using System;
using System.Collections;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("WiderShipMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("WiderShipMod")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3b42a851-dbf6-428d-a7f2-0af1d6039c22")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
[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.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
public class HarmonyPatches
{
public static bool enabledWiderShip;
public static bool enabledShipWindow;
public static bool enabledCelestialTint;
[HarmonyPostfix]
[HarmonyPatch(typeof(StartOfRound), "firstDayAnimation")]
private static void NewSavePatch()
{
if (enabledShipWindow)
{
((MonoBehaviour)StartOfRound.Instance).StartCoroutine(Setup.ShipWindowSetup());
}
}
[HarmonyPostfix]
[HarmonyPatch(typeof(StartOfRound), "Start")]
[HarmonyAfter(new string[] { "mborsh.WiderShipMod", "TestAccount666.ShipWindows" })]
private static void StartRoundPatch()
{
Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
Assembly[] array = assemblies;
foreach (Assembly assembly in array)
{
if (assembly.FullName.StartsWith("WiderShipMod"))
{
enabledWiderShip = true;
}
else if (assembly.FullName.StartsWith("TestAccount666.ShipWindows"))
{
enabledShipWindow = true;
}
else if (assembly.FullName.StartsWith("CelestialTint"))
{
enabledCelestialTint = true;
}
}
Setup.ShipSetup();
}
[HarmonyAfter(new string[] { "mborsh.WiderShipMod" })]
[HarmonyPrefix]
[HarmonyPatch(typeof(RoundManager), "FinishGeneratingLevel")]
private static void StartLevelPatch()
{
Setup.NavSetup();
}
[HarmonyPostfix]
[HarmonyPatch(typeof(StartOfRound), "BuyShipUnlockableClientRpc")]
private static void SyncUnlockPatch()
{
if (enabledShipWindow)
{
((MonoBehaviour)StartOfRound.Instance).StartCoroutine(Setup.ShipWindowSetup());
}
}
[HarmonyPostfix]
[HarmonyPatch(typeof(ShipLights), "ToggleShipLightsOnLocalClientOnly")]
private static void LightPatch(ref bool ___areLightsOn)
{
GameObject.Find("2StoryLight0").SetActive(___areLightsOn);
GameObject.Find("2StoryLight1").SetActive(___areLightsOn);
GameObject.Find("2StorySpotlight0").SetActive(___areLightsOn);
GameObject.Find("2StorySpotlight1").SetActive(___areLightsOn);
}
}
public class Setup : MonoBehaviour
{
public static void ShipSetup()
{
//IL_048a: Unknown result type (might be due to invalid IL or missing references)
//IL_049e: Unknown result type (might be due to invalid IL or missing references)
//IL_04d6: Unknown result type (might be due to invalid IL or missing references)
//IL_04fa: Unknown result type (might be due to invalid IL or missing references)
//IL_051e: Unknown result type (might be due to invalid IL or missing references)
//IL_0542: Unknown result type (might be due to invalid IL or missing references)
//IL_0566: Unknown result type (might be due to invalid IL or missing references)
//IL_058a: Unknown result type (might be due to invalid IL or missing references)
//IL_05c1: Unknown result type (might be due to invalid IL or missing references)
//IL_05e0: Unknown result type (might be due to invalid IL or missing references)
//IL_05ff: Unknown result type (might be due to invalid IL or missing references)
//IL_061e: Unknown result type (might be due to invalid IL or missing references)
//IL_063d: Unknown result type (might be due to invalid IL or missing references)
//IL_065c: Unknown result type (might be due to invalid IL or missing references)
//IL_067b: Unknown result type (might be due to invalid IL or missing references)
//IL_069a: Unknown result type (might be due to invalid IL or missing references)
//IL_06b9: Unknown result type (might be due to invalid IL or missing references)
//IL_06d8: Unknown result type (might be due to invalid IL or missing references)
//IL_06f7: Unknown result type (might be due to invalid IL or missing references)
//IL_0716: Unknown result type (might be due to invalid IL or missing references)
//IL_0735: Unknown result type (might be due to invalid IL or missing references)
//IL_0754: Unknown result type (might be due to invalid IL or missing references)
//IL_0773: 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_0040: 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)
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_0127: Unknown result type (might be due to invalid IL or missing references)
//IL_0146: Unknown result type (might be due to invalid IL or missing references)
//IL_0165: Unknown result type (might be due to invalid IL or missing references)
//IL_0184: Unknown result type (might be due to invalid IL or missing references)
//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
//IL_0200: Unknown result type (might be due to invalid IL or missing references)
//IL_021f: Unknown result type (might be due to invalid IL or missing references)
//IL_023e: Unknown result type (might be due to invalid IL or missing references)
//IL_025d: Unknown result type (might be due to invalid IL or missing references)
//IL_027c: Unknown result type (might be due to invalid IL or missing references)
//IL_029b: Unknown result type (might be due to invalid IL or missing references)
//IL_02ba: 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_02f8: Unknown result type (might be due to invalid IL or missing references)
//IL_0317: Unknown result type (might be due to invalid IL or missing references)
//IL_0336: Unknown result type (might be due to invalid IL or missing references)
//IL_0355: Unknown result type (might be due to invalid IL or missing references)
//IL_0374: Unknown result type (might be due to invalid IL or missing references)
//IL_0393: Unknown result type (might be due to invalid IL or missing references)
//IL_03b2: Unknown result type (might be due to invalid IL or missing references)
//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
//IL_040f: Unknown result type (might be due to invalid IL or missing references)
//IL_087c: Unknown result type (might be due to invalid IL or missing references)
//IL_089b: Unknown result type (might be due to invalid IL or missing references)
//IL_08ba: Unknown result type (might be due to invalid IL or missing references)
//IL_08d9: Unknown result type (might be due to invalid IL or missing references)
//IL_07dd: Unknown result type (might be due to invalid IL or missing references)
//IL_07fc: Unknown result type (might be due to invalid IL or missing references)
//IL_081b: Unknown result type (might be due to invalid IL or missing references)
//IL_083a: Unknown result type (might be due to invalid IL or missing references)
//IL_0859: Unknown result type (might be due to invalid IL or missing references)
//IL_08f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0931: Unknown result type (might be due to invalid IL or missing references)
//IL_0938: Expected O, but got Unknown
//IL_0ab4: Unknown result type (might be due to invalid IL or missing references)
//IL_0ad3: Unknown result type (might be due to invalid IL or missing references)
//IL_0af2: Unknown result type (might be due to invalid IL or missing references)
//IL_0b11: Unknown result type (might be due to invalid IL or missing references)
//IL_0b30: Unknown result type (might be due to invalid IL or missing references)
//IL_0b4f: Unknown result type (might be due to invalid IL or missing references)
//IL_0b6e: Unknown result type (might be due to invalid IL or missing references)
//IL_0b8d: Unknown result type (might be due to invalid IL or missing references)
//IL_0bd9: Unknown result type (might be due to invalid IL or missing references)
//IL_0be0: Expected O, but got Unknown
GameObject val;
if (HarmonyPatches.enabledWiderShip)
{
val = Object.Instantiate<GameObject>(Plugin.bundle.LoadAsset<GameObject>("Assets/Melanie2StoryShip/Prefab/ShipInsideWider.prefab"), GameObject.Find("Environment/HangarShip/ShipInside").transform.position, GameObject.Find("Environment/HangarShip/ShipInside").transform.rotation, GameObject.Find("Environment/HangarShip/ShipInside").transform.parent);
Create("OutsideShipRoom", "OutsideShipRoom0", new Vector3(0f, 5f, 2f));
Create("StorageCloset", "StorageCloset0", new Vector3(4f, 1.6f, -7.4f));
Active("ShipInsideBoth", state: false);
Active("Right wall", state: false);
Active("FloorBoth", state: false);
Active("ShipRailsBoth", state: false);
Active("ShipRailPostsBoth", state: false);
Active("CatwalkBoth", state: false);
Active("CatwalkRLBBoth", state: false);
Active("CatwalkRLBoth", state: false);
Active("Cube.005 (1)", state: false);
Move("AirFilterThing", new Vector3(5.5f, 2.6f, 1.7f));
Move("Area Light (4)(Clone)_left", new Vector3(800f, 0f, 433f));
Move("Area Light (5)(Clone)_left", new Vector3(-600f, 0f, 433f));
Move("Area Light (7)(Clone)_left", new Vector3(800f, 0f, 433f));
Move("Area Light (8)(Clone)_left", new Vector3(-600f, 0f, 433f));
Move("Area Light (4)(Clone)_right", new Vector3(800f, -720f, -77f));
Move("Area Light (5)(Clone)_right", new Vector3(-600f, -720f, -77f));
Move("Area Light (7)(Clone)_right", new Vector3(800f, -720f, -77f));
Move("Area Light (8)(Clone)_right", new Vector3(-600f, -720f, -77f));
Move("Cube.005 (2)", new Vector3(-5f, 3f, -5f));
Move("ChargeStation", new Vector3(4.7f, 1f, -5f));
Move("GiantCylinderMagnet", new Vector3(1f, 2.5f, -14.7f));
Move("HangarDoorButtonPanel", new Vector3(-4.8f, 4f, -4.3f));
Move("HangingLamp (3)(Clone)_left", new Vector3(800f, 0f, 500f));
Move("HangingLamp (4)(Clone)_left", new Vector3(-600f, 0f, 500f));
Move("HangingLamp (3)(Clone)_right", new Vector3(800f, -720f, 0f));
Move("HangingLamp (4)(Clone)_right", new Vector3(-600f, -720f, 0f));
Move("LadderShort", new Vector3(9.4f, -2.6f, 4.4f));
Move("MagnetLever", new Vector3(-7.5f, 1.5f, -14f));
Move("OutsideShip (3)", new Vector3(14.1f, 3.2f, 9f));
Move("SideMachineryLeft", new Vector3(8.3f, 1.6f, 2.4f));
Move("SingleScreen", new Vector3(-7.5f, -1.5f, 0.45f));
Rotate("ChargeStation", new Vector3(-90f, 0f, 0f));
Rotate("LadderShort", new Vector3(0f, 90f, 0f));
Rotate("MagnetLever", new Vector3(90f, 0f, 180f));
Brighten("Area Light (4)(Clone)_left", 4f);
Brighten("Area Light (5)(Clone)_left", 4f);
Brighten("Area Light (7)(Clone)_left", 4f);
Brighten("Area Light (8)(Clone)_left", 4f);
Network("StorageCloset0");
}
else
{
val = Object.Instantiate<GameObject>(Plugin.bundle.LoadAsset<GameObject>("Assets/Melanie2StoryShip/Prefab/ShipInside.prefab"), GameObject.Find("Environment/HangarShip/ShipInside").transform.position, GameObject.Find("Environment/HangarShip/ShipInside").transform.rotation, GameObject.Find("Environment/HangarShip/ShipInside").transform.parent);
Create("Area Light (3)", "2StoryLight0", new Vector3(800f, 0f, 500f));
Create("Area Light (3)", "2StoryLight1", new Vector3(-600f, 0f, 500f));
Create("Area Light (7)", "2StorySpotlight0", new Vector3(800f, 0f, 500f));
Create("Area Light (7)", "2StorySpotlight1", new Vector3(-600f, 0f, 500f));
Create("HangingLamp (2)", "2StoryLamp0", new Vector3(800f, 0f, 500f));
Create("HangingLamp (2)", "2StoryLamp1", new Vector3(-600f, 0f, 500f));
Active("WallInsulator", state: false);
Active("WallInsulator2", state: false);
Move("GiantCylinderMagnet", new Vector3(1f, 2.5f, -9.7f));
Move("LadderShort", new Vector3(9.4f, -2.6f, 1.4f));
Move("LadderShort (1)", new Vector3(-9f, -2.6f, -11.7f));
Move("LeavingShip (1)", new Vector3(0.8f, 3.3f, 11.3f));
Move("LeavingShip (3)", new Vector3(-2.8f, 3.3f, -5.8f));
Move("LeavingShip (4)", new Vector3(13.7f, 3.3f, 13f));
Move("MeterBoxDevice.001", new Vector3(-4f, 1.9f, -2f));
Move("OutsideShip (1)", new Vector3(-2.5f, 0f, -3.8f));
Move("OutsideShip (2)", new Vector3(2.3f, 3.2f, 11f));
Move("OutsideShip (3)", new Vector3(14.1f, 3.2f, 6.1f));
Move("OutsideShipRoom", new Vector3(0f, 0f, 2f));
Move("SideMachineryRight", new Vector3(-4f, 1.9f, -2f));
Size("LeavingShip (3)", new Vector3(3f, 12.2f, 0.8f));
Size("OutsideShip (1)", new Vector3(2.4f, 1.8f, 1.1f));
Size("OutsideShipRoom", new Vector3(1f, 2f, 1f));
Brighten("Area Light (4)", 3f);
Brighten("Area Light (4)(Clone)", 2f);
Brighten("Area Light (7)", 3f);
}
if (HarmonyPatches.enabledCelestialTint)
{
if (HarmonyPatches.enabledWiderShip)
{
Move("MeterBoxDevice.001_copy", new Vector3(-3.1f, 1.2f, -6.1f));
Move("OutsideShipRoom_copy", new Vector3(1.3f, 0.3f, -2.5f));
Move("SideMachineryLeft_copy", new Vector3(-0.6f, 1.7f, -22.3f));
Move("SideMachineryRight_copy", new Vector3(-2.7f, 2.2f, -6.3f));
Rotate("SideMachineryLeft_copy", new Vector3(0f, 90f, 90f));
}
else
{
Move("MeterBoxDevice.001_copy", new Vector3(-3.1f, 1.2f, -8.1f));
Move("OutsideShipRoom_copy", new Vector3(1.3f, 0.3f, -5.5f));
Move("SideMachineryRight_copy", new Vector3(-2.7f, 2.2f, -9.3f));
Size("OutsideShipRoom_copy", new Vector3(1f, 2f, 1f));
}
Move("ShipLightsPost_copy", new Vector3(7.6f, 6.2f, -16.8f));
}
((Object)val).name = "MelanieShip";
foreach (Transform item in GameObject.Find("Environment/HangarShip").transform)
{
Transform val2 = item;
if (((Object)val2).name == "ShipInside" || ((Object)val2).name == "ShipInside.001" || ((Object)val2).name == "Plane.001")
{
Active(((Object)((Component)val2).gameObject).name, state: false);
}
}
Active("CatwalkShip", state: false);
Active("CatwalkRailLining", state: false);
Active("CatwalkRailLiningB", state: false);
Active("CatwalkUnderneathSupports", state: false);
Active("ShipRails", state: false);
Active("ShipRailPosts", state: false);
Active("Environment/HangarShip/Railing/Cube", state: false);
Active("Environment/HangarShip/Railing/Cube (1)", state: false);
Active("Environment/HangarShip/Railing/Cube (2)", state: false);
Active("Environment/HangarShip/Railing/Cube (3)", state: false);
Active("Environment/HangarShip/Railing/Cube (4)", state: false);
Active("Environment/HangarShip/Railing/Cube (5)", state: false);
Active("Environment/HangarShip/Railing/Cube (6)", state: false);
Active("Environment/HangarShip/Railing/Cube (7)", state: false);
Active("Environment/HangarShip/Railing/Cube (8)", state: false);
Active("Environment/HangarShip/Railing/Cube (9)", state: false);
Active("Environment/HangarShip/Railing/Cube (10)", state: false);
Active("LeavingShip (6)", state: false);
Active("Light", state: false);
Active("Light (3)", state: false);
Move("ScavengerModelSuitParts/Circle.002", new Vector3(-1f, -2.7f, 5.3f));
Move("Cube.005", new Vector3(0f, 3f, -4f));
Move("Cube.006", new Vector3(0.5f, 3f, -4f));
Move("ShipLightsPost", new Vector3(0f, 5f, 0f));
Move("ShipBoundsTrigger", new Vector3(1.5f, 6.7f, -6.7f));
Move("ShipInnerRoomBoundsTrigger", new Vector3(1.4f, 4.3f, -6.6f));
Size("ShipBoundsTrigger", new Vector3(24f, 15.1f, 22f));
Size("ShipInnerRoomBoundsTrigger", new Vector3(18f, 11f, 16f));
if (HarmonyPatches.enabledShipWindow)
{
((MonoBehaviour)StartOfRound.Instance).StartCoroutine(ShipWindowSetup());
return;
}
foreach (Transform item2 in GameObject.Find("Environment/HangarShip").transform)
{
Transform val3 = item2;
if (((Object)val3).name == "ShipInside" || ((Object)val3).name == "Plane.001")
{
Active(((Object)((Component)val3).gameObject).name, state: false);
}
}
}
public static IEnumerator ShipWindowSetup()
{
yield return (object)new WaitForSeconds(1f * Time.deltaTime);
Material invis = Plugin.bundle.LoadAsset<Material>("Assets/Melanie2StoryShip/Material/Invis.mat");
if ((Object)(object)GameObject.Find("MelanieShip/CeilingWindow") == (Object)null && (Object)(object)GameObject.Find("CeilingWindow") != (Object)null)
{
Parent("CeilingWindow", "MelanieShip");
Move("CeilingWindow", new Vector3(7.2f, 1.3f, 10.7f));
Material[] matRef = ((Renderer)GameObject.Find("Roof0").GetComponent<MeshRenderer>()).materials;
((Renderer)GameObject.Find("Roof0").GetComponent<MeshRenderer>()).materials = (Material[])(object)new Material[4]
{
matRef[0],
matRef[1],
invis,
invis
};
}
else if ((Object)(object)GameObject.Find("CeilingWindow") == (Object)null)
{
Material[] matRef = ((Renderer)GameObject.Find("Roof0").GetComponent<MeshRenderer>()).materials;
((Renderer)GameObject.Find("Roof0").GetComponent<MeshRenderer>()).materials = (Material[])(object)new Material[4]
{
matRef[0],
matRef[1],
matRef[0],
matRef[1]
};
}
if ((Object)(object)GameObject.Find("MelanieShip/Window1") == (Object)null && (Object)(object)GameObject.Find("Window1") != (Object)null)
{
Parent("Window1", "MelanieShip");
Rotate("Window1", new Vector3(0f, 0f, 21f));
if (HarmonyPatches.enabledWiderShip)
{
Create("Window1", "2StoryWindow0", new Vector3(-7.3f, 2.9f, 6.5f));
Create("Window1", "2StoryWindow1", new Vector3(3.4f, 9.55f, 6.4f));
Move("Window1", new Vector3(3.4f, 9.55f, 1.4f));
Size("2StoryWindow0", new Vector3(5.2f, 0.5f, 1.3f));
}
else
{
Create("Window1", "2StoryWindow0", new Vector3(-7.3f, 0.4f, 6.5f));
Create("Window1", "2StoryWindow1", new Vector3(3.4f, 4.55f, 6.4f));
Move("Window1", new Vector3(3.4f, 4.55f, 1.4f));
Size("2StoryWindow0", new Vector3(2.9f, 0.5f, 1.2f));
}
Rotate("2StoryWindow0", new Vector3(0f, 0f, -90f));
Material[] matRef = ((Renderer)GameObject.Find("Wall0").GetComponent<MeshRenderer>()).materials;
((Renderer)GameObject.Find("Wall0").GetComponent<MeshRenderer>()).materials = (Material[])(object)new Material[4]
{
matRef[0],
matRef[1],
invis,
invis
};
matRef = ((Renderer)GameObject.Find("Wall1").GetComponent<MeshRenderer>()).materials;
((Renderer)GameObject.Find("Wall1").GetComponent<MeshRenderer>()).materials = (Material[])(object)new Material[4]
{
matRef[0],
matRef[1],
invis,
invis
};
}
else if ((Object)(object)GameObject.Find("Window1") == (Object)null)
{
Material[] matRef = ((Renderer)GameObject.Find("Wall0").GetComponent<MeshRenderer>()).materials;
((Renderer)GameObject.Find("Wall0").GetComponent<MeshRenderer>()).materials = (Material[])(object)new Material[4]
{
matRef[0],
matRef[1],
matRef[0],
matRef[1]
};
matRef = ((Renderer)GameObject.Find("Wall1").GetComponent<MeshRenderer>()).materials;
((Renderer)GameObject.Find("Wall1").GetComponent<MeshRenderer>()).materials = (Material[])(object)new Material[4]
{
matRef[0],
matRef[1],
matRef[0],
matRef[1]
};
}
if ((Object)(object)GameObject.Find("MelanieShip/Window2") == (Object)null && (Object)(object)GameObject.Find("Window2") != (Object)null)
{
Parent("Window2", "MelanieShip");
Rotate("Window2", new Vector3(0f, 0f, 0f));
Create("Window2", "2StoryWindow2", new Vector3(5.9f, -4.15f, 6.4f));
if (HarmonyPatches.enabledWiderShip)
{
Move("Window2", new Vector3(5.9f, -7.15f, 1.4f));
}
else
{
Move("Window2", new Vector3(5.9f, -4.15f, 1.4f));
}
Material[] matRef = ((Renderer)GameObject.Find("Wall2").GetComponent<MeshRenderer>()).materials;
((Renderer)GameObject.Find("Wall2").GetComponent<MeshRenderer>()).materials = (Material[])(object)new Material[4]
{
matRef[0],
matRef[1],
invis,
invis
};
}
else if ((Object)(object)GameObject.Find("Window2") == (Object)null)
{
Material[] matRef = ((Renderer)GameObject.Find("Wall2").GetComponent<MeshRenderer>()).materials;
((Renderer)GameObject.Find("Wall2").GetComponent<MeshRenderer>()).materials = (Material[])(object)new Material[4]
{
matRef[0],
matRef[1],
matRef[0],
matRef[1]
};
}
if ((Object)(object)GameObject.Find("MelanieShip/Window3") == (Object)null && (Object)(object)GameObject.Find("Window3") != (Object)null)
{
Parent("Window3", "MelanieShip");
Material[] matRef = ((Renderer)GameObject.Find("Floor0").GetComponent<MeshRenderer>()).materials;
((Renderer)GameObject.Find("Floor0").GetComponent<MeshRenderer>()).materials = (Material[])(object)new Material[4]
{
matRef[0],
matRef[1],
invis,
invis
};
}
else if ((Object)(object)GameObject.Find("Window3") == (Object)null)
{
Material[] matRef = ((Renderer)GameObject.Find("Floor0").GetComponent<MeshRenderer>()).materials;
((Renderer)GameObject.Find("Floor0").GetComponent<MeshRenderer>()).materials = (Material[])(object)new Material[4]
{
matRef[0],
matRef[1],
matRef[0],
matRef[1]
};
}
foreach (Transform item in GameObject.Find("Environment/HangarShip").transform)
{
Transform child = item;
if (((Object)child).name == "ShipInside" || ((Object)child).name == "Plane.001")
{
Active(((Object)((Component)child).gameObject).name, state: false);
}
}
}
public static void NavSetup()
{
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Expected O, but got Unknown
//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
//IL_020f: Unknown result type (might be due to invalid IL or missing references)
//IL_022e: Unknown result type (might be due to invalid IL or missing references)
//IL_024d: Unknown result type (might be due to invalid IL or missing references)
//IL_0152: Unknown result type (might be due to invalid IL or missing references)
//IL_0171: Unknown result type (might be due to invalid IL or missing references)
//IL_0190: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_0260: Unknown result type (might be due to invalid IL or missing references)
try
{
Transform transform = GameObject.Find("Environment/NavMeshColliders/PlayerShipNavmesh").transform;
try
{
GameObject.Find("Environment/NavMeshColliders/PlayerShipNavmesh/Cube (6)").isStatic = false;
GameObject.Find("Environment/NavMeshColliders/PlayerShipNavmesh/Cube (7)").isStatic = false;
GameObject.Find("Environment/NavMeshColliders/PlayerShipNavmesh/Cube (8)").isStatic = false;
GameObject.Find("Environment/NavMeshColliders/PlayerShipNavmesh/Cube (10)").isStatic = false;
GameObject.Find("Environment/NavMeshColliders/PlayerShipNavmesh/Cube (11)").isStatic = false;
GameObject.Find("Environment/NavMeshColliders/PlayerShipNavmesh/Cube (12)").isStatic = false;
GameObject.Find("Environment/NavMeshColliders/PlayerShipNavmesh/Cube (13)").isStatic = false;
GameObject.Find("Environment/NavMeshColliders/PlayerShipNavmesh/Cube (14)").isStatic = false;
}
catch
{
}
foreach (Transform item in transform)
{
Transform val = item;
try
{
((Component)val).gameObject.SetActive(false);
}
catch
{
}
}
Active("Environment/NavMeshColliders/PlayerShipNavmesh/Cube (6)", state: true);
Active("Environment/NavMeshColliders/PlayerShipNavmesh/Cube (7)", state: true);
Active("Environment/NavMeshColliders/PlayerShipNavmesh/Cube (8)", state: true);
GameObject val2;
if (HarmonyPatches.enabledWiderShip)
{
val2 = Object.Instantiate<GameObject>(Plugin.bundle.LoadAsset<GameObject>("Assets/Melanie2StoryShip/Prefab/ShipWiderNav.prefab"), transform.parent);
Move("Environment/NavMeshColliders/PlayerShipNavmesh/Cube (10)", new Vector3(19.6f, -3.8f, 10.1f));
Move("Environment/NavMeshColliders/PlayerShipNavmesh/Cube (11)", new Vector3(19.6f, -3.8f, -5.1f));
Move("ShipLadder", new Vector3(24.9f, -4.8f, 12.7f));
Size("Environment/NavMeshColliders/PlayerShipNavmesh/Cube (13)", new Vector3(0.8f, 5.7f, 16.5f));
}
else
{
val2 = Object.Instantiate<GameObject>(Plugin.bundle.LoadAsset<GameObject>("Assets/Melanie2StoryShip/Prefab/ShipNav.prefab"), transform.parent);
Move("Environment/NavMeshColliders/PlayerShipNavmesh/Cube (10)", new Vector3(19.6f, -3.8f, 7.1f));
Move("Environment/NavMeshColliders/PlayerShipNavmesh/Cube (13)", new Vector3(28.1f, -3.8f, 3.2f));
Move("ShipLadder", new Vector3(24.9f, -4.8f, 9.7f));
Size("Environment/NavMeshColliders/PlayerShipNavmesh/Cube (13)", new Vector3(0.8f, 5.7f, 8.5f));
}
val2.transform.position = transform.position;
GameObject.Find("MelanieLadder0").GetComponent<OffMeshLink>().UpdatePositions();
GameObject.Find("MelanieLadder1").GetComponent<OffMeshLink>().UpdatePositions();
GameObject.Find("MelanieLadder2").GetComponent<OffMeshLink>().UpdatePositions();
try
{
GameObject.Find("MelanieLadder3").GetComponent<OffMeshLink>().UpdatePositions();
}
catch
{
}
}
catch
{
}
}
public static void LightSwitch(string obj, bool state)
{
try
{
((Behaviour)GameObject.Find(obj).GetComponent<Light>()).enabled = state;
}
catch
{
}
}
private static void Move(string obj, Vector3 pos)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
try
{
GameObject.Find(obj).transform.localPosition = pos;
}
catch
{
}
}
private static void Rotate(string obj, Vector3 rot)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
try
{
GameObject.Find(obj).transform.localEulerAngles = rot;
}
catch
{
}
}
private static void Size(string obj, Vector3 scale)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
try
{
GameObject.Find(obj).transform.localScale = scale;
}
catch
{
}
}
private static void Create(string obj, string name, Vector3 pos)
{
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
try
{
GameObject val = Object.Instantiate<GameObject>(GameObject.Find(obj), GameObject.Find(obj).transform.parent);
((Object)val).name = name;
Move(((Object)val).name, pos);
}
catch
{
}
}
private static void Active(string obj, bool state)
{
try
{
GameObject.Find(obj).SetActive(state);
}
catch
{
}
}
private static void Brighten(string obj, float intensity)
{
try
{
Light component = GameObject.Find(obj).GetComponent<Light>();
component.range *= intensity;
}
catch
{
}
}
private static void Parent(string obj, string parent)
{
try
{
GameObject.Find(obj).transform.parent = GameObject.Find(parent).transform;
}
catch
{
}
}
private static void Network(string obj)
{
try
{
GameObject val = GameObject.Find(obj);
val.GetComponent<NetworkObject>().Spawn(false);
((Component)GameNetworkManager.Instance).GetComponent<NetworkManager>().AddNetworkPrefab(val);
}
catch
{
}
}
}
[BepInPlugin("MelanieMelicious.2StoryShip", "Melanie Melicious - 2 sToRy ShIp", "0.2.3")]
public class Plugin : BaseUnityPlugin
{
private const string GUID = "MelanieMelicious.2StoryShip";
private const string NAME = "Melanie Melicious - 2 sToRy ShIp";
private const string VERSION = "0.2.3";
private readonly Harmony harmony = new Harmony("MelanieMelicious.2StoryShip");
public static ManualLogSource mls;
public static AssetBundle bundle;
private static Plugin instance;
private void Awake()
{
instance = this;
mls = Logger.CreateLogSource("2 sToRy ShiP");
mls = ((BaseUnityPlugin)this).Logger;
harmony.PatchAll(typeof(HarmonyPatches));
string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "melanieship2story");
bundle = AssetBundle.LoadFromFile(text);
((BaseUnityPlugin)this).Logger.LogInfo((object)"2-Story Ship Mod loading wowow");
}
}