Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Invoker v0.1.66
plugins/Invoker/HenryMod.dll
Decompiled 2 weeks 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.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.AI.Walker; using EntityStates.Commando; using EntityStates.Commando.CommandoWeapon; using EntityStates.GolemMonster; using HG; using HG.BlendableTypes; using HenryMod.Modules; using HenryMod.Modules.Achievements; using HenryMod.Modules.BaseStates; using HenryMod.Modules.Characters; using HenryMod.Survivors.Henry; using HenryMod.Survivors.Henry.Components; using HenryMod.Survivors.Henry.SkillStates; using IL.EntityStates.GolemMonster; using IL.EntityStates.ImpMonster; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using Newtonsoft.Json; using On.EntityStates.GolemMonster; using On.RoR2; using R2API; using R2API.Utils; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("HenryMod")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+42797355aa18cb54232bd773db55ce2dc50df84b")] [assembly: AssemblyProduct("HenryMod")] [assembly: AssemblyTitle("HenryMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace HenryMod { internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void ErrorAssetBundle(string assetName, string bundleName) { Error("failed to load asset, " + assetName + ", because it does not exist in asset bundle, " + bundleName); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.dillan.Invoker", "Invoker", "0.1.66")] public class HenryPlugin : BaseUnityPlugin { public const string MODUID = "com.dillan.Invoker"; public const string MODNAME = "Invoker"; public const string MODVERSION = "0.1.66"; public const string DEVELOPER_PREFIX = "DILLAN"; public static HenryPlugin instance; private readonly InvokerAudioBank audioBank = new InvokerAudioBank(); private void Awake() { instance = this; Log.Init(((BaseUnityPlugin)this).Logger); Log.Info("Invoker 0.1.66 loaded."); InvokerVisibleMeshKeeper.InstallHooks(); Language.Init(); new HenrySurvivor().Initialize(); new ContentPacks().Initialize(); audioBank.Initialize(); } private void Update() { InvokerRegentHud.Attach(); } private void OnDestroy() { InvokerRegentHud.Cleanup(); audioBank.Dispose(); } } } namespace HenryMod.Survivors.Henry { public class HenrySurvivor : SurvivorBase<HenrySurvivor> { public const string HENRY_PREFIX = "DILLAN_HENRY_"; public override string assetBundleName => "invoker"; public override string bodyName => "HenryBody"; public override string masterName => "HenryMonsterMaster"; public override string modelPrefabName => "mdlHenry"; public override string displayPrefabName => "HenryDisplay"; public override string survivorTokenPrefix => "DILLAN_HENRY_"; public override BodyInfo bodyInfo => new BodyInfo { bodyName = bodyName, bodyNameToken = "DILLAN_HENRY_NAME", subtitleNameToken = "DILLAN_HENRY_SUBTITLE", characterPortrait = InvokerSurvivorPortrait.Get(assetBundle), bodyColor = new Color(1f, 0.15f, 0.8f), sortPosition = 100f, crosshair = Asset.LoadCrosshair("Standard"), podPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/SurvivorPod"), maxHealth = 110f, healthRegen = 1.5f, armor = 0f, jumpCount = 1 }; public override CustomRendererInfo[] customRendererInfos => new CustomRendererInfo[1] { new CustomRendererInfo { childName = "Model" } }; public override UnlockableDef characterUnlockableDef => HenryUnlockables.characterUnlockableDef; public override ItemDisplaysBase itemDisplays => new HenryItemDisplays(); public override AssetBundle assetBundle { get; protected set; } public override GameObject bodyPrefab { get; protected set; } public override CharacterBody prefabCharacterBody { get; protected set; } public override GameObject characterModelObject { get; protected set; } public override CharacterModel prefabCharacterModel { get; protected set; } public override GameObject displayPrefab { get; protected set; } public override void Initialize() { base.Initialize(); } public override void InitializeCharacter() { InvokerOracleSkin.Initialize(Asset.LoadAssetBundle("invokeroracle")); HenryUnlockables.Init(); base.InitializeCharacter(); InvokerAppearance.ApplyCharacterVisuals(bodyPrefab, displayPrefab); HenryConfig.Init(); HenryStates.Init(); HenryTokens.Init(); HenryAssets.Init(assetBundle); Animator componentInChildren = displayPrefab.GetComponentInChildren<Animator>(true); if (Object.op_Implicit((Object)(object)componentInChildren)) { InvokerSelectionPresentation invokerSelectionPresentation = ((Component)componentInChildren).gameObject.AddComponent<InvokerSelectionPresentation>(); invokerSelectionPresentation.flamePrefab = HenryAssets.selectionFlame; invokerSelectionPresentation.nightfallFlamePrefab = InvokerSkinEffects.NightfallSelectionFlame; invokerSelectionPresentation.soulboundFlamePrefab = InvokerSkinEffects.SoulboundSelectionFlame; invokerSelectionPresentation.oracleFlamePrefab = InvokerSkinEffects.OracleSelectionFlame; ((Component)componentInChildren).gameObject.AddComponent<InvokerSelectionAudio>(); } HenryBuffs.Init(assetBundle); InitializeEntityStateMachines(); InitializeSkills(); InitializeSkins(); InitializeCharacterMaster(); AdditionalBodySetup(); AddHooks(); } private void AdditionalBodySetup() { AddHitboxes(); bodyPrefab.AddComponent<HenryWeaponComponent>(); bodyPrefab.AddComponent<InvokerConjurerController>(); bodyPrefab.AddComponent<InvokerRegentController>(); bodyPrefab.AddComponent<InvokerHoverAura>(); InvokerHoverLegClearance invokerHoverLegClearance = characterModelObject.AddComponent<InvokerHoverLegClearance>(); invokerHoverLegClearance.rig = characterModelObject.GetComponentInChildren<InvokerOracleRig>(true); invokerHoverLegClearance.animator = characterModelObject.GetComponent<Animator>(); Animator componentInChildren = displayPrefab.GetComponentInChildren<Animator>(true); if (Object.op_Implicit((Object)(object)componentInChildren)) { InvokerHoverLegClearance invokerHoverLegClearance2 = ((Component)componentInChildren).gameObject.AddComponent<InvokerHoverLegClearance>(); invokerHoverLegClearance2.rig = displayPrefab.GetComponentInChildren<InvokerOracleRig>(true); invokerHoverLegClearance2.animator = componentInChildren; invokerHoverLegClearance2.selectionDisplay = true; } } public void AddHitboxes() { Prefabs.SetupHitBoxGroup(characterModelObject, "SwordGroup", "SwordHitbox"); } public override void InitializeEntityStateMachines() { Prefabs.ClearEntityStateMachines(bodyPrefab); Prefabs.AddMainEntityStateMachine(bodyPrefab, "Body", typeof(GenericCharacterMain), typeof(SpawnTeleporterState)); Prefabs.AddEntityStateMachine(bodyPrefab, "Weapon"); Prefabs.AddEntityStateMachine(bodyPrefab, "Weapon2"); Prefabs.AddEntityStateMachine(bodyPrefab, "Regent"); } public override void InitializeSkills() { Skills.ClearGenericSkills(bodyPrefab); AddPrimarySkills(); AddSecondarySkills(); AddUtiitySkills(); AddSpecialSkills(); InvokerSpellSkills.AddAlternates(bodyPrefab); } private void AddPassiveSkill() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) bodyPrefab.GetComponent<SkillLocator>().passiveSkill = new PassiveSkill { enabled = true, skillNameToken = "DILLAN_HENRY_PASSIVE_NAME", skillDescriptionToken = "DILLAN_HENRY_PASSIVE_DESCRIPTION", keywordToken = "KEYWORD_STUNNING", icon = assetBundle.LoadAsset<Sprite>("texPassiveIcon") }; GenericSkill val = Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, "PassiveSkill"); SkillDefInfo skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "HenryPassive"; skillDefInfo.skillNameToken = "DILLAN_HENRY_PASSIVE_NAME"; skillDefInfo.skillDescriptionToken = "DILLAN_HENRY_PASSIVE_DESCRIPTION"; skillDefInfo.keywordTokens = new string[1] { "KEYWORD_AGILE" }; skillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texPassiveIcon"); SkillDef val2 = Skills.CreateSkillDef(skillDefInfo); Skills.AddSkillsToFamily(val.skillFamily, val2); } private void AddPrimarySkills() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)0); SkillDef val = Skills.CreateSkillDef(new SkillDefInfo("InvokerArcaneBolt", "DILLAN_HENRY_PRIMARY_SLASH_NAME", "DILLAN_HENRY_PRIMARY_SLASH_DESCRIPTION", assetBundle.LoadAsset<Sprite>("texPrimaryIcon"), new SerializableEntityStateType(typeof(ArcaneBolt)), "Weapon", agile: true)); Skills.AddPrimarySkills(bodyPrefab, val); } private void AddSecondarySkills() { //IL_006a: 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_0081: Unknown result type (might be due to invalid IL or missing references) Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)1); SkillDefInfo skillDefInfo = new SkillDefInfo(); skillDefInfo.skillName = "InvokerEldritchBlast"; skillDefInfo.skillNameToken = "DILLAN_HENRY_SECONDARY_GUN_NAME"; skillDefInfo.skillDescriptionToken = "DILLAN_HENRY_SECONDARY_GUN_DESCRIPTION"; skillDefInfo.keywordTokens = new string[1] { "KEYWORD_AGILE" }; skillDefInfo.skillIcon = assetBundle.LoadAsset<Sprite>("texSecondaryIcon"); skillDefInfo.activationState = new SerializableEntityStateType(typeof(EldritchBlast)); skillDefInfo.activationStateMachineName = "Weapon2"; skillDefInfo.interruptPriority = (InterruptPriority)1; skillDefInfo.baseRechargeInterval = 4f; skillDefInfo.baseMaxStock = 1; skillDefInfo.rechargeStock = 1; skillDefInfo.requiredStock = 1; skillDefInfo.stockToConsume = 1; skillDefInfo.isCombatSkill = true; skillDefInfo.canceledFromSprinting = false; skillDefInfo.cancelSprintingOnActivation = false; skillDefInfo.mustKeyPress = false; SkillDef val = Skills.CreateSkillDef(skillDefInfo); Skills.AddSecondarySkills(bodyPrefab, val); } private void AddUtiitySkills() { //IL_0055: 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_006c: Unknown result type (might be due to invalid IL or missing references) Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)2); SkillDef val = Skills.CreateSkillDef(new SkillDefInfo { skillName = "InvokerVoidStep", skillNameToken = "DILLAN_HENRY_UTILITY_ROLL_NAME", skillDescriptionToken = "DILLAN_HENRY_UTILITY_ROLL_DESCRIPTION", skillIcon = assetBundle.LoadAsset<Sprite>("texUtilityIcon"), activationState = new SerializableEntityStateType(typeof(VoidStep)), activationStateMachineName = "Body", interruptPriority = (InterruptPriority)2, baseRechargeInterval = 6f, baseMaxStock = 2, rechargeStock = 1, requiredStock = 1, stockToConsume = 1, isCombatSkill = false, canceledFromSprinting = false, cancelSprintingOnActivation = false, forceSprintDuringState = false, mustKeyPress = true }); Skills.AddUtilitySkills(bodyPrefab, val); } private void AddSpecialSkills() { //IL_0055: 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_006c: Unknown result type (might be due to invalid IL or missing references) Skills.CreateGenericSkillWithSkillFamily(bodyPrefab, (SkillSlot)3); SkillDef val = Skills.CreateSkillDef(new SkillDefInfo { skillName = "InvokerRaiseThrall", skillNameToken = "DILLAN_HENRY_SPECIAL_BOMB_NAME", skillDescriptionToken = "DILLAN_HENRY_SPECIAL_BOMB_DESCRIPTION", skillIcon = assetBundle.LoadAsset<Sprite>("texSpecialIcon"), activationState = new SerializableEntityStateType(typeof(RaiseThrall)), activationStateMachineName = "Weapon2", interruptPriority = (InterruptPriority)1, baseMaxStock = 3, baseRechargeInterval = 8f, rechargeStock = 1, requiredStock = 1, stockToConsume = 1, isCombatSkill = true, mustKeyPress = true }); Skills.AddSpecialSkills(bodyPrefab, val); } public override void InitializeSkins() { ModelSkinController val = ((Component)prefabCharacterModel).gameObject.AddComponent<ModelSkinController>(); val.skins = InvokerMonsoonSkin.PlayerSkins(assetBundle, prefabCharacterModel, displayPrefab); ModelSkinController val2 = displayPrefab.GetComponent<ModelSkinController>(); if (!Object.op_Implicit((Object)(object)val2)) { val2 = displayPrefab.AddComponent<ModelSkinController>(); } val2.skins = val.skins; } public override void InitializeCharacterMaster() { HenryAI.Init(bodyPrefab, masterName); } private void AddHooks() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt; CharacterBody.onBodyStartGlobal += CharacterBody_onBodyStartGlobal; NetworkUser.SetSurvivorPreferenceClient += new hook_SetSurvivorPreferenceClient(NetworkUser_SetSurvivorPreferenceClient); CharacterModel.Start += new hook_Start(CharacterModel_Start); CharacterModel.UpdateOverlays += new hook_UpdateOverlays(CharacterModel_UpdateOverlays); } private static void NetworkUser_SetSurvivorPreferenceClient(orig_SetSurvivorPreferenceClient orig, NetworkUser self, SurvivorDef survivorDef) { if (!Object.op_Implicit((Object)(object)survivorDef) && CharacterBase<HenrySurvivor>.instance != null && Object.op_Implicit((Object)(object)CharacterBase<HenrySurvivor>.instance.bodyPrefab)) { survivorDef = SurvivorCatalog.FindSurvivorDefFromBody(CharacterBase<HenrySurvivor>.instance.bodyPrefab); } if (Object.op_Implicit((Object)(object)survivorDef)) { orig.Invoke(self, survivorDef); } } private static void CharacterModel_Start(orig_Start orig, CharacterModel self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)self) && InvokerAppearance.IsInvokerModel(((Component)self).gameObject)) { InvokerAppearance.EnsureVisible(((Component)self).gameObject); InvokerAppearance.EnsureLocomotion(((Component)self).gameObject); CharacterBody val = self.body; if (!Object.op_Implicit((Object)(object)val)) { val = ((Component)self).GetComponentInParent<CharacterBody>(); } if (ThrallVisuals.IsUndeadMinion(val)) { ThrallVisuals.ApplyUndeadLook(((Component)val).gameObject); } } } private static void CharacterModel_UpdateOverlays(orig_UpdateOverlays orig, CharacterModel self) { orig.Invoke(self); ThrallVisuals.TryAddOverlay(self); } private void CharacterBody_onBodyStartGlobal(CharacterBody body) { if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)((Component)body).GetComponent<InvokerConjurerController>())) { Transform val = ((Object.op_Implicit((Object)(object)body.modelLocator) && Object.op_Implicit((Object)(object)body.modelLocator.modelTransform)) ? body.modelLocator.modelTransform : null); InvokerAppearance.EnsureLocomotion(Object.op_Implicit((Object)(object)val) ? ((Component)val).gameObject : ((Component)body).gameObject); } } private void GlobalEventManager_onServerDamageDealt(DamageReport report) { if (report != null && !((Object)(object)report.attackerBody == (Object)null) && !((Object)(object)report.victimBody == (Object)null) && IsEldritchBlastInflictor(report.damageInfo.inflictor)) { report.victimBody.AddTimedBuff(HenryBuffs.eldritchMark, 8f); } } private static bool IsEldritchBlastInflictor(GameObject inflictor) { if (!Object.op_Implicit((Object)(object)inflictor)) { return false; } if (!InvokerSpellZone.AppliesMark(inflictor)) { return ((Object)inflictor).name.IndexOf("InvokerEldritchBlast", StringComparison.OrdinalIgnoreCase) >= 0; } return true; } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { InvokerSummonStageScaling.Apply(sender, args); if (sender.HasBuff(HenryBuffs.armorBuff)) { args.armorAdd += 300f; } } } public class UndeadMinionVisual : MonoBehaviour { } internal static class EldritchFireVisuals { private sealed class Palette { private readonly float hue; private readonly float saturationMultiplier; private readonly string suffix; private readonly Dictionary<Material, Material> Materials = new Dictionary<Material, Material>(); private readonly Dictionary<Texture, Texture2D> Ramps = new Dictionary<Texture, Texture2D>(); private static readonly string[] ColorProperties = new string[5] { "_Color", "_TintColor", "_EmColor", "_EmissionColor", "_FlashColor" }; public Palette(float hue, float saturationMultiplier, string suffix) { this.hue = hue; this.saturationMultiplier = saturationMultiplier; this.suffix = suffix; } public Palette(Color tint, string suffix) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) float num = default(float); float num2 = default(float); Color.RGBToHSV(tint, ref hue, ref num, ref num2); saturationMultiplier = 1f; this.suffix = suffix; } public void Recolor(GameObject root) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c3: 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_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)root) || (int)SystemInfo.graphicsDeviceType == 4) { return; } ParticleSystem[] componentsInChildren = root.GetComponentsInChildren<ParticleSystem>(true); foreach (ParticleSystem val in componentsInChildren) { if (!IsSmoke(((Component)val).GetComponent<Renderer>())) { MainModule main = val.main; ((MainModule)(ref main)).startColor = Shift(((MainModule)(ref main)).startColor); ColorOverLifetimeModule colorOverLifetime = val.colorOverLifetime; if (((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled) { ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = Shift(((ColorOverLifetimeModule)(ref colorOverLifetime)).color); } ColorBySpeedModule colorBySpeed = val.colorBySpeed; if (((ColorBySpeedModule)(ref colorBySpeed)).enabled) { ((ColorBySpeedModule)(ref colorBySpeed)).color = Shift(((ColorBySpeedModule)(ref colorBySpeed)).color); } TrailModule trails = val.trails; if (((TrailModule)(ref trails)).enabled) { ((TrailModule)(ref trails)).colorOverLifetime = Shift(((TrailModule)(ref trails)).colorOverLifetime); ((TrailModule)(ref trails)).colorOverTrail = Shift(((TrailModule)(ref trails)).colorOverTrail); } } } Renderer[] componentsInChildren2 = root.GetComponentsInChildren<Renderer>(true); foreach (Renderer val2 in componentsInChildren2) { if (IsSmoke(val2)) { continue; } Material[] sharedMaterials = val2.sharedMaterials; for (int j = 0; j < sharedMaterials.Length; j++) { if (Object.op_Implicit((Object)(object)sharedMaterials[j])) { sharedMaterials[j] = GetMaterial(sharedMaterials[j]); } } val2.sharedMaterials = sharedMaterials; TrailRenderer val3 = (TrailRenderer)(object)((val2 is TrailRenderer) ? val2 : null); if (val3 != null) { val3.colorGradient = Shift(val3.colorGradient); } LineRenderer val4 = (LineRenderer)(object)((val2 is LineRenderer) ? val2 : null); if (val4 != null) { val4.colorGradient = Shift(val4.colorGradient); } } Light[] componentsInChildren3 = root.GetComponentsInChildren<Light>(true); foreach (Light val5 in componentsInChildren3) { val5.color = Shift(val5.color); } } private static bool IsSmoke(Renderer renderer) { if (!Object.op_Implicit((Object)(object)renderer)) { return false; } Material[] sharedMaterials = renderer.sharedMaterials; foreach (Material val in sharedMaterials) { if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val.shader) && ((Object)val.shader).name == "Hopoo Games/FX/Opaque Cloud Remap") { return true; } } return false; } private Material GetMaterial(Material original) { //IL_0013: 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_0030: Expected O, but got Unknown //IL_0050: 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) if (Materials.TryGetValue(original, out var value)) { return value; } Material val = new Material(original) { name = ((Object)original).name + suffix }; string[] colorProperties = ColorProperties; foreach (string text in colorProperties) { if (val.HasProperty(text)) { val.SetColor(text, Shift(original.GetColor(text))); } } if (val.HasProperty("_RemapTex")) { Texture texture = original.GetTexture("_RemapTex"); if (Object.op_Implicit((Object)(object)texture)) { val.SetTexture("_RemapTex", (Texture)(object)GetRamp(texture)); } } Materials.Add(original, val); return val; } private Texture2D GetRamp(Texture original) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_00bf: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) if (Ramps.TryGetValue(original, out var value)) { return value; } RenderTexture active = RenderTexture.active; bool sRGBWrite = GL.sRGBWrite; RenderTexture temporary = RenderTexture.GetTemporary(original.width, original.height, 0, (RenderTextureFormat)11, (RenderTextureReadWrite)1); Texture2D val = new Texture2D(original.width, original.height, (TextureFormat)20, false, true) { name = ((Object)original).name + suffix, filterMode = original.filterMode, wrapModeU = original.wrapModeU, wrapModeV = original.wrapModeV, anisoLevel = original.anisoLevel }; try { GL.sRGBWrite = false; Graphics.Blit(original, temporary); RenderTexture.active = temporary; val.ReadPixels(new Rect(0f, 0f, (float)original.width, (float)original.height), 0, 0); Color[] pixels = val.GetPixels(); for (int i = 0; i < pixels.Length; i++) { pixels[i] = Shift(pixels[i]); } val.SetPixels(pixels); val.Apply(false, true); Ramps.Add(original, val); return val; } catch { Object.Destroy((Object)(object)val); throw; } finally { RenderTexture.active = active; GL.sRGBWrite = sRGBWrite; RenderTexture.ReleaseTemporary(temporary); } } private Color Shift(Color original) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) float num = default(float); float num2 = default(float); float num3 = default(float); Color.RGBToHSV(original, ref num, ref num2, ref num3); if (num2 < 0.001f || num3 <= 0f) { return original; } Color val = Color.HSVToRGB(hue, num2 * saturationMultiplier, num3, true); float num4 = Luminance(original); float num5 = Luminance(val); if (num5 > 0f) { val *= num4 / num5; } val.a = original.a; return val; } private static float Luminance(Color color) { //IL_0005: 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_001e: Unknown result type (might be due to invalid IL or missing references) return 0.2126f * color.r + 0.7152f * color.g + 0.0722f * color.b; } private Gradient Shift(Gradient original) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown GradientColorKey[] colorKeys = original.colorKeys; for (int i = 0; i < colorKeys.Length; i++) { colorKeys[i].color = Shift(colorKeys[i].color); } Gradient val = new Gradient { mode = original.mode }; val.SetKeys(colorKeys, original.alphaKeys); return val; } private MinMaxGradient Shift(MinMaxGradient original) { //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) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected I4, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0095: 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) ParticleSystemGradientMode mode = ((MinMaxGradient)(ref original)).mode; switch ((int)mode) { case 0: return new MinMaxGradient(Shift(((MinMaxGradient)(ref original)).color)); case 2: return new MinMaxGradient(Shift(((MinMaxGradient)(ref original)).colorMin), Shift(((MinMaxGradient)(ref original)).colorMax)); case 1: case 4: { MinMaxGradient result = default(MinMaxGradient); ((MinMaxGradient)(ref result))..ctor(Shift(((MinMaxGradient)(ref original)).gradient)); ((MinMaxGradient)(ref result)).mode = ((MinMaxGradient)(ref original)).mode; return result; } case 3: return new MinMaxGradient(Shift(((MinMaxGradient)(ref original)).gradientMin), Shift(((MinMaxGradient)(ref original)).gradientMax)); default: return original; } } } private static readonly Palette Classic = new Palette(0.92f, 0.82f, "InvokerEldritch"); private static readonly Palette Nightfall = new Palette(InvokerPalette.NightfallBlue, "InvokerNightfall"); private static readonly Palette Soulbound = new Palette(InvokerPalette.SoulboundGreen, "InvokerSoulbound"); public static void RecolorSoulbound(GameObject root) { Soulbound.Recolor(root); } public static void Recolor(GameObject root) { Classic.Recolor(root); } public static void RecolorNightfall(GameObject root) { Nightfall.Recolor(root); } } public static class HenryAI { public static void Init(GameObject bodyPrefab, string masterName) { //IL_0035: 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_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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_0170: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_019e: 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_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_022a: 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_0248: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) GameObject obj = Prefabs.CreateBlankMasterPrefab(bodyPrefab, masterName); BaseAI component = obj.GetComponent<BaseAI>(); component.aimVectorDampTime = 0.1f; component.aimVectorMaxSpeed = 360f; AISkillDriver obj2 = obj.AddComponent<AISkillDriver>(); obj2.customName = "Use Primary Swing"; obj2.skillSlot = (SkillSlot)0; obj2.requiredSkill = null; obj2.requireSkillReady = false; obj2.requireEquipmentReady = false; obj2.minUserHealthFraction = float.NegativeInfinity; obj2.maxUserHealthFraction = float.PositiveInfinity; obj2.minTargetHealthFraction = float.NegativeInfinity; obj2.maxTargetHealthFraction = float.PositiveInfinity; obj2.minDistance = 0f; obj2.maxDistance = 8f; obj2.selectionRequiresTargetLoS = false; obj2.selectionRequiresOnGround = false; obj2.selectionRequiresAimTarget = false; obj2.maxTimesSelected = -1; obj2.moveTargetType = (TargetType)0; obj2.activationRequiresTargetLoS = false; obj2.activationRequiresAimTargetLoS = false; obj2.activationRequiresAimConfirmation = false; obj2.movementType = (MovementType)1; obj2.moveInputScale = 1f; obj2.aimType = (AimType)1; obj2.ignoreNodeGraph = false; obj2.shouldSprint = false; obj2.shouldFireEquipment = false; obj2.buttonPressType = (ButtonPressType)0; obj2.driverUpdateTimerOverride = -1f; obj2.resetCurrentEnemyOnNextDriverSelection = false; obj2.noRepeat = false; obj2.nextHighPriorityOverride = null; AISkillDriver obj3 = obj.AddComponent<AISkillDriver>(); obj3.customName = "Use Secondary Shoot"; obj3.skillSlot = (SkillSlot)1; obj3.requireSkillReady = true; obj3.minDistance = 0f; obj3.maxDistance = 25f; obj3.selectionRequiresTargetLoS = false; obj3.selectionRequiresOnGround = false; obj3.selectionRequiresAimTarget = false; obj3.maxTimesSelected = -1; obj3.moveTargetType = (TargetType)0; obj3.activationRequiresTargetLoS = false; obj3.activationRequiresAimTargetLoS = false; obj3.activationRequiresAimConfirmation = true; obj3.movementType = (MovementType)1; obj3.moveInputScale = 1f; obj3.aimType = (AimType)1; obj3.buttonPressType = (ButtonPressType)0; AISkillDriver obj4 = obj.AddComponent<AISkillDriver>(); obj4.customName = "Use Utility Roll"; obj4.skillSlot = (SkillSlot)2; obj4.requireSkillReady = true; obj4.minDistance = 8f; obj4.maxDistance = 20f; obj4.selectionRequiresTargetLoS = true; obj4.selectionRequiresOnGround = false; obj4.selectionRequiresAimTarget = false; obj4.maxTimesSelected = -1; obj4.moveTargetType = (TargetType)0; obj4.activationRequiresTargetLoS = false; obj4.activationRequiresAimTargetLoS = false; obj4.activationRequiresAimConfirmation = false; obj4.movementType = (MovementType)2; obj4.moveInputScale = 1f; obj4.aimType = (AimType)1; obj4.buttonPressType = (ButtonPressType)0; AISkillDriver obj5 = obj.AddComponent<AISkillDriver>(); obj5.customName = "Use Special bomb"; obj5.skillSlot = (SkillSlot)3; obj5.requireSkillReady = true; obj5.minDistance = 0f; obj5.maxDistance = 20f; obj5.selectionRequiresTargetLoS = false; obj5.selectionRequiresOnGround = false; obj5.selectionRequiresAimTarget = false; obj5.maxTimesSelected = -1; obj5.moveTargetType = (TargetType)0; obj5.activationRequiresTargetLoS = false; obj5.activationRequiresAimTargetLoS = false; obj5.activationRequiresAimConfirmation = false; obj5.movementType = (MovementType)1; obj5.moveInputScale = 1f; obj5.aimType = (AimType)1; obj5.buttonPressType = (ButtonPressType)0; AISkillDriver obj6 = obj.AddComponent<AISkillDriver>(); obj6.customName = "Chase"; obj6.skillSlot = (SkillSlot)(-1); obj6.requireSkillReady = false; obj6.minDistance = 0f; obj6.maxDistance = float.PositiveInfinity; obj6.moveTargetType = (TargetType)0; obj6.activationRequiresTargetLoS = false; obj6.activationRequiresAimTargetLoS = false; obj6.activationRequiresAimConfirmation = false; obj6.movementType = (MovementType)1; obj6.moveInputScale = 1f; obj6.aimType = (AimType)1; obj6.buttonPressType = (ButtonPressType)0; } } public static class HenryAssets { public static GameObject swordSwingEffect; public static GameObject swordHitImpactEffect; public static GameObject bombExplosionEffect; public static GameObject voidStepEffect; public static GameObject pinkMuzzleEffect; public static GameObject eldritchMuzzleEffect; public static GameObject summonBurstEffect; public static GameObject summonGestureEffect; public static NetworkSoundEventDef swordHitSoundEvent; public static NetworkSoundEventDef voidStepSoundEvent; public static NetworkSoundEventDef arcaneBoltSoundEvent; public static GameObject selectionFlame; public static Material hoverRingMaterial; public static GameObject bombProjectilePrefab; public static GameObject arcaneBoltProjectilePrefab; public static GameObject eldritchBlastProjectilePrefab; public static GameObject thrallMasterPrefab; public static GameObject thrallBodyPrefab; public static GameObject colossusMasterPrefab; public static GameObject colossusBodyPrefab; public static Sprite regentIcon; private static AssetBundle _assetBundle; public static void Init(AssetBundle assetBundle) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown _assetBundle = assetBundle; InvokerOracleEffects.Init(assetBundle); Shader val = assetBundle.LoadAsset<Shader>("InvokerHoverRing"); if (Object.op_Implicit((Object)(object)val) && val.isSupported) { hoverRingMaterial = new Material(val) { name = "matInvokerSoftHoverRing" }; } else { Log.Warning("Hover ring shader unavailable; continuing without the cosmetic aura."); } swordHitSoundEvent = Content.CreateAndAddNetworkSoundEventDef("HenrySwordHit"); voidStepSoundEvent = Content.CreateAndAddNetworkSoundEventDef("Play_commando_shift"); arcaneBoltSoundEvent = Content.CreateAndAddNetworkSoundEventDef("Play_mage_m1_shoot"); CreateEffects(); CreateProjectiles(); InvokerSkinEffects.Init(); InvokerSpellAssets.Init(); CacheThrallMaster(); CacheColossusMaster(); InvokerRegentEffects.Init(); InvokerCinderlingEffects.Init(); regentIcon = _assetBundle.LoadAsset<Sprite>("texColossusIcon"); } private static void CreateEffects() { CreateBombExplosionEffect(); CacheVoidStepEffect(); selectionFlame = InvokerSelectionVisuals.Create(LoadGamePrefab("Prefabs/Effects/MuzzleFlashes/MuzzleflashMageFire", "RoR2/Base/Mage/MuzzleflashMageFire.prefab")); if (Object.op_Implicit((Object)(object)selectionFlame)) { Object.DontDestroyOnLoad((Object)(object)selectionFlame); } CachePinkCombatEffects(); swordSwingEffect = _assetBundle.LoadEffect("HenrySwordSwingEffect", parentToTransform: true); swordHitImpactEffect = _assetBundle.LoadEffect("ImpactHenrySlash"); } private static void CreateBombExplosionEffect() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) bombExplosionEffect = _assetBundle.LoadEffect("BombExplosionEffect", "HenryBombExplosion"); if (Object.op_Implicit((Object)(object)bombExplosionEffect)) { ShakeEmitter obj = bombExplosionEffect.AddComponent<ShakeEmitter>(); obj.amplitudeTimeDecay = true; obj.duration = 0.5f; obj.radius = 200f; obj.scaleShakeRadiusWithLocalScale = false; obj.wave = new Wave { amplitude = 1f, frequency = 40f, cycleOffset = 0f }; } } private static void CacheVoidStepEffect() { voidStepEffect = CloneRecolorEffect(LoadGamePrefab("Prefabs/Effects/MageLightningBombExplosion", "RoR2/Base/Mage/MageLightningBombExplosion.prefab"), "InvokerVoidStepEffect", null, preserveFire: false, summon: false, teleport: true); } private static void CachePinkCombatEffects() { GameObject val = LoadGamePrefab("Prefabs/Effects/MuzzleFlashes/MuzzleflashMageFire", "RoR2/Base/Mage/MuzzleflashMageFire.prefab"); if (!Object.op_Implicit((Object)(object)val)) { val = LoadGamePrefab("Prefabs/Effects/Muzzleflashes/MuzzleflashMageFire", "RoR2/Base/Mage/MuzzleflashMageFireLarge.prefab"); } pinkMuzzleEffect = CloneRecolorEffect(val, "InvokerPinkMuzzle", null, preserveFire: true); eldritchMuzzleEffect = CloneRecolorEffect(val, "InvokerEldritchMuzzle", null, preserveFire: true); if (!Object.op_Implicit((Object)(object)pinkMuzzleEffect)) { pinkMuzzleEffect = voidStepEffect; } if (!Object.op_Implicit((Object)(object)eldritchMuzzleEffect)) { eldritchMuzzleEffect = pinkMuzzleEffect; } GameObject val2 = LoadGamePrefab("Prefabs/Effects/MageLightningBombExplosion", "RoR2/Base/Mage/MageLightningBombExplosion.prefab"); if (!Object.op_Implicit((Object)(object)val2)) { val2 = LoadGamePrefab("Prefabs/Effects/OmniExplosionVFXQuick", "RoR2/Base/Common/VFX/OmniExplosionVFXQuick.prefab"); } summonBurstEffect = CloneRecolorEffect(val2, "InvokerSummonBurst", null, preserveFire: false, summon: true); if (!Object.op_Implicit((Object)(object)summonBurstEffect)) { summonBurstEffect = voidStepEffect; } if (Object.op_Implicit((Object)(object)pinkMuzzleEffect)) { summonGestureEffect = PrefabAPI.InstantiateClone(pinkMuzzleEffect, "InvokerSummonGesture", false); Renderer[] componentsInChildren = summonGestureEffect.GetComponentsInChildren<Renderer>(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = false; } Light[] componentsInChildren2 = summonGestureEffect.GetComponentsInChildren<Light>(true); for (int i = 0; i < componentsInChildren2.Length; i++) { ((Behaviour)componentsInChildren2[i]).enabled = false; } summonGestureEffect.GetComponent<EffectComponent>().soundName = ""; summonGestureEffect.AddComponent<InvokerSummonGestureEffect>(); Content.CreateAndAddEffectDef(summonGestureEffect); } } private static GameObject CloneRecolorEffect(GameObject source, string cloneName, string soundName = null, bool preserveFire = false, bool summon = false, bool teleport = false) { //IL_00e1: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)source)) { return null; } GameObject val = PrefabAPI.InstantiateClone(source, cloneName, false); if (teleport) { InvokerTeleportVisuals.Refine(val, LoadGamePrefab("Prefabs/Effects/MuzzleFlashes/MuzzleflashMageFire", "RoR2/Base/Mage/MuzzleflashMageFire.prefab")); } else if (summon) { InvokerSummonVisuals.Refine(val); } else if (preserveFire) { EldritchFireVisuals.Recolor(val); } else { InvokerPalette.Recolor(val); } EffectComponent val2 = val.GetComponent<EffectComponent>(); if (!Object.op_Implicit((Object)(object)val2)) { val2 = val.AddComponent<EffectComponent>(); } if (teleport) { EffectComponent[] componentsInChildren = val.GetComponentsInChildren<EffectComponent>(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].soundName = ""; } } else if (summon) { EffectComponent[] componentsInChildren = val.GetComponentsInChildren<EffectComponent>(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].soundName = ""; } val2.soundName = "Play_mage_m1_shoot"; } else if (!string.IsNullOrEmpty(soundName)) { val2.soundName = soundName; } if (!Object.op_Implicit((Object)(object)val.GetComponent<VFXAttributes>())) { val.AddComponent<VFXAttributes>().vfxPriority = (VFXPriority)2; } Content.CreateAndAddEffectDef(val); return val; } public static void PlaySkillSound(NetworkSoundEventDef soundEvent, Vector3 worldPosition, CharacterBody localBody) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)soundEvent == (Object)null)) { EffectManager.SimpleSoundEffect(soundEvent.index, worldPosition, true); LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser(); if (firstLocalUser != null && !((Object)(object)firstLocalUser.cachedBody != (Object)(object)localBody) && Object.op_Implicit((Object)(object)firstLocalUser.cameraRigController)) { Util.PlaySound(soundEvent.eventName, ((Component)firstLocalUser.cameraRigController).gameObject); } } } private static void RecolorProjectile(GameObject projectile, string namePrefix) { if (Object.op_Implicit((Object)(object)projectile)) { EldritchFireVisuals.Recolor(projectile); ProjectileController component = projectile.GetComponent<ProjectileController>(); GameObject ghost = InvokerProjectileVisuals.GetGhost(component); if (Object.op_Implicit((Object)(object)ghost)) { GameObject val = PrefabAPI.InstantiateClone(ghost, namePrefix + "Ghost", false); EldritchFireVisuals.Recolor(val); InvokerProjectileVisuals.SetGhost(component, val); } ProjectileSingleTargetImpact component2 = projectile.GetComponent<ProjectileSingleTargetImpact>(); if (Object.op_Implicit((Object)(object)component2) && Object.op_Implicit((Object)(object)component2.impactEffect)) { component2.impactEffect = CloneRecolorEffect(component2.impactEffect, namePrefix + "Impact", null, preserveFire: true); } ProjectileImpactExplosion component3 = projectile.GetComponent<ProjectileImpactExplosion>(); if (Object.op_Implicit((Object)(object)component3) && Object.op_Implicit((Object)(object)((ProjectileExplosion)component3).explosionEffect)) { ((ProjectileExplosion)component3).explosionEffect = CloneRecolorEffect(((ProjectileExplosion)component3).explosionEffect, namePrefix + "Explosion", null, preserveFire: true); } } } private static void CreateProjectiles() { CreateBombProjectile(); Content.AddProjectilePrefab(bombProjectilePrefab); CreateArcaneBoltProjectile(); CreateEldritchBlastProjectile(); } private static void CreateArcaneBoltProjectile() { GameObject val = LoadGamePrefab("Prefabs/Projectiles/MageFireboltBasic", "RoR2/Base/Mage/MageFireboltBasic.prefab"); if ((Object)(object)val != (Object)null) { arcaneBoltProjectilePrefab = PrefabAPI.InstantiateClone(val, "InvokerArcaneBolt", true); RecolorProjectile(arcaneBoltProjectilePrefab, "InvokerArcaneBolt"); Content.AddProjectilePrefab(arcaneBoltProjectilePrefab); } else { Log.Warning("Arcane Bolt: Artificer bolt prefab missing, using bomb projectile as fallback."); arcaneBoltProjectilePrefab = bombProjectilePrefab; } } private static void CreateEldritchBlastProjectile() { //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) GameObject val = LoadGamePrefab("Prefabs/Projectiles/LemurianBigFireball", "RoR2/Base/LemurianBruiser/LemurianBigFireball.prefab"); if ((Object)(object)val == (Object)null) { val = LoadGamePrefab("Prefabs/Projectiles/MageIcebombProjectile", "RoR2/Base/Mage/MageIceBombProjectile.prefab"); } if ((Object)(object)val == (Object)null) { val = LoadGamePrefab("Prefabs/Projectiles/MageFireboltBasic", "RoR2/Base/Mage/MageFireboltBasic.prefab"); } if ((Object)(object)val == (Object)null) { Log.Warning("Eldritch Blast: no projectile source, falling back to Arcane Bolt prefab."); eldritchBlastProjectilePrefab = arcaneBoltProjectilePrefab; return; } eldritchBlastProjectilePrefab = PrefabAPI.InstantiateClone(val, "InvokerEldritchBlast", true); eldritchBlastProjectilePrefab.transform.localScale = Vector3.one * 1.65f; RecolorEldritchBlast(eldritchBlastProjectilePrefab); ProjectileController component = eldritchBlastProjectilePrefab.GetComponent<ProjectileController>(); if (Object.op_Implicit((Object)(object)component)) { component.procCoefficient = 1f; } Content.AddProjectilePrefab(eldritchBlastProjectilePrefab); } private static void RecolorEldritchBlast(GameObject projectile) { EldritchFireVisuals.Recolor(projectile); ProjectileController component = projectile.GetComponent<ProjectileController>(); GameObject ghost = InvokerProjectileVisuals.GetGhost(component); if (Object.op_Implicit((Object)(object)ghost)) { GameObject val = PrefabAPI.InstantiateClone(ghost, "InvokerEldritchBlastGhost", false); EldritchFireVisuals.Recolor(val); InvokerProjectileVisuals.SetGhost(component, val); } ProjectileImpactExplosion component2 = projectile.GetComponent<ProjectileImpactExplosion>(); if (Object.op_Implicit((Object)(object)component2)) { GameObject impactEffect = component2.impactEffect; GameObject explosionEffect = ((ProjectileExplosion)component2).explosionEffect; if (Object.op_Implicit((Object)(object)impactEffect)) { component2.impactEffect = CloneRecolorEffect(impactEffect, "InvokerEldritchBlastImpact", null, preserveFire: true); } if (Object.op_Implicit((Object)(object)explosionEffect)) { ((ProjectileExplosion)component2).explosionEffect = (((Object)(object)explosionEffect == (Object)(object)impactEffect) ? component2.impactEffect : CloneRecolorEffect(explosionEffect, "InvokerEldritchBlastExplosion", null, preserveFire: true)); } } } private static void CacheThrallMaster() { GameObject val = LoadGamePrefab("Prefabs/CharacterMasters/ImpMonsterMaster", "RoR2/Base/Imp/ImpMaster.prefab"); GameObject val2 = LoadGamePrefab("Prefabs/CharacterBodies/ImpBody", "RoR2/Base/Imp/ImpBody.prefab"); if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null) { val = LoadGamePrefab("Prefabs/CharacterMasters/BeetleMonsterMaster", "RoR2/Base/Beetle/BeetleMaster.prefab"); val2 = LoadGamePrefab("Prefabs/CharacterBodies/BeetleBody", "RoR2/Base/Beetle/BeetleBody.prefab"); } if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null) { val = LoadGamePrefab("Prefabs/CharacterMasters/WispMonsterMaster", "RoR2/Base/Wisp/WispMaster.prefab"); if ((Object)(object)val == (Object)null) { Log.Error("Raise Thrall: could not load a vanilla monster to clone."); return; } thrallMasterPrefab = PrefabAPI.InstantiateClone(val, "InvokerThrallMaster", true); Content.AddMasterPrefab(thrallMasterPrefab); return; } thrallBodyPrefab = PrefabAPI.InstantiateClone(val2, "InvokerThrallBody", true); thrallBodyPrefab.AddComponent<InvokerSummonStageScaling>(); RestyleThrallBody(thrallBodyPrefab); CustomSummonAppearance.TryApply(thrallBodyPrefab, _assetBundle, giant: false); Content.AddCharacterBodyPrefab(thrallBodyPrefab); thrallMasterPrefab = PrefabAPI.InstantiateClone(val, "InvokerThrallMaster", true); CharacterMaster component = thrallMasterPrefab.GetComponent<CharacterMaster>(); if (Object.op_Implicit((Object)(object)component)) { component.bodyPrefab = thrallBodyPrefab; } Content.AddMasterPrefab(thrallMasterPrefab); } private static void CacheColossusMaster() { //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) GameObject val = LoadGamePrefab("Prefabs/CharacterMasters/GolemMonsterMaster", "RoR2/Base/Golem/GolemMaster.prefab"); GameObject val2 = LoadGamePrefab("Prefabs/CharacterBodies/GolemBody", "RoR2/Base/Golem/GolemBody.prefab"); if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null) { Log.Error("Raise Colossus: Stone Golem prefabs did not load."); return; } colossusBodyPrefab = PrefabAPI.InstantiateClone(val2, "InvokerColossusBody", true); colossusBodyPrefab.AddComponent<InvokerSummonStageScaling>(); CharacterBody component = colossusBodyPrefab.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component)) { component.baseNameToken = "DILLAN_HENRY_COLOSSUS_NAME"; component.subtitleNameToken = "DILLAN_HENRY_COLOSSUS_SUBTITLE"; } EntityStateMachine[] components = colossusBodyPrefab.GetComponents<EntityStateMachine>(); foreach (EntityStateMachine val3 in components) { if (val3.customName == "Body") { val3.initialStateType = new SerializableEntityStateType(typeof(GenericCharacterMain)); } } ThrallVisuals.ApplyUndeadLook(colossusBodyPrefab); CustomSummonAppearance.TryApply(colossusBodyPrefab, _assetBundle, giant: true); Content.AddCharacterBodyPrefab(colossusBodyPrefab); colossusMasterPrefab = PrefabAPI.InstantiateClone(val, "InvokerColossusMaster", true); CharacterMaster component2 = colossusMasterPrefab.GetComponent<CharacterMaster>(); if (Object.op_Implicit((Object)(object)component2)) { component2.bodyPrefab = colossusBodyPrefab; } Content.AddMasterPrefab(colossusMasterPrefab); } private static void RestyleThrallBody(GameObject bodyPrefab) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) CharacterBody component = bodyPrefab.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component)) { component.baseNameToken = "DILLAN_HENRY_THRALL_NAME"; component.subtitleNameToken = "DILLAN_HENRY_THRALL_SUBTITLE"; } EntityStateMachine[] components = bodyPrefab.GetComponents<EntityStateMachine>(); foreach (EntityStateMachine val in components) { if (val.customName == "Body") { val.initialStateType = new SerializableEntityStateType(typeof(GenericCharacterMain)); } } ThrallVisuals.ApplyUndeadLook(bodyPrefab); } private static GameObject LoadGamePrefab(string legacyPath, string address) { //IL_0013: 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) GameObject val = LegacyResourcesAPI.Load<GameObject>(legacyPath); if (Object.op_Implicit((Object)(object)val)) { return val; } try { return Addressables.LoadAssetAsync<GameObject>((object)address).WaitForCompletion(); } catch (Exception ex) { Log.Warning("Failed loading " + legacyPath + " / " + address + ": " + ex.Message); return null; } } private static void CreateBombProjectile() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) bombProjectilePrefab = Asset.CloneProjectilePrefab("CommandoGrenadeProjectile", "HenryBombProjectile"); Object.Destroy((Object)(object)bombProjectilePrefab.GetComponent<ProjectileImpactExplosion>()); ProjectileImpactExplosion obj = bombProjectilePrefab.AddComponent<ProjectileImpactExplosion>(); ((ProjectileExplosion)obj).blastRadius = 16f; ((ProjectileExplosion)obj).blastDamageCoefficient = 1f; ((ProjectileExplosion)obj).falloffModel = (FalloffModel)0; obj.destroyOnEnemy = true; obj.lifetime = 12f; obj.impactEffect = bombExplosionEffect; obj.lifetimeExpiredSound = Content.CreateAndAddNetworkSoundEventDef("HenryBombExplosion"); obj.timerAfterImpact = true; obj.lifetimeAfterImpact = 0.1f; ProjectileController component = bombProjectilePrefab.GetComponent<ProjectileController>(); if ((Object)(object)_assetBundle.LoadAsset<GameObject>("HenryBombGhost") != (Object)null) { component.ghostPrefab = _assetBundle.CreateProjectileGhostPrefab("HenryBombGhost"); } component.startSound = ""; } } public static class HenryBuffs { public static BuffDef armorBuff; public static BuffDef eldritchMark; public static void Init(AssetBundle assetBundle) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) armorBuff = Content.CreateAndAddBuff("HenryArmorBuff", LegacyResourcesAPI.Load<BuffDef>("BuffDefs/HiddenInvincibility").iconSprite, Color.white, canStack: false, isDebuff: false); eldritchMark = Content.CreateAndAddBuff("InvokerEldritchMark", LegacyResourcesAPI.Load<BuffDef>("BuffDefs/DeathMark").iconSprite, new Color(1f, 0.12f, 0.82f), canStack: false, isDebuff: true); } } public static class HenryConfig { public static ConfigEntry<bool> someConfigBool; public static ConfigEntry<float> someConfigFloat; public static ConfigEntry<float> someConfigFloatWithCustomRange; public static ConfigEntry<bool> nightfallTestAccess; public static ConfigEntry<bool> spellTestAccess; public static ConfigEntry<bool> soulboundTestAccess; public static ConfigEntry<bool> oracleTestAccess; public static ConfigEntry<KeyboardShortcut> regentKey; public static ConfigEntry<float> hoverSoundVolume; public static string RegentKeyLabel => ((object)regentKey.Value/*cast due to .constrained prefix*/).ToString().Replace("Mouse0", "M1").Replace("Mouse1", "M2") .Replace("Mouse2", "MMB") .Replace("Mouse3", "M4") .Replace("Mouse4", "M3"); public static void Init() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) hoverSoundVolume = Config.MyConfig.Bind<float>("Audio", "Hover sound volume", 0.06f, new ConfigDescription("Quiet pulsing wind for your own Invoker while hovering. 0 disables it; 1 is full volume. Respects the game's sound-effects volume.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); regentKey = Config.BindAndOptions<KeyboardShortcut>("Ossuary Regent", "Summon key", new KeyboardShortcut((KeyCode)327, Array.Empty<KeyCode>()), "Independent Regent summon. M3 uses the spare thumb button (Unity Mouse4), matching Dozzy's grenade. Mouse3 is M4; Mouse2 is the middle wheel. Equipment remains on its normal binding. 30 second cooldown."); oracleTestAccess = Config.BindAndOptions("Testing", "Ashen Oracle skin test access", defaultValue: false, "Make Ashen Oracle and its matching summons selectable without Typhoon mastery or Starstorm 2. Does not grant the achievement or edit your save. Set false and restart to restore the unlock requirement.", restartRequired: true); soulboundTestAccess = Config.BindAndOptions("Testing", "Soulbound skin test access", defaultValue: false, "Make Soulbound and its matching summons selectable without Monsoon mastery. Does not grant the achievement or edit your save. Set false and restart to restore the unlock requirement.", restartRequired: true); spellTestAccess = Config.BindAndOptions("Testing", "Alternate spell test access", defaultValue: false, "Make Soul Lance, Rift Detonation, and Soulstorm selectable without Monsoon mastery. Does not grant the achievement or edit your save. Set false and restart to restore the unlock requirement.", restartRequired: true); nightfallTestAccess = Config.BindAndOptions("Testing", "Nightfall skin test access", defaultValue: false, "Make Nightfall and its matching summons selectable without the summon-only teleporter challenge. Does not grant the achievement or edit your save. Set false and restart to restore the unlock requirement.", restartRequired: true); someConfigBool = Config.BindAndOptions("Henry", "someConfigBool", defaultValue: true, "this creates a bool config, and a checkbox option in risk of options"); someConfigFloat = Config.BindAndOptions("Henry", "someConfigfloat", 5f); someConfigFloatWithCustomRange = Config.BindAndOptions("Henry", "someConfigfloat2", 5f, 0f, 50f, "if a custom range is not passed in, a float will default to a slider with range 0-20. risk of options only has sliders"); } } public static class HenryStates { public static void Init() { Content.AddEntityState(typeof(SlashCombo)); Content.AddEntityState(typeof(Shoot)); Content.AddEntityState(typeof(Roll)); Content.AddEntityState(typeof(ThrowBomb)); Content.AddEntityState(typeof(ArcaneBolt)); Content.AddEntityState(typeof(EldritchBlast)); Content.AddEntityState(typeof(VoidStep)); Content.AddEntityState(typeof(RaiseThrall)); Content.AddEntityState(typeof(RaiseRegent)); Content.AddEntityState(typeof(SoulLance)); Content.AddEntityState(typeof(RiftDetonation)); Content.AddEntityState(typeof(Soulstorm)); } } public static class HenryStaticValues { public const float swordDamageCoefficient = 2.8f; public const float gunDamageCoefficient = 4.2f; public const float bombDamageCoefficient = 16f; public const float arcaneBoltDamageCoefficient = 2.2f; public const float eldritchBlastDamageCoefficient = 5.5f; public const float eldritchMarkDuration = 8f; } public static class HenryTokens { public static void Init() { AddHenryTokens(); } public static void AddHenryTokens() { string text = "DILLAN_HENRY_"; string text2 = $"Cinderlings and the Ossuary Regent grow with the run's ambient level and gain <style=cIsHealing>+{10f}% health</style> and <style=cIsDamage>+{5f}% damage</style> per cleared stage. Summons do not copy your items or equipment."; string text3 = "Invoker is a summoner-sorcerer who marks prey and lets thralls finish the work.<color=#CCD3E0>" + Environment.NewLine + Environment.NewLine + "< ! > Arcane Bolt is your reliable ranged poke." + Environment.NewLine + Environment.NewLine + "< ! > Eldritch Blast marks a target so your thralls focus it." + Environment.NewLine + Environment.NewLine + "< ! > Void Step teleports a short distance." + Environment.NewLine + Environment.NewLine + "< ! > Raise Thrall summons a melee thrall. You can keep up to 3." + Environment.NewLine + Environment.NewLine + "< ! > Press " + HenryConfig.RegentKeyLabel + " to raise an Ossuary Regent. 30 second cooldown; equipment stays separate." + Environment.NewLine + Environment.NewLine + "< ! > " + text2 + Environment.NewLine + Environment.NewLine; string text4 = "..and so he left, invoking something greater."; string text5 = "..and so he vanished, spells unfinished."; Language.Add(text + "NAME", "Invoker"); Language.Add(text + "DESCRIPTION", text3); Language.Add(text + "SUBTITLE", "The Conjurer"); Language.Add(text + "LORE", "sample lore"); Language.Add(text + "OUTRO_FLAVOR", text4); Language.Add(text + "OUTRO_FAILURE", text5); Language.Add(text + "CLASSIC_SKIN_NAME", "Classic"); Language.Add(text + "MASTERY_SKIN_NAME", "Nightfall"); Language.Add(text + "SOULBOUND_SKIN_NAME", "Soulbound"); Language.Add(text + "ORACLE_SKIN_NAME", "Ashen Oracle"); Language.Add(Tokens.GetAchievementNameToken("DILLAN_HENRY_oracleAchievement"), "Invoker: Silent Command"); Language.Add(Tokens.GetAchievementDescriptionToken("DILLAN_HENRY_oracleAchievement"), "As Invoker, defeat a teleporter boss encounter without personally damaging any of its bosses. Your Cinderlings or Ossuary Regent must land a boss killing blow. Unlocks Nightfall and its matching summons."); Language.Add(Tokens.GetAchievementNameToken("DILLAN_HENRY_typhoonAchievement"), "Invoker: Ashen Oracle"); Language.Add(Tokens.GetAchievementDescriptionToken("DILLAN_HENRY_typhoonAchievement"), "As Invoker, beat the game or obliterate on Typhoon to unlock Ashen Oracle and its matching summons. Requires Starstorm 2 to earn; remains usable without it once unlocked."); Language.Add(text + "PASSIVE_NAME", "Henry passive"); Language.Add(text + "PASSIVE_DESCRIPTION", "Sample text."); Language.Add(text + "PRIMARY_SLASH_NAME", "Arcane Bolt"); Language.Add(text + "PRIMARY_SLASH_DESCRIPTION", "<style=cIsUtility>Agile.</style>" + $"Fire a magical bolt for <style=cIsDamage>{220f}% damage</style>."); Language.Add(text + "SOUL_LANCE_NAME", "Soul Lance"); Language.Add(text + "SOUL_LANCE_DESCRIPTION", "<style=cIsUtility>Agile.</style>" + $"Fire a precise lance for <style=cIsDamage>{450f}% damage</style>, <style=cIsDamage>piercing enemies</style>. Slower firing rate."); Language.Add(text + "SECONDARY_GUN_NAME", "Eldritch Blast"); Language.Add(text + "SECONDARY_GUN_DESCRIPTION", "<style=cIsUtility>Agile.</style>" + $"Blast an enemy for <style=cIsDamage>{550f}% damage</style> and apply <style=cIsUtility>Mark</style>. Thralls prioritize the marked target."); Language.Add(text + "RIFT_DETONATION_NAME", "Rift Detonation"); Language.Add(text + "RIFT_DETONATION_DESCRIPTION", "<style=cIsUtility>Agile.</style>" + $"Place a seal at the aimed location. After <style=cIsUtility>{0.8f} seconds</style>, it erupts for <style=cIsDamage>{900f}% damage</style> within <style=cIsUtility>{7f}m</style> and <style=cIsUtility>marks</style> enemies for {8f} seconds. Thralls prioritize marked targets."); Language.Add(text + "UTILITY_ROLL_NAME", "Void Step"); Language.Add(text + "UTILITY_ROLL_DESCRIPTION", "Blink a short distance. <style=cIsUtility>Hold a direction to step that way</style>. Works on the ground and in the air."); Language.Add(text + "SPECIAL_BOMB_NAME", "Raise Thrall"); Language.Add(text + "SPECIAL_BOMB_DESCRIPTION", "Summon a melee thrall. <style=cIsUtility>Maximum of 3</style>. Summoning a fourth replaces the oldest. " + text2); Language.Add(text + "SOULSTORM_NAME", "Soulstorm"); Language.Add(text + "SOULSTORM_DESCRIPTION", "<style=cIsUtility>Agile.</style>" + $"Conjure a storm at the aimed location, striking enemies within <style=cIsUtility>{11f}m</style> for <style=cIsDamage>{150f}% damage</style> every {0.5f} seconds for <style=cIsUtility>{4f} seconds</style>. Continue moving and casting while it persists."); Language.Add(text + "THRALL_NAME", "Cinderling"); Language.Add(text + "THRALL_SUBTITLE", "Raised Dead"); Language.Add(text + "COLOSSUS_NAME", "Ossuary Regent"); Language.Add(text + "COLOSSUS_SUBTITLE", "Raised Giant"); Language.Add(text + "COLOSSUS_EQUIP_NAME", "Raise Colossus"); Language.Add(text + "COLOSSUS_EQUIP_DESC", "Summon a giant undead golem. Only one can exist at a time. <style=cIsUtility>30 second cooldown</style>. " + text2); Language.Add(text + "COLOSSUS_EQUIP_PICKUP", "Summon a giant undead golem."); Language.Add(text + "COLOSSUS_EQUIP_LORE", "Something too large to stay buried."); Language.Add(Tokens.GetAchievementNameToken("DILLAN_HENRY_masteryAchievement"), "Invoker: Mastery"); Language.Add(Tokens.GetAchievementDescriptionToken("DILLAN_HENRY_masteryAchievement"), "As Invoker, beat the game or obliterate on Monsoon or higher to unlock Soulbound, its matching summons, Soul Lance, Rift Detonation, and Soulstorm."); } } public static class HenryUnlockables { public static UnlockableDef characterUnlockableDef; public static UnlockableDef masterySkinUnlockableDef; public static UnlockableDef nightfallUnlockableDef; public static UnlockableDef soulboundUnlockableDef; public static UnlockableDef oracleUnlockableDef; public static void Init() { nightfallUnlockableDef = Content.CreateAndAddUnlockbleDef("DILLAN_HENRY_oracleUnlockable", Tokens.GetAchievementNameToken("DILLAN_HENRY_oracleAchievement"), InvokerOutfitIcons.Nightfall); oracleUnlockableDef = Content.CreateAndAddUnlockbleDef("DILLAN_HENRY_typhoonUnlockable", Tokens.GetAchievementNameToken("DILLAN_HENRY_typhoonAchievement"), InvokerOracleSkin.Icon); masterySkinUnlockableDef = Content.CreateAndAddUnlockbleDef("DILLAN_HENRY_masteryUnlockable", Tokens.GetAchievementNameToken("DILLAN_HENRY_masteryAchievement"), InvokerSoulboundSkin.Icon); soulboundUnlockableDef = masterySkinUnlockableDef; } } internal static class InvokerCinderlingEffects { internal static void Init() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown string[] array = new string[6] { "ImpactImpSwipe", "ImpSwipeEffect", "ImpBlinkEffect", "ImpBossBlinkDestination", "ImpDeathEffect", "SpurtImpBlood" }; foreach (string text in array) { GameObject val = Addressables.LoadAssetAsync<GameObject>((object)("RoR2/Base/Imp/" + text + ".prefab")).WaitForCompletion(); if (!Object.op_Implicit((Object)(object)val)) { Log.Warning("Soulbound Cinderling effect unavailable: " + text); continue; } InvokerSkinEffects.Effect(val, Object.op_Implicit((Object)(object)val.GetComponent<EffectComponent>()), 2); InvokerSkinEffects.Effect(val, Object.op_Implicit((Object)(object)val.GetComponent<EffectComponent>()), 3); } DoubleSlash.OnEnter += new Manipulator(Patch); DoubleSlash.HandleSlash += new Manipulator(Patch); BlinkState.CreateBlinkEffect += new Manipulator(Patch); SpawnState.OnEnter += new Manipulator(Patch); DeathState.OnEnter += new Manipulator(Patch); DeathState.FixedUpdate += new Manipulator(Patch); } internal static GameObject Select(GameObject original, EntityState state) { //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) CharacterBody characterBody = state.characterBody; GameObject thrallBodyPrefab = HenryAssets.thrallBodyPrefab; if (!Object.op_Implicit((Object)(object)characterBody) || (characterBody.skinIndex != 2 && characterBody.skinIndex != 3) || !Object.op_Implicit((Object)(object)thrallBodyPrefab) || characterBody.bodyIndex != thrallBodyPrefab.GetComponent<CharacterBody>().bodyIndex) { return original; } return InvokerSkinEffects.ForBody(original, characterBody); } internal static bool IsVisualRead(Instruction instruction) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) object operand = instruction.Operand; FieldReference val = (FieldReference)((operand is FieldReference) ? operand : null); if (instruction.OpCode != OpCodes.Ldsfld || val == null || ((MemberReference)val.FieldType).FullName != "UnityEngine.GameObject") { return false; } switch (((MemberReference)((MemberReference)val).DeclaringType).FullName) { case "EntityStates.ImpMonster.DoubleSlash": if (!(((MemberReference)val).Name == "hitEffectPrefab")) { return ((MemberReference)val).Name == "swipeEffectPrefab"; } return true; case "EntityStates.ImpMonster.BlinkState": return ((MemberReference)val).Name == "blinkPrefab"; case "EntityStates.ImpMonster.SpawnState": return ((MemberReference)val).Name == "spawnEffectPrefab"; case "EntityStates.ImpMonster.DeathState": if (!(((MemberReference)val).Name == "initialEffect")) { return ((MemberReference)val).Name == "deathEffect"; } return true; default: return false; } } internal static void Patch(ILContext il) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_000a: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); while (val.TryGotoNext((MoveType)2, new Func<Instruction, bool>[1] { IsVisualRead })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate<Func<GameObject, EntityState, GameObject>>((Func<GameObject, EntityState, GameObject>)Select); } } } public sealed class InvokerHoverRingVisual : MonoBehaviour { public const float Period = 3.2f; public const float PulseDuration = 2.15f; public const float PeakOpacity = 0.13f; public const float StartRadius = 0.28f; public const float EndRadius = 0.49f; public Color tint = new Color(1f, 0.36f, 0.64f, 1f); private static readonly int Tint = Shader.PropertyToID("_TintColor"); private Mesh mesh; private MeshRenderer ring; private MaterialPropertyBlock properties; public bool Visible { get { if (Object.op_Implicit((Object)(object)ring)) { return ((Renderer)ring).enabled; } return false; } } public float Opacity { get; private set; } public float Radius { get; private set; } public void Initialize(Material material) { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)ring) && Object.op_Implicit((Object)(object)material)) { mesh = CreateMesh(); ((Component)this).gameObject.AddComponent<MeshFilter>().sharedMesh = mesh; ring = ((Component)this).gameObject.AddComponent<MeshRenderer>(); ((Renderer)ring).sharedMaterial = material; ((Renderer)ring).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)ring).receiveShadows = false; ((Renderer)ring).lightProbeUsage = (LightProbeUsage)0; ((Renderer)ring).reflectionProbeUsage = (ReflectionProbeUsage)0; properties = new MaterialPropertyBlock(); ((Renderer)ring).enabled = false; } } public void Evaluate(float age, float visibility, Vector3 groundPoint, Vector3 normal) { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: 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_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)ring)) { float num = Mathf.Repeat(Mathf.Max(0f, age), 3.2f) / 2.15f; float num2 = ((num < 1f) ? Mathf.Pow(Mathf.Sin(num * MathF.PI), 2f) : 0f); Opacity = 0.13f * num2 * Mathf.Clamp01(visibility); Radius = Mathf.Lerp(0.28f, 0.49f, Mathf.SmoothStep(0f, 1f, Mathf.Clamp01(num))); ((Component)this).transform.SetPositionAndRotation(groundPoint + normal * 0.035f, Quaternion.FromToRotation(Vector3.up, normal)); Vector3 val = (Object.op_Implicit((Object)(object)((Component)this).transform.parent) ? ((Component)this).transform.parent.lossyScale : Vector3.one); ((Component)this).transform.localScale = new Vector3(Radius / Mathf.Max(0.001f, Mathf.Abs(val.x)), Radius / Mathf.Max(0.001f, Mathf.Abs(val.y)), Radius / Mathf.Max(0.001f, Mathf.Abs(val.z))); Color val2 = tint; val2.a = Opacity; properties.SetColor(Tint, val2); ((Renderer)ring).SetPropertyBlock(properties); ((Renderer)ring).enabled = Opacity > 0.0001f; } } public void SetMaterial(Material material) { if (Object.op_Implicit((Object)(object)ring) && Object.op_Implicit((Object)(object)material) && (Object)(object)((Renderer)ring).sharedMaterial != (Object)(object)material) { ((Renderer)ring).sharedMaterial = material; } } private void OnDisable() { if (Object.op_Implicit((Object)(object)ring)) { ((Renderer)ring).enabled = false; } Opacity = 0f; } private void OnDestroy() { if (Object.op_Implicit((Object)(object)mesh)) { if (Application.isPlaying) { Object.Destroy((Object)(object)mesh); } else { Object.DestroyImmediate((Object)(object)mesh); } } } private static Mesh CreateMesh() { //IL_0096: 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_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_015b: 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_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown float[] array = new float[4] { 0.94f, 0.98f, 1.02f, 1.06f }; float[] array2 = new float[4] { 0f, 1f, 1f, 0f }; Vector3[] array3 = (Vector3[])(object)new Vector3[260]; Color[] array4 = (Color[])(object)new Color[array3.Length]; int[] array5 = new int[1152]; for (int i = 0; i <= 64; i++) { float num = (float)i * MathF.PI * 2f / 64f; for (int j = 0; j < 4; j++) { int num2 = i * 4 + j; array3[num2] = new Vector3(Mathf.Cos(num) * array[j], 0f, Mathf.Sin(num) * array[j]); array4[num2] = new Color(1f, 1f, 1f, array2[j]); } } int num3 = 0; for (int k = 0; k < 64; k++) { for (int l = 0; l < 3; l++) { int num4 = k * 4 + l; int num5 = num4 + 4; array5[num3++] = num4; array5[num3++] = num5; array5[num3++] = num4 + 1; array5[num3++] = num4 + 1; array5[num3++] = num5; array5[num3++] = num5 + 1; } } Mesh val = new Mesh { name = "InvokerSoftHoverRing", vertices = array3, colors = array4, triangles = array5 }; val.RecalculateBounds(); return val; } } internal static class InvokerMonsoonSkin { internal static SkinDef CinderlingSkin; internal static SkinDef RegentSkin; internal static SkinDef[] PlayerSkins(AssetBundle bundle, CharacterModel model, GameObject display) { //IL_0118: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0141: 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_0161: Unknown result type (might be due to invalid IL or missing references) SkinnedMeshRenderer component = ((Component)((Component)model).GetComponentInChildren<InvokerVisibleMeshKeeper>(true)).GetComponent<SkinnedMeshRenderer>(); SkinDef val = Skins.CreateSkinDef("DILLAN_HENRY_CLASSIC_SKIN_NAME", InvokerOutfitIcons.Classic, model.baseRendererInfos, ((Component)model).gameObject); val.skinDefParams.meshReplacements = Replacement((Renderer)(object)component, component.sharedMesh); Mesh val2 = bundle.LoadAsset<Mesh>("meshInvokerNightfallClassic"); if (!Object.op_Implicit((Object)(object)val2) || val2.bindposes.Length != component.bones.Length || val2.subMeshCount != 3) { throw new InvalidOperationException("Missing Classic-based Nightfall mesh."); } Material[] array = CreatePlayerMaterials(bundle); bool value = HenryConfig.nightfallTestAccess.Value; SkinDef val3 = Skins.CreateSkinDef("DILLAN_HENRY_MASTERY_SKIN_NAME", InvokerOutfitIcons.Nightfall, model.baseRendererInfos, ((Component)model).gameObject, value ? null : HenryUnlockables.nightfallUnlockableDef); val3.skinDefParams.meshReplacements = Replacement((Renderer)(object)component, val2); val3.skinDefParams.rendererInfos[0].defaultMaterial = array[0]; if (!Object.op_Implicit((Object)(object)CinderlingSkin) || !Object.op_Implicit((Object)(object)RegentSkin)) { throw new InvalidOperationException("Matching Nightfall summon skins are missing."); } val3.skinDefParams.minionSkinReplacements = (MinionSkinReplacement[])(object)new MinionSkinReplacement[2] { new MinionSkinReplacement { minionBodyPrefab = HenryAssets.thrallBodyPrefab, minionSkin = CinderlingSkin }, new MinionSkinReplacement { minionBodyPrefab = HenryAssets.colossusBodyPrefab, minionSkin = RegentSkin } }; GameObject[] array2 = (GameObject[])(object)new GameObject[2] { ((Component)model).gameObject, display }; for (int i = 0; i < array2.Length; i++) { InvokerVisibleMeshKeeper[] componentsInChildren = array2[i].GetComponentsInChildren<InvokerVisibleMeshKeeper>(true); foreach (InvokerVisibleMeshKeeper obj in componentsInChildren) { obj.alternateMesh = val2; obj.alternateMaterials = array; } } Log.Info("Nightfall Silent Command reward registered with both matching summons."); Log.Info("Nightfall uses Classic's original rig and engraved textures. Test access: " + value); return (SkinDef[])(object)new SkinDef[4] { val, val3, InvokerSoulboundSkin.Player(bundle, model, display, component), InvokerOracleSkin.Player(bundle, model, display, component) }; } internal static SkinDef[] SummonSkins(AssetBundle bundle, string name, CharacterModel model, SkinnedMeshRenderer renderer) { SkinDef val = Skins.CreateSkinDef(name + "DefaultSkin", null, model.baseRendererInfos, ((Component)model).gameObject); val.skinDefParams.meshReplacements = Replacement((Renderer)(object)renderer, renderer.sharedMesh); SkinDef val2 = Skins.CreateSkinDef(name + "NightfallSkin", null, model.baseRendererInfos, ((Component)model).gameObject); val2.skinDefParams.meshReplacements = Replacement((Renderer)(object)renderer, RequireMesh(bundle, name, renderer)); val2.skinDefParams.rendererInfos[0].defaultMaterial = CreateMaterial(bundle, name); if (name == "Cinderling") { CinderlingSkin = val2; } else { RegentSkin = val2; } ((Component)model).gameObject.AddComponent<InvokerSummonSkinPortrait>().nightPortrait = (Texture)(object)bundle.LoadAsset<Texture2D>("tex" + name + "MonsoonPortrait"); return (SkinDef[])(object)new SkinDef[4] { val, val2, InvokerSoulboundSkin.Summon(bundle, name, model, renderer), InvokerOracleSkin.Summon(bundle, name, model, renderer) }; } private static MeshReplacement[] Replacement(Renderer renderer, Mesh mesh) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) return (MeshReplacement[])(object)new MeshReplacement[1] { new MeshReplacement { renderer = renderer, mesh = mesh } }; } private static Mesh RequireMesh(AssetBundle bundle, string name, SkinnedMeshRenderer renderer) { Mesh val = bundle.LoadAsset<Mesh>("mesh" + name + "Monsoon"); if (!Object.op_Implicit((Object)(object)val) || val.bindposes.Length != renderer.bones.Length) { throw new InvalidOperationException("Missing or incompatible Nightfall mesh: " + name); } return val; } private static Material CreateMaterial(AssetBundle bundle, string name) { //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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Expected O, but got Unknown //IL_0100: 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_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown Texture2D val = bundle.LoadAsset<Texture2D>("tex" + name + "MonsoonAlbedo"); Texture2D val2 = bundle.LoadAsset<Texture2D>("tex" + name + "MonsoonEmission"); if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val2)) { throw new InvalidOperationException("Missing Nightfall textures: " + name); } Material val3 = new Material(Object.op_Implicit((Object)(object)Materials.hotpoo) ? Materials.hotpoo : LegacyResourcesAPI.Load<Shader>("Shaders/Deferred/HGStandard")) { name = "mat" + name + "Nightfall" }; val3.SetTexture("_MainTex", (Texture)(object)val); val3.SetColor("_Color", Color.white); val3.SetFloat("_SpecularStrength", 0.16f); val3.SetFloat("_SpecularExponent", 8f); val3.SetTexture("_NormalTex", (Texture)(object)bundle.LoadAsset<Texture2D>("tex" + name + "MonsoonNormal")); val3.SetFloat("_NormalStrength", 0.35f); InvokerNightfallEmission.Apply(val3, (Texture)(object)val2, 12f); val3.SetFloat("_Cutoff", 0f); val3.SetFloat("_Cull", 2f); val3.DisableKeyword("DITHER"); return val3; } private static Material[] CreatePlayerMaterials(AssetBundle bundle) { //IL_0050: 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_0061: Expected O, but got Unknown //IL_0073: 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_00f9: 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_010a: Expected O, but got Unknown //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Expected O, but got Unknown Texture2D val = bundle.LoadAsset<Texture2D>("texInvokerNightfallClassicAlbedo"); Texture2D val2 = bundle.LoadAsset<Texture2D>("texInvokerFaceSlitEmission"); if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val2)) { throw new InvalidOperationException("Missing engraved Nightfall textures."); } Material val3 = new Material(Object.op_Implicit((Object)(object)Materials.hotpoo) ? Materials.hotpoo : LegacyResourcesAPI.Load<Shader>("Shaders/Deferred/HGStandard")) { name = "matInvokerNightfallClassic" }; val3.SetTexture("_MainTex", (Texture)(object)val); val3.SetColor("_Color", Color.white); val3.SetColor("_MainColor", Color.white); val3.SetFloat("_NormalStrength", 0f); val3.SetFloat("_SpecularStrength", 0.12f); val3.SetFloat("_SpecularExponent", 8f); val3.SetFloat("_EmPower", 0f); val3.SetFloat("_Cutoff", 0f); val3.SetFloat("_Cull", 2f); val3.DisableKeyword("DITHER"); Material val4 = new Material(val3) { name = "matInvokerNightfallClassicJewels" }; InvokerNightfallEmission.Apply(val4, (Texture)(object)Texture2D.whiteTexture, 0f); Material val5 = new Material(val3) { name = "matInvokerNightfallClassicSlit" }; InvokerNightfallEmission.Apply(val5, (Texture)(object)val2, 0f); InvokerCrystalGeometry.RefinishPlayer(val4, val5, 1); return (Material[])(object)new Material[3] { val3, val4, val5 }; } } internal static class InvokerNightfallEmission { internal static readonly Color GlowBlue = new Color(0.025f, 0.24f, 1f, 1f); internal const float Jewels = 10f; internal const float Face = 9f; internal const float Summons = 12f; internal static void Apply(Material material, Texture mask, float power) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) material.SetTexture("_EmTex", mask); material.SetColor("_EmColor", GlowBlue); material.SetFloat("_EmPower", power); } } internal static class InvokerOracleEffects { private static readonly Dictionary<Material, Material> Materials = new Dictionary<Material, Material>(); private static readonly Dictionary<Texture, Texture2D> Ramps = new Dictionary<Texture, Texture2D>(); private static readonly Dictionary<Material, Material> Sparks = new Dictionary<Material, Material>(); internal static Material SoftMaterial { get; private set; } internal static Material InkMaterial { get; private set; } internal static Material AccentMaterial { get; private set; } internal static void Init(AssetBundle bundle) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown //IL_0111: Unknown result type (might be due to invalid IL or missing references) Shader val = bundle.LoadAsset<Shader>("InvokerOracleSoft"); if (Object.op_Implicit((Object)(object)val)) { SoftMaterial = new Material(val) { name = "matOracleSoftMagic" }; SoftMaterial.SetColor("_EdgeColor", new Color(3f, 0.07f, 1.2f, 1f)); InkMaterial = new Material(SoftMaterial) { name = "matOracleInkWisps" }; InkMaterial.SetFloat("_NoiseStrength", 1f); InkMaterial.SetColor("_EdgeColor", new Color(1.8f, 0.04f, 0.72f, 1f)); Shader obj = bundle.LoadAsset<Shader>("InvokerHoverRing"); if (!Object.op_Implicit((Object)(object)obj)) { throw new InvalidOperationException("Ashen Oracle accent shader is missing."); } AccentMaterial = new Material(obj) { name = "matOraclePinkAccent", renderQueue = 3001 }; AccentMaterial.SetColor("_TintColor", new Color(1.4f, 0.07f, 0.65f, 0.7f)); return; } throw new InvalidOperationException("Ashen Oracle soft-magic shader is missing."); } internal static void Recolor(GameObject root, bool muzzle = false) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_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_00a0: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_0183: 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: Expected O, but got Unknown //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)root) || (int)SystemInfo.graphicsDeviceType == 4) { return; } EldritchFireVisuals.Recolor(root); ParticleSystem[] componentsInChildren = root.GetComponentsInChildren<ParticleSystem>(true); foreach (ParticleSystem val in componentsInChildren) { if (!muzzle || !IsMuzzleAccent(((Object)val).name)) { MainModule main = val.main; ((MainModule)(ref main)).startColor = Neutral(((MainModule)(ref main)).startColor); ColorOverLifetimeModule colorOverLifetime = val.colorOverLifetime; if (((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled) { ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = Neutral(((ColorOverLifetimeModule)(ref colorOverLifetime)).color); } ColorBySpeedModule colorBySpeed = val.colorBySpeed; if (((ColorBySpeedModule)(ref colorBySpeed)).enabled) { ((ColorBySpeedModule)(ref colorBySpeed)).color = Neutral(((ColorBySpeedModule)(ref colorBySpeed)).color); } TrailModule trails = val.trails; if (((TrailModule)(ref trails)).enabled) { ((TrailModule)(ref trails)).colorOverLifetime = Neutral(((TrailModule)(ref trails)).colorOverLifetime); ((TrailModule)(ref trails)).colorOverTrail = Neutral(((TrailModule)(ref trails)).colorOverTrail); } } } Renderer[] componentsInChildren2 = root.GetComponentsInChildren<Renderer>(true); foreach (Renderer val2 in componentsInChildren2) { if (muzzle && ((Object)val2).name == "Flash") { val2.enabled = false; } else { if (muzzle && IsMuzzleAccent(((Object)val2).name)) { continue; } if (((Object)val2).name.IndexOf("Sparks", StringComparison.OrdinalIgnoreCase) >= 0) { Material[] sharedMaterials = val2.sharedMaterials; for (int j = 0; j < sharedMaterials.Length; j++) { if (!Object.op_Implicit((Object)(object)sharedMaterials[j])) { continue; } if (!Sparks.TryGetValue(sharedMaterials[j], out var value)) { value = new Material(sharedMaterials[j]) { name = ((Object)sharedMaterials[j]).name + "OracleSpark" }; if (value.HasProperty("_TintColor")) { Color val3 = InvokerOracleSkin.Pink * 1.6f; val3.a = sharedMaterials[j].GetColor("_TintColor").a; value.SetColor("_TintColor", val3); } if (value.HasProperty("_Boost")) { value.SetFloat("_Boost", 1f); } Sparks.Add(sharedMaterials[j], value); } sharedMaterials[j] = value; } val2.sharedMaterials = sharedMaterials; c