public void StoryClean() { IsContaminated = false; RadiationIn = RadiationTakes + 1; RadiationMarker.SetActive(false); }
private void HandleExpousere() { HandleExpousereTimeStep -= Time.deltaTime; if (HandleExpousereTimeStep < 0) { HandleExpousereTimeStep = 1; //sim update env once a sec if (!(VoidTakes < VoidIn)) {//is beign exposed to void for first time VoidIn -= HandleExpousereTimeStep; if (VoidIn <= 0) { VoidIn = VoidTakes + 1; IsVoid = true; VoidMarker.SetActive(true); GameMaster.WriteInConsole.Add("SYS: Room " + gameObject.name + " is now void\n"); } } if (!(RadiationTakes < RadiationIn)) {//is beign exposed to radiation for first time RadiationIn -= HandleExpousereTimeStep; if (RadiationIn <= 0) { RadiationIn = RadiationTakes + 1; IsContaminated = true; RadiationMarker.SetActive(true); GameMaster.WriteInConsole.Add("SYS: Room " + gameObject.name + " is now contaminated\n"); } } //update clocks if needed RecursiveCheckMarker = false; RecursiveQuick = false; //reset values if needed; if ((IsVoid || IsContaminated) && responsibleOne != null) //it there reason to care and is there source? { if (!responsibleOne.open) //is source of this mess closed? { if (RecursiveExpousureCheckCaller(out var room, out var airlock)) { room.QuickExpand(airlock); } else { QuickClean(); responsibleOne = null; } } } //check if hole sealed if (IsVoid || IsContaminated) { Doors.ForEach(door => { var script = door.GetComponent <DoorsScript>(); if (!script.airlock && script.open) { script.roomA.GetComponent <RoomScript>().Exposed(IsVoid, IsContaminated, script); script.roomB.GetComponent <RoomScript>().Exposed(IsVoid, IsContaminated, script); } }); } //expand if posible (after check so that noting weird can happen if was source) } }