summaryrefslogtreecommitdiff
path: root/Client/Assembly-CSharp/InfectedOverlay.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Assembly-CSharp/InfectedOverlay.cs')
-rw-r--r--Client/Assembly-CSharp/InfectedOverlay.cs51
1 files changed, 51 insertions, 0 deletions
diff --git a/Client/Assembly-CSharp/InfectedOverlay.cs b/Client/Assembly-CSharp/InfectedOverlay.cs
new file mode 100644
index 0000000..53d7942
--- /dev/null
+++ b/Client/Assembly-CSharp/InfectedOverlay.cs
@@ -0,0 +1,51 @@
+using System;
+using UnityEngine;
+
+public class InfectedOverlay : MonoBehaviour
+{
+ public bool CanUseDoors
+ {
+ get
+ {
+ return !this.SabSystem.AnyActive;
+ }
+ }
+
+ public bool CanUseSpecial
+ {
+ get
+ {
+ return this.SabSystem.Timer <= 0f && !this.doors.IsActive && !this.SabSystem.AnyActive;
+ }
+ }
+
+ public MapRoom[] rooms;
+
+ private IActivatable doors;
+
+ private SabotageSystemType SabSystem;
+
+ public void Start()
+ {
+ for (int i = 0; i < this.rooms.Length; i++)
+ {
+ this.rooms[i].Parent = this;
+ }
+ this.SabSystem = (SabotageSystemType)ShipStatus.Instance.Systems[SystemTypes.Sabotage];
+ this.doors = (IActivatable)ShipStatus.Instance.Systems[SystemTypes.Doors];
+ }
+
+ private void FixedUpdate()
+ {
+ if (this.doors == null)
+ {
+ return;
+ }
+ float specialActive = this.doors.IsActive ? 1f : this.SabSystem.PercentCool;
+ for (int i = 0; i < this.rooms.Length; i++)
+ {
+ this.rooms[i].SetSpecialActive(specialActive);
+ this.rooms[i].OOBUpdate();
+ }
+ }
+}