using System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using EntityStates; using EntityStates.Bandit2.Weapon; using EntityStates.FalseSon; using EntityStates.Huntress; using EntityStates.Mage.Weapon; using EntityStates.Railgunner.Weapon; using KinematicCharacterController; using Microsoft.CodeAnalysis; using On.EntityStates.Bandit2.Weapon; using On.EntityStates.FalseSon; using On.EntityStates.Huntress; using On.EntityStates.Mage.Weapon; using On.EntityStates.Railgunner.Weapon; using On.RoR2; using R2API; using RiskOfOptions; using RiskOfOptions.Options; using RoR2; using RoR2.Projectile; using RoR2.Skills; using UnityEngine; using UnityEngine.AddressableAssets; [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("ForgottenSkillsTweaks")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+8cc1e86a45b1b773ef4bb9da913e65e93e6a2044")] [assembly: AssemblyProduct("ForgottenSkillsTweaks")] [assembly: AssemblyTitle("ForgottenSkillsTweaks")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace ForgottenSkillsTweaks { public static class ArrowRainTweak { private static SkillDef Rain; private static SkillDef Blink; private static string OriginalRainDesc; public static void init() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown float newRadius = 13f; Rain = Addressables.LoadAssetAsync((object)"RoR2/Base/Huntress/HuntressBodyArrowRain.asset").WaitForCompletion(); Blink = Addressables.LoadAssetAsync((object)"RoR2/Base/Huntress/HuntressBodyBlink.asset").WaitForCompletion(); OriginalRainDesc = Rain.skillDescriptionToken; LanguageAPI.Add("HuntressArrowRainDescription", "Teleport into the sky. Target an area to rain arrows, slowing all enemies and dealing 660% damage per second."); config.OnConfigChanged += UpdateSkills; UpdateSkills(); ArrowRain.OnEnter += (hook_OnEnter)delegate(orig_OnEnter orig, ArrowRain self) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (config.ArrowRain.Value) { self.areaIndicatorInstance.transform.localScale = new Vector3(newRadius, 150f, newRadius); ArrowRain.projectilePrefab.GetComponent().lifetime = 7f; float num = (((EntityState)self).characterBody.attackSpeed - ((EntityState)self).characterBody.baseAttackSpeed) * 0.5f; ArrowRain.projectilePrefab.GetComponent().resetFrequency = 4f * (1f + num); ((Component)ArrowRain.projectilePrefab.GetComponent()).transform.localScale = new Vector3(newRadius, 150f, newRadius) * 2f; ArrowRain.projectilePrefab.GetComponent().overlapProcCoefficient = 0.7f; ArrowRain.projectilePrefab.GetComponent().damageCoefficient = 0.75f; } }; } private static void UpdateSkills() { if (config.ArrowRain.Value) { Rain.baseRechargeInterval = 11f; Rain.skillDescriptionToken = "HuntressArrowRainDescription"; } else { Rain.baseRechargeInterval = 12f; Rain.skillDescriptionToken = OriginalRainDesc; } if (config.Blink.Value) { Blink.baseRechargeInterval = 4.5f; } else { Blink.baseRechargeInterval = 7f; } } } public static class Bandit { [CompilerGenerated] private static class <>O { public static Action <0>__UpdateSkills; public static hook_TakeDamage <1>__HealthComponent_TakeDamage; public static Action <2>__ServerDamageDealt; } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_OnEnter <>9__7_0; public static hook_ModifyBullet <>9__7_1; internal void b__7_0(orig_OnEnter orig, BaseFireSidearmRevolverState self) { if (self is FireSidearmResetRevolver) { IsRevolver = true; } else { IsRevolver = false; } orig.Invoke(self); } internal void b__7_1(orig_ModifyBullet orig, Bandit2FireRifle self, BulletAttack bulletAttack) { if (config.Blast.Value) { ((GenericBulletBaseState)self).minSpread = 0f; ((GenericBulletBaseState)self).maxSpread = 0.3f; ((GenericBulletBaseState)self).spreadBloomValue = 0.3f; ((GenericBulletBaseState)self).damageCoefficient = 3.8f; } orig.Invoke(self, bulletAttack); } } private static SkillDef revolver; private static SkillDef Blade; private static SkillDef Blast; private static string originalRevolverDesc; private static string[] originalRevolverDesc2; private static string OriginalBlastDesc; private static bool IsRevolver; public static void init() { //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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Expected O, but got Unknown //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown revolver = Addressables.LoadAssetAsync((object)"RoR2/Base/Bandit2/ResetRevolver.asset").WaitForCompletion(); Blade = Addressables.LoadAssetAsync((object)"RoR2/Base/Bandit2/SlashBlade.asset").WaitForCompletion(); Blast = Addressables.LoadAssetAsync((object)"RoR2/Base/Bandit2/Bandit2Blast.asset").WaitForCompletion(); OriginalBlastDesc = Blast.skillDescriptionToken; originalRevolverDesc = revolver.skillDescriptionToken; originalRevolverDesc2 = revolver.keywordTokens; LanguageAPI.Add("NewRevolverDesc", "Slayer. Death Marked. Fire a revolver shot for 600% damage. Kills reset all your cooldowns. Critical strikes reset the other skills cooldowns"); LanguageAPI.Add("KEYWORD_DEATH", "Death MarkedEnemies hemorrhaging take 2.5X more damage, hitting a hemorrhaging enemy guarantees critical strikes for 2 seconds."); LanguageAPI.Add("NewRifleDesc", "Fire a rifle blast for 380% damage. Can hold up to 4 bullets."); config.OnConfigChanged += UpdateSkills; UpdateSkills(); object obj = <>O.<1>__HealthComponent_TakeDamage; if (obj == null) { hook_TakeDamage val = HealthComponent_TakeDamage; <>O.<1>__HealthComponent_TakeDamage = val; obj = (object)val; } HealthComponent.TakeDamage += (hook_TakeDamage)obj; GlobalEventManager.onServerDamageDealt += ServerDamageDealt; object obj2 = <>c.<>9__7_0; if (obj2 == null) { hook_OnEnter val2 = delegate(orig_OnEnter orig, BaseFireSidearmRevolverState self) { if (self is FireSidearmResetRevolver) { IsRevolver = true; } else { IsRevolver = false; } orig.Invoke(self); }; <>c.<>9__7_0 = val2; obj2 = (object)val2; } BaseFireSidearmRevolverState.OnEnter += (hook_OnEnter)obj2; object obj3 = <>c.<>9__7_1; if (obj3 == null) { hook_ModifyBullet val3 = delegate(orig_ModifyBullet orig, Bandit2FireRifle self, BulletAttack bulletAttack) { if (config.Blast.Value) { ((GenericBulletBaseState)self).minSpread = 0f; ((GenericBulletBaseState)self).maxSpread = 0.3f; ((GenericBulletBaseState)self).spreadBloomValue = 0.3f; ((GenericBulletBaseState)self).damageCoefficient = 3.8f; } orig.Invoke(self, bulletAttack); }; <>c.<>9__7_1 = val3; obj3 = (object)val3; } Bandit2FireRifle.ModifyBullet += (hook_ModifyBullet)obj3; } private static void UpdateSkills() { if (config.LightsOut.Value) { revolver.skillDescriptionToken = "NewRevolverDesc"; revolver.keywordTokens = new string[2] { "KEYWORD_SLAYER", "KEYWORD_DEATH" }; } else { revolver.skillDescriptionToken = originalRevolverDesc; revolver.keywordTokens = originalRevolverDesc2; } if (config.Blast.Value) { Blast.skillDescriptionToken = "NewRifleDesc"; } else { Blast.skillDescriptionToken = OriginalBlastDesc; } if (config.Dagger.Value) { Blade.baseMaxStock = 2; } else { Blade.baseMaxStock = 1; } } private static void ServerDamageDealt(DamageReport damageReport) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Invalid comparison between Unknown and I4 if (!config.LightsOut.Value) { return; } DamageInfo damageInfo = damageReport.damageInfo; bool flag = (damageInfo.damageType.damageType & 4) > 0; if (damageInfo.crit && IsRevolver && flag) { CharacterBody attackerBody = damageReport.attackerBody; if (Object.op_Implicit((Object)(object)attackerBody) && Object.op_Implicit((Object)(object)attackerBody.skillLocator)) { SkillLocator skillLocator = attackerBody.skillLocator; skillLocator.GetSkill((SkillSlot)0).Reset(); skillLocator.GetSkill((SkillSlot)1).Reset(); skillLocator.GetSkill((SkillSlot)2).Reset(); } } } private static void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Invalid comparison between Unknown and I4 if (!config.LightsOut.Value) { orig.Invoke(self, damageInfo); return; } CharacterBody val = (Object.op_Implicit((Object)(object)damageInfo.attacker) ? damageInfo.attacker.GetComponent() : null); bool flag = (damageInfo.damageType.damageType & 4) > 0; if (Object.op_Implicit((Object)(object)self.body) && self.body.HasBuff(Buffs.SuperBleed) && flag) { damageInfo.damage *= 2.5f; if (Object.op_Implicit((Object)(object)val)) { val.AddTimedBuff(Buffs.FullCrit, 2f); } } orig.Invoke(self, damageInfo); } } public static class BlightTweak { [CompilerGenerated] private static class <>O { public static Action <0>__UpdateSkills; public static hook_InflictDot_refInflictDotInfo <1>__DotController_InflictDot_refInflictDotInfo; public static hook_TakeDamage <2>__HealthComponent_TakeDamage; } private static SkillDef Blightdef; private static string OriginalBlightDesc; public static float BlightProcCoefficient = 0.5f; [SystemInitializer(new Type[] { typeof(DotController) })] public static void init() { //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_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) //IL_0079: 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 Blightdef = Addressables.LoadAssetAsync((object)"RoR2/Base/Croco/CrocoPassiveBlight.asset").WaitForCompletion(); OriginalBlightDesc = Blightdef.skillDescriptionToken; LanguageAPI.Add("NewBlightDesc", "Attacks that apply Poison apply stacking Blight instead, dealing 100% damage per second. New stacks extends all stacks durations. Can activate items"); config.OnConfigChanged += UpdateSkills; UpdateSkills(); object obj = <>O.<1>__DotController_InflictDot_refInflictDotInfo; if (obj == null) { hook_InflictDot_refInflictDotInfo val = DotController_InflictDot_refInflictDotInfo; <>O.<1>__DotController_InflictDot_refInflictDotInfo = val; obj = (object)val; } DotController.InflictDot_refInflictDotInfo += (hook_InflictDot_refInflictDotInfo)obj; object obj2 = <>O.<2>__HealthComponent_TakeDamage; if (obj2 == null) { hook_TakeDamage val2 = HealthComponent_TakeDamage; <>O.<2>__HealthComponent_TakeDamage = val2; obj2 = (object)val2; } HealthComponent.TakeDamage += (hook_TakeDamage)obj2; } private static void UpdateSkills() { if (config.Blight.Value) { Blightdef.skillDescriptionToken = "NewBlightDesc"; } else { Blightdef.skillDescriptionToken = OriginalBlightDesc; } } private static void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 //IL_0046: Unknown result type (might be due to invalid IL or missing references) if (config.Blight.Value && (int)damageInfo.dotIndex == 5 && (Object)(object)damageInfo.inflictor.GetComponent() != (Object)null) { damageInfo.procCoefficient = 0.65f; damageInfo.procChainMask = default(ProcChainMask); CharacterBody component = damageInfo.attacker.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { damageInfo.crit = component.RollCrit(); } orig.Invoke(self, damageInfo); GlobalEventManager.instance.OnHitEnemy(damageInfo, ((Component)self).gameObject); GlobalEventManager.instance.OnHitAll(damageInfo, ((Component)self).gameObject); } else { orig.Invoke(self, damageInfo); } } private static void DotController_InflictDot_refInflictDotInfo(orig_InflictDot_refInflictDotInfo orig, ref InflictDotInfo inflictDotInfo) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Invalid comparison between Unknown and I4 if (config.Blight.Value && (int)inflictDotInfo.dotIndex == 5) { inflictDotInfo.damageMultiplier += 0.67f; inflictDotInfo.duration = 6f; if (Object.op_Implicit((Object)(object)inflictDotInfo.victimObject)) { DotController val = DotController.FindDotController(inflictDotInfo.victimObject); if (Object.op_Implicit((Object)(object)val) && val.dotStackList != null) { foreach (DotStack dotStack in val.dotStackList) { if ((int)dotStack.dotIndex == 5) { dotStack.timer += 2f; } } } } } orig.Invoke(ref inflictDotInfo); } } public static class config { public static ConfigEntry LightsOut; public static ConfigEntry Blast; public static ConfigEntry Dagger; public static ConfigEntry FlameThrower; public static ConfigEntry ArrowRain; public static ConfigEntry Blink; public static ConfigEntry LaserFather; public static ConfigEntry HH44; public static ConfigEntry PolarMines; public static ConfigEntry Blight; public static event Action OnConfigChanged; public static void init(ConfigFile config) { LightsOut = config.Bind("Bandit", "Lights Out", true, "Enables the Lights Out changes."); Blast = config.Bind("Bandit", "Blast", true, "Enables the Blast changes."); Dagger = config.Bind("Bandit", "Serrated Dagger", true, "Enables the Serrated Dagger changes."); FlameThrower = config.Bind("Artificer", "Flame Thrower", true, "Enables the Flame Thrower changes."); ArrowRain = config.Bind("Huntress", "Arrow Rain", true, "Enables the Arrow Rain changes"); Blink = config.Bind("Huntress", "Blink", true, "Enables the Blink changes."); LaserFather = config.Bind("False Son", "Laser of The Father", true, "Enables the Laser of The Father changes"); HH44 = config.Bind("RailGunner", "HH44", true, "Enables the HH44 changes"); PolarMines = config.Bind("RailGunner", "Polar Mines", true, "Enables the Polar Mines changes"); Blight = config.Bind("Acrid", "Blight", true, "Enables the Blight changes"); BindSettingChanged(LightsOut); BindSettingChanged(Blast); BindSettingChanged(Dagger); BindSettingChanged(FlameThrower); BindSettingChanged(ArrowRain); BindSettingChanged(Blink); BindSettingChanged(LaserFather); BindSettingChanged(HH44); BindSettingChanged(PolarMines); BindSettingChanged(Blight); if (Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions")) { AddConfig(); } } private static void BindSettingChanged(ConfigEntry entry) { entry.SettingChanged += delegate { config.OnConfigChanged?.Invoke(); }; } [MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] private static void AddConfig() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(LightsOut)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Blast)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Dagger)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(FlameThrower)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(ArrowRain)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Blink)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(LaserFather)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(HH44)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(PolarMines)); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(Blight)); } } public static class FlameThrowerTweak { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_OnEnter <>9__8_0; public static hook_FixedUpdate <>9__8_1; internal void b__8_0(orig_OnEnter orig, Flamethrower self) { orig.Invoke(self); if (config.FlameThrower.Value) { self.entryDuration = 0.3f; self.tickDamageCoefficient *= 2.5f; Flamethrower.ignitePercentChance = 100f; self.maxDistance = newRange; float scaleRatio = newRange / 16f; if ((Object)(object)((EntityState)self).characterMotor != (Object)null) { ((BaseCharacterController)((EntityState)self).characterMotor).Motor.ForceUnground(jumpDuration); ((EntityState)self).characterMotor.velocity.y = 0f; } ScaleFlamethrowerVisual(self.leftFlamethrowerEffectInstance, scaleRatio); ScaleFlamethrowerVisual(self.rightFlamethrowerEffectInstance, scaleRatio); } } internal void b__8_1(orig_FixedUpdate orig, Flamethrower self) { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (config.FlameThrower.Value) { if (((EntityState)self).fixedAge <= jumpDuration && (Object)(object)((EntityState)self).characterMotor != (Object)null && (Object)(object)((EntityState)self).characterBody != (Object)null) { float num = ((EntityState)self).fixedAge / jumpDuration; float num2 = speedCurve.Evaluate(num); float num3 = ((EntityState)self).characterBody.moveSpeed * baseSpeedMultiplier * num2; CharacterMotor characterMotor = ((EntityState)self).characterMotor; characterMotor.rootMotion += Vector3.up * (num3 * Time.fixedDeltaTime); ((EntityState)self).characterMotor.velocity.y = 0f; } else if (((EntityState)self).fixedAge <= gravityDelay + jumpDuration) { ((EntityState)self).characterMotor.velocity.y = Mathf.Max(((EntityState)self).characterMotor.velocity.y, 0f); } } } } private static SkillDef FlameThrowerr; private static string OriginalFlameDesc; private static string[] OriginalFlameDesc2; private static float newRange = 45f; private static float jumpDuration = 0.5f; private static float baseSpeedMultiplier = 3.5f; private static float gravityDelay = 0.5f; private static readonly AnimationCurve speedCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[3] { new Keyframe(0f, 1f), new Keyframe(0.7f, 0.5f), new Keyframe(1f, 0f) }); public static void init() { //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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown FlameThrowerr = Addressables.LoadAssetAsync((object)"RoR2/Base/Mage/MageBodyFlamethrower.asset").WaitForCompletion(); OriginalFlameDesc = FlameThrowerr.skillDescriptionToken; OriginalFlameDesc2 = FlameThrowerr.keywordTokens; config.OnConfigChanged += UpdateSkills; UpdateSkills(); LanguageAPI.Add("MageFlamethrowerNewDesc", "Ignite. Burn all enemies in front of you for 5000% damage."); object obj = <>c.<>9__8_0; if (obj == null) { hook_OnEnter val = delegate(orig_OnEnter orig, Flamethrower self) { orig.Invoke(self); if (config.FlameThrower.Value) { self.entryDuration = 0.3f; self.tickDamageCoefficient *= 2.5f; Flamethrower.ignitePercentChance = 100f; self.maxDistance = newRange; float scaleRatio = newRange / 16f; if ((Object)(object)((EntityState)self).characterMotor != (Object)null) { ((BaseCharacterController)((EntityState)self).characterMotor).Motor.ForceUnground(jumpDuration); ((EntityState)self).characterMotor.velocity.y = 0f; } ScaleFlamethrowerVisual(self.leftFlamethrowerEffectInstance, scaleRatio); ScaleFlamethrowerVisual(self.rightFlamethrowerEffectInstance, scaleRatio); } }; <>c.<>9__8_0 = val; obj = (object)val; } Flamethrower.OnEnter += (hook_OnEnter)obj; object obj2 = <>c.<>9__8_1; if (obj2 == null) { hook_FixedUpdate val2 = delegate(orig_FixedUpdate orig, Flamethrower self) { //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (config.FlameThrower.Value) { if (((EntityState)self).fixedAge <= jumpDuration && (Object)(object)((EntityState)self).characterMotor != (Object)null && (Object)(object)((EntityState)self).characterBody != (Object)null) { float num = ((EntityState)self).fixedAge / jumpDuration; float num2 = speedCurve.Evaluate(num); float num3 = ((EntityState)self).characterBody.moveSpeed * baseSpeedMultiplier * num2; CharacterMotor characterMotor = ((EntityState)self).characterMotor; characterMotor.rootMotion += Vector3.up * (num3 * Time.fixedDeltaTime); ((EntityState)self).characterMotor.velocity.y = 0f; } else if (((EntityState)self).fixedAge <= gravityDelay + jumpDuration) { ((EntityState)self).characterMotor.velocity.y = Mathf.Max(((EntityState)self).characterMotor.velocity.y, 0f); } } }; <>c.<>9__8_1 = val2; obj2 = (object)val2; } Flamethrower.FixedUpdate += (hook_FixedUpdate)obj2; } private static void UpdateSkills() { if (config.FlameThrower.Value) { FlameThrowerr.skillDescriptionToken = "MageFlamethrowerNewDesc"; FlameThrowerr.keywordTokens = new string[1] { "KEYWORD_IGNITE" }; } else { FlameThrowerr.skillDescriptionToken = OriginalFlameDesc; FlameThrowerr.keywordTokens = OriginalFlameDesc2; } } private static void ScaleFlamethrowerVisual(GameObject effectInstance, float scaleRatio) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)effectInstance == (Object)null) { return; } ParticleSystem[] componentsInChildren = effectInstance.GetComponentsInChildren(); ParticleSystem[] array = componentsInChildren; foreach (ParticleSystem val in array) { string name = ((Object)((Component)val).gameObject).name; if (!(name == "IcoCharge")) { MainModule main = val.main; ((MainModule)(ref main)).startSpeedMultiplier = ((MainModule)(ref main)).startSpeedMultiplier * scaleRatio; if (name == "FireForward" || name == "Billboard") { ((MainModule)(ref main)).startSizeMultiplier = ((MainModule)(ref main)).startSizeMultiplier * 1.5f; } } } } } [BepInPlugin("com.MiIsaarks.ForgottenSkillsTweaks", "ForgottenSkillsTweaks", "0.4.3")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class MainPlugin : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_FireBullet <>9__7_0; public static hook_OnEnter <>9__7_2; public static hook_GetGrowthLaserBonusDuration <>9__7_3; public static hook_Fire <>9__7_4; public static hook_OnEnter <>9__7_5; internal void b__7_0(orig_FireBullet orig, LaserFatherCharged self, Transform a, Ray b, string c, float d) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) light = true; orig.Invoke(self, a, b, c, d); light = false; } internal void b__7_2(orig_OnEnter orig, LaserFather self) { if (config.LaserFather.Value) { self.baseChargeDuration = 0.5f; } orig.Invoke(self); } internal float b__7_3(orig_GetGrowthLaserBonusDuration orig, FalseSonController self) { if (config.LaserFather.Value) { return 0f; } return orig.Invoke(self); } internal void b__7_4(orig_Fire orig, BulletAttack self) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)self.owner != (Object)null && config.LaserFather.Value) { CharacterBody component = self.owner.GetComponent(); if ((Object)(object)component != (Object)null && component.bodyIndex == BodyCatalog.FindBodyIndex("FalseSonBody")) { EntityStateMachine val = EntityStateMachine.FindByCustomName(self.owner, "Weapon"); if ((Object)(object)val != (Object)null && val.state is LaserFatherCharged) { self.falloffModel = (FalloffModel)0; } } } orig.Invoke(self); } internal void b__7_5(orig_OnEnter orig, LaserFatherCharged self) { orig.Invoke(self); if (config.LaserFather.Value) { LaserFatherCharged.procCoefficientPerTick = 0.7f; self.spikeRefillAmountPerSecond = 0f; } else { LaserFatherCharged.procCoefficientPerTick = 0.45f; } float num = (((EntityState)self).characterBody.attackSpeed - ((EntityState)self).characterBody.baseAttackSpeed) * 0.3f; self.fireFrequency = LaserFatherCharged.baseFireFrequency * (1f + num); hitcount = 1; SkillLocator skillLocator = ((EntityState)self).characterBody.skillLocator; if ((Object)(object)skillLocator != (Object)null && config.LaserFather.Value) { float num2 = skillLocator.GetSkill((SkillSlot)1).maxStock; float num3 = skillLocator.GetSkill((SkillSlot)1).stock; int num4 = (int)(num2 * 0.5f); ((EntityState)self).skillLocator.GetSkill((SkillSlot)1).stock = (int)Mathf.Clamp(num3 + (float)num4, num3, num2); } if (!originalDamage.HasValue) { originalDamage = LaserFatherCharged.damageCoefficient * 1.35f; } FalseSonController component = ((Component)((EntityState)self).characterBody).GetComponent(); if ((Object)(object)component != (Object)null && config.LaserFather.Value) { int growthLevel = component.growthLevel; float num5 = 1f + (float)growthLevel * 0.05f; LaserFatherCharged.damageCoefficient = originalDamage.Value * num5; } else { LaserFatherCharged.damageCoefficient = originalDamage.Value / 1.35f; } } } private static int hitsToLightning = 10; private static int hitcount = 0; private static float? originalDamage = null; private static SkillDef FalseSonLaserF; private static string OriginalFalseSonLaserDesc; private static string[] OriginalFalseSonLaserDesc2; private static bool light = false; public void Awake() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Expected O, but got Unknown //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Expected O, but got Unknown //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Expected O, but got Unknown config.init(((BaseUnityPlugin)this).Config); FlameThrowerTweak.init(); ArrowRainTweak.init(); BlightTweak.init(); RailGunner.init(); Bandit.init(); GameObject Lightning = Addressables.LoadAssetAsync((object)"RoR2/DLC2/FalseSon/LunarStakeLightningStrikeImpactEffect.prefab").WaitForCompletion(); object obj = <>c.<>9__7_0; if (obj == null) { hook_FireBullet val = delegate(orig_FireBullet orig, LaserFatherCharged self, Transform a, Ray b, string c, float d) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) light = true; orig.Invoke(self, a, b, c, d); light = false; }; <>c.<>9__7_0 = val; obj = (object)val; } LaserFatherCharged.FireBullet += (hook_FireBullet)obj; BulletAttack.DefaultHitCallbackImplementation += (hook_DefaultHitCallbackImplementation)delegate(orig_DefaultHitCallbackImplementation orig, BulletAttack self, ref BulletHit bullethit) { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Expected O, but got Unknown //IL_011b: Unknown result type (might be due to invalid IL or missing references) bool result = orig.Invoke(self, ref bullethit); if (!light) { return result; } if ((Object)(object)bullethit.entityObject.GetComponent() != (Object)null && config.LaserFather.Value) { hitcount++; if (hitcount % hitsToLightning == 0) { GameObject inflictor = Object.Instantiate(Lightning, bullethit.entityObject.transform.position, Quaternion.identity); BlastAttack val6 = new BlastAttack { attacker = self.owner, position = bullethit.point, inflictor = inflictor, baseDamage = self.damage * 3.5f, crit = self.isCrit, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.op_Implicit((DamageTypeExtended)8192), radius = 6f, procCoefficient = 1f, falloffModel = (FalloffModel)0, teamIndex = TeamComponent.GetObjectTeam(self.owner) }; val6.Fire(); } } return result; }; object obj2 = <>c.<>9__7_2; if (obj2 == null) { hook_OnEnter val2 = delegate(orig_OnEnter orig, LaserFather self) { if (config.LaserFather.Value) { self.baseChargeDuration = 0.5f; } orig.Invoke(self); }; <>c.<>9__7_2 = val2; obj2 = (object)val2; } LaserFather.OnEnter += (hook_OnEnter)obj2; FalseSonLaserF = Addressables.LoadAssetAsync((object)"RoR2/DLC2/FalseSon/FalseSonBodyLaser.asset").WaitForCompletion(); OriginalFalseSonLaserDesc = FalseSonLaserF.skillDescriptionToken; OriginalFalseSonLaserDesc2 = FalseSonLaserF.keywordTokens; LanguageAPI.Add("FalseSonLaserDescriptionNew", "Charge a rapidly hitting laser dealing 320%-1890% damage for 4s and refill Lunar Spikes. Increases in damage through Growth. Summons Lightning on repeated hits."); LanguageAPI.Add("KEYWORD_LASER_LIGHTNING", "Brother's LightningEvery 10 hits with the laser, call down a lightning strike dealing 350% of the laser's damage."); config.OnConfigChanged += UpdateSkills; UpdateSkills(); object obj3 = <>c.<>9__7_3; if (obj3 == null) { hook_GetGrowthLaserBonusDuration val3 = (orig_GetGrowthLaserBonusDuration orig, FalseSonController self) => config.LaserFather.Value ? 0f : orig.Invoke(self); <>c.<>9__7_3 = val3; obj3 = (object)val3; } FalseSonController.GetGrowthLaserBonusDuration += (hook_GetGrowthLaserBonusDuration)obj3; object obj4 = <>c.<>9__7_4; if (obj4 == null) { hook_Fire val4 = delegate(orig_Fire orig, BulletAttack self) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)self.owner != (Object)null && config.LaserFather.Value) { CharacterBody component = self.owner.GetComponent(); if ((Object)(object)component != (Object)null && component.bodyIndex == BodyCatalog.FindBodyIndex("FalseSonBody")) { EntityStateMachine val6 = EntityStateMachine.FindByCustomName(self.owner, "Weapon"); if ((Object)(object)val6 != (Object)null && val6.state is LaserFatherCharged) { self.falloffModel = (FalloffModel)0; } } } orig.Invoke(self); }; <>c.<>9__7_4 = val4; obj4 = (object)val4; } BulletAttack.Fire += (hook_Fire)obj4; object obj5 = <>c.<>9__7_5; if (obj5 == null) { hook_OnEnter val5 = delegate(orig_OnEnter orig, LaserFatherCharged self) { orig.Invoke(self); if (config.LaserFather.Value) { LaserFatherCharged.procCoefficientPerTick = 0.7f; self.spikeRefillAmountPerSecond = 0f; } else { LaserFatherCharged.procCoefficientPerTick = 0.45f; } float num = (((EntityState)self).characterBody.attackSpeed - ((EntityState)self).characterBody.baseAttackSpeed) * 0.3f; self.fireFrequency = LaserFatherCharged.baseFireFrequency * (1f + num); hitcount = 1; SkillLocator skillLocator = ((EntityState)self).characterBody.skillLocator; if ((Object)(object)skillLocator != (Object)null && config.LaserFather.Value) { float num2 = skillLocator.GetSkill((SkillSlot)1).maxStock; float num3 = skillLocator.GetSkill((SkillSlot)1).stock; int num4 = (int)(num2 * 0.5f); ((EntityState)self).skillLocator.GetSkill((SkillSlot)1).stock = (int)Mathf.Clamp(num3 + (float)num4, num3, num2); } if (!originalDamage.HasValue) { originalDamage = LaserFatherCharged.damageCoefficient * 1.35f; } FalseSonController component = ((Component)((EntityState)self).characterBody).GetComponent(); if ((Object)(object)component != (Object)null && config.LaserFather.Value) { int growthLevel = component.growthLevel; float num5 = 1f + (float)growthLevel * 0.05f; LaserFatherCharged.damageCoefficient = originalDamage.Value * num5; } else { LaserFatherCharged.damageCoefficient = originalDamage.Value / 1.35f; } }; <>c.<>9__7_5 = val5; obj5 = (object)val5; } LaserFatherCharged.OnEnter += (hook_OnEnter)obj5; } private static void UpdateSkills() { if (config.LaserFather.Value) { FalseSonLaserF.baseRechargeInterval = 10f; FalseSonLaserF.skillDescriptionToken = "FalseSonLaserDescriptionNew"; FalseSonLaserF.keywordTokens = new string[2] { "KEYWORD_GROWTH", "KEYWORD_LASER_LIGHTNING" }; } else { FalseSonLaserF.baseRechargeInterval = 15f; FalseSonLaserF.skillDescriptionToken = OriginalFalseSonLaserDesc; FalseSonLaserF.keywordTokens = OriginalFalseSonLaserDesc2; } } } public static class RailGunner { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static hook_OnEnter <>9__5_0; public static Action <>9__5_1; public static Action <>9__5_2; internal void b__5_0(orig_OnEnter orig, BaseFireSnipe self) { if (config.HH44.Value) { if (self is FireSnipeLight) { ((GenericBulletBaseState)self).damageCoefficient = 5f + consecutiveWeakSpotHit; } if (self is FireSnipeCryo) { ((GenericBulletBaseState)self).damageCoefficient = ((GenericBulletBaseState)self).damageCoefficient + consecutiveWeakSpotHit; } if (self is FireSnipeSuper) { ((GenericBulletBaseState)self).damageCoefficient = ((GenericBulletBaseState)self).damageCoefficient + consecutiveWeakSpotHit; } } orig.Invoke(self); } internal void b__5_1(DamageInfo damageInfo) { if (consecutiveWeakSpotHit < 10f) { consecutiveWeakSpotHit += 1f; } } internal void b__5_2() { consecutiveWeakSpotHit = 0f; } } private static float consecutiveWeakSpotHit; private static SkillDef SlowMine; private static SkillDef HH44; private static string originalHH44Desc; private static string[] originalHH44Desc2; public static void init() { //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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown SlowMine = Addressables.LoadAssetAsync((object)"RoR2/DLC1/Railgunner/RailgunnerBodyFireMineBlinding.asset").WaitForCompletion(); HH44 = Addressables.LoadAssetAsync((object)"RoR2/DLC1/Railgunner/RailgunnerBodyScopeLight.asset").WaitForCompletion(); originalHH44Desc = HH44.skillDescriptionToken; originalHH44Desc2 = HH44.keywordTokens; LanguageAPI.Add("HH44NewDescription", "Activate your short-range scope, highlighting Weak Points and transforming your weapon into a quick 500% damage railgun. Consecutive Weak Point hits increases damage"); LanguageAPI.Add("KEYWORD_CONSECUTIVE", "Sniper's FlowConsecutive Weak Point hits boost the damage of your next shot by 100% per consecutive hit up to 10 times."); config.OnConfigChanged += UpdateSkills; object obj = <>c.<>9__5_0; if (obj == null) { hook_OnEnter val = delegate(orig_OnEnter orig, BaseFireSnipe self) { if (config.HH44.Value) { if (self is FireSnipeLight) { ((GenericBulletBaseState)self).damageCoefficient = 5f + consecutiveWeakSpotHit; } if (self is FireSnipeCryo) { ((GenericBulletBaseState)self).damageCoefficient = ((GenericBulletBaseState)self).damageCoefficient + consecutiveWeakSpotHit; } if (self is FireSnipeSuper) { ((GenericBulletBaseState)self).damageCoefficient = ((GenericBulletBaseState)self).damageCoefficient + consecutiveWeakSpotHit; } } orig.Invoke(self); }; <>c.<>9__5_0 = val; obj = (object)val; } BaseFireSnipe.OnEnter += (hook_OnEnter)obj; BaseFireSnipe.onWeakPointHit += delegate { if (consecutiveWeakSpotHit < 10f) { consecutiveWeakSpotHit += 1f; } }; BaseFireSnipe.onWeakPointMissed += delegate { consecutiveWeakSpotHit = 0f; }; } private static void UpdateSkills() { if (config.HH44.Value) { HH44.skillDescriptionToken = "HH44NewDescription"; HH44.keywordTokens = new string[2] { "KEYWORD_WEAKPOINT", "KEYWORD_CONSECUTIVE" }; } else { HH44.skillDescriptionToken = originalHH44Desc; HH44.keywordTokens = originalHH44Desc2; } if (config.PolarMines.Value) { SlowMine.baseRechargeInterval = 8f; SlowMine.baseMaxStock = 2; } else { SlowMine.baseRechargeInterval = 12f; SlowMine.baseMaxStock = 1; } } } }