private void Attack(int amount, ThreatDamageType threatDamageType, IList <ZoneLocation> zoneLocations) { var bonusAttacks = sittingDuck.CurrentThreatBuffs.Values.Count(buff => buff == ExternalThreatBuff.BonusAttack); var damage = new ThreatDamage(amount + bonusAttacks, threatDamageType, zoneLocations); var result = sittingDuck.TakeAttack(damage); if (result.ShipDestroyed) { throw new LoseException(this); } }
protected int AttackSpecificZones(int amount, IList <ZoneLocation> zones, ThreatDamageType?threatDamageType = null) { var damageShielded = 0; foreach (var zoneLocation in zones) { AmountAttackingFor = amount; ZoneUnderAttack = zoneLocation; EventMaster.LogEvent("Attacking"); var bonusAttacks = GetThreatStatus(ThreatStatus.BonusAttack) ? 1 : 0; var damage = new ThreatDamage(amount + bonusAttacks, threatDamageType ?? StandardDamageType, zoneLocation, DamageDistanceToSource); AttackedSittingDuck(this, new ThreatDamageEventArgs { ThreatDamage = damage }); damageShielded += damage.DamageShielded; } AmountAttackingFor = null; EventMaster.LogEvent("Done Attacking"); return(damageShielded); }
private void Attack(int amount, ThreatDamageType threatDamageType, IList<ZoneLocation> zoneLocations) { var bonusAttacks = sittingDuck.CurrentThreatBuffs.Values.Count(buff => buff == ExternalThreatBuff.BonusAttack); var damage = new ThreatDamage(amount + bonusAttacks, threatDamageType, zoneLocations); var result = sittingDuck.TakeAttack(damage); if (result.ShipDestroyed) throw new LoseException(this); }