public static void CancelCreatedEffects(MechComponent mechComponent, bool performAuraRefresh = true)
 {
     if (mechComponent.DamageLevel >= ComponentDamageLevel.NonFunctional)
     {
         mechComponent.CancelCreatedEffects(performAuraRefresh);
     }
 }
Example #2
0
 public static void CancelCreatedEffects(this MechComponent @this, bool performAuraRefresh)
 {
     if (HeatSinkCapacityStatFeature.Shared.IgnoreShutdown(@this))
     {
         return;
     }
     @this.CancelCreatedEffects(performAuraRefresh);
 }
Example #3
0
            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();
                }
            }