using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
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("repo_mod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("repo_mod")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("af5e0028-8f89-49a8-bb71-afc8717cafab")]
[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")]
public class FlyBehavior : MonoBehaviour
{
public bool is_thumbling = false;
public float sprint_mod = 2f;
public float base_mod = 3f;
private bool fly = false;
private Transform aim;
private Rigidbody rb;
private PlayerController pc;
private float mathSprint()
{
if (Input.GetKey((KeyCode)304))
{
return sprint_mod;
}
return 1f;
}
private void apply(Vector3 vec)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: 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_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
Vector3 position = rb.position;
rb.position = new Vector3(position.x + vec.x * Time.deltaTime * base_mod * mathSprint(), position.y + vec.y * Time.deltaTime * base_mod * mathSprint(), position.z + vec.z * Time.deltaTime * base_mod * mathSprint());
}
public void Dis()
{
fly = false;
rb.isKinematic = fly;
((Behaviour)pc).enabled = !fly;
}
public void En()
{
fly = true;
rb.isKinematic = fly;
((Behaviour)pc).enabled = !fly;
}
private void Awake()
{
aim = ((Component)this).gameObject.GetComponent<PlayerController>().cameraGameObject.GetComponent<Transform>();
rb = ((Component)this).gameObject.GetComponent<Rigidbody>();
pc = ((Component)this).gameObject.GetComponent<PlayerController>();
Debug.Log((object)"Fly created!");
}
private void LateUpdate()
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_0129: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
//IL_014f: Unknown result type (might be due to invalid IL or missing references)
//IL_0179: Unknown result type (might be due to invalid IL or missing references)
//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
if (Input.GetKeyDown((KeyCode)111))
{
Vector3 position = rb.position;
rb.position = new Vector3(position.x, position.y + 1f, position.z);
rb.velocity = new Vector3(0f, 0f, 0f);
}
if (Input.GetKeyDown((KeyCode)118))
{
if (is_thumbling)
{
Dis();
}
else
{
fly = !fly;
rb.isKinematic = fly;
((Behaviour)pc).enabled = !fly;
}
}
if (fly)
{
if (Input.GetKey((KeyCode)119))
{
apply(aim.forward);
}
if (Input.GetKey((KeyCode)115))
{
apply(-aim.forward);
}
if (Input.GetKey((KeyCode)97))
{
apply(-aim.right);
}
if (Input.GetKey((KeyCode)100))
{
apply(aim.right);
}
if (Input.GetKey((KeyCode)32))
{
apply(new Vector3(0f, 1f, 0f));
}
if (Input.GetKey((KeyCode)306))
{
apply(new Vector3(0f, -1f, 0f));
}
if (Input.GetKey((KeyCode)101))
{
apply(aim.up);
}
if (Input.GetKey((KeyCode)113))
{
apply(-aim.up);
}
}
}
}
namespace repo_mod;
[BepInPlugin("dev.chair.flymod", "Fly mod", "1.0.3.0")]
public class fly_mod_plug : BaseUnityPlugin
{
public const string pluginGuid = "dev.chair.flymod";
public const string pluginName = "Fly mod";
public const string pluginVersion = "1.0.3.0";
public void Awake()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
Harmony val = new Harmony("dev.chair.flymod");
val.PatchAll();
((BaseUnityPlugin)this).Logger.LogInfo((object)"Hello by chair6798!");
}
}
[HarmonyPatch(typeof(PlayerController), "Start")]
public class FlyPatcher
{
private static void Postfix(PlayerController __instance)
{
((Component)__instance).gameObject.AddComponent<FlyBehavior>();
Debug.Log((object)"Fly component added to PlayerController.");
}
}
[HarmonyPatch(typeof(PlayerAvatar), "TumbleStart")]
public class acttumblePatcher
{
private static void Postfix(PlayerAvatar __instance)
{
GameObject.Find("Controller").GetComponent<FlyBehavior>().Dis();
GameObject.Find("Controller").GetComponent<FlyBehavior>().is_thumbling = true;
Debug.Log((object)"Player tumbled! Disabling fly!");
}
}
[HarmonyPatch(typeof(PlayerAvatar), "TumbleStop")]
public class acttumblePatcher2
{
private static void Postfix(PlayerAvatar __instance)
{
GameObject.Find("Controller").GetComponent<FlyBehavior>().is_thumbling = false;
Debug.Log((object)"Player unthumb! Disabling value!");
}
}