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

@@ -25,7 +25,7 @@ public sealed partial class EnsnareableSystem
{
SubscribeLocalEvent<EnsnaringComponent, ComponentRemove>(OnComponentRemove);
SubscribeLocalEvent<EnsnaringComponent, StepTriggerAttemptEvent>(AttemptStepTrigger);
SubscribeLocalEvent<EnsnaringComponent, StepTriggeredEvent>(OnStepTrigger);
SubscribeLocalEvent<EnsnaringComponent, StepTriggeredOffEvent>(OnStepTrigger);
SubscribeLocalEvent<EnsnaringComponent, ThrowDoHitEvent>(OnThrowHit);
SubscribeLocalEvent<EnsnaringComponent, AttemptPacifiedThrowEvent>(OnAttemptPacifiedThrow);
}
@@ -49,7 +49,7 @@ public sealed partial class EnsnareableSystem
args.Continue = true;
}
private void OnStepTrigger(EntityUid uid, EnsnaringComponent component, ref StepTriggeredEvent args)
private void OnStepTrigger(EntityUid uid, EnsnaringComponent component, ref StepTriggeredOffEvent args)
{
TryEnsnare(args.Tripper, uid, component);
}