コード例 #1
0
ファイル: Player.cs プロジェクト: pareion/tamagotchi
 internal Player(string user)
 {
     username = user;
     money = 0;
     metal = 0;
     herbs = 0;
     area = new Area("Eirin");
     Monsters = new List<Monster>();
     inventory = new List<Item>();
     eggs = new List<Egg>();
     questlog = new List<Quest>();
 }
コード例 #2
0
ファイル: Player.cs プロジェクト: pareion/tamagotchi
 internal Player(string username, int money, int metal, int herbs, Area area, List<Quest> questlog, List<Monster> monsters, List<Egg> eggs, List<Item> items)
 {
     this.username = username;
     this.money = money;
     this.metal = metal;
     this.herbs = herbs;
     this.area = area;
     Monsters = monsters;
     inventory = items;
     this.eggs = eggs;
     this.questlog = questlog;
 }
コード例 #3
0
ファイル: AreaHandler.cs プロジェクト: pareion/tamagotchi
        internal Player The_Plague_Lands(Player play)
        {
            Console.Clear();
            player = play;
            Area area = new Area("The_Plague_Lands", 6);
            player.Area = area;
            player.updateQuests(null, player.Area, null, 0, 0, 0);
            Console.WriteLine("As you enter the dark forest you feel an itching all over your body \n" +
                "the dirt looks tainted and all the leaves withered away. \n" +
                "you look around and spot a single hill with a castle upon \n" +
                "and around the hill you spot a huge graveyard");
            Console.WriteLine();
            Console.WriteLine("You are in " + area.Name + " level " + area.Level);
            Console.WriteLine(player.stats());
            Console.WriteLine();
            Console.WriteLine("1 Go to Graveyard (level 7)");
            Console.WriteLine("2 Go to Orexdale (level 3)");
            Console.WriteLine("3 Go to Undead Castle (level 9)");
            Console.WriteLine("4 Save your progress");
            int choice = 0;
            try_again:
            try
            {
                choice = int.Parse(Console.ReadLine());
            }
            catch (Exception)
            {
                goto try_again;
            }

            switch (choice)
            {
                case 1:
                    player = Graveyard(player);
                    break;
                case 2:
                    player = Orexdale(player);
                    break;
                case 3:
                    player = Undead_Castle(player);
                    break;
                case 4:
                    return player;
            }
            return player;
        }
コード例 #4
0
ファイル: AreaHandler.cs プロジェクト: pareion/tamagotchi
        internal Player The_Fery(Player play)
        {
            Console.Clear();
            player = play;
            Area area = new Area("The_Fery", 1);
            player.Area = area;
            Console.WriteLine("You approach the castle, but as you reach the gate 2 guards stop you and asks \n" +
                                "to put away your equipment while your inside the castle. \n" +
                                "You put the equipment away and as you enter the castle you see a \n" +
                                "staircase leading to a dungeon and the king sitting as his throne.");
            Console.WriteLine();
            Console.WriteLine("You are in " + area.Name + " level " + area.Level);
            Console.WriteLine(player.stats());
            Console.WriteLine();
            Console.WriteLine("1 Go to The Stocades (dungeon level 7)");
            Console.WriteLine("2 Go to Ferrington (city)");
            Console.WriteLine("3 Save your progress");
            int choice = 0;
            try_again:
            try
            {
                choice = int.Parse(Console.ReadLine());
            }
            catch (Exception)
            {
                goto try_again;
            }

            switch (choice)
            {
                case 1:
                    player = The_Stocades(player);
                    break;
                case 2:
                    player = Ferrington(player);
                    break;
                case 3:
                    return player;

            }
            return player;
        }
コード例 #5
0
ファイル: AreaHandler.cs プロジェクト: pareion/tamagotchi
        internal Player Saepegox(Player play)
        {
            Console.Clear();
            player = play;
            Area area = new Area("Saepegox", 2);
            player.Area = area;
            try_again:
            Console.Clear();
            Console.WriteLine("The desert stretches out as far as your eyes can see, you spot a single oasis \n" +
                                "and wonder whether to turn back or head to it \n");
            Console.WriteLine();
            Console.WriteLine("You are in " + area.Name + " level " + area.Level);
            Console.WriteLine("The area consist of Mummies, Pharoahs and Sphinxs");
            Console.WriteLine(player.stats());
            Console.WriteLine();
            Console.WriteLine("1 Go to the Eirin (level 1)");
            Console.WriteLine("2 Go to the Oasis of Jaagi (level 5)");
            Console.WriteLine("3 Explore the area");
            Console.WriteLine("4 Save your progress");
            int choice = 0;

            try
            {
                choice = int.Parse(Console.ReadLine());
            }
            catch (Exception)
            {
                goto try_again;
            }

            switch (choice)
            {
                case 1:
                    player = Eirin(player);
                    break;
                case 2:
                    player = Oasis_Of_Jaagi(player);
                    break;
                case 3:
                    Console.Clear();
                    switch (rng.Next(1, 3))
                    {
                        case 1:
                            Enemy enemy = SaepegoxEnemy(area.Level);
                            Monster tama = chooseMonster(player);
                            Console.WriteLine("Enemy: " + combatStrength(enemy.Tama));
                            Console.WriteLine("You: " + combatStrength(tama));
                            player = FM.FightMonster(player, tama, enemy);
                            goto try_again;
                        case 2:
                            int money = exploreAreaMoney(area.Level);
                            Console.WriteLine("You found money " + money);
                            player.Money += money;
                            Console.WriteLine();
                            Console.WriteLine("Press enter to continue");
                            Console.ReadLine();
                            Console.Clear();
                            goto try_again;
                    }
                    break;
                case 4:
                    return player;

            }
            return player;
        }
コード例 #6
0
ファイル: AreaHandler.cs プロジェクト: pareion/tamagotchi
        internal Player Pladósh(Player play)
        {
            Console.Clear();
            Area area = new Area("Pladósh", 3);
            player = play;
            player.Area = area;
            try_again:
            int choice = 0;
            Console.Clear();
            Console.WriteLine("As you reach the swamp your feets seems to stick to the ground and a smoke starts to appear over the ground \n" +
                                "As you scout out the area you see a witchhut and decided wether to go visit it or explore the swamp \n");
            Console.WriteLine();
            Console.WriteLine("You are in " + area.Name + " level " + area.Level);
            Console.WriteLine("The area consist of Fairies, Fireflies and Swamp Humanoids");
            Console.WriteLine(player.stats());
            Console.WriteLine();
            Console.WriteLine("1 Go to Eirin (level 1)");
            Console.WriteLine("2 Explore the swamp");
            Console.WriteLine("3 Go to the Withhut");
            Console.WriteLine("4 Save your progress");

            try
            {
                choice = int.Parse(Console.ReadLine());
            }
            catch (Exception)
            {
                goto try_again;
            }

            switch (choice)
            {
                case 1:
                    player = Eirin(player);
                    break;
                case 2:
                    Console.Clear();
                    switch (rng.Next(1, 4))
                    {
                        case 1:
                            Enemy enemy = PlagóshEnemy(area.Level);
                            Monster tama = chooseMonster(player);
                            Console.WriteLine("Enemy: " + combatStrength(enemy.Tama));
                            Console.WriteLine("You: " + combatStrength(tama));
                            player = FM.FightMonster(player, tama, enemy);
                            goto try_again;
                        case 2:
                            int herbs2 = exploreAreaHerb(area.Level);
                            Console.WriteLine("You found herbs " + herbs2);
                            player.Herbs += herbs2;
                            Console.WriteLine();
                            Console.WriteLine("Press enter to continue");
                            Console.ReadLine();
                            Console.Clear();
                            goto try_again;
                        case 3:
                            int money = exploreAreaMoney(area.Level);
                            Console.WriteLine("You found money " + money);
                            player.Money += money;
                            Console.WriteLine();
                            Console.WriteLine("Press enter to continue");
                            Console.ReadLine();
                            Console.Clear();
                            goto try_again;
                    }
                    break;
                case 3:
                    player = WitchHut(player);
                    break;
                case 4:
                    return player;
            }
            return player;
        }
コード例 #7
0
ファイル: AreaHandler.cs プロジェクト: pareion/tamagotchi
        internal Player Orexdale(Player play)
        {
            Console.Clear();
            player = play;
            Area area = new Area("Orexdale", 3);
            player.Area = area;
            try_again:
            Console.WriteLine("You travel out of the gate and look beyond the horizon and see huge open area of grass and river \n" +
                "you even spot a waterfall across the landscape and far away you see a dark forest with smoke lurking above it \n" +
                 "as you look even further you even spot a few mountains");
            Console.WriteLine();
            Console.WriteLine("You are in " + area.Name + " level " + area.Level);
            Console.WriteLine("The area consist of Gnomes, goblinscouts and rivermonsters");
            Console.WriteLine(player.stats());
            Console.WriteLine();
            Console.WriteLine("1 Go to Ferrington (city)");
            Console.WriteLine("2 Go to Mount Anor (level 5)");
            Console.WriteLine("3 Go to The Plague Lands (level 6)");
            Console.WriteLine("4 explore the mountains");
            Console.WriteLine("5 Save your progress");
            int choice = 0;

            try
            {
                choice = int.Parse(Console.ReadLine());
            }
            catch (Exception)
            {
                goto try_again;
            }

            switch (choice)
            {
                case 1:
                    player = Ferrington(player);
                    break;
                case 2:
                    player = Mount_Anor(player);
                    break;
                case 3:
                    player = The_Plague_Lands(player);
                    break;
                case 4:
                    Console.Clear();
                    switch (rng.Next(1, 4))
                    {
                        case 1:
                            Enemy enemy = OrexdaleEnemy(area.Level);
                            Monster tama = chooseMonster(player);
                            Console.WriteLine("Enemy: " + combatStrength(enemy.Tama));
                            Console.WriteLine("You: " + combatStrength(tama));
                            player = FM.FightMonster(player, tama, enemy);
                            goto try_again;
                        case 2:
                            int metal2 = exploreAreaMetal(area.Level);
                            Console.WriteLine("You found metal " + metal2);
                            player.Metal += metal2;
                            Console.WriteLine();
                            Console.WriteLine("Press enter to continue");
                            Console.ReadLine();
                            Console.Clear();
                            goto try_again;
                        case 3:
                            int money = exploreAreaMoney(area.Level);
                            Console.WriteLine("You found money " + money);
                            player.Money += money;
                            Console.WriteLine();
                            Console.WriteLine("Press enter to continue");
                            Console.ReadLine();
                            Console.Clear();
                            goto try_again;
                    }
                    break;
                case 5:
                    return player;
            }
            return player;
        }
コード例 #8
0
ファイル: AreaHandler.cs プロジェクト: pareion/tamagotchi
        internal Player Oasis_Of_Jaagi(Player play)
        {
            Console.Clear();
            player = play;
            Area area = new Area("Oasis_Of_Jaagi", 5);
            player.Area = area;
            Console.Clear();
            Console.WriteLine("You are in " + area.Name + " level " + area.Level);
            Console.WriteLine(player.stats());
            Console.WriteLine();
            Console.WriteLine("1 Go to the Saepegox");
            Console.WriteLine("2 Save your progress");
            int choice = 0;
            try_again:
            try
            {
                choice = int.Parse(Console.ReadLine());
            }
            catch (Exception)
            {
                goto try_again;
            }

            switch (choice)
            {
                case 1:
                    player = Saepegox(player);
                    break;
                case 2:
                    return player;

            }
            return player;
        }
コード例 #9
0
ファイル: Player.cs プロジェクト: pareion/tamagotchi
        internal void updateQuests(Enemy enemy, Area area, Item item, int herbs, int money, int metal)
        {
            for (int i = 0; i < questlog.Count; i++)
            {
                switch (questlog[i].Name)
                {
                    #region The Goblin Cave
                    case "The Goblin cave":
                        if (enemy != null)
                        {
                            if (enemy.Name == "goblin")
                            {
                                if (!questlog[i].Completed)
                                {
                                    questlog[i].Progress += 1;
                                    if (questlog[i].Progress >= questlog[i].GoalValidator)
                                    {
                                        Console.WriteLine("You completed the quest " + questlog[i].Name);
                                        Console.WriteLine();
                                        questlog[i].Completed = true;
                                        Console.WriteLine();
                                        Console.WriteLine("Press enter to continue");
                                        Console.ReadLine();
                                    }
                                }
                            }
                        }
                        break;
                    #endregion
                    #region Find the source of the corruption
                    case "Find the source of the corruption":
                        if (area != null)
                        {
                            if (area.Name == "The_Plague_Lands")
                            {
                                if (!questlog[i].Completed)
                                {
                                    questlog[i].Progress += 1;
                                    if (questlog[i].Progress >= questlog[i].GoalValidator)
                                    {
                                        Console.WriteLine("You completed the quest " + questlog[i].Name);
                                        Console.WriteLine();
                                        questlog[i].Completed = true;
                                        Console.WriteLine();
                                        Console.WriteLine("Press enter to continue");
                                        Console.ReadLine();
                                    }
                                }
                            }
                        }
                        break;
                    #endregion
                    #region Learning Brewing
                    case "Learning Brewing":
                        if (herbs > 0)
                        {
                            if (!questlog[i].Completed)
                            {
                                questlog[i].Progress += herbs;
                                if (questlog[i].Progress >= questlog[i].GoalValidator)
                                {
                                    Console.WriteLine("You completed the quest " + questlog[i].Name);
                                    Console.WriteLine();
                                    questlog[i].Completed = true;
                                    Console.WriteLine();
                                    Console.WriteLine("Press enter to continue");
                                    Console.ReadLine();
                                }
                            }
                        }
                        break;
                    #endregion
                    #region The Sorcerer
                    case "The Sorcerer":
                        if (enemy != null)
                        {
                            if (!questlog[i].Completed)
                            {
                                questlog[i].Progress += 1;
                                if (questlog[i].Progress >= questlog[i].GoalValidator)
                                {
                                    Console.WriteLine("You completed the quest " + questlog[i].Name);
                                    Console.WriteLine("You have now vanguished the corruption congratulation on beating the game!");
                                    Console.WriteLine();
                                    questlog[i].Completed = true;
                                    Console.WriteLine();
                                    Console.WriteLine("Press enter to continue");
                                    Console.ReadLine();
                                    Console.ReadLine();
                                }
                            }
                        }
                        break;
                    #endregion
                    default:
                        break;
                }

            }
        }
コード例 #10
0
ファイル: AreaHandler.cs プロジェクト: pareion/tamagotchi
        internal Player Graveyard(Player play)
        {
            Console.Clear();
            player = play;
            Area area = new Area("Graveyard", 7);
            player.Area = area;
            player.updateQuests(null, player.Area, null, 0, 0, 0);
            Console.WriteLine("The graveyards looks old and ruined as you enter it. \n" +
                "the graves looks like someone has been digging them all up \n" +
                "and the air feels cold as ice, as you look around you can \n" +
                "only see the castle upwards even though you feel like \n" +
                "someone is watching you");
            Console.WriteLine();
            Console.WriteLine("You are in " + area.Name + " level " + area.Level);
            Console.WriteLine(player.stats());
            Console.WriteLine();
            Console.WriteLine("1 Go to the The Plague Lands");
            Console.WriteLine("2 Go to the castle");
            Console.WriteLine("3 Save your progress");
            int choice = 0;
            try_again:
            try
            {
                choice = int.Parse(Console.ReadLine());
            }
            catch (Exception)
            {
                goto try_again;
            }

            switch (choice)
            {
                case 1:
                    player = The_Plague_Lands(player);
                    break;
                case 2:
                    player = Undead_Castle(player);
                    break;
                case 3:
                    return player;
            }
            return player;
        }
コード例 #11
0
ファイル: AreaHandler.cs プロジェクト: pareion/tamagotchi
        internal Player Eirin(Player play)
        {
            Console.Clear();
            Area area = new Area("Eirin", 1);
            player = play;
            player.Area = area;
            int choice = 0;
            try_again:
            Console.WriteLine("As you approach the area you see a lot of herbs at the side of the road \n" +
                                "You could either continue towards Pladósh a swapish area or turn your head \n" +
                                "towards the desert Saepegox or head towards to huge town Ferrington");
            Console.WriteLine();
            Console.WriteLine("You are in " + area.Name + " level " + area.Level);
            Console.WriteLine("The area consists of goblins and gnomes");
            Console.WriteLine();
            Console.WriteLine(player.stats());
            Console.WriteLine();
            Console.WriteLine("1 Explore the Eirin");
            Console.WriteLine("2 Explore for herbs");
            Console.WriteLine("3 Go to Pladósh (level 3)");
            Console.WriteLine("4 Go to Saepegox (level 2)");
            Console.WriteLine("5 Go to Ferrington (City)");
            Console.WriteLine("6 Save your progress");
            Console.WriteLine();
            try
            {
                choice = int.Parse(Console.ReadLine());
            }
            catch (Exception)
            {
                Console.Clear();
                goto try_again;

            }
            switch (choice)
            {
                case 1:
                    Console.Clear();
                    switch (rng.Next(1, 4))
                    {
                        case 1:
                            Enemy enemy = EirinEnemy(area.Level);
                            Console.WriteLine();
                            Console.WriteLine("You encounted a " + enemy.Name + " its estimated power " + combatStrength(enemy.Tama));
                            Monster tama = chooseMonster(player);
                            player = FM.FightMonster(player, tama, enemy);
                            goto try_again;
                        case 2:
                            int herbs2 = exploreAreaHerb(area.Level);
                            Console.WriteLine("You found herbs " + herbs2);
                            player.Herbs += herbs2;
                            Console.WriteLine();
                            Console.WriteLine("Press enter to continue");
                            Console.ReadLine();
                            Console.Clear();
                            goto try_again;
                        case 3:
                            int money = exploreAreaMoney(area.Level);
                            Console.WriteLine("You found money " + money);
                            player.Money += money;
                            Console.WriteLine();
                            Console.WriteLine("Press enter to continue");
                            Console.ReadLine();
                            Console.Clear();
                            goto try_again;
                    }
                    break;
                case 2:
                    Console.Clear();
                    int herbs = 0;
                    switch (rng.Next(1, 3))
                    {
                        case 1:
                            herbs = exploreAreaHerb(area.Level);
                            Console.WriteLine("You found herbs " + herbs);
                            player.Herbs += herbs;
                            Console.WriteLine();
                            Console.WriteLine("Press enter to continue");
                            Console.ReadLine();
                            Console.Clear();
                            goto try_again;
                        case 2:
                            Console.WriteLine("You didn't find anything");
                            Console.WriteLine();
                            Console.WriteLine("Press enter to continue");
                            Console.ReadLine();
                            Console.Clear();
                            goto try_again;
                    }
                    goto try_again;
                case 3:
                    player = Pladósh(player);
                    break;
                case 4:
                    player = Saepegox(player);
                    break;
                case 5:
                    player = Ferrington(player);
                    break;
                case 6:
                    return player;
            }

            return player;
        }
コード例 #12
0
ファイル: AreaHandler.cs プロジェクト: pareion/tamagotchi
        internal Player Ferrington(Player play)
        {
            try_again:
            Console.Clear();
            player = play;
            Area area = new Area("Ferrington", 1);
            NPC npc = new NPC("Merchant");
            NPC npc2 = new NPC("King's Diplomat");
            Item a = IC.CreateAtkItem("Steel sword", Item.equipment.weapon, 20, 5, 100);
            a.Price = 200;
            npc.addItem(a);
            Item b = IC.CreateHPItem("HP potion 20", Item.equipment.potion, 20, 0);
            b.Price = 5;
            npc.addItem(b);
            Item c = IC.CreateArmorItem("Armor potion 20 ", Item.equipment.potion, 20, 0);
            c.Price = 20;
            npc.addItem(c);

            Quest quest = new Quest("The Goblin cave", "Some goblins are rampaging the trade roads, go hunt 8 goblins down and the rest might flee!", 8, 0, "money 100", false, false);
            Quest quest2 = new Quest("Find the source of the corruption", "Main Quest The king is looking for a hero who will undertake the task, of finding and repelling the corruption", 1, 0, "money 300", false, false);
            Quest quest3 = new Quest("The Sorcerer", "Find the Sorcerer to stop the corruption", 1, 0, "money 300", false, false);

            npc.addQuest(quest);
            npc2.addQuest(quest2);
            npc2.addQuest(quest3);

            area.setNPC(npc);
            area.setNPC2(npc2);
            player.Area = area;
            Console.Clear();
            Console.WriteLine("You approach the huge city you see a couple of guards standing watch.\n" +
                                "You slowly approach them, they sceptically look at you and you little \n" +
                                "monster, but let you through anyways. Inside the huge city you spot a \n" +
                                "castle straight ahead, to your left you find a bunch of houses \n" +
                                "To your right you spot a merchant so fat he would fall over if you \n" +
                                "touched him. You pass him and go around the town and spot another \n" +
                                "gate leading to Orexdale");
            Console.WriteLine();
            Console.WriteLine("You are in " + area.Name + " level " + area.Level);
            Console.WriteLine(player.stats());
            Console.WriteLine();
            Console.WriteLine("1 Talk to the Merchant");
            Console.WriteLine("2 Talk to the Kings Diplomat");
            Console.WriteLine("3 Go to the The Fery (castle)");
            Console.WriteLine("4 Go to the Eirin (level 1)");
            Console.WriteLine("5 Go to the Orexdale (level 3)");
            Console.WriteLine("6 Save your progress");
            int choice = 0;
            try
            {
                choice = int.Parse(Console.ReadLine());
            }
            catch (Exception)
            {
                goto try_again;
            }

            switch (choice)
            {
                case 1:
                trader:
                    Console.Clear();
                    Console.WriteLine("1. Do you wanna buy something?");
                    Console.WriteLine("2. Do you need a quest?");
                    Console.WriteLine("3. Return to the area");
                    Console.WriteLine();

                    int choice2 = 0, choice3 = 0;

                    try
                    {
                        choice2 = int.Parse(Console.ReadLine());
                    }
                    catch (Exception)
                    {
                        goto trader;
                    }
                    switch (choice2)
                    {
                        case 1:
                        trader2:
                            Console.Clear();
                            Console.WriteLine("Your money: " + player.Money);
                            Console.WriteLine();
                            Console.WriteLine("*** Displaying items ***");
                            int b2;
                            for (int i = 0; i < area.Npc.Selling.Count; i++)
                            {
                                b2 = i + 1;
                                Console.WriteLine("Item: " + b2 + " " + area.Npc.Selling[i].Name);
                            }
                            try
                            {
                                Console.WriteLine("What item do you want to buy?");
                                Console.WriteLine("Type 0 if you don't want to buy anything");
                                choice3 = int.Parse(Console.ReadLine());
                            }
                            catch (Exception)
                            {
                                goto trader2;
                            }
                            if (choice3 != 0)
                            {
                                if (area.Npc.Selling[choice2 + 1].Price <= player.Money)
                                {
                                    player.Inventory.Add(area.Npc.Selling[choice2 + 1]);
                                    player.Money -= area.Npc.Selling[choice2 + 1].Price;
                                }
                                else
                                {
                                    Console.WriteLine("You can't afford it!");
                                    Console.WriteLine();
                                    Console.WriteLine("Press enter to continue");
                                    Console.ReadLine();
                                    Console.Clear();
                                }

                            }
                            goto trader;
                        case 2:
                        quests:
                            Console.Clear();
                            area.Npc.displayQuests();
                            Console.WriteLine();
                            Console.WriteLine("Are you up for one of the challenges?");
                            Console.WriteLine("Type 0 if you wanna return to the menu");
                            Console.WriteLine("Else type 1");
                            int choice4;
                            try
                            {
                                choice4 = int.Parse(Console.ReadLine());
                            }
                            catch (Exception)
                            {
                                goto quests;
                            }
                            switch (choice4)
                            {
                                case 0:
                                    goto trader;
                                default:
                                    if (player.checkQuest(area.Npc.Quests[choice4 - 1]))
                                    {
                                        Console.Clear();
                                        Console.WriteLine("The quest: " + area.Npc.Quests[choice4 - 1].Name + " has been added to your questlog!");
                                        player.Questlog.Add(area.Npc.Quests[choice4 - 1]);
                                        Console.WriteLine();
                                        Console.WriteLine("Press enter to continue");
                                        Console.ReadLine();
                                    }
                                    else
                                    {
                                        player.completeQuest(area.Npc.Quests[choice4 - 1], null);
                                        Console.WriteLine("You'r either on the quest or finished it");
                                        Console.WriteLine();
                                        Console.WriteLine("Press enter to continue");
                                        Console.ReadLine();
                                    }
                                    break;
                            }
                            break;
                        case 3:
                            goto try_again;
                    }
                    goto trader;
                case 2:
                diplomat:
                    Console.Clear();
                    area.Npc2.displayQuests();
                    int choice5 = 0;
                    try
                    {
                        choice5 = int.Parse(Console.ReadLine());
                    }
                    catch (Exception)
                    {
                        goto diplomat;
                    }
                    switch (choice5)
                    {
                        case 0:
                            goto diplomat;
                        default:
                            switch (choice5)
                            {
                                case 1:
                                    if (player.checkQuest(area.Npc2.Quests[0]))
                                    {
                                        Console.Clear();
                                        Console.WriteLine("The quest: " + area.Npc2.Quests[0].Name + " has been added to your questlog!");
                                        player.Questlog.Add(area.Npc2.Quests[0]);
                                        Console.WriteLine();
                                        Console.WriteLine("Press enter to continue");
                                        Console.ReadLine();
                                    }
                                    else
                                    {
                                        player.completeQuest(area.Npc2.Quests[0], null);
                                        Console.WriteLine("You'r either on the quest or finished it");
                                        Console.WriteLine();
                                        Console.WriteLine("Press enter to continue");
                                        Console.ReadLine();
                                    }
                                    break;
                                case 2:
                                    if (player.completedQuest(area.Npc2.Quests[0]))
                                    {
                                        if (player.checkQuest(area.Npc2.Quests[1]))
                                        {
                                            Console.Clear();
                                            Console.WriteLine("The quest: " + area.Npc2.Quests[1].Name + " has been added to your questlog!");
                                            player.Questlog.Add(area.Npc2.Quests[1]);
                                            Console.WriteLine();
                                            Console.WriteLine("Press enter to continue");
                                            Console.ReadLine();
                                        }
                                        else
                                        {
                                            player.completeQuest(area.Npc2.Quests[1], null);
                                            Console.WriteLine("You'r either on the quest or finished it");
                                            Console.WriteLine();
                                            Console.WriteLine("Press enter to continue");
                                            Console.ReadLine();
                                        }
                                    }
                                    else
                                    {
                                        Console.WriteLine("You need to complete 'Find the source of the corruption' before starting it");
                                        Console.WriteLine();
                                        Console.WriteLine("Press enter to continue");
                                        Console.ReadLine();
                                    }

                                    break;
                                default:
                                    break;
                            }

                            break;
                    }
                    goto try_again;
                case 3:
                    player = The_Fery(player);
                    break;
                case 4:
                    player = Eirin(player);
                    break;
                case 5:
                    player = Orexdale(player);
                    break;
                case 6:
                    return player;

            }
            return player;
        }
コード例 #13
0
ファイル: AreaHandler.cs プロジェクト: pareion/tamagotchi
        internal Player WitchHut(Player play)
        {
            try_again:
            Console.Clear();
            player = play;
            Area area = new Area("WitchHut", 1);
            NPC npc = new NPC("Witch Doctor");
            Quest q1 = new Quest("Learning Brewing", "Go find 20 herbs for the Witch Doctor", 20, 0, "herbs 20", false, false);

            npc.addQuest(q1);
            area.setNPC(npc);
            player.Area = area;

            Console.Clear();
            Console.WriteLine("As you walk towards the hut a witch steps outside and looks at you and you wonder whether to \n" +
                                "confront her or go back");
            Console.WriteLine();
            Console.WriteLine(player.stats());
            Console.WriteLine();
            Console.WriteLine("1 Go to Pladósh (level 3)");
            Console.WriteLine("2 Talk to the " + npc.Name);
            Console.WriteLine("3 Save your progress");
            int choice = 0;

            try
            {
                choice = int.Parse(Console.ReadLine());
            }
            catch (Exception)
            {
                goto try_again;
            }

            switch (choice)
            {
                case 1:
                    player = Pladósh(player);
                    break;
                case 2:
                Witch:
                    Console.Clear();
                    Console.WriteLine("As you walk towards the witch she stares at you and let out a little squek before she asks you");
                    Console.WriteLine();
                    Console.WriteLine("1. Do you wanna brew something?");
                    Console.WriteLine("2. Or head back where you came from?");
                    int choice2;
                    try
                    {
                        choice2 = int.Parse(Console.ReadLine());
                    }
                    catch (Exception)
                    {
                        goto Witch;
                    }
                    switch (choice2)
                    {
                        case 1:
                            bool questCompleted = false;
                            foreach (var item in player.Questlog)
                            {
                                if (item.Name == q1.Name && item.Completed && item.Rewarded)
                                {
                                    questCompleted = true;
                                }
                            }
                            if (questCompleted)
                            {
                                PotionMenu();
                                goto Witch;
                            }
                            else
                            {
                                Console.WriteLine("Before you start brewing you have to do a quest for me");
                                Console.WriteLine();
                                Console.WriteLine("Press 1 to accept the quest");
                                int choice3;
                                try
                                {
                                    choice3 = int.Parse(Console.ReadLine());
                                }
                                catch (Exception)
                                {
                                    goto Witch;
                                }
                                switch (choice3)
                                {
                                    case 1:
                                        Console.Clear();
                                        area.Npc.displayQuests();
                                        if (player.checkQuest(area.Npc.Quests[choice3 - 1]))
                                        {
                                            Console.Clear();
                                            Console.WriteLine("The quest: " + area.Npc.Quests[choice3 - 1].Name + " has been added to your questlog!");
                                            player.Questlog.Add(area.Npc.Quests[choice3 - 1]);
                                            player.updateQuests(null, null, null, player.Herbs, 0, 0);
                                            Console.WriteLine();
                                            Console.WriteLine("Press enter to continue");
                                            Console.ReadLine();
                                        }
                                        else
                                        {
                                            if (player.completeQuest(area.Npc.Quests[choice3 - 1], null))
                                            {
                                                player.Herbs -= 20;
                                            }
                                            else
                                                Console.WriteLine("You'r either on the quest or finished it");
                                            Console.WriteLine();
                                            Console.WriteLine("Press enter to continue");
                                            Console.ReadLine();
                                        }
                                        break;
                                    default:
                                        goto Witch;
                                }
                            }
                            goto Witch;
                        case 2:
                            goto try_again;
                    }
                    break;
                case 3:
                    return player;

            }
            return player;
        }
コード例 #14
0
ファイル: AreaHandler.cs プロジェクト: pareion/tamagotchi
        internal Player Undead_Castle(Player play)
        {
            try_again:
            Console.Clear();
            player = play;
            Area area = new Area("Undead_Castle", 9);
            player.Area = area;
            Console.WriteLine("You walk up the hill towards the castle and as you reach the door it opens \n" +
                "and a cold smoke rushes out you look inside and the dark hall consumes you. \n" +
                "As you enter the door you see nothing, but darkness and wonder whether \n" +
                "to continue onwards or turn back");
            Console.WriteLine();
            Console.WriteLine("You are in " + area.Name + " level " + area.Level);
            Console.WriteLine(player.stats());
            Console.WriteLine();
            Console.WriteLine("1 Go to the The Plague Lands (level 6)");
            Console.WriteLine("2 Explore the castle");
            Console.WriteLine("3 Go to the graveyard (level 7)");
            Console.WriteLine("4 Save your progress");
            int choice = 0;
            try
            {
                choice = int.Parse(Console.ReadLine());
            }
            catch (Exception)
            {
                goto try_again;
            }

            switch (choice)
            {
                case 1:
                    player = The_Plague_Lands(player);
                    break;
                case 2:
                    Console.Clear();
                    switch (rng.Next(1, 3))
                    {
                        case 1:
                            Enemy enemy = UndeadCastleEnemy(area.Level);
                            Monster tama = chooseMonster(player);
                            Console.WriteLine("Combat strength");
                            Console.WriteLine("Enemy: " + combatStrength(enemy.Tama));
                            Console.WriteLine("You: " + combatStrength(tama));
                            Console.WriteLine();
                            player = FM.FightMonster(player, tama, enemy);
                            goto try_again;
                        case 2:
                            int money = exploreAreaMoney(area.Level);
                            Console.WriteLine("You found money " + money);
                            player.Money += money;
                            Console.WriteLine();
                            Console.WriteLine("Press enter to continue");
                            Console.ReadLine();
                            Console.Clear();
                            goto try_again;
                    }
                    break;
                case 3:
                    player = Graveyard(player);
                    break;
                case 4:
                    return player;

            }
            return player;
        }
コード例 #15
0
ファイル: AreaHandler.cs プロジェクト: pareion/tamagotchi
        internal Player The_Stocades(Player play)
        {
            Console.Clear();
            player = play;
            Area area = new Area("The_Stocades", 7);
            player.Area = area;
            Console.WriteLine("As you go down the staircase one of the advisors come running towards you \n" +
                                "if you wanna go into the dungeon, please atleast take your equipment with you \n" +
                                "he hands back all your equipment and as you take it on and go towards the dungeon \n" +
                                "he blesses you");
            Console.WriteLine();
            Console.WriteLine("You are in " + area.Name + " level " + area.Level);
            Console.WriteLine(player.stats());
            Console.WriteLine();
            Console.WriteLine("1 Go to The Fery");
            Console.WriteLine("2 Save your progress");
            int choice = 0;
            try_again:
            try
            {
                choice = int.Parse(Console.ReadLine());
            }
            catch (Exception)
            {
                goto try_again;
            }

            switch (choice)
            {
                case 1:
                    player = The_Fery(player);
                    break;
                case 2:
                    return player;

            }
            return player;
        }
コード例 #16
0
ファイル: AreaHandler.cs プロジェクト: pareion/tamagotchi
        internal Player Mount_Anor(Player play)
        {
            try_again:
            Console.Clear();
            player = play;
            Area area = new Area("Mount_Anor", 5);
            player.Area = area;
            Console.WriteLine("As you travel towards the mountains you feel an icy wind coming towards you, \n" +
                "it grows as you get closer and closer to the mountain and as you climb it \n" +
                "you start to feel your insides turn to ice.");
            Console.WriteLine();
            Console.WriteLine("You are in " + area.Name + " level " + area.Level);
            Console.WriteLine("The area consist of eagles, iron golems and stone golems");
            Console.WriteLine(player.stats());
            Console.WriteLine();
            Console.WriteLine("1 Go to Orexdale (level 3)");
            Console.WriteLine("2 Explore the mountain");
            Console.WriteLine("3 Save your progress");
            int choice = 0;
            try
            {
                choice = int.Parse(Console.ReadLine());
            }
            catch (Exception)
            {
                goto try_again;
            }

            switch (choice)
            {
                case 1:
                    player = Orexdale(player);
                    break;
                case 2:
                    Console.Clear();
                    switch (rng.Next(1, 4))
                    {
                        case 1:
                            Enemy enemy = MountAnorEnemy(area.Level);
                            Monster tama = chooseMonster(player);
                            Console.WriteLine("Enemy: " + combatStrength(enemy.Tama));
                            Console.WriteLine("You: " + combatStrength(tama));
                            player = FM.FightMonster(player, tama, enemy);
                            goto try_again;
                        case 2:
                            int metal2 = exploreAreaMetal(area.Level);
                            Console.WriteLine("You found metal " + metal2);
                            player.Metal += metal2;
                            Console.WriteLine();
                            Console.WriteLine("Press enter to continue");
                            Console.ReadLine();
                            Console.Clear();
                            goto try_again;
                        case 3:
                            int money = exploreAreaMoney(area.Level);
                            Console.WriteLine("You found money " + money);
                            player.Money += money;
                            Console.WriteLine();
                            Console.WriteLine("Press enter to continue");
                            Console.ReadLine();
                            Console.Clear();
                            goto try_again;
                    }
                    break;
                case 3:
                    return player;

            }
            return player;
        }
コード例 #17
0
ファイル: World.cs プロジェクト: pareion/tamagotchi
        internal Player GetPlayer()
        {
            //read in Monsters
            string[] Monsters = System.IO.File.ReadAllLines("../../Monster");
            List<Monster> tama2 = new List<Monster>();
            Item.equipment e=0, e2 = 0, e3 = 0, e4 = 0, e5 = 0, e6 = 0;
            foreach (var item in Monsters)
            {
                string[] t2 = item.Split(';');
                Item helmet, chest, weapon, shield, pants, shoes;

                #region fix
                switch (t2[20])
                {
                    case "helmet":
                        e = Item.equipment.helmet;
                        break;
                    case "chest":
                        e = Item.equipment.chest;
                        break;
                    case "pants":
                        e = Item.equipment.pants;
                        break;
                    case "potion":
                        e = Item.equipment.potion;
                        break;
                    case "shield":
                        e = Item.equipment.shield;
                        break;
                    case "shoes":
                        e = Item.equipment.shoes;
                        break;
                    case "weapon":
                        e = Item.equipment.weapon;
                        break;
                    default:
                        break;
                }
                switch (t2[30])
                {
                    case "helmet":
                        e2 = Item.equipment.helmet;
                        break;
                    case "chest":
                        e2 = Item.equipment.chest;
                        break;
                    case "pants":
                        e2 = Item.equipment.pants;
                        break;
                    case "potion":
                        e2 = Item.equipment.potion;
                        break;
                    case "shield":
                        e2 = Item.equipment.shield;
                        break;
                    case "shoes":
                        e2 = Item.equipment.shoes;
                        break;
                    case "weapon":
                        e2 = Item.equipment.weapon;
                        break;
                    default:
                        break;
                }
                switch (t2[40])
                {
                    case "helmet":
                        e3 = Item.equipment.helmet;
                        break;
                    case "chest":
                        e3 = Item.equipment.chest;
                        break;
                    case "pants":
                        e3 = Item.equipment.pants;
                        break;
                    case "potion":
                        e3 = Item.equipment.potion;
                        break;
                    case "shield":
                        e3 = Item.equipment.shield;
                        break;
                    case "shoes":
                        e3 = Item.equipment.shoes;
                        break;
                    case "weapon":
                        e3 = Item.equipment.weapon;
                        break;
                    default:
                        break;
                }
                switch (t2[50])
                {
                    case "helmet":
                        e4 = Item.equipment.helmet;
                        break;
                    case "chest":
                        e4 = Item.equipment.chest;
                        break;
                    case "pants":
                        e4 = Item.equipment.pants;
                        break;
                    case "potion":
                        e4 = Item.equipment.potion;
                        break;
                    case "shield":
                        e4 = Item.equipment.shield;
                        break;
                    case "shoes":
                        e4 = Item.equipment.shoes;
                        break;
                    case "weapon":
                        e4 = Item.equipment.weapon;
                        break;
                    default:
                        break;
                }
                switch (t2[60])
                {
                    case "helmet":
                        e5 = Item.equipment.helmet;
                        break;
                    case "chest":
                        e5 = Item.equipment.chest;
                        break;
                    case "pants":
                        e5 = Item.equipment.pants;
                        break;
                    case "potion":
                        e5 = Item.equipment.potion;
                        break;
                    case "shield":
                        e5 = Item.equipment.shield;
                        break;
                    case "shoes":
                        e5 = Item.equipment.shoes;
                        break;
                    case "weapon":
                        e5 = Item.equipment.weapon;
                        break;
                    default:
                        break;
                }
                switch (t2[70])
                {
                    case "helmet":
                        e6 = Item.equipment.helmet;
                        break;
                    case "chest":
                        e6 = Item.equipment.chest;
                        break;
                    case "pants":
                        e6 = Item.equipment.pants;
                        break;
                    case "potion":
                        e6 = Item.equipment.potion;
                        break;
                    case "shield":
                        e6 = Item.equipment.shield;
                        break;
                    case "shoes":
                        e6 = Item.equipment.shoes;
                        break;
                    case "weapon":
                        e6 = Item.equipment.weapon;
                        break;
                    default:
                        break;
                }
                #endregion
                helmet = new Item(t2[13], int.Parse(t2[14]), int.Parse(t2[15]), int.Parse(t2[16]), int.Parse(t2[17]), int.Parse(t2[18]), int.Parse(t2[19]), e, int.Parse(t2[21]), int.Parse(t2[22]));
                chest = new Item(t2[23], int.Parse(t2[24]), int.Parse(t2[25]), int.Parse(t2[26]), int.Parse(t2[27]), int.Parse(t2[28]), int.Parse(t2[29]), e2, int.Parse(t2[31]), int.Parse(t2[32]));
                weapon = new Item(t2[33], int.Parse(t2[34]), int.Parse(t2[35]), int.Parse(t2[36]), int.Parse(t2[37]), int.Parse(t2[38]), int.Parse(t2[39]), e3, int.Parse(t2[41]), int.Parse(t2[42]));
                shield = new Item(t2[43], int.Parse(t2[44]), int.Parse(t2[45]), int.Parse(t2[46]), int.Parse(t2[47]), int.Parse(t2[48]), int.Parse(t2[49]), e4, int.Parse(t2[51]), int.Parse(t2[52]));
                pants = new Item(t2[53], int.Parse(t2[54]), int.Parse(t2[55]), int.Parse(t2[56]), int.Parse(t2[57]), int.Parse(t2[58]), int.Parse(t2[59]), e5, int.Parse(t2[61]), int.Parse(t2[62]));
                shoes = new Item(t2[63], int.Parse(t2[64]), int.Parse(t2[65]), int.Parse(t2[66]), int.Parse(t2[67]), int.Parse(t2[68]), int.Parse(t2[69]), e6, int.Parse(t2[71]), int.Parse(t2[72]));

                tama2.Add(new Monster(t2[0], int.Parse(t2[1]), t2[2], int.Parse(t2[3]), int.Parse(t2[4]), int.Parse(t2[5]), int.Parse(t2[6]), int.Parse(t2[7]), int.Parse(t2[8]), int.Parse(t2[9]), int.Parse(t2[10]), int.Parse(t2[11]), int.Parse(t2[12]), helmet, chest,weapon,shield,pants,shoes));

            }
            //read in quests
            string[] quests = System.IO.File.ReadAllLines("../../quests");
            List<Quest> quests2 = new List<Quest>();
            foreach (var item in quests)
            {
                string[] q2 = item.Split(';');
                quests2.Add(new Quest(q2[0], q2[1], int.Parse(q2[2]), int.Parse(q2[3]), q2[4], bool.Parse(q2[5]), bool.Parse(q2[6])));
            }
            //read in eggs
            string[] eggs = System.IO.File.ReadAllLines("../../eggs");
            List<Egg> eggs2 = new List<Egg>();
            foreach (var item in eggs)
            {
                string[] e22 = item.Split(';');
                eggs2.Add(new Egg(e22[0], e22[1], int.Parse(e22[2])));
            }
            //read in items
            string[] items = System.IO.File.ReadAllLines("../../items");
            List<Item> items2 = new List<Item>();
            Item.equipment iteeeeem = 0;
            foreach (var item in items)
            {
                string[] ite2 = item.Split(';');
                switch (ite2[7])
                {
                    case "helmet":
                        iteeeeem = Item.equipment.helmet;
                        break;
                    case "chest":
                        iteeeeem = Item.equipment.chest;
                        break;
                    case "pants":
                        iteeeeem = Item.equipment.pants;
                        break;
                    case "potion":
                        iteeeeem = Item.equipment.potion;
                        break;
                    case "shield":
                        iteeeeem = Item.equipment.shield;
                        break;
                    case "shoes":
                        iteeeeem = Item.equipment.shoes;
                        break;
                    case "weapon":
                        iteeeeem = Item.equipment.weapon;
                        break;
                    default:
                        break;
                }
                items2.Add(new Item(ite2[0], int.Parse(ite2[1]), int.Parse(ite2[2]), int.Parse(ite2[3]), int.Parse(ite2[4]), int.Parse(ite2[5]), int.Parse(ite2[6]), iteeeeem, int.Parse(ite2[8]), int.Parse(ite2[9])));
            }
            //read in the player
            string pI = System.IO.File.ReadAllText("../../player");
            string[] pI2 = pI.Split(';');
            Area area = null;
            switch (pI2[4])
            {
                case "Eirin":
                    area = new Area("Eirin");
                    break;
                case "Pladósh":
                    area = new Area("Pladósh");
                    break;
                case "Saepegox":
                    area = new Area("Saepegox");
                    break;
                case "Orexdale":
                    area = new Area("Orexdale");
                    break;
                case "The_Stocades":
                    area = new Area("The_Stocades");
                    break;
                case "Shrine_Of_Jaagi":
                    area = new Area("Shrine_Of_Jaagi");
                    break;
                case "Ferrington":
                    area = new Area("Ferrington");
                    break;
                case "The_Fery":
                    area = new Area("The_Fery");
                    break;
                case "Mount_Anor":
                    area = new Area("Mount_Anor");
                    break;
                case "The_Plague_Lands":
                    area = new Area("The_Plague_Lands");
                    break;
                case "Graveyard":
                    area = new Area("Graveyard");
                    break;
                case "Undead_Castle":
                    area = new Area("Undead_Castle");
                    break;
                case "WitchHut":
                    area = new Area("WitchHut");
                    break;
            }
            Player player = new Player(pI2[0], int.Parse(pI2[1]), int.Parse(pI2[2]), int.Parse(pI2[3]), area, quests2,tama2, eggs2,items2);
            return player;
        }
コード例 #18
0
ファイル: Player.cs プロジェクト: pareion/tamagotchi
        internal bool completeQuest(Quest quest, Area area)
        {
            bool completed = false;
            foreach (var item in questlog)
            {
                if (item.Name == quest.Name)
                {
                    if (item.Progress >= item.GoalValidator)
                    {
                        if (!item.Rewarded)
                        {
                            string[] str = quest.Reward.Split(' ');

                            switch (str[0])
                            {
                                case "herbs":
                                    herbs += int.Parse(str[1]);
                                    break;
                                case "metal":
                                    metal += int.Parse(str[1]);
                                    break;
                                case "money":
                                    money += int.Parse(str[1]);
                                    break;
                            }
                            item.Rewarded = true;
                            completed = true;
                            Console.WriteLine("You have been rewarded with "+str[0] + " "+str[1]);
                        }
                    }
                }
            }
            return completed;
        }