-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Description I made this PR in response to a bug report from Floof, where it was discovered that a "Minimum Size Felinid or Harpy" is instantaneously killed by mouse traps. Which confused me, because Felinids and Harpies are intended to be immune to floor traps like landmines, glass, and mouse traps. Then I discovered that mouse traps overwrite the step trigger cancellation, meaning that mouse traps will just completely ignore a Felinid/Harpy canceling the step trigger. Additionally, to my endless frustration, the Felinid/Harpy floor trap immunity is handled by a Tag and not a Component, which isn't really acceptable in this day and age. I decided to take a little bit of a different approach to this problem, first by doing the usual code cleanup to EE standards. Then by adding a new StepTriggerImmuneComponent. This component acts as an early-exit for the entire StepTriggerSystem, immediately at the initial entrypoint, during the CanTrigger bool. This component is given to Felinids and Harpies by default, representing their "Extremely low density bodies" having too much surface area and not enough mass to trigger floor traps. Effectively, they are now working as originally intended, by having immunity to setting off landmines. Because we have a trait point system, and this is coincidentally also a trait requested by Nuclear14, I have gone ahead and created a Trait that gives this component to anyone willing to pay the points for it. # Changelog :cl: - fix: Felinids and Harpies will now correctly never set off floor traps, such as landmines and mouse traps. - add: Trap Avoider has been added as a new trait, allowing characters to buy the innate ability to avoid floor traps. I would have named this "Light Step", after the trait from Fallout that shares its name and effect, but someone already gave that name to a different trait entirely. --------- Signed-off-by: VMSolidus <[email protected]> Co-authored-by: DEATHB4DEFEAT <[email protected]>
- Loading branch information
1 parent
058650e
commit d0c5110
Showing
7 changed files
with
66 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
Content.Shared/StepTrigger/Components/StepTriggerImmuneComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using Robust.Shared.GameStates; | ||
|
||
namespace Content.Shared.StepTrigger.Components; | ||
|
||
/// <summary> | ||
/// This component marks an entity as being immune to all step triggers. | ||
/// For example, a Felinid or Harpy being so low density, that they don't set off landmines. | ||
/// </summary> | ||
/// <remarks> | ||
/// This is the "Earliest Possible Exit" method, and therefore isn't possible to un-cancel. | ||
/// It will prevent ALL step trigger events from firing. Therefore there may sometimes be unintended consequences to this. | ||
/// Consider using a subscription to StepTriggerAttemptEvent if you wish to be more selective. | ||
/// </remarks> | ||
[RegisterComponent, NetworkedComponent] | ||
public sealed partial class StepTriggerImmuneComponent : Component { } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -118,6 +118,7 @@ | |
understands: | ||
- GalacticCommon | ||
- SolCommon | ||
- type: StepTriggerImmune | ||
|
||
- type: entity | ||
save: false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters