Пример #1
0
        /// <summary>
        /// Initializes combat.  0 = random, 1 = bounded, 2 = particular.  Low doubles as particular.
        /// </summary>
        /// <param name="player"></param>
        /// <param name="type"></param>
        public static void start_Combat(PlayerCharacter player, int type, int low, int high)
        {
            BlankEnemy enemy;

            if (type == 0)
            {
                enemy = new BlankEnemy(get_Random_Enemy());
            }
            else if (type == 1)
            {
                enemy = new BlankEnemy(get_Bounded_Enemy(low, high));
            }
            else
            {
                enemy = new BlankEnemy(get_Particular_Enemy(low));
            }

            Console.WriteLine("A " + enemy.get_Name() + " has appeared!");
            enemy.print_Enemy_Data();

            CombatHandler.combat_Loop(player, enemy);
        }
Пример #2
0
        static void Main(string[] args)
        {
            //the string that will hold all user commands in our adventure game
            String command = string.Empty;

            PlayerCharacter player = new PlayerCharacter();

            Console.WriteLine("Welcome to the Unnamed Game.");

            do
            {
                Console.WriteLine("Please enter a character name.");
                command = Console.ReadLine();
            } while (!(Regex.IsMatch(command, @"^[a-zA-Z]+$")));



            player.set_Name(command);

            CombatHandler.start_Combat(player, 0, 0, 0);

            Console.ReadLine();
        }