Decompiled source of Remilia Scrap v1.2.0

Remilia-Scrap/Remiscrap.dll

Decompiled a month ago
using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("")]
[assembly: AssemblyCompany("Remiscrap")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+68bdf127b9b302b35c3f32f054f85f11b3fdb0aa")]
[assembly: AssemblyProduct("Remiscrap")]
[assembly: AssemblyTitle("Remiscrap")]
[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;
		}
	}
}
namespace Remiscrap
{
	[BepInPlugin("Remiscrap", "Remiscrap", "1.0.0")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class Plugin : BaseUnityPlugin
	{
		private ConfigEntry<int> configRemicolaRarity;

		private ConfigEntry<int> configAlienFumoRarity;

		private ConfigEntry<int> configCarFigurineRarity;

		private ConfigEntry<int> configRemicolaPrice;

		private ConfigEntry<int> configAlienFumoPrice;

		private ConfigEntry<int> configCarFigurinePrice;

		public static Plugin instance;

		private void Awake()
		{
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Expected O, but got Unknown
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Expected O, but got Unknown
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Expected O, but got Unknown
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Expected O, but got Unknown
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Expected O, but got Unknown
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Expected O, but got Unknown
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "remi-cola");
			string text2 = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "alien-fumo");
			string text3 = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "cat-figurine");
			AssetBundle val = AssetBundle.LoadFromFile(text);
			AssetBundle val2 = AssetBundle.LoadFromFile(text2);
			AssetBundle val3 = AssetBundle.LoadFromFile(text3);
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Remiscrap");
			configAlienFumoRarity = ((BaseUnityPlugin)this).Config.Bind<int>("General", "AlienFumoRarity", 25, new ConfigDescription("How rare Alien Milady Fumos are to find. Lower values = rarer", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			configAlienFumoPrice = ((BaseUnityPlugin)this).Config.Bind<int>("General", "AlienFumoPrice", 250, new ConfigDescription("The price of an Alien Milady Fumo, the game will auto-adjust it according to a moon's difficulty (Think about half-price on the easiest moons)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 1000000), Array.Empty<object>()));
			configRemicolaRarity = ((BaseUnityPlugin)this).Config.Bind<int>("General", "ColaRarity", 50, new ConfigDescription("How rare Remi-Cola is to find. Lower values = rarer", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			configRemicolaPrice = ((BaseUnityPlugin)this).Config.Bind<int>("General", "ColaPrice", 50, new ConfigDescription("The price of a Remi-Cola, the game will auto-adjust it according to a moon's difficulty (Think about half-price on the easiest moons)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 1000000), Array.Empty<object>()));
			configCarFigurineRarity = ((BaseUnityPlugin)this).Config.Bind<int>("General", "CarRarity", 35, new ConfigDescription("How rare Remicat figurines are to find. Lower values = rarer", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
			configCarFigurinePrice = ((BaseUnityPlugin)this).Config.Bind<int>("General", "CarPrice", 150, new ConfigDescription("The price of a Remicat figurine, the game will auto-adjust it according to a moon's difficulty (Think about half-price on the easiest moons)", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 1000000), Array.Empty<object>()));
			Item val4 = val.LoadAsset<Item>("Assets/Remicola/RemicolaCanItem.asset");
			Item val5 = val2.LoadAsset<Item>("Assets/Alien Fumo/AlienMiladyFumo.asset");
			Item val6 = val3.LoadAsset<Item>("Assets/Remicat/RemicatItem.asset");
			NetworkPrefabs.RegisterNetworkPrefab(val4.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val5.spawnPrefab);
			NetworkPrefabs.RegisterNetworkPrefab(val6.spawnPrefab);
			Utilities.FixMixerGroups(val4.spawnPrefab);
			Utilities.FixMixerGroups(val5.spawnPrefab);
			Utilities.FixMixerGroups(val6.spawnPrefab);
			val4.minValue = configRemicolaPrice.Value;
			val4.maxValue = configRemicolaPrice.Value + 100;
			val5.minValue = configAlienFumoPrice.Value;
			val5.maxValue = configAlienFumoPrice.Value + 100;
			val6.minValue = configCarFigurinePrice.Value;
			val6.maxValue = configCarFigurinePrice.Value + 100;
			Items.RegisterScrap(val4, configRemicolaRarity.Value, (LevelTypes)(-1));
			Items.RegisterScrap(val5, configAlienFumoRarity.Value, (LevelTypes)(-1));
			Items.RegisterScrap(val6, configCarFigurineRarity.Value, (LevelTypes)(-1));
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Remiscrap");
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Remilia Scrap Loaded!");
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "Remiscrap";

		public const string PLUGIN_NAME = "Remiscrap";

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