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