public void ActivateTrigger(string triggerUid, bool save) { StoryTriggerVO vo = Service.Get <IDataController>().Get <StoryTriggerVO>(triggerUid); IStoryTrigger trigger = StoryTriggerFactory.GenerateStoryTrigger(vo, this); this.ActivateTrigger(trigger, save); }
public virtual void Destroy() { Service.Get <StaRTSLogger>().DebugFormat("Destroying trigger {0}", new object[] { this.vo.Uid }); this.vo = null; this.parent = null; this.prepareArgs = null; this.updateAction = null; }
private void ActivateNextChild() { this.childIndex++; if (this.childIndex < this.uids.Length) { StoryTriggerVO vo = this.sdc.Get <StoryTriggerVO>(this.uids[this.childIndex]); this.currentTrigger = StoryTriggerFactory.GenerateStoryTrigger(vo, this); this.currentTrigger.Activate(); return; } this.parent.SatisfyTrigger(this); }
public AutoStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { if (string.IsNullOrEmpty(vo.PrepareString)) { Service.Get <StaRTSLogger>().Error("AutoStoryTrigger: " + vo.Uid + " is missing prepare string"); } if (this.prepareArgs.Length < 3) { Service.Get <StaRTSLogger>().Error("AutoStoryTrigger: " + vo.Uid + " doesn't have enough arguments"); } this.savePrefName = this.prepareArgs[1]; this.saveValueReq = this.prepareArgs[2]; }
public static IStoryTrigger DeserializeStoryTrigger(object data, ITriggerReactor parent) { Dictionary <string, object> dictionary = data as Dictionary <string, object>; if (!dictionary.ContainsKey("uid")) { Service.Logger.Error("Quest Deserialization Error: Trigger Uid not found."); return(null); } string uid = dictionary["uid"] as string; StoryTriggerVO vo = Service.StaticDataController.Get <StoryTriggerVO>(uid); AbstractStoryTrigger abstractStoryTrigger = StoryTriggerFactory.GenerateStoryTrigger(vo, parent) as AbstractStoryTrigger; return(abstractStoryTrigger.FromObject(dictionary) as AbstractStoryTrigger); }
public static AbstractRUFTask GetRUFTaskForAutoTrigger(StoryTriggerVO vo) { if (string.IsNullOrEmpty(vo.PrepareString)) { Service.Get <StaRTSLogger>().Error("AutoStoryTrigger: " + vo.Uid + " is missing prepare string"); return(null); } string[] array = vo.PrepareString.Split(new char[] { '|' }); if (array.Length < 2) { Service.Get <StaRTSLogger>().Error("AutoStoryTrigger: " + vo.Uid + " doesn't have enough arguments"); return(null); } string text = array[0]; string prefName = array[1]; if ("IF_PREF".Equals(text)) { AutoStoryTrigger trigger = new AutoStoryTrigger(vo, Service.Get <QuestController>()); return(new AutoTriggerRUFTask(trigger)); } if (!"RESUME".Equals(text)) { return(null); } SharedPlayerPrefs sharedPlayerPrefs = Service.Get <SharedPlayerPrefs>(); string pref = sharedPlayerPrefs.GetPref <string>(prefName); if (string.IsNullOrEmpty(pref)) { return(null); } StoryActionVO optional = Service.Get <IDataController>().GetOptional <StoryActionVO>(pref); if (optional == null) { return(null); } return(new ResumeTutorialRUFTask(optional.Uid)); }
public override void Activate() { StaticDataController staticDataController = Service.StaticDataController; this.children = new Dictionary <IStoryTrigger, bool>(); string[] array = this.prepareArgs[0].Split(new char[] { ',' }); string[] array2 = array; for (int i = 0; i < array2.Length; i++) { string uid = array2[i]; StoryTriggerVO vo = staticDataController.Get <StoryTriggerVO>(uid); IStoryTrigger storyTrigger = StoryTriggerFactory.GenerateStoryTrigger(vo, this); this.children.Add(storyTrigger, false); storyTrigger.Activate(); } }
public AbstractStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) { this.vo = vo; this.parent = parent; this.Reaction = vo.Reaction; if (!string.IsNullOrEmpty(vo.PrepareString)) { this.prepareArgs = vo.PrepareString.Split(new char[] { '|' }); } else { this.prepareArgs = new string[0]; } if (!string.IsNullOrEmpty(vo.UpdateAction)) { IDataController dataController = Service.Get <IDataController>(); try { StoryActionVO storyActionVO = dataController.Get <StoryActionVO>(vo.UpdateAction); this.updateAction = StoryActionFactory.GenerateStoryAction(storyActionVO, this); if (!string.IsNullOrEmpty(this.updateAction.VO.Reaction)) { Service.Get <StaRTSLogger>().ErrorFormat("Story chaining is not currently supported for UIActions. {0}, {1}", new object[] { vo.Uid, vo.UpdateAction }); } } catch (KeyNotFoundException ex) { Service.Get <StaRTSLogger>().ErrorFormat("Error in StoryTrigger {0}. Could not find UiAction {1}.", new object[] { vo.Uid, vo.UpdateAction }); throw ex; } } }
public ScreenAppearStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { }
public BattleCompleteStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { }
public SquadUIOpenStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { }
public static IStoryTrigger GenerateStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) { string triggerType = vo.TriggerType; uint num = < PrivateImplementationDetails >.ComputeStringHash(triggerType); if (num <= 2057951039u) { if (num <= 880974561u) { if (num <= 325412241u) { if (num != 75439796u) { if (num != 309063606u) { if (num != 325412241u) { goto IL_426; } if (!(triggerType == "GalaxyMapOpen")) { goto IL_426; } return(new GalaxyMapOpenStoryTrigger(vo, parent)); } else { if (!(triggerType == "Auto")) { goto IL_426; } return(new AutoStoryTrigger(vo, parent)); } } else { if (!(triggerType == "BattleComplete")) { goto IL_426; } return(new BattleCompleteStoryTrigger(vo, parent)); } } else if (num != 738717363u) { if (num != 809982735u) { if (num != 880974561u) { goto IL_426; } if (!(triggerType == "ScreenAppears")) { goto IL_426; } return(new ScreenAppearStoryTrigger(vo, parent)); } else { if (!(triggerType == "SquadMember")) { goto IL_426; } return(new SquadMemberStoryTrigger(vo, parent)); } } else { if (!(triggerType == "ScoutPlanet")) { goto IL_426; } return(new ScoutPlanetTrigger(vo, parent)); } } else if (num <= 1166570171u) { if (num != 959338504u) { if (num != 1066278926u) { if (num != 1166570171u) { goto IL_426; } if (!(triggerType == "RepairBuildingComplete")) { goto IL_426; } } else { if (!(triggerType == "ClusterAND")) { goto IL_426; } return(new ClusterANDStoryTrigger(vo, parent)); } } else { if (!(triggerType == "GameState")) { goto IL_426; } return(new GameStateStoryTrigger(vo, parent)); } } else if (num != 1575734819u) { if (num != 1610766953u) { if (num != 2057951039u) { goto IL_426; } if (!(triggerType == "FactionChoiceComplete")) { goto IL_426; } return(new FactionChangedStoryTrigger(vo, parent)); } else { if (!(triggerType == "MissionVictory")) { goto IL_426; } return(new MissionVictoryStoryTrigger(vo, parent)); } } else { if (!(triggerType == "squadUIOpen")) { goto IL_426; } return(new SquadUIOpenStoryTrigger(vo, parent)); } } else if (num <= 3573432780u) { if (num <= 3174207744u) { if (num != 2275058931u) { if (num != 2581225745u) { if (num != 3174207744u) { goto IL_426; } if (!(triggerType == "SquadSize")) { goto IL_426; } return(new SquadSizeStoryTrigger(vo, parent)); } else { if (!(triggerType == "EventCounter")) { goto IL_426; } return(new EventCounterStoryTrigger(vo, parent)); } } else { if (!(triggerType == "WorldLoad")) { goto IL_426; } return(new WorldLoadStoryTrigger(vo, parent)); } } else if (num != 3324871712u) { if (num != 3358627246u) { if (num != 3573432780u) { goto IL_426; } if (!(triggerType == "PlanetRelocate")) { goto IL_426; } return(new PlanetRelocateStoryTrigger(vo, parent)); } else { if (!(triggerType == "BlockingInitWarClick")) { goto IL_426; } return(new BlockingWarStoryTrigger(vo, parent)); } } else { if (!(triggerType == "HQLevel")) { goto IL_426; } return(new HQLevelStoryTrigger(vo, parent)); } } else if (num <= 3759229686u) { if (num != 3574966019u) { if (num != 3713188019u) { if (num != 3759229686u) { goto IL_426; } if (!(triggerType == "squadActiveMembers")) { goto IL_426; } return(new SquadActiveMembersStoryTrigger(vo, parent)); } else { if (!(triggerType == "WorldTransitionComplete")) { goto IL_426; } return(new WorldTransitionCompleteStoryTrigger(vo, parent)); } } else { if (!(triggerType == "UnlockPlanet")) { goto IL_426; } return(new UnlockPlanetTrigger(vo, parent)); } } else if (num != 3776171487u) { if (num != 3828256924u) { if (num != 3948127682u) { goto IL_426; } if (!(triggerType == "Timer")) { goto IL_426; } return(new TimerTrigger(vo, parent)); } else if (!(triggerType == "RepairAllComplete")) { goto IL_426; } } else { if (!(triggerType == "ClusterORDER")) { goto IL_426; } return(new ClusterORDERStoryTrigger(vo, parent)); } return(new BuildingRepairStoryTrigger(vo, parent)); IL_426: Service.Get <StaRTSLogger>().ErrorFormat("There is no entry in the StoryTriggerFactory for {0}", new object[] { vo.TriggerType }); return(new AbstractStoryTrigger(vo, parent)); }
public BuildingRepairStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { }
public BlockingWarStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { }
public ScoutPlanetTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { }
public SquadMemberStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { }
public HQLevelStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { this.isSatisfied = false; }
public static IStoryTrigger GenerateStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) { string triggerType = vo.TriggerType; switch (triggerType) { case "Auto": return(new AutoStoryTrigger(vo, parent)); case "BattleComplete": return(new BattleCompleteStoryTrigger(vo, parent)); case "ClusterAND": return(new ClusterANDStoryTrigger(vo, parent)); case "ClusterORDER": return(new ClusterORDERStoryTrigger(vo, parent)); case "EventCounter": return(new EventCounterStoryTrigger(vo, parent)); case "FactionChoiceComplete": return(new FactionChangedStoryTrigger(vo, parent)); case "GalaxyMapOpen": return(new GalaxyMapOpenStoryTrigger(vo, parent)); case "GameState": return(new GameStateStoryTrigger(vo, parent)); case "HQLevel": return(new HQLevelStoryTrigger(vo, parent)); case "MissionVictory": return(new MissionVictoryStoryTrigger(vo, parent)); case "PlanetRelocate": return(new PlanetRelocateStoryTrigger(vo, parent)); case "RepairAllComplete": case "RepairBuildingComplete": return(new BuildingRepairStoryTrigger(vo, parent)); case "ScreenAppears": return(new ScreenAppearStoryTrigger(vo, parent)); case "ScoutPlanet": return(new ScoutPlanetTrigger(vo, parent)); case "Timer": return(new TimerTrigger(vo, parent)); case "UnlockPlanet": return(new UnlockPlanetTrigger(vo, parent)); case "WorldLoad": return(new WorldLoadStoryTrigger(vo, parent)); case "WorldTransitionComplete": return(new WorldTransitionCompleteStoryTrigger(vo, parent)); case "SquadMember": return(new SquadMemberStoryTrigger(vo, parent)); case "BlockingInitWarClick": return(new BlockingWarStoryTrigger(vo, parent)); case "SquadSize": return(new SquadSizeStoryTrigger(vo, parent)); case "squadActiveMembers": return(new SquadActiveMembersStoryTrigger(vo, parent)); case "squadUIOpen": return(new SquadUIOpenStoryTrigger(vo, parent)); } Service.Logger.ErrorFormat("There is no entry in the StoryTriggerFactory for {0}", new object[] { vo.TriggerType }); return(new AbstractStoryTrigger(vo, parent)); }
public PlanetRelocateStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { }
public GalaxyMapOpenStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { }
public GameStateStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { }
public EventCounterStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { this.eventCount = -1; }
public SquadSizeStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { }
public ClusterANDStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { }
public MissionVictoryStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { }
public UnlockPlanetTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { }
public WorldLoadStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { }
public FactionChangedStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { }
public WorldTransitionCompleteStoryTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { }
public TimerTrigger(StoryTriggerVO vo, ITriggerReactor parent) : base(vo, parent) { }