Decompiled source of OldChronianRefit v3.0.0
CaelanorHatchFix.dll
Decompiled 8 hours agousing System; using System.Reflection; using System.Runtime.CompilerServices; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using UnityEngine; [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: AssemblyVersion("0.0.0.0")] namespace CaelanorHatchFix; [BepInPlugin("com.dixiecapt.sailwind.caelanorhatchfix", "Caelanor Hatch Walk Collider Fix", "1.2.0")] public class CaelanorHatchFixPlugin : BaseUnityPlugin { public const string Guid = "com.dixiecapt.sailwind.caelanorhatchfix"; public const string Name = "Caelanor Hatch Walk Collider Fix"; public const string Version = "1.2.0"; internal static CaelanorHatchFixPlugin Instance; internal static ConfigEntry<bool> Enabled; private void Awake() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown Instance = this; Enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Shrink the Caelanor cabin hatch's invisible walk collider so it only covers the actual opening. The authored collider is 1.84m long but the hatch only slides 0.85m, so the excess blocks the companionway even when the hatch is open."); MethodInfo methodInfo = AccessTools.Method(typeof(GPButtonTrapdoor), "Awake", (Type[])null, (Type[])null); if (methodInfo == null) { ((BaseUnityPlugin)this).Logger.LogError((object)"[CaelanorHatchFix] GPButtonTrapdoor.Awake not found."); return; } Harmony val = new Harmony("com.dixiecapt.sailwind.caelanorhatchfix"); MethodInfo methodInfo2 = methodInfo; HarmonyMethod val2 = new HarmonyMethod(typeof(CaelanorHatchFixPlugin), "AwakePostfix", (Type[])null); val.Patch((MethodBase)methodInfo2, (HarmonyMethod)null, val2, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); ((BaseUnityPlugin)this).Logger.LogInfo((object)"[CaelanorHatchFix] Patched GPButtonTrapdoor.Awake"); } public static void AwakePostfix(GPButtonTrapdoor __instance) { //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) try { if (!Enabled.Value || (Object)(object)__instance == (Object)null || ((Object)((Component)__instance).gameObject).name != "cabin_hatch") { return; } FieldInfo fieldInfo = AccessTools.Field(typeof(GPButtonTrapdoor), "importedActualBoat"); Transform val = (Transform)((!(fieldInfo != null)) ? null : /*isinst with value type is only supported in some contexts*/); if (!((Object)(object)val == (Object)null) && ((Object)val).name.ToLowerInvariant().Contains("caelanor")) { FieldInfo fieldInfo2 = AccessTools.Field(typeof(GPButtonTrapdoor), "walkCol"); Transform val2 = (Transform)((!(fieldInfo2 != null)) ? null : /*isinst with value type is only supported in some contexts*/); BoxCollider val3 = ((!((Object)(object)val2 != (Object)null)) ? null : ((Component)val2).GetComponent<BoxCollider>()); if ((Object)(object)val3 == (Object)null) { ((BaseUnityPlugin)Instance).Logger.LogWarning((object)"[CaelanorHatchFix] cabin_hatch walk collider not found; skipping."); return; } val3.center = new Vector3(0f, -0.47f, 0.241f); val3.size = new Vector3(1.341f, 1.843f, 0.06f); ((BaseUnityPlugin)Instance).Logger.LogInfo((object)"[CaelanorHatchFix] Slimmed cabin_hatch walk collider to a top plate (walkable from above, clear beneath)."); } } catch (Exception ex) { if ((Object)(object)Instance != (Object)null) { ((BaseUnityPlugin)Instance).Logger.LogWarning((object)("[CaelanorHatchFix] Postfix error: " + ex)); } } } }
CaelanorMastPlatforms.dll
Decompiled 8 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.Rendering; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: AssemblyVersion("0.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace CaelanorMastPlatforms { public class MastPlatformGuard : MonoBehaviour { private void OnEnable() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) try { Physics.SyncTransforms(); BoxCollider[] componentsInChildren = ((Component)this).GetComponentsInChildren<BoxCollider>(true); foreach (BoxCollider val in componentsInChildren) { Collider[] array = Physics.OverlapBox(((Component)val).transform.position, Vector3.Scale(val.size, ((Component)val).transform.lossyScale) / 2f + new Vector3(0.05f, 0.25f, 0.05f), ((Component)val).transform.rotation); foreach (Collider val2 in array) { if (!((Object)(object)val2 == (Object)(object)val) && (Object)(object)val2.attachedRigidbody != (Object)null) { Physics.IgnoreCollision((Collider)(object)val, val2, true); Debug.Log((object)("[MastPlatforms] plate '" + ((Object)val).name + "' ignoring overlapping item '" + ((Object)val2).name + "'")); } } } } catch (Exception ex) { Debug.LogWarning((object)("[MastPlatforms] guard error: " + ex.Message)); } } } public class MastClimbButton : GoPointerButton { public Transform standOn; public Transform standOnAlt; public Func<bool> preferAlt; public float eyeHeight = 1.65f; public Func<bool> allowed; public override void OnActivate(GoPointer activatingPointer) { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: 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) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) try { Transform val = (((Object)(object)standOnAlt != (Object)null && preferAlt != null && preferAlt()) ? standOnAlt : standOn); if (!((Object)(object)val == (Object)null) && !((Object)(object)GameState.currentBoat == (Object)null) && (allowed == null || allowed())) { Transform val2 = (((Object)(object)Refs.observerMirror != (Object)null) ? ((Component)Refs.observerMirror).transform : null); if (!((Object)(object)val2 == (Object)null) && !((Object)(object)Refs.ovrController == (Object)null)) { Vector3 val3 = val.position + val.up * eyeHeight; Vector3 val4 = val2.InverseTransformVector(val3 - val2.position); ((Component)Refs.ovrController).transform.Translate(val4, (Space)1); PlayerClimb.ClickRatlines(); Debug.Log((object)("[MastPlatforms] climbed: '" + base.lookText + "'.")); } } } catch (Exception ex) { Debug.LogWarning((object)("[MastPlatforms] climb failed: " + ex.Message)); } } } [BepInPlugin("com.dixiecapt.sailwind.caelanormastplatforms", "Caelanor Mast Platforms", "3.0.0")] public class CaelanorMastPlatformsPlugin : BaseUnityPlugin { private struct Spot { public string label; public float x; public float yTop; public float z; public float sx; public float sz; public float mastX; public bool cross; } public class SheathingScan : MonoBehaviour { private float _t; private void Update() { if (!GameState.playing || (Object)(object)Instance == (Object)null) { return; } _t += Time.deltaTime; if (_t < 6f) { return; } try { int num = 0; List<string> list = new List<string>(); BoatCustomParts[] array = Resources.FindObjectsOfTypeAll<BoatCustomParts>(); foreach (BoatCustomParts val in array) { if (!((Object)(object)val == (Object)null)) { Instance.ScanSheathing(((Component)val).transform); num++; list.Add(((Object)val).name); } } ((BaseUnityPlugin)Instance).Logger.LogInfo((object)("[Scan] sheathing scan done over " + num + " boats with shipyard parts: " + string.Join(", ", list.ToArray()) + ".")); } catch (Exception ex) { ((BaseUnityPlugin)Instance).Logger.LogWarning((object)("[Scan] " + ex.Message)); } Object.Destroy((Object)(object)((Component)this).gameObject); } } private struct StaySlide { public string name; public string deckKey; public string topKey; public float deckX; public float deckZ; public StaySlide(string n, string dk, float x, float z, string tk) { name = n; deckKey = dk; deckX = x; deckZ = z; topKey = tk; } } private struct ShroudLine { public float deckZ; public float deckY; public float topZ; public float topY; public float deckX0; public float deckX1; public float topX; public float deckWalk; } public class FollowActive : MonoBehaviour { public GameObject leader; public bool self; private void LateUpdate() { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown if ((Object)(object)leader == (Object)null) { return; } bool activeInHierarchy = leader.activeInHierarchy; if (self) { Renderer component = ((Component)this).GetComponent<Renderer>(); if ((Object)(object)component != (Object)null && component.enabled != activeInHierarchy) { component.enabled = activeInHierarchy; } Collider component2 = ((Component)this).GetComponent<Collider>(); if ((Object)(object)component2 != (Object)null && component2.enabled != activeInHierarchy) { component2.enabled = activeInHierarchy; } return; } foreach (Transform item in ((Component)this).transform) { Transform val = item; if (((Component)val).gameObject.activeSelf != activeInHierarchy) { ((Component)val).gameObject.SetActive(activeInHierarchy); } } } } internal class PolyMesh { private readonly List<Vector3> _v = new List<Vector3>(); private readonly List<int> _t = new List<int>(); public void AddPrism(List<Vector2> outline, float yTop, float thick) { //IL_0017: 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) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_0057: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) int count = outline.Count; if (count < 3) { return; } Vector2 val = Vector2.zero; foreach (Vector2 item in outline) { val += item; } val /= (float)count; int count2 = _v.Count; foreach (Vector2 item2 in outline) { _v.Add(new Vector3(item2.x, yTop, item2.y)); } int count3 = _v.Count; foreach (Vector2 item3 in outline) { _v.Add(new Vector3(item3.x, yTop - thick, item3.y)); } for (int i = 1; i + 1 < count; i++) { Tri(count2, count2 + i, count2 + i + 1, Vector3.up); Tri(count3, count3 + i, count3 + i + 1, Vector3.down); } Vector3 outward = default(Vector3); for (int j = 0; j < count; j++) { int num = (j + 1) % count; Vector2 val2 = (outline[j] + outline[num]) / 2f - val; ((Vector3)(ref outward))..ctor(val2.x, 0f, val2.y); Tri(count2 + j, count3 + j, count2 + num, outward); Tri(count2 + num, count3 + j, count3 + num, outward); } } private void Tri(int a, int b, int c, Vector3 outward) { //IL_0008: 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_0025: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Cross(_v[b] - _v[a], _v[c] - _v[a]); if (Vector3.Dot(val, outward) >= 0f) { _t.Add(a); _t.Add(b); _t.Add(c); } else { _t.Add(a); _t.Add(c); _t.Add(b); } } public GameObject Build(Transform parent, string name, Color col) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) Mesh val = new Mesh(); if (_v.Count > 65000) { val.indexFormat = (IndexFormat)1; } val.SetVertices(_v); val.SetTriangles(_t, 0); val.RecalculateNormals(); val.RecalculateBounds(); GameObject val2 = new GameObject(name); val2.transform.SetParent(parent, false); val2.AddComponent<MeshFilter>().sharedMesh = val; ((Renderer)val2.AddComponent<MeshRenderer>()).material = Refits.PlainMaterial(col, 0f, 0.25f); return val2; } } internal static CaelanorMastPlatformsPlugin Instance; private ConfigEntry<bool> _enabled; private ConfigEntry<bool> _climbLines; private ConfigEntry<string> _spots; private ConfigEntry<bool> _measure; private ConfigEntry<float> _copperAe; private ConfigEntry<float> _copperCae; private ConfigEntry<float> _copperRiseAe; private ConfigEntry<float> _copperRiseCae; private ConfigEntry<float> _copperRiseLen; private ConfigEntry<float> _copperBowAe; private ConfigEntry<float> _copperBowCae; private ConfigEntry<float> _copperBowLen; private ConfigEntry<float> _copperMetal; private ConfigEntry<float> _copperSmooth; private ConfigEntry<Color> _copperColour; private ConfigEntry<bool> _copperFromSE; private static readonly HashSet<int> _measured = new HashSet<int>(); private const string DefaultSpots = "foretop:6.75,11.84,0,2.4,2.0,0;maintop:-2.40,13.49,0,2.4,2.0,0;forecross:7.15,18.72,0,1.2,0.9,1,6.74;maincross:-2.85,20.46,0,1.2,0.9,1,-2.44;aeforetop:13.70,17.76,0,3.0,3.2,0;aeforecross:14.48,28.85,0,1.4,1.0,1,14.48;aemaintop:-3.03,18.77,0,3.0,3.2,0;aemaincross:-2.66,31.19,0,1.4,1.0,1,-2.66;aemizentop:-13.21,17.65,0,3.0,3.0,0;aemizencross:-12.82,24.73,0,1.2,0.9,1,-12.82"; private const string V3dDefaultSpots = "foretop:6.75,11.84,0,2.4,2.0,0;maintop:-2.40,13.49,0,2.4,2.0,0;forecross:7.15,18.72,0,1.2,0.9,1,6.74;maincross:-2.85,20.46,0,1.2,0.9,1,-2.44;aeforetop:13.70,17.76,0,3.0,3.2,0;aeforecross:14.48,28.85,0,1.4,1.0,1,14.48;aemaintop:-3.03,18.77,0,3.0,3.2,0;aemaincross:-2.66,31.19,0,1.4,1.0,1,-2.66;aemizentop:-13.21,17.65,0,3.0,2.8,0;aemizencross:-12.82,24.73,0,1.2,0.9,1,-12.82"; private const string V3cDefaultSpots = "foretop:6.75,11.84,0,2.4,2.0,0;maintop:-2.40,13.49,0,2.4,2.0,0;forecross:7.15,18.72,0,1.2,0.9,1,6.74;maincross:-2.85,20.46,0,1.2,0.9,1,-2.44;aeforetop:13.70,17.76,0,3.0,3.2,0;aeforecross:14.48,28.85,0,1.4,1.0,1,14.48;aemaintop:-3.03,18.77,0,3.0,2.4,0;aemaincross:-2.66,31.19,0,1.4,1.0,1,-2.66;aemizentop:-13.21,17.65,0,3.0,2.8,0;aemizencross:-12.82,24.73,0,1.2,0.9,1,-12.82"; private const string V3bDefaultSpots = "foretop:6.75,11.84,0,2.4,2.0,0;maintop:-2.40,13.49,0,2.4,2.0,0;forecross:7.15,18.72,0,1.2,0.9,1,6.74;maincross:-2.85,20.46,0,1.2,0.9,1,-2.44;aeforetop:13.70,17.66,0,3.0,2.4,0;aeforecross:14.48,28.85,0,1.4,1.0,1,14.48;aemaintop:-3.03,18.67,0,3.0,2.4,0;aemaincross:-2.66,31.19,0,1.4,1.0,1,-2.66;aemizentop:-13.21,17.55,0,2.6,2.1,0;aemizencross:-12.82,24.73,0,1.2,0.9,1,-12.82"; private const string V3aDefaultSpots = "foretop:6.75,11.84,0,2.4,2.0,0;maintop:-2.40,13.49,0,2.4,2.0,0;forecross:7.15,18.72,0,1.2,0.9,1,6.74;maincross:-2.85,20.46,0,1.2,0.9,1,-2.44"; private const string OldDefaultSpots = "foretop:6.75,11.84,0,1.15,1.05,0;maintop:-2.40,13.49,0,1.15,1.05,0;forecross:7.15,18.72,0,1.0,0.8,1,6.74;maincross:-2.85,20.46,0,1.0,0.8,1,-2.44"; private static readonly HashSet<string> _sailCheckSkipped = new HashSet<string>(); private static readonly HashSet<int> _scanned = new HashSet<int>(); private const string PumpAsset = "Assets/Lilith/old_chronian/CAE_BilgePumps.prefab"; private static readonly Dictionary<string, ShroudLine> Shrouds = new Dictionary<string, ShroudLine> { { "fore", new ShroudLine { deckZ = 3.3f, deckY = 0.3f, topZ = 0.4f, topY = 11.76f, deckX0 = 4.95f, deckX1 = 6.85f, topX = 6.8f, deckWalk = 0.05f } }, { "main", new ShroudLine { deckZ = 3.15f, deckY = 0.3f, topZ = 0.4f, topY = 13.48f, deckX0 = -4.8f, deckX1 = -2.5f, topX = -2.35f, deckWalk = 0.05f } }, { "aefore", new ShroudLine { deckZ = 4.7f, deckY = 1.8f, topZ = 0.47f, topY = 17.61f, deckX0 = 11.15f, deckX1 = 14.5f, topX = 13.7f, deckWalk = 4.6f } }, { "aemain", new ShroudLine { deckZ = 4.8f, deckY = 1.8f, topZ = 0.55f, topY = 18.62f, deckX0 = -6.8f, deckX1 = -2.25f, topX = -3.03f, deckWalk = 4.6f } }, { "aemizen", new ShroudLine { deckZ = 4.1f, deckY = 2.7f, topZ = 0.59f, topY = 17.5f, deckX0 = -15.1f, deckX1 = -13.1f, topX = -13.21f, deckWalk = 4.6f } } }; private static readonly Dictionary<string, Dictionary<int, List<Vector3[]>>> _shroudRopes = new Dictionary<string, Dictionary<int, List<Vector3[]>>>(); private static readonly Dictionary<string, string> _shroudFrom = new Dictionary<string, string>(); private static readonly Dictionary<string, int> _shroudPieces = new Dictionary<string, int>(); private const float Thick = 0.06f; private static readonly Color Plank = new Color(0.42f, 0.32f, 0.22f); private static readonly Color Timber = new Color(0.33f, 0.24f, 0.15f); private static readonly Color Rope = new Color(0.16f, 0.13f, 0.1f); private static readonly Color Iron = new Color(0.12f, 0.12f, 0.13f); private static Transform _walkForZones; internal static ManualLogSource Log => ((Object)(object)Instance != (Object)null) ? ((BaseUnityPlugin)Instance).Logger : null; internal static bool MeasureOn => (Object)(object)Instance != (Object)null && Instance._measure != null && Instance._measure.Value; internal static float CopperRiseLength => ((Object)(object)Instance != (Object)null && Instance._copperRiseLen != null) ? Instance._copperRiseLen.Value : 18f; internal static float CopperBowRiseLength => ((Object)(object)Instance != (Object)null && Instance._copperBowLen != null) ? Instance._copperBowLen.Value : 3f; internal static bool CopperFromSE => (Object)(object)Instance != (Object)null && Instance._copperFromSE != null && Instance._copperFromSE.Value; internal static Color CopperColour => (Color)(((Object)(object)Instance != (Object)null && Instance._copperColour != null) ? Instance._copperColour.Value : new Color(0.77f, 0.51f, 0.34f)); internal static float CopperMetal => ((Object)(object)Instance != (Object)null && Instance._copperMetal != null) ? Instance._copperMetal.Value : 0.9f; internal static float CopperSmooth => ((Object)(object)Instance != (Object)null && Instance._copperSmooth != null) ? Instance._copperSmooth.Value : 0.6f; internal static float CopperLine(bool frigate) { if ((Object)(object)Instance == (Object)null) { return frigate ? 1.25f : 0.28f; } return (frigate ? Instance._copperAe : Instance._copperCae)?.Value ?? (frigate ? 1.25f : 0.28f); } internal static float CopperRise(bool frigate) { if ((Object)(object)Instance == (Object)null) { return frigate ? 1f : 0.09f; } return (frigate ? Instance._copperRiseAe : Instance._copperRiseCae)?.Value ?? (frigate ? 1f : 0.09f); } internal static float CopperBowRise(bool frigate) { if ((Object)(object)Instance == (Object)null) { return frigate ? 0.36f : 0.8f; } return (frigate ? Instance._copperBowAe : Instance._copperBowCae)?.Value ?? (frigate ? 0.36f : 0.8f); } private void Awake() { //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Expected O, but got Unknown //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Expected O, but got Unknown //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Expected O, but got Unknown //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Expected O, but got Unknown //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Expected O, but got Unknown //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Expected O, but got Unknown //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Expected O, but got Unknown //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Expected O, but got Unknown //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Expected O, but got Unknown //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Expected O, but got Unknown //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Expected O, but got Unknown //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_043f: Expected O, but got Unknown //IL_0476: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Expected O, but got Unknown //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Expected O, but got Unknown Instance = this; _enabled = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Enabled", true, "Offer lookout platforms (fighting tops and crosstree posts) as purchasable shipyard parts on the Caelanor."); _climbLines = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "ClimbLines", true, "Include climbable futtock-shroud lines on the platform edges."); _spots = ((BaseUnityPlugin)this).Config.Bind<string>("General", "Spots", "foretop:6.75,11.84,0,2.4,2.0,0;maintop:-2.40,13.49,0,2.4,2.0,0;forecross:7.15,18.72,0,1.2,0.9,1,6.74;maincross:-2.85,20.46,0,1.2,0.9,1,-2.44;aeforetop:13.70,17.76,0,3.0,3.2,0;aeforecross:14.48,28.85,0,1.4,1.0,1,14.48;aemaintop:-3.03,18.77,0,3.0,3.2,0;aemaincross:-2.66,31.19,0,1.4,1.0,1,-2.66;aemizentop:-13.21,17.65,0,3.0,3.0,0;aemizencross:-12.82,24.73,0,1.2,0.9,1,-12.82", "Platform geometry: label:x,yTop,z,sizeX,sizeZ,isCrosstree separated by ';' (boat-local meters)."); if (_spots.Value == "foretop:6.75,11.84,0,1.15,1.05,0;maintop:-2.40,13.49,0,1.15,1.05,0;forecross:7.15,18.72,0,1.0,0.8,1,6.74;maincross:-2.85,20.46,0,1.0,0.8,1,-2.44" || _spots.Value == "foretop:6.75,11.84,0,2.4,2.0,0;maintop:-2.40,13.49,0,2.4,2.0,0;forecross:7.15,18.72,0,1.2,0.9,1,6.74;maincross:-2.85,20.46,0,1.2,0.9,1,-2.44" || _spots.Value == "foretop:6.75,11.84,0,2.4,2.0,0;maintop:-2.40,13.49,0,2.4,2.0,0;forecross:7.15,18.72,0,1.2,0.9,1,6.74;maincross:-2.85,20.46,0,1.2,0.9,1,-2.44;aeforetop:13.70,17.66,0,3.0,2.4,0;aeforecross:14.48,28.85,0,1.4,1.0,1,14.48;aemaintop:-3.03,18.67,0,3.0,2.4,0;aemaincross:-2.66,31.19,0,1.4,1.0,1,-2.66;aemizentop:-13.21,17.55,0,2.6,2.1,0;aemizencross:-12.82,24.73,0,1.2,0.9,1,-12.82" || _spots.Value == "foretop:6.75,11.84,0,2.4,2.0,0;maintop:-2.40,13.49,0,2.4,2.0,0;forecross:7.15,18.72,0,1.2,0.9,1,6.74;maincross:-2.85,20.46,0,1.2,0.9,1,-2.44;aeforetop:13.70,17.76,0,3.0,3.2,0;aeforecross:14.48,28.85,0,1.4,1.0,1,14.48;aemaintop:-3.03,18.77,0,3.0,2.4,0;aemaincross:-2.66,31.19,0,1.4,1.0,1,-2.66;aemizentop:-13.21,17.65,0,3.0,2.8,0;aemizencross:-12.82,24.73,0,1.2,0.9,1,-12.82" || _spots.Value == "foretop:6.75,11.84,0,2.4,2.0,0;maintop:-2.40,13.49,0,2.4,2.0,0;forecross:7.15,18.72,0,1.2,0.9,1,6.74;maincross:-2.85,20.46,0,1.2,0.9,1,-2.44;aeforetop:13.70,17.76,0,3.0,3.2,0;aeforecross:14.48,28.85,0,1.4,1.0,1,14.48;aemaintop:-3.03,18.77,0,3.0,3.2,0;aemaincross:-2.66,31.19,0,1.4,1.0,1,-2.66;aemizentop:-13.21,17.65,0,3.0,2.8,0;aemizencross:-12.82,24.73,0,1.2,0.9,1,-12.82") { _spots.Value = "foretop:6.75,11.84,0,2.4,2.0,0;maintop:-2.40,13.49,0,2.4,2.0,0;forecross:7.15,18.72,0,1.2,0.9,1,6.74;maincross:-2.85,20.46,0,1.2,0.9,1,-2.44;aeforetop:13.70,17.76,0,3.0,3.2,0;aeforecross:14.48,28.85,0,1.4,1.0,1,14.48;aemaintop:-3.03,18.77,0,3.0,3.2,0;aemaincross:-2.66,31.19,0,1.4,1.0,1,-2.66;aemizentop:-13.21,17.65,0,3.0,3.0,0;aemizencross:-12.82,24.73,0,1.2,0.9,1,-12.82"; } _copperAe = ((BaseUnityPlugin)this).Config.Bind<float>("Refits", "Copper line - Aelasyl (m)", 1.25f, new ConfigDescription("How high the copper sheathing reaches on the Aelasyl, in metres above her model's origin. 1.25 brings it to the lime line at the top of her white band. Applies when she next loads.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 3f), Array.Empty<object>())); _copperCae = ((BaseUnityPlugin)this).Config.Bind<float>("Refits", "Copper line - Caelanor (m)", 0.28f, new ConfigDescription("How high the copper sheathing reaches on the Caelanor, in metres above her model's origin. Her white band sits low: about 0.50 brings the copper to the lime line at its top. Applies when she next loads.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 3f), Array.Empty<object>())); _copperRiseAe = ((BaseUnityPlugin)this).Config.Bind<float>("Refits", "Copper stern rise - Aelasyl (m)", 1f, new ConfigDescription("How much higher the Aelasyl's copper line is at her stern than along her side (negative: lower); the rise is made smoothly over the 'stern rise length'. Applies when she next loads.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-1f, 1.5f), Array.Empty<object>())); _copperRiseCae = ((BaseUnityPlugin)this).Config.Bind<float>("Refits", "Copper stern rise - Caelanor (m)", 0.09f, new ConfigDescription("How much higher the Caelanor's copper line is at her stern than along her side; her painted line DIPS toward the stern, so this is negative. Applies when she next loads.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-1f, 1.5f), Array.Empty<object>())); _copperBowAe = ((BaseUnityPlugin)this).Config.Bind<float>("Refits", "Copper bow rise - Aelasyl (m)", 0.36f, new ConfigDescription("How much the Aelasyl's copper line climbs onto the stem at her bow, over the 'bow rise length'. Applies on load.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-1f, 1.5f), Array.Empty<object>())); _copperBowCae = ((BaseUnityPlugin)this).Config.Bind<float>("Refits", "Copper bow rise - Caelanor (m)", 0.8f, new ConfigDescription("How much the Caelanor's copper line climbs onto the stem at her bow, over the 'bow rise length'. Applies on load.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(-1f, 1.5f), Array.Empty<object>())); _copperBowLen = ((BaseUnityPlugin)this).Config.Bind<float>("Refits", "Copper bow rise length (m)", 3f, new ConfigDescription("Over how many metres abaft the stem the copper line makes its climb at the bow. Applies on load.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.3f, 10f), Array.Empty<object>())); _copperRiseLen = ((BaseUnityPlugin)this).Config.Bind<float>("Refits", "Copper stern rise length (m)", 18f, new ConfigDescription("Over how many metres forward of the stern the copper line makes its rise. Applies on load.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 25f), Array.Empty<object>())); _copperMetal = ((BaseUnityPlugin)this).Config.Bind<float>("Refits", "Copper metal (0-1)", 0.9f, new ConfigDescription("How metallic the copper sheathing is. 1 is bare metal, 0 is paint. Applies on load.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); _copperSmooth = ((BaseUnityPlugin)this).Config.Bind<float>("Refits", "Copper smoothness (0-1)", 0.6f, new ConfigDescription("How smooth the copper sheathing is: higher catches the sun in a tighter, brighter glint. The brass guns are near the top of the range; 0.5 is a sheet-metal sheen. Applies on load.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); _copperFromSE = ((BaseUnityPlugin)this).Config.Bind<bool>("Refits", "Copper uses the Shipyard Expansion texture", false, "ON: with Shipyard Expansion installed the sheathing wears its copper texture (the brig's), tinted by the colour below - which can only darken it. OFF: a plain copper of the mod's own that takes the colour exactly, lighter if you like. Applies on load."); _copperColour = ((BaseUnityPlugin)this).Config.Bind<Color>("Refits", "Copper colour", new Color(0.77f, 0.51f, 0.34f), "The copper's tint, laid over the sheathing's own surface. The default is an orange copper; redder or browner as you like. Applies on load."); _measure = ((BaseUnityPlugin)this).Config.Bind<bool>("Diagnostics", "Measure masts and shrouds", false, "Once per ship as she loads, write the Caelanor's and the Aelasyl's masts, shroud (ratline) surfaces and click-to-climb buttons to the log, scan every ship's hull materials and test the bowsprit net's walking surface with rays - for designing the fittings. Off for play."); MethodInfo methodInfo = AccessTools.Method(typeof(BoatEmbarkCollider), "Awake", (Type[])null, (Type[])null); if (methodInfo == null) { ((BaseUnityPlugin)this).Logger.LogError((object)"[MastPlatforms] BoatEmbarkCollider.Awake not found."); return; } Harmony val = new Harmony("com.dixiecapt.sailwind.caelanormastplatforms"); val.Patch((MethodBase)methodInfo, (HarmonyMethod)null, new HarmonyMethod(typeof(CaelanorMastPlatformsPlugin), "EmbarkAwakePostfix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); MethodInfo methodInfo2 = AccessTools.Method(typeof(ShipyardSailColChecker), "OnTriggerEnter", (Type[])null, (Type[])null); if (methodInfo2 != null) { val.Patch((MethodBase)methodInfo2, new HarmonyMethod(typeof(CaelanorMastPlatformsPlugin), "SailCheckPrefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } else { ((BaseUnityPlugin)this).Logger.LogWarning((object)"[MastPlatforms] ShipyardSailColChecker.OnTriggerEnter not found - our fittings may block sail refits."); } if (_measure.Value) { GameObject val2 = new GameObject("MastPlatforms_SheathingScan"); Object.DontDestroyOnLoad((Object)(object)val2); val2.AddComponent<SheathingScan>(); } ((BaseUnityPlugin)this).Logger.LogInfo((object)"[MastPlatforms] v2: shipyard part registration hooked."); } private List<Spot> ParseSpots() { List<Spot> list = new List<Spot>(); string[] array = (_spots.Value ?? "").Split(new char[1] { ';' }); foreach (string text in array) { string text2 = text.Trim(); if (text2.Length == 0) { continue; } string[] array2 = text2.Split(new char[1] { ':' }); if (array2.Length != 2) { continue; } string[] array3 = array2[1].Split(new char[1] { ',' }); if (array3.Length >= 6) { try { Spot item = default(Spot); item.label = array2[0].Trim(); item.x = float.Parse(array3[0], CultureInfo.InvariantCulture); item.yTop = float.Parse(array3[1], CultureInfo.InvariantCulture); item.z = float.Parse(array3[2], CultureInfo.InvariantCulture); item.sx = float.Parse(array3[3], CultureInfo.InvariantCulture); item.sz = float.Parse(array3[4], CultureInfo.InvariantCulture); item.cross = array3[5].Trim() == "1"; item.mastX = ((array3.Length >= 7) ? float.Parse(array3[6], CultureInfo.InvariantCulture) : item.x); list.Add(item); } catch { } } } return list; } public static bool SailCheckPrefix(Collider other) { try { if ((Object)(object)other == (Object)null) { return true; } Transform val = ((Component)other).transform; while ((Object)(object)val != (Object)null) { string name = ((Object)val).name; if (name.StartsWith("WALK PLATFORMS_") || name.StartsWith("WALK LOWER_RATLINES_") || name == "WALK NETTING" || name == "WALK COPPER" || name.StartsWith("mastplatform_") || name == "gap_shroud_walk" || name.StartsWith("topshroud_") || name.StartsWith("netting_walk_")) { if (_sailCheckSkipped.Add(((Object)other).name) && (Object)(object)Instance != (Object)null) { ((BaseUnityPlugin)Instance).Logger.LogInfo((object)("[MastPlatforms] shipyard sail check: '" + ((Object)other).name + "' (ours) is not an obstruction.")); } return false; } val = val.parent; } } catch { } return true; } public static void EmbarkAwakePostfix(BoatEmbarkCollider __instance) { try { if ((Object)(object)Instance == (Object)null || (Object)(object)__instance == (Object)null) { return; } Transform root = ((Component)__instance).transform.root; if ((Object)(object)root == (Object)null) { return; } if (Instance._measure.Value && (((Object)root).name.StartsWith("BOAT CAELANOR") || ((Object)root).name.StartsWith("BOAT CHRONIAN"))) { Instance.Measure(root, __instance.walkCollider); } if (Instance._measure.Value) { Instance.ScanSheathing(root); } if (!Instance._enabled.Value) { return; } bool flag = ((Object)root).name.StartsWith("BOAT CAELANOR"); bool flag2 = ((Object)root).name.StartsWith("BOAT CHRONIAN"); if (!flag && !flag2) { return; } BoatCustomParts component = ((Component)root).GetComponent<BoatCustomParts>(); Transform walkCollider = __instance.walkCollider; Transform parent = ((Component)__instance).transform.parent; if ((Object)(object)component == (Object)null || (Object)(object)walkCollider == (Object)null || (Object)(object)parent == (Object)null) { return; } if (flag) { if (!((Object)(object)parent.Find("PLATFORMS_fore_none") != (Object)null)) { Instance.RegisterMastPart(component, parent, walkCollider, "fore", "Fore", "Foremast Main", "Foremast Top", "RATLINE_fore"); Instance.RegisterMastPart(component, parent, walkCollider, "main", "Main", "Mainmast Main", "Mainmast Top", "RATLINE_main"); ((BaseUnityPlugin)Instance).Logger.LogInfo((object)("[MastPlatforms] Registered Fore/Main platform shipyard parts on '" + ((Object)root).name + "'.")); Instance.AddStayButtons(parent, walkCollider, new StaySlide[8] { new StaySlide("STAY_jib1", "fore", 8.6f, 0f, null), new StaySlide("STAY_jib2", "fore", 8.6f, 0f, null), new StaySlide("STAY_foreroyal1", "fore", 8.6f, 0f, null), new StaySlide("STAY_foreroyal2", "fore", 8.6f, 0f, null), new StaySlide("STAY_forestay1", "fore", 8.6f, 0f, null), new StaySlide("STAY_forestay2", "fore", 8.6f, 0f, null), new StaySlide("STAY_mainroyal", "fore", 7.2f, 0f, "fore"), new StaySlide("STAY_mainstay", "fore", 7.5f, 0.7f, null) }); Refits.AddNetting(root, parent, walkCollider, component, frigate: false); Refits.AddCopper(root, parent, walkCollider, component, frigate: false); } } else if (!((Object)(object)parent.Find("PLATFORMS_aefore_none") != (Object)null)) { Instance.RegisterMastPart(component, parent, walkCollider, "aefore", "Fore", "Foremast Main", "Foremast Top", "MAST FORE RATLINES"); Instance.RegisterMastPart(component, parent, walkCollider, "aemain", "Main", "Mainmast Main", "Mainmast Top", "MAST MAIN RATLINES"); Instance.RegisterMastPart(component, parent, walkCollider, "aemizen", "Mizen", "Mizzenmast Main", "Mizzenmast Top", "MAST MIZEN RATLINES"); ((BaseUnityPlugin)Instance).Logger.LogInfo((object)("[MastPlatforms] Registered Fore/Main/Mizen platform shipyard parts on '" + ((Object)root).name + "'.")); Instance.AddBilgePump(root, parent, walkCollider, component); Instance.AddStayButtons(parent, walkCollider, new StaySlide[7] { new StaySlide("STAY_jibstay", "aefore", 15.6f, 0f, null), new StaySlide("STAY_foreroyalstay", "aefore", 15.6f, 0f, null), new StaySlide("STAY_forestay", "aefore", 15.6f, 0f, null), new StaySlide("STAY_mainroyalstay", "aefore", 12.6f, 0f, "aefore"), new StaySlide("STAY_mainstay", "aefore", 13f, 0.8f, null), new StaySlide("STAY_mizenroyalstay", "aemain", -4.6f, 0f, "aemain"), new StaySlide("STAY_mizenstay", "aemain", -4.4f, 0.8f, null) }); Refits.AddNetting(root, parent, walkCollider, component, frigate: true); Refits.AddCopper(root, parent, walkCollider, component, frigate: true); Refits.AddDavits(root, parent, walkCollider, component); } } catch (Exception ex) { if ((Object)(object)Instance != (Object)null) { ((BaseUnityPlugin)Instance).Logger.LogWarning((object)("[MastPlatforms] register error: " + ex)); } } } private static string V(Vector3 v) { return "(" + v.x.ToString("F2", CultureInfo.InvariantCulture) + ", " + v.y.ToString("F2", CultureInfo.InvariantCulture) + ", " + v.z.ToString("F2", CultureInfo.InvariantCulture) + ")"; } private static string PathOf(Transform t, Transform stop) { string text = ((Object)t).name; Transform parent = t.parent; while ((Object)(object)parent != (Object)null && (Object)(object)parent != (Object)(object)stop) { text = ((Object)parent).name + "/" + text; parent = parent.parent; } return text; } private void ScanSheathing(Transform root) { //IL_04ee: Unknown result type (might be due to invalid IL or missing references) //IL_04f3: Unknown result type (might be due to invalid IL or missing references) //IL_04f7: Unknown result type (might be due to invalid IL or missing references) //IL_04fc: Unknown result type (might be due to invalid IL or missing references) try { if (!_scanned.Add(((Object)root).GetInstanceID())) { return; } BoatCustomParts component = ((Component)root).GetComponent<BoatCustomParts>(); if ((Object)(object)component == (Object)null || component.availableParts == null) { return; } for (int i = 0; i < component.availableParts.Count; i++) { BoatPart val = component.availableParts[i]; if (val == null || val.partOptions == null) { continue; } for (int j = 0; j < val.partOptions.Count; j++) { BoatPartOption val2 = val.partOptions[j]; if ((Object)(object)val2 == (Object)null) { continue; } string text = (val2.optionName ?? "").ToLowerInvariant(); if (!text.Contains("copper") && !text.Contains("sheath") && !text.Contains("hull") && !text.Contains("paint") && !text.Contains("bottom")) { continue; } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append("[Scan] '" + ((Object)root).name + "' part " + i + " (category " + val.category + ", active " + val.activeOption + ") option " + j + " '" + val2.optionName + "': object '" + PathOf(((Component)val2).transform, root) + "' active=" + ((Component)val2).gameObject.activeSelf + ", price " + val2.basePrice + "/" + val2.installCost + ", mass " + val2.mass + ", walk '" + (((Object)(object)val2.walkColObject != (Object)null) ? ((Object)val2.walkColObject).name : "none") + "', childOptions " + ((val2.childOptions != null) ? val2.childOptions.Length : 0) + ", requires " + ((val2.requires != null) ? val2.requires.Count : 0) + ", requiresDisabled " + ((val2.requiresDisabled != null) ? val2.requiresDisabled.Count : 0) + "."); Component[] components = ((Component)val2).GetComponents<Component>(); foreach (Component val3 in components) { if ((Object)(object)val3 != (Object)null && !(val3 is Transform) && !(val3 is BoatPartOption)) { stringBuilder.Append(" [" + ((object)val3).GetType().Name + "]"); } } Renderer[] componentsInChildren = ((Component)val2).GetComponentsInChildren<Renderer>(true); foreach (Renderer val4 in componentsInChildren) { MeshFilter component2 = ((Component)val4).GetComponent<MeshFilter>(); List<string> list = new List<string>(); Material[] sharedMaterials = val4.sharedMaterials; foreach (Material val5 in sharedMaterials) { list.Add(((Object)(object)val5 != (Object)null) ? (((Object)val5).name + " (" + (((Object)(object)val5.shader != (Object)null) ? ((Object)val5.shader).name : "?") + ")") : "null"); } string[] obj = new string[10] { "\n[Scan] renderer '", PathOf(((Component)val4).transform, ((Component)val2).transform), "' mesh '", ((Object)(object)component2 != (Object)null && (Object)(object)component2.sharedMesh != (Object)null) ? (((Object)component2.sharedMesh).name + "', " + component2.sharedMesh.subMeshCount + " submesh(es), " + component2.sharedMesh.vertexCount + " verts") : "none'", ", materials [", string.Join(" | ", list.ToArray()), "], enabled ", val4.enabled.ToString(), ", bounds ", null }; Bounds bounds = val4.bounds; Vector3 size = ((Bounds)(ref bounds)).size; obj[9] = ((Vector3)(ref size)).ToString("F2"); stringBuilder.Append(string.Concat(obj)); } if (val2.childOptions != null) { GameObject[] childOptions = val2.childOptions; foreach (GameObject val6 in childOptions) { if ((Object)(object)val6 != (Object)null) { stringBuilder.Append("\n[Scan] child option '" + PathOf(val6.transform, root) + "' active=" + val6.activeSelf); } } } ((BaseUnityPlugin)this).Logger.LogInfo((object)stringBuilder.ToString()); } } Renderer[] componentsInChildren2 = ((Component)root).GetComponentsInChildren<Renderer>(true); foreach (Renderer val7 in componentsInChildren2) { if (!((Object)(object)val7 == (Object)null) && ((Object)val7).name.ToUpperInvariant().Contains("HULL")) { MeshFilter component3 = ((Component)val7).GetComponent<MeshFilter>(); List<string> list2 = new List<string>(); Material[] sharedMaterials2 = val7.sharedMaterials; foreach (Material val8 in sharedMaterials2) { list2.Add(((Object)(object)val8 != (Object)null) ? (((Object)val8).name + " (" + (((Object)(object)val8.shader != (Object)null) ? ((Object)val8.shader).name : "?") + ")") : "null"); } ((BaseUnityPlugin)this).Logger.LogInfo((object)("[Scan] '" + ((Object)root).name + "' hull renderer '" + PathOf(((Component)val7).transform, root) + "' mesh '" + (((Object)(object)component3 != (Object)null && (Object)(object)component3.sharedMesh != (Object)null) ? (((Object)component3.sharedMesh).name + "', " + component3.sharedMesh.subMeshCount + " submesh(es), " + component3.sharedMesh.vertexCount + " verts") : "none'") + ", materials [" + string.Join(" | ", list2.ToArray()) + "].")); } } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("[Scan] '" + ((Object)root).name + "': " + ex.Message)); } } private void Measure(Transform root, Transform walk) { //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_0732: Unknown result type (might be due to invalid IL or missing references) //IL_0737: Unknown result type (might be due to invalid IL or missing references) //IL_07a9: Unknown result type (might be due to invalid IL or missing references) //IL_07ae: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_09b6: Unknown result type (might be due to invalid IL or missing references) //IL_09bb: Unknown result type (might be due to invalid IL or missing references) //IL_09d2: Unknown result type (might be due to invalid IL or missing references) //IL_09e9: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_04d1: 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_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_04e6: Unknown result type (might be due to invalid IL or missing references) //IL_04f9: Unknown result type (might be due to invalid IL or missing references) //IL_04fe: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_054e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_056a: Unknown result type (might be due to invalid IL or missing references) //IL_0576: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Unknown result type (might be due to invalid IL or missing references) //IL_0592: Unknown result type (might be due to invalid IL or missing references) //IL_0597: Unknown result type (might be due to invalid IL or missing references) //IL_05a3: Unknown result type (might be due to invalid IL or missing references) //IL_05a8: Unknown result type (might be due to invalid IL or missing references) //IL_05ad: Unknown result type (might be due to invalid IL or missing references) //IL_05b1: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_042c: 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_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: 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_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_0ad1: Unknown result type (might be due to invalid IL or missing references) //IL_0ad6: Unknown result type (might be due to invalid IL or missing references) try { if (!_measured.Add(((Object)root).GetInstanceID())) { return; } ((BaseUnityPlugin)this).Logger.LogInfo((object)("[MastPlatforms] MEASURE '" + ((Object)root).name + "' - walk space '" + (((Object)(object)walk != (Object)null) ? ((Object)walk).name : "none") + "'.")); Transform[] componentsInChildren = ((Component)root).GetComponentsInChildren<Transform>(true); foreach (Transform val in componentsInChildren) { bool flag = (Object)(object)((Component)val).GetComponent<Mast>() != (Object)null; if (!flag && !((Object)val).name.ToUpperInvariant().StartsWith("MAST")) { continue; } Bounds val2 = default(Bounds); bool flag2 = false; Renderer[] componentsInChildren2 = ((Component)val).GetComponentsInChildren<Renderer>(true); foreach (Renderer val3 in componentsInChildren2) { if (!((Object)(object)val3 == (Object)null)) { if (!flag2) { val2 = val3.bounds; flag2 = true; } else { ((Bounds)(ref val2)).Encapsulate(val3.bounds); } } } string text = (flag2 ? (" bounds lo " + V(root.InverseTransformPoint(((Bounds)(ref val2)).min)) + " hi " + V(root.InverseTransformPoint(((Bounds)(ref val2)).max))) : " (no renderer)"); ((BaseUnityPlugin)this).Logger.LogInfo((object)("[MastPlatforms] mast " + (flag ? "[Mast] " : "") + "'" + PathOf(val, root) + "' at " + V(root.InverseTransformPoint(val.position)) + " active=" + ((Component)val).gameObject.activeInHierarchy + text)); } Transform[] array = (Transform[])(object)new Transform[2] { root, walk }; foreach (Transform val4 in array) { if ((Object)(object)val4 == (Object)null) { continue; } Collider[] componentsInChildren3 = ((Component)val4).GetComponentsInChildren<Collider>(true); foreach (Collider val5 in componentsInChildren3) { if ((Object)(object)val5 == (Object)null) { continue; } string text2 = PathOf(((Component)val5).transform, val4).ToUpperInvariant(); if (!((Component)val5).CompareTag("Ratlines") && !text2.Contains("RATLINE") && !text2.Contains("SHROUD")) { continue; } string name = ((object)val5).GetType().Name; string text3 = ""; MeshCollider val6 = (MeshCollider)(object)((val5 is MeshCollider) ? val5 : null); if ((Object)(object)val6 != (Object)null && (Object)(object)val6.sharedMesh != (Object)null && val6.sharedMesh.isReadable) { Vector3[] vertices = val6.sharedMesh.vertices; Vector3 v = Vector3.zero; Vector3 v2 = Vector3.zero; float num = float.MaxValue; float num2 = float.MinValue; float num3 = float.MaxValue; float num4 = float.MinValue; float num5 = float.MaxValue; float num6 = float.MinValue; Vector3[] array2 = vertices; foreach (Vector3 val7 in array2) { Vector3 val8 = val4.InverseTransformPoint(((Component)val5).transform.TransformPoint(val7)); if (val8.y < num) { num = val8.y; v = val8; } if (val8.y > num2) { num2 = val8.y; v2 = val8; } num5 = Mathf.Min(num5, val8.x); num6 = Mathf.Max(num6, val8.x); num3 = Mathf.Min(num3, val8.z); num4 = Mathf.Max(num4, val8.z); } text3 = " lowest " + V(v) + " highest " + V(v2) + " x " + num5.ToString("F2", CultureInfo.InvariantCulture) + ".." + num6.ToString("F2", CultureInfo.InvariantCulture) + " z " + num3.ToString("F2", CultureInfo.InvariantCulture) + ".." + num4.ToString("F2", CultureInfo.InvariantCulture) + " verts " + vertices.Length; } else { Bounds bounds = val5.bounds; text3 = " world-box lo " + V(val4.InverseTransformPoint(((Bounds)(ref bounds)).min)) + " hi " + V(val4.InverseTransformPoint(((Bounds)(ref bounds)).max)); BoxCollider val9 = (BoxCollider)(object)((val5 is BoxCollider) ? val5 : null); if ((Object)(object)val9 != (Object)null) { string[] obj = new string[7] { text3, " box centre ", V(val4.InverseTransformPoint(((Component)val9).transform.TransformPoint(val9.center))), " size ", V(Vector3.Scale(val9.size, ((Component)val9).transform.lossyScale)), " rot ", null }; Quaternion val10 = Quaternion.Inverse(val4.rotation) * ((Component)val9).transform.rotation; obj[6] = V(((Quaternion)(ref val10)).eulerAngles); text3 = string.Concat(obj); } } ((BaseUnityPlugin)this).Logger.LogInfo((object)("[MastPlatforms] ratlines " + name + " '" + PathOf(((Component)val5).transform, val4) + "' in " + (((Object)(object)val4 == (Object)(object)root) ? "ship" : "walk") + " space, tag=" + ((Component)val5).gameObject.tag + " layer=" + ((Component)val5).gameObject.layer + " trigger=" + val5.isTrigger + " enabled=" + val5.enabled + " active=" + ((Component)val5).gameObject.activeInHierarchy + text3)); } } GPButtonRatlines[] componentsInChildren4 = ((Component)root).GetComponentsInChildren<GPButtonRatlines>(true); foreach (GPButtonRatlines val11 in componentsInChildren4) { ((BaseUnityPlugin)this).Logger.LogInfo((object)("[MastPlatforms] click-to-climb '" + PathOf(((Component)val11).transform, root) + "' at " + V(root.InverseTransformPoint(((Component)val11).transform.position)) + " forward " + val11.forward.ToString("F2", CultureInfo.InvariantCulture) + " up " + val11.up.ToString("F2", CultureInfo.InvariantCulture) + (((Object)(object)val11.hardTeleportPos != (Object)null) ? (" teleports to " + V(root.InverseTransformPoint(val11.hardTeleportPos.position))) : " (climbs in place)") + " layer " + ((Component)val11).gameObject.layer + " tag " + ((Component)val11).gameObject.tag)); } BoatCustomParts component = ((Component)root).GetComponent<BoatCustomParts>(); if ((Object)(object)component != (Object)null) { for (int num7 = 0; num7 < component.availableParts.Count; num7++) { BoatPart val12 = component.availableParts[num7]; if (val12 == null || val12.partOptions == null) { continue; } List<string> list = new List<string>(); foreach (BoatPartOption partOption in val12.partOptions) { list.Add(((Object)(object)partOption != (Object)null) ? partOption.optionName : "null"); } ((BaseUnityPlugin)this).Logger.LogInfo((object)("[MastPlatforms] shipyard part " + num7 + " (category " + val12.category + ", active " + val12.activeOption + "): " + string.Join(" | ", list.ToArray()))); } } Transform[] componentsInChildren5 = ((Component)root).GetComponentsInChildren<Transform>(true); foreach (Transform val13 in componentsInChildren5) { if (!((Object)val13).name.StartsWith("CAE_BilgePumps")) { continue; } ((BaseUnityPlugin)this).Logger.LogInfo((object)("[MastPlatforms] bilge pump '" + PathOf(val13, root) + "' at " + V(root.InverseTransformPoint(val13.position)) + " (parent-local " + V(val13.localPosition) + " rot " + V(val13.localEulerAngles) + ")")); Transform[] componentsInChildren6 = ((Component)val13).GetComponentsInChildren<Transform>(true); foreach (Transform val14 in componentsInChildren6) { if ((Object)(object)((Component)val14).GetComponent<BilgePump>() != (Object)null || (Object)(object)((Component)val14).GetComponent<BoatPartOption>() != (Object)null) { ((BaseUnityPlugin)this).Logger.LogInfo((object)("[MastPlatforms] '" + PathOf(val14, val13) + "'" + (((Object)(object)((Component)val14).GetComponent<BilgePump>() != (Object)null) ? " [BilgePump]" : "") + (((Object)(object)((Component)val14).GetComponent<BoatPartOption>() != (Object)null) ? (" [option '" + ((Component)val14).GetComponent<BoatPartOption>().optionName + "']") : "") + " at " + V(root.InverseTransformPoint(val14.position)))); } } } ((BaseUnityPlugin)this).Logger.LogInfo((object)("[MastPlatforms] MEASURE '" + ((Object)root).name + "' done.")); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("[MastPlatforms] measure error: " + ex.Message)); } } internal static void InitOption(BoatPartOption opt) { opt.requires = new List<BoatPartOption>(); opt.requiresDisabled = new List<BoatPartOption>(); opt.childOptions = (GameObject[])(object)new GameObject[0]; } private static BoatPartOption FindOption(BoatCustomParts bcp, string optionName) { foreach (BoatPart availablePart in bcp.availableParts) { foreach (BoatPartOption partOption in availablePart.partOptions) { if ((Object)(object)partOption != (Object)null && partOption.optionName == optionName) { return partOption; } } } return null; } private void AddStayButtons(Transform model, Transform walk, StaySlide[] stays) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Expected O, but got Unknown //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: 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_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_0178: 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_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: 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_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Expected O, but got Unknown //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)model.Find("STAY_SLIDES") != (Object)null) { return; } GameObject val = new GameObject("STAY_SLIDES"); val.transform.SetParent(model, false); int btnLayer = FindButtonLayer(model.root); bool asTrigger = FindButtonTrigger(model.root); int num = 0; for (int i = 0; i < stays.Length; i++) { StaySlide staySlide = stays[i]; Transform val2 = null; Transform[] componentsInChildren = ((Component)model).GetComponentsInChildren<Transform>(true); foreach (Transform val3 in componentsInChildren) { if (((Object)val3).name == staySlide.name) { val2 = val3; break; } } if ((Object)(object)val2 == (Object)null) { continue; } MeshFilter componentInChildren = ((Component)val2).GetComponentInChildren<MeshFilter>(true); if ((Object)(object)componentInChildren == (Object)null || (Object)(object)componentInChildren.sharedMesh == (Object)null) { continue; } Bounds bounds = componentInChildren.sharedMesh.bounds; Vector3 val4 = Vector3.zero; Vector3 val5 = Vector3.zero; float num2 = float.MinValue; float num3 = float.MaxValue; for (int k = 0; k < 8; k++) { Vector3 val6 = ((Bounds)(ref bounds)).center + new Vector3((float)(((k & 1) != 0) ? 1 : (-1)) * ((Bounds)(ref bounds)).extents.x, (float)(((k & 2) != 0) ? 1 : (-1)) * ((Bounds)(ref bounds)).extents.y, (float)(((k & 4) != 0) ? 1 : (-1)) * ((Bounds)(ref bounds)).extents.z); Vector3 val7 = model.InverseTransformPoint(((Component)componentInChildren).transform.TransformPoint(val6)); float num4 = val7.y - val7.x; if (num4 > num2) { num2 = num4; val4 = val7; } if (num4 < num3) { num3 = num4; val5 = val7; } } Vector3 val8 = val4 - val5; if (((Vector3)(ref val8)).magnitude < 2f) { continue; } GameObject val9 = new GameObject("stay_deck_" + staySlide.name); val9.transform.SetParent(val.transform, false); val9.transform.localPosition = new Vector3(staySlide.deckX, DeckAt(walk, staySlide.deckKey, staySlide.deckX, staySlide.deckZ, val5.y + 3f), staySlide.deckZ); Transform val10 = null; Func<bool> preferAlt = null; if (staySlide.topKey != null) { Spot? spot = null; foreach (Spot item in ParseSpots()) { if (item.label == staySlide.topKey + "top") { spot = item; } } if (spot.HasValue) { GameObject val11 = new GameObject("stay_top_" + staySlide.name); val11.transform.SetParent(val.transform, false); val11.transform.localPosition = new Vector3(spot.Value.x - 0.2f, spot.Value.yTop, 0f); val10 = val11.transform; string k2 = staySlide.topKey; preferAlt = delegate { Transform val13 = model.Find("PLATFORMS_" + k2 + "_top"); Transform val14 = model.Find("PLATFORMS_" + k2 + "_full"); return ((Object)(object)val13 != (Object)null && ((Component)val13).gameObject.activeInHierarchy) || ((Object)(object)val14 != (Object)null && ((Component)val14).gameObject.activeInHierarchy); }; } } GameObject val12 = RopeRun(val.transform, "stay_slide", val4, val5, 0.03f, Rope); val12.AddComponent<FollowActive>().leader = ((Component)val2).gameObject; MakeClimbButton(val12, btnLayer, asTrigger, val9.transform, new Vector3(6f, 2f, 6f)); MastClimbButton component = val12.GetComponent<MastClimbButton>(); if ((Object)(object)component != (Object)null && (Object)(object)val10 != (Object)null) { component.standOnAlt = val10; component.preferAlt = preferAlt; } FollowActive component2 = val12.GetComponent<FollowActive>(); if ((Object)(object)component2 != (Object)null) { component2.self = true; } num++; } ((BaseUnityPlugin)this).Logger.LogInfo((object)("[MastPlatforms] stays: " + num + " of " + stays.Length + " made slideable on '" + ((Object)model.root).name + "'.")); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("[MastPlatforms] stays: " + ex.Message)); } } private void AddBilgePump(Transform root, Transform model, Transform walk, BoatCustomParts bcp) { //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_0237: 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_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Expected O, but got Unknown try { if ((Object)(object)model.Find("AE_BilgePumps") != (Object)null) { return; } BoatDamage component = ((Component)root).GetComponent<BoatDamage>(); if ((Object)(object)component == (Object)null) { ((BaseUnityPlugin)this).Logger.LogWarning((object)"[MastPlatforms] Aelasyl pump: no BoatDamage on her - not fitted."); return; } AssetBundle val = null; foreach (AssetBundle allLoadedAssetBundle in AssetBundle.GetAllLoadedAssetBundles()) { if ((Object)(object)allLoadedAssetBundle != (Object)null && allLoadedAssetBundle.Contains("Assets/Lilith/old_chronian/CAE_BilgePumps.prefab")) { val = allLoadedAssetBundle; break; } } if ((Object)(object)val == (Object)null) { ((BaseUnityPlugin)this).Logger.LogWarning((object)"[MastPlatforms] Aelasyl pump: the Old Chronian Fixes bundle with 'Assets/Lilith/old_chronian/CAE_BilgePumps.prefab' is not loaded - is Old Chronian Fixes installed? Not fitted."); return; } GameObject val2 = val.LoadAsset<GameObject>("Assets/Lilith/old_chronian/CAE_BilgePumps.prefab"); if ((Object)(object)val2 == (Object)null) { ((BaseUnityPlugin)this).Logger.LogWarning((object)"[MastPlatforms] Aelasyl pump: prefab not found in the bundle - not fitted."); return; } Spot? spot = null; foreach (Spot item in ParseSpots()) { if (item.label == "aemaintop") { spot = item; } } float num = (spot.HasValue ? spot.Value.mastX : (-3.03f)) - 1.3f; float num2 = 0.9f; float num3 = 4.6f; string text = "assumed"; Vector3 val3 = walk.TransformPoint(new Vector3(num, 40f, num2)); RaycastHit val4 = default(RaycastHit); if (Physics.Raycast(val3, -walk.up, ref val4, 60f, 1 << ((Component)walk).gameObject.layer, (QueryTriggerInteraction)1)) { num3 = walk.InverseTransformPoint(((RaycastHit)(ref val4)).point).y; text = "ray onto '" + ((Object)((RaycastHit)(ref val4)).collider).name + "'"; } GameObject val5 = Object.Instantiate<GameObject>(val2); ((Object)val5).name = "AE_BilgePumps"; val5.transform.SetParent(model, false); val5.transform.localPosition = new Vector3(num, num3 - 0.064f, num2); BilgePump componentInChildren = val5.GetComponentInChildren<BilgePump>(true); val5.transform.localRotation = StandUp(val5.transform, model, ((Object)(object)componentInChildren != (Object)null) ? ((Component)componentInChildren).transform : null, out var how); ((BaseUnityPlugin)this).Logger.LogInfo((object)("[MastPlatforms] Aelasyl pump stood up: " + how)); BilgePump componentInChildren2 = val5.GetComponentInChildren<BilgePump>(true); if ((Object)(object)componentInChildren2 != (Object)null) { componentInChildren2.damage = component; } else { ((BaseUnityPlugin)this).Logger.LogWarning((object)"[MastPlatforms] Aelasyl pump: no BilgePump script in the prefab - the handle will not pump."); } List<BoatPartOption> list = new List<BoatPartOption>(val5.GetComponentsInChildren<BoatPartOption>(true)); if (list.Count > 0) { bcp.availableParts.Add(new BoatPart { activeOption = 1, category = 1, partOptions = list }); List<string> list2 = new List<string>(); foreach (BoatPartOption item2 in list) { list2.Add(item2.optionName); } ((BaseUnityPlugin)this).Logger.LogInfo((object)("[MastPlatforms] Aelasyl pump fitted at (" + num.ToString("F2", CultureInfo.InvariantCulture) + ", " + num3.ToString("F2", CultureInfo.InvariantCulture) + ", " + num2.ToString("F2", CultureInfo.InvariantCulture) + ") - deck by " + text + "; shipyard options: " + string.Join(" | ", list2.ToArray()) + ".")); } else { ((BaseUnityPlugin)this).Logger.LogWarning((object)"[MastPlatforms] Aelasyl pump: the prefab carries no BoatPartOption - fitted but not in the shipyard."); } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("[MastPlatforms] Aelasyl pump: " + ex.Message)); } } private static Spot OnCap(Transform walk, Spot top, string mastColliderName, out string how) { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_0154: 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_016d: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) MeshCollider val = null; MeshCollider[] componentsInChildren = ((Component)walk).GetComponentsInChildren<MeshCollider>(true); foreach (MeshCollider val2 in componentsInChildren) { if ((Object)(object)val2 != (Object)null && ((Object)val2).name == mastColliderName) { val = val2; break; } } if ((Object)(object)val == (Object)null) { how = "no '" + mastColliderName + "' collider in walk space - at the table's height " + top.yTop.ToString("F2", CultureInfo.InvariantCulture) + "."; return top; } Physics.SyncTransforms(); float num = float.MinValue; Vector3 val3 = Vector3.zero; for (float num2 = top.mastX - 1.6f; num2 <= top.mastX + 1.6f; num2 += 0.1f) { for (float num3 = -0.7f; num3 <= 0.7f; num3 += 0.1f) { Vector3 val4 = walk.TransformPoint(new Vector3(num2, top.yTop + 8f, num3)); RaycastHit[] array = Physics.RaycastAll(val4, -walk.up, 14f, 1 << ((Component)walk).gameObject.layer, (QueryTriggerInteraction)1); for (int j = 0; j < array.Length; j++) { RaycastHit val5 = array[j]; if (!((Object)(object)((RaycastHit)(ref val5)).collider != (Object)(object)val)) { Vector3 val6 = walk.InverseTransformPoint(((RaycastHit)(ref val5)).point); if (val6.y > num) { num = val6.y; val3 = val6; } } } } } if (num == float.MinValue || num < top.yTop - 0.5f) { how = "cap not found above the table (" + ((num == float.MinValue) ? "no hit" : ("highest hit y " + num.ToString("F2", CultureInfo.InvariantCulture))) + ") - at the table's height " + top.yTop.ToString("F2", CultureInfo.InvariantCulture) + "."; return top; } float yTop = top.yTop; top.yTop = num + 0.03f; top.mastX = val3.x; top.x = val3.x + 0.4f; top.sx = Mathf.Min(top.sx, 2.7f); how = "on her lower mast cap at (" + val3.x.ToString("F2", CultureInfo.InvariantCulture) + ", " + num.ToString("F2", CultureInfo.InvariantCulture) + ", " + val3.z.ToString("F2", CultureInfo.InvariantCulture) + ") - top at y " + top.yTop.ToString("F2", CultureInfo.InvariantCulture) + " (table said " + yTop.ToString("F2", CultureInfo.InvariantCulture) + "), centred x " + top.x.ToString("F2", CultureInfo.InvariantCulture) + "."; return top; } private static Quaternion StandUp(Transform thing, Transform model, Transform handle, out string how) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: 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_0187: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) Quaternion[] array = (Quaternion[])(object)new Quaternion[6] { Quaternion.Euler(0f, 0f, 90f), Quaternion.identity, Quaternion.Euler(-90f, 0f, 0f), Quaternion.Euler(90f, 0f, 0f), Quaternion.Euler(0f, 0f, -90f), Quaternion.Euler(180f, 0f, 0f) }; MeshFilter[] componentsInChildren = ((Component)thing).GetComponentsInChildren<MeshFilter>(true); Quaternion val = array[0]; float num = float.MinValue; float num2 = -1f; float num3 = 0f; Vector3 val2 = Vector3.zero; Vector3 val3 = Vector3.zero; Quaternion[] array2 = array; Vector3 val6 = default(Vector3); Vector3 val9 = default(Vector3); for (int i = 0; i < array2.Length; i++) { Quaternion val4 = (thing.localRotation = array2[i]); ((Vector3)(ref val6))..ctor(float.MaxValue, float.MaxValue, float.MaxValue); Vector3 val7 = -val6; MeshFilter[] array3 = componentsInChildren; foreach (MeshFilter val8 in array3) { if (!((Object)(object)val8 == (Object)null) && !((Object)(object)val8.sharedMesh == (Object)null)) { Bounds bounds = val8.sharedMesh.bounds; for (int k = 0; k < 8; k++) { ((Vector3)(ref val9))..ctor(((k & 1) == 0) ? ((Bounds)(ref bounds)).min.x : ((Bounds)(ref bounds)).max.x, ((k & 2) == 0) ? ((Bounds)(ref bounds)).min.y : ((Bounds)(ref bounds)).max.y, ((k & 4) == 0) ? ((Bounds)(ref bounds)).min.z : ((Bounds)(ref bounds)).max.z); Vector3 val10 = model.InverseTransformPoint(((Component)val8).transform.TransformPoint(val9)) - thing.localPosition; val6 = Vector3.Min(val6, val10); val7 = Vector3.Max(val7, val10); } } } if (!(val7.y < val6.y)) { float num4 = val7.y - val6.y; float num5 = (((Object)(object)handle != (Object)null) ? (model.InverseTransformPoint(handle.position).y - thing.localPosition.y) : ((val7.y + val6.y) / 2f)); float num6 = num4 + ((num5 > 0f) ? 10f : 0f) + num5 * 0.01f; if (num6 > num) { num = num6; num2 = num4; val = val4; val2 = val6; val3 = val7; num3 = num5; } } } if (val == Quaternion.Euler(-90f, 0f, 0f)) { val = Quaternion.Euler(0f, 90f, 0f) * val; } string[] obj = new string[15] { "rotation ", null, null, null, null, null, null, null, null, null, null, null, null, null, null }; Vector3 eulerAngles = ((Quaternion)(ref val)).eulerAngles; obj[1] = ((Vector3)(ref eulerAngles)).ToString("F0"); obj[2] = ", "; obj[3] = num2.ToString("F2", CultureInfo.InvariantCulture); obj[4] = " m end to end, foot at "; obj[5] = val2.y.ToString("F2", CultureInfo.InvariantCulture); obj[6] = " m, handle at "; obj[7] = num3.ToString("F2", CultureInfo.InvariantCulture); obj[8] = " m, footprint "; obj[9] = (val3.x - val2.x).ToString("F2", CultureInfo.InvariantCulture); obj[10] = " x "; obj[11] = (val3.z - val2.z).ToString("F2", CultureInfo.InvariantCulture); obj[12] = " m"; obj[13] = ((num2 < 0f) ? " (no mesh read - left as the prefab is)" : ""); obj[14] = "."; how = string.Concat(obj); return val; } private void RegisterMastPart(BoatCustomParts bcp, Transform model, Transform walk, string key, string Cap, string mastMainName, string mastTopName, string ratlineName) { //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Expected O, but got Unknown //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Expected O, but got Unknown //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Expected O, but got Unknown //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Expected O, but got Unknown //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Expected O, but got Unknown //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Expected O, but got Unknown _walkForZones = walk; BoatPartOption val = FindOption(bcp, mastMainName); BoatPartOption val2 = FindOption(bcp, mastTopName); Spot? spot = null; Spot? cross = null; foreach (Spot item in ParseSpots()) { if (item.label == key + "top") { spot = item; } if (item.label == key + "cross") { cross = item; } } if (!spot.HasValue || !cross.HasValue) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("[MastPlatforms] spots missing for '" + key + "'.")); return; } if (key == "aemizen") { string how; Spot value = OnCap(walk, spot.Value, "MAST MIZEN MAIN", out how); spot = value; ((BaseUnityPlugin)this).Logger.LogInfo((object)("[MastPlatforms] mizen top: " + how)); } ShroudRopes(model, key, ratlineName, out var _, out var _); GameObject val3 = new GameObject("PLATFORMS_" + key + "_none"); val3.transform.SetParent(model, false); BoatPartOption val4 = val3.AddComponent<BoatPartOption>(); InitOption(val4); val4.optionName = "(No " + Cap + " Platforms)"; val4.basePrice = 0; val4.installCost = 0; val4.mass = 0; val4.walkColObject = val3; GameObject topVis = new GameObject("PLATFORMS_" + key + "_top"); topVis.transform.SetParent(model, false); BuildVisual(topVis.transform, spot.Value); GameObject val5 = new GameObject("WALK PLATFORMS_" + key + "_top"); val5.transform.SetParent(walk, false); val5.layer = ((Component)walk).gameObject.layer; val5.AddComponent<MastPlatformGuard>(); BuildPlates(val5.transform, ((Component)walk).gameObject.layer, spot.Value); try { AddClimbZones(topVis.transform, ((Component)bcp).transform, spot.Value, null); } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("[MastPlatforms] climb zones (top) failed: " + ex.Message)); } BoatPartOption val6 = topVis.AddComponent<BoatPartOption>(); InitOption(val6); val6.optionName = Cap + " Fighting Top"; val6.basePrice = 140; val6.installCost = 40; val6.mass = 45; val6.walkColObject = val5; if ((Object)(object)val != (Object)null) { val6.requires.Add(val); } GameObject fullVis = new GameObject("PLATFORMS_" + key + "_full"); fullVis.transform.SetParent(model, false); BuildVisual(fullVis.transform, spot.Value); BuildVisual(fullVis.transform, cross.Value); GameObject val7 = new GameObject("WALK PLATFORMS_" + key + "_full"); val7.transform.SetParent(walk, false); val7.layer = ((Component)walk).gameObject.layer; val7.AddComponent<MastPlatformGuard>(); BuildPlates(val7.transform, ((Component)walk).gameObject.layer, spot.Value); BuildPlates(val7.transform, ((Component)walk).gameObject.layer, cross.Value); BuildConnectorPlates(val7.transform, ((Component)walk).gameObject.layer, spot.Value, cross.Value); BuildConnectorVisual(fullVis.transform, spot.Value, cross.Value); try { AddClimbZones(fullVis.transform, ((Component)bcp).transform, spot.Value, cross); } catch (Exception ex2) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("[MastPlatforms] climb zones (full) failed: " + ex2.Message)); } BoatPartOption val8 = fullVis.AddComponent<BoatPartOption>(); InitOption(val8); val8.optionName = Cap + " Fighting Top + Lookout Post"; val8.basePrice = 220; val8.installCost = 60; val8.mass = 60; val8.walkColObject = val7; if ((Object)(object)val != (Object)null) { val8.requires.Add(val); } if ((Object)(object)val2 != (Object)null) { val8.requires.Add(val2); } BoatPart val9 = new BoatPart(); val9.category = 0; val9.activeOption = 0; val9.partOptions = new List<BoatPartOption> { val4, val6, val8 }; bcp.availableParts.Add(val9); topVis.SetActive(false); val5.SetActive(false); fullVis.SetActive(false); val7.SetActive(false); try { Transform ratlinePart = null; Transform[] componentsInChildren = ((Component)model).GetComponentsInChildren<Transform>(true); foreach (Transform val10 in componentsInChildren) { if (((Object)val10).name == ratlineName) { ratlinePart = val10; break; } } BuildLowerRatlines(model, walk, key, spot.Value, () => topVis.activeInHierarchy || fullVis.activeInHierarchy, ratlinePart, ratlineName); } catch (Exception ex3) { ((BaseUnityPlugin)this).Logger.LogWarning((object)("[MastPlatforms] lower ratlines (" + key + ") failed: " + ex3.Message)); } } internal static float DeckAt(Transform walk, string key, float x, float z, float fromY) { //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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) float result = 0.05f; if (Shrouds.TryGetValue(key, out var value)) { result = value.deckWalk; } try { Physics.SyncTransforms(); Vector3 val = walk.TransformPoint(new Vector3(x, fromY, z)); float num = float.NaN; RaycastHit[] array = Physics.RaycastAll(val, -walk.up, fromY + 5f, 1 << ((Component)walk).gameObject.layer, (QueryTriggerInteraction)1); for (int i = 0; i < array.Length; i++) { RaycastHit val2 = array[i]; string text = ((Object)((RaycastHit)(ref val2)).collider).name.ToUpperInvariant(); if (!text.Contains("RATLINE") && !text.Contains("SHROUD") && !text.Contains("PLATFORM") && !text.Contains("TOPSHROUD")) { float y = walk.InverseTransformPoint(((RaycastHit)(ref val2)).point).y; if (float.IsNaN(num) || y > num) { num = y; } } } if (!float.IsNaN(num)) { return num; } } catch { } return result; } private void BuildLowerRatlines(Transform model, Transform walk, string key, Spot top, Func<bool> topFitted, Transform ratlinePart, string ratlineName) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0540: 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_0549: Unknown result type (might be due to invalid IL or missing references) //IL_0570: Unknown result type (might be due to invalid IL or missing references) //IL_045a: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: 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_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_0814: Unknown result type (might be due to invalid IL or missing references) //IL_0819: 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_0820: Unknown result type (might be due to invalid IL or missing references) //IL_0838: Unknown result type (might be due to invalid IL or missing references) //IL_083d: Unknown result type (might be due to invalid IL or missing references) //IL_0842: Unknown result type (might be due to invalid IL or missing references) //IL_0847: Unknown result type (might be due to invalid IL or missing references) //IL_0849: Unknown result type (might be due to invalid IL or missing references) //IL_084e: Unknown result type (might be due to invalid IL or missing references) //IL_0853: Unknown result type (might be due to invalid IL or missing references) //IL_0858: Unknown result type (might be due to invalid IL or missing references) //IL_08d3: Unknown result type (might be due to invalid IL or missing references) //IL_08e3: Unknown result type (might be due to invalid IL or missing references) //IL_0877: Unknown result type (might be due to invalid IL or missing references) //IL_0881: Unknown result type (might be due to invalid IL or missing references) //IL_088e: Unknown result type (might be due to invalid IL or missing references) //IL_0898: Unknown result type (might be due to invalid IL or missing references) //IL_09a3: Unknown result type (might be due to invalid IL or missing references) //IL_09ae: Unknown result type (might be due to invalid IL or missing references) //IL_09b5: Unknown result type (might be due to invalid IL or missing references) //IL_09ba: Unknown result type (might be due to invalid IL or missing references) //IL_09c0: Unknown result type (might be due to invalid IL or missing references) //IL_09cb: Unknown result type (might be due to invalid IL or missing references) //IL_09d2: Unknown result type (might be due to invalid IL or missing references) //IL_09d7: Unknown result type (might be due to invalid IL or missing references) //IL_09ea: Unknown result type (might be due to invalid IL or missing references) //IL_09f3: Unknown result type (might be due to invalid IL or missing references) //IL_09fa: Unknown result type (might be due to invalid IL or missing references) //IL_0a42: Unknown result type (might be due to invalid IL or missing references) //IL_0a44: Unknown result type (might be due to invalid IL or missing references) //IL_0a4b: Unknown result type (might be due to invalid IL or missing references) //IL_0a0c: Unknown result type (might be due to invalid IL or missing references) //IL_0a0e: Unknown result type (might be due to invalid IL or missing references) //IL_0a18: Unknown result type (might be due to invalid IL or missing references) //IL_0a20: Unknown result type (might be due to invalid IL or missing references) //IL_0a27: Unknown result type (might be due to invalid IL or missing references) //IL_0a30: Unknown result type (might be due to invalid IL or missing references) //IL_0a35: Unknown result type (might be due to invalid IL or missing references) //IL_0ac9: Unknown result type (might be due to invalid IL or missing references) //IL_0ad0: Expected O, but got Unknown //IL_0af8: Unknown result type (might be due to invalid IL or missing references) //IL_0afa: Unknown result type (might be due to invalid IL or missing references) //IL_0afc: Unknown result type (might be due to invalid IL or missing references) //IL_0b01: Unknown result type (might be due to invalid IL or missing references) //IL_0b0a: Unknown result type (might be due to invalid IL or missing references) //IL_0b0c: Unknown result type (might be due to invalid IL or missing references) //IL_0b0e: Unknown result type (might be due to invalid IL or missing references) //IL_0b18: Unknown result type (might be due to invalid IL or missing references) //IL_0b2a: Unknown result type (might be due to invalid IL or missing references) //IL_0b31: Unknown result type (might be due to invalid IL or missing references) //IL_0b36: Unknown result type (might be due to invalid IL or missing references) //IL_0b59: Unknown result type (might be due to invalid IL or missing references) //IL_0a71: Unknown result type (might be due to invalid IL or missing references) //IL_0a78: Expected O, but got Unknown if (!Shrouds.TryGetValue(key, out var value)) { return; } GameObject val = new GameObject("LOWER_RATLINES_" + key); val.transform.SetParent(model, false); if ((Object)(object)ratlinePart != (Object)null) { val.AddComponent<FollowActive>().leader = ((Component)ratlinePart).gameObject; } GameObject val2 = new GameObject("climbtarget_top"); val2.transform.SetParent(val.transform, false); val2.transform.localPosition = new Vector3(top.x - 0.2f, top.yTop, 0f); int btnLayer = FindButtonLayer(model.root); bool asTrigger = FindButtonTrigger(model.root); string fanFrom; int pieces; Dictionary<int, List<Vector3[]>> dictionary = ShroudRopes(model, key, ratlineName, out fanFrom, out pieces); foreach (KeyValuePair<int, List<Vector3[]>> item in dictionary) { List<string> list = new List<string>(); foreach (Vector3[] item2 in item.Value) { list.Add("foot (" + item2[0].x.ToString("F2", CultureInfo.InvariantCulture) + ", " + item2[0].y.ToString("F1", CultureInfo.InvariantCulture) + ", " + item2[0].z.ToString("F2", CultureInfo.InvariantCulture) + ") head (" + item2[1].x.ToString("F2", CultureInfo.InvariantCulture) + ", " + item2[1].y.ToString("F1", CultureInfo.InvariantCulture) + ", " + item2[1].z.ToString("F2", CultureInfo.InvariantCulture) + ")"); } ((BaseUnityPlugin)this).Logger.LogInfo((object)("[MastPlatforms] lower shrouds '" + key + "' " + ((item.Key < 0) ? "port" : "stbd") + ": " + item.Value.Count + " ropes - " + string.Join("; ", list.ToArray()))); } List<float> list2 = new List<float>(); for (float num = top.yTop - 0.55f; num > value.deckY + 0.45f; num -= 0.42f) { list2.Add(num); } int num2 = 0; Dictionary<int, float> dictionary2 = new Dictionary<int, float> { { -1, float.MaxValue }, { 1, float.MaxValue } }; Vector3 a = default(Vector3); Vector3 b = default(Vector3); for (int i = 0; i < list2.Count; i++) { float num3 = list2[i]; float num4 = Mathf.Clamp01((num3 - value.deckY) / (value.topY - value.deckY)); float num5 = Mathf.Lerp(value.deckZ, value.topZ, num4); float num6 = Mathf.Lerp(value.deckX0, value.topX - 0.15f, num4); float num7 = Mathf.Lerp(value.deckX1, value.topX + 0.15f, num4); for (int j = -1; j <= 1; j += 2) { ((Vector3)(ref a))..ctor(num6, num3, (float)j * num5); ((Ve