private void Start() { if (PersistentSingleton <GameSettings> .Instance.MapJellyOn) { m_runner = (MapNodeRunner)Singleton <PropertyManager> .Instance.GetContext("MapNodeRunner", base.transform); (from _ in m_onEnabled where PlayerData.Instance.LifetimeChunk.Value >= m_runner.NodeIndex * 10 && PlayerData.Instance.LifetimeChunk.Value < (m_runner.NodeIndex + 1) * 10 select _).DelayFrame(1).Subscribe(delegate { BindingManager.Instance.MapJelly.Move(base.transform.position); }).AddTo(this); (from completed in m_runner.Completed.CombineLatest(m_onEnabled, (bool completed, bool enabled) => completed).DelayFrame(2) where completed && PlayerData.Instance.LifetimeChunk.Value == (m_runner.NodeIndex + 1) * 10 select completed).Subscribe(delegate { if (Singleton <WorldRunner> .Instance.HaveProgressedInCurrentSession.Value && !m_transitionedFrom) { BindingManager.Instance.MapJelly.Move(base.transform.position); m_transitionedFrom = true; } }).AddTo(this); (from current in m_runner.IsCurrent.CombineLatest(m_onEnabled, (bool current, bool enabled) => current).DelayFrame(3) where current && PlayerData.Instance.LifetimeChunk.Value == m_runner.NodeIndex * 10 select current).Subscribe(delegate { if (Singleton <WorldRunner> .Instance.HaveProgressedInCurrentSession.Value && !m_transitionedTo) { BindingManager.Instance.MapJelly.DecreaseJelly(base.transform.position); m_transitionedTo = true; } }).AddTo(this); } }
private void Start() { MapNodeRunner mapNodeRunner = (MapNodeRunner)Singleton <PropertyManager> .Instance.GetContext("MapNodeRunner", base.transform); int nodeIndex = mapNodeRunner.NodeIndex; string text = PersistentSingleton <LocalizationService> .Instance.Text("Prestige.ChunkLevel", nodeIndex * 10); base.gameObject.GetComponent <Text>().text = text; }
protected void Start() { MapNodeRunner mapNodeRunner = (MapNodeRunner)Singleton <PropertyManager> .Instance.GetContext("MapNodeRunner", base.transform); PredictableRandom.SetSeed((uint)(mapNodeRunner.NodeIndex + 125), (uint)(PlayerData.Instance.LifetimePrestiges.Value + 125)); int nextRangeInt = PredictableRandom.GetNextRangeInt(0, 3); Singleton <PropertyManager> .Instance.InstantiateSetParent(BindingManager.Instance.BiomeList.Biomes[mapNodeRunner.GetBiomeIndex()].MapNodeProfile[nextRangeInt], Vector3.zero, Quaternion.identity, null, base.transform); }
public override void Install(Dictionary <string, object> parameters) { if (parameters != null && parameters.ContainsKey("NodeOffset")) { m_nodeOffset = (int)parameters["NodeOffset"]; } int num = (int)Singleton <PropertyManager> .Instance.GetContext("Chapter", base.transform); m_runner = Singleton <MapRunner> .Instance.GetOrCreateMapNodeRunner(num * 4 + m_nodeOffset); Add("MapNodeRunner", m_runner); }
private IEnumerator Enable() { yield return(false); MapNodeRunner mapnode = (MapNodeRunner)Singleton <PropertyManager> .Instance.GetContext("MapNodeRunner", base.transform); int node = mapnode.NodeIndex; if (node * 10 + 9 == Singleton <DrJellyRunner> .Instance.DrJellyExitLevel.Value) { GameObject gameObject = Singleton <PropertyManager> .Instance.InstantiateFromResources("Map/MapDrJellyEscape", Vector3.zero, Quaternion.identity, null); gameObject.transform.SetParent(base.transform, worldPositionStays: false); Singleton <DrJellyRunner> .Instance.DrJellyExitLevel.SetValueAndForceNotify(-1); } if ((node + 1) * 10 > Singleton <WorldRunner> .Instance.CurrentChunk.Value.Index) { int newCreatureInRangeOrNone = Singleton <EconomyHelpers> .Instance.GetNewCreatureInRangeOrNone(PlayerData.Instance.MainChunk.Value, node * 10, (node + 1) * 10 - 1); if (newCreatureInRangeOrNone > -1) { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary.Add("HeroIndex", newCreatureInRangeOrNone); GameObject gameObject2 = Singleton <PropertyManager> .Instance.InstantiateFromResources("Map/NewCompanionBubble", Vector3.zero, Quaternion.identity, dictionary); gameObject2.transform.SetParent(base.transform, worldPositionStays: false); } int newGearSetInRangeOrNone = Singleton <EconomyHelpers> .Instance.GetNewGearSetInRangeOrNone(PlayerData.Instance.LifetimeChunk.Value, node * 10, (node + 1) * 10 - 1); if (newGearSetInRangeOrNone > -1) { GameObject gameObject3 = Singleton <PropertyManager> .Instance.InstantiateFromResources("Map/NewBlueprintBubble", Vector3.zero, Quaternion.identity, null); gameObject3.transform.SetParent(base.transform, worldPositionStays: false); } int num = Singleton <PrestigeRunner> .Instance.PrestigeRequirement.Value - 1; if ((node + 1) * 10 - 1 >= PlayerData.Instance.MainChunk.Value && num >= node * 10 && num < (node + 1) * 10) { GameObject gameObject4 = Singleton <PropertyManager> .Instance.InstantiateFromResources("Map/NewPrestigePointBubble", Vector3.zero, Quaternion.identity, null); gameObject4.transform.SetParent(base.transform, worldPositionStays: false); } int value = Singleton <DrJellyRunner> .Instance.DrJellyLevel.Value; if (value >= node * 10 && value < (node + 1) * 10) { GameObject gameObject5 = Singleton <PropertyManager> .Instance.InstantiateFromResources("Map/NewDrJellyBubble", Vector3.zero, Quaternion.identity, null); gameObject5.transform.SetParent(base.transform, worldPositionStays: false); } } }
private IEnumerator Enable() { base.transform.DestroyChildrenImmediate(); yield return(null); MapNodeRunner mapnode = (MapNodeRunner)Singleton <PropertyManager> .Instance.GetContext("MapNodeRunner", base.transform); int node = mapnode.NodeIndex; int companion = Singleton <EconomyHelpers> .Instance.GetNewCreatureInRangeOrNone(PlayerData.Instance.MainChunk.Value, node * 10, (node + 1) * 10 - 1); if (companion > -1) { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary.Add("HeroIndex", companion); GameObject gameObject = Singleton <PropertyManager> .Instance.InstantiateFromResources("Map/MinimapBubbles/MInimap_NewCompanionBubble", Vector3.zero, Quaternion.identity, dictionary); gameObject.transform.SetParent(base.transform, worldPositionStays: false); } yield return(null); int gear = Singleton <EconomyHelpers> .Instance.GetNewGearSetInRangeOrNone(PlayerData.Instance.LifetimeChunk.Value, node * 10, (node + 1) * 10 - 1); if (gear > -1) { GameObject gameObject2 = Singleton <PropertyManager> .Instance.InstantiateFromResources("Map/MinimapBubbles/MInimap_NewBlueprintBubble", Vector3.zero, Quaternion.identity, null); gameObject2.transform.SetParent(base.transform, worldPositionStays: false); } yield return(null); int prestigeRequirement = Singleton <PrestigeRunner> .Instance.PrestigeRequirement.Value - 1; if ((node + 1) * 10 - 1 >= PlayerData.Instance.MainChunk.Value && prestigeRequirement >= node * 10 && prestigeRequirement < (node + 1) * 10) { GameObject gameObject3 = Singleton <PropertyManager> .Instance.InstantiateFromResources("Map/MinimapBubbles/MInimap_NewPrestigePointBubble", Vector3.zero, Quaternion.identity, null); gameObject3.transform.SetParent(base.transform, worldPositionStays: false); } yield return(null); int drJelly = Singleton <DrJellyRunner> .Instance.DrJellyLevel.Value; if (drJelly >= node * 10 && drJelly < (node + 1) * 10) { GameObject gameObject4 = Singleton <PropertyManager> .Instance.InstantiateFromResources("Map/MinimapBubbles/MInimap_NewDrJellyBubble", Vector3.zero, Quaternion.identity, null); gameObject4.transform.SetParent(base.transform, worldPositionStays: false); } yield return(null); }
protected void Start() { Singleton <PropertyManager> .Instance.InstantiateFromResourcesSetParent("Map/MapNode", Vector3.zero, Quaternion.identity, null, base.transform); m_runner = (MapNodeRunner)Singleton <PropertyManager> .Instance.GetContext("MapNodeRunner", base.transform); Animator animator = GetComponentInChildren <Animator>(); (from locked in m_runner.Locked.CombineLatest(m_onEnabled, (bool locked, bool enabled) => locked) where locked select locked).Subscribe(delegate { animator.SetTrigger("Locked"); }).AddTo(this); (from completed in m_runner.Completed.CombineLatest(m_onEnabled, (bool completed, bool enabled) => completed) where completed select completed).Subscribe(delegate { animator.SetTrigger("Completed"); }).AddTo(this); (from current in m_runner.IsCurrent.CombineLatest(m_onEnabled, (bool current, bool enabled) => current) where current select current).Subscribe(delegate { animator.SetTrigger("Current"); }).AddTo(this); (from current in m_runner.IsCurrent.CombineLatest(m_onEnabled, (bool current, bool enabled) => current) where current select current).DelayFrame(2).Subscribe(delegate { BindingManager.Instance.MapCamera.CenterCamera(base.transform.position); }).AddTo(this); (from travel in m_runner.TriggerTravel.CombineLatest(m_onEnabled, (bool travel, bool enabled) => travel) where travel select travel).Subscribe(delegate { animator.SetTrigger("OnTravel"); }).AddTo(this); (from completed in m_runner.TriggerCompleted.CombineLatest(m_onEnabled, (bool completed, bool enabled) => completed) where completed select completed).Subscribe(delegate { animator.SetTrigger("OnCompleted"); }).AddTo(this); }
private IEnumerator Enable() { yield return(false); MapNodeRunner mapnode = (MapNodeRunner)Singleton <PropertyManager> .Instance.GetContext("MapNodeRunner", base.transform); int node = mapnode.NodeIndex; List <FBPlayer> playersInTheNode = new List <FBPlayer>(); foreach (KeyValuePair <string, FBPlayer> fBPlayer in PersistentSingleton <FacebookAPIService> .Instance.FBPlayers) { if (fBPlayer.Value.Highscore > 0 && fBPlayer.Value.Highscore >= node * 10 && fBPlayer.Value.Highscore < (node + 1) * 10) { playersInTheNode.Add(fBPlayer.Value); } } base.transform.DestroyChildrenImmediate(); for (int i = 0; i < 3 && i < playersInTheNode.Count; i++) { Dictionary <string, object> dictionary = new Dictionary <string, object>(); dictionary.Add("StringValue", playersInTheNode[i].Id + ".png"); if (playersInTheNode[i].Id == PlayerData.Instance.FBId.Value) { GameObject gameObject = Singleton <PropertyManager> .Instance.InstantiateFromResources("Map/PlayerBubble", Vector3.zero, Quaternion.identity, dictionary); gameObject.transform.SetParent(base.transform, worldPositionStays: false); } else { GameObject gameObject2 = Singleton <PropertyManager> .Instance.InstantiateFromResources("Map/FriendBubble", Vector3.zero, Quaternion.identity, dictionary); gameObject2.transform.SetParent(base.transform, worldPositionStays: false); } } if (playersInTheNode.Count > 3) { Dictionary <string, object> dictionary2 = new Dictionary <string, object>(); dictionary2.Add("StringValue", "+" + (playersInTheNode.Count - 3)); GameObject gameObject3 = Singleton <PropertyManager> .Instance.InstantiateFromResources("Map/FriendsNumber", Vector3.zero, Quaternion.identity, dictionary2); gameObject3.transform.SetParent(base.transform, worldPositionStays: false); } }