Deprecate IActionBlocker ChangeDirectionAttempt (#4851)

* Deprecate IActionBlocker ChangeDirectionAttempt

* Woops
This commit is contained in:
metalgearsloth
2021-10-13 13:14:30 +11:00
committed by GitHub
parent 31208c2636
commit 7fe7c46373
10 changed files with 22 additions and 44 deletions

View File

@@ -1,4 +1,5 @@
using Content.Shared.Damage;
using Content.Shared.Interaction.Events;
using Content.Shared.MobState.Components;
using Content.Shared.MobState.State;
using Content.Shared.Movement;
@@ -14,6 +15,7 @@ namespace Content.Shared.MobState.EntitySystems
{
base.Initialize();
SubscribeLocalEvent<MobStateComponent, ChangeDirectionAttemptEvent>(OnChangeDirectionAttempt);
SubscribeLocalEvent<MobStateComponent, StartPullAttemptEvent>(OnStartPullAttempt);
SubscribeLocalEvent<MobStateComponent, DamageChangedEvent>(UpdateState);
SubscribeLocalEvent<MobStateComponent, MovementAttemptEvent>(OnMoveAttempt);
@@ -21,6 +23,17 @@ namespace Content.Shared.MobState.EntitySystems
// Note that there's no check for Down attempts because if a mob's in crit or dead, they can be downed...
}
private void OnChangeDirectionAttempt(EntityUid uid, MobStateComponent component, ChangeDirectionAttemptEvent args)
{
switch (component.CurrentState)
{
case SharedDeadMobState:
case SharedCriticalMobState:
args.Cancel();
break;
}
}
private void OnStartPullAttempt(EntityUid uid, MobStateComponent component, StartPullAttemptEvent args)
{
if(component.IsIncapacitated())