using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using CellMenu;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using TMPro;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("R3")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("R3")]
[assembly: AssemblyTitle("R3")]
[assembly: AssemblyVersion("1.0.0.0")]
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;
}
}
}
namespace R3
{
internal class BlockBooster
{
[HarmonyPatch(typeof(CM_BoosterImplantSlot), "UpdateSlot")]
[HarmonyPostfix]
public static void Post_Slot_Updated(CM_BoosterImplantSlot __instance)
{
((RectTransformComp)__instance).SetVisible(false);
if (__instance.m_player.IsLocal)
{
PersistentInventoryManager.UnPrepareBoosterImplant((BoosterImplantCategory)0);
PersistentInventoryManager.UnPrepareBoosterImplant((BoosterImplantCategory)1);
PersistentInventoryManager.UnPrepareBoosterImplant((BoosterImplantCategory)2);
}
}
}
[BepInPlugin("R3", "R3", "1.0.0")]
public class Plugin : BasePlugin
{
public override void Load()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Expected O, but got Unknown
ManualLogSource log = ((BasePlugin)this).Log;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(17, 0, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Plugin is Loadded");
}
log.LogInfo(val);
Harmony.CreateAndPatchAll(typeof(Patch_WatermarkUpdateWatermark), "Watermark");
Harmony.CreateAndPatchAll(typeof(BlockBooster), "BlockBooster");
Harmony.CreateAndPatchAll(typeof(ReplaceSFX), "ReplaceSFX");
}
}
internal static class Patch_WatermarkUpdateWatermark
{
[HarmonyPatch(typeof(PUI_Watermark), "UpdateWatermark")]
[HarmonyPostfix]
private static void Postfix(PUI_Watermark __instance)
{
string text = "4.6.1+gitf831086-dirty-main".Remove("x.x.x".Length);
((TMP_Text)__instance.m_watermarkText).SetText("EARLY ACCESS V0.25\nCORTEX NI R:L17 20869", true);
}
}
[HarmonyPatch(typeof(CellSoundPlayer), "Post")]
[HarmonyPatch(new Type[]
{
typeof(uint),
typeof(bool)
})]
internal static class ReplaceSFX
{
private static void Prefix(ref uint eventID)
{
if (eventID == 6161465)
{
eventID = 104293300u;
}
if (eventID == 979647287)
{
eventID = 104293300u;
}
if (eventID == 3503398391u)
{
eventID = 104293300u;
}
}
}
}