Beispiel #1
0
    //Dot伤害
    public void Hurt(DotBuff buff)
    {
        if (buff.getDamage() == 0)
        {
            return;
        }

        float tempRand = MyTools.ins.getRandom(0, 100);

        if (tempRand >= buff.dotRate)
        {
            MyTools.ins.ShowDotHurt(this, buff, false);
            return;
        }


        //这里本应该计算自身免伤,该版本忽略TODO
        float inDamage = buff.getDamage() * 1f;

        //记录受到的伤害
        this.curHurtDamage += inDamage;
        totalhurtDamage    += curHurtDamage;
        curTroops           = Mathf.Max(0, curTroops - inDamage);


        HurtEvent hurtEvent = new HurtEvent(buff.skill.army.name, buff.skill.name, inDamage);

        hurtEventList.Add(hurtEvent);
        MyTools.ins.ShowDotHurt(this, buff, true);
    }