public override ISpell GenerateAttack() { var attack = new Stomp(this.Unit.AttackPoints); if (this.Unit.EnergyPoints < attack.EnergyCost) { throw new NotEnoughEnergyException(string.Format( GlobalMessages.NotEnoughEnergy, this.Unit.Name, attack.GetType().Name)); } this.Unit.EnergyPoints -= attack.EnergyCost; this.Unit.AttackPoints += AfterAttackBonus; return(attack); }
public override ISpell GenerateAttack() { var attack = new Stomp(this.Unit.AttackPoints); if (this.Unit.EnergyPoints < attack.EnergyCost) { throw new NotEnoughEnergyException(string.Format( GlobalMessages.NotEnoughEnergy, this.Unit.Name, attack.GetType().Name)); } this.Unit.EnergyPoints -= attack.EnergyCost; this.Unit.AttackPoints += AfterAttackBonus; return attack; }
public override ISpell GenerateAttack() { Spell spell = new Stomp(); if (this.Unit.EnergyPoints < spell.EnergyCost) { throw new NotEnoughEnergyException(string.Format( GlobalMessages.NotEnoughEnergy, this.Unit.Name, spell.GetType().Name)); } this.Unit.EnergyPoints -= spell.EnergyCost; spell.Damage = this.Unit.AttackPoints; this.Unit.AttackPoints += 5; return(spell); }
public override ISpell GenerateAttack() { ISpell currentSpell = new Stomp(this.Unit.AttackPoints); if (this.Unit.EnergyPoints < currentSpell.EnergyCost) { throw new NotEnoughEnergyException( string.Format( GlobalMessages.NotEnoughEnergy, this.Unit.Name, currentSpell.GetType().Name)); } this.Unit.EnergyPoints -= currentSpell.EnergyCost; this.Unit.AttackPoints += AdditionalAttackPoints; return currentSpell; }
public override ISpell GenerateAttack() { ISpell currentSpell = new Stomp(this.Unit.AttackPoints); if (this.Unit.EnergyPoints < currentSpell.EnergyCost) { throw new NotEnoughEnergyException( string.Format( GlobalMessages.NotEnoughEnergy, this.Unit.Name, currentSpell.GetType().Name)); } this.Unit.EnergyPoints -= currentSpell.EnergyCost; this.Unit.AttackPoints += AdditionalAttackPoints; return(currentSpell); }
public override ISpell GenerateAttack() { var stomp = new Stomp(this.Unit.AttackPoints); this.Unit.AttackPoints += IceGiantAttackPointsIncreaseOnAttack; if (this.Unit.EnergyPoints < stomp.EnergyCost) { throw new NotEnoughEnergyException(string.Format( GlobalMessages.NotEnoughEnergy, this.Unit.Name, stomp.GetType().Name )); } this.Unit.EnergyPoints -= stomp.EnergyCost; return stomp; }
public override ISpell GenerateAttack() { ISpell spell = null; int damage = (this.Unit.AttackPoints); spell = new Stomp(damage); if (this.Unit.EnergyPoints >= spell.EnergyCost) { this.Unit.EnergyPoints -= spell.EnergyCost; this.Unit.AttackPoints += 5; return(spell); } throw new NotEnoughEnergyException(string.Format(Messages.NotEnoughEnergyException, this.Unit.Name, spell.GetType().Name)); }