Пример #1
0
        public void AccessChest()
        {
            var exit = false;

            while (!exit)
            {
                PrintChestMenu();
                switch (GameService.ParseIntput())
                {
                case 1:
                    GameService.NewPage("\nWhich item would you like to take?", "chest");
                    Console.ReadKey();
                    break;

                case 2:
                    GameService.NewPage("\nWhich item would you like to store?", "chest");
                    Console.ReadKey();
                    break;

                case 3:
                    exit = true;
                    break;

                default:
                    Console.WriteLine("Invalid input");
                    Console.ReadKey();
                    break;
                }
            }
        }
Пример #2
0
 private void PrintChestMenu()
 {
     GameService.NewPage("\nWhat would you like to do?" +
                         "\n1) Take Items" +
                         "\n2) Store Items" +
                         "\n3) Exit Chest", "chest");
 }
Пример #3
0
 private void PrintLeaveMenu()
 {
     GameService.NewPage("Where will you go?" +
                         "\n1) Explore the Surrounding Area" +
                         "\n2) Travel to City" +
                         "\n3) Return to Village");
 }
Пример #4
0
        private void GuildStore()
        {
            bool leaveStore = false;

            while (!leaveStore)
            {
                PrintStoreMenu();
                _saveServices.SaveGame(_characterSuperModel);
                switch (GameService.ParseIntput())
                {
                case 1:
                    ShopWeapons();
                    break;

                case 2:
                    GameService.NewPage("No refunds! Go away!", "inv");
                    Console.ReadKey();
                    break;

                case 3:
                    BuyPotion();
                    break;

                case 4:
                    leaveStore = true;
                    break;

                default:
                    Console.WriteLine("Invalid input.");
                    Console.ReadKey();
                    break;
                }
            }
        }
Пример #5
0
        private void PrintCurrentAttacks()
        {
            var currentType = AtkType.Melee;

            if (_characterSuperModel.CombatStyle == StyleType.Melee)
            {
                currentType = AtkType.Melee;
            }
            else if (_characterSuperModel.CombatStyle == StyleType.Ranged)
            {
                currentType = AtkType.Ranged;
            }
            else if (_characterSuperModel.CombatStyle == StyleType.Mage)
            {
                currentType = AtkType.Mage;
            }

            GameService.NewPage("\nYou look at your items" +
                                $"\n{"ID",-2}  {"Name",-20}  {"Type",-6}  {"Lvl",-3}  {"Stun",-5}  {"D.O.T.",-6}  {"Stealth",-5}", "inv");
            foreach (Attacks attack in _characterSuperModel.CharacterAttacks.Where(i => i.TypeOfAtk == currentType))
            {
                Console.WriteLine(attack);
            }
            Console.ReadLine();
        }
Пример #6
0
        private void PrintCurrentItems()
        {
            var currentType = GearType.Melee;

            if (_characterSuperModel.CombatStyle == StyleType.Melee)
            {
                currentType = GearType.Melee;
            }
            else if (_characterSuperModel.CombatStyle == StyleType.Ranged)
            {
                currentType = GearType.Ranged;
            }
            else if (_characterSuperModel.CombatStyle == StyleType.Mage)
            {
                currentType = GearType.Mage;
            }

            GameService.NewPage("\nYou look at your items" +
                                $"\n{"ID",-2}  {"Name",-18}  {"Type",-6}  {"Lvl",-4}  {"ATK+",-4}  {"HP+",-4}", "inv");
            foreach (Equipment item in _characterSuperModel.CharacterEquipment.Where(i => i.GearType == currentType))
            {
                Console.WriteLine(item);
            }
            Console.ReadLine();
        }
Пример #7
0
        private bool SaveAndQuit()
        {
            var confirm   = false;
            var confirmed = false;

            while (!confirmed)
            {
                GameService.NewPage("\nAre you sure you want to Save and Quit?" +
                                    "\n1) Yes I want to save and quit" +
                                    "\n2) No I want to return to the game", "saveQuit");
                confirmed = true;
                switch (GameService.ParseIntput())
                {
                case 1:
                    _saveServices.SaveGame(_characterSuperModel);
                    confirm = true;
                    break;

                case 2:
                    break;

                default:
                    confirmed = false;
                    Console.WriteLine("Invalid input.");
                    Console.ReadKey();
                    break;
                }
            }
            return(confirm);
        }
Пример #8
0
 private void PrintShopCategory()
 {
     GameService.NewPage("\nWhich combat style would you like to browse?" +
                         "\n1) Melee" +
                         "\n2) Ranged" +
                         "\n3) Magic" +
                         "\n4) Return to Shop", "shop");
 }
Пример #9
0
 private void PrintStoreMenu()
 {
     GameService.NewPage($"\nWhat would you like to do?" +
                         $"\n1) Buy Items" +
                         $"\n2) Sell Items" +
                         $"\n3) Buy Health Potion" +
                         $"\n4) Leave Shop", "shop");
 }
Пример #10
0
 private void PrintGuildMenu()
 {
     GameService.NewPage("\n1) Shop for Gear" +
                         "\n2) Speak to Master Swordsman" +
                         "\n3) Speak to Master Archer" +
                         "\n4) Speak to Master Mage" +
                         "\n5) Return to City", "guild");
 }
Пример #11
0
 private void PrintStyleMenu()
 {
     GameService.NewPage($"\nYour current Combat Style is set to {_characterSuperModel.CombatStyle}." +
                         "\n\nWhich combat style would you like to focus on?" +
                         "\n1) Melee" +
                         "\n2) Ranged" +
                         "\n3) Mage", "inv");
 }
Пример #12
0
 private void PrintHomeMenu()
 {
     GameService.NewPage($"\nWelcome home!" +
                         $"\nWhat would you like to do?" +
                         $"\n1) Access your Chest" +
                         $"\n2) Sleep in your Bed (+{healthFromPlayerBed} HP)" +
                         $"\n3) Leave your Home", "home");
 }
Пример #13
0
        private void PositiveCommute()
        {
            var newRand = _rand.Next(1, 2);

            GameService.NewPage($"\nWhile on your way you found {newRand} Gold!", "event");
            _characterSuperModel.Gold += newRand;
            Console.ReadKey();
        }
Пример #14
0
        private void PositiveEvent()
        {
            var newRand = _rand.Next(1, 4);

            GameService.NewPage($"\nWhile exploring you found {newRand} Gold!", "event");
            _characterSuperModel.Gold += newRand;
            Console.ReadKey();
        }
Пример #15
0
 private void PrintShopItems(List <Equipment> itemList, string key)
 {
     GameService.NewPage($"\nWhich item would you like to buy?" +
                         $"\n{"ID",-2}  {"Name",-18}  {"Type",-6}  {"Lvl",-4}  {"ATK+",-4}  {"HP+",-4}", key);
     foreach (Equipment item in itemList)
     {
         Console.WriteLine(item);
     }
 }
Пример #16
0
 private void PrintMenuOptions()
 {
     GameService.NewPage($"\nAh. Home sweet home. It's a perfectly boring small village but it's all you've known for most of your life.\nA small collection of huts filled with familiar faces. A few small children are running around playing a game.\nIt sure is good to be home. While you may be forced to travel now this will always be home.\nOne of the children sees you and yells \"Welcome home {_characterSuperModel.CharacterName}!\"" +
                         $"\n\n{GameService.GetCharacterStats(_characterSuperModel)}" +
                         $"\n\nWhat do you do?" +
                         $"\n\n1) Visit your Master" +
                         $"\n2) Go Home" +
                         $"\n3) Open Inventory" +
                         $"\n4) Leave Village", "village");
 }
Пример #17
0
 private void EnterArena()
 {
     GameService.NewPage("You enter the arena", "arena");
     _combatService.ArenaFight(_characterSuperModel);
     if (_characterSuperModel.IsDead)
     {
         Console.WriteLine("YOU DIED");
         Console.ReadKey();
     }
 }
Пример #18
0
 private void PrintMenuOptions()
 {
     GameService.NewPage($"\nThe city is filled with people bustling about. You see women and children bouncing from one market stall to another.\nWhat really catches your eye is the massive arena in the center of town. At least maybe now you won't get lost again.\nOff in the distance you recognize the Combat Guild's banner waving over a few neighboring structures. You make a\nmental note to make your way there for training or a new weapon." +
                         $"\n\n{GameService.GetCharacterStats(_characterSuperModel)}" +
                         $"\n\nWhat to do?" +
                         $"\n\n1) Visit the Combat Guild" +
                         $"\n2) Fight in the Arena" +
                         $"\n3) Sleep at the Inn (+{healthFromInnBed} HP)" +
                         $"\n4) Open Inventory" +
                         $"\n5) Leave City", "city");
 }
Пример #19
0
        private void PrintInvMenu()
        {
            var s = "";

            if (_characterSuperModel.PotionCount != 1)
            {
                s = "s";
            }
            GameService.NewPage($"\n{GameService.GetCharacterStats(_characterSuperModel)}" +
                                $"\nYou have {_characterSuperModel.PotionCount} health potion{s}." +
                                "\n\nWhat would you like to do?" +
                                $"\n1) See owned {_characterSuperModel.CombatStyle} Items" +
                                $"\n2) See known {_characterSuperModel.CombatStyle} Attacks" +
                                "\n3) Choose Combat Style" +
                                "\n4) Save and Quit" +
                                "\n5) Exit Inventory", "inv");
        }
Пример #20
0
        private void VisitGuildMaster(string guildName)
        {
            var guildKey = "";

            switch (guildName)
            {
            case "Melee":
                guildKey = "meleeGuild";
                break;

            case "Ranged":
                guildKey = "archerGuild";
                break;

            case "Mage":
                guildKey = "mageGuild";
                break;
            }

            var exit = false;

            while (!exit)
            {
                exit = true;

                GameService.NewPage($"\nYou approach the {guildName} Guild Master and..." +
                                    $"\n1) Learn new Attacks" +
                                    $"\n2) Leave", guildKey);
                switch (GameService.ParseIntput())
                {
                case 1:
                    LearnAttacks(_characterSuperModel, guildName);
                    break;

                case 2:
                    break;

                default:
                    Console.WriteLine("Invalid input");
                    Console.ReadKey();
                    break;
                }
            }
        }
Пример #21
0
        public bool RunMenu()
        {
            var leaveVillage = false;

            while (!leaveVillage)
            {
                PrintMenuOptions();
                _saveServices.SaveGame(_characterSuperModel);
                var input = GameService.ParseIntput();
                switch (input)
                {
                case 1:
                    GameService.NewPage("\nYou go knock on the elder's door to recieve instruction. After a minute or so of waiting you realize no one is home." +
                                        "\nOff in the distance you hear someone muttering something about maybe not waiting until the weekend next time and actually\n" +
                                        "implementing features they advertise. Then again, maybe you're hearing things. It's okay though, you don't need handholding.", "elder");
                    Console.ReadKey();
                    break;

                case 2:
                    GoHome();
                    break;

                case 3:
                    bool leaveFromInv = _inventoryServices.OpenInventory();
                    if (leaveFromInv)
                    {
                        return(false);
                    }
                    break;

                case 4:
                    leaveVillage = Leave();
                    break;

                default:
                    Console.WriteLine("Invalid input.");
                    Console.ReadKey();
                    break;
                }
            }
            return(leaveVillage);
        }
Пример #22
0
        private bool Leave()
        {
            var leave  = false;
            var output = false;

            while (!leave)
            {
                PrintLeaveMenu();
                leave = true;
                switch (GameService.ParseIntput())
                {
                case 1:
                    var isDead = _exploringServices.Explore();
                    if (isDead)
                    {
                        GameService.NewPage("You slowly open your eyes. \"Wha.. what happened?\"\n" +
                                            "Near your bed you find a note a note. It reads:\n\n" +
                                            "\"Found you beaten and bruised out by the road. What kind of champion are you trying to be? Don't do it again.\"");
                        _characterSuperModel.CharacterHealth = _characterSuperModel.CharacterMaxHealth;
                        Console.ReadKey();
                    }
                    output = false;
                    break;

                case 2:
                    output = true;
                    break;

                case 3:
                    output = false;
                    break;

                default:
                    Console.WriteLine("Invalid input");
                    leave = false;
                    Console.ReadKey();
                    break;
                }
            }
            return(output);
        }
Пример #23
0
        private void GoHome()
        {
            var leaveHome = false;

            while (!leaveHome)
            {
                PrintHomeMenu();
                var input = GameService.ParseIntput();
                switch (input)
                {
                case 1:
                    _inventoryServices.AccessChest();
                    break;

                case 2:
                    if ((_characterSuperModel.CharacterHealth += healthFromPlayerBed) > _characterSuperModel.CharacterMaxHealth)
                    {
                        _characterSuperModel.CharacterHealth = _characterSuperModel.CharacterMaxHealth;
                    }
                    else
                    {
                        _characterSuperModel.CharacterHealth += healthFromPlayerBed;
                    }
                    GameService.NewPage($"You sleep in your bed and recover {healthFromPlayerBed} HP." +
                                        $"\nYou now have {_characterSuperModel.CharacterHealth}/{_characterSuperModel.CharacterMaxHealth} HP.");
                    Console.ReadLine();
                    break;

                case 3:
                    leaveHome = true;
                    break;

                default:
                    Console.WriteLine("Invalid input");
                    Console.ReadKey();
                    break;
                }
            }
        }
Пример #24
0
        private void Fight(CharacterSuperModel u, NPCS enemy)
        {
            CharacterSuperModel CurrentStatus = u;
            NPCS EnemyCurrentStatus           = enemy;
            int  yourATK = 0;

            while (CurrentStatus.CharacterHealth > 0 && EnemyCurrentStatus.HP > 0)
            {
Repeat:
                GameService.NewPage($"\n{EnemyCurrentStatus.NPCName}\n" +
                                    $"Hp:{EnemyCurrentStatus.HP}/{enemy.HP}\n\n\n\n\n" +
                                    $"{CurrentStatus.CharacterName}\n" +
                                    $"Hp: {CurrentStatus.CharacterHealth}/{CurrentStatus.CharacterMaxHealth}\n" +
                                    "[1. Attack]\n" +
                                    "[2. Drink Hp Pot]: " + (CurrentStatus.PotionCount) + " Remaining \n" +
                                    "[3. Run]\n"
                                    , "battle");
                char response = Console.ReadKey().KeyChar;

                switch (response)
                {
                case '1':
                {
                    EnemyCurrentStatus.HP -= YourAtkResult(DisplayAndPickAtkOptions(_characterSuperModel.CharacterAttacks).DMG);
                    break;
                }

                case '2':
                {
                    if (CurrentStatus.PotionCount > 0)
                    {
                        CurrentStatus.PotionCount--;
                        if (CurrentStatus.CharacterHealth != CurrentStatus.CharacterMaxHealth)
                        {
                            if ((CurrentStatus.CharacterHealth + 10) <= CurrentStatus.CharacterMaxHealth)
                            {
                                CurrentStatus.CharacterHealth += 10;
                            }
                            else
                            {
                                CurrentStatus.CharacterHealth = CurrentStatus.CharacterMaxHealth;
                            }
                            Console.WriteLine("You Feel Better.");
                        }
                        else
                        {
                            Console.WriteLine("You're already at max health.");
                            goto Repeat;
                        }
                        Console.ReadLine();
                    }
                    else
                    {
                        Console.WriteLine("You are out of Potions!");
                        Console.ReadLine();
                        goto Repeat;
                    }
                    break;
                }

                case '3':
                {
                    Console.WriteLine("You Ran...");
                    Console.ReadLine();
                    goto EndFight;
                }

                default:
                {
                    goto Repeat;
                }
                }
                if (enemy.HP >= 1)
                {
                    EnemyAtk(enemy.ATK);
                }
            }
            if (_characterSuperModel.CharacterHealth > 0)
            {
                _characterSuperModel.CharacterLevel++;
                _characterSuperModel.CharacterBaseHealth += 2;
                _characterSuperModel.CharacterMaxHealth  += 2;
                _characterSuperModel.CharacterHealth      = _characterSuperModel.CharacterMaxHealth;
                _characterSuperModel.Gold += ((enemy.ATK) * 2);
            }
            else
            {
                _characterSuperModel.IsDead = true;
            }
            EndFight :;
        }
Пример #25
0
 private void NeutralCommute()
 {
     GameService.NewPage("\nYour commute went entirely uninterrupted.", "filler");
     Console.ReadKey();
 }
Пример #26
0
        public bool RunMenu()
        {
            bool leaveCity = false;

            while (!leaveCity)
            {
                PrintMenuOptions();
                _saveServices.SaveGame(_characterSuperModel);
                var input = GameService.ParseIntput();
                switch (input)
                {
                case 1:
                    GuildMenu();
                    break;

                case 2:
                    EnterArena();
                    if (_characterSuperModel.IsDead)
                    {
                        GameService.NewPage("You slowly open your eyes. \"Wha.. what happened?\"\n" +
                                            "Near your bed you find a note a note. It reads:\n\n" +
                                            "\"You got smashed bud. Maybe you should train a bit more before you enter the arena again.\"");
                        _characterSuperModel.CharacterHealth = _characterSuperModel.CharacterMaxHealth;
                        Console.ReadKey();
                    }
                    break;

                case 3:
                    if ((_characterSuperModel.CharacterBaseHealth += healthFromInnBed) > _characterSuperModel.CharacterMaxHealth)
                    {
                        _characterSuperModel.CharacterHealth = _characterSuperModel.CharacterMaxHealth;
                    }
                    else
                    {
                        _characterSuperModel.CharacterHealth += healthFromInnBed;
                    }
                    GameService.NewPage($"You sleep in a comfy bed at the inn and recover {healthFromInnBed} HP." +
                                        $"\nYou now have {_characterSuperModel.CharacterHealth}/{_characterSuperModel.CharacterMaxHealth} HP.");
                    Console.ReadKey();
                    break;

                case 4:
                    bool leaveFromInv = _inventoryServices.OpenInventory();
                    if (leaveFromInv)
                    {
                        return(false);
                    }
                    break;

                case 5:
                    leaveCity = Leave();
                    break;

                default:
                    Console.WriteLine("Invalid input.");
                    Console.ReadKey();
                    break;
                }
            }
            return(leaveCity);
        }
Пример #27
0
 private void NeutralEvent()
 {
     GameService.NewPage("\nYou found nothing and decided to head back.", "filler");
     Console.ReadKey();
 }