Пример #1
0
        static private void cmd_forest_run(Player player)
        {
            Monster mon = Monsters.loadFor(player);

            if (mon == null)
            {
                Console.WriteLine("ERROR: running from a fight where no monster exists");
                // Move player to forest
                player.changeZone("forest");
                return;
            }

            // failure?
            if (new Random().Next(0, 3) == 0)
            {
                Program.sendWhisper(player, "You failed to run away!");
                mon.attack();
                return;
            }

            // Move player to forest
            player.changeZone("forest");
            Program.sendWhisper(player, "You successfully run away.");
            mon.clear();
        }