Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Wetland Downpour v1.1.2
WetlandCool.dll
Decompiled 6 hours agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EnemiesReturns.Configuration; using EnemiesReturns.Configuration.LynxTribe; using EnemiesReturns.Enemies.ArcherBug; using EnemiesReturns.Enemies.LynxTribe.Scout; using EnemiesReturns.Enemies.LynxTribe.Shaman; using EnemiesReturns.Enemies.LynxTribe.Totem; using EnemiesReturns.Enemies.Spitter; using FSCStage.Content; using HG; using HG.Reflection; using MSU.Config; using On.RoR2; using R2API; using RoR2; using RoR2.ContentManagement; using RoR2BepInExPack.GameAssetPathsBetter; using SS2; using ShaderSwapper; using SwampMiniboss; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: OptIn] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] public class BakeRoachesYum : MonoBehaviour { } public class ReplaceShaders : MonoBehaviour { } public class GravityZone : MonoBehaviour { private List<CharacterBody> characterBodies = new List<CharacterBody>(); public float gravityCoefficient; public void OnTriggerEnter(Collider other) { CharacterBody component = ((Component)other).GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component) && !characterBodies.Contains(component) && (Object)(object)component.characterMotor != (Object)null && component.characterMotor.useGravity) { characterBodies.Add(component); } } public void OnTriggerStay(Collider other) { CharacterBody component = ((Component)other).GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component) && !characterBodies.Contains(component) && (Object)(object)component.characterMotor != (Object)null && component.characterMotor.useGravity) { characterBodies.Add(component); } } public void OnTriggerExit(Collider other) { CharacterBody component = ((Component)other).GetComponent<CharacterBody>(); if (characterBodies.Contains(component)) { characterBodies.Remove(component); } } private void FixedUpdate() { //IL_0061: Unknown result type (might be due to invalid IL or missing references) foreach (CharacterBody characterBody in characterBodies) { bool flag = characterBody.HasBuff(Buffs.KnockBackActiveWindow) || characterBody.HasBuff(Buffs.KnockUpHitEnemies) || characterBody.HasBuff(Buffs.KnockUpHitEnemiesJuggleCount); if (!characterBody.characterMotor.isGrounded && !flag) { characterBody.characterMotor.velocity.y += (0f - Physics.gravity.y) * gravityCoefficient * Time.fixedDeltaTime; } } } } namespace FSCStage { internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } public class IsStarstorm2 { private static bool? _enabled; public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("com.TeamMoonstorm.MSU") && Chainloader.PluginInfos.ContainsKey("com.TeamMoonstorm"); } return _enabled.Value; } } } public class IsEnemiesReturns { private static bool? _enabled; public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("com.Viliger.EnemiesReturns"); } return _enabled.Value; } } } public class IsSwampMiniboss { private static bool? _enabled; public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("com.rob.SwampMiniboss"); } return _enabled.Value; } } } public class EnemiesReturnsCompat { public static void AddEnemies() { //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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_0049: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_009f: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: 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_00fe: Expected O, but got Unknown //IL_00fe: 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_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //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_0147: Expected O, but got Unknown //IL_0154: Expected O, but got Unknown //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Expected O, but got Unknown //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Expected O, but got Unknown //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Expected O, but got Unknown //IL_0278: Expected O, but got Unknown //IL_0192: 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_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Expected O, but got Unknown //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Expected O, but got Unknown //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Expected O, but got Unknown //IL_01fd: Expected O, but got Unknown //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Expected O, but got Unknown //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Expected O, but got Unknown //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Expected O, but got Unknown //IL_0323: Expected O, but got Unknown if (FSCStage.toggleLynxTotem.Value && General.EnableLynxTotem.Value && !LynxTotem.DefaultStageList.Value.Contains("foggyswampdownpour")) { DirectorCard card = new DirectorCard { spawnCard = (SpawnCard)SpawnCards.cscLynxTotemDefault, spawnDistance = (MonsterSpawnDistance)0, selectionWeight = LynxTotem.SelectionWeight.Value, minimumStageCompletions = LynxTotem.MinimumStageCompletion.Value }; DirectorCardHolder val = new DirectorCardHolder { Card = card, MonsterCategory = (MonsterCategory)4 }; Helpers.AddNewMonsterToStage(val, false, (Stage)1, "foggyswampdownpour"); Helpers.AddNewMonsterToStage(val, false, (Stage)1, "itfoggyswampdownpour"); Log.Info("Lynx Totem added to foggyswampdownpour's spawn pool."); } if (FSCStage.toggleLynxScout.Value && (General.EnableLynxTotem.Value || General.EnableLynxShaman.Value) && !LynxScout.DefaultStageList.Value.Contains("foggyswampdownpour")) { DirectorCard card2 = new DirectorCard { spawnCard = (SpawnCard)SpawnCards.cscLynxScoutDefault, spawnDistance = (MonsterSpawnDistance)0, selectionWeight = LynxScout.SelectionWeight.Value, minimumStageCompletions = LynxScout.MinimumStageCompletion.Value }; DirectorCardHolder val2 = new DirectorCardHolder { Card = card2, MonsterCategory = (MonsterCategory)2 }; Helpers.AddNewMonsterToStage(val2, false, (Stage)1, "foggyswampdownpour"); Helpers.AddNewMonsterToStage(val2, false, (Stage)1, "itfoggyswampdownpour"); Log.Info("Lynx Scout added to foggyswampdownpour's spawn pool."); } if (FSCStage.toggleLynxShaman.Value && General.EnableLynxShaman.Value && !LynxShaman.DefaultStageList.Value.Contains("foggyswampdownpour")) { DirectorCard card3 = new DirectorCard { spawnCard = (SpawnCard)SpawnCards.cscLynxShamanDefault, spawnDistance = (MonsterSpawnDistance)0, selectionWeight = LynxShaman.SelectionWeight.Value, minimumStageCompletions = LynxShaman.MinimumStageCompletion.Value }; DirectorCardHolder val3 = new DirectorCardHolder { Card = card3, MonsterCategory = (MonsterCategory)2 }; Helpers.AddNewMonsterToStage(val3, false, (Stage)1, "foggyswampdownpour"); Helpers.AddNewMonsterToStage(val3, false, (Stage)1, "itfoggyswampdownpour"); Log.Info("Lynx Shaman added to foggyswampdownpour's spawn pool."); } if (FSCStage.toggleArcherBugER.Value && General.EnableArcherBug.Value) { DirectorCard card4 = new DirectorCard { spawnCard = (SpawnCard)SpawnCards.cscArcherBugJungle, spawnDistance = (MonsterSpawnDistance)0, selectionWeight = 1, minimumStageCompletions = 5 }; DirectorCardHolder val4 = new DirectorCardHolder { Card = card4, MonsterCategory = (MonsterCategory)2 }; Helpers.AddNewMonsterToStage(val4, false, (Stage)1, "foggyswampdownpour"); Helpers.AddNewMonsterToStage(val4, false, (Stage)1, "itfoggyswampdownpour"); Log.Info("Archer Bug (EnemiesReturns) added to foggyswampdownpour's spawn pool."); } if (FSCStage.toggleSpitter.Value && General.EnableSpitter.Value && !Spitter.DefaultStageList.Value.Contains("foggyswampdownpour")) { DirectorCard card5 = new DirectorCard { spawnCard = (SpawnCard)SpawnCards.cscSpitterDefault, spawnDistance = (MonsterSpawnDistance)0, selectionWeight = Spitter.SelectionWeight.Value, minimumStageCompletions = Spitter.MinimumStageCompletion.Value }; DirectorCardHolder val5 = new DirectorCardHolder { Card = card5, MonsterCategory = (MonsterCategory)3 }; Helpers.AddNewMonsterToStage(val5, false, (Stage)1, "foggyswampdownpour"); Helpers.AddNewMonsterToStage(val5, false, (Stage)1, "itfoggyswampdownpour"); Log.Info("Spitter added to foggyswampdownpour's spawn pool."); } } } public class Starstorm2Compat { public static string FindEnemyConfig(string monsterName) { string text = "00 - Enemy Disabling.Disable Enemy: " + monsterName; ConfigEntryBase[] configEntries = SS2Config.ConfigMonster.GetConfigEntries(); foreach (ConfigEntryBase val in configEntries) { if (((object)val.Definition).ToString() == text) { return val.GetSerializedValue(); } } return "false"; } public static void AddEnemies() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //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_006b: Expected O, but got Unknown //IL_0078: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Expected O, but got Unknown //IL_00fa: Expected O, but got Unknown //IL_0139: 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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: 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_0167: Expected O, but got Unknown //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Expected O, but got Unknown //IL_0196: Expected O, but got Unknown string text = FindEnemyConfig("Lamp Boss"); if (FSCStage.toggleWayfarer.Value && text == "false") { DirectorCard card = new DirectorCard { spawnCard = SS2Assets.LoadAsset<SpawnCard>("scLampBoss", (SS2Bundle)17), spawnDistance = (MonsterSpawnDistance)0, selectionWeight = 1 }; DirectorCardHolder val = new DirectorCardHolder { Card = card, MonsterCategory = (MonsterCategory)4 }; Helpers.AddNewMonsterToStage(val, false, (Stage)1, "foggyswampdownpour"); Helpers.AddNewMonsterToStage(val, false, (Stage)1, "itfoggyswampdownpour"); Log.Info("Wayfarer added to foggyswampdownpour's spawn pool."); } string text2 = FindEnemyConfig("Lamp"); if (FSCStage.toggleFollower.Value && text2 == "false") { DirectorCard card2 = new DirectorCard { spawnCard = SS2Assets.LoadAsset<SpawnCard>("scLamp", (SS2Bundle)17), spawnDistance = (MonsterSpawnDistance)2, selectionWeight = 2 }; DirectorCardHolder val2 = new DirectorCardHolder { Card = card2, MonsterCategory = (MonsterCategory)2 }; Helpers.AddNewMonsterToStage(val2, false, (Stage)1, "foggyswampdownpour"); Helpers.AddNewMonsterToStage(val2, false, (Stage)1, "itfoggyswampdownpour"); Log.Info("Follower added to foggyswampdownpour's spawn pool."); } if (((ConfiguredVariable<bool>)(object)SS2Config.enableBeta).value) { string text3 = FindEnemyConfig("Acid Bug"); if (FSCStage.toggleAcidBug.Value && text3 == "false") { DirectorCard card3 = new DirectorCard { spawnCard = SS2Assets.LoadAsset<SpawnCard>("cscAcidBug", (SS2Bundle)17), spawnDistance = (MonsterSpawnDistance)0, selectionWeight = 2, minimumStageCompletions = 5 }; DirectorCardHolder val3 = new DirectorCardHolder { Card = card3, MonsterCategory = (MonsterCategory)2 }; Helpers.AddNewMonsterToStage(val3, false, (Stage)1, "foggyswampdownpour"); Helpers.AddNewMonsterToStage(val3, false, (Stage)1, "itfoggyswampdownpour"); Log.Info("Archer Bug (Starstorm 2) added to foggyswampdownpour's spawn pool."); } } } } public class SwampMinibossCompat { private static Vector3 foggySwampSpawn; private static Vector3 downpourSpawn = new Vector3(-900f, 73f, -2162f); public static void GetFoggySwampSpawnPoint() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) foggySwampSpawn = Plugin.spawnPoint; } public static void SetSpawnPointValue(string sceneName) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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) switch (sceneName) { case "foggyswamp": Plugin.spawnPoint = foggySwampSpawn; break; case "foggyswampdownpour": case "itfoggyswampdownpour": Plugin.spawnPoint = downpourSpawn; break; } } } [BepInPlugin("wormsworms.WetlandDownpour", "WetlandDownpour", "1.1.1")] public class FSCStage : BaseUnityPlugin { public const string Author = "wormsworms"; public const string Name = "WetlandDownpour"; public const string Version = "1.1.1"; public const string GUID = "wormsworms.WetlandDownpour"; public static FSCStage instance; public static ConfigEntry<bool> loopVariant; public static ConfigEntry<bool> replaceFoggyswamp; public static ConfigEntry<bool> regularEnabled; public static ConfigEntry<bool> waterMuffle; public static ConfigEntry<bool> simulacrumEnabled; public static ConfigEntry<bool> simulacrumStage1; public static ConfigEntry<bool> toggleWayfarer; public static ConfigEntry<bool> toggleFollower; public static ConfigEntry<bool> toggleAcidBug; public static ConfigEntry<bool> toggleLynxTotem; public static ConfigEntry<bool> toggleLynxScout; public static ConfigEntry<bool> toggleLynxShaman; public static ConfigEntry<bool> toggleSpitter; public static ConfigEntry<bool> toggleArcherBugER; private void Awake() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown instance = this; Log.Init(((BaseUnityPlugin)this).Logger); ConfigSetup(); ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(GiveToRoR2OurContentPackProviders); Language.collectLanguageRootFolders += CollectLanguageRootFolders; Run.onRunStartGlobal += InitializeBazaarSeerValues; RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(OnLoad)); SceneManager.sceneLoaded += SceneSetup; } public static void OnLoad() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //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) if (IsStarstorm2.enabled) { Starstorm2Compat.AddEnemies(); } if (IsEnemiesReturns.enabled) { EnemiesReturnsCompat.AddEnemies(); } if (IsSwampMiniboss.enabled) { SwampMinibossCompat.GetFoggySwampSpawnPoint(); } SceneCollection sceneCollection = Addressables.LoadAssetAsync<SceneCollection>((object)RoR2_Base_SceneGroups.sgStage2_asset).WaitForCompletion(); SceneCollection sceneCollection2 = Addressables.LoadAssetAsync<SceneCollection>((object)RoR2_Base_SceneGroups.loopSgStage2_asset).WaitForCompletion(); SceneDef sceneDefFromSceneName = SceneCatalog.GetSceneDefFromSceneName("foggyswamp"); if (regularEnabled.Value) { if (loopVariant.Value && !replaceFoggyswamp.Value) { FSCContent.SetSceneWeight(sceneDefFromSceneName, 1f, sceneCollection); FSCContent.SetSceneWeight(sceneDefFromSceneName, 0f, sceneCollection2); SceneCatalog.GetSceneDefFromSceneName("foggyswamp").loopedSceneDef = SceneCatalog.GetSceneDefFromSceneName("foggyswampdownpour"); Log.Debug("Wetland Downpour registered (replace Wetland Aspect after looping)"); } else if (replaceFoggyswamp.Value) { FSCContent.SetSceneWeight(sceneDefFromSceneName, 0f, sceneCollection); FSCContent.SetSceneWeight(sceneDefFromSceneName, 0f, sceneCollection2); sceneDefFromSceneName.filterOutOfBazaar = true; Log.Debug("Wetland Downpour registered (always replace Wetland Aspect)"); } else { FSCContent.SetSceneWeight(sceneDefFromSceneName, 0.5f, sceneCollection); FSCContent.SetSceneWeight(sceneDefFromSceneName, 0.5f, sceneCollection2); Log.Debug("Wetland Downpour registered (both Downpour and Aspect always in stage rotation. Weights for Aspect and Downpour halved)"); } } } public void InitializeBazaarSeerValues(Run run) { if (loopVariant.Value && !replaceFoggyswamp.Value) { SceneCatalog.GetSceneDefFromSceneName("foggyswamp").filterOutOfBazaar = false; SceneCatalog.GetSceneDefFromSceneName("foggyswampdownpour").filterOutOfBazaar = true; } else if (replaceFoggyswamp.Value) { SceneCatalog.GetSceneDefFromSceneName("foggyswamp").filterOutOfBazaar = true; SceneCatalog.GetSceneDefFromSceneName("foggyswampdownpour").filterOutOfBazaar = false; } } public void SceneSetup(Scene newScene, LoadSceneMode loadSceneMode) { //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: 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) if (regularEnabled.Value && loopVariant.Value && !replaceFoggyswamp.Value && Object.op_Implicit((Object)(object)Run.instance) && Run.instance.stageClearCount == 5 && !SceneCatalog.GetSceneDefFromSceneName("foggyswamp").filterOutOfBazaar) { SceneCatalog.GetSceneDefFromSceneName("foggyswamp").filterOutOfBazaar = true; SceneCatalog.GetSceneDefFromSceneName("foggyswampdownpour").filterOutOfBazaar = false; Log.Debug("Bazaar filter values for foggyswamp and foggyswampdownpour swapped"); } if (IsSwampMiniboss.enabled) { SwampMinibossCompat.SetSpawnPointValue(((Scene)(ref newScene)).name); if (((Scene)(ref newScene)).name == "foggyswampdownpour" || ((Scene)(ref newScene)).name == "itfoggyswampdownpour") { GameObject gameObject = ((Component)GameObject.Find("HOLDER: Altar Skeleton/Skeleton").transform.GetChild(0)).gameObject; Object.Destroy((Object)gameObject.GetComponent<GameObjectUnlockableFilter>()); gameObject.SetActive(true); } } if (((Scene)(ref newScene)).name == "foggyswampdownpour") { GameObject obj = GameObject.Find("SceneInfo/Ambience"); AkBank component = obj.GetComponent<AkBank>(); AkAmbient[] components = obj.GetComponents<AkAmbient>(); AkAmbient val = components[0]; AkAmbient val2 = components[1]; if (Object.op_Implicit((Object)(object)component)) { WwiseBankReference wwiseObjectReference = Addressables.LoadAssetAsync<WwiseBankReference>((object)"Wwise/CD00105A-AA3B-43F5-882A-C29812E886C8.asset").WaitForCompletion(); WwiseEventReference wwiseObjectReference2 = Addressables.LoadAssetAsync<WwiseEventReference>((object)"Wwise/7B5141F8-EB05-455E-92EF-46A479D8612C.asset").WaitForCompletion(); WwiseEventReference wwiseObjectReference3 = Addressables.LoadAssetAsync<WwiseEventReference>((object)"Wwise/6F2ADD1C-BD55-431F-A62F-80CCD5F9631D.asset").WaitForCompletion(); component.data.WwiseObjectReference = wwiseObjectReference; ((AkEvent)val).data.WwiseObjectReference = wwiseObjectReference2; ((AkEvent)val2).data.WwiseObjectReference = wwiseObjectReference3; } } if (((Scene)(ref newScene)).name == "itfoggyswampdownpour") { MeshRenderer val3 = default(MeshRenderer); GameObject.Find("FSFloor/SubMesh_0").TryGetComponent<MeshRenderer>(ref val3); Material material = ((Renderer)val3).material; Material val4 = Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/GameModes/InfiniteTowerRun/ITAssets/matInfiniteTowerBooleanEffect1.mat").WaitForCompletion(); Material[] array = (Material[])(object)new Material[2] { material, val4 }; RendererSetMaterialsExtension.SetSharedMaterials((Renderer)(object)val3, array, 2); } } private void Destroy() { Language.collectLanguageRootFolders -= CollectLanguageRootFolders; } private static void GiveToRoR2OurContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)new ContentProvider()); } public void CollectLanguageRootFolders(List<string> folders) { folders.Add(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "Language")); folders.Add(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "Plugins/Language")); } private void ConfigSetup() { loopVariant = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "Post-Loop Variant", true, "If true, Wetland Downpour behaves like a vanilla loop variant, entirely replacing Wetland Aspect after looping. If false, it does not replace Wetland Aspect and it can appear before or after looping, like a normal stage."); replaceFoggyswamp = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "Replace Wetland Aspect", false, "If true, Wetland Downpour will always replace Wetland Aspect, before and after looping, regardless of what value Loop Variant is set to."); regularEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "Enable Wetland Downpour", true, "If true, Wetland Downpour can appear in regular runs."); waterMuffle = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings", "Underwater Music Muffling", true, "If true, music will get muffled while the camera is underwater in Wetland Downpour."); simulacrumEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings - Simulacrum", "Enable Simulacrum Variant", true, "If true, Wetland Downpour can appear in the Simulacrum."); simulacrumStage1 = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings - Simulacrum", "Enable on Stage 1", true, "If true, Wetland Downpour can appear as the first stage in the Simulacrum. If false, it can only appear on stage 2 or higher, like Commencement."); toggleWayfarer = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings - Starstorm 2", "Wayfarer", true, "If true, Wayfarers can appear in Wetland Downpour."); toggleFollower = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings - Starstorm 2", "Follower", true, "If true, Followers can appear in Wetland Downpour."); toggleAcidBug = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings - Starstorm 2", "Archer Bug", true, "If true, Archer Bugs can appear in Wetland Downpour (after clearing 5 stages)."); toggleLynxTotem = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings - EnemiesReturns", "Lynx Totem", true, "If true, Lynx Totems can appear in Wetland Downpour."); toggleLynxScout = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings - EnemiesReturns", "Lynx Scout", true, "If true, Lynx Scouts can appear in Wetland Downpour."); toggleLynxShaman = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings - EnemiesReturns", "Lynx Shaman", false, "If true, Lynx Shamans can appear in Wetland Downpour."); toggleSpitter = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings - EnemiesReturns", "Spitter", true, "If true, Spitters can appear in Wetland Downpour."); toggleArcherBugER = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings - EnemiesReturns", "Archer Bug", false, "If true, Archer Bugs can appear in Wetland Downpour (after clearing 5 stages)."); } } } namespace FSCStage.Content { public class ContentProvider : IContentPackProvider { private readonly ContentPack _contentPack = new ContentPack(); public static string assetDirectory; public string identifier => "wormsworms.WetlandDownpour.ContentProvider"; public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { _contentPack.identifier = identifier; string assetsFolderFullPath = (assetDirectory = Path.GetDirectoryName(typeof(ContentProvider).Assembly.Location)); AssetBundle scenesAssetBundle = null; yield return LoadAssetBundle(Path.Combine(assetsFolderFullPath, "wetlanddownpourscenes"), args.progressReceiver, delegate(AssetBundle assetBundle) { scenesAssetBundle = assetBundle; }); AssetBundle assetsAssetBundle = null; yield return LoadAssetBundle(Path.Combine(assetsFolderFullPath, "wetlanddownpourassets"), args.progressReceiver, delegate(AssetBundle assetBundle) { assetsAssetBundle = assetBundle; }); yield return FSCContent.LoadAssetBundlesAsync(scenesAssetBundle, assetsAssetBundle, args.progressReceiver, _contentPack); } private IEnumerator LoadAssetBundle(string assetBundleFullPath, IProgress<float> progress, Action<AssetBundle> onAssetBundleLoaded) { AssetBundleCreateRequest assetBundleCreateRequest = AssetBundle.LoadFromFileAsync(assetBundleFullPath); while (!((AsyncOperation)assetBundleCreateRequest).isDone) { progress.Report(((AsyncOperation)assetBundleCreateRequest).progress); yield return null; } onAssetBundleLoaded(assetBundleCreateRequest.assetBundle); } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(_contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } } public static class Simulacrum { public static void RegisterSceneToSimulacrum(SceneDef sceneDef, bool canBeStage1 = true, float weight = 1f) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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: 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_0087: Unknown result type (might be due to invalid IL or missing references) SceneCollection val = Addressables.LoadAssetAsync<SceneCollection>((object)"RoR2/DLC1/GameModes/InfiniteTowerRun/SceneGroups/sgInfiniteTowerStageX.asset").WaitForCompletion(); SceneCollection val2 = Addressables.LoadAssetAsync<SceneCollection>((object)"RoR2/DLC1/GameModes/InfiniteTowerRun/SceneGroups/sgInfiniteTowerStage1.asset").WaitForCompletion(); List<SceneCollection> list = new List<SceneCollection>(); Enumerator<SceneEntry> enumerator = val.sceneEntries.GetEnumerator(); try { while (enumerator.MoveNext()) { SceneEntry current = enumerator.Current; if ((Object)(object)current.sceneDef == (Object)(object)sceneDef) { Log.Error("SceneDef " + sceneDef.cachedName + " is already registered into the Simulacrum"); return; } if (current.sceneDef.hasAnyDestinations) { list.Add(current.sceneDef.destinationsGroup); } } } finally { ((IDisposable)enumerator).Dispose(); } SceneCollection val3 = ScriptableObject.CreateInstance<SceneCollection>(); ((Object)val3).name = "sgInfiniteTowerStageX" + sceneDef.cachedName; val3._sceneEntries = val._sceneEntries; sceneDef.destinationsGroup = val3; SceneEntry val4 = default(SceneEntry); val4.sceneDef = sceneDef; val4.weightMinusOne = weight - 1f; SceneEntry val5 = val4; ArrayUtils.ArrayAppend<SceneEntry>(ref val._sceneEntries, ref val5); if (canBeStage1) { ArrayUtils.ArrayAppend<SceneEntry>(ref val2._sceneEntries, ref val5); } foreach (SceneCollection item in list) { ArrayUtils.ArrayAppend<SceneEntry>(ref item._sceneEntries, ref val5); } } } public class AudioMuffleZone : MonoBehaviour { private void OnEnable() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown if (FSCStage.waterMuffle.Value) { MusicController.RecalculateHealth += new hook_RecalculateHealth(MusicController_RecalculateHealth); } } private void OnDisable() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown if (FSCStage.waterMuffle.Value) { MusicController.RecalculateHealth -= new hook_RecalculateHealth(MusicController_RecalculateHealth); } } public static bool IsInsideCollider(Collider collider, Vector3 position) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) Bounds bounds = collider.bounds; return ((Bounds)(ref bounds)).Contains(position); } private void MusicController_RecalculateHealth(orig_RecalculateHealth orig, MusicController self, GameObject playerObject) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, playerObject); if (Object.op_Implicit((Object)(object)self.targetCamera) && IsInsideCollider((Collider)(object)((Component)this).gameObject.GetComponent<BoxCollider>(), ((Component)self.targetCamera).transform.localPosition)) { self.rtpcPlayerHealthValue.value -= 100f; self.rtpcPlayerHealthValue.value = Mathf.Max(self.rtpcEnemyValue.value, -100f); } } } public static class FSCContent { internal const string ScenesAssetBundleFileName = "wetlanddownpourscenes"; internal const string AssetsAssetBundleFileName = "wetlanddownpourassets"; private static AssetBundle _scenesAssetBundle; private static AssetBundle _assetsAssetBundle; internal static UnlockableDef[] UnlockableDefs; internal static SceneDef[] SceneDefs; internal static SceneDef FSCSceneDef; internal static Sprite FSCSceneDefPreviewSprite; internal static Material FSCBazaarSeer; internal static SceneDef SimuSceneDef; internal static Sprite SimuSceneDefPreviewSprite; internal static Material SimuBazaarSeer; public static List<Material> SwappedMaterials = new List<Material>(); internal static IEnumerator LoadAssetBundlesAsync(AssetBundle scenesAssetBundle, AssetBundle assetsAssetBundle, IProgress<float> progress, ContentPack contentPack) { _scenesAssetBundle = scenesAssetBundle; _assetsAssetBundle = assetsAssetBundle; IEnumerator upgradeStubbedShaders = ShaderSwapper.UpgradeStubbedShadersAsync(_assetsAssetBundle); while (upgradeStubbedShaders.MoveNext()) { yield return upgradeStubbedShaders.Current; } yield return LoadAllAssetsAsync<UnlockableDef>(assetsAssetBundle, progress, (Action<UnlockableDef[]>)delegate(UnlockableDef[] assets) { contentPack.unlockableDefs.Add(assets); }); yield return LoadAllAssetsAsync<Sprite>(_assetsAssetBundle, progress, (Action<Sprite[]>)delegate(Sprite[] assets) { FSCSceneDefPreviewSprite = assets.First((Sprite a) => ((Object)a).name == "texFSCScenePreview"); SimuSceneDefPreviewSprite = assets.First((Sprite a) => ((Object)a).name == "texFSCScenePreview"); }); yield return LoadAllAssetsAsync<SceneDef>(_assetsAssetBundle, progress, (Action<SceneDef[]>)delegate(SceneDef[] assets) { SceneDefs = assets; FSCSceneDef = SceneDefs.First((SceneDef sd) => sd.baseSceneNameOverride == "foggyswampdownpour"); SimuSceneDef = SceneDefs.First((SceneDef sd) => sd.baseSceneNameOverride == "itfoggyswampdownpour"); Log.Debug(FSCSceneDef.nameToken); Log.Debug(SimuSceneDef.nameToken); contentPack.sceneDefs.Add(assets); }); FSCSceneDef.portalMaterial = StageRegistration.MakeBazaarSeerMaterial((Texture2D)FSCSceneDef.previewTexture); SimuSceneDef.portalMaterial = StageRegistration.MakeBazaarSeerMaterial((Texture2D)FSCSceneDef.previewTexture); AsyncOperationHandle<MusicTrackDef> mainTrackDefRequest = Addressables.LoadAssetAsync<MusicTrackDef>((object)"RoR2/Base/Common/MusicTrackDefs/muFULLSong06.asset"); while (!mainTrackDefRequest.IsDone) { yield return null; } AsyncOperationHandle<MusicTrackDef> bossTrackDefRequest = Addressables.LoadAssetAsync<MusicTrackDef>((object)"RoR2/Base/Common/MusicTrackDefs/muSong22.asset"); while (!bossTrackDefRequest.IsDone) { yield return null; } FSCSceneDef.mainTrack = mainTrackDefRequest.Result; FSCSceneDef.bossTrack = bossTrackDefRequest.Result; SimuSceneDef.mainTrack = mainTrackDefRequest.Result; SimuSceneDef.bossTrack = bossTrackDefRequest.Result; if (FSCStage.regularEnabled.Value) { if (FSCStage.loopVariant.Value && !FSCStage.replaceFoggyswamp.Value) { StageRegistration.RegisterSceneDefToNormalProgression(FSCSceneDef, 1f, false, true); } else if (FSCStage.replaceFoggyswamp.Value) { StageRegistration.RegisterSceneDefToNormalProgression(FSCSceneDef, 1f, true, true); } else { StageRegistration.RegisterSceneDefToNormalProgression(FSCSceneDef, 0.5f, true, true); } } if (FSCStage.simulacrumEnabled.Value && FSCStage.simulacrumStage1.Value) { Simulacrum.RegisterSceneToSimulacrum(SimuSceneDef); } else if (FSCStage.simulacrumEnabled.Value && !FSCStage.simulacrumStage1.Value) { Simulacrum.RegisterSceneToSimulacrum(SimuSceneDef, canBeStage1: false); } } public static void SetSceneWeight(SceneDef scene, float weight, SceneCollection _sceneCollection) { if (!Object.op_Implicit((Object)(object)scene)) { return; } for (int i = 0; i < _sceneCollection._sceneEntries.Length; i++) { ref SceneEntry reference = ref _sceneCollection._sceneEntries[i]; if ((Object)(object)reference.sceneDef == (Object)(object)scene) { Log.Debug($"Updating {scene} weight in {_sceneCollection}: {((SceneEntry)(ref reference)).weight}->{weight}"); ((SceneEntry)(ref reference)).weight = weight; } } Log.Warning($"Failed to find '{scene}' in {_sceneCollection}"); } internal static void Unload() { _assetsAssetBundle.Unload(true); _scenesAssetBundle.Unload(true); } private static IEnumerator LoadAllAssetsAsync<T>(AssetBundle assetBundle, IProgress<float> progress, Action<T[]> onAssetsLoaded) where T : Object { AssetBundleRequest sceneDefsRequest = assetBundle.LoadAllAssetsAsync<T>(); while (!((AsyncOperation)sceneDefsRequest).isDone) { progress.Report(((AsyncOperation)sceneDefsRequest).progress); yield return null; } onAssetsLoaded(sceneDefsRequest.allAssets.Cast<T>().ToArray()); } } }