Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of REPO Base Pack v1.0.3
plugins/ValuableRegen.dll
Decompiled a day agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using UnityEngine; using ValuableRegen.Patches; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 ValuableRegen { internal struct DamageRecord { public float LastDamage; public float Original; } internal static class DamagedRegistry { private static readonly Dictionary<ValuableObject, DamageRecord> Records = new Dictionary<ValuableObject, DamageRecord>(); private static readonly List<ValuableObject> Scratch = new List<ValuableObject>(); internal static int Count => Records.Count; internal static void MarkDamaged(ValuableObject valuable) { if (!((Object)(object)valuable == (Object)null)) { if (Records.TryGetValue(valuable, out var value)) { value.LastDamage = Time.time; Records[valuable] = value; } else { Records[valuable] = new DamageRecord { LastDamage = Time.time, Original = valuable.dollarValueOriginal }; } } } internal static bool TryGet(ValuableObject valuable, out DamageRecord record) { return Records.TryGetValue(valuable, out record); } internal static void Forget(ValuableObject valuable) { Records.Remove(valuable); } internal static void Clear() { Records.Clear(); } internal static List<ValuableObject> Snapshot() { Scratch.Clear(); foreach (KeyValuePair<ValuableObject, DamageRecord> record in Records) { Scratch.Add(record.Key); } return Scratch; } } [BepInPlugin("benjamin.valuableregen", "ValuableRegen", "1.2.0")] [BepInProcess("REPO.exe")] public class Plugin : BaseUnityPlugin { public const string Guid = "benjamin.valuableregen"; public const string Name = "ValuableRegen"; public const string Version = "1.2.0"; internal static ManualLogSource Log; private Harmony _harmony; internal static ConfigEntry<bool> Enabled; internal static ConfigEntry<float> RegenPercentPerSecond; internal static ConfigEntry<float> DamageCooldown; internal static ConfigEntry<float> MaxRestoreFraction; internal static ConfigEntry<float> RegenInterval; internal static ConfigEntry<bool> PauseWhileHeld; internal static ConfigEntry<bool> PreventDestruction; internal static ConfigEntry<float> RescueValuePercent; internal static ConfigEntry<bool> UseHealEffect; internal static ConfigEntry<bool> Verbose; private void Awake() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Expected O, but got Unknown //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Master switch. Turn off to restore vanilla behaviour without uninstalling."); RegenPercentPerSecond = ((BaseUnityPlugin)this).Config.Bind<float>("Regen", "RegenPercentPerSecond", 2f, new ConfigDescription("Percent of the valuable's ORIGINAL value restored per second while regenerating. At 2.0 an item smashed down to half value takes about 25 seconds to fully recover.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.05f, 50f), Array.Empty<object>())); DamageCooldown = ((BaseUnityPlugin)this).Config.Bind<float>("Regen", "DamageCooldown", 4f, new ConfigDescription("Seconds of no further damage before regeneration starts. Stops an item healing mid-tumble down a staircase.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 60f), Array.Empty<object>())); MaxRestoreFraction = ((BaseUnityPlugin)this).Config.Bind<float>("Regen", "MaxRestoreFraction", 1f, new ConfigDescription("Ceiling on regeneration, as a fraction of original value. 1.0 = full recovery. 0.8 means a damaged item can never climb back above 80% of what it was worth, so carelessness still costs you something.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 1f), Array.Empty<object>())); RegenInterval = ((BaseUnityPlugin)this).Config.Bind<float>("Regen", "RegenInterval", 0.5f, new ConfigDescription("Seconds between regeneration ticks. Lower is smoother, higher is cheaper. The per-second rate is unaffected.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 5f), Array.Empty<object>())); PauseWhileHeld = ((BaseUnityPlugin)this).Config.Bind<bool>("Regen", "PauseWhileHeld", false, "Pause regeneration while a player is holding the item, so you can't stand there cradling a vase waiting for it to heal."); PreventDestruction = ((BaseUnityPlugin)this).Config.Bind<bool>("Destruction", "PreventDestruction", true, "Stop valuables being destroyed outright, so a hit heavy enough to wipe an item leaves it battered instead of gone and regeneration can bring it back. Only affects valuables - breakable props, hinges and doors are untouched."); RescueValuePercent = ((BaseUnityPlugin)this).Config.Bind<float>("Destruction", "RescueValuePercent", 1f, new ConfigDescription("Percent of original value a rescued item is parked at. Regeneration works fine from zero, but a valuable sitting at exactly nothing risks tripping other zero-value checks in the game.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 50f), Array.Empty<object>())); UseHealEffect = ((BaseUnityPlugin)this).Config.Bind<bool>("Advanced", "UseHealEffect", false, "Route regeneration through the game's Heal() call so the heal visual effect plays. Off by default: the amount Heal() actually restores could not be verified, so the default path writes dollar values directly instead. Only turn this on if you want the effect and have checked the numbers with Verbose."); Verbose = ((BaseUnityPlugin)this).Config.Bind<bool>("Debug", "Verbose", false, "Log every regeneration tick with before/after values. Turn this on for the first run to calibrate RegenPercentPerSecond."); _harmony = new Harmony("benjamin.valuableregen"); _harmony.PatchAll(typeof(BreakTracker)); _harmony.PatchAll(typeof(DestructionGuard)); _harmony.PatchAll(typeof(LevelResetPatch)); ((Component)this).gameObject.AddComponent<RegenRunner>(); Log.LogInfo((object)"ValuableRegen v1.2.0 loaded. Broken things mend."); } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } internal static void Trace(string msg) { if (Verbose != null && Verbose.Value) { Log.LogInfo((object)msg); } } } internal class RegenRunner : MonoBehaviour { private float _timer; private void Update() { if (Plugin.Enabled.Value && SemiFunc.IsMasterClientOrSingleplayer() && DamagedRegistry.Count != 0) { _timer -= Time.deltaTime; if (!(_timer > 0f)) { Tick(_timer = Plugin.RegenInterval.Value); } } } private void Tick(float delta) { List<ValuableObject> list = DamagedRegistry.Snapshot(); for (int i = 0; i < list.Count; i++) { ValuableObject val = list[i]; if ((Object)(object)val == (Object)null) { DamagedRegistry.Forget(val); } else { if (!DamagedRegistry.TryGet(val, out var record)) { continue; } float original = record.Original; if (original <= 0f) { DamagedRegistry.Forget(val); continue; } float dollarValueCurrent = val.dollarValueCurrent; float num = original * Plugin.MaxRestoreFraction.Value; if (dollarValueCurrent >= num - 0.01f) { DamagedRegistry.Forget(val); } else if (!(Time.time - record.LastDamage < Plugin.DamageCooldown.Value) && (!Plugin.PauseWhileHeld.Value || !((Object)(object)val.physGrabObject != (Object)null) || !val.physGrabObject.grabbed)) { float num2 = original * (Plugin.RegenPercentPerSecond.Value / 100f) * delta; float target = Mathf.Min(dollarValueCurrent + num2, num); Apply(val, dollarValueCurrent, target, original); } } } } private void Apply(ValuableObject valuable, float current, float target, float original) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (Plugin.UseHealEffect.Value && (Object)(object)valuable.impactDetector != (Object)null) { float num = (target - current) / original * 100f; valuable.impactDetector.Heal(num, ((Component)valuable).transform.position); } else { ValueWriter.SetValue(valuable, target, original); } Plugin.Trace($"[ValuableRegen] {((Object)valuable).name}: {current:F0} -> {valuable.dollarValueCurrent:F0} " + $"(target {target:F0}, original {original:F0})"); } } internal static class ValueWriter { internal static void SetValue(ValuableObject valuable, float target, float original) { if (!((Object)(object)valuable == (Object)null)) { valuable.dollarValueCurrent = target; if (SemiFunc.IsMultiplayer() && (Object)(object)valuable.photonView != (Object)null) { valuable.photonView.RPC("DollarValueSetRPC", (RpcTarget)1, new object[1] { target }); } valuable.dollarValueOriginal = original; } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "ValuableRegen"; public const string PLUGIN_NAME = "ValuableRegen"; public const string PLUGIN_VERSION = "1.2.0"; } } namespace ValuableRegen.Patches { [HarmonyPatch(typeof(PhysGrabObjectImpactDetector))] internal static class BreakTracker { private static void Register(PhysGrabObjectImpactDetector detector) { if (Plugin.Enabled.Value && !((Object)(object)detector == (Object)null)) { ValuableObject component = ((Component)detector).GetComponent<ValuableObject>(); if (!((Object)(object)component == (Object)null)) { DamagedRegistry.MarkDamaged(component); } } } [HarmonyPostfix] [HarmonyPatch("Break")] private static void AfterBreak(PhysGrabObjectImpactDetector __instance, float valueLost, Vector3 _contactPoint, int breakLevel, bool _forceBreak) { Register(__instance); } [HarmonyPostfix] [HarmonyPatch("BreakRPC")] private static void AfterBreakRPC(PhysGrabObjectImpactDetector __instance) { Register(__instance); } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector))] internal static class DestructionGuard { private static bool Allow(PhysGrabObjectImpactDetector detector) { if (!Plugin.Enabled.Value || !Plugin.PreventDestruction.Value) { return true; } if ((Object)(object)detector == (Object)null) { return true; } ValuableObject valuableObject = detector.valuableObject; if ((Object)(object)valuableObject == (Object)null) { return true; } DamagedRegistry.MarkDamaged(valuableObject); if (!DamagedRegistry.TryGet(valuableObject, out var record)) { return true; } float num = record.Original * (Plugin.RescueValuePercent.Value / 100f); if (valuableObject.dollarValueCurrent < num) { ValueWriter.SetValue(valuableObject, num, record.Original); } Plugin.Trace("[ValuableRegen] Saved " + ((Object)valuableObject).name + " from destruction at " + $"{valuableObject.dollarValueCurrent:F0} (original {record.Original:F0})."); return false; } [HarmonyPrefix] [HarmonyPatch("DestroyObject")] private static bool BeforeDestroyObject(PhysGrabObjectImpactDetector __instance, bool effects) { return Allow(__instance); } [HarmonyPrefix] [HarmonyPatch("DestroyObjectRPC")] private static bool BeforeDestroyObjectRPC(PhysGrabObjectImpactDetector __instance) { return Allow(__instance); } } [HarmonyPatch(typeof(RunManager))] internal static class LevelResetPatch { [HarmonyPostfix] [HarmonyPatch("ChangeLevel")] private static void AfterChangeLevel() { DamagedRegistry.Clear(); } } }
plugins/StaminaTuner.dll
Decompiled a day agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 StaminaTuner { [BepInPlugin("benjamin.staminatuner", "StaminaTuner", "1.0.0")] [BepInProcess("REPO.exe")] public class Plugin : BaseUnityPlugin { public const string Guid = "benjamin.staminatuner"; public const string Name = "StaminaTuner"; public const string Version = "1.0.0"; internal static ManualLogSource Log; internal static ConfigEntry<bool> Enabled; internal static ConfigEntry<float> MaxStaminaMult; internal static ConfigEntry<float> DrainMult; internal static ConfigEntry<bool> Verbose; private void Awake() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Master switch. Turning it off restores the captured vanilla baselines, not just stops adjusting."); MaxStaminaMult = ((BaseUnityPlugin)this).Config.Bind<float>("Stamina", "MaxStaminaMult", 1f, new ConfigDescription("Multiplier on total stamina. Applied to the base value so stamina upgrades still stack normally on top.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 4f), Array.Empty<object>())); DrainMult = ((BaseUnityPlugin)this).Config.Bind<float>("Stamina", "DrainMult", 1f, new ConfigDescription("Multiplier on how fast sprinting drains stamina. Below 1 sprints last longer; 0.5 is half drain.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 2f), Array.Empty<object>())); Verbose = ((BaseUnityPlugin)this).Config.Bind<bool>("Debug", "Verbose", false, "Log captured baselines."); ((Component)this).gameObject.AddComponent<Tuner>(); Log.LogInfo((object)"StaminaTuner v1.0.0 loaded."); } } internal class Tuner : MonoBehaviour { private PlayerController _pc; private bool _captured; private bool _wasEnabled = true; private float _energyStart; private float _drain; private void LateUpdate() { PlayerController instance = PlayerController.instance; if ((Object)(object)instance == (Object)null) { _captured = false; return; } if (instance != _pc) { _pc = instance; _captured = false; } if (!_captured) { _energyStart = instance.EnergyStart; _drain = instance.EnergySprintDrain; _captured = true; if (Plugin.Verbose.Value) { Plugin.Log.LogInfo((object)$"[StaminaTuner] Baselines energyStart={_energyStart} drain={_drain}"); } } if (!Plugin.Enabled.Value) { if (_wasEnabled) { instance.EnergyStart = _energyStart; instance.EnergySprintDrain = _drain; _wasEnabled = false; } } else { _wasEnabled = true; instance.EnergyStart = _energyStart * Plugin.MaxStaminaMult.Value; instance.EnergySprintDrain = _drain * Plugin.DrainMult.Value; } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "StaminaTuner"; public const string PLUGIN_NAME = "StaminaTuner"; public const string PLUGIN_VERSION = "1.0.0"; } }
plugins/ShopSafety.dll
Decompiled a day agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 ShopSafety { [BepInPlugin("benjamin.shopsafety", "ShopSafety", "1.0.0")] [BepInProcess("REPO.exe")] public class Plugin : BaseUnityPlugin { public const string Guid = "benjamin.shopsafety"; public const string Name = "ShopSafety"; public const string Version = "1.0.0"; internal static ManualLogSource Log; private Harmony _harmony; internal static ConfigEntry<bool> Enabled; internal static ConfigEntry<bool> BlockAllDamage; internal static ConfigEntry<bool> Verbose; private void Awake() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Master switch."); BlockAllDamage = ((BaseUnityPlugin)this).Config.Bind<bool>("Safety", "BlockAllDamage", false, "Block every source of damage in the shop, not just enemy damage. Off by default so you can still fall off things - the shop's threat is the occasional wandering enemy, not fall damage."); Verbose = ((BaseUnityPlugin)this).Config.Bind<bool>("Debug", "Verbose", false, "Log every block."); _harmony = new Harmony("benjamin.shopsafety"); _harmony.PatchAll(typeof(ShopDamagePatch)); Log.LogInfo((object)"ShopSafety v1.0.0 loaded."); } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } internal static void Trace(string m) { if (Verbose != null && Verbose.Value) { Log.LogInfo((object)m); } } } [HarmonyPatch(typeof(PlayerHealth))] internal static class ShopDamagePatch { private static bool Block(int enemyIndex) { if (!Plugin.Enabled.Value) { return false; } if (!SemiFunc.RunIsShop()) { return false; } if (!Plugin.BlockAllDamage.Value) { return enemyIndex >= 0; } return true; } [HarmonyPrefix] [HarmonyPatch("Hurt")] private static bool BeforeHurt(int damage, int enemyIndex) { if (!Block(enemyIndex)) { return true; } Plugin.Trace($"[ShopSafety] Blocked {damage} damage in shop."); return false; } [HarmonyPrefix] [HarmonyPatch("HurtOther")] private static bool BeforeHurtOther(int damage, int enemyIndex) { if (!Block(enemyIndex)) { return true; } Plugin.Trace($"[ShopSafety] Blocked {damage} remote damage in shop."); return false; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "ShopSafety"; public const string PLUGIN_NAME = "ShopSafety"; public const string PLUGIN_VERSION = "1.0.0"; } }
plugins/SpectateFreecam.dll
Decompiled a day agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 SpectateFreecam { [BepInPlugin("benjamin.spectatefreecam", "SpectateFreecam", "1.0.0")] [BepInProcess("REPO.exe")] public class Plugin : BaseUnityPlugin { public const string Guid = "benjamin.spectatefreecam"; public const string Name = "SpectateFreecam"; public const string Version = "1.0.0"; internal static ManualLogSource Log; private Harmony _harmony; internal static ConfigEntry<bool> Enabled; internal static ConfigEntry<KeyCode> ZoomInKey; internal static ConfigEntry<KeyCode> ZoomOutKey; internal static ConfigEntry<float> MinFov; internal static ConfigEntry<float> MaxFov; internal static ConfigEntry<float> ZoomStep; 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Expected O, but got Unknown //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Master switch."); ZoomInKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Zoom", "ZoomInKey", (KeyCode)61, "Narrow the spectate camera's field of view (zoom in)."); ZoomOutKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Zoom", "ZoomOutKey", (KeyCode)45, "Widen the spectate camera's field of view (zoom out)."); MinFov = ((BaseUnityPlugin)this).Config.Bind<float>("Zoom", "MinFov", 20f, new ConfigDescription("Tightest zoom.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 60f), Array.Empty<object>())); MaxFov = ((BaseUnityPlugin)this).Config.Bind<float>("Zoom", "MaxFov", 90f, new ConfigDescription("Widest zoom.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(60f, 120f), Array.Empty<object>())); ZoomStep = ((BaseUnityPlugin)this).Config.Bind<float>("Zoom", "ZoomStep", 5f, new ConfigDescription("Degrees per keypress.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 20f), Array.Empty<object>())); _harmony = new Harmony("benjamin.spectatefreecam"); _harmony.PatchAll(typeof(SpectateZoomPatch)); Log.LogInfo((object)"SpectateFreecam v1.0.0 loaded."); } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } } [HarmonyPatch(typeof(SpectateCamera))] internal static class SpectateZoomPatch { [HarmonyPrefix] [HarmonyPatch("LateUpdate")] private static void BeforeLateUpdate(SpectateCamera __instance) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) if (Plugin.Enabled.Value) { if (Input.GetKeyDown(Plugin.ZoomInKey.Value)) { __instance.cameraFieldOfView = Mathf.Max(Plugin.MinFov.Value, __instance.cameraFieldOfView - Plugin.ZoomStep.Value); } if (Input.GetKeyDown(Plugin.ZoomOutKey.Value)) { __instance.cameraFieldOfView = Mathf.Min(Plugin.MaxFov.Value, __instance.cameraFieldOfView + Plugin.ZoomStep.Value); } } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "SpectateFreecam"; public const string PLUGIN_NAME = "SpectateFreecam"; public const string PLUGIN_VERSION = "1.0.0"; } }
plugins/RunHUD.dll
Decompiled a day agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 RunHUD { [BepInPlugin("benjamin.runhud", "RunHUD", "1.0.0")] [BepInProcess("REPO.exe")] public class Plugin : BaseUnityPlugin { public const string Guid = "benjamin.runhud"; public const string Name = "RunHUD"; public const string Version = "1.0.0"; internal static ManualLogSource Log; internal static ConfigEntry<bool> Enabled; internal static ConfigEntry<bool> ShowLevel; internal static ConfigEntry<bool> ShowHaul; internal static ConfigEntry<bool> ShowEnemyCount; internal static ConfigEntry<int> Corner; internal static ConfigEntry<float> Scale; private void Awake() { //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Master switch."); ShowLevel = ((BaseUnityPlugin)this).Config.Bind<bool>("Display", "ShowLevel", true, "Show the current level number and name."); ShowHaul = ((BaseUnityPlugin)this).Config.Bind<bool>("Display", "ShowHaul", true, "Show hauled value against the extraction goal, with a percentage."); ShowEnemyCount = ((BaseUnityPlugin)this).Config.Bind<bool>("Display", "ShowEnemyCount", false, "Show how many enemies are currently spawned. Host only - clients have no reliable count. Off by default because knowing is arguably cheating."); Corner = ((BaseUnityPlugin)this).Config.Bind<int>("Display", "Corner", 1, new ConfigDescription("0 top-left, 1 top-right, 2 bottom-left, 3 bottom-right.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 3), Array.Empty<object>())); Scale = ((BaseUnityPlugin)this).Config.Bind<float>("Display", "Scale", 1f, new ConfigDescription("Text size multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.6f, 2.5f), Array.Empty<object>())); ((Component)this).gameObject.AddComponent<Hud>(); Log.LogInfo((object)"RunHUD v1.0.0 loaded."); } } internal class Hud : MonoBehaviour { private void OnGUI() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) if (Plugin.Enabled.Value && SemiFunc.RunIsLevel()) { string text = Build(); if (!string.IsNullOrEmpty(text)) { GUIStyle val = new GUIStyle(GUI.skin.label) { richText = true, alignment = (TextAnchor)0, fontSize = Mathf.RoundToInt(14f * Plugin.Scale.Value) }; Vector2 val2 = val.CalcSize(new GUIContent(text)); val2.x += 18f; val2.y += 14f; float num = ((Plugin.Corner.Value == 0 || Plugin.Corner.Value == 2) ? 16f : ((float)Screen.width - val2.x - 16f)); float num2 = ((Plugin.Corner.Value == 0 || Plugin.Corner.Value == 1) ? 16f : ((float)Screen.height - val2.y - 16f)); Rect val3 = default(Rect); ((Rect)(ref val3))..ctor(num, num2, val2.x, val2.y); GUI.color = new Color(0f, 0f, 0f, 0.55f); GUI.Box(val3, GUIContent.none); GUI.color = Color.white; GUI.Label(new Rect(((Rect)(ref val3)).x + 9f, ((Rect)(ref val3)).y + 7f, ((Rect)(ref val3)).width, ((Rect)(ref val3)).height), text, val); } } } private string Build() { StringBuilder stringBuilder = new StringBuilder(); RunManager instance = RunManager.instance; if (Plugin.ShowLevel.Value && (Object)(object)instance != (Object)null) { string text = (((Object)(object)instance.levelCurrent != (Object)null) ? ((Object)instance.levelCurrent).name : ""); int num = text.LastIndexOf('-'); if (num >= 0 && num < text.Length - 1) { text = text.Substring(num + 1).Trim(); } stringBuilder.Append($"<b>Level {instance.levelsCompleted + 1}</b>"); if (!string.IsNullOrEmpty(text)) { stringBuilder.Append(" <color=#9aa0a6>" + text + "</color>"); } } RoundDirector instance2 = RoundDirector.instance; if (Plugin.ShowHaul.Value && (Object)(object)instance2 != (Object)null && instance2.haulGoal > 0) { if (stringBuilder.Length > 0) { stringBuilder.Append('\n'); } float num2 = (float)instance2.currentHaul / (float)instance2.haulGoal * 100f; string text2 = ((num2 >= 100f) ? "#7fd4a0" : ((num2 >= 60f) ? "#e8c46a" : "#ff8a5c")); stringBuilder.Append($"Haul <color={text2}><b>{instance2.currentHaul:n0}</b></color> / {instance2.haulGoal:n0} ({num2:0}%)"); } EnemyDirector instance3 = EnemyDirector.instance; if (Plugin.ShowEnemyCount.Value && (Object)(object)instance3 != (Object)null && SemiFunc.IsMasterClientOrSingleplayer() && instance3.enemiesSpawned != null) { if (stringBuilder.Length > 0) { stringBuilder.Append('\n'); } stringBuilder.Append($"<color=#9aa0a6>Enemies spawned {instance3.enemiesSpawned.Count}</color>"); } return stringBuilder.ToString(); } } public static class MyPluginInfo { public const string PLUGIN_GUID = "RunHUD"; public const string PLUGIN_NAME = "RunHUD"; public const string PLUGIN_VERSION = "1.0.0"; } }
plugins/ColoredNametags.dll
Decompiled a day agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 ColoredNametags { [BepInPlugin("benjamin.colorednametags", "ColoredNametags", "1.0.0")] [BepInProcess("REPO.exe")] public class Plugin : BaseUnityPlugin { public const string Guid = "benjamin.colorednametags"; public const string Name = "ColoredNametags"; public const string Version = "1.0.0"; internal static ManualLogSource Log; private Harmony _harmony; internal static ConfigEntry<bool> Enabled; internal static ConfigEntry<float> Saturation; internal static ConfigEntry<float> MinBrightness; private void Awake() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Master switch."); Saturation = ((BaseUnityPlugin)this).Config.Bind<float>("Appearance", "Saturation", 1f, new ConfigDescription("Blend between white (0) and the player's full colour (1). Lower it if saturated nametags are hard to read against bright rooms.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); MinBrightness = ((BaseUnityPlugin)this).Config.Bind<float>("Appearance", "MinBrightness", 0.45f, new ConfigDescription("Floor on how dark a nametag may render. Without this a player who picks near-black becomes effectively invisible in a dark corridor.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); _harmony = new Harmony("benjamin.colorednametags"); _harmony.PatchAll(typeof(NametagPatch)); Log.LogInfo((object)"ColoredNametags v1.0.0 loaded."); } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } } [HarmonyPatch(typeof(WorldSpaceUIPlayerName))] internal static class NametagPatch { [HarmonyPostfix] [HarmonyPatch("Update")] private static void AfterUpdate(WorldSpaceUIPlayerName __instance) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) if (Plugin.Enabled.Value && !((Object)(object)__instance.text == (Object)null) && !((Object)(object)__instance.playerAvatar == (Object)null)) { Color val = SemiFunc.PlayerGetColorMain(__instance.playerAvatar); val = Color.Lerp(Color.white, val, Plugin.Saturation.Value); float num = Mathf.Max(val.r, Mathf.Max(val.g, val.b)); float value = Plugin.MinBrightness.Value; if (num > 0.001f && num < value) { val *= value / num; } val.a = ((Graphic)__instance.text).color.a; ((Graphic)__instance.text).color = val; } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "ColoredNametags"; public const string PLUGIN_NAME = "ColoredNametags"; public const string PLUGIN_VERSION = "1.0.0"; } }
plugins/CustomColors.dll
Decompiled a day agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 CustomColors { [HarmonyPatch(typeof(SemiFunc))] internal static class ColorPatch { [HarmonyPostfix] [HarmonyPatch("PlayerGetColorMain")] private static void AfterPlayerGetColorMain(PlayerAvatar _player, ref Color __result) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (Plugin.Enabled.Value) { Color? val = ColorSync.Lookup(_player); if (val.HasValue) { __result = val.Value; } } } } internal class ColorPicker : MonoBehaviour { private bool _open; private int _row; private float[] _rgb = new float[3] { 0.31f, 0.76f, 0.97f }; private bool _loaded; private static readonly string[] Names = new string[3] { "Red", "Green", "Blue" }; private void Update() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.Enabled.Value) { return; } if (!_loaded) { Color? val = ColorSync.Parse(Plugin.MyColor.Value); if (val.HasValue) { _rgb[0] = val.Value.r; _rgb[1] = val.Value.g; _rgb[2] = val.Value.b; } _loaded = true; Publish(); } if (!SemiFunc.RunIsShop() && !SemiFunc.RunIsLobby() && !SemiFunc.RunIsLobbyMenu()) { _open = false; return; } if (Input.GetKeyDown(Plugin.ToggleKey.Value)) { _open = !_open; if (!_open) { Publish(); } } if (_open) { if (Input.GetKeyDown((KeyCode)274)) { _row = (_row + 1) % 3; } if (Input.GetKeyDown((KeyCode)273)) { _row = (_row + 2) % 3; } float num = (Input.GetKey((KeyCode)304) ? 0.02f : 0.08f); if (Input.GetKeyDown((KeyCode)275)) { Nudge(num); } if (Input.GetKeyDown((KeyCode)276)) { Nudge(0f - num); } } } private void Nudge(float delta) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) _rgb[_row] = Mathf.Clamp01(Mathf.Round((_rgb[_row] + delta) * 100f) / 100f); Plugin.MyColor.Value = "#" + ColorUtility.ToHtmlStringRGB(Current()); } private Color Current() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) return new Color(_rgb[0], _rgb[1], _rgb[2]); } private void Publish() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) ColorSync.Publish(Current()); } private void OnGUI() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) if (_open) { Rect val = default(Rect); ((Rect)(ref val))..ctor(24f, 24f, 320f, 190f); GUI.color = new Color(0f, 0f, 0f, 0.82f); GUI.Box(val, GUIContent.none); GUI.color = Color.white; GUILayout.BeginArea(new Rect(((Rect)(ref val)).x + 14f, ((Rect)(ref val)).y + 12f, ((Rect)(ref val)).width - 28f, ((Rect)(ref val)).height - 24f)); GUILayout.Label("<b>Your colour</b>", Rich(), Array.Empty<GUILayoutOption>()); GUI.color = Current(); GUILayout.Box(GUIContent.none, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(18f) }); GUI.color = Color.white; GUILayout.Space(4f); for (int i = 0; i < 3; i++) { string arg = ((_row == i) ? "> " : " "); int num = Mathf.RoundToInt(_rgb[i] * 100f); GUILayout.Label($"<size=14>{arg}{Names[i],-6} {num,3}%</size>", Rich(), Array.Empty<GUILayoutOption>()); } GUILayout.Space(6f); GUILayout.Label("<size=11>" + Plugin.MyColor.Value + " · Up/Down select · Left/Right adjust\n" + $"Shift for fine · {Plugin.ToggleKey.Value} closes and applies</size>", Rich(), Array.Empty<GUILayoutOption>()); GUILayout.EndArea(); } } private static GUIStyle Rich() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown return new GUIStyle(GUI.skin.label) { richText = true, wordWrap = true }; } } internal static class ColorSync { private const string Key = "bcol"; internal static void Publish(Color colour) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0032: Expected O, but got Unknown if (PhotonNetwork.IsConnected && PhotonNetwork.LocalPlayer != null) { string text = "#" + ColorUtility.ToHtmlStringRGB(colour); Hashtable val = new Hashtable(); ((Dictionary<object, object>)val).Add((object)"bcol", (object)text); Hashtable val2 = val; PhotonNetwork.LocalPlayer.SetCustomProperties(val2, (Hashtable)null, (WebFlags)null); Plugin.Trace("[CustomColors] Published " + text); } } internal static Color? Lookup(PlayerAvatar avatar) { if ((Object)(object)avatar == (Object)null) { return null; } if (avatar.isLocal || !PhotonNetwork.IsConnected) { return Parse(Plugin.MyColor.Value); } PhotonView photonView = avatar.photonView; Player val = (((Object)(object)photonView != (Object)null) ? photonView.Owner : null); if (val == null) { return null; } if (val.CustomProperties != null && ((Dictionary<object, object>)(object)val.CustomProperties).TryGetValue((object)"bcol", out object value) && value is string hex) { return Parse(hex); } return null; } internal static Color? Parse(string hex) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrEmpty(hex)) { return null; } if (!hex.StartsWith("#")) { hex = "#" + hex; } Color value = default(Color); if (!ColorUtility.TryParseHtmlString(hex, ref value)) { return null; } return value; } } [BepInPlugin("benjamin.customcolors", "CustomColors", "1.0.0")] [BepInProcess("REPO.exe")] public class Plugin : BaseUnityPlugin { public const string Guid = "benjamin.customcolors"; public const string Name = "CustomColors"; public const string Version = "1.0.0"; internal static ManualLogSource Log; private Harmony _harmony; internal static ConfigEntry<bool> Enabled; internal static ConfigEntry<string> MyColor; internal static ConfigEntry<KeyCode> ToggleKey; internal static ConfigEntry<bool> Verbose; private void Awake() { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Master switch. Turn off to fall back to the vanilla palette."); MyColor = ((BaseUnityPlugin)this).Config.Bind<string>("Colour", "MyColor", "#4FC3F7", "Your colour as a hex string, e.g. #4FC3F7. Editable in-game with the picker; this is where it persists."); ToggleKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "ToggleKey", (KeyCode)289, "Opens the colour picker. Works in the lobby and the shop, not mid-level."); Verbose = ((BaseUnityPlugin)this).Config.Bind<bool>("Debug", "Verbose", false, "Log colour broadcasts and lookups."); _harmony = new Harmony("benjamin.customcolors"); _harmony.PatchAll(typeof(ColorPatch)); ((Component)this).gameObject.AddComponent<ColorPicker>(); Log.LogInfo((object)string.Format("{0} v{1} loaded. Picker on {2}.", "CustomColors", "1.0.0", ToggleKey.Value)); } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } internal static void Trace(string msg) { if (Verbose != null && Verbose.Value) { Log.LogInfo((object)msg); } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "CustomColors"; public const string PLUGIN_NAME = "CustomColors"; public const string PLUGIN_VERSION = "1.0.0"; } }
plugins/ReviveHealth.dll
Decompiled a day agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 ReviveHealth { [BepInPlugin("benjamin.revivehealth", "ReviveHealth", "1.0.1")] [BepInProcess("REPO.exe")] public class Plugin : BaseUnityPlugin { public const string Guid = "benjamin.revivehealth"; public const string Name = "ReviveHealth"; public const string Version = "1.0.1"; internal static ManualLogSource Log; private Harmony _harmony; internal static ConfigEntry<bool> Enabled; internal static ConfigEntry<int> RevivePercent; internal static ConfigEntry<int> MinimumHealth; internal static ConfigEntry<bool> Verbose; private void Awake() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Master switch. Turn off to restore vanilla revive health without uninstalling."); RevivePercent = ((BaseUnityPlugin)this).Config.Bind<int>("Revive", "RevivePercent", 50, new ConfigDescription("Percent of the player's MAX health they come back with. Scales with health upgrades, so this stays fair all run rather than becoming irrelevant by level 10.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 100), Array.Empty<object>())); MinimumHealth = ((BaseUnityPlugin)this).Config.Bind<int>("Revive", "MinimumHealth", 10, new ConfigDescription("Floor, in absolute HP. Stops a low percentage on an un-upgraded player reviving them at 1 HP.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 200), Array.Empty<object>())); Verbose = ((BaseUnityPlugin)this).Config.Bind<bool>("Debug", "Verbose", false, "Log every revive with the health granted."); _harmony = new Harmony("benjamin.revivehealth"); _harmony.PatchAll(typeof(RevivePatch)); Log.LogInfo((object)"ReviveHealth v1.0.1 loaded."); } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } internal static void Trace(string msg) { if (Verbose != null && Verbose.Value) { Log.LogInfo((object)msg); } } } [HarmonyPatch(typeof(PlayerAvatar))] internal static class RevivePatch { [HarmonyPostfix] [HarmonyPatch("Revive")] private static void AfterRevive(PlayerAvatar __instance) { if (!Plugin.Enabled.Value) { return; } PlayerHealth playerHealth = __instance.playerHealth; if (!((Object)(object)playerHealth == (Object)null)) { int maxHealth = playerHealth.maxHealth; if (maxHealth > 0) { int num = Mathf.Max(Plugin.MinimumHealth.Value, Mathf.CeilToInt((float)maxHealth * ((float)Plugin.RevivePercent.Value / 100f))); num = Mathf.Min(num, maxHealth); int health = playerHealth.health; playerHealth.health = num; Plugin.Trace($"[ReviveHealth] {__instance.playerName}: revived at {health} -> {num}/{maxHealth}"); } } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "ReviveHealth"; public const string PLUGIN_NAME = "ReviveHealth"; public const string PLUGIN_VERSION = "1.0.1"; } }
plugins/ShopDifficulty.dll
Decompiled a day agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 ShopDifficulty { [HarmonyPatch(typeof(EnemyDirector))] internal static class EnemyCountPatch { [HarmonyPostfix] [HarmonyPatch("AmountSetup")] private static void AfterAmountSetup(EnemyDirector __instance) { if (Plugin.Enabled.Value && SemiFunc.IsMasterClientOrSingleplayer()) { float value = Plugin.EnemyCountMultiplier.Value; if (!Mathf.Approximately(value, 1f)) { int totalAmount = __instance.totalAmount; __instance.totalAmount = Scale(__instance.totalAmount, value); __instance.amountCurve1Value = Scale(__instance.amountCurve1Value, value); __instance.amountCurve2Value = Scale(__instance.amountCurve2Value, value); __instance.amountCurve3Value = Scale(__instance.amountCurve3Value, value); Plugin.Trace($"[ShopDifficulty] Enemy count {totalAmount} -> {__instance.totalAmount} " + $"(x{value:F2}); tiers {__instance.amountCurve1Value}/" + $"{__instance.amountCurve2Value}/{__instance.amountCurve3Value}"); } } } private static int Scale(int value, float mult) { if (value <= 0) { return value; } return Mathf.Max(1, Mathf.CeilToInt((float)value * mult)); } } [HarmonyPatch(typeof(RoundDirector))] internal static class HaulGoalPatch { private static bool _rebroadcasting; [HarmonyPostfix] [HarmonyPatch("StartRoundLogic")] private static void AfterStartRoundLogic(RoundDirector __instance, int value) { if (!Plugin.Enabled.Value || !Plugin.AllowHaulGoalChanges.Value || _rebroadcasting || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } float value2 = Plugin.HaulGoalMultiplier.Value; if (Mathf.Approximately(value2, 1f)) { return; } int num = Mathf.Max(1, Mathf.CeilToInt((float)value * value2)); if (num == value) { return; } __instance.haulGoal = num; if (SemiFunc.IsMultiplayer() && (Object)(object)__instance.photonView != (Object)null) { _rebroadcasting = true; try { __instance.photonView.RPC("StartRoundRPC", (RpcTarget)1, new object[1] { num }); } finally { _rebroadcasting = false; } } Plugin.Trace($"[ShopDifficulty] Haul goal {value} -> {num} (x{value2:F2})"); } } [BepInPlugin("benjamin.shopdifficulty", "ShopDifficulty", "1.0.0")] [BepInProcess("REPO.exe")] public class Plugin : BaseUnityPlugin { public const string Guid = "benjamin.shopdifficulty"; public const string Name = "ShopDifficulty"; public const string Version = "1.0.0"; internal static ManualLogSource Log; private Harmony _harmony; internal static ConfigEntry<bool> Enabled; internal static ConfigEntry<KeyCode> ToggleKey; internal static ConfigEntry<float> EnemyCountMultiplier; internal static ConfigEntry<float> HaulGoalMultiplier; internal static ConfigEntry<bool> AllowHaulGoalChanges; internal static ConfigEntry<bool> Verbose; private void Awake() { //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Expected O, but got Unknown //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Expected O, but got Unknown //IL_0168: Unknown result type (might be due to invalid IL or missing references) Log = ((BaseUnityPlugin)this).Logger; Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Master switch. Turn off to leave difficulty untouched without uninstalling."); ToggleKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "ToggleKey", (KeyCode)288, "Opens and closes the difficulty panel. Only works while you're in the shop."); EnemyCountMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Difficulty", "EnemyCountMultiplier", 1f, new ConfigDescription("Scales how many enemies the next level spawns. 1.0 is vanilla. Adjustable in-game from the shop; this is just where the value persists.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.1f, 4f), Array.Empty<object>())); HaulGoalMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Difficulty", "HaulGoalMultiplier", 1f, new ConfigDescription("Scales the extraction target for the next level. 1.0 is vanilla.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.25f, 3f), Array.Empty<object>())); AllowHaulGoalChanges = ((BaseUnityPlugin)this).Config.Bind<bool>("Difficulty", "AllowHaulGoalChanges", true, "Allow the haul goal to be adjusted. The new goal is re-broadcast to clients so they see the same number without needing the mod. Turn off if you only want to change enemy counts."); Verbose = ((BaseUnityPlugin)this).Config.Bind<bool>("Debug", "Verbose", false, "Log every difficulty adjustment with the before and after values."); _harmony = new Harmony("benjamin.shopdifficulty"); _harmony.PatchAll(typeof(EnemyCountPatch)); _harmony.PatchAll(typeof(HaulGoalPatch)); ((Component)this).gameObject.AddComponent<ShopPanel>(); Log.LogInfo((object)string.Format("{0} v{1} loaded. Press {2} in the shop.", "ShopDifficulty", "1.0.0", ToggleKey.Value)); } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } internal static void Trace(string msg) { if (Verbose != null && Verbose.Value) { Log.LogInfo((object)msg); } } } internal class ShopPanel : MonoBehaviour { private bool _open; private int _row; private static readonly string[] RowNames = new string[2] { "Enemy count", "Haul goal" }; private void Update() { //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.Enabled.Value) { return; } if (!SemiFunc.RunIsShop()) { _open = false; } else { if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } if (Input.GetKeyDown(Plugin.ToggleKey.Value)) { _open = !_open; } if (_open) { int num = ((!Plugin.AllowHaulGoalChanges.Value) ? 1 : 2); if (Input.GetKeyDown((KeyCode)274)) { _row = (_row + 1) % num; } if (Input.GetKeyDown((KeyCode)273)) { _row = (_row - 1 + num) % num; } float num2 = (Input.GetKey((KeyCode)304) ? 0.05f : 0.25f); if (Input.GetKeyDown((KeyCode)275)) { Adjust(_row, num2); } if (Input.GetKeyDown((KeyCode)276)) { Adjust(_row, 0f - num2); } if (Input.GetKeyDown((KeyCode)8)) { Reset(_row); } } } } private void Adjust(int row, float delta) { if (row == 0) { Plugin.EnemyCountMultiplier.Value = Clamp(Plugin.EnemyCountMultiplier.Value + delta, 0.1f, 4f); } else { Plugin.HaulGoalMultiplier.Value = Clamp(Plugin.HaulGoalMultiplier.Value + delta, 0.25f, 3f); } } private void Reset(int row) { if (row == 0) { Plugin.EnemyCountMultiplier.Value = 1f; } else { Plugin.HaulGoalMultiplier.Value = 1f; } } private static float Clamp(float v, float min, float max) { v = Mathf.Round(v * 100f) / 100f; return Mathf.Clamp(v, min, max); } private void OnGUI() { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) if (_open) { Rect val = default(Rect); ((Rect)(ref val))..ctor(24f, 24f, 340f, 172f); GUI.color = new Color(0f, 0f, 0f, 0.82f); GUI.Box(val, GUIContent.none); GUI.color = Color.white; GUILayout.BeginArea(new Rect(((Rect)(ref val)).x + 14f, ((Rect)(ref val)).y + 12f, 312f, 148f)); GUILayout.Label("<b>Difficulty — applies to the next level</b>", RichLabel(), Array.Empty<GUILayoutOption>()); GUILayout.Space(6f); DrawRow(0, RowNames[0], Plugin.EnemyCountMultiplier.Value); if (Plugin.AllowHaulGoalChanges.Value) { DrawRow(1, RowNames[1], Plugin.HaulGoalMultiplier.Value); } GUILayout.Space(8f); GUILayout.Label("<size=11>Up/Down select · Left/Right adjust · Shift for fine\nBackspace resets · " + ((object)Plugin.ToggleKey.Value/*cast due to .constrained prefix*/).ToString() + " closes</size>", RichLabel(), Array.Empty<GUILayoutOption>()); GUILayout.EndArea(); } } private void DrawRow(int index, string label, float value) { string text = ((_row == index) ? "> " : " "); string text2 = (Mathf.Approximately(value, 1f) ? "#cccccc" : ((value > 1f) ? "#ff8a5c" : "#7fd4a0")); GUILayout.Label($"<size=14>{text}{label} <color={text2}><b>{value:0.00}x</b></color></size>", RichLabel(), Array.Empty<GUILayoutOption>()); } private static GUIStyle RichLabel() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown return new GUIStyle(GUI.skin.label) { richText = true, wordWrap = true }; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "ShopDifficulty"; public const string PLUGIN_NAME = "ShopDifficulty"; public const string PLUGIN_VERSION = "1.0.0"; } }
plugins/MovementTuner.dll
Decompiled a day agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 MovementTuner { [BepInPlugin("benjamin.movementtuner", "MovementTuner", "1.0.0")] [BepInProcess("REPO.exe")] public class Plugin : BaseUnityPlugin { public const string Guid = "benjamin.movementtuner"; public const string Name = "MovementTuner"; public const string Version = "1.0.0"; internal static ManualLogSource Log; internal static ConfigEntry<bool> Enabled; internal static ConfigEntry<float> WalkSpeed; internal static ConfigEntry<float> SprintSpeed; internal static ConfigEntry<float> CrouchSpeed; internal static ConfigEntry<float> JumpForce; internal static ConfigEntry<bool> Verbose; private void Awake() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Master switch. Turn off to restore vanilla movement immediately - baselines are restored, not just left alone."); WalkSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Movement", "WalkSpeed", 1f, new ConfigDescription("Multiplier on base walk speed. 1.0 is vanilla.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 2.5f), Array.Empty<object>())); SprintSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Movement", "SprintSpeed", 1f, new ConfigDescription("Multiplier on base sprint speed. Applied to the base value, so speed upgrades still stack on top normally.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 2.5f), Array.Empty<object>())); CrouchSpeed = ((BaseUnityPlugin)this).Config.Bind<float>("Movement", "CrouchSpeed", 1f, new ConfigDescription("Multiplier on crouch speed.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 3f), Array.Empty<object>())); JumpForce = ((BaseUnityPlugin)this).Config.Bind<float>("Movement", "JumpForce", 1f, new ConfigDescription("Multiplier on jump force. Above about 1.4 you will start clipping into geometry.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 2f), Array.Empty<object>())); Verbose = ((BaseUnityPlugin)this).Config.Bind<bool>("Debug", "Verbose", false, "Log the captured baselines once per player."); ((Component)this).gameObject.AddComponent<Tuner>(); Log.LogInfo((object)"MovementTuner v1.0.0 loaded."); } } internal class Tuner : MonoBehaviour { private PlayerController _controller; private bool _captured; private bool _wasEnabled = true; private float _walk; private float _sprint; private float _crouch; private float _jump; private void LateUpdate() { PlayerController instance = PlayerController.instance; if ((Object)(object)instance == (Object)null) { _captured = false; return; } if (instance != _controller) { _controller = instance; _captured = false; } if (!_captured) { _walk = instance.MoveSpeed; _sprint = instance.SprintSpeed; _crouch = instance.CrouchSpeed; _jump = instance.JumpForce; _captured = true; if (Plugin.Verbose.Value) { Plugin.Log.LogInfo((object)$"[MovementTuner] Baselines walk={_walk} sprint={_sprint} crouch={_crouch} jump={_jump}"); } } if (!Plugin.Enabled.Value) { if (_wasEnabled) { instance.MoveSpeed = _walk; instance.SprintSpeed = _sprint; instance.CrouchSpeed = _crouch; instance.JumpForce = _jump; _wasEnabled = false; } } else { _wasEnabled = true; instance.MoveSpeed = _walk * Plugin.WalkSpeed.Value; instance.SprintSpeed = _sprint * Plugin.SprintSpeed.Value; instance.CrouchSpeed = _crouch * Plugin.CrouchSpeed.Value; instance.JumpForce = _jump * Plugin.JumpForce.Value; } } } public static class MyPluginInfo { public const string PLUGIN_GUID = "MovementTuner"; public const string PLUGIN_NAME = "MovementTuner"; public const string PLUGIN_VERSION = "1.0.0"; } }