Decompiled source of Super Synergy v1.0.0

SuperWorld.dll

Decompiled 9 months ago
using System;
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.Gear.Items;
using Characters.Gear.Synergy;
using Characters.Gear.Synergy.Inscriptions;
using Characters.Player;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using SuperSynerge;
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("SuperWorld")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("SuperWorld")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0")]
[assembly: AssemblyProduct("SuperWorld")]
[assembly: AssemblyTitle("SuperWorld")]
[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("SuperWorld", "SuperWorld", "1.0")]
public class Plugin : BaseUnityPlugin
{
	public static ConfigEntry<bool> isNoSuper;

	public static ConfigEntry<bool> isNoFull;

	public static ConfigEntry<bool> isNoOmen;

	public static ConfigEntry<bool> isOmen;

	private void Awake()
	{
		isNoSuper = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "각인 각성 정상화", false, "각인을 평범하게 바꿉니다.");
		isNoFull = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "각인 강제 맥스 정상화", false, "밑에 설정한것을 무시하고 정상화 시킵니다.");
		isNoOmen = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "흉조 추가불가 정상화", false, "흉조또한 추가할수있게됩니다.");
		isOmen = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "3흉조화", false, "3흉조로 시작합니다.");
		Harmony.CreateAndPatchAll(typeof(SuperPath), (string)null);
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Mod SuperWorld is loaded!");
	}

	private void Update()
	{
		((BaseUnityPlugin)this).Config.Reload();
	}
}
namespace SuperSynerge
{
	public class SuperPath
	{
		[HarmonyPostfix]
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		private static void GetSuperIsTrue(ref bool __result, ref Inscription __instance)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Invalid comparison between Unknown and I4
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Invalid comparison between Unknown and I4
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Invalid comparison between Unknown and I4
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Invalid comparison between Unknown and I4
			if (!Plugin.isNoSuper.Value && (int)__instance.key != 29 && (int)__instance.key != 23 && (int)__instance.key != 34 && (int)__instance.key != 35)
			{
				__result = true;
			}
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(Inventory), "UpdateSynergy")]
		private static bool InscriptionFull(ref Synergy ___synergy, ref Action ___onUpdatedKeywordCounts, ref ItemInventory ___item)
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Invalid comparison between Unknown and I4
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Invalid comparison between Unknown and I4
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Invalid comparison between Unknown and I4
			//IL_00e8: 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_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: 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_02aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Invalid comparison between Unknown and I4
			//IL_022c: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			if (Plugin.isNoFull.Value)
			{
				return true;
			}
			foreach (Inscription inscription in ___synergy.inscriptions)
			{
				if (!Plugin.isOmen.Value)
				{
					if ((int)inscription.key != 34)
					{
						inscription.count = inscription.maxStep;
					}
				}
				else if ((int)inscription.key == 34)
				{
					inscription.count = inscription.maxStep;
				}
			}
			foreach (Item item in ___item.items)
			{
				if (!((Object)(object)item == (Object)null))
				{
					if ((int)item.keyword1 != 34 && !Plugin.isNoOmen.Value)
					{
						Inscription obj = ___synergy.inscriptions[item.keyword1];
						obj.count++;
					}
					else if (Plugin.isNoOmen.Value)
					{
						Inscription obj2 = ___synergy.inscriptions[item.keyword1];
						obj2.count++;
					}
					if ((int)item.keyword2 != 34 && !Plugin.isNoOmen.Value)
					{
						Inscription obj3 = ___synergy.inscriptions[item.keyword2];
						obj3.count++;
					}
					else if (Plugin.isNoOmen.Value)
					{
						Inscription obj4 = ___synergy.inscriptions[item.keyword2];
						obj4.count++;
					}
				}
			}
			foreach (Item item2 in ___item.items)
			{
				if ((Object)(object)item2 == (Object)null)
				{
					continue;
				}
				BonusKeyword[] bonusKeyword = item2.bonusKeyword;
				foreach (BonusKeyword obj5 in bonusKeyword)
				{
					obj5.Evaluate();
					EnumArray<Key, int> values = obj5.Values;
					foreach (Key key in Inscription.keys)
					{
						if ((int)key != 34 && !Plugin.isNoOmen.Value)
						{
							Inscription obj6 = ___synergy.inscriptions[key];
							obj6.count += values[key];
						}
						else if (Plugin.isNoOmen.Value)
						{
							Inscription obj7 = ___synergy.inscriptions[key];
							obj7.count += values[key];
						}
					}
				}
			}
			foreach (Key key2 in Inscription.keys)
			{
				Inscription obj8 = ___synergy.inscriptions[key2];
				obj8.count += ___synergy.inscriptions[key2].bonusCount;
			}
			___onUpdatedKeywordCounts?.Invoke();
			___synergy.UpdateBonus();
			return false;
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "SuperWorld";

		public const string PLUGIN_NAME = "SuperWorld";

		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)
		{
		}
	}
}