示例#1
0
        public override void Destroy(DestroyMode mode = DestroyMode.Vanish)
        {
            UnboardAll();
            storage.TryDropAll(Position, ThingPlaceMode.Near);

            if (mode == DestroyMode.Deconstruct)
            {
                mode = DestroyMode.Kill;
            }
            base.Destroy(mode);
        }
        // apply remaining damage and scatter things in slots, if holder is destroyed
        public override void PostPostApplyDamage(DamageInfo dinfo, float totalDamageDealt)
        {
            if (parent.HitPoints < 0)
            {
                foreach (Thing thing in slots)
                {
                    thing.HitPoints -= (int)totalDamageDealt - parent.HitPoints;
                }

                slots.TryDropAll(parent.Position, ThingPlaceMode.Near);
            }
        }
示例#3
0
        public override void Destroy(DestroyMode mode = DestroyMode.Vanish)
        {
            if (mode == DestroyMode.Deconstruct)
            {
                mode = DestroyMode.Kill;
            }
            else if (explosiveComp != null && explosiveComp.wickStarted)
            {
                storage.ClearAndDestroyContents();
            }

            storage.TryDropAll(Position, ThingPlaceMode.Near);

            base.Destroy(mode);
        }