summaryrefslogtreecommitdiff
path: root/Client/Assembly-CSharp/MapRoom.cs
blob: c25469c4215e7849d05e6db9061df2e9180278f7 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
using System;
using UnityEngine;

public class MapRoom : MonoBehaviour
{
	public InfectedOverlay Parent { get; set; }

	public SystemTypes room;

	public SpriteRenderer door;

	public SpriteRenderer special;

	public void Start()
	{
		if (this.door)
		{
			this.door.SetCooldownNormalizedUvs();
		}
		if (this.special)
		{
			this.special.SetCooldownNormalizedUvs();
		}
	}

	public void OOBUpdate()
	{
		if (this.door && ShipStatus.Instance)
		{
			float timer = ((DoorsSystemType)ShipStatus.Instance.Systems[SystemTypes.Doors]).GetTimer(this.room);
			float value = this.Parent.CanUseDoors ? (timer / 30f) : 1f;
			this.door.material.SetFloat("_Percent", value);
		}
	}

	internal void SetSpecialActive(float perc)
	{
		if (this.special)
		{
			this.special.material.SetFloat("_Percent", perc);
		}
	}

	public void SabotageReactor()
	{
		if (!this.Parent.CanUseSpecial)
		{
			return;
		}
		ShipStatus.Instance.RpcRepairSystem(SystemTypes.Sabotage, 3);
	}

	public void SabotageComms()
	{
		if (!this.Parent.CanUseSpecial)
		{
			return;
		}
		ShipStatus.Instance.RpcRepairSystem(SystemTypes.Sabotage, 14);
	}

	public void SabotageOxygen()
	{
		if (!this.Parent.CanUseSpecial)
		{
			return;
		}
		ShipStatus.Instance.RpcRepairSystem(SystemTypes.Sabotage, 8);
	}

	public void SabotageLights()
	{
		if (!this.Parent.CanUseSpecial)
		{
			return;
		}
		ShipStatus.Instance.RpcRepairSystem(SystemTypes.Sabotage, 7);
	}

	public void SabotageDoors()
	{
		if (!this.Parent.CanUseDoors)
		{
			return;
		}
		if (((DoorsSystemType)ShipStatus.Instance.Systems[SystemTypes.Doors]).GetTimer(this.room) > 0f)
		{
			return;
		}
		ShipStatus.Instance.RpcCloseDoorsOfType(this.room);
	}
}