Exemple #1
0
 private void onTalentLevelChange(ref TalentLevelChangeParam prm)
 {
     int length = this.TriggerMatches.Length;
     for (int i = 0; i < length; i++)
     {
         CTriggerMatch match = this.TriggerMatches[i];
         if (match != null)
         {
             PoolObjHandle<ActorRoot> atker = new PoolObjHandle<ActorRoot>(null);
             if (this.FilterMatch(EGlobalGameEvent.TalentLevelChange, match, prm.src, atker, (TalentLevelChangeParam) prm, i))
             {
                 this.DoTriggering(match, prm.src, atker, (TalentLevelChangeParam) prm);
             }
         }
     }
 }
Exemple #2
0
        private void onTalentLevelChange(ref TalentLevelChangeParam prm)
        {
            int num = this.TriggerMatches.Length;
            SFilterMatchParam sFilterMatchParam = default(SFilterMatchParam);

            sFilterMatchParam.intParam = prm.TalentLevel;
            for (int i = 0; i < num; i++)
            {
                CTriggerMatch cTriggerMatch = this.TriggerMatches[i];
                if (cTriggerMatch != null)
                {
                    PoolObjHandle <ActorRoot> atker = new PoolObjHandle <ActorRoot>(null);
                    if (this.FilterMatch(EGlobalGameEvent.TalentLevelChange, cTriggerMatch, prm.src, atker, ref sFilterMatchParam, i))
                    {
                        this.DoTriggering(cTriggerMatch, prm.src, atker);
                    }
                }
            }
        }
        public bool FilterMatch(EGlobalGameEvent inEventType, PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> atker, object param, CTriggerMatch match, int inMatchIndex)
        {
            if (!this.CheckDifficulty())
            {
                return(false);
            }
            if (((this.GlobalVariable != 0) && (Singleton <BattleLogic> .instance.m_globalTrigger != null)) && (this.GlobalVariable != Singleton <BattleLogic> .instance.m_globalTrigger.CurGlobalVariable))
            {
                return(false);
            }
            if (this.bCaptainSrc && ((src == 0) || (src != Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Captain)))
            {
                return(false);
            }
            if (this.bCaptainAtker && ((atker == 0) || (atker != Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Captain)))
            {
                return(false);
            }
            if (this.SrcActorCond != null)
            {
                foreach (STriggerCondActor actor in this.SrcActorCond)
                {
                    if (!actor.FilterMatch(ref src))
                    {
                        return(false);
                    }
                }
            }
            if (this.AtkerActorCond != null)
            {
                foreach (STriggerCondActor actor2 in this.AtkerActorCond)
                {
                    if (!actor2.FilterMatch(ref atker))
                    {
                        return(false);
                    }
                }
            }
            switch (inEventType)
            {
            case EGlobalGameEvent.SpawnGroupDead:
            {
                if (match.Originator == null)
                {
                    break;
                }
                CommonSpawnGroup component = match.Originator.GetComponent <CommonSpawnGroup>();
                SpawnGroup       group2    = match.Originator.GetComponent <SpawnGroup>();
                if ((component == null) || (component == (param as CommonSpawnGroup)))
                {
                    if ((group2 == null) || (group2 == (param as SpawnGroup)))
                    {
                        break;
                    }
                    return(false);
                }
                return(false);
            }

            case EGlobalGameEvent.ActorDead:
            {
                PoolObjHandle <ActorRoot> actorRoot = ActorHelper.GetActorRoot(match.Originator);
                if ((actorRoot == 0) || !(actorRoot != src))
                {
                    break;
                }
                return(false);
            }

            case EGlobalGameEvent.ActorDamage:
            {
                HurtEventResultInfo inHurtInfo = (HurtEventResultInfo)param;
                if (this.FilterMatchDamage(ref inHurtInfo))
                {
                    break;
                }
                return(false);
            }

            case EGlobalGameEvent.UseSkill:
            {
                ActorSkillEventParam param2 = (ActorSkillEventParam)param;
                if (param2.slot == this.skillSlot)
                {
                    break;
                }
                return(false);
            }

            case EGlobalGameEvent.TalentLevelChange:
            {
                TalentLevelChangeParam param4 = (TalentLevelChangeParam)param;
                if (match.Condition.TalentLevel == param4.TalentLevel)
                {
                    break;
                }
                return(false);
            }

            case EGlobalGameEvent.BattleGoldChange:
                if ((src != 0) && ActorHelper.IsHostCtrlActor(ref src))
                {
                    int currentGold = (int)param;
                    if (!this.FilterBattleGoldNum(currentGold))
                    {
                        return(false);
                    }
                    break;
                }
                return(false);

            case EGlobalGameEvent.SkillUseCanceled:
            {
                DefaultSkillEventParam param3 = (DefaultSkillEventParam)param;
                if (param3.slot == this.skillSlot)
                {
                    break;
                }
                return(false);
            }
            }
            return(true);
        }