private void DoTriggering(CTriggerMatch match, PoolObjHandle<ActorRoot> src, PoolObjHandle<ActorRoot> atker, object param) { if (((match.TriggerCountMax <= 0) || (++match.m_triggeredCounter <= match.TriggerCountMax)) && !match.bCoolingDown) { match.IntoCoolingDown(); if (match.DelayTime > 0) { int key = Singleton<CTimerManager>.instance.AddTimer(match.DelayTime, 1, new CTimer.OnTimeUpHandler(this.OnDelayTriggerTimer), true); if (key >= 0) { DebugHelper.Assert(!this.DelayTimeSeqMap.ContainsKey(key)); CDelayMatch match2 = new CDelayMatch { AtkerHandle = atker, SrcHandle = src, ParamObj = param, TriggerMatch = match }; this.DelayTimeSeqMap.Add(key, match2); } } else { this.DoTriggeringImpl(match, src, atker, param); } } }
private void onSpawnGroupDone(ref SGroupDeadEventParam inParam) { int length = this.TriggerMatches.Length; for (int i = 0; i < length; i++) { CTriggerMatch match = this.TriggerMatches[i]; if (match != null) { PoolObjHandle<ActorRoot> src = new PoolObjHandle<ActorRoot>(null); PoolObjHandle<ActorRoot> atker = new PoolObjHandle<ActorRoot>(null); object param = null; if (inParam.csg != null) { param = inParam.csg; } else if (inParam.sg != null) { param = inParam.sg; } if (this.FilterMatch(EGlobalGameEvent.SpawnGroupDead, match, src, atker, param, i)) { this.DoTriggering(match, src, atker, param); } } } }
private void DoTriggeringImpl(CTriggerMatch match, PoolObjHandle<ActorRoot> src, PoolObjHandle<ActorRoot> atker, object param) { ListView<TriggerActionBase> values = this.TriggerActionMultiMap.GetValues((uint) match.ActType, true); for (int i = 0; i < values.Count; i++) { TriggerActionBase base2 = values[i]; if (base2 != null) { base2.AppendRefObj(match.Listeners); base2.TriggerEnter(src, atker, this, param); } } if ((match.ActionList != null) && (match.ActionList.Length > 0)) { int length = match.ActionList.Length; for (int j = 0; j < length; j++) { TriggerActionWrapper wrapper = match.ActionList[j]; if (wrapper != null) { TriggerActionBase actionInternal = wrapper.GetActionInternal(); if (actionInternal == null) { wrapper.Init(); actionInternal = wrapper.GetActionInternal(); DebugHelper.Assert(actionInternal != null); } actionInternal.AppendRefObj(match.Listeners); actionInternal.TriggerEnter(src, atker, this, param); } } } }
private void onFightStart(ref DefaultGameEventParam prm) { int length = this.TriggerMatches.Length; for (int i = 0; i < length; i++) { CTriggerMatch match = this.TriggerMatches[i]; if ((match != null) && this.FilterMatch(EGlobalGameEvent.FightStart, match, prm.src, prm.atker, (DefaultGameEventParam) prm, i)) { this.DoTriggering(match, prm.src, prm.atker, (DefaultGameEventParam) prm); } } }
private void onActorDamage(ref HurtEventResultInfo prm) { int length = this.TriggerMatches.Length; for (int i = 0; i < length; i++) { CTriggerMatch match = this.TriggerMatches[i]; if ((match != null) && this.FilterMatch(EGlobalGameEvent.ActorDamage, match, prm.src, prm.atker, (HurtEventResultInfo) prm, i)) { this.DoTriggering(match, prm.src, prm.atker, (HurtEventResultInfo) prm); } } }
private bool FilterMatch(EGlobalGameEvent inEventType, CTriggerMatch match, PoolObjHandle<ActorRoot> src, PoolObjHandle<ActorRoot> atker, object param, int inMatchIndex) { if (match.EventType != inEventType) { return false; } if (!match.Condition.FilterMatch(inEventType, src, atker, param, match, inMatchIndex)) { return false; } return true; }
private void onEnterCombat(ref DefaultGameEventParam prm) { int num = this.TriggerMatches.Length; SFilterMatchParam sFilterMatchParam = default(SFilterMatchParam); for (int i = 0; i < num; i++) { CTriggerMatch cTriggerMatch = this.TriggerMatches[i]; if (cTriggerMatch != null && this.FilterMatch(EGlobalGameEvent.EnterCombat, cTriggerMatch, prm.src, prm.atker, ref sFilterMatchParam, i)) { this.DoTriggering(cTriggerMatch, prm.src, prm.atker); } } }
private void onActorDead(ref GameDeadEventParam prm) { SFilterMatchParam sFilterMatchParam = default(SFilterMatchParam); int num = this.TriggerMatches.Length; for (int i = 0; i < num; i++) { CTriggerMatch cTriggerMatch = this.TriggerMatches[i]; if (cTriggerMatch != null && this.FilterMatch(EGlobalGameEvent.ActorDead, cTriggerMatch, prm.src, prm.orignalAtker, ref sFilterMatchParam, i)) { this.DoTriggering(cTriggerMatch, prm.src, prm.orignalAtker); } } }
private void onEnterCombat(ref DefaultGameEventParam prm) { int length = this.TriggerMatches.Length; object param = (DefaultGameEventParam)prm; for (int i = 0; i < length; i++) { CTriggerMatch match = this.TriggerMatches[i]; if ((match != null) && this.FilterMatch(EGlobalGameEvent.EnterCombat, match, prm.src, prm.atker, param, i)) { this.DoTriggering(match, prm.src, prm.atker, param); } } }
private void onActorDead(ref GameDeadEventParam prm) { int length = this.TriggerMatches.Length; GameDeadEventParam param = prm; for (int i = 0; i < length; i++) { CTriggerMatch match = this.TriggerMatches[i]; if ((match != null) && this.FilterMatch(EGlobalGameEvent.ActorDead, match, prm.src, prm.orignalAtker, param, i)) { this.DoTriggering(match, prm.src, prm.orignalAtker, param); } } }
private void onActorDamage(ref HurtEventResultInfo prm) { int num = this.TriggerMatches.Length; SFilterMatchParam sFilterMatchParam = default(SFilterMatchParam); sFilterMatchParam.hurtInfo = prm; for (int i = 0; i < num; i++) { CTriggerMatch cTriggerMatch = this.TriggerMatches[i]; if (cTriggerMatch != null && this.FilterMatch(EGlobalGameEvent.ActorDamage, cTriggerMatch, prm.src, prm.atker, ref sFilterMatchParam, i)) { this.DoTriggering(cTriggerMatch, prm.src, prm.atker); } } }
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); } } } }
private void onActorInit(ref PoolObjHandle<ActorRoot> inActor) { 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.ActorInit, match, inActor, atker, null, i)) { this.DoTriggering(match, inActor, atker, null); } } } }
private void OnActorBattleCoinChanged(PoolObjHandle<ActorRoot> actor, int changeValue, int currentValue, bool isIncome) { 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.BattleGoldChange, match, actor, atker, currentValue, i)) { this.DoTriggering(match, actor, atker, currentValue); } } } }
private void onUseSkill(ref ActorSkillEventParam prm) { if (ActorHelper.IsHostCtrlActor(ref prm.src)) { int length = this.TriggerMatches.Length; for (int i = 0; i < length; i++) { CTriggerMatch match = this.TriggerMatches[i]; if (match != null) { PoolObjHandle<ActorRoot> src = new PoolObjHandle<ActorRoot>(null); PoolObjHandle<ActorRoot> atker = new PoolObjHandle<ActorRoot>(null); if (this.FilterMatch(EGlobalGameEvent.UseSkill, match, src, atker, (ActorSkillEventParam) prm, i)) { this.DoTriggering(match, src, atker, (ActorSkillEventParam) prm); } } } } }