master
← slarticodefast:feat-wieldblocker
opened 12:57PM - 24 May 25 UTC
## About the PR
Purely technical addition, no gameplay changes yet
We already … had a `WieldAttemptEvent`, but it was never used.
When added to a mob `WieldingBlockerComponent` will block them from wielding any item.
When added to a clothing item `WieldingBlockerComponent` will block the wearer from wielding if `BlockEquipped` is true.
When added to an item `WieldingBlockerComponent` and `BlockInHand` is true it will block anyone holding the item from wielding other items, no matter if they have free hands or not.
## Why / Balance
Should be useful in the future.
I'm planning on doing some more playtests with 4-handed arachnids. One of the biggest problems is that they can use shields and wield a gun at the same time, which is a huge combat advantage. Adding a wielding blocker when holding shields would be a simple way to keep this more balanced.
## Technical details
`WieldAttemptEvent` and `UnwieldAttemptEvent` were previously only raised on the item to be wielded. I changed it to be a relay event that gets raised on all inventory and hand items instead (which includes the item since it is held in hand).
We allow the event to add a popup message to tell the player why the wielding failed.
The event was currently not used anywhere.
## Media
How to test:
- use the `addhand` command to give yourself extra hands
- use VV to add `WieldingblockerComponent` to a clothing item and set `BlockInHand` to false
- use VV to add `WieldingblockerComponent` to a shield
https://github.com/user-attachments/assets/1adc27dc-82b2-487f-b360-4eb581d65ac2
## Requirements
- [x] I have read and am following the [Pull Request and Changelog Guidelines](https://docs.spacestation14.com/en/general-development/codebase-info/pull-request-guidelines.html).
- [x] I have added media to this PR or it does not require an ingame showcase.
## Breaking changes
`WieldAttemptEvent` and `UnwieldAttemptEvent` now get raised on wielder and relayed to their inventory and all their held items instead of only on the item to be wielded. If you want to keep the previous functionality, then subscribe to the hand relay event and add a `if (uid == args.Wielded)` check in your subscription.
**Changelog**
no player facing changes
WieldAttemptEvent
and UnwieldAttemptEvent
now get raised on wielder and relayed to their inventory and all their held items instead of only on the item to be wielded. If you want to keep the previous functionality, then subscribe to the hand relay event and add a if (uid == args.Wielded)
check in your subscription.