Decompiled source of WILDCARD REPO v0.0.2

BepInEx/plugins/WildCardMod/REPOWildCardMod.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
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 HarmonyLib;
using REPOLib.Modules;
using REPOWildCardMod.Config;
using REPOWildCardMod.NetcodePatcher;
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("REPOWildCardMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Scan Computers")]
[assembly: AssemblyProduct("REPOWildCardMod")]
[assembly: AssemblyCopyright("Copyright © Scan Computers 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("a4fd09a5-2078-4f37-ae81-44c02af535da")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: NetcodePatchedAssembly]
namespace REPOWildCardMod
{
	[BepInPlugin("deB.WildCard", "WILDCARD REPO", "0.0.2")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class WildCardMod : BaseUnityPlugin
	{
		internal const string modGUID = "deB.WildCard";

		internal const string modName = "WILDCARD REPO";

		internal const string modVersion = "0.0.2";

		internal static ManualLogSource log = null;

		private static WildCardMod Instance;

		public static List<GameObject> valList = new List<GameObject>();

		internal static WildCardConfig ModConfig { get; private set; } = null;


		private void Awake()
		{
			log = ((BaseUnityPlugin)this).Logger;
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			for (int i = 0; i < types.Length; i++)
			{
				MethodInfo[] methods = types[i].GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				for (int j = 0; j < methods.Length; j++)
				{
					object[] customAttributes = methods[j].GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methods[j].Invoke(null, null);
					}
				}
			}
			AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "wildcardmod"));
			string[] allAssetNames = val.GetAllAssetNames();
			for (int k = 0; k < allAssetNames.Length; k++)
			{
				string text = allAssetNames[k].Substring(0, allAssetNames[k].LastIndexOf("/"));
				string text2 = text;
				string text3 = text2;
				if (text3 == "assets/my creations/valuables")
				{
					valList.Add(val.LoadAsset<GameObject>(allAssetNames[k]));
				}
				else
				{
					log.LogWarning((object)("\"" + text + "\" is not a known asset path, skipping."));
				}
			}
			ModConfig = new WildCardConfig(((BaseUnityPlugin)this).Config, valList);
			for (int l = 0; l < valList.Count; l++)
			{
				if (ModConfig.isValEnabled[l].Value)
				{
					Valuables.RegisterValuable(valList[l]);
					log.LogDebug((object)(((Object)valList[l]).name + " valuable was loaded!"));
				}
				else
				{
					log.LogInfo((object)(((Object)valList[l]).name + " valuable was disabled!"));
				}
			}
			log.LogInfo((object)"WILDCARD REPO Successfully Loaded");
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "REPOWildCardMod";

		public const string PLUGIN_NAME = "REPOWildCardMod";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}
namespace REPOWildCardMod.Valuables
{
	public class FixatedNose : MonoBehaviour
	{
		private readonly ManualLogSource log = WildCardMod.log;

		public AudioSource source;

		public float lerp;

		public AnimationCurve curve;

		public void Awake()
		{
			log.LogDebug((object)"Fixated Nose has Spawned!");
		}

		public void Honk(bool breaking)
		{
			source.Play();
			if (breaking)
			{
				((MonoBehaviour)this).StartCoroutine(HonkCoroutine());
			}
		}

		public IEnumerator HonkCoroutine()
		{
			yield return null;
			source.pitch = Mathf.Lerp(1f, 0f, curve.Evaluate(lerp));
			lerp += Time.deltaTime * 2f;
		}
	}
}
namespace REPOWildCardMod.Config
{
	public class WildCardConfig
	{
		private readonly ManualLogSource log = WildCardMod.log;

		internal readonly List<ConfigEntry<bool>> isValEnabled = new List<ConfigEntry<bool>>();

		internal WildCardConfig(ConfigFile cfg, List<GameObject> valList)
		{
			cfg.SaveOnConfigSet = false;
			for (int i = 0; i < valList.Count; i++)
			{
				bool flag = true;
				isValEnabled.Add(cfg.Bind<bool>("Valuables", "Enable " + ((Object)valList[i]).name + "?", flag, (ConfigDescription)null));
				log.LogDebug((object)("Added config for " + ((Object)valList[i]).name));
			}
			ClearOrphanedEntries(cfg);
			cfg.Save();
			cfg.SaveOnConfigSet = true;
		}

		private static void ClearOrphanedEntries(ConfigFile cfg)
		{
			PropertyInfo propertyInfo = AccessTools.Property(typeof(ConfigFile), "OrphanedEntries");
			Dictionary<ConfigDefinition, string> dictionary = (Dictionary<ConfigDefinition, string>)propertyInfo.GetValue(cfg);
			dictionary.Clear();
		}
	}
}
namespace System.Runtime.CompilerServices
{
	[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
	internal sealed class IgnoresAccessChecksToAttribute : Attribute
	{
		public IgnoresAccessChecksToAttribute(string assemblyName)
		{
		}
	}
}
namespace REPOWildCardMod.NetcodePatcher
{
	[AttributeUsage(AttributeTargets.Module)]
	internal class NetcodePatchedAssemblyAttribute : Attribute
	{
	}
}