Esempio n. 1
0
 private void UpgradeArmorButton_Click(object sender, EventArgs e)
 {
     if (map.Player.UnlockedArmors[1])
     {
         if (map.Player.Gold >= 250)
         {
             map.Player.UnlockedArmors[2] = true;
             map.Player.Gold     -= 250;
             map.Player.WornArmor = 3;
             map.Player.ChangeArmor(new HeavyArmor());
             UpgradeArmorButton.Hide();
             RefreshGold();
         }
         else
         {
             MessageBox.Show("Nie stać Cię");
         }
     }
     else if (map.Player.Gold >= 150)
     {
         map.Player.UnlockedArmors[1] = true;
         map.Player.Gold     -= 150;
         map.Player.WornArmor = 2;
         map.Player.ChangeArmor(new MediumArmor());
         UpgradeArmorButton.Text = "Ulepsz Zbroję (250)";
         ArmorUpgradeToolTip.SetToolTip(UpgradeArmorButton, HeavyArmor.Def.ToString() + " zręczności, " + HeavyArmor.Str.ToString() + " siły");
         RefreshGold();
     }
     else
     {
         MessageBox.Show("Nie stać Cię");
     }
 }
Esempio n. 2
0
        public Merchant(Map m)
        {
            map = m;
            InitializeComponent();

            if (!map.Player.UnlockedArmors[0] || map.Player.UnlockedArmors[2])
            {
                UpgradeArmorButton.Hide();
            }

            if (map.Player.UnlockedArmors[1])
            {
                UpgradeArmorButton.Text = "Ulepsz zbroję (250)";
                ArmorUpgradeToolTip.SetToolTip(UpgradeArmorButton, HeavyArmor.Def.ToString() + " zręczności, " + HeavyArmor.Str.ToString() + " siły");
            }
            else
            {
                UpgradeArmorButton.Text = "Ulepsz zbroję (150)";
                ArmorUpgradeToolTip.SetToolTip(UpgradeArmorButton, MediumArmor.Def.ToString() + " zręczności, " + MediumArmor.Str.ToString() + " siły");
            }


            if (!map.Player.UnlockedWeapons[0] || map.Player.UnlockedWeapons[2])
            {
                UpgradeWeaponButton.Hide();
            }

            if (map.Player.UnlockedWeapons[1])
            {
                WeaponUpgradeToolTip.SetToolTip(UpgradeWeaponButton, HeavyWeapon.Def.ToString() + " zręczności, " + HeavyWeapon.Str.ToString() + " siły");
                UpgradeWeaponButton.Text = "Ulepsz broń (250)";
            }
            else
            {
                UpgradeWeaponButton.Text = "Ulepsz broń (150)";
                WeaponUpgradeToolTip.SetToolTip(UpgradeWeaponButton, MediumWeapon.Def.ToString() + " zręczności, " + MediumWeapon.Str.ToString() + " siły");
            }


            if (!map.Player.UnlockedShields[0] || map.Player.UnlockedShields[1])
            {
                UpgradeShieldButton.Hide();
            }
            else
            {
                ShieldUpgradeToolTip.SetToolTip(UpgradeShieldButton, HeavyShield.Def.ToString() + " zręczności, " + HeavyShield.Str.ToString() + " siły");
                UpgradeShieldButton.Text = "Ulepsz tarczę (150)";
            }

            if (!map.Player.UnlockedHelmets[0] || map.Player.UnlockedHelmets[1])
            {
                UpgradeHelmetButton.Hide();
            }
            else
            {
                HelmetUpgradeToolTip.SetToolTip(UpgradeHelmetButton, HeavyHelmet.Def.ToString() + " zręczności, " + HeavyHelmet.Str.ToString() + " siły");
                UpgradeHelmetButton.Text = "Ulepsz hełm (180)";
            }



            RefreshGold();
        }