Example #1
0
        // Add cards:
        public void gainCard(entity.type t)
        {
            entity c;

            switch (t)
            {
            case entity.type.archer:
                c = new archer();
                break;

            case entity.type.militia:
                c = new militia();
                break;

            case entity.type.spearman:
                c = new spearman();
                break;

            case entity.type.scout:
                c = new scout();
                break;

            default:
                c = new entity();
                break;
            }

            deck.Enqueue(c);
        }
Example #2
0
        public override void attack(entity enemy)
        {
            // Calculate
            int bonus = 0;
            //if (enemy.mods.Contains(mod.range)) { bonus += 5; } // needs bonus?
            int d = getDamage(damage + bonus, enemy.meleeArmor);

            // Apply damage
            enemy.HP -= d;
            if (enemy.HP < 0)
            {
                enemy.HP = 0;
            }
        }
Example #3
0
        public override void attack(entity enemy)
        {
            // Calculate
            int bonus = 0;

            if (enemy.mods.Contains(mod.pike))
            {
                bonus += 5;
            }
            int d = getDamage(damage + bonus, enemy.pierceArmor);

            // Apply damage
            enemy.HP -= d;
            if (enemy.HP < 0)
            {
                enemy.HP = 0;
            }
        }
Example #4
0
 // Attacking & Defending
 public virtual void attack(entity enemy)
 {
 }