Example #1
0
 public Unit(int hp, double speed, int damage, int hpregen, int mp, skillSilense silence, skillsummon Skillssum, params skill[] Skills)
 {
     this.hp        = hp;
     this.speed     = speed;
     this.silence   = silence;
     this.damage    = damage;
     this.hpregen   = hpregen;
     this.mp        = mp;
     exp            = 0;
     lvl            = 0;
     this.Skills    = Skills;
     defhp          = hp;
     defmp          = mp;
     defspeed       = speed;
     this.Skillssum = Skillssum;
 }
Example #2
0
        public static void Main()
        {
            skill        IceArrow = new skill(30, 0, 0, 60, 4.00, 2.00, false);
            skill        heal     = new skill(20, 0, 20, 40, 4.00, 2.00, true);
            skill        debuff   = new skill(40, 0, 30, 50, 4.00, 2.00, false);
            skillsummon  sum      = new skillsummon(40, 10);
            skillSilense silence  = new skillSilense(30, 15.00, 3.00);

            Unit Ivan  = new Unit(100, 100.00, 100, 4, 100, silence, sum, IceArrow, heal, debuff);
            Unit Anton = new Unit(100, 100.00, 100, 4, 100, null, null, IceArrow, heal, debuff);

            Console.WriteLine(Ivan.Hp);

            //Eric.action(silence, Bob);
            Anton.action(Anton.Skills[0], Ivan);
            Console.WriteLine(Ivan.Hp);
            // Eric.action(Eric.Skillssum);
            Console.ReadLine();
        }
Example #3
0
        public void action(skillSilense silence, Unit target)
        {
            if (silence.cd == false)
            {
                TimerCallback timeCB = new TimerCallback(refreshsil);
                Timer         time   = new Timer(timeCB, null, 0, (int)silence.reloading * 100);

                if (mp >= silence.manacost)
                {
                    mp -= silence.manacost;
                    silence.action(target);
                }
                else
                {
                    Console.WriteLine("Не хватает маны");
                }
            }
            else
            {
                Console.WriteLine("Перезарядка!");
            }
        }