Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force Smokebombs into the Pike/Banner/ExtraWeapon slot #311

Open
Meowkov opened this issue Mar 12, 2024 · 3 comments
Open

Force Smokebombs into the Pike/Banner/ExtraWeapon slot #311

Meowkov opened this issue Mar 12, 2024 · 3 comments
Assignees
Labels
area/web-ui enhancement New feature or request

Comments

@Meowkov
Copy link
Collaborator

Meowkov commented Mar 12, 2024

Currently Smokebombs can be equipped in every weapon slot, this allows for up to 4 smoke bombs to be equipped by each player.

We want to restrict the the smoke bombs to the ExtraWeapon / Pike / Banner slot to make it a decision if you bring a smoke bomb or another ExtraWeapon slot item and reduce the overall amount of smoke bombs that can be active at the same time.

Since smoke bombs are setups like stones the best way to lock them to the slots could be part of the item id as filter.
crpg_smokebomb_

@Meowkov Meowkov added the enhancement New feature or request label Mar 12, 2024
@Muparadzi
Copy link
Collaborator

Maybe something like this:

weapons.xml - note the additional flag, I'm not sure if we can add our own custom flags however

  <Item id="crpg_smokebomb_h0" name="{=Meow}Smokebomb" is_merchandise="false" body_name="bo_throwing_stone" holster_body_name="bo_axe_short" holster_mesh="stone_holster" holster_mesh_with_weapon="stone_holster" mesh="torch_flame_base" weight="0.1" appearance="0.1" Type="Thrown" item_holsters="throwing_stone:throwing_stone_2">
    <ItemComponent>
      <Weapon weapon_class="Stone" ammo_class="Stone" stack_amount="1" physics_material="smokebomb_h0" accuracy="100" thrust_speed="102" speed_rating="102" missile_speed="40" weapon_length="15" thrust_damage="7" item_usage="stone" rotation="100,30,20" trail_particle_name="smokebomb_h0" passby_sound_code="" rotation_speed="0, -3.0, 0">
        <WeaponFlags RangedWeapon="true" Consumable="true" AutoReload="true" UnloadWhenSheathed="true" UseHandAsThrowBase="true" AmmoBreaksOnBounceBack="true" LeavesTrail="true" />
      </Weapon>
    </ItemComponent>
    <Flags>
      <Flag name="ExtraWeaponSlot" type="ItemFlags" />
    </Flags>
  </Item>

item-service.ts

  if (item.flags.includes(ItemFlags.ExtraWeaponSlot)) {
  return [ItemSlot.WeaponExtra];
}

@Meowkov
Copy link
Collaborator Author

Meowkov commented Mar 12, 2024

I think Flags are validated by BL and throw errors if they are unknown but I am not a 100% on that since lots of things changed with 1.2.
If we could make it a working flag so the game can deal with it, that sure would be a great addition for utility items like deployable stakes or siege shields at some point.

@Muparadzi
Copy link
Collaborator

ExtraWeapon is designed for weapons which have either tags: ItemFlags.DropOnWeaponChange | ItemFlags.DropOnAnyAction

You cannot 'swap' back to an extra weapon slot, as you equip the item when you first spawn and it is not designed for items which are not dropped when swapped away from.

Perhaps we can prevent players from equipping the same item twice, but keep it in the normal weapon slot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/web-ui enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants