Decompiled source of CalderaSamples v1.0.0

CalderaSamples.dll

Decompiled 3 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 HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("OutwardModTemplate")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OutwardModTemplate")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c5450fe0-edcf-483f-b9ea-4b1ef9d36da7")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace CalderaSamples;

[BepInPlugin("Tchernobill.CalderaSamples", "CalderaSamples", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	[HarmonyPatch(typeof(QuestEventDictionary), "Load")]
	public class QuestEventDictionary_Load
	{
		private static string[] samples = new string[4] { "Caldera_SamplesA", "Caldera_SamplesB", "Caldera_SamplesC", "Caldera_SamplesD" };

		public static IList<string> toLookForUID = new List<string>();

		private static void Postfix()
		{
			for (int i = 0; i < QuestEventDictionary.m_sections.Count; i++)
			{
				logSection(QuestEventDictionary.m_sections[i]);
			}
		}

		private static void logSection(QuestEventFamily questEventFamily)
		{
			for (int i = 0; i < questEventFamily.Events.Count; i++)
			{
				logEvent(questEventFamily.Events[i]);
			}
		}

		private static void logEvent(QuestEventSignature questEventSignature)
		{
			string[] array = samples;
			for (int i = 0; i < array.Length; i++)
			{
				if (array[i] == questEventSignature.EventName)
				{
					toLookForUID.Add(questEventSignature.EventUID);
				}
			}
		}
	}

	[HarmonyPatch(typeof(Character), "Update")]
	public class Character_Update
	{
		private static void Prefix(ref Character __instance)
		{
			if (!AreaManager.Instance.IsInArea((AreaEnum)602))
			{
				return;
			}
			foreach (string item in QuestEventDictionary_Load.toLookForUID)
			{
				if (QuestEventManager.Instance.GetEventCurrentStack(item) <= 0)
				{
					QuestEventManager.Instance.AddEvent(item, 1, true);
				}
			}
		}
	}

	public const string GUID = "Tchernobill.CalderaSamples";

	public const string NAME = "CalderaSamples";

	public const string VERSION = "1.0.0";

	internal void Awake()
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		new Harmony("Tchernobill.CalderaSamples").PatchAll();
	}

	internal void Update()
	{
	}
}