private void HitTrigger(Action _action)
        {
            if (this.attackActor != 0)
            {
                this.GetCollidedActorList(_action, this.attackActor, this.triggerActor);
                if ((this.collidedActors != null) && (this.collidedActors.Count != 0))
                {
                    SkillChooseTargetEventParam prm = new SkillChooseTargetEventParam(this.attackActor, this.attackActor, this.collidedActors.Count);
                    Singleton <GameEventSys> .instance.SendEvent <SkillChooseTargetEventParam>(GameEventDef.Event_HitTrigger, ref prm);

                    if ((this.TriggerActorCount > 0) && (this.TriggerActorCount < this.collidedActors.Count))
                    {
                        this.PriorityTrigger(_action);
                    }
                    else
                    {
                        for (int i = 0; i < this.collidedActors.Count; i++)
                        {
                            PoolObjHandle <ActorRoot> target = this.collidedActors[i];
                            this.TriggerAction(_action, ref target);
                        }
                    }
                }
            }
        }
        private void HitTrigger(Action _action)
        {
            if (!this.attackActor)
            {
                return;
            }
            if (this.skillContext != null)
            {
                this.skillContext.EffectCountInSingleTrigger = 0;
            }
            this.GetCollidedActorList(_action, this.attackActor, this.triggerActor);
            if (this.collidedActors != null && this.collidedActors.get_Count() > 0)
            {
                if (this.bTriggerBounceBullet)
                {
                    SkillUseContext refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
                    if (!refParamObject.TargetActor)
                    {
                        refParamObject.TargetActor = this.collidedActors.get_Item(0);
                    }
                }
                SkillChooseTargetEventParam skillChooseTargetEventParam = new SkillChooseTargetEventParam(this.attackActor, this.attackActor, this.collidedActors.get_Count());
                Singleton <GameEventSys> .get_instance().SendEvent <SkillChooseTargetEventParam>(GameEventDef.Event_HitTrigger, ref skillChooseTargetEventParam);

                if (this.TriggerActorCount > 0 && this.TriggerActorCount < this.collidedActors.get_Count())
                {
                    this.PriorityTrigger(_action);
                }
                else
                {
                    for (int i = 0; i < this.collidedActors.get_Count(); i++)
                    {
                        PoolObjHandle <ActorRoot> poolObjHandle = this.collidedActors.get_Item(i);
                        this.TriggerAction(_action, ref poolObjHandle);
                    }
                }
            }
            if (this.bTriggerMode)
            {
                int count = this.TriggeredBuffContextList.get_Count();
                if (count > 0 && this.attackActor)
                {
                    for (int j = count - 1; j >= 0; j--)
                    {
                        HitTriggerDurationContext.STriggeredBuffContext sTriggeredBuffContext = this.TriggeredBuffContextList.get_Item(j);
                        if (!this.collidedActors.Contains(sTriggeredBuffContext.actor))
                        {
                            this.attackActor.get_handle().SkillControl.RemoveBuff(sTriggeredBuffContext.actor, sTriggeredBuffContext.buffId);
                            this.TriggeredBuffContextList.RemoveAt(j);
                        }
                    }
                }
            }
        }
예제 #3
0
        public override void Process(Action _action, Track _track)
        {
            PoolObjHandle <ActorRoot> actorHandle = _action.GetActorHandle(this.targetId);

            if (actorHandle != 0)
            {
                SkillComponent skillControl = actorHandle.handle.SkillControl;
                if (skillControl != null)
                {
                    BaseSkill refParamObject = _action.refParams.GetRefParamObject <BaseSkill>("SkillObj");
                    if (refParamObject != null)
                    {
                        List <PoolObjHandle <ActorRoot> > list = this.FilterTargetByTriggerRegion(_action, actorHandle, refParamObject);
                        if (list != null)
                        {
                            SkillChooseTargetEventParam prm = new SkillChooseTargetEventParam(actorHandle, actorHandle, list.Count);
                            Singleton <GameEventSys> .instance.SendEvent <SkillChooseTargetEventParam>(GameEventDef.Event_HitTrigger, ref prm);
                        }
                        SkillUseContext inContext = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
                        if (inContext != null)
                        {
                            skillControl.SpawnBuff(actorHandle, inContext, this.SelfSkillCombineID_1, false);
                            skillControl.SpawnBuff(actorHandle, inContext, this.SelfSkillCombineID_2, false);
                            skillControl.SpawnBuff(actorHandle, inContext, this.SelfSkillCombineID_3, false);
                            if (list != null)
                            {
                                for (int i = 0; i < list.Count; i++)
                                {
                                    inContext.EffectDir = actorHandle.handle.forward;
                                    bool flag = false;
                                    flag = skillControl.SpawnBuff(list[i], inContext, this.TargetSkillCombine_1, false) | skillControl.SpawnBuff(list[i], inContext, this.TargetSkillCombine_2, false);
                                    if (flag | skillControl.SpawnBuff(list[i], inContext, this.TargetSkillCombine_3, false))
                                    {
                                        PoolObjHandle <ActorRoot> handle2 = list[i];
                                        handle2.handle.ActorControl.BeAttackHit(actorHandle);
                                    }
                                }
                            }
                        }
                    }
                    this.shape = null;
                }
            }
        }
예제 #4
0
        private void HitTrigger(AGE.Action _action)
        {
            if (this.attackActor != 0)
            {
                this.GetCollidedActorList(_action, this.attackActor, this.triggerActor);
                if ((this.collidedActors != null) && (this.collidedActors.Count > 0))
                {
                    SkillChooseTargetEventParam prm = new SkillChooseTargetEventParam(this.attackActor, this.attackActor, this.collidedActors.Count);
                    Singleton <GameEventSys> .instance.SendEvent <SkillChooseTargetEventParam>(GameEventDef.Event_HitTrigger, ref prm);

                    if ((this.TriggerActorCount > 0) && (this.TriggerActorCount < this.collidedActors.Count))
                    {
                        this.PriorityTrigger(_action);
                    }
                    else
                    {
                        for (int i = 0; i < this.collidedActors.Count; i++)
                        {
                            PoolObjHandle <ActorRoot> target = this.collidedActors[i];
                            this.TriggerAction(_action, ref target);
                        }
                    }
                }
                if (this.bTriggerMode)
                {
                    int count = this.TriggeredBuffContextList.Count;
                    if ((count > 0) && (this.attackActor != 0))
                    {
                        for (int j = count - 1; j >= 0; j--)
                        {
                            STriggeredBuffContext context = this.TriggeredBuffContextList[j];
                            if (!this.collidedActors.Contains(context.actor))
                            {
                                STriggeredBuffContext context2 = this.TriggeredBuffContextList[j];
                                STriggeredBuffContext context3 = this.TriggeredBuffContextList[j];
                                this.attackActor.handle.SkillControl.RemoveBuff(context2.actor, context3.buffId);
                                this.TriggeredBuffContextList.RemoveAt(j);
                            }
                        }
                    }
                }
            }
        }
        public override void Process(Action _action, Track _track)
        {
            PoolObjHandle <ActorRoot> actorHandle = _action.GetActorHandle(this.targetId);

            if (!actorHandle)
            {
                return;
            }
            SkillComponent skillControl = actorHandle.handle.SkillControl;

            if (skillControl == null)
            {
                return;
            }
            BaseSkill refParamObject = _action.refParams.GetRefParamObject <BaseSkill>("SkillObj");

            if (refParamObject != null)
            {
                List <PoolObjHandle <ActorRoot> > list = this.FilterTargetByTriggerRegion(_action, actorHandle, refParamObject);
                if (this.bActOnCallMonster)
                {
                    HeroWrapper heroWrapper = actorHandle.handle.ActorControl as HeroWrapper;
                    if (list != null && heroWrapper != null && heroWrapper.hasCalledMonster)
                    {
                        list.Clear();
                        list.Add(heroWrapper.CallMonster);
                    }
                }
                if (list != null && list.get_Count() > 0)
                {
                    SkillChooseTargetEventParam skillChooseTargetEventParam = new SkillChooseTargetEventParam(actorHandle, actorHandle, list.get_Count());
                    Singleton <GameEventSys> .instance.SendEvent <SkillChooseTargetEventParam>(GameEventDef.Event_HitTrigger, ref skillChooseTargetEventParam);
                }
                SkillUseContext refParamObject2 = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
                if (refParamObject2 != null)
                {
                    int num = 0;
                    refParamObject2.EffectCountInSingleTrigger = 1;
                    if (this.bSkillCombineChoose && _action.refParams.GetRefParam("SpecifiedSkillCombineIndex", ref num))
                    {
                        switch (num)
                        {
                        case 1:
                            skillControl.SpawnBuff(actorHandle, refParamObject2, this.SelfSkillCombineID_1, false);
                            break;

                        case 2:
                            skillControl.SpawnBuff(actorHandle, refParamObject2, this.SelfSkillCombineID_2, false);
                            break;

                        case 3:
                            skillControl.SpawnBuff(actorHandle, refParamObject2, this.SelfSkillCombineID_3, false);
                            break;
                        }
                    }
                    else
                    {
                        skillControl.SpawnBuff(actorHandle, refParamObject2, this.SelfSkillCombineID_1, false);
                        skillControl.SpawnBuff(actorHandle, refParamObject2, this.SelfSkillCombineID_2, false);
                        skillControl.SpawnBuff(actorHandle, refParamObject2, this.SelfSkillCombineID_3, false);
                    }
                    if (list != null && list.get_Count() > 0)
                    {
                        for (int i = 0; i < list.get_Count(); i++)
                        {
                            refParamObject2.EffectDir = actorHandle.handle.forward;
                            bool flag = skillControl.SpawnBuff(list.get_Item(i), refParamObject2, this.TargetSkillCombine_1, false);
                            flag |= skillControl.SpawnBuff(list.get_Item(i), refParamObject2, this.TargetSkillCombine_2, false);
                            flag |= skillControl.SpawnBuff(list.get_Item(i), refParamObject2, this.TargetSkillCombine_3, false);
                            if (flag)
                            {
                                list.get_Item(i).handle.ActorControl.BeAttackHit(actorHandle, refParamObject2.bExposing);
                            }
                        }
                        list.Clear();
                    }
                }
            }
            this.shape = null;
        }