using System;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
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: AssemblyCompany("ExtraFireEscapesMod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+7ca877523952b107d6b32ea530242d06307c1cd1")]
[assembly: AssemblyProduct("ExtraFireEscapesMod")]
[assembly: AssemblyTitle("ExtraFireEscapesMod")]
[assembly: AssemblyVersion("1.0.0.0")]
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;
}
}
}
public static class ExtraFireEscapesConfig
{
public static ConfigEntry<bool> expFireB;
public static ConfigEntry<bool> expFireC;
public static ConfigEntry<bool> assFireB;
public static ConfigEntry<bool> assFireC;
public static ConfigEntry<bool> vowFireB;
public static ConfigEntry<bool> vowFireC;
public static ConfigEntry<bool> adaFireB;
public static ConfigEntry<bool> adaFireC;
public static ConfigEntry<bool> renFireB;
public static ConfigEntry<bool> renFireC;
public static ConfigEntry<bool> renAltC;
public static ConfigEntry<bool> renAltD;
public static ConfigEntry<bool> dinFireB;
public static ConfigEntry<bool> dinFireC;
public static ConfigEntry<bool> offFireB;
public static ConfigEntry<bool> offFireC;
public static ConfigEntry<bool> titFireB;
public static ConfigEntry<bool> titFireC;
public static ConfigEntry<bool> artFireB;
public static ConfigEntry<bool> artFireC;
public static ConfigEntry<bool> embFireB;
public static ConfigEntry<bool> embFireC;
public static void SetupConfig(ConfigFile config)
{
expFireB = config.Bind<bool>("Experimentation", "Fire Exit B Enabled", true, "Enables Fire Exit B in Experimentation, in the back-right corner of the map");
expFireC = config.Bind<bool>("Experimentation", "Fire Exit C Enabled", true, "Enables Fire Exit C in Experimentation, in the alley to the right of Main");
assFireB = config.Bind<bool>("Assurance", "Fire Exit B Enabled", true, "Enables Fire Exit B in Assurance, on a ridge behind the Ship");
assFireC = config.Bind<bool>("Assurance", "Fire Exit C Enabled", true, "Enables Fire Exit C in Assurance, on a ridge near main accessible via the Pipe");
vowFireB = config.Bind<bool>("Vow", "Fire Exit B Enabled", true, "Enables Fire Exit B in Vow, in a small valley behind the Ship");
vowFireC = config.Bind<bool>("Vow", "Fire Exit C Enabled", true, "Enables Fire Exit C in Vow, past the near side of the Dam");
adaFireB = config.Bind<bool>("Adamance", "Fire Exit B Enabled", true, "Enables Fire Exit B in Adamance, behind the House");
adaFireC = config.Bind<bool>("Adamance", "Fire Exit C Enabled", true, "Enables Fire Exit C in Adamance, past Fire A and deep into the valley");
renFireB = config.Bind<bool>("Rend", "Fire Exit B Enabled", true, "Enables Fire Exit B in Rend, behind the Ship and slightly away from the Facility");
renFireB = config.Bind<bool>("Rend", "Fire Exit B Alternative", false, "Enables the Alternative Fire Exit B in Rend, in front of the Ship and slightly away from the Facility");
renFireC = config.Bind<bool>("Rend", "Fire Exit C Enabled", true, "Enables Fire Exit C in Rend, on the backside of the Facility");
renFireB = config.Bind<bool>("Rend", "Fire Exit C Alternative", false, "Enables the Alternative Fire Exit C in Rend, to the left of Main and around some ridges");
dinFireB = config.Bind<bool>("Dine", "Fire Exit B Enabled", true, "Enables Fire Exit B in Dine, in front and to the right of the Ship");
dinFireC = config.Bind<bool>("Dine", "Fire Exit C Enabled", true, "Enables Fire Exit C in Dine, in front and to the left of the Ship on top of a small ridge");
offFireB = config.Bind<bool>("Offense", "Fire Exit B Enabled", true, "Enables Fire Exit B in Offense, far to the right of Main");
offFireC = config.Bind<bool>("Offense", "Fire Exit C Enabled", true, "Enables Fire Exit C in Offense, atop a rock in front of Main");
titFireB = config.Bind<bool>("Titan", "Fire Exit B Enabled", true, "Enables Fire Exit B in Titan, around the right side of the Facility at ground level");
titFireC = config.Bind<bool>("Titan", "Fire Exit C Enabled", true, "Enables Fire Exit C in Titan, left past Fire A, onto the ledge and around the Facility");
artFireB = config.Bind<bool>("Artifice", "Fire Exit B Enabled", true, "Enables Fire Exit B in Artifice, on the far-left side of the Facility outside the fence");
artFireC = config.Bind<bool>("Artifice", "Fire Exit C Enabled", true, "Enables Fire Exit C in Artifice, atop the Facility above Fire A");
embFireB = config.Bind<bool>("Embryon", "Fire Exit B Enabled", true, "Enables Fire Exit B in Embryon, behind and slightly to the left of the Ship by the large rock");
embFireC = config.Bind<bool>("Embryon", "Fire Exit C Enabled", true, "Enables Fire Exit C in Embryon, in front and slightly to the left of the Ship");
}
}
[HarmonyPatch(typeof(RoundManager))]
public class RoundManagerPatches
{
private static Transform environmentContainer = GameObject.Find("Environment").transform;
[HarmonyPatch("LoadNewLevel")]
[HarmonyPrefix]
private static void LoadNewLevelPrefixPatch(SelectableLevel newLevel)
{
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_0181: Unknown result type (might be due to invalid IL or missing references)
//IL_0195: Unknown result type (might be due to invalid IL or missing references)
//IL_0228: Unknown result type (might be due to invalid IL or missing references)
//IL_023c: Unknown result type (might be due to invalid IL or missing references)
//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
//IL_04c7: Unknown result type (might be due to invalid IL or missing references)
//IL_04db: Unknown result type (might be due to invalid IL or missing references)
//IL_056e: Unknown result type (might be due to invalid IL or missing references)
//IL_0582: Unknown result type (might be due to invalid IL or missing references)
//IL_0615: Unknown result type (might be due to invalid IL or missing references)
//IL_0629: Unknown result type (might be due to invalid IL or missing references)
//IL_06bc: Unknown result type (might be due to invalid IL or missing references)
//IL_06d0: Unknown result type (might be due to invalid IL or missing references)
//IL_0768: Unknown result type (might be due to invalid IL or missing references)
//IL_077c: Unknown result type (might be due to invalid IL or missing references)
//IL_012b: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
//IL_01e6: 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)
//IL_028d: Unknown result type (might be due to invalid IL or missing references)
//IL_032a: Unknown result type (might be due to invalid IL or missing references)
//IL_033e: Unknown result type (might be due to invalid IL or missing references)
//IL_03cf: Unknown result type (might be due to invalid IL or missing references)
//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
//IL_0397: Unknown result type (might be due to invalid IL or missing references)
//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
//IL_0518: Unknown result type (might be due to invalid IL or missing references)
//IL_052c: Unknown result type (might be due to invalid IL or missing references)
//IL_05bf: Unknown result type (might be due to invalid IL or missing references)
//IL_05d3: Unknown result type (might be due to invalid IL or missing references)
//IL_0666: Unknown result type (might be due to invalid IL or missing references)
//IL_067a: Unknown result type (might be due to invalid IL or missing references)
//IL_070d: Unknown result type (might be due to invalid IL or missing references)
//IL_0721: Unknown result type (might be due to invalid IL or missing references)
//IL_07b9: Unknown result type (might be due to invalid IL or missing references)
//IL_07cd: Unknown result type (might be due to invalid IL or missing references)
//IL_0470: Unknown result type (might be due to invalid IL or missing references)
//IL_0484: Unknown result type (might be due to invalid IL or missing references)
//IL_0438: Unknown result type (might be due to invalid IL or missing references)
//IL_044c: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)ExtraFireEscapesPlugin.fireExitTypeAObject == (Object)null || (Object)(object)ExtraFireEscapesPlugin.fireExitTypeBObject == (Object)null)
{
Debug.LogError((object)"Fire Exit prefabs not loaded");
return;
}
try
{
environmentContainer = GameObject.Find("Environment").transform;
if ((Object)(object)environmentContainer == (Object)null)
{
Debug.LogError((object)"Environment/Teleports container not found");
return;
}
switch (newLevel.levelID)
{
case 0:
if (ExtraFireEscapesConfig.expFireB.Value)
{
Debug.Log((object)"Spawning fire escape 2 on Experimentation...");
SpawnFireCoorTeleporter(new Vector3(64f, 10f, 150f), Quaternion.Euler(0f, 90f, 0f), "B", 2);
}
if (ExtraFireEscapesConfig.expFireC.Value)
{
Debug.Log((object)"Spawning fire escape 3 on Experimentation...");
SpawnFireCoorTeleporter(new Vector3(-110f, 4f, 80.4f), Quaternion.Euler(0f, 180f, 0f), "C", 1);
}
break;
case 1:
if (ExtraFireEscapesConfig.assFireB.Value)
{
Debug.Log((object)"Spawning fire escape 2 on Assurance...");
SpawnFireCoorTeleporter(new Vector3(-50f, 12f, 15f), Quaternion.Euler(0f, -90f, 0f), "B", 2);
}
if (ExtraFireEscapesConfig.assFireC.Value)
{
Debug.Log((object)"Spawning fire escape 3 on Assurance...");
SpawnFireCoorTeleporter(new Vector3(126f, 20f, 37f), Quaternion.Euler(0f, 0f, 0f), "C", 2);
}
break;
case 2:
if (ExtraFireEscapesConfig.vowFireB.Value)
{
Debug.Log((object)"Spawning fire escape 2 on Vow...");
SpawnFireCoorTeleporter(new Vector3(88.5f, -14.5f, -29.5f), Quaternion.Euler(0f, -10f, 0f), "B", 2);
}
if (ExtraFireEscapesConfig.vowFireC.Value)
{
Debug.Log((object)"Spawning fire escape 3 on Vow...");
SpawnFireCoorTeleporter(new Vector3(-106f, -1.15f, 72f), Quaternion.Euler(0f, -45f, 0f), "C", 2);
}
break;
case 3:
break;
case 4:
break;
case 5:
if (ExtraFireEscapesConfig.adaFireB.Value)
{
Debug.Log((object)"Spawning fire escape 2 on Adamance...");
SpawnFireCoorTeleporter(new Vector3(-55f, -17.5f, 39f), Quaternion.Euler(0f, 20f, 0f), "B", 2);
}
if (ExtraFireEscapesConfig.adaFireC.Value)
{
Debug.Log((object)"Spawning fire escape 3 on Adamance...");
SpawnFireCoorTeleporter(new Vector3(-12f, -7.5f, -159f), Quaternion.Euler(0f, 90f, 0f), "C", 2);
}
break;
case 6:
if (ExtraFireEscapesConfig.renFireB.Value)
{
Debug.Log((object)"Spawning fire escape 2 on Rend...");
if (!ExtraFireEscapesConfig.renAltC.Value)
{
SpawnFireCoorTeleporter(new Vector3(117f, 0.5f, 51f), Quaternion.Euler(0f, 45f, 0f), "B", 2);
}
else
{
SpawnFireCoorTeleporter(new Vector3(-119f, -2f, 40f), Quaternion.Euler(0f, -45f, 0f), "AltB", 2);
}
}
if (ExtraFireEscapesConfig.renFireC.Value)
{
Debug.Log((object)"Spawning fire escape 3 on Rend...");
if (!ExtraFireEscapesConfig.renAltD.Value)
{
SpawnFireCoorTeleporter(new Vector3(52f, -15.5f, -177.5f), Quaternion.Euler(0f, -27f, 0f), "C", 1);
}
else
{
SpawnFireCoorTeleporter(new Vector3(122f, -8.5f, -133.5f), Quaternion.Euler(0f, 235f, 0f), "AltC", 2);
}
}
break;
case 7:
if (ExtraFireEscapesConfig.dinFireB.Value)
{
Debug.Log((object)"Spawning fire escape 2 on Dine...");
SpawnFireCoorTeleporter(new Vector3(-63f, -16f, 90f), Quaternion.Euler(0f, 180f, 0f), "B", 2);
}
if (ExtraFireEscapesConfig.dinFireC.Value)
{
Debug.Log((object)"Spawning fire escape 3 on Dine...");
SpawnFireCoorTeleporter(new Vector3(-84f, 3.75f, -98f), Quaternion.Euler(0f, 145f, 0f), "C", 2);
}
break;
case 8:
if (ExtraFireEscapesConfig.offFireB.Value)
{
Debug.Log((object)"Spawning fire escape 2 on Offense...");
SpawnFireCoorTeleporter(new Vector3(211f, 5.6f, -100.5f), Quaternion.Euler(0f, 25f, 0f), "B", 2);
}
if (ExtraFireEscapesConfig.offFireC.Value)
{
Debug.Log((object)"Spawning fire escape 3 on Offense...");
SpawnFireCoorTeleporter(new Vector3(78f, 20.9f, -106f), Quaternion.Euler(0f, 90f, 0f), "C", 2);
}
break;
case 9:
if (ExtraFireEscapesConfig.titFireB.Value)
{
Debug.Log((object)"Spawning fire escape 2 on Titan...");
SpawnFireCoorTeleporter(new Vector3(6.5f, 0.5f, 88f), Quaternion.Euler(0f, 215f, 0f), "B", 1);
}
if (ExtraFireEscapesConfig.titFireC.Value)
{
Debug.Log((object)"Spawning fire escape 3 on Titan...");
SpawnFireCoorTeleporter(new Vector3(-105f, 46f, -29f), Quaternion.Euler(0f, 305f, 0f), "C", 1);
}
break;
case 10:
if (ExtraFireEscapesConfig.artFireB.Value)
{
Debug.Log((object)"Spawning fire escape 2 on Atrifice...");
SpawnFireCoorTeleporter(new Vector3(92f, 1.8f, -177f), Quaternion.Euler(0f, -90f, 0f), "B", 1);
}
if (ExtraFireEscapesConfig.artFireC.Value)
{
Debug.Log((object)"Spawning fire escape 3 on Atrifice...");
SpawnFireCoorTeleporter(new Vector3(13f, 14.9f, -183f), Quaternion.Euler(0f, 90f, 0f), "C", 2);
}
break;
case 11:
break;
case 12:
if (ExtraFireEscapesConfig.embFireB.Value)
{
Debug.Log((object)"Spawning fire escape 2 on Embrion...");
SpawnFireCoorTeleporter(new Vector3(-189f, 1.6f, -125f), Quaternion.Euler(0f, -45f, 0f), "B", 2);
}
if (ExtraFireEscapesConfig.embFireC.Value)
{
Debug.Log((object)"Spawning fire escape 3 on Embrion...");
SpawnFireCoorTeleporter(new Vector3(99f, 1f, -119f), Quaternion.Euler(0f, 45f, 0f), "C", 2);
}
break;
}
}
catch
{
Debug.LogError((object)"We broke everything :[[[[");
}
}
private static void SpawnFireCoorTeleporter(Vector3 location, Quaternion rotation, string nameSuffix, int type)
{
//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)
GameObject val = Object.Instantiate<GameObject>((type == 1) ? ExtraFireEscapesPlugin.fireExitTypeAObject : ExtraFireEscapesPlugin.fireExitTypeBObject, location, rotation, environmentContainer);
if ((Object)(object)val != (Object)null)
{
((Object)val).name = "WrexFireExitContainer" + nameSuffix;
val.GetComponent<NetworkObject>().Spawn(true);
val.transform.SetParent(environmentContainer);
}
}
}
[BepInPlugin("Wrex.ExtraFireEscapesMod", "Extra Fire Escapes Mod", "0.0.1")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class ExtraFireEscapesPlugin : BaseUnityPlugin
{
private const string modGuid = "Wrex.ExtraFireEscapesMod";
private const string modName = "Extra Fire Escapes Mod";
private const string modVer = "0.0.1";
private const string bundleName = "ExtraFireEscapesModBundle";
private const string fireExitTypeAAssetName = "Assets/DansMods/ExtraFireEscapesMod/WrexFireExitA.prefab";
private const string fireExitTypeBAssetName = "Assets/DansMods/ExtraFireEscapesMod/WrexFireExitB.prefab";
public static ExtraFireEscapesPlugin instance;
public static ManualLogSource mls;
public static AssetBundle bundle;
public static GameObject fireExitTypeAObject;
public static GameObject fireExitTypeBObject;
private void Awake()
{
instance = this;
try
{
ConfigureLogging();
ExtraFireEscapesConfig.SetupConfig(((BaseUnityPlugin)this).Config);
Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), (string)null);
LoadAssetBundle();
NetworkPrefabs.RegisterNetworkPrefab(fireExitTypeAObject);
NetworkPrefabs.RegisterNetworkPrefab(fireExitTypeBObject);
}
catch (Exception ex)
{
mls.LogError((object)ex.Message);
mls.LogError((object)ex.StackTrace);
}
}
private void ConfigureLogging()
{
mls = Logger.CreateLogSource("Wrex.ExtraFireEscapesMod");
mls = ((BaseUnityPlugin)this).Logger;
mls.LogInfo((object)"Loading Extra Fire Escapes Mod");
}
private void LoadAssetBundle()
{
Assembly assembly = typeof(ExtraFireEscapesPlugin).Assembly;
string text = Path.Combine(Path.GetDirectoryName(assembly.Location), "ExtraFireEscapesModBundle");
bundle = AssetBundle.LoadFromFile(text);
if ((Object)(object)bundle == (Object)null)
{
mls.LogError((object)"Failed to load asset bundle");
return;
}
fireExitTypeAObject = bundle.LoadAsset<GameObject>("Assets/DansMods/ExtraFireEscapesMod/WrexFireExitA.prefab");
fireExitTypeBObject = bundle.LoadAsset<GameObject>("Assets/DansMods/ExtraFireEscapesMod/WrexFireExitB.prefab");
if ((Object)(object)fireExitTypeAObject == (Object)null || (Object)(object)fireExitTypeBObject == (Object)null)
{
mls.LogError((object)"Failed to load custom assets");
}
else
{
mls.LogInfo((object)"Custom assets loaded");
}
}
}