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;
                            skillUseParam.uiFromId     = buffSkill.skillContext.uiFromId;
                            skillUseParam.skillUseFrom = buffSkill.skillContext.skillUseFrom;
                            actor.SkillControl.SpawnBuff(actor.SelfPtr, ref skillUseParam, skillFuncParam, true);
                            this.buffHolder.RemoveBuff(buffSkill);
                            DefaultGameEventParam defaultGameEventParam = new DefaultGameEventParam(this.buffHolder.actorPtr, _hurt.atker);
                            Singleton <GameEventSys> .instance.SendEvent <DefaultGameEventParam>(GameEventDef.Event_ActorImmuneDeadHurt, ref defaultGameEventParam);

                            _hurtValue = 0;
                        }
                    }
                    else
                    {
                        SkillUseParam skillUseParam2 = default(SkillUseParam);
                        skillUseParam2.SetOriginator(_hurt.atker);
                        skillUseParam2.bExposing    = buffSkill.skillContext.bExposing;
                        skillUseParam2.uiFromId     = buffSkill.skillContext.uiFromId;
                        skillUseParam2.skillUseFrom = buffSkill.skillContext.skillUseFrom;
                        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.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero && _hurt.hurtType != HurtTypeDef.RealHurt)
                {
                    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);
        }
예제 #2
0
 private bool IsValidSkillTarget(ref SkillUseParam _param)
 {
     return(this.IsValidSkillTarget(ref _param.TargetActor));
 }
예제 #3
0
        public bool IsSkillUseValid(SkillSlotType _type, ref SkillUseParam _param)
        {
            SkillSlot skillSlot;

            return(this.TryGetSkillSlot(_type, out skillSlot) && skillSlot.IsSkillUseValid(ref _param));
        }
예제 #4
0
 public bool UseSkill(ref SkillUseParam param, bool bImmediate = false)
 {
     return(this.InternalUseSkill(ref param, bImmediate));
 }
예제 #5
0
 public override bool Use(PoolObjHandle <ActorRoot> user, ref SkillUseParam param)
 {
     this.skillContext.Copy(ref param);
     return(this.UseImpl(user));
 }