using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BoplFixedMath;
using HarmonyLib;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("DeathStar")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DeathStar")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[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")]
namespace DeathStar;
[BepInPlugin("com.codemob.deathstar", "Death Star", "1.0.0")]
public class DeathStar : BaseUnityPlugin
{
public Harmony harmony;
private void Awake()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Expected O, but got Unknown
//IL_0090: Expected O, but got Unknown
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Expected O, but got Unknown
harmony = new Harmony(((BaseUnityPlugin)this).Info.Metadata.GUID);
harmony.PatchAll(typeof(DeathStar));
MethodInfo method = typeof(Beam).GetMethod("UpdateBeam", BindingFlags.Instance | BindingFlags.NonPublic);
MethodInfo method2 = typeof(DeathStar).GetMethod("Beam_UpdateBeam_Postfix", BindingFlags.Static | BindingFlags.Public);
MethodInfo method3 = typeof(DeathStar).GetMethod("Beam_UpdateBeam_Prefix", BindingFlags.Static | BindingFlags.Public);
harmony.Patch((MethodBase)method, new HarmonyMethod(method3), new HarmonyMethod(method2), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
MethodInfo method4 = typeof(Beam).GetMethod("MovePlayer", BindingFlags.Instance | BindingFlags.NonPublic);
MethodInfo method5 = typeof(DeathStar).GetMethod("Beam_MovePlayer", BindingFlags.Static | BindingFlags.Public);
harmony.Patch((MethodBase)method4, (HarmonyMethod)null, new HarmonyMethod(method5), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
}
[HarmonyPatch(typeof(DetPhysics), "AddBeamBody")]
[HarmonyPrefix]
public static void DetPhysics_AddBeamBody(ref BeamBody body)
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
body.scale = (Fix)4L;
}
public static void Beam_UpdateBeam_Postfix(ref PlayerBody ___body, ref Vec2 ___staffDir, ref PlayerPhysics ___physics)
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: 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_001b: Unknown result type (might be due to invalid IL or missing references)
___body.AddForce(-___staffDir * (Fix)0.075);
}
public static void Beam_UpdateBeam_Prefix(ref Beam __instance)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
__instance.angularAimSpeed = (Fix)0.03;
}
public static void Beam_MovePlayer(ref PlayerPhysics ___physics, ref bool ___inAir)
{
if (___physics.IsGrounded() | ___inAir)
{
___physics.AddGravityFactor();
}
if (___physics.IsGrounded())
{
___physics.UnGround(true, true);
}
}
[HarmonyPatch(typeof(Beam), "ExitAbility", new Type[] { typeof(AbilityExitInfo) })]
[HarmonyPrefix]
public static bool Beam_ExitAbility(ref AbilityExitInfo exitInfo)
{
return !exitInfo.justlanded;
}
[HarmonyPatch(typeof(Beam), "UpdateSim")]
[HarmonyPrefix]
public static void Beam_UpdateSim(ref Beam __instance, ref bool ___inAir)
{
___inAir = true;
}
}