Example #1
0
        // constructor and methods below

        public GameSession(GamePage parentPage, string playerChoice)
        {
            // core
            this.parentPage = parentPage;
            CurrentPlayer   = new Mage(this);
            if (playerChoice != null)
            {
                if (playerChoice.Contains("Fizyczna"))
                {
                    CurrentPlayer = new Warrior(this);
                }
            }
            itemPositions = new List <int>();
            activeItems   = new List <Item>();
            parentPage.AddConsoleText("Witaj w grze!");
            RefreshStats();
            SoundEngine       = parentPage.soundEngine;
            ChildSoundEngines = new List <SoundEngine>();
            // map
            metaMapMatrix = new MetaMapMatrix(this);
            mapMatrix     = metaMapMatrix.GetCurrentMatrix(0);
            //mapMatrix.Matrix[15, 15] = 3001;
            AvailableMoves = new bool[4];
            InitializeMapDisplay(0);
            // starting skills and items
            if (playerChoice != null)
            {
                if (playerChoice.Contains("topor"))
                {
                    ProduceItem("item0003");
                    CurrentPlayer.Learn(new AxeCut());
                    CurrentPlayer.Learn(new SwordSlash());
                    CurrentPlayer.Learn(new SpearStab());
                }
                else if (playerChoice.Contains("miecz"))
                {
                    ProduceItem("item0004");
                    CurrentPlayer.Learn(new AxeCut());
                    CurrentPlayer.Learn(new SwordSlash());
                    CurrentPlayer.Learn(new SpearStab());
                }
                else if (playerChoice.Contains("wlocznia"))
                {
                    ProduceItem("item0002");
                    CurrentPlayer.Learn(new AxeCut());
                    CurrentPlayer.Learn(new SwordSlash());
                    CurrentPlayer.Learn(new SpearStab());
                }
                else if (playerChoice.Contains("Ognista"))
                {
                    ProduceItem("item0001");
                    CurrentPlayer.Learn(new FireArrow());
                }
                else if (playerChoice.Contains("Podmuch"))
                {
                    ProduceItem("item0001");
                    CurrentPlayer.Learn(new WindGust());
                }
            }
        }
Example #2
0
 public GameSession(GamePage parentPage, string playerChoice)
 {
     // core
     this.parentPage = parentPage;
     currentPlayer   = new Mage(this);
     if (playerChoice != null)
     {
         if (playerChoice.Contains("Warrior"))
         {
             currentPlayer = new Warrior(this);
         }
     }
     itemPositions = new List <int>();
     items         = new List <Item>();
     parentPage.AddConsoleText("Welcome to the game!");
     RefreshStats();
     // map
     metaMapMatrix  = new MetaMapMatrix();
     mapMatrix      = metaMapMatrix.GetCurrentMatrix(0);
     AvailableMoves = new bool[4];
     InitializeMapDisplay(0);
     // starting skills and items
     if (playerChoice != null)
     {
         if (playerChoice.Contains("Axe"))
         {
             ProduceItem("item0003");
             currentPlayer.Learn(new AxeCut());
         }
         else if (playerChoice.Contains("Sword"))
         {
             ProduceItem("item0009");
             ProduceItem("item0010");
             ProduceItem("item0012");
             currentPlayer.Learn(new SwordSlash());
         }
         else if (playerChoice.Contains("Spear"))
         {
             ProduceItem("item0002");
             currentPlayer.Learn(new SpearStab());
         }
         else if (playerChoice.Contains("Fire"))
         {
             ProduceItem("item0001");
             currentPlayer.Learn(new FireArrow());
         }
         else if (playerChoice.Contains("Wind"))
         {
             ProduceItem("item0001");
             currentPlayer.Learn(new WindGust());
         }
     }
 }