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;
     }
 }
Exemple #2
0
 // Token: 0x06003746 RID: 14150 RVA: 0x000E0F2C File Offset: 0x000DF12C
 public static void Update()
 {
     Randomizer.UpdateMessages();
     if (Characters.Sein && !Characters.Sein.IsSuspended)
     {
         Characters.Sein.Mortality.Health.GainHealth((float)RandomizerBonus.HealthRegeneration() * (Characters.Sein.PlayerAbilities.HealthEfficiency.HasAbility ? 0.0016f : 0.0008f));
         Characters.Sein.Energy.Gain((float)RandomizerBonus.EnergyRegeneration() * (Characters.Sein.PlayerAbilities.EnergyEfficiency.HasAbility ? 0.0003f : 0.0002f));
         if (Randomizer.ForceTrees && Scenes.Manager.CurrentScene != null && Scenes.Manager.CurrentScene.Scene == "catAndMouseResurrectionRoom" && RandomizerBonus.SkillTreeProgression() < 10)
         {
             Randomizer.MessageQueue.Enqueue("Trees (" + RandomizerBonus.SkillTreeProgression().ToString() + "/10)");
             if (Randomizer.Entrance)
             {
                 Randomizer.EnterDoor(new Vector3(-242f, 489f));
             }
             else
             {
                 Characters.Sein.Position = new Vector3(20f, 105f);
             }
         }
         if (Randomizer.Chaos)
         {
             RandomizerChaosManager.Update();
         }
         if (Randomizer.Sync)
         {
             RandomizerSyncManager.Update();
         }
         if (Randomizer.Returning)
         {
             Characters.Sein.Position = new Vector3(189f, -215f);
             Characters.Ori.Position  = new Vector3(190f, -210f);
             Randomizer.Returning     = false;
         }
     }
     if (RandomizerRebinding.ReplayMessage.IsPressed())
     {
         Randomizer.playLastMessage();
         return;
     }
     if (RandomizerRebinding.ReturnToStart.IsPressed() && Characters.Sein)
     {
         Randomizer.returnToStart();
         return;
     }
     if (RandomizerRebinding.ReloadSeed.IsPressed())
     {
         Randomizer.initialize();
         Randomizer.showSeedInfo();
         return;
     }
     if (RandomizerRebinding.ShowProgress.IsPressed() && Characters.Sein)
     {
         Randomizer.showProgress();
         return;
     }
     if (RandomizerRebinding.ColorShift.IsPressed())
     {
         string obj = "Color shift enabled";
         if (Randomizer.ColorShift)
         {
             obj = "Color shift disabled";
         }
         Randomizer.ColorShift = !Randomizer.ColorShift;
         Randomizer.MessageQueue.Enqueue(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;
     }
 }