Decompiled source of GasAcceleratorMod v1.0.1

GasAcceleratorMod.dll

Decompiled 2 days ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("GasAcceleratorMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Microsoft")]
[assembly: AssemblyProduct("GasAcceleratorMod")]
[assembly: AssemblyCopyright("Copyright © Microsoft 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("47c34b2c-a498-4386-9f4c-10d96b1829f6")]
[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")]
[BepInPlugin("com.example.gasaccelerator", "Gas Accelerator Mod", "1.0.0")]
public class GasAcceleratorMod : BaseUnityPlugin
{
	public static ConfigEntry<float> SpeedMultiplier { get; set; }

	private void Awake()
	{
		//IL_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Expected O, but got Unknown
		SpeedMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("General", "SpeedMultiplier", 10f, "气态采集器的速度倍率 (例如: 5, 10, 20)");
		Harmony val = new Harmony("com.example.gasaccelerator");
		val.PatchAll();
		((BaseUnityPlugin)this).Logger.LogInfo((object)$"气态加速Mod已加载,当前倍率: {SpeedMultiplier.Value}x (可通过配置文件调整)");
	}
}
[HarmonyPatch(typeof(StationComponent), "UpdateCollection")]
public static class UpdateCollection_Patch
{
	private static void Prefix(StationComponent __instance, ref float collectSpeedRate)
	{
		if (__instance.isCollector)
		{
			collectSpeedRate *= GasAcceleratorMod.SpeedMultiplier.Value;
		}
	}
}