示例#1
0
        private void TmDef_Tick(object sender, EventArgs e)
        {
            defSure++;
            ClsPot potBilgi = new ClsPot();

            if (defSure == potBilgi.Sure)
            {
                lblAtak.Text = (Convert.ToInt32(lblDef.Text) - potBilgi.Etki).ToString();
                lbBilgi.Items.Add($"Defansınız Eski Haline Geldi ");
                lbBilgi.SelectedIndex = lbBilgi.Items.Count - 1;
                tmDef.Stop();
            }
        }
示例#2
0
        void SatinalamaTanim()
        {
            ClsPot bilgiPot = new ClsPot();

            btnSatinal.Enabled = true;
            //lblPotTanim.Text = "";
            //lblPotTanim.Text = pot + " " + Tur + " Potu\n";
            //lblPotTanim.Text += potdeger + " " + Tur + " Ekler\n";
            //lblPotTanim.Text += "Fiyati " + Fiyat + " Para";
            lblPotTanim.Text  = bilgiPot.Ad + "\n";
            lblPotTanim.Text += bilgiPot.Tur + " " + bilgiPot.Etki + "\n";
            //  lblPotTanim.Text += pots. + " " + Tur + " Ekler\n";
            lblPotTanim.Text += "Fiyati " + bilgiPot.Fiyat + " Para";
        }
示例#3
0
        void potSatinAl()
        {
            ClsPot bilgiPot = new ClsPot();
            int    para     = Convert.ToInt32(lblPara.Text);

            if (para >= bilgiPot.Fiyat)
            {
                para         = para - bilgiPot.Fiyat;
                lblPara.Text = para.ToString();
                if (PotTur == "Küçük Healt Pot")
                {
                    hpkAdet += 1;
                }
                else if (PotTur == "Büyük Healt Pot")
                {
                    hpbAdet += 1;
                }
                else if (PotTur == "Küçük Atak Pot")
                {
                    atakKAdet += 1;
                }
                else if (PotTur == "Büyük Atak Pot")
                {
                    atakBAdet += 1;
                }
                else if (PotTur == "Küçük Defans Pot")
                {
                    defKAdet += 1;
                }
                else if (PotTur == "Büyük Defans Pot")
                {
                    defBAdet += 1;
                }
                butonİsim();
            }
        }
示例#4
0
        void PotKullan()
        {
            ClsPot potBilgi = new ClsPot();

            void can()
            {
                lblCan.Text = (Convert.ToInt32(lblCan.Text) + potBilgi.Etki).ToString();

                if (PotTur == "Küçük Healt Pot")
                {
                    hpkAdet -= 1;
                }
                else
                {
                    hpbAdet -= 1;
                }
                lbBilgi.Items.Add($"{potBilgi.Level} Level Pot Kullanıdnız");
                lbBilgi.Items.Add($"Canını {potBilgi.Etki} artı");
                lbBilgi.SelectedIndex = lbBilgi.Items.Count - 1;
            }

            void atak()
            {
                // ClsPot potBilgi = new ClsPot();
                lblAtak.Text = (Convert.ToInt32(lblAtak.Text) + potBilgi.Etki).ToString();
                if (PotTur == "Küçük Atak Pot")
                {
                    atakKAdet -= 1;
                    butonİsim();
                }
                else
                {
                    atakBAdet -= 1;
                    butonİsim();
                }
                lbBilgi.Items.Add($"{potBilgi.Level} Level {potBilgi.Tur} Pot Kullanıdnız");
                lbBilgi.Items.Add($"Atağınız {potBilgi.Sure} saniye ile {potBilgi.Etki} artı");
                lbBilgi.SelectedIndex = lbBilgi.Items.Count - 1;
                tmAtak.Start();
            }

            void defans()
            {
                lblDef.Text = (Convert.ToInt32(lblDef.Text) + potBilgi.Etki).ToString();
                if (PotTur == "Küçük Defans Pot")
                {
                    defKAdet -= 1;
                }
                else
                {
                    defBAdet -= 1;
                }
                lbBilgi.Items.Add($"{potBilgi.Level} Level {potBilgi.Tur} Pot Kullanıdnız");
                lbBilgi.Items.Add($"Defansınız {potBilgi.Sure} saniye ile {potBilgi.Etki} artı");
                lbBilgi.SelectedIndex = lbBilgi.Items.Count - 1;
                tmDef.Start();
            }

            if (hpkAdet > 0 && PotTur == "Küçük Healt Pot ")
            {
                can();
            }
            else if (hpbAdet > 0 && PotTur == "Büyük Healt Pot")
            {
                can();
            }
            else if (atakKAdet > 0 && PotTur == "Küçük Atak Pot")
            {
                atak();
            }
            else if (defKAdet > 0 && PotTur == "Küçük Defans Pot")
            {
                defans();
            }
            else if (defKAdet > 0 && PotTur == "Büyük Defans Pot")
            {
                defans();
            }
        }