Пример #1
0
        private bool NoDamageImpl(ref HurtDataInfo _hurt)
        {
            BuffSkill skill = null;

            for (int i = 0; i < this.NoHurtBuffList.Count; i++)
            {
                skill = this.NoHurtBuffList[i];
                if (skill != null)
                {
                    if (skill.cfgData.dwEffectSubType == 6)
                    {
                        if (this.CheckTargetNoDamage(ref _hurt, skill))
                        {
                            return(true);
                        }
                    }
                    else if (_hurt.hurtType == HurtTypeDef.PhysHurt)
                    {
                        if ((skill.cfgData.dwEffectSubType == 4) && this.CheckTargetNoDamage(ref _hurt, skill))
                        {
                            return(true);
                        }
                    }
                    else if (((_hurt.hurtType == HurtTypeDef.MagicHurt) && (skill.cfgData.dwEffectSubType == 5)) && this.CheckTargetNoDamage(ref _hurt, skill))
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Пример #2
0
        public override int TakeDamage(ref HurtDataInfo hurt)
        {
            if (this.bGodMode)
            {
                return(0);
            }
            SLevelContext curLvelContext = Singleton <BattleLogic> .get_instance().GetCurLvelContext();

            if (curLvelContext != null && hurt.atker && hurt.atker.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ)
            {
                OrganWrapper organWrapper = hurt.atker.get_handle().AsOrgan();
                if (organWrapper != null)
                {
                    int attackCounter = organWrapper.GetAttackCounter(this.actorPtr);
                    if (attackCounter > 1)
                    {
                        int num = (attackCounter - 1) * organWrapper.cfgInfo.iContiAttakAdd;
                        if (num > organWrapper.cfgInfo.iContiAttakMax)
                        {
                            num = organWrapper.cfgInfo.iContiAttakMax;
                        }
                        hurt.adValue += num;
                    }
                }
            }
            return(base.TakeDamage(ref hurt));
        }
Пример #3
0
        private int ReduceDamagePart(ref HurtDataInfo hurt, HurtTypeDef hurtType)
        {
            int result = 0;

            if (hurtType == HurtTypeDef.PhysHurt)
            {
                int num = this.actor.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYDEFPT].totalValue - hurt.attackInfo.iDEFStrike;
                num = num * (10000 - hurt.attackInfo.iDEFStrikeRate) / 10000;
                num = ((num > 0) ? num : 0);
                int num2 = num + (int)(this.battleParam.dwM_PhysicsDefend * (uint)this.actor.ValueComponent.mActorValue.actorLvl) + (int)this.battleParam.dwN_PhysicsDefend;
                if (num2 != 0)
                {
                    result = num * 10000 / num2;
                }
            }
            else if (hurtType == HurtTypeDef.MagicHurt)
            {
                int num3 = this.actor.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCDEFPT].totalValue - hurt.attackInfo.iRESStrike;
                num3 = num3 * (10000 - hurt.attackInfo.iRESStrikeRate) / 10000;
                num3 = ((num3 > 0) ? num3 : 0);
                int num4 = num3 + (int)(this.battleParam.dwM_MagicDefend * (uint)this.actor.ValueComponent.mActorValue.actorLvl) + (int)this.battleParam.dwN_MagicDefend;
                if (num4 != 0)
                {
                    result = num3 * 10000 / num4;
                }
            }
            return(result);
        }
Пример #4
0
 private void StatProtectValue(ref HurtDataInfo hurt, int iChangeValue)
 {
     if (iChangeValue <= 0)
     {
         return;
     }
     this.m_uiProtectTotalValue += (uint)iChangeValue;
     if (hurt.atker)
     {
         if (hurt.atker.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
         {
             this.m_uiProtectValueFromHero += (uint)iChangeValue;
         }
         if (hurt.atker.get_handle().BuffHolderComp != null && hurt.atker.get_handle().BuffHolderComp.protectRule != null)
         {
             hurt.atker.get_handle().BuffHolderComp.protectRule.BePortectedTotalValue += (uint)iChangeValue;
             if (hurt.target && hurt.target.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
             {
                 if (hurt.hurtType == HurtTypeDef.PhysHurt)
                 {
                     hurt.atker.get_handle().BuffHolderComp.protectRule.BeProtectedValueToHeroPhys += (uint)iChangeValue;
                 }
                 else if (hurt.hurtType == HurtTypeDef.MagicHurt)
                 {
                     hurt.atker.get_handle().BuffHolderComp.protectRule.BeProtectedValueToHeroMagic += (uint)iChangeValue;
                 }
                 else if (hurt.hurtType == HurtTypeDef.RealHurt)
                 {
                     hurt.atker.get_handle().BuffHolderComp.protectRule.BeProtectedValueToHeroReal += (uint)iChangeValue;
                 }
             }
         }
     }
 }
Пример #5
0
        private bool CheckTargetNoDamage(ref HurtDataInfo _hurt, BuffSkill _buffSkill)
        {
            int num  = _buffSkill.CustomParams[3];
            int num2 = _buffSkill.CustomParams[4];

            if (num == 0)
            {
                return(true);
            }
            if (_hurt.atker != 0)
            {
                int actorType = (int)_hurt.atker.handle.TheActorMeta.ActorType;
                if ((num & (((int)1) << actorType)) > 0)
                {
                    if (actorType != 1)
                    {
                        return(true);
                    }
                    if (num2 == 0)
                    {
                        return(true);
                    }
                    if (_hurt.atker.handle.ActorControl.GetActorSubType() == num2)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Пример #6
0
 public static int OnDamageExtraEffect(ref HurtDataInfo _hurt, int _hurtValue)
 {
     BuffSkill skill = null;
     SkillSlot slot = null;
     BufferLogicEffect logicEffect = null;
     List<PoolObjHandle<BuffSkill>> extraHurtList = null;
     if ((_hurt.atker != 0) && !_hurt.atker.handle.ActorControl.IsDeadState)
     {
         logicEffect = _hurt.atker.handle.BuffHolderComp.logicEffect;
         extraHurtList = logicEffect.GetExtraHurtList();
         for (int i = 0; i < extraHurtList.Count; i++)
         {
             if (_hurt.target == 0)
             {
                 return _hurtValue;
             }
             skill = extraHurtList[i];
             int num = skill.GetSkillFuncParam(0x48, 0, false);
             if ((_hurt.atkSlot == num) && _hurt.atker.handle.SkillControl.TryGetSkillSlot(_hurt.atkSlot, out slot))
             {
                 int num2 = skill.GetSkillFuncParam(0x48, 1, false);
                 int num3 = skill.GetSkillFuncParam(0x48, 2, false);
                 int num4 = skill.GetSkillFuncParam(0x48, 3, false);
                 int num5 = skill.GetSkillFuncParam(0x48, 4, false);
                 logicEffect.SetSkillSlotUseTime(_hurt.atkSlot, num5);
                 logicEffect.SetSkillSlotUseCount(_hurt.atkSlot, slot.GetSkillUseCount());
                 return logicEffect.DamageExtraEffect(ref _hurt, _hurtValue, num2, num3, num4);
             }
         }
     }
     return _hurtValue;
 }
Пример #7
0
        public static int OnDamageExtraEffect(ref HurtDataInfo _hurt, int _hurtValue)
        {
            SkillSlot skillSlot = null;

            if (!_hurt.atker || _hurt.atker.handle.ActorControl.IsDeadState)
            {
                return(_hurtValue);
            }
            BufferLogicEffect logicEffect          = _hurt.atker.handle.BuffHolderComp.logicEffect;
            List <PoolObjHandle <BuffSkill> > list = logicEffect.GetExtraHurtList();

            for (int i = 0; i < list.get_Count(); i++)
            {
                if (!_hurt.target)
                {
                    return(_hurtValue);
                }
                BuffSkill buffSkill      = list.get_Item(i);
                int       skillFuncParam = buffSkill.GetSkillFuncParam(72, 0, false);
                if (_hurt.atkSlot == (SkillSlotType)skillFuncParam && _hurt.atker.handle.SkillControl.TryGetSkillSlot(_hurt.atkSlot, out skillSlot))
                {
                    int skillFuncParam2 = buffSkill.GetSkillFuncParam(72, 1, false);
                    int skillFuncParam3 = buffSkill.GetSkillFuncParam(72, 2, false);
                    int skillFuncParam4 = buffSkill.GetSkillFuncParam(72, 3, false);
                    int skillFuncParam5 = buffSkill.GetSkillFuncParam(72, 4, false);
                    logicEffect.SetSkillSlotUseTime(_hurt.atkSlot, skillFuncParam5);
                    logicEffect.SetSkillSlotUseCount(_hurt.atkSlot, skillSlot.GetSkillUseCount());
                    return(logicEffect.DamageExtraEffect(ref _hurt, _hurtValue, skillFuncParam2, skillFuncParam3, skillFuncParam4));
                }
            }
            return(_hurtValue);
        }
Пример #8
0
 public override int TakeDamage(ref HurtDataInfo hurt)
 {
     if (!this.m_bFirstAttacked)
     {
         this.m_bFirstAttacked = true;
         if (hurt.atker.get_handle().TheActorMeta.ActorCamp == 1)
         {
             Singleton <EventRouter> .get_instance().BroadCastEvent <COM_PLAYERCAMP>(EventID.CampTowerFirstAttackTime, 2);
         }
         else if (hurt.atker.get_handle().TheActorMeta.ActorCamp == 2)
         {
             Singleton <EventRouter> .get_instance().BroadCastEvent <COM_PLAYERCAMP>(EventID.CampTowerFirstAttackTime, 1);
         }
     }
     hurt.iReduceDamage = 0;
     if (hurt.atker && hurt.atker.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && hurt.atkSlot == SkillSlotType.SLOT_SKILL_0)
     {
         if (this.cfgInfo.iBlockHeroAtkDamageMSec == 0 || (long)this.cfgInfo.iBlockHeroAtkDamageMSec >= (long)Singleton <FrameSynchr> .get_instance().LogicFrameTick)
         {
             hurt.iReduceDamage += this.cfgInfo.iBlockHeroAtkDamage;
         }
         if (this._aroundEnemyMonsterCount == 0 && (this.cfgInfo.iNoEnemyBlockHeroAtkDamageMSec == 0 || (long)this.cfgInfo.iNoEnemyBlockHeroAtkDamageMSec >= (long)Singleton <FrameSynchr> .get_instance().LogicFrameTick))
         {
             hurt.iReduceDamage += this.cfgInfo.iNoEnemyBlockHeroAtkDamage;
         }
     }
     return(base.TakeDamage(ref hurt));
 }
Пример #9
0
        private int GetBaseHurtValue(ref HurtDataInfo hurt)
        {
            int result     = 1;
            int totalValue = hurt.target.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP].totalValue;
            int actorHp    = hurt.target.handle.ValueComponent.actorHp;

            switch (hurt.extraHurtType)
            {
            case ExtraHurtTypeDef.ExtraHurt_Value:
                result = 1;
                break;

            case ExtraHurtTypeDef.ExtraHurt_MaxHp:
                result = totalValue;
                break;

            case ExtraHurtTypeDef.ExtraHurt_CurHp:
                result = totalValue - actorHp;
                break;

            case ExtraHurtTypeDef.ExtraHurt_LoseHp:
                result = actorHp;
                break;
            }
            return(result);
        }
        public override int TakeDamage(ref HurtDataInfo hurt)
        {
            if (base.IsBornState)
            {
                base.SetObjBehaviMode(ObjBehaviMode.State_Idle);
                this.nextBehavior = ObjBehaviMode.State_Null;
                base.PlayAnimation("Idle", 0f, 0, true);
            }
            if (this.actorSubSoliderType == 8 && this.myBehavior == ObjBehaviMode.State_Idle)
            {
                hurt.iReduceDamage  = 0;
                hurt.iReduceDamage += this.cfgInfo.iBlockHeroAtkDamage;
            }
            int actorHp = this.actor.ValueComponent.actorHp;
            int result  = base.TakeDamage(ref hurt);

            if (this.actorSubSoliderType == 8)
            {
                int num  = this.dukeMustUseSkillHpRate;
                int num2 = this.totalHpRate / num;
                for (int i = 1; i <= num2; i++)
                {
                    int num3 = this.totalHpRate - num * i;
                    if (this.actor.ValueComponent.actorHp * this.totalHpRate / this.actor.ValueComponent.actorHpTotal < num3 && actorHp * this.totalHpRate / this.actor.ValueComponent.actorHpTotal > num3)
                    {
                        this.m_nextMustUseSkill = SkillSlotType.SLOT_SKILL_2;
                        break;
                    }
                }
            }
            return(result);
        }
Пример #11
0
        public int OnDamage(ref HurtDataInfo _hurt, int _hurtValue)
        {
            if (!_hurt.bLastHurt)
            {
                this.clearRule.CheckBuffClear(1);
            }
            if (!_hurt.bExtraBuff)
            {
                SkillSlotType atkSlot = _hurt.atkSlot;
                SkillSlotType atkSlot2;
                bool          flag = this.OnChangeExtraEffectSkillSlot(_hurt.atker, _hurt.atkSlot, out atkSlot2);
                if (flag)
                {
                    _hurt.atkSlot = atkSlot2;
                }
                this.OnDamageTriggerEffect(_hurt.target, _hurt.atker);
                this.OnDamageExtraEffect(_hurt.atker, _hurt.atkSlot);
                if (flag)
                {
                    _hurt.atkSlot = atkSlot;
                }
            }
            int num = _hurtValue * _hurt.iEffectFadeRate / 10000;

            num = num * _hurt.iOverlayFadeRate / 10000;
            num = this.protectRule.ResistDamage(ref _hurt, num);
            num = BufferLogicEffect.OnDamageExtraEffect(ref _hurt, num);
            num = this.DealDamageContionType(ref _hurt, num);
            this.OnDamageExtraHurtFunc(ref _hurt, _hurt.atkSlot);
            return(num);
        }
Пример #12
0
        private int GetExtraHurtValue(ref HurtDataInfo hurt)
        {
            int totalValue = hurt.target.handle.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP].totalValue;
            int actorHp    = hurt.target.handle.ValueComponent.actorHp;

            return((hurt.loseHpValue * (totalValue - actorHp)) / 0x2710);
        }
Пример #13
0
        private int Hemophagia(ref HurtDataInfo hurt, int hurtValue)
        {
            int nAddHp = 0;

            if (hurt.atker != 0)
            {
                if (hurt.hurtType == HurtTypeDef.PhysHurt)
                {
                    int num2 = 0;
                    int num3 = (int)((hurt.attackInfo.iPhysicsHemophagia + (hurt.attackInfo.iActorLvl * this.battleParam.dwM_PhysicsHemophagia)) + this.battleParam.dwN_PhysicsHemophagia);
                    if (num3 > 0)
                    {
                        num2 = (hurt.attackInfo.iPhysicsHemophagia * 0x2710) / num3;
                    }
                    nAddHp = (hurtValue * (num2 + hurt.attackInfo.iPhysicsHemophagiaRate)) / 0x2710;
                    nAddHp = (nAddHp * hurt.hemoFadeRate) / 0x2710;
                }
                else if (hurt.hurtType == HurtTypeDef.MagicHurt)
                {
                    int num4 = 0;
                    int num5 = (int)((hurt.attackInfo.iMagicHemophagia + (hurt.attackInfo.iActorLvl * this.battleParam.dwM_MagicHemophagia)) + this.battleParam.dwN_MagicHemophagia);
                    if (num5 > 0)
                    {
                        num4 = (hurt.attackInfo.iMagicHemophagia * 0x2710) / num5;
                    }
                    nAddHp = (hurtValue * (num4 + hurt.attackInfo.iMagicHemophagiaRate)) / 0x2710;
                    nAddHp = (nAddHp * hurt.hemoFadeRate) / 0x2710;
                }
                if (nAddHp > 0)
                {
                    hurt.atker.handle.ActorControl.ReviveHp(nAddHp);
                }
            }
            return(nAddHp);
        }
Пример #14
0
        private bool CheckTargetNoDamage(ref HurtDataInfo _hurt, BuffSkill _buffSkill)
        {
            int skillFuncParam  = _buffSkill.GetSkillFuncParam(30, 1, false);
            int skillFuncParam2 = _buffSkill.GetSkillFuncParam(30, 2, false);

            if (skillFuncParam == 0)
            {
                return(true);
            }
            if (_hurt.atker)
            {
                int actorType = (int)_hurt.atker.get_handle().TheActorMeta.ActorType;
                if ((skillFuncParam & 1 << actorType) > 0)
                {
                    if (actorType != 1)
                    {
                        return(true);
                    }
                    if (skillFuncParam2 == 0)
                    {
                        return(true);
                    }
                    int actorSubType = (int)_hurt.atker.get_handle().ActorControl.GetActorSubType();
                    if (actorSubType == skillFuncParam2)
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
        public int ResistDamage(ref HurtDataInfo _hurt, int _hurtValue)
        {
            int num = _hurtValue;

            if (_hurtValue <= 0)
            {
                return(_hurtValue);
            }
            int num2;

            if (_hurt.hurtType == HurtTypeDef.PhysHurt)
            {
                num2       = _hurtValue;
                _hurtValue = this.ResistProtectImpl(_hurtValue, this.PhysicsProtectList, 0);
                num2      -= _hurtValue;
                this.SendProtectEvent(0, -num2);
                if (_hurtValue > 0)
                {
                    num2       = _hurtValue;
                    _hurtValue = this.ResistProtectImpl(_hurtValue, this.AllProtectBuffList, 2);
                    num2      -= _hurtValue;
                    this.SendProtectEvent(2, -num2);
                }
            }
            else if (_hurt.hurtType == HurtTypeDef.MagicHurt)
            {
                num2       = _hurtValue;
                _hurtValue = this.ResistProtectImpl(_hurtValue, this.MagicProtectList, 1);
                num2      -= _hurtValue;
                this.SendProtectEvent(1, -num2);
                if (_hurtValue > 0)
                {
                    num2       = _hurtValue;
                    _hurtValue = this.ResistProtectImpl(_hurtValue, this.AllProtectBuffList, 2);
                    num2      -= _hurtValue;
                    this.SendProtectEvent(2, -num2);
                }
            }
            if (_hurtValue > 0)
            {
                num2       = _hurtValue;
                _hurtValue = this.ResistProtectImpl(_hurtValue, this.AllIncludeRealHurtProtectBuffList, 3);
                num2      -= _hurtValue;
                this.SendProtectEvent(3, -num2);
            }
            num2 = num - _hurtValue;
            this.SendHurtAbsorbEvent(_hurt.atker, num2);
            this.StatProtectValue(ref _hurt, num2);
            if (this.limiteMaxHpHurt.bValid)
            {
                int num3 = this.buffHolder.actor.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_MAXHP].totalValue;
                num3 = num3 * this.limiteMaxHpHurt.hurtRate / 10000;
                if (_hurtValue > num3)
                {
                    _hurtValue = num3;
                }
            }
            _hurtValue = this.ResistDeadDamage(ref _hurt, _hurtValue);
            return(_hurtValue);
        }
Пример #16
0
 private bool NoDamageImpl(ref HurtDataInfo _hurt)
 {
     for (int i = 0; i < this.NoHurtBuffList.get_Count(); i++)
     {
         BuffSkill buffSkill = this.NoHurtBuffList.get_Item(i);
         if (buffSkill != null)
         {
             if (buffSkill.cfgData.bEffectSubType == 6)
             {
                 if (this.CheckTargetNoDamage(ref _hurt, buffSkill))
                 {
                     return(true);
                 }
             }
             else if (_hurt.hurtType == HurtTypeDef.PhysHurt)
             {
                 if (buffSkill.cfgData.bEffectSubType == 4 && this.CheckTargetNoDamage(ref _hurt, buffSkill))
                 {
                     return(true);
                 }
             }
             else if (_hurt.hurtType == HurtTypeDef.MagicHurt && buffSkill.cfgData.bEffectSubType == 5 && this.CheckTargetNoDamage(ref _hurt, buffSkill))
             {
                 return(true);
             }
         }
     }
     return(false);
 }
Пример #17
0
 public override int TakeDamage(ref HurtDataInfo hurt)
 {
     if (this.bGodMode)
     {
         return(0);
     }
     if (((Singleton <BattleLogic> .instance.GetCurLvelContext() != null) && (hurt.atker != 0)) && (hurt.atker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Organ))
     {
         OrganWrapper wrapper = hurt.atker.handle.AsOrgan();
         if (wrapper != null)
         {
             int attackCounter = wrapper.GetAttackCounter(base.actorPtr);
             if (attackCounter > 1)
             {
                 int iContiAttakMax = (attackCounter - 1) * wrapper.cfgInfo.iContiAttakAdd;
                 if (iContiAttakMax > wrapper.cfgInfo.iContiAttakMax)
                 {
                     iContiAttakMax = wrapper.cfgInfo.iContiAttakMax;
                 }
                 hurt.adValue += iContiAttakMax;
             }
         }
     }
     return(base.TakeDamage(ref hurt));
 }
Пример #18
0
        private int ReduceDamagePart(ref HurtDataInfo hurt, HurtTypeDef hurtType)
        {
            int num = 0;

            if (hurtType == HurtTypeDef.PhysHurt)
            {
                int num2 = base.actor.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_PHYDEFPT].totalValue - hurt.attackInfo.iDEFStrike;
                num2 = (num2 * (0x2710 - hurt.attackInfo.iDEFStrikeRate)) / 0x2710;
                num2 = (num2 <= 0) ? 0 : num2;
                int num3 = (int)((num2 + (this.battleParam.dwM_PhysicsDefend * base.actor.ValueComponent.mActorValue.actorLvl)) + this.battleParam.dwN_PhysicsDefend);
                if (num3 != 0)
                {
                    num = (num2 * 0x2710) / num3;
                }
                return(num);
            }
            if (hurtType == HurtTypeDef.MagicHurt)
            {
                int num4 = base.actor.ValueComponent.mActorValue[RES_FUNCEFT_TYPE.RES_FUNCEFT_MGCDEFPT].totalValue - hurt.attackInfo.iRESStrike;
                num4 = (num4 * (0x2710 - hurt.attackInfo.iRESStrikeRate)) / 0x2710;
                num4 = (num4 <= 0) ? 0 : num4;
                int num5 = (int)((num4 + (this.battleParam.dwM_MagicDefend * base.actor.ValueComponent.mActorValue.actorLvl)) + this.battleParam.dwN_MagicDefend);
                if (num5 != 0)
                {
                    num = (num4 * 0x2710) / num5;
                }
            }
            return(num);
        }
Пример #19
0
        private int CriticalDamagePart(ref HurtDataInfo hurt)
        {
            bool flag = false;
            int  num  = 0;

            if ((hurt.atkSlot == SkillSlotType.SLOT_SKILL_0) && (hurt.iCanSkillCrit != 0))
            {
                int num2 = (int)((hurt.attackInfo.iCritStrikeValue + (hurt.attackInfo.iActorLvl * this.battleParam.dwM_Critical)) + this.battleParam.dwN_Critical);
                int num3 = 0;
                int num4 = 0;
                if (num2 > 0)
                {
                    num3 = ((hurt.attackInfo.iCritStrikeValue * 0x2710) / num2) + hurt.attackInfo.iCritStrikeRate;
                }
                int num5 = (int)((hurt.attackInfo.iReduceCritStrikeValue + (base.actor.ValueComponent.mActorValue.actorLvl * this.battleParam.dwM_ReduceCritical)) + this.battleParam.dwN_ReduceCritical);
                if (num5 > 0)
                {
                    num4  = (hurt.attackInfo.iReduceCritStrikeValue * 0x2710) / num5;
                    num4 += hurt.attackInfo.iReduceCritStrikeRate;
                }
                if (!base.actor.ActorControl.GetNoAbilityFlag(ObjAbilityType.ObjAbility_ImmuneCrit))
                {
                    flag = FrameRandom.Random(0x2710) < (num3 - num4);
                }
                num = !flag ? 0 : hurt.attackInfo.iCritStrikeEff;
                if (flag)
                {
                    DefaultGameEventParam prm = new DefaultGameEventParam(hurt.atker, hurt.target);
                    Singleton <GameEventSys> .instance.SendEvent <DefaultGameEventParam>(GameEventDef.Event_ActorCrit, ref prm);
                }
            }
            return(num);
        }
Пример #20
0
        private int GetExtraHurtValue(ref HurtDataInfo hurt)
        {
            int totalValue = hurt.target.get_handle().ValueComponent.mActorValue[5].totalValue;
            int actorHp    = hurt.target.get_handle().ValueComponent.actorHp;

            return(hurt.loseHpValue * (totalValue - actorHp) / 10000);
        }
Пример #21
0
        public int OnHurtBounceDamage(ref HurtDataInfo hurt, int hp)
        {
            if (hp <= 0)
            {
                return(hp);
            }
            if (!hurt.atker || hurt.bBounceHurt)
            {
                return(hp);
            }
            ResDT_SkillFunc skillFunc = null;
            int             num       = hp;

            for (int i = 0; i < this.SpawnedBuffList.get_Count(); i++)
            {
                BuffSkill buffSkill = this.SpawnedBuffList.get_Item(i);
                if (buffSkill != null && buffSkill.FindSkillFunc(83, out skillFunc))
                {
                    int skillFuncParam = buffSkill.GetSkillFuncParam(skillFunc, 2, false);
                    if ((skillFuncParam & 1 << (int)hurt.atker.get_handle().TheActorMeta.ActorType) <= 0)
                    {
                        int skillFuncParam2 = buffSkill.GetSkillFuncParam(skillFunc, 0, false);
                        int skillFuncParam3 = buffSkill.GetSkillFuncParam(skillFunc, 1, false);
                        int num2            = num * skillFuncParam2 / 10000;
                        num -= num2;
                        HurtDataInfo     hurtDataInfo = default(HurtDataInfo);
                        HurtAttackerInfo attackInfo   = default(HurtAttackerInfo);
                        attackInfo.Init(hurt.target, hurt.atker);
                        hurtDataInfo.atker                       = hurt.target;
                        hurtDataInfo.target                      = hurt.atker;
                        hurtDataInfo.attackInfo                  = attackInfo;
                        hurtDataInfo.atkSlot                     = SkillSlotType.SLOT_SKILL_VALID;
                        hurtDataInfo.hurtType                    = (HurtTypeDef)skillFuncParam3;
                        hurtDataInfo.extraHurtType               = ExtraHurtTypeDef.ExtraHurt_Value;
                        hurtDataInfo.hurtValue                   = num2;
                        hurtDataInfo.adValue                     = 0;
                        hurtDataInfo.apValue                     = 0;
                        hurtDataInfo.hpValue                     = 0;
                        hurtDataInfo.loseHpValue                 = 0;
                        hurtDataInfo.iConditionType              = 0;
                        hurtDataInfo.iConditionParam             = 0;
                        hurtDataInfo.hurtCount                   = 0;
                        hurtDataInfo.firstHemoFadeRate           = 0;
                        hurtDataInfo.followUpHemoFadeRate        = 0;
                        hurtDataInfo.iEffectCountInSingleTrigger = 0;
                        hurtDataInfo.bExtraBuff                  = false;
                        hurtDataInfo.gatherTime                  = 0;
                        hurtDataInfo.bBounceHurt                 = true;
                        hurtDataInfo.bLastHurt                   = false;
                        hurtDataInfo.iAddTotalHurtValueRate      = 0;
                        hurtDataInfo.iAddTotalHurtValue          = 0;
                        hurtDataInfo.iEffectFadeRate             = 10000;
                        hurtDataInfo.iOverlayFadeRate            = 10000;
                        int num3 = hurt.atker.get_handle().HurtControl.TakeBouncesDamage(ref hurtDataInfo);
                    }
                }
            }
            return(num);
        }
Пример #22
0
 public override int TakeDamage(ref HurtDataInfo hurt)
 {
     if (hurt.hurtType != HurtTypeDef.Therapic)
     {
         this.IsTrueType = true;
     }
     return(base.TakeDamage(ref hurt));
 }
 public bool ImmuneDamage(ref HurtDataInfo _hurt)
 {
     if (this.NoDamageImpl(ref _hurt))
     {
         this.SendHurtImmuneEvent(_hurt.atker);
         return(true);
     }
     return(false);
 }
Пример #24
0
        private int ResistDeadDamage(ref HurtDataInfo _hurt, int _hurtValue)
        {
            ResDT_SkillFunc skillFunc = null;

            if (this.buffHolder == null || this.buffHolder.actor == null)
            {
                return(_hurtValue);
            }
            ActorRoot actor = this.buffHolder.actor;

            for (int i = 0; i < actor.BuffHolderComp.SpawnedBuffList.get_Count(); i++)
            {
                BuffSkill buffSkill = actor.BuffHolderComp.SpawnedBuffList.get_Item(i);
                if (buffSkill != null && buffSkill.FindSkillFunc(54, out skillFunc))
                {
                    int skillFuncParam = buffSkill.GetSkillFuncParam(skillFunc, 0, false);
                    if (buffSkill.GetSkillFuncParam(skillFunc, 1, false) == 0)
                    {
                        if (actor.ValueComponent.actorHp <= _hurtValue)
                        {
                            SkillUseParam skillUseParam = default(SkillUseParam);
                            skillUseParam.SetOriginator(_hurt.atker);
                            skillUseParam.bExposing = buffSkill.skillContext.bExposing;
                            actor.SkillControl.SpawnBuff(actor.SelfPtr, ref skillUseParam, skillFuncParam, true);
                            this.buffHolder.RemoveBuff(buffSkill);
                            DefaultGameEventParam defaultGameEventParam = new DefaultGameEventParam(this.buffHolder.actorPtr, _hurt.atker);
                            Singleton <GameEventSys> .get_instance().SendEvent <DefaultGameEventParam>(GameEventDef.Event_ActorImmuneDeadHurt, ref defaultGameEventParam);

                            _hurtValue = 0;
                        }
                    }
                    else
                    {
                        SkillUseParam skillUseParam2 = default(SkillUseParam);
                        skillUseParam2.SetOriginator(_hurt.atker);
                        skillUseParam2.bExposing = buffSkill.skillContext.bExposing;
                        actor.SkillControl.SpawnBuff(actor.SelfPtr, ref skillUseParam2, skillFuncParam, true);
                        this.buffHolder.RemoveBuff(buffSkill);
                        _hurtValue = 0;
                    }
                }
                if (_hurt.atkSlot == SkillSlotType.SLOT_SKILL_0 && buffSkill != null && buffSkill.FindSkillFunc(67, out skillFunc) && _hurt.atker && _hurt.atker.get_handle().TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero)
                {
                    int skillFuncParam2 = buffSkill.GetSkillFuncParam(skillFunc, 0, false);
                    int skillFuncParam3 = buffSkill.GetSkillFuncParam(skillFunc, 4, false);
                    if (skillFuncParam2 == 1)
                    {
                        _hurtValue = _hurtValue * (10000 - skillFuncParam3) / 10000;
                    }
                    else if (skillFuncParam2 == 0)
                    {
                        _hurtValue -= skillFuncParam3;
                    }
                }
            }
            return(_hurtValue);
        }
Пример #25
0
 public HurtEventResultInfo(PoolObjHandle<ActorRoot> _src, PoolObjHandle<ActorRoot> _atker, HurtDataInfo _hurtInfo, int _hurtTotal, int _hpChanged, int _critValue)
 {
     this.src = _src;
     this.atker = _atker;
     this.hurtInfo = _hurtInfo;
     this.hurtTotal = _hurtTotal;
     this.hpChanged = _hpChanged;
     this.critValue = _critValue;
 }
Пример #26
0
        private int ResistDeadDamage(ref HurtDataInfo _hurt, int _hurtValue)
        {
            BuffSkill       inBuff       = null;
            ResDT_SkillFunc outSkillFunc = null;

            if ((this.buffHolder != null) && (this.buffHolder.actor != null))
            {
                ActorRoot actor = this.buffHolder.actor;
                for (int i = 0; i < actor.BuffHolderComp.SpawnedBuffList.Count; i++)
                {
                    inBuff = actor.BuffHolderComp.SpawnedBuffList[i];
                    if ((inBuff != null) && inBuff.FindSkillFunc(0x36, out outSkillFunc))
                    {
                        int inSkillCombineId = inBuff.GetSkillFuncParam(0x36, 0, false);
                        if (inBuff.GetSkillFuncParam(0x36, 1, false) == 0)
                        {
                            if (actor.ValueComponent.actorHp <= _hurtValue)
                            {
                                SkillUseParam inParam = new SkillUseParam();
                                inParam.SetOriginator(_hurt.atker);
                                actor.SkillControl.SpawnBuff(actor.SelfPtr, ref inParam, inSkillCombineId, true);
                                this.buffHolder.RemoveBuff(inBuff);
                                DefaultGameEventParam prm = new DefaultGameEventParam(this.buffHolder.actorPtr, _hurt.atker);
                                Singleton <GameEventSys> .instance.SendEvent <DefaultGameEventParam>(GameEventDef.Event_ActorImmuneDeadHurt, ref prm);

                                _hurtValue = 0;
                            }
                        }
                        else
                        {
                            SkillUseParam param3 = new SkillUseParam();
                            param3.SetOriginator(_hurt.atker);
                            actor.SkillControl.SpawnBuff(actor.SelfPtr, ref param3, inSkillCombineId, true);
                            this.buffHolder.RemoveBuff(inBuff);
                            _hurtValue = 0;
                        }
                    }
                    if ((((_hurt.atkSlot == SkillSlotType.SLOT_SKILL_0) && (inBuff != null)) && (inBuff.FindSkillFunc(0x43, out outSkillFunc) && (_hurt.atker != 0))) && (_hurt.atker.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero))
                    {
                        int num4 = inBuff.GetSkillFuncParam(0x43, 0, false);
                        int num5 = inBuff.GetSkillFuncParam(0x43, 4, false);
                        switch (num4)
                        {
                        case 1:
                            _hurtValue = (_hurtValue * (0x2710 - num5)) / 0x2710;
                            break;

                        case 0:
                            _hurtValue -= num5;
                            break;
                        }
                    }
                }
            }
            return(_hurtValue);
        }
Пример #27
0
        private int ResistDeadDamage(ref HurtDataInfo _hurt, int _hurtValue)
        {
            BuffSkill       inBuff       = null;
            ResDT_SkillFunc outSkillFunc = null;

            if ((this.buffHolder != null) && (this.buffHolder.actor != null))
            {
                ActorRoot actor = this.buffHolder.actor;
                for (int i = 0; i < actor.BuffHolderComp.SpawnedBuffList.Count; i++)
                {
                    inBuff = actor.BuffHolderComp.SpawnedBuffList[i];
                    if ((inBuff != null) && inBuff.FindSkillFunc(0x36, out outSkillFunc))
                    {
                        int inSkillCombineId = inBuff.CustomParams[0];
                        if (inBuff.CustomParams[1] == 0)
                        {
                            if (actor.ValueComponent.actorHp <= _hurtValue)
                            {
                                SkillUseContext inContext = new SkillUseContext();
                                inContext.SetOriginator(_hurt.atker);
                                actor.SkillControl.SpawnBuff(actor.SelfPtr, inContext, inSkillCombineId, true);
                                this.buffHolder.RemoveBuff(inBuff);
                                DefaultGameEventParam prm = new DefaultGameEventParam(this.buffHolder.actorPtr, _hurt.atker);
                                Singleton <GameEventSys> .instance.SendEvent <DefaultGameEventParam>(GameEventDef.Event_ActorImmuneDeadHurt, ref prm);

                                _hurtValue = 0;
                            }
                        }
                        else
                        {
                            SkillUseContext context2 = new SkillUseContext();
                            context2.SetOriginator(_hurt.atker);
                            actor.SkillControl.SpawnBuff(actor.SelfPtr, context2, inSkillCombineId, true);
                            this.buffHolder.RemoveBuff(inBuff);
                            _hurtValue = 0;
                        }
                    }
                    if (((_hurt.atkSlot == SkillSlotType.SLOT_SKILL_0) && (inBuff != null)) && inBuff.FindSkillFunc(0x43, out outSkillFunc))
                    {
                        int num4 = inBuff.CustomParams[0];
                        int num5 = inBuff.CustomParams[4];
                        switch (num4)
                        {
                        case 1:
                            _hurtValue = (_hurtValue * (0x2710 - num5)) / 0x2710;
                            break;

                        case 0:
                            _hurtValue -= num5;
                            break;
                        }
                    }
                }
            }
            return(_hurtValue);
        }
Пример #28
0
 public override int TakeDamage(ref HurtDataInfo hurt)
 {
     if (base.IsBornState)
     {
         base.SetObjBehaviMode(ObjBehaviMode.State_Idle);
         base.nextBehavior = ObjBehaviMode.State_Null;
         base.PlayAnimation("Idle", 0f, 0, true);
     }
     return(base.TakeDamage(ref hurt));
 }
Пример #29
0
        private int GetBaseHurtRate(ref HurtDataInfo hurt)
        {
            int result = 1;

            if (hurt.extraHurtType != ExtraHurtTypeDef.ExtraHurt_Value)
            {
                result = 100;
            }
            return(result);
        }
Пример #30
0
        private int GetBaseHurtRate(ref HurtDataInfo hurt)
        {
            int num = 1;

            if (hurt.extraHurtType != ExtraHurtTypeDef.ExtraHurt_Value)
            {
                num = 100;
            }
            return(num);
        }