Beispiel #1
0
        public static bool Buff;                                     //czy jest to umiejetnosc czy atak

        public static void Attack(Warrior hero, List <Hero> Enemies) //dla warriora
        {
            Buff = false;                                            //ustawia ze jest to atak
            if (!hero._moreArmor)                                    //jesli nie ma wlaczonego buff'u moreArmor
            {
                hero.warShout();                                     //to go aktywuje
                Buff = true;                                         //zaznacza ze to nie atak
            }
            else//w przeciwnym wypadku
            {
                if (hero.Health > 65)//decyduje kogo chce zaatakowac
                {
                    DMG = hero.powerHit();
                }
                else if (hero.Health > 30)
                {
                    DMG = hero.swordHit();
                }
                else if (hero.Health > 20)
                {
                    DMG = hero.powerHit();
                }
                else
                {
                    DMG = hero.swordHit();
                }
                Enemy = rnd.Next(0, Enemies.Count);//wybiera wroga w sposob losowy
                Buff  = false;
            }
        }
Beispiel #2
0
 private void warrior_attack(Warrior hero, bool fourthSkill) //atakuje Warrior
 {
     hero.checkWarShout();                                   //sprawdza umiejetnosc moreArmor
     if (fourthSkill)                                        //jesli czwarty skill: to jest booleam z paramteru który mówi nam czy został uzyty
     {
         hero.warShout();                                    //czwarty skill, jesli nie został to sprawdza radiobutton'y
     }
     else if (radioButton1.Checked)
     {
         DMG = hero.swordHit();
     }
     else if (radioButton2.Checked)
     {
         DMG = hero.powerHit();
     }
 }