Ejemplo n.º 1
0
        public int Attack(IDefendable defender)
        {
            this.isAttacking = true;
            this.color = Color.Red;

            return defender.Defend(this);
        }
Ejemplo n.º 2
0
        /// <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
        }
Ejemplo n.º 3
0
        /// <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
        }
Ejemplo n.º 4
0
        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;
        }
Ejemplo n.º 5
0
        public int Attack(IDefendable defender)
        {
            this.isAttacking = true;

            return defender.Defend(this);
        }