From e9ea621b93fbb58d9edfca8375918791637bbd52 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 30 Dec 2020 20:59:04 +0800 Subject: +init --- Client/Assembly-CSharp/MapRoom.cs | 92 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 Client/Assembly-CSharp/MapRoom.cs (limited to 'Client/Assembly-CSharp/MapRoom.cs') 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); + } +} -- cgit v1.1-26-g67d0