Decompiled source of DeathOfWorld v1.0.1

DeadlyOfWorld.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using Characters;
using Characters.Abilities.Darks;
using Data;
using DeadlyOfWorld;
using Hardmode;
using HarmonyLib;
using Level;
using Microsoft.CodeAnalysis;
using Services;
using Singletons;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = "")]
[assembly: IgnoresAccessChecksTo("")]
[assembly: AssemblyCompany("DeadlyOfWorld")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("DeadlyWorld")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0")]
[assembly: AssemblyProduct("DeadlyOfWorld")]
[assembly: AssemblyTitle("DeadlyOfWorld")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
[BepInPlugin("DeadlyOfWorld", "DeadlyOfWorld", "1.0")]
public class Plugin : BaseUnityPlugin
{
	public static ConfigEntry<int> Step;

	public static ConfigEntry<int> isSetP;

	public static ConfigEntry<bool> isNoDarker;

	public static ConfigEntry<bool> isParamet;

	private void Awake()
	{
		Step = ((BaseUnityPlugin)this).Config.Bind<int>("General", "난이도", 1, "난이도 : 1\t1.전원검은적\n난이도 : 11\t11.일반적으로 많이나옵니다.\n난이도 : 12\t12.레어하게 많이나옵니다.\n난이도 : 13\t13.유니크하게 나옵니다.\n난이도 : 14\t14.레전드확율로 나옵니다.");
		Step = ((BaseUnityPlugin)this).Config.Bind<int>("General", "확율", 0, "0~100까지의확율로 검은적이 나오게 설정할수있습니다.");
		isNoDarker = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "검은적 정상화", false, "검은적이 나오는것을 되돌립니다.");
		isParamet = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "검은적 확율화", false, "검은적이 나오는것을 직접설정하게 바꿉니다.");
		Harmony.CreateAndPatchAll(typeof(DeadlyPath), (string)null);
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Mod DeadlyOfWorld is loaded!");
	}

	private void Update()
	{
		((BaseUnityPlugin)this).Config.Reload();
	}
}
namespace DeadlyOfWorld
{
	public class DeadlyPath
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(Character), "InitializeActions")]
		private static void CharacterPostfix(ref Character __instance)
		{
			List<Character> list = new List<Character>();
			list.Add(__instance);
			DarkEnemySelector.instance.ElectIn((ICollection<Character>)list);
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(DarkEnemySelector), "ElectIn")]
		private static void SetCounters(object[] __args, ref DarkAbilityConstructor[] ____constructors)
		{
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Expected I4, but got Unknown
			//IL_0215: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_031d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0327: Unknown result type (might be due to invalid IL or missing references)
			//IL_0328: Unknown result type (might be due to invalid IL or missing references)
			//IL_0333: Unknown result type (might be due to invalid IL or missing references)
			//IL_0340: Unknown result type (might be due to invalid IL or missing references)
			//IL_0346: Expected I4, but got Unknown
			//IL_0355: Unknown result type (might be due to invalid IL or missing references)
			//IL_035b: Invalid comparison between Unknown and I4
			//IL_0436: Unknown result type (might be due to invalid IL or missing references)
			//IL_045e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0468: Unknown result type (might be due to invalid IL or missing references)
			//IL_0469: Unknown result type (might be due to invalid IL or missing references)
			//IL_0474: Unknown result type (might be due to invalid IL or missing references)
			//IL_0481: Unknown result type (might be due to invalid IL or missing references)
			//IL_0487: Expected I4, but got Unknown
			//IL_0496: Unknown result type (might be due to invalid IL or missing references)
			//IL_049c: Invalid comparison between Unknown and I4
			//IL_0577: Unknown result type (might be due to invalid IL or missing references)
			//IL_059f: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c8: Expected I4, but got Unknown
			//IL_05d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dd: Invalid comparison between Unknown and I4
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Invalid comparison between Unknown and I4
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Invalid comparison between Unknown and I4
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Invalid comparison between Unknown and I4
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Invalid comparison between Unknown and I4
			//IL_0393: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Invalid comparison between Unknown and I4
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Invalid comparison between Unknown and I4
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Invalid comparison between Unknown and I4
			//IL_06e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_039c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a6: Invalid comparison between Unknown and I4
			//IL_0269: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Invalid comparison between Unknown and I4
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Invalid comparison between Unknown and I4
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Invalid comparison between Unknown and I4
			//IL_06e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f3: Invalid comparison between Unknown and I4
			//IL_0615: Unknown result type (might be due to invalid IL or missing references)
			//IL_04dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e7: Invalid comparison between Unknown and I4
			//IL_03aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b4: Invalid comparison between Unknown and I4
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Invalid comparison between Unknown and I4
			//IL_0153: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Invalid comparison between Unknown and I4
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Invalid comparison between Unknown and I4
			//IL_06f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0701: Invalid comparison between Unknown and I4
			//IL_061e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0628: Invalid comparison between Unknown and I4
			//IL_04eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f5: Invalid comparison between Unknown and I4
			//IL_03b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c2: Invalid comparison between Unknown and I4
			//IL_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Invalid comparison between Unknown and I4
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0705: Unknown result type (might be due to invalid IL or missing references)
			//IL_070f: Invalid comparison between Unknown and I4
			//IL_062c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0636: Invalid comparison between Unknown and I4
			//IL_04f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0503: Invalid comparison between Unknown and I4
			//IL_03c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Invalid comparison between Unknown and I4
			//IL_0293: Unknown result type (might be due to invalid IL or missing references)
			//IL_029d: Invalid comparison between Unknown and I4
			//IL_0713: Unknown result type (might be due to invalid IL or missing references)
			//IL_071d: Invalid comparison between Unknown and I4
			//IL_063a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0644: Invalid comparison between Unknown and I4
			//IL_0507: Unknown result type (might be due to invalid IL or missing references)
			//IL_0511: Invalid comparison between Unknown and I4
			//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03de: Invalid comparison between Unknown and I4
			//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0721: Unknown result type (might be due to invalid IL or missing references)
			//IL_072b: Invalid comparison between Unknown and I4
			//IL_0648: Unknown result type (might be due to invalid IL or missing references)
			//IL_0652: Invalid comparison between Unknown and I4
			//IL_0515: Unknown result type (might be due to invalid IL or missing references)
			//IL_051f: Invalid comparison between Unknown and I4
			//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_072f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0656: Unknown result type (might be due to invalid IL or missing references)
			//IL_0660: Invalid comparison between Unknown and I4
			//IL_0523: Unknown result type (might be due to invalid IL or missing references)
			//IL_0664: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin.isNoDarker.Value)
			{
				return;
			}
			object[] array;
			if (Plugin.isParamet.Value)
			{
				if (new Random().Next(1, 101) < Plugin.isSetP.Value)
				{
					return;
				}
				array = __args;
				for (int i = 0; i < array.Length; i++)
				{
					foreach (Character item in (ICollection<Character>)array[i])
					{
						if ((int)item.type == 0 && (int)item.key != 15005 && (int)item.key != 30302 && (int)item.key != 30303 && (int)item.key != 30304 && (int)item.key != 10001 && (int)item.key != 0)
						{
							____constructors[Singleton<HardmodeManager>.Instance.currentLevel].Provide(item);
						}
					}
				}
				return;
			}
			if (Plugin.Step.Value == 1)
			{
				array = __args;
				for (int i = 0; i < array.Length; i++)
				{
					foreach (Character item2 in (ICollection<Character>)array[i])
					{
						if ((int)item2.type == 0 && (int)item2.key != 15005 && (int)item2.key != 30302 && (int)item2.key != 30303 && (int)item2.key != 30304 && (int)item2.key != 10001 && (int)item2.key != 0)
						{
							____constructors[Singleton<HardmodeManager>.Instance.currentLevel].Provide(item2);
						}
					}
				}
				return;
			}
			if (Plugin.Step.Value == 11)
			{
				RarityPossibilities val = new RarityPossibilities(Array.Empty<int>());
				Chapter currentChapter = Singleton<Service>.Instance.levelManager.currentChapter;
				Random random = new Random(Save.instance.randomSeed + 2028506624 + currentChapter.type * 256 + currentChapter.stageIndex * 16 + currentChapter.currentStage.pathIndex);
				random.Next(0, 100);
				if ((int)val.Evaluate(random) != 0)
				{
					return;
				}
				array = __args;
				for (int i = 0; i < array.Length; i++)
				{
					ICollection<Character> obj = (ICollection<Character>)array[i];
					Debug.LogError((object)obj.Count);
					foreach (Character item3 in obj)
					{
						if ((int)item3.type == 0 && (int)item3.key != 15005 && (int)item3.key != 30302 && (int)item3.key != 30303 && (int)item3.key != 30304 && (int)item3.key != 10001 && (int)item3.key != 0)
						{
							____constructors[Singleton<HardmodeManager>.Instance.currentLevel].Provide(item3);
						}
					}
				}
				return;
			}
			if (Plugin.Step.Value == 12)
			{
				RarityPossibilities val2 = new RarityPossibilities(Array.Empty<int>());
				Chapter currentChapter2 = Singleton<Service>.Instance.levelManager.currentChapter;
				Random random2 = new Random(Save.instance.randomSeed + 2028506624 + currentChapter2.type * 256 + currentChapter2.stageIndex * 16 + currentChapter2.currentStage.pathIndex);
				random2.Next(0, 100);
				if ((int)val2.Evaluate(random2) != 1)
				{
					return;
				}
				array = __args;
				for (int i = 0; i < array.Length; i++)
				{
					ICollection<Character> obj2 = (ICollection<Character>)array[i];
					Debug.LogError((object)obj2.Count);
					foreach (Character item4 in obj2)
					{
						if ((int)item4.type == 0 && (int)item4.key != 15005 && (int)item4.key != 30302 && (int)item4.key != 30303 && (int)item4.key != 30304 && (int)item4.key != 10001 && (int)item4.key != 0)
						{
							____constructors[Singleton<HardmodeManager>.Instance.currentLevel].Provide(item4);
						}
					}
				}
				return;
			}
			if (Plugin.Step.Value == 13)
			{
				RarityPossibilities val3 = new RarityPossibilities(Array.Empty<int>());
				Chapter currentChapter3 = Singleton<Service>.Instance.levelManager.currentChapter;
				Random random3 = new Random(Save.instance.randomSeed + 2028506624 + currentChapter3.type * 256 + currentChapter3.stageIndex * 16 + currentChapter3.currentStage.pathIndex);
				random3.Next(0, 100);
				if ((int)val3.Evaluate(random3) != 2)
				{
					return;
				}
				array = __args;
				for (int i = 0; i < array.Length; i++)
				{
					ICollection<Character> obj3 = (ICollection<Character>)array[i];
					Debug.LogError((object)obj3.Count);
					foreach (Character item5 in obj3)
					{
						if ((int)item5.type == 0 && (int)item5.key != 15005 && (int)item5.key != 30302 && (int)item5.key != 30303 && (int)item5.key != 30304 && (int)item5.key != 10001 && (int)item5.key != 0)
						{
							____constructors[Singleton<HardmodeManager>.Instance.currentLevel].Provide(item5);
						}
					}
				}
				return;
			}
			if (Plugin.Step.Value == 14)
			{
				RarityPossibilities val4 = new RarityPossibilities(Array.Empty<int>());
				Chapter currentChapter4 = Singleton<Service>.Instance.levelManager.currentChapter;
				Random random4 = new Random(Save.instance.randomSeed + 2028506624 + currentChapter4.type * 256 + currentChapter4.stageIndex * 16 + currentChapter4.currentStage.pathIndex);
				random4.Next(0, 100);
				if ((int)val4.Evaluate(random4) != 3)
				{
					return;
				}
				array = __args;
				for (int i = 0; i < array.Length; i++)
				{
					ICollection<Character> obj4 = (ICollection<Character>)array[i];
					Debug.LogError((object)obj4.Count);
					foreach (Character item6 in obj4)
					{
						if ((int)item6.type == 0 && (int)item6.key != 15005 && (int)item6.key != 30302 && (int)item6.key != 30303 && (int)item6.key != 30304 && (int)item6.key != 10001 && (int)item6.key != 0)
						{
							____constructors[Singleton<HardmodeManager>.Instance.currentLevel].Provide(item6);
						}
					}
				}
				return;
			}
			Plugin.Step.Value = 1;
			array = __args;
			for (int i = 0; i < array.Length; i++)
			{
				ICollection<Character> obj5 = (ICollection<Character>)array[i];
				Debug.LogError((object)obj5.Count);
				foreach (Character item7 in obj5)
				{
					if ((int)item7.type == 0 && (int)item7.key != 15005 && (int)item7.key != 30302 && (int)item7.key != 30303 && (int)item7.key != 30304 && (int)item7.key != 10001 && (int)item7.key != 0)
					{
						____constructors[Singleton<HardmodeManager>.Instance.currentLevel].Provide(item7);
					}
				}
			}
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "DeadlyOfWorld";

		public const string PLUGIN_NAME = "DeadlyOfWorld";

		public const string PLUGIN_VERSION = "1.0";
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}