Decompiled source of 0xClonaz LetherallyEveryMod v1.0.3

LetherallyEveryMod.dll

Decompiled 11 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using TerminalApi;
using Unity.Netcode;
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("LetherallyEveryMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LetherallyEveryMod")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("5138d505-5ae5-4c9c-ac5a-2f15c7a5faea")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace LetherallyEveryMod;

[HarmonyPatch(typeof(Terminal))]
internal class GamblingPatch
{
	public class Plugin : BaseUnityPlugin
	{
		private static TerminalNode spinNode = new TerminalNode();

		private static TerminalNode savedNode = new TerminalNode();

		private static int betAmount = 0;

		private void Awake(ref int __groupCredits)
		{
			TerminalApi.AddCommand("gambling", "Gamble your easy earned money it's totally worth it", "gambling", true);
			__groupCredits = 1000000;
		}

		public static void Gambling()
		{
			TerminalApi.UpdateKeywordCompatibleNoun("check", "gambling", TerminalApi.CreateTerminalNode("Good choice now place your bet and and choose if it Ace or King\n To place bet type: bet [money] Ace/King\n for example bet 100 Ace ", false, ""));
		}

		public static TerminalNode ListGames(Terminal __terminal)
		{
			TerminalNode val = TerminalApi.CreateTerminalNode(">Ace Or King \nGamble your credits! DO NOT Play responsibly.", false, "");
			val.clearPreviousText = true;
			return val;
		}

		[HarmonyPatch("Update")]
		public static TerminalNode AceOrKing(Terminal __terminal, ref int __groupCredits)
		{
			string terminalInput = TerminalApi.GetTerminalInput();
			string text = null;
			int num = new Random().Next(2);
			if (terminalInput.Contains("bet"))
			{
				string[] array = terminalInput.Split(new char[1] { ' ' });
				text = array[2];
				betAmount = Convert.ToInt32(array[1]);
			}
			string text2 = ((num == 0) ? "Ace" : "King");
			if (text == text2)
			{
				__groupCredits += betAmount * 2;
				return TerminalApi.CreateTerminalNode("You won..... for now.", false, "");
			}
			return TerminalApi.CreateTerminalNode("Hahahaha I mean nice try, now go to work.", false, "");
		}
	}
}
[HarmonyPatch(typeof(TimeOfDay))]
internal class LongerDaysPatch
{
	public class LongerDays : BaseUnityPlugin
	{
		[HarmonyPatch("Update")]
		internal class LongerDaysPatch
		{
			public static void Prefix(ref TimeOfDay __instance)
			{
				__instance.globalTimeSpeedMultiplier = 0.5f;
			}
		}

		internal static float SetTime = 0.5f;

		private ConfigEntry<float> configSetTime;

		private void Awake()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			ConfigDescription val = new ConfigDescription("Default: 0.5 (1 day is 2x longer) for example 2 would be 4x longer and 1 would be the normal.", (AcceptableValueBase)new AcceptableValueRange<float>(0.001f, 999f), Array.Empty<object>());
			configSetTime = ((BaseUnityPlugin)this).Config.Bind<float>("SetTime", "SetTime", 0.5f, val);
			SetTime = configSetTime.Value;
		}
	}
}
[HarmonyPatch(typeof(ItemDropship))]
internal class FasterItemDropRocketPatch
{
	public static FasterItemDropRocketPatch Instance;

	private void Awake()
	{
		if (Instance == null)
		{
			Instance = this;
		}
	}

	[HarmonyPatch("Update")]
	[HarmonyPostfix]
	private static void UpdateShipTimer(ref float ___shipTimer, ref bool ___deliveringOrder, ItemDropship __instance)
	{
		if (((NetworkBehaviour)__instance).IsServer && !___deliveringOrder && ___shipTimer > 2f)
		{
			___shipTimer = 50f;
		}
	}
}
[BepInPlugin("0xClonaz.LetherallyEveryMod", "Letherally EveryMod", "1.0.0")]
public class LetherallyEveryModBase : BaseUnityPlugin
{
	private const string modGUID = "0xClonaz.LetherallyEveryMod";

	private const string modName = "Letherally EveryMod";

	private const string modVersion = "1.0.0";

	private readonly Harmony harmony = new Harmony("0xClonaz.LetherallyEveryMod");

	private static LetherallyEveryModBase instance;

	internal ManualLogSource mls;

	private void Awake()
	{
		if ((Object)(object)instance == (Object)null)
		{
			instance = this;
		}
		mls = Logger.CreateLogSource("0xClonaz.LetherallyEveryMod");
		mls.LogInfo((object)"Mükszik");
		harmony.PatchAll(typeof(LetherallyEveryModBase));
		harmony.PatchAll(typeof(FasterItemDropRocketPatch));
		harmony.PatchAll(typeof(LongerDaysPatch));
		harmony.PatchAll(typeof(GamblingPatch));
	}
}
public static class MyPluginInfo
{
	public const string PLUGIN_GUID = "LetherallyEveryMod";

	public const string PLUGIN_NAME = "";

	public const string PLUGIN_VERSION = "1.0.0.0";
}

ClonazMods-LetherallyEveryMod/LetherallyEveryMod.dll

Decompiled 11 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using TerminalApi;
using Unity.Netcode;
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("LetherallyEveryMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LetherallyEveryMod")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("5138d505-5ae5-4c9c-ac5a-2f15c7a5faea")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace LetherallyEveryMod;

[HarmonyPatch(typeof(Terminal))]
internal class GamblingPatch
{
	public class Plugin : BaseUnityPlugin
	{
		private static TerminalNode spinNode = new TerminalNode();

		private static TerminalNode savedNode = new TerminalNode();

		private static int betAmount = 0;

		private void Awake(ref int __groupCredits)
		{
			TerminalApi.AddCommand("gambling", "Gamble your easy earned money it's totally worth it", "gambling", true);
			__groupCredits = 1000000;
		}

		public static void Gambling()
		{
			TerminalApi.UpdateKeywordCompatibleNoun("check", "gambling", TerminalApi.CreateTerminalNode("Good choice now place your bet and and choose if it Ace or King\n To place bet type: bet [money] Ace/King\n for example bet 100 Ace ", false, ""));
		}

		public static TerminalNode ListGames(Terminal __terminal)
		{
			TerminalNode val = TerminalApi.CreateTerminalNode(">Ace Or King \nGamble your credits! DO NOT Play responsibly.", false, "");
			val.clearPreviousText = true;
			return val;
		}

		[HarmonyPatch("Update")]
		public static TerminalNode AceOrKing(Terminal __terminal, ref int __groupCredits)
		{
			string terminalInput = TerminalApi.GetTerminalInput();
			string text = null;
			int num = new Random().Next(2);
			if (terminalInput.Contains("bet"))
			{
				string[] array = terminalInput.Split(new char[1] { ' ' });
				text = array[2];
				betAmount = Convert.ToInt32(array[1]);
			}
			string text2 = ((num == 0) ? "Ace" : "King");
			if (text == text2)
			{
				__groupCredits += betAmount * 2;
				return TerminalApi.CreateTerminalNode("You won..... for now.", false, "");
			}
			return TerminalApi.CreateTerminalNode("Hahahaha I mean nice try, now go to work.", false, "");
		}
	}
}
[HarmonyPatch(typeof(TimeOfDay))]
internal class LongerDaysPatch
{
	public class LongerDays : BaseUnityPlugin
	{
		[HarmonyPatch("Update")]
		internal class LongerDaysPatch
		{
			public static void Prefix(ref TimeOfDay __instance)
			{
				__instance.globalTimeSpeedMultiplier = 0.5f;
			}
		}

		internal static float SetTime = 0.5f;

		private ConfigEntry<float> configSetTime;

		private void Awake()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			ConfigDescription val = new ConfigDescription("Default: 0.5 (1 day is 2x longer) for example 2 would be 4x longer and 1 would be the normal.", (AcceptableValueBase)new AcceptableValueRange<float>(0.001f, 999f), Array.Empty<object>());
			configSetTime = ((BaseUnityPlugin)this).Config.Bind<float>("SetTime", "SetTime", 0.5f, val);
			SetTime = configSetTime.Value;
		}
	}
}
[HarmonyPatch(typeof(ItemDropship))]
internal class FasterItemDropRocketPatch
{
	public static FasterItemDropRocketPatch Instance;

	private void Awake()
	{
		if (Instance == null)
		{
			Instance = this;
		}
	}

	[HarmonyPatch("Update")]
	[HarmonyPostfix]
	private static void UpdateShipTimer(ref float ___shipTimer, ref bool ___deliveringOrder, ItemDropship __instance)
	{
		if (((NetworkBehaviour)__instance).IsServer && !___deliveringOrder && ___shipTimer > 2f)
		{
			___shipTimer = 50f;
		}
	}
}
[BepInPlugin("0xClonaz.LetherallyEveryMod", "Letherally EveryMod", "1.0.0")]
public class LetherallyEveryModBase : BaseUnityPlugin
{
	private const string modGUID = "0xClonaz.LetherallyEveryMod";

	private const string modName = "Letherally EveryMod";

	private const string modVersion = "1.0.0";

	private readonly Harmony harmony = new Harmony("0xClonaz.LetherallyEveryMod");

	private static LetherallyEveryModBase instance;

	internal ManualLogSource mls;

	private void Awake()
	{
		if ((Object)(object)instance == (Object)null)
		{
			instance = this;
		}
		mls = Logger.CreateLogSource("0xClonaz.LetherallyEveryMod");
		mls.LogInfo((object)"Mükszik");
		harmony.PatchAll(typeof(LetherallyEveryModBase));
		harmony.PatchAll(typeof(FasterItemDropRocketPatch));
		harmony.PatchAll(typeof(LongerDaysPatch));
		harmony.PatchAll(typeof(GamblingPatch));
	}
}
public static class MyPluginInfo
{
	public const string PLUGIN_GUID = "LetherallyEveryMod";

	public const string PLUGIN_NAME = "";

	public const string PLUGIN_VERSION = "1.0.0.0";
}