Compare commits

..

2 Commits

3 changed files with 125 additions and 39 deletions

View File

@@ -4,7 +4,7 @@
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<AssemblyName>BetterStuff</AssemblyName> <AssemblyName>BetterStuff</AssemblyName>
<Product>Better Stuff</Product> <Product>Better Stuff</Product>
<Version>1.0.0</Version> <Version>1.1.0</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<RestoreAdditionalProjectSources> <RestoreAdditionalProjectSources>

22
CHANGELOG Normal file
View File

@@ -0,0 +1,22 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [1.1.0] - 2026-01-25
### Added
- Increased the walk speed of janitors, security guards and customer helpers
- Increased the scanning speed of customer helpers, customers and player on self checkouts
- Config contains the default gamevalues of each option
## [1.0.0] - 2026-01-09
### Added
- Initial release
- Increased the scanning speed of cashiers
- Increased the time until the paymentprocess is finished
- Increased the time between scanningprocess an paymentprocess
- Increased the walk speed of Restockers

112
Plugin.cs
View File

@@ -1,25 +1,30 @@
using System; using BepInEx;
using BepInEx;
using BepInEx.Configuration; using BepInEx.Configuration;
using BepInEx.Logging; using BepInEx.Logging;
using BepInEx.Unity.IL2CPP; using BepInEx.Unity.IL2CPP;
using HarmonyLib; using HarmonyLib;
using UnityEngine;
using UnityEngine.Playables;
namespace BetterStuff; namespace BetterStuff;
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)] [BepInPlugin(PLUGIN_GUID, PLUGIN_NAME, PLUGIN_VERSION)]
public class Plugin : BasePlugin public class Plugin : BasePlugin
{ {
public const string PLUGIN_GUID = "de.mpburgmann.BetterStuff";
public const string PLUGIN_NAME = "Better Stuff";
public const string PLUGIN_VERSION = "1.1.0";
internal static new ManualLogSource Log; internal static new ManualLogSource Log;
private static ConfigEntry<float> scanTimeMin; private static ConfigEntry<float> scanTime;
private static ConfigEntry<float> scanTimeMax;
private static ConfigEntry<float> finishDuration; private static ConfigEntry<float> finishDuration;
private static ConfigEntry<float> timeAfterScans; private static ConfigEntry<float> timeAfterScans;
private static ConfigEntry<float> restockerSpeed; private static ConfigEntry<float> restockerSpeed;
private static ConfigEntry<float> selfcheckoutCustomerSpeed;
private static ConfigEntry<float> selfcheckoutPlayerSpeed;
private static ConfigEntry<float> customerHelperScanningSpeed;
private static ConfigEntry<float> customerHelperSpeed;
private static ConfigEntry<float> securityGuardSpeed;
private static ConfigEntry<float> janitorSpeed;
public override void Load() public override void Load()
{ {
@@ -27,26 +32,34 @@ public class Plugin : BasePlugin
Log = base.Log; Log = base.Log;
Log.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!"); Log.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} is loaded!");
Plugin.scanTimeMin = Config.Bind("Cashier Scantime", "min", 0.2f); scanTime = Config.Bind("Cashier", "Scanning Speed", 0.7f, "Default vanilla value is 1.5.");
Plugin.scanTimeMax = Config.Bind("Cashier Scantime", "max", 0.8f); finishDuration = Config.Bind("Cashier", "FinishingDuration", 1f, "Default vanilla value is 2.");
Plugin.finishDuration = Config.Bind("Cashier PaymentTime", "FinishingDuration", 1f); timeAfterScans = Config.Bind("Cashier", "TimeAfterAllScans", 0.5f, "Default vanilla value is 1.");
Plugin.timeAfterScans = Config.Bind("Cashier PaymentTime", "TimeAfterAllScans", 0.5f);
Plugin.restockerSpeed = Config.Bind("Restocker", "Speed", 5f); restockerSpeed = Config.Bind("Restocker", "Speed", 5f, "Default value is 2.");
Harmony harmony = new(MyPluginInfo.PLUGIN_GUID); selfcheckoutCustomerSpeed = Config.Bind("Selfcheckout", "Customer Speed", 0.6f, "Default vanilla value is 1.8.");
selfcheckoutPlayerSpeed = Config.Bind("Selfcheckout", "Player Speed", 0.3f, "Default vanilla value is 0.6.");
customerHelperScanningSpeed = Config.Bind("Customer Helper", "Scanning Speed", 0.5f, "Default vanilla value is 1.5.");
customerHelperSpeed = Config.Bind("Customer Helper", "Speed", 5f, "Default value is 2.");
securityGuardSpeed = Config.Bind("Security Guard", "Speed", 5f, "Default value is 2.");
janitorSpeed = Config.Bind("Janitor", "Speed", 5f, "Default value is 2.");
Harmony harmony = new(PLUGIN_GUID);
harmony.PatchAll(); harmony.PatchAll();
} }
public static class CashierPatch
{
[HarmonyPatch(typeof(Cashier), "Start")] [HarmonyPatch(typeof(Cashier), "Start")]
public static class Cashier_Start_Patch public static class Cashier_Start_Patch
{ {
[HarmonyPostfix] [HarmonyPostfix]
public static void Postfix(Cashier __instance) public static void Postfix(Cashier __instance)
{ {
__instance.ScanningInterval = UnityEngine.Random.Range(Plugin.scanTimeMin.Value, Plugin.scanTimeMax.Value); __instance.ScanningInterval = scanTime.Value;
} }
} }
@@ -56,25 +69,76 @@ public class Plugin : BasePlugin
[HarmonyPostfix] [HarmonyPostfix]
public static void Postfix(Checkout __instance) public static void Postfix(Checkout __instance)
{ {
__instance.m_AutomatedCheckout.m_FinishingPaymentDuration = Plugin.finishDuration.Value; if(!__instance.m_IsSelfCheckout)
__instance.m_AutomatedCheckout.m_IntervalAfterScanningAll = Plugin.timeAfterScans.Value; {
__instance.m_AutomatedCheckout.m_FinishingPaymentDuration = finishDuration.Value;
__instance.m_AutomatedCheckout.m_IntervalAfterScanningAll = timeAfterScans.Value;
} }
} }
} }
public static class RestockerPatch
{
[HarmonyPatch(typeof(Restocker), "Start")] [HarmonyPatch(typeof(Restocker), "Start")]
public static class Restocker_Start_Patch public static class Restocker_Start_Patch
{ {
[HarmonyPostfix] [HarmonyPostfix]
public static void Postfix(Restocker __instance) public static void Postfix(Restocker __instance)
{ {
__instance.m_Agent.speed = Plugin.restockerSpeed.Value; __instance.m_Agent.speed = restockerSpeed.Value;
__instance.m_Agent.acceleration *= 200f;
__instance.m_Agent.angularSpeed *= 200f;
}
}
[HarmonyPatch(typeof(Checkout), "Start")]
public static class Selfcheckout_Start_Patch
{
[HarmonyPostfix]
public static void Postfix(Checkout __instance)
{
if (__instance.m_IsSelfCheckout)
{
__instance.m_SelfCheckout.m_CustomerScanningInterval = selfcheckoutCustomerSpeed.Value;
__instance.m_SelfCheckout.m_PlayerScanningInterval = selfcheckoutPlayerSpeed.Value;
}
}
}
[HarmonyPatch(typeof(CustomerHelper), "Start")]
public static class CustomerHelper_Start_Patch
{
[HarmonyPostfix]
public static void Postfix(CustomerHelper __instance)
{
__instance.ScanningInterval = customerHelperScanningSpeed.Value;
__instance.m_CustomerHelperScanIntervals = new Il2CppSystem.Collections.Generic.List<float>(1);
__instance.m_CustomerHelperScanIntervals.Add(customerHelperScanningSpeed.Value);
__instance.m_Agent.speed = customerHelperSpeed.Value;
__instance.m_Agent.acceleration *= 200f;
__instance.m_Agent.angularSpeed *= 200f;
}
}
[HarmonyPatch(typeof(SecurityGuard), "Start")]
public static class SecurityGuard_Start_Patch
{
[HarmonyPostfix]
public static void Postfix(SecurityGuard __instance)
{
__instance.m_AnimController.m_Agent.speed = securityGuardSpeed.Value;
__instance.m_AnimController.m_Agent.acceleration *= 200f;
__instance.m_AnimController.m_Agent.angularSpeed *= 200f;
}
}
[HarmonyPatch(typeof(Janitor), "Start")]
public static class Janitor_Start_Patch
{
[HarmonyPostfix]
public static void Postfix(Janitor __instance)
{
__instance.m_Agent.speed = janitorSpeed.Value;
__instance.m_Agent.acceleration *= 200f; __instance.m_Agent.acceleration *= 200f;
__instance.m_Agent.angularSpeed *= 200f; __instance.m_Agent.angularSpeed *= 200f;
} }
} }
} }
}