summaryrefslogtreecommitdiff
path: root/Client/Assembly-CSharp/InfectedOverlay.cs
blob: 53d79424022a131a7032a17edd1126d905455469 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
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();
		}
	}
}