using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using DM;
using Landfall.TABS;
using Landfall.TABS.GameMode;
using Landfall.TABS.UnitPlacement;
using Landfall.TABS.WinConditions;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("Tabs Poof Mod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Tabs Poof Mod")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("8aad4f38-2ad4-4206-bf0b-7d28fb6d5c2e")]
[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")]
namespace ReinforcementsMod;
[BepInPlugin("tabs.bayturtleking.reinforcementsmod", "Reinforcements Mod", "1.0.0")]
public class reinformod : BaseUnityPlugin
{
private void Awake()
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
ConfigEntry<KeyCode> val = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "Spawn panel key", (KeyCode)111, "The key that opens the Reinforcements menu.");
((Component)this).gameObject.AddComponent<goblinmarket>().thebutton = val.Value;
}
}
public class goblinmarket : MonoBehaviour
{
private string comment = "i hate imguis so much";
public KeyCode thebutton = (KeyCode)280;
private bool yeahok;
private bool yeahokbefore;
private Vector2 scrollything;
private string ransomnote = "";
private string ransomnotebutolder;
private Team whoshallsuffer = (Team)1;
private List<UnitBlueprint> thecat;
private List<UnitBlueprint> thegoodstuff;
private GameModeService theguy;
private Rect amazondeliverybox = new Rect(20f, 20f, 340f, 520f);
private CursorLockMode cursorwasdoingwhat;
private bool couldyouseeitbefore;
private MouseLook thecompass;
private bool wasthecompassspinningbefore;
private UnitBlueprint currentlypickedvictim;
private const float howbigeachthingis = 24f;
private void Update()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
if (Input.GetKeyDown(thebutton))
{
yeahok = !yeahok;
if (yeahok)
{
cursorwasdoingwhat = Cursor.lockState;
couldyouseeitbefore = Cursor.visible;
if ((Object)(object)thecompass == (Object)null)
{
thecompass = Object.FindObjectOfType<MouseLook>();
}
if ((Object)(object)thecompass != (Object)null)
{
wasthecompassspinningbefore = ((Behaviour)thecompass).enabled;
((Behaviour)thecompass).enabled = false;
}
}
else
{
currentlypickedvictim = null;
if ((Object)(object)thecompass != (Object)null)
{
((Behaviour)thecompass).enabled = wasthecompassspinningbefore;
}
}
}
if (yeahok && (Object)(object)currentlypickedvictim != (Object)null && Input.GetMouseButtonDown(0))
{
Vector2 val = default(Vector2);
((Vector2)(ref val))..ctor(Input.mousePosition.x, (float)Screen.height - Input.mousePosition.y);
if (!((Rect)(ref amazondeliverybox)).Contains(val))
{
dospawnjstuff(currentlypickedvictim);
}
}
}
private void LateUpdate()
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
if (yeahok)
{
Cursor.lockState = (CursorLockMode)0;
Cursor.visible = true;
}
else if (yeahokbefore)
{
Cursor.lockState = cursorwasdoingwhat;
Cursor.visible = couldyouseeitbefore;
}
yeahokbefore = yeahok;
}
private void OnGUI()
{
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Expected O, but got Unknown
//IL_0086: 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)
if (!yeahok)
{
return;
}
if ((Object)(object)theguy == (Object)null)
{
theguy = ServiceLocator.GetService<GameModeService>();
}
if (thecat == null)
{
thecat = (from dude in ContentDatabase.Instance().GetAllUnitBlueprints()
orderby dude.Entity.Name
select dude).ToList();
shakethecat();
}
amazondeliverybox = GUI.Window(84125, amazondeliverybox, new WindowFunction(dothestuff), "Turtle's Reinforcements");
}
private void shakethecat()
{
thegoodstuff = thecat.Where((UnitBlueprint dude) => string.IsNullOrEmpty(ransomnote) || dude.Entity.Name.ToLower().Contains(ransomnote.ToLower())).ToList();
ransomnotebutolder = ransomnote;
}
private void dothestuff(int whocares)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Invalid comparison between Unknown and I4
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_0164: Unknown result type (might be due to invalid IL or missing references)
//IL_0169: Unknown result type (might be due to invalid IL or missing references)
//IL_016e: Unknown result type (might be due to invalid IL or missing references)
//IL_017f: Unknown result type (might be due to invalid IL or missing references)
//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
if (GUILayout.Button(((int)whoshallsuffer == 1) ? "[BLUE!]" : "blue", Array.Empty<GUILayoutOption>()))
{
whoshallsuffer = (Team)1;
}
if (GUILayout.Button(((int)whoshallsuffer == 0) ? "[RED]" : "red", Array.Empty<GUILayoutOption>()))
{
whoshallsuffer = (Team)0;
}
GUILayout.EndHorizontal();
ransomnote = GUILayout.TextField(ransomnote, Array.Empty<GUILayoutOption>());
if (ransomnote != ransomnotebutolder)
{
shakethecat();
}
Rect rect = GUILayoutUtility.GetRect(10f, 10000f, 380f, 380f);
Rect val = default(Rect);
((Rect)(ref val))..ctor(0f, 0f, ((Rect)(ref rect)).width - 20f, (float)thegoodstuff.Count * 24f);
scrollything = GUI.BeginScrollView(rect, scrollything, val);
int num = Mathf.Max(0, Mathf.FloorToInt(scrollything.y / 24f));
int num2 = Mathf.Min(thegoodstuff.Count, Mathf.CeilToInt((scrollything.y + ((Rect)(ref rect)).height) / 24f) + 1);
for (int i = num; i < num2; i++)
{
UnitBlueprint val2 = thegoodstuff[i];
Rect val3 = new Rect(0f, (float)i * 24f, ((Rect)(ref val)).width, 22f);
Color backgroundColor = GUI.backgroundColor;
if ((Object)(object)currentlypickedvictim == (Object)(object)val2)
{
GUI.backgroundColor = Color.green;
}
if (GUI.Button(val3, val2.Entity.Name))
{
if ((Object)(object)currentlypickedvictim == (Object)(object)val2)
{
currentlypickedvictim = null;
}
else
{
currentlypickedvictim = val2;
}
}
GUI.backgroundColor = backgroundColor;
}
GUI.EndScrollView();
GUI.DragWindow();
}
private void dospawnjstuff(UnitBlueprint dude)
{
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: 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_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)theguy == (Object)null) && theguy.CurrentGameMode != null)
{
UnitPlacementBrush brush = theguy.CurrentGameMode.Brush;
Vector3 val = default(Vector3);
if (brush != null && brush.RaycastMap(ref val))
{
Quaternion val2 = Quaternion.Euler(0f, ((int)whoshallsuffer == 0) ? 90f : 270f, 0f);
brush.PlaceUnitInternal(dude, whoshallsuffer, val, val2, false, (RuntimeReference)null, false, false, false, 0);
}
}
}
}