Decompiled source of AnarchyMetamorphosis v1.0.0

AnarchyMetamorphosis.dll

Decompiled a month ago
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;
using RoR2;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("AnarchyMetamorphosis")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("AnarchyMetamorphosis")]
[assembly: AssemblyTitle("AnarchyMetamorphosis")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace AnarchyMetamorphosis;

[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("Ineophobe.AnarchyMetamorphosis", "AnarchyMetamorphosis", "1.0.0")]
public class MetamorphosisPlugin : BaseUnityPlugin
{
	public const string PluginGUID = "Ineophobe.AnarchyMetamorphosis";

	public const string PluginAuthor = "Ineophobe";

	public const string PluginName = "AnarchyMetamorphosis";

	public const string PluginVersion = "1.0.0";

	public void Awake()
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		new Harmony("Ineophobe.AnarchyMetamorphosis").PatchAll();
		((BaseUnityPlugin)this).Logger.LogInfo((object)"AnarchyMetamorphosis loaded successfully!");
	}
}
[HarmonyPatch(typeof(CharacterMaster), "PickRandomSurvivorBodyPrefab")]
public static class PickRandomSurvivorBodyPrefabPatch
{
	public static bool Prefix(ref GameObject __result, Xoroshiro128Plus rng, NetworkUser networkUser, bool allowHidden)
	{
		GameObject[] array = BodyCatalog.allBodyPrefabs.Where((GameObject prefab) => (Object)(object)prefab.GetComponent<SetStateOnHurt>() != (Object)null).ToArray();
		__result = rng.NextElementUniform<GameObject>(array);
		return false;
	}
}