Пример #1
0
 private void UpgradeHelmetButton_Click(object sender, EventArgs e)
 {
     if (map.Player.Gold >= 180)
     {
         map.Player.Gold -= 180;
         map.Player.UnlockedHelmets[1] = true;
         map.Player.ChangeHelmet(new HeavyHelmet());
         map.Player.WornHelmet = 2;
         UpgradeHelmetButton.Hide();
         RefreshGold();
     }
     else
     {
         MessageBox.Show("Nie stać Cię");
     }
 }
Пример #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();
        }