예제 #1
0
        public void Attack(Samurai_Yuri enemy)
        {
            // use a SWITCH statement to perform the attack
            int damage;

            switch (ChooseAttack())
            {
            case AttackType.Judo:
                // 70% chance to hit
                if (rng.Next(0, 11) > 3)
                {
                    damage = rng.Next(15, 31);
                    //deal damge to enemy
                    enemy.HP -= damage;
                    // write output to the user
                    Console.WriteLine("{0} deals {1} delt damage to {2}JUDO CHOP!!", this.Name, damage, enemy.Name);
                }
                else
                {
                    Console.WriteLine("{0} missed {1} with the Judo Chop!", this.Name, enemy.Name);
                }

                break;

            case AttackType.Teeth:
                damage    = rng.Next(5, 16);
                enemy.HP -= damage;
                Console.WriteLine("{0} deals {1} delt damage to {2} with the grossest looking teeth ever seen.", this.Name, damage, enemy.Name);
                break;

            case AttackType.MoJo:
                // heals for 10 - 20
                int amountToHealPlayer = rng.Next(10, 21);
                this.HP += amountToHealPlayer;
                Console.WriteLine("{0} was healed for {1} HP. Yeah baby Yeah!", this.Name, amountToHealPlayer);
                break;

            default:
                break;
            }
        }
예제 #2
0
 public Game()
 {
     this.Player = new Player("Austin Powers", 100);
     this.Enemy  = new Samurai_Yuri("Sexy Samurai", 200);
 }