//Creating necessary PictureBox array and the inventory list for creating Inventory
        public Inventory(MainMethods givenMainMethod, MainVariables givenMainVariables, GameStart givenGameStart)
        {
            InitializeComponent();
            inventoryPicbArray = new PictureBox[]  { picBItemOne, picBItemTwo, picBItemThree, picBItemFour, picBItemFive, picBItemSix, picBItemSeven, picBItemEight,
                                                     picBItemNine, picBItemTen, picBItemEleven, picBItemTwelve, picBItemThirteen, picBItemFourteen, picBItemFifteen, picBItemSixteen };
            inventoryNameList = new List <string>();

            mainMethods   = givenMainMethod;
            mainVariables = givenMainVariables;
            gameStart     = givenGameStart;

            mainMethods.Fill_PictureBox(picBInventoryClose, mainVariables.UserInterface_InventoryClose);
            mainMethods.Form_Background_Change(this, mainVariables.UserInterface_InventoryBackground);

            //Filling the inventory slots by going through each item possible, checking if the countvalue is above 0, inventory name list is necessary for the on click
            //event of each picture box, item count not used yet but if i want to put a label or something on health potions, this might come in handy
            int picBWalker = 0;

            for (int i = 0; i < mainVariables.Items_List.Count; i++)
            {
                string[] stringBreaker = mainVariables.Items_List[i].Split('_');
                if (mainMethods.Check_Item_Above_0(i))
                {
                    int itemcount = Int32.Parse(stringBreaker[1]);
                    mainMethods.Fill_PictureBox(inventoryPicbArray[picBWalker], mainVariables.Items_Bitmap_List[i]);
                    inventoryNameList.Add(stringBreaker[0]);
                    picBWalker++;
                }
            }
        }
Example #2
0
        //Initializing mainframe, depending on whether it was called before or not
        public MainFrame()
        {
            InitializeComponent();
            mainVariables = new MainVariables();
            mainMethods   = new MainMethods(mainVariables);
            mainVariables.Music_Soundplayer.Play();

            Initialize_MainMenu();
        }
Example #3
0
        public Main_Dialog(MainVariables givenMainVariables, MainMethods givenMainMethods, string givenName, GameStart GivenGameStart, MainFrame givenMainFrame, int optionCall)
        {
            InitializeComponent();
            gameStart = GivenGameStart;
            mainFrame = givenMainFrame;

            name          = givenName;
            mainVariables = givenMainVariables;
            mainMethods   = givenMainMethods;

            mainMethods.Form_Background_Change(this, mainVariables.UserInterface_DialogboxBackground);
            mainMethods.Fill_PictureBox(picBNextDialog, mainVariables.UserInterface_DialogForward);
            mainMethods.Dialog_Progression(name, optionCall, this, gameStart, mainFrame);
        }
        //Constructor to use the given variables and store the references, filling the pictureboxes etc.
        public IngameMenu(MainVariables givenMainVariables, MainMethods givenMainMethods, GameStart givenGameStart, MainFrame givenMainFrame)
        {
            //Initializing the ingame Menu
            InitializeComponent();

            mainVariables = givenMainVariables;
            mainMethods   = givenMainMethods;
            gamestart     = givenGameStart;
            mainFrame     = givenMainFrame;

            mainMethods.Fill_PictureBox(picBBackToGame, mainVariables.UserInterface_BackToGame);
            mainMethods.Fill_PictureBox(picBSaveGame, mainVariables.UserInterface_SaveGame);
            mainMethods.Fill_PictureBox(picBLoadGame, mainVariables.MainMenu_LoadGame);
            mainMethods.Fill_PictureBox(picBLeaveGame, mainVariables.UserInterface_BackToMainMenu);
            mainMethods.Form_Background_Change(this, mainVariables.UserInterface_IngameMenuBackground);
        }
        //Fills the character Creator with pics and initializes the forms he needs access to
        public CharacterCreation(MainFrame givenMainFrame, MainMethods givenMainMethods, MainVariables givenMainVariabes)
        {
            InitializeComponent();
            mainVariables = givenMainVariabes;
            mainMethods   = givenMainMethods;
            mainFrame     = givenMainFrame;

            mainMethods.Reset_Story_Variables();

            mainMethods.Fill_PictureBox(picBCCStrPlus, mainVariables.CharacterCreation_AttributeUp);
            mainMethods.Fill_PictureBox(picBCCAgiPlus, mainVariables.CharacterCreation_AttributeUp);
            mainMethods.Fill_PictureBox(picBCCIntPlus, mainVariables.CharacterCreation_AttributeUp);
            mainMethods.Fill_PictureBox(picBCCStrMinus, mainVariables.CharacterCreation_AttributeDown);
            mainMethods.Fill_PictureBox(picBCCAgiMinus, mainVariables.CharacterCreation_AttributeDown);
            mainMethods.Fill_PictureBox(picBCCIntMinus, mainVariables.CharacterCreation_AttributeDown);
            mainMethods.Fill_PictureBox(picBCCSend, mainVariables.CharacterCreation_Start);
            mainMethods.Fill_PictureBox(picBCCBack, mainVariables.CharacterCreation_Cancel);
            mainMethods.Fill_PictureBox(picBCCCharPrevious, mainVariables.CharacterCreation_PicPrevious);
            mainMethods.Fill_PictureBox(picBCCCharNext, mainVariables.CharacterCreation_PicNext);
            mainMethods.Fill_PictureBox(picBCharacterCreation, mainVariables.MainCharacter_OnePic);

            mainMethods.Form_Background_Change(this, mainVariables.CharacterCreation_Background);
        }
        private void Initializing_Gamestart(MainMethods givenMainMethods, MainVariables givenMainVariables, MainFrame givenMainFrame)
        {
            mainMethods    = givenMainMethods;
            mainVariables  = givenMainVariables;
            mainFrame      = givenMainFrame;
            inGameMenu     = new IngameMenu(mainVariables, mainMethods, this, mainFrame);
            oneSecondTimer = new Timer();
            lblUiMana.Text = mainVariables.Character_Crystals.ToString();

            try
            { mainVariables.Music_Soundplayer.Stop(); }
            catch (Exception ex) { }

            //What is loaded depends on the place, case 1 is starting area
            switch (mainVariables.StoryLine_Progress)
            {
            case 1:
                mainMethods.Form_Background_Change(this, mainVariables.FirstScreen_Background);
                mainMethods.Character_PictureBox(mainVariables.Character_Picture, picBMainHero);
                mainMethods.Fill_PictureBox(picBSideCharOne, mainVariables.Characters_Maria_Bitmap); picBSideCharOne.Visible = true;
                if (mainVariables.Characters_Maria_Progression != 10)
                {
                    mainMethods.Fill_PictureBox(PicBGoFront, mainVariables.UserInterface_TowardsForest);
                    mainMethods.Fill_PictureBox(PicBFlower1, mainVariables.Items_SingleFlowerBM); PicBFlower1.Visible   = true;
                    mainMethods.Fill_PictureBox(PicBFlower2, mainVariables.Items_SingleFlowerBM); PicBFlower2.Visible   = true;
                    mainMethods.Fill_PictureBox(PicBFlower3, mainVariables.Items_SingleFlowerBM); PicBFlower3.Visible   = true;
                    mainMethods.Fill_PictureBox(PicBFlower4, mainVariables.Items_SingleFlowerBM); PicBFlower4.Visible   = true;
                    mainMethods.Fill_PictureBox(PicBFlower5, mainVariables.Items_SingleFlowerBM); PicBFlower5.Visible   = true;
                    mainMethods.Fill_PictureBox(PicBFlower6, mainVariables.Items_SingleFlowerBM); PicBFlower6.Visible   = true;
                    mainMethods.Fill_PictureBox(PicBFlower7, mainVariables.Items_SingleFlowerBM); PicBFlower7.Visible   = true;
                    mainMethods.Fill_PictureBox(PicBFlower8, mainVariables.Items_SingleFlowerBM); PicBFlower8.Visible   = true;
                    mainMethods.Fill_PictureBox(PicBFlower9, mainVariables.Items_SingleFlowerBM); PicBFlower9.Visible   = true;
                    mainMethods.Fill_PictureBox(PicBFlower10, mainVariables.Items_SingleFlowerBM); PicBFlower10.Visible = true;
                }
                break;

            //case 2 is forest
            case 2:
                mainVariables.UserInterface_DialogboxActive = true;
                mainMethods.Form_Background_Change(this, mainVariables.Background_Forest);
                mainMethods.Fill_PictureBox(picBGoblin, mainVariables.Characters_GoblinBM); picBGoblin.Visible = true;
                picBGoblin.Visible = true;
                main_Dialog        = new Main_Dialog(mainVariables, mainMethods, "Goblin", this, mainFrame);
                main_Dialog.Show();
                break;

            //case 3 is village
            case 3:
                mainMethods.Form_Background_Change(this, mainVariables.Background_City);
                mainMethods.Fill_PictureBox(picBJack, mainVariables.Characters_JackBM);
                if (!mainVariables.Characters_KittenClicked)
                {
                    mainMethods.Fill_PictureBox(picBKitten, mainVariables.Characters_KittenBM);
                }
                if (!mainVariables.Characters_JacksKittenSaved)
                {
                    mainMethods.Fill_PictureBox(picBStuckKitten, mainVariables.Characters_StuckKittenBM);
                }
                mainMethods.Fill_PictureBox(picBJorn, mainVariables.Characters_JornBM);
                picBJorn.Location = new Point(438, 263);
                picBJack.Location = new Point(88, 175);
                mainMethods.Fill_PictureBox(PicBLea, mainVariables.Characters_LeaBM);
                mainMethods.Fill_PictureBox(picBLeaWood, mainVariables.Characters_Lea_Wood);
                if (!mainVariables.Characters_Vendor_TestBought)
                {
                    mainMethods.Fill_PictureBox(picBVendorTest, mainVariables.Items_FinishedTestBM);
                }
                if (!mainVariables.Characters_Vendor_RopeBought)
                {
                    mainMethods.Fill_PictureBox(picBVendorRope, mainVariables.Items_RopeBM);
                }
                mainMethods.Fill_PictureBox(picBVendor, mainVariables.Characters_VendorBM);
                mainMethods.Fill_PictureBox(picBValeria, mainVariables.Characters_Valeria);
                mainMethods.Fill_PictureBox(PicBGoFront, mainVariables.Icon_CityGoTemple);

                break;

            //case 4 is the ending  //<5 //>= 5 && < 9 // 8<
            case 4:

                mainMethods.Fill_PictureBox(picBGoddess, mainVariables.Characters_Goddess);
                mainMethods.Form_Background_Change(this, mainVariables.Backgrounds_Black);
                if (mainVariables.Character_Honor < 5)
                {
                    main_Dialog = new Main_Dialog(mainVariables, mainMethods, "Goddess", this, mainFrame, 11);
                    main_Dialog.Show();
                    mainVariables.UserInterface_DialogboxActive = true;
                }
                else if (mainVariables.Character_Honor > 8)
                {
                    main_Dialog = new Main_Dialog(mainVariables, mainMethods, "Goddess", this, mainFrame, 13);
                    main_Dialog.Show();
                    mainVariables.UserInterface_DialogboxActive = true;
                }
                else
                {
                    main_Dialog = new Main_Dialog(mainVariables, mainMethods, "Goddess", this, mainFrame, 12);
                    main_Dialog.Show();
                    mainVariables.UserInterface_DialogboxActive = true;
                }
                main_Dialog.Location = new Point(1000, 300);
                picBGoddess.Location = new Point(171, 115);
                break;
            }

            // 0) Flowercircle 1) Health potion 2) Sword 3) Finished test 4) Rope 5) Super axe 6) Chicken leg 7) Mirror 8) Giant nut 9) Single flower

            //Adding items to the itemlist and adding bitmaps for those item in a second List
            mainVariables.Items_List.Add(mainVariables.Items_FlowerCircle); mainVariables.Items_List.Add(mainVariables.Items_HealthPotion); mainVariables.Items_List.Add(mainVariables.Items_Sword);
            mainVariables.Items_List.Add(mainVariables.Items_FinishedTest); mainVariables.Items_List.Add(mainVariables.Items_Rope); mainVariables.Items_List.Add(mainVariables.Items_SuperAxe);
            mainVariables.Items_List.Add(mainVariables.Items_ChickenLeg); mainVariables.Items_List.Add(mainVariables.Items_Mirror); mainVariables.Items_List.Add(mainVariables.Items_GiantNut);
            mainVariables.Items_List.Add(mainVariables.Items_SingleFlower);
            //--
            mainVariables.Items_Bitmap_List.Add(mainVariables.Items_FlowerCircleBM); mainVariables.Items_Bitmap_List.Add(mainVariables.Items_HealthPotionBM); mainVariables.Items_Bitmap_List.Add(mainVariables.Items_SwordBM);
            mainVariables.Items_Bitmap_List.Add(mainVariables.Items_FinishedTestBM); mainVariables.Items_Bitmap_List.Add(mainVariables.Items_RopeBM); mainVariables.Items_Bitmap_List.Add(mainVariables.Items_SuperAxeBM);
            mainVariables.Items_Bitmap_List.Add(mainVariables.Items_ChickenLegBM); mainVariables.Items_Bitmap_List.Add(mainVariables.Items_MirrorBM); mainVariables.Items_Bitmap_List.Add(mainVariables.Items_GiantNutBm);
            mainVariables.Items_Bitmap_List.Add(mainVariables.Items_SingleFlowerBM);

            if (mainVariables.StoryLine_Progress == 1 || mainVariables.StoryLine_Progress == 2 || mainVariables.StoryLine_Progress == 3)
            {
                Main_UI();
            }
        }
 //default start when game is loaded via start new game
 public GameStart(MainMethods givenMainMethods, MainVariables givenMainVariables, MainFrame givenMainFrame)
 {
     InitializeComponent();
     Initializing_Gamestart(givenMainMethods, givenMainVariables, givenMainFrame);
 }