public static void OnDeath() { if (Randomizer.Sync) { RandomizerSyncManager.onDeath(); } RandomizerBonusSkill.OnDeath(); RandomizerTrackedDataManager.UpdateBitfields(); RandomizerStatsManager.OnDeath(); }
// Token: 0x06003004 RID: 12292 public void FixedUpdate() { MapStone.State currentState = this.CurrentState; if (currentState != MapStone.State.Normal) { if (currentState == MapStone.State.Highlighted) { if (this.DistanceToSein > this.Radius || this.OriHasTargets || !Characters.Sein.IsOnGround) { this.Unhighlight(); this.CurrentState = MapStone.State.Normal; } if (Characters.Sein.Controller.CanMove && !Characters.Sein.IsSuspended && Core.Input.SpiritFlame.OnPressed) { if (Characters.Sein.Inventory.MapStones > 0) { Characters.Sein.Inventory.MapStones--; if (this.OnOpenedAction) { this.OnOpenedAction.Perform(null); } AchievementsLogic.Instance.OnMapStoneActivated(); this.CurrentState = MapStone.State.Activated; Randomizer.getMapStone(); RandomizerTrackedDataManager.SetMapstone(this.WorldArea.AreaIdentifier); return; } UI.SeinUI.ShakeMapstones(); if (this.OnFailAction) { this.OnFailAction.Perform(null); return; } } } } else if (this.DistanceToSein < this.Radius && !this.OriHasTargets && Characters.Sein.IsOnGround) { this.Highlight(); this.CurrentState = MapStone.State.Highlighted; } }
// Token: 0x06000F85 RID: 3973 RVA: 0x0005DF74 File Offset: 0x0005C174 public void SetAbility(AbilityType ability, bool value) { switch (ability) { case AbilityType.Bash: if (Randomizer.GiveAbility) { this.Bash.HasAbility = true; } else { Randomizer.getSkill(4); } break; case AbilityType.ChargeFlame: if (Randomizer.GiveAbility) { this.ChargeFlame.HasAbility = true; } else { Randomizer.getSkill(2); } break; case AbilityType.WallJump: if (Randomizer.GiveAbility) { this.WallJump.HasAbility = true; } else { Randomizer.getSkill(1); } break; case AbilityType.Stomp: if (Randomizer.GiveAbility) { this.Stomp.HasAbility = true; } else { Randomizer.getSkill(5); } break; case AbilityType.DoubleJump: if (Randomizer.GiveAbility) { this.DoubleJump.HasAbility = true; } else { Randomizer.getSkill(3); } break; case AbilityType.ChargeJump: if (Randomizer.GiveAbility) { this.ChargeJump.HasAbility = true; } else { Randomizer.getSkill(8); } break; case AbilityType.Magnet: this.Magnet.HasAbility = value; break; case AbilityType.UltraMagnet: this.UltraMagnet.HasAbility = value; break; case AbilityType.Climb: if (Randomizer.GiveAbility) { this.Climb.HasAbility = true; } else { Randomizer.getSkill(7); } break; case AbilityType.Glide: if (Randomizer.GiveAbility) { this.Glide.HasAbility = true; } else { Randomizer.getSkill(6); } break; case AbilityType.SpiritFlame: RandomizerTrackedDataManager.SetTree(0); this.SpiritFlame.HasAbility = value; Characters.Ori.MoveOriToPlayer(); break; case AbilityType.RapidFlame: this.RapidFire.HasAbility = value; break; case AbilityType.SplitFlameUpgrade: this.SplitFlameUpgrade.HasAbility = value; break; case AbilityType.SoulEfficiency: this.SoulEfficiency.HasAbility = value; break; case AbilityType.WaterBreath: this.WaterBreath.HasAbility = value; break; case AbilityType.ChargeFlameBlast: this.ChargeFlameBlast.HasAbility = value; break; case AbilityType.ChargeFlameBurn: this.ChargeFlameBurn.HasAbility = value; break; case AbilityType.DoubleJumpUpgrade: this.DoubleJumpUpgrade.HasAbility = value; break; case AbilityType.BashBuff: this.BashBuff.HasAbility = value; break; case AbilityType.UltraDefense: this.UltraDefense.HasAbility = value; break; case AbilityType.HealthEfficiency: this.HealthEfficiency.HasAbility = value; break; case AbilityType.Sense: this.Sense.HasAbility = value; break; case AbilityType.UltraStomp: this.StompUpgrade.HasAbility = value; break; case AbilityType.SparkFlame: this.SparkFlame.HasAbility = value; break; case AbilityType.QuickFlame: this.QuickFlame.HasAbility = value; break; case AbilityType.MapMarkers: this.MapMarkers.HasAbility = value; break; case AbilityType.EnergyEfficiency: this.EnergyEfficiency.HasAbility = value; break; case AbilityType.HealthMarkers: this.HealthMarkers.HasAbility = value; break; case AbilityType.EnergyMarkers: this.EnergyMarkers.HasAbility = value; break; case AbilityType.AbilityMarkers: this.AbilityMarkers.HasAbility = value; break; case AbilityType.Rekindle: this.Rekindle.HasAbility = value; break; case AbilityType.Regroup: this.Regroup.HasAbility = value; break; case AbilityType.ChargeFlameEfficiency: this.ChargeFlameEfficiency.HasAbility = value; break; case AbilityType.UltraSoulFlame: this.UltraSoulFlame.HasAbility = value; break; case AbilityType.SoulFlameEfficiency: this.SoulFlameEfficiency.HasAbility = value; break; case AbilityType.CinderFlame: this.CinderFlame.HasAbility = value; break; case AbilityType.UltraSplitFlame: this.UltraSplitFlame.HasAbility = value; break; case AbilityType.Dash: if (Randomizer.GiveAbility) { this.Dash.HasAbility = true; } else { Randomizer.getSkill(10); } break; case AbilityType.Grenade: if (Randomizer.GiveAbility) { this.Grenade.HasAbility = true; } else { Randomizer.getSkill(9); } break; case AbilityType.GrenadeUpgrade: this.GrenadeUpgrade.HasAbility = value; break; case AbilityType.ChargeDash: this.ChargeDash.HasAbility = value; break; case AbilityType.AirDash: this.AirDash.HasAbility = value; break; case AbilityType.GrenadeEfficiency: this.GrenadeEfficiency.HasAbility = value; break; } this.m_sein.Prefabs.EnsureRightPrefabsAreThereForAbilities(); }
public static void getSkill(int tree) { RandomizerTrackedDataManager.SetTree(tree); Randomizer.getSkill(); }
public static void Update() { Randomizer.UpdateMessages(); if (Characters.Sein && SkillTreeManager.Instance != null && SkillTreeManager.Instance.NavigationManager.IsVisible) { if (Characters.Sein.IsSuspended) { SkillTreeManager.Instance.NavigationManager.FadeAnimator.SetParentOpacity(1f); } else { SkillTreeManager.Instance.NavigationManager.FadeAnimator.SetParentOpacity(RandomizerSettings.AbilityMenuOpacity); } } Randomizer.Tick(); if (Characters.Sein && !Characters.Sein.IsSuspended) { RandomizerBonus.Update(); if (!Randomizer.ColorShift) { RandomizerColorManager.UpdateColors(); } Randomizer.UpdateHoruCutsceneStatus(); if (Characters.Sein.Inventory.GetRandomizerItem(82) > 0 && Items.NightBerry != null) { Items.NightBerry.transform.position = new Vector3(-910f, -300f); Characters.Sein.Inventory.SetRandomizerItem(82, 0); } if (RandomizerBonusSkill.LevelExplosionCooldown > 0) { RandomizerBonusSkill.LevelExplosionCooldown--; if (RandomizerBonusSkill.LevelExplosionCooldown > 10) { Characters.Sein.Energy.SetCurrent(RandomizerBonusSkill.OldEnergy); Characters.Sein.Mortality.Health.SetAmount(RandomizerBonusSkill.OldHealth); } } if (Randomizer.Chaos) { RandomizerChaosManager.Update(); } if (Randomizer.Sync) { RandomizerSyncManager.Update(); } if (Randomizer.Warping > 0) { if (Randomizer.DelayedWarp) { Randomizer.DelayedWarp = false; Randomizer.WarpTo(Randomizer.WarpTarget, Randomizer.Warping); } else { Characters.Sein.Position = Randomizer.WarpTarget; Characters.Sein.Speed = new Vector3(0f, 0f); Characters.Ori.Position = new Vector3(Randomizer.WarpTarget.x, Randomizer.WarpTarget.y - 5); bool loading = false; foreach (SceneManagerScene sms in Scenes.Manager.ActiveScenes) { if (sms.CurrentState == SceneManagerScene.State.Loading) { loading = true; break; } } if (!loading) { Randomizer.Warping--; } if (Randomizer.Warping == 0 && Randomizer.SaveAfterWarp) { GameController.Instance.CreateCheckpoint(); GameController.Instance.SaveGameController.PerformSave(); Randomizer.SaveAfterWarp = false; } } } else if (Randomizer.Returning) { Characters.Sein.Position = new Vector3(189f, -215f); if (Scenes.Manager.CurrentScene.Scene == "sunkenGladesRunaway") { Randomizer.Returning = false; } } } if (CreditsActive) { return; } if (RandomizerRebinding.ReloadSeed.IsPressed()) { Randomizer.initialize(); Randomizer.showSeedInfo(); return; } if (RandomizerRebinding.ShowStats.IsPressed() && Characters.Sein) { RandomizerStatsManager.ShowStats(10); return; } if (RandomizerRebinding.ListTrees.IsPressed() && Characters.Sein) { Randomizer.MessageQueueTime = 0; RandomizerTrackedDataManager.ListTrees(); return; } if (RandomizerRebinding.ListRelics.IsPressed() && Characters.Sein) { Randomizer.MessageQueueTime = 0; RandomizerTrackedDataManager.ListRelics(); return; } if (RandomizerRebinding.ListMapAltars.IsPressed() && Characters.Sein) { Randomizer.MessageQueueTime = 0; RandomizerTrackedDataManager.ListMapstones(); return; } if (RandomizerRebinding.ListTeleporters.IsPressed() && Characters.Sein) { Randomizer.MessageQueueTime = 0; RandomizerTrackedDataManager.ListTeleporters(); return; } if (RandomizerRebinding.BonusSwitch.IsPressed() && Characters.Sein) { RandomizerBonusSkill.SwitchBonusSkill(); return; } if (RandomizerRebinding.BonusToggle.IsPressed() && Characters.Sein) { RandomizerBonusSkill.ActivateBonusSkill(); return; } if (RandomizerRebinding.BonusSwitch.IsPressed() && Characters.Sein) { RandomizerBonusSkill.SwitchBonusSkill(); return; } if (RandomizerRebinding.ReplayMessage.IsPressed()) { Randomizer.playLastMessage(); return; } if (RandomizerRebinding.ReturnToStart.IsPressed() && Characters.Sein && Randomizer.Warping <= 0) { if (Randomizer.AltRDisabled || RandomizerBonus.AltRDisabled()) { Randomizer.printInfo("Return to start is disabled!"); return; } Randomizer.returnToStart(); return; } if (RandomizerRebinding.ShowProgress.IsPressed() && Characters.Sein) { Randomizer.MessageQueueTime = 0; Randomizer.showProgress(); return; } if (RandomizerRebinding.ColorShift.IsPressed()) { string obj = "Color shift enabled"; if (Randomizer.ColorShift) { obj = "Color shift disabled"; } else { Randomizer.changeColor(); } Randomizer.ColorShift = !Randomizer.ColorShift; Randomizer.printInfo(obj); } if (RandomizerRebinding.ToggleChaos.IsPressed() && Characters.Sein) { if (Randomizer.Chaos) { Randomizer.showChaosMessage("Chaos deactivated"); Randomizer.Chaos = false; RandomizerChaosManager.ClearEffects(); return; } Randomizer.showChaosMessage("Chaos activated"); Randomizer.Chaos = true; return; } else if (RandomizerRebinding.ChaosVerbosity.IsPressed() && Randomizer.Chaos) { Randomizer.ChaosVerbose = !Randomizer.ChaosVerbose; if (Randomizer.ChaosVerbose) { Randomizer.showChaosMessage("Chaos messages enabled"); return; } Randomizer.showChaosMessage("Chaos messages disabled"); return; } else { if (RandomizerRebinding.ForceChaosEffect.IsPressed() && Randomizer.Chaos && Characters.Sein) { RandomizerChaosManager.SpawnEffect(); return; } return; } }
public static void initialize() { Randomizer.OHKO = false; Randomizer.ZeroXP = false; Randomizer.BonusActive = true; Randomizer.GiveAbility = false; Randomizer.Chaos = false; Randomizer.ChaosVerbose = false; Randomizer.Returning = false; Randomizer.Sync = false; Randomizer.ForceMaps = false; Randomizer.SyncMode = 4; Randomizer.StringKeyPickupTypes = new List <string> { "TP", "SH", "NO", "WT", "MU", "HN", "WP", "RP", "WS" }; Randomizer.ShareParams = ""; RandomizerChaosManager.initialize(); Randomizer.DamageModifier = 1f; Randomizer.Table = new Hashtable(); Randomizer.GridFactor = 4.0; Randomizer.Message = "Good luck on your rando!"; Randomizer.MessageProvider = (RandomizerMessageProvider)ScriptableObject.CreateInstance(typeof(RandomizerMessageProvider)); Randomizer.ProgressiveMapStones = true; Randomizer.ForceTrees = false; Randomizer.CluesMode = false; Randomizer.Shards = false; Randomizer.WorldTour = false; Randomizer.SeedMeta = ""; Randomizer.MistySim = new WorldEvents(); Randomizer.MistySim.MoonGuid = new MoonGuid(1061758509, 1206015992, 824243626, -2026069462); Randomizer.TeleportTable = new Hashtable(); Randomizer.TeleportTable["Forlorn"] = "forlorn"; Randomizer.TeleportTable["Grotto"] = "moonGrotto"; Randomizer.TeleportTable["Sorrow"] = "valleyOfTheWind"; Randomizer.TeleportTable["Grove"] = "spiritTree"; Randomizer.TeleportTable["Swamp"] = "swamp"; Randomizer.TeleportTable["Valley"] = "sorrowPass"; Randomizer.TeleportTable["Ginso"] = "ginsoTree"; Randomizer.TeleportTable["Horu"] = "mountHoru"; Randomizer.TeleportTable["Glades"] = "sunkenGlades"; Randomizer.TeleportTable["Blackroot"] = "mangroveFalls"; Randomizer.Entrance = false; Randomizer.DoorTable = new Hashtable(); Randomizer.ColorShift = false; Randomizer.MessageQueue = new Queue(); Randomizer.MessageQueueTime = 0; Randomizer.QueueBash = false; Randomizer.BashWasQueued = false; Randomizer.BashTap = false; Randomizer.fragsEnabled = false; Randomizer.LastTick = 10000000L; Randomizer.LockedCount = 0; Randomizer.ResetTrackerCount = 0; Randomizer.HotCold = false; Randomizer.HotColdTypes = new string[] { "EV", "RB17", "RB19", "RB21", "RB28", "SK" }; Randomizer.HotColdItems = new Dictionary <int, RandomizerHotColdItem>(); Randomizer.HotColdMaps = new List <int>(); int HotColdSaveId = 2000; Randomizer.HoruScene = ""; Randomizer.HoruMap = new Hashtable(); Randomizer.HoruMap["mountHoruStomperSystemsR"] = 2640380; Randomizer.HoruMap["mountHoruProjectileCorridor"] = 1720288; Randomizer.HoruMap["mountHoruMovingPlatform"] = 3040304; Randomizer.HoruMap["mountHoruLaserTurretsR"] = 2160192; Randomizer.HoruMap["mountHoruBlockableLasers"] = -919624; Randomizer.HoruMap["mountHoruBigPushBlock"] = -199724; Randomizer.HoruMap["mountHoruBreakyPathTop"] = -1639664; Randomizer.HoruMap["mountHoruFallingBlocks"] = -959848; Randomizer.OpenMode = true; Randomizer.OpenWorld = false; RandomizerDataMaps.LoadGladesData(); RandomizerDataMaps.LoadGinsoData(); RandomizerDataMaps.LoadForlornData(); RandomizerDataMaps.LoadHoruData(); RandomizerDataMaps.LoadValleyData(); RandomizerColorManager.Initialize(); RandomizerPlantManager.Initialize(); RandomizerRebinding.ParseRebinding(); RandomizerSettings.ParseSettings(); Randomizer.RelicZoneLookup = new Dictionary <string, string>(); RandomizerTrackedDataManager.Initialize(); RandomizerStatsManager.Initialize(); Randomizer.RelicCount = 0; Randomizer.GrenadeZone = "MIA"; Randomizer.StompZone = "MIA"; Randomizer.RepeatablePickups = new HashSet <int>(); Randomizer.StompTriggers = false; Randomizer.SpawnWith = ""; Randomizer.IgnoreEnemyExp = false; bool relicCountOverride = false; try { if (File.Exists("randomizer.dat")) { string[] allLines = File.ReadAllLines("randomizer.dat"); string[] flagLine = allLines[0].Split(new char[] { '|' }); string s = flagLine[1]; string[] flags = flagLine[0].Split(new char[] { ',' }); Randomizer.SeedMeta = allLines[0]; foreach (string rawFlag in flags) { string flag = rawFlag.ToLower(); if (flag == "ohko") { Randomizer.OHKO = true; } if (flag.StartsWith("worldtour")) { Randomizer.WorldTour = true; if (flag.Contains("=")) { relicCountOverride = true; Randomizer.RelicCount = int.Parse(flag.Substring(10)); } } if (flag.StartsWith("sync")) { Randomizer.Sync = true; Randomizer.SyncId = flag.Substring(4); RandomizerSyncManager.Initialize(); } if (flag.StartsWith("frags/")) { Randomizer.fragsEnabled = true; string[] fragParams = flag.Split(new char[] { '/' }); Randomizer.maxFrags = int.Parse(fragParams[2]); Randomizer.fragKeyFinish = int.Parse(fragParams[1]); } if (flag.StartsWith("mode=")) { string modeStr = flag.Substring(5).ToLower(); int syncMode; if (modeStr == "shared") { syncMode = 1; } else if (modeStr == "none") { syncMode = 4; } else { syncMode = int.Parse(modeStr); } Randomizer.SyncMode = syncMode; } if (flag.StartsWith("shared=")) { Randomizer.ShareParams = flag.Substring(7); } if (flag == "noextraexp") { Randomizer.IgnoreEnemyExp = true; } if (flag == "0xp") { Randomizer.IgnoreEnemyExp = true; Randomizer.ZeroXP = true; } if (flag == "nobonus") { Randomizer.BonusActive = false; } if (flag == "nonprogressivemapstones") { Randomizer.ProgressiveMapStones = false; } if (flag == "forcetrees") { Randomizer.ForceTrees = true; } if (flag == "forcemaps") { Randomizer.ForceMaps = true; } if (flag == "clues") { Randomizer.CluesMode = true; RandomizerClues.initialize(); } if (flag == "shards") { Randomizer.Shards = true; } if (flag == "entrance") { Randomizer.Entrance = true; } if (flag == "closeddungeons") { Randomizer.OpenMode = false; } if (flag == "openworld") { Randomizer.OpenWorld = true; } if (flag.StartsWith("hotcold=")) { Randomizer.HotCold = true; Randomizer.HotColdTypes = flag.Substring(8).Split(new char[] { '+' }); Array.Sort(Randomizer.HotColdTypes); } if (flag.StartsWith("sense=")) { Randomizer.HotColdTypes = flag.Substring(6).Split(new char[] { '+' }); Array.Sort(Randomizer.HotColdTypes); } if (flag == "noaltr") { Randomizer.AltRDisabled = true; } if (flag == "stomptriggers") { Randomizer.StompTriggers = true; } } for (int i = 1; i < allLines.Length; i++) { string[] lineParts = allLines[i].Split(new char[] { '|' }); int coords; int.TryParse(lineParts[0], out coords); if (coords == 2) { SpawnWith = lineParts[1] + lineParts[2]; continue; } int index = Array.BinarySearch <string>(Randomizer.HotColdTypes, lineParts[1]); if (index < 0) { index = -index - 1; } while (index < Randomizer.HotColdTypes.Length && Randomizer.HotColdTypes[index].Substring(0, 2) == lineParts[1]) { if (Randomizer.HotColdTypes[index] == lineParts[1] || Randomizer.HotColdTypes[index].Substring(2) == lineParts[2]) { if (Math.Abs(coords) > 100) { Randomizer.HotColdItems.Add(coords, new RandomizerHotColdItem(Randomizer.HashKeyToVector(coords), HotColdSaveId)); HotColdSaveId++; } else { Randomizer.HotColdMaps.Add(coords); } } index++; } if (Randomizer.StringKeyPickupTypes.Contains(lineParts[1])) { Randomizer.Table[coords] = new RandomizerAction(lineParts[1], lineParts[2]); if (lineParts[1] == "WT") { Randomizer.RelicZoneLookup[lineParts[2]] = lineParts[3]; if (!relicCountOverride) { Randomizer.RelicCount++; } } if (lineParts[1] == "RP") { Randomizer.RepeatablePickups.Add(coords); } } else { int id; int.TryParse(lineParts[2], out id); if (lineParts[1] == "EN") { // door entries are coord|EN|targetX|targetY int doorY; int.TryParse(lineParts[3], out doorY); Randomizer.DoorTable[coords] = new Vector3((float)id, (float)doorY); } else { Randomizer.Table[coords] = new RandomizerAction(lineParts[1], id); if (lineParts[1] == "SK") { if (id == 51) { GrenadeZone = lineParts[3]; } else if (id == 4) { StompZone = lineParts[3]; } } if (Randomizer.CluesMode && lineParts[1] == "EV" && id % 2 == 0) { RandomizerClues.AddClue(lineParts[3], id / 2); } } } } Randomizer.HotColdMaps.Sort(); if (Randomizer.CluesMode) { RandomizerClues.FinishClues(); } } else { Randomizer.printInfo("Error: randomizer.dat not found"); } } catch (Exception e) { Randomizer.printInfo("Error parsing randomizer.dat:" + e.Message, 300); } RandomizerBonusSkill.Reset(); }
// Token: 0x06003848 RID: 14408 public static void Tick() { long tick = DateTime.Now.Ticks % 10000000L; if (tick < Randomizer.LastTick) { if (ResetVolume == 1) { ResetVolume = 0; GameSettings.Instance.SoundEffectsVolume = CachedVolume; } else if (ResetVolume > 1) { ResetVolume--; } if (RepeatableCooldown > 0) { RepeatableCooldown--; } if (RandomizerStatsManager.StatsTimer > 0) { RandomizerStatsManager.StatsTimer--; } RandomizerStatsManager.IncTime(); if (Scenes.Manager.CurrentScene != null) { string scene = Scenes.Manager.CurrentScene.Scene; if (scene == "titleScreenSwallowsNest") { ResetTrackerCount++; if (ResetTrackerCount > 10) { RandomizerTrackedDataManager.Reset(); ResetTrackerCount = 0; } if (RandomizerCreditsManager.CreditsDone) { RandomizerCreditsManager.CreditsDone = false; } } else if (scene == "creditsScreen") { if (!CreditsActive && !RandomizerCreditsManager.CreditsDone) { CreditsActive = true; RandomizerCreditsManager.Initialize(); } } else if (scene == "theSacrifice" && RandomizerStatsManager.Active) { foreach (SceneManagerScene sms in Scenes.Manager.ActiveScenes) { if (sms.MetaData.Scene == "creditsScreen" && sms.CurrentState == SceneManagerScene.State.Loading) { RandomizerStatsManager.Finish(); } } } } if (CreditsActive && !RandomizerCreditsManager.CreditsDone) { RandomizerCreditsManager.Tick(); } if (Characters.Sein) { if (JustSpawned && SpawnWith != "" && Characters.Sein.Inventory) { JustSpawned = false; RandomizerAction spawnItem; if (Randomizer.StringKeyPickupTypes.Contains(SpawnWith.Substring(0, 2))) { spawnItem = new RandomizerAction(SpawnWith.Substring(0, 2), SpawnWith.Substring(2)); } else { spawnItem = new RandomizerAction(SpawnWith.Substring(0, 2), int.Parse(SpawnWith.Substring(2))); } RandomizerSwitch.GivePickup(spawnItem, 2, true); } if (!Characters.Sein.IsSuspended && Scenes.Manager.CurrentScene != null) { ResetTrackerCount = 0; RandomizerTrackedDataManager.UpdateBitfields(); RandomizerColorManager.UpdateHotColdTarget(); if (Characters.Sein.Position.y > 937f && Sein.World.Events.WarmthReturned && Scenes.Manager.CurrentScene.Scene == "ginsoTreeWaterRisingEnd") { if (Characters.Sein.Abilities.Bash.IsBashing) { Characters.Sein.Abilities.Bash.BashGameComplete(0f); } Characters.Sein.Position = new Vector3(750f, -120f); return; } if (Scenes.Manager.CurrentScene.Scene == "catAndMouseResurrectionRoom" && !Randomizer.canFinalEscape()) { if (Randomizer.Entrance) { Randomizer.EnterDoor(new Vector3(-242f, 489f)); return; } Characters.Sein.Position = new Vector3(20f, 105f); return; } else if (!Characters.Sein.Controller.CanMove && Scenes.Manager.CurrentScene.Scene == "moonGrottoGumosHideoutB") { Randomizer.LockedCount++; if (Randomizer.LockedCount >= 4) { GameController.Instance.ResetInputLocks(); return; } } else { Randomizer.LockedCount = 0; } } } } Randomizer.LastTick = tick; }
public static void GivePickup(RandomizerAction Action, int coords, bool found_locally = true) { try { switch (Action.Action) { case "RP": case "MU": string[] pieces = ((string)Action.Value).Split('/'); for (int i = 0; i < pieces.Length; i += 2) { string code = pieces[i]; if (Randomizer.StringKeyPickupTypes.Contains(code)) { RandomizerSwitch.GivePickup(new RandomizerAction(code, pieces[i + 1]), coords, false); } else { int id; int.TryParse(pieces[i + 1], out id); RandomizerSwitch.GivePickup(new RandomizerAction(code, id), coords, false); } } SilentMode = false; break; case "AC": SkillPointPickup(); break; case "EC": MaxEnergyContainerPickup(); break; case "EX": ExpOrbPickup((int)Action.Value); break; case "KS": KeystonePickup(); break; case "HC": MaxHealthContainerPickup(); break; case "MS": MapStonePickup(); break; case "SK": if (Randomizer.CutscenePickupLocs.Contains(coords)) { Randomizer.FixCutscenePickup = (int)Action.Value; } AbilityPickup((int)Action.Value); break; case "EV": EventPickup((int)Action.Value); break; case "RB": RandomizerBonus.UpgradeID((int)Action.Value); break; case "TP": TeleportPickup((string)Action.Value); break; case "SH": string message = ((string)Action.Value).Replace("AltR", RandomizerRebinding.ReturnToStart.FirstBindName()); if (message.Length > 1 && message[1] == '=') { var parts = message.Split(',').ToList(); var flags = parts.FindAll(ele => ele.Length >= 2 && ele[1] == '='); message = String.Join(",", parts.FindAll(ele => ele.Length < 2 || ele[1] != '=').ToArray()); int duration = 120; foreach (var flag in flags) { var p = flag.Split('='); if (p.Length != 2) { continue; } if (p[0] == "d") { int.TryParse(p[1], out duration); } else if (p[0] == "s") { SilentMode = (p[1].Trim().ToLower() == "true"); } } Randomizer.showHint(message, duration); } else { Randomizer.showHint(message); } break; case "WT": RandomizerTrackedDataManager.SetRelic(Randomizer.RelicZoneLookup[(string)Action.Value]); int relics = Characters.Sein.Inventory.GetRandomizerItem(302); string relicStr = "\n(" + relics.ToString() + "/" + Randomizer.RelicCount.ToString() + ")"; if (relics >= Randomizer.RelicCount) { relicStr = "$" + relicStr + "$"; } PickupMessage((string)Action.Value + relicStr, 480); break; case "WS": case "WP": Randomizer.SaveAfterWarp = Action.Action == "WS"; string[] xy = ((string)Action.Value).Split(','); if (xy.Length > 2 && xy[2] == "force") { Randomizer.WarpTo(new UnityEngine.Vector3(float.Parse(xy[0]), float.Parse(xy[1])), 15); } else { Randomizer.WarpTarget = new UnityEngine.Vector3(float.Parse(xy[0]), float.Parse(xy[1])); Randomizer.WarpSource = Characters.Sein.Position; Randomizer.CanWarp = 7; } break; case "NO": break; } BingoController.OnItem(Action, coords); RandomizerTrackedDataManager.UpdateBitfields(); } catch (Exception e) { Randomizer.LogError("Give Pickup(" + Action.ToString() + ", " + coords.ToString() + "): " + e.Message); } if (found_locally && Randomizer.Sync) { RandomizerSyncManager.FoundPickup(Action, coords); } if (found_locally) { Randomizer.OnCoord(coords); } }
public static void GivePickup(RandomizerAction Action, int coords, bool found_locally = true) { try { if (found_locally && Randomizer.Sync) { RandomizerSyncManager.FoundPickup(Action, coords); } switch (Action.Action) { case "RP": case "MU": string[] pieces = ((string)Action.Value).Split('/'); for (int i = 0; i < pieces.Length; i += 2) { string code = pieces[i]; if (Randomizer.StringKeyPickupTypes.Contains(code)) { RandomizerSwitch.GivePickup(new RandomizerAction(code, pieces[i + 1]), coords, found_locally); } else { int id; int.TryParse(pieces[i + 1], out id); RandomizerSwitch.GivePickup(new RandomizerAction(code, id), coords, found_locally); } } break; case "AC": SkillPointPickup(); break; case "EC": MaxEnergyContainerPickup(); break; case "EX": ExpOrbPickup((int)Action.Value); break; case "KS": KeystonePickup(); break; case "HC": MaxHealthContainerPickup(); break; case "MS": MapStonePickup(); break; case "SK": AbilityPickup((int)Action.Value); break; case "EV": EventPickup((int)Action.Value); break; case "RB": RandomizerBonus.UpgradeID((int)Action.Value); break; case "TP": TeleportPickup((string)Action.Value); break; case "SH": Randomizer.showHint((string)Action.Value); break; case "WT": Characters.Sein.Inventory.IncRandomizerItem(302, 1); int relics = Characters.Sein.Inventory.GetRandomizerItem(302); RandomizerTrackedDataManager.SetRelic(Randomizer.RelicZoneLookup[(string)Action.Value]); string relicStr = "\n(" + relics.ToString() + "/" + Randomizer.RelicCount.ToString() + ")"; if (relics >= Randomizer.RelicCount) { relicStr = "$" + relicStr + "$"; } Randomizer.showHint((string)Action.Value + relicStr, 480); break; case "WS": case "WP": Randomizer.SaveAfterWarp = Action.Action == "WS"; string[] xy = ((string)Action.Value).Split(','); Randomizer.WarpTo(new UnityEngine.Vector3(float.Parse(xy[0]), float.Parse(xy[1])), 15); break; case "NO": break; } RandomizerTrackedDataManager.UpdateBitfields(); } catch (Exception e) { Randomizer.LogError("Give Pickup: " + e.Message); } }
// Token: 0x06003798 RID: 14232 public static void CheckPickups(object sender, UploadValuesCompletedEventArgs e) { try { if (e.Error != null) { if (e.Error is System.NullReferenceException) { return; } Randomizer.LogError("CheckPickups got error: " + e.Error.ToString()); } if (!e.Cancelled && e.Error == null) { if (!Characters.Sein) { return; } string[] array = System.Text.Encoding.UTF8.GetString(e.Result).Split(new char[] { ',' }); int bf = int.Parse(array[0]); foreach (SkillInfoLine skillInfoLine in SkillInfos) { if (getBit(bf, skillInfoLine.bit) && !Characters.Sein.PlayerAbilities.HasAbility(skillInfoLine.skill)) { RandomizerSwitch.GivePickup(new RandomizerAction("SK", skillInfoLine.id), 0, false); } } int bf2 = int.Parse(array[1]); foreach (EventInfoLine eventInfoLine in EventInfos) { if (getBit(bf2, eventInfoLine.bit) && !eventInfoLine.checker()) { RandomizerSwitch.GivePickup(new RandomizerAction("EV", eventInfoLine.id), 0, false); } } int bf4 = int.Parse(array[2]); foreach (TeleportInfoLine teleportInfoLine in TeleportInfos) { if (getBit(bf4, teleportInfoLine.bit) && !isTeleporterActivated(teleportInfoLine.id)) { RandomizerSwitch.GivePickup(new RandomizerAction("TP", teleportInfoLine.id), 0, false); } } if (array[3] != "") { string[] upgrades = array[3].Split(';'); foreach (string rawUpgrade in upgrades) { string[] splitpair = rawUpgrade.Split('x'); int id = int.Parse(splitpair[0]); int cnt = int.Parse(splitpair[1]); if (id >= 100) { if (id >= 900) { if (id < 910) { int tree = id - 899; string treeName = RandomizerTrackedDataManager.Trees[tree]; if (RandomizerTrackedDataManager.SetTree(tree)) { Randomizer.showHint(treeName + " tree (activated by teammate)"); } } else if (id < 922) { string relicZone = RandomizerTrackedDataManager.Zones[id - 911]; if (RandomizerTrackedDataManager.SetRelic(relicZone)) { Randomizer.showHint("#" + relicZone + " relic# (found by teammate)", 300); } } } else if (!RandomizerBonusSkill.UnlockedBonusSkills.ContainsValue(id) && cnt > 0) { RandomizerBonus.UpgradeID(id); } } else if (RandomizerBonus.UpgradeCount(id) < cnt) { RandomizerBonus.UpgradeID(id); } else if (!PickupQueue.Where((Pickup p) => p.type == "RB" && p.id == splitpair[0]).Any() && RandomizerBonus.UpgradeCount(id) > cnt) { RandomizerBonus.UpgradeID(-id); } } } if (array.Length > 5) { foreach (string text in array[5].Split(new char[] { '|' })) { if (CurrentSignals.Contains(text)) { continue; } if (text == "stop") { RandomizerChaosManager.ClearEffects(); } else if (text.StartsWith("msg:")) { Randomizer.printInfo(text.Substring(4), 360); } else if (text.StartsWith("win:")) { if (!RandomizerBonusSkill.UnlockCreditWarp(text.Substring(4))) { Randomizer.Print(text.Substring(4), 10, false, true, false, false); RandomizerStatsManager.WriteStatsFile(); } } else if (text.StartsWith("pickup:")) { string[] parts = text.Substring(7).Split(new char[] { '|' }); RandomizerAction action; if (Randomizer.StringKeyPickupTypes.Contains(parts[0])) { action = new RandomizerAction(parts[0], parts[1]); } else { int pickup_id; int.TryParse(parts[1], out pickup_id); action = new RandomizerAction(parts[0], pickup_id); } RandomizerSwitch.GivePickup(action, 0, false); } else if (text == "spawnChaos") { Randomizer.ChaosVerbose = true; RandomizerChaosManager.SpawnEffect(); ChaosTimeoutCounter = 3600; } var client = new WebClient(); client.DownloadStringAsync(new Uri(RootUrl + "/callback/" + text)); CurrentSignals.Add(text); } } else { CurrentSignals.Clear(); } return; } if (e.Error.GetType().Name == "WebException" && ((HttpWebResponse)((WebException)e.Error).Response).StatusCode == HttpStatusCode.PreconditionFailed) { if (Randomizer.SyncMode == 1) { Randomizer.printInfo("Co-op server error, try reloading the seed (Alt+L)"); } else { Randomizer.LogError("Co-op server error, try reloading the seed (Alt+L)"); } return; } } catch (Exception e2) { Randomizer.LogError("CheckPickups threw error: " + e2.Message); } }