using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
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("gravityOil")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("gravityOil")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("4025235f-2789-46a5-b28f-835604776883")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
internal IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}
namespace gravityOil
{
[BepInPlugin("capybara7886.ultrakill.gravityOilShot", "Gravity Oil", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
public static bool modEnabled = true;
public StainVoxel stainAtPlayer;
public OilGravityVolume oilGravController;
private 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("lakeullHarmony");
val.PatchAll();
}
private void Update()
{
//IL_0020: 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_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)MonoSingleton<NewMovement>.Instance != (Object)null))
{
return;
}
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(((Component)MonoSingleton<NewMovement>.Instance).transform.localPosition.x, ((Component)MonoSingleton<NewMovement>.Instance).transform.localPosition.y, ((Component)MonoSingleton<NewMovement>.Instance).transform.localPosition.z);
stainAtPlayer = MonoSingleton<StainVoxelManager>.Instance.CreateOrGetVoxel(val, true);
if (stainAtPlayer != null && (Object)(object)stainAtPlayer.staticProxy != (Object)null)
{
VoxelProxy staticProxy = stainAtPlayer.staticProxy;
List<GasolineStain> stains = staticProxy.stains;
for (int i = 0; i < stains.Count; i++)
{
OilGravityVolume orAddComponent = GameObjectExtensions.GetOrAddComponent<OilGravityVolume>(((Component)stains[i]).gameObject);
orAddComponent.GetCanChange(onCreation: false);
}
}
}
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
internal class StainPatch
{
private static void Postfix(ref bool __result)
{
__result = true;
}
}
[HarmonyPatch(typeof(RocketLauncher), "ShootNapalm")]
internal class StainGetter
{
public static bool addedStain;
private static void Postfix(RocketLauncher __instance)
{
if (!addedStain)
{
GameObject gameObject = ((Component)((Component)__instance.napalmProjectile).GetComponent<GasolineProjectile>().stain).gameObject;
if ((Object)(object)gameObject != (Object)null && (Object)(object)gameObject.GetComponent<OilGravityVolume>() == (Object)null)
{
gameObject.AddComponent<OilGravityVolume>();
addedStain = true;
}
}
}
}
public class OilGravityVolume : MonoSingleton<OilGravityVolume>
{
private NewMovement nm;
private Vector3 upSim;
public OilGravityVolume()
{
nm = MonoSingleton<NewMovement>.Instance;
}
private void Awake()
{
Debug.Log((object)"Oil Gravity Volume Mod Loaded!");
GetCanChange(onCreation: true);
}
public void UpdateGravity()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
upSim = new Vector3(Mathf.Round(((Component)this).gameObject.transform.forward.x * 10f) * 4f, Mathf.Round(((Component)this).gameObject.transform.forward.y * 10f) * 4f, Mathf.Round(((Component)this).gameObject.transform.forward.z * 10f) * 4f);
if (!((Vector3)(ref upSim)).Equals(PhysicsExtensions.GetGravityVector(nm.rb)))
{
nm.SwitchGravity(upSim, false, false);
}
}
public void GetCanChange(bool onCreation)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//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)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: 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_005d: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = ((Component)this).transform.position - ((Component)nm).transform.position;
float num = Vector3.Dot(((Component)nm).transform.forward, val);
bool flag = num > 0f;
bool flag2 = 3.5f >= Vector3.Distance(((Component)nm).transform.position, ((Component)this).transform.position);
if (flag && (flag2 || !onCreation))
{
((MonoBehaviour)this).Invoke("UpdateGravity", 0.1f);
}
}
}
}