Decompiled source of SimulacrumAdditions v2.3.3
SimulacrumAdditions.dll
Decompiled a day ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.CodeDom.Compiler; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using AK.Wwise; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using EntityStates; using EntityStates.Drone; using EntityStates.GrandParent; using EntityStates.InfiniteTowerSafeWard; using EntityStates.Missions.Moon; using EntityStates.QuestVolatileBattery; using EntityStates.VagrantMonster; using EntityStates.VagrantNovaItem; using EntityStates.VoidMegaCrab; using EntityStates.VoidMegaCrab.Weapon; using IL.RoR2; using JetBrains.Annotations; using Mono.Cecil.Cil; using MonoMod.Cil; using On.EntityStates; using On.EntityStates.Drone; using On.EntityStates.GrandParent; using On.EntityStates.InfiniteTowerSafeWard; using On.EntityStates.Missions.Moon; using On.EntityStates.QuestVolatileBattery; using On.EntityStates.VagrantMonster; using On.EntityStates.VagrantNovaItem; using On.EntityStates.VoidMegaCrab; using On.EntityStates.VoidMegaCrab.Weapon; using On.RoR2; using On.RoR2.Artifacts; using On.RoR2.Projectile; using On.RoR2.UI; using On.RoR2.UI.LogBook; using On.RoR2.UI.MainMenu; using R2API; using R2API.Utils; using RiskOfOptions; using RiskOfOptions.Options; using RoR2; using RoR2.Artifacts; using RoR2.CharacterAI; using RoR2.ExpansionManagement; using RoR2.Navigation; using RoR2.Projectile; using RoR2.Skills; using RoR2.Stats; using RoR2.UI; using RoR2.UI.LogBook; using RoR2.UI.MainMenu; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SimulacrumAdditions")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+343425940de1fc53dc8687736df18b4b5f623990")] [assembly: AssemblyProduct("SimulacrumAdditions")] [assembly: AssemblyTitle("SimulacrumAdditions")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: UnverifiableCode] namespace SimulacrumAdditions { public class AutoConfig { public static ConfigFile ConfigFileAuto = new ConfigFile(Paths.ConfigPath + "\\Wolfo.Simulacrum_Additions___Autogenerated_Wave_Config.cfg", true); public static ConfigEntry<int> cfgSuperBossEveryXWaves; public static void InitConfig() { InfiniteTowerWaveCategory iTBasicWaves = SimuMain.ITBasicWaves; string text = "Basic Waves"; for (int i = 1; i < iTBasicWaves.wavePrefabs.Length; i++) { ConfigEntry<bool> val = ConfigFileAuto.Bind<bool>(text, ((Object)iTBasicWaves.wavePrefabs[i].wavePrefab).name, true, "Enable this wave? :\n" + Language.GetString(((Component)iTBasicWaves.wavePrefabs[i].wavePrefab.GetComponent<InfiniteTowerWaveController>().overlayEntries[1].prefab.transform.GetChild(0).GetChild(1).GetChild(0)).GetComponent<InfiniteTowerWaveCounter>().token) + "\n" + Language.GetString(((Component)iTBasicWaves.wavePrefabs[i].wavePrefab.GetComponent<InfiniteTowerWaveController>().overlayEntries[1].prefab.transform.GetChild(0).GetChild(1).GetChild(1)).GetComponent<LanguageTextMeshController>().token)); } iTBasicWaves = SimuMain.ITBossWaves; text = "Boss Waves"; for (int j = 1; j < iTBasicWaves.wavePrefabs.Length; j++) { ConfigEntry<bool> val2 = ConfigFileAuto.Bind<bool>(text, ((Object)iTBasicWaves.wavePrefabs[j].wavePrefab).name, true, "Enable this wave? :\n" + Language.GetString(((Component)iTBasicWaves.wavePrefabs[j].wavePrefab.GetComponent<InfiniteTowerWaveController>().overlayEntries[1].prefab.transform.GetChild(0).GetChild(1).GetChild(0)).GetComponent<InfiniteTowerWaveCounter>().token) + "\n" + Language.GetString(((Component)iTBasicWaves.wavePrefabs[j].wavePrefab.GetComponent<InfiniteTowerWaveController>().overlayEntries[1].prefab.transform.GetChild(0).GetChild(1).GetChild(1)).GetComponent<LanguageTextMeshController>().token)); } iTBasicWaves = SimuMain.ITSuperBossWaves; text = "Super Boss Waves"; for (int k = 0; k < iTBasicWaves.wavePrefabs.Length; k++) { ConfigEntry<bool> val3 = ConfigFileAuto.Bind<bool>(text, ((Object)iTBasicWaves.wavePrefabs[k].wavePrefab).name, true, "Enable this wave? :\n" + Language.GetString(((Component)iTBasicWaves.wavePrefabs[k].wavePrefab.GetComponent<InfiniteTowerWaveController>().overlayEntries[1].prefab.transform.GetChild(0).GetChild(1).GetChild(0)).GetComponent<InfiniteTowerWaveCounter>().token) + "\n" + Language.GetString(((Component)iTBasicWaves.wavePrefabs[k].wavePrefab.GetComponent<InfiniteTowerWaveController>().overlayEntries[1].prefab.transform.GetChild(0).GetChild(1).GetChild(1)).GetComponent<LanguageTextMeshController>().token)); } } public static void ApplyConfig() { InfiniteTowerWaveCategory iTBasicWaves = SimuMain.ITBasicWaves; string text = "Basic Waves"; for (int i = 1; i < iTBasicWaves.wavePrefabs.Length; i++) { ConfigEntry<bool> val = null; ConfigFileAuto.TryGetEntry<bool>(text, ((Object)iTBasicWaves.wavePrefabs[i].wavePrefab).name, ref val); if (val != null && !val.Value) { iTBasicWaves.wavePrefabs[i].weight = 0f; } } iTBasicWaves = SimuMain.ITBossWaves; text = "Boss Waves"; for (int j = 1; j < iTBasicWaves.wavePrefabs.Length; j++) { ConfigEntry<bool> val2 = null; ConfigFileAuto.TryGetEntry<bool>(text, ((Object)iTBasicWaves.wavePrefabs[j].wavePrefab).name, ref val2); if (val2 != null && !val2.Value) { iTBasicWaves.wavePrefabs[j].weight = 0f; } } iTBasicWaves = SimuMain.ITSuperBossWaves; text = "Super Boss Waves"; for (int k = 0; k < iTBasicWaves.wavePrefabs.Length; k++) { ConfigEntry<bool> val3 = null; ConfigFileAuto.TryGetEntry<bool>(text, ((Object)iTBasicWaves.wavePrefabs[k].wavePrefab).name, ref val3); if (val3 != null && !val3.Value) { iTBasicWaves.wavePrefabs[k].weight = 0f; } } } } public class WConfig { public static ConfigFile ConfigFileUNSORTED = new ConfigFile(Paths.ConfigPath + "\\Wolfo.Simulacrum_Additions.cfg", true); public static ConfigEntry<bool> cfgFasterWavesLater; public static ConfigEntry<bool> cfgCrabSpeedOnLaterWaves; public static ConfigEntry<bool> cfgVoidTripleAllTier; public static ConfigEntry<bool> cfgVoidTripleContentsInPing; public static ConfigEntry<bool> cfgSimuCreditsRebalance; public static ConfigEntry<bool> cfgSimuMoreGold; public static ConfigEntry<bool> cfgDifferentTeleportEffect; public static ConfigEntry<bool> cfgVoidsEverywhere; public static ConfigEntry<bool> cfgExtraDifficuly; public static ConfigEntry<bool> cfgNewEnemiesVisible; public static ConfigEntry<bool> cfgDumpInfo; public static ConfigEntry<bool> cfgVoidCoins; public static ConfigEntry<bool> cfgEnableArtifactAugments; public static ConfigEntry<bool> cfgEnableArtifactStages; public static ConfigEntry<bool> cfgMusicSuperBoss; public static ConfigEntry<bool> cfgSacrificeBalance; public static ConfigEntry<bool> cfgItemsEvery8; public static ConfigEntry<bool> cfgItemsFrequently; public static ConfigEntry<bool> cfgMakeSpecialWavesMoreCommon; public static ConfigEntry<bool> cfgAwaitTravel; public static ConfigEntry<bool> cfgWaveOnEndScreen; public static ConfigEntry<float> ArtifactOfRealityBonusRadius; public static ConfigEntry<float> cfgCrabRadius; public static ConfigEntry<float> cfgCrabRadiusPerPlayer; public static ConfigEntry<bool> cfgWarbannerOnBoss; public static ConfigEntry<int> cfgSimuEndingStartAtXWaves; public static ConfigEntry<int> cfgSimuEndingEveryXWaves; public static ConfigEntry<int> cfgSuperBossStartAtXWaves; public static ConfigEntry<int> cfgSuperBossEveryXWaves; public static ConfigEntry<bool> ResetStatsButton; public static void RiskConfig() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Expected O, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown ModSettingsManager.SetModDescription("Simulacrum Gaming"); Sprite modIcon = Sprite.Create(Assets.Bundle.LoadAsset<Texture2D>("Assets/Simulacrum/Wave/waveGupYellow.png"), WRect.rec64, WRect.half); ModSettingsManager.SetModIcon(modIcon); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ResetStatsButton)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(cfgNewEnemiesVisible, true)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(cfgVoidCoins)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(cfgVoidTripleAllTier, true)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(cfgSacrificeBalance)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(cfgFasterWavesLater)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(cfgExtraDifficuly)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(cfgSimuMoreGold, false)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(cfgSimuCreditsRebalance, true)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(cfgItemsEvery8, true)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(cfgItemsFrequently, true)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(cfgCrabSpeedOnLaterWaves)); } public static void InitConfig() { ResetStatsButton = ConfigFileUNSORTED.Bind<bool>("Main", "Reset Wave Count Button", false, "Add a button on the Simulacrum select screen to reset a specific characters wave count."); cfgMusicSuperBoss = ConfigFileUNSORTED.Bind<bool>("Main", "Music for Super Boss waves", true, "Like Mithrix theme for Mithrix wave."); cfgVoidCoins = ConfigFileUNSORTED.Bind<bool>("Main", "Add Void Coins", true, "Add previously unused Void Coins with which you can purchase Void Interactables. You can still purchase them with Blood if you do not have any."); cfgVoidTripleAllTier = ConfigFileUNSORTED.Bind<bool>("Main", "Void Potential Chests can drop more tiers", true, "With this they can give items from any tier, normally they use a normal chest pool."); cfgVoidTripleContentsInPing = ConfigFileUNSORTED.Bind<bool>("Main", "Void Potential contents in ping message", true, "When pinging a Void Potential the items inside will be in the ping message. Requested for more easily sharing items inside Void Potentials."); cfgNewEnemiesVisible = ConfigFileUNSORTED.Bind<bool>("Main", "Logbook Entries for Simu only bosses", false, "Add reskins of enemies added by mod to Logbook."); cfgDifferentTeleportEffect = ConfigFileUNSORTED.Bind<bool>("Main", "Simulacrum Teleport Effect", true, "Void themed teleport effect for Simulacrum runs"); cfgWaveOnEndScreen = ConfigFileUNSORTED.Bind<bool>("Main", "Wave name on end screen", true, "More info"); cfgCrabSpeedOnLaterWaves = ConfigFileUNSORTED.Bind<bool>("Main : Crab", "Speed up as waves go on", true, "The crab will travel faster the more waves are completed, mostly noticible later waves."); cfgAwaitTravel = ConfigFileUNSORTED.Bind<bool>("Main : Crab", "Crab waits before travelling", true, "Like after wave 5, more time to do stuff before leaving or just to leave instantly."); cfgCrabRadius = ConfigFileUNSORTED.Bind<float>("Main : Crab", "Crab Radius : Base Radius", 65f, "Vanilla radius is 60."); cfgCrabRadiusPerPlayer = ConfigFileUNSORTED.Bind<float>("Main : Crab", "Crab Radius : Per Player", 5f, "Radius increase per player including player 1. Vanilla radius is 0."); cfgVoidsEverywhere = ConfigFileUNSORTED.Bind<bool>("Main", "Void Enemies on all stages", true, "After wave 60 void enemies will spawn on all simu stages."); cfgEnableArtifactAugments = ConfigFileUNSORTED.Bind<bool>("Main : Artifacts", "Enable Artifact of Augments", true, "An Artifact that allows only special augments."); cfgEnableArtifactStages = ConfigFileUNSORTED.Bind<bool>("Main : Artifacts", "Enable Artifact of Reality", true, "An Artifact that makes the game mode use normal stages instead of simu variants"); ArtifactOfRealityBonusRadius = ConfigFileUNSORTED.Bind<float>("Main : Artifacts", "Artifact of Reality : Larger Radius", 10f, "Bonus radius since default stages are often bigger and have weird cornerns"); cfgItemsEvery8 = ConfigFileUNSORTED.Bind<bool>("Simulacrum : Balance", "Items every 8 Waves", true, "Give items every 8 waves. Fits better with the run ending at wave 50."); cfgItemsFrequently = ConfigFileUNSORTED.Bind<bool>("Simulacrum : Balance", "Items are given more frequently later", true, "Items will be added twice as frequently after the first Red"); cfgSimuCreditsRebalance = ConfigFileUNSORTED.Bind<bool>("Simulacrum : Balance", "Simulacrum Credits Rebalance", true, "Get more credits early on, Stages have 630 to 400 credits depending on stages completed and get more credits in multiplayer. Vanilla they always have 600 regardless of stage/player count."); cfgSimuMoreGold = ConfigFileUNSORTED.Bind<bool>("Simulacrum : Balance", "Simulacrum Gold Balance", true, "Gold is multiplied per player amount. Gain 50% more gold at the start and 25% less gold starting at wave 30. Helps with early looting and makes it so you won't instantly be able to afford every chest later on."); cfgExtraDifficuly = ConfigFileUNSORTED.Bind<bool>("Simulacrum : Balance", "More scaling", true, "Scales immediate wave spawns up and elite cost down to overall increase difficulty but also make waves shorter"); cfgSacrificeBalance = ConfigFileUNSORTED.Bind<bool>("Simulacrum : Balance", "Nerf Sacrifice in Simulacrum", true, "30% less item drops from enemies and 1 less option in potentials"); cfgFasterWavesLater = ConfigFileUNSORTED.Bind<bool>("Simulacrum : Balance", "Waves get faster later", true, "Less time between waves and waves spawn enemies faster."); cfgSimuEndingStartAtXWaves = ConfigFileUNSORTED.Bind<int>("Simulacrum : Ending Portal", "Ending Start Wave", 50, "This is the first wave the ending Portal appears (only use steps of 10)"); cfgSimuEndingEveryXWaves = ConfigFileUNSORTED.Bind<int>("Simulacrum : Ending Portal", "Ending Portal Every X Waves", 10, "The ending portal will appear every X waves. (only use steps of 10)"); cfgSuperBossStartAtXWaves = ConfigFileUNSORTED.Bind<int>("Simulacrum : Forced Super Boss", "Forced Special Boss Start Wave", 50, "A forced special boss is meant to be paired with the wave where the ending portal spawns so it's less of just a random end. (only use steps of 10)"); cfgSuperBossEveryXWaves = ConfigFileUNSORTED.Bind<int>("Simulacrum : Forced Super Boss", "Forced Special Boss Every X Waves", 30, "The forced special boss will appear every X waves. (only use steps of 10)"); cfgDumpInfo = ConfigFileUNSORTED.Bind<bool>("Testing", "Wave Info Dump", false, "Dump wave info on startup in log"); RiskConfig(); } } public class Const { public static GameObject BasicWave = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/GameModes/InfiniteTowerRun/InfiniteTowerAssets/InfiniteTowerWaveDefault.prefab").WaitForCompletion(); public static GameObject BasicWaveUI = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/GameModes/InfiniteTowerRun/InfiniteTowerAssets/InfiniteTowerCurrentWaveUI.prefab").WaitForCompletion(); public static GameObject BossWave = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/GameModes/InfiniteTowerRun/InfiniteTowerAssets/InfiniteTowerWaveBoss.prefab").WaitForCompletion(); public static GameObject BossWaveUI = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/GameModes/InfiniteTowerRun/InfiniteTowerAssets/InfiniteTowerCurrentBossWaveUI.prefab").WaitForCompletion(); public static GameObject ScavWave = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/GameModes/InfiniteTowerRun/InfiniteTowerAssets/InfiniteTowerWaveBossScav.prefab").WaitForCompletion(); public static GameObject ArtifactWave = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/GameModes/InfiniteTowerRun/InfiniteTowerAssets/InfiniteTowerWaveArtifactBomb.prefab").WaitForCompletion(); public static GameObject ArtifactWaveUI = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/GameModes/InfiniteTowerRun/InfiniteTowerAssets/InfiniteTowerCurrentArtifactBombWaveUI.prefab").WaitForCompletion(); public static GameObject LunarWaveUI = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/GameModes/InfiniteTowerRun/InfiniteTowerAssets/InfiniteTowerCurrentBossLunarWaveUI.prefab").WaitForCompletion(); public static GameObject VoidWaveUI = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/GameModes/InfiniteTowerRun/InfiniteTowerAssets/InfiniteTowerCurrentBossVoidWaveUI.prefab").WaitForCompletion(); public static void MakeValues() { } } internal static class Assets { public static AssetBundle Bundle; public static PluginInfo PluginInfo; public static string Folder = "SimulacrumMod"; internal static string assemblyDir => Path.GetDirectoryName(PluginInfo.Location); internal static void Init(PluginInfo info) { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown PluginInfo = info; if (!Directory.Exists(GetPathToFile(Folder))) { Debug.LogWarning((object)(Folder + " | Folder does not exist")); Folder = "plugins\\" + Folder; if (!Directory.Exists(GetPathToFile(Folder))) { Debug.LogWarning((object)(Folder + " | Folder does not exist")); } } if (Directory.Exists(GetPathToFile(Folder + "\\Languages"))) { Language.SetFolders += new hook_SetFolders(SetFolders); } else { Debug.LogWarning((object)(Folder + "\\Languages | Folder does not exist")); } if (Directory.Exists(GetPathToFile(Folder + "\\AssetBundles"))) { Bundle = AssetBundle.LoadFromFile(GetPathToFile(Folder + "\\AssetBundles", "simulacrumadditions")); } else { Debug.LogWarning((object)(Folder + "\\AssetBundles | Folder does not exist")); } } private static void SetFolders(orig_SetFolders orig, Language self, IEnumerable<string> newFolders) { IEnumerable<string> second = Directory.EnumerateDirectories(Path.Combine(GetPathToFile(Folder + "\\Languages")), self.name); orig.Invoke(self, newFolders.Union(second)); } internal static string GetPathToFile(string folderName) { return Path.Combine(assemblyDir, folderName); } internal static string GetPathToFile(string folderName, string fileName) { return Path.Combine(assemblyDir, folderName, fileName); } } public static class ArrayUtil { public static T[] Add<T>(this T[] array, params T[] items) { return (array ?? Enumerable.Empty<T>()).Concat(items).ToArray(); } public static T[] Remove<T>(this T[] array, params T[] items) { return (array ?? Enumerable.Empty<T>()).Except(items).ToArray(); } } public class WRect { public static readonly Random random = new Random(); public static Rect recnothing = new Rect(0f, 0f, 0f, 0f); public static Rect recwide = new Rect(0f, 0f, 384f, 256f); public static Rect rechalftall = new Rect(0f, 0f, 256f, 320f); public static Rect rechalfwide = new Rect(0f, 0f, 320f, 256f); public static Rect rectall = new Rect(0f, 0f, 256f, 384f); public static Rect rec512 = new Rect(0f, 0f, 512f, 512f); public static Rect rec320 = new Rect(0f, 0f, 320f, 320f); public static Rect rec256 = new Rect(0f, 0f, 256f, 256f); public static Rect rec192 = new Rect(0f, 0f, 192f, 192f); public static Rect rec128 = new Rect(0f, 0f, 128f, 128f); public static Rect rec106 = new Rect(0f, 0f, 106f, 106f); public static Rect rec64 = new Rect(0f, 0f, 64f, 64f); public static Vector2 half = new Vector2(0.5f, 0.5f); } public class ArtifactTweaks { public static SpawnCard iscLemEggIT; public static void Main() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown FogDamageController.MyFixedUpdate += new Manipulator(NoFogLemurianDamage); DevotionInventoryController.Awake += new hook_Awake(DevotionInventoryController_Awake); InfiniteTowerWaveController.OnAllEnemiesDefeatedServer += new hook_OnAllEnemiesDefeatedServer(ActivateNewArtifacts_OnAllEnemiesDefeatedServer); SpawnCard val = (SpawnCard)(object)Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/CU8/LemurianEgg/iscLemurianEgg.asset").WaitForCompletion(); iscLemEggIT = Object.Instantiate<SpawnCard>(val); ((Object)iscLemEggIT).name = "iscLemurianEggIT"; iscLemEggIT.directorCreditCost = 1; SceneDirector.onGenerateInteractableCardSelection += SimulacrumDevotionAddEgg; InfiniteTowerWaveController.PlayBeginSound += new hook_PlayBeginSound(LessOptionsDuringSacrifice); SacrificeArtifactManager.OnArtifactEnabled += new hook_OnArtifactEnabled(SacrificeArtifactManager_OnArtifactEnabled); SacrificeArtifactManager.OnArtifactDisabled += new hook_OnArtifactDisabled(SacrificeArtifactManager_OnArtifactDisabled); } private static void LessOptionsDuringSacrifice(orig_PlayBeginSound orig, InfiniteTowerWaveController self) { orig.Invoke(self); if (!WConfig.cfgSacrificeBalance.Value) { return; } bool flag = RunArtifactManager.instance.IsArtifactEnabled(Artifacts.sacrificeArtifactDef); SimulacrumExtrasHelper component = ((Component)self).GetComponent<SimulacrumExtrasHelper>(); if (flag && self.rewardOptionCount > 1) { self.rewardOptionCount--; if (Object.op_Implicit((Object)(object)component) && component.rewardOptionCount > 1) { component.rewardOptionCount--; } } } private static void DevotionInventoryController_Awake(orig_Awake orig, DevotionInventoryController self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)Run.instance) && Object.op_Implicit((Object)(object)((Component)Run.instance).GetComponent<InfiniteTowerRun>())) { self._devotionMinionInventory.GiveItem(Items.BoostHp, 5); } } private static void NoFogLemurianDamage(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.5f), (Instruction x) => ILPatternMatchingExt.MatchMul(x) })) { val.Next.Operand = 0f; Debug.Log((object)"IL Found : IL.RoR2.FogDamageController.FixedUpdate"); } else { Debug.LogWarning((object)"IL Failed : IL.RoR2.FogDamageController.FixedUpdate"); } } private static void ActivateNewArtifacts_OnAllEnemiesDefeatedServer(orig_OnAllEnemiesDefeatedServer orig, InfiniteTowerWaveController self) { orig.Invoke(self); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)RunArtifactManager.instance) || !self.isBossWave) { return; } foreach (DevotionInventoryController instance in DevotionInventoryController.InstanceList) { instance.UpdateAllMinions(true); } } private static void SimulacrumDevotionAddEgg(SceneDirector scene, DirectorCardCategorySelection dccs) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)Run.instance) && Object.op_Implicit((Object)(object)((Component)Run.instance).GetComponent<InfiniteTowerRun>()) && RunArtifactManager.instance.IsArtifactEnabled(Artifacts.Devotion)) { DirectorCard val = new DirectorCard { spawnCard = iscLemEggIT, selectionWeight = 10, preventOverhead = false, minimumStageCompletions = 0, spawnDistance = (MonsterSpawnDistance)0 }; int num = dccs.AddCategory("Egg", 40f); dccs.AddCard(num, val); } } private static void SacrificeArtifactManager_OnArtifactEnabled(orig_OnArtifactEnabled orig, RunArtifactManager runArtifactManager, ArtifactDef artifactDef) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown orig.Invoke(runArtifactManager, artifactDef); if (NetworkServer.active && !((Object)(object)artifactDef != (Object)(object)Artifacts.sacrificeArtifactDef) && WConfig.cfgSacrificeBalance.Value && Object.op_Implicit((Object)(object)Run.instance) && Object.op_Implicit((Object)(object)((Component)Run.instance).GetComponent<InfiniteTowerRun>())) { Debug.Log((object)"Simulacrum : Added Sacrifice"); Util.GetExpAdjustedDropChancePercent += new hook_GetExpAdjustedDropChancePercent(SimulacrumNerfSacrifice); } } private static float SimulacrumNerfSacrifice(orig_GetExpAdjustedDropChancePercent orig, float baseChancePercent, GameObject characterBodyObject) { return orig.Invoke(baseChancePercent, characterBodyObject) * 0.7f; } private static void SacrificeArtifactManager_OnArtifactDisabled(orig_OnArtifactDisabled orig, RunArtifactManager runArtifactManager, ArtifactDef artifactDef) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown orig.Invoke(runArtifactManager, artifactDef); if (NetworkServer.active && !((Object)(object)artifactDef != (Object)(object)Artifacts.sacrificeArtifactDef) && WConfig.cfgSacrificeBalance.Value && Object.op_Implicit((Object)(object)Run.instance) && Object.op_Implicit((Object)(object)((Component)Run.instance).GetComponent<InfiniteTowerRun>())) { Debug.Log((object)"Simulacrum : Removed Sacrifice"); Util.GetExpAdjustedDropChancePercent -= new hook_GetExpAdjustedDropChancePercent(SimulacrumNerfSacrifice); } } } public class CrabActivateToTravel { public class CrabTravelOnCommand : MonoBehaviour { public void Activate() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown Run instance = Run.instance; Xoroshiro128Plus safeWardRng = ((InfiniteTowerRun)((instance is InfiniteTowerRun) ? instance : null)).safeWardRng; EntityStateMachine component = ((Component)this).GetComponent<EntityStateMachine>(); component.SetNextState((EntityState)new Travelling(safeWardRng)); PurchaseInteraction component2 = ((Component)this).gameObject.GetComponent<PurchaseInteraction>(); component2.SetAvailable(false); component2.contextToken = "INFINITE_TOWER_SAFE_WARD_CONTEXT"; Object.Destroy((Object)(object)this); } } public static void Make() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown Travelling.OnEnter += new hook_OnEnter(Travelling_OnEnter); if (WConfig.cfgAwaitTravel.Value) { Unburrow.OnEnter += new hook_OnEnter(Unburrow_OnEnter); Unburrow.FixedUpdate += new hook_FixedUpdate(Unburrow_FixedUpdate); } } private static void Travelling_OnEnter(orig_OnEnter orig, Travelling self) { self.animationStateName = "Swim"; self.animationLayerName = "Base"; orig.Invoke(self); } private static void Unburrow_OnEnter(orig_OnEnter orig, Unburrow self) { //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Expected O, but got Unknown //IL_0131: Expected O, but got Unknown ((BaseSafeWardState)self).zone = ((EntityState)self).GetComponent<VerticalTubeZone>(); float num = VoidSafeWard_Hooks.baseRadius + (float)Run.instance.participatingPlayerCount * VoidSafeWard_Hooks.radiusPerPlayer; if (Object.op_Implicit((Object)(object)((BaseSafeWardState)self).zone) && ((BaseSafeWardState)self).zone.radius > num) { VoidSafeWard_Hooks.RadiusShrinker radiusShrinker = ((EntityState)self).gameObject.AddComponent<VoidSafeWard_Hooks.RadiusShrinker>(); radiusShrinker.originalRadius = ((BaseSafeWardState)self).zone.radius; radiusShrinker.newRadius = num; self.radius = ((BaseSafeWardState)self).zone.radius; } else { self.radius = num; } ((BaseSafeWardState)self).objectiveToken = "INFINITETOWER_OBJECTIVE_AWAITING_TRAVEL"; orig.Invoke(self); self.duration = 0f; Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "INFINITETOWER_TRAVEL_NOTICE" }); Animator modelAnimator = ((EntityState)self).GetModelAnimator(); modelAnimator.Play("BurrowedToIdle", 0, -0.2f); CrabTravelOnCommand target = ((EntityState)self).gameObject.AddComponent<CrabTravelOnCommand>(); PurchaseInteraction component = ((EntityState)self).gameObject.GetComponent<PurchaseInteraction>(); component.SetAvailable(true); component.contextToken = "INFINITETOWER_TRAVEL_CONTEXT"; PersistentCall item = new PersistentCall { m_Target = (Object)(object)target, m_MethodName = "Activate", m_Mode = (PersistentListenerMode)1, m_Arguments = new ArgumentCache() }; ((UnityEventBase)component.onPurchase).m_PersistentCalls.m_Calls.Add(item); ((UnityEventBase)component.onPurchase).m_CallsDirty = true; } private static void Unburrow_FixedUpdate(orig_FixedUpdate orig, Unburrow self) { ((EntityState)self).fixedAge = ((EntityState)self).fixedAge + Time.fixedDeltaTime; if (((EntityState)self).fixedAge > 5f && ((EntityState)self).fixedAge < 6f) { Animator modelAnimator = ((EntityState)self).GetModelAnimator(); modelAnimator.Play("BurrowedToIdle", 0, 12f); } } } public class ITRun_Hooks { public static SceneDef PreviousSceneDef; internal static void AddHooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown InfiniteTowerRun.PreStartClient += new hook_PreStartClient(ITRun_SetThingsOn_Start); InfiniteTowerRun.OnDestroy += new hook_OnDestroy(ITRun_SetThingsOn_End); InfiniteTowerRun.OnWaveAllEnemiesDefeatedServer += new hook_OnWaveAllEnemiesDefeatedServer(PreventRepeatingStages); InfiniteTowerWaveCategory.SelectWavePrefab += new hook_SelectWavePrefab(ForceSuperBossWave); InfiniteTowerRun.AdvanceWave += new hook_AdvanceWave(MakeWavesMoreCommon); if (WConfig.cfgItemsFrequently.Value) { InfiniteTowerRun.AdvanceWave += new hook_AdvanceWave(MoreItems_AdvanceWave); } } private static void MakeWavesMoreCommon(orig_AdvanceWave orig, InfiniteTowerRun self) { orig.Invoke(self); if ((self.waveIndex == 50 || self.waveIndex == 31) && SimuMain.ITBossWaves.wavePrefabs[0].weight > 1f) { float num = 1f; num = ((self.waveIndex != 31) ? SimuMain.DefaultWeightMultiplier2 : SimuMain.DefaultWeightMultiplier1); SimuMain.ITBasicWaves.wavePrefabs[0].weight = SimuMain.BasicWaveWeight * num; SimuMain.ITBasicWaves.GenerateWeightedSelection(); SimuMain.ITBossWaves.wavePrefabs[0].weight = SimuMain.BasicBossWaveWight * num; SimuMain.ITBossWaves.GenerateWeightedSelection(); } } private static void MoreItems_AdvanceWave(orig_AdvanceWave orig, InfiniteTowerRun self) { //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Expected O, but got Unknown if (self.enemyItemPatternIndex >= 5 && self.enemyItemPeriod > 5) { self.enemyItemPeriod /= 2; } orig.Invoke(self); if (!WConfig.cfgDumpInfo.Value || !NetworkServer.active || self.waveIndex <= self.enemyItemPeriod) { return; } int num = self.waveIndex; int num2 = 0; int num3 = 8; while (num >= num3) { num -= num3; num2++; if (num2 % 5 == 0 && num3 > 2) { num3 /= 2; } } Debug.Log((object)("WaveIndex:" + self.waveIndex + " ExpectedItemCount " + num2)); while (self.enemyItemPatternIndex < num2) { EnemyItemEntry[] enemyItemPattern = self.enemyItemPattern; int enemyItemPatternIndex = self.enemyItemPatternIndex; self.enemyItemPatternIndex = enemyItemPatternIndex + 1; EnemyItemEntry val = enemyItemPattern[enemyItemPatternIndex % self.enemyItemPattern.Length]; if (!Object.op_Implicit((Object)(object)val.dropTable)) { break; } PickupIndex val2 = val.dropTable.GenerateDrop(self.enemyItemRng); if (val2 != PickupIndex.none) { PickupDef pickupDef = PickupCatalog.GetPickupDef(val2); if (pickupDef != null) { self.enemyInventory.GiveItem(pickupDef.itemIndex, val.stacks); Chat.SendBroadcastChat((ChatMessageBase)new PlayerPickupChatMessage { baseToken = "INFINITETOWER_ADD_ITEM", pickupToken = pickupDef.nameToken, pickupColor = Color32.op_Implicit(pickupDef.baseColor) }); } } } } public static GameObject ForceSuperBossWave(orig_SelectWavePrefab orig, InfiniteTowerWaveCategory self, InfiniteTowerRun run, Xoroshiro128Plus rng) { if (run.waveIndex >= SimuMain.SimuForcedBossStartAtXWaves && run.waveIndex % SimuMain.SimuForcedBossEveryXWaves == SimuMain.SimuForcedBossWaveRest) { GameObject val = orig.Invoke(SimuMain.ITSuperBossWaves, run, rng); Debug.Log((object)"Forcing SuperBoss"); Debug.Log((object)(run.waveIndex + " Forced SuperBoss " + (object)val)); return val; } GameObject val2 = orig.Invoke(self, run, rng); Debug.Log((object)(run.waveIndex + " SelectWavePrefab " + (object)val2)); return val2; } public static void PreventRepeatingStages(orig_OnWaveAllEnemiesDefeatedServer orig, InfiniteTowerRun self, InfiniteTowerWaveController wc) { orig.Invoke(self, wc); if (!self.IsStageTransitionWave()) { return; } if ((Object)(object)PreviousSceneDef != (Object)null && (Object)(object)PreviousSceneDef == (Object)(object)((Run)self).nextStageScene) { int num = 0; do { num++; ((Run)self).PickNextStageSceneFromCurrentSceneDestinations(); } while ((Object)(object)((Run)self).nextStageScene == (Object)(object)PreviousSceneDef && num < 10); } PreviousSceneDef = Stage.instance.sceneDef; } private static void ITRun_SetThingsOn_Start(orig_PreStartClient orig, InfiniteTowerRun self) { orig.Invoke(self); SimuMain.ITBossWaves.availabilityPeriod = 5; SimuMain.ITBossWaves.minWaveIndex = 0; if (SimuMain.ITBossWaves.wavePrefabs[0].weight < 1f) { SimuMain.ITBasicWaves.wavePrefabs[0].weight = SimuMain.BasicWaveWeight; SimuMain.ITBasicWaves.GenerateWeightedSelection(); SimuMain.ITBossWaves.wavePrefabs[0].weight = SimuMain.BasicBossWaveWight; SimuMain.ITBasicWaves.GenerateWeightedSelection(); } SimulacrumDCCS.MakeITSand(makeITSand: true); if (WConfig.cfgVoidCoins.Value) { VoidCoin.VoidCoinRunStart(); } GameObject val = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterMasters/EquipmentDroneMaster"); ((Behaviour)val.GetComponent<StartEvent>()).enabled = false; val.AddComponent<EquipmentDroneInSimulacrum>(); Object.Destroy((Object)(object)val.GetComponent<SetDontDestroyOnLoad>()); ((Component)self).gameObject.AddComponent<Hooks_Other.LastWaveHolder>(); } private static void ITRun_SetThingsOn_End(orig_OnDestroy orig, InfiniteTowerRun self) { orig.Invoke(self); GameObject val = LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterMasters/EquipmentDroneMaster"); ((Behaviour)val.GetComponent<StartEvent>()).enabled = true; val.AddComponent<SetDontDestroyOnLoad>(); Object.Destroy((Object)(object)val.GetComponent<EquipmentDroneInSimulacrum>()); SimulacrumDCCS.MakeITSand(makeITSand: false); if (WConfig.cfgVoidCoins.Value) { VoidCoin.VoidCoinRunEnd(); } } } public class Hooks_Other { public class ResetWavesCounter : MonoBehaviour { public void Reset() { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) Debug.LogWarning((object)"Attempting to reset Simulacrum Wave High-scores"); MPEventSystem val = MPEventSystem.instancesList[0]; UserProfile val2; if ((Object)(object)val == (Object)null) { val2 = null; } else { LocalUser localUser = val.localUser; val2 = ((localUser != null) ? localUser.userProfile : null); } UserProfile val3 = val2; if (val3 != null) { StatSheet statSheet = val3.statSheet; SurvivorDef survivorPreference = val3.GetSurvivorPreference(); if (Object.op_Implicit((Object)(object)survivorPreference)) { string bodyName = BodyCatalog.GetBodyName(SurvivorCatalog.GetBodyIndexFromSurvivorIndex(survivorPreference.survivorIndex)); Debug.LogWarning((object)("Resetting for " + bodyName)); statSheet.SetStatValueFromString(PerBodyStatDef.highestInfiniteTowerWaveReachedEasy.FindStatDef(bodyName ?? ""), "0"); statSheet.SetStatValueFromString(PerBodyStatDef.highestInfiniteTowerWaveReachedNormal.FindStatDef(bodyName ?? ""), "0"); statSheet.SetStatValueFromString(PerBodyStatDef.highestInfiniteTowerWaveReachedHard.FindStatDef(bodyName ?? ""), "0"); } } } } public class LastWaveHolder : MonoBehaviour { public GameObject UIThing; public GameObject LatestWave; } internal static void AddHooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown PickupCatalog.FindPickupIndex_ItemTier += new hook_FindPickupIndex_ItemTier(PickupCatalog_FindPickupIndex_ItemTier); CharacterBody.RpcTeleportCharacterToSafety += new Manipulator(FixUnstableTransmitterBeingStupid); ScavengerItemGranter.Start += new hook_Start(SimuGiveScavVoidItems); EventFunctions.BeginEnding += new hook_BeginEnding(SimulacrumEndingBeginEnding); if (WConfig.cfgWaveOnEndScreen.Value) { GameEndReportPanelController.SetDisplayData += new hook_SetDisplayData(GameEndReportPanelController_SetDisplayData); } InfiniteTowerMenuController.OnEventSystemDiscovered += new hook_OnEventSystemDiscovered(InfiniteTowerMenuController_OnEventSystemDiscovered); } private static void InfiniteTowerMenuController_OnEventSystemDiscovered(orig_OnEventSystemDiscovered orig, InfiniteTowerMenuController self, MPEventSystem eventSystem) { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Expected O, but got Unknown //IL_012f: Expected O, but got Unknown //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Expected O, but got Unknown //IL_015f: Expected O, but got Unknown //IL_016a: Expected O, but got Unknown orig.Invoke(self, eventSystem); if (WConfig.ResetStatsButton.Value) { Transform child = ((Component)self).transform.GetChild(0).GetChild(1).GetChild(0); Transform val = child.Find("Reset"); if (child.childCount == 2) { GameObject val2 = Object.Instantiate<GameObject>(((Component)child.GetChild(1)).gameObject, child); ((Object)val2).name = "Reset"; ((Graphic)val2.GetComponent<Image>()).color = Color.red; ((Component)val2.transform.GetChild(1)).GetComponent<LanguageTextMeshController>().token = "Reset selected Survivor"; val = val2.transform; child.GetChild(1).SetAsLastSibling(); } if (Object.op_Implicit((Object)(object)val)) { ((Component)val.GetChild(2)).gameObject.SetActive(false); HGButton component = ((Component)val).GetComponent<HGButton>(); ResetWavesCounter target = ((Component)self).gameObject.AddComponent<ResetWavesCounter>(); ((UnityEventBase)((Button)component).onClick).m_PersistentCalls = new PersistentCallGroup { m_Calls = new List<PersistentCall> { new PersistentCall { m_Target = (Object)(object)target, m_MethodName = "Reset", m_Mode = (PersistentListenerMode)1, m_Arguments = new ArgumentCache() }, new PersistentCall { m_Target = (Object)(object)self, m_MethodName = "UpdateDisplayedSurvivor", m_Mode = (PersistentListenerMode)1, m_Arguments = new ArgumentCache() } } }; } } } private static void GameEndReportPanelController_SetDisplayData(orig_SetDisplayData orig, GameEndReportPanelController self, DisplayData newDisplayData) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, newDisplayData); if (!Object.op_Implicit((Object)(object)Run.instance) || !Object.op_Implicit((Object)(object)((Component)Run.instance).GetComponent<InfiniteTowerRun>())) { return; } LastWaveHolder component = ((Component)Run.instance).GetComponent<LastWaveHolder>(); if (!Object.op_Implicit((Object)(object)component)) { return; } GameObject val = component.LatestWave; if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((Component)Run.instance).GetComponent<InfiniteTowerRun>().waveInstance)) { val = ((Component)Run.instance).GetComponent<InfiniteTowerRun>().waveInstance.GetComponent<InfiniteTowerWaveController>().overlayEntries[1].prefab; } if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)self.selectedDifficultyLabel) || Object.op_Implicit((Object)(object)component.UIThing)) { return; } GameObject val2 = Object.Instantiate<GameObject>(((Component)((Component)self.selectedDifficultyLabel).transform.parent).gameObject, ((Component)self.selectedDifficultyLabel).transform.parent.parent); val2.transform.SetSiblingIndex(1); component.UIThing = val2; ((Component)val2.transform.GetChild(0)).GetComponent<LanguageTextMeshController>().token = "Last Wave:"; string token = ((Component)val.transform.GetChild(0).GetChild(1).GetChild(0)).GetComponent<InfiniteTowerWaveCounter>().token; token = Language.GetString(token); string format = token; Run instance = Run.instance; token = string.Format(format, ((InfiniteTowerRun)((instance is InfiniteTowerRun) ? instance : null)).waveIndex); ((Component)val2.transform.GetChild(2)).GetComponent<LanguageTextMeshController>().token = token; Image component2 = ((Component)val2.transform.GetChild(3)).GetComponent<Image>(); Image component3 = ((Component)val.transform.GetChild(0).GetChild(0).GetChild(0)).GetComponent<Image>(); component2.sprite = component3.sprite; ((Graphic)component2).color = ((Graphic)component3).color; ((Graphic)((Component)val2.transform.GetChild(2)).GetComponent<HGTextMeshProUGUI>()).color = ((Graphic)((Component)val.transform.GetChild(0).GetChild(1).GetChild(0)).GetComponent<TextMeshProUGUI>()).color; val2.transform.GetChild(2).SetAsLastSibling(); try { if (val.transform.GetChild(0).childCount == 4) { GameObject val3 = Object.Instantiate<GameObject>(((Component)component2).gameObject, val2.transform); component3 = ((Component)val.transform.GetChild(0).GetChild(3).GetChild(0)).GetComponent<Image>(); component2 = val3.GetComponent<Image>(); component2.sprite = component3.sprite; ((Graphic)component2).color = ((Graphic)component3).color; } } catch (Exception) { } TooltipProvider val4 = val2.AddComponent<TooltipProvider>(); val4.titleToken = token; val4.titleColor = ((Graphic)((Component)val.transform.GetChild(0).GetChild(2)).GetComponent<Image>()).color; val4.bodyToken = ((Component)val.transform.GetChild(0).GetChild(1).GetChild(1)).GetComponent<LanguageTextMeshController>().token; } public static void SimulacrumEndingBeginEnding(orig_BeginEnding orig, EventFunctions self, GameEndingDef gameEndingDef) { //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown if ((Object)(object)gameEndingDef == (Object)(object)GameEndings.VoidEnding && Object.op_Implicit((Object)(object)((Component)Run.instance).GetComponent<InfiniteTowerRun>())) { orig.Invoke(self, SimuMain.InfiniteTowerEnding); foreach (CharacterBody readOnlyInstances in CharacterBody.readOnlyInstancesList) { if (readOnlyInstances.hasEffectiveAuthority) { } EntityStateMachine val = EntityStateMachine.FindByCustomName(((Component)readOnlyInstances).gameObject, "Body"); if (Object.op_Implicit((Object)(object)val)) { val.SetInterruptState((EntityState)new Idle(), (InterruptPriority)5); } } Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "<color=#F4ADFA><sprite name=\"VoidCoin\" tint=1> The Simulation has been suspended. Printing results.. <sprite name=\"VoidCoin\" tint=1></color>" }); } else { orig.Invoke(self, gameEndingDef); } } public static void SimuGiveScavVoidItems(orig_Start orig, ScavengerItemGranter self) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Invalid comparison between Unknown and I4 //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Invalid comparison between Unknown and I4 orig.Invoke(self); if (Run.instance is InfiniteTowerRun) { Inventory component = ((Component)self).GetComponent<Inventory>(); PickupIndex val = ((PickupDropTable)SimuMain.dtAISafeRandomVoid).GenerateDrop(Run.instance.treasureRng); ItemDef itemDef = ItemCatalog.GetItemDef(((PickupIndex)(ref val)).pickupDef.itemIndex); if ((int)itemDef.tier == 6) { component.GiveItem(itemDef, 3); Debug.Log((object)("Giving Simu Scav 3x " + (object)itemDef)); } else if ((int)itemDef.tier == 7) { component.GiveItem(itemDef, 2); Debug.Log((object)("Giving Simu Scav 2x " + (object)itemDef)); } else { component.GiveItem(itemDef, 1); Debug.Log((object)("Giving Simu Scav 1x " + (object)itemDef)); } } } private static PickupIndex PickupCatalog_FindPickupIndex_ItemTier(orig_FindPickupIndex_ItemTier orig, ItemTier tier) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (tier == SimuMain.ItemOrangeTierDef.tier && Object.op_Implicit((Object)(object)RunArtifactManager.instance) && RunArtifactManager.instance.IsArtifactEnabled(Artifacts.commandArtifactDef)) { return PickupCatalog.FindPickupIndex(Equipment.Fruit.equipmentIndex); } return orig.Invoke(tier); } private static void PickupPickerController_SetOptionsFromPickupForCommandArtifact(orig_SetOptionsFromPickupForCommandArtifact orig, PickupPickerController self, PickupIndex pickupIndex) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, pickupIndex); } private static void FixUnstableTransmitterBeingStupid(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchCall(x, "RoR2.TeleportHelper", "TeleportBody") })) { int index = val.Index; val.Index = index - 1; val.EmitDelegate<Func<Vector3, Vector3>>((Func<Vector3, Vector3>)((Vector3 teleportPosition) => (Object.op_Implicit((Object)(object)Run.instance) && Object.op_Implicit((Object)(object)((Component)Run.instance).GetComponent<InfiniteTowerRun>())) ? ((Component)((Component)Run.instance).GetComponent<InfiniteTowerRun>().safeWardController).transform.position : teleportPosition)); Debug.Log((object)"IL Found : Unstable Transmitter to Void Crab"); } else { Debug.LogWarning((object)"IL Failed : Unstable Transmitter to Void Crab"); } } } public class VoidSafeWard_Hooks { public class RadiusShrinker : MonoBehaviour { public float newRadius; public float currentRadius; public float originalRadius; public float remove = 0.13f; public InfiniteTowerSafeWardController crab; public void Start() { currentRadius = originalRadius; crab = ((Component)Run.instance).GetComponent<InfiniteTowerRun>().safeWardController; if (!Object.op_Implicit((Object)(object)crab)) { Debug.Log((object)"No gameobject"); Object.Destroy((Object)(object)this); } } public void FixedUpdate() { //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)crab != (Object)null) { if (currentRadius > newRadius) { currentRadius -= remove; Reflection.SetFieldValue<float>((object)crab.wardStateMachine.state, "radius", currentRadius); crab.holdoutZoneController.baseRadius = currentRadius; ((BaseSafeWardState)crab.wardStateMachine.state).zone.Networkradius = currentRadius; } else { Reflection.SetFieldValue<float>((object)crab.wardStateMachine.state, "radius", newRadius); crab.holdoutZoneController.baseRadius = newRadius; ((BaseSafeWardState)crab.wardStateMachine.state).zone.Networkradius = newRadius; Object.Destroy((Object)(object)this); } } } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_MoveSafeWard <>9__2_0; public static hook_OnTimerExpire <>9__2_1; public static hook_OnTimerExpire <>9__2_2; public static hook_OnEnter <>9__2_3; public static hook_OnEnter <>9__2_4; public static hook_OnEnter <>9__2_5; public static hook_OnEnter <>9__2_6; internal void <AddHooks>b__2_0(orig_MoveSafeWard orig, InfiniteTowerRun self) { if (self.waveIndex % 5 != 0) { Debug.Log((object)"Preventing early moving of crab"); } else { orig.Invoke(self); } } internal void <AddHooks>b__2_1(orig_OnTimerExpire orig, InfiniteTowerBossWaveController self) { if (((InfiniteTowerWaveController)self).waveIndex % 5 != 0) { if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Void RoR2.InfiniteTowerWaveController::OnTimerExpire()' called on client"); return; } ((InfiniteTowerWaveController)self).MarkAsFinished(); Debug.Log((object)"Preventing early moving of crab"); } else { orig.Invoke(self); } } internal void <AddHooks>b__2_2(orig_OnTimerExpire orig, InfiniteTowerExplicitSpawnWaveController self) { if (((InfiniteTowerWaveController)self).waveIndex % 5 != 0) { if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Void RoR2.InfiniteTowerWaveController::OnTimerExpire()' called on client"); return; } ((InfiniteTowerWaveController)self).MarkAsFinished(); Debug.Log((object)"Preventing early moving of crab"); } else { orig.Invoke(self); } } internal void <AddHooks>b__2_3(orig_OnEnter orig, Unburrow self) { orig.Invoke(self); if (NetworkServer.active) { GoldTitanManager.EndChannelingTitansServer((object)((EntityState)self).gameObject); } } internal void <AddHooks>b__2_4(orig_OnEnter orig, AwaitingPortalUse self) { orig.Invoke(self); if (NetworkServer.active) { GoldTitanManager.EndChannelingTitansServer((object)((EntityState)self).gameObject); } } internal void <AddHooks>b__2_5(orig_OnEnter orig, Burrow self) { float radius = ((EntityState)self).GetComponent<VerticalTubeZone>().radius; self.radius = radius; orig.Invoke(self); } internal void <AddHooks>b__2_6(orig_OnEnter orig, Unburrow self) { orig.Invoke(self); GameObject waveInstance = ((Component)Run.instance).GetComponent<InfiniteTowerRun>().waveInstance; if (self.duration > 0f && Object.op_Implicit((Object)(object)waveInstance)) { self.duration = waveInstance.GetComponent<InfiniteTowerWaveController>().secondsAfterWave; } } } public static float baseRadius = 65f; public static float radiusPerPlayer = 5f; internal static void AddHooks() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Expected O, but got Unknown //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Expected O, but got Unknown //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Expected O, but got Unknown baseRadius = WConfig.cfgCrabRadius.Value; radiusPerPlayer = WConfig.cfgCrabRadiusPerPlayer.Value; object obj = <>c.<>9__2_0; if (obj == null) { hook_MoveSafeWard val = delegate(orig_MoveSafeWard orig, InfiniteTowerRun self) { if (self.waveIndex % 5 != 0) { Debug.Log((object)"Preventing early moving of crab"); } else { orig.Invoke(self); } }; <>c.<>9__2_0 = val; obj = (object)val; } InfiniteTowerRun.MoveSafeWard += (hook_MoveSafeWard)obj; object obj2 = <>c.<>9__2_1; if (obj2 == null) { hook_OnTimerExpire val2 = delegate(orig_OnTimerExpire orig, InfiniteTowerBossWaveController self) { if (((InfiniteTowerWaveController)self).waveIndex % 5 != 0) { if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Void RoR2.InfiniteTowerWaveController::OnTimerExpire()' called on client"); } else { ((InfiniteTowerWaveController)self).MarkAsFinished(); Debug.Log((object)"Preventing early moving of crab"); } } else { orig.Invoke(self); } }; <>c.<>9__2_1 = val2; obj2 = (object)val2; } InfiniteTowerBossWaveController.OnTimerExpire += (hook_OnTimerExpire)obj2; object obj3 = <>c.<>9__2_2; if (obj3 == null) { hook_OnTimerExpire val3 = delegate(orig_OnTimerExpire orig, InfiniteTowerExplicitSpawnWaveController self) { if (((InfiniteTowerWaveController)self).waveIndex % 5 != 0) { if (!NetworkServer.active) { Debug.LogWarning((object)"[Server] function 'System.Void RoR2.InfiniteTowerWaveController::OnTimerExpire()' called on client"); } else { ((InfiniteTowerWaveController)self).MarkAsFinished(); Debug.Log((object)"Preventing early moving of crab"); } } else { orig.Invoke(self); } }; <>c.<>9__2_2 = val3; obj3 = (object)val3; } InfiniteTowerExplicitSpawnWaveController.OnTimerExpire += (hook_OnTimerExpire)obj3; object obj4 = <>c.<>9__2_3; if (obj4 == null) { hook_OnEnter val4 = delegate(orig_OnEnter orig, Unburrow self) { orig.Invoke(self); if (NetworkServer.active) { GoldTitanManager.EndChannelingTitansServer((object)((EntityState)self).gameObject); } }; <>c.<>9__2_3 = val4; obj4 = (object)val4; } Unburrow.OnEnter += (hook_OnEnter)obj4; AwaitingPortalUse.OnEnter += new hook_OnEnter(Radius_AwaitingPortalUse_OnEnter); object obj5 = <>c.<>9__2_4; if (obj5 == null) { hook_OnEnter val5 = delegate(orig_OnEnter orig, AwaitingPortalUse self) { orig.Invoke(self); if (NetworkServer.active) { GoldTitanManager.EndChannelingTitansServer((object)((EntityState)self).gameObject); } }; <>c.<>9__2_4 = val5; obj5 = (object)val5; } AwaitingPortalUse.OnEnter += (hook_OnEnter)obj5; Active.OnEnter += new hook_OnEnter(Activate_SetCorrectRadius); AwaitingActivation.OnEnter += new hook_OnEnter(Waiting_SetRadius); Travelling.OnEnter += new hook_OnEnter(Travelling_RadiusAndSpeed); object obj6 = <>c.<>9__2_5; if (obj6 == null) { hook_OnEnter val6 = delegate(orig_OnEnter orig, Burrow self) { float radius = ((EntityState)self).GetComponent<VerticalTubeZone>().radius; self.radius = radius; orig.Invoke(self); }; <>c.<>9__2_5 = val6; obj6 = (object)val6; } Burrow.OnEnter += (hook_OnEnter)obj6; object obj7 = <>c.<>9__2_6; if (obj7 == null) { hook_OnEnter val7 = delegate(orig_OnEnter orig, Unburrow self) { orig.Invoke(self); GameObject waveInstance = ((Component)Run.instance).GetComponent<InfiniteTowerRun>().waveInstance; if (self.duration > 0f && Object.op_Implicit((Object)(object)waveInstance)) { self.duration = waveInstance.GetComponent<InfiniteTowerWaveController>().secondsAfterWave; } }; <>c.<>9__2_6 = val7; obj7 = (object)val7; } Unburrow.OnEnter += (hook_OnEnter)obj7; } private static void Radius_AwaitingPortalUse_OnEnter(orig_OnEnter orig, AwaitingPortalUse self) { ((BaseSafeWardState)self).zone = ((EntityState)self).GetComponent<VerticalTubeZone>(); float num = baseRadius + (float)Run.instance.participatingPlayerCount * radiusPerPlayer; if (Object.op_Implicit((Object)(object)((BaseSafeWardState)self).zone) && ((BaseSafeWardState)self).zone.radius > num) { RadiusShrinker radiusShrinker = ((EntityState)self).gameObject.AddComponent<RadiusShrinker>(); radiusShrinker.originalRadius = ((BaseSafeWardState)self).zone.radius; radiusShrinker.newRadius = num; self.radius = ((BaseSafeWardState)self).zone.radius; } else { self.radius = num; } orig.Invoke(self); } public static void Waiting_SetRadius(orig_OnEnter orig, AwaitingActivation self) { InfiniteTowerRun component = ((Component)Run.instance).GetComponent<InfiniteTowerRun>(); if (Object.op_Implicit((Object)(object)component.waveInstance)) { float radius = baseRadius + (float)Run.instance.participatingPlayerCount * radiusPerPlayer; self.radius = radius; } else { self.radius = baseRadius / 2f; } orig.Invoke(self); if (!Object.op_Implicit((Object)(object)component.safeWardController)) { component.safeWardController = ((EntityState)self).gameObject.GetComponent<InfiniteTowerSafeWardController>(); } } public static void Travelling_RadiusAndSpeed(orig_OnEnter orig, Travelling self) { ((BaseSafeWardState)self).zone = ((EntityState)self).GetComponent<VerticalTubeZone>(); self.radius = ((BaseSafeWardState)self).zone.radius; orig.Invoke(self); float num = baseRadius / 2f; float num2 = 1f; float num3 = ((Component)Run.instance).GetComponent<InfiniteTowerRun>().Network_waveIndex; if (WConfig.cfgCrabSpeedOnLaterWaves.Value) { num2 = 1f + (num3 - 10f) / 50f + 0.1f; if (num3 > 30f) { num2 += (num3 - 25f) / 50f; if (num2 > 3f) { num2 = 3f; } } num = Mathf.Min(num * (0.5f + 0.5f * num2), baseRadius); self.travelSpeed *= num2; self.pathMaxSpeed *= num2; } if (Object.op_Implicit((Object)(object)RunArtifactManager.instance) && RunArtifactManager.instance.IsArtifactEnabled(ArtifactReal.ArtifactUseNormalStages)) { num = baseRadius; } else if (Object.op_Implicit((Object)(object)((BaseSafeWardState)self).zone) && ((BaseSafeWardState)self).zone.radius > num) { RadiusShrinker radiusShrinker = ((EntityState)self).gameObject.AddComponent<RadiusShrinker>(); radiusShrinker.originalRadius = ((BaseSafeWardState)self).zone.radius; radiusShrinker.remove *= 2f; radiusShrinker.newRadius = num; } Debug.Log((object)("Wave:" + num3 + " speedMult:" + num2 + " TravellingSpeed:" + self.travelSpeed + " Radius:" + num)); } private static void Activate_SetCorrectRadius(orig_OnEnter orig, Active self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)Run.instance) && Run.instance is InfiniteTowerRun && Object.op_Implicit((Object)(object)((InfiniteTowerRun)/*isinst with value type is only supported in some contexts*/).waveInstance)) { Run instance = Run.instance; SimulacrumExtrasHelper component = ((InfiniteTowerRun)((instance is InfiniteTowerRun) ? instance : null)).waveInstance.GetComponent<SimulacrumExtrasHelper>(); if (Object.op_Implicit((Object)(object)component) && component.newRadius > 0f) { float num = baseRadius + (component.newRadius - 60f) + (float)Run.instance.participatingPlayerCount * radiusPerPlayer; Reflection.SetFieldValue<float>((object)((BaseSafeWardState)self).safeWardController.wardStateMachine.state, "radius", component.newRadius); ((BaseSafeWardState)self).safeWardController.holdoutZoneController.baseRadius = component.newRadius; } else { float num2 = baseRadius + (float)Run.instance.participatingPlayerCount * radiusPerPlayer; Reflection.SetFieldValue<float>((object)((BaseSafeWardState)self).safeWardController.wardStateMachine.state, "radius", num2); ((BaseSafeWardState)self).safeWardController.holdoutZoneController.baseRadius = num2; } } } } public class Wave_Hooks { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_DropRewards <>9__0_0; internal void <AddHooks>b__0_0(orig_DropRewards orig, InfiniteTowerWaveController self) { orig.Invoke(self); SimulacrumExtrasHelper component = ((Component)self).GetComponent<SimulacrumExtrasHelper>(); if (Object.op_Implicit((Object)(object)component) && (Object)(object)component.rewardDropTable != (Object)null) { component.DropRewards(); } } } internal static void AddHooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown InfiniteTowerRun.InitializeWaveController += new hook_InitializeWaveController(InfiniteTowerRun_BeginNextWave); InfiniteTowerExplicitSpawnWaveController.Initialize += new hook_Initialize(GiveStatBoosts_ExplicitSpawnWaveController_Initialize); InfiniteTowerWaveController.OnCombatSquadMemberDiscovered += new hook_OnCombatSquadMemberDiscovered(InfiniteTowerWaveController_OnCombatSquadMemberDiscovered); InfiniteTowerWaveController.StartTimer += new hook_StartTimer(KillAllGhosts_StartTimer); InfiniteTowerWaveController.OnAllEnemiesDefeatedServer += new hook_OnAllEnemiesDefeatedServer(InfiniteTowerWaveController_OnAllEnemiesDefeatedServer); InfiniteTowerRun.CleanUpCurrentWave += new hook_CleanUpCurrentWave(InfiniteTowerRun_CleanUpCurrentWave); SimulacrumExtrasHelper.shareSuitInstalled = Chainloader.PluginInfos.ContainsKey("com.funkfrog_sipondo.sharesuite"); object obj = <>c.<>9__0_0; if (obj == null) { hook_DropRewards val = delegate(orig_DropRewards orig, InfiniteTowerWaveController self) { orig.Invoke(self); SimulacrumExtrasHelper component = ((Component)self).GetComponent<SimulacrumExtrasHelper>(); if (Object.op_Implicit((Object)(object)component) && (Object)(object)component.rewardDropTable != (Object)null) { component.DropRewards(); } }; <>c.<>9__0_0 = val; obj = (object)val; } InfiniteTowerWaveController.DropRewards += (hook_DropRewards)obj; } private static void KillAllGhosts_StartTimer(orig_StartTimer orig, InfiniteTowerWaveController self) { orig.Invoke(self); if (WConfig.cfgFasterWavesLater.Value && self.waveIndex % 5 != 0) { int num = Mathf.Min(5, Run.instance.participatingPlayerCount); self.Network_timerStart += (float)(self.waveIndex / 10 * num) * 0.2f; Debug.Log((object)("secondsAfterWave: " + self.Network_timerStart)); } MusicTrackOverride component = ((Component)self).gameObject.GetComponent<MusicTrackOverride>(); if (Object.op_Implicit((Object)(object)component)) { ((Behaviour)component).enabled = false; } if (!NetworkServer.active) { return; } for (int i = 0; i < CharacterMaster.instancesList.Count; i++) { CharacterMaster val = CharacterMaster.instancesList[i]; if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val.inventory)) { continue; } int itemCount = val.inventory.GetItemCount(ItemHelpers.ITKillOnCompletion); if (itemCount > 0) { val.inventory.GiveItem(Items.HealthDecay, 1); } if (itemCount <= 6) { continue; } try { val.TrueKill(); } catch (Exception ex) { Debug.Log((object)ex); if (val.inventory.GetItemCount(Items.ExtraLife) > 0) { val.inventory.ResetItem(Items.ExtraLife); } if (val.inventory.GetItemCount(Items.ExtraLifeVoid) > 0) { val.inventory.ResetItem(Items.ExtraLifeVoid); } ((MonoBehaviour)val).CancelInvoke("RespawnExtraLife"); ((MonoBehaviour)val).CancelInvoke("PlayExtraLifeSFX"); ((MonoBehaviour)val).CancelInvoke("RespawnExtraLifeVoid"); ((MonoBehaviour)val).CancelInvoke("PlayExtraLifeVoidSFX"); ((MonoBehaviour)val).CancelInvoke("RespawnExtraLifeShrine"); } Object.Destroy((Object)(object)((Component)val).gameObject, 2f); } } public static void InfiniteTowerWaveController_OnAllEnemiesDefeatedServer(orig_OnAllEnemiesDefeatedServer orig, InfiniteTowerWaveController self) { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Expected O, but got Unknown //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Expected O, but got Unknown orig.Invoke(self); CombatDirector[] components = ((Component)self).gameObject.GetComponents<CombatDirector>(); if (components.Length > 1) { ((Behaviour)((Component)self).gameObject.GetComponents<CombatDirector>()[0]).enabled = false; ((Behaviour)((Component)self).gameObject.GetComponents<CombatDirector>()[1]).enabled = false; } SimulacrumInteractablesWaveHelper component = ((Component)self).gameObject.GetComponent<SimulacrumInteractablesWaveHelper>(); if (Object.op_Implicit((Object)(object)component)) { ((Behaviour)component).enabled = false; } InfiniteTowerRun component2 = ((Component)Run.instance).GetComponent<InfiniteTowerRun>(); if (component2.waveIndex >= SimuMain.SimuEndingStartAtXWaves && component2.waveIndex % SimuMain.SimuEndingEveryXWaves == SimuMain.SimuEndingWaveRest) { GameObject val = DirectorCore.instance.TrySpawnObject(new DirectorSpawnRequest((SpawnCard)(object)SimuMain.iscSimuExitPortal, new DirectorPlacementRule { minDistance = 30f, maxDistance = 35f, placementMode = (PlacementMode)1, position = ((Component)component2.safeWardController).transform.position, spawnOnTarget = ((Component)component2.safeWardController).transform }, component2.safeWardRng)); } if (((Object)self).name.EndsWith("EquipmentDrone(Clone)")) { MeteorStormController[] array = Object.FindObjectsOfType(typeof(MeteorStormController)) as MeteorStormController[]; if (array.Length != 0) { for (int i = 0; i < array.Length; i++) { Object.Destroy((Object)(object)((Component)array[i]).gameObject); } } BuffWard[] array2 = Object.FindObjectsOfType(typeof(BuffWard)) as BuffWard[]; if (array2.Length != 0) { GameObject val2 = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/BrittleDeath"); for (int j = 0; j < array2.Length; j++) { if (Object.op_Implicit((Object)(object)(array2[j].buffDef = Buffs.Cripple))) { Object.Destroy((Object)(object)((Component)array2[j]).gameObject); EffectManager.SpawnEffect(val2, new EffectData { origin = ((Component)array2[j]).transform.position, rotation = ((Component)array2[j]).transform.rotation }, true); } } } } else if (((Object)self).name.EndsWith("Enigma(Clone)")) { ((Component)self).GetComponent<ArtifactEnabler>().OnDisable(); } else if (Object.op_Implicit((Object)(object)((Component)self).GetComponent<SimulacrumLightningStormWave>())) { ((Component)self).GetComponent<SimulacrumLightningStormWave>().DisableStorm(); } if (Object.op_Implicit((Object)(object)Run.instance)) { ((Component)Run.instance).GetComponent<EnemyInfoPanelInventoryProvider>().MarkAsDirty(); } Debug.Log((object)("OnAllEnemiesDefeatedServer " + (object)self)); } private static void GiveStatBoosts_ExplicitSpawnWaveController_Initialize(orig_Initialize orig, InfiniteTowerExplicitSpawnWaveController self, int waveIndex, Inventory enemyInventory, GameObject spawnTargetObject) { //IL_0711: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_0673: Unknown result type (might be due to invalid IL or missing references) //IL_06dd: Unknown result type (might be due to invalid IL or missing references) //IL_06f7: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Unknown result type (might be due to invalid IL or missing references) //IL_0560: Unknown result type (might be due to invalid IL or missing references) //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_05ae: Unknown result type (might be due to invalid IL or missing references) //IL_05c9: Unknown result type (might be due to invalid IL or missing references) //IL_05cb: Unknown result type (might be due to invalid IL or missing references) //IL_0617: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_0633: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { if (((InfiniteTowerWaveController)self).linearCreditsPerWave * (float)waveIndex > 400f) { ((InfiniteTowerWaveController)self).linearCreditsPerWave = ((InfiniteTowerWaveController)self).linearCreditsPerWave * (float)waveIndex / 400f; } float num = 0.5f; float num2 = 0.5f; bool flag = false; if (waveIndex >= SimuMain.SimuForcedBossStartAtXWaves && waveIndex % SimuMain.SimuForcedBossEveryXWaves == SimuMain.SimuForcedBossWaveRest) { flag = true; num = 1f; } if (Object.op_Implicit((Object)(object)((Component)self).GetComponent<CardRandomizer>())) { ((Component)self).GetComponent<CardRandomizer>().DoTheThing(self); } int num3 = 0; bool flag2 = false; switch (((Object)self).name) { case "InfiniteTowerWaveBossVoidElites(Clone)": num = 3f; break; case "InfiniteTowerWaveBossCharacters(Clone)": num = 1.2f; flag2 = true; if (waveIndex > 29) { self.spawnList[0].spawnCard.itemsToGrant[0].count = 1; } else { self.spawnList[0].spawnCard.itemsToGrant[0].count = 0; } break; case "InfiniteTowerWaveSS2RainbowElites(Clone)": { num = -1f; DirectorCard val = ((Component)self).GetComponent<CombatDirector>().SelectMonsterCardForCombatShrine((float)(waveIndex * 2 + 20)); if (val == null) { Debug.LogWarning((object)"Could not find Emyprean candidate normally"); val = ClassicStageInfo.instance.monsterCategories.categories[2].cards[0]; } ((SpawnCard)self.spawnList[0].spawnCard).prefab = val.spawnCard.prefab; ((SpawnCard)self.spawnList[0].spawnCard).nodeGraphType = val.spawnCard.nodeGraphType; break; } } SimuExplicitStats component = ((Component)self).GetComponent<SimuExplicitStats>(); if (Object.op_Implicit((Object)(object)component)) { if (component.halfOnNonFinal && !flag) { num = component.hpBonusMulti / 2f; num2 = component.damageBonusMulti / 2f; } else { num2 = component.damageBonusMulti; num = component.hpBonusMulti; } if (component.spawnAsVoidTeam) { ((InfiniteTowerWaveController)self).combatDirector.teamIndex = (TeamIndex)4; } if (component.ExtraSpawnAfterWave > 0 && waveIndex > component.ExtraSpawnAfterWave) { self.spawnList[0].count++; } } if (num > 0f) { float num4 = 1f; float num5 = 1f; num4 += Run.instance.difficultyCoefficient / 2.5f * Math.Max(1f, (float)(waveIndex / 10) * 0.225f + 0.225f); num5 += Run.instance.difficultyCoefficient / 30f * Math.Max(1f, (float)(waveIndex / 10) * 0.04f); num4 *= num; num5 *= num2; if (flag) { num4 /= 1f + (float)(Run.instance.participatingPlayerCount - 1) * 0.2f; int participatingPlayerCount = Run.instance.participatingPlayerCount; num4 *= Mathf.Pow((float)participatingPlayerCount, 0.4f); } int num6 = Mathf.RoundToInt((num4 - 1f) * 10f); int num7 = Mathf.RoundToInt((num5 - 1f) * 10f); if (num6 > 100000) { num6 = 100000; } Debug.LogFormat(((Object)self).name + " Special Scaling: currentBoostHpCoefficient={0}, currentBoostDamageCoefficient={1}", new object[2] { num6, num7 }); for (int i = 0; i < self.spawnList.Length; i++) { bool flag3 = true; bool flag4 = true; bool flag5 = true; for (int j = 0; j < self.spawnList[i].spawnCard.itemsToGrant.Length; j++) { if ((Object)(object)self.spawnList[i].spawnCard.itemsToGrant[j].itemDef == (Object)(object)Items.BoostHp) { flag3 = false; self.spawnList[i].spawnCard.itemsToGrant[j].count = num6; } else if ((Object)(object)self.spawnList[i].spawnCard.itemsToGrant[j].itemDef == (Object)(object)Items.BoostDamage) { flag4 = false; self.spawnList[i].spawnCard.itemsToGrant[j].count = num7; } else if ((Object)(object)self.spawnList[i].spawnCard.itemsToGrant[j].itemDef == (Object)(object)Items.TeleportWhenOob) { flag5 = false; } } if (flag3) { self.spawnList[i].spawnCard.itemsToGrant = self.spawnList[i].spawnCard.itemsToGrant.Add(new ItemCountPair { itemDef = Items.BoostHp, count = num6 }); } if (flag4) { self.spawnList[i].spawnCard.itemsToGrant = self.spawnList[i].spawnCard.itemsToGrant.Add(new ItemCountPair { itemDef = Items.BoostDamage, count = num7 }); } if (flag5) { self.spawnList[i].spawnCard.itemsToGrant = self.spawnList[i].spawnCard.itemsToGrant.Add(new ItemCountPair { itemDef = Items.TeleportWhenOob, count = 1 }); } } } if (flag2) { ((InfiniteTowerWaveController)self).combatDirector.teamIndex = (TeamIndex)4; ((InfiniteTowerWaveController)self).enemyInventory = enemyInventory; CombatDirector combatDirector = ((InfiniteTowerWaveController)self).combatDirector; SpawnCard spawnCard = (SpawnCard)(object)self.spawnList[0].spawnCard; EliteDef eliteDef = self.spawnList[0].eliteDef; Transform transform = spawnTargetObject.transform; bool preventOverhead = self.spawnList[0].preventOverhead; combatDirector.Spawn(spawnCard, eliteDef, transform, self.spawnList[0].spawnDistance, preventOverhead, 1f, (PlacementMode)1); ((InfiniteTowerWaveController)self).combatDirector.teamIndex = (TeamIndex)2; } } orig.Invoke(self, waveIndex, enemyInventory, spawnTargetObject); ((InfiniteTowerWaveController)self).combatDirector.teamIndex = (TeamIndex)2; } public static void InfiniteTowerRun_BeginNextWave(orig_InitializeWaveController orig, InfiniteTowerRun self) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0422: Unknown result type (might be due to invalid IL or missing references) //IL_0432: Expected O, but got Unknown //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Expected O, but got Unknown //IL_045f: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0621: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (NetworkServer.active) { GoldTitanManager.TryStartChannelingTitansServer((object)((Component)self.safeWardController).gameObject, ((Component)self.safeWardController).gameObject.transform.position, (Vector3?)null, (Action)null); } CombatDirector component = self.waveInstance.GetComponent<CombatDirector>(); InfiniteTowerWaveController component2 = self.waveInstance.GetComponent<InfiniteTowerWaveController>(); SimulacrumExtrasHelper component3 = self.waveInstance.GetComponent<SimulacrumExtrasHelper>(); float baseRadius = VoidSafeWard_Hooks.baseRadius; float radius = ((Component)self.safeWardController.wardStateMachine).GetComponent<VerticalTubeZone>().radius; if (Object.op_Implicit((Object)(object)component3) && component3.newRadius > 0f) { baseRadius = VoidSafeWard_Hooks.baseRadius + (component3.newRadius - 60f) + (float)Run.instance.participatingPlayerCount * VoidSafeWard_Hooks.radiusPerPlayer; } else { baseRadius += (float)Run.instance.participatingPlayerCount * VoidSafeWard_Hooks.radiusPerPlayer; if (component2.isBossWave) { baseRadius += 5f; } } if (radius > baseRadius) { VoidSafeWard_Hooks.RadiusShrinker radiusShrinker = ((Component)self).gameObject.AddComponent<VoidSafeWard_Hooks.RadiusShrinker>(); radiusShrinker.originalRadius = radius; radiusShrinker.newRadius = baseRadius; } else { Reflection.SetFieldValue<float>((object)self.safeWardController.wardStateMachine.state, "radius", baseRadius); self.safeWardController.holdoutZoneController.baseRadius = baseRadius; } component.minSpawnRange = 15f; component.maxSpawnDistance = baseRadius - 5f; if (Object.op_Implicit((Object)(object)self._waveController)) { switch (((Object)self.waveInstance).name) { case "InfiniteTowerWaveBossArtifactDoppelganger(Clone)": { if (!NetworkServer.active) { break; } DoppelgangerInvasionManager.PerformInvasion(((Run)self).bossRewardRng); CombatSquad component4 = self.waveInstance.GetComponent<CombatSquad>(); CombatSquad[] array = Object.FindObjectsOfType(typeof(CombatSquad)) as CombatSquad[]; for (int j = 0; j < array.Length; j++) { if (!((Object)array[j]).name.Equals("ShadowCloneEncounter(Clone)") && !((Object)array[j]).name.Equals("ShadowCloneEncounterAltered")) { continue; } foreach (CharacterMaster members in array[j].membersList) { component4.AddMember(members); } } break; } case "InfiniteTowerWaveBossBrother(Clone)": self.waveInstance.AddComponent<PhaseCounter>().phase = 3; break; case "InfiniteTowerWaveBossVoidElites(Clone)": { CombatDirector obj = self.waveInstance.GetComponents<CombatDirector>()[1]; obj.monsterCredit *= Math.Max(0.9f, ((float)(self.waveIndex / 10) + 1f) * 0.24f); break; } case "InfiniteTowerWaveHeresy(Clone)": if (NetworkServer.active) { if (WRect.random.Next(0, 2) == 0) { self.enemyInventory.GiveItem(Items.LunarPrimaryReplacement, 1); self.enemyInventory.GiveItem(ItemHelpers.ITDamageDown, 50); self.enemyInventory.GiveItem(ItemHelpers.ITAttackSpeedDown, 70); self.enemyInventory.GiveItem(ItemHelpers.ITCooldownUp, 10); self.enemyInventory.GiveItem(Items.BoostHp, self.waveIndex / 10 * 2); Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "ITWAVE_HERESY_ANNOUNCE_EYE" }); } else { self.enemyInventory.GiveItem(Items.LunarSecondaryReplacement, 1); self.enemyInventory.GiveItem(Items.LunarUtilityReplacement, 1); self.enemyInventory.GiveItem(Items.BoostHp, self.waveIndex / 10 * 2); self.enemyInventory.GiveItem(ItemHelpers.ITDamageDown, 5); Chat.SendBroadcastChat((ChatMessageBase)new SimpleChatMessage { baseToken = "ITWAVE_HERESY_ANNOUNCE_ARM" }); } } break; case "InfiniteTowerWaveManyItems(Clone)": { if (!NetworkServer.active) { break; } for (int i = 0; i < self.enemyInventory.itemAcquisitionOrder.Count; i++) { ItemDef itemDef = ItemCatalog.GetItemDef(self.enemyInventory.itemAcquisitionOrder[i]); if ((Object)(object)itemDef == (Object)(object)ItemHelpers.ITHealthScaling || (Object)(object)itemDef == (Object)(object)Items.Bear || (Object)(object)itemDef == (Object)(object)Items.ExtraLife || (Object)(object)itemDef == (Object)(object)Items.ExtraLifeVoid) { self.enemyInventory.GiveItem(itemDef, 1); } else { self.enemyInventory.GiveItem(itemDef, self.enemyInventory.GetItemCount(self.enemyInventory.itemAcquisitionOrder[i]) * 4); } } break; } } if (NetworkServer.active) { if (WConfig.cfgSimuMoreGold.Value) { CombatDirector component5 = self.waveInstance.GetComponent<CombatDirector>(); component5.goldRewardCoefficient *= (float)((Run)self).participatingPlayerCount; CombatDirector component6 = self.waveInstance.GetComponent<CombatDirector>(); component6.goldRewardCoefficient *= Mathf.Max(0.75f, 1.5f - 0.5f * (float)(self.waveIndex / 20)); } if (self.waveIndex % 5 == 0) { for (int k = 0; k < PlayerCharacterMasterController.instances.Count; k++) { CharacterBody body = PlayerCharacterMasterController.instances[k].body; if (!Object.op_Implicit((Object)(object)body)) { continue; } CharacterMaster master = PlayerCharacterMasterController.instances[k].master; if (Object.op_Implicit((Object)(object)master)) { int itemCount = master.inventory.GetItemCount(Items.WardOnLevel); if (itemCount > 0) { GameObject val = Object.Instantiate<GameObject>(LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/WarbannerWard"), body.transform.position, Quaternion.identity); val.GetComponent<TeamFilter>().teamIndex = (TeamIndex)1; val.GetComponent<BuffWard>().Networkradius = 8f + 8f * (float)itemCount; NetworkServer.Spawn(val); } } } } } } ((Component)self).GetComponent<EnemyInfoPanelInventoryProvider>().MarkAsDirty(); if (self.waveIndex < 11) { if (self.waveIndex == 5) { component2.baseCredits -= 100f; component2.immediateCreditsFraction -= 0.1f; component2.wavePeriodSeconds += 5f; } if (self.waveIndex == 10) { component2.baseCredits -= 50f; } } if (WConfig.cfgExtraDifficuly.Value) { component.eliteBias = Mathf.Min(component.eliteBias - (float)self.waveIndex / 100f, component.eliteBias); component.eliteBias = Mathf.Max(component.eliteBias, 0.5f); float num = 1f + (float)(self.waveIndex - 1) * 2f / 100f; if (num > 3f) { num = 3f; } component2.immediateCreditsFraction *= num; } if (WConfig.cfgFasterWavesLater.Value) { if (self.waveIndex % 5 == 0) { if (WConfig.cfgAwaitTravel.Value) { component2.secondsAfterWave = 0; } else { int participatingPlayerCount = Run.instance.participatingPlayerCount; if (participatingPlayerCount > 1) { component2.secondsAfterWave += 1 + participatingPlayerCount; } else { component2.secondsAfterWave++; } } } else { component2.secondsAfterWave = Mathf.Max(component2.secondsAfterWave - self.waveIndex / 10, 5); } if (self.waveIndex < 11) { component2.maxSquadSize = 15; } else if (self.waveIndex > 20) { component2.wavePeriodSeconds *= 0.9f; } else if (self.waveIndex > 40) { component2.wavePeriodSeconds *= 0.8f; } else if (self.waveIndex > 60) { component2.wavePeriodSeconds *= 0.6f; } } if (RunArtifactManager.instance.IsArtifactEnabled(Artifacts.swarmsArtifactDef)) { component2.maxSquadSize += 10; } if (component2.immediateCreditsFraction < 0f) { component2.immediateCreditsFraction = 0f; } Debug.Log((object)(self.waveIndex + " immediateCreditsFraction: " + component2.immediateCreditsFraction + " eliteBias: " + component.eliteBias + " wavePeriodSeconds: " + component2.wavePeriodSeconds)); Hooks_Other.LastWaveHolder component7 = ((Component)self).gameObject.GetComponent<Hooks_Other.LastWaveHolder>(); component7.LatestWave = component2.overlayEntries[1].prefab; } public static void InfiniteTowerRun_CleanUpCurrentWave(orig_CleanUpCurrentWave orig, InfiniteTowerRun self) { //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active && Object.op_Implicit((Object)(object)self.waveInstance)) { string name = ((Object)self.waveInstance).name; string text = name; if (!(text == "InfiniteTowerWaveHeresy(Clone)")) { if (text == "InfiniteTowerWaveManyItems(Clone)") { for (int i = 0; i < self.enemyInventory.itemAcquisitionOrder.Count; i++) { ItemDef itemDef = ItemCatalog.GetItemDef(self.enemyInventory.itemAcquisitionOrder[i]); if ((Object)(object)itemDef == (Object)(object)ItemHelpers.ITHealthScaling || (Object)(object)itemDef == (Object)(object)Items.Bear || (Object)(object)itemDef == (Object)(object)Items.ExtraLife || (Object)(object)itemDef == (Object)(object)Items.ExtraLifeVoid) { self.enemyInventory.RemoveItem(itemDef, 1); } else { self.enemyInventory.RemoveItem(itemDef, (int)((float)self.enemyInventory.GetItemCount(self.enemyInventory.itemAcquisitionOrder[i]) / 5f * 4f)); } } } } else { if (self.enemyInventory.GetItemCount(ItemHelpers.ITDamageDown) > 10) { self.enemyInventory.RemoveItem(Items.LunarPrimaryReplacement, 1); } else { self.enemyInventory.RemoveItem(Items.LunarSecondaryReplacement, 1); self.enemyInventory.RemoveItem(Items.LunarUtilityReplacement, 1); } self.enemyInventory.RemoveItem(ItemHelpers.ITDamageDown, self.enemyInventory.GetItemCount(ItemHelpers.ITDamageDown)); self.enemyInventory.RemoveItem(ItemHelpers.ITAttackSpeedDown, self.enemyInventory.GetItemCount(ItemHelpers.ITAttackSpeedDown)); self.enemyInventory.RemoveItem(ItemHelpers.ITCooldownUp, self.enemyInventory.GetItemCount(ItemHelpers.ITCooldownUp)); self.enemyInventory.RemoveItem(Items.BoostHp, self.enemyInventory.GetItemCount(Items.BoostHp)); } if (Object.op_Implicit((Object)(object)Run.instance)) { ((Component)Run.instance).GetComponent<EnemyInfoPanelInventoryProvider>().MarkAsDirty(); } } orig.Invoke(self); Debug.Log((object)("WaveCleanUp " + (object)self.waveInstance)); } private static void InfiniteTowerWaveController_OnCombatSquadMemberDiscovered(orig_OnCombatSquadMemberDiscovered orig, InfiniteTowerWaveController self, CharacterMaster master) { //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Invalid comparison between Unknown and I4 //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Invalid comparison between Unknown and I4 //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Invalid comparison between Unknown and I4 orig.Invoke(self, master); if (!Object.op_Implicit((Object)(object)master.inventory)) { return; } int itemCount = mast