Пример #1
0
 public void Leave(AGE.Action _action, Track _track)
 {
     if (this.bTriggerMode && (this.attackActor != 0))
     {
         int count = this.TriggeredBuffContextList.Count;
         for (int i = 0; i < count; i++)
         {
             STriggeredBuffContext context = this.TriggeredBuffContextList[i];
             if (context.actor != 0)
             {
                 STriggeredBuffContext context2 = this.TriggeredBuffContextList[i];
                 STriggeredBuffContext context3 = this.TriggeredBuffContextList[i];
                 this.attackActor.handle.SkillControl.RemoveBuff(context2.actor, context3.buffId);
             }
         }
         this.TriggeredBuffContextList.Clear();
     }
 }
Пример #2
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);
                            }
                        }
                    }
                }
            }
        }
Пример #3
0
 private void TriggerAction(AGE.Action _action, ref PoolObjHandle <ActorRoot> target)
 {
     if (this.attackActor != 0)
     {
         int  num;
         uint objID = target.handle.ObjID;
         if (this.collideCountMap.TryGetValue(objID, out num))
         {
             num++;
             this.collideCountMap[objID] = num;
         }
         else
         {
             this.collideCountMap.Add(objID, 1);
         }
         int num3 = 0;
         if (this.collideTimeMap.TryGetValue(objID, out num3))
         {
             this.collideTimeMap[objID] = this.localTime;
         }
         else
         {
             this.collideTimeMap.Add(objID, this.localTime);
         }
         SkillUseContext refParamObject = _action.refParams.GetRefParamObject <SkillUseContext>("SkillContext");
         if ((refParamObject != null) && (_action.refParams.GetRefParamObject <BaseSkill>("SkillObj") != null))
         {
             refParamObject.EffectCount++;
             if (!this.bTriggerMode)
             {
                 this.attackActor.handle.SkillControl.SpawnBuff(refParamObject.Originator, refParamObject, this.SelfSkillCombineID_1, false);
                 this.attackActor.handle.SkillControl.SpawnBuff(refParamObject.Originator, refParamObject, this.SelfSkillCombineID_2, false);
                 this.attackActor.handle.SkillControl.SpawnBuff(refParamObject.Originator, refParamObject, this.SelfSkillCombineID_3, false);
             }
             else
             {
                 if ((refParamObject.Originator != 0) && (this.SelfSkillCombineID_1 > 0))
                 {
                     STriggeredBuffContext inPoint = new STriggeredBuffContext {
                         actor  = refParamObject.Originator,
                         buffId = this.SelfSkillCombineID_1
                     };
                     if (BaseAlgorithm.AddUniqueItem <STriggeredBuffContext>(this.TriggeredBuffContextList, inPoint))
                     {
                         this.attackActor.handle.SkillControl.SpawnBuff(refParamObject.Originator, refParamObject, this.SelfSkillCombineID_1, false);
                     }
                 }
                 if ((refParamObject.Originator != 0) && (this.SelfSkillCombineID_2 > 0))
                 {
                     STriggeredBuffContext context3 = new STriggeredBuffContext {
                         actor  = refParamObject.Originator,
                         buffId = this.SelfSkillCombineID_2
                     };
                     if (BaseAlgorithm.AddUniqueItem <STriggeredBuffContext>(this.TriggeredBuffContextList, context3))
                     {
                         this.attackActor.handle.SkillControl.SpawnBuff(refParamObject.Originator, refParamObject, this.SelfSkillCombineID_2, false);
                     }
                 }
                 if ((refParamObject.Originator != 0) && (this.SelfSkillCombineID_3 > 0))
                 {
                     STriggeredBuffContext context4 = new STriggeredBuffContext {
                         actor  = refParamObject.Originator,
                         buffId = this.SelfSkillCombineID_3
                     };
                     if (BaseAlgorithm.AddUniqueItem <STriggeredBuffContext>(this.TriggeredBuffContextList, context4))
                     {
                         this.attackActor.handle.SkillControl.SpawnBuff(refParamObject.Originator, refParamObject, this.SelfSkillCombineID_3, false);
                     }
                 }
             }
             if (target != 0)
             {
                 this.hit = true;
                 if ((target.handle.TheActorMeta.ActorType == ActorTypeDef.Actor_Type_Hero) && !this.bHitTargetHero)
                 {
                     this.bHitTargetHero   = true;
                     this.HitTargetHeroPos = target.handle.location;
                 }
                 refParamObject.EffectDir = this.attackActor.handle.forward;
                 bool flag = false;
                 if (!this.bTriggerMode)
                 {
                     bool introduced12 = this.attackActor.handle.SkillControl.SpawnBuff(target, refParamObject, this.TargetSkillCombine_1, this.bExtraBuff);
                     flag  = introduced12 | this.attackActor.handle.SkillControl.SpawnBuff(target, refParamObject, this.TargetSkillCombine_2, this.bExtraBuff);
                     flag |= this.attackActor.handle.SkillControl.SpawnBuff(target, refParamObject, this.TargetSkillCombine_3, this.bExtraBuff);
                 }
                 else
                 {
                     if (this.TargetSkillCombine_1 > 0)
                     {
                         STriggeredBuffContext context5 = new STriggeredBuffContext {
                             actor  = target,
                             buffId = this.TargetSkillCombine_1
                         };
                         if (BaseAlgorithm.AddUniqueItem <STriggeredBuffContext>(this.TriggeredBuffContextList, context5))
                         {
                             this.attackActor.handle.SkillControl.SpawnBuff(target, refParamObject, this.TargetSkillCombine_1, false);
                         }
                         flag = true;
                     }
                     if (this.TargetSkillCombine_2 > 0)
                     {
                         STriggeredBuffContext context6 = new STriggeredBuffContext {
                             actor  = target,
                             buffId = this.TargetSkillCombine_2
                         };
                         if (BaseAlgorithm.AddUniqueItem <STriggeredBuffContext>(this.TriggeredBuffContextList, context6))
                         {
                             this.attackActor.handle.SkillControl.SpawnBuff(target, refParamObject, this.TargetSkillCombine_2, false);
                         }
                         flag = true;
                     }
                     if (this.TargetSkillCombine_3 > 0)
                     {
                         STriggeredBuffContext context7 = new STriggeredBuffContext {
                             actor  = target,
                             buffId = this.TargetSkillCombine_3
                         };
                         if (BaseAlgorithm.AddUniqueItem <STriggeredBuffContext>(this.TriggeredBuffContextList, context7))
                         {
                             this.attackActor.handle.SkillControl.SpawnBuff(target, refParamObject, this.TargetSkillCombine_3, false);
                         }
                         flag = true;
                     }
                 }
                 if (flag)
                 {
                     target.handle.ActorControl.BeAttackHit(this.attackActor);
                 }
             }
             if ((this.bTriggerBullet && (this.BulletActionName != null)) && (this.BulletActionName.Length > 0))
             {
                 refParamObject.AppointType = SkillRangeAppointType.Target;
                 refParamObject.TargetActor = target;
                 this.attackActor.handle.SkillControl.SpawnBullet(refParamObject, this.BulletActionName, false, this.bAgeImmeExcute);
             }
         }
     }
 }