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 SwanSongExtended v1.0.0
SwanSongExtended.dll
Decompiled an hour ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using BetterSoulCost; using BossDropRework; using EntityStates; using EntityStates.AI; using EntityStates.AI.Walker; using EntityStates.Bandit2; using EntityStates.BrotherMonster; using EntityStates.BrotherMonster.Weapon; using EntityStates.Captain.Weapon; using EntityStates.CaptainSupplyDrop; using EntityStates.GrandParent; using EntityStates.LaserTurbine; using EntityStates.Mage.Weapon; using EntityStates.NullifierMonster; using EntityStates.TeleporterHealNovaController; using EntityStates.VoidRaidCrab; using FabricatorStandalone; using HG; using HG.BlendableTypes; using HG.Reflection; using HarmonyLib; using IL.RoR2; using IL.RoR2.Items; using IL.RoR2.Orbs; using KinematicCharacterController; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using MoreStats; using On.EntityStates; using On.EntityStates.AI.Walker; using On.EntityStates.LaserTurbine; using On.EntityStates.TeleporterHealNovaController; using On.RoR2; using On.RoR2.CharacterAI; using On.RoR2.Items; using On.RoR2.Orbs; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using R2API.Utils; using RainrotSharedUtils; using RainrotSharedUtils.Components; using RainrotSharedUtils.Difficulties; using RainrotSharedUtils.MoreProjectiles; using RainrotSharedUtils.Shelters; using RoR2; using RoR2.Achievements; using RoR2.Artifacts; using RoR2.Audio; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.EntitlementManagement; using RoR2.ExpansionManagement; using RoR2.Hologram; using RoR2.Items; using RoR2.Navigation; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using RoR2BepInExPack.GameAssetPaths; using RoR2BepInExPack.GameAssetPaths.Version_1_39_0; using RoR2BepInExPack.GameAssetPathsBetter; using SwanSongExtended.Artifacts; using SwanSongExtended.Changes; using SwanSongExtended.Characters; using SwanSongExtended.Components; using SwanSongExtended.Elites; using SwanSongExtended.Equipment; using SwanSongExtended.Equipment.Zapinator; using SwanSongExtended.Interactables; using SwanSongExtended.Items; using SwanSongExtended.Modules; using SwanSongExtended.Scavengers; using SwanSongExtended.Skills; using SwanSongExtended.States; using SwanSongExtended.States.AI; using SwanSongExtended.Storms; using ThreeEyedGames; using Unity; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.ResourceManagement.AsyncOperations; using UnityEngine.SceneManagement; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("SwanSongExtended")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("SwanSongExtended")] [assembly: AssemblyTitle("SwanSongExtended")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } } namespace RiskierRainContent.Interactables { internal static class CombatEncounterHelper { public enum CustomDirectorType { GalleryDirector = 1, ConstructDirector } public static GameObject MethodOne(PurchaseInteraction purchaseInteraction, Interactor activator, int credits, CustomDirectorType directorType) { //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_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Expected O, but got Unknown Vector3 val = Vector3.zero; Quaternion rotation = Quaternion.identity; Transform transform = ((Component)purchaseInteraction).gameObject.transform; if (Object.op_Implicit((Object)(object)transform)) { val = transform.position; rotation = transform.rotation; } GameObject val2 = LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/Encounters/MonstersOnShrineUseEncounter"); if ((Object)(object)val2 == (Object)null) { return null; } GameObject val3 = Object.Instantiate<GameObject>(val2, val, Quaternion.identity); NetworkServer.Spawn(val3); CombatDirector component = val3.GetComponent<CombatDirector>(); ParseDirectorType(((Component)component).gameObject, directorType); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)Stage.instance)) { return null; } float num = (float)credits * Stage.instance.entryDifficultyCoefficient; DirectorCard val4 = component.SelectMonsterCardForCombatShrine(num); if (val4 != null) { component.CombatShrineActivation(activator, num, val4); EffectData val5 = new EffectData { origin = val, rotation = rotation }; if (directorType == CustomDirectorType.ConstructDirector) { GameObject val6 = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/MonstersOnShrineUse"); EffectManager.SpawnEffect(val6, val5, true); } } return val3; } public static void ParseDirectorType(GameObject obj, CustomDirectorType value) { switch (value) { case CustomDirectorType.GalleryDirector: obj.AddComponent<GalleryDirector>(); break; case CustomDirectorType.ConstructDirector: obj.AddComponent<ConstructDirector>(); break; default: obj.AddComponent<GalleryDirector>(); break; } } } internal class GalleryDirector : MonoBehaviour { } internal class ConstructDirector : MonoBehaviour { } } namespace SwanSongExtended { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [R2APISubmoduleDependency(new string[] { "LanguageAPI", "PrefabAPI", "RecalculateStatsAPI", "DotAPI", "DifficultyAPI" })] [BepInPlugin("com.RiskOfBrainrot.SwanSongExtended", "SwanSongExtended", "1.0.0")] public class SwanSongPlugin : BaseUnityPlugin { public static int ignitionTankBurnChance = 15; public float ignitionBurnDamage = 2f; public float ignitionBurnDuration = 2f; private bool shouldIgnitionDamageAndDurationCompound = false; public static int stacheBurnChance = 25; public static int brandBurnChance = 30; public const string difficultyToken = "DIFFICULTYSWANSONG"; public static float eclipseDifficultyBoost = 6f; public static DifficultyDef difficultyDefExtinction; public static DifficultyIndex difficultyIndexExtinction; public static string extinctionName = "Extinction"; public static string extinctionDescBase = "For only the determined and truly masochistic.\nThe planet is alive and writhing with unspeakable hatred for what has been done to it. You, the subject of its fury, will be torn asunder and be made unrecognizable. <style=cStack>\n\n>Player Health Regeneration: <style=cArtifact>-40%</style></style> <style=cStack>\n>Difficulty Scaling: <style=cArtifact>+100%</style>"; public static string extinctionDescStartingDifficulty = "<style=cStack>\n>Starting Difficulty: <style=cArtifact>Very Hard</style></style>"; public static string extinctionDescExtra = "\n>Rare Elites: <style=cArtifact>Stage 4</style>\n>Teleporter Visuals: <style=cArtifact>OFF</style>\n>Enemies gain <style=cArtifact>enhanced scaling</style>\n>Enemies gain <style=cArtifact>tripled projectiles</style></style>"; public static string extinctionDesc = extinctionDescBase + extinctionDescStartingDifficulty + extinctionDescExtra; private static List<string> swanSongDeathQuoteTokens = new List<string>(); private static List<string> swanSongStormDeathQuoteTokens = new List<string>(); private static bool boostSpawnRates = true; public const string guid = "com.RiskOfBrainrot.SwanSongExtended"; public const string teamName = "RiskOfBrainrot"; public const string modName = "SwanSongExtended"; public const string version = "1.0.0"; public const string expansionName = "Swan Song"; public const string expansionName2 = "Secrets of the Scug"; public const string expansionToken = "EXPANSION2R4R"; public const string expansionToken2 = "EXPANSIONSOTS"; public const string DEVELOPER_PREFIX = "FRUIT"; public static SwanSongPlugin instance; public static ExpansionDef expansionDefSS2; public static ExpansionDef expansionDefSOTS; public const string iconsPath = ""; private GameObject meatballNapalmPool => CommonAssets.meatballNapalmPool; public static AssetBundle mainAssetBundle => CommonAssets.mainAssetBundle; public static AssetBundle retierAssetBundle => mainAssetBundle; public static bool iabMissilesLoaded => ModLoaded("com.RiskOfBrainrot.IAmBecomeMissiles"); public static bool isAELoaded => ModLoaded("com.Borbo.ArtificerExtended"); public static bool is2R4RLoaded => ModLoaded("com.RiskOfBrainrot.RiskierRain"); public static bool isBossDropLoaded => ModLoaded("com.RiskOfBrainrot.FruityBossDrops"); public static bool isHBULoaded => ModLoaded("com.Borbo.HuntressBuffULTIMATE"); public static bool isScepterLoaded => ModLoaded("com.DestroyedClone.AncientScepter"); public static bool autosprintLoaded => ModLoaded("com.johnedwa.RTAutoSprintEx"); public static bool acridLungeLoaded => ModLoaded("Withor.AcridBiteLunge"); public static bool ucrLoaded => ModLoaded("HIFU.UltimateCustomRun"); public static bool fabricatorsLoaded => ModLoaded("com.RiskOfBrainrot.Fabricators"); internal static event Action onSwanSongLoaded; private void BurnReworks() { IgnitionTankRework(); } private void IgnitionTankRework() { //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 StatHooks.GetMoreStatCoefficients += new MoreStatHookEventHandler(IgniTankBurnChance); StrengthenBurnUtils.CheckDotForUpgrade += new hook_CheckDotForUpgrade(OverrideIgnitionBurn); LanguageAPI.Add("ITEM_STRENGTHENBURN_PICKUP", "Your ignite effects deal triple damage."); LanguageAPI.Add("ITEM_STRENGTHENBURN_DESC", $"Gain <style=cIsDamage>{ignitionTankBurnChance}% ignite chance</style>. " + "All ignition effects deal <style=cIsDamage>+" + Tools.ConvertDecimal(ignitionBurnDamage) + "</style> <style=cStack>(+" + Tools.ConvertDecimal(ignitionBurnDamage) + " per stack)</style> more damage and last <style=cIsUtility>+" + Tools.ConvertDecimal(ignitionBurnDuration) + "</style> <style=cStack>(+" + Tools.ConvertDecimal(ignitionBurnDuration) + " per stack)</style> longer."); } private void IgniTankBurnChance(CharacterBody sender, MoreStatHookEventArgs args) { Inventory inventory = sender.inventory; if (Object.op_Implicit((Object)(object)inventory) && inventory.GetItemCountEffective(Items.StrengthenBurn) > 0) { args.burnChanceOnHit += (float)ignitionTankBurnChance; } } private void OverrideIgnitionBurn(orig_CheckDotForUpgrade orig, Inventory inventory, ref InflictDotInfo dotInfo) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Invalid comparison between Unknown and I4 //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) if ((int)dotInfo.dotIndex != 1 && (int)dotInfo.dotIndex != 2) { return; } int itemCountEffective = inventory.GetItemCountEffective(Items.StrengthenBurn); if (itemCountEffective > 0) { dotInfo.preUpgradeDotIndex = dotInfo.dotIndex; dotInfo.dotIndex = (DotIndex)7; float num = 1f + ignitionBurnDamage * (float)itemCountEffective; float num2 = 1f + ignitionBurnDuration * (float)itemCountEffective; if (shouldIgnitionDamageAndDurationCompound) { dotInfo.totalDamage *= num * num2; dotInfo.damageMultiplier *= num; } else { dotInfo.totalDamage *= num; dotInfo.damageMultiplier *= num / num2; } } } public static int GetBurnCount(CharacterBody victimBody) { return victimBody.GetBuffCount(Buffs.OnFire) + victimBody.GetBuffCount(Buffs.StrongerBurn); } public static bool EnableMoreProjectilesForExtinctionEnemies(CharacterBody sender) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 //IL_0014: 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) return (int)sender.teamComponent.teamIndex != 1 && Run.instance.selectedDifficulty == difficultyIndexExtinction; } private void CreateDifficultyDef() { //IL_0037: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown //IL_007a: 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_0105: 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_0162: Expected O, but got Unknown DifficultyUtilsModule.UseDifficultyStats = true; DifficultyUtilsModule.CompensateRewardsForDifficultyBoost = true; DifficultyUtilsModule.BoostTeleporterContrast = true; difficultyDefExtinction = new DifficultyDef(4f, "DIFFICULTYSWANSONG_NAME", "", "DIFFICULTYSWANSONG_DESC", Color32.op_Implicit(new Color32((byte)115, (byte)81, (byte)151, byte.MaxValue)), "", true); difficultyDefExtinction.iconSprite = mainAssetBundle.LoadAsset<Sprite>("Assets/Textures/Icons/texIconDifficultyHardest.png"); difficultyDefExtinction.foundIconSprite = true; difficultyIndexExtinction = DifficultyAPI.AddDifficulty(difficultyDefExtinction); MoreDifficultyStats moreDifficultyStats = DifficultyUtilsModule.GetMoreDifficultyStats(difficultyIndexExtinction); moreDifficultyStats.ambientLevelCap = 999; moreDifficultyStats.delayFirstStorm_ForSwanSong = false; moreDifficultyStats.desiredStormTime_ForSwanSong = 4f; moreDifficultyStats.desiredStormWarningTime_ForSwanSong = 1f; moreDifficultyStats.startingDifficultyCoefficientBoost = difficultyDefExtinction.scalingValue - 1f; moreDifficultyStats.startingDifficultyDisplay = 9f; moreDifficultyStats.startingLevelBoost = eclipseDifficultyBoost; moreDifficultyStats.stormIntensifyStrength_ForSwanSong = 0.70000005f; moreDifficultyStats.teleporterParticleRangeMultiplier = 0f; moreDifficultyStats.tier2EliteStage = 4; DifficultyUtilsModule.difficultyCustomStats[difficultyIndexExtinction] = moreDifficultyStats; LanguageAPI.Add("DIFFICULTYSWANSONG_NAME", extinctionName); LanguageAPI.Add("DIFFICULTYSWANSONG_DESC", extinctionDesc); RoR2Application.onLoadFinished = (Action)Delegate.Combine(RoR2Application.onLoadFinished, new Action(ExtinctionCustomHooks)); MoreProjectilesModule.MoreProjectilesProvider += new MoreProjectilesEventHandler(EnableMoreProjectilesForExtinctionEnemies); } private void ExtinctionCustomHooks() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown if (is2R4RLoaded) { Log.Error("Extinction no custom hooks"); return; } Log.Error("Extinction custom hooks"); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(MonsoonPlusStatBuffs2); } private void MonsoonPlusStatBuffs2(CharacterBody sender, StatHookEventArgs args) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Invalid comparison between Unknown and I4 DifficultyIndex selectedDifficulty = Run.instance.selectedDifficulty; if (selectedDifficulty != difficultyIndexExtinction) { return; } float num = eclipseDifficultyBoost; if ((int)sender.teamComponent.teamIndex != 1) { float num2 = sender.level - num; if (sender.baseNameToken != "JELLYFISH_BODY_NAME") { args.attackSpeedMultAdd += Mathf.Clamp01(num2 / 200f) * 4f; } if (sender.isChampion) { args.armorAdd += 3f * num2; } else { args.moveSpeedMultAdd += Mathf.Clamp01(num2 / 200f) * 2f; } } } public static void AddDeathMessages() { //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Expected O, but got Unknown AddDeathQuoteTokenToList(ref swanSongStormDeathQuoteTokens, "You didn't go fast enough.", "{0} thought about uninstalling Swan Song."); AddDeathQuoteTokenToList(ref swanSongStormDeathQuoteTokens, "Was it worth it?", "{0} is wondering if it was worth it."); AddDeathQuoteTokenToList(ref swanSongStormDeathQuoteTokens, "Sending complaints about storms..", "{0} is sending complaints about storms.."); AddDeathQuoteTokenToList(ref swanSongStormDeathQuoteTokens, "Should've checked the forecast..", "{0} didn't check the forecast."); AddDeathQuoteTokenToList(ref swanSongStormDeathQuoteTokens, "Consider playing SUPERBUG instead?", "{0} is considering playing SUPERBUG instead."); AddDeathQuoteTokenToList(ref swanSongStormDeathQuoteTokens, "You were washed away.", "{0} was washed away."); AddDeathQuoteTokenToList(ref swanSongStormDeathQuoteTokens, "The storm blew you away.", "The storm blew {0} away."); AddDeathQuoteTokenToList(ref swanSongStormDeathQuoteTokens, "You'll get the hang of it!", "{0} is still learning!"); AddDeathQuoteToken("RIPMGSGHBAB.", "{0} went KA-BOOM."); AddDeathQuoteToken("You have made a poor balancing decision.", "{0} has made a poor balancing decision."); AddDeathQuoteToken("You were splatted.", "{0} was splatted."); AddDeathQuoteToken("Get got.", "{0} got got."); AddDeathQuoteToken("Congratulations on the spontaneous lobotomy!", "{0} was spontaneously lobotomized."); AddDeathQuoteToken("Your innards became outards.", "{0}'s innards became outards."); AddDeathQuoteToken("Your plea for death is answered.", "{0}'s plea for death was answered."); AddDeathQuoteToken("Must've been the wind.", "{0} blames it on the weather."); AddDeathQuoteToken("Counting, or not counting Elite violence?", "{0} had embarrassing last words."); AddDeathQuoteToken("Flopped!", "{0} was a flop."); AddDeathQuoteToken("Maybe that's configurable?", "{0} wants to change the config."); AddDeathQuoteToken("Remember to take breaks.", "{0} suggests we should take a break."); AddDeathQuoteToken("Remember to drink water.", "{0} wants a water break."); AddDeathQuoteToken("Didn't account for that?", "{0} didn't account for that."); AddDeathQuoteToken("You were slain..", "{0} was slain.."); AddDeathQuoteToken("You weren't green enough..", "{0} wasnt green enough.."); GlobalEventManager.OnPlayerCharacterDeath += new Manipulator(GlobalEventManager_OnPlayerCharacterDeath); static void AddDeathQuoteToken(string defaultText, string? secondPlayerText) { AddDeathQuoteTokenToList(ref swanSongDeathQuoteTokens, defaultText, secondPlayerText); } static void AddDeathQuoteTokenToList(ref List<string> list, string secondPerson, string? thirdPerson) { string text = "PLAYER_DEATH_QUOTE_SWANSONG_" + swanSongDeathQuoteTokens.Count; LanguageAPI.Add(text + "_2P", secondPerson); LanguageAPI.Add(text, thirdPerson ?? secondPerson); list.Add(text); } } private static void GlobalEventManager_OnPlayerCharacterDeath(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0084: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); int num = default(int); if (!val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchLdsfld<GlobalEventManager>(x, "standardDeathQuoteTokens") }) || !val.TryGotoNext((MoveType)0, new Func<Instruction, bool>[1] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, ref num) })) { DebugBreakpoint("GlobalEventManager_OnPlayerCharacterDeath"); return; } val.Emit(OpCodes.Ldarg_1); val.EmitDelegate<Func<string, DamageReport, string>>((Func<string, DamageReport, string>)delegate(string tokenIn, DamageReport damageReport) { if (swanSongStormDeathQuoteTokens.Count > 0 && StormsCore.IsStormDamage(damageReport.damageInfo, damageReport.attackerBody)) { return swanSongStormDeathQuoteTokens[Random.Range(0, swanSongStormDeathQuoteTokens.Count)]; } num = GlobalEventManager.standardDeathQuoteTokens.Length; int num2 = Random.Range(0, num + swanSongDeathQuoteTokens.Count); return (num2 < num || num2 - num > swanSongDeathQuoteTokens.Count) ? tokenIn : swanSongDeathQuoteTokens[num2 - num]; }); } public static void EmergencyDirectorTweaks() { RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(EmergencyDirectorHooks)); } private static void EmergencyDirectorHooks() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown if (!Tools.isLoaded("com.RiskOfBrainrot.RiskierRain")) { if (Tools.isLoaded("com.Nuxlar.EarlySpawnBoost") || Tools.isLoaded("com.score.DirectorReworkPlus") || Tools.isLoaded("com.RiskyLives.RiskyMod") || Tools.isLoaded("BALLS.WellRoundedBalance")) { boostSpawnRates = false; } CombatDirector.Awake += new hook_Awake(EmergencyDirectorChange); } } private static void EmergencyDirectorChange(orig_Awake orig, CombatDirector self) { //IL_003a: 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) if (((Object)((Component)self).gameObject).name == "Teleporter1(Clone)" || (Object)(object)Run.instance == (Object)null) { orig.Invoke(self); return; } if (Run.instance.selectedDifficulty == difficultyIndexExtinction) { self.eliteBias *= 0.5f; orig.Invoke(self); return; } if (boostSpawnRates && Run.instance.stageClearCount < 2 && Run.instance.IsExpansionEnabled(expansionDefSS2)) { self.creditMultiplier *= 1.2f; } orig.Invoke(self); } public static bool ModLoaded(string modGuid) { return modGuid != "" && Chainloader.PluginInfos.ContainsKey(modGuid); } private void Awake() { instance = this; Config.Init(); Language.Init(); Log.Init(((BaseUnityPlugin)this).Logger); CreateExpansionDef(); CreateDifficultyDef(); EmergencyDirectorHooks(); AddDeathMessages(); Hooks.Init(); CommonAssets.Init(); EliteModule.Init(); Spawnlists.Init(); StormsCore.Init(); TwistedScavengersCore.Init(); Materials.SwapShadersFromMaterialsInBundle(mainAssetBundle); ConfigManager.HandleConfigAttributes(((object)this).GetType(), "SwanSong", Config.MyConfig); InitializeContent(); if (Config.SectionEnableConfig("Interactable Secrets").Value) { Secrets.AddSecrets(); } InitializeChanges(); SwanSongPlugin.onSwanSongLoaded(); Config.Save(); new ContentPacks().Initialize(); } public static void DebugBreakpoint(string methodName, int breakpointNumber = -1) { Log.DebugBreakpoint(methodName, breakpointNumber); } private void CreateExpansionDef() { //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) expansionDefSS2 = ScriptableObject.CreateInstance<ExpansionDef>(); expansionDefSS2.nameToken = "EXPANSION2R4R_NAME"; expansionDefSS2.descriptionToken = "EXPANSION2R4R_DESCRIPTION"; expansionDefSS2.iconSprite = mainAssetBundle.LoadAsset<Sprite>("Assets/Textures/Icons/texIconExpansionSwanSong.png"); expansionDefSS2.disabledIconSprite = Addressables.LoadAssetAsync<Sprite>((object)RoR2_Base_Common_MiscIcons.texUnlockIcon_png).WaitForCompletion(); LanguageAPI.Add("EXPANSION2R4R_NAME", "Swan Song"); LanguageAPI.Add("EXPANSION2R4R_DESCRIPTION", "Adds content from the 'Swan Song' expansion to the game."); Content.AddExpansionDef(expansionDefSS2); expansionDefSOTS = ScriptableObject.CreateInstance<ExpansionDef>(); expansionDefSOTS.nameToken = "EXPANSIONSOTS_NAME"; expansionDefSOTS.descriptionToken = "EXPANSIONSOTS_DESCRIPTION"; expansionDefSOTS.iconSprite = null; expansionDefSOTS.disabledIconSprite = null; } private void InitializeContent() { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); if (Config.SectionEnableConfig("Items (Reworks)").Value) { BeginInitializing<ReworkBase>(types, "SwanSongReworks.txt"); } BeginInitializing<ItemBase>(types, "SwanSongItems.txt"); BeginInitializing<EquipmentBase>(types, "SwanSongEquipment.txt"); BeginInitializing<EliteEquipmentBase>(types, "SwanSongElites.txt"); BeginInitializing<InteractableBase>(types, "SwanSongInteractables.txt"); BeginInitializing<ArtifactBase>(types, "SwanSongArtifacts.txt"); BeginInitializing<SkillBase>(types, "SwanSongSkills.txt"); if (TwistedScavengersCore.enableScavs.Value) { BeginInitializing<TwistedScavengerBase>(types, "SwanSongScavengers.txt"); } } private void InitializeChanges() { } private void BeginInitializing<T>(Type[] allTypes, string fileName = "") where T : SharedBase { Type baseType = typeof(T); if (!baseType.IsAbstract) { Log.Error(Log.Combine() + "Incorrect BaseType: " + baseType.Name); return; } IEnumerable<Type> source = allTypes.Where((Type type) => !type.IsAbstract && type.IsSubclassOf(baseType)); if (source.Count() <= 0) { return; } IEnumerable<SharedBase> enumerable = from objType in source select (T)Activator.CreateInstance(objType) into sharedBase orderby sharedBase.loadOrder select sharedBase; Log.Debug(Log.Combine(baseType.Name) + "Initializing"); foreach (SharedBase item in enumerable) { string text = Log.Combine(baseType.Name, item.ConfigName); if (ValidateBaseType(item)) { Log.Debug(text + "Validated"); InitializeBaseType(item); Log.Debug(text + "Initialized"); } } if (!string.IsNullOrEmpty(fileName)) { Language.TryPrintOutput(fileName); } } private bool ValidateBaseType(SharedBase obj) { bool isEnabled = obj.isEnabled; if (obj.forcePrerequisites) { return isEnabled && obj.GetPrerequisites(); } return obj.Bind(isEnabled, "Should This Content Be Enabled") && obj.GetPrerequisites(); } private void InitializeBaseType(SharedBase obj) { obj.Init(); } public static bool GetConfigBool(bool defaultValue, string packetTitle, string desc = "") { return ConfigManager.DualBindToConfig(packetTitle, Config.MyConfig, "Should This Content Be Enabled", defaultValue, desc); } public static Sprite TryLoadSpriteFromBundle(string path, AssetBundle assetBundle = null, bool fallBackOnWrench = false) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) Sprite val = SwanSongPlugin.TryLoadFromBundle<Sprite>(path, assetBundle); if (Object.op_Implicit((Object)(object)val)) { return val; } return Addressables.LoadAssetAsync<Sprite>((object)(fallBackOnWrench ? RoR2_Base_Core.texNullIcon_png : RoR2_Base_Common_MiscIcons.texWIPIcon_png)).WaitForCompletion(); } public static T TryLoadFromBundle<T>(string path, AssetBundle assetBundle = null) where T : Object { if ((Object)(object)assetBundle == (Object)null) { assetBundle = mainAssetBundle; } if (Object.op_Implicit((Object)(object)assetBundle) && !string.IsNullOrWhiteSpace(path) && assetBundle.Contains(path)) { return assetBundle.LoadAsset<T>(path); } return default(T); } public static AssetReferenceT<T> LoadAsync<T>(string guid, Action<T> callback) where T : Object { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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) AssetReferenceT<T> val = new AssetReferenceT<T>(guid); AsyncOperationHandle<T> handle = AssetAsyncReferenceManager<T>.LoadAsset(val, (AsyncReferenceHandleUnloadType)2); if (callback == null) { return val; } if (handle.IsDone) { onCompleted(handle); return val; } handle.Completed += onCompleted; return val; void onCompleted(AsyncOperationHandle<T> val2) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 if (val2.Result == null || (int)val2.Status != 1) { Debug.LogError((object)$"Failed to load asset [{val2.DebugName}] : {val2.OperationException}"); } else { callback(val2.Result); } } } public static void RemoveCraftingRecipe(string guid) { SwanSongPlugin.LoadAsync<CraftableDef>(guid, (Action<CraftableDef>)delegate(CraftableDef craftableDef) { craftableDef.recipes = (Recipe[])(object)new Recipe[0]; }); } public static void RetierItemAsync(string itemGuid, ItemTier tier = (ItemTier)5, Action<ItemDef> callback = null) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: 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_0023: Unknown result type (might be due to invalid IL or missing references) AssetReferenceT<ItemDef> val = new AssetReferenceT<ItemDef>(itemGuid); AsyncOperationHandle<ItemDef> val2 = AssetAsyncReferenceManager<ItemDef>.LoadAsset(val, (AsyncReferenceHandleUnloadType)2); val2.Completed += delegate(AsyncOperationHandle<ItemDef> ctx) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) ItemDef result = ctx.Result; result.tier = tier; result.deprecatedTier = tier; if (callback != null) { callback(result); } }; } public static void RemoveEquipmentAsync(string equipmentGuid, Action<EquipmentDef> callback = null) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) AssetReferenceT<EquipmentDef> val = new AssetReferenceT<EquipmentDef>(equipmentGuid); AsyncOperationHandle<EquipmentDef> val2 = AssetAsyncReferenceManager<EquipmentDef>.LoadAsset(val, (AsyncReferenceHandleUnloadType)2); val2.Completed += delegate(AsyncOperationHandle<EquipmentDef> ctx) { EquipmentDef result = ctx.Result; result.canDrop = false; result.canBeRandomlyTriggered = false; result.enigmaCompatible = false; result.dropOnDeathChance = 0f; if (callback != null) { callback(result); } }; } internal static void BlacklistSingleItem(ItemDef itemDef, ItemTag itemTag = (ItemTag)4) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)itemDef != (Object)null) { List<ItemTag> list = new List<ItemTag>(itemDef.tags); list.Add(itemTag); itemDef.tags = list.ToArray(); } else { Log.Error("ItemDef null - unable to blacklist"); } } internal static void BlacklistSingleItem(string name, ItemTag itemTag = (ItemTag)4) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) ItemDef itemDef = LoadItemDef(name); BlacklistSingleItem(itemDef, itemTag); } public static void ChangeBuffStacking(string buffName, bool canStack) { BuffDef val = LoadBuffDef(buffName); if ((Object)(object)val != (Object)null) { val.canStack = canStack; } } private static ItemDef LoadItemDef(string name) { return LegacyResourcesAPI.Load<ItemDef>("ItemDefs/" + name); } private static EquipmentDef LoadEquipDef(string name) { return LegacyResourcesAPI.Load<EquipmentDef>("EquipmentDefs/" + name); } private static BuffDef LoadBuffDef(string name) { return LegacyResourcesAPI.Load<BuffDef>("BuffDefs/" + name); } } public static class Secrets { private const bool DEBUG = true; public static void AddSecrets() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: 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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: 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_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: 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_02fc: 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_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_0440: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_056d: Unknown result type (might be due to invalid IL or missing references) if (SwanSongPlugin.fabricatorsLoaded) { AddDoubleChestSecrets(); } InteractableSpawnCard val = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)RoR2_Base_ShrineCombat.iscShrineCombat_asset).WaitForCompletion(); InteractableSpawnCard val2 = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)RoR2_Base_EquipmentBarrel.iscEquipmentBarrel_asset).WaitForCompletion(); InteractableSpawnCard spawnCard = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/Base/DuplicatorLarge/iscDuplicatorLarge.asset").WaitForCompletion(); InteractableSpawnCard spawnCard2 = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/Base/Chest2/iscChest2.asset").WaitForCompletion(); InteractableSpawnCard spawnCard3 = Addressables.LoadAssetAsync<InteractableSpawnCard>((object)"RoR2/Base/LunarChest/iscLunarChest.asset").WaitForCompletion(); InteractableSpawnCard spawnCard4 = InteractableBase<ConstructConstruct>.instance.customInteractable.spawnCard; InteractableSpawnCard spawnCard5 = null; InteractableSpawnCard spawnCard6 = null; InteractableSpawnCard spawnCard7 = null; InteractableSpawnCard spawnCard8 = null; SpawnSecret("ancientloft", (SpawnCard)(object)spawnCard, new Vector3(-86f, 29f, 34f)); SpawnSecret("ancientloft", (SpawnCard)(object)spawnCard2, new Vector3(-104f, 106f, 265f)); SpawnSecret("ancientloft", (SpawnCard)(object)spawnCard, new Vector3(-68f, 40f, -59f)); SpawnSecret("foggyswamp", (SpawnCard)(object)spawnCard, new Vector3(257f, 84f, -140f)); SpawnSecret("foggyswamp", (SpawnCard)(object)spawnCard, new Vector3(145f, -75f, -75f)); SpawnSecret("foggyswamp", (SpawnCard)(object)spawnCard, new Vector3(-108f, -104f, -138f)); SpawnSecret("foggyswamp", (SpawnCard)(object)spawnCard, new Vector3(-86f, 29f, 34f)); SpawnSecret("foggyswamp", (SpawnCard)(object)spawnCard2, new Vector3(-128f, -127f, 98f)); SpawnSecret("foggyswamp", (SpawnCard)(object)spawnCard3, new Vector3(-137f, -356f)); SpawnSecret("foggyswamp", (SpawnCard)(object)spawnCard4, new Vector3(258f, -150f, -170f), 0.3f); SpawnSecret("goolake", (SpawnCard)(object)spawnCard2, new Vector3(22f, -158f, -371f)); SpawnSecret("goolake", (SpawnCard)(object)spawnCard, new Vector3(-7f, -81f, -174f)); SpawnSecret("goolake", (SpawnCard)(object)spawnCard, new Vector3(221f, -100f, 296f)); SpawnSecret("goolake", (SpawnCard)(object)spawnCard5, new Vector3(351f, -78f, 108f)); SpawnSecret("goolake", (SpawnCard)(object)spawnCard, new Vector3(118f, -91f, -7f)); SpawnSecret("goolake", (SpawnCard)(object)spawnCard2, new Vector3(174f, -11f, -252f)); SpawnSemiRandom("wispgraveyard", (SpawnCard)(object)spawnCard5, (Vector3[])(object)new Vector3[4] { new Vector3(-412f, 6f, -20f), new Vector3(-418f, 6f, -67f), new Vector3(-383f, 6f, -102f), new Vector3(-421f, 6f, -39f) }); SpawnSecret("wispgraveyard", (SpawnCard)(object)spawnCard6, new Vector3(46f, 29f, -62f)); SpawnSemiRandom("frozenwall", (SpawnCard)(object)spawnCard7, (Vector3[])(object)new Vector3[3] { new Vector3(74f, 121f, 147f), new Vector3(66f, 115f, 109f), new Vector3(54f, 111f, 72f) }); SpawnSecret("frozenwall", (SpawnCard)(object)spawnCard8, new Vector3(0f, 34f, 5f)); SpawnSecret("sulfurpools", (SpawnCard)(object)spawnCard6, new Vector3(9f, -7f, -51f), 0.5f); SpawnSecret("sulfurpools", (SpawnCard)(object)spawnCard6, new Vector3(-155f, 27f, 46f), 0.5f); SpawnSecret("sulfurpools", (SpawnCard)(object)spawnCard6, new Vector3(176f, 28f, 45f), 0.5f); SpawnSecret("sulfurpools", (SpawnCard)(object)spawnCard6, new Vector3(94f, 22f, -133f), 0.5f); SpawnSemiRandom("sulfurpools", (SpawnCard)(object)spawnCard4, (Vector3[])(object)new Vector3[3] { new Vector3(23f, -35f, 65f), new Vector3(26f, -34f, 99f), new Vector3(28f, -34f, 36f) }); SpawnSemiRandom("sulfurpools", (SpawnCard)(object)spawnCard4, (Vector3[])(object)new Vector3[2] { new Vector3(173f, 2f, -154f), new Vector3(128f, 0f, -194f) }, 0.5f); } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void AddDoubleChestSecrets() { //IL_001a: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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_00c2: 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_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: 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_0206: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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_0281: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_041b: Unknown result type (might be due to invalid IL or missing references) //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_0448: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0556: Unknown result type (might be due to invalid IL or missing references) //IL_057f: Unknown result type (might be due to invalid IL or missing references) SpawnSecret("golemplains", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-109f, -100f, 42f)); SpawnSecret("golemplains", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(133f, -100f, 29f), 0.4f); SpawnSecret("golemplains", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(183f, -92f, -144f)); SpawnSecret("golemplains", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(100f, -155f, -342f), 0.4f); SpawnSemiRandom(posList: (Vector3[])(object)new Vector3[5] { new Vector3(139f, -119f, 194f), new Vector3(156f, -120f, -196f), new Vector3(152f, -112f, -222f), new Vector3(120f, -112f, -209f), new Vector3(89f, -116f, -192f) }, scene: "golemplains", spawnCard: (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard); SpawnSecret("golemplains2", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-33f, 61f, -57f)); SpawnSecret("golemplains2", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-77f, 54f, -102f)); SpawnSecret("golemplains2", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-214f, 42f, -29f), 0.8f); SpawnSecret("golemplains2", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(141f, 60f, -4f), 0.4f); SpawnSecret("golemplains2", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(151f, 14f, -230f)); SpawnSecret("blackbeach", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-23f, -175f, -387f)); SpawnSecret("blackbeach", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(93f, -125f, -299f)); SpawnSecret("blackbeach", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(31f, -213f, -120f)); SpawnSecret("blackbeach", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-288f, -16f, -181f), 0.3f); SpawnSecret("blackbeach", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-337f, -199f, -230f), 0.5f); SpawnSecret("blackbeach2", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-101f, 28f, 11f), 0.8f); SpawnSecret("blackbeach2", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-134f, 47f, -103f), 0.4f); SpawnSecret("blackbeach2", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(12f, 88f, -126f)); SpawnSecret("blackbeach2", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(117f, 65f, 151f)); SpawnSecret("snowyforest", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-252f, 22f, 57f), 0.5f); SpawnSecret("snowyforest", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(24f, 67f, 2f)); SpawnSecret("snowyforest", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-34f, 70f, -193f)); SpawnSecret("snowyforest", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(38f, 42f, -27f), 0.5f); SpawnSemiRandom(posList: (Vector3[])(object)new Vector3[3] { new Vector3(136f, 53f, 191f), new Vector3(92f, 41f, -32f), new Vector3(110f, 79f, 19f) }, scene: "snowyforest", spawnCard: (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard); SpawnSecret("ancientloft", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(165f, 62f, -31f), 0.8f); SpawnSecret("wispgraveyard", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-22f, 59f, 286f)); SpawnSecret("frozenwall", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(87f, 82f, -250f), 0.5f); SpawnSecret("frozenwall", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(-104f, 35f, 49f)); SpawnSecret("frozenwall", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(196f, 25f, 32f)); SpawnSecret("sulfurpools", (SpawnCard)(object)FabricatorPlugin.fabricatorCommonSpawnCard, new Vector3(11f, -19f, 37f)); } public static void SpawnSecret(string scene, SpawnCard spawnCard, Vector3 pos, float chance = -1f) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)spawnCard == (Object)null) { return; } Stage.onStageStartGlobal += delegate(Stage self) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: 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_00c3: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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_0122: Expected O, but got Unknown //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Invalid comparison between Unknown and I4 Vector3 val = default(Vector3); SceneDef sceneDef = self.sceneDef; if (!((Object)(object)sceneDef == (Object)null) && !(self.sceneDef.cachedName != scene) && (chance == -1f || RollForSecret(chance))) { if (!CheckForGeometry(pos + new Vector3(0f, 2f, 0f))) { Debug.Log((object)"no floor!!"); } else { DirectorPlacementRule val2 = new DirectorPlacementRule { placementMode = (PlacementMode)0 }; if ((Object)(object)spawnCard == (Object)null) { Debug.Log((object)"spawncardnullwtf"); } if (val2 == null) { Debug.Log((object)"placementrulenulwtf"); } GameObject spawnedInstance = spawnCard.DoSpawn(pos, Quaternion.Euler(val), new DirectorSpawnRequest(spawnCard, val2, Run.instance.runRNG)).spawnedInstance; spawnedInstance.transform.eulerAngles = val; if (Object.op_Implicit((Object)(object)spawnedInstance)) { PurchaseInteraction component = spawnedInstance.GetComponent<PurchaseInteraction>(); if (Object.op_Implicit((Object)(object)component) && (int)component.costType == 1) { component.Networkcost = Run.instance.GetDifficultyScaledCost(component.cost); } } NetworkServer.Spawn(spawnedInstance); } } }; } public static void SpawnSemiRandom(string scene, SpawnCard spawnCard, Vector3[] posList, float chance = -1f) { if ((Object)(object)spawnCard == (Object)null) { return; } Stage.onStageStartGlobal += delegate(Stage self) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown //IL_0073: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00d2: Invalid comparison between Unknown and I4 Vector3 val = default(Vector3); if (!(self.sceneDef.cachedName != scene) && (chance == -1f || RollForSecret(chance))) { DirectorPlacementRule val2 = new DirectorPlacementRule { placementMode = (PlacementMode)0 }; GameObject spawnedInstance = spawnCard.DoSpawn(SemiRandomLocation(posList), Quaternion.Euler(val), new DirectorSpawnRequest(spawnCard, val2, Run.instance.runRNG)).spawnedInstance; spawnedInstance.transform.eulerAngles = val; if (Object.op_Implicit((Object)(object)spawnedInstance)) { PurchaseInteraction component = spawnedInstance.GetComponent<PurchaseInteraction>(); if (Object.op_Implicit((Object)(object)component) && (int)component.costType == 1) { component.Networkcost = Run.instance.GetDifficultyScaledCost(component.cost); } } NetworkServer.Spawn(spawnedInstance); } }; } public static Vector3 SemiRandomLocation(Vector3[] locations) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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) int num = locations.Length; int num2 = Random.RandomRangeInt(0, num); Vector3 result = locations[num2]; bool flag = true; Debug.LogWarning((object)$"{num} spots, chose spot {num2}"); return result; } public static bool RollForSecret(float chance) { return Random.RandomRange(0f, 1f) < chance; } public static bool CheckForGeometry(Vector3 cords) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) return Physics.Raycast(cords, Vector3.down, 5f); } } internal static class Log { public static bool enableDebugging; internal static ManualLogSource _logSource; public static void DebugBreakpoint(string methodName, int breakpointNumber = -1) { string text = "SwanSongExtended: " + methodName + " IL hook failed!"; if (breakpointNumber >= 0) { text += $" (breakpoint {breakpointNumber})"; } Error(text); } internal static void Init(ManualLogSource logSource) { enableDebugging = ConfigManager.DualBindToConfig("Swan Song", Config.MyConfig, "Enable Debugging", defaultValue: false, "Enable debug outputs to the log for troubleshooting purposes. Enabling this will slow down the game."); _logSource = logSource; } internal static string Combine(params string[] parameters) { string text = "SwanSongExtended : "; foreach (string text2 in parameters) { text = text + text2 + " : "; } return text; } internal static void Debug(object data) { if (enableDebugging) { _logSource.LogDebug(data); } } internal static void Error(object data) { _logSource.LogError(data); } internal static void ErrorAssetBundle(string assetName, string bundleName) { Error("failed to load asset, " + assetName + ", because it does not exist in asset bundle, " + bundleName); } 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 abstract class SharedBase { public virtual int loadOrder => 0; public virtual bool forcePrerequisites { get; } = false; public abstract string ConfigName { get; } public virtual bool isEnabled { get; } = true; public static ManualLogSource Logger => Log._logSource; public abstract AssetBundle assetBundle { get; } public abstract void Hooks(); public abstract void Lang(); public virtual bool GetPrerequisites() { return true; } public virtual void Init() { ConfigManager.HandleConfigAttributes(GetType(), ConfigName, Config.MyConfig); Hooks(); Lang(); SwanSongPlugin.onSwanSongLoaded += PostInit; } public T Bind<T>(T defaultValue, string configName, string configDesc = "") { return ConfigManager.DualBindToConfig(ConfigName, Config.MyConfig, configName, defaultValue, configDesc); } public virtual void PostInit() { } public static float GetHyperbolic(float firstStack, float cap, float chance) { if (firstStack >= cap) { return cap * (chance / firstStack); } float num = chance / firstStack; float num2 = 100f * firstStack / (cap - firstStack); return cap * (1f - 100f / (num * num2 + 100f)); } public static ExpansionDef SotvExpansionDef() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) return Addressables.LoadAssetAsync<ExpansionDef>((object)"RoR2/DLC1/Common/DLC1.asset").WaitForCompletion(); } } public static class Extensions { public static bool InteractableIsPermittedForSpawn(this GameObject interactableObject, bool disallowPickups = true) { if ((Object)(object)interactableObject == (Object)null) { return false; } InteractionProcFilter val = default(InteractionProcFilter); if (interactableObject.TryGetComponent<InteractionProcFilter>(ref val)) { return val.shouldAllowOnInteractionBeginProc; } PurchaseInteraction val2 = default(PurchaseInteraction); if (interactableObject.TryGetComponent<PurchaseInteraction>(ref val2)) { return !val2.disableSpawnOnInteraction; } DelusionChestController val3 = default(DelusionChestController); if (interactableObject.TryGetComponent<DelusionChestController>(ref val3)) { PickupPickerController val4 = default(PickupPickerController); if (interactableObject.TryGetComponent<PickupPickerController>(ref val4) && ((Behaviour)val4).enabled) { return false; } return true; } GenericPickupController val5 = default(GenericPickupController); if (interactableObject.TryGetComponent<GenericPickupController>(ref val5)) { return disallowPickups || val5.Duplicated; } if (Object.op_Implicit((Object)(object)interactableObject.GetComponent<VehicleSeat>())) { return false; } if (Object.op_Implicit((Object)(object)interactableObject.GetComponent<NetworkUIPromptController>())) { return false; } PowerPedestal val6 = default(PowerPedestal); if (interactableObject.TryGetComponent<PowerPedestal>(ref val6)) { return val6.CanTriggerFireworks; } AccessCodesNodeController val7 = default(AccessCodesNodeController); if (interactableObject.TryGetComponent<AccessCodesNodeController>(ref val7)) { return val7.CheckInteractionOrder(); } return true; } public static GameObject FixItemModel(this GameObject prefab) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: 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_00e4: 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_00f3: 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) if ((Object)(object)prefab == (Object)null) { prefab = Resources.Load<GameObject>("prefabs/NullModel"); } ModelPanelParameters val = prefab.AddComponent<ModelPanelParameters>(); val.minDistance = 1f; val.maxDistance = 15f; Transform val2 = prefab.transform.Find("FocusPos"); if ((Object)(object)val2 == (Object)null) { GameObject val3 = new GameObject("FocusPos"); val2 = val3.transform; val2.parent = prefab.transform; val2.localPosition = Vector3.zero; } val.focusPointTransform = val2; Transform val4 = prefab.transform.Find("CameraPos"); if ((Object)(object)val4 == (Object)null) { GameObject val5 = new GameObject("CameraPos"); val4 = val5.transform; val4.parent = prefab.transform; val4.SetPositionAndRotation(val2.position + Vector3.forward * -7f + Vector3.right * -1f, val4.rotation); } val.cameraPositionTransform = val4; return prefab; } public static bool IsStormElite(this CharacterBody body) { if (StormEliteEquipmentBase<SurgingAspect>.instance != null && body.HasBuff(StormEliteEquipmentBase<SurgingAspect>.instance.EliteBuffDef)) { return true; } if (T1EliteEquipmentBase<WhirlwindAspect>.instance != null && body.HasBuff(T1EliteEquipmentBase<WhirlwindAspect>.instance.EliteBuffDef)) { return true; } return false; } public static string AsPercent(this float d) { return d * 100f + "%"; } public static Sprite AsSprite(this Texture2D tex) { //IL_001a: 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) return Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f)); } public static void AddPersistentListener(this OnSpawnedServer unityEvent, UnityAction<GameObject> action) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) PersistentCallGroup persistentCalls = ((UnityEventBase)unityEvent).m_PersistentCalls; PersistentCall val = new PersistentCall(); ref Object target = ref val.m_Target; object? target2 = ((Delegate)(object)action).Target; target = (Object)((target2 is Object) ? target2 : null); val.m_TargetAssemblyTypeName = UnityEventTools.TidyAssemblyTypeName(((Delegate)(object)action).Method.DeclaringType.AssemblyQualifiedName); val.m_MethodName = ((Delegate)(object)action).Method.Name; val.m_CallState = (UnityEventCallState)2; val.m_Mode = (PersistentListenerMode)0; persistentCalls.AddListener(val); } public static void AddPersistentListener(this HoldoutZoneControllerChargedUnityEvent unityEvent, UnityAction<HoldoutZoneController> action) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) PersistentCallGroup persistentCalls = ((UnityEventBase)unityEvent).m_PersistentCalls; PersistentCall val = new PersistentCall(); ref Object target = ref val.m_Target; object? target2 = ((Delegate)(object)action).Target; target = (Object)((target2 is Object) ? target2 : null); val.m_TargetAssemblyTypeName = UnityEventTools.TidyAssemblyTypeName(((Delegate)(object)action).Method.DeclaringType.AssemblyQualifiedName); val.m_MethodName = ((Delegate)(object)action).Method.Name; val.m_CallState = (UnityEventCallState)2; val.m_Mode = (PersistentListenerMode)0; persistentCalls.AddListener(val); } public static void AddPersistentListener(this UnityEvent<Interactor> unityEvent, UnityAction<Interactor> action) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) PersistentCallGroup persistentCalls = ((UnityEventBase)unityEvent).m_PersistentCalls; PersistentCall val = new PersistentCall(); ref Object target = ref val.m_Target; object? target2 = ((Delegate)(object)action).Target; target = (Object)((target2 is Object) ? target2 : null); val.m_TargetAssemblyTypeName = UnityEventTools.TidyAssemblyTypeName(((Delegate)(object)action).Method.DeclaringType.AssemblyQualifiedName); val.m_MethodName = ((Delegate)(object)action).Method.Name; val.m_CallState = (UnityEventCallState)2; val.m_Mode = (PersistentListenerMode)0; persistentCalls.AddListener(val); } public static void AddPersistentListener(this UnityEvent<CharacterMaster> unityEvent, UnityAction<CharacterMaster> action) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) PersistentCallGroup persistentCalls = ((UnityEventBase)unityEvent).m_PersistentCalls; PersistentCall val = new PersistentCall(); ref Object target = ref val.m_Target; object? target2 = ((Delegate)(object)action).Target; target = (Object)((target2 is Object) ? target2 : null); val.m_TargetAssemblyTypeName = UnityEventTools.TidyAssemblyTypeName(((Delegate)(object)action).Method.DeclaringType.AssemblyQualifiedName); val.m_MethodName = ((Delegate)(object)action).Method.Name; val.m_CallState = (UnityEventCallState)2; val.m_Mode = (PersistentListenerMode)0; persistentCalls.AddListener(val); } public static void AddPersistentListener(this UnityEvent<GameObject> unityEvent, UnityAction<GameObject> action) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) PersistentCallGroup persistentCalls = ((UnityEventBase)unityEvent).m_PersistentCalls; PersistentCall val = new PersistentCall(); ref Object target = ref val.m_Target; object? target2 = ((Delegate)(object)action).Target; target = (Object)((target2 is Object) ? target2 : null); val.m_TargetAssemblyTypeName = UnityEventTools.TidyAssemblyTypeName(((Delegate)(object)action).Method.DeclaringType.AssemblyQualifiedName); val.m_MethodName = ((Delegate)(object)action).Method.Name; val.m_CallState = (UnityEventCallState)2; val.m_Mode = (PersistentListenerMode)0; persistentCalls.AddListener(val); } } public static class Tools { public static string modPrefix = string.Format("@{0}+{1}", "ArtificerExtended", "artiskillicons"); public static AssetBundle LoadAssetBundle(byte[] resourceBytes) { if (resourceBytes == null) { throw new ArgumentNullException("resourceBytes"); } return AssetBundle.LoadFromMemory(resourceBytes); } public static string GetModPrefix(this BaseUnityPlugin plugin, string bundleName) { return $"@{plugin.Info.Metadata.Name}+{bundleName}"; } internal static bool isLoaded(string modguid) { foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos) { string key = pluginInfo.Key; PluginInfo value = pluginInfo.Value; if (key == modguid) { return true; } } return false; } internal static string ConvertDecimal(float d) { return d * 100f + "%"; } public static float GetAmbientLevelScalar(float scalar) { if (!Object.op_Implicit((Object)(object)Run.instance)) { return 1f; } return 1f + scalar * Run.instance.ambientLevel; } public static bool IsEasyMode(DifficultyIndex minDifficultyIndex = (DifficultyIndex)0) { //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) if ((Object)(object)Run.instance == (Object)null) { return true; } return Run.instance.selectedDifficulty <= minDifficultyIndex; } internal static void GetMaterial(GameObject model, string childObject, Color color, ref Material material, float scaleMultiplier = 1f, bool replaceAll = false) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = model.GetComponentsInChildren<Renderer>(); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { Renderer val2 = val; if (string.Equals(((Object)val).name, childObject)) { if (color == Color.clear) { Object.Destroy((Object)(object)val); break; } if ((Object)(object)material == (Object)null) { material = new Material(val.material); material.mainTexture = val.material.mainTexture; material.shader = val.material.shader; material.color = color; } val.material = material; Transform transform = ((Component)val).transform; transform.localScale *= scaleMultiplier; if (!replaceAll) { break; } } } } internal static void DebugMaterial(GameObject model) { Renderer[] componentsInChildren = model.GetComponentsInChildren<Renderer>(); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { Renderer val2 = val; Debug.Log((object)("Material: " + ((Object)val2).name.ToString())); } } internal static void GetParticle(GameObject model, string childObject, Color color, float sizeMultiplier = 1f, bool replaceAll = false) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: 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_0033: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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) ParticleSystem[] componentsInChildren = model.GetComponentsInChildren<ParticleSystem>(); ParticleSystem[] array = componentsInChildren; foreach (ParticleSystem val in array) { ParticleSystem val2 = val; MainModule main = val2.main; ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ColorBySpeedModule colorBySpeed = val2.colorBySpeed; if (string.Equals(((Object)val2).name, childObject)) { ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(color); ((MainModule)(ref main)).startSizeMultiplier = ((MainModule)(ref main)).startSizeMultiplier * sizeMultiplier; ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = MinMaxGradient.op_Implicit(color); ((ColorBySpeedModule)(ref colorBySpeed)).color = MinMaxGradient.op_Implicit(color); if (!replaceAll) { break; } } } } internal static void DebugParticleSystem(GameObject model) { ParticleSystem[] components = model.GetComponents<ParticleSystem>(); ParticleSystem[] array = components; foreach (ParticleSystem val in array) { ParticleSystem val2 = val; Debug.Log((object)("Particle: " + ((Object)val2).name.ToString())); } } internal static void GetLight(GameObject model, string childObject, Color color, bool replaceAll = false) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) Light[] componentsInChildren = model.GetComponentsInChildren<Light>(); Light[] array = componentsInChildren; foreach (Light val in array) { Light val2 = val; if (string.Equals(((Object)val2).name, childObject)) { val2.color = color; if (!replaceAll) { break; } } } } internal static void DebugLight(GameObject model) { Light[] componentsInChildren = model.GetComponentsInChildren<Light>(); Light[] array = componentsInChildren; foreach (Light val in array) { Light val2 = val; Debug.Log((object)("Light: " + ((Object)val2).name.ToString())); } } public static void ClearDotStacksForType(this DotController dotController, DotIndex dotIndex) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) for (int num = dotController.dotStackList.Count - 1; num >= 0; num--) { if (dotController.dotStackList[num].dotIndex == dotIndex) { dotController.RemoveDotStackAtServer(num); } } } public static void ApplyCooldownScale(GenericSkill skillSlot, float cooldownScale) { if ((Object)(object)skillSlot != (Object)null) { skillSlot.cooldownScale *= cooldownScale; } } public static int CountOverspillTriangular(float totalValue, float incrementor = 1f) { int num = 1; for (float num2 = 1f; num2 < totalValue; num2 += (float)num * incrementor) { num++; } return num; } public static int CountOverspillFibonacci(float totalValue, float thresholdScale = 1f, int startingIndex = 1) { int num = 0; float num2 = 1f; float num3 = 1f; while (num3 * thresholdScale < totalValue || startingIndex > 0) { if (startingIndex > 0) { startingIndex--; } else { num++; } num3 += num2; num2 = num3 - num2; } return num; } } } namespace SwanSongExtended.Storms { public class CycloneController : MonoBehaviour { public enum CycloneState { Idle, PreparingCyclone, ElectingLeader, PreparingSquall, FiringSquall } internal abstract class BaseCycloneState : BaseState { public GameObject beamVfxInstance => instance.beamPreVfxInstance; internal AffixSquallBehavior leaderElite { get { if ((Object)(object)instance == (Object)null) { return null; } return instance.leaderElite; } set { if (!((Object)(object)instance == (Object)null)) { instance.leaderElite = value; } } } public abstract CycloneState cycloneState { get; } public abstract BaseCycloneState GetNextState(); public override void OnEnter() { Debug.LogError((object)cycloneState.ToString()); } internal void UpdateTelegraphr(bool newValue) { if (newValue != instance.telegraphActive) { instance.telegraphActive = newValue; if (newValue) { instance.beamPreVfxInstance = Object.Instantiate<GameObject>(WhirlwindAspect.squallPreBeamVfxPrefab); instance.beamPreVfxInstance.transform.SetParent(((ItemBehavior)leaderElite).body.aimOriginTransform, true); instance.UpdatePreBeamTransform(); RoR2Application.onLateUpdate += instance.UpdatePreBeamTransform; } else { RoR2Application.onLateUpdate -= instance.UpdatePreBeamTransform; EntityState.Destroy((Object)(object)instance.beamPreVfxInstance); VfxKillBehavior.KillVfxObject(instance.beamPreVfxInstance); instance.beamPreVfxInstance = null; } } } public override void OnExit() { ((EntityState)this).OnExit(); } public void ElectLeader(AffixSquallBehavior candidateElite) { if (!((Object)(object)leaderElite == (Object)(object)candidateElite) && !((Object)(object)candidateElite == (Object)null)) { DemoteCurrentLeaderInternal(); ((ItemBehavior)candidateElite).body.AddBuff(StormsCore.CycloneLeader); leaderElite = candidateElite; EntityStateMachine val = EntityStateMachine.FindByCustomName(((Component)leaderElite).gameObject, "Body"); if ((Object)(object)val != (Object)null) { val.SetNextStateToMain(); } } } public void DemoteCurrentLeaderInternal() { DemoteCurrentLeader(); } public static bool IsAnyEliteInCyclone() { return AffixSquallBehavior.readOnlyInstancesList.Any((AffixSquallBehavior x) => ((ItemBehavior)x).body.HasBuff(StormsCore.CycloneProtection)); } } internal class PrepareCyclone : BaseCycloneState { private float refreshCountdown = 0f; private float refreshInterval = 3f; public override CycloneState cycloneState => CycloneState.PreparingCyclone; public override void OnEnter() { if (Object.op_Implicit((Object)(object)instance.primaryCycloneInstance)) { EntityState.Destroy((Object)(object)instance.primaryCycloneInstance); } if (instance.defaultConvergePosition.HasValue) { instance.defaultConvergePosition = null; } ResetRefreshCountdown(); DemoteCurrentLeaderInternal(); if (instance.accumulatedSquallTime <= 0f) { instance.accumulatedSquallTime = 0f; instance.accumulatedSquallCharge = 0f; instance.squallTimeFired = 0f; } instance.squallContributorCountHighest = 0; base.OnEnter(); } public override void FixedUpdate() { //IL_0181: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0194: 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_028f: 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_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (!NetworkServer.active) { return; } if (instance.accumulatedSquallTime > 0f) { instance.accumulatedSquallTime -= StormsCore.squallReelectionRallyTimeLoss * Time.fixedDeltaTime; if (instance.accumulatedSquallTime <= 0f) { instance.accumulatedSquallTime = 0f; instance.accumulatedSquallCharge = 0f; } } if (refreshCountdown > 0f) { refreshCountdown -= Time.fixedDeltaTime; return; } IEnumerable<AffixSquallBehavior> source = AffixSquallBehavior.readOnlyInstancesList.Where((AffixSquallBehavior x) => (int)((ItemBehavior)x).body.teamComponent.teamIndex != 1 && !ShelterUtilsModule.IsBodySheltered(((ItemBehavior)x).body, 0f)); int num = source.Count(); if (source.Any((AffixSquallBehavior x) => !ShelterUtilsModule.IsBodySheltered(((ItemBehavior)x).body, 0f))) { source.Where((AffixSquallBehavior x) => !ShelterUtilsModule.IsBodySheltered(((ItemBehavior)x).body, 0f)); num = source.Count(); } else if (num <= 0) { ResetRefreshCountdown(); return; } AffixSquallBehavior affixSquallBehavior = source.ElementAt(Random.Range(0, num - 1)); NodeGraph nodeGraph = SceneInfo.instance.GetNodeGraph((GraphType)0); NodeIndex val = nodeGraph.FindClosestNode(((Component)affixSquallBehavior).transform.position, (HullClassification)2, 50f); Vector3 val2 = default(Vector3); if (!nodeGraph.GetNodePosition(val, ref val2)) { return; } if (ShelterUtilsModule.IsPositionSheltered(val2, 0f)) { List<NodeIndex> list = nodeGraph.FindNodesInRange(val2, 0f, StormsCore.cycloneRadius * 1.5f, (HullMask)2); List<Vector3> list2 = new List<Vector3>(); Vector3 val3 = default(Vector3); foreach (NodeIndex item in list) { if (nodeGraph.GetNodePosition(item, ref val3) && !ShelterUtilsModule.IsPositionSheltered(val3, 0f)) { list2.Add(val3); } } if (list2.Count <= 0) { ResetRefreshCountdown(); return; } val2 = list2[Random.Range(0, list2.Count - 1)]; } Debug.LogError((object)"Electing leader and placing cyclone"); ElectLeader(affixSquallBehavior); instance.defaultConvergePosition = val2; if (!Tools.IsEasyMode((DifficultyIndex)0)) { GameObject val4 = Object.Instantiate<GameObject>(StormsCore.cycloneWardPrefab, val2, Quaternion.identity); val4.GetComponent<TeamFilter>().teamIndex = (TeamIndex)(-1); instance.primaryCycloneInstance = val4; NetworkServer.Spawn(val4); } ((EntityState)this).outer.SetNextState((EntityState)(object)GetNextState()); } private void ResetRefreshCountdown() { refreshCountdown = refreshInterval; } public override BaseCycloneState GetNextState() { BaseCycloneState baseCycloneState = new PrepareSquall(); (baseCycloneState as PrepareSquall).leaderEliteObject = ((Component)base.leaderElite).gameObject; return baseCycloneState; } } internal class ElectLeader : BaseCycloneState { internal float attemptElectLeaderCountdown = 0f; private bool shouldMoveCyclone = false; public override CycloneState cycloneState => CycloneState.ElectingLeader; public override void OnEnter() { base.OnEnter(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!NetworkServer.active) { return; } if (attemptElectLeaderCountdown > 0f) { attemptElectLeaderCountdown -= Time.fixedDeltaTime; return; } if (AffixSquallBehavior.readOnlyInstancesList.Count <= 0) { GetNextState(); } List<AffixSquallBehavior> list = AffixSquallBehavior.readOnlyInstancesList.Where((AffixSquallBehavior x) => (int)((ItemBehavior)x).body.teamComponent.teamIndex != 1 && ((ItemBehavior)x).body.HasBuff(StormsCore.CycloneProtection)).ToList(); int num = list.Count(); if (num == 0) { instance.accumulatedSquallTime -= StormsCore.squallReelectionRallyTimeLoss * StormsCore.squallReelectionInterval; if (instance.accumulatedSquallTime <= 0f || instance.squallContributorCountCurrent <= 0) { FizzleOut(); } else { attemptElectLeaderCountdown = StormsCore.squallReelectionInterval; } } else { ElectLeader(list[Random.Range(0, num - 1)]); ((EntityState)this).outer.SetNextState((EntityState)(object)GetNextState()); } } private void FizzleOut() { instance.accumulatedSquallCharge = 0f; instance.accumulatedSquallTime = 0f; shouldMoveCyclone = true; ((EntityState)this).outer.SetNextState((EntityState)(object)GetNextState()); } public override BaseCycloneState GetNextState() { if (((Object)(object)instance.primaryCycloneInstance == (Object)null && !instance.defaultConvergePosition.HasValue) || (Object)(object)instance.leaderElite == (Object)null || shouldMoveCyclone) { return new PrepareCyclone(); } BaseCycloneState baseCycloneState = new PrepareSquall(); (baseCycloneState as PrepareSquall).leaderEliteObject = ((Component)base.leaderElite).gameObject; return baseCycloneState; } } internal class PrepareSquall : BaseCycloneState { private CycloneState nextState = CycloneState.PreparingSquall; public GameObject leaderEliteObject; private float squallTimeCache = 0f; public override CycloneState cycloneState => CycloneState.PreparingSquall; public override void OnSerialize(NetworkWriter writer) { ((EntityState)this).OnSerialize(writer); writer.Write(leaderEliteObject); } public override void OnDeserialize(NetworkReader reader) { ((EntityState)this).OnDeserialize(reader); leaderEliteObject = reader.ReadGameObject(); if ((Object)(object)leaderEliteObject != (Object)null) { base.leaderElite = leaderEliteObject.GetComponent<AffixSquallBehavior>(); } } public override void OnEnter() { base.OnEnter(); squallTimeCache = instance.accumulatedSquallTime; } public override void OnExit() { base.OnExit(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (NetworkServer.active) { bool flag = ((EntityState)this).fixedAge > 1f; bool flag2 = ((EntityState)this).fixedAge >= StormsCore.squallRallyTimeMax + 1f; if ((Object)(object)base.leaderElite == (Object)null || (flag && instance.accumulatedSquallTime <= squallTimeCache) || flag2) { Log.Debug("PrepareSquall: Entering reelection"); ((EntityState)this).outer.SetNextState((EntityState)(object)GetNextState()); } else if ((Object)(object)squallTargetBody == (Object)null) { instance.accumulatedSquallTime = ((instance.squallContributorCountCurrent == 0) ? 0f : (squallTimeCache + 1f)); instance.accumulatedSquallCharge = 0f; } else if (GetSquallThresholdMet()) { Log.Debug("PrepareSquall: Beginning to fire"); ((EntityState)this).outer.SetNextState((EntityState)(object)new FireSquall()); } } } private bool GetSquallThresholdMet() { if (instance.accumulatedSquallTime < StormsCore.squallRallyTimeMin) { return false; } if (instance.accumulatedSquallTime >= StormsCore.squallRallyTimeMax) { return true; } float num = StormsCore.squallRallyTimeMin * StormsCore.squallRallyContributorThreshold; float num2 = Util.Remap(instance.accumulatedSquallCharge, 0f, num, StormsCore.squallRallyTimeMax, StormsCore.squallRallyTimeMin); return instance.accumulatedSquallTime >= num2; } public override BaseCycloneState GetNextState() { BaseCycloneState baseCycloneState = new ElectLeader(); if (instance.squallContributorCountCurrent <= 0) { (baseCycloneState as ElectLeader).attemptElectLeaderCountdown = 2f; } return baseCycloneState; } } internal class FireSquall : BaseCycloneState { private bool resetting = false; public override CycloneState cycloneState => CycloneState.FiringSquall; public override void OnEnter() { RefreshFiringState(); base.OnEnter(); } private void RefreshFiringState() { if (!((Object)(object)base.leaderElite == (Object)null)) { if (((EntityState)this).fixedAge + instance.squallTimeFired >= WhirlwindAspect.squallPreFireTime) { base.leaderElite.firingState = AffixSquallBehavior.FiringState.Firing; return; } base.leaderElite.firingState = AffixSquallBehavior.FiringState.Aiming; base.leaderElite.OnTargetUpdated(); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if ((Object)(object)base.leaderElite == (Object)null) { Log.Debug("FireSquall: Beginning reelection"); ((EntityState)this).outer.SetNextState((EntityState)(object)new ElectLeader()); return; } if (((EntityState)this).fixedAge + instance.squallTimeFired >= WhirlwindAspect.squallPreFireTime) { RefreshFiringState(); } float num = StormsCore.squallFireDurationMin + StormsCore.squallFireDurationBonusPerOverspill * (float)Tools.CountOverspillTriangular(instance.squallContributorCountHighest); if (((EntityState)this).fixedAge + instance.squallTimeFired >= num + WhirlwindAspect.squallPreFireTime) { Log.Debug("End squall"); ((EntityState)this).outer.SetNextState((EntityState)(object)GetNextState()); } } public override void OnExit() { if ((Object)(object)base.leaderElite != (Object)null) { base.leaderElite.firingState = AffixSquallBehavior.FiringState.Off; } squallTargetBody = null; base.OnExit(); if (!resetting) { instance.squallTimeFired = 0f; } else { instance.squallTimeFired += ((EntityState)this).fixedAge; } } public override BaseCycloneState GetNextState() { resetting = true; instance.accumulatedSquallCharge = 0f; instance.accumulatedSquallTime = 0f; return new PrepareCyclone(); } } internal class Idle : BaseCycloneState { public override CycloneState cycloneState => CycloneState.Idle; public override BaseCycloneState GetNextState() { return new PrepareSquall(); } } public static CycloneController instance; public GameObject beamPreVfxInstance; public bool telegraphActive = false; public EntityStateMachine cycloneStateMachine; public AISkillDriver HowlSquallDriver; public Vector3? defaultConvergePosition; public static CharacterBody squallTargetBody; public static Vector3 convergePositionGround; public static Vector3 convergePositionAir; public float accumulatedSquallCharge = 0f; public float accumulatedSquallTime = 0f; public int squallContributorCountCurrent = 0; public int squallContributorCountHighest = 0; public float squallTimeFired = 0f; public CycloneState cycloneState { get { if (currentState == null) { return CycloneState.Idle; } return currentState.cycloneState; } } private BaseCycloneState currentState => cycloneStateMachine.state as BaseCycloneState; public AffixSquallBehavior leaderElite { get; private set; } public GameObject primaryCycloneInstance { get; private set; } internal void UpdatePreBeamTransform() { //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_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) if (!telegraphActive) { RoR2Application.onLateUpdate -= UpdatePreBeamTransform; return; } Ray beamRay = leaderElite.GetBeamRay(); beamPreVfxInstance.transform.SetPositionAndRotation(((Ray)(ref beamRay)).origin, Quaternion.LookRotation(((Ray)(ref beamRay)).direction)); } public static void DemoteCurrentLeader() { squallTargetBody = null; if (!((Object)(object)instance != (Object)null)) { return; } if ((Object)(object)instance.leaderElite != (Object)null) { instance.leaderElite.firingState = AffixSquallBehavior.FiringState.Off; if (((ItemBehavior)instance.leaderElite).body.HasBuff(StormsCore.CycloneLeader)) { ((ItemBehavior)instance.leaderElite).body.RemoveBuff(StormsCore.CycloneLeader); } } instance.leaderElite = null; } public static bool GetShouldConverge() { return (Object)(object)instance != (Object)null && (instance.defaultConvergePosition.HasValue || (Object)(object)instance.leaderElite != (Object)null); } public static void AddSquallCharge(float charge) { if (!((Object)(object)instance == (Object)null) && instance.cycloneState != CycloneState.FiringSquall) { instance.accumulatedSquallCharge += charge; } } public static void AddSquallTime(float time) { if (!((Object)(object)instance == (Object)null) && instance.cycloneState != CycloneState.FiringSquall) { instance.accumulatedSquallTime += time; } } public static void SetContributorCount(int count) { if (!((Object)(object)instance == (Object)null) && instance.cycloneState != CycloneState.FiringSquall) { instance.squallContributorCountCurrent = count; if (count > instance.squallContributorCountHighest) { instance.squallContributorCountHighest = count; } } } private void Awake() { //IL_002f: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) cycloneStateMachine = EntityStateMachine.FindByCustomName(((Component)this).gameObject, "Cyclone"); HowlSquallDriver = ((Component)this).gameObject.AddComponent<AISkillDriver>(); HowlSquallDriver.aimType = (AimType)2; HowlSquallDriver.buttonPressType = (ButtonPressType)1; HowlSquallDriver.movementType = (MovementType)0; HowlSquallDriver.moveTargetType = (TargetType)3; HowlSquallDriver.activationRequiresAimConfirmation = false; HowlSquallDriver.activationRequiresAimTargetLoS = false; HowlSquallDriver.activationRequiresTargetLoS = false; HowlSquallDriver.aimVectorDampTimeOverride = WhirlwindAspect.squallAimDamping; HowlSquallDriver.aimVectorMaxSpeedOverride = WhirlwindAspect.squallAimMaxSpeed; HowlSquallDriver.customName = "FireSquall"; HowlSquallDriver.driverUpdateTimerOverride = 1f; HowlSquallDriver.maxDistance = float.PositiveInfinity; HowlSquallDriver.moveInputScale = 1f; HowlSquallDriver.shouldFireEquipment = true; HowlSquallDriver.selectionRequiresAimTarget = false; HowlSquallDriver.selectionRequiresOnGround = false; HowlSquallDriver.selectionRequiresTargetLoS = false; HowlSquallDriver.selectionRequiresTargetNonFlier = false; } private void OnEnabl