Esempio n. 1
0
        private void inventoryBluePotionPB_Click(object sender, EventArgs e)
        {
            string weaponName = "Blue Potion";

            game.Equip(weaponName);
            DisplayEquippedWeaponInventory(weaponName);
        }
Esempio n. 2
0
 private void iSword_Click(object sender, EventArgs e)
 {
     if (game.CheckPlayerInventory("Sword"))
     {
         game.Equip("Sword");
         EquipWeapon("Sword");
         iSword.BorderStyle = BorderStyle.FixedSingle;
     }
 }
Esempio n. 3
0
 private void Weapon1_Click(object sender, EventArgs e)
 {
     game.Equip("Sword");
     Weapon1.BorderStyle        = BorderStyle.Fixed3D;
     Weapon2.BorderStyle        = BorderStyle.FixedSingle;
     Weapon3.BorderStyle        = BorderStyle.FixedSingle;
     bluePotionInEq.BorderStyle = BorderStyle.FixedSingle;
     RedPotionInEq.BorderStyle  = BorderStyle.FixedSingle;
 }
Esempio n. 4
0
 private void SelectInventoryItem(PictureBox item, string itemName, string weaponType)
 {
     if (_game.CheckPlayerInventory(itemName))
     {
         _game.Equip(itemName);
         RemoveInventoryBorders();
         item.BorderStyle = BorderStyle.FixedSingle;
         SetupAttackButtons(weaponType);
         RemoveInventoryBorders();
     }
 }
Esempio n. 5
0
 private void swordInv_Click(object sender, EventArgs e)
 {
     if (game.CheckPlayerInventory("Sword"))
     {
         game.Equip("Sword");
         swordInv.BorderStyle      = BorderStyle.FixedSingle;
         bowInv.BorderStyle        = BorderStyle.None;
         maceInv.BorderStyle       = BorderStyle.None;
         bluePotionInv.BorderStyle = BorderStyle.None;
         redPotionInv.BorderStyle  = BorderStyle.None;
     }
 }
Esempio n. 6
0
        void SwapWeapons(string weaponName)
        {
            invBow.BorderStyle   = BorderStyle.None;
            invSword.BorderStyle = BorderStyle.None;
            invMace.BorderStyle  = BorderStyle.None;
            invBlue.BorderStyle  = BorderStyle.None;
            invRed.BorderStyle   = BorderStyle.None;

            game.Equip(weaponName);
            TurnOnArrows();
            switch (weaponName)
            {
            case "Sword":
                invSword.BorderStyle = BorderStyle.Fixed3D;
                break;

            case "Bow":
                invBow.BorderStyle = BorderStyle.Fixed3D;
                break;

            case "Mace":
                invMace.BorderStyle = BorderStyle.Fixed3D;
                break;

            case "Blue Potion":
                invBlue.BorderStyle = BorderStyle.Fixed3D;
                TurnOffArrows();
                break;

            case "Red Potion":
                invRed.BorderStyle = BorderStyle.Fixed3D;
                TurnOffArrows();
                break;
            }
        }
Esempio n. 7
0
        private void InventoryAxePictureBox_Click(object sender, EventArgs e)
        {
            if (game.ChekPlayerInventory("Axe"))
            {
                game.Equip("Axe");
                InventoryAxePictureBox.BorderStyle        = BorderStyle.Fixed3D;
                InventoryMacePictureBox.BorderStyle       = BorderStyle.None;
                InventorySwordPictureBox.BorderStyle      = BorderStyle.None;
                InventoryBluePotionPictureBox.BorderStyle = BorderStyle.None;
                InventoryRedPotionPictureBox.BorderStyle  = BorderStyle.None;

                AttackUpButton.Text       = "↑";
                AttackLeftButton.Visible  = true;
                AttackRightButton.Visible = true;
                AttackDownButton.Visible  = true;
            }
        }
Esempio n. 8
0
        private void UpdateInventory(string weaponName)
        {
            Control control = null;

            switch (weaponName)
            {
            case "Red Potion":
                control = RedPotionInvSprite;

                break;

            case "Blue Potion":
                control = BluePotionInvSprite;
                game.Equip("Blue Potion");
                break;

            case "Sword":
                control = SwordInvSprite;
                break;

            case "Bow":
                control = BowInvSprite;
                break;

            case "Mace":
                control = MaceInvSprite;
                break;
            }

            if (game.CheckPlayerInventory(weaponName))
            {
                control.Visible = true;
                if (weaponName == "Red Potion")
                {
                    game.Equip("Red Potion");
                }
                else if (weaponName == "Blue Potion")
                {
                    game.Equip("Blue Potion");
                }
            }
            if (game.PlayerEquippedWeapon != null)
            {
                if (game.PlayerEquippedWeapon.Name == weaponName)
                {
                    control.BackColor = Color.Blue;
                }
            }
        }