Add door emag visuals and sound (#6971)

Co-authored-by: fishfish458 <fishfish458>
This commit is contained in:
Fishfish458
2022-03-19 14:00:01 -05:00
committed by GitHub
parent 16b80e6f85
commit 4500f88737
6 changed files with 57 additions and 5 deletions

View File

@@ -135,6 +135,11 @@ public abstract class SharedDoorSystem : EntitySystem
door.NextStateChange = GameTiming.CurTime + door.DenyDuration;
break;
case DoorState.Emagging:
_activeDoors.Add(door);
door.NextStateChange = GameTiming.CurTime + door.EmagDuration;
break;
case DoorState.Open:
case DoorState.Closed:
door.Partial = false;
@@ -352,7 +357,7 @@ public abstract class SharedDoorSystem : EntitySystem
SetCollidable(uid, true, door, physics);
door.NextStateChange = GameTiming.CurTime + door.CloseTimeTwo;
_activeDoors.Add(door);
// Crush any entities. Note that we don't check airlock safety here. This should have been checked before
// the door closed.
Crush(uid, door, physics);
@@ -579,6 +584,10 @@ public abstract class SharedDoorSystem : EntitySystem
SetState(door.Owner, DoorState.Closed, door);
break;
case DoorState.Emagging:
StartOpening(door.Owner, door);
break;
case DoorState.Open:
// This door is open, and queued for an auto-close.
if (!TryClose(door.Owner, door, predicted: true))