Decompiled source of AlwaysFresh v1.0.0

AlwaysFresh.dll

Decompiled 6 hours ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
[assembly: AssemblyCompany("Gray No More")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Gray No More")]
[assembly: AssemblyTitle("Gray No More")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Gray_No_More;

[BepInPlugin("GrayNoMore.adry.ultrakill", "Gray no More", "1.0.0")]
[BepInProcess("ULTRAKILL.exe")]
public class GrayNoMore : BaseUnityPlugin
{
	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("GrayNoMore.adry.ultrakill");
		val.PatchAll();
	}
}
[HarmonyPatch(typeof(StyleHUD), "DecayFreshness")]
public class PatchDecayFreshness
{
	private static bool Prefix()
	{
		return false;
	}
}
[HarmonyPatch(typeof(StyleHUD), "UpdateFreshness")]
public class PatchUpdateFreshness
{
	private static void Postfix(StyleHUD __instance)
	{
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		object value = AccessTools.Field(typeof(StyleHUD), "gc").GetValue((object)__instance);
		GunControl val = (GunControl)((value is GunControl) ? value : null);
		if (!((Object)(object)val != (Object)null))
		{
			return;
		}
		Enumerator<GameObject> enumerator = val.allWeapons.GetEnumerator();
		try
		{
			while (enumerator.MoveNext())
			{
				GameObject current = enumerator.Current;
				if ((Object)(object)current != (Object)null)
				{
					__instance.SetFreshness(current, 10f);
				}
			}
		}
		finally
		{
			((global::System.IDisposable)enumerator).Dispose();
		}
	}
}
[HarmonyPatch(typeof(StyleHUD), "AddPoints")]
public class PatchAddPoints
{
	private static void Prefix(ref int points, ref GameObject sourceWeapon, StyleHUD __instance)
	{
		points = Mathf.RoundToInt((float)points * 1f);
	}
}