Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of FalseSon Boss Tweaks v1.0.0
FalseSonTweaks.dll
Decompiled a year agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.FalseSonBoss; using IL.EntityStates.FalseSonBoss; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using On.EntityStates.FalseSonBoss; using R2API; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; 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("FalseSonTweaks")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("FalseSonTweaks")] [assembly: AssemblyTitle("FalseSonTweaks")] [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 FalseSonTweaks { internal class DashChanges { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func<Instruction, bool> <>9__0_2; public static Func<Instruction, bool> <>9__0_3; public static Func<Instruction, bool> <>9__0_4; public static Func<Instruction, bool> <>9__0_5; public static Func<Instruction, bool> <>9__0_6; public static Func<BuffDef, BuffDef> <>9__0_7; public static Manipulator <>9__0_0; public static Func<Instruction, bool> <>9__0_8; public static Func<Instruction, bool> <>9__0_9; public static Func<Instruction, bool> <>9__0_10; public static Func<Instruction, bool> <>9__0_11; public static Func<Instruction, bool> <>9__0_12; public static Func<BuffDef, BuffDef> <>9__0_13; public static Manipulator <>9__0_1; internal void <Init>b__0_0(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); val.GotoNext(new Func<Instruction, bool>[5] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "EntityStates.EntityState", "get_characterBody"), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Buffs", "HiddenInvincibility"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.BuffDef", "get_buffIndex"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "AddBuff") }); val.Index += 3; val.EmitDelegate<Func<BuffDef, BuffDef>>((Func<BuffDef, BuffDef>)((BuffDef buffdef) => Buffs.ArmorBoost)); } internal bool <Init>b__0_2(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool <Init>b__0_3(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "EntityStates.EntityState", "get_characterBody"); } internal bool <Init>b__0_4(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Buffs", "HiddenInvincibility"); } internal bool <Init>b__0_5(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.BuffDef", "get_buffIndex"); } internal bool <Init>b__0_6(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "AddBuff"); } internal BuffDef <Init>b__0_7(BuffDef buffdef) { return Buffs.ArmorBoost; } internal void <Init>b__0_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); val.GotoNext(new Func<Instruction, bool>[5] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "EntityStates.EntityState", "get_characterBody"), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Buffs", "HiddenInvincibility"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.BuffDef", "get_buffIndex"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "RemoveBuff") }); val.Index += 3; val.EmitDelegate<Func<BuffDef, BuffDef>>((Func<BuffDef, BuffDef>)((BuffDef buffdef) => Buffs.ArmorBoost)); } internal bool <Init>b__0_8(Instruction x) { return ILPatternMatchingExt.MatchLdarg(x, 0); } internal bool <Init>b__0_9(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "EntityStates.EntityState", "get_characterBody"); } internal bool <Init>b__0_10(Instruction x) { return ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Buffs", "HiddenInvincibility"); } internal bool <Init>b__0_11(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.BuffDef", "get_buffIndex"); } internal bool <Init>b__0_12(Instruction x) { return ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "RemoveBuff"); } internal BuffDef <Init>b__0_13(BuffDef buffdef) { return Buffs.ArmorBoost; } } public void Init() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown object obj = <>c.<>9__0_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 ILCursor val4 = new ILCursor(il); val4.GotoNext(new Func<Instruction, bool>[5] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "EntityStates.EntityState", "get_characterBody"), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Buffs", "HiddenInvincibility"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.BuffDef", "get_buffIndex"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "AddBuff") }); val4.Index += 3; val4.EmitDelegate<Func<BuffDef, BuffDef>>((Func<BuffDef, BuffDef>)((BuffDef buffdef) => Buffs.ArmorBoost)); }; <>c.<>9__0_0 = val; obj = (object)val; } CorruptedPathsDash.OnEnter += (Manipulator)obj; object obj2 = <>c.<>9__0_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 val3 = new ILCursor(il); val3.GotoNext(new Func<Instruction, bool>[5] { (Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "EntityStates.EntityState", "get_characterBody"), (Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, "RoR2.RoR2Content/Buffs", "HiddenInvincibility"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt(x, "RoR2.BuffDef", "get_buffIndex"), (Instruction x) => ILPatternMatchingExt.MatchCallOrCallvirt<CharacterBody>(x, "RemoveBuff") }); val3.Index += 3; val3.EmitDelegate<Func<BuffDef, BuffDef>>((Func<BuffDef, BuffDef>)((BuffDef buffdef) => Buffs.ArmorBoost)); }; <>c.<>9__0_1 = val2; obj2 = (object)val2; } CorruptedPathsDash.OnExit += (Manipulator)obj2; Log.Info("Dash Changes Loaded"); } } internal class LaserChanges { private BuffDef StopMoving = ScriptableObject.CreateInstance<BuffDef>(); private float laserDuration = 6f; private bool movingChanges = true; private void LoadConfig() { movingChanges = ModConfig.laserMoveChanges.Value; laserDuration = ModConfig.laserDuration.Value; } public void Init() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown LoadConfig(); ((Object)StopMoving).name = "bdStopMovingBuff"; StopMoving.buffColor = Color.red; StopMoving.canStack = false; StopMoving.isDebuff = false; StopMoving.isCooldown = false; StopMoving.isHidden = true; StopMoving.iconSprite = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/Common/bdSlow50.asset").WaitForCompletion().iconSprite; ContentAddition.AddBuffDef(StopMoving); LunarGazeFire.OnEnter += new hook_OnEnter(LunarGazeFire_OnEnter); LunarGazeFire.OnExit += new hook_OnExit(LunarGazeFire_OnExit); RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients); LunarGazeFire.FixedUpdate += new hook_FixedUpdate(LunarGazeFire_FixedUpdate); Log.Info("Laser Changes Loaded"); } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { if (movingChanges && sender.HasBuff(StopMoving)) { args.moveSpeedReductionMultAdd += 1000f; } } private void LunarGazeFire_OnEnter(orig_OnEnter orig, LunarGazeFire self) { LunarGazeFire.minimumDuration = laserDuration; LunarGazeFire.maximumDuration = laserDuration + 0.5f; orig.Invoke(self); if (movingChanges) { ((EntityState)self).characterBody.AddBuff(StopMoving); } } private void LunarGazeFire_OnExit(orig_OnExit orig, LunarGazeFire self) { orig.Invoke(self); if (movingChanges && ((EntityState)self).characterBody.HasBuff(StopMoving)) { ((EntityState)self).characterBody.RemoveBuff(StopMoving); } } private void LunarGazeFire_FixedUpdate(orig_FixedUpdate orig, LunarGazeFire self) { LunarGazeFire.minimumDuration = laserDuration; LunarGazeFire.maximumDuration = laserDuration + 0.5f; orig.Invoke(self); } } 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); } } [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency("com.rune580.riskofoptions", "2.8.2")] [BepInPlugin("0p41.FalseSon_Boss_Tweaks", "FalseSon_Boss_Tweaks", "1.0.0")] public class MainPlugin : BaseUnityPlugin { public const string PluginGUID = "0p41.FalseSon_Boss_Tweaks"; public const string PluginAuthor = "0p41"; public const string PluginName = "FalseSon_Boss_Tweaks"; public const string PluginVersion = "1.0.0"; public void Awake() { Log.Init(((BaseUnityPlugin)this).Logger); ModConfig.Init(((BaseUnityPlugin)this).Config); LaserChanges laserChanges = new LaserChanges(); laserChanges.Init(); if (ModConfig.dashChanges.Value) { DashChanges dashChanges = new DashChanges(); dashChanges.Init(); } } } public static class ModConfig { public static ConfigEntry<bool> laserMoveChanges; public static ConfigEntry<float> laserDuration; private const float defaultLaserDuration = 3f; public static ConfigEntry<bool> dashChanges; public static void Init(ConfigFile config) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Expected O, but got Unknown laserMoveChanges = config.Bind<bool>("Laser Changes", "No Moving While Using Laser", true, "Prevents False Son (Boss) from moving around while using his laser.\nBe careful as he can still attack."); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(laserMoveChanges, true)); laserDuration = config.Bind<float>("Laser Changes", "Duration Of The Laser", 3f, "Duration of False Son (Boss) laser beam in seconds.\nVanilla duration is 6."); ModSettingsManager.AddOption((BaseOption)new StepSliderOption(laserDuration, new StepSliderConfig { min = 0.5f, max = 100f, increment = 0.5f, restartRequired = true })); dashChanges = config.Bind<bool>("Dash Changes", "Change Dash Buff", true, "Toggles if False Son (Boss) gains an armor buff like Mithrix instead of being Immune to all damage when doing his dash attack."); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(dashChanges, true)); } } }