using 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 Gameplay.TacticalTargeting;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Photon.Pun;
using UnityEngine;
using VoidManager;
using VoidManager.CustomGUI;
using VoidManager.MPModChecks;
using VoidManager.Utilities;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyCompany("ExtraTargetLocksClient")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Template")]
[assembly: AssemblyFileVersion("1.0.1.0")]
[assembly: AssemblyInformationalVersion("1.0.1")]
[assembly: AssemblyProduct("ExtraTargetLocksClient")]
[assembly: AssemblyTitle("ExtraTargetLocksClient")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.1.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.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 ExtraTargetLocks
{
[BepInPlugin("ExtraTargetLocksClient", "ExtraTargetLocksClient", "1.0.1")]
[BepInProcess("Void Crew.exe")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInIncompatibility("ExtraTargetLocks")]
public class BepinPlugin : BaseUnityPlugin
{
internal class Bindings
{
internal static ConfigEntry<int> MaxTargetLocks;
internal const int AbsoluteMaxTargetLocks = 7;
}
internal static ManualLogSource Log;
private void Awake()
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Expected O, but got Unknown
Log = ((BaseUnityPlugin)this).Logger;
Bindings.MaxTargetLocks = ((BaseUnityPlugin)this).Config.Bind<int>("General", "CurrentMaxTargetLocks", 7, new ConfigDescription("The currently active number of max target locks.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(4, 7), Array.Empty<object>()));
Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin ExtraTargetLocksClient is loaded!");
}
}
internal class GUI : ModSettingsMenu
{
private string MTLString = string.Empty;
public override string Name()
{
return "Extra Target Locks: " + BepinPlugin.Bindings.MaxTargetLocks.Value;
}
public override void Draw()
{
if (Game.InGame && !PhotonNetwork.IsMasterClient)
{
GUILayout.Label("Must be host to configure. Current setting: " + BepinPlugin.Bindings.MaxTargetLocks.Value, Array.Empty<GUILayoutOption>());
return;
}
GUILayout.Label("Extra Target Locks", Array.Empty<GUILayoutOption>());
MTLString = GUILayout.TextField(MTLString, Array.Empty<GUILayoutOption>());
if (int.TryParse(MTLString, out var result) && result >= 4 && result <= 7)
{
if (GUILayout.Button("Apply Setting - Current value: " + BepinPlugin.Bindings.MaxTargetLocks.Value, Array.Empty<GUILayoutOption>()))
{
BepinPlugin.Bindings.MaxTargetLocks.Value = result;
if (Patches.CurrentUsedTacticalLock != null)
{
Patches.CurrentUsedTacticalLock.LockLimit = result;
}
}
}
else
{
GUILayout.Label("Cannot Change Setting - Must be a number between 4 and 7.", Array.Empty<GUILayoutOption>());
}
}
public override void OnOpen()
{
MTLString = BepinPlugin.Bindings.MaxTargetLocks.Value.ToString();
}
}
internal class Patches
{
[HarmonyPatch(typeof(TacticalLock), "AbilityStarted")]
internal class TacticalLockPatch
{
[HarmonyPostfix]
private static void Patch(TacticalLock __instance)
{
CurrentUsedTacticalLock = __instance;
__instance.LockLimit = BepinPlugin.Bindings.MaxTargetLocks.Value;
}
}
internal static TacticalLock CurrentUsedTacticalLock;
}
public class VoidManagerPlugin : VoidPlugin
{
public override MultiplayerType MPType => (MultiplayerType)3;
public override string Author => "Dragon";
public override string Description => "Increases max target locks. ClientSide";
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "ExtraTargetLocksClient";
public const string PLUGIN_NAME = "ExtraTargetLocksClient";
public const string PLUGIN_VERSION = "1.0.1";
}
}