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 Inferno v1.8.1
Inferno.dll
Decompiled 20 hours 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.Linq; using System.Reflection; using System.Runtime.CompilerServices; 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 Downpour; using EntityStates; using EntityStates.BeetleGuardMonster; using EntityStates.BeetleMonster; using EntityStates.BeetleQueenMonster; using EntityStates.Bison; using EntityStates.BrotherHaunt; using EntityStates.BrotherMonster; using EntityStates.BrotherMonster.Weapon; using EntityStates.ClayBoss; using EntityStates.ClayBoss.ClayBossWeapon; using EntityStates.ClayBruiser.Weapon; using EntityStates.ClayGrenadier; using EntityStates.GolemMonster; using EntityStates.GrandParentBoss; using EntityStates.GravekeeperBoss; using EntityStates.GravekeeperMonster.Weapon; using EntityStates.GreaterWispMonster; using EntityStates.Gup; using EntityStates.HermitCrab; using EntityStates.ImpBossMonster; using EntityStates.ImpMonster; using EntityStates.LemurianBruiserMonster; using EntityStates.LemurianMonster; using EntityStates.LunarWisp; using EntityStates.MajorConstruct.Weapon; using EntityStates.MiniMushroom; using EntityStates.MinorConstruct.Weapon; using EntityStates.Missions.BrotherEncounter; using EntityStates.NullifierMonster; using EntityStates.TitanMonster; using EntityStates.Treebot.Weapon; using EntityStates.VagrantMonster; using EntityStates.VoidBarnacle.Weapon; using EntityStates.VoidMegaCrab; using EntityStates.Wisp1Monster; using IL.EntityStates.AI.Walker; using IL.RoR2; using Inferno.Eclipse; using Inferno.ExtraSkinStuff; using Inferno.Item; using Inferno.Skill_Misc; using Inferno.Stat_AI; using InfernoSkinMod; using KinematicCharacterController; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using On.EntityStates; using On.EntityStates.BeetleGuardMonster; using On.EntityStates.BeetleMonster; using On.EntityStates.BeetleQueenMonster; using On.EntityStates.Bison; using On.EntityStates.BrotherHaunt; using On.EntityStates.BrotherMonster; using On.EntityStates.BrotherMonster.Weapon; using On.EntityStates.ClayBoss; using On.EntityStates.ClayBoss.ClayBossWeapon; using On.EntityStates.ClayBruiser.Weapon; using On.EntityStates.ClayGrenadier; using On.EntityStates.GolemMonster; using On.EntityStates.GrandParentBoss; using On.EntityStates.GravekeeperBoss; using On.EntityStates.GravekeeperMonster.Weapon; using On.EntityStates.GreaterWispMonster; using On.EntityStates.HermitCrab; using On.EntityStates.ImpBossMonster; using On.EntityStates.ImpMonster; using On.EntityStates.LemurianBruiserMonster; using On.EntityStates.LemurianMonster; using On.EntityStates.LunarWisp; using On.EntityStates.MajorConstruct.Weapon; using On.EntityStates.MiniMushroom; using On.EntityStates.MinorConstruct.Weapon; using On.EntityStates.Missions.BrotherEncounter; using On.EntityStates.NullifierMonster; using On.EntityStates.TitanMonster; using On.EntityStates.VagrantMonster; using On.EntityStates.VoidBarnacle.Weapon; using On.EntityStates.VoidMegaCrab; using On.EntityStates.Wisp1Monster; using On.RoR2; using On.RoR2.Projectile; using On.RoR2.UI; using R2API; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.Achievements; using RoR2.CharacterAI; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.Rendering.PostProcessing; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Inferno")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+b79dede12c8464773723fd4fa517a6163d52270f")] [assembly: AssemblyProduct("Inferno")] [assembly: AssemblyTitle("Inferno")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace Inferno { [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.*/)] [BepInPlugin("HIFU.Inferno", "Inferno", "1.8.1")] public class Main : BaseUnityPlugin { [CompilerGenerated] private static class <>O { public static hook_GetLocalizedStringByToken <0>__Language_GetLocalizedStringByToken; public static hook_FromDifficulty <1>__RuleDef_FromDifficulty; public static Action<CharacterBody> <2>__BodyChanges; public static StatHookEventHandler <3>__RecalculateStatsAPI_GetStatCoefficients; public static Action<CharacterMaster> <4>__MasterChanges; public static Manipulator <5>__LookBusy_OnEnter; public static Manipulator <6>__LookBusy_PickNewTargetLookDirection; public static Manipulator <7>__Wander_PickNewTargetLookPosition; public static hook_Start <8>__CurrentDifficultyIconController_Start; public static Manipulator <9>__Ambient; } public const string PluginGUID = "HIFU.Inferno"; public const string PluginAuthor = "HIFU"; public const string PluginName = "Inferno"; public const string PluginVersion = "1.8.1"; public static Main instance; public static DifficultyDef InfernoDiffDef; public static DifficultyIndex InfernoDiffIndex; public static AssetBundle inferno; public static ManualLogSource InfernoLogger; public static bool check; public static AISkillDriver BrotherHurtDash; public static AISkillDriver BrotherHurtLeap; public static List<AISkillDriver> hurtstuff = new List<AISkillDriver>(); public static ColorGrading cg; public static Vignette vn; public static bool ShouldRun = false; public static GameObject ppHolder; public static bool hasFired; public static UnlockableDef CommandoSkin; public static UnlockableDef BanditSkin; public static UnlockableDef CaptainSkin; public static UnlockableDef ArtificerSkin; public static UnlockableDef MercenarySkin; public static UnlockableDef RailgunnerSkin; private static readonly Random random = new Random(); private static readonly Random rnggggggggggggg = new Random(); private static readonly Random randomAttackSpeedFuckYou = new Random(); public static GameObject Ramp1; public static GameObject Ramp2; public static GameObject Ramp3; public static GameObject Rocks; public static int ShardCount = 0; public static Shader cloudRemap; public static Material matMercDelayedBillboard; public static Material matMercDelayedBillboard2; public static Material matMercEnergized; public static Material matMercEvisTarget; public static Material matMercExposed; public static Material matMercExposedBackdrop; public static Material matMercExposedSlash; public static Material matMercFocusedAssaultIcon; public static Material matMercHologram; public static Material matMercIgnition; public static Material matMercSwipe1; public static Material matMercSwipe2; public static Material matMercSwipe3; private static readonly string s = "Assets/InfernoSkins/"; public static bool EclipseExtendedLoaded = false; public static string eclipseDescString; public static Color32 infernoColor = new Color32((byte)105, (byte)30, (byte)37, byte.MaxValue); private static int? vanillaAmbientLevelCap; public static ConfigEntry<float> Scaling { get; set; } public static ConfigEntry<float> LevelRegen { get; set; } public static ConfigEntry<float> LevelMoveSpeed { get; set; } public static ConfigEntry<float> LevelAttackSpeed { get; set; } public static ConfigEntry<float> LoopArmor { get; set; } public static ConfigEntry<float> BossHp { get; set; } public static ConfigEntry<float> MonsterHp { get; set; } public static ConfigEntry<float> StageCooldownReduction { get; set; } public static ConfigEntry<float> LevelDiffBoost { get; set; } public static ConfigEntry<bool> LevelDiffBoostScaleWithPlayers { get; set; } public static ConfigEntry<float> AllyPermanentDamage { get; set; } public static ConfigEntry<float> ProjectileSpeed { get; set; } public static ConfigEntry<int> MonsterLimit { get; set; } public static ConfigEntry<bool> EnableAI { get; set; } public static ConfigEntry<float> AIScaling { get; set; } public static ConfigEntry<bool> EnableSkills { get; set; } public static ConfigEntry<bool> EnableStats { get; set; } public static ConfigEntry<bool> EnableCDirector { get; set; } public static ConfigEntry<float> CreditMultiplier { get; set; } public static ConfigEntry<float> TeleporterSpeed { get; set; } public static ConfigEntry<float> TeleporterSize { get; set; } public static ConfigEntry<float> ColorGradingRedGain { get; set; } public static ConfigEntry<float> VignetteIntensity { get; set; } public static ConfigEntry<float> PostProcessingWeight { get; set; } public static ConfigEntry<bool> MithrixAS { get; set; } public static ConfigEntry<bool> Important { get; set; } public static ConfigEntry<bool> EnableMithrixChanges { get; set; } public static ConfigEntry<bool> DisableInfernalEclipse { get; set; } public static bool InfernalEclipseEnabled => !DisableInfernalEclipse.Value; public static ConfigEntry<float> PillarSpeed { get; set; } public void Awake() { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Expected O, but got Unknown //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_055d: Expected O, but got Unknown //IL_0562: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_057d: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Expected O, but got Unknown //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Expected O, but got Unknown //IL_0597: Unknown result type (might be due to invalid IL or missing references) //IL_059c: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_05b2: Unknown result type (might be due to invalid IL or missing references) //IL_05c2: Expected O, but got Unknown //IL_05bd: Unknown result type (might be due to invalid IL or missing references) //IL_05c7: Expected O, but got Unknown //IL_05cc: Unknown result type (might be due to invalid IL or missing references) //IL_05d1: Unknown result type (might be due to invalid IL or missing references) //IL_05dc: Unknown result type (might be due to invalid IL or missing references) //IL_05e7: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Expected O, but got Unknown //IL_05f2: Unknown result type (might be due to invalid IL or missing references) //IL_05fc: Expected O, but got Unknown //IL_0601: Unknown result type (might be due to invalid IL or missing references) //IL_0606: Unknown result type (might be due to invalid IL or missing references) //IL_0611: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_062c: Expected O, but got Unknown //IL_0627: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Expected O, but got Unknown //IL_0636: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Unknown result type (might be due to invalid IL or missing references) //IL_0646: Unknown result type (might be due to invalid IL or missing references) //IL_0651: Unknown result type (might be due to invalid IL or missing references) //IL_0661: Expected O, but got Unknown //IL_065c: Unknown result type (might be due to invalid IL or missing references) //IL_0666: Expected O, but got Unknown //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_0670: Unknown result type (might be due to invalid IL or missing references) //IL_067b: Unknown result type (might be due to invalid IL or missing references) //IL_0686: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Expected O, but got Unknown //IL_0691: Unknown result type (might be due to invalid IL or missing references) //IL_069b: Expected O, but got Unknown //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_06bb: Unknown result type (might be due to invalid IL or missing references) //IL_06cb: Expected O, but got Unknown //IL_06c6: Unknown result type (might be due to invalid IL or missing references) //IL_06d0: Expected O, but got Unknown //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06e5: Unknown result type (might be due to invalid IL or missing references) //IL_06f0: Unknown result type (might be due to invalid IL or missing references) //IL_0700: Expected O, but got Unknown //IL_06fb: Unknown result type (might be due to invalid IL or missing references) //IL_0705: Expected O, but got Unknown //IL_070a: Unknown result type (might be due to invalid IL or missing references) //IL_070f: Unknown result type (might be due to invalid IL or missing references) //IL_071a: Unknown result type (might be due to invalid IL or missing references) //IL_0725: Unknown result type (might be due to invalid IL or missing references) //IL_0735: Expected O, but got Unknown //IL_0730: Unknown result type (might be due to invalid IL or missing references) //IL_073a: Expected O, but got Unknown //IL_073f: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_075a: Unknown result type (might be due to invalid IL or missing references) //IL_076a: Expected O, but got Unknown //IL_0765: Unknown result type (might be due to invalid IL or missing references) //IL_076f: Expected O, but got Unknown //IL_0774: Unknown result type (might be due to invalid IL or missing references) //IL_077e: Expected O, but got Unknown //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Expected O, but got Unknown //IL_0792: Unknown result type (might be due to invalid IL or missing references) //IL_0797: Unknown result type (might be due to invalid IL or missing references) //IL_07a2: Unknown result type (might be due to invalid IL or missing references) //IL_07ad: Unknown result type (might be due to invalid IL or missing references) //IL_07bd: Expected O, but got Unknown //IL_07b8: Unknown result type (might be due to invalid IL or missing references) //IL_07c2: Expected O, but got Unknown //IL_07c7: Unknown result type (might be due to invalid IL or missing references) //IL_07cc: Unknown result type (might be due to invalid IL or missing references) //IL_07dc: Expected O, but got Unknown //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07e1: Expected O, but got Unknown //IL_07e6: Unknown result type (might be due to invalid IL or missing references) //IL_07eb: Unknown result type (might be due to invalid IL or missing references) //IL_07f6: Unknown result type (might be due to invalid IL or missing references) //IL_0801: Unknown result type (might be due to invalid IL or missing references) //IL_0811: Expected O, but got Unknown //IL_080c: Unknown result type (might be due to invalid IL or missing references) //IL_0816: Expected O, but got Unknown //IL_081b: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_0830: Expected O, but got Unknown //IL_082b: Unknown result type (might be due to invalid IL or missing references) //IL_0835: Expected O, but got Unknown //IL_083a: Unknown result type (might be due to invalid IL or missing references) //IL_083f: Unknown result type (might be due to invalid IL or missing references) //IL_084f: Expected O, but got Unknown //IL_084a: Unknown result type (might be due to invalid IL or missing references) //IL_0854: Expected O, but got Unknown //IL_0859: Unknown result type (might be due to invalid IL or missing references) //IL_085e: Unknown result type (might be due to invalid IL or missing references) //IL_0865: Unknown result type (might be due to invalid IL or missing references) //IL_0875: Expected O, but got Unknown //IL_0870: Unknown result type (might be due to invalid IL or missing references) //IL_087a: Expected O, but got Unknown //IL_087f: Unknown result type (might be due to invalid IL or missing references) //IL_0884: Unknown result type (might be due to invalid IL or missing references) //IL_088f: Unknown result type (might be due to invalid IL or missing references) //IL_089a: Unknown result type (might be due to invalid IL or missing references) //IL_08aa: Expected O, but got Unknown //IL_08a5: Unknown result type (might be due to invalid IL or missing references) //IL_08af: Expected O, but got Unknown //IL_08b4: Unknown result type (might be due to invalid IL or missing references) //IL_08b9: Unknown result type (might be due to invalid IL or missing references) //IL_08c4: Unknown result type (might be due to invalid IL or missing references) //IL_08cf: Unknown result type (might be due to invalid IL or missing references) //IL_08df: Expected O, but got Unknown //IL_08da: Unknown result type (might be due to invalid IL or missing references) //IL_08e4: Expected O, but got Unknown //IL_08e9: Unknown result type (might be due to invalid IL or missing references) //IL_08ee: Unknown result type (might be due to invalid IL or missing references) //IL_08f9: Unknown result type (might be due to invalid IL or missing references) //IL_0904: Unknown result type (might be due to invalid IL or missing references) //IL_0914: Expected O, but got Unknown //IL_090f: Unknown result type (might be due to invalid IL or missing references) //IL_0919: Expected O, but got Unknown //IL_091e: Unknown result type (might be due to invalid IL or missing references) //IL_0923: Unknown result type (might be due to invalid IL or missing references) //IL_092e: Unknown result type (might be due to invalid IL or missing references) //IL_0939: Unknown result type (might be due to invalid IL or missing references) //IL_0949: Expected O, but got Unknown //IL_0944: Unknown result type (might be due to invalid IL or missing references) //IL_094e: Expected O, but got Unknown //IL_0953: Unknown result type (might be due to invalid IL or missing references) //IL_095d: Expected O, but got Unknown //IL_0978: Unknown result type (might be due to invalid IL or missing references) //IL_0982: Expected O, but got Unknown //IL_097d: Unknown result type (might be due to invalid IL or missing references) //IL_0987: Expected O, but got Unknown //IL_098c: Unknown result type (might be due to invalid IL or missing references) //IL_0991: Unknown result type (might be due to invalid IL or missing references) //IL_09a1: Expected O, but got Unknown //IL_099c: Unknown result type (might be due to invalid IL or missing references) //IL_09a6: Expected O, but got Unknown //IL_09c1: Unknown result type (might be due to invalid IL or missing references) //IL_09cb: Expected O, but got Unknown //IL_09c6: Unknown result type (might be due to invalid IL or missing references) //IL_09d0: Expected O, but got Unknown //IL_09d5: Unknown result type (might be due to invalid IL or missing references) //IL_09da: Unknown result type (might be due to invalid IL or missing references) //IL_09e5: Unknown result type (might be due to invalid IL or missing references) //IL_09f0: Unknown result type (might be due to invalid IL or missing references) //IL_0a00: Expected O, but got Unknown //IL_09fb: Unknown result type (might be due to invalid IL or missing references) //IL_0a05: Expected O, but got Unknown //IL_0a0a: Unknown result type (might be due to invalid IL or missing references) //IL_0a0f: Unknown result type (might be due to invalid IL or missing references) //IL_0a1a: Unknown result type (might be due to invalid IL or missing references) //IL_0a25: Unknown result type (might be due to invalid IL or missing references) //IL_0a35: Expected O, but got Unknown //IL_0a30: Unknown result type (might be due to invalid IL or missing references) //IL_0a3a: Expected O, but got Unknown //IL_0a3f: Unknown result type (might be due to invalid IL or missing references) //IL_0a44: Unknown result type (might be due to invalid IL or missing references) //IL_0a4f: Unknown result type (might be due to invalid IL or missing references) //IL_0a5a: Unknown result type (might be due to invalid IL or missing references) //IL_0a6a: Expected O, but got Unknown //IL_0a65: Unknown result type (might be due to invalid IL or missing references) //IL_0a6f: Expected O, but got Unknown //IL_0a8a: Unknown result type (might be due to invalid IL or missing references) //IL_0a94: Expected O, but got Unknown //IL_0a8f: Unknown result type (might be due to invalid IL or missing references) //IL_0a99: Expected O, but got Unknown //IL_0a9e: Unknown result type (might be due to invalid IL or missing references) //IL_0aa8: Expected O, but got Unknown //IL_0aad: Unknown result type (might be due to invalid IL or missing references) //IL_0ab2: Unknown result type (might be due to invalid IL or missing references) //IL_0ae1: Unknown result type (might be due to invalid IL or missing references) //IL_0ae6: Unknown result type (might be due to invalid IL or missing references) //IL_0aec: Expected O, but got Unknown //IL_0b01: Unknown result type (might be due to invalid IL or missing references) //IL_0b06: Unknown result type (might be due to invalid IL or missing references) //IL_0b0c: Expected O, but got Unknown instance = this; InfernoLogger = ((BaseUnityPlugin)this).Logger; EclipseExtendedLoaded = false; eclipseDescString = "<style=cDeath>Infernal Eclipse</style> is a gamemode that adds stacking challenge modifiers to your run.\n\nEach time you <style=cDeath>beat the game</style>, your <style=cDeath>Infernal Eclipse</style> level <style=cDeath>permanently increases</style> with that Survivor, up to a maximum of <style=cDeath>" + (EclipseExtendedLoaded ? "16" : "8") + "</style> times."; inferno = AssetBundle.LoadFromFile(Assembly.GetExecutingAssembly().Location.Replace("Inferno.dll", "inferno")); cloudRemap = Addressables.LoadAssetAsync<Shader>((object)"RoR2/Base/Shaders/HGCloudRemap.shader").WaitForCompletion(); Body.Init(); Material[] array = inferno.LoadAllAssets<Material>(); foreach (Material val in array) { if (((Object)val.shader).name == "StubbedShader/fx/hgcloudremap") { val.shader = cloudRemap; } } matMercDelayedBillboard = inferno.LoadAsset<Material>(s + "matMercDelayedBillboard.mat"); matMercDelayedBillboard2 = inferno.LoadAsset<Material>(s + "matMercDelayedBillboard2.mat"); matMercEnergized = inferno.LoadAsset<Material>(s + "matMercEnergized.mat"); Items.Create(); Important = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "! Important !", true, "Make sure everyone's configs are the same for multiplayer!"); Scaling = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Difficulty Scaling", 150f, "Percentage of difficulty scaling, 150% is +50%. Difficulty order does not update visually. Vanilla is 150"); LevelMoveSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Enemy Move Speed Scaling", 0.12f, "Adds move speed to each monster every level. Vanilla is 0"); LevelRegen = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Enemy Regen Scaling", 0.12f, "Adds health regen to each monster every level. Vanilla is 0"); LevelAttackSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Enemy Attack Speed Scaling", 0.003f, "Adds attack speed to each monster every level. Vanilla is 0"); LoopArmor = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Enemy Armor Scaling", 10f, "Adds armor to each monster every completed loop. Vanilla is 0"); MonsterHp = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Enemy Health Scaling", 0.06f, "Adds % max hp to each monster every completed stage. Vanilla is 0"); BossHp = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Boss Health Scaling", 0.07f, "Adds % max hp to each boss every completed stage. Vanilla is 0"); StageCooldownReduction = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Enemy Cooldown Reduction Scaling", 0.01f, "Adds % cooldown reduction to each monster every completed stage. Vanilla is 0"); ProjectileSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("General II", "Enemy Projectile Speed", 1.25f, "Sets the projectile speed multiplier. Vanilla is 1"); LevelDiffBoost = ((BaseUnityPlugin)this).Config.Bind<float>("General II", "Level and Difficulty Boost", 1.25f, "Adds to ambient level and difficulty coefficient. Vanilla is 0"); LevelDiffBoostScaleWithPlayers = ((BaseUnityPlugin)this).Config.Bind<bool>("General II", "Scale Difficulty Boost with player count?", false, "Vanilla is false"); AllyPermanentDamage = ((BaseUnityPlugin)this).Config.Bind<float>("General III", "Ally Permanent Damage", 0f, "Makes allies take % max hp permanent damage. Vanilla is 0, Eclipse 8 is 40"); MonsterLimit = ((BaseUnityPlugin)this).Config.Bind<int>("General II", "Enemy Cap", 60, "Sets the enemy cap. Vanilla is 40"); EnableAI = ((BaseUnityPlugin)this).Config.Bind<bool>("General II", "Enable AI Changes?", true, "Vanilla is false"); AIScaling = ((BaseUnityPlugin)this).Config.Bind<float>("General II", "AI Scaling Coefficient", 1f, "Adds to AI aim and range every cleared stage. Only works with AI Changes enabled. Vanilla is false"); EnableSkills = ((BaseUnityPlugin)this).Config.Bind<bool>("General II", "Enable Skill Changes?", true, "Vanilla is false"); EnableStats = ((BaseUnityPlugin)this).Config.Bind<bool>("General II", "Enable Stat Changes?", true, "Vanilla is false"); EnableCDirector = ((BaseUnityPlugin)this).Config.Bind<bool>("General II", "Enable Combat Director Changes?", true, "Makes the combat director spawn monsters closer and with more variety during looping. Vanilla is false"); CreditMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("General II", "C. Director Credit Multiplier", 0.05f, "Adds to the combat director credit multiplier every cleared stage. Vanilla is 0"); TeleporterSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("General III", "Holdout Zone Speed", 30f, "Adds to the percent of holdout zone speed. Vanilla is 0"); TeleporterSize = ((BaseUnityPlugin)this).Config.Bind<float>("General III", "Holdout Zone Radius", -30f, "Adds to the percent of holdout zone radius. Vanilla is 0"); PillarSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("General III", "Pillar Speed", 30f, "Adds to the percent of pillar speed. Vanilla is 0"); DisableInfernalEclipse = ((BaseUnityPlugin)this).Config.Bind<bool>("General III", "Disable Infernal Eclipse?", false, "Turns off all Infernal Eclipse changes. Eclipse runs no longer get Inferno modifiers, and the Eclipse menu, medals, icons and text stay vanilla."); MigrateInfernalEclipseConfig(); MithrixAS = ((BaseUnityPlugin)this).Config.Bind<bool>("Bullshit", "Make Mithrix scale with Attack Speed?", false, "Vanilla is false"); ColorGradingRedGain = ((BaseUnityPlugin)this).Config.Bind<float>("Post Processing", "Red Gain", 3.7f, "Vanilla is 0"); VignetteIntensity = ((BaseUnityPlugin)this).Config.Bind<float>("Post Processing", "Vignette Intensity", 0.21f, "Vanilla is 0"); PostProcessingWeight = ((BaseUnityPlugin)this).Config.Bind<float>("Post Processing", "Strength", 1f, "Vanilla is 0"); EnableMithrixChanges = ((BaseUnityPlugin)this).Config.Bind<bool>("Mod Compatibility", "Enable Mithrix Changes?", true, "Useful when playing with another mod that changes Mithrix. Best to change before fighting Mithrix. Vanilla is false"); AddDifficulty(); FillTokens(); PostProcessingSetup.Gupdate(); ModSettingsManager.SetModIcon(inferno.LoadAsset<Sprite>("texInferno2Icon.png")); ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("! Important ! ", "General", "Make sure everyone's configs are the same for multiplayer!", " ", new UnityAction(ResetConfig))); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(Scaling, new StepSliderConfig { increment = 25f, min = 0f, max = 1600f })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(LevelAttackSpeed, new StepSliderConfig { increment = 0.001f, min = 0f, max = 0.1f })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(LevelMoveSpeed, new StepSliderConfig { increment = 0.01f, min = 0f, max = 1f })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(LevelRegen, new StepSliderConfig { increment = 0.01f, min = 0f, max = 1f })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(StageCooldownReduction, new StepSliderConfig { increment = 0.01f, min = 0f, max = 1f })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(LoopArmor, new StepSliderConfig { increment = 5f, min = 0f, max = 50f })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(MonsterHp, new StepSliderConfig { increment = 0.01f, min = 0f, max = 0.5f })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(BossHp, new StepSliderConfig { increment = 0.01f, min = 0f, max = 0.5f })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(ProjectileSpeed, new StepSliderConfig { increment = 0.05f, min = 1f, max = 5f })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(LevelDiffBoost, new StepSliderConfig { increment = 0.25f, min = 0f, max = 10f })); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(LevelDiffBoostScaleWithPlayers)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(EnableCDirector)); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(CreditMultiplier, new StepSliderConfig { increment = 0.01f, min = 0f, max = 0.25f })); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(EnableAI, new CheckBoxConfig { description = "If in a run, restart it to apply changes. Vanilla is false" })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(AIScaling, new StepSliderConfig { increment = 0.1f, min = 0f, max = 3f })); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(EnableSkills, new CheckBoxConfig { description = "If in a run, restart it to apply changes. Vanilla is false" })); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(EnableStats, new CheckBoxConfig { description = "If in a run, restart it to apply changes. Vanilla is false" })); ModSettingsManager.AddOption((BaseOption)new IntSliderOption(MonsterLimit, new IntSliderConfig { min = 0, max = 200 })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(AllyPermanentDamage, new StepSliderConfig { increment = 5f, min = 0f, max = 500f })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(TeleporterSpeed, new StepSliderConfig { increment = 3f, min = -99f, max = 99f })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(TeleporterSize, new StepSliderConfig { increment = 3f, min = -70f, max = 99f })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(PillarSpeed, new StepSliderConfig { increment = 3f, min = -99f, max = 99f })); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(DisableInfernalEclipse)); ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("", "General", "Note that upon hitting the Reset to default button, this menu does not visually update until you leave the settings and go back in.", "Reset to default", new UnityAction(ResetConfig))); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(MithrixAS, new CheckBoxConfig { category = "Bullshit" })); ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("", "Bullshit", "Random bullshit go", "Randomize Config", new UnityAction(RandomizeConfig))); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(ColorGradingRedGain, new StepSliderConfig { increment = 0.1f, min = 0f, max = 20f })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(VignetteIntensity, new StepSliderConfig { increment = 0.01f, min = 0f, max = 1f })); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(PostProcessingWeight, new StepSliderConfig { increment = 0.01f, min = 0f, max = 1f })); ModSettingsManager.AddOption((BaseOption)new GenericButtonOption("", "Post Processing", "Note that upon hitting the Reset to default button, this menu does not visually update until you leave the settings and go back in.", "Reset to default", new UnityAction(ResetPostProcessing))); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(EnableMithrixChanges)); SkillDef obj = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Beetle/BeetleBodySleep.asset").WaitForCompletion(); obj.baseMaxStock = 0; obj.stockToConsume = 69; obj.requiredStock = 69; object obj2 = <>O.<0>__Language_GetLocalizedStringByToken; if (obj2 == null) { hook_GetLocalizedStringByToken val2 = Language_GetLocalizedStringByToken; <>O.<0>__Language_GetLocalizedStringByToken = val2; obj2 = (object)val2; } Language.GetLocalizedStringByToken += (hook_GetLocalizedStringByToken)obj2; object obj3 = <>O.<1>__RuleDef_FromDifficulty; if (obj3 == null) { hook_FromDifficulty val3 = RuleDef_FromDifficulty; <>O.<1>__RuleDef_FromDifficulty = val3; obj3 = (object)val3; } RuleDef.FromDifficulty += (hook_FromDifficulty)obj3; InfernalEclipse.Init(); Run.onRunSetRuleBookGlobal += ChangeAmbientCap; Run.onRunStartGlobal += delegate(Run run) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_005d: Expected O, but got Unknown //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Expected O, but got Unknown //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown ShouldRun = false; if (IsInferno(run.selectedDifficulty)) { if (EnableStats.Value) { CharacterBody.onBodyStartGlobal += Body.BodyChanges; object obj4 = <>O.<3>__RecalculateStatsAPI_GetStatCoefficients; if (obj4 == null) { StatHookEventHandler val4 = Hooks.RecalculateStatsAPI_GetStatCoefficients; <>O.<3>__RecalculateStatsAPI_GetStatCoefficients = val4; obj4 = (object)val4; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj4; } if (EnableAI.Value) { CharacterMaster.onStartGlobal += Master.MasterChanges; object obj5 = <>O.<5>__LookBusy_OnEnter; if (obj5 == null) { Manipulator val5 = Hooks.LookBusy_OnEnter; <>O.<5>__LookBusy_OnEnter = val5; obj5 = (object)val5; } LookBusy.OnEnter += (Manipulator)obj5; object obj6 = <>O.<6>__LookBusy_PickNewTargetLookDirection; if (obj6 == null) { Manipulator val6 = Hooks.LookBusy_PickNewTargetLookDirection; <>O.<6>__LookBusy_PickNewTargetLookDirection = val6; obj6 = (object)val6; } LookBusy.PickNewTargetLookDirection += (Manipulator)obj6; object obj7 = <>O.<7>__Wander_PickNewTargetLookPosition; if (obj7 == null) { Manipulator val7 = Hooks.Wander_PickNewTargetLookPosition; <>O.<7>__Wander_PickNewTargetLookPosition = val7; obj7 = (object)val7; } Wander.PickNewTargetLookPosition += (Manipulator)obj7; } if (EnableSkills.Value) { HookBehavior.ApplyHooks(); } object obj8 = <>O.<8>__CurrentDifficultyIconController_Start; if (obj8 == null) { hook_Start val8 = InfernalEclipse.CurrentDifficultyIconController_Start; <>O.<8>__CurrentDifficultyIconController_Start = val8; obj8 = (object)val8; } CurrentDifficultyIconController.Start += (hook_Start)obj8; object obj9 = <>O.<9>__Ambient; if (obj9 == null) { Manipulator val9 = Hooks.Ambient; <>O.<9>__Ambient = val9; obj9 = (object)val9; } Run.RecalculateDifficultyCoefficentInternal += (Manipulator)obj9; ShouldRun = true; } }; Run.onRunDestroyGlobal += delegate { //IL_0030: 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_003b: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_0090: 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_009b: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown //IL_00d5: 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_00e0: Expected O, but got Unknown //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Expected O, but got Unknown CharacterBody.onBodyStartGlobal -= Body.BodyChanges; object obj4 = <>O.<3>__RecalculateStatsAPI_GetStatCoefficients; if (obj4 == null) { StatHookEventHandler val4 = Hooks.RecalculateStatsAPI_GetStatCoefficients; <>O.<3>__RecalculateStatsAPI_GetStatCoefficients = val4; obj4 = (object)val4; } RecalculateStatsAPI.GetStatCoefficients -= (StatHookEventHandler)obj4; CharacterMaster.onStartGlobal -= Master.MasterChanges; object obj5 = <>O.<5>__LookBusy_OnEnter; if (obj5 == null) { Manipulator val5 = Hooks.LookBusy_OnEnter; <>O.<5>__LookBusy_OnEnter = val5; obj5 = (object)val5; } LookBusy.OnEnter -= (Manipulator)obj5; object obj6 = <>O.<6>__LookBusy_PickNewTargetLookDirection; if (obj6 == null) { Manipulator val6 = Hooks.LookBusy_PickNewTargetLookDirection; <>O.<6>__LookBusy_PickNewTargetLookDirection = val6; obj6 = (object)val6; } LookBusy.PickNewTargetLookDirection -= (Manipulator)obj6; object obj7 = <>O.<7>__Wander_PickNewTargetLookPosition; if (obj7 == null) { Manipulator val7 = Hooks.Wander_PickNewTargetLookPosition; <>O.<7>__Wander_PickNewTargetLookPosition = val7; obj7 = (object)val7; } Wander.PickNewTargetLookPosition -= (Manipulator)obj7; HookBehavior.UndoHooks(); object obj8 = <>O.<9>__Ambient; if (obj8 == null) { Manipulator val8 = Hooks.Ambient; <>O.<9>__Ambient = val8; obj8 = (object)val8; } Run.RecalculateDifficultyCoefficentInternal -= (Manipulator)obj8; object obj9 = <>O.<8>__CurrentDifficultyIconController_Start; if (obj9 == null) { hook_Start val9 = InfernalEclipse.CurrentDifficultyIconController_Start; <>O.<8>__CurrentDifficultyIconController_Start = val9; obj9 = (object)val9; } CurrentDifficultyIconController.Start -= (hook_Start)obj9; RestoreAmbientCap(); ShouldRun = false; }; ChangeMercParticles.ChangeLights(); } private void MigrateInfernalEclipseConfig() { ConfigEntry<bool> val = ((BaseUnityPlugin)this).Config.Bind<bool>("General III", "Set Inferno as Base Eclipse difficulty?", true, "Replaced by \"Disable Infernal Eclipse?\""); if (!val.Value) { DisableInfernalEclipse.Value = true; } ((BaseUnityPlugin)this).Config.Remove(((ConfigEntryBase)val).Definition); ((BaseUnityPlugin)this).Config.Save(); } private void RandomizeConfig() { RandomizeScaling(); RandomizeLevelAttackSpeed(); RandomizeLevelMoveSpeed(); RandomizeLevelRegen(); RandomizeLoopArmor(); RandomizeBossHp(); RandomizeProjectileSpeed(); RandomizeLevelDiffBoost(); RandomizeCreditMultiplier(); RandomizeAIScaling(); RandomizeMonsterLimit(); RandomizeTeleporterSize(); RandomizeTeleporterSpeed(); RandomizeCooldownScaling(); } private void RandomizeScaling() { Scaling.Value = (int)Math.Round((float)rnggggggggggggg.Next(0, 64), MidpointRounding.ToEven) * 25; } private void RandomizeLevelRegen() { LevelRegen.Value = (float)Math.Round(random.NextDouble(), 2); } private void RandomizeLevelMoveSpeed() { LevelMoveSpeed.Value = (float)Math.Round(random.NextDouble(), 2); } private void RandomizeLevelAttackSpeed() { LevelAttackSpeed.Value = (float)Math.Round(randomAttackSpeedFuckYou.NextDouble() * 0.10000000149011612 + 0.0, 3); } private void RandomizeLoopArmor() { LoopArmor.Value = (float)Math.Round((float)rnggggggggggggg.Next(1, 10), MidpointRounding.ToEven) * 5f; } private void RandomizeProjectileSpeed() { ProjectileSpeed.Value = (float)Math.Round((float)rnggggggggggggg.Next(20, 100), MidpointRounding.ToEven) * 0.05f; } private void RandomizeLevelDiffBoost() { LevelDiffBoost.Value = (float)Math.Round((float)rnggggggggggggg.Next(0, 40), MidpointRounding.ToEven) * 0.25f; } private void RandomizeMonsterLimit() { MonsterLimit.Value = random.Next(0, 200); } private void RandomizeBossHp() { BossHp.Value = (float)Math.Round((float)rnggggggggggggg.Next(0, 50), MidpointRounding.ToEven) * 0.01f; } private void RandomizeCreditMultiplier() { CreditMultiplier.Value = (float)Math.Round((float)rnggggggggggggg.Next(0, 25), MidpointRounding.ToEven) * 0.01f; } private void RandomizeTeleporterSize() { TeleporterSize.Value = (float)Math.Round((float)rnggggggggggggg.Next(-10, 10), MidpointRounding.ToEven) * 5f; } private void RandomizeTeleporterSpeed() { TeleporterSpeed.Value = (float)Math.Round((float)rnggggggggggggg.Next(-10, 10), MidpointRounding.ToEven) * 5f; } private void RandomizeAIScaling() { AIScaling.Value = (float)Math.Round((float)rnggggggggggggg.Next(0, 30), MidpointRounding.ToEven) * 0.1f; } private void RandomizeCooldownScaling() { StageCooldownReduction.Value = (float)Math.Round((float)rnggggggggggggg.Next(0, 100), MidpointRounding.ToEven) * 0.01f; } private void ResetConfig() { Scaling.Value = 150f; LevelRegen.Value = 0.12f; LevelMoveSpeed.Value = 0.12f; LevelAttackSpeed.Value = 0.003f; LoopArmor.Value = 10f; MonsterHp.Value = 0.06f; BossHp.Value = 0.07f; StageCooldownReduction.Value = 0.01f; ProjectileSpeed.Value = 1.25f; LevelDiffBoost.Value = 1.25f; LevelDiffBoostScaleWithPlayers.Value = false; AllyPermanentDamage.Value = 0f; MonsterLimit.Value = 60; EnableAI.Value = true; AIScaling.Value = 1f; EnableSkills.Value = true; EnableStats.Value = true; EnableCDirector.Value = true; CreditMultiplier.Value = 0.05f; TeleporterSpeed.Value = 30f; TeleporterSize.Value = -30f; PillarSpeed.Value = 30f; MithrixAS.Value = false; } private void ResetPostProcessing() { ColorGradingRedGain.Value = 3.7f; VignetteIntensity.Value = 0.21f; PostProcessingWeight.Value = 1f; } public void FixedUpdate() { //IL_005c: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) if (ShouldRun) { ppHolder.SetActive(true); ((ParameterOverride<bool>)(object)((PostProcessEffectSettings)cg).enabled).value = true; ((ParameterOverride<float>)(object)cg.contrast).value = 70f; ((ParameterOverride<Vector4>)(object)cg.gain).value = new Vector4(ColorGradingRedGain.Value, 1f, 1f, 2.5f); ((ParameterOverride<float>)(object)vn.intensity).value = VignetteIntensity.Value; ((ParameterOverride<float>)(object)cg.hueShift).value = 0f; ((ParameterOverride<float>)(object)cg.postExposure).value = 0f; ((ParameterOverride<float>)(object)cg.saturation).value = -9.610426f; ((ParameterOverride<float>)(object)cg.temperature).value = 0f; ((ParameterOverride<float>)(object)cg.tint).value = 0f; ((ParameterOverride<VignetteMode>)(object)vn.mode).value = (VignetteMode)0; ((ParameterOverride<Color>)(object)vn.color).value = Color32.op_Implicit(new Color32((byte)105, (byte)30, (byte)37, byte.MaxValue)); ((ParameterOverride<float>)(object)vn.smoothness).value = 0.7f; ((ParameterOverride<bool>)(object)vn.rounded).value = false; ppHolder.GetComponent<PostProcessVolume>().weight = PostProcessingWeight.Value; } else { ppHolder.SetActive(false); } if ((Object)(object)InfernoSkinModPlugin.BanditSkin != (Object)null) { InfernoSkinModPlugin.BanditSkin.unlockableDef = BanditSkin; } if ((Object)(object)InfernoSkinModPlugin.CommandoSkin != (Object)null) { InfernoSkinModPlugin.CommandoSkin.unlockableDef = CommandoSkin; } if ((Object)(object)InfernoSkinModPlugin.CaptainSkin != (Object)null) { InfernoSkinModPlugin.CaptainSkin.unlockableDef = CaptainSkin; } if ((Object)(object)InfernoSkinModPlugin.ArtificerSkin != (Object)null) { InfernoSkinModPlugin.ArtificerSkin.unlockableDef = ArtificerSkin; } if ((Object)(object)InfernoSkinModPlugin.MercenarySkin != (Object)null) { InfernoSkinModPlugin.MercenarySkin.unlockableDef = MercenarySkin; } if ((Object)(object)InfernoSkinModPlugin.RailgunnerSkin != (Object)null) { InfernoSkinModPlugin.RailgunnerSkin.unlockableDef = RailgunnerSkin; } } public void ChangeAmbientCap(Run run, RuleBook useless) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (IsInferno(run.selectedDifficulty)) { int valueOrDefault = vanillaAmbientLevelCap.GetValueOrDefault(); if (!vanillaAmbientLevelCap.HasValue) { valueOrDefault = Run.ambientLevelCap; vanillaAmbientLevelCap = valueOrDefault; } Run.ambientLevelCap = int.MaxValue; } else { RestoreAmbientCap(); } } public static void RestoreAmbientCap() { if (vanillaAmbientLevelCap.HasValue) { Run.ambientLevelCap = vanillaAmbientLevelCap.Value; vanillaAmbientLevelCap = null; } } private static string Language_GetLocalizedStringByToken(orig_GetLocalizedStringByToken orig, Language self, string token) { InfernoDiffDef.scalingValue = Scaling.Value / 50f; if (token == "INFERNO_DESCRIPTION") { return "For veteran players. Every step requires utmost focus and awareness. You will be obliterated.<style=cStack>\n\n>Player Health Regeneration: <style=cDeath>-40%</style> \n" + ((Scaling.Value <= 0f) ? ">Difficulty Scaling: <style=cDeath>0%</style>\n" : ((Scaling.Value == 100f) ? "" : ((Scaling.Value < 100f) ? (">Difficulty Scaling: <style=cIsHealing>" + (Scaling.Value - 100f) + "% + Endless</style>\n") : (">Difficulty Scaling: <style=cDeath>+" + (Scaling.Value - 100f) + "% + Endless</style>\n")))) + ((LevelAttackSpeed.Value > 0f || LevelMoveSpeed.Value > 0f || LevelRegen.Value > 0f) ? ">Enemy Stats: <style=cDeath>Constantly Increasing</style>\n" : "") + ((ProjectileSpeed.Value > 1f) ? (">Enemy Projectile Speed: <style=cDeath>+" + (ProjectileSpeed.Value - 1f) * 100f + "%</style>\n") : "") + (EnableCDirector.Value ? ">Combat Director: <style=cDeath>Resourceful</style>\n" : "") + ((LevelDiffBoost.Value > 0f) ? ">Starting Difficulty: <style=cDeath>Increased</style>\n" : "") + ((EnableSkills.Value || EnableStats.Value) ? ">Enemy Abilities: <style=cDeath>Improved</style>\n" : "") + (EnableAI.Value ? (">Enemy AI: <style=cDeath>Refined" + ((AIScaling.Value > 0f) ? " + Evolving</style>\n" : "</style>\n")) : "") + (((float)MonsterLimit.Value == 40f) ? "" : (((float)MonsterLimit.Value < 40f) ? (">Enemy Cap: <style=cIsHealing>" + ((float)MonsterLimit.Value - 40f) / 40f * 100f + "%</style>\n") : (">Enemy Cap: <style=cDeath>+" + ((float)MonsterLimit.Value - 40f) / 40f * 100f + "%</style>\n"))) + ((AllyPermanentDamage.Value > 0f) ? ">Allies receive <style=cDeath>permanent damage</style>\n" : "") + "</style>"; } if (InfernalEclipseEnabled) { switch (token) { case "TITLE_ECLIPSE": return "<style=cDeath>Infernal Eclipse</style>"; case "ECLIPSE_GAMEMODE_NAME": return "<style=cDeath>Infernal Eclipse</style>"; case "TITLE_EXTRAGAMEMODE_DESC": return "Play alternate Risk of Rain 2 gamemodes, like Prismatic Trials and <style=cDeath>Infernal Eclipse</style>."; case "ECLIPSE_GAMEMODE_DESCRIPTION": return eclipseDescString; case "ECLIPSE_GAMEMODE_START": return "Start <style=cDeath>Infernal Eclipse</style>"; case "ECLIPSE_1_NAME": return "<style=cDeath>Infernal Eclipse (1)</style>"; case "ECLIPSE_2_NAME": return "<style=cDeath>Infernal Eclipse (2)</style>"; case "ECLIPSE_3_NAME": return "<style=cDeath>Infernal Eclipse (3)</style>"; case "ECLIPSE_4_NAME": return "<style=cDeath>Infernal Eclipse (4)</style>"; case "ECLIPSE_5_NAME": return "<style=cDeath>Infernal Eclipse (5)</style>"; case "ECLIPSE_6_NAME": return "<style=cDeath>Infernal Eclipse (6)</style>"; case "ECLIPSE_7_NAME": return "<style=cDeath>Infernal Eclipse (7)</style>"; case "ECLIPSE_8_NAME": return "<style=cDeath>Infernal Eclipse (8)</style>"; case "GROOVYECLIPSE_0_NAME": return "<style=cDeath>Infernal Eclipse (9)</style>"; case "GROOVYECLIPSE_1_NAME": return "<style=cDeath>Infernal Eclipse (10)</style>"; case "GROOVYECLIPSE_2_NAME": return "<style=cDeath>Infernal Eclipse (11)</style>"; case "GROOVYECLIPSE_3_NAME": return "<style=cDeath>Infernal Eclipse (12)</style>"; case "GROOVYECLIPSE_4_NAME": return "<style=cDeath>Infernal Eclipse (13)</style>"; case "GROOVYECLIPSE_5_NAME": return "<style=cDeath>Infernal Eclipse (14)</style>"; case "GROOVYECLIPSE_6_NAME": return "<style=cDeath>Infernal Eclipse (15)</style>"; case "GROOVYECLIPSE_7_NAME": return "<style=cDeath>Infernal Eclipse (16)</style>"; } } return orig.Invoke(self, token); } public void AddDifficulty() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) InfernoDiffDef = new DifficultyDef(Scaling.Value / 50f, "INFERNO_NAME", "INFERNO_ICON", "INFERNO_DESCRIPTION", Color32.op_Implicit(new Color32((byte)105, (byte)30, (byte)37, byte.MaxValue)), "if", true); InfernoDiffDef.iconSprite = inferno.LoadAsset<Sprite>("texInfernoIcon.png"); InfernoDiffDef.foundIconSprite = true; InfernoDiffIndex = DifficultyAPI.AddDifficulty(InfernoDiffDef); } private static RuleDef RuleDef_FromDifficulty(orig_FromDifficulty orig) { RuleDef val = orig.Invoke(); List<RuleChoiceDef> choices = val.choices; RuleChoiceDef val2 = choices.Find((RuleChoiceDef choice) => choice.difficultyIndex == InfernoDiffIndex); if (val2 == null) { return val; } RuleChoiceDef val3 = ((val.defaultChoiceIndex >= 0 && val.defaultChoiceIndex < choices.Count) ? choices[val.defaultChoiceIndex] : null); choices.Remove(val2); int num = choices.FindLastIndex(delegate(RuleChoiceDef choice) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) string text = DifficultyCatalog.GetDifficultyDef(choice.difficultyIndex)?.nameToken; return (text == "SS2_DIFFICULTY_TYPHOON_NAME" || text == "FFTS_DIFFICULTY_WHIRLWIND_NAME") ? true : false; }); if (num < 0) { num = choices.FindIndex((RuleChoiceDef choice) => (int)choice.difficultyIndex == 2); } choices.Insert(num + 1, val2); if (val3 != null) { val.defaultChoiceIndex = choices.IndexOf(val3); } return val; } public static bool IsInferno(DifficultyIndex difficultyIndex) { //IL_0000: 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) DifficultyDef difficultyDef = DifficultyCatalog.GetDifficultyDef(difficultyIndex); if ((difficultyDef == null || difficultyDef != InfernoDiffDef) && (!InfernalEclipseEnabled || !InfernalEclipse.IsEclipseDifficulty(difficultyIndex))) { if (DownpourCompat.enabled) { return DownpourCompat.IsBrimstone(difficultyDef); } return false; } return true; } public void FillTokens() { InfernoDiffDef.scalingValue = Scaling.Value / 50f; LanguageAPI.Add("INFERNO_NAME", "Inferno"); LanguageAPI.Add("INFERNO_DESCRIPTION", "For veteran players. Every step requires utmost focus and awareness. You will be obliterated.<style=cStack>\n\n>Player Health Regeneration: <style=cDeath>-40%</style> \n" + ((Scaling.Value <= 0f) ? ">Difficulty Scaling: <style=cDeath>0%</style>\n" : ((Scaling.Value == 100f) ? "" : ((Scaling.Value < 100f) ? (">Difficulty Scaling: <style=cIsHealing>" + (Scaling.Value - 100f) + "% + Endless</style>\n") : (">Difficulty Scaling: <style=cDeath>+" + (Scaling.Value - 100f) + "% + Endless</style>\n")))) + ((LevelAttackSpeed.Value > 0f || LevelMoveSpeed.Value > 0f || LevelRegen.Value > 0f) ? ">Enemy Stats: <style=cDeath>Constantly Increasing</style>\n" : "") + ((ProjectileSpeed.Value > 1f) ? (">Enemy Projectile Speed: <style=cDeath>+" + (ProjectileSpeed.Value - 1f) * 100f + "%</style>\n") : "") + (EnableCDirector.Value ? ">Combat Director: <style=cDeath>Resourceful</style>\n" : "") + ((LevelDiffBoost.Value > 0f) ? ">Starting Difficulty: <style=cDeath>Increased</style>\n" : "") + ((EnableSkills.Value || EnableStats.Value) ? ">Enemy Abilities: <style=cDeath>Improved</style>\n" : "") + (EnableAI.Value ? (">Enemy AI: <style=cDeath>Refined" + ((AIScaling.Value > 0f) ? " + Evolving</style>\n" : "</style>\n")) : "") + (((float)MonsterLimit.Value == 40f) ? "" : (((float)MonsterLimit.Value < 40f) ? (">Enemy Cap: <style=cIsHealing>" + ((float)MonsterLimit.Value - 40f) / 40f * 100f + "%</style>") : (">Enemy Cap: <style=cDeath>+" + ((float)MonsterLimit.Value - 40f) / 40f * 100f + "%</style>\n"))) + ((AllyPermanentDamage.Value > 0f) ? ">Allies receive <style=cDeath>permanent damage</style>\n" : "") + "</style>"); LanguageAPI.Add("ACHIEVEMENT_COMMANDOCLEARGAMEINFERNO_NAME", "Commando: <style=cDeath>Survival</style>"); LanguageAPI.Add("ACHIEVEMENT_COMMANDOCLEARGAMEINFERNO_DESCRIPTION", "As Commando, beat the game or obliterate on <style=cDeath>Inferno</style>."); LanguageAPI.Add("ACHIEVEMENT_BANDIT2CLEARGAMEINFERNO_NAME", "Bandit: <style=cDeath>Survival</style>"); LanguageAPI.Add("ACHIEVEMENT_BANDIT2CLEARGAMEINFERNO_DESCRIPTION", "As Bandit, beat the game or obliterate on <style=cDeath>Inferno</style>."); LanguageAPI.Add("ACHIEVEMENT_CAPTAINCLEARGAMEINFERNO_NAME", "Captain: <style=cDeath>Survival</style>"); LanguageAPI.Add("ACHIEVEMENT_CAPTAINCLEARGAMEINFERNO_DESCRIPTION", "As Captain, beat the game or obliterate on <style=cDeath>Inferno</style>."); LanguageAPI.Add("ACHIEVEMENT_ARTIFICERCLEARGAMEINFERNO_NAME", "Artificer: <style=cDeath>Survival</style>"); LanguageAPI.Add("ACHIEVEMENT_ARTIFICERCLEARGAMEINFERNO_DESCRIPTION", "As Artificer, beat the game or obliterate on <style=cDeath>Inferno</style>."); LanguageAPI.Add("ACHIEVEMENT_MERCENARYCLEARGAMEINFERNO_NAME", "Mercenary: <style=cDeath>Survival</style>"); LanguageAPI.Add("ACHIEVEMENT_MERCENARYCLEARGAMEINFERNO_DESCRIPTION", "As Mercenary, beat the game or obliterate on <style=cDeath>Inferno</style>."); LanguageAPI.Add("ACHIEVEMENT_RAILGUNNERCLEARGAMEINFERNO_NAME", "Railgunner: <style=cDeath>Survival</style>"); LanguageAPI.Add("ACHIEVEMENT_RAILGUNNERCLEARGAMEINFERNO_DESCRIPTION", "As Railgunner, beat the game or obliterate on <style=cDeath>Inferno</style>."); LanguageAPI.Add("DOTFLARE_SKIN_BCAPTAIN_NAME", "<style=cDeath>Erised</style>"); LanguageAPI.Add("DOTFLARE_SKIN_CARTI_NAME", "<style=cDeath>Crystallized</style>"); LanguageAPI.Add("DOTFLARE_SKIN_DBANDIT_NAME", "<style=cDeath>Deadshot</style>"); LanguageAPI.Add("DOTFLARE_SKIN_HMERC_NAME", "<style=cDeath>Headless</style>"); LanguageAPI.Add("DOTFLARE_SKIN_MMANDO_NAME", "<style=cDeath>Overgrown</style>"); LanguageAPI.Add("DOTFLARE_SKIN_PGUNNER_NAME", "<style=cDeath>Buried</style>"); CommandoSkin = ScriptableObject.CreateInstance<UnlockableDef>(); CommandoSkin.cachedName = "Skins.Inferno_Commando"; CommandoSkin.nameToken = "ACHIEVEMENT_COMMANDOCLEARGAMEINFERNO_NAME"; CommandoSkin.achievementIcon = inferno.LoadAsset<Sprite>("Assets/InfernoSkins/texCommandoSkin.png"); ContentAddition.AddUnlockableDef(CommandoSkin); BanditSkin = ScriptableObject.CreateInstance<UnlockableDef>(); BanditSkin.cachedName = "Skins.Inferno_Bandit"; BanditSkin.nameToken = "ACHIEVEMENT_BANDIT2CLEARGAMEINFERNO_NAME"; BanditSkin.achievementIcon = inferno.LoadAsset<Sprite>("Assets/InfernoSkins/texBanditSkin.png"); ContentAddition.AddUnlockableDef(BanditSkin); CaptainSkin = ScriptableObject.CreateInstance<UnlockableDef>(); CaptainSkin.cachedName = "Skins.Inferno_Captain"; CaptainSkin.nameToken = "ACHIEVEMENT_CAPTAINCLEARGAMEINFERNO_NAME"; CaptainSkin.achievementIcon = inferno.LoadAsset<Sprite>("Assets/InfernoSkins/texCaptainSkin.png"); ContentAddition.AddUnlockableDef(CaptainSkin); ArtificerSkin = ScriptableObject.CreateInstance<UnlockableDef>(); ArtificerSkin.cachedName = "Skins.Inferno_Artificer"; ArtificerSkin.nameToken = "ACHIEVEMENT_ARTIFICERCLEARGAMEINFERNO_NAME"; ArtificerSkin.achievementIcon = inferno.LoadAsset<Sprite>("Assets/InfernoSkins/texArtificerSkin.png"); ContentAddition.AddUnlockableDef(ArtificerSkin); MercenarySkin = ScriptableObject.CreateInstance<UnlockableDef>(); MercenarySkin.cachedName = "Skins.Inferno_Mercenary"; MercenarySkin.nameToken = "ACHIEVEMENT_MERCENARYCLEARGAMEINFERNO_NAME"; MercenarySkin.achievementIcon = inferno.LoadAsset<Sprite>("Assets/InfernoSkins/texMercenarySkin.png"); ContentAddition.AddUnlockableDef(MercenarySkin); RailgunnerSkin = ScriptableObject.CreateInstance<UnlockableDef>(); RailgunnerSkin.cachedName = "Skins.Inferno_Railgunner"; RailgunnerSkin.nameToken = "ACHIEVEMENT_RAILGUNNERCLEARGAMEINFERNO_NAME"; RailgunnerSkin.achievementIcon = inferno.LoadAsset<Sprite>("Assets/InfernoSkins/texRailgunnerSkin.png"); ContentAddition.AddUnlockableDef(RailgunnerSkin); } } public class InfernoPermanentDamage : MonoBehaviour, IOnTakeDamageServerReceiver { public HealthComponent hc; public CharacterBody body; public void Start() { hc = ((Component)this).GetComponent<HealthComponent>(); if (!Object.op_Implicit((Object)(object)hc)) { Object.Destroy((Object)(object)this); } else { body = hc.body; } } public void OnTakeDamageServer(DamageReport damageReport) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Invalid comparison between Unknown and I4 if (Object.op_Implicit((Object)(object)body) && (int)body.teamComponent.teamIndex == 1) { int num = Mathf.FloorToInt(damageReport.damageDealt / hc.fullCombinedHealth * 100f * Main.AllyPermanentDamage.Value / 100f); for (int i = 0; i < num; i++) { body.AddBuff(Buffs.PermanentCurse); } } } } public static class RiskyModCompat { private static bool? _enabled; public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("com.RiskyLives.RiskyMod"); } return _enabled.Value; } } } public static class DownpourCompat { private static bool? _enabled; public static bool enabled { get { if (!_enabled.HasValue) { _enabled = Chainloader.PluginInfos.ContainsKey("prodzpod.Downpour"); } return _enabled.Value; } } [MethodImpl(MethodImplOptions.NoInlining)] public static bool IsBrimstone(DifficultyDef def) { return DownpourPlugin.BrimstoneList.Contains(def); } } internal class PeripheryV { } } namespace Inferno.Unlocks { public class BasePerSurvivorClearGameInfernoAchievement : BaseAchievement { public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); Run.onClientGameOverGlobal += OnClientGameOverGlobal; } public override void OnBodyRequirementBroken() { Run.onClientGameOverGlobal -= OnClientGameOverGlobal; ((BaseAchievement)this).OnBodyRequirementBroken(); } private void OnClientGameOverGlobal(Run run, RunReport runReport) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)runReport.gameEnding) && runReport.gameEnding.isWin && Main.IsInferno(runReport.ruleBook.FindDifficulty())) { ((BaseAchievement)this).Grant(); } } } [RegisterAchievement("CommandoClearGameInferno", "Skins.Inferno_Commando", null, 30u, null)] public class CommandoClearGameInfernoAchievement : BasePerSurvivorClearGameInfernoAchievement { public override BodyIndex LookUpRequiredBodyIndex() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("CommandoBody"); } } [RegisterAchievement("Bandit2ClearGameInferno", "Skins.Inferno_Bandit", "CompleteThreeStages", 30u, null)] public class BanditClearGameInfernoAchievement : BasePerSurvivorClearGameInfernoAchievement { public override BodyIndex LookUpRequiredBodyIndex() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("Bandit2Body"); } } [RegisterAchievement("CaptainClearGameInferno", "Skins.Inferno_Captain", "CompleteMainEnding", 30u, null)] public class CaptainClearGameInfernoAchievement : BasePerSurvivorClearGameInfernoAchievement { public override BodyIndex LookUpRequiredBodyIndex() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("CaptainBody"); } } [RegisterAchievement("ArtificerClearGameInferno", "Skins.Inferno_Artificer", "FreeMage", 30u, null)] public class ArtificerClearGameInfernoAchievement : BasePerSurvivorClearGameInfernoAchievement { public override BodyIndex LookUpRequiredBodyIndex() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("MageBody"); } } [RegisterAchievement("MercenaryClearGameInferno", "Skins.Inferno_Mercenary", "CompleteUnknownEnding", 30u, null)] public class MercenaryClearGameInfernoAchievement : BasePerSurvivorClearGameInfernoAchievement { public override BodyIndex LookUpRequiredBodyIndex() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("MercBody"); } } [RegisterAchievement("RailgunnerClearGameInferno", "Skins.Inferno_Railgunner", null, 30u, null)] public class RailgunnerClearGameInfernoAchievement : BasePerSurvivorClearGameInfernoAchievement { public override BodyIndex LookUpRequiredBodyIndex() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return BodyCatalog.FindBodyIndex("RailgunnerBody"); } } } namespace Inferno.Stat_AI { public static class Body { [CompilerGenerated] private static class <>O { public static hook_Init <0>__BodyCatalog_Init; } public static BodyIndex beetleQueenIndex; public static BodyIndex clayDunestriderIndex; public static BodyIndex grandparentIndex; public static BodyIndex grovetenderIndex; public static BodyIndex grovetenderWispIndex; public static BodyIndex impOverlordIndex; public static BodyIndex magmaWormIndex; public static BodyIndex mithrixIndex; public static BodyIndex mithrixP4Index; public static BodyIndex stoneTitanIndex; public static BodyIndex wanderingVagrantIndex; public static BodyIndex wanderingVagrantBombIndex; public static BodyIndex beetleIndex; public static BodyIndex beetleGuardIndex; public static BodyIndex bighornBisonIndex; public static BodyIndex blindPestIndex; public static BodyIndex clayTemplarIndex; public static BodyIndex elderLemurianIndex; public static BodyIndex greaterWispIndex; public static BodyIndex hermitCrabIndex; public static BodyIndex impIndex; public static BodyIndex jellyfishIndex; public static BodyIndex lemurianIndex; public static BodyIndex lesserWispIndex; public static BodyIndex lunarExploderIndex; public static BodyIndex lunarGolemIndex; public static BodyIndex lunarWispIndex; public static BodyIndex stoneGolemIndex; public static BodyIndex voidReaverIndex; public static BodyIndex xiConstructIndex; public static BodyIndex gupIndex; public static BodyIndex geepIndex; public static BodyIndex gipIndex; public static BodyIndex clayApothecaryIndex; public static BodyIndex parentIndex; public static BodyIndex miniMushrumIndex; public static BodyIndex solusControlUnitIndex; public static BodyIndex scavengerIndex; public static BodyIndex larvaIndex; public static BodyIndex aurelioniteIndex; public static BodyIndex solusProbeIndex; public static void Init() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown object obj = <>O.<0>__BodyCatalog_Init; if (obj == null) { hook_Init val = BodyCatalog_Init; <>O.<0>__BodyCatalog_Init = val; obj = (object)val; } BodyCatalog.Init += (hook_Init)obj; } private static IEnumerator BodyCatalog_Init(orig_Init orig) { yield return orig.Invoke(); beetleQueenIndex = BodyCatalog.FindBodyIndex("BeetleQueen2Body"); clayDunestriderIndex = BodyCatalog.FindBodyIndex("ClayBossBody"); grandparentIndex = BodyCatalog.FindBodyIndex("GrandParentBody"); grovetenderIndex = BodyCatalog.FindBodyIndex("GravekeeperBody"); grovetenderWispIndex = BodyCatalog.FindBodyIndex("GravekeeperTrackingFireball"); impOverlordIndex = BodyCatalog.FindBodyIndex("ImpBossBody"); magmaWormIndex = BodyCatalog.FindBodyIndex("MagmaWormBody"); mithrixIndex = BodyCatalog.FindBodyIndex("BrotherBody"); mithrixP4Index = BodyCatalog.FindBodyIndex("BrotherHurtBody"); stoneTitanIndex = BodyCatalog.FindBodyIndex("TitanBody"); wanderingVagrantIndex = BodyCatalog.FindBodyIndex("VagrantBody"); wanderingVagrantBombIndex = BodyCatalog.FindBodyIndex("VagrantTrackingBomb"); beetleIndex = BodyCatalog.FindBodyIndex("BeetleBody"); beetleGuardIndex = BodyCatalog.FindBodyIndex("BeetleGuardBody"); bighornBisonIndex = BodyCatalog.FindBodyIndex("BisonBody"); blindPestIndex = BodyCatalog.FindBodyIndex("FlyingVerminBody"); clayTemplarIndex = BodyCatalog.FindBodyIndex("ClayBruiserBody"); elderLemurianIndex = BodyCatalog.FindBodyIndex("LemurianBruiserBody"); greaterWispIndex = BodyCatalog.FindBodyIndex("GreaterWispBody"); hermitCrabIndex = BodyCatalog.FindBodyIndex("HermitCrabBody"); impIndex = BodyCatalog.FindBodyIndex("ImpBody"); jellyfishIndex = BodyCatalog.FindBodyIndex("JellyfishBody"); lemurianIndex = BodyCatalog.FindBodyIndex("LemurianBody"); lesserWispIndex = BodyCatalog.FindBodyIndex("WispBody"); lunarExploderIndex = BodyCatalog.FindBodyIndex("LunarExploderBody"); lunarGolemIndex = BodyCatalog.FindBodyIndex("LunarGolemBody"); lunarWispIndex = BodyCatalog.FindBodyIndex("LunarWispBody"); stoneGolemIndex = BodyCatalog.FindBodyIndex("GolemBody"); voidReaverIndex = BodyCatalog.FindBodyIndex("NullifierBody"); xiConstructIndex = BodyCatalog.FindBodyIndex("MegaConstructBody"); gupIndex = BodyCatalog.FindBodyIndex("GupBody"); geepIndex = BodyCatalog.FindBodyIndex("GeepBody"); gipIndex = BodyCatalog.FindBodyIndex("GipBody"); clayApothecaryIndex = BodyCatalog.FindBodyIndex("ClayGrenadierBody"); parentIndex = BodyCatalog.FindBodyIndex("ParentBody"); miniMushrumIndex = BodyCatalog.FindBodyIndex("MiniMushroomBody"); solusControlUnitIndex = BodyCatalog.FindBodyIndex("RoboBallBossBody"); scavengerIndex = BodyCatalog.FindBodyIndex("ScavBody"); larvaIndex = BodyCatalog.FindBodyIndex("AcidLarvaBody"); aurelioniteIndex = BodyCatalog.FindBodyIndex("TitanGoldBody"); solusProbeIndex = BodyCatalog.FindBodyIndex("RoboBallMiniBody"); } public static void BodyChanges(CharacterBody body) { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0383: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_037d: 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_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_0403: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) //IL_0418: 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_042d: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_0459: 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_0480: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_04ca: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_04f5: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Unknown result type (might be due to invalid IL or missing references) //IL_0526: Unknown result type (might be due to invalid IL or missing references) //IL_054f: 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_0590: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Unknown result type (might be due to invalid IL or missing references) //IL_05d1: Unknown result type (might be due to invalid IL or missing references) //IL_05d3: Unknown result type (might be due to invalid IL or missing references) //IL_05e6: Unknown result type (might be due to invalid IL or missing references) //IL_05e8: Unknown result type (might be due to invalid IL or missing references) //IL_05fb: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_0610: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Unknown result type (might be due to invalid IL or missing references) //IL_063d: Unknown result type (might be due to invalid IL or missing references) //IL_0650: Unknown result type (might be due to invalid IL or missing references) //IL_0652: Unknown result type (might be due to invalid IL or missing references) //IL_067b: Unknown result type (might be due to invalid IL or missing references) //IL_067d: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06a8: Unknown result type (might be due to invalid IL or missing references) if (body.isPlayerControlled) { return; } SetStateOnHurt component = ((Component)body).GetComponent<SetStateOnHurt>(); CharacterDirection component2 = ((Component)body).GetComponent<CharacterDirection>(); WormBodyPositions2 component3 = ((Component)body).GetComponent<WormBodyPositions2>(); WormBodyPositionsDriver component4 = ((Component)body).GetComponent<WormBodyPositionsDriver>(); if (Object.op_Implicit((Object)(object)component2)) { component2.turnSpeed = 360f; } if (Object.op_Implicit((Object)(object)component)) { component.canBeHitStunned = false; } if (Object.op_Implicit((Object)(object)component3)) { component3.speedMultiplier = 40f; component3.followDelay = 0.1f; } if (Object.op_Implicit((Object)(object)component4)) { component4.maxTurnSpeed = 1000f; } BodyIndex bodyIndex = body.bodyIndex; if (bodyIndex == beetleQueenIndex) { body.baseMaxHealth = 2500f; body.levelMaxHealth = 750f; body.mainRootSpeed = 14f; body.baseMoveSpeed = 14f; body.rootMotionInMainState = false; component2.driveFromRootRotation = false; component2.turnSpeed = 100f; } else if (bodyIndex == clayDunestriderIndex) { body.baseMaxHealth = 2500f; body.levelMaxHealth = 750f; body.baseMoveSpeed = 14f; } else if (bodyIndex == grandparentIndex) { body.baseMaxHealth = 4000f; body.levelMaxHealth = 1200f; } else if (bodyIndex == grovetenderIndex) { body.baseMaxHealth = 3200f; body.levelMaxHealth = 960f; body.baseMoveSpeed = 24f; } else if (bodyIndex == grovetenderWispIndex) { body.baseMoveSpeed = 50f; body.baseMaxHealth = 50f; body.levelMaxHealth = 15f; } else if (bodyIndex == impOverlordIndex) { body.baseMaxHealth = 3200f; body.levelMaxHealth = 960f; body.baseMoveSpeed = 13f; body.baseAcceleration = 200f; } else if (bodyIndex == magmaWormIndex) { body.baseMaxHealth = 2500f; body.levelMaxHealth = 750f; } else if (bodyIndex == mithrixIndex) { if (Main.EnableMithrixChanges.Value) { body.baseAcceleration = 200f; body.baseMoveSpeed = 17f; body.baseMaxHealth = 800f; body.levelMaxHealth = 240f; body.bodyFlags = (BodyFlags)(body.bodyFlags | 1); body.bodyFlags = (BodyFlags)(body.bodyFlags | 0x20); } } else if (bodyIndex == mithrixP4Index) { if (Main.EnableMithrixChanges.Value) { body.baseMaxHealth = 500f; body.levelMaxHealth = 150f; body.baseMoveSpeed = 10f; body.sprintingSpeedMultiplier = 1.45f; body.baseDamage = 5f; body.levelDamage = 1f; body.bodyFlags = (BodyFlags)(body.bodyFlags | 1); body.bodyFlags = (BodyFlags)(body.bodyFlags | 0x20); } } else if (bodyIndex == stoneTitanIndex) { body.baseMaxHealth = 2500f; body.levelMaxHealth = 750f; body.baseMoveSpeed = 12f; } else if (bodyIndex == wanderingVagrantIndex) { body.baseMaxHealth = 2500f; body.levelMaxHealth = 750f; body.baseMoveSpeed = 14f; body.baseAcceleration = 500f; } else if (bodyIndex == wanderingVagrantBombIndex) { body.baseMaxHealth = 90f; body.levelMaxHealth = 27f; } else if (bodyIndex == beetleIndex) { body.baseMoveSpeed = 12f; component.canBeStunned = false; body.bodyFlags = (BodyFlags)(body.bodyFlags | 1); } else if (bodyIndex == beetleGuardIndex) { body.baseMoveSpeed = 22f; } else if (bodyIndex == bighornBisonIndex) { body.baseMoveSpeed = 5f; body.bodyFlags = (BodyFlags)(body.bodyFlags | 1); } else if (bodyIndex == blindPestIndex) { body.baseMoveSpeed = 9f; body.baseDamage = 10f; body.levelDamage = 2f; } else if (bodyIndex == clayTemplarIndex) { body.baseMoveSpeed = 11f; body.baseDamage = 12f; body.levelDamage = 2.4f; } else if (bodyIndex == elderLemurianIndex) { body.baseMoveSpeed = 16f; } else if (bodyIndex == greaterWispIndex) { body.baseMoveSpeed = 12f; } else if (bodyIndex == hermitCrabIndex) { body.baseMoveSpeed = 22f; } else if (bodyIndex == impIndex) { body.baseMoveSpeed = 15f; } else if (bodyIndex == jellyfishIndex) { body.baseMoveSpeed = 13f; } else if (bodyIndex == lemurianIndex) { body.baseMoveSpeed = 10f; } else if (bodyIndex == lesserWispIndex) { body.baseMoveSpeed = 12f; body.baseAcceleration = 24f; component.canBeStunned = false; } else if (bodyIndex == lunarExploderIndex) { body.baseMoveSpeed = 16f; body.baseAcceleration = 1000f; } else if (bodyIndex == lunarGolemIndex) { body.baseMoveSpeed = 16f; } else if (bodyIndex == lunarWispIndex) { body.baseDamage = 10f; } else if (bodyIndex == stoneGolemIndex) { body.baseDamage = 16f; body.levelDamage = 3.2f; body.baseMoveSpeed = 8f; } else if (bodyIndex == voidReaverIndex) { body.baseMoveSpeed = 17f; component.canBeStunned = false; } else if (bodyIndex == xiConstructIndex) { body.baseMoveSpeed = 35f; } else if (bodyIndex == gupIndex) { body.baseMoveSpeed = 14f; body.baseMaxHealth = 700f; body.levelMaxHealth = 210f; } else if (bodyIndex == geepIndex) { body.baseMoveSpeed = 19f; body.baseMaxHealth = 550f; body.levelMaxHealth = 165f; body.baseDamage = 11f; body.levelDamage = 2.2f; } else if (bodyIndex == gipIndex) { body.baseMoveSpeed = 24f; body.baseMaxHealth = 350f; body.levelMaxHealth = 105f; body.baseDamage = 10f; body.levelDamage = 2f; } else if (bodyIndex == clayApothecaryIndex) { body.baseMoveSpeed = 12f; } else if (bodyIndex == parentIndex) { body.baseMoveSpeed = 17f; } else if (bodyIndex == miniMushrumIndex) { body.baseMoveSpeed = 6f; } else if (bodyIndex == solusControlUnitIndex) { body.baseMoveSpeed = 14f; body.baseMaxHealth = 3000f; body.levelMaxHealth = 900f; } else if (bodyIndex == scavengerIndex) { body.baseMoveSpeed = 9f; } else if (bodyIndex == larvaIndex) { body.sprintingSpeedMultiplier = 3f; body.baseMaxHealth = 80f; body.levelMaxHealth = 24f; } else if (bodyIndex == aurelioniteIndex) { body.baseMaxHealth = 2500f; body.levelMaxHealth = 750f; body.baseMoveSpeed = 12f; } else if (bodyIndex == solusProbeIndex) { body.baseMoveSpeed = 13f; } } } public static class Master { public static void MasterChanges(CharacterMaster master) { try { ApplyMasterChanges(master); } catch (Exception ex) { Main.InfernoLogger.LogWarning((object)("Failed to apply AI changes to " + ((Object)master).name + ": " + ex.Message)); } } private static void ApplyMasterChanges(CharacterMaster master) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 //IL_0c16: Unknown result type (might be due to invalid IL or missing references) //IL_1699: Unknown result type (might be due to invalid IL or missing references) //IL_0fc1: Unknown result type (might be due to invalid IL or missing references) //IL_06b6: Unknown result type (might be due to invalid IL or missing references) //IL_09ef: Unknown result type (might be due to invalid IL or missing references) //IL_0ff6: Unknown result type (might be due to invalid IL or missing references) //IL_1480: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Unknown result type (might be due to invalid IL or missing references) //IL_0be0: Unknown result type (might be due to invalid IL or missing references) //IL_0a2f: Unknown result type (might be due to invalid IL or missing references) //IL_07a6: Unknown result type (might be due to invalid IL or missing references) //IL_102b: Unknown result type (might be due to invalid IL or missing references) //IL_14c0: Unknown result type (might be due to invalid IL or missing references) //IL_0736: Unknown result type (might be due to invalid IL or missing references) //IL_0c4d: Unknown result type (might be due to invalid IL or missing references) //IL_094c: Unknown result type (might be due to invalid IL or missing references) //IL_0981: Unknown result type (might be due to invalid IL or missing references) if ((int)master.teamIndex != 2 && (int)master.teamIndex != 4) { return; } CharacterBody body = master.GetBody(); if (!Object.op_Implicit((Object)(object)body)) { return; } if (body.isChampion) { master.inventory.GiveItemPermanent(Items.TeleportWhenOob, 1); } body.levelMoveSpeed = Main.LevelMoveSpeed.Value; body.levelRegen = Main.LevelRegen.Value; body.levelAttackSpeed = Main.LevelAttackSpeed.Value; if (body.baseJumpPower < 20f) { body.baseJumpPower = 20f; } BaseAI component = ((Component)master).GetComponent<BaseAI>(); if (!Object.op_Implicit((Object)(object)component)) { return; } if (((Object)master).name != "GolemMaster(Clone)") { component.fullVision = true; component.aimVectorDampTime = Mathf.Max(0.001f, 0.031f - 0.0001f * Main.AIScaling.Value * (float)Run.instance.stageClearCount); component.aimVectorMaxSpeed = 250f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; component.enemyAttentionDuration = 1.5f; } else { component.fullVision = true; component.aimVectorDampTime = Mathf.Max(0.001f, 0.09f - 0.0003f * Main.AIScaling.Value * (float)Run.instance.stageClearCount); component.aimVectorMaxSpeed = 250f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; component.enemyAttentionDuration = 1.5f; } string name = ((Object)master).name; if (name == null) { return; } switch (name.Length) { case 24: switch (name[8]) { case 'e': if (name == "BeetleQueenMaster(Clone)") { (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Chase" select x).First().minDistance = 0f; AISkillDriver obj12 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "SpawnWards" select x).First(); obj12.maxDistance = 100f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; obj12.maxUserHealthFraction = float.PositiveInfinity; master.inventory.GiveItemPermanent(Items.AllCooldownItemDef, 25); } break; case 'p': if (name == "GravekeeperMaster(Clone)") { (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "RunAndShoot" select x).First().movementType = (MovementType)2; AISkillDriver obj11 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Hooks" select x).First(); obj11.movementType = (MovementType)2; obj11.maxUserHealthFraction = float.PositiveInfinity; obj11.minDistance = 13f; (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "WaitAroundUntilSkillIsBack" select x).First().movementType = (MovementType)2; } break; case 'u': if (name == "BrotherHurtMaster(Clone)" && Main.EnableMithrixChanges.Value) { AISkillDriver obj13 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "SlamGround" select x).First(); obj13.maxUserHealthFraction = float.PositiveInfinity; obj13.movementType = (MovementType)2; (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Shoot" select x).First().movementType = (MovementType)2; master.inventory.GiveItemPermanent(Items.PrimaryStockItemDef, 6); master.inventory.GiveItemPermanent(Items.AllCooldownItemDef, 5); } break; case 'a': if (name == "BeetleGuardMaster(Clone)") { (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "FireSunder" select x).First().maxDistance = 100f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; master.inventory.GiveItemPermanent(Items.AllCooldownItemDef, 25); master.inventory.GiveItemPermanent(Items.SecondaryStockItemDef, 2); } break; case 's': if (name == "ClayBruiserMaster(Clone)") { (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "WalkAndShoot" select x).First().movementType = (MovementType)2; } break; case 'i': if (name == "GreaterWispMaster(Clone)") { AISkillDriver obj10 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.minDistance == 15f select x).First(); obj10.movementType = (MovementType)2; obj10.maxDistance = 100f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; } break; } break; case 20: switch (name[1]) { case 'm': if (name == "ImpBossMaster(Clone)") { (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "GroundPound" select x).First().maxDistance = 12f; AISkillDriver obj9 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "FireVoidspikesWhenInRange" select x).First(); obj9.movementType = (MovementType)2; obj9.minDistance = 16f; (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "BlinkToTarget" select x).First().minDistance = 33f; } break; case 'r': if (name == "BrotherMaster(Clone)" && Main.EnableMithrixChanges.Value) { AISkillDriver val = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Sprint and FireLunarShards" select x).First(); val.minDistance = 0f; val.maxUserHealthFraction = float.PositiveInfinity; (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Sprint After Target" select x).First().minDistance = 40f - Main.AIScaling.Value * (float)Run.instance.stageClearCount; (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "DashStrafe" select x).First().nextHighPriorityOverride = val; master.inventory.GiveItemPermanent(Items.UtilityStockItemDef, 1); master.inventory.GiveItemPermanent(Items.SpecialStockItemDef, 1); master.inventory.GiveItemPermanent(Items.AllCooldownItemDef, 10); } break; case 'u': if (name == "VultureMaster(Clone)") { master.inventory.GiveItemPermanent(Items.AllCooldownItemDef, 25); } break; case 'a': if (name == "VagrantMaster(Clone)") { (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Chase" select x).First().minDistance = 25f; } break; } break; case 18: switch (name[0]) { case 'T': if (name == "TitanMaster(Clone)") { AISkillDriver obj7 = (from x in ((Component)master).GetComponents<AISkillDriver>() where (int)x.skillSlot == 3 select x).First(); obj7.maxUserHealthFraction = float.PositiveInfinity; obj7.minDistance = 16f; obj7.movementType = (MovementType)2; AISkillDriver obj8 = (from x in ((Component)master).GetComponents<AISkillDriver>() where (int)x.skillSlot == 2 select x).First(); obj8.maxUserHealthFraction = 0.8f; obj8.movementType = (MovementType)2; } break; case 'G': if (name == "GolemMaster(Clone)") { AISkillDriver obj6 = (from x in ((Component)master).GetComponents<AISkillDriver>() where (int)x.skillSlot == 1 select x).First(); obj6.selectionRequiresAimTarget = true; obj6.activationRequiresAimTargetLoS = true; obj6.activationRequiresAimConfirmation = true; obj6.maxDistance = 100f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; obj6.minDistance = 0f; } break; case 'B': if (name == "BisonMaster(Clone)") { AISkillDriver obj5 = (from x in ((Component)master).GetComponents<AISkillDriver>() where (int)x.skillSlot == 2 select x).First(); obj5.minDistance = 0f; obj5.maxDistance = 150f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; master.inventory.GiveItemPermanent(Items.AllCooldownItemDef, 20); } break; } break; case 19: switch (name[0]) { case 'B': if (name == "BeetleMaster(Clone)") { AISkillDriver obj = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "HeadbuttOffNodegraph" select x).First(); obj.maxDistance = 25f + 1f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; obj.selectionRequiresOnGround = true; obj.activationRequiresAimTargetLoS = true; } break; case 'P': if (name == "ParentMaster(Clone)") { (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Teleport" select x).First().maxUserHealthFraction = 1f; master.inventory.GiveItemPermanent(Items.AllCooldownItemDef, 33); } break; } break; case 25: switch (name[6]) { case 'V': if (name == "FlyingVerminMaster(Clone)") { AISkillDriver obj4 = (from x in ((Component)master).GetComponents<AISkillDriver>() where (int)x.skillSlot == 0 select x).First(); obj4.minDistance = 10f; obj4.maxDistance = 40f; } break; case 's': if (name == "MiniMushroomMaster(Clone)") { (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Spore Grenade" select x).First().maxDistance = 60f + 10f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Path" select x).First().shouldSprint = true; (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "PathStrafe" select x).First().shouldSprint = true; master.inventory.GiveItemPermanent(Items.AllCooldownItemDef, 25); } break; case 'g': if (name == "VoidMegaCrabMaster(Clone)") { master.inventory.GiveItemPermanent(Items.AllCooldownItemDef, 33); } break; case 'l': if (name == "RoboBallBossMaster(Clone)") { (from x in ((Component)master).GetComponents<AISkillDriver>() where (int)x.skillSlot == 3 select x).First().maxUserHealthFraction = 0.5f; master.inventory.GiveItemPermanent(Items.PrimaryStockItemDef, 1); } break; case 'r': if (name == "VoidBarnacleMaster(Clone)") { (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Shooty" select x).First().maxDistance = 100f; } break; } break; case 16: switch (name[0]) { case 'I': if (name == "ImpMaster(Clone)") { (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Slash" select x).First().maxDistance = 12f; } break; case 'G': if (na
InfernoSkinMod.dll
Decompiled 20 hours agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; using Microsoft.CodeAnalysis; using MonoMod.RuntimeDetour; using MonoMod.RuntimeDetour.HookGen; using RoR2; using RoR2.ContentManagement; using RuneFoxMods.DynamicSkins; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace RuneFoxMods { public class Utils { public static void PrintBodyCatalog() { Debug.Log((object)"\nBodyCatalog"); foreach (GameObject allBodyPrefab in BodyCatalog.allBodyPrefabs) { Debug.Log((object)((Object)allBodyPrefab).name); } Debug.Log((object)"\n"); } public static void ReadChildren(GameObject parent, int tabs, bool includecomponents = true) { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) string text = ""; for (int i = 0; i < tabs; i++) { text += " "; } for (int j = 0; j < parent.transform.childCount; j++) { Transform child = parent.transform.GetChild(j); if (!((Object)child == (Object)null)) { string text2 = ((Component)child).gameObject.activeInHierarchy.ToString(); Debug.Log((object)(text + ((Object)child).name + " " + text2 + " " + ((object)((Component)child).transform.position/*cast due to .constrained prefix*/).ToString())); if (includecomponents) { ReadComponents(((Component)child).gameObject, tabs + 1); Debug.Log((object)""); } ReadChildren(((Component)child).gameObject, tabs + 1, includecomponents); continue; } break; } } public static void readheiarchy(GameObject parent, bool includeComponents = true) { Debug.Log((object)((Object)parent).name); if (includeComponents) { ReadComponents(parent, 1); Debug.Log((object)""); } ReadChildren(parent, 1, includeComponents); } public static void ReadComponents(GameObject obj, int tabs) { string text = ""; for (int i = 0; i < tabs; i++) { text += " "; } Component[] components = obj.GetComponents(typeof(Component)); foreach (Component val in components) { string text2 = ""; Debug.Log((object)(text + "Comp: " + ((object)val).GetType().ToString() + " " + text2)); } } public static void PrintAllPaths(GameObject parent) { Debug.Log((object)((Object)parent).name); PrintAllPathsInner(parent, ((Object)parent).name); } public static void PrintAllPathsInner(GameObject parent, string parent_string) { int childCount = parent.transform.childCount; for (int i = 0; i < childCount; i++) { Transform child = parent.transform.GetChild(i); if (!((Object)child).name.EndsWith("_end")) { string text = parent_string + "/" + ((Object)child).name; Debug.Log((object)(" " + ((Object)child).name + "\t\t" + text)); PrintAllPathsInner(((Component)child).gameObject, text); continue; } break; } } public unsafe static void PrintDynamicBone(DynamicBone DB) { //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: 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_0190: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)("Root: " + (object)DB.m_Root)); Debug.Log((object)("Damping: " + DB.m_Damping)); Debug.Log((object)("Damping Dist: " + (object)DB.m_DampingDistrib)); Debug.Log((object)("Elasticity: " + DB.m_Elasticity)); Debug.Log((object)("Elasticity Dist: " + (object)DB.m_ElasticityDistrib)); Debug.Log((object)("Stiffness: " + DB.m_Stiffness)); Debug.Log((object)("Stiffness Dist: " + (object)DB.m_StiffnessDistrib)); Debug.Log((object)("Inert: " + DB.m_Inert)); Debug.Log((object)("Inert Dist: " + (object)DB.m_InertDistrib)); Debug.Log((object)("Radius: " + DB.m_Radius)); Debug.Log((object)("Radius Dist: " + (object)DB.m_RadiusDistrib)); Debug.Log((object)("End Length: " + DB.m_EndLength)); Vector3 endOffset = DB.m_EndOffset; Debug.Log((object)("End Offset: " + ((object)(*(Vector3*)(&endOffset))/*cast due to .constrained prefix*/).ToString())); endOffset = DB.m_Gravity; Debug.Log((object)("Gravity: " + ((object)(*(Vector3*)(&endOffset))/*cast due to .constrained prefix*/).ToString())); endOffset = DB.m_Force; Debug.Log((object)("Force: " + ((object)(*(Vector3*)(&endOffset))/*cast due to .constrained prefix*/).ToString())); Debug.Log((object)("FreezeAxis: " + ((object)Unsafe.As<FreezeAxis, FreezeAxis>(ref DB.m_FreezeAxis)/*cast due to .constrained prefix*/).ToString())); Debug.Log((object)("Colliders: " + DB.m_Colliders.Count)); foreach (DynamicBoneCollider collider in DB.m_Colliders) { Debug.Log((object)("\t Parent: " + ((Object)((Component)collider).transform).name)); Debug.Log((object)("\t Direction: " + ((object)Unsafe.As<Direction, Direction>(ref collider.m_Direction)/*cast due to .constrained prefix*/).ToString())); endOffset = collider.m_Center; Debug.Log((object)("\t Center " + ((object)(*(Vector3*)(&endOffset))/*cast due to .constrained prefix*/).ToString())); Debug.Log((object)("\t Bound " + ((object)Unsafe.As<Bound, Bound>(ref collider.m_Bound)/*cast due to .constrained prefix*/).ToString())); Debug.Log((object)("\t Radius " + collider.m_Radius)); Debug.Log((object)("\t Height " + collider.m_Height)); } Debug.Log((object)("Exclusions: " + DB.m_Exclusions.Count)); foreach (Transform exclusion in DB.m_Exclusions) { Debug.Log((object)("\t Transform: " + ((Object)exclusion).name)); } } public static ChildLocator GetChildLocator(GameObject body) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown ChildLocator val = null; Transform child = body.transform.GetChild(0); if (Object.op_Implicit((Object)child)) { Transform child2 = child.GetChild(0); if (Object.op_Implicit((Object)child2)) { val = ((Component)child2).GetComponent<ChildLocator>(); if (Object.op_Implicit((Object)val)) { Debug.Log((object)"Locator Found"); } } } return val; } public static Transform FindChildInTree(Transform Root, string name) { Queue<Transform> queue = new Queue<Transform>(); queue.Enqueue(Root); while (queue.Count != 0) { Transform val = queue.Dequeue(); if (((Object)val).name == name) { return val; } for (int i = 0; i < val.childCount; i++) { Transform child = val.GetChild(i); queue.Enqueue(child); } } return null; } public static string RemoveCloneNaming(string str) { return str.Remove(str.Length - 7); } } } namespace RuneFoxMods.DynamicSkins { public class AppliedModifications { public Stack<Modification> BaseModelModifications = new Stack<Modification>(); public List<Modification> OtherModifications = new List<Modification>(); } public class DynamicBoneColliderData { public string m_parent_name; public Direction m_Direction; public Vector3 m_Center; public Bound m_Bound; public float m_Radius; public float m_Height; public DynamicBoneColliderData(string parent_name, Direction direction, Vector3 Center, Bound bound, float radius, float heaight) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //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) //IL_001c: 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) m_parent_name = parent_name; m_Direction = direction; m_Center = Center; m_Bound = bound; m_Radius = radius; m_Height = heaight; } } public class DynamicBoneData { public string m_Root; public float m_Damping; public AnimationCurve m_DampingDistrib; public float m_Elasticity; public AnimationCurve m_ElasticityDistrib; public float m_Stiffness; public AnimationCurve m_StiffnessDistrib; public float m_Inert; public AnimationCurve m_InertDistrib; public float m_Radius; public AnimationCurve m_RadiusDistrib; public float m_EndLength; public Vector3 m_EndOffset; public Vector3 m_Gravity; public Vector3 m_Force; public List<DynamicBoneColliderData> m_Colliders; public List<string> m_Exclusions; public FreezeAxis m_FreezeAxis; public DynamicBoneData(string root, float damping, AnimationCurve damping_dist, float elasticity, AnimationCurve elasticity_dist, float stiffness, AnimationCurve stiffness_dist, float inert, AnimationCurve inert_dist, float radius, AnimationCurve radius_dist, float end_length, Vector3 end_offset, Vector3 gravity, Vector3 force, List<DynamicBoneColliderData> colliders, List<string> exclusions, FreezeAxis freeze_axis) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) m_Root = root; m_Damping = damping; m_DampingDistrib = damping_dist; m_Elasticity = elasticity; m_ElasticityDistrib = elasticity_dist; m_Stiffness = stiffness; m_StiffnessDistrib = stiffness_dist; m_Inert = inert; m_InertDistrib = inert_dist; m_Radius = radius; m_RadiusDistrib = radius_dist; m_EndLength = end_length; m_EndOffset = end_offset; m_Gravity = gravity; m_Force = force; m_Colliders = colliders; m_Exclusions = exclusions; m_FreezeAxis = freeze_axis; } } public static class DynamicSkinHelpers { public static SkinnedMeshRenderer[] GetBaseSkinRenderers(GameObject modelObject) { //IL_0021: 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_0036: Expected O, but got Unknown //IL_0036: Expected O, but got Unknown SkinnedMeshRenderer[] componentsInChildren = modelObject.GetComponentsInChildren<SkinnedMeshRenderer>(true); List<SkinnedMeshRenderer> list = new List<SkinnedMeshRenderer>(); SkinnedMeshRenderer[] array = componentsInChildren; foreach (SkinnedMeshRenderer val in array) { if ((Object)((Component)val).transform.parent == (Object)modelObject.transform) { list.Add(val); } } return list.ToArray(); } public static Transform[] BoneArrayBuilder(Transform NewBoneRoot) { List<Transform> list = new List<Transform>(); BoneArrayBuilderHelper(NewBoneRoot, list); return list.ToArray(); } public static void BoneArrayBuilderHelper(Transform parent, List<Transform> list) { if (!((Object)parent).name.EndsWith("_end")) { list.Add(parent); } for (int i = 0; i < parent.childCount; i++) { BoneArrayBuilderHelper(parent.GetChild(i), list); } } public static Transform GetArmature(GameObject obj) { return GetArmatureHelper(obj); } public static Transform GetArmatureHelper(GameObject obj) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown if (((Object)obj).name.ToLower().Contains("armature")) { return obj.transform; } for (int i = 0; i < obj.transform.childCount; i++) { Transform armatureHelper = GetArmatureHelper(((Component)obj.transform.GetChild(i)).gameObject); if (Object.op_Implicit((Object)armatureHelper)) { return armatureHelper; } } return null; } public static Transform GetTopParent(Transform obj) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown Transform val = obj; while ((Object)val.parent != (Object)null) { val = val.parent; } return val; } public static string GetPrevBoneInList(Transform targetBone, SkinnedMeshRenderer meshRenderer) { Transform[] bones = meshRenderer.bones; for (int i = 0; i <= bones.Length - 1; i++) { if (((Object)bones[i + 1]).name == ((Object)targetBone).name) { return ((Object)bones[i]).name; } } return null; } public static int GetBoneIndexInList(Transform targetBone, SkinnedMeshRenderer meshRenderer) { Transform[] bones = meshRenderer.bones; for (int i = 0; i <= bones.Length; i++) { if (((Object)bones[i]).name == ((Object)targetBone).name) { return i; } } return -1; } public static int GetPrevBoneIndexInList(Transform targetBone, SkinnedMeshRenderer meshRenderer) { Transform[] bones = meshRenderer.bones; for (int i = 0; i <= bones.Length - 1; i++) { if (((Object)bones[i + 1]).name == ((Object)targetBone).name) { return i; } } return -1; } } public class DynamicSkinManager { public Dictionary<string, SkinDef> SkinDefs = new Dictionary<string, SkinDef>(); public GameObject LastModelObject; public Dictionary<string, SortedList<int, Modification>> ModificationList = new Dictionary<string, SortedList<int, Modification>>(); public Dictionary<GameObject, AppliedModifications> ModifiedObjects = new Dictionary<GameObject, AppliedModifications>(); public ManualLogSource InstanceLogger; public void AddModification(string skinNameToken, int boneIndex, Modification modification) { if (!ModificationList.TryGetValue(skinNameToken, out var value)) { value = new SortedList<int, Modification>(); ModificationList.Add(skinNameToken, value); } value.Add(boneIndex, modification); } public void AddSkinDef(SkinDef skinDef) { SkinDefs.Add(skinDef.nameToken, skinDef); } public void SkinDefApply(Action<SkinDef, GameObject> orig, SkinDef self, GameObject modelObject) { orig(self, modelObject); RemoveInvalidModelObjects(); ModifiedObjects.TryGetValue(modelObject, out var value); try { if (self.nameToken == null || !SkinDefs.TryGetValue(self.nameToken, out var _)) { if (value != null) { ClearSkinModifications(modelObject, value); } } else if (value == null) { AppliedModifications appliedModifications = new AppliedModifications(); ModifiedObjects.Add(modelObject, appliedModifications); ApplySkinModifications(self, modelObject, appliedModifications); } } catch (Exception ex) { InstanceLogger.LogWarning((object)"An error occured while adding accessories to a skin"); InstanceLogger.LogError((object)ex); } } public void RemoveInvalidModelObjects() { foreach (GameObject item in ModifiedObjects.Keys.Where((GameObject el) => !Object.op_Implicit((Object)el)).ToList()) { ModifiedObjects.Remove(item); } } public void ClearSkinModifications(GameObject modelObject, AppliedModifications modifications) { while (modifications.BaseModelModifications.Count != 0) { Modification modification = modifications.BaseModelModifications.Pop(); clearModification(modification, modelObject, modifications); } while (modifications.OtherModifications.Count != 0) { clearModification(modifications.OtherModifications[0], modelObject, modifications); } ModifiedObjects.Remove(modelObject); } public void ApplySkinModifications(SkinDef skindef, GameObject modelObject, AppliedModifications modifications) { CharacterModel component = modelObject.GetComponent<CharacterModel>(); LastModelObject = modelObject; if (!ModificationList.TryGetValue(skindef.nameToken, out var value)) { return; } foreach (KeyValuePair<int, Modification> item in value) { ApplyModification(modelObject, component, item.Value, modifications); } } public static void ApplyModification(GameObject modelObject, CharacterModel characterModel, Modification modification, AppliedModifications modifications) { _ = modification.bodyname; string parentname = modification.parentname; Transform val = Utils.FindChildInTree(modelObject.transform, parentname); GameObject val2; if (modification.affectsbasemodel) { val2 = Object.Instantiate<GameObject>(modification.prefab, val, false); ((Object)val2).name = Utils.RemoveCloneNaming(((Object)val2).name); modification.instance = val2; modification.inst_armature = val2; ModificationApplyBones(modelObject, modification, modifications); } else { val2 = Object.Instantiate<GameObject>(modification.prefab, modelObject.transform, false); ((Object)val2).name = Utils.RemoveCloneNaming(((Object)val2).name); modification.instance = val2; Transform armature = DynamicSkinHelpers.GetArmature(val2); ((Component)armature).transform.SetParent(val, false); modification.inst_armature = ((Component)armature).gameObject; } modification.instance = val2; if (modification.dynamicBoneData != null) { ModificationApplyDynamicBones(modelObject, modification); } ModificationAddRenderers(val2, characterModel); modifications.OtherModifications.Add(modification); } public static void ModificationApplyBones(GameObject modelObject, Modification modification, AppliedModifications modifications) { SkinnedMeshRenderer[] baseSkinRenderers = DynamicSkinHelpers.GetBaseSkinRenderers(modelObject); List<Transform> list = baseSkinRenderers[0].bones.ToList(); Transform[] array = DynamicSkinHelpers.BoneArrayBuilder(modification.instance.transform); list.InsertRange(modification.boneIndex, array); modification.boneCount = array.Length; SkinnedMeshRenderer[] array2 = baseSkinRenderers; for (int i = 0; i < array2.Length; i++) { array2[i].bones = list.ToArray(); } modifications.BaseModelModifications.Push(modification); } public static void ModificationApplyDynamicBones(GameObject modelObject, Modification modification) { //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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: 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_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Expected O, but got Unknown //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) DynamicBone val = (modification.inst_dynamicBone = modification.instance.AddComponent<DynamicBone>()); List<DynamicBoneCollider> list = new List<DynamicBoneCollider>(); foreach (DynamicBoneColliderData collider in modification.dynamicBoneData.m_Colliders) { DynamicBoneCollider val2 = ((Component)Utils.FindChildInTree(modelObject.transform, collider.m_parent_name)).gameObject.AddComponent<DynamicBoneCollider>(); val2.m_Direction = collider.m_Direction; val2.m_Center = collider.m_Center; val2.m_Bound = collider.m_Bound; val2.m_Radius = collider.m_Radius; val2.m_Height = collider.m_Height; list.Add(val2); } modification.inst_DB_colliders = list; Transform root = (val.m_Root = Utils.FindChildInTree(modification.inst_armature.transform, modification.dynamicBoneData.m_Root)); val.m_Damping = modification.dynamicBoneData.m_Damping; val.m_DampingDistrib = modification.dynamicBoneData.m_DampingDistrib; val.m_Elasticity = modification.dynamicBoneData.m_Elasticity; val.m_ElasticityDistrib = modification.dynamicBoneData.m_ElasticityDistrib; val.m_Stiffness = modification.dynamicBoneData.m_Stiffness; val.m_StiffnessDistrib = modification.dynamicBoneData.m_StiffnessDistrib; val.m_Inert = modification.dynamicBoneData.m_Inert; val.m_InertDistrib = modification.dynamicBoneData.m_InertDistrib; val.m_Radius = modification.dynamicBoneData.m_Radius; val.m_RadiusDistrib = modification.dynamicBoneData.m_RadiusDistrib; val.m_EndLength = modification.dynamicBoneData.m_EndLength; val.m_EndOffset = modification.dynamicBoneData.m_EndOffset; val.m_Gravity = modification.dynamicBoneData.m_Gravity; val.m_Force = modification.dynamicBoneData.m_Force; val.m_Colliders = list; val.m_Exclusions = new List<Transform>(); foreach (string exclusion in modification.dynamicBoneData.m_Exclusions) { Transform val3 = Utils.FindChildInTree(root, exclusion); if ((Object)val3 != (Object)null) { val.m_Exclusions.Add(val3); } else { Debug.LogWarning((object)"Tried to exclude a transform that could not be found"); } } val.m_FreezeAxis = modification.dynamicBoneData.m_FreezeAxis; } public static void ModificationAddRenderers(GameObject newPart, CharacterModel characterModel) { //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_005d: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) SkinnedMeshRenderer[] componentsInChildren = newPart.GetComponentsInChildren<SkinnedMeshRenderer>(true); Array.Resize(ref characterModel.baseRendererInfos, characterModel.baseRendererInfos.Length + componentsInChildren.Length); if (componentsInChildren.Length != 0) { int num = componentsInChildren.Length; SkinnedMeshRenderer[] array = componentsInChildren; foreach (SkinnedMeshRenderer val in array) { characterModel.baseRendererInfos[characterModel.baseRendererInfos.Length - num] = new RendererInfo { renderer = (Renderer)componentsInChildren[^num], ignoreOverlays = false, defaultShadowCastingMode = (ShadowCastingMode)1, defaultMaterial = ((Renderer)val).sharedMaterial }; num--; } } } public void clearModification(Modification modification, GameObject modelObject, AppliedModifications modifications) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Expected O, but got Unknown //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown if (modification.inst_DB_colliders != null) { foreach (Object inst_DB_collider in modification.inst_DB_colliders) { Object.Destroy(inst_DB_collider); } } if (modification.affectsbasemodel) { SkinnedMeshRenderer[] baseSkinRenderers = DynamicSkinHelpers.GetBaseSkinRenderers(modelObject); List<Transform> list = baseSkinRenderers[0].bones.ToList(); list.RemoveRange(modification.boneIndex, modification.boneCount); SkinnedMeshRenderer[] array = baseSkinRenderers; for (int i = 0; i < array.Length; i++) { array[i].bones = list.ToArray(); } } Object.Destroy((Object)modifications.OtherModifications[0].inst_dynamicBone); Object.Destroy((Object)modifications.OtherModifications[0].inst_armature); Object.Destroy((Object)modifications.OtherModifications[0].instance); if (!modifications.OtherModifications.Remove(modification)) { InstanceLogger.LogError((object)"Skin Modification was not removed"); } } } public class Modification { public string prefabpath; public string bodyname; public string parentname; public GameObject prefab; public bool affectsbasemodel; public DynamicBoneData dynamicBoneData; public string parentSkinToken; public int boneIndex; public int boneCount; public GameObject instance; public GameObject inst_armature; public DynamicBone inst_dynamicBone; public List<DynamicBoneCollider> inst_DB_colliders = new List<DynamicBoneCollider>(); public Modification(string PrefabPath, string ParentName, string BodyName, string ParentSkinToken, int BoneIndex, bool AffectsBaseModel, AssetBundle assetBundle) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown bodyname = BodyName; prefabpath = PrefabPath; parentname = ParentName; parentSkinToken = ParentSkinToken; affectsbasemodel = AffectsBaseModel; boneIndex = BoneIndex; prefab = assetBundle.LoadAsset<GameObject>(prefabpath); if ((Object)prefab == (Object)null) { Debug.LogWarning((object)("Asset at " + PrefabPath + " was not loaded")); } } } } namespace InfernoSkinMod { [BepInPlugin("com.Dotflare.InfernoSkinMod", "InfernoSkinMod", "1.1.2")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class InfernoSkinModPlugin : BaseUnityPlugin { public class FieldException : Exception { public FieldException(string message, Exception innerException) : base(message, innerException) { } } public class DynamicSkinExtension { public Modification DBanditJawBoneModification; public Modification PGunnerloincloth1Modification; public void BeforeStart() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) _DynamicSkinManager.InstanceLogger = ((BaseUnityPlugin)Instance).Logger; new Hook((MethodBase)typeof(SkinDef).GetMethod("Apply"), (Delegate)new Action<Action<SkinDef, GameObject>, SkinDef, GameObject>(_DynamicSkinManager.SkinDefApply)).Apply(); } public void AfterStart() { InitializeModifications(); InitializeDynamicBones(); AddModificationsToList(); } public void BeforeBodyCatalogInit() { Bandit2BodyDBanditSkinAddedEvent += onSkinAdded; RailgunnerBodyPGunnerSkinAddedEvent += onSkinAdded; } public void AfterBodyCatalogInit() { } public void InitializeModifications() { DBanditJawBoneModification = new Modification("JawBone.prefab", "head", "Bandit2Body", "DOTFLARE_SKIN_DBANDIT_NAME", 24, AffectsBaseModel: true, assetBundle); PGunnerloincloth1Modification = new Modification("loincloth1.prefab", "pelvis", "RailgunnerBody", "DOTFLARE_SKIN_PGUNNER_NAME", 100, AffectsBaseModel: true, assetBundle); } public void InitializeDynamicBones() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0164: 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) DBanditJawBoneModification.dynamicBoneData = new DynamicBoneData("JawBone", 0.5f, null, 0.1f, null, 0.9f, null, 0.6f, null, 0.1f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData> { new DynamicBoneColliderData("head", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.005f, 0f) }, new List<string>(), (FreezeAxis)0); PGunnerloincloth1Modification.dynamicBoneData = new DynamicBoneData("loincloth1", 0.1f, null, 0.1f, null, 0.1f, null, 0f, null, 0f, null, 0f, new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new Vector3(0f, 0f, 0f), new List<DynamicBoneColliderData> { new DynamicBoneColliderData("pelvis", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.1f, 0f), new DynamicBoneColliderData("thigh.l", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 1f), new DynamicBoneColliderData("thigh.r", (Direction)1, new Vector3(0f, 0f, 0f), (Bound)0, 0.2f, 1f) }, new List<string>(), (FreezeAxis)0); } public void AddModificationsToList() { _DynamicSkinManager.AddModification("DOTFLARE_SKIN_DBANDIT_NAME", 24, DBanditJawBoneModification); _DynamicSkinManager.AddModification("DOTFLARE_SKIN_PGUNNER_NAME", 100, PGunnerloincloth1Modification); } public static void onSkinAdded(object sender, SkinAddedArgs e) { _DynamicSkinManager.AddSkinDef(e.skinDef); } } public delegate void VoidDelegate(); public class SkinAddedArgs : EventArgs { public SkinDef skinDef { get; } public GameObject bodyPrefab { get; } public SkinAddedArgs(SkinDef newSkinDef, GameObject newGameObject) { skinDef = newSkinDef; bodyPrefab = newGameObject; } } public static SkinDef RailgunnerSkin; public static SkinDef ArtificerSkin; public static SkinDef MercenarySkin; public static SkinDef BanditSkin; public static SkinDef CommandoSkin; public static SkinDef CaptainSkin; public static AssetBundle assetBundle; public static List<Material> materialsWithRoRShader = new List<Material>(); public static DynamicSkinExtension _DynamicSkinExtension = new DynamicSkinExtension(); public static DynamicSkinManager _DynamicSkinManager = new DynamicSkinManager(); public static VoidDelegate BeforeStartDelegate; public static VoidDelegate AfterStartDelegate; public static VoidDelegate BeforeBodyCatalogDelegate; public static VoidDelegate AfterBodyCatalogDelegate; public static InfernoSkinModPlugin Instance { get; set; } public static ManualLogSource InstanceLogger { get { InfernoSkinModPlugin instance = Instance; if (!((Object)(object)instance != (Object)null)) { return null; } return ((BaseUnityPlugin)instance).Logger; } } public static event EventHandler<SkinAddedArgs> RailgunnerBodyPGunnerSkinAddedEvent; public static event EventHandler<SkinAddedArgs> Bandit2BodyDBanditSkinAddedEvent; public static event EventHandler<SkinAddedArgs> CommandoBodyMMandoSkinAddedEvent; public static event EventHandler<SkinAddedArgs> CaptainBodyBCaptainSkinAddedEvent; public void Start() { Instance = this; BeforeStart(); using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("InfernoSkinMod.dotflareinfernoskinmod")) { assetBundle = AssetBundle.LoadFromStream(stream); } ((ResourceAvailability)(ref BodyCatalog.availability)).CallWhenAvailable((Action)BodyCatalogInit); HookEndpointManager.Add((MethodBase)typeof(Language).GetMethod("LoadStrings"), (Delegate)new Action<Action<Language>, Language>(LanguageLoadStrings)); ReplaceShaders(); AfterStart(); } public void BeforeStart() { BeforeStartDelegate = (VoidDelegate)Delegate.Combine(BeforeStartDelegate, new VoidDelegate(_DynamicSkinExtension.BeforeStart)); BeforeStartDelegate?.Invoke(); } public void AfterStart() { AfterStartDelegate = (VoidDelegate)Delegate.Combine(AfterStartDelegate, new VoidDelegate(_DynamicSkinExtension.AfterStart)); AfterStartDelegate?.Invoke(); } public static void BeforeBodyCatalogInit() { BeforeBodyCatalogDelegate = (VoidDelegate)Delegate.Combine(BeforeBodyCatalogDelegate, new VoidDelegate(_DynamicSkinExtension.BeforeBodyCatalogInit)); BeforeBodyCatalogDelegate?.Invoke(); } public static void AfterBodyCatalogInit() { AfterBodyCatalogDelegate = (VoidDelegate)Delegate.Combine(AfterBodyCatalogDelegate, new VoidDelegate(_DynamicSkinExtension.AfterBodyCatalogInit)); AfterBodyCatalogDelegate?.Invoke(); } public static void ReplaceShaders() { LoadMaterialsWithReplacedShader("RoR2/Base/Shaders/HGStandard.shader", "Assets/resources/PGunner/MGunner.mat", "Assets/resources/PGunner/MGunnerGun.mat", "Assets/resources/DBandit/DBanditBones.mat", "Assets/resources/DBandit/DBanditBody.mat", "Assets/resources/DBandit/DBanditCoat.mat", "Assets/resources/DBandit/DBanditWeapon.mat", "Assets/resources/MMando/MMando.mat", "Assets/resources/BCaptain/BCaptainRobot.mat", "Assets/resources/BCaptain/BCaptain.mat", "Assets/resources/HMerc/MatHMerc.mat", "Assets/resources/HMerc/MatHMercWeapon.mat", "Assets/resources/CArti/CArti.mat"); } public static void LoadMaterialsWithReplacedShader(string shaderPath, params string[] materialPaths) { //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) Shader shader = Addressables.LoadAssetAsync<Shader>((object)shaderPath).WaitForCompletion(); foreach (string text in materialPaths) { Material val = assetBundle.LoadAsset<Material>(text); val.shader = shader; materialsWithRoRShader.Add(val); } } public static void LanguageLoadStrings(Action<Language> orig, Language self) { orig(self); self.SetStringByToken("DOTFLARE_SKIN_PGUNNER_NAME", "Pharoah"); self.SetStringByToken("DOTFLARE_SKIN_DBANDIT_NAME", "Deadshot"); self.SetStringByToken("DOTFLARE_SKIN_MMANDO_NAME", "Overgrown"); self.SetStringByToken("DOTFLARE_SKIN_BCAPTAIN_NAME", ""); self.SetStringByToken("DOTFLARE_SKIN_HMERC_NAME", "Headless"); self.SetStringByToken("DOTFLARE_SKIN_CARTI_NAME", ""); } public static void Nothing(Action<SkinDef> orig, SkinDef self) { } public static void BodyCatalogInit() { BeforeBodyCatalogInit(); MethodInfo? method = typeof(SkinDef).GetMethod("Awake", BindingFlags.Instance | BindingFlags.NonPublic); HookEndpointManager.Add((MethodBase)method, (Delegate)new Action<Action<SkinDef>, SkinDef>(Nothing)); AddRailgunnerBodyPGunnerSkin(); AddBandit2BodyDBanditSkin(); AddCommandoBodyMMandoSkin(); AddCaptainBodyBCaptainSkin(); AddMercBodyHMercSkin(); AddMageBodyCArtiSkin(); HookEndpointManager.Remove((MethodBase)method, (Delegate)new Action<Action<SkinDef>, SkinDef>(Nothing)); AfterBodyCatalogInit(); } public static void RailgunnerBodyPGunnerSkinAdded(SkinDef skinDef, GameObject bodyPrefab) { InfernoSkinModPlugin.RailgunnerBodyPGunnerSkinAddedEvent?.Invoke(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } public static void AddRailgunnerBodyPGunnerSkin() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_02b5: Unknown result type (might be due to invalid IL or missing references) string text = "RailgunnerBody"; string text2 = "PGunner"; try { GameObject val = BodyCatalog.FindBodyPrefab(text); if (!Object.op_Implicit((Object)val)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist")); return; } ModelLocator component = val.GetComponent<ModelLocator>(); if (!Object.op_Implicit((Object)component)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component")); return; } GameObject gameObject = ((Component)component.modelTransform).gameObject; ModelSkinController val2 = (Object.op_Implicit((Object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)val2)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component")); return; } Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true); RailgunnerSkin = ScriptableObject.CreateInstance<SkinDef>(); TryCatchThrow("Icon", delegate { RailgunnerSkin.icon = assetBundle.LoadAsset<Sprite>("Assets\\SkinMods\\InfernoSkinMod\\Icons\\PGunnerIcon.png"); }); ((Object)RailgunnerSkin).name = text2; RailgunnerSkin.nameToken = "DOTFLARE_SKIN_PGUNNER_NAME"; RailgunnerSkin.rootObject = gameObject; TryCatchThrow("Base Skins", delegate { RailgunnerSkin.baseSkins = Array.Empty<SkinDef>(); }); TryCatchThrow("Unlockable Name", delegate { RailgunnerSkin.unlockableDef = null; }); TryCatchThrow("Game Object Activations", delegate { RailgunnerSkin.gameObjectActivations = Array.Empty<GameObjectActivation>(); }); TryCatchThrow("Renderer Infos", delegate { //IL_000f: 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_004a: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008b: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) RailgunnerSkin.rendererInfos = (RendererInfo[])(object)new RendererInfo[5] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/PGunner/MGunner.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[0] }, new RendererInfo { defaultMaterial = null, defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[1] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/PGunner/MGunner.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[2] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/PGunner/MGunner.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[3] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/PGunner/MGunnerGun.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[4] } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) RailgunnerSkin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[5] { new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\mdlRailgunBackpackMesh.mesh"), renderer = renderers[0] }, new MeshReplacement { mesh = null, renderer = renderers[1] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\mdlRailGunnerBase.mesh"), renderer = renderers[2] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\mdlRailGunnerMetal.mesh"), renderer = renderers[3] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\mdlRailgunProto.mesh"), renderer = renderers[4] } }; }); TryCatchThrow("Minion Skin Replacements", delegate { RailgunnerSkin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>(); }); TryCatchThrow("Projectile Ghost Replacements", delegate { RailgunnerSkin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>(); }); Array.Resize(ref val2.skins, val2.skins.Length + 1); val2.skins[val2.skins.Length - 1] = RailgunnerSkin; BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = val2.skins; RailgunnerBodyPGunnerSkinAdded(RailgunnerSkin, val); } catch (FieldException ex) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message)); InstanceLogger.LogError((object)ex.InnerException); } catch (Exception ex2) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogError((object)ex2); } } public static void Bandit2BodyDBanditSkinAdded(SkinDef skinDef, GameObject bodyPrefab) { InfernoSkinModPlugin.Bandit2BodyDBanditSkinAddedEvent?.Invoke(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } public static void AddBandit2BodyDBanditSkin() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_02b5: Unknown result type (might be due to invalid IL or missing references) string text = "Bandit2Body"; string text2 = "DBandit"; try { GameObject val = BodyCatalog.FindBodyPrefab(text); if (!Object.op_Implicit((Object)val)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist")); return; } ModelLocator component = val.GetComponent<ModelLocator>(); if (!Object.op_Implicit((Object)component)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component")); return; } GameObject gameObject = ((Component)component.modelTransform).gameObject; ModelSkinController val2 = (Object.op_Implicit((Object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)val2)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component")); return; } Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true); BanditSkin = ScriptableObject.CreateInstance<SkinDef>(); TryCatchThrow("Icon", delegate { BanditSkin.icon = assetBundle.LoadAsset<Sprite>("Assets\\SkinMods\\InfernoSkinMod\\Icons\\DBanditIcon.png"); }); ((Object)BanditSkin).name = text2; BanditSkin.nameToken = "DOTFLARE_SKIN_DBANDIT_NAME"; BanditSkin.rootObject = gameObject; TryCatchThrow("Base Skins", delegate { BanditSkin.baseSkins = Array.Empty<SkinDef>(); }); TryCatchThrow("Unlockable Name", delegate { BanditSkin.unlockableDef = null; }); TryCatchThrow("Game Object Activations", delegate { BanditSkin.gameObjectActivations = Array.Empty<GameObjectActivation>(); }); TryCatchThrow("Renderer Infos", delegate { //IL_000f: 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_004a: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0168: 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_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) BanditSkin.rendererInfos = (RendererInfo[])(object)new RendererInfo[7] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/DBandit/DBanditBones.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[0] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/DBandit/DBanditBody.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[1] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/DBandit/DBanditBody.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[2] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/DBandit/DBanditCoat.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[3] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/DBandit/DBanditWeapon.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[4] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/DBandit/DBanditWeapon.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[7] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/DBandit/DBanditBody.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[6] } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_00a4: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_00e3: 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_010f: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) BanditSkin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[7] { new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\Bandit2AccessoriesMesh.mesh"), renderer = renderers[0] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\Bandit2ArmsMesh.mesh"), renderer = renderers[1] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\Bandit2BodyMesh.mesh"), renderer = renderers[2] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\Bandit2CoatMesh.mesh"), renderer = renderers[3] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\BanditShotgunMesh.mesh"), renderer = renderers[4] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\BanditPistolMesh.mesh"), renderer = renderers[7] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\Bandit2HatMesh.mesh"), renderer = renderers[6] } }; }); TryCatchThrow("Minion Skin Replacements", delegate { BanditSkin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>(); }); TryCatchThrow("Projectile Ghost Replacements", delegate { BanditSkin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>(); }); Array.Resize(ref val2.skins, val2.skins.Length + 1); val2.skins[val2.skins.Length - 1] = BanditSkin; BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = val2.skins; Bandit2BodyDBanditSkinAdded(BanditSkin, val); } catch (FieldException ex) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message)); InstanceLogger.LogError((object)ex.InnerException); } catch (Exception ex2) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogError((object)ex2); } } public static void CommandoBodyMMandoSkinAdded(SkinDef skinDef, GameObject bodyPrefab) { InfernoSkinModPlugin.CommandoBodyMMandoSkinAddedEvent?.Invoke(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } public static void AddCommandoBodyMMandoSkin() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_02b5: Unknown result type (might be due to invalid IL or missing references) string text = "CommandoBody"; string text2 = "MMando"; try { GameObject val = BodyCatalog.FindBodyPrefab(text); if (!Object.op_Implicit((Object)val)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist")); return; } ModelLocator component = val.GetComponent<ModelLocator>(); if (!Object.op_Implicit((Object)component)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component")); return; } GameObject gameObject = ((Component)component.modelTransform).gameObject; ModelSkinController val2 = (Object.op_Implicit((Object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)val2)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component")); return; } Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true); CommandoSkin = ScriptableObject.CreateInstance<SkinDef>(); TryCatchThrow("Icon", delegate { CommandoSkin.icon = assetBundle.LoadAsset<Sprite>("Assets\\SkinMods\\InfernoSkinMod\\Icons\\MMandoIcon.png"); }); ((Object)CommandoSkin).name = text2; CommandoSkin.nameToken = "DOTFLARE_SKIN_MMANDO_NAME"; CommandoSkin.rootObject = gameObject; TryCatchThrow("Base Skins", delegate { CommandoSkin.baseSkins = Array.Empty<SkinDef>(); }); TryCatchThrow("Unlockable Name", delegate { CommandoSkin.unlockableDef = null; }); TryCatchThrow("Game Object Activations", delegate { CommandoSkin.gameObjectActivations = Array.Empty<GameObjectActivation>(); }); TryCatchThrow("Renderer Infos", delegate { //IL_000f: 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_004a: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) CommandoSkin.rendererInfos = (RendererInfo[])(object)new RendererInfo[3] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/MMando/MMando.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[0] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/MMando/MMando.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[3] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/MMando/MMando.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[6] } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_00a4: 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) CommandoSkin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[3] { new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\GunMesh.mesh"), renderer = renderers[0] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\CommandoMesh.004.mesh"), renderer = renderers[6] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\GunMesh.001.mesh"), renderer = renderers[3] } }; }); TryCatchThrow("Minion Skin Replacements", delegate { CommandoSkin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>(); }); TryCatchThrow("Projectile Ghost Replacements", delegate { CommandoSkin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>(); }); Array.Resize(ref val2.skins, val2.skins.Length + 1); val2.skins[val2.skins.Length - 1] = CommandoSkin; BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = val2.skins; CommandoBodyMMandoSkinAdded(CommandoSkin, val); } catch (FieldException ex) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message)); InstanceLogger.LogError((object)ex.InnerException); } catch (Exception ex2) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogError((object)ex2); } } public static void CaptainBodyBCaptainSkinAdded(SkinDef skinDef, GameObject bodyPrefab) { InfernoSkinModPlugin.CaptainBodyBCaptainSkinAddedEvent?.Invoke(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } public static void AddCaptainBodyBCaptainSkin() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_02b5: Unknown result type (might be due to invalid IL or missing references) string text = "CaptainBody"; string text2 = "BCaptain"; try { GameObject val = BodyCatalog.FindBodyPrefab(text); if (!Object.op_Implicit((Object)val)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist")); return; } ModelLocator component = val.GetComponent<ModelLocator>(); if (!Object.op_Implicit((Object)component)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component")); return; } GameObject gameObject = ((Component)component.modelTransform).gameObject; ModelSkinController val2 = (Object.op_Implicit((Object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)val2)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component")); return; } Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true); CaptainSkin = ScriptableObject.CreateInstance<SkinDef>(); TryCatchThrow("Icon", delegate { CaptainSkin.icon = assetBundle.LoadAsset<Sprite>("Assets\\SkinMods\\InfernoSkinMod\\Icons\\BCaptainIcon.png"); }); ((Object)CaptainSkin).name = text2; CaptainSkin.nameToken = "DOTFLARE_SKIN_BCAPTAIN_NAME"; CaptainSkin.rootObject = gameObject; TryCatchThrow("Base Skins", delegate { CaptainSkin.baseSkins = Array.Empty<SkinDef>(); }); TryCatchThrow("Unlockable Name", delegate { CaptainSkin.unlockableDef = ((IEnumerable<UnlockableDef>)ContentManager.unlockableDefs).FirstOrDefault((Func<UnlockableDef, bool>)((UnlockableDef def) => def.cachedName == "0")); }); TryCatchThrow("Game Object Activations", delegate { CaptainSkin.gameObjectActivations = Array.Empty<GameObjectActivation>(); }); TryCatchThrow("Renderer Infos", delegate { //IL_000f: 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_004a: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0168: 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_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) CaptainSkin.rendererInfos = (RendererInfo[])(object)new RendererInfo[7] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/BCaptain/BCaptainRobot.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = false, renderer = renderers[0] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/BCaptain/BCaptain.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = false, renderer = renderers[1] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/BCaptain/BCaptain.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = false, renderer = renderers[2] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/BCaptain/BCaptain.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = false, renderer = renderers[3] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/BCaptain/BCaptainRobot.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = false, renderer = renderers[4] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/BCaptain/BCaptain.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = false, renderer = renderers[5] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/BCaptain/BCaptain.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = false, renderer = renderers[6] } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_00a4: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_00e3: 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_010f: 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_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) CaptainSkin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[7] { new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\Captain.mesh"), renderer = renderers[0] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\CaptainHat.mesh"), renderer = renderers[1] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\CaptainChestArmor.mesh"), renderer = renderers[2] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\CaptainCoat.mesh"), renderer = renderers[3] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\CaptainGunArm.mesh"), renderer = renderers[4] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\CaptainHead.mesh"), renderer = renderers[5] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\CaptainUnderCoat.mesh"), renderer = renderers[6] } }; }); TryCatchThrow("Minion Skin Replacements", delegate { CaptainSkin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>(); }); TryCatchThrow("Projectile Ghost Replacements", delegate { CaptainSkin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>(); }); Array.Resize(ref val2.skins, val2.skins.Length + 1); val2.skins[val2.skins.Length - 1] = CaptainSkin; BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = val2.skins; CaptainBodyBCaptainSkinAdded(CaptainSkin, val); } catch (FieldException ex) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message)); InstanceLogger.LogError((object)ex.InnerException); } catch (Exception ex2) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogError((object)ex2); } } public static void AddMercBodyHMercSkin() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_02b5: Unknown result type (might be due to invalid IL or missing references) string text = "MercBody"; string text2 = "HMerc"; try { GameObject val = BodyCatalog.FindBodyPrefab(text); if (!Object.op_Implicit((Object)val)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist")); return; } ModelLocator component = val.GetComponent<ModelLocator>(); if (!Object.op_Implicit((Object)component)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component")); return; } GameObject gameObject = ((Component)component.modelTransform).gameObject; ModelSkinController val2 = (Object.op_Implicit((Object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)val2)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component")); return; } Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true); MercenarySkin = ScriptableObject.CreateInstance<SkinDef>(); TryCatchThrow("Icon", delegate { MercenarySkin.icon = assetBundle.LoadAsset<Sprite>("Assets\\SkinMods\\InfernoSkinMod\\Icons\\HMercIcon.png"); }); ((Object)MercenarySkin).name = text2; MercenarySkin.nameToken = "DOTFLARE_SKIN_HMERC_NAME"; MercenarySkin.rootObject = gameObject; TryCatchThrow("Base Skins", delegate { MercenarySkin.baseSkins = Array.Empty<SkinDef>(); }); TryCatchThrow("Unlockable Name", delegate { MercenarySkin.unlockableDef = null; }); TryCatchThrow("Game Object Activations", delegate { MercenarySkin.gameObjectActivations = Array.Empty<GameObjectActivation>(); }); TryCatchThrow("Renderer Infos", delegate { //IL_000f: 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_004a: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_0090: Unknown result type (might be due to invalid IL or missing references) MercenarySkin.rendererInfos = (RendererInfo[])(object)new RendererInfo[2] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/HMerc/MatHMerc.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[7] }, new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/HMerc/MatHMercWeapon.mat"), defaultShadowCastingMode = (ShadowCastingMode)0, ignoreOverlays = false, renderer = renderers[8] } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) MercenarySkin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[2] { new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\MercMesh.mesh"), renderer = renderers[7] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\MercSwordMesh.mesh"), renderer = renderers[8] } }; }); TryCatchThrow("Minion Skin Replacements", delegate { MercenarySkin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>(); }); TryCatchThrow("Projectile Ghost Replacements", delegate { MercenarySkin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>(); }); Array.Resize(ref val2.skins, val2.skins.Length + 1); val2.skins[val2.skins.Length - 1] = MercenarySkin; BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = val2.skins; } catch (FieldException ex) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message)); InstanceLogger.LogError((object)ex.InnerException); } catch (Exception ex2) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogError((object)ex2); } } public static void AddMageBodyCArtiSkin() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Expected O, but got Unknown //IL_02b5: Unknown result type (might be due to invalid IL or missing references) string text = "MageBody"; string text2 = "CArti"; try { GameObject val = BodyCatalog.FindBodyPrefab(text); if (!Object.op_Implicit((Object)val)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin because \"" + text + "\" doesn't exist")); return; } ModelLocator component = val.GetComponent<ModelLocator>(); if (!Object.op_Implicit((Object)component)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelLocator\" component")); return; } GameObject gameObject = ((Component)component.modelTransform).gameObject; ModelSkinController val2 = (Object.op_Implicit((Object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)val2)) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\" because it doesn't have \"ModelSkinController\" component")); return; } Renderer[] renderers = gameObject.GetComponentsInChildren<Renderer>(true); ArtificerSkin = ScriptableObject.CreateInstance<SkinDef>(); TryCatchThrow("Icon", delegate { ArtificerSkin.icon = assetBundle.LoadAsset<Sprite>("Assets\\SkinMods\\InfernoSkinMod\\Icons\\CArtiIcon.png"); }); ((Object)ArtificerSkin).name = text2; ArtificerSkin.nameToken = "DOTFLARE_SKIN_CARTI_NAME"; ArtificerSkin.rootObject = gameObject; TryCatchThrow("Base Skins", delegate { ArtificerSkin.baseSkins = Array.Empty<SkinDef>(); }); TryCatchThrow("Unlockable Name", delegate { ArtificerSkin.unlockableDef = null; }); TryCatchThrow("Game Object Activations", delegate { ArtificerSkin.gameObjectActivations = Array.Empty<GameObjectActivation>(); }); TryCatchThrow("Renderer Infos", delegate { //IL_000f: 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_004a: 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) ArtificerSkin.rendererInfos = (RendererInfo[])(object)new RendererInfo[1] { new RendererInfo { defaultMaterial = assetBundle.LoadAsset<Material>("Assets/resources/CArti/CArti.mat"), defaultShadowCastingMode = (ShadowCastingMode)1, ignoreOverlays = false, renderer = renderers[7] } }; }); TryCatchThrow("Mesh Replacements", delegate { //IL_000f: 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_002d: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) ArtificerSkin.meshReplacements = (MeshReplacement[])(object)new MeshReplacement[2] { new MeshReplacement { mesh = null, renderer = renderers[6] }, new MeshReplacement { mesh = assetBundle.LoadAsset<Mesh>("Assets\\SkinMods\\InfernoSkinMod\\Meshes\\MageMesh.mesh"), renderer = renderers[7] } }; }); TryCatchThrow("Minion Skin Replacements", delegate { ArtificerSkin.minionSkinReplacements = Array.Empty<MinionSkinReplacement>(); }); TryCatchThrow("Projectile Ghost Replacements", delegate { ArtificerSkin.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>(); }); Array.Resize(ref val2.skins, val2.skins.Length + 1); val2.skins[val2.skins.Length - 1] = ArtificerSkin; BodyCatalog.skins[BodyCatalog.FindBodyIndex(val)] = val2.skins; } catch (FieldException ex) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogWarning((object)("Field causing issue: " + ex.Message)); InstanceLogger.LogError((object)ex.InnerException); } catch (Exception ex2) { InstanceLogger.LogWarning((object)("Failed to add \"" + text2 + "\" skin to \"" + text + "\"")); InstanceLogger.LogError((object)ex2); } } public static void TryCatchThrow(string message, Action action) { try { action?.Invoke(); } catch (Exception innerException) { throw new FieldException(message, innerException); } } } }