예제 #1
0
        /// <summary>
        /// Contains most of the logic actually performing a round of the game. It's what called in the 'Hunt' menu option.
        /// </summary>
        private void PlayRound()
        {
            //Initialization
            Character winner = null;

            Console.Clear();
            Character enemy = new Character();

            //If the player has any equipment, equip one and show a little notification about it
            player.EquipGear();
            if (player.equippedGear != null)
            {
                Console.WriteLine("{0} has equipped {1} for their next fight! \n", player.Name, player.equippedGear.name);
            }

            //create a new battle between the player and enemy, run and print it.
            Battle battle = new Battle(player, enemy);

            winner = battle.DoBattle();
            player.battleLogs.Add(battle.battleLog);
            PrintBattle(battle.battleLog);

            //the player get rewards for winning a battle
            if (winner == player)
            {
                player.battlesSurvived++;
                player.gold++;
                player.LevelUp();
                Console.ReadKey(true);
            }
        }
예제 #2
0
        static void Main(string[] args)
        {
            Program   p = new Program();
            Character c = new Character();

            StartGameMessage();
            c.InputCharacterStats();
            while (p.GameContinues)
            {
                Battle b = new Battle();
                p.GameContinues = b.DoBattle(c);
            }
            c.PrintLog();
            EndGameMessage();
        }