using System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using FishNet.Object; using HarmonyLib; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.Events; 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: AssemblyCompany("Estonia")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("MultiplierEditor")] [assembly: AssemblyTitle("MultiplierEditor")] [assembly: AssemblyVersion("1.0.0.0")] [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 MultiplierEditor { [BepInPlugin("estonia.howtofish.multipliereditor", "Multiplier Editor", "1.0.0")] [BepInProcess("How to Fish.exe")] public sealed class MultiplierEditorPlugin : BaseUnityPlugin { private sealed class BonusSetting { private readonly string[] _matches; private readonly ConfigEntry _config; public string Label { get; } public float DefaultValue { get; } public float Value { get { return _config.Value; } set { _config.Value = value; } } public BonusSetting(string label, float defaultValue, ConfigEntry config, string[] aliases) { Label = label; DefaultValue = defaultValue; _config = config; List list = new List { Normalize(label) }; foreach (string value in aliases) { list.Add(Normalize(value)); } _matches = list.ToArray(); } public bool Matches(string normalizedName) { string[] matches = _matches; foreach (string text in matches) { if (normalizedName == text || normalizedName.Contains(text)) { return true; } } return false; } } [HarmonyPatch(typeof(KillScoreCalculator), "GetExplosionBonuses")] private static class ExplosionBonusesPatch { private static void Postfix(ref List __result) { _instance?.ApplyOverrides(__result); } } [HarmonyPatch(typeof(KillScoreCalculator), "GetMeleeBonuses")] private static class MeleeBonusesPatch { private static void Postfix(ref List __result) { _instance?.ApplyOverrides(__result); } } [HarmonyPatch(typeof(KillScoreCalculator), "GetMeleePlayerBonuses")] private static class MeleePlayerBonusesPatch { private static void Postfix(ref List __result) { _instance?.ApplyOverrides(__result); } } [HarmonyPatch(typeof(KillScoreCalculator), "GetRangedBonuses")] private static class RangedBonusesPatch { private static void Postfix(ref List __result) { _instance?.ApplyOverrides(__result); } } [HarmonyPatch(typeof(KillScoreCalculator), "GetRangedPlayerBonuses")] private static class RangedPlayerBonusesPatch { private static void Postfix(ref List __result) { _instance?.ApplyOverrides(__result); } } [HarmonyPatch(typeof(KillScoreCalculator), "GetAllBonuses")] private static class AllBonusesPatch { private static void Postfix(ref List __result) { _instance?.ApplyOverrides(__result); } } private const string PluginGuid = "estonia.howtofish.multipliereditor"; private const string PluginName = "Multiplier Editor"; private const string PluginVersion = "1.0.0"; private const string Author = "Estonia"; private static readonly BindingFlags PrivateStatic = BindingFlags.Static | BindingFlags.NonPublic; private static readonly BindingFlags PrivateInstance = BindingFlags.Instance | BindingFlags.NonPublic; private static MultiplierEditorPlugin _instance; private readonly List _bonusSettings = new List(); private readonly List