Пример #1
0
 //public bool DoSpell(MagicPersonRP sender, PersonRP receiver)
 //{
 //    return SpellDo(sender, receiver);
 //}
 protected override bool makeMagic(MagicPersonRP sender, PersonRP receiver, int power)
 {
     if (receiver.CONDITION_OF_PERSON != Condition.Paralyzed)
     {
         return(false);   //каст
     }
     receiver.CURRENT_AMOUNT_OF_HP = 1;
     return(true);
 }
Пример #2
0
        public bool SpellDO(Spell spell, PersonRP receiver, int power)
        {
            int index = ListOfSpell.IndexOf(spell);

            if (index == -1)
            {
                return(false);
            }
            return(ListOfSpell[index].SpellDo(this, receiver, power));
        }
Пример #3
0
        public bool SpellDo(MagicPersonRP sender, PersonRP receiver, int power)
        {
            if (power < 0)
            {
                throw new Exception("Мощность заклинания не может быть меньше 0");
            }
            if (sender == null || receiver == null)
            {
                throw new NullReferenceException("Должен быть указан человек на которого накладывается заклинание");
            }
            if (Status_cd)
            {
                return(false);
            }
            if (receiver.STATUS_RES)
            {
                return(false);
            }
            if (sender.CONDITION_OF_PERSON == Condition.Dead || sender.CONDITION_OF_PERSON == Condition.Paralyzed)
            {
                return(false);
            }
            if (verb && !sender.SPEECH)
            {
                return(false);
            }
            if (move && !sender.MOVE)
            {
                return(false);
            }
            float f = min_manacost + power * cost_on_value;

            if (sender.CURRENT_AMOUNT_OF_MAGIC < f)
            {
                //CD_Do(1000);
                return(false);
            }
            if (makeMagic(sender, receiver, power))
            {
                sender.CURRENT_AMOUNT_OF_MAGIC -= f;
                CD_Do(cd);
                return(true);
            }
            else
            {
                return(false);
            }
        }
Пример #4
0
        protected override bool makeMagic(MagicPersonRP sender, PersonRP receiver, int power)
        {
            if (receiver.CONDITION_OF_PERSON == Condition.Dead)
            {
                return(false);
            }
            receiver.STATUS_RES = true;
            Thread a = new Thread(() =>
            {
                Thread.Sleep(power + 1000);
                receiver.STATUS_RES = false;
            });

            a.Start();
            return(true);
        }
Пример #5
0
 protected override bool makeMagic(MagicPersonRP sender, PersonRP receiver, int power)
 {
     if (receiver.CONDITION_OF_PERSON != Condition.Poisoned)
     {
         return(false);//каст
     }
     if (receiver.hp_percents() >= 10f)
     {
         receiver.CONDITION_OF_PERSON = Condition.Normal;
     }
     else
     {
         receiver.CONDITION_OF_PERSON = Condition.Weakened;
     }
     return(true);
 }
Пример #6
0
        protected override bool makeMagic(MagicPersonRP sender, PersonRP receiver, int power)
        {
            if (receiver.CONDITION_OF_PERSON == Condition.Dead)
            {
                return(false);                  // может быть отравлен стоит убрать(от этого зависит будет ли каст способности)
            }
            float Power  = power_start + power; // можно домножить на что-нибудь
            float new_hp = receiver.CURRENT_AMOUNT_OF_HP + Power;

            if (receiver.MAX_HP < new_hp)
            {
                receiver.CURRENT_AMOUNT_OF_HP = receiver.MAX_HP;
            }
            else
            {
                receiver.CURRENT_AMOUNT_OF_HP = new_hp;
            }
            return(true);
        }
Пример #7
0
 protected abstract bool makeMagic(MagicPersonRP sender, PersonRP receiver, int power);
Пример #8
0
 public bool SpellDO(Spell spell, PersonRP receiver)
 {
     return(SpellDO(spell, receiver, 0));
 }