Beispiel #1
0
        public virtual void Attack(Player hero)
        {
            int hDice = dice.LaunchDice();
            int mDice = dice.LaunchDice();
            if (mDice > hDice)
            {
                hero.TakeDmg(constdmg);
                //return true;
            }

            //return false;
        }
Beispiel #2
0
        public override void Attack(Player hero)
        {
            base.Attack(hero);

            int hDice = dice.LaunchDice();
            int mDice = dice.LaunchDice();
            if (mDice > hDice)
            {
                int spellDmg = MagicAttack();
                hero.TakeDmg(constdmg + spellDmg);
                //return true;
            }
        }
Beispiel #3
0
        private static void jeu()
        {
            Player hero = new Player();
            int scoreMonstreFacile = 0;
            int scoreMonstreDifficile = 0;
            int scorePoints = 0;
            EasyMonster monster;

            while (hero.IsAlive)
            {

                monster = selectRandomMonster();

                while (monster.IsAlive && hero.IsAlive)
                {
                    hero.Attack(monster);

                    if (monster.IsAlive)
                        monster.Attack(hero);
                }

                if (hero.IsAlive)
                {
                    if (monster is EasyMonster)
                    {
                        scoreMonstreFacile++;
                    }
                    else
                    {
                        scoreMonstreDifficile++;
                    }
                }
                else
                {
                    Console.Write("ok you kill " + scoreMonstreFacile + " monstre facile et " + scoreMonstreDifficile + "monstre difficile pour un score de " + scorePoints);
                }
            }
        }