public static bool Prefix(MechShutdownSequence __instance) { try { var mech = __instance.OwningMech; var receiveShutdownInjury = __instance.Combat.Constants.Heat.ShutdownCausesInjury || mech.StatCollection.ReceiveShutdownInjury().Get(); if (receiveShutdownInjury && mech.IsOverheated) { var sourceID = __instance.instigatorGUID; var stackItemUID = __instance.RootSequenceGUID; ShutdownInjuryProtectionFeature.SetInjury(mech, sourceID, stackItemUID); } return(false); } catch (Exception e) { Control.Logger.Error.Log(e); } return(true); }
public static void Prefix(Mech __instance, int stackID, string attackerID) { try { var mech = __instance; if (!mech.StatCollection.ReceiveHeatDamageInjury().Get()) { return; } ShutdownInjuryProtectionFeature.SetInjury(mech, attackerID, stackID); } catch (Exception e) { Control.Logger.Error.Log(e); } }
public static void Prefix(Mech __instance, string sourceID, int stackItemID) { try { var mech = __instance; if (mech.HasActivatedThisRound) { return; } if (!mech.StatCollection.ReceiveOverheatedOnActivationEndInjury().Get()) { return; } ShutdownInjuryProtectionFeature.SetInjury(mech, sourceID, stackItemID); } catch (Exception e) { Control.Logger.Error.Log(e); } }