Allow all door access in Suspicion mode (#1817)

* Add AccessTypes, let RuleSuspicion change it

* Fix enum description

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>

* Move check to CanOpen()

Co-authored-by: DrSmugleaf <DrSmugleaf@users.noreply.github.com>
This commit is contained in:
Visne
2020-08-25 13:37:21 +02:00
committed by GitHub
parent b5a68748ea
commit 318f051fb9
3 changed files with 77 additions and 13 deletions

View File

@@ -1,9 +1,9 @@
using System;
using System.Threading;
using Content.Server.GameObjects.Components.Suspicion;
using Content.Server.GameObjects.EntitySystems;
using Content.Server.Interfaces.Chat;
using Content.Server.Interfaces.GameTicking;
using Content.Server.Mobs;
using Content.Server.Mobs.Roles;
using Content.Server.Players;
using Content.Shared.GameObjects.Components.Damage;
@@ -38,6 +38,8 @@ namespace Content.Server.GameTicking.GameRules
EntitySystem.Get<AudioSystem>().PlayGlobal("/Audio/Misc/tatoralert.ogg", AudioParams.Default,
(session) => session.ContentData().Mind?.HasRole<SuspicionTraitorRole>() ?? false);
EntitySystem.Get<DoorSystem>().AccessType = DoorSystem.AccessTypes.AllowAllNoExternal;
Timer.SpawnRepeating(DeadCheckDelay, _checkWinConditions, _checkTimerCancel.Token);
}
@@ -45,6 +47,8 @@ namespace Content.Server.GameTicking.GameRules
{
base.Removed();
EntitySystem.Get<DoorSystem>().AccessType = DoorSystem.AccessTypes.Id;
_checkTimerCancel.Cancel();
}