public void Demolish(Actor saboteur, bool continueNorth, bool continueSouth) { var initialDamage = Health.DamageState; self.World.AddFrameEndTask(w => { Combat.DoExplosion(saboteur, "Demolish", self.CenterPosition); self.World.WorldActor.Trait <ScreenShaker>().AddEffect(15, self.CenterPosition, 6); self.Kill(saboteur); }); // Destroy adjacent spans (long bridges) if (continueNorth && northNeighbour != null) { var delay = initialDamage == DamageState.Dead || NeighbourIsDeadShore(northNeighbour) ? 0 : Info.RepairPropagationDelay; self.World.AddFrameEndTask(w => w.Add(new DelayedAction(delay, () => northNeighbour.Demolish(saboteur, true, false)))); } if (continueSouth && southNeighbour != null) { var delay = initialDamage == DamageState.Dead || NeighbourIsDeadShore(southNeighbour) ? 0 : Info.RepairPropagationDelay; self.World.AddFrameEndTask(w => w.Add(new DelayedAction(delay, () => southNeighbour.Demolish(saboteur, false, true)))); } }
void Detonate() { self.World.AddFrameEndTask(w => { if (info.DetonationWeapon != null) { Combat.DoExplosion(self, info.DetonationWeapon, self.CenterPosition); } self.Kill(self); }); }
public void Killed(Actor self, AttackInfo e) { if (self.World.SharedRandom.Next(100) > self.Info.Traits.Get <ExplodesInfo>().Chance) { return; } var weapon = ChooseWeaponForExplosion(self); if (weapon != null) { var move = self.TraitOrDefault <IMove>(); var altitude = move != null ? move.Altitude : 0; Combat.DoExplosion(e.Attacker, weapon, self.CenterLocation, altitude); } }
public void OnCrush(Actor crusher) { if (crusher.HasTrait <MineImmune>() || self.Owner.Stances[crusher.Owner] == Stance.Ally) { return; } var mobile = crusher.TraitOrDefault <Mobile>(); if (mobile != null && !info.DetonateClasses.Intersect(mobile.Info.Crushes).Any()) { return; } Combat.DoExplosion(self, info.Weapon, crusher.CenterLocation, 0); self.QueueActivity(new RemoveSelf()); }
public void Tick(Actor self) { if (!deployed) { return; } if (++tick >= info.ThumpInterval) { if (info.ThumpDamageWeapon != null) { Combat.DoExplosion(self, info.ThumpDamageWeapon, self.CenterPosition); } screenShaker.AddEffect(info.ThumpShakeTime, self.CenterPosition, info.ThumpShakeIntensity, info.ThumpShakeMultiplier); tick = 0; } }
public void Killed(Actor self, AttackInfo e) { if (self.World.SharedRandom.Next(100) > Info.Chance) { return; } if (Info.InfDeath != null && e.Warhead != null && !Info.InfDeath.Contains(e.Warhead.InfDeath)) { return; } var weapon = ChooseWeaponForExplosion(self); if (weapon != null) { Combat.DoExplosion(e.Attacker, weapon, self.CenterPosition); } }
public void Detonate(Actor self, Actor detonatedBy) { var move = self.TraitOrDefault <IMove>(); var info = self.Info.Traits.Get <AttackBaseInfo>(); var altitude = move != null ? move.Altitude : 0; self.World.AddFrameEndTask(w => { if (self.Destroyed) { return; } Combat.DoExplosion(self, info.PrimaryWeapon, self.CenterLocation, altitude); // Remove from world self.Kill(self); detonatedBy.Owner.Kills++; self.Owner.Deaths++; self.Destroy(); }); }
public void Killed(Actor self, AttackInfo e) { if (self.World.SharedRandom.Next(100) > Info.Chance) { return; } if (Info.InfDeath != null && e.Warhead != null && !Info.InfDeath.Contains(e.Warhead.InfDeath)) { return; } var weapon = ChooseWeaponForExplosion(self); if (weapon != null) { var move = self.TraitOrDefault <IMove>(); var altitude = move != null ? move.Altitude : 0; Combat.DoExplosion(e.Attacker, weapon, self.CenterLocation, altitude); } }
public override void Activate(Actor collector) { Combat.DoExplosion(self, ((ExplodeCrateActionInfo)info).Weapon, collector.CenterPosition); base.Activate(collector); }
public override void Activate(Actor collector) { Combat.DoExplosion(self, (info as ExplodeCrateActionInfo).Weapon, collector.CenterLocation, 0); base.Activate(collector); }