mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-18 05:59:03 +03:00
## Mirror of PR #22962: [Landmine stepoff](https://github.com/space-wizards/space-station-14/pull/22962) from <img src="https://avatars.githubusercontent.com/u/10567778?v=4" alt="space-wizards" width="22"/> [space-wizards](https://github.com/space-wizards)/[space-station-14](https://github.com/space-wizards/space-station-14) ###### `54dd273f660d6d8d523d0771bb8d8437373b082e` PR opened by <img src="https://avatars.githubusercontent.com/u/59531932?v=4" width="16"/><a href="https://github.com/YuriyKiss"> YuriyKiss</a> at 2023-12-25 12:38:55 UTC --- PR changed 13 files with 95 additions and 47 deletions. The PR had the following labels: - Status: Awaiting Changes --- <details open="true"><summary><h1>Original Body</h1></summary> > ## About the PR > Landmine will explode when player steps off it. Landmine will make a sound effect when player steps on it > Close #21658 (Issue has some other suggestions, turn them into separate issues if relevant) > > Requires https://github.com/space-wizards/RobustToolbox/pull/4883 > > ## Why / Balance > IRL some landmines will only trigger after you release the pressure put on them. > > ## Technical details > There are two landmine modes now, one will make landmine trigger immediately after player steps on them another one will only trigger after player steps off the landmine (this is the default now). > > ## Media > Landmine stepoff in action: > > https://github.com/space-wizards/space-station-14/assets/59531932/6e884619-7217-4301-bd78-6e843e0d78f1 > > - [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** > - tweak: landmines will trigger after you step off them > - add: landmine trigger sound > </details> Signed-off-by: VMSolidus <evilexecutive@gmail.com> Co-authored-by: SimpleStation14 <Unknown> Co-authored-by: VMSolidus <evilexecutive@gmail.com>
68 lines
2.1 KiB
C#
68 lines
2.1 KiB
C#
using Content.Shared.StepTrigger.Systems;
|
|
using Content.Shared.Whitelist;
|
|
using Robust.Shared.GameStates;
|
|
|
|
namespace Content.Shared.StepTrigger.Components;
|
|
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
|
|
[Access(typeof(StepTriggerSystem))]
|
|
public sealed partial class StepTriggerComponent : Component
|
|
{
|
|
/// <summary>
|
|
/// List of entities that are currently colliding with the entity.
|
|
/// </summary>
|
|
[ViewVariables, AutoNetworkedField]
|
|
public HashSet<EntityUid> Colliding = new();
|
|
|
|
/// <summary>
|
|
/// The list of entities that are standing on this entity,
|
|
/// which shouldn't be able to trigger it again until stepping off.
|
|
/// </summary>
|
|
[ViewVariables, AutoNetworkedField]
|
|
public HashSet<EntityUid> CurrentlySteppedOn = new();
|
|
|
|
/// <summary>
|
|
/// Whether or not this component will currently try to trigger for entities.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public bool Active = true;
|
|
|
|
/// <summary>
|
|
/// Ratio of shape intersection for a trigger to occur.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public float IntersectRatio = 0.3f;
|
|
|
|
/// <summary>
|
|
/// Entities will only be triggered if their speed exceeds this limit.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public float RequiredTriggeredSpeed = 3.5f;
|
|
|
|
/// <summary>
|
|
/// If any entities occupy the blacklist on the same tile then steptrigger won't work.
|
|
/// </summary>
|
|
[DataField]
|
|
public EntityWhitelist? Blacklist;
|
|
|
|
/// <summary>
|
|
/// If this is true, steptrigger will still occur on entities that are in air / weightless. They do not
|
|
/// by default.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public bool IgnoreWeightless;
|
|
|
|
/// <summary>
|
|
/// Does this have separate "StepOn" and "StepOff" triggers.
|
|
/// </summary>
|
|
[DataField, AutoNetworkedField]
|
|
public bool StepOn = false;
|
|
}
|
|
|
|
[RegisterComponent]
|
|
[Access(typeof(StepTriggerSystem))]
|
|
public sealed partial class StepTriggerActiveComponent : Component
|
|
{
|
|
|
|
}
|