Beispiel #1
0
        private void process()
        {
            Monster tmp = currentMap.checkMonsterHealth();

            if (tmp != null)
            {
                player.addXP(tmp.getLevel());
                textBox.Add(tmp.getName() + " falls to your might!");
            }

            for (int i = 0; i < currentMap.getMonsters().Length; i++)
            {
                if (currentMap.moveAndCheckAttack(i, player.getPlayerX(), player.getPlayerY()))
                {
                    Object[] temp    = currentMap.getMonsters();
                    Monster  monTemp = (Monster)temp[i];
                    player.setNowHP(player.getNowHP() - executeEnemyAttack(monTemp));
                }
            }

            if (player.endRoundCheck())
            {
                textBox.Add("You have gained a level, " + player.getName() + "'s stats have been increased");
            }

            if (player.getNowHP() <= 0)
            {
                gameEnd = true;
            }
        }
Beispiel #2
0
 public Monster checkMonsterHealth()
 {
     for (int i = 0; i < monsters.Count; i++)
     {
         Monster tmp = (Monster)monsters[i];
         if (tmp.checkHealth())
         {
             items[tmp.getX(), tmp.getY()] = generateItem(tmp.getLevel());
             monsters.RemoveAt(i);
             return(tmp);
         }
     }
     return(null);
 }