public static void CancelCreatedEffects(MechComponent mechComponent, bool performAuraRefresh = true) { if (mechComponent.DamageLevel >= ComponentDamageLevel.NonFunctional) { mechComponent.CancelCreatedEffects(performAuraRefresh); } }
public static void CancelCreatedEffects(this MechComponent @this, bool performAuraRefresh) { if (HeatSinkCapacityStatFeature.Shared.IgnoreShutdown(@this)) { return; } @this.CancelCreatedEffects(performAuraRefresh); }
static void SetDamageLevel(MechComponent mechComponent, WeaponHitInfo hitInfo, ComponentDamageLevel damageLevel) { Control.Logger.Debug?.Log($"damageLevel={damageLevel} uid={mechComponent.uid} (Id={mechComponent.Description.Id} Location={mechComponent.Location})"); mechComponent.StatCollection.ModifyStat( hitInfo.attackerId, hitInfo.stackItemUID, "DamageLevel", StatCollection.StatOperation.Set, damageLevel); if (damageLevel == ComponentDamageLevel.Destroyed) { mechComponent.CancelCreatedEffects(); } }