Exemplo n.º 1
0
 public static void drawmap()
 {
     Interface.type("_________________________________________________________________________", 0, ConsoleColor.Yellow);
     Interface.type("I--WESTERN--I-----------I--NORTHERN-I-----------I-----------I-----------I", 0, ConsoleColor.Yellow);
     Interface.type("I-----------I-----------I-----------I-----------I-----------I-COALTOWN--I", 0, ConsoleColor.Yellow);
     Interface.type("I--KINGDOM--I-----------I--KINGDOM--I-----------I-----------I-----------I", 0, ConsoleColor.Yellow);
     Interface.type("I_______________________________________________________________________I", 0, ConsoleColor.Yellow);
     Interface.type("I-----------I-----------I-----------I--NORTHERN-I-----------I-----------I", 0, ConsoleColor.Yellow);
     Interface.type("I-----------I-RIVERWELL-I-----------I-----------I-----------I-----------I", 0, ConsoleColor.Yellow);
     Interface.type("I-----------I-----------I-----------I-MOUNTAINS-I-----------I-----------I", 0, ConsoleColor.Yellow);
     Interface.type("I_______________________________________________________________________I", 0, ConsoleColor.Yellow);
     Interface.type("I-ILLUSION--I-----------I-----------I-----------I-----------I-----------I", 0, ConsoleColor.Yellow);
     Interface.type("I-----------I-----------I-----------I-----------I--NEWPORT--I-----------I", 0, ConsoleColor.Yellow);
     Interface.type("I--FOREST---I-----------I-----------I-----------I-----------I-----------I", 0, ConsoleColor.Yellow);
     Interface.type("I_______________________________________________________________________I", 0, ConsoleColor.Yellow);
     Interface.type("I-----------I-----------I-----------I--CENTRAL--I-----------I--EASTERN--I", 0, ConsoleColor.Yellow);
     Interface.type("I-----------I-----------I-----------I-----------I-----------I-----------I", 0, ConsoleColor.Yellow);
     Interface.type("I-----------I-----------I-----------I--KINGDOM--I-----------I--KINGDOM--I", 0, ConsoleColor.Yellow);
     Interface.type("I_______________________________________________________________________I", 0, ConsoleColor.Yellow);
     Interface.type("I-----------I-----------I---MAGIC---I-----------I---TWIN----I-----------I", 0, ConsoleColor.Yellow);
     Interface.type("I--SEAPORT--I-----------I-----------I-----------I-----------I-----------I", 0, ConsoleColor.Yellow);
     Interface.type("I-----------I-----------I---CITY----I-----------I---PATHS---I-----------I", 0, ConsoleColor.Yellow);
     Interface.type("I_______________________________________________________________________I", 0, ConsoleColor.Yellow);
     Interface.type("I-----------I-----------I-----------I-----------I-----------I-----------I", 0, ConsoleColor.Yellow);
     Interface.type("I-----------I-VALLEYBURGI-----------I-----------I-----------I-RAVENKEEP-I", 0, ConsoleColor.Yellow);
     Interface.type("I-----------I-----------I-----------I-----------I-----------I-----------I", 0, ConsoleColor.Yellow);
     Interface.type("_________________________________________________________________________", 0, ConsoleColor.Yellow);
     Interface.type("I-----------I-----------I-SOUTHERN--I-----------I--FROZEN---I-----------I", 0, ConsoleColor.Yellow);
     Interface.type("I-----------I-----------I-----------I-----------I-----------I-----------I", 0, ConsoleColor.Yellow);
     Interface.type("I-----------I-----------I--KINGDOM--I-----------I--FJORDS---I-----------I", 0, ConsoleColor.Yellow);
     Interface.type("_________________________________________________________________________", 0, ConsoleColor.Yellow);
 }
Exemplo n.º 2
0
            public void levelup()
            {
                int xp_overlap;

                xp_next = level >= 10 ? 62 + (level - 10) * 7 : (level >= 5 ? 17 + (level - 5) * 3 : 17);
                if (xp >= xp_next)
                {
                    level++;
                    hp = maxhp;
                    Interface.type("Congratulations! You have leveled up! You are now level " + level + ".", true);
                    if (xp > xp_next)
                    {
                        xp_overlap = Math.Abs(xp - xp_next);
                    }
                    else
                    {
                        xp_overlap = 0;
                    }
                    xp      = xp_overlap;
                    xp_next = (level >= 10 ? 62 + (level - 10) * 7 : (level >= 5 ? 17 + (level - 5) * 3 : 17));
                    if (xp >= xp_next)
                    {
                        levelup();
                    }
                }
            }
Exemplo n.º 3
0
 public static void Endgame()
 {
     if (!Main.devmode)
     {
         if (Main.magiccounter >= 1)
         {
             Interface.type("You recognize the magic man from the alley in Central. It is he who stands before you.");
         }
         Interface.type("\"I am Janus.\" The man before you says. You stand in front of the protetorate, Janus. He says \"" + Main.Player.name + ", have you realized that this world is an illusion?\" You nod your head. \"You will result in the Realm\"s demise, you must be purged. Shimmering light gathers around him, and beams of blue light blast out of him.");
         Interface.type("I regret to say it, but we must fight.");
         Combat.BattleLoop(new finalboss());
         Main.ach.Get("finalboss");
         Interface.type("Janus defeated, the world vanishes and you both are standing on glass in a blank world of black void.");
         Interface.type("The protectorate kneels on the ground in front of you. \"Do you truly wish to end the illusion?\", he says. You look at him without uttering a word. \"Very well, I must ask of you one last favor; even though the realm is no more, do not let it vanish from within you.\" Everything around you goes black. (Press any key to continue)");
         Interface.readkey();
         Console.Clear();
     }
     Interface.type("GAME CLEAR!", ConsoleColor.Yellow);
     Interface.type("==========STATS==========", ConsoleColor.Yellow);
     Interface.type("Name: " + Main.Player.name, ConsoleColor.Yellow);
     Interface.type("Race: " + Main.Player.race.ToUpperFirstLetter(), ConsoleColor.Yellow);
     Interface.type("Class: " + Main.Player.pclass.ToUpperFirstLetter(), ConsoleColor.Yellow);
     Interface.type("Level: " + Main.Player.level, ConsoleColor.Yellow);
     Interface.type("Gold: " + Main.Player.g, ConsoleColor.Yellow);
     Interface.type("Reputation " + Main.Player.reputation, ConsoleColor.Yellow);
     Interface.type("FINAL SCORE: " + calcScore().Item2, ConsoleColor.Yellow);
     Interface.type("FINAL RANK: " + calcScore().Item1, ConsoleColor.Yellow);
     Interface.type("=========================\r\n", ConsoleColor.Yellow);
     Interface.type("Press any key to continue.", ConsoleColor.White);
     Interface.readkey();
     Console.Clear();
     Credits();
 }
Exemplo n.º 4
0
        public override void Interact()
        {
            base.Interact();
            Interface.type("Press 's' to stay at the inn for " + price + " gold, or anything else to go back.");
            switch (Interface.readkey().KeyChar)
            {
            case 's':
                Player.Purchase(price);
                Main.Player.hp = Main.Player.maxhp;
                Interface.type("Your health has been restored.", ConsoleColor.Cyan);
                if (!String.IsNullOrEmpty(stay))
                {
                    Interface.type(stay);
                }
                Main.Player.last_inn[0] = Map.PlayerPosition.x;
                Main.Player.last_inn[1] = Map.PlayerPosition.y;
                break;

            default:
                if (!String.IsNullOrEmpty(leave))
                {
                    Interface.type(leave);
                }
                break;
            }
        }
Exemplo n.º 5
0
        public static void checkver()
        {
            string path         = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            string programName  = "update.exe";
            string resourceName = "Realm.update.exe";
            string exepath      = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\Realm.exe";
            string temppath     = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\test.exe";

            worker();
            while (!Init.init)
            {
            }

            if (isConnected())
            {
                if (!Init.failed)
                {
                    if (!FileCompare(exepath, temppath))
                    {
                        Interface.type("New version available. Press 'p' to download. ", 0);
                        if (Interface.readkey().KeyChar == 'p')
                        {
                            var p = new Plop();
                            p.DropAndRun(resourceName, programName);
                            Environment.Exit(0);
                        }
                    }
                    File.Delete(temppath);
                }
            }
            else
            {
                Interface.type("Connection error.");
            }
        }
Exemplo n.º 6
0
        public virtual void droploot()
        {
            int gold = Combat.Dice.roll(1, gpdice);

            Interface.type("You gain " + gold + " gold.", ConsoleColor.Yellow);
            if (!Main.is_theif)
            {
                Main.Player.g += gold;
            }
            else
            {
                Main.Player.g += (gold + (gold / 10));
            }

            int xp = Combat.Dice.roll(1, xpdice);

            Interface.type("You gained " + xp + " xp.", ConsoleColor.Yellow);
            Main.Player.xp += xp;
            List <Item> dropcands = Player.getCorrectlyTieredItems();

            if (Main.rand.NextDouble() <= .1d)
            {
                Main.Player.backpack.Add(dropcands[Main.rand.Next(0, dropcands.Count - 1)]);
                Interface.type("Obtained " + dropcands[Main.rand.Next(0, dropcands.Count - 1)].name + "!", ConsoleColor.Green);
            }

            Main.Player.reputation += (1 + extrarep);
        }
Exemplo n.º 7
0
        public static void worker()
        {
            BackgroundWorker bw = new BackgroundWorker();

            // this allows our worker to report progress during work
            bw.WorkerReportsProgress = true;

            // what to do in the background thread
            bw.DoWork += new DoWorkEventHandler(
                delegate(object o, DoWorkEventArgs args)
            {
                BackgroundWorker b  = o as BackgroundWorker;
                WebClient webClient = new WebClient();
                try
                {
                    FileIO fio = new FileIO();
                    fio.startDownload();
                }
                catch (WebException)
                {
                    Interface.type("Failed to connect to server.");
                    Init.failed = true;
                }
                // do some simple processing for 10 seconds
            });
            bw.RunWorkerAsync();
        }
Exemplo n.º 8
0
        public static void BackpackLoop()
        {
            bool loopcontrol = true;

            while (loopcontrol)
            {
                Console.ForegroundColor = ConsoleColor.Green;
                Interface.type("----------Current Equipment----------");
                Interface.type("Primary: " + Main.Player.primary.name);
                Interface.type("Secondary: " + Main.Player.secondary.name);
                Interface.type("Armor: " + Main.Player.armor.name);
                Interface.type("Accessory: " + Main.Player.accessory.name);
                Interface.type("-------------------------------------");
                int q = 1;
                Combat.CommandTable cmd = new Combat.CommandTable();
                foreach (Item i in Main.Player.backpack)
                {
                    Interface.type((q - 1) + ". " + i.name);
                    backpackcommand bpcmd = new backpackcommand(i.name, (char)(q + 47));
                    cmd.AddCommand(bpcmd);
                    q++;
                }
                Interface.type("");
                char ch = Interface.readkey().KeyChar;
                if (!cmd.commandChars.Contains(ch))
                {
                    break;
                }
                cmd.ExecuteCommand(ch, Main.Player.backpack[(int)Char.GetNumericValue(ch)]);
            }
            Console.ResetColor();
        }
Exemplo n.º 9
0
 public static void Initialize()
 {
     FileIO.checkver();
     File.Delete(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\test.exe");
     Console.Title = "Realm: " + Interface.GetTitle();
     Interface.type(Main.version, ConsoleColor.White);
     Map.gencave();
     Achievement.LoadAchievements();
     if (!Save.LoadGame())
     {
         Interface.type("\"Greetings. Before we begin, I must know your name.\"");
         Interface.type("Please enter your name. ");
         Main.Player.name = Interface.readinput(true);
         if (Main.devmode)
         {
             Console.Clear();
             Main.Player.race   = Interface.readinput();
             Main.Player.pclass = Interface.readinput();
         }
         Main.ach.Get("name");
         Main.Tutorial();
     }
     else
     {
         Main.MainLoop();
     }
 }
Exemplo n.º 10
0
 public void AddCommand(Command cmd)
 {
     _commands.Add(cmd.cmdchar, cmd);
     if (cmd.name != "Basic Attack" && cmd.GetType() == typeof(Command))
     {
         Interface.type("Learned " + cmd.name + "!", ConsoleColor.Cyan);
     }
 }
Exemplo n.º 11
0
 public static void GameOver()
 {
     Interface.type("Game Over. You have been revived at the last inn you stayed in. You have lost all your gold and half of your levels.", ConsoleColor.DarkRed);
     Main.Player.level     /= 2;
     Main.Player.g          = 0;
     Main.Player.reputation = -50;
     Map.PlayerPosition.x   = Main.Player.last_inn[0];
     Map.PlayerPosition.y   = Main.Player.last_inn[1];
 }
Exemplo n.º 12
0
            public override bool Execute(object Data)
            {
                int heal = Math.Max(((Main.Player.intl * 2) / 3), 1);

                Main.Player.hp += heal;
                if (Main.Player.hp > Main.Player.maxhp)
                {
                    Main.Player.hp = Main.Player.maxhp;
                }
                Interface.type("You gain " + heal + " life.", ConsoleColor.Cyan);
                return(true);
            }
Exemplo n.º 13
0
            public static bool misschance(int spd)
            {
                int misschance = Dice.roll(1, 101 + (spd * 3));

                if (misschance == 1)
                {
                    Interface.type("Missed!", ConsoleColor.White);
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
Exemplo n.º 14
0
 public static bool Purchase(int cost)
 {
     if (cost > Main.Player.g)
     {
         Interface.type("You don't have enough gold.");
         return(false);
     }
     else
     {
         Main.Player.g -= cost;
         Main.ach.Get("itembuy");
         return(true);
     }
 }
Exemplo n.º 15
0
 public static void Credits()
 {
     Interface.type("A child awakes from his sleep and looks out the window feeling fulfilled as if a story has come to a close.");
     Interface.type("Press any key to continue.", ConsoleColor.White);
     Interface.readkey();
     Console.Clear();
     Interface.type("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", ConsoleColor.DarkMagenta);
     Interface.type("----------------------Credits---------------------", ConsoleColor.DarkMagenta);
     Interface.type("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", ConsoleColor.DarkMagenta);
     Interface.type("__________________________________________________", ConsoleColor.DarkMagenta);
     Interface.type("Executive Developer: Cooper Teixeira", ConsoleColor.Yellow);
     Interface.type("__________________________________________________", ConsoleColor.DarkMagenta);
     Interface.type("Secondary Developer: Giorgio Lo", ConsoleColor.Yellow);
     Interface.type("__________________________________________________", ConsoleColor.DarkMagenta);
     Interface.type("Executive Producer: Cooper Teixeira", ConsoleColor.Yellow);
     Interface.type("__________________________________________________", ConsoleColor.DarkMagenta);
     Interface.type("Co-Producer: Giorgio Lo", ConsoleColor.Yellow);
     Interface.type("__________________________________________________", ConsoleColor.DarkMagenta);
     Interface.type("Lead Content Designer: Giorgio Lo", ConsoleColor.Yellow);
     Interface.type("__________________________________________________", ConsoleColor.DarkMagenta);
     Interface.type("Secondary Content Designer: Cooper Teixeira", ConsoleColor.Yellow);
     Interface.type("__________________________________________________", ConsoleColor.DarkMagenta);
     Interface.type("Chief Tester: Rosemary Rogal", ConsoleColor.Yellow);
     Interface.type("__________________________________________________", ConsoleColor.DarkMagenta);
     Interface.type("Lead Art Designer: Rosemary Rogal", ConsoleColor.Yellow);
     Interface.type("__________________________________________________", ConsoleColor.DarkMagenta);
     Interface.type("Secondary Art Designer: Giorgio Lo", ConsoleColor.Yellow);
     Interface.type("__________________________________________________", ConsoleColor.DarkMagenta);
     Interface.type("Secondary Art Designer: Cooper Teixeira", ConsoleColor.Yellow);
     Interface.type("__________________________________________________", ConsoleColor.DarkMagenta);
     Interface.type("Concept Artist: Rosemary Rogal", ConsoleColor.Yellow);
     Interface.type("__________________________________________________", ConsoleColor.DarkMagenta);
     Interface.type("Special thanks to:", ConsoleColor.DarkMagenta);
     Interface.type("- Steve Teixeira", ConsoleColor.Yellow);
     Interface.type("- Ryan Teixeira", ConsoleColor.Yellow);
     Interface.type("- Paul Pfenning", ConsoleColor.Yellow);
     Interface.type("- Charlie Catino", ConsoleColor.Yellow);
     Interface.type("- Bradley Lignoski", ConsoleColor.Yellow);
     Interface.type("- Alexander Pfenning", ConsoleColor.Yellow);
     Interface.type("- Ben Boyd", ConsoleColor.Yellow);
     Interface.type("__________________________________________________", ConsoleColor.DarkMagenta);
     Interface.type("Copyright(c) 2013", ConsoleColor.White);
     Interface.type("Press any key to continue.", ConsoleColor.White);
     Interface.readkey();
     Environment.Exit(0);
 }
Exemplo n.º 16
0
        public override void Interact()
        {
            base.Interact();
            Interface.type("Press 'b' to go into the buy menu, 's' to go into the sell menu, or anything else to go back.");
            switch (Interface.readkey().KeyChar)
            {
            case 'b':
                Interface.type("Press any key not listed to exit the buy menu.");
                bool loop = true;
                while (loop)
                {
                    foreach (KeyValuePair <char, Item> kv in forsale)
                    {
                        Interface.type(kv.Key + ". " + kv.Value.name + "(" + kv.Value.value + ")", ConsoleColor.Green);
                    }
                    Interface.type("");
                    handleinput(Interface.readkey().KeyChar);
                }
                break;

            case 's':
                Interface.type("Index. Item name.....Item resale value. Press a non-listed key to go back.", ConsoleColor.Yellow);
                List <int> indices = new List <int>();
                int        itr     = 1;
                foreach (Item item in Main.Player.backpack)
                {
                    Interface.type(itr + ". " + item.name + "....." + (int)(item.value * .6));
                    indices.Add(itr);
                }
                char input = Interface.readkey().KeyChar;
                if (indices.Contains(Convert.ToInt32(input)))
                {
                    Main.Player.g += (int)(Main.Player.backpack[Convert.ToInt32(input)].value * .6);
                    Main.Player.backpack.Remove(Main.Player.backpack[Convert.ToInt32(input)]);
                }
                break;

            default:
                break;
            }
        }
Exemplo n.º 17
0
            public override bool Execute(object data)
            {
                // data should be the enemy
                Enemy  target = (Enemy)data;
                double damage = Dice.roll(2, Main.Player.atk * 2 / 3);

                if (damage <= 0)
                {
                    damage = 1;
                }
                if (Dice.misschance(target.spd))
                {
                    damage = 0;
                }
                target.hp -= Convert.ToInt32(damage);
                int heal = Convert.ToInt32(damage / 3);

                Main.Player.hp += heal;
                Interface.type("You gain " + heal + " life.", ConsoleColor.Cyan);
                return(true);
            }
Exemplo n.º 18
0
 public static bool Purchase(int cost, Item i)
 {
     if (cost <= Main.Player.g)
     {
         Main.Player.g -= cost;
         if (Main.Player.backpack.Count <= 10)
         {
             Main.Player.backpack.Add(i);
             Interface.type("Obtained '" + i.name + "'!", ConsoleColor.Green);
         }
         else
         {
             Interface.type("Not enough space.");
         }
         return(true);
     }
     else
     {
         Interface.type("You don't have enough gold.");
         return(false);
     }
 }
Exemplo n.º 19
0
 void client_DownloadFileCompleted(object sender, AsyncCompletedEventArgs e)
 {
     Interface.type("Done.");
     Init.init = true;
 }
Exemplo n.º 20
0
            public override bool Execute(object Data)
            {
                Item i = (Item)Data;

                Interface.type(i.name);
                Interface.type("Description: " + i.desc, ConsoleColor.Green);
                Interface.type("Attack Buff: " + i.atkbuff + " / Defense Buff: " + i.defbuff + " / Speed Buff: " + i.spdbuff + " / Intelligence Buff: " + i.intlbuff, ConsoleColor.Green);
                if (i.slot == 1)
                {
                    Interface.type("Slot: Primary", ConsoleColor.Green);
                }
                else if (i.slot == 2)
                {
                    Interface.type("Slot: Secondary", ConsoleColor.Green);
                }
                else if (i.slot == 3)
                {
                    Interface.type("Slot: Armor", ConsoleColor.Green);
                }
                else if (i.slot == 4)
                {
                    Interface.type("Slot: Accessory", ConsoleColor.Green);
                }
                Interface.type("Tier: ", ConsoleColor.Green);
                Interface.typeOnSameLine(i.tier.ToString(), (i.tier == 0 ? ConsoleColor.Gray : i.tier == 1 ? ConsoleColor.White : i.tier == 2 ? ConsoleColor.Blue : i.tier == 3 ? ConsoleColor.Yellow : i.tier == 4 ? ConsoleColor.Red : i.tier == 5 ? ConsoleColor.Magenta : i.tier == 6 ? ConsoleColor.Cyan : ConsoleColor.DarkMagenta));
                Interface.type("Enter (y) to equip this item, (d) to destroy and anything else to go back.", ConsoleColor.Green);
                char c = Interface.readkey().KeyChar;

                switch (c)
                {
                case 'y':
                    if (i.slot == 1)
                    {
                        Main.Player.primary = i;
                    }
                    else if (i.slot == 2)
                    {
                        Main.Player.secondary = i;
                    }
                    else if (i.slot == 3)
                    {
                        Main.Player.armor = i;
                    }
                    else if (i.slot == 4)
                    {
                        Main.Player.accessory = i;
                    }
                    break;

                case 'd':
                    if (i.slot == 1)
                    {
                        if (Main.Player.primary == i)
                        {
                            Main.Player.primary = new Item();
                        }
                        Main.Player.backpack.Remove(i);
                    }
                    else if (i.slot == 2)
                    {
                        if (Main.Player.secondary == i)
                        {
                            Main.Player.secondary = new Item();
                        }
                        Main.Player.backpack.Remove(i);
                    }
                    else if (i.slot == 3)
                    {
                        if (Main.Player.armor == i)
                        {
                            Main.Player.armor = new Item();
                        }
                        Main.Player.backpack.Remove(i);
                    }
                    else if (i.slot == 4)
                    {
                        if (Main.Player.accessory == i)
                        {
                            Main.Player.accessory = new Item();
                        }
                        Main.Player.backpack.Remove(i);
                    }
                    break;

                default:
                    return(false);
                }
                return(true);
            }
Exemplo n.º 21
0
 public virtual void Interact()
 {
     Interface.type("NPC: " + name, ConsoleColor.Cyan);
     Interface.type("==================", ConsoleColor.Yellow);
     Interface.type(text);
 }
Exemplo n.º 22
0
 public void Get(string achievement)
 {
     try
     {
         string tachpath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\temp_achievements.rlm";
         string achpath  = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\achievements.rlm";
         if (achievement == "name" && Main.achieve["name"] == false && !Main.achievements_disabled)
         {
             Interface.type("Achievement Unlocked!: Howdy, stranger.", ConsoleColor.Green);
         }
         else if (achievement == "wking" && Main.achieve["wking"] == false && !Main.achievements_disabled)
         {
             Interface.type("Achievement Unlocked!: Brave, brave Sir Robin...", ConsoleColor.Green);
         }
         else if (achievement == "1slime" && Main.achieve["1slime"] == false && !Main.achievements_disabled)
         {
             Interface.type("Achievement Unlocked!: Tru hero");
         }
         else if (achievement == "100slime" && Main.achieve["100slime"] == false && !Main.achievements_disabled)
         {
             Interface.type("Achievement Unlocked!: Farm Simulator 2013", ConsoleColor.Green);
         }
         else if (achievement == "raven" && Main.achieve["raven"] == false && !Main.achievements_disabled)
         {
             Interface.type("Achievement Unlocked!: Caw Caw", ConsoleColor.Green);
         }
         else if (achievement == "finalboss" && Main.achieve["finalboss"] == false && !Main.achievements_disabled)
         {
             Interface.type("Achievement Unlocked!: The end?");
         }
         else if (achievement == "1goblin" && Main.achieve["1goblin"] == false && !Main.achievements_disabled)
         {
             Interface.type("Achievement Unlocked!: On your way...", ConsoleColor.Green);
         }
         else if (achievement == "100goblins" && Main.achieve["100goblins"] == false && !Main.achievements_disabled)
         {
             Interface.type("Achievement Unlocked!: Are you Rosie?", ConsoleColor.Green);
         }
         else if (achievement == "1drake" && Main.achieve["1drake"] == false && !Main.achievements_disabled)
         {
             Interface.type("Achievement Unlocked!: Basically dragonborn.", ConsoleColor.Green);
         }
         else if (achievement == "100drakes" && Main.achieve["100drakes"] == false && !Main.achievements_disabled)
         {
             Interface.type("Achievement Unlocked!: You monster.", ConsoleColor.Green);
         }
         else if (achievement == "1bandit" && Main.achieve["1bandit"] == false && !Main.achievements_disabled)
         {
             Interface.type("Achievement Unlocked!: Basically Batman.", ConsoleColor.Green);
         }
         else if (achievement == "100bandits" && Main.achieve["100bandits"] == false && !Main.achievements_disabled)
         {
             Interface.type("Achievement Unlocked!: The DK Crew", ConsoleColor.Green);
         }
         else if (achievement == "itembuy" && Main.achieve["itembuy"] == false && !Main.achievements_disabled)
         {
             Interface.type("Achievement Unlocked!: One thing isn't a spree, mom.", ConsoleColor.Green);
         }
         else if (achievement == "cardboard" && Main.achieve["cardboard"] == false && !Main.achievements_disabled)
         {
             Interface.type("Achievement Unlocked!: grats on the upgrade", ConsoleColor.Green);
         }
         else if (achievement == "dragon" && Main.achieve["dragon"] == false && !Main.achievements_disabled)
         {
             Interface.type("Achievement Unlocked!: Fus ro dah", ConsoleColor.Green);
         }
         else if (achievement == "set" && Main.achieve["set"] == false && !Main.achievements_disabled)
         {
             Interface.type("Achievement Unlocked!: Wombo Combo!", ConsoleColor.Green);
         }
         if (Main.achieve.ContainsKey(achievement))
         {
             Main.achieve[achievement] = true;
         }
         if (!File.Exists(achpath))
         {
             File.Create(achpath).Close();
         }
         using (StreamWriter file = new StreamWriter(tachpath))
         {
             foreach (KeyValuePair <string, bool> pair in Main.achieve)
             {
                 file.WriteLine(pair.Key + "=" + pair.Value);
             }
         }
         Save.EncryptFile(tachpath, achpath, Save.key);
         File.Delete(tachpath);
     }
     catch (Exception e)
     {
         Interface.type("Achievement load failed.");
         File.Delete(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\temp_achievements.rlm");
         string        crashpath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\crashlog.txt";
         List <string> listlines = new List <string>();
         listlines.Add("---Load Achievement Runtime Error---");
         listlines.Add("Message: \r\n" + e.Message);
         try
         {
             listlines.Add("Inner Exception: \r\n" + e.InnerException.ToString());
         }
         catch
         {
         }
         listlines.Add("------------------------------------");
         try
         {
             if (!File.Exists(crashpath))
             {
                 File.Create(crashpath).Dispose();
             }
             listlines.Add(e.InnerException.ToString());
         }
         catch (NullReferenceException)
         {
         }
         File.WriteAllLines(crashpath, listlines.ToArray());
     }
 }
Exemplo n.º 23
0
        public static void CaveLoop()
        {
            caveplace currPlace = new caveplace();

            Main.Player.applybonus();
            while (Main.Player.hp > 0)
            {
                Enemy enemy = new Enemy();
                Main.Player.levelup();
                currPlace = Map.cavemap[Map.CavePosition];
                if (Main.Player.hp > Main.Player.maxhp)
                {
                    Main.Player.hp = Main.Player.maxhp;
                }
                if (Combat.CheckBattle() && currPlace.getEnemyList() != null)
                {
                    enemy = currPlace.getEnemyList();
                    Combat.BattleLoop(enemy);
                }
                if (!Main.devmode)
                {
                    Main.Player.applybonus();
                }
                else
                {
                    Main.Player.applydevbonus();
                }
                if (!Main.devmode)
                {
                    Interface.type("-------------------------------------");
                    Interface.type(Main.Player.name + "(" + Main.Player.race + ")," + " Level " + Main.Player.level + " " + Main.Player.pclass + ":");
                    Interface.type("HP: " + Main.Player.hp + "/" + Main.Player.maxhp);
                    Interface.type("Attack: " + Main.Player.atk + " / Defense: " + Main.Player.def + " / Speed: " + Main.spdbuff + " / Intelligence: " + Main.Player.intl);
                    Interface.type("Mana: " + (1 + (Main.Player.intl / 10)));
                    Interface.type("Gold: " + Main.Player.g + " / Exp to Level: " + (Main.Player.xp_next - Main.Player.xp));
                    Interface.type("-------------------------------------");
                }
                if (!Main.devmode)
                {
                    Interface.type(currPlace.Description);
                }
                else
                {
                    Interface.type(currPlace.ToString());
                }

                ConsoleKeyInfo command = Interface.readkey();
                if (command.KeyChar == 'x')
                {
                    Interface.type("\r\nAre you sure?");
                    char surecommand = Interface.readkey().KeyChar;
                    if (surecommand == 'y')
                    {
                        End.GameOver();
                    }
                }
                else if (command.Key == ConsoleKey.Escape)
                {
                    Environment.Exit(0);
                }
                else if (command.KeyChar == '-' && Main.devmode)
                {
                    string input = Interface.readinput();
                    if (input == "e")
                    {
                        End.Endgame();
                    }
                    else if (input == "c")
                    {
                        string combat_input = Interface.readinput();
                        Type   etype        = Type.GetType("Realm." + combat_input);
                        Enemy  e            = (Enemy)Activator.CreateInstance(etype);
                        Combat.BattleLoop(e);
                    }
                    else if (input == "n")
                    {
                        Main.Player.name = Interface.readinput();
                    }
                    else if (input == "a")
                    {
                        string add_input = Interface.readinput();
                        Type   atype     = Type.GetType("Realm." + add_input);
                        Item   i         = (Item)Activator.CreateInstance(atype);
                        if (Main.Player.backpack.Count <= 10)
                        {
                            Main.Player.backpack.Add(i);
                        }
                        else
                        {
                            Interface.type("Not enough space.");
                        }
                        Interface.type("Obtained '" + i.name + "'!");
                    }
                    else if (input == "p")
                    {
                        string p_input = Interface.readinput();
                        Type   atype   = Type.GetType("Realm." + p_input);
                        Item   i       = (Item)Activator.CreateInstance(atype);
                        Main.Player.primary = i;
                    }
                    else if (input == "t")
                    {
                        string place_input = Interface.readinput();
                        Type   ptype       = Type.GetType("Realm." + place_input);
                        Place  p           = (Place)Activator.CreateInstance(ptype);
                    }
                }
                else
                {
                    currPlace.handleInput(command.KeyChar);
                }
                Main.loop_number++;
            }
        }
Exemplo n.º 24
0
        public static void Tutorial()
        {
            List <string> racelist = new List <string> {
                "human", "elf", "rockman", "giant", "zephyr", "shade"
            };
            List <string> classlist = new List <string> {
                "warrior", "paladin", "mage", "thief"
            };
            List <string> secret = new List <string>();

            if (achieve["100slimes"])
            {
                secret.Add("Slime");
            }
            if (achieve["100goblins"])
            {
                secret.Add("Goblin");
            }
            if (achieve["100bandits"])
            {
                secret.Add("Bandit");
            }
            if (achieve["100drakes"])
            {
                secret.Add("Drake");
            }
            is_typing = true;
            Interface.type("Welcome, ");
            Interface.typeOnSameLine(Player.name, ConsoleColor.White);
            Interface.typeOnSameLine(", to Realm.");
            if (achieve["finalboss"])
            {
                Player.backpack.Add(new nightbringer());
            }
            if (!devmode)
            {
                Interface.type("Skip the tutorial? (y/n)");
                if (Interface.readkey().KeyChar == 'n')
                {
                    Interface.type("To do anything in Realm, simply press one of the listed commands.");
                    Interface.type("If at any time, you wish to you view you stats, press 'v'");
                    Interface.type("Make sure to visit every library! They offer many valuable abilities as well as experience.");
                    Interface.type("When in combat, select an availible move. All damage is randomized. Mana is refilled after each fight.");
                    Interface.type("While in the backpack, simply select a number corresponding to an item. You may swap this item in or out. Make sure to equip an item once you pick it up!");
                    Interface.type("At any specified time, you may press x, then y. This will cause you to commit suicide.");
                    Interface.type("At any specified time, you may press #. Doing so will save the game.");
                }
                Interface.type("In Realm, every player selects a race. Each race gives its own bonuses. You may choose from Human, Elf, Rockman, Giant, Zephyr, or Shade.");
                if (achieve["100slimes"] || achieve["100goblins"] || achieve["100bandits"] || achieve["100drakes"])
                {
                    Interface.type("Secret Races: ", ConsoleColor.Yellow);
                    for (int i = 0; i < secret.Count; i++)
                    {
                        if (i > 1)
                        {
                            Interface.typeOnSameLine(", ", ConsoleColor.Yellow);
                        }
                        Interface.type(secret[i], ConsoleColor.Yellow);
                    }
                    foreach (string s in secret)
                    {
                        racelist.Add(s);
                    }
                }
                Interface.type("Please enter a race. ");
                is_typing = false;
                string race = Interface.readinput();
                while (!racelist.Contains(race))
                {
                    Interface.type("Invalid. Please try again. ");
                    race = Interface.readinput();
                }
                Player.race = race;
                Interface.type("You have selected " + Interface.ToUpperFirstLetter(Player.race) + ".", ConsoleColor.Magenta);
                Interface.type("Each player also has a class. You may choose from Warrior, Paladin, Mage, or Thief.");
                Interface.type("Please enter a class. ");
                string pclass = Interface.readinput();
                while (!classlist.Contains(pclass))
                {
                    Interface.type("Invalid. Please try again. ");
                    pclass = Interface.readinput();
                }
                Player.pclass = pclass;
                Interface.type("You have selected " + Interface.ToUpperFirstLetter(Player.pclass) + ".", ConsoleColor.Magenta);
                Interface.type("You are now ready to play Realm. Good luck!");
                Interface.type("Press any key to continue.", ConsoleColor.White);
                Interface.readkey();
                Map.PlayerPosition.x = 0;
                Map.PlayerPosition.y = 6;
                if (Player.race == "giant")
                {
                    Player.hp = 15;
                }
            }
            MainLoop();
        }
Exemplo n.º 25
0
        public static bool LoadGame()
        {
            string tpath    = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\temp_save.rlm";
            string path     = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\save.rlm";
            string achpath  = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\achievements.rlm";
            string tachpath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\temp_achievements.rlm";

            try
            {
                if (!File.Exists(path))
                {
                    return(false);
                }
                Interface.type("Loading Save...", ConsoleColor.White);
                DecryptFile(path, tpath, key);
                Dictionary <string, string> vals = new Dictionary <string, string>();
                string line;
                using (StreamReader file = new StreamReader(tpath))
                {
                    while ((line = file.ReadLine()) != null)
                    {
                        string[] split = line.Split(new char[] { '=' });
                        vals.Add(split[0], split[1]);
                    }
                    foreach (KeyValuePair <string, string> entry in vals)
                    {
                        if (entry.Key == "devmode")
                        {
                            Exception devmode = new Exception("Devmode detected. Load save aborted.");
                            throw devmode;
                        }
                        if (entry.Key == "name")
                        {
                            Main.Player.name = entry.Value;
                        }
                        if (entry.Key == "level")
                        {
                            Main.Player.level = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "xpos")
                        {
                            Map.PlayerPosition.x = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "ypos")
                        {
                            Map.PlayerPosition.y = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "hasmap")
                        {
                            Main.hasmap = true;
                        }
                        if (entry.Key == "wkingdead")
                        {
                            Main.wkingdead = true;
                        }
                        if (entry.Key == "ravendead")
                        {
                            Main.raven_dead = true;
                        }
                        if (entry.Key == "hp")
                        {
                            Main.Player.hp = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "g")
                        {
                            Main.Player.g = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "xp")
                        {
                            Main.Player.xp = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "race")
                        {
                            if (!String.IsNullOrEmpty(entry.Value))
                            {
                                Main.Player.race = entry.Value;
                            }
                            else
                            {
                                Main.Player.race = "human";
                            }
                        }
                        if (entry.Key == "class")
                        {
                            if (!String.IsNullOrEmpty(entry.Value))
                            {
                                Main.Player.pclass = entry.Value;
                            }
                            else
                            {
                                Main.Player.pclass = "warrior";
                            }
                        }
                        if (entry.Key == "bp1")
                        {
                            Type atype = Type.GetType(entry.Value);
                            Item i     = (Item)Activator.CreateInstance(atype);
                            Main.Player.backpack.Add(i);
                        }
                        if (entry.Key == "bp2")
                        {
                            Type atype = Type.GetType(entry.Value);
                            Item i     = (Item)Activator.CreateInstance(atype);
                            Main.Player.backpack.Add(i);
                        }
                        if (entry.Key == "bp3")
                        {
                            Type atype = Type.GetType(entry.Value);
                            Item i     = (Item)Activator.CreateInstance(atype);
                            Main.Player.backpack.Add(i);
                        }
                        if (entry.Key == "bp4")
                        {
                            Type atype = Type.GetType(entry.Value);
                            Item i     = (Item)Activator.CreateInstance(atype);
                            Main.Player.backpack.Add(i);
                        }
                        if (entry.Key == "bp5")
                        {
                            Type atype = Type.GetType(entry.Value);
                            Item i     = (Item)Activator.CreateInstance(atype);
                            Main.Player.backpack.Add(i);
                        }
                        if (entry.Key == "bp6")
                        {
                            Type atype = Type.GetType(entry.Value);
                            Item i     = (Item)Activator.CreateInstance(atype);
                            Main.Player.backpack.Add(i);
                        }
                        if (entry.Key == "bp7")
                        {
                            Type atype = Type.GetType(entry.Value);
                            Item i     = (Item)Activator.CreateInstance(atype);
                            Main.Player.backpack.Add(i);
                        }
                        if (entry.Key == "bp7")
                        {
                            Type atype = Type.GetType(entry.Value);
                            Item i     = (Item)Activator.CreateInstance(atype);
                            Main.Player.backpack.Add(i);
                        }
                        if (entry.Key == "bp8")
                        {
                            Type atype = Type.GetType(entry.Value);
                            Item i     = (Item)Activator.CreateInstance(atype);
                            Main.Player.backpack.Add(i);
                        }
                        if (entry.Key == "bp9")
                        {
                            Type atype = Type.GetType(entry.Value);
                            Item i     = (Item)Activator.CreateInstance(atype);
                            Main.Player.backpack.Add(i);
                        }
                        if (entry.Key == "bp10")
                        {
                            Type atype = Type.GetType(entry.Value);
                            Item i     = (Item)Activator.CreateInstance(atype);
                            Main.Player.backpack.Add(i);
                        }
                        if (entry.Key == "primary")
                        {
                            Type atype = Type.GetType(entry.Value);
                            Item i     = (Item)Activator.CreateInstance(atype);
                            Main.Player.primary = i;
                        }
                        if (entry.Key == "secondary")
                        {
                            Type atype = Type.GetType(entry.Value);
                            Item i     = (Item)Activator.CreateInstance(atype);
                            Main.Player.secondary = i;
                        }
                        if (entry.Key == "armor")
                        {
                            Type atype = Type.GetType(entry.Value);
                            Item i     = (Item)Activator.CreateInstance(atype);
                            Main.Player.armor = i;
                        }
                        if (entry.Key == "accessory")
                        {
                            Type atype = Type.GetType(entry.Value);
                            Item i     = (Item)Activator.CreateInstance(atype);
                            Main.Player.accessory = i;
                        }
                        if (entry.Key == "slimecounter")
                        {
                            Main.slimecounter = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "goblincounter")
                        {
                            Main.goblincounter = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "banditcounter")
                        {
                            Main.banditcounter = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "drakecounter")
                        {
                            Main.drakecounter = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "Energy Overload")
                        {
                            Main.Player.abilities.AddCommand(new Combat.EnergyOverload("Energy Overload", 'e'));
                        }
                        if (entry.Key == "Blade Dash")
                        {
                            Main.Player.abilities.AddCommand(new Combat.BladeDash("Blade Dash", 'd'));
                        }
                        if (entry.Key == "Holy Smite")
                        {
                            Main.Player.abilities.AddCommand(new Combat.HolySmite("Holy Smite", 'h'));
                        }
                        if (entry.Key == "Consume Soul")
                        {
                            Main.Player.abilities.AddCommand(new Combat.ConsumeSoul("Consume Soul", 'u'));
                        }
                        if (entry.Key == "Curse")
                        {
                            Main.Player.abilities.AddCommand(new Combat.Curse("Curse", 'c'));
                        }
                        if (entry.Key == "Sacrifice")
                        {
                            Main.Player.abilities.AddCommand(new Combat.Sacrifice("Sacrifice", 's'));
                        }
                        if (entry.Key == "Phase")
                        {
                            Main.Player.abilities.AddCommand(new Combat.Phase("Phase", 'p'));
                        }
                        if (entry.Key == "Dawnstrike")
                        {
                            Main.Player.abilities.AddCommand(new Combat.Dawnstrike("Dawnstrike", 't'));
                        }
                        if (entry.Key == "Vorpal Blades")
                        {
                            Main.Player.abilities.AddCommand(new Combat.VorpalBlades("Vorpal Blades", 'v'));
                        }
                        if (entry.Key == "Incinerate")
                        {
                            Main.Player.abilities.AddCommand(new Combat.Incinerate("Incinerate", 'a'));
                        }
                        if (entry.Key == "Heavensplitter")
                        {
                            Main.Player.abilities.AddCommand(new Combat.Heavensplitter("Heavensplitter", 'z'));
                        }
                        if (entry.Key == "Gamble")
                        {
                            Main.Player.abilities.AddCommand(new Combat.Gamble("Gamble", '$'));
                        }
                        if (entry.Key == "Nightshade")
                        {
                            Main.Player.abilities.AddCommand(new Combat.Nightshade("Nightshade", 'n'));
                        }
                        if (entry.Key == "Safeguard")
                        {
                            Main.Player.abilities.AddCommand(new Combat.Safeguard("Safeguard", 'g'));
                        }
                        if (entry.Key == "Mimic")
                        {
                            Main.Player.abilities.AddCommand(new Combat.Mimic("Mimic", 'm'));
                        }
                        if (entry.Key == "Heal")
                        {
                            Main.Player.abilities.AddCommand(new Combat.Heal("Heal", 'l'));
                        }
                        if (entry.Key == "Lightspeed")
                        {
                            Main.Player.abilities.AddCommand(new Combat.Lightspeed("Lightspeed", '!'));
                        }
                        if (entry.Key == "Rage")
                        {
                            Main.Player.abilities.AddCommand(new Combat.Rage("Rage", 'r'));
                        }
                        if (entry.Key == "Hell's Kitchen")
                        {
                            Main.Player.abilities.AddCommand(new Combat.HellsKitchen("Hell's Kitchen", '@'));
                        }
                        if (entry.Key == "Ice Chains")
                        {
                            Main.Player.abilities.AddCommand(new Combat.IceChains("Ice Chains", 'i'));
                        }
                        if (entry.Key == "Now You See Me")
                        {
                            Main.Player.abilities.AddCommand(new Combat.NowYouSeeMe("Now You See Me", 'y'));
                        }
                        if (entry.Key == "Illusion")
                        {
                            Main.Player.abilities.AddCommand(new Combat.Illusion("Illusion", '?'));
                        }
                        if (entry.Key == "Pew Pew Pew")
                        {
                            Main.Player.abilities.AddCommand(new Combat.PewPewPew("Pew Pew Pew", 'w'));
                        }
                        if (entry.Key == "loopnumber")
                        {
                            Main.loop_number = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "wkingcounter")
                        {
                            Main.wkingcounter = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "slibcounter")
                        {
                            Main.slibcounter = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "forrestcounter")
                        {
                            Main.forrestcounter = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "libcounter")
                        {
                            Main.libcounter = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "centrallibcounter")
                        {
                            Main.centrallibcounter = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "ramsaycounter")
                        {
                            Main.ramsaycounter = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "magiccounter")
                        {
                            Main.magiccounter = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "nlibcounter")
                        {
                            Main.nlibcounter = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "townfolkcounter")
                        {
                            Main.townfolkcounter = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "nomadcounter")
                        {
                            Main.nomadcounter = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "minecounter")
                        {
                            Main.minecounter = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "frozencounter")
                        {
                            Main.frozencounter = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "noobcounter")
                        {
                            Main.noobcounter = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "is_thief")
                        {
                            Main.is_theif = true;
                        }
                        if (entry.Key == "intlbuff")
                        {
                            Main.intlbuff = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "atkbuff")
                        {
                            Main.atkbuff = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "defbuff")
                        {
                            Main.defbuff = Convert.ToInt32(entry.Value);
                        }
                        if (entry.Key == "spdbuff")
                        {
                            Main.spdbuff = Convert.ToInt32(entry.Value);
                        }
                    }
                    Interface.type("Done.", ConsoleColor.White);
                    file.Close();
                    File.Delete(tpath);
                    File.Delete(tachpath);
                    return(true);
                }
            }
            catch (Exception e)
            {
                Interface.type("Load failed. Would you like to delete your save? (press 'y' to delete)", ConsoleColor.White);
                char key = Interface.readkey().KeyChar;
                if (key == 'y')
                {
                    File.Delete(path);
                }
                else if (key == 'e')
                {
                    Interface.type(e.ToString());
                }
                File.Delete(tachpath);
                File.Delete(tpath);

                WriteError(e);

                return(false);
            }
        }
Exemplo n.º 26
0
 //public static void typeAbility(string abilityname)
 //{
 //    Main.is_typing = true;
 //    Console.WriteLine("\r\n");
 //    string leanred = "Learned '";
 //    string exclaim = "'!";
 //    foreach (char c in leanred)
 //    {
 //        Console.Write(c);
 //        Thread.SpinWait(1000000);
 //    }
 //    Console.ForegroundColor = ConsoleColor.Cyan;
 //    Console.Write(abilityname);
 //    Console.ResetColor();
 //    foreach (char c in exclaim)
 //    {
 //        Console.Write(c);
 //        Thread.SpinWait(1000000);
 //    }
 //    Main.is_typing = false;
 //}
 public static void typeStats()
 {
     Interface.type("--------------STATS-----------------", ConsoleColor.Yellow);
     Interface.type(Main.Player.name + "(" + Interface.ToUpperFirstLetter(Main.Player.race) + ")," + " Level " + Main.Player.level + " " + Interface.ToUpperFirstLetter(Main.Player.pclass) + ":", ConsoleColor.Yellow);
     Interface.type("HP: " + Main.Player.hp + "/" + Main.Player.maxhp, ConsoleColor.Yellow);
     Interface.type("Attack: " + Main.Player.atk + " / Defense: " + Main.Player.def + " / Speed: " + Main.Player.spd + " / Intelligence: " + Main.Player.intl, ConsoleColor.Yellow);
     Interface.type("Mana: " + (1 + (Main.Player.intl / 10)), ConsoleColor.Yellow);
     Interface.type("Gold: " + Main.Player.g + " / Exp to Level: " + (Main.Player.xp_next - Main.Player.xp), ConsoleColor.Yellow);
     Interface.type("=============Achievements============", ConsoleColor.Cyan);
     foreach (KeyValuePair <string, bool> entry in Main.achieve)
     {
         if (entry.Key == "name" && Main.achieve[entry.Key])
         {
             Interface.type("Howdy, stranger. - Name Yourself", ConsoleColor.Cyan);
         }
         else if (entry.Key == "wking" && Main.achieve[entry.Key])
         {
             Interface.type("Brave, brave Sir Robin... - Run away from the Western King", ConsoleColor.Cyan);
         }
         else if (entry.Key == "1slime" && Main.achieve[entry.Key])
         {
             Interface.type("Tru hero - Kill a slime", ConsoleColor.Cyan);
         }
         else if (entry.Key == "100slime" && Main.achieve[entry.Key])
         {
             Interface.type("Professional Farmer - Kill 100 slimes", ConsoleColor.Cyan);
         }
         else if (entry.Key == "raven" && Main.achieve[entry.Key])
         {
             Interface.type("Caw Caw - Defeat the Raven King", ConsoleColor.Cyan);
         }
         else if (entry.Key == "finalboss" && Main.achieve[entry.Key])
         {
             Interface.type("The end? - Defeat Janus", ConsoleColor.Cyan);
         }
         else if (entry.Key == "1goblin" && Main.achieve[entry.Key])
         {
             Interface.type("On your way... - Kill a goblin", ConsoleColor.Cyan);
         }
         else if (entry.Key == "100goblins" && Main.achieve[entry.Key])
         {
             Interface.type("Are you Rosie? - Kill 100 goblins", ConsoleColor.Cyan);
         }
         else if (entry.Key == "1drake" && Main.achieve[entry.Key])
         {
             Interface.type("Basically dragonborn. - Kill a drake", ConsoleColor.Cyan);
         }
         else if (entry.Key == "100drakes" && Main.achieve[entry.Key])
         {
             Interface.type("You monster. - Kill 100 drakes", ConsoleColor.Cyan);
         }
         else if (entry.Key == "1bandit" && Main.achieve[entry.Key])
         {
             Interface.type("Basically Batman. - Kill a bandit", ConsoleColor.Cyan);
         }
         else if (entry.Key == "100bandits" && Main.achieve[entry.Key])
         {
             Interface.type("The DK Crew - Kill 100 bandits", ConsoleColor.Cyan);
         }
         else if (entry.Key == "itembuy" && Main.achieve[entry.Key])
         {
             Interface.type("One thing isn't a spree, mom. - Buy an item", ConsoleColor.Cyan);
         }
         else if (entry.Key == "cardboard" && Main.achieve[entry.Key])
         {
             Interface.type("grats on the upgrade - Find the cardboard armor", ConsoleColor.Cyan);
         }
         else if (entry.Key == "dragon" && Main.achieve[entry.Key])
         {
             Interface.type("Fus ro dah - Slay Tyrone", ConsoleColor.Cyan);
         }
         else if (entry.Key == "set" && Main.achieve[entry.Key])
         {
             Interface.type("Wombo Combo! - Obtain all the pieces", ConsoleColor.Cyan);
         }
     }
     Interface.type("-------------------------------------", ConsoleColor.Yellow);
 }
Exemplo n.º 27
0
        public static void BattleLoop(Enemy enemy)
        {
            Main.game_state = 1;

            Main.Player.applybonus();

            int enemydmg = 0;
            int mana     = 1 + Main.Player.intl / 10;

            Interface.type("You have entered combat! Ready your weapons!", ConsoleColor.Red);
            Interface.type("Level " + enemy.level + " " + enemy.name + ":", ConsoleColor.Yellow);
            Interface.type("-------------------------", ConsoleColor.Yellow);
            Interface.type("HP: " + enemy.hp, ConsoleColor.Yellow);
            Interface.type("Attack: " + enemy.atk, ConsoleColor.Yellow);
            Interface.type("Defense: " + enemy.def, ConsoleColor.Yellow);
            Interface.type("-------------------------", ConsoleColor.Yellow);
            bool is_turn = enemy.spd < Main.Player.spd;

            while (enemy.hp >= 0)
            {
                Interface.type("----------------------", ConsoleColor.Cyan);
                Interface.type("Your HP: " + Main.Player.hp, ConsoleColor.Cyan);
                Interface.type("Your Mana: " + mana, ConsoleColor.Cyan);
                Interface.type("----------------------", ConsoleColor.Cyan);
                Interface.type("Enemy HP: " + enemy.hp, ConsoleColor.Red);
                Interface.type("----------------------", ConsoleColor.Cyan);
                if (is_turn && !Main.Player.stunned)
                {
                    if (Main.Player.phased)
                    {
                        Main.Player.phased = false;
                    }
                    Interface.type("\r\nAVAILABLE MOVES:", ConsoleColor.Cyan);
                    Interface.type("-------------", ConsoleColor.Cyan);
                    int i = 0;
                    foreach (Realm.Combat.Command c in Main.Player.abilities.commands.Values)
                    {
                        string src = "||   " + c.cmdchar + ". " + c.name;
                        Interface.type(src, ConsoleColor.Cyan);
                        i++;
                    }
                    Interface.type("-------------", ConsoleColor.Cyan);
                    Interface.type("");

                    if (Main.Player.fire >= 3)
                    {
                        Main.Player.on_fire = false;
                    }
                    if (Main.Player.on_fire)
                    {
                        Main.Player.fire++;
                        int dmg = Combat.Dice.roll(1, 3);
                        Main.Player.hp -= dmg;
                        Interface.type("You take " + dmg + " fire damage.", ConsoleColor.Red);
                    }
                    if (Main.Player.blinded)
                    {
                        Main.Player.blinded = false;
                    }
                    if (Main.Player.cursed)
                    {
                        Main.Player.hp -= Combat.Dice.roll(1, 6);
                        Interface.type("You are cursed!", ConsoleColor.Red);
                    }

                    int  oldhp = enemy.hp;
                    char ch    = Interface.readkey().KeyChar;
                    while (!Main.Player.abilities.commandChars.Contains(ch))
                    {
                        Interface.type("Invalid.");
                        Interface.type("");
                        ch = Interface.readkey().KeyChar;
                    }
                    while (ch != 'b' && mana <= 0)
                    {
                        Interface.type("Out of mana!", ConsoleColor.Red);
                        Interface.type("");
                        ch = Interface.readkey().KeyChar;
                    }
                    if (ch != 'b')
                    {
                        mana--;
                    }
                    if (ch == 'm')
                    {
                        Interface.type("You mimc the enemy's damage!", ConsoleColor.Cyan);
                        enemy.hp -= enemydmg;
                    }
                    if (!Main.Player.blinded)
                    {
                        Main.Player.abilities.ExecuteCommand(ch, enemy);
                    }
                    else
                    {
                        Interface.type("You are blind!", ConsoleColor.Red);
                        if (Combat.Dice.roll(1, 10) == 1)
                        {
                            Interface.type("By some miracle, you manage to hit", ConsoleColor.Cyan);
                            Main.Player.abilities.ExecuteCommand(ch, enemy);
                            int blindenemyhp = oldhp - enemy.hp;
                            if (ch != 'l')
                            {
                                Interface.type("The enemy takes " + blindenemyhp + " damage!", ConsoleColor.Cyan);
                            }
                        }
                    }
                    int enemyhp = oldhp - enemy.hp;
                    if (ch != 'l')
                    {
                        Interface.type("The enemy takes " + enemyhp + " damage!", ConsoleColor.Cyan);
                    }
                    if (enemy.hp <= 0)
                    {
                        Interface.type("Your have defeated " + enemy.name + "!", ConsoleColor.Yellow);
                        enemy.droploot();
                        Main.Player.levelup();
                        if (enemy.name == "slime")
                        {
                            Main.slimecounter++;
                            Main.ach.Get("1slime");
                        }
                        else if (enemy.name == "goblin")
                        {
                            Main.ach.Get("1goblin");
                            Main.goblincounter++;
                        }
                        else if (enemy.name == "bandit")
                        {
                            Main.banditcounter++;
                            Main.ach.Get("1bandit");
                        }
                        else if (enemy.name == "drake")
                        {
                            Main.ach.Get("1drake");
                            Main.drakecounter++;
                        }
                        return;
                    }
                    if (!Main.Player.phased)
                    {
                        is_turn = false;
                    }
                }
                else if (Main.Player.stunned)
                {
                    Interface.type("You are stunned!", ConsoleColor.Red);
                    Main.Player.stunned = false;
                    if (Main.Player.fire >= 3)
                    {
                        Main.Player.on_fire = false;
                    }
                    if (Main.Player.on_fire)
                    {
                        Main.Player.fire++;
                        int dmg = Combat.Dice.roll(1, 3);
                        Main.Player.hp -= dmg;
                        Interface.type("You take " + dmg + " fire damage.", ConsoleColor.Red);
                    }
                    if (Main.Player.cursed)
                    {
                        Main.Player.hp -= Combat.Dice.roll(1, 6);
                        Interface.type("You are cursed!", ConsoleColor.Red);
                    }
                    is_turn = false;
                }

                else if (!is_turn && !enemy.stunned)
                {
                    if (enemy.fire >= 3)
                    {
                        enemy.on_fire = false;
                    }
                    if (Main.Player.guard >= 2)
                    {
                        Main.Player.guarded = false;
                    }
                    if (Main.Player.guarded)
                    {
                        Main.Player.guard++;
                    }
                    if (enemy.blinded)
                    {
                        enemy.blinded = false;
                    }
                    if (enemy.on_fire)
                    {
                        enemy.fire++;
                        int dmg = Combat.Dice.roll(1, 3);
                        enemy.hp -= dmg;
                        Interface.type(enemy.name + " takes " + dmg + " fire damage.", ConsoleColor.Cyan);
                        if (enemy.hp <= 0)
                        {
                            Interface.type("Your have defeated " + enemy.name + "!", ConsoleColor.Yellow);
                            enemy.droploot();
                            Main.Player.levelup();
                            if (enemy.name == "slime")
                            {
                                Main.slimecounter++;
                                Main.ach.Get("1slime");
                            }
                            else if (enemy.name == "goblin")
                            {
                                Main.ach.Get("1goblin");
                                Main.goblincounter++;
                            }
                            else if (enemy.name == "bandit")
                            {
                                Main.banditcounter++;
                                Main.ach.Get("1bandit");
                            }
                            else if (enemy.name == "drake")
                            {
                                Main.ach.Get("1drake");
                                Main.drakecounter++;
                            }
                            return;
                        }
                    }
                    if (enemy.cursed)
                    {
                        Interface.type(enemy.name + " is cursed!", ConsoleColor.Cyan);
                        enemy.hp -= Combat.Dice.roll(1, 6);
                        if (enemy.hp <= 0)
                        {
                            Interface.type("Your have defeated " + enemy.name + "!", ConsoleColor.Yellow);
                            enemy.droploot();
                            Main.Player.levelup();
                            return;
                        }
                    }
                    if (enemy.trapped)
                    {
                        Interface.type("Your trap has sprung!");
                        int dmg = (Main.Player.level / 5) + (Main.Player.intl / 3) + Combat.Dice.roll(1, 5);
                        enemy.hp -= dmg;
                        Interface.type(enemy.name + " takes " + dmg + " damage!", ConsoleColor.Cyan);
                        if (enemy.hp <= 0)
                        {
                            Interface.type("Your have defeated " + enemy.name + "!", ConsoleColor.Yellow);
                            enemy.droploot();
                            Main.Player.levelup();
                            return;
                        }
                    }
                    if (enemy.hp <= 0)
                    {
                        Interface.type("Your have defeated " + enemy.name + "!", ConsoleColor.Yellow);
                        enemy.droploot();
                        Main.Player.levelup();
                        return;
                    }
                    int    oldhp = Main.Player.hp;
                    string ability;
                    if (!Main.Player.guarded && !enemy.blinded)
                    {
                        enemy.attack(out ability);
                        enemydmg = oldhp - Main.Player.hp;
                        Interface.type(enemy.name + " used " + ability, ConsoleColor.Red);
                        Interface.type("You take " + enemydmg + " damage!", ConsoleColor.Red);
                    }
                    else
                    {
                        if (Main.Player.blinded)
                        {
                            Interface.type(enemy.name + "is blind!", ConsoleColor.Cyan);
                            if (Combat.Dice.roll(1, 10) == 1)
                            {
                                Interface.type("By some miracle, " + enemy.name + " manages to hit you!", ConsoleColor.Red);
                                enemy.attack(out ability);
                                enemydmg = oldhp - Main.Player.hp;
                                Interface.type(enemy.name + " used " + ability, ConsoleColor.Red);
                                Interface.type("You take " + enemydmg + " damage!", ConsoleColor.Red);
                            }
                        }
                        else if (Main.Player.guarded)
                        {
                            Interface.type("Safeguard prevented damage!", ConsoleColor.Cyan);
                        }
                    }
                    if (Main.Player.hp <= 0)
                    {
                        End.GameOver();
                    }
                    is_turn = true;
                }
                else if (enemy.stunned)
                {
                    Interface.type(enemy.name + " is stunned!", ConsoleColor.Cyan);
                    enemy.stunned = false;
                    if (enemy.fire >= 3)
                    {
                        enemy.on_fire = false;
                    }
                    if (enemy.on_fire)
                    {
                        enemy.fire++;
                        int dmg = Combat.Dice.roll(1, 3);
                        enemy.hp -= dmg;
                        Interface.type(enemy.name + " takes " + dmg + " fire damage.", ConsoleColor.Cyan);
                    }
                    if (enemy.cursed)
                    {
                        Interface.type(enemy.name + " is cursed!", ConsoleColor.Cyan);
                        enemy.hp -= Combat.Dice.roll(1, 6);
                    }
                    if (enemy.hp <= 0)
                    {
                        Interface.type("Your have defeated " + enemy.name + "!", ConsoleColor.Yellow);
                        enemy.droploot();
                        Main.Player.levelup();
                        if (enemy.name == "slime")
                        {
                            Main.slimecounter++;
                            Main.ach.Get("1slime");
                        }
                        else if (enemy.name == "goblin")
                        {
                            Main.ach.Get("1goblin");
                            Main.goblincounter++;
                        }
                        else if (enemy.name == "bandit")
                        {
                            Main.banditcounter++;
                            Main.ach.Get("1bandit");
                        }
                        else if (enemy.name == "drake")
                        {
                            Main.ach.Get("1drake");
                            Main.drakecounter++;
                        }
                        return;
                    }
                    is_turn = true;
                }
            }
        }
Exemplo n.º 28
0
        public static void SaveGame()
        {
            string tpath = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\temp_save.rlm";
            string path  = Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) + "\\save.rlm";

            Interface.type("Saving...", ConsoleColor.White);
            List <string> lines = new List <string>();

            lines.Add("name=" + Main.Player.name);
            foreach (Combat.Command c in Main.Player.abilities.commands.Values)
            {
                lines.Add(c.name + "=true");
            }

            int bpcounter = 1;

            foreach (Item i in Main.Player.backpack)
            {
                lines.Add("bp" + bpcounter + "=" + i);
                bpcounter++;
            }
            lines.Add("race=" + Main.Player.race);
            lines.Add("class=" + Main.Player.pclass);
            if (!Main.Player.primary.Equals(new Item()))
            {
                lines.Add("primary=" + Main.Player.primary);
            }
            if (!Main.Player.secondary.Equals(new Item()))
            {
                lines.Add("secondary=" + Main.Player.secondary);
            }
            if (!Main.Player.armor.Equals(new Item()))
            {
                lines.Add("armor=" + Main.Player.armor);
            }
            if (!Main.Player.accessory.Equals(new Item()))
            {
                lines.Add("accessory=" + Main.Player.accessory);
            }
            lines.Add("level=" + Main.Player.level);
            lines.Add("hp=" + Main.Player.hp);
            lines.Add("ppx=" + Map.PlayerPosition.x);
            lines.Add("ppy=" + Map.PlayerPosition.y);
            lines.Add("intlbuff=" + Main.intlbuff);
            lines.Add("atkbuff=" + Main.atkbuff);
            lines.Add("defbuff=" + Main.defbuff);
            lines.Add("spdbuff=" + Main.spdbuff);
            if (Main.hasmap)
            {
                lines.Add("hasmap=true");
            }
            if (Main.wkingdead)
            {
                lines.Add("wkingdead=true");
            }
            if (Main.raven_dead)
            {
                lines.Add("ravendead=true");
            }
            if (Main.is_theif)
            {
                lines.Add("is_thief=true");
            }
            if (Main.devmode)
            {
                lines.Add("devmode=true");
            }
            lines.Add("wkingcounter=" + Main.wkingcounter);
            lines.Add("slibcounter=" + Main.slibcounter);
            lines.Add("forrestcounter=" + Main.forrestcounter);
            lines.Add("libcounter=" + Main.libcounter);
            lines.Add("centrallibcounter=" + Main.centrallibcounter);
            lines.Add("ramsaycounter=" + Main.ramsaycounter);
            lines.Add("magiccounter=" + Main.magiccounter);
            lines.Add("nlibcounter=" + Main.nlibcounter);
            lines.Add("townfolkcounter=" + Main.townfolkcounter);
            lines.Add("nomadcounter=" + Main.nomadcounter);
            lines.Add("minecounter=" + Main.minecounter);
            lines.Add("frozencounter=" + Main.frozencounter);
            lines.Add("noobcounter=" + Main.noobcounter);
            lines.Add("slimecounter=" + Main.slimecounter);
            lines.Add("banditcounter=" + Main.banditcounter);
            lines.Add("goblincounter=" + Main.goblincounter);
            lines.Add("drakecounter=" + Main.drakecounter);
            lines.Add("g=" + Main.Player.g);
            lines.Add("xp=" + Main.Player.xp);
            lines.Add("xpos=" + Map.PlayerPosition.x);
            lines.Add("ypos=" + Map.PlayerPosition.y);
            string[] linesarray = lines.ToArray <string>();
            File.WriteAllLines(tpath, linesarray);
            Interface.type("Done.", ConsoleColor.White);
            EncryptFile(tpath, path, key);
        }
Exemplo n.º 29
0
        public static void MainLoop()
        {
            game_state = 0;
            Place currPlace;

            while (Player.hp > 0)
            {
                if (slimecounter == 100)
                {
                    ach.Get("100slimes");
                }
                if (goblincounter == 100)
                {
                    ach.Get("100goblins");
                }
                if (banditcounter == 100)
                {
                    ach.Get("100bandits");
                }
                if (drakecounter == 100)
                {
                    ach.Get("100drakes");
                }

                Tuple <int, int> xy = Map.CoordinatesOf(typeof(Nomad));
                Map.map[xy.Item1, xy.Item2] = new Place();
                Tuple <int, int> nextNomad = Map.getRandomBlankTile();
                Map.map[nextNomad.Item1, nextNomad.Item2] = new Nomad();

                foreach (Place p in Map.map)
                {
                    if (p.GetType() == typeof(Place))
                    {
                        p.is_npc_active = false;
                    }
                }
                Tuple <int, int> randomTile = Map.getRandomBlankTile();
                if (rand.NextDouble() <= .1)
                {
                    Map.map[randomTile.Item1, randomTile.Item2].is_npc_active = true;
                }

                if (devmode)
                {
                    Interface.type("Dev Powers!", ConsoleColor.DarkMagenta);
                    Player.primary   = new phantasmal_claymore();
                    Player.secondary = new spectral_bulwark();
                    Player.armor     = new illusory_plate();
                    Player.accessory = new void_cloak();
                    hasmap           = true;
                }
                Player.applybonus();
                Enemy enemy = new Enemy();
                Player.levelup();
                currPlace = Map.map[Map.PlayerPosition.x, Map.PlayerPosition.y];
                if (Player.hp > Player.maxhp)
                {
                    Player.hp = Player.maxhp;
                }
                if (loop_number >= 1)
                {
                    if (Combat.CheckBattle() && currPlace.getEnemyList() != null && !devmode)
                    {
                        enemy = currPlace.getEnemyList();
                        Combat.BattleLoop(enemy);
                    }
                }
                Item pc = new phantasmal_claymore();
                Item sb = new spectral_bulwark();
                Item ip = new illusory_plate();
                Item vc = new void_cloak();
                if ((Player.backpack.Contains(pc) && Player.backpack.Contains(sb) && Player.backpack.Contains(ip) && Player.backpack.Contains(vc)) || devmode)
                {
                    if (!Player.abilities.commandChars.Contains('*'))
                    {
                        Player.abilities.AddCommand(new Combat.EndtheIllusion("End the Illusion", '*'));
                    }
                    ach.Get("set");
                }
                if (devmode)
                {
                    Interface.type(Map.PlayerPosition.x + " " + Map.PlayerPosition.y);
                }
                if (!devmode)
                {
                    Player.applybonus();
                }
                else
                {
                    Player.applydevbonus();
                }
                if (gbooks >= 3 && !Player.abilities.commandChars.Contains('@'))
                {
                    Interface.type("Having read all of the Ramsay books, you are enlightened in the ways of Gordon Ramsay.");
                    Player.abilities.AddCommand(new Combat.HellsKitchen("Hell's Kitchen", '@'));
                }
                if (!devmode)
                {
                    Interface.type(currPlace.Description);
                }
                else
                {
                    Interface.type(currPlace.ToString());
                }
                char[] currcommands = currPlace.getAvailableCommands();
                Interface.typeOnSameLine("\r\nYour current commands are x", ConsoleColor.Cyan);
                foreach (char c in currcommands)
                {
                    Interface.typeOnSameLine(", " + c, ConsoleColor.Cyan);
                }
                Interface.type("");

                ConsoleKeyInfo command = Interface.readkey();
                if (command.KeyChar == 'x')
                {
                    Interface.type("\r\nAre you sure?", ConsoleColor.Red);
                    char surecommand = Interface.readkey().KeyChar;
                    if (surecommand == 'y')
                    {
                        End.GameOver();
                    }
                }
                else if (command.Key == ConsoleKey.Escape)
                {
                    Environment.Exit(0);
                }
                else if (command.KeyChar == '-' && devmode)
                {
                    string input = Interface.readinput();
                    if (input == "end")
                    {
                        End.Endgame();
                    }
                    else if (input == "combat")
                    {
                        string combat_input = Interface.readinput();
                        Type   etype        = Type.GetType("Realm." + combat_input);
                        try
                        {
                            Enemy e = (Enemy)Activator.CreateInstance(etype);
                            Combat.BattleLoop(e);
                        }
                        catch (ArgumentNullException)
                        {
                            Interface.type("Invalid Enemy.");
                        }
                    }
                    else if (input == "name")
                    {
                        Player.name = Interface.readinput();
                    }
                    else if (input == "additem")
                    {
                        string add_input = Interface.readinput();
                        Type   atype     = Type.GetType("Realm." + add_input);
                        try
                        {
                            Item i = (Item)Activator.CreateInstance(atype);

                            if (Player.backpack.Count <= 10)
                            {
                                Player.backpack.Add(i);
                                Interface.type("Obtained '" + i.name + "'!");
                            }
                            else
                            {
                                Interface.type("Not enough space.");
                            }
                        }
                        catch (ArgumentNullException)
                        {
                            Interface.type("Invalid Item.");
                        }
                    }

                    else if (input == "droploot")
                    {
                        if (Main.rand.NextDouble() <= .1d)
                        {
                            Main.Player.backpack.Add(MainItemList[Main.rand.Next(0, MainItemList.Count - 1)]);
                            Interface.type("Obtained " + MainItemList[Main.rand.Next(0, MainItemList.Count - 1)].name + "!", ConsoleColor.Green);
                        }
                        else
                        {
                            Interface.type("Nothing dropped.");
                        }
                    }
                    else if (input == "teleport")
                    {
                        int xcoord = Int32.Parse(Interface.readinput());
                        int ycoord = Int32.Parse(Interface.readinput());
                        Map.PlayerPosition.x = xcoord;
                        Map.PlayerPosition.y = ycoord;
                    }
                    else if (input == "level")
                    {
                        Main.Player.level = Convert.ToInt32(Interface.readinput());
                    }
                    else if (input == "levelup")
                    {
                        Main.Player.xp += Main.Player.xp_next;
                    }
                    else if (input == "getach")
                    {
                        ach.Get(Interface.readinput());
                    }
                    else if (input == "suicide")
                    {
                        End.GameOver();
                    }
                }
                else
                {
                    currPlace.handleInput(command.KeyChar);
                }
                loop_number++;
            }
        }