示例#1
0
        public void ApplyArtefact(int index, int power, MagicPersonRP value)
        {
            if (value == null)
            {
                throw new Exception("Объект не передан.");
            }
            if (this.CONDITION_OF_PERSON != Condition.Dead)
            {
                var arte = m_inventory[index];

                arte.setPower(power);

                Condition temp = CONDITION_OF_PERSON;

                value.CURRENT_AMOUNT_OF_MAGIC += arte.changeEXP();
                value.CURRENT_AMOUNT_OF_HP    += arte.changeHP();
                value.CONDITION_OF_PERSON      = arte.changeCondition();

                if (arte.changeCondition() == Condition.Notchange)
                {
                    CONDITION_OF_PERSON = temp;
                }

                if (!arte.renewable())
                {
                    m_inventory.Remove(arte);
                }
            }
            else
            {
                throw new Exception("Персонаж мёртв.");
            }
        }
示例#2
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);
 }
示例#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);