public static bool HandleSabotage(MapRoom Map, SabotageType Type) { foreach (var Role in Role.ROLES) { if (Role.ActivateSabotage(Map, Type)) { // If that role handles sabotage activation then cancel default return(false); } } return(true); }
public override bool ActivateSabotage(MapRoom Map, SabotageType Type) { if (!IsLocalPlayer()) { return(false); } if (PlayerControl.LocalPlayer.Data.IsDead) { return(true); } if (RepairUsed || !SabotageActive) { return(true); } RepairUsed = true; // ReSharper disable once SwitchStatementMissingSomeEnumCasesNoDefault switch (Type) { case SabotageType.Lights: SabotageCentralPatch.FixLights(); ExtraNetwork.Send(CustomRPC.FixLights); break; case SabotageType.Reactor: ShipStatus.Instance.RpcRepairSystem(SystemTypes.Reactor, 16); break; case SabotageType.Comms: ShipStatus.Instance.RpcRepairSystem(SystemTypes.Comms, 16 | 0); ShipStatus.Instance.RpcRepairSystem(SystemTypes.Comms, 16 | 1); break; case SabotageType.Oxygen: ShipStatus.Instance.RpcRepairSystem(SystemTypes.LifeSupp, 0 | 64); ShipStatus.Instance.RpcRepairSystem(SystemTypes.LifeSupp, 1 | 64); break; case SabotageType.Seismic: ShipStatus.Instance.RpcRepairSystem(SystemTypes.Laboratory, 16); break; } return(true); }
public virtual bool ActivateSabotage(MapRoom Map, SabotageType Type) { return(false); }
//Tells the game that the sabotage has been fixed public void StopSabatage(SabotageType st) { sabotages[(int)st].FixSabotage(); }