public override void Startup() { base.Startup(); this._thisActor = ActorHelper.GetActorRoot(this.sourceActor); this.m_collidePolygon = base.gameObject.GetComponent <GeoPolygon>(); if (!this.CoolMode || !this._coolingDown) { this.OnTriggerStart(); } }
public override void Startup() { base.Startup(); this._thisActor = ActorHelper.GetActorRoot(this.sourceActor); this.m_collidePolygon = base.gameObject.GetComponent<GeoPolygon>(); Singleton<GameEventSys>.instance.RmvEventHandler<DefaultGameEventParam>(GameEventDef.Event_ActorDestroy, new RefAction<DefaultGameEventParam>(this.onActorDestroy)); Singleton<GameEventSys>.instance.AddEventHandler<DefaultGameEventParam>(GameEventDef.Event_ActorDestroy, new RefAction<DefaultGameEventParam>(this.onActorDestroy)); if (!this.CoolMode || !this._coolingDown) { this.OnTriggerStart(); } }
public override RefParamOperator TriggerEnter(PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> atker, ITrigger inTrigger) { int enterUniqueId = this.EnterUniqueId; GameObject[] refObjList = this.RefObjList; RefParamOperator refParamOperator = new RefParamOperator(); if (enterUniqueId > 0) { if (refObjList != null) { int num = refObjList.Length; for (int i = 0; i < num; i++) { GameObject gameObject = refObjList[i]; if (!(gameObject == null)) { PoolObjHandle <ActorRoot> actorRoot = ActorHelper.GetActorRoot(gameObject); if (actorRoot) { BufConsumer bufConsumer = new BufConsumer(enterUniqueId, actorRoot, actorRoot); if (bufConsumer.Use()) { refParamOperator = new RefParamOperator(); string name = string.Format("TriggerActionBuffTar_{0}", i); refParamOperator.AddRefParam(name, bufConsumer.buffSkill); } } } } } if (this.bSrc && src) { BufConsumer bufConsumer2 = new BufConsumer(enterUniqueId, src, atker); if (bufConsumer2.Use()) { refParamOperator = new RefParamOperator(); refParamOperator.AddRefParam("TriggerActionBuffSrc", bufConsumer2.buffSkill); } } if (this.bAtker && atker) { BufConsumer bufConsumer3 = new BufConsumer(enterUniqueId, atker, src); if (bufConsumer3.Use()) { refParamOperator = new RefParamOperator(); refParamOperator.AddRefParam("TriggerActionBuffAtker", bufConsumer3.buffSkill); } } } return(refParamOperator); }
public override RefParamOperator TriggerEnter(PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> atker, ITrigger inTrigger, object prm) { int enterUniqueId = base.EnterUniqueId; GameObject[] refObjList = base.RefObjList; RefParamOperator @operator = new RefParamOperator(); if (enterUniqueId > 0) { if (refObjList != null) { int length = refObjList.Length; for (int i = 0; i < length; i++) { GameObject go = refObjList[i]; if (go != null) { PoolObjHandle <ActorRoot> actorRoot = ActorHelper.GetActorRoot(go); if (actorRoot != 0) { BufConsumer consumer = new BufConsumer(enterUniqueId, actorRoot, actorRoot); if (consumer.Use()) { @operator = new RefParamOperator(); string name = string.Format("TriggerActionBuffTar_{0}", i); @operator.AddRefParam(name, consumer.buffSkill); } } } } } if (base.bSrc && (src != 0)) { BufConsumer consumer2 = new BufConsumer(enterUniqueId, src, atker); if (consumer2.Use()) { @operator = new RefParamOperator(); @operator.AddRefParam("TriggerActionBuffSrc", consumer2.buffSkill); } } if (base.bAtker && (atker != 0)) { BufConsumer consumer3 = new BufConsumer(enterUniqueId, atker, src); if (consumer3.Use()) { @operator = new RefParamOperator(); @operator.AddRefParam("TriggerActionBuffAtker", consumer3.buffSkill); } } } return(@operator); }
public bool FilterMatch(EGlobalGameEvent inEventType, PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> atker, ref SFilterMatchParam 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 || src != Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Captain)) { return(false); } if (this.bCaptainAtker && (!atker || atker != Singleton <GamePlayerCenter> .GetInstance().GetHostPlayer().Captain)) { return(false); } if (this.SrcActorCond != null) { STriggerCondActor[] srcActorCond = this.SrcActorCond; for (int i = 0; i < srcActorCond.Length; i++) { STriggerCondActor sTriggerCondActor = srcActorCond[i]; if (!sTriggerCondActor.FilterMatch(ref src)) { return(false); } } } if (this.AtkerActorCond != null) { STriggerCondActor[] atkerActorCond = this.AtkerActorCond; for (int j = 0; j < atkerActorCond.Length; j++) { STriggerCondActor sTriggerCondActor2 = atkerActorCond[j]; if (!sTriggerCondActor2.FilterMatch(ref atker)) { return(false); } } } switch (inEventType) { case EGlobalGameEvent.SpawnGroupDead: if (match.Originator != null) { CommonSpawnGroup component = match.Originator.GetComponent <CommonSpawnGroup>(); SpawnGroup component2 = match.Originator.GetComponent <SpawnGroup>(); if (component != null && component != param.csg) { return(false); } if (component2 != null && component2 != param.sg) { return(false); } } break; case EGlobalGameEvent.ActorDead: { PoolObjHandle <ActorRoot> actorRoot = ActorHelper.GetActorRoot(match.Originator); if (actorRoot && actorRoot != src) { return(false); } break; } case EGlobalGameEvent.ActorDamage: if (!this.FilterMatchDamage(ref param.hurtInfo)) { return(false); } break; case EGlobalGameEvent.UseSkill: if (param.slot != (SkillSlotType)this.skillSlot) { return(false); } break; case EGlobalGameEvent.TalentLevelChange: if (match.Condition.TalentLevel != param.intParam) { return(false); } break; case EGlobalGameEvent.BattleGoldChange: { if (!src || !ActorHelper.IsHostCtrlActor(ref src)) { return(false); } int intParam = param.intParam; if (!this.FilterBattleGoldNum(intParam)) { return(false); } break; } case EGlobalGameEvent.SkillUseCanceled: if (param.slot != (SkillSlotType)this.skillSlot) { return(false); } break; } return(true); }
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); }
public override RefParamOperator TriggerEnter(PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> atker, ITrigger inTrigger) { List <PoolObjHandle <ActorRoot> > list = new List <PoolObjHandle <ActorRoot> >(); if (this.bSrc && src) { list.Add(src); } if (this.bAtker && atker) { list.Add(atker); } if (this.RefObjList != null && this.RefObjList.Length > 0) { GameObject[] refObjList = this.RefObjList; for (int i = 0; i < refObjList.Length; i++) { GameObject gameObject = refObjList[i]; if (!(gameObject == null)) { SpawnPoint componentInChildren = gameObject.GetComponentInChildren <SpawnPoint>(); if (componentInChildren != null) { List <PoolObjHandle <ActorRoot> > spawnedList = componentInChildren.GetSpawnedList(); List <PoolObjHandle <ActorRoot> > .Enumerator enumerator = spawnedList.GetEnumerator(); while (enumerator.MoveNext()) { PoolObjHandle <ActorRoot> current = enumerator.get_Current(); if (current) { list.Add(current); } } } else { PoolObjHandle <ActorRoot> actorRoot = ActorHelper.GetActorRoot(gameObject); if (actorRoot) { list.Add(actorRoot); } } } } } List <PoolObjHandle <ActorRoot> > .Enumerator enumerator2 = list.GetEnumerator(); while (enumerator2.MoveNext()) { if (enumerator2.get_Current()) { if (!this.HasActor(enumerator2.get_Current())) { this.SetHudText(Utility.GetBubbleText((uint)this.EnterUniqueId), enumerator2.get_Current()); if (this.TotalTime > 0) { int id = Singleton <CTimerManager> .GetInstance().AddTimer(this.TotalTime, 1, new CTimer.OnTimeUpHandler(this.OnTimeUp), true); this.m_actorTimerMap.Add(new TriggerActionTextBubble.ActorRootInfo { Actor = enumerator2.get_Current(), Id = id }); } } } } return(null); }
public override RefParamOperator TriggerEnter(PoolObjHandle <ActorRoot> src, PoolObjHandle <ActorRoot> atker, ITrigger inTrigger, object prm) { List <PoolObjHandle <ActorRoot> > list = new List <PoolObjHandle <ActorRoot> >(); if (base.bSrc && (src != 0)) { list.Add(src); } if (base.bAtker && (atker != 0)) { list.Add(atker); } if ((base.RefObjList != null) && (base.RefObjList.Length > 0)) { foreach (GameObject obj2 in base.RefObjList) { if (obj2 != null) { SpawnPoint componentInChildren = obj2.GetComponentInChildren <SpawnPoint>(); if (componentInChildren != null) { List <PoolObjHandle <ActorRoot> > .Enumerator enumerator = componentInChildren.GetSpawnedList().GetEnumerator(); while (enumerator.MoveNext()) { PoolObjHandle <ActorRoot> current = enumerator.Current; if (current != 0) { list.Add(current); } } } else { PoolObjHandle <ActorRoot> actorRoot = ActorHelper.GetActorRoot(obj2); if (actorRoot != 0) { list.Add(actorRoot); } } } } } List <PoolObjHandle <ActorRoot> > .Enumerator enumerator2 = list.GetEnumerator(); while (enumerator2.MoveNext()) { if ((enumerator2.Current != 0) && !this.HasActor(enumerator2.Current)) { this.SetHudText(Utility.GetBubbleText((uint)base.EnterUniqueId), enumerator2.Current); if (base.TotalTime > 0) { int num2 = Singleton <CTimerManager> .GetInstance().AddTimer(base.TotalTime, 1, new CTimer.OnTimeUpHandler(this.OnTimeUp), true); ActorRootInfo item = new ActorRootInfo { Actor = enumerator2.Current, Id = num2 }; this.m_actorTimerMap.Add(item); } } } return(null); }