Simple-Station / Einstein-Engines

A Space Station 14 upstream repository, inspired by Baystation12.
https://einstein.simplestation.org
GNU Affero General Public License v3.0
28 stars 55 forks source link

Mirror: Fix bypassing vaulting clumsy check with verb action. #314

Closed SimpleStation14 closed 1 month ago

SimpleStation14 commented 2 months ago

Mirror of PR #24977: Fix bypassing vaulting clumsy check with verb action. from space-wizards space-wizards/space-station-14

225bc3c5aeffbef6286b607b02cd24a8ad75a437

PR opened by Tayrtahn at 2024-02-05 21:32:50 UTC


PR changed 7 files with 101 additions and 39 deletions.

The PR had the following labels:


Original Body

> > > > ## About the PR > > Stops clumsy characters being able to climb/vault onto tables and such by using alt-click or the verb menu instead of drag-dropping. > > This also fixes a separate bug where, when a clumsy character managed to pass the bonk check, the action would just cancel and the character didn't actually climb the object. Passing the check will now let the character climb. > > Additionally, this fixes a oddity where the ability for mobs to climb was determined by whether or not they had feet/legs, which was arbitrary and problematic for creatures like slimes (which should be able to ooze up onto a table). This check could also be bypassed by using the verb instead of drag-dropping, so that was fixed too. The ability for mobs to climb is now controlled in the prototypes. > > The default chance of a clumsy character bonking on a climbable has also been reduced from 75% to 50% to compensate somewhat. > > ## Why / Balance > > Fixes #24951 > Fixes #17423 > Fixes #25951 > > ## Technical details > > ClimbSystem now raises AttemptClimbEvent as part of TryClimb, and aborts climbing if it gets cancelled. This makes sure that all code paths go through a clumsy check. BonkSystem now listens for AttemptClimbEvents and responds to them instead of trying to intercept DragDropEvents. > CanVault now gets checked in TryClimb as well, to prevent bypassing it. > > The logic for climbing capabilities is now: > - The presence of ClimbingComponent makes an entity able to be placed on surfaces like tables. > - ClimbingComponent.CanClimb controls whether it can climb onto surfaces by drag-drop or verb. > > The new field defaults to true to minimize changes to existing behavior. Some mobs will have gained the ability to climb when previously they couldn't, but that should be less impactful than the opposite and can be resolved by YML changes in the future. > > ## Media > > > - [x] I have added screenshots/videos to this PR showcasing its changes ingame, **or** this PR does not require an ingame showcase > > ## Breaking changes > > > > **Changelog** > > > > :cl: > - fix: Clumsy characters can no longer avoid bonking their heads by using the Climb verb. > - tweak: Clumsy characters are less likely to bonk their heads when trying to climb.