Decompiled source of CorpseSkins v1.0.8

corpseskins.dll

Decompiled 11 months ago
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 BepInEx.Configuration;
using BepInEx.Logging;
using GameplayEntities;
using HarmonyLib;
using LLBML.Utils;
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("FixedCameraPlusPlus")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("FixedCameraPlusPlus")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("664de4af-aa69-4f3a-9e6b-dd07c879adf5")]
[assembly: AssemblyFileVersion("1.0.8.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.8.0")]
[module: UnverifiableCode]
namespace corpseSkins;

[BepInPlugin("us.wallace.plugins.llb.corpseSkins", "corpseSkins Plug-In", "1.0.8.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInProcess("LLBlaze.exe")]
public class Plugin : BaseUnityPlugin
{
	private class CorpseEntitySetCharacterPatch
	{
		[HarmonyPatch(typeof(CorpseEntity), "SetCharacter")]
		[HarmonyPrefix]
		public static bool SetCharacter_Prefix(CorpseEntity __instance, Character setCharacter, CharacterVariant variant)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: 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)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Invalid comparison between Unknown and I4
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Invalid comparison between Unknown and I4
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0304: Unknown result type (might be due to invalid IL or missing references)
			//IL_0314: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Invalid comparison between Unknown and I4
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0317: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: Invalid comparison between Unknown and I4
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Invalid comparison between Unknown and I4
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Invalid comparison between Unknown and I4
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Invalid comparison between Unknown and I4
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0215: Invalid comparison between Unknown and I4
			//IL_0339: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Invalid comparison between Unknown and I4
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ab: Invalid comparison between Unknown and I4
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Invalid comparison between Unknown and I4
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Invalid comparison between Unknown and I4
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Invalid comparison between Unknown and I4
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Invalid comparison between Unknown and I4
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Invalid comparison between Unknown and I4
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Invalid comparison between Unknown and I4
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c6: Invalid comparison between Unknown and I4
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Invalid comparison between Unknown and I4
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: Invalid comparison between Unknown and I4
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Invalid comparison between Unknown and I4
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Invalid comparison between Unknown and I4
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Invalid comparison between Unknown and I4
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Invalid comparison between Unknown and I4
			//IL_018e: 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_01a9: Invalid comparison between Unknown and I4
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			if (useRandomCharacter.Value)
			{
				__instance.character = (Character)(0 + Random.Range(0, 11));
			}
			else if (corpsesToDummy.Value && !useRandomCharacter.Value)
			{
				__instance.character = (Character)100;
				if (corpseSkins.Value)
				{
					variant = (CharacterVariant)0;
				}
			}
			else
			{
				__instance.character = setCharacter;
			}
			if (corpseSkins.Value && !corpsesToDummy.Value)
			{
				if ((int)variant == 1)
				{
					variant = (CharacterVariant)1;
				}
				else if ((int)variant == 2)
				{
					variant = (CharacterVariant)2;
				}
				else if ((int)variant == 3)
				{
					variant = (CharacterVariant)3;
				}
				else if ((int)variant == 4)
				{
					variant = (CharacterVariant)4;
				}
				else if ((int)variant == 5)
				{
					variant = (CharacterVariant)5;
				}
				else if ((int)variant == 6)
				{
					variant = (CharacterVariant)6;
				}
				else if ((int)variant == 7)
				{
					variant = (CharacterVariant)7;
				}
				else if ((int)variant == 9)
				{
					variant = (CharacterVariant)9;
				}
				else if ((int)variant == 10)
				{
					variant = (CharacterVariant)10;
				}
				else if ((int)variant == 11)
				{
					variant = (CharacterVariant)11;
				}
				else if ((int)variant == 12)
				{
					variant = (CharacterVariant)12;
				}
				else if ((int)variant == 13)
				{
					variant = (CharacterVariant)13;
				}
				else if ((int)variant == 14)
				{
					variant = (CharacterVariant)14;
				}
				else if ((int)variant == 15)
				{
					variant = (CharacterVariant)15;
				}
				else if ((int)variant == 16)
				{
					variant = (CharacterVariant)16;
				}
			}
			else if (useNoiseClone.Value)
			{
				variant = (CharacterVariant)8;
			}
			else if (makeNoiseClone.Value)
			{
				if (corpsesToDummy.Value)
				{
					__instance.character = (Character)100;
				}
				else
				{
					__instance.character = setCharacter;
				}
				variant = (((int)variant != 9 && (int)variant != 10) ? (((int)variant != 11 && (int)variant != 12) ? ((CharacterVariant)13) : ((CharacterVariant)15)) : ((CharacterVariant)14));
			}
			else if (useRandomSkin.Value)
			{
				variant = (CharacterVariant)(0 + Random.Range(0, 16));
			}
			else if (!corpseSkins.Value)
			{
				if (corpsesToDummy.Value)
				{
					__instance.character = (Character)100;
				}
				else
				{
					__instance.character = setCharacter;
				}
				variant = (((int)variant != 9 && (int)variant != 10) ? (((int)variant != 11 && (int)variant != 12) ? ((CharacterVariant)13) : ((CharacterVariant)15)) : ((CharacterVariant)14));
			}
			AOOJOMIECLD val = JPLELOFJOOH.NEBGBODHHCG(__instance.character, variant);
			((HitableEntity)__instance).standardScale = val.OGMOEKPOBBP;
			((VisualEntity)__instance).SetVisualModel("main", val, false, false);
			((AnimatableEntity)__instance).AddClipsToAnimInfo();
			if ((int)setCharacter != 0 && (int)setCharacter != 2)
			{
				((AnimatableEntity)__instance).SetAnimInfo("knockback", HHBCPNCDNDH.NKKIFJJEPOL(1.0m), false, string.Empty, 0f, false);
			}
			__instance.DisableEffectGameObjects();
			return false;
		}
	}

	private class CJPLELOFJOOHHIDKOLCMMGJPatch
	{
		[HarmonyPatch(typeof(JPLELOFJOOH), "HIDKOLCMMGJ")]
		[HarmonyPrefix]
		public static bool HIDKOLCMMGJ_Prefix(JPLELOFJOOH __instance, List<NCBHPNHFLAJ> KBLOHCMNDEC, NCBHPNHFLAJ PKEOMLCLPNE, CharacterVariant GFBALEFFNKF)
		{
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: 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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: 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_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			if (makeNoiseClone.Value)
			{
				string[] array = new string[PKEOMLCLPNE.MJJFEAGJICG.Length];
				for (int i = 0; i < array.Length; i++)
				{
					array[i] = PKEOMLCLPNE.MJJFEAGJICG[i] + "_Corpse";
				}
				NCBHPNHFLAJ item = default(NCBHPNHFLAJ);
				((NCBHPNHFLAJ)(ref item))..ctor(PKEOMLCLPNE.LALEEFJMMLH, GFBALEFFNKF, PKEOMLCLPNE.BADNNNCEKEF, "ScreenSpaceNoiseOverlayMat", (FKBHNEMDBMK)3, PKEOMLCLPNE.DDHGFDLLDAG);
				KBLOHCMNDEC.Add(item);
			}
			else
			{
				string[] array2 = new string[PKEOMLCLPNE.MJJFEAGJICG.Length];
				for (int j = 0; j < array2.Length; j++)
				{
					array2[j] = PKEOMLCLPNE.MJJFEAGJICG[j] + "_Corpse";
				}
				NCBHPNHFLAJ item2 = default(NCBHPNHFLAJ);
				((NCBHPNHFLAJ)(ref item2))..ctor(PKEOMLCLPNE.LALEEFJMMLH, GFBALEFFNKF, PKEOMLCLPNE.BADNNNCEKEF, array2, PKEOMLCLPNE.MIGKFLKFCIJ, PKEOMLCLPNE.DDHGFDLLDAG);
				KBLOHCMNDEC.Add(item2);
			}
			return false;
		}
	}

	public enum Animation
	{
		ANIM_ABILITYLAND,
		ANIM_BOOST,
		ANIM_BUNT,
		ANIM_BUNTHIT,
		ANIM_BUNTOUT,
		ANIM_CANDYLEFT,
		ANIM_CANDYRIGHT,
		ANIM_CATCH,
		ANIM_CATCHMISSOUT,
		ANIM_CEILINGRIDE,
		ANIM_CLIMBDOWN,
		ANIM_CLIMBIDLE,
		ANIM_CLIMBSWING,
		ANIM_CLIMBSWINGHIT,
		ANIM_CLIMBSWINGOUT,
		ANIM_CLIMBUP,
		ANIM_CROUCH,
		ANIM_CROUCHIN,
		ANIM_CROUCHOUT,
		ANIM_CROUCHTURN,
		ANIM_CUFFHOOKSHOT,
		ANIM_CUFFHOOKSHOTDOWN,
		ANIM_CUFFHOOKSHOTDOWNAIR,
		ANIM_CUFFHOOKSHOTUP,
		ANIM_CUFFPULL,
		ANIM_CUFFSHOOT,
		ANIM_DASH,
		ANIM_DASHIN,
		ANIM_DASHOUT,
		ANIM_DOUBLEJUMP,
		ANIM_DOWNSWING,
		ANIM_DOWNSWINGHIT,
		ANIM_DOWNSWINGOUT,
		ANIM_DROPIN,
		ANIM_EAT,
		ANIM_FALLHOLD,
		ANIM_FLOAT,
		ANIM_FLOATFORWARD,
		ANIM_FLOATTOFLYUP,
		ANIM_FLYUP,
		ANIM_FLYUPTOFLOAT,
		ANIM_FULLSHOT,
		ANIM_GETHIT,
		ANIM_GETUP,
		ANIM_GRAB,
		ANIM_GROUNDKNOCKBACK,
		ANIM_GROUNDPARRYKNOCKBACK,
		ANIM_IDLE,
		ANIM_JUMP,
		ANIM_JUMPFORWARD,
		ANIM_JUMPFORWARDTOFALL,
		ANIM_JUMPHOLD,
		ANIM_JUMPTOFALL,
		ANIM_JUMPTOFLOAT,
		ANIM_KICKFLIP,
		ANIM_KICKFLIPFRONTSMASH,
		ANIM_KICKFLIPNEUTRAL,
		ANIM_KICKFLIPUPSIDEDOWN,
		ANIM_KITE,
		ANIM_KITEIN,
		ANIM_KNOCKBACK,
		ANIM_LAND,
		ANIM_LIEDOWN,
		ANIM_OUTFITPOSE1,
		ANIM_OUTFITPOSE2,
		ANIM_OUTFITPOSE3,
		ANIM_PIECEHIT,
		ANIM_PIECEDISAPPEAR,
		ANIM_PIECEIDLE,
		ANIM_RUN,
		ANIM_RUNLEGSRUN,
		ANIM_RUNLEGSSTARTRUN,
		ANIM_SHADOWBLOB,
		ANIM_SHADOWBUNT,
		ANIM_SHADOWBUNTHIT,
		ANIM_SHADOWBUNTOUT,
		ANIM_SHADOWDROP,
		ANIM_SHADOWEAT,
		ANIM_SHADOWSWING,
		ANIM_SHADOWSWINGHIT,
		ANIM_SHADOWSWINGOUT,
		ANIM_SLIDE,
		ANIM_SMASH,
		ANIM_SMASHFROMOVERHEADTOFRONT,
		ANIM_SMASHFRONTHIT,
		ANIM_SMASHOUTFROMHIT,
		ANIM_SMASHOVERHEADHIT,
		ANIM_SPECIAL,
		ANIM_SPECIALCHARGE,
		ANIM_SPECIALSPIN,
		ANIM_SPITUP,
		ANIM_SPITWINDUP,
		ANIM_STARTCEILINGRIDE,
		ANIM_STARTFLOATFORWARD,
		ANIM_STARTRUN,
		ANIM_STARTRUNTORUN,
		ANIM_STOP,
		ANIM_STOPAIR,
		ANIM_STOPFLOAT,
		ANIM_STORYPOSE1,
		ANIM_STORYPOSE2,
		ANIM_STORYPOSE3,
		ANIM_STORYPOSE4,
		ANIM_STORYPOSE5,
		ANIM_STORYPOSE6,
		ANIM_STORYPOSE7,
		ANIM_STORYPOSE8,
		ANIM_STORYPOSE9,
		ANIM_STORYPOSE10,
		ANIM_STORYPOSE11,
		ANIM_SWING,
		ANIM_SWINGCHARGE,
		ANIM_SWINGHIT,
		ANIM_SWINGOUT,
		ANIM_SWINGWOOSH,
		ANIM_TAUNT,
		ANIM_TAUNTIDLE,
		ANIM_TAUNTOUT,
		ANIM_THROW,
		ANIM_THROWHOLD,
		ANIM_TRYCATCH,
		ANIM_TRYCATCHTEMPOFF,
		ANIM_TURN,
		ANIM_TURNRUN,
		ANIM_WALLGRAB,
		ANIM_WALLJUMP,
		ANIM_WALLRIDE,
		ANIM_WALLSLIDE,
		ANIM_WALLSLIDESTART
	}

	public static ConfigEntry<bool> corpseSkins;

	public static ConfigEntry<bool> corpsesToDummy;

	public static ConfigEntry<bool> useRandomSkin;

	public static ConfigEntry<bool> useRandomCharacter;

	public static ConfigEntry<bool> useNoiseClone;

	public static ConfigEntry<bool> makeNoiseClone;

	public static ManualLogSource Log { get; private set; }

	private void Awake()
	{
		//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dc: Expected O, but got Unknown
		//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: Expected O, but got Unknown
		corpseSkins = ((BaseUnityPlugin)this).Config.Bind<bool>("corpseSkins", "Corpses have skins", true, (ConfigDescription)null);
		corpsesToDummy = ((BaseUnityPlugin)this).Config.Bind<bool>("corpseSkins", "Turn corpes into dummys", false, (ConfigDescription)null);
		useRandomSkin = ((BaseUnityPlugin)this).Config.Bind<bool>("corpseSkins", "Use a randomized skin", false, (ConfigDescription)null);
		useRandomCharacter = ((BaseUnityPlugin)this).Config.Bind<bool>("corpseSkins", "Use a randomized character", false, (ConfigDescription)null);
		useNoiseClone = ((BaseUnityPlugin)this).Config.Bind<bool>("corpseSkins", "Use noise clone for corpses", false, (ConfigDescription)null);
		makeNoiseClone = ((BaseUnityPlugin)this).Config.Bind<bool>("corpseSkins", "Turn corpses into noise clones", false, (ConfigDescription)null);
		((BaseUnityPlugin)this).Config.Bind<string>("CcorpseSkins", "mm_header_qol", "Turning corpses into noise clones REQUIRES Game Restart", new ConfigDescription("", (AcceptableValueBase)null, new object[1] { "modmenu_header" }));
		Log = ((BaseUnityPlugin)this).Logger;
		((BaseUnityPlugin)this).Logger.LogDebug((object)"corpses your skins");
		Harmony val = new Harmony("us.wallace.plugins.llb.corpseSkins");
		val.PatchAll(typeof(CJPLELOFJOOHHIDKOLCMMGJPatch));
		val.PatchAll(typeof(CorpseEntitySetCharacterPatch));
		((BaseUnityPlugin)this).Logger.LogDebug((object)"corpseSkins is loaded");
	}

	private void Start()
	{
		ModDependenciesUtils.RegisterToModMenu(((BaseUnityPlugin)this).Info, (List<string>)null);
	}
}