void IDemolishable.Demolish(Actor self, Actor saboteur, int delay, BitSet <DamageType> damageTypes) { // TODO: Handle using ITick self.World.Add(new DelayedAction(delay, () => { if (self.IsDead) { return; } var modifiers = self.TraitsImplementing <IDamageModifier>() .Concat(self.Owner.PlayerActor.TraitsImplementing <IDamageModifier>()) .Select(t => t.GetDamageModifier(self, null)); if (Util.ApplyPercentageModifiers(100, modifiers) > 0) { Bridge.Do((b, d) => b.Demolish(saboteur, d, damageTypes)); } })); }
public void Repair(Actor repairer) { repairDirections = Bridge.GetHut(0) != this && Bridge.GetHut(1) != this ? 2 : 1; Bridge.Do((b, d) => b.Repair(repairer, d, () => repairDirections--)); }