using 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 UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: IgnoresAccessChecksTo("Autodesk.Fbx")]
[assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")]
[assembly: IgnoresAccessChecksTo("FbxBuildTestAssets")]
[assembly: IgnoresAccessChecksTo("Klattersynth")]
[assembly: IgnoresAccessChecksTo("Photon3Unity3D")]
[assembly: IgnoresAccessChecksTo("PhotonChat")]
[assembly: IgnoresAccessChecksTo("PhotonRealtime")]
[assembly: IgnoresAccessChecksTo("PhotonUnityNetworking")]
[assembly: IgnoresAccessChecksTo("PhotonUnityNetworking.Utilities")]
[assembly: IgnoresAccessChecksTo("PhotonVoice.API")]
[assembly: IgnoresAccessChecksTo("PhotonVoice")]
[assembly: IgnoresAccessChecksTo("PhotonVoice.PUN")]
[assembly: IgnoresAccessChecksTo("SingularityGroup.HotReload.Runtime")]
[assembly: IgnoresAccessChecksTo("SingularityGroup.HotReload.Runtime.Public")]
[assembly: IgnoresAccessChecksTo("Sirenix.OdinInspector.Attributes")]
[assembly: IgnoresAccessChecksTo("Sirenix.Serialization.Config")]
[assembly: IgnoresAccessChecksTo("Sirenix.Serialization")]
[assembly: IgnoresAccessChecksTo("Sirenix.Utilities")]
[assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")]
[assembly: IgnoresAccessChecksTo("Unity.Formats.Fbx.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem")]
[assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")]
[assembly: IgnoresAccessChecksTo("Unity.Postprocessing.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")]
[assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")]
[assembly: IgnoresAccessChecksTo("Unity.Timeline")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Antlr3.Runtime")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Core")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Flow")]
[assembly: IgnoresAccessChecksTo("Unity.VisualScripting.State")]
[assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")]
[assembly: IgnoresAccessChecksTo("UnityEngine.UI")]
[assembly: IgnoresAccessChecksTo("websocket-sharp")]
[assembly: AssemblyCompany("Drilixyr")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("IVSpawner")]
[assembly: AssemblyTitle("IVSpawner")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[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 IVSpawner
{
[HarmonyPatch(typeof(PlayerController))]
internal static class ExamplePlayerControllerPatch
{
[HarmonyPrefix]
[HarmonyPatch("Start")]
private static void Start_Prefix(PlayerController __instance)
{
IVSpawnerPlugin.ModLogger.LogInfo((object)$"{__instance} Start Prefix");
}
[HarmonyPostfix]
[HarmonyPatch("Start")]
private static void Start_Postfix(PlayerController __instance)
{
IVSpawnerPlugin.ModLogger.LogInfo((object)$"{__instance} Start Postfix");
}
}
[BepInPlugin("Drilixyr.IVSpawner", "IVSpawner", "1.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class IVSpawnerPlugin : BaseUnityPlugin
{
private ConfigEntry<KeyboardShortcut>? toggleUIKey;
private bool isUIVisible = false;
private Rect windowRect = new Rect(10f, 10f, 420f, 600f);
private Vector2 scrollPosition = Vector2.zero;
private string searchQuery = "";
private List<string> valuableItems = new List<string>
{
"Valuable Diamond", "Valuable Emerald Bracelet", "Valuable Goblet", "Valuable Ocarina", "Valuable Pocket Watch", "Valuable Uranium Mug", "Valuable Arctic Bonsai", "Valuable Arctic HDD", "Valuable Chomp Book", "Valuable Crown",
"Valuable Doll", "Valuable Frog", "Valuable Gem Box", "Valuable Globe", "Valuable Love Potion", "Valuable Money", "Valuable Music Box", "Valuable Toy Monkey", "Valuable Uranium Plate", "Valuable Vase Small",
"Valuable Arctic 3D Printer", "Valuable Arctic Laptop", "Valuable Arctic Propane Tank", "Valuable Arctic Sample", "Valuable Arctic Sample Six Pack", "Valuable Bottle", "Valuable Clown", "Valuable Computer", "Valuable Fan", "Valuable Gramophone",
"Valuable Marble Table", "Valuable Radio", "Valuable Ship in a bottle", "Valuable Trophy", "Valuable Vase", "Valuable Wizard Goblin Head", "Valuable Wizard Power Crystal", "Valuable Wizard Time Glass", "Valuable Arctic Barrel", "Valuable Arctic Big Sample",
"Valuable Creature Leg", "Valuable Arctic Flamethrower", "Valuable Arctic Guitar", "Valuable Arctic Sample Cooler", "Valuable Diamond Display", "Valuable Ice Saw", "Valuable Scream Doll", "Valuable Television", "Valuable Vase Big", "Valuable Wizard Cube of Knowledge",
"Valuable Wizard Master Potion", "Valuable Animal Crate", "Valuable Arctic Ice Block", "Valuable Dinosaur", "Valuable Piano", "Valuable Wizard Griffin Statue", "Valuable Arctic Science Station", "Valuable Harp", "Valuable Painting", "Valuable Wizard Dumgolfs Staff",
"Valuable Wizard Sword", "Valuable Arctic Server Rack", "Valuable Golden Statue", "Valuable Grandfather Clock", "Valuable Wizard Broom"
};
private List<string> normalItems = new List<string>
{
"Item Cart Medium", "Item Cart Small", "Item Drone Battery", "Item Drone Feather", "Item Drone Indestructible", "Item Drone Torque", "Item Drone Zero Gravity", "Item Extraction Tracker", "Item Grenade Duct Taped", "Item Grenade Explosive",
"Item Grenade Human", "Item Grenade Shockwave", "Item Grenade Stun", "Item Gun Handgun", "Item Gun Shotgun", "Item Gun Tranq", "Item Health Pack Large", "Item Health Pack Medium", "Item Health Pack Small", "Item Melee Baseball Bat",
"Item Melee Frying Pan", "Item Melee Inflatable Hammer", "Item Melee Sledge Hammer", "Item Melee Sword", "Item Mine Explosive", "Item Mine Shockwave", "Item Mine Stun", "Item Orb Zero Gravity", "Item Power Crystal", "Rubber Duck",
"Item Upgrade Map Player Count", "Item Upgrade Player Energy", "Item Upgrade Player Extra Jump", "Item Upgrade Player Grab Range", "Item Upgrade Player Grab Strength", "Item Upgrade Player Health", "Item Upgrade Player Sprint Speed", "Item Upgrade Player Tumble Launch", "Item Valuable Tracker"
};
private bool isValuablesTabActive = false;
internal static IVSpawnerPlugin Instance { get; private set; }
internal static ManualLogSource ModLogger => Instance.logger;
private ManualLogSource? logger => ((BaseUnityPlugin)this).Logger;
private void Awake()
{
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
Instance = this;
isValuablesTabActive = true;
((Component)this).gameObject.transform.parent = null;
((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
toggleUIKey = ((BaseUnityPlugin)this).Config.Bind<KeyboardShortcut>("Hotkeys", "ToggleUI", new KeyboardShortcut((KeyCode)282, Array.Empty<KeyCode>()), "Toggle item spawn menu.");
ModLogger.LogInfo((object)"IVSpawner mod loaded.");
}
private void Update()
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
ConfigEntry<KeyboardShortcut>? obj = toggleUIKey;
if (obj != null)
{
KeyboardShortcut value = obj.Value;
if (((KeyboardShortcut)(ref value)).IsDown())
{
isUIVisible = !isUIVisible;
}
}
}
private void OnGUI()
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Expected O, but got Unknown
//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)
if (isUIVisible)
{
windowRect = GUI.Window(0, windowRect, new WindowFunction(DrawWindow), "IVSpawner Menu");
}
}
private void DrawWindow(int windowID)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Expected O, but got Unknown
//IL_016a: Unknown result type (might be due to invalid IL or missing references)
//IL_0182: Unknown result type (might be due to invalid IL or missing references)
//IL_0187: Unknown result type (might be due to invalid IL or missing references)
//IL_0251: Unknown result type (might be due to invalid IL or missing references)
GUIStyle val = new GUIStyle(GUI.skin.button)
{
alignment = (TextAnchor)4
};
val.normal.textColor = Color.white;
val.hover.textColor = Color.yellow;
GUIStyle val2 = val;
GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
GUILayout.Space(10f);
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
GUILayout.FlexibleSpace();
if (GUILayout.Button("Valuables", val2, (GUILayoutOption[])(object)new GUILayoutOption[2]
{
GUILayout.Width(190f),
GUILayout.Height(30f)
}))
{
isValuablesTabActive = true;
}
GUILayout.Space(10f);
if (GUILayout.Button("Items", val2, (GUILayoutOption[])(object)new GUILayoutOption[2]
{
GUILayout.Width(190f),
GUILayout.Height(30f)
}))
{
isValuablesTabActive = false;
}
GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
GUILayout.Space(10f);
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
GUILayout.Space(10f);
GUILayout.Label("Search:", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(50f) });
searchQuery = GUILayout.TextField(searchQuery, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(320f) });
GUILayout.Space(10f);
GUILayout.EndHorizontal();
GUILayout.Space(10f);
scrollPosition = GUILayout.BeginScrollView(scrollPosition, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(480f) });
List<string> list = (isValuablesTabActive ? valuableItems : normalItems);
foreach (string item in list)
{
if ((string.IsNullOrEmpty(searchQuery) || item.ToLower().Contains(searchQuery.ToLower())) && GUILayout.Button(item, val2, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(370f) }))
{
TrySpawnItem(item);
}
}
GUILayout.EndScrollView();
GUILayout.EndVertical();
GUI.DragWindow(new Rect(0f, 0f, 10000f, 20f));
}
private void DrawValuablesTab()
{
//IL_0015: 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_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Expected O, but got Unknown
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Expected O, but got Unknown
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Expected O, but got Unknown
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Expected O, but got Unknown
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Expected O, but got Unknown
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: 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_0138: Unknown result type (might be due to invalid IL or missing references)
GUILayout.BeginArea(new Rect(20f, 150f, 350f, 200f));
Vector2 zero = Vector2.zero;
zero = GUILayout.BeginScrollView(zero, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(300f) });
foreach (string valuableItem in valuableItems)
{
GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
GUIStyle val = new GUIStyle(GUI.skin.button);
val.normal.textColor = Color.white;
val.normal.background = null;
val.hover.textColor = Color.yellow;
val.fontStyle = (FontStyle)1;
val.border = new RectOffset(2, 2, 2, 2);
val.margin = new RectOffset(5, 5, 5, 5);
val.padding = new RectOffset(10, 10, 5, 5);
Color white = Color.white;
Rect rect = GUILayoutUtility.GetRect(new GUIContent(valuableItem), val);
GUI.Box(new Rect(((Rect)(ref rect)).x - 1f, ((Rect)(ref rect)).y - 1f, ((Rect)(ref rect)).width + 2f, ((Rect)(ref rect)).height + 2f), GUIContent.none);
if (GUI.Button(rect, valuableItem, val))
{
TrySpawnItem(valuableItem);
}
if (GUILayout.Button(valuableItem, val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(300f) }))
{
TrySpawnItem(valuableItem);
}
GUILayout.EndVertical();
}
GUILayout.EndScrollView();
GUILayout.EndArea();
}
private void DrawItemsTab()
{
//IL_0015: 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_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Expected O, but got Unknown
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Expected O, but got Unknown
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Expected O, but got Unknown
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Expected O, but got Unknown
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Expected O, but got Unknown
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: 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_0138: Unknown result type (might be due to invalid IL or missing references)
GUILayout.BeginArea(new Rect(20f, 150f, 350f, 200f));
Vector2 zero = Vector2.zero;
zero = GUILayout.BeginScrollView(zero, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(300f) });
foreach (string normalItem in normalItems)
{
GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
GUIStyle val = new GUIStyle(GUI.skin.button);
val.normal.textColor = Color.white;
val.normal.background = null;
val.hover.textColor = Color.yellow;
val.fontStyle = (FontStyle)1;
val.border = new RectOffset(2, 2, 2, 2);
val.margin = new RectOffset(5, 5, 5, 5);
val.padding = new RectOffset(10, 10, 5, 5);
Color white = Color.white;
Rect rect = GUILayoutUtility.GetRect(new GUIContent(normalItem), val);
GUI.Box(new Rect(((Rect)(ref rect)).x - 1f, ((Rect)(ref rect)).y - 1f, ((Rect)(ref rect)).width + 2f, ((Rect)(ref rect)).height + 2f), GUIContent.none);
if (GUI.Button(rect, normalItem, val))
{
TrySpawnItem(normalItem);
}
if (GUILayout.Button(normalItem, val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(300f) }))
{
TrySpawnItem(normalItem);
}
GUILayout.EndVertical();
}
GUILayout.EndScrollView();
GUILayout.EndArea();
}
private void TrySpawnItem(string itemName)
{
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: 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)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
GameObject val = FindItemPrefab(itemName);
if ((Object)(object)val == (Object)null)
{
ModLogger.LogError((object)("Item prefab not found: " + itemName));
return;
}
PlayerController obj = Object.FindObjectOfType<PlayerController>();
GameObject val2 = ((obj != null) ? ((Component)obj).gameObject : null);
if ((Object)(object)val2 == (Object)null)
{
ModLogger.LogError((object)"No player found.");
return;
}
Vector3 val3 = val2.transform.position + val2.transform.forward * 2f;
GameObject val4 = Object.Instantiate<GameObject>(val, val3, Quaternion.identity);
((Object)val4).name = itemName + "_Clone";
ModLogger.LogInfo((object)("Spawned item: " + ((Object)val4).name));
}
private GameObject? FindItemPrefab(string itemName)
{
GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>();
GameObject[] array2 = array;
foreach (GameObject val in array2)
{
if (((Object)val).name == itemName)
{
return val;
}
}
return null;
}
}
}