Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of KnotLog v1.0.0
plugins/KnotLog.dll
Decompiled a week ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using KnotLog.Audio; using KnotLog.Core; using KnotLog.Dev; using KnotLog.Gameplay; using KnotLog.Net; using KnotLog.UI; using KnotLog.Visual; using KnotLog.Visual.Anim; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.Audio; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("assembly_utils")] [assembly: IgnoresAccessChecksTo("assembly_valheim")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [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 KnotLog { public static class Cfg { public static ConfigEntry<float> GlassSeconds; public static ConfigEntry<float> ShortGlassSeconds; public static ConfigEntry<float> LineMarkedForSeconds; public static ConfigEntry<float> LineLength; public static ConfigEntry<float> StrayLength; public static ConfigEntry<float> HaulSpeed; public static ConfigEntry<string> ChipLogRecipe; public static ConfigEntry<string> ChipLogStation; public static ConfigEntry<int> ChipLogStationLevel; public static ConfigEntry<string> PatentLogRecipe; public static ConfigEntry<string> PatentLogStation; public static ConfigEntry<int> PatentLogStationLevel; public static ConfigEntry<float> RotorPitch; public static ConfigEntry<float> RotorSlip; public static ConfigEntry<float> RotorStartSpeed; public static ConfigEntry<float> PatentLineLength; public static ConfigEntry<CountingMode> Counting; public static ConfigEntry<KeyCode> LogKey; public static ConfigEntry<KeyCode> CountKey; public static ConfigEntry<KeyCode> GlassKey; public static ConfigEntry<bool> ShowExactReading; public static ConfigEntry<bool> ShowMetric; public static ConfigEntry<float> ResultSeconds; public static ConfigEntry<float> ResultRecallSeconds; public static ConfigEntry<float> HudScale; public static ConfigEntry<Vector2> HudOffset; public static ConfigEntry<bool> ProceduralAnimation; public static ConfigEntry<float> SfxVolume; public static ConfigEntry<bool> SpeakCalls; public static ConfigEntry<int> LogbookSize; public static float SpacingMeters => (float)LogMath.KnotSpacing(LineMarkedForSeconds.Value); public static void Bind(ConfigFile c) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Expected O, but got Unknown //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Expected O, but got Unknown //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Expected O, but got Unknown //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Expected O, but got Unknown //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Expected O, but got Unknown //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Expected O, but got Unknown //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Expected O, but got Unknown //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Expected O, but got Unknown //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Expected O, but got Unknown //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Expected O, but got Unknown //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Expected O, but got Unknown //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Expected O, but got Unknown //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Expected O, but got Unknown //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Expected O, but got Unknown //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Expected O, but got Unknown //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Expected O, but got Unknown //IL_04be: Unknown result type (might be due to invalid IL or missing references) //IL_04c3: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Expected O, but got Unknown //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Expected O, but got Unknown //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Expected O, but got Unknown //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_05b5: Unknown result type (might be due to invalid IL or missing references) //IL_05bf: Expected O, but got Unknown //IL_05fd: Unknown result type (might be due to invalid IL or missing references) //IL_0607: Expected O, but got Unknown ConfigurationManagerAttributes val = new ConfigurationManagerAttributes { IsAdminOnly = true }; GlassSeconds = c.Bind<float>("1 - Chip log", "GlassSeconds", 28f, new ConfigDescription("Running time of the (long) sandglass in seconds. Historical: 28 s.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 120f), new object[1] { val })); ShortGlassSeconds = c.Bind<float>("1 - Chip log", "ShortGlassSeconds", 14f, new ConfigDescription("Running time of the short glass, used at high speed (every knot then counts double). Historical: 14 s.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(3f, 60f), new object[1] { val })); LineMarkedForSeconds = c.Bind<float>("1 - Chip log", "LineMarkedForSeconds", 28f, new ConfigDescription("The glass the knots on the line are spaced for. Knot spacing = this × 1852 m / 3600 s (28 s → 14.40 m, the historical 47 ft 3 in). Leave it equal to GlassSeconds for the real thing.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 120f), new object[1] { val })); LineLength = c.Bind<float>("1 - Chip log", "LineLength", 300f, new ConfigDescription("Meters of line on the reel. Historical reels held about 150 fathoms (≈ 275 m).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(50f, 1000f), new object[1] { val })); StrayLength = c.Bind<float>("1 - Chip log", "StrayLength", 10f, new ConfigDescription("Unmarked stray line (meters) that lets the chip clear the wake before the glass is turned.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 50f), new object[1] { val })); HaulSpeed = c.Bind<float>("1 - Chip log", "HaulSpeed", 14f, new ConfigDescription("How fast the line is reeled back in (m/s). Pure quality of life.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(2f, 60f), new object[1] { val })); ChipLogRecipe = c.Bind<string>("1 - Chip log", "Recipe", "Wood:6,LeatherScraps:4,Resin:4", new ConfigDescription("Crafting cost, comma separated Prefab:Amount pairs. Needs a restart.", (AcceptableValueBase)null, new object[1] { val })); ChipLogStation = c.Bind<string>("1 - Chip log", "CraftingStation", "piece_workbench", new ConfigDescription("Internal name of the crafting station. Needs a restart.", (AcceptableValueBase)null, new object[1] { val })); ChipLogStationLevel = c.Bind<int>("1 - Chip log", "CraftingStationLevel", 1, new ConfigDescription("Required station level. Needs a restart.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), new object[1] { val })); PatentLogRecipe = c.Bind<string>("2 - Patent log", "Recipe", "Bronze:4,BronzeNails:10,FineWood:2,LeatherScraps:6", new ConfigDescription("Crafting cost of the patent (taffrail) log. Needs a restart.", (AcceptableValueBase)null, new object[1] { val })); PatentLogStation = c.Bind<string>("2 - Patent log", "CraftingStation", "forge", new ConfigDescription("Internal name of the crafting station. Needs a restart.", (AcceptableValueBase)null, new object[1] { val })); PatentLogStationLevel = c.Bind<int>("2 - Patent log", "CraftingStationLevel", 2, new ConfigDescription("Required station level. Needs a restart.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), new object[1] { val })); RotorPitch = c.Bind<float>("2 - Patent log", "RotorPitch", 0.9f, new ConfigDescription("Meters the rotor travels through the water per revolution.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.2f, 5f), new object[1] { val })); RotorSlip = c.Bind<float>("2 - Patent log", "RotorSlip", 0.04f, new ConfigDescription("Fraction the rotor slips in the water (the register is calibrated for it).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 0.3f), new object[1] { val })); RotorStartSpeed = c.Bind<float>("2 - Patent log", "RotorStartSpeed", 0.35f, new ConfigDescription("Below this speed (m/s) the rotor does not turn at all, like a real patent log.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 3f), new object[1] { val })); PatentLineLength = c.Bind<float>("2 - Patent log", "LineLength", 22f, new ConfigDescription("Length of the towing line of the rotor (meters).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(5f, 60f), new object[1] { val })); Counting = c.Bind<CountingMode>("3 - Client", "CountingMode", CountingMode.Automatic, "Automatic: knots are counted for you as they run through your hand. Manual: press the count key for every knot you feel – the reading uses YOUR count."); LogKey = c.Bind<KeyCode>("3 - Client", "HeaveKey", (KeyCode)108, "Heave the chip log (or stream/haul the patent log) while aboard. Using the item from the hotbar does the same."); CountKey = c.Bind<KeyCode>("3 - Client", "CountKey", (KeyCode)107, "Manual counting mode: press for every knot running through your hand. Otherwise it shows the last reading again (see ResultRecallSeconds)."); GlassKey = c.Bind<KeyCode>("3 - Client", "SwitchGlassKey", (KeyCode)106, "Switch between the long (28 s) and the short (14 s) glass before heaving."); ShowExactReading = c.Bind<bool>("3 - Client", "ShowExactReading", true, "Also show the exact reading (one decimal) next to the called quarter-knot reading."); ShowMetric = c.Bind<bool>("3 - Client", "ShowMetric", true, "Show m/s and km/h next to knots."); ResultSeconds = c.Bind<float>("3 - Client", "ResultSeconds", 15f, new ConfigDescription("How long the reading stays on screen before it slowly fades.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(2f, 120f), Array.Empty<object>())); ResultRecallSeconds = c.Bind<float>("3 - Client", "ResultRecallSeconds", 5f, new ConfigDescription("Pressing the count key while the reading fades (or later, while no measurement runs) brings it back for this long.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(2f, 120f), Array.Empty<object>())); ConfigEntry<int> val2 = c.Bind<int>("9 - Internal", "ConfigVersion", 1, new ConfigDescription("Used by the mod to update old defaults. Do not change.", (AcceptableValueBase)null, new object[1] { (object)new ConfigurationManagerAttributes { Browsable = false } })); if (val2.Value < 2) { if (Mathf.Approximately(ResultSeconds.Value, 12f)) { ResultSeconds.Value = 15f; } val2.Value = 2; } HudScale = c.Bind<float>("3 - Client", "HudScale", 1f, new ConfigDescription("Scale of the log panel and the patent log dial.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0.5f, 2f), Array.Empty<object>())); HudOffset = c.Bind<Vector2>("3 - Client", "HudOffset", new Vector2(0f, 0f), "Offset (pixels) of the log panel from its default place on the right side of the screen."); ProceduralAnimation = c.Bind<bool>("3 - Client", "ArmAnimation", true, "Animate the arms while throwing, holding and hauling the line."); SfxVolume = c.Bind<float>("3 - Client", "SoundVolume", 1f, new ConfigDescription("Volume of the mod's sounds (on top of the game's SFX volume).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 2f), Array.Empty<object>())); SpeakCalls = c.Bind<bool>("3 - Client", "SpeakCalls", true, "Show the logger's calls (\"Turn!\", \"Stop!\") as a speech bubble above your head."); LogbookSize = c.Bind<int>("3 - Client", "LogbookSize", 5, new ConfigDescription("Number of readings shown in the logbook.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 12), Array.Empty<object>())); } } public static class Items { public const string ChipLogPrefab = "KnotLog_ChipLog"; public const string PatentLogPrefab = "KnotLog_PatentLog"; public const string ChipLogToken = "$item_knotlog_chiplog"; public const string PatentLogToken = "$item_knotlog_patentlog"; private const string BasePrefab = "BronzeNails"; public static Sprite ChipLogIcon { get; private set; } public static Sprite PatentLogIcon { get; private set; } public static void Init() { PrefabManager.OnVanillaPrefabsAvailable += AddItems; } private static void AddItems() { try { Mats.Init(); ChipLogIcon = AddItem("KnotLog_ChipLog", "$item_knotlog_chiplog", 2.5f, Props.CreateChipLogBundle, "icon_chiplog.png", Cfg.ChipLogRecipe.Value, Cfg.ChipLogStation.Value, Cfg.ChipLogStationLevel.Value); PatentLogIcon = AddItem("KnotLog_PatentLog", "$item_knotlog_patentlog", 4f, Props.CreatePatentLogBundle, "icon_patentlog.png", Cfg.PatentLogRecipe.Value, Cfg.PatentLogStation.Value, Cfg.PatentLogStationLevel.Value); } catch (Exception ex) { KnotLogPlugin.Log.LogError((object)("Could not register items: " + ex)); } finally { PrefabManager.OnVanillaPrefabsAvailable -= AddItems; } } private static Sprite AddItem(string prefabName, string token, float weight, Func<GameObject> buildVisual, string fallbackIcon, string recipe, string station, int stationLevel) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_0114: Unknown result type (might be due to invalid IL or missing references) ItemConfig val = new ItemConfig { Name = token, Description = token + "_desc", CraftingStation = station, MinStationLevel = Math.Max(1, stationLevel), Amount = 1, Weight = weight, StackSize = 1 }; foreach (RequirementConfig item in ParseRecipe(recipe, prefabName)) { val.AddRequirement(item); } GameObject val2 = buildVisual(); Sprite val3 = RenderIcon(val2); if ((Object)(object)val3 == (Object)null) { val3 = LoadIcon(fallbackIcon); } val.Icon = val3; CustomItem val4 = new CustomItem(prefabName, "BronzeNails", val); if ((Object)(object)val4.ItemPrefab == (Object)null) { Object.Destroy((Object)(object)val2); KnotLogPlugin.Log.LogError((object)("Cloning BronzeNails for " + prefabName + " failed.")); return val3; } Reskin(val4.ItemPrefab, val2); AddFloating(val4.ItemPrefab); SharedData shared = val4.ItemDrop.m_itemData.m_shared; shared.m_itemType = (ItemType)16; shared.m_maxStackSize = 1; shared.m_maxQuality = 1; shared.m_useDurability = false; shared.m_teleportable = true; shared.m_value = 0; shared.m_questItem = false; if ((Object)(object)val3 != (Object)null) { shared.m_icons = (Sprite[])(object)new Sprite[1] { val3 }; } ItemManager.Instance.AddItem(val4); return val3; } private static void Reskin(GameObject prefab, GameObject visual) { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) Transform transform = prefab.transform; for (int num = transform.childCount - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)((Component)transform.GetChild(num)).gameObject); } Collider[] components = prefab.GetComponents<Collider>(); for (int i = 0; i < components.Length; i++) { Object.DestroyImmediate((Object)(object)components[i]); } MeshRenderer component = prefab.GetComponent<MeshRenderer>(); if ((Object)(object)component != (Object)null) { Object.DestroyImmediate((Object)(object)component); } MeshFilter component2 = prefab.GetComponent<MeshFilter>(); if ((Object)(object)component2 != (Object)null) { Object.DestroyImmediate((Object)(object)component2); } ((Object)visual).name = "model"; visual.transform.SetParent(transform, false); visual.transform.localPosition = Vector3.zero; visual.transform.localRotation = Quaternion.identity; Bounds val = LocalBounds(transform, visual); BoxCollider obj = prefab.AddComponent<BoxCollider>(); obj.center = ((Bounds)(ref val)).center; obj.size = Vector3.Max(((Bounds)(ref val)).size, new Vector3(0.12f, 0.08f, 0.12f)); SetLayer(visual, prefab.layer); } private static void AddFloating(GameObject prefab) { Floating val = prefab.GetComponent<Floating>(); if ((Object)(object)val == (Object)null) { val = prefab.AddComponent<Floating>(); } val.m_waterLevelOffset = 0.15f; val.m_forceDistance = 0.5f; val.m_force = 0.5f; val.m_balanceForceFraction = 0.02f; val.m_damping = 0.05f; } private static Bounds LocalBounds(Transform root, GameObject visual) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) MeshFilter[] componentsInChildren = visual.GetComponentsInChildren<MeshFilter>(true); bool flag = false; Bounds result = default(Bounds); ((Bounds)(ref result))..ctor(Vector3.zero, Vector3.zero); MeshFilter[] array = componentsInChildren; foreach (MeshFilter val in array) { if ((Object)(object)val.sharedMesh == (Object)null) { continue; } Bounds bounds = val.sharedMesh.bounds; Matrix4x4 val2 = root.worldToLocalMatrix * ((Component)val).transform.localToWorldMatrix; for (int j = 0; j < 8; j++) { Vector3 val3 = ((Bounds)(ref bounds)).center + Vector3.Scale(((Bounds)(ref bounds)).extents, new Vector3((float)(((j & 1) != 0) ? 1 : (-1)), (float)(((j & 2) != 0) ? 1 : (-1)), (float)(((j & 4) != 0) ? 1 : (-1)))); Vector3 val4 = ((Matrix4x4)(ref val2)).MultiplyPoint3x4(val3); if (!flag) { ((Bounds)(ref result))..ctor(val4, Vector3.zero); flag = true; } else { ((Bounds)(ref result)).Encapsulate(val4); } } } if (!flag) { return new Bounds(Vector3.zero, new Vector3(0.3f, 0.2f, 0.3f)); } return result; } private static void SetLayer(GameObject go, int layer) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) go.layer = layer; foreach (Transform item in go.transform) { SetLayer(((Component)item).gameObject, layer); } } private static Sprite RenderIcon(GameObject visual) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown if (GUIManager.IsHeadless()) { return null; } GameObject val = null; try { val = Object.Instantiate<GameObject>(visual); val.transform.position = Vector3.zero; val.transform.rotation = Quaternion.identity; return RenderManager.Instance.Render(new RenderRequest(val) { Rotation = RenderManager.IsometricRotation, Width = 128, Height = 128, ParticleSimulationTime = -1f, UseCache = false }); } catch (Exception ex) { KnotLogPlugin.Log.LogWarning((object)("Icon rendering failed, using painted icon: " + ex.Message)); return null; } finally { if ((Object)(object)val != (Object)null) { Object.DestroyImmediate((Object)(object)val); } } } private static Sprite LoadIcon(string file) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) string text = KnotLogPlugin.AssetPath(file); if (!File.Exists(text)) { return null; } try { return AssetUtils.LoadSpriteFromFile(text, new Vector2(0.5f, 0.5f)); } catch (Exception ex) { KnotLogPlugin.Log.LogWarning((object)("Could not load " + file + ": " + ex.Message)); return null; } } public static List<RequirementConfig> ParseRecipe(string recipe, string forItem) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown List<RequirementConfig> list = new List<RequirementConfig>(); if (string.IsNullOrWhiteSpace(recipe)) { return list; } string[] array = recipe.Split(new char[2] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries); foreach (string text in array) { string[] array2 = text.Split(new char[1] { ':' }); if (array2.Length == 2 && int.TryParse(array2[1].Trim(), out var result) && result > 0 && array2[0].Trim().Length > 0) { list.Add(new RequirementConfig(array2[0].Trim(), result, 0, true)); continue; } KnotLogPlugin.Log.LogWarning((object)("Ignoring invalid recipe entry '" + text + "' for " + forItem + ".")); } return list; } public static bool IsChipLog(ItemData item) { if (item != null && item.m_shared != null) { return item.m_shared.m_name == "$item_knotlog_chiplog"; } return false; } public static bool IsPatentLog(ItemData item) { if (item != null && item.m_shared != null) { return item.m_shared.m_name == "$item_knotlog_patentlog"; } return false; } public static ItemData Find(Player p, string token) { Inventory val = (((Object)(object)p != (Object)null) ? ((Humanoid)p).GetInventory() : null); if (val == null) { return null; } foreach (ItemData allItem in val.GetAllItems()) { if (allItem != null && allItem.m_shared != null && allItem.m_shared.m_name == token) { return allItem; } } return null; } } public static class Lang { private static readonly (string key, string en, string de)[] Core = new(string, string, string)[47] { ("item_knotlog_chiplog", "Chip Log", "Logge"), ("item_knotlog_chiplog_desc", "A wooden log-chip on a knotted line, a hand reel and a 28-second sandglass – the sailor's way to measure speed. Go aft and heave it over the stern: when the red rag runs through your hand the glass is turned, and every knot that runs out before the sand does is one knot of speed.", "Ein hölzernes Logscheit an einer geknoteten Logleine, eine Handrolle und ein 28-Sekunden-Logglas – so misst der Seemann die Fahrt. Geh achtern und wirf die Logge über das Heck: Läuft der rote Lappen durch die Hand, wird das Glas gedreht, und jeder Knoten, der ausläuft, bevor der Sand durch ist, ist ein Knoten Fahrt."), ("item_knotlog_patentlog", "Patent Log", "Patentlog"), ("item_knotlog_patentlog_desc", "A bronze taffrail log. Clamped on the stern rail, its rotor is towed astern and spins with every fathom the ship sails; the register counts the turns and shows the speed and the distance run.", "Ein bronzenes Patentlog. Am Heckbord festgeklemmt, wird sein Propeller nachgeschleppt und dreht sich mit jedem Faden, den das Schiff segelt; das Zählwerk zählt die Umdrehungen und zeigt Fahrt und gesegelte Strecke."), ("knotlog_call_heave", "Heave!", "Logge über!"), ("knotlog_call_turn", "Turn!", "Glas!"), ("knotlog_call_stop", "Stop!", "Stopp!"), ("knotlog_call_lineout", "Line's out!", "Leine aus!"), ("knotlog_call_noway", "No way on her!", "Keine Fahrt!"), ("knotlog_call_reading", "{0} knots!", "{0} Knoten!"), ("knotlog_msg_needship", "You must be aboard a ship to heave the log.", "Du musst an Bord eines Schiffes sein, um zu loggen."), ("knotlog_msg_goaft", "Go aft – the log is heaved over the stern.", "Geh nach achtern – die Logge wird über das Heck geworfen."), ("knotlog_msg_nowater", "There is not enough water astern.", "Achtern ist nicht genug Wasser."), ("knotlog_msg_noitem", "You need a chip log.", "Du brauchst eine Logge."), ("knotlog_msg_cant", "You can't do that right now.", "Das geht gerade nicht."), ("knotlog_msg_leftship", "The log line slipped from your hands.", "Die Logleine ist dir aus der Hand gerutscht."), ("knotlog_msg_aborted", "You haul the log in.", "Du holst die Logge ein."), ("knotlog_msg_glass_long", "Long glass ({0} s) ready.", "Langes Glas ({0} s) bereit."), ("knotlog_msg_glass_short", "Short glass ({0} s) ready – every knot counts double.", "Kurzes Glas ({0} s) bereit – jeder Knoten zählt doppelt."), ("knotlog_msg_patent_needship", "Clamp the patent log on a ship's stern rail.", "Das Patentlog wird am Heckbord eines Schiffes festgeklemmt."), ("knotlog_msg_patent_streamed", "Patent log streamed astern.", "Patentlog ausgebracht."), ("knotlog_msg_patent_hauled", "Patent log hauled in.", "Patentlog eingeholt."), ("knotlog_msg_patent_busy", "Another patent log is already streamed from this ship.", "Von diesem Schiff ist schon ein Patentlog ausgebracht."), ("knotlog_msg_patent_left", "You unclamp the patent log and take it with you.", "Du nimmst das Patentlog vom Heckbord mit."), ("knotlog_stamp", "Day {0}, {1}:{2}", "Tag {0}, {1}:{2}"), ("knotlog_hint_heave", "Heave the log", "Logge werfen"), ("knotlog_hint_goaft", "Go aft to the stern to heave the log", "Zum Loggen ans Heck gehen"), ("knotlog_hint_glass", "Glass: {0} s", "Glas: {0} s"), ("knotlog_hint_cancel", "Cancel", "Abbrechen"), ("knotlog_hint_count", "Count a knot", "Knoten zählen"), ("knotlog_hint_hurry", "Haul in faster", "Schneller einholen"), ("knotlog_hint_patent_stream", "Stream the patent log", "Patentlog ausbringen"), ("knotlog_hint_patent_haul", "Haul in the patent log", "Patentlog einholen"), ("knotlog_hint_hotbar", "Hotbar {0}", "Leiste {0}"), ("knotlog_hint_result_keep", "Keep the reading up", "Messung länger anzeigen"), ("knotlog_tip_controls", "Controls", "Bedienung"), ("knotlog_tip_chip_heave", "{0}: heave the log (stand at the stern)", "{0}: Logge werfen (am Heck stehen)"), ("knotlog_tip_chip_glass", "{0}: switch long / short glass ({1} s / {2} s)", "{0}: langes / kurzes Glas ({1} s / {2} s)"), ("knotlog_tip_chip_running", "{0} while the line runs: cancel · while hauling: haul faster", "{0} während die Leine läuft: abbrechen · beim Einholen: schneller"), ("knotlog_tip_chip_count", "{0}: count a knot (counting mode Manual)", "{0}: Knoten zählen (Zählmodus Manuell)"), ("knotlog_tip_chip_recall", "{0} afterwards: show the last reading again", "{0} danach: letzte Messung nochmal anzeigen"), ("knotlog_tip_patent_use", "{0}: stream / haul in (aboard a ship)", "{0}: ausbringen / einholen (an Bord)"), ("knotlog_tip_patent_key", "{0}: haul it in while it is out", "{0}: einholen, solange es ausgebracht ist"), ("knotlog_tip_patent_total", "Distance registered: {0} nm", "Gesamt gesegelt: {0} sm"), ("knotlog_key_heave", "Heave log", "Logge werfen"), ("knotlog_key_count", "Count knot", "Knoten zählen"), ("knotlog_key_glass", "Switch glass", "Glas wechseln") }; public static void Register() { CustomLocalization localization = LocalizationManager.Instance.GetLocalization(); Dictionary<string, string> dictionary = new Dictionary<string, string>(); Dictionary<string, string> dictionary2 = new Dictionary<string, string>(); Add(Core, dictionary, dictionary2); Add(HudStrings.All, dictionary, dictionary2); string text = "English"; localization.AddTranslation(ref text, dictionary); text = "German"; localization.AddTranslation(ref text, dictionary2); } private static void Add((string key, string en, string de)[] src, Dictionary<string, string> en, Dictionary<string, string> de) { if (src != null) { for (int i = 0; i < src.Length; i++) { (string key, string en, string de) tuple = src[i]; string item = tuple.key; string item2 = tuple.en; string item3 = tuple.de; en[item] = item2; de[item] = item3; } } } public static string T(string token, params object[] args) { string text = ((Localization.instance != null) ? Localization.instance.Localize("$" + token) : token); if (args == null || args.Length == 0) { return text; } try { return string.Format(text, args); } catch (FormatException) { return text; } } } internal static class Patches { [HarmonyPatch(typeof(Humanoid), "UseItem")] private static class UseItem { private static bool Prefix(Humanoid __instance, Inventory inventory, ItemData item) { if ((Object)(object)__instance != (Object)(object)Player.m_localPlayer || item == null) { return true; } if (inventory != null && inventory != __instance.GetInventory()) { return true; } if (Items.IsChipLog(item)) { if ((Object)(object)ChipLogController.Instance != (Object)null) { ChipLogController.Instance.OnUse(); } return false; } if (Items.IsPatentLog(item)) { if ((Object)(object)PatentLogController.Instance != (Object)null) { PatentLogController.Instance.OnUse(item); } return false; } return true; } } [HarmonyPatch(typeof(Player), "SetControls")] private static class SetControls { private static void Prefix(Player __instance, ref bool attack, ref bool attackHold, ref bool secondaryAttack, ref bool secondaryAttackHold, ref bool block, ref bool blockHold, ref bool jump, ref bool dodge) { if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer)) { ChipLogController instance = ChipLogController.Instance; if (!((Object)(object)instance == (Object)null) && instance.IsActive) { attack = (attackHold = (secondaryAttack = (secondaryAttackHold = false))); block = (blockHold = (jump = (dodge = false))); } } } } [HarmonyPatch(typeof(MonoUpdaters), "LateUpdate")] private static class LateProps { [HarmonyPriority(0)] private static void Postfix() { ChipLogController instance = ChipLogController.Instance; if ((Object)(object)instance != (Object)null) { instance.LateUpdateProps(); } RemoteLogView.LateAll(); } } [HarmonyPatch(typeof(Character), "UpdateRotation")] private static class FaceTheLine { private static void Postfix(Character __instance, float dt) { //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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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) if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer) && !(((Vector3)(ref __instance.m_moveDir)).sqrMagnitude > 0.01f)) { ChipLogController instance = ChipLogController.Instance; if (!((Object)(object)instance == (Object)null) && instance.WantsFacing(out var direction)) { Transform transform = ((Component)__instance).transform; Quaternion val = Quaternion.LookRotation(direction, Vector3.up); transform.rotation = Quaternion.RotateTowards(transform.rotation, val, 420f * dt); } } } } [HarmonyPatch(typeof(Player), "OnDeath")] private static class OnDeath { private static void Prefix(Player __instance) { if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer) && (Object)(object)PatentLogController.Instance != (Object)null) { PatentLogController.Instance.Flush(); } } private static void Postfix(Player __instance) { if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer)) { if ((Object)(object)ChipLogController.Instance != (Object)null) { ChipLogController.Instance.ForceStop(); } if ((Object)(object)PatentLogController.Instance != (Object)null) { PatentLogController.Instance.ForceStop(); } } } } [HarmonyPatch(typeof(ItemData), "GetTooltip", new Type[] { typeof(ItemData), typeof(int), typeof(bool), typeof(float), typeof(int), typeof(bool) })] private static class Tooltip { private static void Postfix(ItemData item, ref string __result) { if (item == null || (!Items.IsChipLog(item) && !Items.IsPatentLog(item))) { return; } try { __result += LogKeyHints.Tooltip(item); } catch (Exception ex) { KnotLogPlugin.Log.LogWarning((object)("Tooltip: " + ex.Message)); } } } [HarmonyPatch(typeof(Game), "Logout")] private static class Logout { private static void Prefix() { if ((Object)(object)ChipLogController.Instance != (Object)null) { ChipLogController.Instance.ForceStop(); } if ((Object)(object)PatentLogController.Instance != (Object)null) { PatentLogController.Instance.ForceStop(); } LogHud.Destroy(); ChipLogController.Logbook.Clear(); } } [HarmonyPatch(typeof(Game), "SavePlayerProfile")] private static class SaveProfile { private static void Prefix() { if ((Object)(object)PatentLogController.Instance != (Object)null) { PatentLogController.Instance.Flush(); } } } } [BepInPlugin("jan.knotlog", "KnotLog", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class KnotLogPlugin : BaseUnityPlugin { public const string PluginGuid = "jan.knotlog"; public const string PluginName = "KnotLog"; public const string PluginVersion = "1.0.0"; private Harmony _harmony; private ButtonConfig _heaveButton; private ButtonConfig _countButton; private ButtonConfig _glassButton; public static KnotLogPlugin Instance { get; private set; } public static string PluginDir { get; private set; } public static ManualLogSource Log { get; private set; } public static string AssetPath(string fileName) { return Path.Combine(PluginDir ?? "", "Assets", fileName); } private void Awake() { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; PluginDir = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); Cfg.Bind(((BaseUnityPlugin)this).Config); Lang.Register(); Items.Init(); AddButtons(); ((Component)this).gameObject.AddComponent<ChipLogController>(); ((Component)this).gameObject.AddComponent<PatentLogController>(); _harmony = new Harmony("jan.knotlog"); _harmony.PatchAll(typeof(KnotLogPlugin).Assembly); SelfTest.TryStart(((Component)this).gameObject); ChipLogController.Logbook.Capacity = Mathf.Max(1, Cfg.LogbookSize.Value); Cfg.LogbookSize.SettingChanged += delegate { ChipLogController.Logbook.Capacity = Mathf.Max(1, Cfg.LogbookSize.Value); }; } private void Start() { if (!GUIManager.IsHeadless()) { Sfx.Init(); } } private void AddButtons() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_002d: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Expected O, but got Unknown _heaveButton = new ButtonConfig { Name = "KnotLog_Heave", Config = Cfg.LogKey, HintToken = "$knotlog_key_heave" }; _countButton = new ButtonConfig { Name = "KnotLog_Count", Config = Cfg.CountKey, HintToken = "$knotlog_key_count" }; _glassButton = new ButtonConfig { Name = "KnotLog_Glass", Config = Cfg.GlassKey, HintToken = "$knotlog_key_glass" }; InputManager.Instance.AddButton("jan.knotlog", _heaveButton); InputManager.Instance.AddButton("jan.knotlog", _countButton); InputManager.Instance.AddButton("jan.knotlog", _glassButton); } private void Update() { if ((Object)(object)Player.m_localPlayer != (Object)null) { RemoteLogView.Scan(Time.deltaTime); } LogKeyHints.Tick(Player.m_localPlayer); Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null || ZInput.instance == null || !((Character)localPlayer).TakeInput()) { return; } ChipLogController instance = ChipLogController.Instance; PatentLogController instance2 = PatentLogController.Instance; if (ZInput.GetButtonDown(_heaveButton.Name)) { bool flag = Items.Find(localPlayer, "$item_knotlog_chiplog") != null; if ((Object)(object)instance != (Object)null && instance.IsActive) { instance.OnUse(); } else if ((Object)(object)instance2 != (Object)null && instance2.IsDeployed) { instance2.OnUse(null); } else if ((Object)(object)instance != (Object)null && flag) { instance.OnUse(); } else if ((Object)(object)instance2 != (Object)null && Items.Find(localPlayer, "$item_knotlog_patentlog") != null) { instance2.OnUse(null); } else { ChipLogController.Message("knotlog_msg_noitem"); } } if (ZInput.GetButtonDown(_countButton.Name)) { OnCountPressed(instance); } if ((Object)(object)instance != (Object)null && ZInput.GetButtonDown(_glassButton.Name) && !instance.IsActive && Items.Find(localPlayer, "$item_knotlog_chiplog") != null) { instance.OnGlassKey(); } } internal static void OnCountPressed(ChipLogController chip) { if ((Object)(object)chip != (Object)null && chip.IsActive && chip.Mode == CountingMode.Manual && (chip.Phase == LogPhase.Stray || chip.Phase == LogPhase.Timing)) { chip.OnCountKey(); } else { LogHud.RecallResult(); } } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } } } namespace KnotLog.Visual { public enum ArmPose { None, HoldReel, Throw, Haul, Stream } public class ArmPoseDriver : MonoBehaviour { private static readonly List<ArmPoseDriver> s_active = new List<ArmPoseDriver>(); private static int s_lastApplyAllFrame = -1; private const float DefaultHaulRate = 1.2f; private const float GlobalFadeSeconds = 0.3f; private const float AfterThrowBlend = 0.35f; private const float StreamRate = 0.45f; private const float TimeWrap = 100f; private const int MaxErrors = 5; private Player _player; private VisEquipment _visEquipment; private ArmRig _rig; private bool _rigFailed; private int _errorCount; private int _lastAppliedFrame = -1; private ArmPose _pose; private PoseSample _from; private PoseSample _out; private float _fade = 1f; private float _fadeSeconds; private float _global; private PoseContext _ctx; private float _haulRate = 1.2f; private float _haulRateTarget = 1.2f; private float _throwSeconds = 1f; private Action _onRelease; private bool _released = true; private float _twitchVel; public Transform RightHand { get { VisEquipment val = Vis(); if (!((Object)(object)val != (Object)null)) { return null; } return val.m_rightHand; } } public Transform LeftHand { get { VisEquipment val = Vis(); if (!((Object)(object)val != (Object)null)) { return null; } return val.m_leftHand; } } public ArmPose Pose => _pose; public bool IsThrowing => _pose == ArmPose.Throw; private static bool AnimationEnabled { get { if (Cfg.ProceduralAnimation != null) { return Cfg.ProceduralAnimation.Value; } return true; } } public static ArmPoseDriver Get(Player player) { if ((Object)(object)player == (Object)null) { return null; } ArmPoseDriver armPoseDriver = ((Component)player).GetComponent<ArmPoseDriver>(); if ((Object)(object)armPoseDriver == (Object)null) { armPoseDriver = ((Component)player).gameObject.AddComponent<ArmPoseDriver>(); } return armPoseDriver; } public void SetPose(ArmPose pose, float blendSeconds = 0.25f) { if (pose == ArmPose.Throw) { PlayThrow(1.1f, null); return; } if (_pose == ArmPose.Throw) { if (pose == ArmPose.HoldReel) { return; } FireRelease(); } if (pose != _pose) { SwitchPose(pose, blendSeconds); } } public void PlayThrow(float seconds, Action onRelease) { FireRelease(); _onRelease = onRelease; _released = false; if (!AnimationEnabled || !((Behaviour)this).isActiveAndEnabled) { FireRelease(); SwitchPose(ArmPose.HoldReel, 0.25f); return; } _throwSeconds = Mathf.Clamp(float.IsNaN(seconds) ? 1.1f : seconds, 0.3f, 6f); _ctx.ThrowT = 0f; _ctx.ThrowLeftAloft = _out.Left.Weight > 0.5f && _out.Left.Upper.y > 0.5f; SwitchPose(ArmPose.Throw, Mathf.Min(0.25f, _throwSeconds * 0.2f)); } public void SetHaulRate(float rate) { _haulRateTarget = (float.IsNaN(rate) ? 1.2f : Mathf.Clamp(rate, 0f, 4f)); } public void Twitch(float strength = 1f) { if (!float.IsNaN(strength)) { _twitchVel += 3f * Mathf.Clamp(strength, 0f, 3f); } } public static void ApplyAll() { s_lastApplyAllFrame = Time.frameCount; for (int num = s_active.Count - 1; num >= 0; num--) { if (num < s_active.Count) { ArmPoseDriver armPoseDriver = s_active[num]; if ((Object)(object)armPoseDriver == (Object)null) { s_active.RemoveAt(num); } else { armPoseDriver.SafeApply(); } } } } private void Awake() { _player = ((Component)this).GetComponent<Player>(); } private void OnEnable() { if (!s_active.Contains(this)) { s_active.Add(this); } } private void OnDisable() { s_active.Remove(this); FireRelease(); } private void OnDestroy() { s_active.Remove(this); FireRelease(); } private void LateUpdate() { if (Time.frameCount - s_lastApplyAllFrame > 1) { SafeApply(); } } private VisEquipment Vis() { if ((Object)(object)_visEquipment == (Object)null) { if ((Object)(object)_player == (Object)null) { _player = ((Component)this).GetComponent<Player>(); } if ((Object)(object)_player != (Object)null) { _visEquipment = ((Humanoid)_player).m_visEquipment; } if ((Object)(object)_visEquipment == (Object)null) { _visEquipment = ((Component)this).GetComponent<VisEquipment>(); } } return _visEquipment; } private void SafeApply() { if (_lastAppliedFrame == Time.frameCount) { return; } _lastAppliedFrame = Time.frameCount; try { float dt = Mathf.Clamp(Time.deltaTime, 0f, 0.1f); Tick(dt); Write(dt); } catch (Exception arg) { _rig = null; if (++_errorCount >= 5) { _rigFailed = true; } if (_errorCount == 1 || _errorCount == 5) { ManualLogSource log = KnotLogPlugin.Log; if (log != null) { log.LogWarning((object)string.Format("ArmPoseDriver: {0}{1}", (_errorCount == 5) ? "disabled after repeated errors: " : "", arg)); } } } } private void SwitchPose(ArmPose pose, float blendSeconds) { _from = _out; _fade = 0f; _fadeSeconds = (float.IsNaN(blendSeconds) ? 0f : Mathf.Max(0f, blendSeconds)); if (pose == ArmPose.Haul && _pose != ArmPose.Haul) { _ctx.HaulPhase = 0.1f; } _pose = pose; } private void FireRelease() { if (_released) { return; } _released = true; Action onRelease = _onRelease; _onRelease = null; if (onRelease == null) { return; } try { onRelease(); } catch (Exception arg) { ManualLogSource log = KnotLogPlugin.Log; if (log != null) { log.LogWarning((object)$"ArmPoseDriver: throw release callback failed: {arg}"); } } } private void Tick(float dt) { _ctx.Time += dt; if (_ctx.Time >= 100f) { _ctx.Time -= 100f; } _haulRate = Mathf.MoveTowards(_haulRate, _haulRateTarget, 2f * dt); _ctx.HaulPhase += _haulRate * dt; _ctx.HaulPhase -= Mathf.Floor(_ctx.HaulPhase); _ctx.StreamPhase += 0.45f * dt; _ctx.StreamPhase -= Mathf.Floor(_ctx.StreamPhase); if (_ctx.Twitch != 0f || _twitchVel != 0f) { int num = Mathf.Clamp(Mathf.CeilToInt(dt / 0.01f), 1, 10); float num2 = dt / (float)num; for (int i = 0; i < num; i++) { _twitchVel += (-400f * _ctx.Twitch - 20f * _twitchVel) * num2; _ctx.Twitch += _twitchVel * num2; } if (Mathf.Abs(_ctx.Twitch) < 0.0001f && Mathf.Abs(_twitchVel) < 0.001f) { _ctx.Twitch = 0f; _twitchVel = 0f; } } bool flag = false; if (_pose == ArmPose.Throw) { _ctx.ThrowT += dt / _throwSeconds; if (!_released && (_ctx.ThrowT >= 0.5f || !AnimationEnabled)) { FireRelease(); } if (_ctx.ThrowT >= 1f) { _ctx.ThrowT = 1f; flag = true; } } PoseSample b = PoseLibrary.Evaluate(_pose, in _ctx); _fade += dt; float num3 = ((_fadeSeconds <= 0f) ? 1f : Curve.Smooth(_fade / _fadeSeconds)); _out = ((num3 >= 1f) ? b : PoseSample.Blend(in _from, in b, num3)); if (flag && _pose == ArmPose.Throw) { SwitchPose(ArmPose.HoldReel, 0.35f); } } private void Write(float dt) { //IL_00ee: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_player == (Object)null) { return; } bool flag = AnimationEnabled && !IsDeadSafe(_player); _global = Mathf.MoveTowards(_global, flag ? 1f : 0f, dt / 0.3f); if (_global * _out.MaxWeight <= 0.001f || !((Character)_player).m_lodVisible) { return; } if (_rig == null && !_rigFailed) { _rig = ArmRig.Build(((Character)_player).m_animator); if (!_rig.Valid) { _rigFailed = true; ManualLogSource log = KnotLogPlugin.Log; if (log != null) { log.LogWarning((object)"ArmPoseDriver: arm bones not found, procedural arm animation disabled for this player."); } } } if (!_rigFailed && _rig != null) { _rig.Apply(in _out, BodyFrame(((Component)_player).transform), _global); } } private static bool IsDeadSafe(Player p) { ZNetView nview = ((Character)p).m_nview; if ((Object)(object)nview != (Object)null && nview.IsValid()) { return ((Character)p).IsDead(); } return false; } private static Quaternion BodyFrame(Transform t) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = t.forward; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { val = -t.up; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.0001f) { val = Vector3.forward; } } return Quaternion.LookRotation(((Vector3)(ref val)).normalized, Vector3.up); } } [HarmonyPatch(typeof(MonoUpdaters), "LateUpdate")] internal static class ArmPoseLateUpdatePatch { [HarmonyPriority(800)] private static void Postfix() { ArmPoseDriver.ApplyAll(); } } public static class Props { internal const float ChipR = 0.3f; internal const float ChipT = 0.025f; internal const float ChipApexY = 0.12f; internal const float PegLen = 0.036f; internal static readonly Vector3 ChipKnotPinned = new Vector3(0f, 0f, 0.35f); internal const float ReelAxleY = 0.195f; internal const float FlangeX = 0.07f; internal const float FlangeT = 0.012f; internal const float FlangeR = 0.12f; internal const float CoreR = 0.034f; internal const float ArmX = 0.104f; internal const float ArmT = 0.014f; internal const float WoundMinR = 0.036f; internal const float WoundMaxR = 0.104f; private const int WoundTurns = 9; private const int WoundPer = 8; internal const float RegAxisY = 0.098f; internal const float RegFlyZ = -0.132f; internal const float RegDialZ = 0.005f; internal const float RegDialY = 0.1485f; internal const float RegDialR = 0.0372f; internal static readonly Vector3 RegLineExit = new Vector3(0f, 0.098f, -0.219f); internal static readonly Vector3 RotorEye = new Vector3(0f, 0f, 0.18f); internal static Vector3 ChipPegSeat => new Vector3(0f, 0.06999999f, 0.0133f); internal static Vector3 ChipCorner(int side) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) return new Vector3((float)side * 0.266f * 0.70710677f, -0.0680904f, 0.0145000005f); } public static GameObject CreateChip() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown Mats.Init(); GameObject val = new GameObject("KnotLog_Chip"); Transform transform = val.transform; PartSet partSet = new PartSet(); Transform val2 = MeshKit.Child(transform, "Board"); BuildChipBoard(partSet); partSet.Emit(val2, "Board"); Transform val3 = MeshKit.Child(transform, "Peg"); BuildPeg(partSet); partSet.Emit(val3, "Peg"); Mesh mesh = UnitCordMesh(0.0032f); Transform cordL = CordPart(transform, "CordL", mesh); Transform cordR = CordPart(transform, "CordR", mesh); Transform cordApex = CordPart(transform, "CordApex", mesh); Transform val4 = MeshKit.Child(transform, "BridleKnot", ChipKnotPinned, Quaternion.identity); MeshKit.Ellipsoid(partSet[Mats.Rope], Vector3.zero, new Vector3(0.012f, 0.011f, 0.014f), Quaternion.identity); partSet.Emit(val4, "Knot"); val.AddComponent<ChipVisual>().Setup(val2, val3, cordL, cordR, cordApex, val4); return val; } public static GameObject CreateReel() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Expected O, but got Unknown Mats.Init(); GameObject val = new GameObject("KnotLog_Reel"); Transform transform = val.transform; PartSet partSet = new PartSet(); BuildReelFrame(partSet); partSet.Emit(transform, "Frame"); Transform val2 = MeshKit.Child(transform, "Spool", new Vector3(0f, 0.195f, 0f), Quaternion.identity); BuildReelSpool(partSet); partSet.Emit(val2, "Spool"); Transform val3 = MeshKit.Child(val2, "Wound"); BuildWound(partSet); partSet.Emit(val3, "Wound"); Transform exit = MeshKit.Child(transform, "LineExit"); val.AddComponent<ReelVisual>().Setup(val2, val3, exit); return val; } public static GameObject CreateSandglass() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Expected O, but got Unknown Mats.Init(); GameObject val = new GameObject("KnotLog_Sandglass"); Transform val2 = MeshKit.Child(val.transform, "Flip", new Vector3(0f, 0.15f, 0f), Quaternion.identity); PartSet partSet = new PartSet(); BuildSandglassFrame(partSet); partSet.Emit(val2, "Glass"); MeshFilter topU = SandPart(val2, "SandTop", Quaternion.identity); MeshFilter topL = SandPart(val2, "SandTopLower", Quaternion.Euler(180f, 0f, 0f)); MeshFilter pile = SandPart(val2, "SandPile", Quaternion.identity); MeshBuilder meshBuilder = new MeshBuilder(); MeshKit.Cylinder(meshBuilder, Vector3.zero, Vector3.down, 0.0009f, 6, caps: false); Transform transform = ((Component)MeshKit.Part(val2, "Stream", meshBuilder.ToMesh("KnotLog_SandStream"), Mats.Sand, shadows: false)).transform; transform.localPosition = new Vector3(0f, -0.0015f, 0f); val.AddComponent<SandglassVisual>().Setup(val2, topU, topL, pile, transform); return val; } public static GameObject CreateRegister() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_00d8: Expected O, but got Unknown Mats.Init(); GameObject val = new GameObject("KnotLog_Register"); Transform transform = val.transform; PartSet partSet = new PartSet(); BuildRegisterBody(partSet); partSet.Emit(transform, "Body"); Transform val2 = MeshKit.Child(transform, "Flywheel", new Vector3(0f, 0.098f, -0.132f), Quaternion.identity); BuildFlywheel(partSet); partSet.Emit(val2, "Fly"); Transform val3 = MeshKit.Child(transform, "Needle", new Vector3(0f, 0.1497f, 0.005f), Quaternion.Euler(0f, -135f, 0f)); BuildNeedle(partSet); partSet.Emit(val3, "Needle"); Transform exit = MeshKit.Child(transform, "LineExit", RegLineExit, Quaternion.LookRotation(Vector3.back, Vector3.up)); val.AddComponent<RegisterVisual>().Setup(val2, val3, exit); return val; } public static GameObject CreateRotor() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown Mats.Init(); GameObject val = new GameObject("KnotLog_Rotor"); Transform val2 = MeshKit.Child(val.transform, "Spin"); PartSet partSet = new PartSet(); BuildRotor(partSet); partSet.Emit(val2, "Rotor"); Transform attach = MeshKit.Child(val.transform, "LineAttach", RotorEye, Quaternion.identity); val.AddComponent<RotorVisual>().Setup(val2, attach); return val; } public static GameObject CreateChipLogBundle() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_00f7: 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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: 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_0143: 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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: 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) //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_018d: 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_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: 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_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0241: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: 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_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0303: 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_0323: 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_038e: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: 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_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_0404: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0410: 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_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Unknown result type (might be due to invalid IL or missing references) //IL_0447: Unknown result type (might be due to invalid IL or missing references) //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_0456: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_046c: Unknown result type (might be due to invalid IL or missing references) Mats.Init(); GameObject val = new GameObject("KnotLog_ChipLogBundle"); PartSet partSet = new PartSet(); partSet.Push(Vector3.zero, Quaternion.Euler(0f, 0f, 90f)); BuildReelFrame(partSet); partSet.Push(new Vector3(0f, 0.195f, 0f), Quaternion.identity); BuildReelSpool(partSet); partSet.Push(Vector3.zero, Quaternion.identity, new Vector3(1f, 0.104f, 0.104f)); BuildWound(partSet); partSet.Pop(); partSet.Pop(); partSet.Pop(); Vector3 val2 = new Vector3(-0.195f, 0f, 0f); Vector3 val3 = val2 + new Vector3(-0.007f, 0.1375f, 0f); Quaternion val4 = Quaternion.Euler(0f, 90f, 0f) * Quaternion.Euler(-90f, 0f, 0f); Matrix4x4 m = Matrix4x4.TRS(val3, val4, Vector3.one); partSet.Push(m); BuildChipBoard(partSet); partSet.Push(ChipPegSeat, Quaternion.identity); BuildPeg(partSet); partSet.Pop(); partSet.Pop(); Vector3 val5 = val2 + new Vector3(0.24f, 0.1355f, 0.03f); Vector3 a = ((Matrix4x4)(ref m)).MultiplyPoint3x4(ChipCorner(-1)); Vector3 a2 = ((Matrix4x4)(ref m)).MultiplyPoint3x4(ChipCorner(1)); Vector3 a3 = ((Matrix4x4)(ref m)).MultiplyPoint3x4(ChipPegSeat + new Vector3(0f, 0f, 0.031999998f)); MeshKit.Cylinder(partSet[Mats.Rope], a, val5, 0.0032f, 8, caps: false, 1f, 12f); MeshKit.Cylinder(partSet[Mats.Rope], a2, val5, 0.0032f, 8, caps: false, 1f, 12f); MeshKit.Cylinder(partSet[Mats.Rope], a3, val5, 0.0032f, 8, caps: false, 1f, 12f); MeshKit.Ellipsoid(partSet[Mats.Rope], val5, new Vector3(0.012f, 0.011f, 0.014f), Quaternion.identity); Vector3 val6 = val2 + new Vector3(0.1f, 0.04f, 0.03f); Vector3 val7 = Vector3.Lerp(val5, val6, 0.5f) + new Vector3(0.012f, -0.012f, 0f); MeshKit.Cylinder(partSet[Mats.Rope], val5, val7, 0.007f, 10, caps: false, 1f, 6f); MeshKit.Cylinder(partSet[Mats.Rope], val7, val6, 0.007f, 10, caps: false, 1f, 6f); MeshKit.Sphere(partSet[Mats.Rope], val7, 0.007f, 10, 6); float num = -0.1167f; Vector3 val8 = val2 + new Vector3(0f, num + 0.112500004f, -0.18024999f); partSet.Push(val8, Quaternion.Euler(0f, 20f, 0f), Vector3.one * 0.75f); BuildSandglassFrame(partSet); Vector2[] array = (Vector2[])(object)new Vector2[20]; if (SandShape.FillProfile(array, 1f, 0f)) { MeshKit.Lathe(partSet[Mats.Sand], array, 20, 3f, 30f); } MeshKit.Torus(partSet[Mats.Rope], new Vector3(0f, -0.01f, 0f), Quaternion.identity, 0.0722f, 0.0042f, 28, 8, 8f); partSet.Pop(); Vector3 val9 = val8 + new Vector3(0f, -0.0075f, 0.05415f); Vector3 val10 = val2 + new Vector3(0f, -0.0075f, -0.102000006f); MeshKit.Cylinder(partSet[Mats.Rope], val9 + Vector3.up * 0.006f, val10 + Vector3.up * 0.012f, 0.0042f, 8, caps: false, 1f, 12f); MeshKit.Cylinder(partSet[Mats.Rope], val9 - Vector3.up * 0.006f, val10 - Vector3.up * 0.012f, 0.0042f, 8, caps: false, 1f, 12f); partSet.Emit(val.transform, "Bundle"); MeshKit.CenterOnBounds(val); return val; } public static GameObject CreatePatentLogBundle() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_0169: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: 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_01b9: 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_01e1: 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_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: 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_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0220: 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_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0255: 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_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_0268: 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_027a: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_028e: 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_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) Mats.Init(); GameObject val = new GameObject("KnotLog_PatentLogBundle"); PartSet partSet = new PartSet(); BuildRegisterBody(partSet); partSet.Push(new Vector3(0f, 0.098f, -0.132f), Quaternion.Euler(0f, 0f, 18f)); BuildFlywheel(partSet); partSet.Pop(); partSet.Push(new Vector3(0f, 0.1497f, 0.005f), Quaternion.Euler(0f, -135f, 0f)); BuildNeedle(partSet); partSet.Pop(); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(0.175f, 0f, -0.02f); float[] array = new float[5] { 0.06f, 0.073f, 0.086f, 0.066f, 0.08f }; for (int i = 0; i < array.Length; i++) { float num = ((i < 3) ? 0.0062f : 0.01674f); Quaternion rot = Quaternion.Euler(2.5f * Mathf.Sin((float)i * 1.7f), (float)i * 41f, 2f * Mathf.Cos((float)i * 2.3f)); MeshKit.Torus(partSet[Mats.Line], val2 + new Vector3(0.002f * (float)i, num, -0.002f * (float)i), rot, array[i], 0.0062f, 36, 8, 14f); } float num2 = 0.02294f; Vector3 val3 = val2 + new Vector3(0f, num2 + 0.029698199f, 0.035f); Quaternion val4 = Quaternion.Euler(0f, 0f, 14f); partSet.Push(val3, val4); BuildRotor(partSet); partSet.Pop(); Vector3 regLineExit = RegLineExit; Vector3 val5 = default(Vector3); ((Vector3)(ref val5))..ctor(0.05f, 0.035f, -0.235f); Vector3 b = val2 + new Vector3(-0.075f, 0.0124f, -0.045f); MeshKit.Cylinder(partSet[Mats.Line], regLineExit, val5, 0.0062f, 10, caps: false, 1f, 14f); MeshKit.Cylinder(partSet[Mats.Line], val5, b, 0.0062f, 10, caps: false, 1f, 14f); MeshKit.Sphere(partSet[Mats.Line], val5, 0.0062f, 10, 6); Vector3 b2 = val3 + val4 * RotorEye; Vector3 a = val2 + new Vector3(0.02f, num2, 0.08f); MeshKit.Cylinder(partSet[Mats.Line], a, b2, 0.00558f, 10, caps: false, 1f, 14f); partSet.Emit(val.transform, "Bundle"); MeshKit.CenterOnBounds(val); return val; } internal static void BuildChipBoard(PartSet s) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_017d: 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_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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) s.Push(new Vector3(0f, 0.12f, 0f), Quaternion.identity); MeshKit.Sector(s[Mats.Wood], 0f, 0.3f, -45f, 45f, 0.025f, 28, 1.6f); MeshKit.Sector(s[Mats.Lead], 0.284f, 0.30400002f, -38f, 38f, 0.032f, 24, 6f); for (int i = -1; i <= 1; i++) { Vector3 val = MeshKit.SectorDir((float)i * 25f * ((float)Math.PI / 180f)) * 0.2935f; for (int j = -1; j <= 1; j += 2) { MeshKit.Ellipsoid(s[Mats.Iron], val + new Vector3(0f, 0f, (float)j * 0.016f), new Vector3(0.0042f, 0.0042f, 0.0016f), Quaternion.identity, 10, 5); } } s.Pop(); List<Vector2> prof = new List<Vector2> { new Vector2(0.0085f, -0.0005f), new Vector2(0.0085f, 0.0028f), new Vector2(0.0074f, 0.0038f), new Vector2(0.005f, 0.0038f), new Vector2(0.0046f, 0.003f), new Vector2(0.0046f, 0.0008f), new Vector2(0.0046f, 0.0008f), new Vector2(0f, 0.0008f) }; MeshKit.LatheZ(s[Mats.DarkWood], new Vector3(0f, 0.06999999f, 0.0125f), prof, 16, 1f, 30f); for (int k = -1; k <= 1; k += 2) { MeshKit.Ellipsoid(s[Mats.Rope], ChipCorner(k), new Vector3(0.0068f, 0.0068f, 0.005f), Quaternion.identity, 10, 6); } } internal static void BuildPeg(PartSet s) { //IL_0010: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) List<Vector2> prof = new List<Vector2> { new Vector2(0f, 0f), new Vector2(0.0028f, 0f), new Vector2(0.0036f, 0.002f), new Vector2(0.0042f, 0.012f), new Vector2(0.0043f, 0.025f), new Vector2(0.006f, 0.027f), new Vector2(0.006f, 0.03f), new Vector2(0.0045f, 0.031f), new Vector2(0.0045f, 0.033f), new Vector2(0.0052f, 0.034f), new Vector2(0.004f, 0.036f), new Vector2(0f, 0.036f) }; MeshKit.LatheZ(s[Mats.DarkWood], Vector3.zero, prof, 12, 1f, 3f, swapUV: true); } private static Mesh UnitCordMesh(float radius) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) MeshBuilder meshBuilder = new MeshBuilder(); MeshKit.Cylinder(meshBuilder, Vector3.zero, Vector3.forward, radius, 8, caps: false, 1f, 4f); return meshBuilder.ToMesh("KnotLog_Cord"); } private static Transform CordPart(Transform parent, string name, Mesh mesh) { return ((Component)MeshKit.Part(parent, name, mesh, Mats.Rope)).transform; } internal static void BuildReelFrame(PartSet s) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_002b: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0123: 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_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_0201: 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_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02e8: 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_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) float num = 0.151f; List<Vector2> prof = new List<Vector2> { new Vector2(0.0066f, 0f), new Vector2(0.011f, 0f), new Vector2(0.011f, 0.0022f), new Vector2(0.0095f, 0.0034f), new Vector2(0.0068f, 0.0046f), new Vector2(0.0035f, 0.0054f), new Vector2(0f, 0.0057f) }; for (int i = -1; i <= 1; i += 2) { MeshKit.Box(s[Mats.Wood], new Vector3((float)i * 0.104f, 0.044f + num * 0.5f, 0f), new Vector3(0.014f, num, 0.032f), Quaternion.identity); MeshKit.Cylinder(s[Mats.Wood], new Vector3((float)i * 0.097f, 0.195f, 0f), new Vector3((float)i * 0.111f, 0.195f, 0f), 0.019f, 24, caps: true, 1f, 2f); s.Push(new Vector3((float)i * 0.111f, 0.195f, 0f), (i > 0) ? Quaternion.identity : Quaternion.Euler(0f, 180f, 0f)); MeshKit.LatheX(s[Mats.Iron], Vector3.zero, prof, 16); s.Pop(); } MeshKit.Box(s[Mats.Wood], new Vector3(0f, 0.055f, 0f), new Vector3(0.222f, 0.022f, 0.036f), Quaternion.identity); List<Vector2> prof2 = new List<Vector2> { new Vector2(0f, -0.105f), new Vector2(0.012f, -0.105f), new Vector2(0.019f, -0.101f), new Vector2(0.0225f, -0.094f), new Vector2(0.022f, -0.087f), new Vector2(0.018f, -0.081f), new Vector2(0.0165f, -0.074f), new Vector2(0.0172f, -0.058f), new Vector2(0.0184f, -0.038f), new Vector2(0.0182f, -0.018f), new Vector2(0.0168f, 0.002f), new Vector2(0.0156f, 0.016f), new Vector2(0.016f, 0.02f), new Vector2(0.019f, 0.024f), new Vector2(0.0205f, 0.029f), new Vector2(0.0205f, 0.037f), new Vector2(0.0185f, 0.041f), new Vector2(0.0175f, 0.044f), new Vector2(0f, 0.044f) }; MeshKit.Lathe(s[Mats.DarkWood], prof2, 24, 1f, 2.5f, null, swapUV: true); MeshKit.Cylinder(s[Mats.Iron], new Vector3(-0.117f, 0.195f, 0f), new Vector3(0.117f, 0.195f, 0f), 0.0065f, 12); } internal static void BuildReelSpool(PartSet s) { //IL_0010: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: 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_00d3: 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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_014a: 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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: 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_01c5: 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_0204: 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_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) List<Vector2> prof = new List<Vector2> { new Vector2(0f, 0f), new Vector2(0.116f, 0f), new Vector2(0.116f, 0f), new Vector2(0.12f, 0.003f), new Vector2(0.12f, 0.009f), new Vector2(0.116f, 0.012f), new Vector2(0.116f, 0.012f), new Vector2(0f, 0.012f) }; List<Vector2> prof2 = new List<Vector2> { new Vector2(0.024f, 0f), new Vector2(0.024f, 0.009f), new Vector2(0.021f, 0.012f), new Vector2(0.012f, 0.0132f), new Vector2(0f, 0.0135f) }; float num = 0.082f; for (int i = -1; i <= 1; i += 2) { s.Push(Vector3.zero, (i > 0) ? Quaternion.identity : Quaternion.Euler(0f, 180f, 0f)); MeshKit.LatheX(s[Mats.Wood], new Vector3(0.07f, 0f, 0f), prof, 40, MeshKit.Tiles(0.12f, 2f), 2f); MeshKit.Box(s[Mats.Wood], new Vector3(num + 0.004f, 0f, 0f), new Vector3(0.008f, 0.21f, 0.022f), Quaternion.identity); MeshKit.Box(s[Mats.Wood], new Vector3(num + 0.0042f, 0f, 0f), new Vector3(0.0078f, 0.21f, 0.022f), Quaternion.Euler(90f, 0f, 0f)); MeshKit.LatheX(s[Mats.DarkWood], new Vector3(num, 0f, 0f), prof2, 20, 1f, 4f); for (int j = 0; j < 4; j++) { float num2 = (float)j * (float)Math.PI * 0.5f; MeshKit.Ellipsoid(s[Mats.Iron], new Vector3(num + 0.0081f, Mathf.Cos(num2) * 0.09f, Mathf.Sin(num2) * 0.09f), new Vector3(0.0022f, 0.0048f, 0.0048f), Quaternion.identity, 10, 5); } s.Pop(); } MeshKit.Cylinder(s[Mats.Wood], new Vector3(-0.07f, 0f, 0f), new Vector3(0.07f, 0f, 0f), 0.034f, 24, caps: false, 1f, 2f); } internal static void BuildWound(PartSet s) { WoundProfile(s[Mats.Rope], 0, 9, 1f); WoundProfile(s[Mats.RopeDark], 2, 3, 1.008f); WoundProfile(s[Mats.RopeDark], 5, 6, 1.008f); WoundProfile(s[Mats.RopeDark], 7, 8, 1.008f); } private static void WoundProfile(MeshBuilder mb, int fromTurn, int toTurn, float scale) { //IL_0053: 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) List<Vector2> list = new List<Vector2>(); for (int i = fromTurn * 8; i <= toTurn * 8; i++) { float num = (float)i / 8f; float num2 = -0.07f + 0.14f * num / 9f; float num3 = (0.955f + 0.045f * Mathf.Sqrt(Mathf.Abs(Mathf.Sin((float)Math.PI * num)))) * scale; list.Add(new Vector2(num3, num2)); } MeshKit.LatheX(mb, Vector3.zero, list, 36, 10f, 25f); } internal static void BuildSandglassFrame(PartSet s) { //IL_0010: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: 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_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_017b: 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_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: 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_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Unknown result type (might be due to invalid IL or missing references) //IL_04ef: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) List<Vector2> prof = new List<Vector2> { new Vector2(0f, -0.15f), new Vector2(0.068f, -0.15f), new Vector2(0.068f, -0.15f), new Vector2(0.073f, -0.1485f), new Vector2(0.075f, -0.145f), new Vector2(0.075f, -0.14f), new Vector2(0.0725f, -0.1385f), new Vector2(0.0725f, -0.1375f), new Vector2(0.0738f, -0.136f), new Vector2(0.0738f, -0.132f), new Vector2(0.0712f, -0.1292f), new Vector2(0.066f, -0.128f), new Vector2(0.066f, -0.128f), new Vector2(0f, -0.128f) }; List<Vector2> prof2 = new List<Vector2> { new Vector2(0f, -0.128f), new Vector2(0.0105f, -0.128f), new Vector2(0.0105f, -0.1215f), new Vector2(0.0088f, -0.1185f), new Vector2(0.0068f, -0.113f), new Vector2(0.0074f, -0.108f), new Vector2(0.009f, -0.1045f), new Vector2(0.0074f, -0.1005f), new Vector2(0.0064f, -0.096f), new Vector2(0.0058f, -0.065f), new Vector2(0.0055f, -0.032f), new Vector2(0.006f, -0.015f), new Vector2(0.0072f, -0.008f), new Vector2(0.0088f, -0.0035f), new Vector2(0.009f, -0.0012f), new Vector2(0.009f, 0f) }; List<Vector2> list = new List<Vector2> { new Vector2(0f, -0.126f), new Vector2(SandShape.OuterR(0.126f) * 0.8f, -0.126f) }; for (int i = 0; i <= 22; i++) { float num = 0.126f * (1f - (float)i / 22f); list.Add(new Vector2(SandShape.OuterR(num), 0f - num)); } List<Vector2> list2 = new List<Vector2>(); for (int num2 = 22; num2 >= 0; num2--) { float num3 = 0.124400005f * (1f - (float)num2 / 22f); list2.Add(new Vector2(SandShape.InnerR(num3), 0f - num3)); } list2.Add(new Vector2(SandShape.InnerR(0.124400005f) * 0.8f, -0.124400005f)); list2.Add(new Vector2(0f, -0.124400005f)); for (int j = 0; j < 2; j++) { s.Push(Vector3.zero, (j == 0) ? Quaternion.identity : Quaternion.Euler(180f, 0f, 0f)); MeshKit.Lathe(s[Mats.Wood], prof, 40, MeshKit.Tiles(0.075f, 2f), 2f); MeshKit.Torus(s[Mats.DarkWood], new Vector3(0f, -0.125f, 0f), Quaternion.identity, SandShape.OuterR(0.126f) + 0.0024f, 0.0032f, 28, 8, 3f); for (int k = 0; k < 3; k++) { float num4 = (float)k * 120f * ((float)Math.PI / 180f); s.Push(new Vector3(Mathf.Cos(num4) * 0.062f, 0f, Mathf.Sin(num4) * 0.062f), Quaternion.identity); MeshKit.Lathe(s[Mats.DarkWood], prof2, 14, 1f, 3f, null, swapUV: true); s.Pop(); } MeshKit.Lathe(s[M