diff options
Diffstat (limited to 'Client/Assembly-CSharp/MapRoom.cs')
-rw-r--r-- | Client/Assembly-CSharp/MapRoom.cs | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/Client/Assembly-CSharp/MapRoom.cs b/Client/Assembly-CSharp/MapRoom.cs new file mode 100644 index 0000000..c25469c --- /dev/null +++ b/Client/Assembly-CSharp/MapRoom.cs @@ -0,0 +1,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); + } +} |