Decompiled source of Inferno v1.7.6
Inferno.dll
Decompiled a month 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.SurvivorMannequins; 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.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Inferno")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [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] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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.*/)] [BepInPlugin("HIFU.Inferno", "Inferno", "1.7.6")] public class Main : BaseUnityPlugin { [CompilerGenerated] private static class <>O { public static hook_GetLocalizedStringByToken <0>__Language_GetLocalizedStringByToken; public static Action<CharacterBody> <1>__BodyChanges; public static StatHookEventHandler <2>__RecalculateStatsAPI_GetStatCoefficients; public static Action<CharacterMaster> <3>__MasterChanges; public static Manipulator <4>__LookBusy_OnEnter; public static Manipulator <5>__LookBusy_PickNewTargetLookDirection; public static Manipulator <6>__Wander_PickNewTargetLookPosition; public static hook_Start <7>__CurrentDifficultyIconController_Start; public static Manipulator <8>__Ambient; } public const string PluginGUID = "HIFU.Inferno"; public const string PluginAuthor = "HIFU"; public const string PluginName = "Inferno"; public const string PluginVersion = "1.7.6"; 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 Ramps; 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); 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> InfernalEclipse { get; set; } public static ConfigEntry<float> PillarSpeed { get; set; } public void Awake() { //IL_0061: 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_0579: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Expected O, but got Unknown //IL_057e: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Expected O, but got Unknown //IL_058e: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_059e: Unknown result type (might be due to invalid IL or missing references) //IL_05a9: Unknown result type (might be due to invalid IL or missing references) //IL_05b9: Expected O, but got Unknown //IL_05b4: Unknown result type (might be due to invalid IL or missing references) //IL_05be: Expected O, but got Unknown //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_05c9: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_05df: Unknown result type (might be due to invalid IL or missing references) //IL_05ef: Expected O, but got Unknown //IL_05ea: Unknown result type (might be due to invalid IL or missing references) //IL_05f4: Expected O, but got Unknown //IL_05fa: Unknown result type (might be due to invalid IL or missing references) //IL_05ff: Unknown result type (might be due to invalid IL or missing references) //IL_060a: Unknown result type (might be due to invalid IL or missing references) //IL_0615: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Expected O, but got Unknown //IL_0620: Unknown result type (might be due to invalid IL or missing references) //IL_062a: Expected O, but got Unknown //IL_0630: Unknown result type (might be due to invalid IL or missing references) //IL_0635: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_064b: Unknown result type (might be due to invalid IL or missing references) //IL_065b: Expected O, but got Unknown //IL_0656: Unknown result type (might be due to invalid IL or missing references) //IL_0660: Expected O, but got Unknown //IL_0666: Unknown result type (might be due to invalid IL or missing references) //IL_066b: Unknown result type (might be due to invalid IL or missing references) //IL_0676: Unknown result type (might be due to invalid IL or missing references) //IL_0681: Unknown result type (might be due to invalid IL or missing references) //IL_0691: Expected O, but got Unknown //IL_068c: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Expected O, but got Unknown //IL_069c: Unknown result type (might be due to invalid IL or missing references) //IL_06a1: Unknown result type (might be due to invalid IL or missing references) //IL_06ac: Unknown result type (might be due to invalid IL or missing references) //IL_06b7: Unknown result type (might be due to invalid IL or missing references) //IL_06c7: Expected O, but got Unknown //IL_06c2: Unknown result type (might be due to invalid IL or missing references) //IL_06cc: Expected O, but got Unknown //IL_06d2: Unknown result type (might be due to invalid IL or missing references) //IL_06d7: Unknown result type (might be due to invalid IL or missing references) //IL_06e2: Unknown result type (might be due to invalid IL or missing references) //IL_06ed: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Expected O, but got Unknown //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_0702: Expected O, but got Unknown //IL_0708: Unknown result type (might be due to invalid IL or missing references) //IL_070d: Unknown result type (might be due to invalid IL or missing references) //IL_0718: Unknown result type (might be due to invalid IL or missing references) //IL_0723: Unknown result type (might be due to invalid IL or missing references) //IL_0733: Expected O, but got Unknown //IL_072e: Unknown result type (might be due to invalid IL or missing references) //IL_0738: Expected O, but got Unknown //IL_073e: Unknown result type (might be due to invalid IL or missing references) //IL_0743: Unknown result type (might be due to invalid IL or missing references) //IL_074e: Unknown result type (might be due to invalid IL or missing references) //IL_0759: Unknown result type (might be due to invalid IL or missing references) //IL_0769: Expected O, but got Unknown //IL_0764: Unknown result type (might be due to invalid IL or missing references) //IL_076e: Expected O, but got Unknown //IL_0774: Unknown result type (might be due to invalid IL or missing references) //IL_0779: Unknown result type (might be due to invalid IL or missing references) //IL_0784: Unknown result type (might be due to invalid IL or missing references) //IL_078f: Unknown result type (might be due to invalid IL or missing references) //IL_079f: Expected O, but got Unknown //IL_079a: Unknown result type (might be due to invalid IL or missing references) //IL_07a4: Expected O, but got Unknown //IL_07aa: Unknown result type (might be due to invalid IL or missing references) //IL_07b4: Expected O, but got Unknown //IL_07ba: Unknown result type (might be due to invalid IL or missing references) //IL_07c4: Expected O, but got Unknown //IL_07ca: Unknown result type (might be due to invalid IL or missing references) //IL_07cf: Unknown result type (might be due to invalid IL or missing references) //IL_07da: Unknown result type (might be due to invalid IL or missing references) //IL_07e5: Unknown result type (might be due to invalid IL or missing references) //IL_07f5: Expected O, but got Unknown //IL_07f0: Unknown result type (might be due to invalid IL or missing references) //IL_07fa: Expected O, but got Unknown //IL_0800: Unknown result type (might be due to invalid IL or missing references) //IL_0805: Unknown result type (might be due to invalid IL or missing references) //IL_0815: Expected O, but got Unknown //IL_0810: Unknown result type (might be due to invalid IL or missing references) //IL_081a: Expected O, but got Unknown //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_0825: Unknown result type (might be due to invalid IL or missing references) //IL_0830: Unknown result type (might be due to invalid IL or missing references) //IL_083b: Unknown result type (might be due to invalid IL or missing references) //IL_084b: Expected O, but got Unknown //IL_0846: Unknown result type (might be due to invalid IL or missing references) //IL_0850: Expected O, but got Unknown //IL_0856: Unknown result type (might be due to invalid IL or missing references) //IL_085b: Unknown result type (might be due to invalid IL or missing references) //IL_086b: Expected O, but got Unknown //IL_0866: Unknown result type (might be due to invalid IL or missing references) //IL_0870: Expected O, but got Unknown //IL_0876: Unknown result type (might be due to invalid IL or missing references) //IL_087b: Unknown result type (might be due to invalid IL or missing references) //IL_088b: Expected O, but got Unknown //IL_0886: Unknown result type (might be due to invalid IL or missing references) //IL_0890: Expected O, but got Unknown //IL_0896: Unknown result type (might be due to invalid IL or missing references) //IL_089b: Unknown result type (might be due to invalid IL or missing references) //IL_08a2: Unknown result type (might be due to invalid IL or missing references) //IL_08b2: Expected O, but got Unknown //IL_08ad: Unknown result type (might be due to invalid IL or missing references) //IL_08b7: Expected O, but got Unknown //IL_08bd: Unknown result type (might be due to invalid IL or missing references) //IL_08c2: Unknown result type (might be due to invalid IL or missing references) //IL_08cd: Unknown result type (might be due to invalid IL or missing references) //IL_08d8: Unknown result type (might be due to invalid IL or missing references) //IL_08e8: Expected O, but got Unknown //IL_08e3: Unknown result type (might be due to invalid IL or missing references) //IL_08ed: Expected O, but got Unknown //IL_08f3: Unknown result type (might be due to invalid IL or missing references) //IL_08f8: Unknown result type (might be due to invalid IL or missing references) //IL_0903: Unknown result type (might be due to invalid IL or missing references) //IL_090e: Unknown result type (might be due to invalid IL or missing references) //IL_091e: Expected O, but got Unknown //IL_0919: Unknown result type (might be due to invalid IL or missing references) //IL_0923: Expected O, but got Unknown //IL_0929: 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_0944: Unknown result type (might be due to invalid IL or missing references) //IL_0954: Expected O, but got Unknown //IL_094f: Unknown result type (might be due to invalid IL or missing references) //IL_0959: Expected O, but got Unknown //IL_095f: Unknown result type (might be due to invalid IL or missing references) //IL_0964: Unknown result type (might be due to invalid IL or missing references) //IL_096f: Unknown result type (might be due to invalid IL or missing references) //IL_097a: Unknown result type (might be due to invalid IL or missing references) //IL_098a: Expected O, but got Unknown //IL_0985: Unknown result type (might be due to invalid IL or missing references) //IL_098f: Expected O, but got Unknown //IL_0995: Unknown result type (might be due to invalid IL or missing references) //IL_099f: Expected O, but got Unknown //IL_09bb: Unknown result type (might be due to invalid IL or missing references) //IL_09c5: Expected O, but got Unknown //IL_09c0: Unknown result type (might be due to invalid IL or missing references) //IL_09ca: Expected O, but got Unknown //IL_09d0: Unknown result type (might be due to invalid IL or missing references) //IL_09d5: Unknown result type (might be due to invalid IL or missing references) //IL_09e5: Expected O, but got Unknown //IL_09e0: Unknown result type (might be due to invalid IL or missing references) //IL_09ea: Expected O, but got Unknown //IL_0a06: Unknown result type (might be due to invalid IL or missing references) //IL_0a10: Expected O, but got Unknown //IL_0a0b: Unknown result type (might be due to invalid IL or missing references) //IL_0a15: Expected O, but got Unknown //IL_0a1b: Unknown result type (might be due to invalid IL or missing references) //IL_0a20: Unknown result type (might be due to invalid IL or missing references) //IL_0a2b: Unknown result type (might be due to invalid IL or missing references) //IL_0a36: Unknown result type (might be due to invalid IL or missing references) //IL_0a46: Expected O, but got Unknown //IL_0a41: Unknown result type (might be due to invalid IL or missing references) //IL_0a4b: Expected O, but got Unknown //IL_0a51: Unknown result type (might be due to invalid IL or missing references) //IL_0a56: Unknown result type (might be due to invalid IL or missing references) //IL_0a61: Unknown result type (might be due to invalid IL or missing references) //IL_0a6c: Unknown result type (might be due to invalid IL or missing references) //IL_0a7c: Expected O, but got Unknown //IL_0a77: Unknown result type (might be due to invalid IL or missing references) //IL_0a81: Expected O, but got Unknown //IL_0a87: Unknown result type (might be due to invalid IL or missing references) //IL_0a8c: Unknown result type (might be due to invalid IL or missing references) //IL_0a97: Unknown result type (might be due to invalid IL or missing references) //IL_0aa2: Unknown result type (might be due to invalid IL or missing references) //IL_0ab2: Expected O, but got Unknown //IL_0aad: Unknown result type (might be due to invalid IL or missing references) //IL_0ab7: Expected O, but got Unknown //IL_0ad3: Unknown result type (might be due to invalid IL or missing references) //IL_0add: Expected O, but got Unknown //IL_0ad8: Unknown result type (might be due to invalid IL or missing references) //IL_0ae2: Expected O, but got Unknown //IL_0ae8: Unknown result type (might be due to invalid IL or missing references) //IL_0af2: Expected O, but got Unknown //IL_0af8: Unknown result type (might be due to invalid IL or missing references) //IL_0afd: Unknown result type (might be due to invalid IL or missing references) //IL_0b2e: Unknown result type (might be due to invalid IL or missing references) //IL_0b33: Unknown result type (might be due to invalid IL or missing references) //IL_0b39: Expected O, but got Unknown 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) { string name = ((Object)val.shader).name; string text = name; if (text == "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"); InfernalEclipse = ((BaseUnityPlugin)this).Config.Bind<bool>("General III", "Set Inferno as Base Eclipse difficulty?", true, "Adds all Inferno modifiers to all Eclipse levels."); 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(InfernalEclipse)); 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 val2 = Addressables.LoadAssetAsync<SkillDef>((object)"RoR2/Base/Beetle/BeetleBodySleep.asset").WaitForCompletion(); val2.baseMaxStock = 0; val2.stockToConsume = 69; val2.requiredStock = 69; object obj = <>O.<0>__Language_GetLocalizedStringByToken; if (obj == null) { hook_GetLocalizedStringByToken val3 = Language_GetLocalizedStringByToken; <>O.<0>__Language_GetLocalizedStringByToken = val3; obj = (object)val3; } Language.GetLocalizedStringByToken += (hook_GetLocalizedStringByToken)obj; Inferno.Eclipse.InfernalEclipse.Init(); Run.onRunSetRuleBookGlobal += ChangeAmbientCap; Run.onRunStartGlobal += delegate(Run run) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Expected O, but got Unknown //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Expected O, but got Unknown //IL_00d0: 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_00db: Expected O, but got Unknown //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown ShouldRun = false; if (IsInferno(run.selectedDifficulty)) { if (EnableStats.Value) { CharacterBody.onBodyStartGlobal += Body.BodyChanges; object obj8 = <>O.<2>__RecalculateStatsAPI_GetStatCoefficients; if (obj8 == null) { StatHookEventHandler val10 = Hooks.RecalculateStatsAPI_GetStatCoefficients; <>O.<2>__RecalculateStatsAPI_GetStatCoefficients = val10; obj8 = (object)val10; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj8; } if (EnableAI.Value) { CharacterMaster.onStartGlobal += Master.MasterChanges; object obj9 = <>O.<4>__LookBusy_OnEnter; if (obj9 == null) { Manipulator val11 = Hooks.LookBusy_OnEnter; <>O.<4>__LookBusy_OnEnter = val11; obj9 = (object)val11; } LookBusy.OnEnter += (Manipulator)obj9; object obj10 = <>O.<5>__LookBusy_PickNewTargetLookDirection; if (obj10 == null) { Manipulator val12 = Hooks.LookBusy_PickNewTargetLookDirection; <>O.<5>__LookBusy_PickNewTargetLookDirection = val12; obj10 = (object)val12; } LookBusy.PickNewTargetLookDirection += (Manipulator)obj10; object obj11 = <>O.<6>__Wander_PickNewTargetLookPosition; if (obj11 == null) { Manipulator val13 = Hooks.Wander_PickNewTargetLookPosition; <>O.<6>__Wander_PickNewTargetLookPosition = val13; obj11 = (object)val13; } Wander.PickNewTargetLookPosition += (Manipulator)obj11; } if (EnableSkills.Value) { HookBehavior.ApplyHooks(); } object obj12 = <>O.<7>__CurrentDifficultyIconController_Start; if (obj12 == null) { hook_Start val14 = Inferno.Eclipse.InfernalEclipse.CurrentDifficultyIconController_Start; <>O.<7>__CurrentDifficultyIconController_Start = val14; obj12 = (object)val14; } CurrentDifficultyIconController.Start += (hook_Start)obj12; object obj13 = <>O.<8>__Ambient; if (obj13 == null) { Manipulator val15 = Hooks.Ambient; <>O.<8>__Ambient = val15; obj13 = (object)val15; } Run.RecalculateDifficultyCoefficentInternal += (Manipulator)obj13; ShouldRun = true; } }; Run.onRunDestroyGlobal += delegate { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0074: 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_007f: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown CharacterBody.onBodyStartGlobal -= Body.BodyChanges; object obj2 = <>O.<2>__RecalculateStatsAPI_GetStatCoefficients; if (obj2 == null) { StatHookEventHandler val4 = Hooks.RecalculateStatsAPI_GetStatCoefficients; <>O.<2>__RecalculateStatsAPI_GetStatCoefficients = val4; obj2 = (object)val4; } RecalculateStatsAPI.GetStatCoefficients -= (StatHookEventHandler)obj2; CharacterMaster.onStartGlobal -= Master.MasterChanges; object obj3 = <>O.<4>__LookBusy_OnEnter; if (obj3 == null) { Manipulator val5 = Hooks.LookBusy_OnEnter; <>O.<4>__LookBusy_OnEnter = val5; obj3 = (object)val5; } LookBusy.OnEnter -= (Manipulator)obj3; object obj4 = <>O.<5>__LookBusy_PickNewTargetLookDirection; if (obj4 == null) { Manipulator val6 = Hooks.LookBusy_PickNewTargetLookDirection; <>O.<5>__LookBusy_PickNewTargetLookDirection = val6; obj4 = (object)val6; } LookBusy.PickNewTargetLookDirection -= (Manipulator)obj4; object obj5 = <>O.<6>__Wander_PickNewTargetLookPosition; if (obj5 == null) { Manipulator val7 = Hooks.Wander_PickNewTargetLookPosition; <>O.<6>__Wander_PickNewTargetLookPosition = val7; obj5 = (object)val7; } Wander.PickNewTargetLookPosition -= (Manipulator)obj5; HookBehavior.UndoHooks(); object obj6 = <>O.<8>__Ambient; if (obj6 == null) { Manipulator val8 = Hooks.Ambient; <>O.<8>__Ambient = val8; obj6 = (object)val8; } Run.RecalculateDifficultyCoefficentInternal -= (Manipulator)obj6; object obj7 = <>O.<7>__CurrentDifficultyIconController_Start; if (obj7 == null) { hook_Start val9 = Inferno.Eclipse.InfernalEclipse.CurrentDifficultyIconController_Start; <>O.<7>__CurrentDifficultyIconController_Start = val9; obj7 = (object)val9; } CurrentDifficultyIconController.Start -= (hook_Start)obj7; ShouldRun = false; }; ChangeMercParticles.ChangeLights(); } 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; MithrixAS.Value = false; } private void ResetPostProcessing() { ColorGradingRedGain.Value = 3.7f; VignetteIntensity.Value = 0.21f; PostProcessingWeight.Value = 1f; } public void FixedUpdate() { //IL_0061: 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_00f3: 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) //IL_0117: 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) { SkinDef banditSkin = InfernoSkinModPlugin.BanditSkin; banditSkin.unlockableDef = BanditSkin; } if ((Object)(object)InfernoSkinModPlugin.CommandoSkin != (Object)null) { SkinDef commandoSkin = InfernoSkinModPlugin.CommandoSkin; commandoSkin.unlockableDef = CommandoSkin; } if ((Object)(object)InfernoSkinModPlugin.CaptainSkin != (Object)null) { SkinDef captainSkin = InfernoSkinModPlugin.CaptainSkin; captainSkin.unlockableDef = CaptainSkin; } if ((Object)(object)InfernoSkinModPlugin.ArtificerSkin != (Object)null) { SkinDef artificerSkin = InfernoSkinModPlugin.ArtificerSkin; artificerSkin.unlockableDef = ArtificerSkin; } if ((Object)(object)InfernoSkinModPlugin.MercenarySkin != (Object)null) { SkinDef mercenarySkin = InfernoSkinModPlugin.MercenarySkin; mercenarySkin.unlockableDef = MercenarySkin; } if ((Object)(object)InfernoSkinModPlugin.RailgunnerSkin != (Object)null) { SkinDef railgunnerSkin = InfernoSkinModPlugin.RailgunnerSkin; railgunnerSkin.unlockableDef = RailgunnerSkin; } } public void ChangeAmbientCap(Run run, RuleBook useless) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) Run.ambientLevelCap = ((run.selectedDifficulty == InfernoDiffIndex) ? int.MaxValue : Run.ambientLevelCap); } 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 (InfernalEclipse.Value) { 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_006e: 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) 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); } public static bool IsInferno(DifficultyIndex difficultyIndex) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Invalid comparison between Unknown and I4 DifficultyDef difficultyDef = DifficultyCatalog.GetDifficultyDef(difficultyIndex); return (difficultyDef != null && difficultyDef == InfernoDiffDef) || ((int)difficultyIndex >= 3 && InfernalEclipse.Value) || (Chainloader.PluginInfos.ContainsKey("prodzpod.Downpour") && DownpourCompat.IsBrimstone(difficultyDef)); } 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)body)) { return; } TeamIndex teamIndex = body.teamComponent.teamIndex; TeamIndex val = teamIndex; if ((int)val == 1) { float num = damageReport.damageDealt / hc.fullCombinedHealth * 100f; int num2 = Mathf.FloorToInt(num * Main.AllyPermanentDamage.Value / 100f); for (int i = 0; i < num2; 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 { public static bool IsBrimstone(DifficultyDef def) { return DownpourPlugin.BrimstoneList.Contains(def); } } internal class PeripheryV { } } namespace Inferno.Unlocks { public class BasePerSurvivorClearGameInfernoAchievement : BaseAchievement { [SystemInitializer(new Type[] { typeof(OptInAttribute) })] public override void OnBodyRequirementMet() { ((BaseAchievement)this).OnBodyRequirementMet(); Run.onClientGameOverGlobal += OnClientGameOverGlobal; } [SystemInitializer(new Type[] { typeof(OptInAttribute) })] public override void OnBodyRequirementBroken() { Run.onClientGameOverGlobal -= OnClientGameOverGlobal; ((BaseAchievement)this).OnBodyRequirementBroken(); } [SystemInitializer(new Type[] { typeof(OptInAttribute) })] private void OnClientGameOverGlobal(Run run, RunReport runReport) { //IL_0021: 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())) { runReport.gameEnding.lunarCoinReward = 15u; runReport.gameEnding.showCredits = false; ((BaseAchievement)this).Grant(); } } } [RegisterAchievement("CommandoClearGameInferno", "Skins.Inferno_Commando", null, 30u, null)] public class CommandoClearGameInfernoAchievement : BasePerSurvivorClearGameInfernoAchievement { [SystemInitializer(new Type[] { typeof(OptInAttribute) })] public override BodyIndex LookUpRequiredBodyIndex() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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 { [SystemInitializer(new Type[] { typeof(OptInAttribute) })] public override BodyIndex LookUpRequiredBodyIndex() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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 { [SystemInitializer(new Type[] { typeof(OptInAttribute) })] public override BodyIndex LookUpRequiredBodyIndex() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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 { [SystemInitializer(new Type[] { typeof(OptInAttribute) })] public override BodyIndex LookUpRequiredBodyIndex() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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 { [SystemInitializer(new Type[] { typeof(OptInAttribute) })] public override BodyIndex LookUpRequiredBodyIndex() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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 { [SystemInitializer(new Type[] { typeof(OptInAttribute) })] public override BodyIndex LookUpRequiredBodyIndex() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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_0011: 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: 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_0094: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015c: 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_0160: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: 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_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0283: 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_0291: 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_029d: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: 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_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_0326: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_0414: Unknown result type (might be due to invalid IL or missing references) //IL_0416: 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_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_0441: Unknown result type (might be due to invalid IL or missing references) //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: 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_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_04ef: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_050c: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_0529: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_052d: Unknown result type (might be due to invalid IL or missing references) //IL_0546: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_054a: Unknown result type (might be due to invalid IL or missing references) //IL_054c: Unknown result type (might be due to invalid IL or missing references) //IL_0565: 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_0569: Unknown result type (might be due to invalid IL or missing references) //IL_056b: Unknown result type (might be due to invalid IL or missing references) //IL_0596: Unknown result type (might be due to invalid IL or missing references) //IL_0598: Unknown result type (might be due to invalid IL or missing references) //IL_059a: 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_05c0: Unknown result type (might be due to invalid IL or missing references) //IL_05c2: Unknown result type (might be due to invalid IL or missing references) //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_05c6: Unknown result type (might be due to invalid IL or missing references) //IL_05df: Unknown result type (might be due to invalid IL or missing references) //IL_05e1: Unknown result type (might be due to invalid IL or missing references) //IL_05e3: Unknown result type (might be due to invalid IL or missing references) //IL_05e5: Unknown result type (might be due to invalid IL or missing references) //IL_05fe: Unknown result type (might be due to invalid IL or missing references) //IL_0600: Unknown result type (might be due to invalid IL or missing references) //IL_0602: Unknown result type (might be due to invalid IL or missing references) //IL_0604: Unknown result type (might be due to invalid IL or missing references) //IL_0633: Unknown result type (might be due to invalid IL or missing references) //IL_0635: Unknown result type (might be due to invalid IL or missing references) //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_0639: Unknown result type (might be due to invalid IL or missing references) //IL_0659: Unknown result type (might be due to invalid IL or missing references) //IL_065b: Unknown result type (might be due to invalid IL or missing references) //IL_065d: Unknown result type (might be due to invalid IL or missing references) //IL_065f: Unknown result type (might be due to invalid IL or missing references) //IL_0678: Unknown result type (might be due to invalid IL or missing references) //IL_067a: Unknown result type (might be due to invalid IL or missing references) //IL_067c: Unknown result type (might be due to invalid IL or missing references) //IL_067e: Unknown result type (might be due to invalid IL or missing references) //IL_06ad: Unknown result type (might be due to invalid IL or missing references) //IL_06af: Unknown result type (might be due to invalid IL or missing references) //IL_06b1: Unknown result type (might be due to invalid IL or missing references) //IL_06b3: Unknown result type (might be due to invalid IL or missing references) //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_06fa: Unknown result type (might be due to invalid IL or missing references) //IL_06fc: Unknown result type (might be due to invalid IL or missing references) //IL_06fe: Unknown result type (might be due to invalid IL or missing references) //IL_0743: Unknown result type (might be due to invalid IL or missing references) //IL_0745: Unknown result type (might be due to invalid IL or missing references) //IL_0747: Unknown result type (might be due to invalid IL or missing references) //IL_0749: Unknown result type (might be due to invalid IL or missing references) //IL_0762: Unknown result type (might be due to invalid IL or missing references) //IL_0764: Unknown result type (might be due to invalid IL or missing references) //IL_0766: Unknown result type (might be due to invalid IL or missing references) //IL_0768: Unknown result type (might be due to invalid IL or missing references) //IL_0781: Unknown result type (might be due to invalid IL or missing references) //IL_0783: Unknown result type (might be due to invalid IL or missing references) //IL_0785: Unknown result type (might be due to invalid IL or missing references) //IL_0787: Unknown result type (might be due to invalid IL or missing references) //IL_07a0: 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_07a4: 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_07d5: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07d9: Unknown result type (might be due to invalid IL or missing references) //IL_07db: Unknown result type (might be due to invalid IL or missing references) //IL_07f4: 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_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_07fa: Unknown result type (might be due to invalid IL or missing references) //IL_0826: Unknown result type (might be due to invalid IL or missing references) //IL_0828: Unknown result type (might be due to invalid IL or missing references) //IL_082a: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0858: Unknown result type (might be due to invalid IL or missing references) //IL_085a: Unknown result type (might be due to invalid IL or missing references) //IL_085c: 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) 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; BodyIndex val = bodyIndex; if (val == beetleQueenIndex) { body.baseMaxHealth = 2500f; body.levelMaxHealth = 750f; body.mainRootSpeed = 14f; body.baseMoveSpeed = 14f; body.rootMotionInMainState = false; component2.driveFromRootRotation = false; component2.turnSpeed = 100f; return; } BodyIndex val2 = val; if (val2 == clayDunestriderIndex) { body.baseMaxHealth = 2500f; body.levelMaxHealth = 750f; body.baseMoveSpeed = 14f; return; } BodyIndex val3 = val; if (val3 == grandparentIndex) { body.baseMaxHealth = 4000f; body.levelMaxHealth = 1200f; return; } BodyIndex val4 = val; if (val4 == grovetenderIndex) { body.baseMaxHealth = 3200f; body.levelMaxHealth = 960f; body.baseMoveSpeed = 24f; return; } BodyIndex val5 = val; if (val5 == grovetenderWispIndex) { body.baseMoveSpeed = 50f; body.baseMaxHealth = 50f; body.levelMaxHealth = 15f; return; } BodyIndex val6 = val; if (val6 == impOverlordIndex) { body.baseMaxHealth = 3200f; body.levelMaxHealth = 960f; body.baseMoveSpeed = 13f; body.baseAcceleration = 200f; return; } BodyIndex val7 = val; if (val7 == magmaWormIndex) { body.baseMaxHealth = 2500f; body.levelMaxHealth = 750f; return; } BodyIndex val8 = val; if (val8 == 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); } return; } BodyIndex val9 = val; if (val9 == 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); } return; } BodyIndex val10 = val; if (val10 == stoneTitanIndex) { body.baseMaxHealth = 2500f; body.levelMaxHealth = 750f; body.baseMoveSpeed = 12f; return; } BodyIndex val11 = val; if (val11 == wanderingVagrantIndex) { body.baseMaxHealth = 2500f; body.levelMaxHealth = 750f; body.baseMoveSpeed = 14f; body.baseAcceleration = 500f; return; } BodyIndex val12 = val; if (val12 == wanderingVagrantBombIndex) { body.baseMaxHealth = 90f; body.levelMaxHealth = 27f; return; } BodyIndex val13 = val; if (val13 == beetleIndex) { body.baseMoveSpeed = 12f; component.canBeStunned = false; body.bodyFlags = (BodyFlags)(body.bodyFlags | 1); return; } BodyIndex val14 = val; if (val14 == beetleGuardIndex) { body.baseMoveSpeed = 22f; return; } BodyIndex val15 = val; if (val15 == bighornBisonIndex) { body.baseMoveSpeed = 5f; body.bodyFlags = (BodyFlags)(body.bodyFlags | 1); return; } BodyIndex val16 = val; if (val16 == blindPestIndex) { body.baseMoveSpeed = 9f; body.baseDamage = 10f; body.levelDamage = 2f; return; } BodyIndex val17 = val; if (val17 == clayTemplarIndex) { body.baseMoveSpeed = 11f; body.baseDamage = 12f; body.levelDamage = 2.4f; return; } BodyIndex val18 = val; if (val18 == elderLemurianIndex) { body.baseMoveSpeed = 16f; return; } BodyIndex val19 = val; if (val19 == greaterWispIndex) { body.baseMoveSpeed = 12f; return; } BodyIndex val20 = val; if (val20 == hermitCrabIndex) { body.baseMoveSpeed = 22f; return; } BodyIndex val21 = val; if (val21 == impIndex) { body.baseMoveSpeed = 15f; return; } BodyIndex val22 = val; if (val22 == jellyfishIndex) { body.baseMoveSpeed = 13f; return; } BodyIndex val23 = val; if (val23 == lemurianIndex) { body.baseMoveSpeed = 10f; return; } BodyIndex val24 = val; if (val24 == lesserWispIndex) { body.baseMoveSpeed = 12f; body.baseAcceleration = 24f; component.canBeStunned = false; return; } BodyIndex val25 = val; if (val25 == lunarExploderIndex) { body.baseMoveSpeed = 16f; body.baseAcceleration = 1000f; return; } BodyIndex val26 = val; if (val26 == lunarGolemIndex) { body.baseMoveSpeed = 16f; return; } BodyIndex val27 = val; if (val27 == lunarWispIndex) { body.baseDamage = 10f; return; } BodyIndex val28 = val; if (val28 == stoneGolemIndex) { body.baseDamage = 16f; body.levelDamage = 3.2f; body.baseMoveSpeed = 8f; return; } BodyIndex val29 = val; if (val29 == voidReaverIndex) { body.baseMoveSpeed = 17f; component.canBeStunned = false; return; } BodyIndex val30 = val; if (val30 == xiConstructIndex) { body.baseMoveSpeed = 35f; return; } BodyIndex val31 = val; if (val31 == gupIndex) { body.baseMoveSpeed = 14f; body.baseMaxHealth = 700f; body.levelMaxHealth = 210f; return; } BodyIndex val32 = val; if (val32 == geepIndex) { body.baseMoveSpeed = 19f; body.baseMaxHealth = 550f; body.levelMaxHealth = 165f; body.baseDamage = 11f; body.levelDamage = 2.2f; return; } BodyIndex val33 = val; if (val33 == gipIndex) { body.baseMoveSpeed = 24f; body.baseMaxHealth = 350f; body.levelMaxHealth = 105f; body.baseDamage = 10f; body.levelDamage = 2f; return; } BodyIndex val34 = val; if (val34 == clayApothecaryIndex) { body.baseMoveSpeed = 12f; return; } BodyIndex val35 = val; if (val35 == parentIndex) { body.baseMoveSpeed = 17f; return; } BodyIndex val36 = val; if (val36 == miniMushrumIndex) { body.baseMoveSpeed = 6f; return; } BodyIndex val37 = val; if (val37 == solusControlUnitIndex) { body.baseMoveSpeed = 14f; body.baseMaxHealth = 3000f; body.levelMaxHealth = 900f; return; } BodyIndex val38 = val; if (val38 == scavengerIndex) { body.baseMoveSpeed = 9f; return; } BodyIndex val39 = val; if (val39 == larvaIndex) { body.sprintingSpeedMultiplier = 3f; body.baseMaxHealth = 80f; body.levelMaxHealth = 24f; return; } BodyIndex val40 = val; if (val40 == aurelioniteIndex) { body.baseMaxHealth = 2500f; body.levelMaxHealth = 750f; body.baseMoveSpeed = 12f; return; } BodyIndex val41 = val; if (val41 == solusProbeIndex) { body.baseMoveSpeed = 13f; } } } public static class Master { public static void MasterChanges(CharacterMaster master) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Invalid comparison between Unknown and I4 //IL_0dfc: Unknown result type (might be due to invalid IL or missing references) //IL_1984: Unknown result type (might be due to invalid IL or missing references) //IL_0813: Unknown result type (might be due to invalid IL or missing references) //IL_11fb: Unknown result type (might be due to invalid IL or missing references) //IL_084c: Unknown result type (might be due to invalid IL or missing references) //IL_1234: Unknown result type (might be due to invalid IL or missing references) //IL_089d: Unknown result type (might be due to invalid IL or missing references) //IL_0dbe: Unknown result type (might be due to invalid IL or missing references) //IL_0b9b: Unknown result type (might be due to invalid IL or missing references) //IL_0918: Unknown result type (might be due to invalid IL or missing references) //IL_126d: Unknown result type (might be due to invalid IL or missing references) //IL_1730: 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_1775: Unknown result type (might be due to invalid IL or missing references) //IL_0e3a: Unknown result type (might be due to invalid IL or missing references) //IL_0ae7: Unknown result type (might be due to invalid IL or missing references) //IL_0b20: 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.GiveItem(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; string text = name; if (text == null) { return; } switch (text.Length) { case 24: switch (text[8]) { case 'e': if (text == "BeetleQueenMaster(Clone)") { AISkillDriver val34 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Chase" select x).First(); val34.minDistance = 0f; AISkillDriver val35 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "SpawnWards" select x).First(); val35.maxDistance = 100f + 20f * Main.AIScaling.Value * (float)Run.instance.stageClearCount; val35.maxUserHealthFraction = float.PositiveInfinity; master.inventory.GiveItem(Items.AllCooldownItemDef, 25); } break; case 'p': if (text == "GravekeeperMaster(Clone)") { AISkillDriver val30 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "RunAndShoot" select x).First(); val30.movementType = (MovementType)2; AISkillDriver val31 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Hooks" select x).First(); val31.movementType = (MovementType)2; val31.maxUserHealthFraction = float.PositiveInfinity; val31.minDistance = 13f; AISkillDriver val32 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "WaitAroundUntilSkillIsBack" select x).First(); val32.movementType = (MovementType)2; } break; case 'u': if (text == "BrotherHurtMaster(Clone)" && Main.EnableMithrixChanges.Value) { AISkillDriver val37 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "SlamGround" select x).First(); val37.maxUserHealthFraction = float.PositiveInfinity; val37.movementType = (MovementType)2; AISkillDriver val38 = (from x in ((Component)master).GetComponents<AISkillDriver>() where x.customName == "Shoot" select x).First(); val38.movementType = (MovementType)2; master.inventory.GiveItem(Items.PrimaryStockItemDef, 6); master.inventory.GiveItem(Items.AllCooldownItemDef, 5); } break; case 'a': if (text == "BeetleGuardMaster(Clone)") { AISkillDriver val33 = (from x in ((Component)master).GetComponents<AISkillD
InfernoSkinMod.dll
Decompiled a month agousing System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Security.Permissions; using BepInEx; using BepInEx.Logging; 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.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] namespace InfernoSkinMod { [BepInPlugin("com.Dotflare.InfernoSkinMod", "InfernoSkinMod", "1.1.1")] [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_0039: 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_003e: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0086: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0198: 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; return (instance != null) ? ((BaseUnityPlugin)instance).Logger : null; } } 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_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) 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(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } public static void AddRailgunnerBodyPGunnerSkin() { //IL_02c8: 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)(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)(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)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)(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_0010: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_00ab: 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_00c8: 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_00f0: 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_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0135: 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) //IL_0152: 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_0010: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) 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(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } public static void AddBandit2BodyDBanditSkin() { //IL_02c8: 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)(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)(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)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)(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_0010: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: 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_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0143: 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_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0188: 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_01a5: 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_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: 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_0010: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00af: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_0144: 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_014e: 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) //IL_017a: 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(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } public static void AddCommandoBodyMMandoSkin() { //IL_02c8: 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)(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)(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)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)(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_0010: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_00d6: 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_0010: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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) 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(Instance, new SkinAddedArgs(skinDef, bodyPrefab)); } public static void AddCaptainBodyBCaptainSkin() { //IL_02c8: 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)(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)(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)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)(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_0010: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: 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_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0143: 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_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0188: 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_01a5: 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_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: 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_0010: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00af: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0110: 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_0144: 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_014e: 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) //IL_017a: 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_02c8: 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)(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)(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)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)(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_0010: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_0010: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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_02c8: 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)(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)(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)(object)gameObject) ? gameObject.GetComponent<ModelSkinController>() : null); if (!Object.op_Implicit((Object)(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_0010: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) 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_0010: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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); } } } } 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_0097: 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)(object)child == (Object)null) { break; } string text2 = ((Component)child).gameObject.activeInHierarchy.ToString(); Debug.Log((object)(text + ((Object)child).name + " " + text2 + " " + ((Component)child).transform.position)); if (includecomponents) { ReadComponents(((Component)child).gameObject, tabs + 1); Debug.Log((object)""); } ReadChildren(((Component)child).gameObject, tabs + 1, includecomponents); } } 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)); Component[] array = components; foreach (Component val in array) { 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")) { break; } string text = parent_string + "/" + ((Object)child).name; Debug.Log((object)(" " + ((Object)child).name + "\t\t" + text)); PrintAllPathsInner(((Component)child).gameObject, text); } } public static void PrintDynamicBone(DynamicBone DB) { //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) Debug.Log((object)("Root: " + DB.m_Root)); Debug.Log((object)("Damping: " + DB.m_Damping)); Debug.Log((object)("Damping Dist: " + DB.m_DampingDistrib)); Debug.Log((object)("Elasticity: " + DB.m_Elasticity)); Debug.Log((object)("Elasticity Dist: " + DB.m_ElasticityDistrib)); Debug.Log((object)("Stiffness: " + DB.m_Stiffness)); Debug.Log((object)("Stiffness Dist: " + DB.m_StiffnessDistrib)); Debug.Log((object)("Inert: " + DB.m_Inert)); Debug.Log((object)("Inert Dist: " + DB.m_InertDistrib)); Debug.Log((object)("Radius: " + DB.m_Radius)); Debug.Log((object)("Radius Dist: " + DB.m_RadiusDistrib)); Debug.Log((object)("End Length: " + DB.m_EndLength)); Debug.Log((object)("End Offset: " + DB.m_EndOffset)); Debug.Log((object)("Gravity: " + DB.m_Gravity)); Debug.Log((object)("Force: " + DB.m_Force)); Debug.Log((object)("FreezeAxis: " + DB.m_FreezeAxis)); 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: " + collider.m_Direction)); Debug.Log((object)("\t Center " + collider.m_Center)); Debug.Log((object)("\t Bound " + collider.m_Bound)); 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) { ChildLocator val = null; Transform child = body.transform.GetChild(0); if (Object.op_Implicit((Object)(object)child)) { Transform child2 = child.GetChild(0); if (Object.op_Implicit((Object)(object)child2)) { val = ((Component)child2).GetComponent<ChildLocator>(); if (Object.op_Implicit((Object)(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 static class DynamicSkinHelpers { public static SkinnedMeshRenderer[] GetBaseSkinRenderers(GameObject modelObject) { SkinnedMeshRenderer[] componentsInChildren = modelObject.GetComponentsInChildren<SkinnedMeshRenderer>(true); List<SkinnedMeshRenderer> list = new List<SkinnedMeshRenderer>(); SkinnedMeshRenderer[] array = componentsInChildren; foreach (SkinnedMeshRenderer val in array) { if ((Object)(object)((Component)val).transform.parent == (Object)(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) { 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)(object)armatureHelper)) { return armatureHelper; } } return null; } public static Transform GetTopParent(Transform obj) { Transform val = obj; while ((Object)(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 (!SkinDefs.TryGetValue(self.nameToken, out var _)) { if (value != null) { ClearSkinModifications(LastModelObject, 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)(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) { string bodyname = 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; foreach (SkinnedMeshRenderer val in array2) { val.bones = list.ToArray(); } modifications.BaseModelModifications.Push(modification); } public static void ModificationApplyDynamicBones(GameObject modelObject, Modification modification) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_026a: 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) { Transform val2 = Utils.FindChildInTree(modelObject.transform, collider.m_parent_name); DynamicBoneCollider val3 = ((Component)val2).gameObject.AddComponent<DynamicBoneCollider>(); val3.m_Direction = collider.m_Direction; val3.m_Center = collider.m_Center; val3.m_Bound = collider.m_Bound; val3.m_Radius = collider.m_Radius; val3.m_Height = collider.m_Height; list.Add(val3); } 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 val4 = Utils.FindChildInTree(root, exclusion); if ((Object)(object)val4 != (Object)null) { val.m_Exclusions.Add(val4); } 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_0050: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) 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)(object)componentsInChildren[^num], ignoreOverlays = false, defaultShadowCastingMode = (ShadowCastingMode)1, defaultMaterial = ((Renderer)val).sharedMaterial }; num--; } } } public void clearModification(Modification modification, GameObject modelObject, AppliedModifications modifications) { if (modification.inst_DB_colliders != null) { foreach (DynamicBoneCollider inst_DB_collider in modification.inst_DB_colliders) { Object.Destroy((Object)(object)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; foreach (SkinnedMeshRenderer val in array) { val.bones = list.ToArray(); } } Object.Destroy((Object)(object)modifications.OtherModifications[0].inst_dynamicBone); Object.Destroy((Object)(object)modifications.OtherModifications[0].inst_armature); Object.Destroy((Object)(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) { bodyname = BodyName; prefabpath = PrefabPath; parentname = ParentName; parentSkinToken = ParentSkinToken; affectsbasemodel = AffectsBaseModel; boneIndex = BoneIndex; prefab = assetBundle.LoadAsset<GameObject>(prefabpath); if ((Object)(object)prefab == (Object)null) { Debug.LogWarning((object)("Asset at " + PrefabPath + " was not loaded")); } } } public class AppliedModifications { public Stack<Modification> BaseModelModifications = new Stack<Modification>(); public List<Modification> OtherModifications = new List<Modification>(); } 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_0066: 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_006e: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008e: 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) 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 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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) m_parent_name = parent_name; m_Direction = direction; m_Center = Center; m_Bound = bound; m_Radius = radius; m_Height = heaight; } } }