Due to update 2.4.3, some mods may no longer function. FixedConfig may be necessary.
Decompiled source of StatBoosterAbility v1.0.1
StatBooster.dll
Decompiled 6 months agousing System; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using AbilityApi; using BepInEx; using BoplFixedMath; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("Ghost Ability")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("Ghost Ability")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("9e5d4943-526f-4757-941c-a54b3a9e0064")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] [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 StatBooster { [BepInPlugin("org.000diggity000.StatBoostAbility", "StatBoostAbility", "1.0.0")] public class Plugin : BaseUnityPlugin { public static Stream GetResourceStream(string namespaceName, string path) { return Assembly.GetExecutingAssembly().GetManifestResourceStream(namespaceName + "." + path); } private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) Harmony val = new Harmony("org.000diggity000.StatBoostAbility"); val.PatchAll(); string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); GhostAbility ghostAbility = ConstructInstantAbility<GhostAbility>("Stat Booster"); ((Component)ghostAbility).gameObject.AddComponent<PlayerPhysics>(); Texture2D val2 = new Texture2D(1, 1); ImageConversion.LoadImage(val2, ReadFully(GetResourceStream("StatBooster", "AbilityIcon.png"))); Sprite val3 = Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), new Vector2(0.5f, 0.5f)); NamedSprite val4 = default(NamedSprite); ((NamedSprite)(ref val4))..ctor("Stat Booster", val3, ((Component)ghostAbility).gameObject, true); Api.RegisterNamedSprites(val4, true); } public static byte[] ReadFully(Stream input) { byte[] array = new byte[16384]; using MemoryStream memoryStream = new MemoryStream(); int count; while ((count = input.Read(array, 0, array.Length)) > 0) { memoryStream.Write(array, 0, count); } return memoryStream.ToArray(); } public static T ConstructInstantAbility<T>(string name) where T : MonoUpdatable { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); Object.DontDestroyOnLoad((Object)(object)val); Ability val2 = val.AddComponent<Ability>(); val.AddComponent<FixTransform>(); val.AddComponent<SpriteRenderer>(); val.AddComponent<PlayerBody>(); val.AddComponent<DPhysicsBox>(); val.AddComponent<PlayerCollision>(); MonoUpdatable val3 = (MonoUpdatable)(object)val.AddComponent<T>(); if ((Object)(object)val3 == (Object)null) { Object.Destroy((Object)(object)val); throw new MissingReferenceException("Invalid type was fed to ConstructInstantAbility"); } return (T)(object)val3; } } public class GhostAbility : MonoUpdatable, IAbilityComponent { public Ability ab; private Player player; private FixTransform playerTransform; private PlayerBody body; private PlayerPhysics playerPhysics; private SpriteRenderer spriteRenderer; public void Awake() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) Updater.RegisterUpdatable((MonoUpdatable)(object)this); ab = ((Component)this).GetComponent<Ability>(); ab.Cooldown = (Fix)0L; body = ((Component)this).GetComponent<PlayerBody>(); playerPhysics = ((Component)this).GetComponent<PlayerPhysics>(); spriteRenderer = ((Component)this).GetComponent<SpriteRenderer>(); } public void Update() { } public override void Init() { } private void OldUpdate(Fix simDeltaTime) { } public override void UpdateSim(Fix SimDeltaTime) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) OldUpdate(SimDeltaTime); } public void OnEnterAbility() { //IL_000d: 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_002e: 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_0052: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_0082: 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_00aa: 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_00c6: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) ((Renderer)spriteRenderer).material = ab.GetPlayerInfo().playerMaterial; body.position = ab.GetPlayerInfo().position; playerPhysics.SyncPhysicsTo(ab.GetPlayerInfo()); AbilityExitInfo val = default(AbilityExitInfo); val.position = body.position; val.selfImposedVelocity = body.selfImposedVelocity; ((Component)ab.GetPlayerInfo().slimeController).gameObject.GetComponent<PlayerPhysics>().Speed = (Fix)30L; ((Component)ab.GetPlayerInfo().slimeController).gameObject.GetComponent<PlayerPhysics>().jumpStrength = (Fix)60L; ((Component)ab.GetPlayerInfo().slimeController).gameObject.GetComponent<PlayerPhysics>().gravity_modifier = (Fix)0.7f; ab.Cooldown = (Fix)999999999L; ((AbilityMonoBehaviour)ab).ExitAbility(val); } public void ExitAbility(AbilityExitInfo info) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) ((Behaviour)this).enabled = false; ((AbilityMonoBehaviour)ab).ExitAbility(info); } public void OnScaleChanged(Fix scaleMultiplier) { throw new NotImplementedException(); } } }