public int Attack(IDefendable defender) { this.isAttacking = true; this.color = Color.Red; return defender.Defend(this); }
/// <summary> /// Attacks the defender /// </summary> /// <param name="defender">Entity to be attacked</param> /// <returns>Damage done</returns> public int Attack(IDefendable defender) { //this.isAttacking = true; // controls state, should be fsm this.color = attack_color; // should be animation return defender.Defend(this); // the defender modifies its own HP using this entity's damage }
/// <summary> /// Attacks the defender /// </summary> /// <param name="defender">Entity to be attacked</param> /// <returns>Damage done</returns> protected int attack(IDefendable defender) { this.isActive = true; // controls state, should be fsm //this.entity = attack_color; // should be animation return defender.Defend(this.entity_attack); // the defender modifies its own HP using this entity's damage }
public int Attack(IDefendable defender) { this.isAttacking = true; this.color = Color.Red; int result = defender.Defend(this); if (defender.HP <= 0) { this.kills++; this.Damage = this.Damage + kills; this.HP = 100; this.color = Color.Yellow; } return result; }
public int Attack(IDefendable defender) { this.isAttacking = true; return defender.Defend(this); }