コード例 #1
0
        private void GetPlayerAction()
        {
            GameUtils.GetDelayedText($"You currently have {player.goldCoins} Goldcoins");
            GameUtils.GetDelayedText("So what do you wanna do?");
            Console.Write("Type either the name of the item you wish to buy or q to leave: ");
            var answer = Console.ReadLine();

            try
            {
                string properAnswer = answer;

                if (properAnswer == "q")
                {
                    _isDone = true;
                    Console.WriteLine($"You thank {owner} and leave the store \n");
                }
                else
                {
                    ConductBusiness(properAnswer);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine("The Shopkeeper shakes his head in disappointment towards you\n");
                GetPlayerAction();
            }
        }
コード例 #2
0
        void SetupCharacter()
        {
            Console.Write("Input the name of your character: ");
            var chosenName = Console.ReadLine();

            player = new Player(chosenName);

            GameUtils.GetDelayedText($"A fitting name for a warrior, {player.name}", 1200);
            GameUtils.GetDelayedText("Good luck on your adventure young traveller", 1200);
            GameUtils.GetDelayedText("and so the journey begins....", 1200);
            GameUtils.GetDelayedText("\n\n\n\n", 1200);
        }
コード例 #3
0
ファイル: Encounter.cs プロジェクト: Alegherix/Makruul
 public bool GetPlayerFightResponse()
 {
     GameUtils.GetDelayedText($"You spot a {monster.name} in the distance", 950);
     Console.WriteLine("What do you want to do?");
     Console.WriteLine($"1) I laugh in the face of danger, I want to kill {monster.name}!!");
     Console.WriteLine("2) I'm a feeling a little off about this one, time to flee");
     Console.Write("1/2: ");
     if (!int.TryParse(Console.ReadLine(), out var answer))
     {
         Console.WriteLine("You have to type either 1 or 2!");
         GetPlayerFightResponse();
     }
     Console.WriteLine("\n");
     return(answer == 1);
 }
コード例 #4
0
ファイル: StartingZone.cs プロジェクト: Alegherix/Makruul
        public void EnterStartingZone()
        {
            List <string> gameTexts = new List <string>()
            {
                "You find yourself wandering aimlessly in a dark forest",
                "You let your eyes wonder freely trying to make out something of resemblance",
                "You hear a muffled roar coming from some bushes just behind some cow parsley.",
            };

            foreach (var gameText in gameTexts)
            {
                GameUtils.GetDelayedText(gameText, 1200);
            }

            initialEncounter.Run();
        }
コード例 #5
0
ファイル: PlayerAction.cs プロジェクト: Alegherix/Makruul
        public int GetPlayerChoice()
        {
            Console.WriteLine();
            GameUtils.GetDelayedText("What do you want to do now?");

            string[]      playerOptions = player.GetOptions();
            List <string> allOptions    = new List <string>(playerOptions);

            allOptions.Add("Search for more monsters to slay!");
            allOptions.Add(("I want to head into town!"));

            for (int i = 0; i < allOptions.Count; i++)
            {
                Console.WriteLine($"{i}) {allOptions[i]}");
            }
            Console.Write("Choice: ");
            return(GameUtils.GetNumberInput());
        }
コード例 #6
0
ファイル: GeneralStore.cs プロジェクト: Alegherix/Makruul
 protected override void GreetPlayer()
 {
     GameUtils.GetDelayedText($"\nHello there traveller, I'm {owner} welcome to my store", 600);
     GameUtils.GetDelayedText("I assume you want to browse my goods!\n");
 }
コード例 #7
0
 public void TellStoryTask()
 {
     GameUtils.GetDelayedText("Your task is to find Makruul the gruesome, a hideous werewolf that's been ravaging the lands", 800);
     GameUtils.GetDelayedText("The last time he was spotted was close to cave", 1200);
 }
コード例 #8
0
ファイル: Weaponsmith.cs プロジェクト: Alegherix/Makruul
 protected override void GreetPlayer()
 {
     GameUtils.GetDelayedText($"Hello there traveller, I'm {owner}, the town blacksmith!", 600);
     GameUtils.GetDelayedText("I assume you want to browse my weapons!\n", 600);
 }