using 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 HarmonyLib;
using InControl;
using Microsoft.CodeAnalysis;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Scuttlebraced")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.0.2.0")]
[assembly: AssemblyInformationalVersion("0.0.2+50df5752f19fbb1ccfec2e05c497f6c23b05eb08")]
[assembly: AssemblyProduct("Scuttlebraced")]
[assembly: AssemblyTitle("Scuttlebraced")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.2.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.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]
[Microsoft.CodeAnalysis.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]
[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;
}
}
}
internal sealed class ConfigurationManagerAttributes
{
public delegate void CustomHotkeyDrawerFunc(ConfigEntryBase setting, ref bool isCurrentlyAcceptingInput);
public bool? ShowRangeAsPercent;
public Action<ConfigEntryBase> CustomDrawer;
public CustomHotkeyDrawerFunc CustomHotkeyDrawer;
public bool? Browsable;
public string Category;
public object DefaultValue;
public bool? HideDefaultButton;
public bool? HideSettingName;
public string Description;
public string DispName;
public int? Order;
public bool? ReadOnly;
public bool? IsAdvanced;
public Func<object, string> ObjToStr;
public Func<string, object> StrToObj;
}
namespace Scuttlebraced
{
[BepInPlugin("bergbok.scuttlebraced", "Scuttlebraced", "0.0.2")]
[BepInProcess("Hollow Knight Silksong")]
public class Scuttlebraced : BaseUnityPlugin
{
[HarmonyPatch(typeof(HeroController), "Update")]
private static class HeroController_Update_Patch
{
[HarmonyPostfix]
private static void Postfix(HeroController __instance)
{
if (PluginEnabled.Value)
{
Extensions.SendEventSafe(__instance.toolEventTarget, "TAKE CONTROL");
__instance.toolEventTarget.SendEvent("SCUTTLE");
}
}
}
[HarmonyPatch(typeof(HeroController), "CanDash")]
private static class HeroController_CanDash_Patch
{
[HarmonyPostfix]
private static void Postfix(HeroController __instance, ref bool __result)
{
if (PluginEnabled.Value)
{
__result = true;
}
}
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
private static class OneAxisInputControl_IsPressed_Patch
{
[HarmonyPostfix]
private static void Postfix(OneAxisInputControl __instance, ref bool __result)
{
if (PluginEnabled.Value)
{
PlayerAction val = (PlayerAction)(object)((__instance is PlayerAction) ? __instance : null);
if (val != null && val.Name == "Dash")
{
__result = true;
}
}
}
}
internal static Scuttlebraced Instance;
internal static ConfigEntry<bool> PluginEnabled;
private void Awake()
{
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
Instance = this;
PluginEnabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, (ConfigDescription)null);
new Harmony("bergbok.scuttlebraced").PatchAll();
((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin loaded and initialized.");
}
}
public static class PluginInfo
{
public const string PLUGIN_GUID = "bergbok.scuttlebraced";
public const string PLUGIN_NAME = "Scuttlebraced";
public const string PLUGIN_VERSION = "0.0.2";
}
}