Example #1
0
    void RangeAntiPop(int idx)
    {
        COM_ReportTargetBase prop = props_[idx].prop2_[0];
        int chageVal = 0;

        switch (prop.prop_.type_)
        {
        case PropertyType.PT_HpCurr:
            chageVal = (int)prop.prop_.value_ - caster_.battlePlayer.hpCrt_;
            caster_.battlePlayer.hpCrt_ = (int)prop.prop_.value_;
            if (caster_.battlePlayer.hpCrt_ < 0)
            {
                caster_.battlePlayer.hpCrt_ = 0;
            }
            break;

        case PropertyType.PT_MpCurr:
            chageVal = (int)prop.prop_.value_ - caster_.battlePlayer.mpCrt_;
            caster_.battlePlayer.mpCrt_ = (int)prop.prop_.value_;
            if (caster_.battlePlayer.mpCrt_ < 0)
            {
                caster_.battlePlayer.mpCrt_ = 0;
            }
            break;
        }
        caster_.ChangeAttributeType    = prop.prop_.type_;
        caster_.ChangeAttributeValue   = chageVal;
        caster_.ControlEntity.hitOver_ = prop.fly_;
        caster_.ControlEntity.PopValueChange(caster_.ChangeAttributeValue, caster_.ChangeAttributeType, caster_.battlePlayer.hpMax_, caster_.battlePlayer.mpMax_, null, prop.bao_);
    }
Example #2
0
    void PopChangeValue(int idx)
    {
        if (idx == -1)
        {
            return;
        }

        if (props_ == null || props_.Length == 0)
        {
            return;
        }

        if (isMelee_)
        {
            if (prop_.prop2_.Length != 0)
            {
                COM_ReportTargetBase prop = prop_.prop2_[0];
                int chageVal = 0;
                switch (prop.prop_.type_)
                {
                case PropertyType.PT_HpCurr:
                    chageVal = (int)prop.prop_.value_ - caster_.battlePlayer.hpCrt_;
                    caster_.battlePlayer.hpCrt_ = (int)prop.prop_.value_;
                    if (caster_.battlePlayer.hpCrt_ < 0)
                    {
                        caster_.battlePlayer.hpCrt_ = 0;
                    }
                    break;

                case PropertyType.PT_MpCurr:
                    chageVal = (int)prop.prop_.value_ - caster_.battlePlayer.mpCrt_;
                    caster_.battlePlayer.mpCrt_ = (int)prop.prop_.value_;
                    if (caster_.battlePlayer.mpCrt_ < 0)
                    {
                        caster_.battlePlayer.mpCrt_ = 0;
                    }
                    break;
                }
                caster_.ChangeAttributeType  = prop.prop_.type_;
                caster_.ChangeAttributeValue = chageVal;
                if (caster_.battlePlayer.hpCrt_ > caster_.battlePlayer.hpMax_)
                {
                    caster_.battlePlayer.hpCrt_ = caster_.battlePlayer.hpMax_;
                }
                if (caster_.battlePlayer.mpCrt_ > caster_.battlePlayer.mpMax_)
                {
                    caster_.battlePlayer.mpCrt_ = caster_.battlePlayer.mpMax_;
                }
                caster_.ControlEntity.hitOver_ = prop.fly_;
                caster_.ControlEntity.PopValueChange(caster_.ChangeAttributeValue, caster_.ChangeAttributeType, caster_.battlePlayer.hpMax_, caster_.battlePlayer.mpMax_, null, prop.bao_);
            }
            else
            {
                COM_ReportTarget prop = prop_;
                int chageVal          = 0;
                switch (prop.prop_.type_)
                {
                case PropertyType.PT_HpCurr:
                    chageVal = (int)prop.prop_.value_ - aim_.battlePlayer.hpCrt_;
                    aim_.battlePlayer.hpCrt_ = (int)prop.prop_.value_;
                    if (aim_.battlePlayer.hpCrt_ < 0)
                    {
                        aim_.battlePlayer.hpCrt_ = 0;
                    }
                    break;

                case PropertyType.PT_MpCurr:
                    chageVal = (int)prop.prop_.value_ - aim_.battlePlayer.mpCrt_;
                    aim_.battlePlayer.mpCrt_ = (int)prop.prop_.value_;
                    if (aim_.battlePlayer.mpCrt_ < 0)
                    {
                        aim_.battlePlayer.mpCrt_ = 0;
                    }
                    break;
                }
                aim_.ChangeAttributeType  = prop.prop_.type_;
                aim_.ChangeAttributeValue = chageVal;

                if (aim_.battlePlayer.hpCrt_ > aim_.battlePlayer.hpMax_)
                {
                    aim_.battlePlayer.hpCrt_ = aim_.battlePlayer.hpMax_;
                }
                if (aim_.battlePlayer.mpCrt_ > aim_.battlePlayer.mpMax_)
                {
                    aim_.battlePlayer.mpCrt_ = aim_.battlePlayer.mpMax_;
                }
                aim_.ControlEntity.hitOver_ = prop.fly_;
                aim_.ControlEntity.PopValueChange(aim_.ChangeAttributeValue, aim_.ChangeAttributeType, aim_.battlePlayer.hpMax_, aim_.battlePlayer.mpMax_, null, prop.bao_);
            }
            if (aim_.isDead)
            {
                GlobalInstanceFunction.Instance.setTimeScale(Battle.Instance.reportPlaySpeed_ * 0.7f);
            }
        }
        else
        {
            bool             deadBefore = aims_[idx].isDead;
            COM_ReportTarget prop       = props_[idx];
            int chageVal = 0;
            switch (prop.prop_.type_)
            {
            case PropertyType.PT_HpCurr:
                chageVal = (int)prop.prop_.value_ - aims_[idx].battlePlayer.hpCrt_;
                aims_[idx].battlePlayer.hpCrt_ = (int)prop.prop_.value_;
                if (aims_[idx].battlePlayer.hpCrt_ < 0)
                {
                    aims_[idx].battlePlayer.hpCrt_ = 0;
                }
                break;

            case PropertyType.PT_MpCurr:
                chageVal = (int)prop.prop_.value_ - aims_[idx].battlePlayer.mpCrt_;
                aims_[idx].battlePlayer.mpCrt_ = (int)prop.prop_.value_;
                if (aims_[idx].battlePlayer.mpCrt_ < 0)
                {
                    aims_[idx].battlePlayer.mpCrt_ = 0;
                }
                break;
            }
            aims_[idx].ChangeAttributeType  = prop.prop_.type_;
            aims_[idx].ChangeAttributeValue = chageVal;
            aims_[idx].ControlEntity.PopValueChange(aims_[idx].ChangeAttributeValue, aims_[idx].ChangeAttributeType, aims_[idx].battlePlayer.hpMax_, aims_[idx].battlePlayer.mpMax_, null, prop.bao_);
            aims_[idx].ControlEntity.hitOver_ = prop.fly_;
            if (aims_[idx].battlePlayer.hpCrt_ > aims_[idx].battlePlayer.hpMax_)
            {
                aims_[idx].battlePlayer.hpCrt_ = aims_[idx].battlePlayer.hpMax_;
            }
            if (aims_[idx].battlePlayer.mpCrt_ > aims_[idx].battlePlayer.mpMax_)
            {
                aims_[idx].battlePlayer.mpCrt_ = aims_[idx].battlePlayer.mpMax_;
            }
            if (aims_[idx].isDead && deadBefore == false)
            {
                GlobalInstanceFunction.Instance.setTimeScale(Battle.Instance.reportPlaySpeed_ * 0.7f);
            }
        }
    }
Example #3
0
    void HitMotion_1(int idx)
    {
        if (idx == -1)
        {
            return;
        }

        if (isMelee_)
        {
            if (prop_.prop2_.Length != 0)
            {
                COM_ReportTargetBase prop = prop_.prop2_[0];
                int chageVal = 0;
                switch (prop.prop_.type_)
                {
                case PropertyType.PT_HpCurr:
                    chageVal = (int)prop.prop_.value_ - aim_.battlePlayer.hpCrt_;
                    break;

                case PropertyType.PT_MpCurr:
                    chageVal = (int)prop.prop_.value_ - aim_.battlePlayer.mpCrt_;
                    break;
                }
                aim_.ControlEntity.Beattack_1(crt_data_._Id, crt_data_._Level, hasWuxiaoBuff(aim_), false, false, caster_);
                //反弹伤害不播受击
                caster_.ControlEntity.Beattack_1(crt_data_._Id, crt_data_._Level, false, false, chageVal == 0, null, false);
                //caster_.ControlEntity.UpdateStateTick();
            }
            else
            {
                COM_ReportTarget prop = prop_;
                int chageVal          = 0;
                switch (prop.prop_.type_)
                {
                case PropertyType.PT_HpCurr:
                    chageVal = (int)prop.prop_.value_ - aim_.battlePlayer.hpCrt_;
                    break;

                case PropertyType.PT_MpCurr:
                    chageVal = (int)prop.prop_.value_ - aim_.battlePlayer.mpCrt_;
                    break;
                }
                aim_.ControlEntity.LookAt(caster_.ControlEntity.ActorObj);
                bool hasWuxiao = hasWuxiaoBuff(aim_);
                if (hasWuxiao == false)
                {
                    hasWuxiao = (chageVal > 0);
                }
                if (prop.prop_.type_ == PropertyType.PT_HpCurr)
                {
                    aim_.ControlEntity.Beattack_1(crt_data_._Id, crt_data_._Level, !hasWuxiao, (aim_.battlePlayer.hpCrt_ + chageVal) <= 0, chageVal == 0, caster_);
                }
                else if (prop.prop_.type_ == PropertyType.PT_MpCurr)
                {
                    aim_.ControlEntity.Beattack_1(crt_data_._Id, crt_data_._Level, !hasWuxiao, false, false, caster_);
                }
                //aim_.ControlEntity.UpdateStateTick();
            }
        }
        else
        {
            if (props_[idx].prop2_.Length != 0)
            {
                if (effectInsts_.ContainsKey(idx))
                {
                    effectInsts_[idx].DestorySelf();
                }
                aims_[idx].ControlEntity.Beattack_1(crt_data_._Id, crt_data_._Level, hasWuxiaoBuff(aims_[idx]), false, false, caster_);
                Vector3 casterPos = aims_[idx].ControlEntity.ActorObj.transform.position;
                Vector3 aim       = caster_.ControlEntity.ActorObj.transform.position;
                EffectAPI.Play((EFFECT_ID)crt_data_._EffectID, casterPos, new Vector3[] { aim }, GetPack(RangeAntiHit, null, null, RangeAntiPop), ActionOver, SaveEffectInst, new ParamData(idx));
            }
            else
            {
                COM_PropValue prop     = props_[idx].prop_;
                int           chageVal = 0;
                switch (prop.type_)
                {
                case PropertyType.PT_HpCurr:
                    chageVal = (int)prop.value_ - aims_[idx].battlePlayer.hpCrt_;
                    break;

                case PropertyType.PT_MpCurr:
                    chageVal = (int)prop.value_ - aims_[idx].battlePlayer.mpCrt_;
                    break;
                }
                aims_[idx].ControlEntity.LookAt(caster_.ControlEntity.ActorObj);
                bool hasWuxiao = hasWuxiaoBuff(aims_[idx]);
                if (hasWuxiao == false)
                {
                    hasWuxiao = (chageVal > 0);
                }
                aims_[idx].ControlEntity.Beattack_1(crt_data_._Id, crt_data_._Level, !hasWuxiao, aims_[idx].battlePlayer.hpCrt_ + chageVal <= 0f, chageVal == 0, caster_);
                //aims_[idx].ControlEntity.UpdateStateTick();
            }
        }
    }