예제 #1
0
        // --------- 反弹伤害 ---------
        private float returnDamage(BT_Monster Pet, BT_Monster enemy, float damage)
        {
            short           bufDebuffType = CMsgHeader.BUFF_DEBUFF_REBOUND;
            BT_BuffOrDebuff reboundBuff   = Pet.getBuffOrDebuff(bufDebuffType);

            if (reboundBuff != null && --reboundBuff.round >= 0 && enemy.alive)
            {
                //
                float rebound = damage * reboundBuff.rate * Consts.oneHundred;
                damage -= rebound;
                if (damage < 0)
                {
                    damage = 0;
                }
                // 反弹部分伤害到敌人...
                enemy.sufferNormalAttack(MathHelper.MidpointRounding(rebound), Pet, true);
            }

            return(damage);
        }