Landmine stepoff (#22962)

* make landmine work on stepping off

* update methods naming

* made both step modes possible

* updated stepoff event raise to not interfere with game physics internals

* added comments

* figuring out how audiosystem works

* added beep sound effect, updated how stepoff trigger works to make it more consistent

* updated source in attributions.yml

* made stepoff working every time

* introduced suggested changes

* updated janitor's WetSignMine to have audio

* made cleaner events and bashing my head at OnEndCollide event raise

* inverted conditional where applicable

* review

---------

Co-authored-by: Yurii Kis <yurii.kis@smartteksas.com>
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
KISS
2024-03-24 07:33:45 +02:00
committed by GitHub
parent f96cf360e9
commit 54dd273f66
13 changed files with 97 additions and 49 deletions

View File

@@ -24,7 +24,7 @@ public sealed class ChasmSystem : EntitySystem
{
base.Initialize();
SubscribeLocalEvent<ChasmComponent, StepTriggeredEvent>(OnStepTriggered);
SubscribeLocalEvent<ChasmComponent, StepTriggeredOffEvent>(OnStepTriggered);
SubscribeLocalEvent<ChasmComponent, StepTriggerAttemptEvent>(OnStepTriggerAttempt);
SubscribeLocalEvent<ChasmFallingComponent, UpdateCanMoveEvent>(OnUpdateCanMove);
}
@@ -47,7 +47,7 @@ public sealed class ChasmSystem : EntitySystem
}
}
private void OnStepTriggered(EntityUid uid, ChasmComponent component, ref StepTriggeredEvent args)
private void OnStepTriggered(EntityUid uid, ChasmComponent component, ref StepTriggeredOffEvent args)
{
// already doomed
if (HasComp<ChasmFallingComponent>(args.Tripper))