Decompiled source of ELEVATOR v0.5.3

ELEVATOR.dll

Decompiled 2 months ago
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using Atlas;
using Atlas.MappingComponents.Sandbox;
using Atlas.MappingComponents.TakeAndHold;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using Sodalite.Api;
using Sodalite.Utilities;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
public class PrefabLoader : MonoBehaviour
{
	private AssetBundle LoadedPrefabAssetBundle;

	public string PrefabPath;

	public string Prefab_to_Load;

	private void Start()
	{
		LoadPrefab(PrefabPath);
		ActivatePrefab(Prefab_to_Load);
	}

	private void LoadPrefab(string bundleURL)
	{
		LoadedPrefabAssetBundle = AssetBundle.LoadFromFile(bundleURL);
		Debug.Log((object)((!((Object)(object)LoadedPrefabAssetBundle == (Object)null)) ? ("Loaded AssetBundle " + PrefabPath) : "AssetBundle Failed to load"));
	}

	private void ActivatePrefab(string Prefab_to_Load)
	{
		//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)
		Object val = LoadedPrefabAssetBundle.LoadAsset(Prefab_to_Load);
		Object.Instantiate(val, ((Component)this).transform.position, ((Component)this).transform.rotation);
	}
}
namespace AntiSosig.ELEVATOR
{
	[BepInPlugin("AntiSosig.ELEVATOR", "ELEVATOR", "0.5.3")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("nrgill28.Atlas", "1.0.1")]
	public class ELEVATORPlugin : BaseUnityPlugin
	{
		private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

		internal static ManualLogSource Logger;

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			LoadAssets();
		}

		private void LoadAssets()
		{
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "AntiSosig.ELEVATOR");
			AtlasPlugin.RegisterScene(Path.Combine(BasePath, "onlytakesandbox"));
		}
	}
	public class ColChechker : MonoBehaviour
	{
		[HideInInspector]
		public GameObject RoomToSpawn;

		public GameObject Wall;

		public Transform spawnpoint;

		public bool once = false;

		[HideInInspector]
		public RoomList rl;

		[HideInInspector]
		public RoomSpawner rs;

		public void SpawnRoom(GameObject room)
		{
			//IL_0008: 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)
			GameObject item = Object.Instantiate<GameObject>(room, spawnpoint.position, spawnpoint.rotation);
			rl.spawned.Add(item);
			Object.Destroy((Object)(object)((Component)spawnpoint).gameObject);
		}

		private void Start()
		{
		}

		private IEnumerator wait()
		{
			yield return (object)new WaitForSeconds(0.2f);
			rl.CRC++;
			rs.spawned = true;
			SpawnRoom(RoomToSpawn);
		}

		private void FixedUpdate()
		{
			MyCollisions();
		}

		private void MyCollisions()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			Collider[] array = Physics.OverlapBox(((Component)this).gameObject.transform.position, ((Component)this).transform.localScale / 2f, spawnpoint.rotation);
			int num = 0;
			while (num < array.Length)
			{
				Debug.Log((object)("Hit : " + ((Object)array[num]).name + num));
				if (((Object)array[num]).name != ((Object)spawnpoint).name)
				{
					num++;
				}
			}
			if (num > 0 || rl.CRC >= rl.max_RC)
			{
				Debug.Log((object)"Can't place it");
				GameObject item = Object.Instantiate<GameObject>(Wall, spawnpoint.position, spawnpoint.rotation);
				rs.spawned_type = -1;
				rs.spawned = true;
				rl.spawned.Add(item);
				Object.Destroy((Object)(object)((Component)spawnpoint).gameObject);
			}
			else if (num <= 0 && !once)
			{
				once = true;
				((MonoBehaviour)this).StartCoroutine(wait());
			}
		}

		private void OnDrawGizmos()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			Gizmos.color = Color.red;
			Gizmos.DrawWireCube(((Component)this).transform.position, ((Component)this).transform.localScale);
		}
	}
	public class Data_Sphere : MonoBehaviour
	{
		private RoomList rl;

		public Text sosig_num;

		private void Awake()
		{
			rl = GameObject.Find("ROOML").GetComponent<RoomList>();
		}

		private void Update()
		{
			if (rl.sosigs.Count > 0)
			{
				sosig_num.text = "" + rl.sosigs.Count;
			}
			else
			{
				sosig_num.text = "END";
			}
		}
	}
	public class Data_SphereBeacon : MonoBehaviour
	{
		public Vector3 offset;

		public GameObject DS;

		private void Update()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: 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_0025: Unknown result type (might be due to invalid IL or missing references)
			Vector3 position = DS.transform.position;
			Vector3 position2 = position + offset;
			((Component)this).transform.position = position2;
		}
	}
}
public class KillBox : MonoBehaviour
{
	private void OnTriggerEnter(Collider other)
	{
		Object.Destroy((Object)(object)((Component)other).gameObject);
	}
}
namespace AntiSosig.ELEVATOR
{
	public class LiftManager : MonoBehaviour
	{
		public Transform Corridor_spawn;

		public GameObject Corridor;

		public Text Timer;

		public Text SosigNum;

		public GameObject SosigNum_O;

		public Text Level;

		public GameObject StartButton;

		public GameObject NextButton;

		public GameObject TimerText;

		public int curr_level = 0;

		public RoomList rl;

		private bool started_counting = false;

		private bool started_hunt = false;

		private float time = 10f;

		public MiniCam MiniMap;

		private void Start()
		{
			//IL_000d: 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)
			GameObject item = Object.Instantiate<GameObject>(Corridor, Corridor_spawn.position, Corridor_spawn.rotation);
			rl.spawned.Add(item);
		}

		private void Update()
		{
			Level.text = "" + curr_level;
			if (rl.navMeshDone)
			{
				started_counting = true;
			}
			if (started_counting)
			{
				Timer.text = "" + time;
				if (time > 0f)
				{
					time -= Time.deltaTime;
				}
				else
				{
					EnableToOpen();
				}
			}
			else
			{
				Timer.text = ">-<";
			}
			if (started_hunt)
			{
				if (rl.sosigs.Count > 0)
				{
					SosigNum.text = "" + rl.sosigs.Count;
				}
				else
				{
					SosigNum.text = "END";
					SosigNum_O.SetActive(false);
					NextButton.SetActive(true);
					if (Input.GetKeyDown((KeyCode)278))
					{
						New_level();
					}
				}
			}
			if (Input.GetKeyDown((KeyCode)279))
			{
				StartHunt();
			}
		}

		private void EnableToOpen()
		{
			started_counting = false;
			time = 10f;
			TimerText.SetActive(false);
			NextButton.SetActive(false);
			StartButton.SetActive(true);
		}

		public void StartHunt()
		{
			TimerText.SetActive(false);
			StartButton.SetActive(false);
			NextButton.SetActive(false);
			SosigNum_O.SetActive(true);
			started_hunt = true;
		}

		public void New_level()
		{
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			rl.Swipe();
			rl.CRC = 0;
			MiniMap.rooms.Clear();
			MiniMap.rooms.Add(((Component)this).gameObject.transform);
			started_counting = false;
			started_hunt = false;
			time = 10f;
			curr_level++;
			TimerText.SetActive(true);
			StartButton.SetActive(false);
			SosigNum_O.SetActive(false);
			NextButton.SetActive(false);
			GameObject item = Object.Instantiate<GameObject>(Corridor, Corridor_spawn.position, Corridor_spawn.rotation);
			rl.spawned.Add(item);
		}
	}
	public class MiniCam : MonoBehaviour
	{
		public List<Transform> rooms = new List<Transform>();

		public Vector3 offset;

		private void LateUpdate()
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//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_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			Vector3 center = GetCenter();
			Vector3 position = center + offset;
			((Component)this).transform.position = position;
			Debug.Log((object)GetDistance());
			((Component)this).GetComponent<Camera>().orthographicSize = GetDistance() + 10f;
		}

		private float GetDistance()
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			if (rooms.Count == 1)
			{
				return 5f;
			}
			Bounds val = default(Bounds);
			((Bounds)(ref val))..ctor(rooms[0].position, Vector3.zero);
			for (int i = 0; i < rooms.Count; i++)
			{
				((Bounds)(ref val)).Encapsulate(rooms[i].position);
			}
			return ((Bounds)(ref val)).size.x;
		}

		private Vector3 GetCenter()
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: 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_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: 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)
			if (rooms.Count == 1)
			{
				return rooms[0].position;
			}
			Bounds val = default(Bounds);
			((Bounds)(ref val))..ctor(rooms[0].position, Vector3.zero);
			for (int i = 0; i < rooms.Count; i++)
			{
				((Bounds)(ref val)).Encapsulate(rooms[i].position);
			}
			return ((Bounds)(ref val)).center;
		}
	}
	public class PanelSizer : MonoBehaviour
	{
		private bool swtch = false;

		public Vector3 small;

		public Vector3 small_pos;

		public Vector3 big;

		public Vector3 big_pos;

		public void Update()
		{
			if (Input.GetKeyDown((KeyCode)115))
			{
				Sizer();
			}
		}

		public void Sizer()
		{
			//IL_0043: 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_0014: 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 (!swtch)
			{
				((Component)this).transform.localPosition = big_pos;
				((Component)this).transform.localScale = big;
				swtch = true;
			}
			else
			{
				((Component)this).transform.localPosition = small_pos;
				((Component)this).transform.localScale = small;
				swtch = false;
			}
		}
	}
	public class RH : MonoBehaviour
	{
		private RoomList rl;

		private void Awake()
		{
			rl = GameObject.Find("ROOML").GetComponent<RoomList>();
		}

		private void Start()
		{
		}
	}
	public class ReadBundleTest : MonoBehaviour
	{
		public string elevator_path = "";

		public bool ready = false;

		private void Awake()
		{
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			string location = executingAssembly.Location;
			Debug.Log((object)("Assembly Path: " + location));
			elevator_path = Path.GetDirectoryName(location);
			Debug.Log((object)("ELEVATOR PATH: " + elevator_path));
			ready = true;
		}
	}
	public class RndGunSpawn : MonoBehaviour
	{
		public GameObject ammo;

		public GameObject gun;

		public bool starter = false;

		private GameObject LM;

		public bool lidoff = false;

		private string E_P = "";

		private void Awake()
		{
			LM = GameObject.Find("Lift");
			E_P = GameObject.Find("ELEVATOR_PATH").GetComponent<ReadBundleTest>().elevator_path;
		}

		private void Start()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Expected O, but got Unknown
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Expected O, but got Unknown
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Expected O, but got Unknown
			//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cc: Expected O, but got Unknown
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Expected O, but got Unknown
			if (starter)
			{
				string path = Path.Combine(E_P, "Starter.txt");
				string[] array = File.ReadAllLines(path);
				Random val = new Random();
				int num = Random.Range(0, array.Length - 1);
				string[] array2 = array[num].Split(new char[1] { ';' });
				Debug.Log((object)array2[0]);
				ammo.AddComponent<ObjectSpawnPoint>().ObjectId = array2[1];
				gun.AddComponent<ObjectSpawnPoint>().ObjectId = array2[0];
				return;
			}
			int curr_level = LM.GetComponent<LiftManager>().curr_level;
			if (curr_level <= 1)
			{
				string path2 = Path.Combine(E_P, "Low.txt");
				string[] array3 = File.ReadAllLines(path2);
				Random val2 = new Random();
				int num2 = Random.Range(0, array3.Length - 1);
				string[] array4 = array3[num2].Split(new char[1] { ';' });
				Debug.Log((object)array4[0]);
				ammo.AddComponent<ObjectSpawnPoint>().SpawnOnStart = false;
				ammo.GetComponent<ObjectSpawnPoint>().ObjectId = array4[1];
				gun.AddComponent<ObjectSpawnPoint>().SpawnOnStart = false;
				gun.GetComponent<ObjectSpawnPoint>().ObjectId = array4[0];
			}
			else if (curr_level > 1 && curr_level <= 3)
			{
				string path3 = Path.Combine(E_P, "Med.txt");
				string[] array5 = File.ReadAllLines(path3);
				Random val3 = new Random();
				int num3 = Random.Range(0, array5.Length - 1);
				string[] array6 = array5[num3].Split(new char[1] { ';' });
				Debug.Log((object)array6[0]);
				ammo.AddComponent<ObjectSpawnPoint>().SpawnOnStart = false;
				ammo.GetComponent<ObjectSpawnPoint>().ObjectId = array6[1];
				gun.AddComponent<ObjectSpawnPoint>().SpawnOnStart = false;
				gun.GetComponent<ObjectSpawnPoint>().ObjectId = array6[0];
			}
			else if (curr_level > 3 && curr_level < 5)
			{
				string path4 = Path.Combine(E_P, "Upper.txt");
				string[] array7 = File.ReadAllLines(path4);
				Random val4 = new Random();
				int num4 = Random.Range(0, array7.Length - 1);
				string[] array8 = array7[num4].Split(new char[1] { ';' });
				Debug.Log((object)array8[0]);
				ammo.AddComponent<ObjectSpawnPoint>().SpawnOnStart = false;
				ammo.GetComponent<ObjectSpawnPoint>().ObjectId = array8[1];
				gun.AddComponent<ObjectSpawnPoint>().SpawnOnStart = false;
				gun.GetComponent<ObjectSpawnPoint>().ObjectId = array8[0];
			}
			else if (curr_level >= 5)
			{
				string path5 = Path.Combine(E_P, "Uber.txt");
				string[] array9 = File.ReadAllLines(path5);
				Random val5 = new Random();
				int num5 = Random.Range(0, array9.Length - 1);
				string[] array10 = array9[num5].Split(new char[1] { ';' });
				Debug.Log((object)array10[0]);
				ammo.AddComponent<ObjectSpawnPoint>().SpawnOnStart = false;
				ammo.GetComponent<ObjectSpawnPoint>().ObjectId = array10[1];
				gun.AddComponent<ObjectSpawnPoint>().SpawnOnStart = false;
				gun.GetComponent<ObjectSpawnPoint>().ObjectId = array10[0];
			}
		}

		public void Update()
		{
			if (lidoff)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject, 0.5f);
			}
		}

		public void Open()
		{
			if (!starter)
			{
				ammo.GetComponent<ObjectSpawnPoint>().Spawn();
				gun.GetComponent<ObjectSpawnPoint>().Spawn();
			}
		}
	}
	public class RndPowerupSpawn : MonoBehaviour
	{
		public GameObject powerup;

		public bool lidoff = false;

		private string E_P = "";

		private void Awake()
		{
			E_P = GameObject.Find("ELEVATOR_PATH").GetComponent<ReadBundleTest>().elevator_path;
		}

		private void Start()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			string path = Path.Combine(E_P, "power.txt");
			string[] array = File.ReadAllLines(path);
			Random val = new Random();
			int num = Random.Range(0, array.Length - 1);
			powerup.AddComponent<ObjectSpawnPoint>().SpawnOnStart = false;
			powerup.GetComponent<ObjectSpawnPoint>().ObjectId = array[num];
		}

		public void Update()
		{
			if (lidoff)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}

		public void Open()
		{
			powerup.GetComponent<ObjectSpawnPoint>().Spawn();
		}
	}
	public class RoomList : MonoBehaviour
	{
		public int CRC = 0;

		public int max_RC = 30;

		public GameObject[] Rooms;

		public GameObject[] cols;

		public NavMeshSurface navMeshSurface;

		public bool navMeshDone = false;

		public List<RoomSpawner> queue = new List<RoomSpawner>();

		public List<Sosig> sosigs = new List<Sosig>();

		public List<GameObject> spawned = new List<GameObject>();

		public GameObject Beacon;

		private void Start()
		{
			((MonoBehaviour)this).StartCoroutine(loop());
		}

		private IEnumerator loop()
		{
			yield return (object)new WaitForSeconds(20f);
			navMeshSurface.BuildNavMesh();
			Debug.Log((object)"Done");
			navMeshDone = true;
			Debug.Log((object)Camera.allCameras.Length);
			if (Camera.allCameras.Length > 0)
			{
				Camera[] allCameras = Camera.allCameras;
				foreach (Camera val in allCameras)
				{
					val.useOcclusionCulling = false;
					val.farClipPlane = 1000f;
				}
			}
		}

		public void Update()
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			if (queue.Count > 0)
			{
				queue[0].SpawnRoom();
				queue.RemoveAt(0);
			}
			if (Input.GetKeyDown((KeyCode)107))
			{
				foreach (Sosig sosig in sosigs)
				{
					sosig.Mustard = 0f;
					sosig.BodyState = (SosigBodyState)3;
				}
			}
			if (Input.GetKeyDown((KeyCode)100))
			{
				Swipe();
			}
		}

		public void Swipe()
		{
			//IL_0053: 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)
			foreach (GameObject item in spawned)
			{
				Object.Destroy((Object)(object)item);
			}
			spawned.Clear();
			List<GameObject> list = new List<GameObject>();
			Scene activeScene = SceneManager.GetActiveScene();
			((Scene)(ref activeScene)).GetRootGameObjects(list);
			for (int i = 0; i < list.Count; i++)
			{
				GameObject val = list[i];
				if (((Object)val).name == "Sosig_Torso")
				{
					Object.Destroy((Object)(object)val);
				}
			}
			navMeshSurface.RemoveData();
			navMeshDone = false;
			((MonoBehaviour)this).StartCoroutine(loop());
		}
	}
	public class RoomSpawner : MonoBehaviour
	{
		private RoomList rl;

		public int spawned_type = 0;

		public bool spawned = false;

		private void Awake()
		{
			rl = GameObject.Find("ROOML").GetComponent<RoomList>();
		}

		public void SpawnRoom()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			int num = (spawned_type = Random.Range(0, rl.Rooms.Length - 1));
			GameObject val = Object.Instantiate<GameObject>(rl.cols[num], ((Component)this).transform.position, ((Component)this).transform.rotation);
			int num2 = Random.Range(0, 999);
			val.GetComponentInChildren<ColChechker>().rl = rl;
			val.GetComponentInChildren<ColChechker>().rs = ((Component)this).gameObject.GetComponent<RoomSpawner>();
			((Object)val).name = "Check" + num2;
			val.GetComponentInChildren<ColChechker>().RoomToSpawn = rl.Rooms[num];
		}

		public void Request_Spawn()
		{
			rl.queue.Add(((Component)this).gameObject.GetComponent<RoomSpawner>());
		}

		private void Start()
		{
			Request_Spawn();
		}
	}
	public class SoCheck : MonoBehaviour
	{
		private Sosig sosig;

		public RoomList rl;

		[HideInInspector]
		public GameObject Beacon;

		private void Awake()
		{
			sosig = ((Component)this).gameObject.GetComponent<Sosig>();
		}

		private void Update()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Invalid comparison between Unknown and I4
			if (sosig.Mustard <= 0f || (int)sosig.BodyState == 3)
			{
				rl.sosigs.Remove(sosig);
				Object.Destroy((Object)(object)Beacon);
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}
	}
	public class SoSpawner : MonoBehaviour
	{
		public SosigEnemyID[] sosig_IDs;

		public Transform[] sosig_spawns;

		public bool is_event = true;

		public bool event_started = false;

		private Transform[] CoversAndPositions;

		public SosigOrder order;

		private RoomList rl;

		private bool collected = false;

		public string RoomSeed = "";

		public RoomSpawner[] rss;

		private MiniCam mc;

		public Transform Room_miniMapO;

		public GameObject[] Designs;

		public Transform Design_Point;

		private GameObject Beacon;

		private readonly SpawnOptions spawnOptions;

		public SoSpawner()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Expected O, but got Unknown
			SpawnOptions val = new SpawnOptions();
			val.SpawnState = (SosigOrder)1;
			val.IFF = 1;
			val.SpawnActivated = true;
			val.EquipmentMode = (EquipmentSlots)7;
			val.SpawnWithFullAmmo = true;
			spawnOptions = val;
			((MonoBehaviour)this)..ctor();
		}

		private void Awake()
		{
			CoversAndPositions = sosig_spawns;
			rl = GameObject.Find("ROOML").GetComponent<RoomList>();
			mc = GameObject.Find("MiniMap").GetComponent<MiniCam>();
			mc.rooms.Add(Room_miniMapO);
			Beacon = rl.Beacon;
		}

		private void Start()
		{
			//IL_0023: 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 (Designs.Length > 0)
			{
				GameObject random = SodaliteUtils.GetRandom<GameObject>((IList<GameObject>)Designs);
				Object.Instantiate<GameObject>(random, Design_Point.position, Design_Point.rotation, Design_Point);
			}
			if (!is_event)
			{
				SpawnButton();
			}
		}

		private void Update()
		{
			if (!rl.navMeshDone)
			{
				return;
			}
			if (!event_started)
			{
				SpawnButton();
			}
			if (collected || rss.Length <= 0)
			{
				return;
			}
			RoomSpawner[] array = rss;
			foreach (RoomSpawner roomSpawner in array)
			{
				if (roomSpawner.spawned)
				{
					RoomSeed = RoomSeed + "" + roomSpawner.spawned_type;
				}
			}
			collected = true;
		}

		public void SpawnButton()
		{
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: 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)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			event_started = true;
			int num = 0;
			num = ((sosig_spawns.Length <= 1) ? 1 : Random.Range(1, sosig_spawns.Length));
			for (int i = 0; i < num; i++)
			{
				spawnOptions.SosigTargetPosition = SodaliteUtils.GetRandom<Transform>((IList<Transform>)CoversAndPositions).position;
				spawnOptions.SpawnState = order;
				int num2 = Random.Range(0, sosig_IDs.Length - 1);
				Sosig val = SosigAPI.Spawn(ManagerSingleton<IM>.Instance.odicSosigObjsByID[sosig_IDs[num2]], spawnOptions, sosig_spawns[i].position, sosig_spawns[i].rotation);
				((Component)val).gameObject.AddComponent<SoCheck>();
				GameObject val2 = Object.Instantiate<GameObject>(Beacon, ((Component)this).transform.position, ((Component)this).transform.rotation);
				val2.GetComponent<Data_SphereBeacon>().DS = ((Component)val).gameObject;
				((Component)val).gameObject.GetComponent<SoCheck>().rl = rl;
				((Component)val).gameObject.GetComponent<SoCheck>().Beacon = val2;
				rl.sosigs.Add(val);
			}
		}
	}
}
public class spawnadd : MonoBehaviour
{
	private void Awake()
	{
		GameObject val = GameObject.FindGameObjectWithTag("Settings");
		val.GetComponent<TNH_ManagerOverride>().SupplyPoints.Add(((Component)this).gameObject.GetComponent<AtlasSupplyPoint>());
	}

	private void Update()
	{
	}
}