using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text.Json;
using System.Text.Json.Serialization;
using AIGraph;
using ARA.LevelLayout;
using ARA.LevelLayout.DefinitionData;
using AmorLib.Utils;
using AmorLib.Utils.Extensions;
using AmorLib.Utils.JsonElementConverters;
using BepInEx;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using FluffyUnderware.DevTools.Extensions;
using GTFO.API;
using GTFO.API.Utilities;
using GameData;
using HarmonyLib;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem.Collections.Generic;
using LevelGeneration;
using MTFO.API;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.Animations;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("AdditionalRundownAdvancements")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+be16dc3a853ccf2e5730a28ef4a5d0434e790215")]
[assembly: AssemblyProduct("AdditionalRundownAdvancements")]
[assembly: AssemblyTitle("AdditionalRundownAdvancements")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
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;
}
}
}
namespace ARA
{
internal static class ARAJson
{
private static readonly JsonSerializerOptions _setting = JsonSerializerUtil.CreateDefaultSettings(true, true, false);
public static T Deserialize<T>(string json)
{
return JsonSerializer.Deserialize<T>(json, _setting);
}
public static object Deserialize(Type type, string json)
{
return JsonSerializer.Deserialize(json, type, _setting);
}
public static string Serialize(object value, Type type)
{
return JsonSerializer.Serialize(value, type, _setting);
}
}
internal static class ARALogger
{
internal static readonly ManualLogSource MLS;
static ARALogger()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Expected O, but got Unknown
MLS = new ManualLogSource("ARA");
Logger.Sources.Add((ILogSource)(object)MLS);
}
public static void Info(BepInExInfoLogInterpolatedStringHandler handler)
{
MLS.LogInfo(handler);
}
public static void Info(string str)
{
MLS.LogMessage((object)str);
}
public static void Debug(BepInExDebugLogInterpolatedStringHandler handler)
{
MLS.LogDebug(handler);
}
public static void Debug(string str)
{
MLS.LogDebug((object)str);
}
public static void Error(BepInExErrorLogInterpolatedStringHandler handler)
{
MLS.LogError(handler);
}
public static void Error(string str)
{
MLS.LogError((object)str);
}
public static void Warn(BepInExWarningLogInterpolatedStringHandler handler)
{
MLS.LogWarning(handler);
}
public static void Warn(string str)
{
MLS.LogWarning((object)str);
}
}
public abstract class CustomConfigBase
{
public static readonly string Module = Path.Combine(MTFOPathAPI.CustomPath, "AdditionalRundownAdvancements");
public abstract string ModulePath { get; }
public abstract void Setup();
public virtual void OnBuildStart()
{
}
public virtual void OnBeforeBatchBuild(BatchName batch)
{
}
public virtual void OnBuildDone()
{
}
public virtual void OnEnterLevel()
{
}
public virtual void OnLevelCleanup()
{
}
}
public static class CustomConfigManager
{
public static readonly List<CustomConfigBase> CustomConfigs = new List<CustomConfigBase>();
public static void Setup(IEnumerable<CustomConfigBase> configs)
{
foreach (CustomConfigBase config in configs)
{
CustomConfigs.Add(config);
config.Setup();
}
LevelAPI.OnBuildStart += OnBuildStart;
LevelAPI.OnBeforeBuildBatch += OnBeforeBatchBuild;
LevelAPI.OnBuildDone += OnBuildDone;
LevelAPI.OnEnterLevel += OnEnterLevel;
LevelAPI.OnLevelCleanup += OnLevelCleanup;
}
private static void OnBuildStart()
{
CustomConfigs.ForEach(delegate(CustomConfigBase config)
{
config.OnBuildStart();
});
}
private static void OnBeforeBatchBuild(BatchName batch)
{
//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)
CustomConfigs.ForEach(delegate(CustomConfigBase config)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
config.OnBeforeBatchBuild(batch);
});
}
private static void OnBuildDone()
{
CustomConfigs.ForEach(delegate(CustomConfigBase config)
{
config.OnBuildDone();
});
}
private static void OnEnterLevel()
{
CustomConfigs.ForEach(delegate(CustomConfigBase config)
{
config.OnEnterLevel();
});
}
private static void OnLevelCleanup()
{
CustomConfigs.ForEach(delegate(CustomConfigBase config)
{
config.OnLevelCleanup();
});
}
}
[BepInPlugin("Amor.ARA", "AdditionalRundownAdvancements", "0.1.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
internal sealed class EntryPoint : BasePlugin
{
public const string MODNAME = "AdditionalRundownAdvancements";
public override void Load()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
new Harmony("Amor.ARA").PatchAll();
AssetAPI.OnStartupAssetsLoaded += OnStartupAssetsLoaded;
ARALogger.Info("ARA is done loading!");
}
private void OnStartupAssetsLoaded()
{
IEnumerable<CustomConfigBase> configs = from t in AccessTools.GetTypesFromAssembly(((object)this).GetType().Assembly)
where typeof(CustomConfigBase).IsAssignableFrom(t) && !t.IsAbstract
select (CustomConfigBase)Activator.CreateInstance(t);
CustomConfigManager.Setup(configs);
}
}
}
namespace ARA.Patches
{
[HarmonyPatch(typeof(ElevatorCargoCage), "SpawnObjectiveItemsInLandingArea")]
internal static class ElevatorCargoPatches
{
[HarmonyPrefix]
[HarmonyWrapSafe]
private static bool Pre_SpawnItems(out ElevatorCargoCustomData? __state)
{
if (LayoutConfigManager.Current == LayoutConfigDefinition.Empty)
{
__state = null;
return true;
}
__state = LayoutConfigManager.Current.Elevator;
if (__state.DisableElevatorCargo)
{
ElevatorRide.Current.m_cargoCageInUse = false;
return false;
}
return !__state.OverrideCargoItems;
}
[HarmonyPostfix]
[HarmonyWrapSafe]
private static void Post_SpawnItems(ElevatorCargoCage __instance, ElevatorCargoCustomData? __state)
{
if (__state != null && __state.CargoItems.Length != 0)
{
if (__instance.m_itemsToMoveToCargo == null)
{
List<Transform> val2 = (__instance.m_itemsToMoveToCargo = new List<Transform>());
}
uint[] cargoItems = __state.CargoItems;
foreach (uint num in cargoItems)
{
LG_PickupItem val3 = LG_PickupItem.SpawnGenericPickupItem(ElevatorShaftLanding.CargoAlign);
val3.SpawnNode = Builder.GetElevatorArea().m_courseNode;
val3.SetupAsBigPickupItem(Random.Range(0, int.MaxValue), num, false, 0);
__instance.m_itemsToMoveToCargo.Add(((Component)val3).transform);
}
ElevatorRide.Current.m_cargoCageInUse = true;
}
}
}
[HarmonyPatch(typeof(LG_DistributionJobUtils), "GetRandomNodeFromZoneForFunction")]
internal static class GeneratorClusterPatch
{
[HarmonyPrefix]
[HarmonyWrapSafe]
public static bool ForceGeneratorClusterSpawn(LG_Zone zone, ExpeditionFunction func, float randomValue, ref AIG_CourseNode __result)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0004: Invalid comparison between Unknown and I4
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Expected O, but got Unknown
if ((int)func != 19)
{
return true;
}
if (!LayoutConfigManager.TryGetCurrentZoneData(zone, out ZoneCustomData zoneData) || !zoneData.ForceGeneratorClusterMarkers)
{
return true;
}
List<LG_Area> list = new List<LG_Area>();
Enumerator<LG_Area> enumerator = zone.m_areas.GetEnumerator();
while (enumerator.MoveNext())
{
LG_Area current = enumerator.Current;
if (current.GetMarkerSpawnerCount((ExpeditionFunction)19) > 0)
{
list.Add(current);
}
}
if (list.Count == 0)
{
return true;
}
int index = Math.Clamp((int)(randomValue * (float)list.Count), 0, list.Count - 1);
bool flag = default(bool);
BepInExDebugLogInterpolatedStringHandler val = new BepInExDebugLogInterpolatedStringHandler(44, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Selected area for forced generator cluster: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(list[index].m_navInfo.m_suffix);
}
ARALogger.Debug(val);
__result = list[index].m_courseNode;
return false;
}
}
}
namespace ARA.LevelLayout
{
public sealed class LayoutConfigDefinition
{
[JsonIgnore]
public static readonly LayoutConfigDefinition Empty = new LayoutConfigDefinition();
public uint MainLevelLayout { get; set; } = 0u;
public ElevatorCargoCustomData Elevator { get; set; } = new ElevatorCargoCustomData();
[JsonPropertyName("SetupWorldEventObjectOnAllTerminals")]
public bool AllWorldEventTerminals { get; set; } = false;
public ZoneCustomData[] Zones { get; set; } = Array.Empty<ZoneCustomData>();
}
public class LayoutConfigManager : CustomConfigBase
{
private static readonly Dictionary<string, HashSet<uint>> _filepathLayoutMap = new Dictionary<string, HashSet<uint>>();
private static readonly Dictionary<uint, LayoutConfigDefinition> _customLayoutData = new Dictionary<uint, LayoutConfigDefinition>();
public static LayoutConfigDefinition Current { get; private set; } = LayoutConfigDefinition.Empty;
public override string ModulePath => CustomConfigBase.Module + "/LevelLayout";
public static bool TryGetCurrentZoneData(LG_Zone zone, [MaybeNullWhen(false)] out ZoneCustomData zoneData)
{
LG_Zone zone2 = zone;
zoneData = Current.Zones.FirstOrDefault(delegate(ZoneCustomData z)
{
int result;
if (z != null)
{
(int, int, int) intTuple = ((GlobalBase)z).IntTuple;
(int, int, int) tuple = GlobalIndexUtil.ToIntTuple(zone2);
result = ((intTuple.Item1 == tuple.Item1 && intTuple.Item2 == tuple.Item2 && intTuple.Item3 == tuple.Item3) ? 1 : 0);
}
else
{
result = 0;
}
return (byte)result != 0;
}, null);
return zoneData != null;
}
public override void Setup()
{
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Expected O, but got Unknown
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Expected O, but got Unknown
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_00ed: Expected O, but got Unknown
Directory.CreateDirectory(ModulePath);
string path = Path.Combine(ModulePath, "Template.json");
LayoutConfigDefinition layoutConfigDefinition = new LayoutConfigDefinition();
layoutConfigDefinition.Zones = new ZoneCustomData[1]
{
new ZoneCustomData()
};
LayoutConfigDefinition value = layoutConfigDefinition;
File.WriteAllText(path, ARAJson.Serialize(value, typeof(LayoutConfigDefinition)));
foreach (string item in Directory.EnumerateFiles(ModulePath, "*.json", SearchOption.AllDirectories))
{
string content = File.ReadAllText(item);
ReadFileContent(item, content);
}
LiveEditListener val = LiveEdit.CreateListener(ModulePath, "*.json", true);
val.FileCreated += new LiveEditEventHandler(FileCreatedOrChanged);
val.FileChanged += new LiveEditEventHandler(FileCreatedOrChanged);
val.FileDeleted += new LiveEditEventHandler(FileDeleted);
}
private static void ReadFileContent(string file, string content)
{
HashSet<uint> orAddNew = CollectionExtensions.GetOrAddNew<string, HashSet<uint>>((IDictionary<string, HashSet<uint>>)_filepathLayoutMap, file);
foreach (uint item in orAddNew)
{
_customLayoutData.Remove(item);
}
orAddNew.Clear();
LayoutConfigDefinition layoutConfigDefinition = ARAJson.Deserialize<LayoutConfigDefinition>(content);
if (layoutConfigDefinition != null && layoutConfigDefinition.MainLevelLayout != 0)
{
orAddNew.Add(layoutConfigDefinition.MainLevelLayout);
_customLayoutData[layoutConfigDefinition.MainLevelLayout] = layoutConfigDefinition;
}
}
private void FileCreatedOrChanged(LiveEditEventArgs e)
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Expected O, but got Unknown
LiveEditEventArgs e2 = e;
bool flag = default(bool);
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(23, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("LiveEdit file changed: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(e2.FullPath);
}
ARALogger.Warn(val);
LiveEdit.TryReadFileContent(e2.FullPath, (Action<string>)delegate(string content)
{
ReadFileContent(e2.FullPath, content);
});
}
private void FileDeleted(LiveEditEventArgs e)
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Expected O, but got Unknown
LiveEditEventArgs e2 = e;
bool flag = default(bool);
BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(23, 1, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("LiveEdit file deleted: ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(e2.FullPath);
}
ARALogger.Warn(val);
LiveEdit.TryReadFileContent(e2.FullPath, (Action<string>)delegate
{
foreach (uint item in _filepathLayoutMap[e2.FullPath])
{
_customLayoutData.Remove(item);
}
_filepathLayoutMap.Remove(e2.FullPath);
});
}
public override void OnBuildStart()
{
uint levelLayoutData = RundownManager.ActiveExpedition.LevelLayoutData;
Current = (_customLayoutData.TryGetValue(levelLayoutData, out LayoutConfigDefinition value) ? value : LayoutConfigDefinition.Empty);
}
public override void OnBeforeBatchBuild(BatchName batch)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0004: Invalid comparison between Unknown and I4
if ((int)batch == 46)
{
ApplyLayoutData();
}
}
public override void OnEnterLevel()
{
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
ElevatorCargoCage val = Object.FindObjectOfType<ElevatorCargoCage>();
if ((Object)(object)val == (Object)null)
{
return;
}
foreach (ItemCuller componentsInChild in ((Component)val).GetComponentsInChildren<ItemCuller>())
{
componentsInChild.MoveToNode(Builder.GetElevatorArea().m_courseNode.m_cullNode, ((Component)val).transform.position);
}
}
private static void ApplyLayoutData()
{
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Expected I4, but got Unknown
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Expected I4, but got Unknown
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Expected I4, but got Unknown
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
//IL_0279: Unknown result type (might be due to invalid IL or missing references)
ARALogger.Debug("Applying layout data");
Enumerator<LG_Zone> enumerator = Builder.CurrentFloor.allZones.GetEnumerator();
while (enumerator.MoveNext())
{
LG_Zone current = enumerator.Current;
if (Current.AllWorldEventTerminals)
{
for (int i = 0; i < current.TerminalsSpawnedInZone.Count; i++)
{
LG_ComputerTerminal val = current.TerminalsSpawnedInZone[i];
LG_MarkerProducer componentInParent = ((Component)val).GetComponentInParent<LG_MarkerProducer>();
if (!((Object)(object)componentInParent == (Object)null))
{
string text = $"WE_ARA_Term_{(int)current.DimensionIndex}_{(int)current.Layer.m_type}_{(int)current.LocalIndex}_{i}";
LG_WorldEventObject val2 = ComponentExt.AddChildGameObject<LG_WorldEventObject>((Component)(object)componentInParent, text);
((Component)val2).transform.localPosition = Vector3.zero;
val2.WorldEventComponents = Il2CppReferenceArray<IWorldEventComponent>.op_Implicit(Array.Empty<IWorldEventComponent>());
}
}
}
if (!TryGetCurrentZoneData(current, out ZoneCustomData zoneData) || (Object)(object)((GlobalBase)(zoneData?)).Zone == (Object)null)
{
continue;
}
zoneData.AddSpawnPoints();
WE_ObjectCustomData[] worldEventObjects = zoneData.WorldEventObjects;
foreach (WE_ObjectCustomData wE_ObjectCustomData in worldEventObjects)
{
if (!wE_ObjectCustomData.IsAreaIndexValid(current, out LG_Area area))
{
continue;
}
LG_WorldEventObject val3 = ComponentExt.AddChildGameObject<LG_WorldEventObject>((Component)(object)area, wE_ObjectCustomData.WorldEventObjectFilter);
((Component)val3).transform.SetPositionAndRotation((!wE_ObjectCustomData.UseRandomPosition) ? wE_ObjectCustomData.Position : area.m_courseNode.GetRandomPositionInside(), Quaternion.Euler(wE_ObjectCustomData.Rotation));
((Component)val3).transform.localScale = wE_ObjectCustomData.Scale;
val3.WorldEventComponents = Il2CppReferenceArray<IWorldEventComponent>.op_Implicit(Array.Empty<IWorldEventComponent>());
foreach (WE_ComponentCustomData component in wE_ObjectCustomData.Components)
{
switch (component.Type)
{
case WorldEventComponent.WE_ChainedPuzzle:
((Component)val3).gameObject.AddComponent<LG_WorldEventChainPuzzle>();
break;
case WorldEventComponent.WE_NavMarker:
{
PlaceNavMarkerOnGO val4 = ((Component)val3).gameObject.AddComponent<PlaceNavMarkerOnGO>();
val4.type = component.NavMarkerType;
val4.m_placeOnStart = component.PlaceOnStart;
((Component)val3).gameObject.AddComponent<LG_WorldEventNavMarker>();
break;
}
}
}
}
}
}
}
}
namespace ARA.LevelLayout.DefinitionData
{
public sealed class ElevatorCargoCustomData
{
[JsonPropertyName("ForceDisableElevatorCargo")]
public bool DisableElevatorCargo { get; set; } = false;
[JsonPropertyName("OverrideDefaultElevatorCargoItems")]
public bool OverrideCargoItems { get; set; } = false;
[JsonPropertyName("CustomElevatorCargoItems")]
public uint[] CargoItems { get; set; } = Array.Empty<uint>();
}
public enum TerminalPrefab
{
None,
Default,
MiningCover,
MiniTerminal,
ServiceCover,
CyberDeck
}
public sealed class TerminalCustomData
{
public int TerminalIndex { get; set; } = 0;
public TerminalPrefab TerminalPrefabOverride { get; set; } = TerminalPrefab.None;
public LogFileCustomData[] LogFiles { get; set; } = Array.Empty<LogFileCustomData>();
}
public sealed class LogFileCustomData
{
public string FileName { get; set; } = string.Empty;
public List<WardenObjectiveEventData> EventsOnFileRead { get; set; } = new List<WardenObjectiveEventData>();
}
public enum WorldEventComponent
{
None,
WE_ChainedPuzzle,
WE_NavMarker,
WE_CollisionTrigger,
WE_LookatTrigger,
WE_InteractTrigger
}
public enum ColliderType
{
Box,
Sphere,
Capsule
}
public sealed class WE_ComponentCustomData
{
public WorldEventComponent Type { get; set; } = WorldEventComponent.None;
public eMarkerType NavMarkerType { get; set; } = (eMarkerType)1;
public bool PlaceOnStart { get; set; } = true;
public bool IsToggle { get; set; } = false;
public ColliderType ColliderType { get; set; } = ColliderType.Box;
public Vector3 Center { get; set; } = Vector3.zero;
public Vector3 Size { get; set; } = Vector3.one;
public float Radius { get; set; } = 0f;
public float Hieght { get; set; } = 0f;
public Axis Direction { get; set; } = (Axis)0;
public float LookatMaxDistance { get; set; } = 0f;
public LocaleText InteractionText { get; set; } = LocaleText.Empty;
public eCarryItemInsertTargetType CarryItemInsertType { get; set; } = (eCarryItemInsertTargetType)0;
public bool RemoveItemOnInsert { get; set; } = false;
}
public sealed class WE_ObjectCustomData
{
public string WorldEventObjectFilter { get; set; } = string.Empty;
public int AreaIndex { get; set; } = 0;
public bool UseRandomPosition { get; set; } = false;
public Vector3 Position { get; set; } = Vector3.zero;
public Vector3 Rotation { get; set; } = Vector3.zero;
public Vector3 Scale { get; set; } = Vector3.one;
public List<WE_ComponentCustomData> Components { get; set; } = new List<WE_ComponentCustomData>();
public bool IsAreaIndexValid(LG_Zone zone, [MaybeNullWhen(false)] out LG_Area area)
{
if (AreaIndex < 0 || AreaIndex >= zone.m_areas.Count)
{
area = null;
return false;
}
area = zone.m_areas[AreaIndex];
return true;
}
}
public sealed class ZoneCustomData : GlobalBase
{
public Vector3[] HibernateSpawnAligns { get; set; } = Array.Empty<Vector3>();
public Vector3[] EnemySpawnPoints { get; set; } = Array.Empty<Vector3>();
public Vector3[] BioscanSpawnPoints { get; set; } = Array.Empty<Vector3>();
public bool ForceGeneratorClusterMarkers { get; set; } = false;
public WE_ObjectCustomData[] WorldEventObjects { get; set; } = Array.Empty<WE_ObjectCustomData>();
public void AddSpawnPoints()
{
AddSpawnPoints("HSA", HibernateSpawnAligns, (LG_Area area) => area.m_spawnAligns);
AddSpawnPoints("ESP", EnemySpawnPoints, (LG_Area area) => area.m_enemySpawnPoints);
AddSpawnPoints("SBP", BioscanSpawnPoints, (LG_Area area) => area.m_bioscanSpawnPoints);
}
private void AddSpawnPoints(string source, Vector3[] positions, Func<LG_Area, List<Transform>> targetList)
{
//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_0011: 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)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Expected O, but got Unknown
//IL_0099: 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)
for (int i = 0; i < positions.Length; i++)
{
Vector3 val = positions[i];
LG_Area area = CourseNodeUtil.GetCourseNode(val, ((GlobalBase)this).DimensionIndex).m_area;
if (!((Object)(object)area == (Object)null))
{
string text = "ARA_" + source + "_SpawnPoint";
if (i > 0)
{
text += $" ({i})";
}
GameObject val2 = new GameObject(text);
val2.transform.SetPositionAndRotation(val, Quaternion.identity);
val2.transform.SetParent(((Component)area).transform, true);
targetList(area).Add(val2.transform);
}
}
}
}
}