using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; 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 HarmonyLib; using IL.RoR2; using Microsoft.CodeAnalysis; using Mono.Cecil; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using On.RoR2; using R2API; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.Items; using RoR2.Projectile; using SeekersoftheStormNerfs.items; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SeekersoftheStormNerfs")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("SeekersoftheStormNerfs")] [assembly: AssemblyTitle("SeekersoftheStormNerfs")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace SeekersoftheStormNerfs { internal static class Log { private static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } internal static class PluginConfig { public static ConfigEntry CEBaseKillDamage { get; set; } public static ConfigEntry CEStackKillDamage { get; set; } public static ConfigEntry CEBaseMaxKills { get; set; } public static ConfigEntry CEStackMaxKills { get; set; } public static ConfigEntry CEBaseTime { get; set; } public static ConfigEntry CEStackTime { get; set; } public static ConfigEntry CERefreshMethod { get; set; } public static ConfigEntry CEBeepBoop { get; set; } public static ConfigEntry EABaseMoveSpeed { get; set; } public static ConfigEntry EAStackMoveSpeed { get; set; } public static ConfigEntry EABaseWispInterval { get; set; } public static ConfigEntry EAStackWispIntervalReduction { get; set; } public static ConfigEntry EABaseWispMoveSpeed { get; set; } public static ConfigEntry EAStackWispMoveSpeed { get; set; } public static ConfigEntry EABaseMaxWisps { get; set; } public static ConfigEntry EAStackMaxWisps { get; set; } public static ConfigEntry EANoStackWispMoveSpeed { get; set; } public static ConfigEntry EANoStackMaxWisps { get; set; } public static ConfigEntry EABaseBuffDuration { get; set; } public static ConfigEntry EAStackBuffDuration { get; set; } public static ConfigEntry BLBaseBodyAttackSpeed { get; set; } public static ConfigEntry BLStackBodyAttackSpeed { get; set; } public static ConfigEntry BLBaseAttackSpeed { get; set; } public static ConfigEntry BLStackAttackSpeed { get; set; } public static ConfigEntry BLBaseMaxBodies { get; set; } public static ConfigEntry BLStackMaxBodies { get; set; } public static ConfigEntry BLBaseRadius { get; set; } public static ConfigEntry BLStackRadius { get; set; } public static ConfigEntry BLHyperbolicScaling { get; set; } public static ConfigEntry BLEnableUnconditionalAS { get; set; } public static ConfigEntry WEBaseDamageReduction { get; set; } public static ConfigEntry WEStackDamageReduction { get; set; } public static ConfigEntry WEBaseEchoes { get; set; } public static ConfigEntry WEStackEchoes { get; set; } public static ConfigEntry WEBaseCooldown { get; set; } public static ConfigEntry WEStackCooldownReduction { get; set; } public static ConfigEntry WEInitialDelay { get; set; } public static ConfigEntry WEEnableDamageThreshold { get; set; } public static ConfigEntry WEDamageThreshold { get; set; } public static ConfigEntry WEInterval { get; set; } public static ConfigEntry BFBaseLaunchesAfterFirst { get; set; } public static ConfigEntry BFStackLaunchesAfterFirst { get; set; } public static ConfigEntry BFBaseDamageBonus { get; set; } public static ConfigEntry BFStackDamageBonus { get; set; } public static ConfigEntry BFBaseCooldown { get; set; } public static ConfigEntry BFCooldownFloor { get; set; } public static ConfigEntry BFStackCooldownReduction { get; set; } public static ConfigEntry CDBaseChance { get; set; } public static ConfigEntry CDStackChance { get; set; } public static ConfigEntry LSBaseMaxCharges { get; set; } public static ConfigEntry LSStackMaxCharges { get; set; } public static ConfigEntry LSChargeThreshold { get; set; } public static ConfigEntry LSBaseDamage { get; set; } public static ConfigEntry LSStackDamage { get; set; } public static ConfigEntry LSBaseCDR { get; set; } public static ConfigEntry LSStackCDR { get; set; } public static ConfigEntry LSProcCoeff { get; set; } public static ConfigEntry LSStrikeDelay { get; set; } public static ConfigEntry LSRadius { get; set; } public static ConfigEntry LSAllSkillsCharge { get; set; } public static ConfigEntry NTBaseBleedChance { get; set; } public static ConfigEntry NTStackBleedChance { get; set; } public static ConfigEntry NTEnableBurn { get; set; } public static ConfigEntry NTBaseBurnChance { get; set; } public static ConfigEntry NTStackBurnChance { get; set; } public static ConfigEntry NTBaseDebuffTransfer { get; set; } public static ConfigEntry NTStackDebuffTransfer { get; set; } public static ConfigEntry NTBaseBodies { get; set; } public static ConfigEntry NTStackBodies { get; set; } public static ConfigEntry NTBaseRange { get; set; } public static ConfigEntry NTStackRange { get; set; } public static ConfigEntry PBBaseExpGain { get; set; } public static ConfigEntry PBStackExpGain { get; set; } public static ConfigEntry PBBaseStatBonus { get; set; } public static ConfigEntry PBStackStatBonus { get; set; } public static ConfigEntry PBCalcBasedOnBeadsRemoved { get; set; } public static ConfigEntry SSBaseItemCount { get; set; } public static ConfigEntry SSStackExtraItemChance { get; set; } public static ConfigEntry SSOneExtraItemChance { get; set; } public static ConfigEntry SSTwoExtraItemsChance { get; set; } public static ConfigEntry SSThreeExtraItemsChance { get; set; } public static ConfigEntry UTBaseTempHealth { get; set; } public static ConfigEntry UTStackTempHealth { get; set; } public static ConfigEntry UTBuffTime { get; set; } public static ConfigEntry UTStackBuffTime { get; set; } public static ConfigEntry UTBaseCooldown { get; set; } public static ConfigEntry UTStackCooldownReduction { get; set; } public static ConfigEntry UTBuffExtension { get; set; } public static ConfigEntry UTMaxBuffExtension { get; set; } public static ConfigEntry UTBaseBleedStacks { get; set; } public static ConfigEntry UTStackBleedStacks { get; set; } public static ConfigEntry UTConsumeOneStack { get; set; } public static ConfigEntry UTConsumeAllStacks { get; set; } public static ConfigEntry UTShowReadyBuff { get; set; } public static ConfigEntry EBTravelSpeed { get; set; } public static ConfigEntry EBHitProcCoeff { get; set; } public static ConfigEntry EBSpinProcCoeff { get; set; } public static ConfigEntry EBBaseHitDamage { get; set; } public static ConfigEntry EBStackHitDamage { get; set; } public static ConfigEntry EBPercSpinDamage { get; set; } public static ConfigEntry EBBaseHitChance { get; set; } public static ConfigEntry EBStackHitChance { get; set; } public static ConfigEntry GNBaseBuffs { get; set; } public static ConfigEntry GNStackBuffs { get; set; } public static ConfigEntry GNBaseStatBuff { get; set; } public static ConfigEntry GNStackStatBuff { get; set; } public static ConfigEntry GNEnableAccelBoost { get; set; } public static ConfigEntry RLBaseChance { get; set; } public static ConfigEntry RLStackChance { get; set; } public static ConfigEntry RLBaseDamage { get; set; } public static ConfigEntry RLStackDamage { get; set; } public static ConfigEntry RLThreshold { get; set; } public static ConfigEntry RLBaseThresholdChance { get; set; } public static ConfigEntry RLStackThresholdChance { get; set; } public static ConfigEntry RLChanceCap { get; set; } public static ConfigEntry RLBaseThresholdDamage { get; set; } public static ConfigEntry RLStackThresholdDamage { get; set; } public static ConfigEntry RLDamageCap { get; set; } public static ConfigEntry RLAoE { get; set; } public static ConfigEntry RLProcCoeff { get; set; } public static ConfigEntry SWBaseChampionDropChance { get; set; } public static ConfigEntry SWStackChampionDropChance { get; set; } public static ConfigEntry SWBaseEliteDropChance { get; set; } public static ConfigEntry SWStackEliteDropChance { get; set; } public static ConfigEntry WBBaseBossHP { get; set; } public static ConfigEntry WBStackBossHP { get; set; } public static ConfigEntry WBInitialCount { get; set; } public static ConfigEntry WBBaseMaxMissiles { get; set; } public static ConfigEntry WBStackMaxMissiles { get; set; } public static ConfigEntry WBGoldReq { get; set; } public static ConfigEntry WBGoldReqScalingExponent { get; set; } public static ConfigEntry WBNormalEnemyDamageRatio { get; set; } public static ConfigEntry WBProjectileDamageCoeff { get; set; } public static ConfigEntry WBProcCoeff { get; set; } public static ConfigEntry WBStartDelay { get; set; } public static ConfigEntry WBInterval { get; set; } public static ConfigEntry WBEnemyCollision { get; set; } public static ConfigEntry WBDisableDuringTPEvent { get; set; } public static ConfigEntry WBEnableBaseDamageMissiles { get; set; } public static ConfigEntry WBBaseDamage { get; set; } public static ConfigEntry WBStackDamage { get; set; } public static ConfigEntry WBEnableGoldOnShrineUse { get; set; } public static ConfigEntry WBBaseShrineUseGold { get; set; } public static ConfigEntry WBStackShrineUseGold { get; set; } public static ConfigEntry WBEnableAnnouncement { get; set; } public static ConfigEntry BLEnableChanges { get; set; } public static ConfigEntry BFEnableChanges { get; set; } public static ConfigEntry CDEnableChanges { get; set; } public static ConfigEntry CEEnableChanges { get; set; } public static ConfigEntry EBEnableChanges { get; set; } public static ConfigEntry EAEnableChanges { get; set; } public static ConfigEntry GNEnableChanges { get; set; } public static ConfigEntry LSEnableChanges { get; set; } public static ConfigEntry NTEnableChanges { get; set; } public static ConfigEntry PBEnableChanges { get; set; } public static ConfigEntry RLEnableChanges { get; set; } public static ConfigEntry SSEnableChanges { get; set; } public static ConfigEntry SWEnableChanges { get; set; } public static ConfigEntry UTEnableChanges { get; set; } public static ConfigEntry WBEnableChanges { get; set; } public static ConfigEntry WEEnableChanges { get; set; } public static void Init(ConfigFile cfg) { if (SeekersoftheStormNerfs.RooInstalled) { InitRoO(); } BLEnableChanges = cfg.BindOption("Bolstering Lantern", "Enable Changes", defaultValue: true, "Enable changes for this item." + Environment.NewLine + "If set to false, hooks for this item will not apply, none of the below settings will apply, and the item will be reverted to it's vanilla functionality.", restartRequired: true); BLBaseBodyAttackSpeed = cfg.BindOptionSteppedSlider("Bolstering Lantern", "Base AS", 0.1f, 0.01f, "Bonus attack speed per nearby ally/enemy with 1 stack. Vanilla is 0.1 = 10%.", 0f, 0.5f, restartRequired: true, 1); BLStackBodyAttackSpeed = cfg.BindOptionSteppedSlider("Bolstering Lantern", "Stack AS", 0f, 0.01f, "Extra bonus attack speed per nearby enemy/ally, per stack. Vanilla is 0.035 = 3.5%.", 0f, 0.5f, restartRequired: true, 1); BLBaseMaxBodies = cfg.BindOptionSteppedSlider("Bolstering Lantern", "Base Max Enemies/Allies", 2f, 1f, "Max number of nearby allies/enemies with 1 stack. Vanilla is 3.", 0f, 10f, restartRequired: true); BLStackMaxBodies = cfg.BindOptionSteppedSlider("Bolstering Lantern", "Stack Max Enemies/Allies", 2f, 1f, "Extra max number of nearby allies/enemies, per stack. Vanilla is 2.", 0f, 10f, restartRequired: true); BLBaseRadius = cfg.BindOptionSteppedSlider("Bolstering Lantern", "Base Radius", 20f, 1f, "Enemy/ally detection radius in metres at 1 stack. Vanilla is 20.", 5f, 50f, restartRequired: true, 3); BLStackRadius = cfg.BindOptionSteppedSlider("Bolstering Lantern", "Stack Radius", 0f, 1f, "Extra enemy/ally detection radius in metres, per stack. Vanilla is 5.", 0f, 20f, restartRequired: true, 3); BLHyperbolicScaling = cfg.BindOption("Bolstering Lantern", "Hyperbolic Range Scaling", defaultValue: false, "Enables hyperbolic scaling for the range of Bolstering Lantern. Will yield diminishing returns on the radius.", restartRequired: true); BLEnableUnconditionalAS = cfg.BindOption("Bolstering Lantern", "Enable Unconditional Attack Speed", defaultValue: false, "Grants a certain amount of attack speed just for having the item.", restartRequired: true); BLBaseAttackSpeed = cfg.BindOptionSteppedSlider("Bolstering Lantern", "Unconditional Base AS", 0f, 0.01f, "The amount of attack speed this item grants unconditionally at 1 stack of the item. Vanilla is 0 = 0%.", 0f, 1f, restartRequired: true, 1); BLStackAttackSpeed = cfg.BindOptionSteppedSlider("Bolstering Lantern", "Unconditional Stack AS", 0f, 0.01f, "The amount of attack speed this item grants unconditionally, per stack of the item. Vanilla is 0 = 0%.", 0f, 1f, restartRequired: true, 1); CEEnableChanges = cfg.BindOption("Chronic Expansion", "Enable Changes", defaultValue: true, "Enable changes for this item." + Environment.NewLine + "If set to false, hooks for this item will not apply, none of the below settings will apply, and the item will be reverted to it's vanilla functionality.", restartRequired: true); CEBaseKillDamage = cfg.BindOptionSteppedSlider("Chronic Expansion", "Base Damage Bonus", 0.05f, 0.001f, "Damage bonus per kill with 1 stack. Vanilla is 0.035 = 3.5%.", 0f, 0.1f, restartRequired: true, 1); CEStackKillDamage = cfg.BindOptionSteppedSlider("Chronic Expansion", "Stack Damage Bonus", 0f, 0.001f, "Extra damage bonus per kill, per stack. Vanilla is 0.01 = 1%.", 0f, 0.02f, restartRequired: true, 1); CEBaseMaxKills = cfg.BindOptionSteppedSlider("Chronic Expansion", "Base Max Kills", 5f, 1f, "The maximum number of kills at 1 stack. Vanilla is 10.", 1f, 20f, restartRequired: true); CEStackMaxKills = cfg.BindOptionSteppedSlider("Chronic Expansion", "Stack Max Kills", 5f, 1f, "Extra number of maximum kills added per stack. Vanilla is 5.", 0f, 20f, restartRequired: true); CEBaseTime = cfg.BindOptionSteppedSlider("Chronic Expansion", "Base Timer", 7f, 0.1f, "Time in seconds before the buff wears off at 1 stack. Vanilla is 7s.", 0f, 20f, restartRequired: true, 2); CEStackTime = cfg.BindOptionSteppedSlider("Chronic Expansion", "Stack Timer", 0.5f, 0.1f, "Extra time in seconds before the buff wears off, per stack. Vanilla is 0s.", 0f, 20f, restartRequired: true, 2); CERefreshMethod = cfg.BindOption("Chronic Expansion", "Refresh only on kill", defaultValue: true, "True only refreshes the timer on kill. False refreshers the timer on damage dealt. Vanilla is False.", restartRequired: true); CEBeepBoop = cfg.BindOption("Chronic Expansion", "Enable Timeout Sound Cue", defaultValue: false, "True retains the potentially annoying timeout sound effect. False removes it. Vanilla is True.", restartRequired: true); EAEnableChanges = cfg.BindOption("Elusive Antlers", "Enable Changes", defaultValue: true, "Enable changes for this item." + Environment.NewLine + "If set to false, hooks for this item will not apply, none of the below settings will apply, and the item will be reverted to it's vanilla functionality.", restartRequired: true); EABaseMoveSpeed = cfg.BindOptionSteppedSlider("Elusive Antlers", "Base MS", 0f, 0.01f, "Bonus move speed at 1 stack, with no collected wisps. Vanilla is 0 = 0%.", 0f, 0.5f, restartRequired: true, 1); EAStackMoveSpeed = cfg.BindOptionSteppedSlider("Elusive Antlers", "Stack MS", 0f, 0.01f, "Extra bonus move speed with no collected wisps, per stack. Vanilla is 0 = 0%.", 0f, 0.5f, restartRequired: true, 1); EABaseWispMoveSpeed = cfg.BindOptionSteppedSlider("Elusive Antlers", "Base Wisp MS", 0.1f, 0.01f, "Bonus movespeed per collected wisp at 1 stack. Vanilla is 0.12 = 12%.", 0f, 0.5f, restartRequired: true, 1); EAStackWispMoveSpeed = cfg.BindOptionSteppedSlider("Elusive Antlers", "Stack Wisp MS", 0f, 0.01f, "Extra bonus movespeed per collected wisp, per stack. Vanilla is 0 = 0%.", 0f, 0.5f, restartRequired: true, 1); EABaseMaxWisps = cfg.BindOptionSteppedSlider("Elusive Antlers", "Base Max Wisps", 2f, 1f, "The maximum number of wisps collected at 1 stack. Vanilla is 3.", 1f, 10f, restartRequired: true); EAStackMaxWisps = cfg.BindOptionSteppedSlider("Elusive Antlers", "Stack Max Wisps", 2f, 1f, "Extra maximum number of wisps collected, per stack. Vanilla is 3.", 1f, 10f, restartRequired: true); EABaseBuffDuration = cfg.BindOptionSteppedSlider("Elusive Antlers", "Base Buff Time", 12f, 0.1f, "Duration of Movespeed buff in seconds from collecting wisps at 1 stack. Vanilla is 12s.", 1f, 20f, restartRequired: true, 2); EAStackBuffDuration = cfg.BindOptionSteppedSlider("Elusive Antlers", "Stack Buff Time", 0f, 0.1f, "Extra duration of movespeed buff in seconds from collecting wisps, per stack. Vanilla is 0.", 0f, 20f, restartRequired: true, 2); EABaseWispInterval = cfg.BindOptionSteppedSlider("Elusive Antlers", "Interval", 10f, 0.1f, "Duration in seconds between wisp spawns at 1 stack.", 1f, 20f, restartRequired: true, 2); EAStackWispIntervalReduction = cfg.BindOptionSteppedSlider("Elusive Antlers", "Interval Reduction", 0f, 0.01f, "Percentage interval reduction for the second stack of this item. This function is hyperbolic, so stacks beyond 2 will yield diminishing returns (like tougher times)." + Environment.NewLine + "WARNING: If this value is set to more than 1 - (floor/interval), unusual behaviour will occur!", 0f, 0.5f, restartRequired: true, 1); EANoStackWispMoveSpeed = cfg.BindOptionSteppedSlider("Elusive Antlers", "Zero-Stack Wisp MS", 0.1f, 0.01f, "Movespeed bonus with 0 stacks of ELusive Antlers. Vanilla is 0.12 = 12%." + Environment.NewLine + "(Allies with no stacks of elusive antlers can still pick up wisps spawned by other players. They will inherit the buff duration, but movespeed and max stacks can be defined seperately). Vanilla is 0.12 = 12%", 0f, 0.5f, restartRequired: true, 1); EANoStackMaxWisps = cfg.BindOptionSteppedSlider("Elusive Antlers", "Zero-Stack Max Wisps", 2f, 1f, "Max number of collected wisps with 0 stacks of Elusive Antlers. Vanilla is 3." + Environment.NewLine + "(Allies with no stacks of elusive antlers can still pick up wisps spawned by other players. They will inherit the buff duration, but movespeed and max stacks can be defined seperately).", 1f, 10f, restartRequired: true); WEEnableChanges = cfg.BindOption("Warped Echo", "Enable Changes", defaultValue: true, "Enable changes for this item." + Environment.NewLine + "If set to false, hooks for this item will not apply, none of the below settings will apply, and the item will be reverted to it's vanilla functionality.", restartRequired: true); WEBaseDamageReduction = cfg.BindOptionSteppedSlider("Warped Echo", "Base Damage Reduction", 0.04f, 0.01f, "The percentage amount that the triggering hit is reduced by. Vanilla is 0.3 = 30%.", 0f, 0.5f, restartRequired: true, 1); WEStackDamageReduction = cfg.BindOptionSteppedSlider("Warped Echo", "Stack Damage Reduction", 0.04f, 0.01f, "The percentage amount per stack that the triggering hit is reduced by. Scaling is hyperbolic. Vanilla is 0%.", 0f, 0.25f, restartRequired: true, 1); WEBaseEchoes = cfg.BindOptionSteppedSlider("Warped Echo", "Base Echoes", 4f, 1f, "The amount of echoes that the triggering hit is split up into with 1 stack. Vanilla is 3.", 1f, 10f, restartRequired: true); WEStackEchoes = cfg.BindOptionSteppedSlider("Warped Echo", "Stack Echoes", 2f, 1f, "The amount of echoes that the triggering hit is split up into, per stack. Vanilla is 1.", 1f, 10f, restartRequired: true); WEBaseCooldown = cfg.BindOptionSteppedSlider("Warped Echo", "Base Cooldown", 30f, 0.1f, "The time in seconds it takes the item to recharge. Vanilla is 15s.", 5f, 50f, restartRequired: true, 2); WEStackCooldownReduction = cfg.BindOptionSteppedSlider("Warped Echo", "Stack Cooldown Reduction", 0f, 0.01f, "The percentage amount by which the cooldown is decreased, per stack. This scales hyperbolically. Vanilla is 0.03 = 3%", 0f, 0.1f, restartRequired: true, 1); WEInitialDelay = cfg.BindOptionSteppedSlider("Warped Echo", "Initial Delay", 2.5f, 0.1f, "The delay between the instance of damage and the first echo arriving. Setting this too low will cause the first (and potentially further) instance of damage to be ignored. Vanilla is 0s.", 0.3f, 5f, restartRequired: true, 2); WEInterval = cfg.BindOptionSteppedSlider("Warped Echo", "Damage Interval", 0.25f, 0.01f, "The rate in seconds at which echoes are applied beyond the first. Setting this too low will cause some echoes to be ignored. Vanilla is 0.75s.", 0f, 3f, restartRequired: true, 2); WEEnableDamageThreshold = cfg.BindOption("Warped Echo", "Enable Damage Threshold", defaultValue: true, "Enables a threshold of the wielder's health over which Warped Echo will trigger. Vanilla is False.", restartRequired: true); WEDamageThreshold = cfg.BindOptionSteppedSlider("Warped Echo", "Damage Threshold", 0.25f, 0.01f, "Percentage of wielder's health lost to trigger the item. Vanilla is 0.", 0f, 0.75f, restartRequired: true, 1); BFEnableChanges = cfg.BindOption("Breaching Fin", "Enable Changes", defaultValue: true, "Enable changes for this item." + Environment.NewLine + "If set to false, hooks for this item will not apply, none of the below settings will apply, and the item will be reverted to it's vanilla functionality.", restartRequired: true); BFBaseLaunchesAfterFirst = cfg.BindOptionSteppedSlider("Breaching Fin", "Base Launches after first", 2f, 1f, "Number of additional launches past the first at 1 stack. Vanilla is 2.", 0f, 10f, restartRequired: true); BFStackLaunchesAfterFirst = cfg.BindOptionSteppedSlider("Breaching Fin", "Stack Launches after first", 1f, 1f, "Number of additional launches past the first, per stack of the item. Vanilla is 1.", 0f, 5f, restartRequired: true); BFBaseDamageBonus = cfg.BindOptionSteppedSlider("Breaching Fin", "Base Damage Bonus", 0.1f, 0.01f, "The percentage damage bonus applied to enemies per launch at 1 stack. Vanilla is 0.2 = 20%.", 0f, 1f, restartRequired: true, 1); BFStackDamageBonus = cfg.BindOptionSteppedSlider("Breaching Fin", "Stack Damage Bonus", 0f, 0.01f, "The additional percentage damage bonus applied to enemies per launch, per stack. Vanilla is 0 = 0%.", 0f, 0.5f, restartRequired: true, 1); BFBaseCooldown = cfg.BindOptionSteppedSlider("Breaching Fin", "Base Cooldown", 10f, 0.1f, "The time in seconds that it takes to recharge this item at 1 stack. Vanilla is 10s.", 5f, 60f, restartRequired: true, 2); BFStackCooldownReduction = cfg.BindOptionSteppedSlider("Breaching Fin", "Stack Cooldown Reduction", 0f, 0.01f, "The percentage cooldown reduction for each stack beyond the first. Scaling is hyperbolic. Vanilla is 0 = 0%.", 0f, 0.5f, restartRequired: true, 1); BFCooldownFloor = cfg.BindOptionSteppedSlider("Breaching Fin", "Cooldown Floor", 10f, 0.1f, "The minimum cooldown of this as stacks increase. Scaling is hyperbolic. Vanilla is 10s.", 5f, 60f, restartRequired: true, 2); CDEnableChanges = cfg.BindOption("Chance Doll", "Enable Changes", defaultValue: true, "Enable changes for this item." + Environment.NewLine + "If set to false, hooks for this item will not apply, none of the below settings will apply, and the item will be reverted to it's vanilla functionality.", restartRequired: true); CDBaseChance = cfg.BindOptionSteppedSlider("Chance Doll", "Base Chance to Improve", 0.4f, 0.01f, "The chance to increase the rarity of an item acquired from a shrine of chance at 1 stack of the item. Vanilla is 0.4 = 40%", 0f, 1f, restartRequired: true, 1); CDStackChance = cfg.BindOptionSteppedSlider("Chance Doll", "Stack Chance to Improve", 0.1f, 0.01f, "The bonus chance to increase the rarity of an item acquired from a shrine of chance, per stack. Vanilla is 0.1 = 10%", 0f, 1f, restartRequired: true, 1); LSEnableChanges = cfg.BindOption("Luminous Shot", "Enable Changes", defaultValue: true, "Enable changes for this item." + Environment.NewLine + "If set to false, hooks for this item will not apply, none of the below settings will apply, and the item will be reverted to it's vanilla functionality.", restartRequired: true); LSBaseMaxCharges = cfg.BindOptionSteppedSlider("Luminous Shot", "Base Max Charges", 5f, 1f, "The max number of charges Luminous Shot can store at 1 stack. Vanilla is 5.", 1f, 10f, restartRequired: true); LSStackMaxCharges = cfg.BindOptionSteppedSlider("Luminous Shot", "Stack Max Charges", 1f, 1f, "The additional max number of charges Luminous Shot can store per stack. Vanilla is 1.", 1f, 5f, restartRequired: true); LSChargeThreshold = cfg.BindOptionSteppedSlider("Luminous Shot", "Charge Threshold", 3f, 1f, "The amount of charges required before Luminous Shot activates. Vanilla is 3. If set higher than base, will require more than 1 stack of the item to actually activate.", 1f, 5f, restartRequired: true); LSBaseDamage = cfg.BindOptionSteppedSlider("Luminous Shot", "Base Damage", 1.75f, 0.01f, "The amount of TOTAL damage, per lightning strike, that Luminous Shot deals. Vanilla is 1.75 = 175%.", 0f, 5f, restartRequired: true, 1); LSStackDamage = cfg.BindOptionSteppedSlider("Luminous Shot", "Stack Damage", 0.5f, 0.01f, "The additional amount of TOTAL damage, per lightning strike, that Luminous deals, per stack. Vanilla is 0.5 = 50%.", 0f, 2f, restartRequired: true, 1); LSBaseCDR = cfg.BindOptionSteppedSlider("Luminous Shot", "Base Secondary Cooldown Reduction", 0.25f, 0.01f, "The percentage reduction in secondary cooldown at 1 stack. Vanilla is 0.2 = 20%.", 0f, 0.8f, restartRequired: true, 1); LSStackCDR = cfg.BindOptionSteppedSlider("Luminous Shot", "Stack Secondary Cooldown Reduction", 0f, 0.01f, "The extra percentage reduction in secondary cooldown, per stack. Vanilla is 0 = 0%.", 0f, 0.2f, restartRequired: true, 1); LSProcCoeff = cfg.BindOptionSteppedSlider("Luminous Shot", "Proc Coefficient", 0.8f, 0.01f, "The proc coefficient attached to each individual lightning strike. Vanilla is 1 = 100%.", 0f, 1f, restartRequired: true, 1); LSStrikeDelay = cfg.BindOptionSteppedSlider("Luminous Shot", "Strike Delay", 0.12f, 0.01f, "The delay in seconds between lightning strikes. Vanilla is 0.2s", 0.1f, 1f, restartRequired: true, 2); LSRadius = cfg.BindOptionSteppedSlider("Luminous Shot", "Strike Radius", 7f, 0.1f, "The radius of effect that Luminous deals it's damage in around the target, in metres. Vanilla is 7m. Note that the visual radius does not increase to reflect this.", 1f, 20f, restartRequired: true, 3); LSAllSkillsCharge = cfg.BindOption("Luminous Shot", "Utility and Special Add Charge", defaultValue: false, "Allows both special and utility skills to contribute charges towards Luminous Shot. Vanilla is false.", restartRequired: true); NTEnableChanges = cfg.BindOption("Noxious Thorn", "Enable Changes", defaultValue: true, "Enable changes for this item." + Environment.NewLine + "If set to false, hooks for this item will not apply, none of the below settings will apply, and the item will be reverted to it's vanilla functionality.", restartRequired: true); NTBaseBleedChance = cfg.BindOptionSteppedSlider("Noxious Thorn", "Base Bleed Chance", 0.1f, 0.01f, "The chance of applying 1 stack of bleed with 1 stack. Vanilla is 0.1 = 10%.", 0f, 1f, restartRequired: true, 1); NTStackBleedChance = cfg.BindOptionSteppedSlider("Noxious Thorn", "Stack Bleed Chance", 0f, 0.01f, "The extra chance of applying 1 stack of bleed, per stack. Vanilla is 0 = 0%.", 0f, 0.2f, restartRequired: true, 1); NTBaseDebuffTransfer = cfg.BindOptionSteppedSlider("Noxious Thorn", "Base Debuff Transfer Percentage", 0.33f, 0.01f, "The percentage amount of debuff stacks that Noxious Thorn applies to nearby enemies. Vanilla is 0.33 = 33%.", 0f, 2f, restartRequired: true, 1); NTStackDebuffTransfer = cfg.BindOptionSteppedSlider("Noxious Thorn", "Stack Debuff Transfer Percentage", 0f, 0.01f, "The extra percentage amount of debuff stacks that Noxious Thorn applies to nearby enemies, per stack. Vanilla is 0 = 0%.", 0f, 0.5f, restartRequired: true, 1); NTBaseBodies = cfg.BindOptionSteppedSlider("Noxious Thorn", "Base Number of Enemies", 1f, 1f, "The number of enemies that transferred debuff stacks are applied to, with 1 stack. Vanilla is 1.", 1f, 10f, restartRequired: true); NTStackBodies = cfg.BindOptionSteppedSlider("Noxious Thorn", "Stack Number of Enemies", 1f, 1f, "The extra number of enemies that transferred debuff stacks are applied to, per stack. Vanilla is 1.", 0f, 5f, restartRequired: true); NTBaseRange = cfg.BindOptionSteppedSlider("Noxious Thorn", "Base Range", 12f, 1f, "The maximum range in metres at which debuffs can be transferred, with 1 stack. Vanilla is 20m.", 5f, 30f, restartRequired: true, 3); NTStackRange = cfg.BindOptionSteppedSlider("Noxious Thorn", "Stack Range", 4f, 1f, "The range in metres at which debuffs can be transferred, per stack. Vanilla is 5m.", 0f, 30f, restartRequired: true, 3); NTEnableBurn = cfg.BindOption("Noxious Thorn", "Enable Independent Burn Chance", defaultValue: false, "Enables a chance to burn that is checked seperately to the chance to apply bleed. Vanilla is false.", restartRequired: true); NTBaseBurnChance = cfg.BindOptionSteppedSlider("Noxious Thorn", "Base Burn Chance", 0f, 0.01f, "The percentage chance to inflict burn on a target with 1 stack. Vanilla is 0 = 0%.", 0f, 1f, restartRequired: true, 1); NTStackBurnChance = cfg.BindOptionSteppedSlider("Noxious Thorn", "Stack Burn Chance", 0f, 0.01f, "The additional percentage chance to inflict burn on a target, per stack. Vanilla is 0 = 0%.", 0f, 0.2f, restartRequired: true, 1); PBEnableChanges = cfg.BindOption("Prayer Beads", "Enable Changes", defaultValue: true, "Enable changes for this item." + Environment.NewLine + "If set to false, hooks for this item will not apply, none of the below settings will apply, and the item will be reverted to it's vanilla functionality.", restartRequired: true); PBBaseExpGain = cfg.BindOptionSteppedSlider("Prayer Beads", "Base Exp Gain", 1f, 0.01f, "The amount of experience Prayer Beads earns as a percentage of your own experience gain. Vanilla is 1 = 100%.", 0.1f, 2f, restartRequired: true, 1); PBStackExpGain = cfg.BindOptionSteppedSlider("Prayer Beads", "Stack Exp Gain", 0.25f, 0.01f, "The additional amount of experience Prayer Beads earns as a percentage of your own experience gain, per stack. Vanilla is 0.25 = 25%.", 0f, 1f, restartRequired: true, 1); PBBaseStatBonus = cfg.BindOptionSteppedSlider("Prayer Beads", "Base Stat Bonus", 0.1f, 0.01f, "The stats that Prayer Beads yields upon removal, as a percentage of your level-up Damage, Health and Regeneration. Vanilla is 0.2 = 20%", 0.05f, 1f, restartRequired: true, 1); PBStackStatBonus = cfg.BindOptionSteppedSlider("Prayer Beads", "Stack Stat Bonus", 0.1f, 0.01f, "The additional stats that Prayer Beads yields upon removal, as a percentage of your level-up Damage, Health and Regeneration, per stack. Vanilla is 0.05 = 5%", 0f, 1f, restartRequired: true, 1); PBCalcBasedOnBeadsRemoved = cfg.BindOption("Prayer Beads", "Calculated based on Removed Stacks", defaultValue: true, "Calculates stat boost based on the number of removed stacks, rather than the number of stacks upon removal. Vanilla is false.", restartRequired: true); SSEnableChanges = cfg.BindOption("Sale Star", "Enable Changes", defaultValue: true, "Enable changes for this item." + Environment.NewLine + "If set to false, hooks for this item will not apply, none of the below settings will apply, and the item will be reverted to it's vanilla functionality.", restartRequired: true); SSBaseItemCount = cfg.BindOptionSteppedSlider("Sale Star", "Base Items", 2f, 1f, "The number of items granted from using Sale Star at 1 stack of the item. Vanilla is 2", 1f, 10f, restartRequired: true); SSStackExtraItemChance = cfg.BindOptionSteppedSlider("Sale Star", "Stack Chance of Extra Items", 0.05f, 0.01f, "The extra chance of getting additional items, per stack beyond the first. Vanilla is 0.05 = 5%.", 0f, 1f, restartRequired: true, 1); SSOneExtraItemChance = cfg.BindOptionSteppedSlider("Sale Star", "+1 Item Chance Modifier", 0.3f, 0.01f, "The base modifier for gaining 1 extra item. Does not apply at 1 stack. Vanilla is 0.3 = 30%.", 0f, 1f, restartRequired: true, 1); SSTwoExtraItemsChance = cfg.BindOptionSteppedSlider("Sale Star", "+2 Items Chance Modifier", 0.15f, 0.01f, "The base modifier for gaining 2 extra items, assuming the check for 1 extra item succeeds. Vanilla is 0.15 = 15%.", 0f, 1f, restartRequired: true, 1); SSThreeExtraItemsChance = cfg.BindOptionSteppedSlider("Sale Star", "+3 Items Chance Modifier", 0.01f, 0.01f, "The base modifier for gaining 3 extra items, assuming the check for both 1 and 2 extra items succeeds. Vanilla is 0.01 = 1%.", 0f, 1f, restartRequired: true, 1); UTEnableChanges = cfg.BindOption("Unstable Transmitter", "Enable Changes", defaultValue: true, "Enable changes for this item." + Environment.NewLine + "If set to false, hooks for this item will not apply, none of the below settings will apply, and the item will be reverted to it's vanilla functionality.", restartRequired: true); UTBaseTempHealth = cfg.BindOptionSteppedSlider("Unstable Transmitter", "Base Temp Health", 0.5f, 0.01f, "The amount of temporary health applied on activation, as a percentage of your maximum health, at 1 stack. Vanilla is 0.6 = 60%.", 0f, 2f, restartRequired: true, 1); UTStackTempHealth = cfg.BindOptionSteppedSlider("Unstable Transmitter", "Stack Temp Health", 0f, 0.01f, "The extra amount of temporary health applied on activation, as a percentage of your maximum health, per stack. Vanilla is 0 = 0%.", 0f, 0.5f, restartRequired: true, 1); UTBuffTime = cfg.BindOptionSteppedSlider("Unstable Transmitter", "Buff Duration", 8f, 0.1f, "The duration of the teleport aura buff, in seconds. Vanilla is 8s.", 1f, 20f, restartRequired: true, 2); UTStackBuffTime = cfg.BindOptionSteppedSlider("Unstable Transmitter", "Stack Buff Time", 0f, 0.1f, "The amount of additional time, per stack, that Unstable Transmitter buffs the player for. Vanilla is 0s.", 0f, 2f, restartRequired: true, 2); UTBuffExtension = cfg.BindOptionSteppedSlider("Unstable Transmitter", "Buff Extension on Kill", 1f, 0.1f, "The duration by which the teleporter aura buff is extended upon killing an enemy with it's bleed effect. Vanilla is 1s.", 0f, 5f, restartRequired: true, 2); UTMaxBuffExtension = cfg.BindOptionSteppedSlider("Unstable Transmitter", "Max Buff Extension", 10f, 0.1f, "The maximum time that the teleporter aura buff can be extended by. Vanilla is 10s.", 0f, 20f, restartRequired: true, 2); UTBaseCooldown = cfg.BindOptionSteppedSlider("Unstable Transmitter", "Base Cooldown", 1f, 0.1f, "The time in seconds it takes to recharge. Vanilla is 1.1s.", 0f, 120f, restartRequired: true, 2); UTStackCooldownReduction = cfg.BindOptionSteppedSlider("Unstable Transmitter", "Stack Cooldown Reduction", 0f, 0.01f, "The cooldown reduction percentage per stack. This function is hyperbolic. Vanilla is 0.1 = 10%.", 0f, 0.3f, restartRequired: true, 1); UTBaseBleedStacks = cfg.BindOptionSteppedSlider("Unstable Transmitter", "Base Bleed Stacks", 3f, 1f, "The base number of bleed stacks applied to teleported enemies at 1 stack. Vanilla is 3.", 0f, 10f, restartRequired: true); UTStackBleedStacks = cfg.BindOptionSteppedSlider("Unstable Transmitter", "Stack Bleed Stacks", 0f, 1f, "The extra number of bleed stacks applied to teleported enemies per stack. Vanilla is 0.", 0f, 5f, restartRequired: true); UTShowReadyBuff = cfg.BindOption("Unstable Transmitter", "Show Ready Buff", defaultValue: true, "Displays a buff icon when Unstable Transmitter is off cooldown and ready to be used. Vanilla is false.", restartRequired: true); UTConsumeOneStack = cfg.BindOption("Unstable Transmitter", "Consume One Stack on Use", defaultValue: true, "If set to true, will consume on stack of the item after the teleport aura expires. Vanilla is true. Note that this is overwritten if Consume All Stacks on Use is set to true.", restartRequired: true); UTConsumeAllStacks = cfg.BindOption("Unstable Transmitter", "Consume All Stacks on Use", defaultValue: false, "If set to true, will consume all stacks of the item after the teleport aura expires. Vanilla is false. Note that this will overwrite Consume One Stack if true.", restartRequired: true); EBEnableChanges = cfg.BindOption("Electric Boomerang", "Enable Changes", defaultValue: true, "Enable changes for this item." + Environment.NewLine + "If set to false, hooks for this item will not apply, none of the below settings will apply, and the item will be reverted to it's vanilla functionality.", restartRequired: true); EBBaseHitChance = cfg.BindOptionSteppedSlider("Electric Boomerang", "Base Chance", 0.15f, 0.01f, "Percentage chance to activate electric boomerang at 1 stack of the item. Vanilla is 0.15 = 15%.", 0f, 1f, restartRequired: true, 1); EBStackHitChance = cfg.BindOptionSteppedSlider("Electric Boomerang", "Stack Chance", 0f, 0.01f, "Extra percentage chance to activate electric boomerang, per stack of the item. Vanilla is 0.00 = 0%.", 0f, 0.5f, restartRequired: true, 1); EBBaseHitDamage = cfg.BindOptionSteppedSlider("Electric Boomerang", "Base Contact Damage", 1f, 0.01f, "The contact damage dealt to enemies as a percentage of your BASE damage, at 1 stack of the item. Vanilla is 1.24 = 124%.", 0f, 5f, restartRequired: true, 1); EBStackHitDamage = cfg.BindOptionSteppedSlider("Electric Boomerang", "Stack Contact Damage", 1f, 0.01f, "The extra contact damage dealt to enemies as a percentage of your BASE damage, per stack of the item. Vanilla is 1.24 = 124%.", 0f, 2f, restartRequired: true, 1); EBPercSpinDamage = cfg.BindOptionSteppedSlider("Electric Boomerang", "Spin Damage Percentage", 0.25f, 0.01f, "The tick damage dealt whilst the boomerang is intersecting with an enemy's hitbox, as a percentage of the contact damage. (e.g, if contact damage is 12, 25% spin damage will be 3). Vanilla is ~0.32 = 32%.", 0f, 1f, restartRequired: true, 1); EBHitProcCoeff = cfg.BindOptionSteppedSlider("Electric Boomerang", "Contact Proc Coefficient", 1f, 0.01f, "The proc coefficient attached to the contact portion of electric boomerang's damage. Vanilla is 1 = 100%", 0f, 2f, restartRequired: true, 1); EBSpinProcCoeff = cfg.BindOptionSteppedSlider("Electric Boomerang", "Spin Proc Coefficient", 0.2f, 0.01f, "The proc coefficient attached to the hitbox-intersection portion of electric boomerang's damage. Vanilla is 0.2 = 20%", 0f, 2f, restartRequired: true, 1); EBTravelSpeed = cfg.BindOptionSteppedSlider("Electric Boomerang", "Travel Speed", 60f, 1f, "The maximum speed of electric boomerang's projectiles in m/s. Note that tweaking this will also change the effective range of the boomerang. Vanilla is 60m/s.", 30f, 120f, restartRequired: true, 4); GNEnableChanges = cfg.BindOption("Growth Nectar", "Enable Changes", defaultValue: true, "Enable changes for this item." + Environment.NewLine + "If set to false, hooks for this item will not apply, none of the below settings will apply, and the item will be reverted to it's vanilla functionality.", restartRequired: true); GNBaseBuffs = cfg.BindOptionSteppedSlider("Growth Nectar", "Base Max Buffs", 4f, 1f, "The maximum number of buffs that apply Growth Nectar's buff at stack 1 of the item. Vanilla is 4.", 0f, 20f, restartRequired: true); GNStackBuffs = cfg.BindOptionSteppedSlider("Growth Nectar", "Stack Max Buffs", 4f, 1f, "The extra maximum number of buffs that apply Growth Nectar's buff, per stack. Vanilla is 4.", 0f, 10f, restartRequired: true); GNBaseStatBuff = cfg.BindOptionSteppedSlider("Growth Nectar", "Base Stat Boost", 0.04f, 0.001f, "The stat boost applied to Health, Health Regen, Movement Speed, Damage, Attack Speed, Crit Chance and Armour Multiplier per buff at 1 stack. Vanilla is 0.04 = 4%.", 0f, 1f, restartRequired: true, 1); GNStackStatBuff = cfg.BindOptionSteppedSlider("Growth Nectar", "Stack Stat Boost", 0f, 0.001f, "The extra stat boost applied to Health, Health Regen, Movement Speed, Damage, Attack Speed, Crit Chance and Armour Multiplier per buff, per stack. Vanilla is 0 = 0%.", 0f, 0.5f, restartRequired: true, 1); GNEnableAccelBoost = cfg.BindOption("Growth Nectar", "Affects Acceleration", defaultValue: true, "Allows Growth Nectar to boost acceleration alongside speed, preventing low traction at high buff stacks.", restartRequired: true); RLEnableChanges = cfg.BindOption("Runic Lens", "Enable Changes", defaultValue: true, "Enable changes for this item." + Environment.NewLine + "If set to false, hooks for this item will not apply, none of the below settings will apply, and the item will be reverted to it's vanilla functionality.", restartRequired: true); RLBaseChance = cfg.BindOptionSteppedSlider("Runic Lens", "Base Chance to Hit", 0.02f, 0.001f, "The base percentage chance to activate upon damaging an enemy, at 1 stack. Vanilla is 0.03 = 3%.", 0f, 1f, restartRequired: true, 1); RLStackChance = cfg.BindOptionSteppedSlider("Runic Lens", "Stack Chance to Hit", 0f, 0.001f, "The extra percentage chance to activate upon damaging an enemy, per stack. Vanilla is 0 = 0%.", 0f, 1f, restartRequired: true, 1); RLBaseDamage = cfg.BindOptionSteppedSlider("Runic Lens", "Base Damage", 20f, 0.01f, "The damage dealt on impact as a percentage of your BASE damage at 1 stack. Vanilla is 20 = 2000%.", 5f, 100f, restartRequired: true, 1); RLStackDamage = cfg.BindOptionSteppedSlider("Runic Lens", "Stack Damage", 0f, 0.01f, "The extra damage dealt on impact as a percentage of your BASE damage, per stack. Vanilla is 0 = 0%.", 0f, 50f, restartRequired: true, 1); RLThreshold = cfg.BindOptionSteppedSlider("Runic Lens", "Threshold", 1f, 0.01f, "Threshold is a percentage of your BASE damage. For every threshold% damage the inflicting attack deals, Runic Lens boosts the damage and activation chance.", 0f, 10f, restartRequired: true, 1); RLBaseThresholdChance = cfg.BindOptionSteppedSlider("Runic Lens", "Base Threshold Extra Chance to Hit", 0.02f, 0.001f, "Base additional chance to hit for every threshold% damage that the inflicting attack deals. Vanilla is 0.03 = 3%.", 0f, 0.2f, restartRequired: true, 1); RLStackThresholdChance = cfg.BindOptionSteppedSlider("Runic Lens", "Stack Threshold Extra Chance to Hit (Threshold)", 0.02f, 0.001f, "Extra additional chance to hit for every threshold% damage that the inflicting attack deals, per stack. Vanilla is 0.03 = 3%.", 0f, 0.2f, restartRequired: true, 1); RLChanceCap = cfg.BindOptionSteppedSlider("Runic Lens", "Chance to Hit Cap", 0.75f, 0.01f, "Maximum chance to hit through both base chance, stacking and thresholding scaling. Vanilla is 0.75 = 75%.", 0.25f, 1f, restartRequired: true, 1); RLBaseThresholdDamage = cfg.BindOptionSteppedSlider("Runic Lens", "Base Threshold Extra Damage", 1.5f, 0.01f, "Additional damage as a percentage of BASE damage, for every threshold% damage that the inflicting attack deals. Vanilla is 1.5 = 150%.", 0f, 3f, restartRequired: true, 1); RLStackThresholdDamage = cfg.BindOptionSteppedSlider("Runic Lens", "Stack Threshold Extra Damage", 0.5f, 0.01f, "Extra additional damage as a percentage of BASE damage, for every threshold% damage that the inflicting attack deals, per stack. Vanilla is 0.5 = 50%.", 0f, 1f, restartRequired: true, 1); RLDamageCap = cfg.BindOptionSteppedSlider("Runic Lens", "Damage Cap", 75f, 0.01f, "Maximum damage as a percentage of BASE damage, through both base damage and threshold scaling. Vanilla is 75 = 7500%.", 50f, 100f, restartRequired: true, 1); RLAoE = cfg.BindOptionSteppedSlider("Runic Lens", "Area of Effect", 10f, 0.1f, "Area of Effect of the Meteor. Vanilla is 10m.", 5f, 50f, restartRequired: true, 3); RLProcCoeff = cfg.BindOptionSteppedSlider("Runic Lens", "Proc Coefficient", 0.5f, 0.01f, "Proc Coefficient of the Meteor. Vanilla is 0.5 = 50%.", 0f, 1f, restartRequired: true, 1); SWEnableChanges = cfg.BindOption("Sonorous Whispers", "Enable Changes", defaultValue: true, "Enable changes for this item." + Environment.NewLine + "If set to false, hooks for this item will not apply, none of the below settings will apply, and the item will be reverted to it's vanilla functionality.", restartRequired: true); SWBaseChampionDropChance = cfg.BindOptionSteppedSlider("Sonorous Whispers", "Base Boss Drop Chance", 0.65f, 0.01f, "The chance of a boss dropping an item on kill at 1 stack. Vanilla is 1.00 = 100%.", 0f, 1f, restartRequired: true, 1); SWStackChampionDropChance = cfg.BindOptionSteppedSlider("Sonorous Whispers", "Stack Boss Drop Chance", 0.05f, 0.01f, "The extra chance of a boss dropping an item on kill per stack. Vanilla is 0.00 = 0%.", 0f, 1f, restartRequired: true, 1); SWBaseEliteDropChance = cfg.BindOptionSteppedSlider("Sonorous Whispers", "Base Elite Drop Chance", 0.02f, 0.001f, "The chance of an elite dropping an item on kill at 1 stack. Vanilla is 0.04 = 4%.", 0f, 1f, restartRequired: true, 1); SWStackEliteDropChance = cfg.BindOptionSteppedSlider("Sonorous Whispers", "Stack Elite Drop Chance", 0.01f, 0.001f, "The extra chance of an elite dropping an item on kill per stack. Vanilla is 0.01 = 1%.", 0f, 1f, restartRequired: true, 1); WBEnableChanges = cfg.BindOption("War Bonds", "Enable Changes", defaultValue: true, "Enable changes for this item." + Environment.NewLine + "If set to false, hooks for this item will not apply, none of the below settings will apply, and the item will be reverted to it's vanilla functionality.", restartRequired: true); WBBaseBossHP = cfg.BindOptionSteppedSlider("War Bonds", "Base Boss %HP Damage", 0.025f, 0.001f, "Damage per missile as a percentage of the receiving boss' health, at 1 stack. Vanilla is 0.025 = 2.5%.", 0f, 1f, restartRequired: true, 1); WBStackBossHP = cfg.BindOptionSteppedSlider("War Bonds", "Stack Boss %HP Damage", 0.025f, 0.001f, "The extra damage per missile as a percentage of the receiving boss' health, per stack. Vanilla is 0.025", 0f, 1f, restartRequired: true, 1); WBInitialCount = cfg.BindOptionSteppedSlider("War Bonds", "Initial Missile Count", 1f, 1f, "The number of war bonds missiles granted to the player at the start of each stage. Vanilla is 5.", 0f, 20f, restartRequired: true); WBBaseMaxMissiles = cfg.BindOptionSteppedSlider("War Bonds", "Base Max Missiles", 10f, 1f, "The maximum number of missiles a player can have, at 1 stack. Vanilla is 20.", 0f, 20f, restartRequired: true); WBStackMaxMissiles = cfg.BindOptionSteppedSlider("War Bonds", "Stack Max Missiles", 5f, 1f, "The extra maximum number of missiles a player can have, per stack. Vanilla is 5.", 0f, 20f, restartRequired: true); WBGoldReq = cfg.BindOptionSteppedSlider("War Bonds", "Gold Requirement", 150f, 5f, "The collected gold required to load another missile. Vanilla is 25.", 0f, 1000f, restartRequired: true); WBGoldReqScalingExponent = cfg.BindOptionSteppedSlider("War Bonds", "Gold Requirement Exponent", 1.3f, 0.01f, "The exponent by which difficulty coefficient is raised to when calculating the gold requirement for War Bonds. In Vanilla, this matches the exponent for all priced interactables at 1.25. Adjust carefully as the requirement can balloon massively at high values!", 1f, 2f, restartRequired: true); WBNormalEnemyDamageRatio = cfg.BindOptionSteppedSlider("War Bonds", "Normal Enemy Damage", 25f, 0.01f, "The damage dealt to non-boss enemies by war bonds, as a percentage of the wielder's BASE damage. Vanilla is 32 = 3200%", 0f, 50f, restartRequired: true, 1); WBProjectileDamageCoeff = cfg.BindOptionSteppedSlider("War Bonds", "Overlap Projectile Damage Coefficient", 0f, 0.01f, "The damage that the projectile portion (not the explosion) of war bonds deals as it passes through enemies, as a percentage of War Bonds' explosion damage. Vanilla is 1 = 100%.", 0f, 3f, restartRequired: true, 1); WBProcCoeff = cfg.BindOptionSteppedSlider("War Bonds", "Proc Coefficient", 0f, 0.01f, "The proc coefficient of War Bonds' missiles. Vanilla is 1.", 0f, 3f, restartRequired: true, 1); WBStartDelay = cfg.BindOptionSteppedSlider("War Bonds", "Missile Start Delay", 5f, 0.1f, "The delay between the boss spawning and the first missile being launched in seconds. Vanilla is 5s.", 0f, 10f, restartRequired: true, 2); WBInterval = cfg.BindOptionSteppedSlider("War Bonds", "Missile Interval", 0.75f, 0.01f, "The time between subsequent launches of missiles in seconds. Vanilla is 0.3s.", 0f, 5f, restartRequired: true, 2); WBEnemyCollision = cfg.BindOption("War Bonds", "Explode on Enemy Collision", defaultValue: true, "Causes War Bonds missiles to explode on contact with enemies, in addition to hitting terrain.", restartRequired: true); WBDisableDuringTPEvent = cfg.BindOption("War Bonds", "Disable Charging during TP Event", defaultValue: true, "Prevents additional War Bonds missiles from being earned once the teleporter is activated, until the player leaves the stage.", restartRequired: true); WBEnableBaseDamageMissiles = cfg.BindOption("War Bonds", "Change Damage to Base Damage", defaultValue: true, "Changes damage calculation from %health to base damage. Vanilla is false.", restartRequired: true); WBBaseDamage = cfg.BindOptionSteppedSlider("War Bonds", "Base Damage", 25f, 0.01f, "The amount of BASE damage that war bonds missiles deal at 1 stack of the item. Vanilla uses %Health.", 1f, 50f, restartRequired: true); WBStackDamage = cfg.BindOptionSteppedSlider("War Bonds", "Stack Damage", 0f, 0.01f, "The amount of extra BASE damage that war bonds missiles deal, per stack beyond the first. Vanilla uses %Health.", 0f, 50f, restartRequired: true); WBEnableGoldOnShrineUse = cfg.BindOption("War Bonds", "Enable Gold on Shrine Use", defaultValue: false, "Grants gold upon using a shrine. Vanilla is false.", restartRequired: true); WBBaseShrineUseGold = cfg.BindOptionSteppedSlider("War Bonds", "Base Gold on Shrine Use", 10f, 1f, "The amount of gold granted upon using a shrine at 1 stack of the item.", 0f, 100f, restartRequired: true); WBStackShrineUseGold = cfg.BindOptionSteppedSlider("War Bonds", "Stack Gold on Shrine Use", 10f, 1f, "The amount extra gold granted upon using a shrine, per stack of the item.", 0f, 100f, restartRequired: true); WBEnableAnnouncement = cfg.BindOption("War Bonds", "Announce Gold Req. on Stage Start", defaultValue: true, "Announces how much gold is required per missile upon starting a given stage.", restartRequired: true); } public static void InitRoO() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) try { ModSettingsManager.SetModDescription("SOTS Items saving too many of your otherwise doomed runs? Not anymore!", "Skeletogne.SeekersoftheStormNerfs", "SeekersoftheStormNerfs"); byte[] array = File.ReadAllBytes(Path.Combine(SeekersoftheStormNerfs.Instance.DirectoryName, "icon.png")); Texture2D val = new Texture2D(256, 256); ImageConversion.LoadImage(val, array); Sprite modIcon = Sprite.Create(val, new Rect(0f, 0f, 256f, 256f), new Vector2(0.5f, 0.5f)); ModSettingsManager.SetModIcon(modIcon); } catch (Exception ex) { Log.Debug(ex.ToString()); } } public static ConfigEntry BindOption(this ConfigFile myConfig, string section, string name, T defaultValue, string description = "", bool restartRequired = false) { //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Expected O, but got Unknown bool flag = ((defaultValue is int || defaultValue is float) ? true : false); if (flag && !typeof(T).IsEnum) { Log.Warning("Config entry " + name + " in section " + section + " is a numeric " + typeof(T).Name + " type, but has been registered without using BindOptionSlider. Lower and upper bounds will be set to the defaults [0, 20]. Was this intentional?"); return myConfig.BindOptionSlider(section, name, defaultValue, description, 0f, 20f, restartRequired); } if (string.IsNullOrEmpty(description)) { description = name; } if (restartRequired) { description += " (restart required)"; } AcceptableValueBase val = null; if (typeof(T).IsEnum) { val = (AcceptableValueBase)(object)new AcceptableValueList(Enum.GetNames(typeof(T))); } ConfigEntry val2 = myConfig.Bind(section, name, defaultValue, new ConfigDescription(description, val, Array.Empty())); if (SeekersoftheStormNerfs.RooInstalled) { TryRegisterOption(val2, restartRequired); } return val2; } public static ConfigEntry BindOptionSlider(this ConfigFile myConfig, string section, string name, T defaultValue, string description = "", float min = 0f, float max = 20f, bool restartRequired = false) { //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Expected O, but got Unknown bool flag = ((defaultValue is int || defaultValue is float) ? true : false); if (!flag || typeof(T).IsEnum) { Log.Warning("Config entry " + name + " in section " + section + " is a not a numeric " + typeof(T).Name + " type, but has been registered as a slider option using BindOptionSlider. Was this intentional?"); return myConfig.BindOption(section, name, defaultValue, description, restartRequired); } if (string.IsNullOrEmpty(description)) { description = name; } string text = description; T val = defaultValue; description = text + " (Default: " + val?.ToString() + ")"; if (restartRequired) { description += " (restart required)"; } AcceptableValueBase val2 = (AcceptableValueBase)((typeof(T) == typeof(int)) ? ((object)new AcceptableValueRange((int)min, (int)max)) : ((object)new AcceptableValueRange(min, max))); ConfigEntry val3 = myConfig.Bind(section, name, defaultValue, new ConfigDescription(description, val2, Array.Empty())); if (SeekersoftheStormNerfs.RooInstalled) { TryRegisterOptionSlider(val3, min, max, restartRequired); } return val3; } public static ConfigEntry BindOptionSteppedSlider(this ConfigFile myConfig, string section, string name, T defaultValue, float increment = 1f, string description = "", float min = 0f, float max = 20f, bool restartRequired = false, int type = 0) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown if (string.IsNullOrEmpty(description)) { description = name; } string text = description; T val = defaultValue; description = text + " (Default: " + val?.ToString() + ")"; if (restartRequired) { description += " (restart required)"; } ConfigEntry val2 = myConfig.Bind(section, name, defaultValue, new ConfigDescription(description, (AcceptableValueBase)(object)new AcceptableValueRange(min, max), Array.Empty())); if (SeekersoftheStormNerfs.RooInstalled) { TryRegisterOptionSteppedSlider(val2, increment, min, max, restartRequired, type); } return val2; } public static void TryRegisterOption(ConfigEntry entry, bool restartRequired) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown if (entry is ConfigEntry val) { ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(val, new InputFieldConfig { submitOn = (SubmitEnum)6, restartRequired = restartRequired })); return; } if (entry is ConfigEntry val2) { ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(val2, restartRequired)); return; } if (entry is ConfigEntry val3) { ModSettingsManager.AddOption((BaseOption)new KeyBindOption(val3, restartRequired)); return; } if (typeof(T).IsEnum) { ModSettingsManager.AddOption((BaseOption)new ChoiceOption((ConfigEntryBase)(object)entry, restartRequired)); return; } Log.Warning("Config entry " + ((ConfigEntryBase)entry).Definition.Key + " in section " + ((ConfigEntryBase)entry).Definition.Section + " with type " + typeof(T).Name + " could not be registered in Risk Of Options using TryRegisterOption."); } public static void TryRegisterOptionSlider(ConfigEntry entry, float min, float max, bool restartRequired) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown //IL_005b: 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_0067: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown if (entry is ConfigEntry val) { ModSettingsManager.AddOption((BaseOption)new IntSliderOption(val, new IntSliderConfig { min = (int)min, max = (int)max, formatString = "{0:0}", restartRequired = restartRequired })); } else if (entry is ConfigEntry val2) { ModSettingsManager.AddOption((BaseOption)new SliderOption(val2, new SliderConfig { min = min, max = max, FormatString = "{0:0.000}", restartRequired = restartRequired })); } else { Log.Warning("Config entry " + ((ConfigEntryBase)entry).Definition.Key + " in section " + ((ConfigEntryBase)entry).Definition.Section + " with type " + typeof(T).Name + " could not be registered in Risk Of Options using TryRegisterOptionSlider."); } } public static void TryRegisterOptionSteppedSlider(ConfigEntry entry, float increment, float min, float max, bool restartRequired, int type) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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_004d: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown if (entry is ConfigEntry val) { ModSettingsManager.AddOption((BaseOption)new StepSliderOption(val, new StepSliderConfig { increment = increment, min = min, max = max, FormatString = GetStepSizePrecision((decimal)increment, type), restartRequired = restartRequired })); } else { Log.Warning("Config entry " + ((ConfigEntryBase)entry).Definition.Key + " in section " + ((ConfigEntryBase)entry).Definition.Section + " with type " + typeof(T).Name + " could not be registered in Risk Of Options using TryRegisterOptionSteppedSlider."); } } private static string GetStepSizePrecision(decimal n, int type) { n = Math.Abs(n); n -= (decimal)(int)n; int num = 0; string text = "{0:"; while (n > 0m) { num++; n *= 10m; n -= (decimal)(int)n; } if (type == 1) { return text + "P" + (num - 2) + "}"; } if (num == 0) { return text + "0}" + AppendSuffix(type); } if (num > 0) { text += "0."; for (int i = 0; i < num; i++) { text += "0"; } text += "}"; return text + AppendSuffix(type); } Log.Error("Could not determine string format!"); return "{0:000}"; } private static string AppendSuffix(int type) { return type switch { 1 => "%", 2 => "s", 3 => "m", 4 => "m/s", _ => "", }; } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("Skeletogne.SeekersoftheStormNerfs", "SeekersoftheStormNerfs", "1.2.1")] public class SeekersoftheStormNerfs : BaseUnityPlugin { [CompilerGenerated] private static class <>O { public static hook_OnSkillActivated <0>__UtilityAndSpecialCharge; public static hook_TakeDamageProcess <1>__CheckForNoxiousThornBurn; public static hook_TrackBeadExperience <2>__ChangeBeadExpGain; } public const string PluginGUID = "Skeletogne.SeekersoftheStormNerfs"; public const string PluginAuthor = "Skeletogne"; public const string PluginName = "SeekersoftheStormNerfs"; public const string PluginVersion = "1.2.1"; private static readonly Dictionary DefaultLanguage = new Dictionary(); internal static bool RooInstalled => Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); public static SeekersoftheStormNerfs Instance { get; private set; } internal string DirectoryName => Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); public void OnEnable() { //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_0039: Expected O, but got Unknown //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_0077: Expected O, but got Unknown //IL_009b: 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_00a6: Expected O, but got Unknown if (PluginConfig.LSEnableChanges.Value && PluginConfig.LSAllSkillsCharge.Value) { object obj = <>O.<0>__UtilityAndSpecialCharge; if (obj == null) { hook_OnSkillActivated val = LuminousShot.UtilityAndSpecialCharge; <>O.<0>__UtilityAndSpecialCharge = val; obj = (object)val; } CharacterBody.OnSkillActivated += (hook_OnSkillActivated)obj; } if (PluginConfig.NTEnableChanges.Value && PluginConfig.NTEnableBurn.Value) { object obj2 = <>O.<1>__CheckForNoxiousThornBurn; if (obj2 == null) { hook_TakeDamageProcess val2 = NoxiousThorn.CheckForNoxiousThornBurn; <>O.<1>__CheckForNoxiousThornBurn = val2; obj2 = (object)val2; } HealthComponent.TakeDamageProcess += (hook_TakeDamageProcess)obj2; } if (PluginConfig.PBEnableChanges.Value) { object obj3 = <>O.<2>__ChangeBeadExpGain; if (obj3 == null) { hook_TrackBeadExperience val3 = PrayerBeads.ChangeBeadExpGain; <>O.<2>__ChangeBeadExpGain = val3; obj3 = (object)val3; } CharacterMaster.TrackBeadExperience += (hook_TrackBeadExperience)obj3; } } public void OnDisable() { //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_0039: Expected O, but got Unknown //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_0077: Expected O, but got Unknown //IL_009b: 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_00a6: Expected O, but got Unknown if (PluginConfig.LSEnableChanges.Value && PluginConfig.LSAllSkillsCharge.Value) { object obj = <>O.<0>__UtilityAndSpecialCharge; if (obj == null) { hook_OnSkillActivated val = LuminousShot.UtilityAndSpecialCharge; <>O.<0>__UtilityAndSpecialCharge = val; obj = (object)val; } CharacterBody.OnSkillActivated -= (hook_OnSkillActivated)obj; } if (PluginConfig.NTEnableChanges.Value && PluginConfig.NTEnableBurn.Value) { object obj2 = <>O.<1>__CheckForNoxiousThornBurn; if (obj2 == null) { hook_TakeDamageProcess val2 = NoxiousThorn.CheckForNoxiousThornBurn; <>O.<1>__CheckForNoxiousThornBurn = val2; obj2 = (object)val2; } HealthComponent.TakeDamageProcess -= (hook_TakeDamageProcess)obj2; } if (PluginConfig.PBEnableChanges.Value) { object obj3 = <>O.<2>__ChangeBeadExpGain; if (obj3 == null) { hook_TrackBeadExperience val3 = PrayerBeads.ChangeBeadExpGain; <>O.<2>__ChangeBeadExpGain = val3; obj3 = (object)val3; } CharacterMaster.TrackBeadExperience -= (hook_TrackBeadExperience)obj3; } } public void Awake() { Instance = this; Log.Init(((BaseUnityPlugin)this).Logger); PluginConfig.Init(((BaseUnityPlugin)this).Config); if (PluginConfig.CEEnableChanges.Value) { ChronicExpansion.ApplyChanges(); } if (PluginConfig.EAEnableChanges.Value) { ElusiveAntlers.ApplyChanges(); } if (PluginConfig.BLEnableChanges.Value) { BolsteringLantern.ApplyChanges(); } if (PluginConfig.WEEnableChanges.Value) { WarpedEcho.ApplyChanges(); } if (PluginConfig.BFEnableChanges.Value) { BreachingFin.ApplyChanges(); } if (PluginConfig.CDEnableChanges.Value) { ChanceDoll.ApplyChanges(); } if (PluginConfig.LSEnableChanges.Value) { LuminousShot.ApplyChanges(); } if (PluginConfig.NTEnableChanges.Value) { NoxiousThorn.ApplyChanges(); } if (PluginConfig.PBEnableChanges.Value) { PrayerBeads.ApplyChanges(); } if (PluginConfig.SSEnableChanges.Value) { SaleStar.ApplyChanges(); } if (PluginConfig.UTEnableChanges.Value) { UnstableTransmitter.ApplyChanges(); } if (PluginConfig.EBEnableChanges.Value) { ElectricBoomerang.ApplyChanges(); } if (PluginConfig.GNEnableChanges.Value) { GrowthNectar.ApplyChanges(); } if (PluginConfig.RLEnableChanges.Value) { RunicLens.ApplyChanges(); } if (PluginConfig.SWEnableChanges.Value) { SonorousWhispers.ApplyChanges(); } if (PluginConfig.WBEnableChanges.Value) { WarBonds.ApplyChanges(); } } public static void ReplaceItemDesc(string itemToken, string itemDescription) { try { DefaultLanguage[itemToken] = itemDescription; LanguageAPI.Add(itemToken, itemDescription); } catch { Log.Error("Failed to update item description for " + itemToken); } } public static MethodInfo GetAnonymousMethod(Type t, string methodName) { Type[] nestedTypes = t.GetNestedTypes((BindingFlags)(-1)); Type[] array = nestedTypes; foreach (Type type in array) { if (!type.Name.Contains("<>") || !type.Name.Contains("DisplayClass")) { continue; } MethodInfo[] methods = type.GetMethods((BindingFlags)(-1)); foreach (MethodInfo methodInfo in methods) { if (methodInfo.Name.Contains(methodName)) { return methodInfo; } } } MethodInfo[] methods2 = t.GetMethods((BindingFlags)(-1)); foreach (MethodInfo methodInfo2 in methods2) { if (methodInfo2.Name.Contains("<") && methodInfo2.Name.Contains(methodName)) { return methodInfo2; } } return null; } } } namespace SeekersoftheStormNerfs.items { internal static class BolsteringLantern { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__10_4; public static Func <>9__10_2; public static Func <>9__10_5; public static Func <>9__10_6; public static Manipulator <>9__10_0; public static Func <>9__10_8; public static Func <>9__10_9; public static Func <>9__10_10; public static Func <>9__10_11; public static Func <>9__10_12; public static Func <>9__10_7; public static Func <>9__10_14; public static Func <>9__10_15; public static Func <>9__10_16; public static Func <>9__10_17; public static Func <>9__10_13; public static Manipulator <>9__10_1; internal void b__10_0(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) <>c__DisplayClass10_0 CS$<>8__locals0 = new <>c__DisplayClass10_0(); ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(AttackSpeedPerNearbyCollider), "maxCharacterCount") })) { val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)((int originalValue, int itemCount) => baseMaxBodies + (itemCount - 1) * stackMaxBodies)); } else { Log.Error("IL Hook for Bolstering Lantern Max Character Count failed!"); } CS$<>8__locals0.stackDiam = stackRadius * 2f; CS$<>8__locals0.baseStackDiam = baseRadius * 2f; ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchStindR4(x), (Instruction x) => ILPatternMatchingExt.MatchRet(x) })) { val2.Emit(OpCodes.Ldarg_1); val2.EmitDelegate>((Func)((float originalValue, int itemCount) => hyperbolicScaling ? (CS$<>8__locals0.baseStackDiam + Util.ConvertAmplificationPercentageIntoReductionPercentage(CS$<>8__locals0.stackDiam) * (float)(itemCount - 1)) : (CS$<>8__locals0.baseStackDiam + CS$<>8__locals0.stackDiam * (float)(itemCount - 1)))); } else { Log.Error("IL Hook for Bolstering Lantern Effect Radius failed!"); } } internal bool b__10_4(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, typeof(AttackSpeedPerNearbyCollider), "maxCharacterCount"); } internal int b__10_2(int originalValue, int itemCount) { return baseMaxBodies + (itemCount - 1) * stackMaxBodies; } internal bool b__10_5(Instruction x) { return ILPatternMatchingExt.MatchStindR4(x); } internal bool b__10_6(Instruction x) { return ILPatternMatchingExt.MatchRet(x); } internal void b__10_1(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 100), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 100), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 31) })) { val.Index += 2; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body) { if (Object.op_Implicit((Object)(object)body.inventory)) { int itemCount2 = body.inventory.GetItemCount(Items.AttackSpeedPerNearbyAllyOrEnemy); int buffCount = body.GetBuffCount(Buffs.AttackSpeedPerNearbyAllyOrEnemyBuff); if (itemCount2 > 0) { return (float)buffCount * (baseBodyAttackSpeed + stackBodyAttackSpeed * (float)(itemCount2 - 1)); } } return originalValue; }); } else { Log.Error("IL Hook for Bolstering Lantern Attack Speed failed!"); } if (!enableUnconditionalAS) { return; } ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 100), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 67), (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.07f) })) { val2.Emit(OpCodes.Ldloc, 100); val2.Emit(OpCodes.Ldarg_0); val2.EmitDelegate>((Func)delegate(float attackSpeed, CharacterBody body) { if ((Object)(object)body == (Object)null) { return attackSpeed; } if ((Object)(object)body.inventory == (Object)null) { return attackSpeed; } int itemCount = body.inventory.GetItemCount(Items.AttackSpeedPerNearbyAllyOrEnemy); return attackSpeed + (baseAttackSpeed + stackAttackSpeed * (float)(itemCount - 1)); }); val2.Emit(OpCodes.Stloc, 100); } else { Log.Debug("IL Hook for Bolstering Lantern unconditional attack speed failed!"); } } internal bool b__10_8(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool b__10_9(Instruction x) { return ILPatternMatchingExt.MatchAdd(x); } internal bool b__10_10(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 100); } internal bool b__10_11(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 100); } internal bool b__10_12(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 31); } internal float b__10_7(float originalValue, CharacterBody body) { if (Object.op_Implicit((Object)(object)body.inventory)) { int itemCount = body.inventory.GetItemCount(Items.AttackSpeedPerNearbyAllyOrEnemy); int buffCount = body.GetBuffCount(Buffs.AttackSpeedPerNearbyAllyOrEnemyBuff); if (itemCount > 0) { return (float)buffCount * (baseBodyAttackSpeed + stackBodyAttackSpeed * (float)(itemCount - 1)); } } return originalValue; } internal bool b__10_14(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 100); } internal bool b__10_15(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 67); } internal bool b__10_16(Instruction x) { return ILPatternMatchingExt.MatchConvR4(x); } internal bool b__10_17(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 0.07f); } internal float b__10_13(float attackSpeed, CharacterBody body) { if ((Object)(object)body == (Object)null) { return attackSpeed; } if ((Object)(object)body.inventory == (Object)null) { return attackSpeed; } int itemCount = body.inventory.GetItemCount(Items.AttackSpeedPerNearbyAllyOrEnemy); return attackSpeed + (baseAttackSpeed + stackAttackSpeed * (float)(itemCount - 1)); } } [CompilerGenerated] private sealed class <>c__DisplayClass10_0 { public float baseStackDiam; public float stackDiam; internal float b__3(float originalValue, int itemCount) { if (hyperbolicScaling) { return baseStackDiam + Util.ConvertAmplificationPercentageIntoReductionPercentage(stackDiam) * (float)(itemCount - 1); } return baseStackDiam + stackDiam * (float)(itemCount - 1); } } private static readonly int baseMaxBodies = (int)PluginConfig.BLBaseMaxBodies.Value; private static readonly int stackMaxBodies = (int)PluginConfig.BLStackMaxBodies.Value; private static readonly float baseRadius = PluginConfig.BLBaseRadius.Value; private static readonly float stackRadius = PluginConfig.BLStackRadius.Value; private static readonly bool hyperbolicScaling = PluginConfig.BLHyperbolicScaling.Value; private static readonly float baseBodyAttackSpeed = PluginConfig.BLBaseBodyAttackSpeed.Value; private static readonly float stackBodyAttackSpeed = PluginConfig.BLStackBodyAttackSpeed.Value; private static readonly bool enableUnconditionalAS = PluginConfig.BLEnableUnconditionalAS.Value; private static readonly float baseAttackSpeed = PluginConfig.BLBaseAttackSpeed.Value; private static readonly float stackAttackSpeed = PluginConfig.BLStackAttackSpeed.Value; public static void ApplyChanges() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown Log.Info("Bolstering Lantern hooks initialised."); object obj = <>c.<>9__10_0; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) ILCursor val5 = new ILCursor(il); if (val5.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(AttackSpeedPerNearbyCollider), "maxCharacterCount") })) { val5.Emit(OpCodes.Ldarg_1); val5.EmitDelegate>((Func)((int originalValue, int itemCount) => baseMaxBodies + (itemCount - 1) * stackMaxBodies)); } else { Log.Error("IL Hook for Bolstering Lantern Max Character Count failed!"); } float stackDiam = stackRadius * 2f; float baseStackDiam = baseRadius * 2f; ILCursor val6 = new ILCursor(il); if (val6.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchStindR4(x), (Instruction x) => ILPatternMatchingExt.MatchRet(x) })) { val6.Emit(OpCodes.Ldarg_1); val6.EmitDelegate>((Func)((float originalValue, int itemCount) => hyperbolicScaling ? (baseStackDiam + Util.ConvertAmplificationPercentageIntoReductionPercentage(stackDiam) * (float)(itemCount - 1)) : (baseStackDiam + stackDiam * (float)(itemCount - 1)))); } else { Log.Error("IL Hook for Bolstering Lantern Effect Radius failed!"); } }; <>c.<>9__10_0 = val; obj = (object)val; } AttackSpeedPerNearbyCollider.UpdateValues += (Manipulator)obj; object obj2 = <>c.<>9__10_1; if (obj2 == null) { Manipulator val2 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) ILCursor val3 = new ILCursor(il); if (val3.TryGotoNext(new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 100), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 100), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 31) })) { val3.Index += 2; val3.Emit(OpCodes.Ldarg_0); val3.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body) { if (Object.op_Implicit((Object)(object)body.inventory)) { int itemCount3 = body.inventory.GetItemCount(Items.AttackSpeedPerNearbyAllyOrEnemy); int buffCount = body.GetBuffCount(Buffs.AttackSpeedPerNearbyAllyOrEnemyBuff); if (itemCount3 > 0) { return (float)buffCount * (baseBodyAttackSpeed + stackBodyAttackSpeed * (float)(itemCount3 - 1)); } } return originalValue; }); } else { Log.Error("IL Hook for Bolstering Lantern Attack Speed failed!"); } if (enableUnconditionalAS) { ILCursor val4 = new ILCursor(il); if (val4.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 100), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 67), (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.07f) })) { val4.Emit(OpCodes.Ldloc, 100); val4.Emit(OpCodes.Ldarg_0); val4.EmitDelegate>((Func)delegate(float attackSpeed, CharacterBody body) { if ((Object)(object)body == (Object)null) { return attackSpeed; } if ((Object)(object)body.inventory == (Object)null) { return attackSpeed; } int itemCount2 = body.inventory.GetItemCount(Items.AttackSpeedPerNearbyAllyOrEnemy); return attackSpeed + (baseAttackSpeed + stackAttackSpeed * (float)(itemCount2 - 1)); }); val4.Emit(OpCodes.Stloc, 100); } else { Log.Debug("IL Hook for Bolstering Lantern unconditional attack speed failed!"); } } }; <>c.<>9__10_1 = val2; obj2 = (object)val2; } CharacterBody.RecalculateStats += (Manipulator)obj2; SeekersoftheStormNerfs.ReplaceItemDesc("ITEM_ATTACKSPEEDPERNEARBYALLYORENEMY_DESC", "Increase your attack speed by " + (enableUnconditionalAS ? ($"{baseAttackSpeed * 100f:0.##}% " + ((stackAttackSpeed != 0f) ? $"(+{stackAttackSpeed * 100f:0.##}% per stack) " : "") + "plus an additional ") : "") + $"{baseBodyAttackSpeed * 100f:0.##}% " + ((stackBodyAttackSpeed != 0f) ? $"(+{stackBodyAttackSpeed * 100f:0.##}% per stack) " : "") + $"for up to {baseMaxBodies} " + ((stackMaxBodies != 0) ? $"(+{stackMaxBodies} per stack) " : "") + $"enemies and allies within {baseRadius:0.##} " + ((stackRadius != 0f) ? $"(+{stackRadius:0.##} per stack) " : "") + "meters."); } } internal static class BreachingFin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__7_4; public static Func <>9__7_3; public static Manipulator <>9__7_0; public static Func <>9__7_6; public static Func <>9__7_7; public static Func <>9__7_5; public static Manipulator <>9__7_1; public static Func <>9__7_9; public static Func <>9__7_10; public static Func <>9__7_8; public static Manipulator <>9__7_2; internal void b__7_0(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchRet(x) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(float originalValue, int itemCount) { float num = Util.ConvertAmplificationPercentageIntoReductionNormalized((float)(itemCount - 1) * stackCooldownReduction); return Mathf.Lerp(baseCooldown, cooldownFloor, num); }); } else { Log.Error("IL Hook for Breaching Fin cooldown failed!"); } } internal bool b__7_4(Instruction x) { return ILPatternMatchingExt.MatchRet(x); } internal float b__7_3(float originalValue, int itemCount) { float num = Util.ConvertAmplificationPercentageIntoReductionNormalized((float)(itemCount - 1) * stackCooldownReduction); return Mathf.Lerp(baseCooldown, cooldownFloor, num); } internal void b__7_1(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005e: 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_0076: 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) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(DamageInfo), "damage") })) { val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldind_Ref); val.Emit(OpCodes.Ldarg_1); val.Emit(OpCodes.Ldarg_2); val.EmitDelegate>((Func)delegate(float originalValue, DamageInfo damageInfo, CharacterBody attacker, CharacterBody victim) { if ((Object)(object)attacker == (Object)null) { return 0f; } int itemCount = attacker.inventory.GetItemCount(Items.KnockBackHitEnemies); int buffCount = victim.GetBuffCount(Buffs.KnockUpHitEnemiesJuggleCount); return damageInfo.damage * Mathf.Max(1f, (float)buffCount) * (baseDamageBonus + stackDamageBonus * (float)(itemCount - 1)); }); } else { Log.Error("IL Hook for Breaching Fin damage bonus failed!"); } } internal bool b__7_6(Instruction x) { return ILPatternMatchingExt.MatchAdd(x); } internal bool b__7_7(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, typeof(DamageInfo), "damage"); } internal float b__7_5(float originalValue, DamageInfo damageInfo, CharacterBody attacker, CharacterBody victim) { if ((Object)(object)attacker == (Object)null) { return 0f; } int itemCount = attacker.inventory.GetItemCount(Items.KnockBackHitEnemies); int buffCount = victim.GetBuffCount(Buffs.KnockUpHitEnemiesJuggleCount); return damageInfo.damage * Mathf.Max(1f, (float)buffCount) * (baseDamageBonus + stackDamageBonus * (float)(itemCount - 1)); } internal void b__7_2(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 23), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)delegate(int originalValue, DamageInfo damageInfo) { if ((Object)(object)damageInfo.attacker.GetComponent() == (Object)null) { return 0; } if ((Object)(object)damageInfo.attacker.GetComponent().inventory == (Object)null) { return 0; } int itemCount = damageInfo.attacker.GetComponent().inventory.GetItemCount(Items.KnockBackHitEnemies); return baselaunchesAfterFirst + stackLaunchesAfterFirst * (itemCount - 1); }); } else { Log.Error("IL Hook for Breaching Fin number of additional launches beyond first failed!"); } } internal bool b__7_9(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 23); } internal bool b__7_10(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal int b__7_8(int originalValue, DamageInfo damageInfo) { if ((Object)(object)damageInfo.attacker.GetComponent() == (Object)null) { return 0; } if ((Object)(object)damageInfo.attacker.GetComponent().inventory == (Object)null) { return 0; } int itemCount = damageInfo.attacker.GetComponent().inventory.GetItemCount(Items.KnockBackHitEnemies); return baselaunchesAfterFirst + stackLaunchesAfterFirst * (itemCount - 1); } } public static readonly int baselaunchesAfterFirst = (int)PluginConfig.BFBaseLaunchesAfterFirst.Value; public static readonly int stackLaunchesAfterFirst = (int)PluginConfig.BFStackLaunchesAfterFirst.Value; public static readonly float baseDamageBonus = PluginConfig.BFBaseDamageBonus.Value; public static readonly float stackDamageBonus = PluginConfig.BFStackDamageBonus.Value; public static readonly float baseCooldown = PluginConfig.BFBaseCooldown.Value; public static readonly float cooldownFloor = PluginConfig.BFCooldownFloor.Value; public static readonly float stackCooldownReduction = PluginConfig.BFStackCooldownReduction.Value; public static void ApplyChanges() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //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_0075: Expected O, but got Unknown Log.Info("Breaching Fin hooks initialised."); object obj = <>c.<>9__7_0; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) ILCursor val6 = new ILCursor(il); if (val6.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchRet(x) })) { val6.Emit(OpCodes.Ldarg_0); val6.EmitDelegate>((Func)delegate(float originalValue, int itemCount) { float num = Util.ConvertAmplificationPercentageIntoReductionNormalized((float)(itemCount - 1) * stackCooldownReduction); return Mathf.Lerp(baseCooldown, cooldownFloor, num); }); } else { Log.Error("IL Hook for Breaching Fin cooldown failed!"); } }; <>c.<>9__7_0 = val; obj = (object)val; } KnockbackFinUtil.GetCooldown += (Manipulator)obj; object obj2 = <>c.<>9__7_1; if (obj2 == null) { Manipulator val2 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005e: 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_0076: 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) ILCursor val5 = new ILCursor(il); if (val5.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(DamageInfo), "damage") })) { val5.Emit(OpCodes.Ldarg_0); val5.Emit(OpCodes.Ldind_Ref); val5.Emit(OpCodes.Ldarg_1); val5.Emit(OpCodes.Ldarg_2); val5.EmitDelegate>((Func)delegate(float originalValue, DamageInfo damageInfo, CharacterBody attacker, CharacterBody victim) { if ((Object)(object)attacker == (Object)null) { return 0f; } int itemCount3 = attacker.inventory.GetItemCount(Items.KnockBackHitEnemies); int buffCount = victim.GetBuffCount(Buffs.KnockUpHitEnemiesJuggleCount); return damageInfo.damage * Mathf.Max(1f, (float)buffCount) * (baseDamageBonus + stackDamageBonus * (float)(itemCount3 - 1)); }); } else { Log.Error("IL Hook for Breaching Fin damage bonus failed!"); } }; <>c.<>9__7_1 = val2; obj2 = (object)val2; } KnockbackFinUtil.ModifyDamageInfo += (Manipulator)obj2; object obj3 = <>c.<>9__7_2; if (obj3 == null) { Manipulator val3 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) ILCursor val4 = new ILCursor(il); if (val4.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 23), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { val4.Emit(OpCodes.Ldarg_1); val4.EmitDelegate>((Func)delegate(int originalValue, DamageInfo damageInfo) { if ((Object)(object)damageInfo.attacker.GetComponent() == (Object)null) { return 0; } if ((Object)(object)damageInfo.attacker.GetComponent().inventory == (Object)null) { return 0; } int itemCount2 = damageInfo.attacker.GetComponent().inventory.GetItemCount(Items.KnockBackHitEnemies); return baselaunchesAfterFirst + stackLaunchesAfterFirst * (itemCount2 - 1); }); } else { Log.Error("IL Hook for Breaching Fin number of additional launches beyond first failed!"); } }; <>c.<>9__7_2 = val3; obj3 = (object)val3; } HealthComponent.TakeDamageProcess += (Manipulator)obj3; SeekersoftheStormNerfs.ReplaceItemDesc("ITEM_KNOCKBACKHITENEMIES_DESC", "Grounded enemies hit with any skill are launched, and stunned for 3.2s. Enemies hit while airborne are launched again up to " + $"{baselaunchesAfterFirst} times" + (((float)stackLaunchesAfterFirst != 0f) ? $" (+{stackLaunchesAfterFirst} per stack). " : ". ") + $"Launched enemies take increased damage by {baseDamageBonus * 100f:0.##}% " + ((stackDamageBonus != 0f) ? $"(+{stackDamageBonus * 100f:0.##}% per stack) " : "") + "from all sources per launch. Recharges after " + $"{baseCooldown}s" + ((stackCooldownReduction != 0f) ? $" (-{stackCooldownReduction * 100f:0.##}% per stack)." : ".")); } } internal static class ChanceDoll { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__2_2; public static Func <>9__2_3; public static Func <>9__2_1; public static Manipulator <>9__2_0; internal void b__2_0(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1) })) { val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)delegate(int originalValue, Interactor activator) { if ((Object)(object)((Component)activator).GetComponent() == (Object)null) { Log.Info("Activator is null!"); return 0; } if ((Object)(object)((Component)activator).GetComponent().inventory == (Object)null) { Log.Info("Activator inventory is null!"); return 0; } int itemCount = ((Component)activator).GetComponent().inventory.GetItemCount(Items.ExtraShrineItem); return baseChance + stackChance * (itemCount - 1); }); } else { Log.Error("IL Hook for Chance Doll item rarity increase chance failed!"); } } internal bool b__2_2(Instruction x) { return ILPatternMatchingExt.MatchConvR4(x); } internal bool b__2_3(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 1); } internal int b__2_1(int originalValue, Interactor activator) { if ((Object)(object)((Component)activator).GetComponent() == (Object)null) { Log.Info("Activator is null!"); return 0; } if ((Object)(object)((Component)activator).GetComponent().inventory == (Object)null) { Log.Info("Activator inventory is null!"); return 0; } int itemCount = ((Component)activator).GetComponent().inventory.GetItemCount(Items.ExtraShrineItem); return baseChance + stackChance * (itemCount - 1); } } public static readonly int baseChance = (int)(PluginConfig.CDBaseChance.Value * 100f); public static readonly int stackChance = (int)(PluginConfig.CDStackChance.Value * 100f); public static void ApplyChanges() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown Log.Info("Chance Doll hooks initialised."); object obj = <>c.<>9__2_0; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1) })) { val2.Emit(OpCodes.Ldarg_1); val2.EmitDelegate>((Func)delegate(int originalValue, Interactor activator) { if ((Object)(object)((Component)activator).GetComponent() == (Object)null) { Log.Info("Activator is null!"); return 0; } if ((Object)(object)((Component)activator).GetComponent().inventory == (Object)null) { Log.Info("Activator inventory is null!"); return 0; } int itemCount = ((Component)activator).GetComponent().inventory.GetItemCount(Items.ExtraShrineItem); return baseChance + stackChance * (itemCount - 1); }); } else { Log.Error("IL Hook for Chance Doll item rarity increase chance failed!"); } }; <>c.<>9__2_0 = val; obj = (object)val; } ShrineChanceBehavior.AddShrineStack += (Manipulator)obj; SeekersoftheStormNerfs.ReplaceItemDesc("ITEM_EXTRASHRINEITEM_DESC", "On Shrine of Chance success, " + $"{baseChance:0.##}% " + (((float)stackChance != 0f) ? $"(+{stackChance:0.##}% per stack) " : "") + "chance to get higher rarity items."); } } internal static class ChronicExpansion { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__8_7; public static Func <>9__8_8; public static Func <>9__8_9; public static Func <>9__8_6; public static Manipulator <>9__8_0; public static Func <>9__8_11; public static Func <>9__8_12; public static Func <>9__8_13; public static Func <>9__8_10; public static Manipulator <>9__8_1; public static Func <>9__8_15; public static Func <>9__8_16; public static Func <>9__8_17; public static Func <>9__8_14; public static Manipulator <>9__8_2; public static Func <>9__8_19; public static Func <>9__8_20; public static Func <>9__8_21; public static Func <>9__8_18; public static Manipulator <>9__8_3; public static Func <>9__8_22; public static Func <>9__8_23; public static Func <>9__8_24; public static Func <>9__8_25; public static Manipulator <>9__8_4; public static Func <>9__8_26; public static Func <>9__8_27; public static Func <>9__8_28; public static Func <>9__8_29; public static Func <>9__8_30; public static Func <>9__8_31; public static Manipulator <>9__8_5; internal void b__8_0(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 96), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(CharacterBody), "baseDamage") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount = body.inventory.GetItemCount(Items.IncreaseDamageOnMultiKill); int buffCount = body.GetBuffCount(Buffs.IncreaseDamageBuff); return (itemCount > 0) ? ((baseKillDamage + stackKillDamage * (float)(itemCount - 1)) * (float)buffCount) : 0f; }); } else { Log.Error("SOTSNerf IL Hook for Kill Damage failed!"); } } internal bool b__8_7(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 96); } internal bool b__8_8(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool b__8_9(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, typeof(CharacterBody), "baseDamage"); } internal float b__8_6(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount = body.inventory.GetItemCount(Items.IncreaseDamageOnMultiKill); int buffCount = body.GetBuffCount(Buffs.IncreaseDamageBuff); if (itemCount > 0) { return (baseKillDamage + stackKillDamage * (float)(itemCount - 1)) * (float)buffCount; } return 0f; } internal void b__8_1(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchRet(x), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0), (Instruction x) => ILPatternMatchingExt.MatchRet(x) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(int originalValue, CharacterBody body) { int itemCount = body.inventory.GetItemCount(Items.IncreaseDamageOnMultiKill); return baseMaxKills + stackMaxKills * (itemCount - 1); }); } else { Log.Error("SOTSNerf IL Hook for Base Max Kills failed!"); } } internal bool b__8_11(Instruction x) { return ILPatternMatchingExt.MatchRet(x); } internal bool b__8_12(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 0); } internal bool b__8_13(Instruction x) { return ILPatternMatchingExt.MatchRet(x); } internal int b__8_10(int originalValue, CharacterBody body) { int itemCount = body.inventory.GetItemCount(Items.IncreaseDamageOnMultiKill); return baseMaxKills + stackMaxKills * (itemCount - 1); } internal void b__8_2(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(CharacterBody), "increasedDamageKillTimer"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(float originalValue, CharacterBody self) { if ((Object)(object)self == (Object)null) { return 0f; } if ((Object)(object)self.inventory == (Object)null) { return 0f; } int itemCount = self.inventory.GetItemCount(Items.IncreaseDamageOnMultiKill); return baseTime + stackTime * (float)(itemCount - 1); }); } else { Log.Error("IL Hook for Chronic Expansion timeout failed!"); } } internal bool b__8_15(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, typeof(CharacterBody), "increasedDamageKillTimer"); } internal bool b__8_16(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool b__8_17(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 1); } internal float b__8_14(float originalValue, CharacterBody self) { if ((Object)(object)self == (Object)null) { return 0f; } if ((Object)(object)self.inventory == (Object)null) { return 0f; } int itemCount = self.inventory.GetItemCount(Items.IncreaseDamageOnMultiKill); return baseTime + stackTime * (float)(itemCount - 1); } internal void b__8_3(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(IncreaseDamageOnMultiKillItemDisplayUpdater), "resetTime"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(float originalValue, IncreaseDamageOnMultiKillItemDisplayUpdater self) { if ((Object)(object)self.body == (Object)null) { return 0f; } if ((Object)(object)self.body.inventory == (Object)null) { return 0f; } int itemCount = self.body.inventory.GetItemCount(Items.IncreaseDamageOnMultiKill); return baseTime + stackTime * (float)(itemCount - 1); }); } else { Log.Info("IL Hook for Chronic Expansion visual timeout failed!"); } } internal bool b__8_19(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, typeof(IncreaseDamageOnMultiKillItemDisplayUpdater), "resetTime"); } internal bool b__8_20(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool b__8_21(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 1); } internal float b__8_18(float originalValue, IncreaseDamageOnMultiKillItemDisplayUpdater self) { if ((Object)(object)self.body == (Object)null) { return 0f; } if ((Object)(object)self.body.inventory == (Object)null) { return 0f; } int itemCount = self.body.inventory.GetItemCount(Items.IncreaseDamageOnMultiKill); return baseTime + stackTime * (float)(itemCount - 1); } internal void b__8_4(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel val2 = default(ILLabel); if (val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchBle(x, ref val2), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 2) })) { Instruction next = val.Clone().GotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "IncreasePrimaryDamageBuff") }).Next; if (next != null) { val.Emit(OpCodes.Pop); val.Emit(OpCodes.Pop); val.Emit(OpCodes.Br, next); val.Emit(OpCodes.Ldc_R4, 0f); val.Emit(OpCodes.Ldc_R4, 0f); } else { Log.Error("Failed to find target instruction!"); } } else { Log.Error("IL Hook for Chronic Expansion refresh method failed!"); } } internal bool b__8_22(Instruction x) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBle(x, ref val); } internal bool b__8_23(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 2); } internal bool b__8_24(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 0); } internal bool b__8_25(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "IncreasePrimaryDamageBuff"); } internal void b__8_5(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); Instruction next = val.Clone().GotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchRet(x) }).Next; ILLabel val4 = default(ILLabel); FieldReference val3 = default(FieldReference); MethodReference val2 = default(MethodReference); if (val.TryGotoNext(new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val4), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, ref val3), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, ref val2), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { val.Emit(OpCodes.Pop); val.Emit(OpCodes.Br, next); val.Emit(OpCodes.Ldnull); } else { Log.Error("IL Hook for Chronic Expansion timeout sound effect failed!"); } } internal bool b__8_26(Instruction x) { return ILPatternMatchingExt.MatchRet(x); } internal bool b__8_27(Instruction x) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBrfalse(x, ref val); } internal bool b__8_28(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool b__8_29(Instruction x) { FieldReference val = default(FieldReference); return ILPatternMatchingExt.MatchLdfld(x, ref val); } internal bool b__8_30(Instruction x) { MethodReference val = default(MethodReference); return ILPatternMatchingExt.MatchCallvirt(x, ref val); } internal bool b__8_31(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } } private static readonly float baseKillDamage = PluginConfig.CEBaseKillDamage.Value; private static readonly float stackKillDamage = PluginConfig.CEStackKillDamage.Value; private static readonly int baseMaxKills = (int)PluginConfig.CEBaseMaxKills.Value; private static readonly int stackMaxKills = (int)PluginConfig.CEStackMaxKills.Value; private static readonly float baseTime = PluginConfig.CEBaseTime.Value; private static readonly float stackTime = PluginConfig.CEStackTime.Value; private static readonly bool refreshOnKill = PluginConfig.CERefreshMethod.Value; private static readonly bool beepBoop = PluginConfig.CEBeepBoop.Value; public static void ApplyChanges() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //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_0075: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00be: 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_00c9: Expected O, but got Unknown //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown Log.Debug("Chronic Expansion hooks intialised!"); object obj = <>c.<>9__8_0; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) ILCursor val16 = new ILCursor(il); if (val16.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 96), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, typeof(CharacterBody), "baseDamage") })) { val16.Emit(OpCodes.Ldarg_0); val16.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount4 = body.inventory.GetItemCount(Items.IncreaseDamageOnMultiKill); int buffCount = body.GetBuffCount(Buffs.IncreaseDamageBuff); return (itemCount4 > 0) ? ((baseKillDamage + stackKillDamage * (float)(itemCount4 - 1)) * (float)buffCount) : 0f; }); } else { Log.Error("SOTSNerf IL Hook for Kill Damage failed!"); } }; <>c.<>9__8_0 = val; obj = (object)val; } CharacterBody.RecalculateStats += (Manipulator)obj; object obj2 = <>c.<>9__8_1; if (obj2 == null) { Manipulator val2 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) ILCursor val15 = new ILCursor(il); if (val15.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchRet(x), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0), (Instruction x) => ILPatternMatchingExt.MatchRet(x) })) { val15.Emit(OpCodes.Ldarg_0); val15.EmitDelegate>((Func)delegate(int originalValue, CharacterBody body) { int itemCount3 = body.inventory.GetItemCount(Items.IncreaseDamageOnMultiKill); return baseMaxKills + stackMaxKills * (itemCount3 - 1); }); } else { Log.Error("SOTSNerf IL Hook for Base Max Kills failed!"); } }; <>c.<>9__8_1 = val2; obj2 = (object)val2; } CharacterBody.GetMaxIncreasedDamageMultiKillBuffsForCharacter += (Manipulator)obj2; object obj3 = <>c.<>9__8_2; if (obj3 == null) { Manipulator val3 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) ILCursor val14 = new ILCursor(il); if (val14.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(CharacterBody), "increasedDamageKillTimer"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1) })) { val14.Emit(OpCodes.Ldarg_0); val14.EmitDelegate>((Func)delegate(float originalValue, CharacterBody self) { if ((Object)(object)self == (Object)null) { return 0f; } if ((Object)(object)self.inventory == (Object)null) { return 0f; } int itemCount2 = self.inventory.GetItemCount(Items.IncreaseDamageOnMultiKill); return baseTime + stackTime * (float)(itemCount2 - 1); }); } else { Log.Error("IL Hook for Chronic Expansion timeout failed!"); } }; <>c.<>9__8_2 = val3; obj3 = (object)val3; } CharacterBody.AddIncreasedDamageMultiKillTime += (Manipulator)obj3; object obj4 = <>c.<>9__8_3; if (obj4 == null) { Manipulator val4 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) ILCursor val13 = new ILCursor(il); if (val13.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, typeof(IncreaseDamageOnMultiKillItemDisplayUpdater), "resetTime"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1) })) { val13.Emit(OpCodes.Ldarg_0); val13.EmitDelegate>((Func)delegate(float originalValue, IncreaseDamageOnMultiKillItemDisplayUpdater self) { if ((Object)(object)self.body == (Object)null) { return 0f; } if ((Object)(object)self.body.inventory == (Object)null) { return 0f; } int itemCount = self.body.inventory.GetItemCount(Items.IncreaseDamageOnMultiKill); return baseTime + stackTime * (float)(itemCount - 1); }); } else { Log.Info("IL Hook for Chronic Expansion visual timeout failed!"); } }; <>c.<>9__8_3 = val4; obj4 = (object)val4; } IncreaseDamageOnMultiKillItemDisplayUpdater.ctor += (Manipulator)obj4; if (refreshOnKill) { object obj5 = <>c.<>9__8_4; if (obj5 == null) { Manipulator val5 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) ILCursor val11 = new ILCursor(il); ILLabel val12 = default(ILLabel); if (val11.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchBle(x, ref val12), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 2) })) { Instruction next2 = val11.Clone().GotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "IncreasePrimaryDamageBuff") }).Next; if (next2 != null) { val11.Emit(OpCodes.Pop); val11.Emit(OpCodes.Pop); val11.Emit(OpCodes.Br, next2); val11.Emit(OpCodes.Ldc_R4, 0f); val11.Emit(OpCodes.Ldc_R4, 0f); } else { Log.Error("Failed to find target instruction!"); } } else { Log.Error("IL Hook for Chronic Expansion refresh method failed!"); } }; <>c.<>9__8_4 = val5; obj5 = (object)val5; } GlobalEventManager.ProcessHitEnemy += (Manipulator)obj5; } if (!beepBoop) { object obj6 = <>c.<>9__8_5; if (obj6 == null) { Manipulator val6 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) ILCursor val7 = new ILCursor(il); Instruction next = val7.Clone().GotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchRet(x) }).Next; ILLabel val10 = default(ILLabel); FieldReference val9 = default(FieldReference); MethodReference val8 = default(MethodReference); if (val7.TryGotoNext(new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val10), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, ref val9), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, ref val8), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { val7.Emit(OpCodes.Pop); val7.Emit(OpCodes.Br, next); val7.Emit(OpCodes.Ldnull); } else { Log.Error("IL Hook for Chronic Expansion timeout sound effect failed!"); } }; <>c.<>9__8_5 = val6; obj6 = (object)val6; } IncreaseDamageOnMultiKillItemDisplayUpdater.SetVisibleHologram += (Manipulator)obj6; } SeekersoftheStormNerfs.ReplaceItemDesc("ITEM_INCREASEDAMAGEONMULTIKILL_DESC", "Killing an enemy increases your damage by " + $"{baseKillDamage * 100f:0.##}% " + ((stackKillDamage != 0f) ? $"(+{stackKillDamage:P} per stack), " : "") + "up to " + $"{baseMaxKills} " + (((float)stackMaxKills != 0f) ? $"(+{stackMaxKills} per stack) " : "") + "time(s), for " + $"{baseTime:0.##}s " + ((stackTime != 0f) ? $"(+{stackTime:0.##}s per stack)." : ".") + (refreshOnKill ? " Killing an enemy refreshes the timer." : " Dealing damage refreshes the timer.")); } } internal static class ElectricBoomerang { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__8_3; public static Func <>9__8_4; public static Func <>9__8_5; public static Func <>9__8_6; public static Func <>9__8_7; public static Func <>9__8_1; public static Func <>9__8_8; public static Func <>9__8_9; public static Func <>9__8_10; public static Func <>9__8_2; public static Manipulator <>9__8_0; internal void b__8_0(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Expected O, but got Unknown //IL_0184: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "procCoefficient"), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 7), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, typeof(Util), "CheckRoll") })) { val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)delegate(float originalValue, DamageInfo damageInfo) { if (damageInfo == null) { return 0f; } if ((Object)(object)damageInfo.attacker == (Object)null) { return 0f; } if ((Object)(object)damageInfo.attacker.GetComponent() == (Object)null) { return 0f; } if ((Object)(object)damageInfo.attacker.GetComponent().inventory == (Object)null) { return 0f; } int itemCount2 = damageInfo.attacker.GetComponent().inventory.GetItemCount(Items.StunAndPierce); return baseHitChance * 100f + stackHitChance * 100f * (float)(itemCount2 - 1); }); } else { Log.Error("IL Hook for Electric Boomerang chance to hit failed!"); } ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 153), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "procChainMask") })) { val2.Emit(OpCodes.Ldarg_1); val2.EmitDelegate>((Func)delegate(float originalValue, DamageInfo damageInfo) { CharacterBody component = damageInfo.attacker.GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory)) { int itemCount = component.inventory.GetItemCount(Items.StunAndPierce); if (itemCount > 0) { return component.damage * (baseHitDamage + stackHitDamage * (float)(itemCount - 1)); } } return 0f; }); } else { Log.Error("IL Hook for Electric Boomerang damage failed!"); } } internal bool b__8_3(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 1); } internal bool b__8_4(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, "procCoefficient"); } internal bool b__8_5(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool b__8_6(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 7); } internal bool b__8_7(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, typeof(Util), "CheckRoll"); } internal float b__8_1(float originalValue, DamageInfo damageInfo) { if (damageInfo == null) { return 0f; } if ((Object)(object)damageInfo.attacker == (Object)null) { return 0f; } if ((Object)(object)damageInfo.attacker.GetComponent() == (Object)null) { return 0f; } if ((Object)(object)damageInfo.attacker.GetComponent().inventory == (Object)null) { return 0f; } int itemCount = damageInfo.attacker.GetComponent().inventory.GetItemCount(Items.StunAndPierce); return baseHitChance * 100f + stackHitChance * 100f * (float)(itemCount - 1); } internal bool b__8_8(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 153); } internal bool b__8_9(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 1); } internal bool b__8_10(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, "procChainMask"); } internal float b__8_2(float originalValue, DamageInfo damageInfo) { CharacterBody component = damageInfo.attacker.GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.inventory)) { int itemCount = component.inventory.GetItemCount(Items.StunAndPierce); if (itemCount > 0) { return component.damage * (baseHitDamage + stackHitDamage * (float)(itemCount - 1)); } } return 0f; } } private static readonly float travelSpeed = PluginConfig.EBTravelSpeed.Value; private static readonly float hitProcCoeff = PluginConfig.EBHitProcCoeff.Value; private static readonly float spinProcCoeff = PluginConfig.EBSpinProcCoeff.Value; private static readonly float baseHitDamage = PluginConfig.EBBaseHitDamage.Value; private static readonly float stackHitDamage = PluginConfig.EBStackHitDamage.Value; private static readonly float percSpinDamage = PluginConfig.EBPercSpinDamage.Value; private static readonly float baseHitChance = PluginConfig.EBBaseHitChance.Value; private static readonly float stackHitChance = PluginConfig.EBStackHitChance.Value; public static void ApplyChanges() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown Log.Info("Electric Boomerang Hooks initialised"); GameObject val = Addressables.LoadAssetAsync((object)"RoR2/DLC2/Items/StunAndPierce/StunAndPierceBoomerang.prefab").WaitForCompletion(); if ((Object)(object)val != (Object)null) { ProjectileOverlapAttack component = val.GetComponent(); ProjectileDotZone component2 = val.GetComponent(); BoomerangProjectile component3 = val.GetComponent(); component3.travelSpeed = travelSpeed; component.damageCoefficient = 1f; component.overlapProcCoefficient = hitProcCoeff; component2.damageCoefficient = percSpinDamage; Log.Info($"DoT Damage Coefficient is {component2.damageCoefficient}"); component2.overlapProcCoefficient = spinProcCoeff; } else { Log.Error("Game object does not exist!"); } object obj = <>c.<>9__8_0; if (obj == null) { Manipulator val2 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Expected O, but got Unknown //IL_0184: Unknown result type (might be due to invalid IL or missing references) ILCursor val3 = new ILCursor(il); if (val3.TryGotoNext(new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "procCoefficient"), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 7), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, typeof(Util), "CheckRoll") })) { val3.Emit(OpCodes.Ldarg_1); val3.EmitDelegate>((Func)delegate(float originalValue, DamageInfo damageInfo) { if (damageInfo == null) { return 0f; } if ((Object)(object)damageInfo.attacker == (Object)null) { return 0f; } if ((Object)(object)damageInfo.attacker.GetComponent() == (Object)null) { return 0f; } if ((Object)(object)damageInfo.attacker.GetComponent().inventory == (Object)null) { return 0f; } int itemCount2 = damageInfo.attacker.GetComponent().inventory.GetItemCount(Items.StunAndPierce); return baseHitChance * 100f + stackHitChance * 100f * (float)(itemCount2 - 1); }); } else { Log.Error("IL Hook for Electric Boomerang chance to hit failed!"); } ILCursor val4 = new ILCursor(il); if (val4.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 153), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "procChainMask") })) { val4.Emit(OpCodes.Ldarg_1); val4.EmitDelegate>((Func)delegate(float originalValue, DamageInfo damageInfo) { CharacterBody component4 = damageInfo.attacker.GetComponent(); if (Object.op_Implicit((Object)(object)component4) && Object.op_Implicit((Object)(object)component4.inventory)) { int itemCount = component4.inventory.GetItemCount(Items.StunAndPierce); if (itemCount > 0) { return component4.damage * (baseHitDamage + stackHitDamage * (float)(itemCount - 1)); } } return 0f; }); } else { Log.Error("IL Hook for Electric Boomerang damage failed!"); } }; <>c.<>9__8_0 = val2; obj = (object)val2; } GlobalEventManager.ProcessHitEnemy += (Manipulator)obj; SeekersoftheStormNerfs.ReplaceItemDesc("ITEM_STUNANDPIERCE_DESC", $"{baseHitChance * 100f:0.##}% chance " + ((stackHitChance != 0f) ? $"(+{stackHitChance * 100f:0.##}% per stack) " : "") + "on hit to fire an electric boomerang that slices through and stuns enemies, dealing " + $"{baseHitDamage * 100f:0.##}% base damage " + ((stackHitDamage != 0f) ? $"(+{stackHitDamage * 100f:0.##}% per stack) " : "") + "and rapidly deals " + $"{percSpinDamage * baseHitDamage * 100f:0.##}% base damage " + ((stackHitDamage != 0f) ? $"(+{percSpinDamage * stackHitDamage * 100f:0.##}% per stack) " : "") + "whilst intersecting with enemies. Can strike enemies on the return."); } } internal static class ElusiveAntlers { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__12_6; public static Func <>9__12_7; public static Func <>9__12_4; public static Func <>9__12_10; public static Func <>9__12_11; public static Func <>9__12_12; public static Func <>9__12_13; public static Func <>9__12_5; public static Manipulator <>9__12_0; public static Func <>9__12_16; public static Func <>9__12_17; public static Func <>9__12_14; public static Func <>9__12_18; public static Func <>9__12_19; public static Func <>9__12_15; public static Manipulator <>9__12_1; public static Func <>9__12_21; public static Func <>9__12_22; public static Func <>9__12_23; public static Func <>9__12_20; public static Manipulator <>9__12_2; public static Func <>9__12_25; public static Func <>9__12_26; public static Func <>9__12_24; public static Manipulator <>9__12_3; internal void b__12_0(ILContext il) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) <>c__DisplayClass12_0 CS$<>8__locals0 = new <>c__DisplayClass12_0 { getTeamComponent = AccessTools.PropertyGetter(typeof(CharacterBody), "teamComponent"), getTeamIndex = AccessTools.PropertyGetter(typeof(TeamComponent), "teamIndex") }; ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 87), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, CS$<>8__locals0.getTeamComponent), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, CS$<>8__locals0.getTeamIndex) })) { val.Emit(OpCodes.Ldloc, 87); val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(float moveSpeed, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount2 = body.inventory.GetItemCount(Items.SpeedBoostPickup); return moveSpeed + (baseMoveSpeed + stackMoveSpeed * (float)(itemCount2 - 1)); }); val.Emit(OpCodes.Stloc, 87); } else { Log.Error("IL Hook for Elusive Antlers Move Speed failed!"); } ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "ElusiveAntlersBuff"), (Instruction x) => ILPatternMatchingExt.MatchCall(x, "GetBuffCount"), (Instruction x) => ILPatternMatchingExt.MatchConvR4(x) })) { val2.Emit(OpCodes.Ldarg_0); val2.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount = body.inventory.GetItemCount(Items.SpeedBoostPickup); return (itemCount == 0) ? noStackWispMoveSpeed : (baseWispMoveSpeed + stackWispMoveSpeed * (float)(itemCount - 1)); }); } else { Log.Error("IL Hook for Elusive Antlers Wisp Move Speed!"); } } internal bool b__12_6(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 87); } internal bool b__12_7(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal float b__12_4(float moveSpeed, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount = body.inventory.GetItemCount(Items.SpeedBoostPickup); return moveSpeed + (baseMoveSpeed + stackMoveSpeed * (float)(itemCount - 1)); } internal bool b__12_10(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool b__12_11(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "ElusiveAntlersBuff"); } internal bool b__12_12(Instruction x) { return ILPatternMatchingExt.MatchCall(x, "GetBuffCount"); } internal bool b__12_13(Instruction x) { return ILPatternMatchingExt.MatchConvR4(x); } internal float b__12_5(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount = body.inventory.GetItemCount(Items.SpeedBoostPickup); if (itemCount == 0) { return noStackWispMoveSpeed; } return baseWispMoveSpeed + stackWispMoveSpeed * (float)(itemCount - 1); } internal void b__12_1(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchRet(x), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 3) })) { val.EmitDelegate>((Func)((int originalValue) => noStackMaxWisps)); } else { Log.Error("SOTSNerf IL Hook for Elusive Antlers Max Wisp Stacks with 0 stacks failed!"); } ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchRet(x) })) { int index = val2.Index; val2.Index = index + 1; val2.Emit(OpCodes.Ldarg_0); val2.EmitDelegate>((Func)delegate(int originalValue, CharacterBody body) { int itemCount = body.inventory.GetItemCount(Items.SpeedBoostPickup); return baseMaxWisps + stackMaxWisps * (itemCount - 1); }); } else { Log.Error("SOTSNerf IL Hook for Elusive Antlers Max Wisp Stacks for 1+ stacks failed!"); } } internal bool b__12_16(Instruction x) { return ILPatternMatchingExt.MatchRet(x); } internal bool b__12_17(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 3); } internal int b__12_14(int originalValue) { return noStackMaxWisps; } internal bool b__12_18(Instruction x) { return ILPatternMatchingExt.MatchAdd(x); } internal bool b__12_19(Instruction x) { return ILPatternMatchingExt.MatchRet(x); } internal int b__12_15(int originalValue, CharacterBody body) { int itemCount = body.inventory.GetItemCount(Items.SpeedBoostPickup); return baseMaxWisps + stackMaxWisps * (itemCount - 1); } internal void b__12_2(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "shardPickupBuffTimeSeconds"), (Instruction x) => ILPatternMatchingExt.MatchDup(x), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 60f) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body) { if (Object.op_Implicit((Object)(object)body.inventory)) { int itemCount = body.inventory.GetItemCount(Items.SpeedBoostPickup); if (itemCount == 0) { return 0f; } if (itemCount > 0) { return baseBuffDuration + stackBuffDuration * (float)(itemCount - 1); } } return 0f; }); } else { Log.Error("IL Hook for Elusive Antlers buff duration failed!"); } } internal bool b__12_21(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "shardPickupBuffTimeSeconds"); } internal bool b__12_22(Instruction x) { return ILPatternMatchingExt.MatchDup(x); } internal bool b__12_23(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 60f); } internal float b__12_20(float originalValue, CharacterBody body) { if (Object.op_Implicit((Object)(object)body.inventory)) { int itemCount = body.inventory.GetItemCount(Items.SpeedBoostPickup); if (itemCount == 0) { return 0f; } if (itemCount > 0) { return baseBuffDuration + stackBuffDuration * (float)(itemCount - 1); } } return 0f; } internal void b__12_3(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "spawnTimer"), (Instruction x) => ILPatternMatchingExt.MatchRet(x) })) { val.Emit(OpCodes.Ldarg, 0); val.EmitDelegate>((Func)delegate(float originalValue, ItemBehavior behaviour) { if ((Object)(object)behaviour != (Object)null && (Object)(object)behaviour.body != (Object)null) { CharacterBody body = behaviour.body; if ((Object)(object)body != (Object)null && (Object)(object)body.inventory != (Object)null) { int itemCount = body.inventory.GetItemCount(Items.SpeedBoostPickup); float num = Util.ConvertAmplificationPercentageIntoReductionNormalized(stackWispIntervalReduction * (float)(itemCount - 1)); return baseWispInterval - num; } } return baseWispInterval; }); } else { Log.Error("IL Hook for Elusive Antlers wisp interval failed!"); } } internal bool b__12_25(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "spawnTimer"); } internal bool b__12_26(Instruction x) { return ILPatternMatchingExt.MatchRet(x); } internal float b__12_24(float originalValue, ItemBehavior behaviour) { if ((Object)(object)behaviour != (Object)null && (Object)(object)behaviour.body != (Object)null) { CharacterBody body = behaviour.body; if ((Object)(object)body != (Object)null && (Object)(object)body.inventory != (Object)null) { int itemCount = body.inventory.GetItemCount(Items.SpeedBoostPickup); float num = Util.ConvertAmplificationPercentageIntoReductionNormalized(stackWispIntervalReduction * (float)(itemCount - 1)); return baseWispInterval - num; } } return baseWispInterval; } } [CompilerGenerated] private sealed class <>c__DisplayClass12_0 { public MethodBase getTeamComponent; public MethodBase getTeamIndex; internal bool b__8(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, getTeamComponent); } internal bool b__9(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, getTeamIndex); } } private static readonly float baseMoveSpeed = PluginConfig.EABaseMoveSpeed.Value; private static readonly float stackMoveSpeed = PluginConfig.EAStackMoveSpeed.Value; private static readonly float baseWispInterval = PluginConfig.EABaseWispInterval.Value; private static readonly float stackWispIntervalReduction = PluginConfig.EAStackWispIntervalReduction.Value; private static readonly float baseWispMoveSpeed = PluginConfig.EABaseWispMoveSpeed.Value; private static readonly float stackWispMoveSpeed = PluginConfig.EAStackWispMoveSpeed.Value; private static readonly int baseMaxWisps = (int)PluginConfig.EABaseMaxWisps.Value; private static readonly int stackMaxWisps = (int)PluginConfig.EAStackMaxWisps.Value; private static readonly float noStackWispMoveSpeed = PluginConfig.EANoStackWispMoveSpeed.Value; private static readonly int noStackMaxWisps = (int)PluginConfig.EANoStackMaxWisps.Value; private static readonly float baseBuffDuration = PluginConfig.EABaseBuffDuration.Value; private static readonly float stackBuffDuration = PluginConfig.EAStackBuffDuration.Value; public static void ApplyChanges() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //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_0075: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown Log.Info("Elusive Antlers hook initialised."); object obj = <>c.<>9__12_0; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) MethodBase getTeamComponent = AccessTools.PropertyGetter(typeof(CharacterBody), "teamComponent"); MethodBase getTeamIndex = AccessTools.PropertyGetter(typeof(TeamComponent), "teamIndex"); ILCursor val9 = new ILCursor(il); if (val9.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 87), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, getTeamComponent), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, getTeamIndex) })) { val9.Emit(OpCodes.Ldloc, 87); val9.Emit(OpCodes.Ldarg_0); val9.EmitDelegate>((Func)delegate(float moveSpeed, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount5 = body.inventory.GetItemCount(Items.SpeedBoostPickup); return moveSpeed + (baseMoveSpeed + stackMoveSpeed * (float)(itemCount5 - 1)); }); val9.Emit(OpCodes.Stloc, 87); } else { Log.Error("IL Hook for Elusive Antlers Move Speed failed!"); } ILCursor val10 = new ILCursor(il); if (val10.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "ElusiveAntlersBuff"), (Instruction x) => ILPatternMatchingExt.MatchCall(x, "GetBuffCount"), (Instruction x) => ILPatternMatchingExt.MatchConvR4(x) })) { val10.Emit(OpCodes.Ldarg_0); val10.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount4 = body.inventory.GetItemCount(Items.SpeedBoostPickup); return (itemCount4 == 0) ? noStackWispMoveSpeed : (baseWispMoveSpeed + stackWispMoveSpeed * (float)(itemCount4 - 1)); }); } else { Log.Error("IL Hook for Elusive Antlers Wisp Move Speed!"); } }; <>c.<>9__12_0 = val; obj = (object)val; } CharacterBody.RecalculateStats += (Manipulator)obj; object obj2 = <>c.<>9__12_1; if (obj2 == null) { Manipulator val2 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) ILCursor val7 = new ILCursor(il); if (val7.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchRet(x), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 3) })) { val7.EmitDelegate>((Func)((int originalValue) => noStackMaxWisps)); } else { Log.Error("SOTSNerf IL Hook for Elusive Antlers Max Wisp Stacks with 0 stacks failed!"); } ILCursor val8 = new ILCursor(il); if (val8.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchRet(x) })) { int index = val8.Index; val8.Index = index + 1; val8.Emit(OpCodes.Ldarg_0); val8.EmitDelegate>((Func)delegate(int originalValue, CharacterBody body) { int itemCount3 = body.inventory.GetItemCount(Items.SpeedBoostPickup); return baseMaxWisps + stackMaxWisps * (itemCount3 - 1); }); } else { Log.Error("SOTSNerf IL Hook for Elusive Antlers Max Wisp Stacks for 1+ stacks failed!"); } }; <>c.<>9__12_1 = val2; obj2 = (object)val2; } CharacterBody.GetElusiveAntlersCurrentMaxStack += (Manipulator)obj2; object obj3 = <>c.<>9__12_2; if (obj3 == null) { Manipulator val3 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) ILCursor val6 = new ILCursor(il); if (val6.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "shardPickupBuffTimeSeconds"), (Instruction x) => ILPatternMatchingExt.MatchDup(x), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 60f) })) { val6.Emit(OpCodes.Ldarg_0); val6.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body) { if (Object.op_Implicit((Object)(object)body.inventory)) { int itemCount2 = body.inventory.GetItemCount(Items.SpeedBoostPickup); if (itemCount2 == 0) { return 0f; } if (itemCount2 > 0) { return baseBuffDuration + stackBuffDuration * (float)(itemCount2 - 1); } } return 0f; }); } else { Log.Error("IL Hook for Elusive Antlers buff duration failed!"); } }; <>c.<>9__12_2 = val3; obj3 = (object)val3; } CharacterBody.SpawnShard += (Manipulator)obj3; object obj4 = <>c.<>9__12_3; if (obj4 == null) { Manipulator val4 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) ILCursor val5 = new ILCursor(il); if (val5.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "spawnTimer"), (Instruction x) => ILPatternMatchingExt.MatchRet(x) })) { val5.Emit(OpCodes.Ldarg, 0); val5.EmitDelegate>((Func)delegate(float originalValue, ItemBehavior behaviour) { if ((Object)(object)behaviour != (Object)null && (Object)(object)behaviour.body != (Object)null) { CharacterBody body2 = behaviour.body; if ((Object)(object)body2 != (Object)null && (Object)(object)body2.inventory != (Object)null) { int itemCount = body2.inventory.GetItemCount(Items.SpeedBoostPickup); float num = Util.ConvertAmplificationPercentageIntoReductionNormalized(stackWispIntervalReduction * (float)(itemCount - 1)); return baseWispInterval - num; } } return baseWispInterval; }); } else { Log.Error("IL Hook for Elusive Antlers wisp interval failed!"); } }; <>c.<>9__12_3 = val4; obj4 = (object)val4; } ElusiveAntlersBehavior.FixedUpdate += (Manipulator)obj4; SeekersoftheStormNerfs.ReplaceItemDesc("ITEM_SPEEDBOOSTPICKUP_DESC", "Increases movement speed by " + $"{baseMoveSpeed * 100f:0.##}% " + ((stackMoveSpeed != 0f) ? $"(+{stackMoveSpeed * 100f:0.##}% per stack), " : "") + "Spawns orbs of energy nearby every " + $"{baseWispInterval:0.##}s " + ((stackWispIntervalReduction != 0f) ? $"(-{stackWispIntervalReduction * 100f:0.##}% per stack), " : "") + "giving " + $"+{baseWispMoveSpeed * 100f:0.##}% movement speed " + ((stackWispMoveSpeed != 0f) ? $"(+{stackWispMoveSpeed * 100f:0.##}% per stack), " : "") + "up to " + $"{baseMaxWisps} " + (((float)stackMaxWisps != 0f) ? $"(+{stackMaxWisps} per stack) " : "") + "time(s) for " + $"{baseBuffDuration:0.##}s " + ((stackBuffDuration != 0f) ? $"(+{stackBuffDuration:0.##}s per stack)" : "")); } } internal static class GrowthNectar { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__5_3; public static Func <>9__5_4; public static Func <>9__5_5; public static Func <>9__5_1; public static Func <>9__5_6; public static Func <>9__5_7; public static Func <>9__5_8; public static Func <>9__5_2; public static Func <>9__5_10; public static Func <>9__5_11; public static Action <>9__5_9; public static Manipulator <>9__5_0; internal void b__5_0(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Expected O, but got Unknown //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 112), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount2 = body.inventory.GetItemCount(Items.BoostAllStats); int buffCount = body.GetBuffCount(Buffs.BoostAllStatsBuff); return (float)buffCount * (baseStatBuff + stackStatBuff * (float)(itemCount2 - 1)); }); } else { Log.Error("SOTSNerf IL Hook for Growth Nectar Base Stat Boost per Buff and Stat Boost Per Buff Per Stack failed! "); } ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "maxGrowthNectarBuffCount"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0) })) { val2.Emit(OpCodes.Ldarg_0); val2.EmitDelegate>((Func)delegate(int originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0; } if ((Object)(object)body.inventory == (Object)null) { return 0; } int itemCount = body.inventory.GetItemCount(Items.BoostAllStats); return baseBuffs + stackBuffs * (itemCount - 1); }); } else { Log.Error("IL Hook for Growth Nectar Base Max Buffs and Max Buffs Per Stack failed!"); } if (!affectAccel) { return; } <>c__DisplayClass5_0 CS$<>8__locals0 = new <>c__DisplayClass5_0(); ILCursor val3 = new ILCursor(il); CS$<>8__locals0.getMaxHealth = AccessTools.PropertyGetter(typeof(CharacterBody), "maxHealth"); CS$<>8__locals0.setMaxBonusHealth = AccessTools.PropertySetter(typeof(CharacterBody), "maxBonusHealth"); if (val3.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, CS$<>8__locals0.getMaxHealth), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, CS$<>8__locals0.setMaxBonusHealth) })) { val3.Emit(OpCodes.Ldloc, 112); val3.Emit(OpCodes.Ldarg_0); val3.EmitDelegate>((Action)delegate(float modifier, CharacterBody body) { if (Object.op_Implicit((Object)(object)body)) { body.acceleration += body.acceleration * modifier; } }); } else { Log.Error("IL Hook for Growth Nectar acceleration failed!"); } } internal bool b__5_3(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 112); } internal bool b__5_4(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool b__5_5(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal float b__5_1(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount = body.inventory.GetItemCount(Items.BoostAllStats); int buffCount = body.GetBuffCount(Buffs.BoostAllStatsBuff); return (float)buffCount * (baseStatBuff + stackStatBuff * (float)(itemCount - 1)); } internal bool b__5_6(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "maxGrowthNectarBuffCount"); } internal bool b__5_7(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool b__5_8(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 0); } internal int b__5_2(int originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0; } if ((Object)(object)body.inventory == (Object)null) { return 0; } int itemCount = body.inventory.GetItemCount(Items.BoostAllStats); return baseBuffs + stackBuffs * (itemCount - 1); } internal bool b__5_10(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool b__5_11(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal void b__5_9(float modifier, CharacterBody body) { if (Object.op_Implicit((Object)(object)body)) { body.acceleration += body.acceleration * modifier; } } } [CompilerGenerated] private sealed class <>c__DisplayClass5_0 { public MethodBase getMaxHealth; public MethodBase setMaxBonusHealth; internal bool b__12(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, getMaxHealth); } internal bool b__13(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, setMaxBonusHealth); } } private static readonly int baseBuffs = (int)PluginConfig.GNBaseBuffs.Value; private static readonly int stackBuffs = (int)PluginConfig.GNStackBuffs.Value; private static readonly float baseStatBuff = PluginConfig.GNBaseStatBuff.Value; private static readonly float stackStatBuff = PluginConfig.GNStackStatBuff.Value; private static readonly bool affectAccel = PluginConfig.GNEnableAccelBoost.Value; public static void ApplyChanges() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown Log.Info("Growth Nectar hooks initialised."); object obj = <>c.<>9__5_0; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Expected O, but got Unknown //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 112), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { val2.Emit(OpCodes.Ldarg_0); val2.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount2 = body.inventory.GetItemCount(Items.BoostAllStats); int buffCount = body.GetBuffCount(Buffs.BoostAllStatsBuff); return (float)buffCount * (baseStatBuff + stackStatBuff * (float)(itemCount2 - 1)); }); } else { Log.Error("SOTSNerf IL Hook for Growth Nectar Base Stat Boost per Buff and Stat Boost Per Buff Per Stack failed! "); } ILCursor val3 = new ILCursor(il); if (val3.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "maxGrowthNectarBuffCount"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0) })) { val3.Emit(OpCodes.Ldarg_0); val3.EmitDelegate>((Func)delegate(int originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0; } if ((Object)(object)body.inventory == (Object)null) { return 0; } int itemCount = body.inventory.GetItemCount(Items.BoostAllStats); return baseBuffs + stackBuffs * (itemCount - 1); }); } else { Log.Error("IL Hook for Growth Nectar Base Max Buffs and Max Buffs Per Stack failed!"); } if (affectAccel) { ILCursor val4 = new ILCursor(il); MethodBase getMaxHealth = AccessTools.PropertyGetter(typeof(CharacterBody), "maxHealth"); MethodBase setMaxBonusHealth = AccessTools.PropertySetter(typeof(CharacterBody), "maxBonusHealth"); if (val4.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, getMaxHealth), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, setMaxBonusHealth) })) { val4.Emit(OpCodes.Ldloc, 112); val4.Emit(OpCodes.Ldarg_0); val4.EmitDelegate>((Action)delegate(float modifier, CharacterBody body) { if (Object.op_Implicit((Object)(object)body)) { body.acceleration += body.acceleration * modifier; } }); } else { Log.Error("IL Hook for Growth Nectar acceleration failed!"); } } }; <>c.<>9__5_0 = val; obj = (object)val; } CharacterBody.RecalculateStats += (Manipulator)obj; SeekersoftheStormNerfs.ReplaceItemDesc("ITEM_BOOSTALLSTATS_DESC", $"Grants a {baseStatBuff * 100f:0.##}% " + ((stackStatBuff != 0f) ? $"(+{stackStatBuff * 100f:0.##}% per stack) " : "") + "increase to ALL stats for each buff, up to a maximum of " + $"{baseBuffs}" + ((stackBuffs != 0) ? $" (+{stackBuffs} per stack)." : ".")); } } internal class LuminousShot { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__11_4; public static Func <>9__11_5; public static Func <>9__11_6; public static Func <>9__11_3; public static Manipulator <>9__11_0; public static Func <>9__11_12; public static Func <>9__11_13; public static Func <>9__11_7; public static Func <>9__11_14; public static Func <>9__11_15; public static Func <>9__11_16; public static Func <>9__11_17; public static Func <>9__11_8; public static Func <>9__11_18; public static Func <>9__11_19; public static Func <>9__11_20; public static Func <>9__11_9; public static Func <>9__11_21; public static Func <>9__11_22; public static Func <>9__11_23; public static Func <>9__11_10; public static Func <>9__11_24; public static Func <>9__11_25; public static Func <>9__11_26; public static Func <>9__11_27; public static Func <>9__11_11; public static Manipulator <>9__11_1; public static Func <>9__11_29; public static Func <>9__11_30; public static Func <>9__11_31; public static Func <>9__11_28; public static Manipulator <>9__11_2; internal void b__11_0(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 1), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(int originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0; } if ((Object)(object)body.inventory == (Object)null) { return 0; } int itemCount = body.inventory.GetItemCount(Items.IncreasePrimaryDamage); return baseMaxCharges + stackMaxCharges * (itemCount - 1); }); } else { Log.Error("IL Hook for Luminous Shot max charges failed!"); } } internal bool b__11_4(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 1); } internal bool b__11_5(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 0); } internal bool b__11_6(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 1); } internal int b__11_3(int originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0; } if ((Object)(object)body.inventory == (Object)null) { return 0; } int itemCount = body.inventory.GetItemCount(Items.IncreasePrimaryDamage); return baseMaxCharges + stackMaxCharges * (itemCount - 1); } internal void b__11_1(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Expected O, but got Unknown //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Expected O, but got Unknown //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 22), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 3) })) { val.Index += 2; val.EmitDelegate>((Func)((int originalValue) => chargeThreshold)); } else { Log.Error("IL Hook for Luminous Shot charge requirement failed!"); } ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 142), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "ResetIncreasePrimaryDamage"), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1) })) { val2.Emit(OpCodes.Ldarg_1); val2.EmitDelegate>((Func)delegate(float originalValue, DamageInfo damageInfo) { if ((Object)(object)damageInfo.attacker == (Object)null) { return 0f; } if ((Object)(object)damageInfo.attacker.GetComponent() == (Object)null) { return 0f; } if ((Object)(object)damageInfo.attacker.GetComponent().inventory == (Object)null) { return 0f; } int itemCount = damageInfo.attacker.GetComponent().inventory.GetItemCount(Items.IncreasePrimaryDamage); return damageInfo.damage * (baseDamage + stackDamage * (float)(itemCount - 1)); }); } else { Log.Error("IL Hook for Luminous Shot Damage failed!"); } ILCursor val3 = new ILCursor(il); if (val3.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "radius"), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 146), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1) })) { val3.EmitDelegate>((Func)((float originalValue) => radius)); } else { Log.Error("IL Hook for Luminous Shot Radius failed!"); } ILCursor val4 = new ILCursor(il); if (val4.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "procCoefficient"), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 146), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.2f) })) { val4.EmitDelegate>((Func)((float originalValue) => procCoeff)); } else { Log.Error("IL Hook for Luminous Shot Proc Coefficient failed!"); } ILCursor val5 = new ILCursor(il); if (val5.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 144), (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "maxTimer") })) { val5.EmitDelegate>((Func)((float originalValue) => strikeDelay)); } else { Log.Error("IL Hook for Luminous Shot Delay failed!"); } } internal bool b__11_12(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 22); } internal bool b__11_13(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 3); } internal int b__11_7(int originalValue) { return chargeThreshold; } internal bool b__11_14(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 142); } internal bool b__11_15(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 0); } internal bool b__11_16(Instruction x) { return ILPatternMatchingExt.MatchCallvirt(x, "ResetIncreasePrimaryDamage"); } internal bool b__11_17(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 1); } internal float b__11_8(float originalValue, DamageInfo damageInfo) { if ((Object)(object)damageInfo.attacker == (Object)null) { return 0f; } if ((Object)(object)damageInfo.attacker.GetComponent() == (Object)null) { return 0f; } if ((Object)(object)damageInfo.attacker.GetComponent().inventory == (Object)null) { return 0f; } int itemCount = damageInfo.attacker.GetComponent().inventory.GetItemCount(Items.IncreasePrimaryDamage); return damageInfo.damage * (baseDamage + stackDamage * (float)(itemCount - 1)); } internal bool b__11_18(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "radius"); } internal bool b__11_19(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 146); } internal bool b__11_20(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 1); } internal float b__11_9(float originalValue) { return radius; } internal bool b__11_21(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "procCoefficient"); } internal bool b__11_22(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 146); } internal bool b__11_23(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 0.2f); } internal float b__11_10(float originalValue) { return procCoeff; } internal bool b__11_24(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 144); } internal bool b__11_25(Instruction x) { return ILPatternMatchingExt.MatchConvR4(x); } internal bool b__11_26(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool b__11_27(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "maxTimer"); } internal float b__11_11(float originalValue) { return strikeDelay; } internal void b__11_2(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 105), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 1f; } if ((Object)(object)body.inventory == (Object)null) { return 1f; } int itemCount = body.inventory.GetItemCount(Items.IncreasePrimaryDamage); float num = Util.ConvertAmplificationPercentageIntoReductionNormalized(baseCDR + stackCDR * (float)(itemCount - 1)); return 1f - num; }); } else { Log.Error("IL Hook for Luminous Shot Secondary Cooldown failed!"); } } internal bool b__11_29(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool b__11_30(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 105); } internal bool b__11_31(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal float b__11_28(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 1f; } if ((Object)(object)body.inventory == (Object)null) { return 1f; } int itemCount = body.inventory.GetItemCount(Items.IncreasePrimaryDamage); float num = Util.ConvertAmplificationPercentageIntoReductionNormalized(baseCDR + stackCDR * (float)(itemCount - 1)); return 1f - num; } } private static readonly int baseMaxCharges = (int)PluginConfig.LSBaseMaxCharges.Value; private static readonly int stackMaxCharges = (int)PluginConfig.LSStackMaxCharges.Value; private static readonly int chargeThreshold = (int)PluginConfig.LSChargeThreshold.Value; private static readonly float baseDamage = PluginConfig.LSBaseDamage.Value; private static readonly float stackDamage = PluginConfig.LSStackDamage.Value; private static readonly float baseCDR = PluginConfig.LSBaseCDR.Value; private static readonly float stackCDR = PluginConfig.LSStackCDR.Value; private static readonly float procCoeff = PluginConfig.LSProcCoeff.Value; private static readonly float strikeDelay = PluginConfig.LSStrikeDelay.Value; private static readonly float radius = PluginConfig.LSRadius.Value; private static readonly bool allSkillsCharge = PluginConfig.LSAllSkillsCharge.Value; public static void ApplyChanges() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0049: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown BuffDefStockThresholdIcon val = Addressables.LoadAssetAsync((object)"RoR2/DLC2/Items/IncreasePrimaryDamage/bdIncreasePrimaryDamageBuff.asset").WaitForCompletion(); val.IconThreshold = chargeThreshold; Log.Info("Luminous Shot hooks initialised."); object obj = <>c.<>9__11_0; if (obj == null) { Manipulator val2 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) ILCursor val11 = new ILCursor(il); if (val11.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 1), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1) })) { val11.Emit(OpCodes.Ldarg_0); val11.EmitDelegate>((Func)delegate(int originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0; } if ((Object)(object)body.inventory == (Object)null) { return 0; } int itemCount3 = body.inventory.GetItemCount(Items.IncreasePrimaryDamage); return baseMaxCharges + stackMaxCharges * (itemCount3 - 1); }); } else { Log.Error("IL Hook for Luminous Shot max charges failed!"); } }; <>c.<>9__11_0 = val2; obj = (object)val2; } CharacterBody.AddIncreasePrimaryDamageStack += (Manipulator)obj; object obj2 = <>c.<>9__11_1; if (obj2 == null) { Manipulator val3 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Expected O, but got Unknown //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Expected O, but got Unknown //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Expected O, but got Unknown ILCursor val6 = new ILCursor(il); if (val6.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 22), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 3) })) { val6.Index += 2; val6.EmitDelegate>((Func)((int originalValue) => chargeThreshold)); } else { Log.Error("IL Hook for Luminous Shot charge requirement failed!"); } ILCursor val7 = new ILCursor(il); if (val7.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 142), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "ResetIncreasePrimaryDamage"), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1) })) { val7.Emit(OpCodes.Ldarg_1); val7.EmitDelegate>((Func)delegate(float originalValue, DamageInfo damageInfo) { if ((Object)(object)damageInfo.attacker == (Object)null) { return 0f; } if ((Object)(object)damageInfo.attacker.GetComponent() == (Object)null) { return 0f; } if ((Object)(object)damageInfo.attacker.GetComponent().inventory == (Object)null) { return 0f; } int itemCount2 = damageInfo.attacker.GetComponent().inventory.GetItemCount(Items.IncreasePrimaryDamage); return damageInfo.damage * (baseDamage + stackDamage * (float)(itemCount2 - 1)); }); } else { Log.Error("IL Hook for Luminous Shot Damage failed!"); } ILCursor val8 = new ILCursor(il); if (val8.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "radius"), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 146), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1) })) { val8.EmitDelegate>((Func)((float originalValue) => radius)); } else { Log.Error("IL Hook for Luminous Shot Radius failed!"); } ILCursor val9 = new ILCursor(il); if (val9.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "procCoefficient"), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 146), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.2f) })) { val9.EmitDelegate>((Func)((float originalValue) => procCoeff)); } else { Log.Error("IL Hook for Luminous Shot Proc Coefficient failed!"); } ILCursor val10 = new ILCursor(il); if (val10.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 144), (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "maxTimer") })) { val10.EmitDelegate>((Func)((float originalValue) => strikeDelay)); } else { Log.Error("IL Hook for Luminous Shot Delay failed!"); } }; <>c.<>9__11_1 = val3; obj2 = (object)val3; } GlobalEventManager.ProcessHitEnemy += (Manipulator)obj2; object obj3 = <>c.<>9__11_2; if (obj3 == null) { Manipulator val4 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) ILCursor val5 = new ILCursor(il); if (val5.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 105), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { val5.Emit(OpCodes.Ldarg_0); val5.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 1f; } if ((Object)(object)body.inventory == (Object)null) { return 1f; } int itemCount = body.inventory.GetItemCount(Items.IncreasePrimaryDamage); float num = Util.ConvertAmplificationPercentageIntoReductionNormalized(baseCDR + stackCDR * (float)(itemCount - 1)); return 1f - num; }); } else { Log.Error("IL Hook for Luminous Shot Secondary Cooldown failed!"); } }; <>c.<>9__11_2 = val4; obj3 = (object)val4; } CharacterBody.RecalculateStats += (Manipulator)obj3; SeekersoftheStormNerfs.ReplaceItemDesc("ITEM_INCREASEPRIMARYDAMAGE_DESC", "Activating " + (allSkillsCharge ? "any non-Primary skill " : "Secondary skill ") + "stores up to " + $"{baseMaxCharges} charges" + (((float)stackMaxCharges != 0f) ? $" (+{stackMaxCharges} per stack). " : ". ") + $"Requires {chargeThreshold} charges for your " + "Primary skill to fire lightning srtikes, dealing " + $"{baseDamage * 100f:0.##}% TOTAL damage " + ((stackDamage != 0f) ? $"(+{stackDamage * 100f:0.##}% per stack) " : "") + "each. Reduces Secondary skill cooldown by " + baseCDR * 100f + "%" + ((stackCDR != 0f) ? $" (-{stackCDR * 100f:0.##}% per stack)." : ".")); } public static void UtilityAndSpecialCharge(orig_OnSkillActivated orig, CharacterBody self, GenericSkill skill) { if (allSkillsCharge && NetworkServer.active && self.inventory.GetItemCount(Items.IncreasePrimaryDamage) > 0 && ((Object)(object)skill == (Object)(object)self.skillLocator.utility || (Object)(object)skill == (Object)(object)self.skillLocator.special)) { self.AddIncreasePrimaryDamageStack(); } orig.Invoke(self, skill); } } internal static class NoxiousThorn { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__11_3; public static Func <>9__11_4; public static Func <>9__11_5; public static Func <>9__11_6; public static Func <>9__11_7; public static Func <>9__11_2; public static Manipulator <>9__11_0; public static Func <>9__11_11; public static Func <>9__11_12; public static Func <>9__11_13; public static Func <>9__11_14; public static Func <>9__11_15; public static Func <>9__11_8; public static Func <>9__11_16; public static Func <>9__11_17; public static Func <>9__11_18; public static Func <>9__11_9; public static Func <>9__11_19; public static Func <>9__11_20; public static Func <>9__11_21; public static Func <>9__11_22; public static Func <>9__11_10; public static Manipulator <>9__11_1; internal void b__11_0(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchCall(x, "set_bleedChance"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "baseVisionDistance") })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount = body.inventory.GetItemCount(Items.TriggerEnemyDebuffs); return baseBleedChance * 100f + stackBleedChance * 100f * (float)(itemCount - 1); }); } else { Log.Error("IL Hook for Noxious Thorn Bleed Chance failed!"); } } internal bool b__11_3(Instruction x) { return ILPatternMatchingExt.MatchAdd(x); } internal bool b__11_4(Instruction x) { return ILPatternMatchingExt.MatchCall(x, "set_bleedChance"); } internal bool b__11_5(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool b__11_6(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool b__11_7(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, "baseVisionDistance"); } internal float b__11_2(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount = body.inventory.GetItemCount(Items.TriggerEnemyDebuffs); return baseBleedChance * 100f + stackBleedChance * 100f * (float)(itemCount - 1); } internal void b__11_1(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Expected O, but got Unknown //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Expected O, but got Unknown //IL_026a: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchCall(x, "CeilToInt"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 10), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 11) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount3 = body.inventory.GetItemCount(Items.TriggerEnemyDebuffs); return baseDebuffTransfer + stackDebuffTransfer * (float)(itemCount3 - 1); }); } else { Log.Error("IL Hook for Noxious Thorn Buff Stack Transfer Percentage failed!"); } ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "radius"), (Instruction x) => ILPatternMatchingExt.MatchDup(x), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0) })) { val2.Emit(OpCodes.Ldarg_0); val2.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount2 = body.inventory.GetItemCount(Items.TriggerEnemyDebuffs); return baseRange + stackRange * (float)(itemCount2 - 1); }); } else { Log.Error("IL Hook for Noxious Thorn buff transfer range failed!"); } ILCursor val3 = new ILCursor(il); ILLabel val4 = default(ILLabel); if (val3.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 4), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 17), (Instruction x) => ILPatternMatchingExt.MatchBr(x, ref val4) })) { val3.Emit(OpCodes.Ldarg_0); val3.EmitDelegate>((Func)delegate(int originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0; } if ((Object)(object)body.inventory == (Object)null) { return 0; } int itemCount = body.inventory.GetItemCount(Items.TriggerEnemyDebuffs); return baseBodies + stackBodies * (itemCount - 1); }); } else { Log.Error("IL Hook for Noxious Thorn number of enemies failed!"); } } internal bool b__11_11(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool b__11_12(Instruction x) { return ILPatternMatchingExt.MatchCall(x, "CeilToInt"); } internal bool b__11_13(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 10); } internal bool b__11_14(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 0); } internal bool b__11_15(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 11); } internal float b__11_8(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount = body.inventory.GetItemCount(Items.TriggerEnemyDebuffs); return baseDebuffTransfer + stackDebuffTransfer * (float)(itemCount - 1); } internal bool b__11_16(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "radius"); } internal bool b__11_17(Instruction x) { return ILPatternMatchingExt.MatchDup(x); } internal bool b__11_18(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 0); } internal float b__11_9(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount = body.inventory.GetItemCount(Items.TriggerEnemyDebuffs); return baseRange + stackRange * (float)(itemCount - 1); } internal bool b__11_19(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 4); } internal bool b__11_20(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 0); } internal bool b__11_21(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 17); } internal bool b__11_22(Instruction x) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBr(x, ref val); } internal int b__11_10(int originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0; } if ((Object)(object)body.inventory == (Object)null) { return 0; } int itemCount = body.inventory.GetItemCount(Items.TriggerEnemyDebuffs); return baseBodies + stackBodies * (itemCount - 1); } } private static readonly float baseBleedChance = PluginConfig.NTBaseBleedChance.Value; private static readonly float stackBleedChance = PluginConfig.NTStackBleedChance.Value; private static readonly bool enableBurn = PluginConfig.NTEnableBurn.Value; private static readonly float baseBurnChance = PluginConfig.NTBaseBurnChance.Value; private static readonly float stackBurnChance = PluginConfig.NTStackBurnChance.Value; private static readonly float baseDebuffTransfer = PluginConfig.NTBaseDebuffTransfer.Value; private static readonly float stackDebuffTransfer = PluginConfig.NTStackDebuffTransfer.Value; private static readonly int baseBodies = (int)PluginConfig.NTBaseBodies.Value; private static readonly int stackBodies = (int)PluginConfig.NTStackBodies.Value; private static readonly float baseRange = PluginConfig.NTBaseRange.Value; private static readonly float stackRange = PluginConfig.NTStackRange.Value; public static void ApplyChanges() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown Log.Info("Noxious Thorn hooks initialised."); object obj = <>c.<>9__11_0; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) ILCursor val7 = new ILCursor(il); if (val7.TryGotoNext(new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchCall(x, "set_bleedChance"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "baseVisionDistance") })) { val7.Emit(OpCodes.Ldarg_0); val7.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount4 = body.inventory.GetItemCount(Items.TriggerEnemyDebuffs); return baseBleedChance * 100f + stackBleedChance * 100f * (float)(itemCount4 - 1); }); } else { Log.Error("IL Hook for Noxious Thorn Bleed Chance failed!"); } }; <>c.<>9__11_0 = val; obj = (object)val; } CharacterBody.RecalculateStats += (Manipulator)obj; object obj2 = <>c.<>9__11_1; if (obj2 == null) { Manipulator val2 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Expected O, but got Unknown //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Expected O, but got Unknown //IL_026a: Unknown result type (might be due to invalid IL or missing references) ILCursor val3 = new ILCursor(il); if (val3.TryGotoNext(new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchCall(x, "CeilToInt"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 10), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 11) })) { val3.Emit(OpCodes.Ldarg_0); val3.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount3 = body.inventory.GetItemCount(Items.TriggerEnemyDebuffs); return baseDebuffTransfer + stackDebuffTransfer * (float)(itemCount3 - 1); }); } else { Log.Error("IL Hook for Noxious Thorn Buff Stack Transfer Percentage failed!"); } ILCursor val4 = new ILCursor(il); if (val4.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "radius"), (Instruction x) => ILPatternMatchingExt.MatchDup(x), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0) })) { val4.Emit(OpCodes.Ldarg_0); val4.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount2 = body.inventory.GetItemCount(Items.TriggerEnemyDebuffs); return baseRange + stackRange * (float)(itemCount2 - 1); }); } else { Log.Error("IL Hook for Noxious Thorn buff transfer range failed!"); } ILCursor val5 = new ILCursor(il); ILLabel val6 = default(ILLabel); if (val5.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 4), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 0), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 17), (Instruction x) => ILPatternMatchingExt.MatchBr(x, ref val6) })) { val5.Emit(OpCodes.Ldarg_0); val5.EmitDelegate>((Func)delegate(int originalValue, CharacterBody body) { if ((Object)(object)body == (Object)null) { return 0; } if ((Object)(object)body.inventory == (Object)null) { return 0; } int itemCount = body.inventory.GetItemCount(Items.TriggerEnemyDebuffs); return baseBodies + stackBodies * (itemCount - 1); }); } else { Log.Error("IL Hook for Noxious Thorn number of enemies failed!"); } }; <>c.<>9__11_1 = val2; obj2 = (object)val2; } CharacterBody.TriggerEnemyDebuffs += (Manipulator)obj2; SeekersoftheStormNerfs.ReplaceItemDesc("ITEM_TRIGGERENEMYDEBUFFS_DESC", $"Gain {baseBleedChance * 100f:0.##}% " + ((stackBleedChance != 0f) ? $"(+{stackBleedChance * 100f:0.##}% per stack) " : "") + "chance to bleed " + (enableBurn ? ($"and {baseBurnChance * 100f:0.##}% chance " + ((stackBurnChance != 0f) ? $"(+{stackBurnChance * 100f:0.##}% per stack) " : "") + "to burn ") : "") + "enemies on hit. On killing an enemy, " + $"transfer {baseDebuffTransfer * 100f:0.##}% " + ((stackDebuffTransfer != 0f) ? $"(+{stackDebuffTransfer * 100f:0.##}% per stack) " : "") + "of every debuff stack to " + $"{baseBodies}" + ((baseBodies == 1) ? " enemy" : " enemies") + " " + (((float)stackBodies != 0f) ? $"(+{stackBodies} per stack) " : "") + "within " + $"{baseRange:0.##}m" + ((stackRange != 0f) ? $" (+{stackRange:0.##}m per stack)." : ".")); } public static void CheckForNoxiousThornBurn(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Invalid comparison between Unknown and I4 //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, damageInfo); if (!(Object.op_Implicit((Object)(object)damageInfo.attacker) & enableBurn) || (int)DamageTypeCombo.op_Implicit(damageInfo.damageType) == 67108864) { return; } CharacterBody component = damageInfo.attacker.GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.inventory)) { return; } int itemCount = component.inventory.GetItemCount(Items.TriggerEnemyDebuffs); if (itemCount > 0 && Util.CheckRoll((baseBurnChance * 100f + stackBurnChance * 100f * (float)(itemCount - 1)) * damageInfo.procCoefficient, 0f, (CharacterMaster)null)) { InflictDotInfo val = default(InflictDotInfo); val.victimObject = ((Component)self).gameObject; val.attackerObject = damageInfo.attacker; val.totalDamage = 1.2f * component.baseDamage; val.dotIndex = (DotIndex)1; val.damageMultiplier = 1f; InflictDotInfo val2 = val; if (Object.op_Implicit((Object)(object)component.inventory)) { StrengthenBurnUtils.CheckDotForUpgrade(component.inventory, ref val2); } DotController.InflictDot(ref val2); } } } internal static class PrayerBeads { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__5_4; public static Func <>9__5_5; public static Func <>9__5_6; public static Func <>9__5_7; public static Func <>9__5_8; public static Func <>9__5_9; public static Func <>9__5_10; public static Manipulator <>9__5_0; public static Func <>9__5_12; public static Func <>9__5_13; public static Func <>9__5_14; public static Func <>9__5_15; public static Func <>9__5_16; public static Func <>9__5_11; public static Manipulator <>9__5_1; internal void b__5_0(ILContext il) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) <>c__DisplayClass5_0 CS$<>8__locals0 = new <>c__DisplayClass5_0 { levelUpBuffCount = 0 }; ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.2f) })) { val.EmitDelegate>((Func)delegate(int originalValue) { CS$<>8__locals0.levelUpBuffCount = originalValue; Log.Debug("Successfully retreieved levelUpBuffCount!"); return originalValue; }); } else { Log.Error("IL Hook to retrieve levelUpBuffCount failed!"); } ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 2), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 2) })) { val2.Emit(OpCodes.Ldarg_0); val2.Emit(OpCodes.Ldarg_1); val2.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body, float levelStat) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount = body.inventory.GetItemCount(Items.ExtraStatsOnLevelUp); return calcBasedOnBeadsRemoved ? ((float)CS$<>8__locals0.levelUpBuffCount * levelStat * (baseStatBonus + stackStatBonus * (float)(body.extraStatsOnLevelUpCount_CachedLastApplied - itemCount - 1))) : ((float)CS$<>8__locals0.levelUpBuffCount * levelStat * (baseStatBonus + stackStatBonus * (float)(body.extraStatsOnLevelUpCount_CachedLastApplied - 1))); }); } else { Log.Error("IL Hook to chance Prayer Beads level up stats failed!"); } } internal bool b__5_4(Instruction x) { return ILPatternMatchingExt.MatchConvR4(x); } internal bool b__5_5(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 1); } internal bool b__5_6(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool b__5_7(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 0.2f); } internal bool b__5_8(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 0); } internal bool b__5_9(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 2); } internal bool b__5_10(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 2); } internal void b__5_1(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1), (Instruction x) => ILPatternMatchingExt.MatchSub(x), (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchMul(x) })) { val.EmitDelegate>((Func)((float originalValue) => 0f)); } else { Log.Error("IL Hook for Prayer Beads Experience Gain failed!"); } } internal bool b__5_12(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 0); } internal bool b__5_13(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 1); } internal bool b__5_14(Instruction x) { return ILPatternMatchingExt.MatchSub(x); } internal bool b__5_15(Instruction x) { return ILPatternMatchingExt.MatchConvR4(x); } internal bool b__5_16(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal float b__5_11(float originalValue) { return 0f; } } [CompilerGenerated] private sealed class <>c__DisplayClass5_0 { public int levelUpBuffCount; internal int b__2(int originalValue) { levelUpBuffCount = originalValue; Log.Debug("Successfully retreieved levelUpBuffCount!"); return originalValue; } internal float b__3(float originalValue, CharacterBody body, float levelStat) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount = body.inventory.GetItemCount(Items.ExtraStatsOnLevelUp); if (calcBasedOnBeadsRemoved) { return (float)levelUpBuffCount * levelStat * (baseStatBonus + stackStatBonus * (float)(body.extraStatsOnLevelUpCount_CachedLastApplied - itemCount - 1)); } return (float)levelUpBuffCount * levelStat * (baseStatBonus + stackStatBonus * (float)(body.extraStatsOnLevelUpCount_CachedLastApplied - 1)); } } private static readonly float baseExpGain = PluginConfig.PBBaseExpGain.Value; private static readonly float stackExpGain = PluginConfig.PBStackExpGain.Value; private static readonly float baseStatBonus = PluginConfig.PBBaseStatBonus.Value; private static readonly float stackStatBonus = PluginConfig.PBStackStatBonus.Value; private static readonly bool calcBasedOnBeadsRemoved = PluginConfig.PBCalcBasedOnBeadsRemoved.Value; public static void ApplyChanges() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0036: 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_0041: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Expected O, but got Unknown Log.Info("Prayer beads hooks initialised."); MethodInfo anonymousMethod = SeekersoftheStormNerfs.GetAnonymousMethod(typeof(CharacterBody), "CalculateAppliedBeadStats"); object obj = <>c.<>9__5_0; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) int levelUpBuffCount = 0; ILCursor val5 = new ILCursor(il); if (val5.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0.2f) })) { val5.EmitDelegate>((Func)delegate(int originalValue) { levelUpBuffCount = originalValue; Log.Debug("Successfully retreieved levelUpBuffCount!"); return originalValue; }); } else { Log.Error("IL Hook to retrieve levelUpBuffCount failed!"); } ILCursor val6 = new ILCursor(il); if (val6.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 2), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 2) })) { val6.Emit(OpCodes.Ldarg_0); val6.Emit(OpCodes.Ldarg_1); val6.EmitDelegate>((Func)delegate(float originalValue, CharacterBody body, float levelStat) { if ((Object)(object)body == (Object)null) { return 0f; } if ((Object)(object)body.inventory == (Object)null) { return 0f; } int itemCount = body.inventory.GetItemCount(Items.ExtraStatsOnLevelUp); return calcBasedOnBeadsRemoved ? ((float)levelUpBuffCount * levelStat * (baseStatBonus + stackStatBonus * (float)(body.extraStatsOnLevelUpCount_CachedLastApplied - itemCount - 1))) : ((float)levelUpBuffCount * levelStat * (baseStatBonus + stackStatBonus * (float)(body.extraStatsOnLevelUpCount_CachedLastApplied - 1))); }); } else { Log.Error("IL Hook to chance Prayer Beads level up stats failed!"); } }; <>c.<>9__5_0 = val; obj = (object)val; } ILHook val2 = new ILHook((MethodBase)anonymousMethod, (Manipulator)obj); val2.Apply(); object obj2 = <>c.<>9__5_1; if (obj2 == null) { Manipulator val3 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val4 = new ILCursor(il); if (val4.TryGotoNext(new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1), (Instruction x) => ILPatternMatchingExt.MatchSub(x), (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchMul(x) })) { val4.EmitDelegate>((Func)((float originalValue) => 0f)); } else { Log.Error("IL Hook for Prayer Beads Experience Gain failed!"); } }; <>c.<>9__5_1 = val3; obj2 = (object)val3; } CharacterMaster.TrackBeadExperience += (Manipulator)obj2; SeekersoftheStormNerfs.ReplaceItemDesc("ITEM_EXTRASTATSONLEVELUP_DESC", "On gaining experience, this item also gains " + $"{baseExpGain * 100f:0.##}% " + ((stackExpGain != 0f) ? $"(+{stackExpGain * 100f:0.##}% per stack) " : "") + "experience. Each time this item levels, it stores " + $"{baseStatBonus * 100f:0.##}% " + ((stackStatBonus != 0f) ? $"(+{stackStatBonus * 100f:0.##}% per stack) " : "") + "of your level-up bonus from the following stats: Health, Regeneration and Base Damage. Upon removal, gain all stored stats " + (calcBasedOnBeadsRemoved ? "for each stack removed." : "for each stack you had before removal.")); } public static void ChangeBeadExpGain(orig_TrackBeadExperience orig, CharacterMaster self, ulong amount) { CharacterBody body = self.GetBody(); int itemCount = body.inventory.GetItemCount(Items.ExtraStatsOnLevelUp); float num = amount; ulong num2 = (ulong)(num * baseExpGain + num * stackExpGain * (float)(itemCount - 1)); orig.Invoke(self, num2); } } internal static class RunicLens { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__13_9; public static Func <>9__13_10; public static Func <>9__13_11; public static Func <>9__13_12; public static Func <>9__13_4; public static Func <>9__13_13; public static Func <>9__13_14; public static Func <>9__13_15; public static Func <>9__13_16; public static Func <>9__13_5; public static Func <>9__13_17; public static Func <>9__13_18; public static Func <>9__13_19; public static Func <>9__13_20; public static Func <>9__13_6; public static Func <>9__13_7; public static Func <>9__13_21; public static Func <>9__13_22; public static Func <>9__13_8; public static Manipulator <>9__13_0; public static Func <>9__13_23; public static Func <>9__13_24; public static Func <>9__13_25; public static Manipulator <>9__13_1; public static Func <>9__13_29; public static Func <>9__13_30; public static Func <>9__13_31; public static Func <>9__13_26; public static Func <>9__13_27; public static Func <>9__13_32; public static Func <>9__13_33; public static Func <>9__13_34; public static Func <>9__13_28; public static Manipulator <>9__13_2; public static Func <>9__13_37; public static Func <>9__13_38; public static Func <>9__13_39; public static Func <>9__13_35; public static Func <>9__13_40; public static Func <>9__13_36; public static Manipulator <>9__13_3; internal void b__13_0(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Expected O, but got Unknown //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Expected O, but got Unknown //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 149), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 149), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 150) })) { val.Emit(OpCodes.Ldloc, 23); val.EmitDelegate>((Func)((float originalValue, int itemCount) => baseThresholdChance * 100f + stackThresholdChance * 100f * (float)(itemCount - 1))); } else { Log.Error("IL Hook for Runic Lens Overspill Chance to hit failed!"); } ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 150), (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 151), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 151) })) { val2.Emit(OpCodes.Ldloc, 20); val2.EmitDelegate>((Func)((float originalValue, int itemCount) => baseChance * 100f + stackChance * 100f * (float)(itemCount - 1))); } else { Log.Error("IL Hook for Runic Lens Chance to hit failed!"); } ILCursor val3 = new ILCursor(il); ILLabel val5 = default(ILLabel); if (val3.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchBleUn(x, ref val5), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 75f), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 151), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 151) })) { val3.EmitDelegate>((Func)((float originalValue) => chanceCap * 100f)); val3.Index += 2; val3.EmitDelegate>((Func)((float originalValue) => chanceCap * 100f)); } else { Log.Info("IL Hook for Chance to hit cap failed!"); } ILCursor val4 = new ILCursor(il); if (val4.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "scale"), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1) })) { val4.EmitDelegate>((Func)((float originalValue) => areaOfEffect)); } else { Log.Error("IL Hook for Meteor scale failed!"); } } internal bool b__13_9(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 149); } internal bool b__13_10(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 149); } internal bool b__13_11(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool b__13_12(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 150); } internal float b__13_4(float originalValue, int itemCount) { return baseThresholdChance * 100f + stackThresholdChance * 100f * (float)(itemCount - 1); } internal bool b__13_13(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 150); } internal bool b__13_14(Instruction x) { return ILPatternMatchingExt.MatchAdd(x); } internal bool b__13_15(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 151); } internal bool b__13_16(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 151); } internal float b__13_5(float originalValue, int itemCount) { return baseChance * 100f + stackChance * 100f * (float)(itemCount - 1); } internal bool b__13_17(Instruction x) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBleUn(x, ref val); } internal bool b__13_18(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 75f); } internal bool b__13_19(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 151); } internal bool b__13_20(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 151); } internal float b__13_6(float originalValue) { return chanceCap * 100f; } internal float b__13_7(float originalValue) { return chanceCap * 100f; } internal bool b__13_21(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "scale"); } internal bool b__13_22(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 1); } internal float b__13_8(float originalValue) { return areaOfEffect; } internal void b__13_1(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchDiv(x), (Instruction x) => ILPatternMatchingExt.MatchConvI4(x), (Instruction x) => ILPatternMatchingExt.MatchRet(x) })) { val.Emit(OpCodes.Ldc_R4, threshold); val.Emit(OpCodes.Mul); } else { Log.Error("IL Hook for Overspill threshold failed!"); } } internal bool b__13_23(Instruction x) { return ILPatternMatchingExt.MatchDiv(x); } internal bool b__13_24(Instruction x) { return ILPatternMatchingExt.MatchConvI4(x); } internal bool b__13_25(Instruction x) { return ILPatternMatchingExt.MatchRet(x); } internal void b__13_2(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 3), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 3), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 75f) })) { val.Emit(OpCodes.Ldarg_1); val.Emit(OpCodes.Ldarg_2); val.EmitDelegate>((Func)delegate(float originalValue, int thresholdCoeff, int itemCount) { float num = baseDamage + stackDamage * (float)(itemCount - 1); float num2 = baseThresholdDamage + stackThresholdDamage * (float)(itemCount - 1); return num + num2 * (float)thresholdCoeff; }); val.Index += 3; val.EmitDelegate>((Func)((float originalValue) => damageCap * 100f)); } else { Log.Error("IL Hook for Damage and Cap (conditional check) failed!"); } ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 3), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "attackerBody") })) { val2.EmitDelegate>((Func)((float originalValue) => damageCap * 100f)); } } internal bool b__13_29(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 3); } internal bool b__13_30(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 3); } internal bool b__13_31(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 75f); } internal float b__13_26(float originalValue, int thresholdCoeff, int itemCount) { float num = baseDamage + stackDamage * (float)(itemCount - 1); float num2 = baseThresholdDamage + stackThresholdDamage * (float)(itemCount - 1); return num + num2 * (float)thresholdCoeff; } internal float b__13_27(float originalValue) { return damageCap * 100f; } internal bool b__13_32(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 3); } internal bool b__13_33(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool b__13_34(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, "attackerBody"); } internal float b__13_28(float originalValue) { return damageCap * 100f; } internal void b__13_3(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "procCoefficient"), (Instruction x) => ILPatternMatchingExt.MatchDup(x), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { val.EmitDelegate>((Func)((float originalValue) => procCoeff)); } else { Log.Error("IL Hook for Proc Coefficient failed!"); } ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "radius") })) { val2.EmitDelegate>((Func)((float originalValue) => areaOfEffect)); } else { Log.Error("IL Hook for damage radius failed!"); } } internal bool b__13_37(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "procCoefficient"); } internal bool b__13_38(Instruction x) { return ILPatternMatchingExt.MatchDup(x); } internal bool b__13_39(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal float b__13_35(float originalValue) { return procCoeff; } internal bool b__13_40(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "radius"); } internal float b__13_36(float originalValue) { return areaOfEffect; } } private static readonly float baseChance = PluginConfig.RLBaseChance.Value; private static readonly float stackChance = PluginConfig.RLStackChance.Value; private static readonly float baseDamage = PluginConfig.RLBaseDamage.Value; private static readonly float stackDamage = PluginConfig.RLStackDamage.Value; private static readonly float threshold = PluginConfig.RLThreshold.Value; private static readonly float baseThresholdChance = PluginConfig.RLBaseThresholdChance.Value; private static readonly float stackThresholdChance = PluginConfig.RLStackThresholdChance.Value; private static readonly float chanceCap = PluginConfig.RLChanceCap.Value; private static readonly float baseThresholdDamage = PluginConfig.RLBaseThresholdDamage.Value; private static readonly float stackThresholdDamage = PluginConfig.RLStackThresholdDamage.Value; private static readonly float damageCap = PluginConfig.RLChanceCap.Value; private static readonly float areaOfEffect = PluginConfig.RLAoE.Value; private static readonly float procCoeff = PluginConfig.RLProcCoeff.Value; public static void ApplyChanges() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //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_0075: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown Log.Info("Runic lens hooks initialised."); object obj = <>c.<>9__13_0; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Expected O, but got Unknown //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Expected O, but got Unknown //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Expected O, but got Unknown ILCursor val10 = new ILCursor(il); if (val10.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 149), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 149), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 150) })) { val10.Emit(OpCodes.Ldloc, 23); val10.EmitDelegate>((Func)((float originalValue, int itemCount) => baseThresholdChance * 100f + stackThresholdChance * 100f * (float)(itemCount - 1))); } else { Log.Error("IL Hook for Runic Lens Overspill Chance to hit failed!"); } ILCursor val11 = new ILCursor(il); if (val11.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 150), (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 151), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 151) })) { val11.Emit(OpCodes.Ldloc, 20); val11.EmitDelegate>((Func)((float originalValue, int itemCount) => baseChance * 100f + stackChance * 100f * (float)(itemCount - 1))); } else { Log.Error("IL Hook for Runic Lens Chance to hit failed!"); } ILCursor val12 = new ILCursor(il); ILLabel val14 = default(ILLabel); if (val12.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchBleUn(x, ref val14), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 75f), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 151), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 151) })) { val12.EmitDelegate>((Func)((float originalValue) => chanceCap * 100f)); val12.Index += 2; val12.EmitDelegate>((Func)((float originalValue) => chanceCap * 100f)); } else { Log.Info("IL Hook for Chance to hit cap failed!"); } ILCursor val13 = new ILCursor(il); if (val13.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "scale"), (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 1) })) { val13.EmitDelegate>((Func)((float originalValue) => areaOfEffect)); } else { Log.Error("IL Hook for Meteor scale failed!"); } }; <>c.<>9__13_0 = val; obj = (object)val; } GlobalEventManager.ProcessHitEnemy += (Manipulator)obj; object obj2 = <>c.<>9__13_1; if (obj2 == null) { Manipulator val2 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) ILCursor val9 = new ILCursor(il); if (val9.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchDiv(x), (Instruction x) => ILPatternMatchingExt.MatchConvI4(x), (Instruction x) => ILPatternMatchingExt.MatchRet(x) })) { val9.Emit(OpCodes.Ldc_R4, threshold); val9.Emit(OpCodes.Mul); } else { Log.Error("IL Hook for Overspill threshold failed!"); } }; <>c.<>9__13_1 = val2; obj2 = (object)val2; } MeteorAttackOnHighDamageUtil.CalculateOverspill += (Manipulator)obj2; object obj3 = <>c.<>9__13_2; if (obj3 == null) { Manipulator val3 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown ILCursor val7 = new ILCursor(il); if (val7.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 3), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 3), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 75f) })) { val7.Emit(OpCodes.Ldarg_1); val7.Emit(OpCodes.Ldarg_2); val7.EmitDelegate>((Func)delegate(float originalValue, int thresholdCoeff, int itemCount) { float num = baseDamage + stackDamage * (float)(itemCount - 1); float num2 = baseThresholdDamage + stackThresholdDamage * (float)(itemCount - 1); return num + num2 * (float)thresholdCoeff; }); val7.Index += 3; val7.EmitDelegate>((Func)((float originalValue) => damageCap * 100f)); } else { Log.Error("IL Hook for Damage and Cap (conditional check) failed!"); } ILCursor val8 = new ILCursor(il); if (val8.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 3), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "attackerBody") })) { val8.EmitDelegate>((Func)((float originalValue) => damageCap * 100f)); } }; <>c.<>9__13_2 = val3; obj3 = (object)val3; } MeteorAttackOnHighDamageBodyBehavior.CalculateDamage += (Manipulator)obj3; object obj4 = <>c.<>9__13_3; if (obj4 == null) { Manipulator val4 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown ILCursor val5 = new ILCursor(il); if (val5.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "procCoefficient"), (Instruction x) => ILPatternMatchingExt.MatchDup(x), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { val5.EmitDelegate>((Func)((float originalValue) => procCoeff)); } else { Log.Error("IL Hook for Proc Coefficient failed!"); } ILCursor val6 = new ILCursor(il); if (val6.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "radius") })) { val6.EmitDelegate>((Func)((float originalValue) => areaOfEffect)); } else { Log.Error("IL Hook for damage radius failed!"); } }; <>c.<>9__13_3 = val4; obj4 = (object)val4; } MeteorAttackOnHighDamageBodyBehavior.DetonateRunicLensMeteor += (Manipulator)obj4; SeekersoftheStormNerfs.ReplaceItemDesc("ITEM_METEORATTACKONHIGHDAMAGE_DESC", $"{baseChance * 100f:0.##}% " + ((stackChance != 0f) ? $"(+{stackChance * 100f:0.##}% per stack) " : "") + "chance on hit to call a meteor strike, dealing " + $"{baseDamage * 100f:0.##}% " + ((stackDamage != 0f) ? $"(+{stackDamage * 100f:0.##}% per stack) " : "") + "base damage. Every " + $"{threshold * 100f:0.##}% attack damage dealt increases the activation chance by " + $"{baseThresholdChance * 100f:0.##}% " + ((stackThresholdChance != 0f) ? $"(+{stackThresholdChance * 100f:0.##}% per stack) " : "") + "and damage by " + $"{baseThresholdDamage * 100f:0.##}%" + ((stackThresholdDamage != 0f) ? $" (+{stackThresholdDamage * 100f:0.##}% per stack)." : ".")); } } internal static class SaleStar { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__5_3; public static Func <>9__5_1; public static Func <>9__5_4; public static Func <>9__5_2; public static Manipulator <>9__5_0; internal void b__5_0(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003c: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "dropCount") })) { val.Emit(OpCodes.Ldarg_1); val.Emit(OpCodes.Ldloc, 7); val.EmitDelegate>((Func)delegate(int originalValue, Interactor interactor, int itemCount) { int num3 = 0; if (itemCount > 1) { List list2 = new List(3) { oneExtraItemChance * 100f, twoExtraItemsChance * 100f, threeExtraItemsChance * 100f }; foreach (float item in list2) { float num4 = Util.ConvertAmplificationPercentageIntoReductionNormalized((float)(itemCount - 1) * stackExtraItemChance); if (!Util.CheckRoll(item + num4 * 100f, ((Component)interactor).GetComponent().master)) { break; } num3++; } } return baseItemCount + num3; }); } else { Log.Error("IL Hook for Sale Star failed!"); } ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "dropCount") })) { val2.Emit(OpCodes.Ldarg_0); val2.Emit(OpCodes.Ldloc, 7); val2.EmitDelegate>((Func)delegate(int originalValue, Interactor interactor, int itemCount) { int num = 0; if (itemCount > 1) { List list = new List(3) { oneExtraItemChance * 100f, twoExtraItemsChance * 100f, threeExtraItemsChance * 100f }; foreach (float item2 in list) { float num2 = Util.ConvertAmplificationPercentageIntoReductionNormalized((float)(itemCount - 1) * stackExtraItemChance); if (!Util.CheckRoll(item2 + num2 * 100f, ((Component)interactor).GetComponent().master)) { break; } num++; } } return baseItemCount + num; }); } else { Log.Error("IL Hook for Sale Star failed!"); } } internal bool b__5_3(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "dropCount"); } internal int b__5_1(int originalValue, Interactor interactor, int itemCount) { int num = 0; if (itemCount > 1) { List list = new List(3) { oneExtraItemChance * 100f, twoExtraItemsChance * 100f, threeExtraItemsChance * 100f }; foreach (float item in list) { float num2 = Util.ConvertAmplificationPercentageIntoReductionNormalized((float)(itemCount - 1) * stackExtraItemChance); if (Util.CheckRoll(item + num2 * 100f, ((Component)interactor).GetComponent().master)) { num++; continue; } break; } } return baseItemCount + num; } internal bool b__5_4(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "dropCount"); } internal int b__5_2(int originalValue, Interactor interactor, int itemCount) { int num = 0; if (itemCount > 1) { List list = new List(3) { oneExtraItemChance * 100f, twoExtraItemsChance * 100f, threeExtraItemsChance * 100f }; foreach (float item in list) { float num2 = Util.ConvertAmplificationPercentageIntoReductionNormalized((float)(itemCount - 1) * stackExtraItemChance); if (Util.CheckRoll(item + num2 * 100f, ((Component)interactor).GetComponent().master)) { num++; continue; } break; } } return baseItemCount + num; } } private static readonly int baseItemCount = (int)PluginConfig.SSBaseItemCount.Value; private static readonly float stackExtraItemChance = PluginConfig.SSStackExtraItemChance.Value; private static readonly float oneExtraItemChance = PluginConfig.SSOneExtraItemChance.Value; private static readonly float twoExtraItemsChance = PluginConfig.SSTwoExtraItemsChance.Value; private static readonly float threeExtraItemsChance = PluginConfig.SSThreeExtraItemsChance.Value; public static void ApplyChanges() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown Log.Info("Sale star hooks initialised."); object obj = <>c.<>9__5_0; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003c: 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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "dropCount") })) { val2.Emit(OpCodes.Ldarg_1); val2.Emit(OpCodes.Ldloc, 7); val2.EmitDelegate>((Func)delegate(int originalValue, Interactor interactor, int itemCount) { int num3 = 0; if (itemCount > 1) { List list2 = new List(3) { oneExtraItemChance * 100f, twoExtraItemsChance * 100f, threeExtraItemsChance * 100f }; foreach (float item in list2) { float num4 = Util.ConvertAmplificationPercentageIntoReductionNormalized((float)(itemCount - 1) * stackExtraItemChance); if (!Util.CheckRoll(item + num4 * 100f, ((Component)interactor).GetComponent().master)) { break; } num3++; } } return baseItemCount + num3; }); } else { Log.Error("IL Hook for Sale Star failed!"); } ILCursor val3 = new ILCursor(il); if (val3.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "dropCount") })) { val3.Emit(OpCodes.Ldarg_0); val3.Emit(OpCodes.Ldloc, 7); val3.EmitDelegate>((Func)delegate(int originalValue, Interactor interactor, int itemCount) { int num = 0; if (itemCount > 1) { List list = new List(3) { oneExtraItemChance * 100f, twoExtraItemsChance * 100f, threeExtraItemsChance * 100f }; foreach (float item2 in list) { float num2 = Util.ConvertAmplificationPercentageIntoReductionNormalized((float)(itemCount - 1) * stackExtraItemChance); if (!Util.CheckRoll(item2 + num2 * 100f, ((Component)interactor).GetComponent().master)) { break; } num++; } } return baseItemCount + num; }); } else { Log.Error("IL Hook for Sale Star failed!"); } }; <>c.<>9__5_0 = val; obj = (object)val; } PurchaseInteraction.OnInteractionBegin += (Manipulator)obj; SeekersoftheStormNerfs.ReplaceItemDesc("ITEM_LOWERPRICEDCHESTS_DESC", "Gain " + (baseItemCount - 1) + ((baseItemCount == 2) ? " extra item " : " extra items ") + "on the first chest opened per stage." + Environment.NewLine + "Each additional Sale Star increases the chance of getting more items by " + $"{stackExtraItemChance * 100f:0.##}%."); } } internal static class SonorousWhispers { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__4_3; public static Func <>9__4_4; public static Func <>9__4_5; public static Func <>9__4_6; public static Func <>9__4_7; public static Func <>9__4_1; public static Func <>9__4_8; public static Func <>9__4_9; public static Func <>9__4_10; public static Func <>9__4_11; public static Func <>9__4_12; public static Func <>9__4_13; public static Func <>9__4_14; public static Func <>9__4_15; public static Func <>9__4_16; public static Func <>9__4_2; public static Manipulator <>9__4_0; internal void b__4_0(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown //IL_0275: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); ILLabel val4 = default(ILLabel); if (val.TryGotoNext(new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 100f), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 16), (Instruction x) => ILPatternMatchingExt.MatchCall(x, typeof(Util), "CheckRoll"), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val4), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 2) })) { int index = val.Index; val.Index = index + 1; val.Emit(OpCodes.Ldloc, 99); val.EmitDelegate>((Func)((float originalValue, int itemCount) => baseChampionChance * 100f + stackChampionChance * 100f * (float)(itemCount - 1))); } else { Log.Error("IL Hook for Sonorous Whispers Boss Drop chance failed!"); } ILCursor val2 = new ILCursor(il); ILLabel val3 = default(ILLabel); if (val2.TryGotoNext(new Func[9] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 4f), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1f), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 99), (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 16), (Instruction x) => ILPatternMatchingExt.MatchCall(x, typeof(Util), "CheckRoll"), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val3) })) { val2.Index += 6; val2.Emit(OpCodes.Ldloc, 99); val2.EmitDelegate>((Func)((float originalValue, int itemCount) => baseEliteChance * 100f + stackEliteChance * 100f * (float)(itemCount - 1))); } else { Log.Error("IL Hook for Sonorous Whispers Elite Drop chance failed!"); } } internal bool b__4_3(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 100f); } internal bool b__4_4(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 16); } internal bool b__4_5(Instruction x) { return ILPatternMatchingExt.MatchCall(x, typeof(Util), "CheckRoll"); } internal bool b__4_6(Instruction x) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBrfalse(x, ref val); } internal bool b__4_7(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 2); } internal float b__4_1(float originalValue, int itemCount) { return baseChampionChance * 100f + stackChampionChance * 100f * (float)(itemCount - 1); } internal bool b__4_8(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 4f); } internal bool b__4_9(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 1f); } internal bool b__4_10(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 99); } internal bool b__4_11(Instruction x) { return ILPatternMatchingExt.MatchConvR4(x); } internal bool b__4_12(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool b__4_13(Instruction x) { return ILPatternMatchingExt.MatchAdd(x); } internal bool b__4_14(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 16); } internal bool b__4_15(Instruction x) { return ILPatternMatchingExt.MatchCall(x, typeof(Util), "CheckRoll"); } internal bool b__4_16(Instruction x) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBrfalse(x, ref val); } internal float b__4_2(float originalValue, int itemCount) { return baseEliteChance * 100f + stackEliteChance * 100f * (float)(itemCount - 1); } } private static readonly float baseChampionChance = PluginConfig.SWBaseChampionDropChance.Value; private static readonly float stackChampionChance = PluginConfig.SWStackChampionDropChance.Value; private static readonly float baseEliteChance = PluginConfig.SWBaseEliteDropChance.Value; private static readonly float stackEliteChance = PluginConfig.SWStackEliteDropChance.Value; public static void ApplyChanges() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown Log.Info("Sonorous Whispers hooks initialised."); object obj = <>c.<>9__4_0; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown //IL_0275: Unknown result type (might be due to invalid IL or missing references) ILCursor val2 = new ILCursor(il); ILLabel val5 = default(ILLabel); if (val2.TryGotoNext(new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 100f), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 16), (Instruction x) => ILPatternMatchingExt.MatchCall(x, typeof(Util), "CheckRoll"), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val5), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 2) })) { int index = val2.Index; val2.Index = index + 1; val2.Emit(OpCodes.Ldloc, 99); val2.EmitDelegate>((Func)((float originalValue, int itemCount) => baseChampionChance * 100f + stackChampionChance * 100f * (float)(itemCount - 1))); } else { Log.Error("IL Hook for Sonorous Whispers Boss Drop chance failed!"); } ILCursor val3 = new ILCursor(il); ILLabel val4 = default(ILLabel); if (val3.TryGotoNext(new Func[9] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 4f), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1f), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 99), (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 16), (Instruction x) => ILPatternMatchingExt.MatchCall(x, typeof(Util), "CheckRoll"), (Instruction x) => ILPatternMatchingExt.MatchBrfalse(x, ref val4) })) { val3.Index += 6; val3.Emit(OpCodes.Ldloc, 99); val3.EmitDelegate>((Func)((float originalValue, int itemCount) => baseEliteChance * 100f + stackEliteChance * 100f * (float)(itemCount - 1))); } else { Log.Error("IL Hook for Sonorous Whispers Elite Drop chance failed!"); } }; <>c.<>9__4_0 = val; obj = (object)val; } GlobalEventManager.OnCharacterDeath += (Manipulator)obj; SeekersoftheStormNerfs.ReplaceItemDesc("ITEM_ITEMDROPCHANCEONKILL_DESC", $"When a large monster is killed it has a {baseChampionChance * 100f:0.###}% " + ((stackChampionChance != 0f) ? $"(+{stackChampionChance * 100f:0.###}% per stack) " : "") + "chance of dropping an item. All elites have a " + $"{baseEliteChance * 100f:0.###}% " + ((stackEliteChance != 0f) ? $"(+{stackEliteChance * 100f:0.###}% per stack) " : "") + "chance of dropping an item."); } } internal static class UnstableTransmitter { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__13_7; public static Func <>9__13_8; public static Func <>9__13_9; public static Func <>9__13_5; public static Func <>9__13_10; public static Func <>9__13_11; public static Func <>9__13_12; public static Func <>9__13_6; public static Manipulator <>9__13_0; public static Func <>9__13_14; public static Func <>9__13_15; public static Func <>9__13_16; public static Func <>9__13_13; public static Manipulator <>9__13_1; public static Func <>9__13_19; public static Func <>9__13_20; public static Func <>9__13_17; public static Func <>9__13_18; public static Manipulator <>9__13_2; public static Func <>9__13_22; public static Func <>9__13_23; public static Func <>9__13_24; public static Func <>9__13_25; public static Func <>9__13_26; public static Func <>9__13_21; public static Manipulator <>9__13_3; public static Func <>9__13_27; public static Func <>9__13_29; public static Func <>9__13_30; public static Action <>9__13_28; public static Manipulator <>9__13_4; internal void b__13_0(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown //IL_0140: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 2), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(float originalValue, HealthComponent healthComponent) { if ((Object)(object)healthComponent != (Object)null && (Object)(object)healthComponent.body != (Object)null && (Object)(object)healthComponent.body.inventory != (Object)null) { int itemCount2 = healthComponent.body.inventory.GetItemCount(Items.TeleportOnLowHealth); return baseTempHealth + stackTempHealth * (float)(itemCount2 - 1); } return originalValue; }); } else { Log.Error("IL Hook for Unstable Transmitter Temp Health failed!"); } ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "AddTimedBuff"), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "HiddenInvincibility") })) { val2.Emit(OpCodes.Ldarg_0); val2.EmitDelegate>((Func)delegate(float originalValue, HealthComponent healthComponent) { if ((Object)(object)healthComponent != (Object)null && (Object)(object)healthComponent.body != (Object)null && (Object)(object)healthComponent.body.inventory != (Object)null) { int itemCount = healthComponent.body.inventory.GetItemCount(Items.TeleportOnLowHealth); return buffTime + stackBuffTime * (float)(itemCount - 1); } return originalValue; }); } else { Log.Error("IL Hook for Unstable Transmitter Buff Duration failed!"); } } internal bool b__13_7(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool b__13_8(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 2); } internal bool b__13_9(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 1); } internal float b__13_5(float originalValue, HealthComponent healthComponent) { if ((Object)(object)healthComponent != (Object)null && (Object)(object)healthComponent.body != (Object)null && (Object)(object)healthComponent.body.inventory != (Object)null) { int itemCount = healthComponent.body.inventory.GetItemCount(Items.TeleportOnLowHealth); return baseTempHealth + stackTempHealth * (float)(itemCount - 1); } return originalValue; } internal bool b__13_10(Instruction x) { return ILPatternMatchingExt.MatchCallvirt(x, "AddTimedBuff"); } internal bool b__13_11(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 1); } internal bool b__13_12(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "HiddenInvincibility"); } internal float b__13_6(float originalValue, HealthComponent healthComponent) { if ((Object)(object)healthComponent != (Object)null && (Object)(object)healthComponent.body != (Object)null && (Object)(object)healthComponent.body.inventory != (Object)null) { int itemCount = healthComponent.body.inventory.GetItemCount(Items.TeleportOnLowHealth); return buffTime + stackBuffTime * (float)(itemCount - 1); } return originalValue; } internal void b__13_1(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { int index = val.Index; val.Index = index + 1; val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(float originalValue, TeleportOnLowHealthBehavior teleportOnLowHealth) { float num = Util.ConvertAmplificationPercentageIntoReductionNormalized(stackCooldownReduction * (float)(teleportOnLowHealth.itemCount - 1)); return baseCooldown - baseCooldown * num; }); } else { Log.Error("SOTSNerf IL Hook for Unstable Transmitter Base Cooldown failed!"); } } internal bool b__13_14(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool b__13_15(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 0); } internal bool b__13_16(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal float b__13_13(float originalValue, TeleportOnLowHealthBehavior teleportOnLowHealth) { float num = Util.ConvertAmplificationPercentageIntoReductionNormalized(stackCooldownReduction * (float)(teleportOnLowHealth.itemCount - 1)); return baseCooldown - baseCooldown * num; } internal void b__13_2(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1f), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 10f) })) { int index = val.Index; val.Index = index + 1; val.EmitDelegate>((Func)((float originalValue) => buffExtension)); index = val.Index; val.Index = index + 1; val.EmitDelegate>((Func)((float originalValue) => maxBuffExtension)); } else { Log.Error("IL Hook for Unstable Transmitter Buff Extension failed!"); } } internal bool b__13_19(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 1f); } internal bool b__13_20(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 10f); } internal float b__13_17(float originalValue) { return buffExtension; } internal float b__13_18(float originalValue) { return maxBuffExtension; } internal void b__13_3(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); MethodReference val4 = default(MethodReference); FieldReference val3 = default(FieldReference); MethodReference val2 = default(MethodReference); if (val.TryGotoNext((MoveType)1, new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 3), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 2), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, ref val4), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, ref val3), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, ref val2) })) { int index = val.Index; val.Index = index + 1; val.Emit(OpCodes.Ldarg_2); val.EmitDelegate>((Func)delegate(int originalValue, CharacterBody body) { int itemCount = body.inventory.GetItemCount(Items.TeleportOnLowHealth); return baseBleedStacks + stackBleedStacks * (itemCount - 1); }); } else { Log.Error("IL Hook for Unstable Transmitter bleed stacks failed!"); } } internal bool b__13_22(Instruction x) { return ILPatternMatchingExt.MatchLdcI4(x, 3); } internal bool b__13_23(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 2); } internal bool b__13_24(Instruction x) { MethodReference val = default(MethodReference); return ILPatternMatchingExt.MatchCallvirt(x, ref val); } internal bool b__13_25(Instruction x) { FieldReference val = default(FieldReference); return ILPatternMatchingExt.MatchLdsfld(x, ref val); } internal bool b__13_26(Instruction x) { MethodReference val = default(MethodReference); return ILPatternMatchingExt.MatchCallvirt(x, ref val); } internal int b__13_21(int originalValue, CharacterBody body) { int itemCount = body.inventory.GetItemCount(Items.TeleportOnLowHealth); return baseBleedStacks + stackBleedStacks * (itemCount - 1); } internal void b__13_4(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00c1: 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) ILCursor val = new ILCursor(il); Instruction next = val.Clone().GotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchRet(x) }).Next; if (val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "teleportAuraInstance"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { int index = val.Index; val.Index = index + 1; if (!consumeAllStacks && !consumeOneStack) { val.Emit(OpCodes.Br, next); } else { if (!consumeAllStacks) { return; } val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)delegate(TeleportOnLowHealthBehavior behavior) { CharacterBody body = ((BaseItemBodyBehavior)behavior).body; int num = body.inventory.GetItemCount(Items.TeleportOnLowHealth) - 1; if (num >= 1) { body.inventory.RemoveItem(Items.TeleportOnLowHealth, num); body.inventory.GiveItem(Items.TeleportOnLowHealthConsumed, num); } }); } } else { Log.Error("IL Hook for Unstable Transmitter stack consumption failed!"); } } internal bool b__13_27(Instruction x) { return ILPatternMatchingExt.MatchRet(x); } internal bool b__13_29(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "teleportAuraInstance"); } internal bool b__13_30(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal void b__13_28(TeleportOnLowHealthBehavior behavior) { CharacterBody body = ((BaseItemBodyBehavior)behavior).body; int num = body.inventory.GetItemCount(Items.TeleportOnLowHealth) - 1; if (num >= 1) { body.inventory.RemoveItem(Items.TeleportOnLowHealth, num); body.inventory.GiveItem(Items.TeleportOnLowHealthConsumed, num); } } } private static readonly float baseTempHealth = PluginConfig.UTBaseTempHealth.Value; private static readonly float stackTempHealth = PluginConfig.UTStackTempHealth.Value; private static readonly float buffTime = PluginConfig.UTBuffTime.Value; private static readonly float stackBuffTime = PluginConfig.UTStackBuffTime.Value; private static readonly float baseCooldown = PluginConfig.UTBaseCooldown.Value; private static readonly float stackCooldownReduction = PluginConfig.UTStackCooldownReduction.Value; private static readonly float buffExtension = PluginConfig.UTBuffExtension.Value; private static readonly float maxBuffExtension = PluginConfig.UTMaxBuffExtension.Value; private static readonly int baseBleedStacks = (int)PluginConfig.UTBaseBleedStacks.Value; private static readonly int stackBleedStacks = (int)PluginConfig.UTStackBleedStacks.Value; private static readonly bool consumeOneStack = PluginConfig.UTConsumeOneStack.Value; private static readonly bool consumeAllStacks = PluginConfig.UTConsumeAllStacks.Value; private static readonly bool showReadyBuff = PluginConfig.UTShowReadyBuff.Value; public static void ApplyChanges() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //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_0075: Expected O, but got Unknown //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //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_00bf: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Expected O, but got Unknown if (showReadyBuff) { BuffDef val = Addressables.LoadAssetAsync((object)"RoR2/DLC2/Items/TeleportOnLowHealth/bdTeleportOnLowHealth.asset").WaitForCompletion(); val.isHidden = false; } Log.Info("Unstable Transmitter hooks initialised."); object obj = <>c.<>9__13_0; if (obj == null) { Manipulator val2 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown //IL_0140: Unknown result type (might be due to invalid IL or missing references) ILCursor val14 = new ILCursor(il); if (val14.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 2), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1) })) { val14.Emit(OpCodes.Ldarg_0); val14.EmitDelegate>((Func)delegate(float originalValue, HealthComponent healthComponent) { if ((Object)(object)healthComponent != (Object)null && (Object)(object)healthComponent.body != (Object)null && (Object)(object)healthComponent.body.inventory != (Object)null) { int itemCount3 = healthComponent.body.inventory.GetItemCount(Items.TeleportOnLowHealth); return baseTempHealth + stackTempHealth * (float)(itemCount3 - 1); } return originalValue; }); } else { Log.Error("IL Hook for Unstable Transmitter Temp Health failed!"); } ILCursor val15 = new ILCursor(il); if (val15.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "AddTimedBuff"), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 1), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "HiddenInvincibility") })) { val15.Emit(OpCodes.Ldarg_0); val15.EmitDelegate>((Func)delegate(float originalValue, HealthComponent healthComponent) { if ((Object)(object)healthComponent != (Object)null && (Object)(object)healthComponent.body != (Object)null && (Object)(object)healthComponent.body.inventory != (Object)null) { int itemCount2 = healthComponent.body.inventory.GetItemCount(Items.TeleportOnLowHealth); return buffTime + stackBuffTime * (float)(itemCount2 - 1); } return originalValue; }); } else { Log.Error("IL Hook for Unstable Transmitter Buff Duration failed!"); } }; <>c.<>9__13_0 = val2; obj = (object)val2; } TeleportOnLowHealthBehavior.TryProc += (Manipulator)obj; object obj2 = <>c.<>9__13_1; if (obj2 == null) { Manipulator val3 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0091: Unknown result type (might be due to invalid IL or missing references) ILCursor val13 = new ILCursor(il); if (val13.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { int index4 = val13.Index; val13.Index = index4 + 1; val13.Emit(OpCodes.Ldarg_0); val13.EmitDelegate>((Func)delegate(float originalValue, TeleportOnLowHealthBehavior teleportOnLowHealth) { float num2 = Util.ConvertAmplificationPercentageIntoReductionNormalized(stackCooldownReduction * (float)(teleportOnLowHealth.itemCount - 1)); return baseCooldown - baseCooldown * num2; }); } else { Log.Error("SOTSNerf IL Hook for Unstable Transmitter Base Cooldown failed!"); } }; <>c.<>9__13_1 = val3; obj2 = (object)val3; } TeleportOnLowHealthBehavior.RefreshCooldown += (Manipulator)obj2; object obj3 = <>c.<>9__13_2; if (obj3 == null) { Manipulator val4 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val12 = new ILCursor(il); if (val12.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 1f), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 10f) })) { int index3 = val12.Index; val12.Index = index3 + 1; val12.EmitDelegate>((Func)((float originalValue) => buffExtension)); index3 = val12.Index; val12.Index = index3 + 1; val12.EmitDelegate>((Func)((float originalValue) => maxBuffExtension)); } else { Log.Error("IL Hook for Unstable Transmitter Buff Extension failed!"); } }; <>c.<>9__13_2 = val4; obj3 = (object)val4; } TeleportOnLowHealthBehavior.OnCharacterDeathGlobal += (Manipulator)obj3; object obj4 = <>c.<>9__13_3; if (obj4 == null) { Manipulator val5 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) ILCursor val8 = new ILCursor(il); MethodReference val11 = default(MethodReference); FieldReference val10 = default(FieldReference); MethodReference val9 = default(MethodReference); if (val8.TryGotoNext((MoveType)1, new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchLdcI4(x, 3), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 2), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, ref val11), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, ref val10), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, ref val9) })) { int index2 = val8.Index; val8.Index = index2 + 1; val8.Emit(OpCodes.Ldarg_2); val8.EmitDelegate>((Func)delegate(int originalValue, CharacterBody body) { int itemCount = body.inventory.GetItemCount(Items.TeleportOnLowHealth); return baseBleedStacks + stackBleedStacks * (itemCount - 1); }); } else { Log.Error("IL Hook for Unstable Transmitter bleed stacks failed!"); } }; <>c.<>9__13_3 = val5; obj4 = (object)val5; } HealthComponent.DoWarp += (Manipulator)obj4; if (consumeAllStacks || !consumeOneStack) { object obj5 = <>c.<>9__13_4; if (obj5 == null) { Manipulator val6 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00c1: 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) ILCursor val7 = new ILCursor(il); Instruction next = val7.Clone().GotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchRet(x) }).Next; if (val7.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "teleportAuraInstance"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { int index = val7.Index; val7.Index = index + 1; if (!consumeAllStacks && !consumeOneStack) { val7.Emit(OpCodes.Br, next); } else if (consumeAllStacks) { val7.Emit(OpCodes.Ldarg_0); val7.EmitDelegate>((Action)delegate(TeleportOnLowHealthBehavior behavior) { CharacterBody body2 = ((BaseItemBodyBehavior)behavior).body; int num = body2.inventory.GetItemCount(Items.TeleportOnLowHealth) - 1; if (num >= 1) { body2.inventory.RemoveItem(Items.TeleportOnLowHealth, num); body2.inventory.GiveItem(Items.TeleportOnLowHealthConsumed, num); } }); } } else { Log.Error("IL Hook for Unstable Transmitter stack consumption failed!"); } }; <>c.<>9__13_4 = val6; obj5 = (object)val6; } TeleportOnLowHealthBehavior.DestroyTeleportOrb += (Manipulator)obj5; } SeekersoftheStormNerfs.ReplaceItemDesc("ITEM_TELEPORTONLOWHEALTH_DESC", "Falling below 25% health gives you " + $"{baseTempHealth * 100f:0.##}% " + ((stackTempHealth != 0f) ? $"(+{stackTempHealth * 100f:0.##}% per stack) " : "") + "of your maximum health as a temporary barrier. Gain a dimensional aura for " + $"{buffTime:0.##}s " + ((stackBuffTime != 0f) ? $"(+{stackBuffTime:0.##}s per stack) " : "") + $"that applies {baseBleedStacks} " + ((stackBleedStacks != 0) ? $"(+{stackBleedStacks} per stack) " : "") + "stacks of bleed and teleports away enemies. Enemies killed by the aura extend " + $"the duration by {buffExtension:0.##}s. " + (consumeAllStacks ? "" : ("Usable again after " + $"{baseCooldown:0.##}s" + ((stackCooldownReduction != 0f) ? $" (-{stackCooldownReduction * 100f:0.##}% per stack). " : ". "))) + (consumeAllStacks ? "All stacks are consumed upon use, recharging at the start of each stage." : (consumeOneStack ? "One stack is consumed upon use, recharging at the start of each stage." : ""))); } } internal class WarBonds { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__22_8; public static Func <>9__22_4; public static Func <>9__22_9; public static Func <>9__22_5; public static Func <>9__22_10; public static Func <>9__22_6; public static Func <>9__22_11; public static Func <>9__22_7; public static Manipulator <>9__22_0; public static Func <>9__22_13; public static Func <>9__22_14; public static Func <>9__22_12; public static Manipulator <>9__22_1; public static Func <>9__22_16; public static Func <>9__22_15; public static Manipulator <>9__22_2; public static Func <>9__22_19; public static Func <>9__22_20; public static Func <>9__22_21; public static Func <>9__22_22; public static Func <>9__22_23; public static Func <>9__22_24; public static Func <>9__22_25; public static Func <>9__22_26; public static Func <>9__22_27; public static Func <>9__22_28; public static Func <>9__22_17; public static Func <>9__22_29; public static Func <>9__22_30; public static Func <>9__22_31; public static Func <>9__22_18; public static Manipulator <>9__22_3; internal void b__22_0(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "missileBarrageCount") })) { val.EmitDelegate>((Func)((int originalValue) => initialCount)); } else { Log.Error("IL Hook for War Bonds initial missile count failed!"); } ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "initialMissileDelay") })) { val2.EmitDelegate>((Func)((float originalValue) => startDelay)); } else { Log.Error("IL Hook for War Bonds initial missile delay failed!"); } ILCursor val3 = new ILCursor(il); if (val3.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "fireDelay") })) { val3.EmitDelegate>((Func)((float originalValue) => interval)); } else { Log.Error("IL Hook for War Bonds missile interval failed!"); } ILCursor val4 = new ILCursor(il); if (val4.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "normalEnemyDamageRatio") })) { val4.EmitDelegate>((Func)((float originalValue) => normalEnemyDamageRatio)); } else { Log.Error("IL Hook for War Bonds normal enemy damage ratio failed!"); } } internal bool b__22_8(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "missileBarrageCount"); } internal int b__22_4(int originalValue) { return initialCount; } internal bool b__22_9(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "initialMissileDelay"); } internal float b__22_5(float originalValue) { return startDelay; } internal bool b__22_10(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "fireDelay"); } internal float b__22_6(float originalValue) { return interval; } internal bool b__22_11(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "normalEnemyDamageRatio"); } internal float b__22_7(float originalValue) { return normalEnemyDamageRatio; } internal void b__22_1(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005e: 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) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchRet(x), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)delegate(float originalValue, ItemBehavior behavior, CharacterBody target) { int itemCount = behavior.body.inventory.GetItemCount(Items.BarrageOnBoss); if (!enableMissileBaseDamage) { float maxHealth = target.maxHealth; return target.maxHealth * (baseBossHP + stackBossHP * (float)(itemCount - 1)); } float damage = behavior.body.damage; return damage * (baseDamage + stackDamage * (float)(itemCount - 1)); }); } else { Log.Error("IL Hook for War Bonds Boss Max Hp% damage failed!"); } } internal bool b__22_13(Instruction x) { return ILPatternMatchingExt.MatchRet(x); } internal bool b__22_14(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal float b__22_12(float originalValue, ItemBehavior behavior, CharacterBody target) { int itemCount = behavior.body.inventory.GetItemCount(Items.BarrageOnBoss); if (!enableMissileBaseDamage) { float maxHealth = target.maxHealth; return target.maxHealth * (baseBossHP + stackBossHP * (float)(itemCount - 1)); } float damage = behavior.body.damage; return damage * (baseDamage + stackDamage * (float)(itemCount - 1)); } internal void b__22_2(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchRet(x) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Func)delegate(int originalValue, ItemBehavior behavior) { int itemCount = behavior.body.inventory.GetItemCount(Items.BarrageOnBoss); return baseMaxMissiles + stackMaxMissiles * (itemCount - 1); }); } else { Log.Error("IL Hook for War bonds max buff count failed!"); } } internal bool b__22_16(Instruction x) { return ILPatternMatchingExt.MatchRet(x); } internal int b__22_15(int originalValue, ItemBehavior behavior) { int itemCount = behavior.body.inventory.GetItemCount(Items.BarrageOnBoss); return baseMaxMissiles + stackMaxMissiles * (itemCount - 1); } internal void b__22_3(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Expected O, but got Unknown //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "extraMissileMoneyThreshold") })) { val.EmitDelegate>((Func)(() => disableDuringTPEvent && postTeleporterEvent)); Instruction next = val.Clone().GotoNext(new Func[1] { (Instruction y) => ILPatternMatchingExt.MatchRet(y) }).Next; val.Emit(OpCodes.Brtrue, next); } else { Log.Error("IL Hook for War Bonds Disable stacking during TP Event failed!"); } ILCursor val2 = new ILCursor(il); ILLabel val4 = default(ILLabel); if (val2.TryGotoNext(new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchConvRUn(x), (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchBgt(x, ref val4), (Instruction x) => ILPatternMatchingExt.MatchRet(x) })) { val2.EmitDelegate>((Func)((int originalValue) => (int)((float)goldReq * Mathf.Pow(Run.instance.difficultyCoefficient, scalingExponent)))); } else { Log.Error("IL Hook for extraMissileMoneyCount check failed!"); } ILCursor val3 = new ILCursor(il); if (val3.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "extraMissileMoneyThreshold"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { val3.EmitDelegate>((Func)((uint originalValue) => (uint)((float)goldReq * Mathf.Pow(Run.instance.difficultyCoefficient, scalingExponent)))); } else { Log.Error("IL Hook for War Bonds Gold Requirement failed!"); } } internal bool b__22_19(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool b__22_20(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool b__22_21(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, "extraMissileMoneyThreshold"); } internal bool b__22_22() { if (disableDuringTPEvent) { return postTeleporterEvent; } return false; } internal bool b__22_23(Instruction y) { return ILPatternMatchingExt.MatchRet(y); } internal bool b__22_24(Instruction x) { return ILPatternMatchingExt.MatchAdd(x); } internal bool b__22_25(Instruction x) { return ILPatternMatchingExt.MatchConvRUn(x); } internal bool b__22_26(Instruction x) { return ILPatternMatchingExt.MatchConvR4(x); } internal bool b__22_27(Instruction x) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBgt(x, ref val); } internal bool b__22_28(Instruction x) { return ILPatternMatchingExt.MatchRet(x); } internal int b__22_17(int originalValue) { return (int)((float)goldReq * Mathf.Pow(Run.instance.difficultyCoefficient, scalingExponent)); } internal bool b__22_29(Instruction x) { return ILPatternMatchingExt.MatchAdd(x); } internal bool b__22_30(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "extraMissileMoneyThreshold"); } internal bool b__22_31(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal uint b__22_18(uint originalValue) { return (uint)((float)goldReq * Mathf.Pow(Run.instance.difficultyCoefficient, scalingExponent)); } } private static readonly float baseBossHP = PluginConfig.WBBaseBossHP.Value; private static readonly float stackBossHP = PluginConfig.WBStackBossHP.Value; private static readonly int initialCount = (int)PluginConfig.WBInitialCount.Value; private static readonly int baseMaxMissiles = (int)PluginConfig.WBBaseMaxMissiles.Value; private static readonly int stackMaxMissiles = (int)PluginConfig.WBStackMaxMissiles.Value; private static readonly int goldReq = (int)PluginConfig.WBGoldReq.Value; private static readonly float scalingExponent = PluginConfig.WBGoldReqScalingExponent.Value; private static readonly float normalEnemyDamageRatio = PluginConfig.WBNormalEnemyDamageRatio.Value; private static readonly float projectileDamageCoeff = PluginConfig.WBProjectileDamageCoeff.Value; private static readonly float procCoeff = PluginConfig.WBProcCoeff.Value; private static readonly float startDelay = PluginConfig.WBStartDelay.Value; private static readonly float interval = PluginConfig.WBInterval.Value; private static readonly bool enemyCollision = PluginConfig.WBEnemyCollision.Value; private static readonly bool disableDuringTPEvent = PluginConfig.WBDisableDuringTPEvent.Value; private static readonly bool enableMissileBaseDamage = PluginConfig.WBEnableBaseDamageMissiles.Value; private static readonly float baseDamage = PluginConfig.WBBaseDamage.Value; private static readonly float stackDamage = PluginConfig.WBStackDamage.Value; private static readonly bool enableGoldOnShrineUse = PluginConfig.WBEnableGoldOnShrineUse.Value; private static readonly int baseGold = (int)PluginConfig.WBBaseShrineUseGold.Value; private static readonly int stackGold = (int)PluginConfig.WBStackShrineUseGold.Value; private static readonly bool enableAnnouncement = PluginConfig.WBEnableAnnouncement.Value; private static bool postTeleporterEvent = false; public static void ApplyChanges() { //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Expected O, but got Unknown //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Expected O, but got Unknown //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Expected O, but got Unknown //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Expected O, but got Unknown //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Expected O, but got Unknown if (disableDuringTPEvent) { Stage.onStageStartGlobal += OnStageStart; } if (enableAnnouncement) { Inventory.onServerItemGiven += OnWarBondsPickUp; CharacterBody.onBodyStartGlobal += OnCharacterBodyStart; } if (disableDuringTPEvent) { TeleporterInteraction.onTeleporterBeginChargingGlobal += OnTPCharge; } if (enableGoldOnShrineUse) { LanguageAPI.Add("ITEM_GOLDONSTAGESTART_PICKUP_2P", "Attention loyal soldier! Thank you for choosing UES Bonds! Funding required: {1} gold."); LanguageAPI.Add("ITEM_GOLDONSTAGESTART_PICKUP", "Attention loyal soldier! Thank you for choosing UES Bonds! Funding required: {1} gold."); LanguageAPI.Add("ITEM_GOLDONSTAGESTART_NEWSTAGE_2P", "UES ALERT - Required funding has increased to {1} gold."); LanguageAPI.Add("ITEM_GOLDONSTAGESTART_NEWSTAGE", "UES ALERT - Required funding has increased to {1} gold."); LanguageAPI.Add("ITEM_GOLDONSTAGESTART_GRANTGOLDONSHRINEUSE_2P", "You have gained {1} gold. Thank you for using UES Bonds!"); LanguageAPI.Add("ITEM_GOLDONSTAGESTART_GRANTGOLDONSHRINEUSE", "{0} has gained {1} gold. Thank you for using UES Bonds!"); GlobalEventManager.OnInteractionsGlobal += OnShrineUse; } Log.Info("War Bonds hooks initialised."); GameObject val = Addressables.LoadAssetAsync((object)"RoR2/DLC2/Items/BarrageOnBoss/BossMissileProjectile.prefab").WaitForCompletion(); ProjectileController component = val.GetComponent(); ProjectileOverlapAttack component2 = val.GetComponent(); ProjectileImpactExplosion component3 = val.GetComponent(); SphereCollider component4 = val.GetComponent(); if (enemyCollision) { ((Collider)component4).isTrigger = false; component3.destroyOnEnemy = true; } component2.damageCoefficient = projectileDamageCoeff; component.procCoefficient = procCoeff; object obj = <>c.<>9__22_0; if (obj == null) { Manipulator val2 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Expected O, but got Unknown ILCursor val13 = new ILCursor(il); if (val13.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "missileBarrageCount") })) { val13.EmitDelegate>((Func)((int originalValue) => initialCount)); } else { Log.Error("IL Hook for War Bonds initial missile count failed!"); } ILCursor val14 = new ILCursor(il); if (val14.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "initialMissileDelay") })) { val14.EmitDelegate>((Func)((float originalValue) => startDelay)); } else { Log.Error("IL Hook for War Bonds initial missile delay failed!"); } ILCursor val15 = new ILCursor(il); if (val15.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "fireDelay") })) { val15.EmitDelegate>((Func)((float originalValue) => interval)); } else { Log.Error("IL Hook for War Bonds missile interval failed!"); } ILCursor val16 = new ILCursor(il); if (val16.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "normalEnemyDamageRatio") })) { val16.EmitDelegate>((Func)((float originalValue) => normalEnemyDamageRatio)); } else { Log.Error("IL Hook for War Bonds normal enemy damage ratio failed!"); } }; <>c.<>9__22_0 = val2; obj = (object)val2; } BarrageOnBossBehaviour.ctor += (Manipulator)obj; object obj2 = <>c.<>9__22_1; if (obj2 == null) { Manipulator val3 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005e: 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) ILCursor val12 = new ILCursor(il); if (val12.TryGotoNext(new Func[2] { (Instruction x) => ILPatternMatchingExt.MatchRet(x), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { val12.Emit(OpCodes.Ldarg_0); val12.Emit(OpCodes.Ldarg_1); val12.EmitDelegate>((Func)delegate(float originalValue, ItemBehavior behavior, CharacterBody target) { int itemCount2 = behavior.body.inventory.GetItemCount(Items.BarrageOnBoss); if (!enableMissileBaseDamage) { float maxHealth = target.maxHealth; return target.maxHealth * (baseBossHP + stackBossHP * (float)(itemCount2 - 1)); } float damage = behavior.body.damage; return damage * (baseDamage + stackDamage * (float)(itemCount2 - 1)); }); } else { Log.Error("IL Hook for War Bonds Boss Max Hp% damage failed!"); } }; <>c.<>9__22_1 = val3; obj2 = (object)val3; } BarrageOnBossBehaviour.CalculateMissileDamage += (Manipulator)obj2; MethodBase methodBase = AccessTools.PropertyGetter(typeof(BarrageOnBossBehaviour), "maxBuffCount"); object obj3 = <>c.<>9__22_2; if (obj3 == null) { Manipulator val4 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) ILCursor val11 = new ILCursor(il); if (val11.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchRet(x) })) { val11.Emit(OpCodes.Ldarg_0); val11.EmitDelegate>((Func)delegate(int originalValue, ItemBehavior behavior) { int itemCount = behavior.body.inventory.GetItemCount(Items.BarrageOnBoss); return baseMaxMissiles + stackMaxMissiles * (itemCount - 1); }); } else { Log.Error("IL Hook for War bonds max buff count failed!"); } }; <>c.<>9__22_2 = val4; obj3 = (object)val4; } ILHook val5 = new ILHook(methodBase, (Manipulator)obj3); val5.Apply(); object obj4 = <>c.<>9__22_3; if (obj4 == null) { Manipulator val6 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Expected O, but got Unknown //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Expected O, but got Unknown ILCursor val7 = new ILCursor(il); if (val7.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "extraMissileMoneyThreshold") })) { val7.EmitDelegate>((Func)(() => disableDuringTPEvent && postTeleporterEvent)); Instruction next = val7.Clone().GotoNext(new Func[1] { (Instruction y) => ILPatternMatchingExt.MatchRet(y) }).Next; val7.Emit(OpCodes.Brtrue, next); } else { Log.Error("IL Hook for War Bonds Disable stacking during TP Event failed!"); } ILCursor val8 = new ILCursor(il); ILLabel val10 = default(ILLabel); if (val8.TryGotoNext(new Func[5] { (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchConvRUn(x), (Instruction x) => ILPatternMatchingExt.MatchConvR4(x), (Instruction x) => ILPatternMatchingExt.MatchBgt(x, ref val10), (Instruction x) => ILPatternMatchingExt.MatchRet(x) })) { val8.EmitDelegate>((Func)((int originalValue) => (int)((float)goldReq * Mathf.Pow(Run.instance.difficultyCoefficient, scalingExponent)))); } else { Log.Error("IL Hook for extraMissileMoneyCount check failed!"); } ILCursor val9 = new ILCursor(il); if (val9.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchAdd(x), (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "extraMissileMoneyThreshold"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { val9.EmitDelegate>((Func)((uint originalValue) => (uint)((float)goldReq * Mathf.Pow(Run.instance.difficultyCoefficient, scalingExponent)))); } else { Log.Error("IL Hook for War Bonds Gold Requirement failed!"); } }; <>c.<>9__22_3 = val6; obj4 = (object)val6; } BarrageOnBossBehaviour.UpdateExtraMissileMoneyCount += (Manipulator)obj4; SeekersoftheStormNerfs.ReplaceItemDesc("ITEM_BARRAGEONBOSS_DESC", (enableGoldOnShrineUse ? ("Gain " + $"{baseGold} " + (((float)stackGold != 0f) ? $"(+{stackGold} per stack) " : "") + "gold on shrine use, scaling with time. ") : "") + "During boss events, " + $"{initialCount} missile(s) bombard the area, dealing " + ((!enableMissileBaseDamage) ? ($"{baseBossHP * 100f:0.##}% " + ((stackBossHP != 0f) ? $"(+{stackBossHP * 100f:0.##}% per stack) " : "") + "of boss' Max Health in damage. ") : ($"{baseDamage * 100f:0.##}% " + ((stackDamage != 0f) ? $"(+{stackDamage * 100f:0.##}% per stack) " : "") + "base damage. ")) + "Before the boss event, gain additional missiles, up to a maximum of " + $"{baseMaxMissiles}" + ((stackMaxMissiles != 0) ? $" (+{stackMaxMissiles} per stack), " : ", ") + $"per {goldReq} gold gained." + " Gold requirement scales over time."); } private static void OnCharacterBodyStart(CharacterBody characterBody) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Invalid comparison between Unknown and I4 //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)characterBody == (Object)null) && !((Object)(object)characterBody.teamComponent == (Object)null) && !((Object)(object)characterBody.inventory == (Object)null) && (int)characterBody.teamComponent.teamIndex == 1) { bool flag = false; if (characterBody.inventory.GetItemCount(Items.BarrageOnBoss) > 0) { flag = true; } if (flag) { uint num = (uint)((float)goldReq * Mathf.Pow(Run.instance.difficultyCoefficient, scalingExponent)); SubjectFormatChatMessage val = new SubjectFormatChatMessage(); ((SubjectChatMessage)val).baseToken = "ITEM_GOLDONSTAGESTART_NEWSTAGE"; val.paramTokens = new string[1] { num.ToString() }; new WaitForSeconds(2f); Chat.SendBroadcastChat((ChatMessageBase)(object)val); } } } private static void OnWarBondsPickUp(Inventory inventory, ItemIndex index, int itemCount) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown if (!((Object)(object)inventory == (Object)null) && inventory.GetItemCount(index) == 1 && index == Items.BarrageOnBoss.itemIndex) { uint num = (uint)((float)goldReq * Mathf.Pow(Run.instance.difficultyCoefficient, scalingExponent)); SubjectFormatChatMessage val = new SubjectFormatChatMessage(); ((SubjectChatMessage)val).baseToken = "ITEM_GOLDONSTAGESTART_PICKUP"; val.paramTokens = new string[1] { num.ToString() }; Chat.SendBroadcastChat((ChatMessageBase)(object)val); } } private static void OnShrineUse(Interactor interactor, IInteractable interactable, GameObject gameObject) { //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown if ((Object)(object)interactor == (Object)null || interactable == null || (Object)(object)gameObject == (Object)null) { return; } PurchaseInteraction component = gameObject.GetComponent(); if (!((Object)(object)component == (Object)null) && component.isShrine) { CharacterBody component2 = ((Component)interactor).GetComponent(); if (!((Object)(object)component2 == (Object)null) && !((Object)(object)component2.inventory == (Object)null) && component2.inventory.GetItemCount(Items.BarrageOnBoss) >= 1) { int itemCount = component2.inventory.GetItemCount(Items.BarrageOnBoss); uint num = (uint)((float)(baseGold + stackGold * (itemCount - 1)) * Mathf.Pow(Run.instance.difficultyCoefficient, 1.25f)); component2.master.GiveMoney(num); SubjectFormatChatMessage val = new SubjectFormatChatMessage(); ((SubjectChatMessage)val).subjectAsCharacterBody = component2; ((SubjectChatMessage)val).baseToken = "ITEM_GOLDONSTAGESTART_GRANTGOLDONSHRINEUSE"; val.paramTokens = new string[1] { num.ToString() }; Chat.SendBroadcastChat((ChatMessageBase)(object)val); } } } public static void OnStageStart(Stage stage) { if (disableDuringTPEvent) { postTeleporterEvent = false; } } public static void OnTPCharge(TeleporterInteraction teleportInteraction) { postTeleporterEvent = true; } } internal static class WarpedEcho { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__10_6; public static Func <>9__10_7; public static Func <>9__10_8; public static Func <>9__10_9; public static Func <>9__10_10; public static Func <>9__10_11; public static Func <>9__10_12; public static Func <>9__10_13; public static Func <>9__10_14; public static Func <>9__10_15; public static Func <>9__10_16; public static Func <>9__10_17; public static Func <>9__10_18; public static Func <>9__10_19; public static Func <>9__10_20; public static Func <>9__10_21; public static Func <>9__10_22; public static Func <>9__10_23; public static Func <>9__10_3; public static Func <>9__10_24; public static Func <>9__10_25; public static Func <>9__10_26; public static Func <>9__10_4; public static Func <>9__10_27; public static Func <>9__10_28; public static Func <>9__10_29; public static Func <>9__10_5; public static Manipulator <>9__10_0; public static Func <>9__10_31; public static Func <>9__10_30; public static Manipulator <>9__10_1; public static Func <>9__10_33; public static Func <>9__10_34; public static Func <>9__10_35; public static Func <>9__10_36; public static Action <>9__10_32; public static Manipulator <>9__10_2; internal void b__10_0(ILContext il) { //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Expected O, but got Unknown //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Expected O, but got Unknown //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Expected O, but got Unknown //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0481: Unknown result type (might be due to invalid IL or missing references) if (PluginConfig.WEEnableDamageThreshold.Value) { ILCursor val = new ILCursor(il); FieldReference val7 = default(FieldReference); ILLabel val6 = default(ILLabel); if (val.TryGotoNext(new Func[6] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, ref val7), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "damage"), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f), (Instruction x) => ILPatternMatchingExt.MatchBleUn(x, ref val6), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0) })) { val.Emit(OpCodes.Ldarg_0); val.Emit(OpCodes.Ldarg_1); val.EmitDelegate>((Func)delegate(HealthComponent healthComponent, DamageInfo damageInfo) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)healthComponent.body)) { if (Object.op_Implicit((Object)(object)healthComponent.body.inventory) && healthComponent.body.inventory.GetItemCount(Items.DelayedDamage) != 0) { float armor = healthComponent.body.armor; float damage = damageInfo.damage; float num2 = 0f; if (DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)2)) != 0) { num2 = damage; } else { if (armor == 0f) { num2 = damage; } if (armor > 0f) { num2 = damage * (1f - armor / (100f + armor)); } if (armor < 0f) { num2 = damage * (2f - 100f / (100f - armor)); } } if (num2 / healthComponent.body.maxHealth >= damageThreshold) { return true; } } return false; } return false; }); ILLabel val5 = default(ILLabel); Instruction next = val.Clone().GotoNext(new Func[5] { (Instruction y) => ILPatternMatchingExt.MatchLdloc(y, 8), (Instruction y) => ILPatternMatchingExt.MatchLdcR4(y, 0f), (Instruction y) => ILPatternMatchingExt.MatchBleUn(y, ref val5), (Instruction y) => ILPatternMatchingExt.MatchLdarg(y, 0), (Instruction y) => ILPatternMatchingExt.MatchLdfld(y, "barrier") }).Next; val.Emit(OpCodes.Brfalse, next); } else { Log.Error("IL Hook for Warped Echo failed!"); } } ILCursor val2 = new ILCursor(il); if (val2.TryGotoNext(new Func[6] { (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 63), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 8), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 7) })) { val2.Emit(OpCodes.Ldarg_0); val2.EmitDelegate>((Func)delegate(float originalValue, HealthComponent healthComponent) { if ((Object)(object)healthComponent == (Object)null) { return 1f; } if ((Object)(object)healthComponent.body == (Object)null) { return 1f; } if ((Object)(object)healthComponent.body.inventory == (Object)null) { return 1f; } int itemCount2 = healthComponent.body.inventory.GetItemCount(Items.DelayedDamage); float num = Util.ConvertAmplificationPercentageIntoReductionNormalized(baseDamageReduction + stackDamageReduction * (float)(itemCount2 - 1)); return 1f - num; }); } else { Log.Error("IL Hook for Warped Echo damage reduction failed!"); } ILCursor val3 = new ILCursor(il); if (val3.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "SecondHalfOfDelayedDamage"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { val3.EmitDelegate>((Func)((float originalValue) => interval)); } else { Log.Error("IL Hook for Warped Echo damage timer failed!"); } ILCursor val4 = new ILCursor(il); if (val4.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 62), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "body") })) { val4.Emit(OpCodes.Ldarg_0); val4.EmitDelegate>((Func)delegate(int originalValue, HealthComponent healthComponent) { if ((Object)(object)healthComponent == (Object)null) { return 1; } if ((Object)(object)healthComponent.body == (Object)null) { return 1; } if ((Object)(object)healthComponent.body.inventory == (Object)null) { return 1; } int itemCount = healthComponent.body.inventory.GetItemCount(Items.DelayedDamage); return baseEchoes + stackEchoes * (itemCount - 1); }); } else { Log.Error("IL Hook for Warped Echo number of damage instances failed!"); } } internal bool b__10_6(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 0); } internal bool b__10_7(Instruction x) { FieldReference val = default(FieldReference); return ILPatternMatchingExt.MatchLdfld(x, ref val); } internal bool b__10_8(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, "damage"); } internal bool b__10_9(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 0f); } internal bool b__10_10(Instruction x) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBleUn(x, ref val); } internal bool b__10_11(Instruction x) { return ILPatternMatchingExt.MatchLdloc(x, 0); } internal bool b__10_12(HealthComponent healthComponent, DamageInfo damageInfo) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)healthComponent.body)) { if (Object.op_Implicit((Object)(object)healthComponent.body.inventory) && healthComponent.body.inventory.GetItemCount(Items.DelayedDamage) != 0) { float armor = healthComponent.body.armor; float damage = damageInfo.damage; float num = 0f; if (DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)2)) != 0) { num = damage; } else { if (armor == 0f) { num = damage; } if (armor > 0f) { num = damage * (1f - armor / (100f + armor)); } if (armor < 0f) { num = damage * (2f - 100f / (100f - armor)); } } if (num / healthComponent.body.maxHealth >= damageThreshold) { return true; } } return false; } return false; } internal bool b__10_13(Instruction y) { return ILPatternMatchingExt.MatchLdloc(y, 8); } internal bool b__10_14(Instruction y) { return ILPatternMatchingExt.MatchLdcR4(y, 0f); } internal bool b__10_15(Instruction y) { ILLabel val = default(ILLabel); return ILPatternMatchingExt.MatchBleUn(y, ref val); } internal bool b__10_16(Instruction y) { return ILPatternMatchingExt.MatchLdarg(y, 0); } internal bool b__10_17(Instruction y) { return ILPatternMatchingExt.MatchLdfld(y, "barrier"); } internal bool b__10_18(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool b__10_19(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 63); } internal bool b__10_20(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 0f); } internal bool b__10_21(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 8); } internal bool b__10_22(Instruction x) { return ILPatternMatchingExt.MatchLdcR4(x, 0f); } internal bool b__10_23(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 7); } internal float b__10_3(float originalValue, HealthComponent healthComponent) { if ((Object)(object)healthComponent == (Object)null) { return 1f; } if ((Object)(object)healthComponent.body == (Object)null) { return 1f; } if ((Object)(object)healthComponent.body.inventory == (Object)null) { return 1f; } int itemCount = healthComponent.body.inventory.GetItemCount(Items.DelayedDamage); float num = Util.ConvertAmplificationPercentageIntoReductionNormalized(baseDamageReduction + stackDamageReduction * (float)(itemCount - 1)); return 1f - num; } internal bool b__10_24(Instruction x) { return ILPatternMatchingExt.MatchMul(x); } internal bool b__10_25(Instruction x) { return ILPatternMatchingExt.MatchCallvirt(x, "SecondHalfOfDelayedDamage"); } internal bool b__10_26(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal float b__10_4(float originalValue) { return interval; } internal bool b__10_27(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 62); } internal bool b__10_28(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool b__10_29(Instruction x) { return ILPatternMatchingExt.MatchLdfld(x, "body"); } internal int b__10_5(int originalValue, HealthComponent healthComponent) { if ((Object)(object)healthComponent == (Object)null) { return 1; } if ((Object)(object)healthComponent.body == (Object)null) { return 1; } if ((Object)(object)healthComponent.body.inventory == (Object)null) { return 1; } int itemCount = healthComponent.body.inventory.GetItemCount(Items.DelayedDamage); return baseEchoes + stackEchoes * (itemCount - 1); } internal void b__10_1(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "timeUntilDamage") })) { val.EmitDelegate>((Func)((float originalValue) => originalValue + initialDelay)); } else { Log.Error("IL Hook for Warped Echo first damage instance fix failed!"); } } internal bool b__10_31(Instruction x) { return ILPatternMatchingExt.MatchStfld(x, "timeUntilDamage"); } internal float b__10_30(float originalValue) { return originalValue + initialDelay; } internal void b__10_2(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00a2: Unknown result type (might be due to invalid IL or missing references) ILCursor val = new ILCursor(il); if (val.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "DelayedDamageBuff"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetBuffCount"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 1) })) { val.Emit(OpCodes.Ldarg_0); val.EmitDelegate>((Action)delegate(CharacterBody body) { int itemCount = body.inventory.GetItemCount(Items.DelayedDamage); body.delayedDamageRefreshTime = baseCooldown - baseCooldown * Util.ConvertAmplificationPercentageIntoReductionNormalized(stackCooldownReduction * (float)(itemCount - 1)); }); } else { Log.Error("IL Hook for Warped Echo cooldown failed!"); } } internal bool b__10_33(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool b__10_34(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "DelayedDamageBuff"); } internal bool b__10_35(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetBuffCount"); } internal bool b__10_36(Instruction x) { return ILPatternMatchingExt.MatchStloc(x, 1); } internal void b__10_32(CharacterBody body) { int itemCount = body.inventory.GetItemCount(Items.DelayedDamage); body.delayedDamageRefreshTime = baseCooldown - baseCooldown * Util.ConvertAmplificationPercentageIntoReductionNormalized(stackCooldownReduction * (float)(itemCount - 1)); } } private static readonly float baseDamageReduction = PluginConfig.WEBaseDamageReduction.Value; private static readonly float stackDamageReduction = PluginConfig.WEStackDamageReduction.Value; private static readonly int baseEchoes = (int)PluginConfig.WEBaseEchoes.Value; private static readonly int stackEchoes = (int)PluginConfig.WEStackEchoes.Value; private static readonly float baseCooldown = PluginConfig.WEBaseCooldown.Value; private static readonly float stackCooldownReduction = PluginConfig.WEStackCooldownReduction.Value; private static readonly float initialDelay = PluginConfig.WEInitialDelay.Value; private static readonly bool enableDamageThreshold = PluginConfig.WEEnableDamageThreshold.Value; private static readonly float damageThreshold = PluginConfig.WEDamageThreshold.Value; private static readonly float interval = PluginConfig.WEInterval.Value; public static void ApplyChanges() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //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_0075: Expected O, but got Unknown Log.Info("Warped Echo hooks initialised."); object obj = <>c.<>9__10_0; if (obj == null) { Manipulator val = delegate(ILContext il) { //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Expected O, but got Unknown //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Expected O, but got Unknown //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Expected O, but got Unknown //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0481: Unknown result type (might be due to invalid IL or missing references) if (PluginConfig.WEEnableDamageThreshold.Value) { ILCursor val6 = new ILCursor(il); FieldReference val12 = default(FieldReference); ILLabel val11 = default(ILLabel); if (val6.TryGotoNext(new Func[6] { (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, ref val12), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "damage"), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f), (Instruction x) => ILPatternMatchingExt.MatchBleUn(x, ref val11), (Instruction x) => ILPatternMatchingExt.MatchLdloc(x, 0) })) { val6.Emit(OpCodes.Ldarg_0); val6.Emit(OpCodes.Ldarg_1); val6.EmitDelegate>((Func)delegate(HealthComponent healthComponent, DamageInfo damageInfo) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)healthComponent.body)) { if (Object.op_Implicit((Object)(object)healthComponent.body.inventory) && healthComponent.body.inventory.GetItemCount(Items.DelayedDamage) != 0) { float armor = healthComponent.body.armor; float damage = damageInfo.damage; float num2 = 0f; if (DamageTypeCombo.op_Implicit(damageInfo.damageType & DamageTypeCombo.op_Implicit((DamageType)2)) != 0) { num2 = damage; } else { if (armor == 0f) { num2 = damage; } if (armor > 0f) { num2 = damage * (1f - armor / (100f + armor)); } if (armor < 0f) { num2 = damage * (2f - 100f / (100f - armor)); } } if (num2 / healthComponent.body.maxHealth >= damageThreshold) { return true; } } return false; } return false; }); ILLabel val10 = default(ILLabel); Instruction next = val6.Clone().GotoNext(new Func[5] { (Instruction y) => ILPatternMatchingExt.MatchLdloc(y, 8), (Instruction y) => ILPatternMatchingExt.MatchLdcR4(y, 0f), (Instruction y) => ILPatternMatchingExt.MatchBleUn(y, ref val10), (Instruction y) => ILPatternMatchingExt.MatchLdarg(y, 0), (Instruction y) => ILPatternMatchingExt.MatchLdfld(y, "barrier") }).Next; val6.Emit(OpCodes.Brfalse, next); } else { Log.Error("IL Hook for Warped Echo failed!"); } } ILCursor val7 = new ILCursor(il); if (val7.TryGotoNext(new Func[6] { (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 63), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 8), (Instruction x) => ILPatternMatchingExt.MatchLdcR4(x, 0f), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 7) })) { val7.Emit(OpCodes.Ldarg_0); val7.EmitDelegate>((Func)delegate(float originalValue, HealthComponent healthComponent) { if ((Object)(object)healthComponent == (Object)null) { return 1f; } if ((Object)(object)healthComponent.body == (Object)null) { return 1f; } if ((Object)(object)healthComponent.body.inventory == (Object)null) { return 1f; } int itemCount3 = healthComponent.body.inventory.GetItemCount(Items.DelayedDamage); float num = Util.ConvertAmplificationPercentageIntoReductionNormalized(baseDamageReduction + stackDamageReduction * (float)(itemCount3 - 1)); return 1f - num; }); } else { Log.Error("IL Hook for Warped Echo damage reduction failed!"); } ILCursor val8 = new ILCursor(il); if (val8.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchMul(x), (Instruction x) => ILPatternMatchingExt.MatchCallvirt(x, "SecondHalfOfDelayedDamage"), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0) })) { val8.EmitDelegate>((Func)((float originalValue) => interval)); } else { Log.Error("IL Hook for Warped Echo damage timer failed!"); } ILCursor val9 = new ILCursor(il); if (val9.TryGotoNext(new Func[3] { (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 62), (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdfld(x, "body") })) { val9.Emit(OpCodes.Ldarg_0); val9.EmitDelegate>((Func)delegate(int originalValue, HealthComponent healthComponent) { if ((Object)(object)healthComponent == (Object)null) { return 1; } if ((Object)(object)healthComponent.body == (Object)null) { return 1; } if ((Object)(object)healthComponent.body.inventory == (Object)null) { return 1; } int itemCount2 = healthComponent.body.inventory.GetItemCount(Items.DelayedDamage); return baseEchoes + stackEchoes * (itemCount2 - 1); }); } else { Log.Error("IL Hook for Warped Echo number of damage instances failed!"); } }; <>c.<>9__10_0 = val; obj = (object)val; } HealthComponent.TakeDamageProcess += (Manipulator)obj; object obj2 = <>c.<>9__10_1; if (obj2 == null) { Manipulator val2 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown ILCursor val5 = new ILCursor(il); if (val5.TryGotoNext(new Func[1] { (Instruction x) => ILPatternMatchingExt.MatchStfld(x, "timeUntilDamage") })) { val5.EmitDelegate>((Func)((float originalValue) => originalValue + initialDelay)); } else { Log.Error("IL Hook for Warped Echo first damage instance fix failed!"); } }; <>c.<>9__10_1 = val2; obj2 = (object)val2; } CharacterBody.SecondHalfOfDelayedDamage += (Manipulator)obj2; object obj3 = <>c.<>9__10_2; if (obj3 == null) { Manipulator val3 = delegate(ILContext il) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_00a2: Unknown result type (might be due to invalid IL or missing references) ILCursor val4 = new ILCursor(il); if (val4.TryGotoNext(new Func[4] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Buffs), "DelayedDamageBuff"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "GetBuffCount"), (Instruction x) => ILPatternMatchingExt.MatchStloc(x, 1) })) { val4.Emit(OpCodes.Ldarg_0); val4.EmitDelegate>((Action)delegate(CharacterBody body) { int itemCount = body.inventory.GetItemCount(Items.DelayedDamage); body.delayedDamageRefreshTime = baseCooldown - baseCooldown * Util.ConvertAmplificationPercentageIntoReductionNormalized(stackCooldownReduction * (float)(itemCount - 1)); }); } else { Log.Error("IL Hook for Warped Echo cooldown failed!"); } }; <>c.<>9__10_2 = val3; obj3 = (object)val3; } CharacterBody.UpdateDelayedDamage += (Manipulator)obj3; SeekersoftheStormNerfs.ReplaceItemDesc("ITEM_DELAYEDDAMAGE_DESC", "The next source of damage " + (enableDamageThreshold ? $"that deals more than {damageThreshold * 100f:0.##}% maximum health " : "") + "is reduced by " + $"{baseDamageReduction * 100f:0.##}%" + ((stackDamageReduction != 0f) ? $" (+{stackDamageReduction * 100f:0.##}% per stack), " : ", ") + $"delayed by {initialDelay:0.##}s, and then spread across " + $"{baseEchoes} hits " + ((stackEchoes != 0) ? $"(+{stackEchoes} per stack), " : "") + $"at a rate of {1f / interval:0.##} per second. " + "All echoed damage is non-lethal aside from the final hit. " + $"Recharges every {baseCooldown:0.##}s" + ((stackCooldownReduction != 0f) ? $" (-{stackCooldownReduction * 100f:0.##}% per stack)." : ".")); } } }