using System;
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.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("MaskRemover")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MaskRemover")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("0e64dde3-171b-49a5-8732-2d1dfd821a70")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace MaskRemover;
[HarmonyPatch(typeof(MaskedPlayerEnemy))]
internal class MaskedPlayerEnemyPatch
{
[HarmonyPatch("Start")]
[HarmonyPostfix]
public static void PatchStart(MaskedPlayerEnemy __instance)
{
try
{
Object.Destroy((Object)(object)((Component)((Component)__instance).gameObject.transform.Find("ScavengerModel").Find("metarig").Find("spine")
.Find("spine.001")
.Find("spine.002")
.Find("spine.003")
.Find("spine.004")
.Find("HeadMaskComedy")
.Find("ComedyMaskLOD1")).gameObject.GetComponent<MeshRenderer>());
}
catch
{
Console.WriteLine("Unable to remove mask from masked enemy");
}
try
{
Object.Destroy((Object)(object)((Component)((Component)__instance).gameObject.transform.Find("ScavengerModel").Find("metarig").Find("spine")
.Find("spine.001")
.Find("spine.002")
.Find("spine.003")
.Find("spine.004")
.Find("HeadMaskTragedy")
.Find("ComedyMaskLOD1")).gameObject.GetComponent<MeshRenderer>());
}
catch
{
Console.WriteLine("Unable to remove mask from masked enemy");
}
}
}
[BepInPlugin("com.poseidon.maskremover", "Mask Remover", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
private const string ModGUID = "com.poseidon.maskremover";
private const string ModName = "Mask Remover";
private const string ModVersion = "1.0.0";
private readonly Harmony harmony = new Harmony("com.poseidon.maskremover");
private void Awake()
{
harmony.PatchAll(typeof(MaskedPlayerEnemyPatch));
}
}