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 Farming Tools v1.0.0
plugins/FarmingTools.dll
Decompiled 5 days 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.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using FarmingTools.Core; using FarmingTools.Dev; using FarmingTools.Gameplay; using FarmingTools.Visual; using HarmonyLib; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using Microsoft.CodeAnalysis; using Splatform; using UnityEngine; using UnityEngine.Rendering; [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 FarmingTools { public static class Cfg { public static ConfigEntry<string> PloughRecipe; public static ConfigEntry<string> PloughStation; public static ConfigEntry<string> DrillRecipe; public static ConfigEntry<string> DrillStation; public static ConfigEntry<string> ReaperRecipe; public static ConfigEntry<string> ReaperStation; public static ConfigEntry<float> PloughStamina; public static ConfigEntry<string> BagRecipe; public static ConfigEntry<string> BagStation; public static ConfigEntry<int> BagStationLevel; public static ConfigEntry<string> StaffRecipe; public static ConfigEntry<string> StaffStation; public static ConfigEntry<int> StaffStationLevel; public static ConfigEntry<float> StaffEitr; public static ConfigEntry<float> StaffSowEitr; public static ConfigEntry<float> StaffRadius; public static ConfigEntry<float> StaffRadiusMaster; public static ConfigEntry<float> StaffSowRadius; public static ConfigEntry<bool> StaffWild; public static ConfigEntry<string> StaffExclude; public static ConfigEntry<string> StaffInclude; 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Expected O, but got Unknown //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Expected O, but got Unknown //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Expected O, but got Unknown //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Expected O, but got Unknown //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Expected O, but got Unknown //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Expected O, but got Unknown //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Expected O, but got Unknown //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Expected O, but got Unknown //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Expected O, but got Unknown //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Expected O, but got Unknown //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Expected O, but got Unknown //IL_032c: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Expected O, but got Unknown //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Expected O, but got Unknown //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Expected O, but got Unknown //IL_03d1: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Expected O, but got Unknown //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Expected O, but got Unknown //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Expected O, but got Unknown ConfigurationManagerAttributes val = new ConfigurationManagerAttributes { IsAdminOnly = true }; PloughRecipe = c.Bind<string>("1 - Implements", "PloughRecipe", "FineWood:12,Iron:8,IronNails:10", new ConfigDescription("Build cost of the iron plough, \"Item:amount,Item:amount\" (item prefab names).", (AcceptableValueBase)null, new object[1] { val })); PloughStation = c.Bind<string>("1 - Implements", "PloughStation", "forge", new ConfigDescription("Crafting station that has to be near when building the iron plough (prefab name, empty for none).", (AcceptableValueBase)null, new object[1] { val })); PloughStamina = c.Bind<float>("1 - Implements", "PloughStamina", 1f, new ConfigDescription("Stamina per metre the plough is pulled through the ground with its shares lowered. Without stamina the shares do not bite.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10f), new object[1] { val })); DrillRecipe = c.Bind<string>("1 - Implements", "SeedDrillRecipe", "YggdrasilWood:20,MechanicalSpring:4,Copper:10,BlackMetal:6", new ConfigDescription("Build cost of the Dvergr seed drill, \"Item:amount,Item:amount\" (item prefab names).", (AcceptableValueBase)null, new object[1] { val })); DrillStation = c.Bind<string>("1 - Implements", "SeedDrillStation", "blackforge", new ConfigDescription("Crafting station that has to be near when building the Dvergr seed drill (prefab name, empty for none).", (AcceptableValueBase)null, new object[1] { val })); ReaperRecipe = c.Bind<string>("1 - Implements", "ReaperRecipe", "Blackwood:20,FlametalNew:10,CharredCogwheel:2,MechanicalSpring:4", new ConfigDescription("Build cost of the reaper, \"Item:amount,Item:amount\" (item prefab names).", (AcceptableValueBase)null, new object[1] { val })); ReaperStation = c.Bind<string>("1 - Implements", "ReaperStation", "blackforge", new ConfigDescription("Crafting station that has to be near when building the reaper (prefab name, empty for none).", (AcceptableValueBase)null, new object[1] { val })); BagRecipe = c.Bind<string>("2 - Seed bag", "Recipe", "LinenThread:6,LeatherScraps:6,DeerHide:2", new ConfigDescription("Crafting cost of the seed bag, \"Item:amount,Item:amount\" (item prefab names).", (AcceptableValueBase)null, new object[1] { val })); BagStation = c.Bind<string>("2 - Seed bag", "Station", "piece_workbench", new ConfigDescription("Crafting station of the seed bag (prefab name, empty for none).", (AcceptableValueBase)null, new object[1] { val })); BagStationLevel = c.Bind<int>("2 - Seed bag", "StationLevel", 3, new ConfigDescription("Level the crafting station needs for the seed bag.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), new object[1] { val })); StaffRecipe = c.Bind<string>("3 - Staff of Plenty", "Recipe", "Frostwood:10,Gold:6,NornThread:4,GemstoneGreen:1", new ConfigDescription("Crafting cost of the Staff of Plenty, \"Item:amount,Item:amount\" (item prefab names).", (AcceptableValueBase)null, new object[1] { val })); StaffStation = c.Bind<string>("3 - Staff of Plenty", "Station", "piece_magetable", new ConfigDescription("Crafting station of the Staff of Plenty (prefab name, empty for none).", (AcceptableValueBase)null, new object[1] { val })); StaffStationLevel = c.Bind<int>("3 - Staff of Plenty", "StationLevel", 3, new ConfigDescription("Level the crafting station needs for the Staff of Plenty.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 10), new object[1] { val })); StaffEitr = c.Bind<float>("3 - Staff of Plenty", "HarvestEitr", 40f, new ConfigDescription("Eitr for one cast that gathers everything ripe around you.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 200f), new object[1] { val })); StaffSowEitr = c.Bind<float>("3 - Staff of Plenty", "SowEitr", 30f, new ConfigDescription("Eitr for one cast that sows around you (secondary attack).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 200f), new object[1] { val })); StaffRadius = c.Bind<float>("3 - Staff of Plenty", "HarvestRadius", 6f, new ConfigDescription("Harvest radius in metres at farming skill 0. It grows with the skill, as the scythe's does.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 30f), new object[1] { val })); StaffRadiusMaster = c.Bind<float>("3 - Staff of Plenty", "HarvestRadiusMaster", 12f, new ConfigDescription("Harvest radius in metres at farming skill 100.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 40f), new object[1] { val })); StaffSowRadius = c.Bind<float>("3 - Staff of Plenty", "SowRadius", 5f, new ConfigDescription("Radius in metres in which the secondary cast sows on cultivated soil.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 20f), new object[1] { val })); StaffWild = c.Bind<bool>("3 - Staff of Plenty", "HarvestWild", true, new ConfigDescription("Besides what the scythe takes, the staff also picks the plants that bear food again after picking: raspberries, blueberries, cloudberries, lingonberries, vineberries.", (AcceptableValueBase)null, new object[1] { val })); StaffExclude = c.Bind<string>("3 - Staff of Plenty", "NeverHarvest", "Pickable_RoyalJelly", new ConfigDescription("Pickables the staff leaves alone, comma separated prefab names.", (AcceptableValueBase)null, new object[1] { val })); StaffInclude = c.Bind<string>("3 - Staff of Plenty", "AlsoHarvest", "", new ConfigDescription("Further pickables the staff takes, comma separated prefab names (for plants of other mods).", (AcceptableValueBase)null, new object[1] { val })); } } public static class Items { [HarmonyPatch(typeof(Game), "Start")] private static class ApplyOnWorldStart { private static void Postfix() { ApplyConfig(); } } private static GameObject _bag; private static GameObject _staff; private static (string prefab, ConfigEntry<string> recipe, ConfigEntry<string> station, ConfigEntry<int> level)[] Entries => new(string, ConfigEntry<string>, ConfigEntry<string>, ConfigEntry<int>)[2] { ("ft_seedbag", Cfg.BagRecipe, Cfg.BagStation, Cfg.BagStationLevel), ("ft_staffofplenty", Cfg.StaffRecipe, Cfg.StaffStation, Cfg.StaffStationLevel) }; public static void Init() { PrefabManager.OnVanillaPrefabsAvailable += Add; SynchronizationManager.OnConfigurationSynchronized += delegate { ApplyConfig(); }; (string, ConfigEntry<string>, ConfigEntry<string>, ConfigEntry<int>)[] entries = Entries; for (int num = 0; num < entries.Length; num++) { (string, ConfigEntry<string>, ConfigEntry<string>, ConfigEntry<int>) tuple = entries[num]; tuple.Item2.SettingChanged += delegate { ApplyConfig(); }; tuple.Item3.SettingChanged += delegate { ApplyConfig(); }; tuple.Item4.SettingChanged += delegate { ApplyConfig(); }; } Cfg.StaffEitr.SettingChanged += delegate { ApplyConfig(); }; Cfg.StaffSowEitr.SettingChanged += delegate { ApplyConfig(); }; } public static void ApplyConfig() { //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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown try { StaffOfPlenty.ApplyConfig(_staff); if ((Object)(object)ObjectDB.instance == (Object)null) { return; } (string, ConfigEntry<string>, ConfigEntry<string>, ConfigEntry<int>)[] entries = Entries; for (int i = 0; i < entries.Length; i++) { (string prefab, ConfigEntry<string> recipe, ConfigEntry<string> station, ConfigEntry<int> level) e = entries[i]; Recipe val = ObjectDB.instance.m_recipes.Find((Recipe x) => (Object)(object)x != (Object)null && (Object)(object)x.m_item != (Object)null && ((Object)x.m_item).name == e.prefab); if ((Object)(object)val == (Object)null) { continue; } List<Requirement> list = new List<Requirement>(); foreach (RequirementConfig item in Pieces.ParseRecipe(e.recipe.Value)) { GameObject obj = Pieces.FindPrefab(item.Item); ItemDrop val2 = ((obj != null) ? obj.GetComponent<ItemDrop>() : null); if ((Object)(object)val2 != (Object)null) { list.Add(new Requirement { m_resItem = val2, m_amount = item.Amount, m_recover = true }); } else { FarmingToolsPlugin.Log.LogWarning((object)(e.prefab + " recipe: unknown item '" + item.Item + "'.")); } } if (list.Count > 0) { val.m_resources = list.ToArray(); } if (string.IsNullOrWhiteSpace(e.station.Value)) { val.m_craftingStation = null; } else { GameObject obj2 = Pieces.FindPrefab(e.station.Value.Trim()); CraftingStation val3 = ((obj2 != null) ? obj2.GetComponent<CraftingStation>() : null); if ((Object)(object)val3 != (Object)null) { val.m_craftingStation = val3; } else { FarmingToolsPlugin.Log.LogWarning((object)(e.prefab + " station: unknown crafting station '" + e.station.Value + "'.")); } } val.m_minStationLevel = Math.Max(1, e.level.Value); } } catch (Exception ex) { FarmingToolsPlugin.Log.LogWarning((object)("Could not apply the item recipes: " + ex.Message)); } } private static void Add() { try { Mats.Init(); AddBag(); AddStaff(); } catch (Exception ex) { FarmingToolsPlugin.Log.LogError((object)("Could not register the items: " + ex)); } finally { PrefabManager.OnVanillaPrefabsAvailable -= Add; } } private static ItemConfig Config(string prefab, string recipe, string station, int level) { //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_0016: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown ItemConfig val = new ItemConfig { Name = "$" + prefab, Description = "$" + prefab + "_desc", CraftingStation = (station ?? ""), MinStationLevel = Math.Max(1, level), Amount = 1 }; foreach (RequirementConfig item in Pieces.ParseRecipe(recipe)) { val.AddRequirement(item); } return val; } private static void AddBag() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown //IL_012f: 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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Expected O, but got Unknown GameObject val = ItemModels.SeedPouch(); Sprite val2 = Pieces.RenderIcon(val, Quaternion.Euler(18f, -35f, 0f)); ItemConfig val3 = Config("ft_seedbag", Cfg.BagRecipe.Value, Cfg.BagStation.Value, Cfg.BagStationLevel.Value); if ((Object)(object)val2 != (Object)null) { val3.Icon = val2; } CustomItem val4 = new CustomItem("ft_seedbag", "BeltStrength", val3); if ((Object)(object)val4.ItemPrefab == (Object)null) { FarmingToolsPlugin.Log.LogError((object)"Cloning BeltStrength failed; no seed bag."); return; } GameObject itemPrefab = val4.ItemPrefab; Transform transform = itemPrefab.transform; for (int num = transform.childCount - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)((Component)transform.GetChild(num)).gameObject); } Collider[] components = itemPrefab.GetComponents<Collider>(); for (int i = 0; i < components.Length; i++) { Object.DestroyImmediate((Object)(object)components[i]); } ((Object)val).name = "model"; val.transform.SetParent(transform, false); val.SetActive(true); SetLayer(val, itemPrefab.layer); BoxCollider obj = itemPrefab.AddComponent<BoxCollider>(); obj.center = new Vector3(0f, 0.11f, 0f); obj.size = new Vector3(0.24f, 0.22f, 0.2f); GameObject obj2 = ItemModels.SeedPouch(); GameObject val5 = new GameObject("attach_Hips"); val5.transform.SetParent(transform, false); obj2.transform.SetParent(val5.transform, false); obj2.AddComponent<HipPouch>(); obj2.SetActive(true); val5.SetActive(false); SharedData shared = val4.ItemDrop.m_itemData.m_shared; shared.m_equipStatusEffect = null; shared.m_weight = 1f; shared.m_teleportable = true; shared.m_setStatusEffect = null; shared.m_setName = ""; if ((Object)(object)val2 != (Object)null) { shared.m_icons = (Sprite[])(object)new Sprite[1] { val2 }; } ItemManager.Instance.AddItem(val4); _bag = itemPrefab; } private static void AddStaff() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Expected O, but got Unknown //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_010d: 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) ItemConfig val = Config("ft_staffofplenty", Cfg.StaffRecipe.Value, Cfg.StaffStation.Value, Cfg.StaffStationLevel.Value); CustomItem val2 = new CustomItem("ft_staffofplenty", "StaffGreenRoots", val); if ((Object)(object)val2.ItemPrefab == (Object)null) { FarmingToolsPlugin.Log.LogError((object)"Cloning StaffGreenRoots failed; no Staff of Plenty."); return; } GameObject itemPrefab = val2.ItemPrefab; Renderer[] componentsInChildren = itemPrefab.GetComponentsInChildren<Renderer>(true); foreach (Renderer val3 in componentsInChildren) { if (val3 is ParticleSystemRenderer) { continue; } Material[] sharedMaterials = val3.sharedMaterials; for (int j = 0; j < sharedMaterials.Length; j++) { if (!((Object)(object)sharedMaterials[j] == (Object)null) && sharedMaterials[j].HasProperty("_Color")) { Material val4 = new Material(sharedMaterials[j]) { name = ((Object)sharedMaterials[j]).name + "_plenty" }; Color color = val4.color; val4.color = new Color(color.r * 1.25f, color.g * 1.05f, color.b * 0.55f, color.a); sharedMaterials[j] = val4; } } val3.sharedMaterials = sharedMaterials; } SharedData shared = val2.ItemDrop.m_itemData.m_shared; Attack val5 = shared.m_attack.Clone(); val5.m_attackType = (AttackType)3; val5.m_attackProjectile = null; val5.m_attackAnimation = "staff_fireball"; val5.m_attackEitr = Cfg.StaffEitr.Value; val5.m_attackStamina = 0f; val5.m_triggerEffect = Effects("fx_greenroots_projectile_hit", "sfx_staff_elder_grow"); val5.m_startEffect = Effects("sfx_staff_elder_cast"); Attack val6 = val5.Clone(); val6.m_attackAnimation = "staff_fireball"; val6.m_attackEitr = Cfg.StaffSowEitr.Value; val6.m_triggerEffect = Effects("vfx_Place_replant", "sfx_staff_elder_grow"); shared.m_attack = val5; shared.m_secondaryAttack = val6; shared.m_triggerEffect = new EffectList(); shared.m_damages = default(DamageTypes); Sprite val7 = RenderStaffIcon(itemPrefab); if ((Object)(object)val7 != (Object)null) { shared.m_icons = (Sprite[])(object)new Sprite[1] { val7 }; } ItemManager.Instance.AddItem(val2); _staff = itemPrefab; } private static EffectList Effects(params string[] names) { //IL_0064: 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_0076: Expected O, but got Unknown //IL_0023: 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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Expected O, but got Unknown List<EffectData> list = new List<EffectData>(); foreach (string text in names) { GameObject val = Pieces.FindPrefab(text); if ((Object)(object)val != (Object)null) { list.Add(new EffectData { m_prefab = val, m_enabled = true, m_variant = -1 }); } else { FarmingToolsPlugin.Log.LogWarning((object)("Staff of Plenty: no effect " + text)); } } return new EffectList { m_effectPrefabs = list.ToArray() }; } private static Sprite RenderStaffIcon(GameObject pf) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) Transform val = pf.transform.Find("attach") ?? ((pf.transform.childCount > 0) ? pf.transform.GetChild(0) : null); if (!((Object)(object)val != (Object)null)) { return null; } return Pieces.RenderIcon(((Component)val).gameObject, Quaternion.Euler(0f, 90f, -45f)); } 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); } } } public static class Lang { private static readonly (string key, string en, string de)[] Texts = new(string, string, string)[30] { ("ft_plough", "Iron plough", "Eisenpflug"), ("ft_plough_desc", "Two iron shares on a frame of dark wood. Hitch it like a cart and lower the shares: behind you the soil turns into a field, two strides wide. Heavy work – it costs stamina.", "Zwei eiserne Scharen an einem Rahmen aus Dunkelholz. Spann ihn an wie einen Karren und senk die Scharen: Hinter dir wird der Boden zum Acker, zwei Schritte breit. Schwere Arbeit – sie kostet Ausdauer."), ("ft_seeddrill", "Dvergr seed drill", "Dvergr-Sämaschine"), ("ft_seeddrill_desc", "A Dvergr machine: fill its hopper with seed and pull it over a ploughed field. Five coulters lay the seed in even rows, as close as the plants still grow well – or in rows with a lane between. It sows only where a plant would grow.", "Eine Maschine der Dvergr: Füll den Saatkasten und zieh sie über einen gepflügten Acker. Fünf Scheibenschare legen die Saat in gleichmäßige Reihen, so dicht, wie die Pflanzen noch gut wachsen – oder in Reihen mit Gassen dazwischen. Sie sät nur, wo eine Pflanze auch wächst."), ("ft_hopper", "Seed hopper", "Saatkasten"), ("ft_reaper", "Reaper", "Erntewagen"), ("ft_reaper_desc", "A crop box of ashwood behind a header three metres wide: the reel lays the stalks onto the cutter bar, and what the header cuts lands in the box. It takes what a scythe takes. Set it to sow as well and it puts the same crop back from the seed in the box.", "Ein Erntekasten aus Aschholz hinter einem drei Meter breiten Mähwerk: Die Haspel legt die Halme auf den Messerbalken, und was das Mähwerk schneidet, landet im Kasten. Er nimmt, was auch die Sense nimmt. Stellst du ihn auf Nachsäen, setzt er dieselbe Frucht aus der Saat im Kasten gleich wieder."), ("ft_cropbox", "Crop box", "Erntekasten"), ("ft_seedbag", "Seed bag", "Saatbeutel"), ("ft_seedbag_desc", "A leather pouch of seed on the belt. Each crop you plant with the cultivator also goes into the eight places around it – three by three, as close as the plants still grow well. Every plant costs its seed.", "Ein Lederbeutel voll Saat am Gürtel. Jede Pflanze, die du mit dem Kultivator setzt, kommt auch auf die acht Plätze ringsum – drei mal drei, so dicht, wie die Pflanzen noch gut wachsen. Jede Pflanze kostet ihre Saat."), ("ft_staffofplenty", "Staff of Plenty", "Stab der Fülle"), ("ft_staffofplenty_desc", "A staff of the Deep North, bound with bloodgold and Nornathread. Raise it, and everything ripe around you gives up its fruit – crops, mushrooms, berries on the bush, flowers – and the harvest flies to your hands. Its second power sows your seed into the cultivated soil around you.", "Ein Stab aus dem Tiefen Norden, mit Gold beschlagen und mit Nornengarn umwunden. Heb ihn, und alles Reife um dich herum gibt seine Frucht her – Feldfrüchte, Pilze, Beeren am Strauch, Blumen –, und die Ernte fliegt dir in die Hände. Seine zweite Kraft sät deine Saat in den bestellten Boden um dich."), ("ft_hover_hitch", "[<color=yellow><b>$KEY_Use</b></color>] Hitch / unhitch", "[<color=yellow><b>$KEY_Use</b></color>] Anspannen / abspannen"), ("ft_hover_plough_lower", "[<color=yellow><b>$KEY_AltPlace + $KEY_Use</b></color>] Lower the shares", "[<color=yellow><b>$KEY_AltPlace + $KEY_Use</b></color>] Scharen senken"), ("ft_hover_plough_lift", "[<color=yellow><b>$KEY_AltPlace + $KEY_Use</b></color>] Lift the shares", "[<color=yellow><b>$KEY_AltPlace + $KEY_Use</b></color>] Scharen heben"), ("ft_hover_pattern", "[<color=yellow><b>$KEY_AltPlace + $KEY_Use</b></color>] Sowing: {0}", "[<color=yellow><b>$KEY_AltPlace + $KEY_Use</b></color>] Säen: {0}"), ("ft_pattern_dense", "dense", "dicht"), ("ft_pattern_rows", "rows with lanes", "Reihen mit Gassen"), ("ft_pattern_off", "coulters lifted", "Schare gehoben"), ("ft_hover_reap", "[<color=yellow><b>$KEY_AltPlace + $KEY_Use</b></color>] Header: {0}", "[<color=yellow><b>$KEY_AltPlace + $KEY_Use</b></color>] Mähwerk: {0}"), ("ft_reap_on", "reaping", "mähen"), ("ft_reap_sow", "reaping and sowing again", "mähen und nachsäen"), ("ft_reap_off", "lifted", "gehoben"), ("ft_hover_seed", "Seed: {0} ({1})", "Saat: {0} ({1})"), ("ft_hover_noseed", "No seed in the hopper", "Keine Saat im Kasten"), ("ft_msg_tired", "Too tired to plough.", "Zu erschöpft zum Pflügen."), ("ft_msg_ward", "This land is warded.", "Dieses Land ist geschützt."), ("ft_msg_boxfull", "The crop box is full.", "Der Erntekasten ist voll."), ("ft_msg_noseed", "No seed in the hopper that grows here.", "Keine Saat im Kasten, die hier wächst."), ("ft_msg_noseed_staff", "You carry no seed that grows here.", "Du trägst keine Saat, die hier wächst.") }; 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>(); (string, string, string)[] texts = Texts; for (int i = 0; i < texts.Length; i++) { (string, string, string) tuple = texts[i]; string item = tuple.Item1; string item2 = tuple.Item2; string item3 = tuple.Item3; dictionary[item] = item2; dictionary2[item] = item3; } string text = "English"; localization.AddTranslation(ref text, dictionary); text = "German"; localization.AddTranslation(ref text, dictionary2); } 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; } } } public static class Pieces { [HarmonyPatch(typeof(Game), "Start")] private static class ApplyOnWorldStart { private static void Postfix() { ApplyConfig(); } } private const string BasePrefab = "Cart"; public const string PloughPrefab = "ft_plough"; public const string DrillPrefab = "ft_seeddrill"; public const string ReaperPrefab = "ft_reaper"; private static readonly Dictionary<string, GameObject> Prefabs = new Dictionary<string, GameObject>(); private static (string prefab, ConfigEntry<string> recipe, ConfigEntry<string> station)[] Entries => new(string, ConfigEntry<string>, ConfigEntry<string>)[3] { ("ft_plough", Cfg.PloughRecipe, Cfg.PloughStation), ("ft_seeddrill", Cfg.DrillRecipe, Cfg.DrillStation), ("ft_reaper", Cfg.ReaperRecipe, Cfg.ReaperStation) }; public static void Init() { PrefabManager.OnVanillaPrefabsAvailable += Add; SynchronizationManager.OnConfigurationSynchronized += delegate { ApplyConfig(); }; (string, ConfigEntry<string>, ConfigEntry<string>)[] entries = Entries; for (int num = 0; num < entries.Length; num++) { (string, ConfigEntry<string>, ConfigEntry<string>) tuple = entries[num]; tuple.Item2.SettingChanged += delegate { ApplyConfig(); }; tuple.Item3.SettingChanged += delegate { ApplyConfig(); }; } } public static void ApplyConfig() { (string, ConfigEntry<string>, ConfigEntry<string>)[] entries = Entries; for (int i = 0; i < entries.Length; i++) { (string, ConfigEntry<string>, ConfigEntry<string>) tuple = entries[i]; if (Prefabs.TryGetValue(tuple.Item1, out var value) && (Object)(object)value != (Object)null) { Apply(value, tuple.Item2.Value, tuple.Item3.Value); } } } internal static GameObject FindPrefab(string name) { if (string.IsNullOrEmpty(name)) { return null; } GameObject val = null; if ((Object)(object)ObjectDB.instance != (Object)null) { val = ObjectDB.instance.GetItemPrefab(name); } if ((Object)(object)val == (Object)null && (Object)(object)ZNetScene.instance != (Object)null) { val = ZNetScene.instance.GetPrefab(name); } if ((Object)(object)val == (Object)null) { try { val = PrefabManager.Instance.GetPrefab(name); } catch (Exception) { } } return val; } internal static void Apply(GameObject prefab, string recipe, string station) { //IL_0088: 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_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Expected O, but got Unknown try { Piece val = (((Object)(object)prefab != (Object)null) ? prefab.GetComponent<Piece>() : null); if ((Object)(object)val == (Object)null) { return; } List<Requirement> list = new List<Requirement>(); foreach (RequirementConfig item in ParseRecipe(recipe)) { GameObject obj = FindPrefab(item.Item); ItemDrop val2 = ((obj != null) ? obj.GetComponent<ItemDrop>() : null); if ((Object)(object)val2 == (Object)null) { FarmingToolsPlugin.Log.LogWarning((object)(((Object)prefab).name + " recipe: unknown item '" + item.Item + "'.")); continue; } list.Add(new Requirement { m_resItem = val2, m_amount = item.Amount, m_recover = true }); } if (list.Count > 0) { val.m_resources = list.ToArray(); } if (string.IsNullOrWhiteSpace(station)) { val.m_craftingStation = null; return; } GameObject obj2 = FindPrefab(station.Trim()); CraftingStation val3 = ((obj2 != null) ? obj2.GetComponent<CraftingStation>() : null); if ((Object)(object)val3 != (Object)null) { val.m_craftingStation = val3; } else { FarmingToolsPlugin.Log.LogWarning((object)(((Object)prefab).name + " station: unknown crafting station '" + station + "'.")); } } catch (Exception ex) { FarmingToolsPlugin.Log.LogWarning((object)("Could not apply the recipe of " + ((prefab != null) ? ((Object)prefab).name : null) + ": " + ex.Message)); } } private static void Add() { try { Mats.Init(); AddImplement("ft_plough", ImplementModels.Plough(), typeof(Plough), Cfg.PloughRecipe.Value, Cfg.PloughStation.Value, 60f, 400f, box: false); AddImplement("ft_seeddrill", ImplementModels.SeedDrill(), typeof(SeedDrill), Cfg.DrillRecipe.Value, Cfg.DrillStation.Value, 80f, 600f, box: true); AddImplement("ft_reaper", ImplementModels.Reaper(), typeof(Reaper), Cfg.ReaperRecipe.Value, Cfg.ReaperStation.Value, 70f, 800f, box: true); } catch (Exception ex) { FarmingToolsPlugin.Log.LogError((object)("Could not register the implements: " + ex)); } finally { PrefabManager.OnVanillaPrefabsAvailable -= Add; } } private static void AddImplement(string prefabName, ImplementLayout layout, Type behaviour, string recipe, string station, float mass, float health, bool box) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_0036: 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) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Expected O, but got Unknown Sprite icon = RenderIcon(layout.Root, Quaternion.Euler(-24f, 138f, 0f)); PieceConfig val = new PieceConfig { Name = "$" + prefabName, Description = "$" + prefabName + "_desc", PieceTable = "Hammer", Category = "Misc", CraftingStation = (station ?? ""), Icon = icon }; foreach (RequirementConfig item in ParseRecipe(recipe)) { val.AddRequirement(item); } CustomPiece val2 = new CustomPiece(prefabName, "Cart", val); if ((Object)(object)val2.PiecePrefab == (Object)null) { FarmingToolsPlugin.Log.LogError((object)("Cloning Cart failed; no " + prefabName + ".")); Object.Destroy((Object)(object)layout.Root); return; } if (string.IsNullOrWhiteSpace(station)) { Piece component = val2.PiecePrefab.GetComponent<Piece>(); if ((Object)(object)component != (Object)null) { component.m_craftingStation = null; } } Rebuild(val2.PiecePrefab, prefabName, layout, behaviour, mass, health, box); PieceManager.Instance.AddPiece(val2); Prefabs[prefabName] = val2.PiecePrefab; } private static void Rebuild(GameObject prefab, string prefabName, ImplementLayout layout, Type behaviour, float mass, float health, bool box) { //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Expected O, but got Unknown //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: 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_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_0254: 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_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) Transform transform = prefab.transform; int layer = LayerMask.NameToLayer("vehicle"); Vagon component = prefab.GetComponent<Vagon>(); Container componentInChildren = prefab.GetComponentInChildren<Container>(true); HashSet<Transform> hashSet = new HashSet<Transform>(); Rigidbody[] wheels = component.m_wheels; foreach (Rigidbody val in wheels) { if ((Object)(object)val != (Object)null) { hashSet.Add(((Component)val).transform); } } if ((Object)(object)component.m_attachPoint != (Object)null) { hashSet.Add(component.m_attachPoint); } if (box && (Object)(object)componentInChildren != (Object)null) { hashSet.Add(((Component)componentInChildren).transform); } for (int num = transform.childCount - 1; num >= 0; num--) { if (!hashSet.Contains(transform.GetChild(num))) { Object.DestroyImmediate((Object)(object)((Component)transform.GetChild(num)).gameObject); } } LODGroup[] components = prefab.GetComponents<LODGroup>(); for (int i = 0; i < components.Length; i++) { Object.DestroyImmediate((Object)(object)components[i]); } Collider[] components2 = prefab.GetComponents<Collider>(); for (int i = 0; i < components2.Length; i++) { Object.DestroyImmediate((Object)(object)components2[i]); } GameObject root = layout.Root; root.transform.SetParent(transform, false); root.transform.localPosition = Vector3.zero; root.transform.localRotation = Quaternion.identity; root.SetActive(true); SetLayer(root, prefab.layer); GameObject val2 = new GameObject("colliders"); val2.transform.SetParent(transform, false); val2.layer = layer; foreach (var solid in layout.Solids) { Vector3 item = solid.center; Vector3 item2 = solid.size; BoxCollider obj = val2.AddComponent<BoxCollider>(); obj.center = item; obj.size = item2; } wheels = component.m_wheels; foreach (Rigidbody val3 in wheels) { if (!((Object)(object)val3 == (Object)null)) { Vector3 localPosition = ((Component)val3).transform.localPosition; ((Component)val3).transform.localPosition = new Vector3(Mathf.Sign(localPosition.x) * layout.WheelX, localPosition.y, localPosition.z); } } component.m_attachPoint.localPosition = layout.Attach; component.m_lineAttachPoints0 = MeshKit.Child(transform, "rope0", layout.Line0, Quaternion.identity); component.m_lineAttachPoints1 = MeshKit.Child(transform, "rope1", layout.Line1, Quaternion.identity); component.m_loadVis = new List<LoadData>(); component.m_slipperyCollider = null; component.m_wheelLoops = ((IEnumerable<ZSFX>)(((object)component.m_wheelLoops) ?? ((object)new ZSFX[0]))).Where((ZSFX z) => (Object)(object)z != (Object)null).ToArray(); component.m_baseMass = mass; component.m_name = "$" + prefabName; if (box && (Object)(object)componentInChildren != (Object)null) { Transform transform2 = ((Component)componentInChildren).transform; for (int num2 = transform2.childCount - 1; num2 >= 0; num2--) { Object.DestroyImmediate((Object)(object)((Component)transform2.GetChild(num2)).gameObject); } Component[] components3 = ((Component)transform2).GetComponents<Component>(); foreach (Component val4 in components3) { if (val4 is Collider || val4 is MeshRenderer || val4 is MeshFilter) { Object.DestroyImmediate((Object)(object)val4); } } transform2.localPosition = Vector3.zero; transform2.localRotation = Quaternion.identity; transform2.localScale = Vector3.one; BoxCollider obj2 = ((Component)transform2).gameObject.AddComponent<BoxCollider>(); obj2.center = layout.BoxCenter; obj2.size = layout.BoxSize; bool flag = behaviour == typeof(Reaper); componentInChildren.m_name = (flag ? "$ft_cropbox" : "$ft_hopper"); componentInChildren.m_width = (flag ? 6 : 4); componentInChildren.m_height = (flag ? 3 : 2); component.m_container = componentInChildren; } else { component.m_container = null; } WearNTear component2 = prefab.GetComponent<WearNTear>(); if ((Object)(object)component2 != (Object)null) { component2.m_new = root; component2.m_worn = root; component2.m_broken = root; component2.m_health = health; component2.m_fragmentRoots = null; } Implement obj3 = (Implement)(object)prefab.AddComponent(behaviour); obj3.m_workBack = layout.WorkBack; obj3.m_halfWidth = layout.HalfWidth; obj3.m_centerOfMass = layout.CenterOfMass; if (obj3 is Plough plough) { plough.m_shareFrame = layout.WorkFrame; } if (obj3 is SeedDrill seedDrill) { seedDrill.m_coulterFrame = layout.WorkFrame; } if (obj3 is Reaper reaper) { reaper.m_cutterFrame = layout.WorkFrame; reaper.m_reel = layout.Reel; } } 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); } } internal static Sprite RenderIcon(GameObject visual, Quaternion rotation) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_0056: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Expected O, but got Unknown if (GUIManager.IsHeadless()) { return null; } GameObject val = null; try { val = Object.Instantiate<GameObject>(visual); val.SetActive(true); val.transform.position = Vector3.zero; val.transform.rotation = Quaternion.identity; return RenderManager.Instance.Render(new RenderRequest(val) { Rotation = rotation, Width = 128, Height = 128, ParticleSimulationTime = -1f, UseCache = false }); } catch (Exception ex) { FarmingToolsPlugin.Log.LogWarning((object)("Icon rendering failed: " + ex.Message)); return null; } finally { if ((Object)(object)val != (Object)null) { Object.DestroyImmediate((Object)(object)val); } } } public static List<RequirementConfig> ParseRecipe(string recipe) { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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)); } else { FarmingToolsPlugin.Log.LogWarning((object)("Ignoring invalid recipe entry '" + text + "'.")); } } return list; } } [BepInPlugin("zap.farmingtools", "Farming Tools", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class FarmingToolsPlugin : BaseUnityPlugin { public const string PluginGuid = "zap.farmingtools"; public const string PluginName = "Farming Tools"; public const string PluginVersion = "1.0.0"; private Harmony _harmony; public static FarmingToolsPlugin 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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(); Pieces.Init(); Items.Init(); _harmony = new Harmony("zap.farmingtools"); _harmony.PatchAll(typeof(FarmingToolsPlugin).Assembly); SelfTest.TryStart(((Component)this).gameObject); } private void Update() { Harvest.Update(); } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } } } namespace FarmingTools.Visual { public class HipPouch : MonoBehaviour { public static readonly Vector3 Offset = new Vector3(0.27f, -0.04f, -0.03f); public const float Size = 0.85f; private void Start() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_00ab: 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_00cd: Unknown result type (might be due to invalid IL or missing references) Transform val = (((Object)(object)((Component)this).transform.parent != (Object)null) ? ((Component)this).transform.parent.parent : null); if (!((Object)(object)val == (Object)null)) { VisEquipment componentInParent = ((Component)this).GetComponentInParent<VisEquipment>(); Transform val2 = (((Object)(object)componentInParent != (Object)null) ? ((Component)componentInParent).transform : val.root); ((Component)this).transform.position = val.position + val2.TransformDirection(Offset); ((Component)this).transform.rotation = val2.rotation * Quaternion.Euler(0f, 90f, 4f); float num = Mathf.Max(0.0001f, ((Component)this).transform.parent.lossyScale.x); ((Component)this).transform.localScale = Vector3.one * (0.85f / num); } } } internal sealed class ImplementLayout { public GameObject Root; public Transform WorkFrame; public readonly List<(Vector3 center, Vector3 size)> Solids = new List<(Vector3, Vector3)>(); public Vector3 BoxCenter; public Vector3 BoxSize; public float WheelX = 0.8f; public Vector3 Attach = new Vector3(0f, 0.58f, 2.08f); public Vector3 Line0; public Vector3 Line1; public float WorkBack; public float HalfWidth; public Vector3 CenterOfMass = new Vector3(0f, 0.55f, 0.45f); public Transform Reel; } internal static class ImplementModels { public const float AxleY = 0.52f; public const float AxleZ = -0.13f; private static void Beam(PartSet ps, Material mat, Vector3 a, Vector3 b, float w, float h, float uv = 2f) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_0036: 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_004f: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) Vector3 val = b - a; if (!(((Vector3)(ref val)).sqrMagnitude < 1E-06f)) { Quaternion rot = Quaternion.LookRotation(((Vector3)(ref val)).normalized, (Mathf.Abs(((Vector3)(ref val)).normalized.y) > 0.95f) ? Vector3.forward : Vector3.up); MeshKit.Box(ps[mat], (a + b) * 0.5f, new Vector3(w, h, ((Vector3)(ref val)).magnitude), rot, uv); } } private static void Rod(PartSet ps, Material mat, Vector3 a, Vector3 b, float r, int seg = 8) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) MeshKit.Cylinder(ps[mat], a, b, r, seg); } private static void PrismX(PartSet ps, Material mat, IList<Vector2> sec, float x0, float x1, bool caps = true) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: 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) //IL_00c9: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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_0104: 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_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: 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_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: 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_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0259: 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) MeshBuilder meshBuilder = ps[mat]; int count = sec.Count; Vector3 n = default(Vector3); Vector3 p = default(Vector3); Vector3 p2 = default(Vector3); Vector3 p3 = default(Vector3); Vector3 p4 = default(Vector3); for (int i = 0; i < count; i++) { Vector2 val = sec[i]; Vector2 val2 = sec[(i + 1) % count]; Vector2 val3 = val2 - val; Vector2 normalized = ((Vector2)(ref val3)).normalized; ((Vector3)(ref n))..ctor(0f, 0f - normalized.x, normalized.y); ((Vector3)(ref p))..ctor(x0, val.x, val.y); ((Vector3)(ref p2))..ctor(x0, val2.x, val2.y); ((Vector3)(ref p3))..ctor(x1, val2.x, val2.y); ((Vector3)(ref p4))..ctor(x1, val.x, val.y); val3 = val2 - val; float magnitude = ((Vector2)(ref val3)).magnitude; float num = x1 - x0; int a = meshBuilder.Add(p, n, new Vector2(0f, 0f)); int num2 = meshBuilder.Add(p2, n, new Vector2(0f, magnitude * 2f)); int c = meshBuilder.Add(p3, n, new Vector2(num * 2f, magnitude * 2f)); int num3 = meshBuilder.Add(p4, n, new Vector2(num * 2f, 0f)); meshBuilder.Quad(a, num2, c, num3); meshBuilder.Quad(a, num3, c, num2); } if (!caps) { return; } Vector3 n2 = default(Vector3); for (int j = 0; j < 2; j++) { float num4 = ((j == 0) ? x0 : x1); ((Vector3)(ref n2))..ctor((j == 0) ? (-1f) : 1f, 0f, 0f); int a2 = meshBuilder.Add(new Vector3(num4, Avg(sec).x, Avg(sec).y), n2, new Vector2(0.5f, 0.5f)); for (int k = 0; k < count; k++) { Vector2 val4 = sec[k]; Vector2 val5 = sec[(k + 1) % count]; int num5 = meshBuilder.Add(new Vector3(num4, val4.x, val4.y), n2, new Vector2(val4.y * 2f, val4.x * 2f)); int num6 = meshBuilder.Add(new Vector3(num4, val5.x, val5.y), n2, new Vector2(val5.y * 2f, val5.x * 2f)); meshBuilder.Tri(a2, num5, num6); meshBuilder.Tri(a2, num6, num5); } } } private static Vector2 Avg(IList<Vector2> p) { //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_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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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) Vector2 val = Vector2.zero; foreach (Vector2 item in p) { val += item; } return val / (float)p.Count; } private static void Cog(PartSet ps, Material mat, Vector3 c, float r, float thick, int teeth) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) MeshKit.Cylinder(ps[mat], c - Vector3.right * thick * 0.5f, c + Vector3.right * thick * 0.5f, r, 20); MeshKit.Cylinder(ps[mat], c - Vector3.right * thick, c + Vector3.right * thick, r * 0.25f, 10); Vector3 val = default(Vector3); for (int i = 0; i < teeth; i++) { float num = (float)i * (float)Math.PI * 2f / (float)teeth; ((Vector3)(ref val))..ctor(0f, Mathf.Cos(num), Mathf.Sin(num)); MeshKit.Box(ps[mat], c + val * (r + 0.02f), new Vector3(thick, 0.045f, 0.04f), Quaternion.LookRotation(Vector3.right, val), 4f); } } private static void Spring(PartSet ps, Material mat, Vector3 a, Vector3 b, float r, int turns) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0021: 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_0033: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_009f: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) Vector3 val = b - a; Quaternion val2 = Quaternion.FromToRotation(Vector3.up, ((Vector3)(ref val)).normalized); int num = turns * 10; Vector3 a2 = a + val2 * new Vector3(r, 0f, 0f); for (int i = 1; i <= num; i++) { float num2 = (float)i / (float)num; float num3 = num2 * (float)turns * (float)Math.PI * 2f; Vector3 val3 = a + val * num2 + val2 * new Vector3(Mathf.Cos(num3) * r, 0f, Mathf.Sin(num3) * r); MeshKit.Cylinder(ps[mat], a2, val3, 0.009f, 5, caps: false); a2 = val3; } } private static Transform Frame(GameObject root, string name, Vector3 pivot) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) return MeshKit.Child(root.transform, name, pivot, Quaternion.identity); } public static ImplementLayout Plough() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_007c: 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_00c2: 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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_041d: Unknown result type (might be due to invalid IL or missing references) //IL_0422: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_04c4: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_050f: Unknown result type (might be due to invalid IL or missing references) //IL_0523: Unknown result type (might be due to invalid IL or missing references) //IL_0537: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Unknown result type (might be due to invalid IL or missing references) //IL_0589: Unknown result type (might be due to invalid IL or missing references) //IL_0597: Unknown result type (might be due to invalid IL or missing references) //IL_059c: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05f1: Unknown result type (might be due to invalid IL or missing references) //IL_0605: Unknown result type (might be due to invalid IL or missing references) //IL_0619: Unknown result type (might be due to invalid IL or missing references) //IL_0647: Unknown result type (might be due to invalid IL or missing references) //IL_065b: Unknown result type (might be due to invalid IL or missing references) //IL_066f: Unknown result type (might be due to invalid IL or missing references) //IL_06b1: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06e9: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_072a: Unknown result type (might be due to invalid IL or missing references) //IL_073e: Unknown result type (might be due to invalid IL or missing references) //IL_0768: Unknown result type (might be due to invalid IL or missing references) //IL_076d: Unknown result type (might be due to invalid IL or missing references) //IL_0782: Unknown result type (might be due to invalid IL or missing references) //IL_0787: Unknown result type (might be due to invalid IL or missing references) Mats.Init(); ImplementLayout implementLayout = new ImplementLayout { Root = new GameObject("ft_plough_model"), WheelX = 0.86f, WorkBack = 1.0799999f, HalfWidth = 0.9f }; implementLayout.Root.SetActive(false); Object.DontDestroyOnLoad((Object)(object)implementLayout.Root); PartSet partSet = new PartSet(); float num = 0.62f; for (int i = -1; i <= 1; i += 2) { Beam(partSet, Mats.DarkWood, new Vector3((float)i * 0.66f, num, 0.25f), new Vector3((float)i * 0.6f, 0.74f, 2.2f), 0.08f, 0.09f); Beam(partSet, Mats.DarkWood, new Vector3((float)i * 0.74f, num, 0.35f), new Vector3((float)i * 0.74f, num - 0.03f, -1.3f), 0.1f, 0.12f); Beam(partSet, Mats.Wood, new Vector3((float)i * 0.6f, num + 0.05f, -1.25f), new Vector3((float)i * 0.4f, 1.08f, -1.8f), 0.06f, 0.07f); MeshKit.Box(partSet[Mats.Iron], new Vector3((float)i * 0.74f, 0.57f, -0.13f), new Vector3(0.13f, 0.14f, 0.16f), Quaternion.identity, 4f); } Beam(partSet, Mats.DarkWood, new Vector3(-0.8f, num, 0.3f), new Vector3(0.8f, num, 0.3f), 0.1f, 0.1f); Beam(partSet, Mats.DarkWood, new Vector3(-0.8f, num - 0.03f, -1.25f), new Vector3(0.8f, num - 0.03f, -1.25f), 0.1f, 0.1f); Beam(partSet, Mats.DarkWood, new Vector3(-0.6f, 0.71f, 1.25f), new Vector3(0.6f, 0.71f, 1.25f), 0.07f, 0.07f); Beam(partSet, Mats.DarkWood, new Vector3(0f, 0.72f, 1.25f), new Vector3(0f, num + 0.02f, -1.25f), 0.14f, 0.16f); for (float num2 = 0.9f; num2 > -1.2f; num2 -= 0.7f) { MeshKit.Box(partSet[Mats.Iron], new Vector3(0f, 0.66f + (num2 + 1.25f) * 0.04f, num2), new Vector3(0.16f, 0.18f, 0.05f), Quaternion.Euler(-2.3f, 0f, 0f), 4f); } Beam(partSet, Mats.Wood, new Vector3(-0.42f, 1.06f, -1.78f), new Vector3(0.42f, 1.06f, -1.78f), 0.05f, 0.05f); Rod(partSet, Mats.Iron, new Vector3(-0.9f, 0.52f, -0.13f), new Vector3(0.9f, 0.52f, -0.13f), 0.035f); for (int j = -1; j <= 1; j += 2) { MeshKit.Box(partSet[Mats.Iron], new Vector3((float)j * 0.6f, 0.735f, 2.1f), new Vector3(0.1f, 0.11f, 0.12f), Quaternion.Euler(-4f, 0f, 0f), 4f); } partSet.Emit(implementLayout.Root.transform, "body"); Vector3 pivot = new Vector3(0f, num - 0.02f, -0.13f); implementLayout.WorkFrame = Frame(implementLayout.Root, "shares", pivot); float[] array = new float[2] { -0.45f, 0.45f }; foreach (float num3 in array) { Beam(partSet, Mats.DarkWood, P(num3, num - 0.08f, -0.08f), P(num3, num - 0.1f, -1.12f), 0.09f, 0.1f); Beam(partSet, Mats.Iron, P(num3, num - 0.14f, -0.86f), P(num3, 0.06f, -0.98f), 0.05f, 0.08f, 4f); MeshKit.Box(partSet[Mats.Iron], P(num3 - 0.03f, 0.32f, -0.6f), new Vector3(0.016f, 0.48f, 0.12f), Quaternion.Euler(18f, 0f, 0f), 4f); List<Vector2> poly = new List<Vector2> { new Vector2(num3 - 0.14f, -1.02f), new Vector2(num3 - 0.02f, -0.7f), new Vector2(num3 + 0.1f, -1.02f) }; partSet.Push(-pivot, Quaternion.identity); MeshKit.ExtrudeXZ(partSet[Mats.Iron], poly, -0.02f, 0.025f, 4f); partSet.Pop(); MeshKit.Box(partSet[Mats.Iron], P(num3 + 0.1f, 0.14f, -0.98f), new Vector3(0.36f, 0.28f, 0.025f), Quaternion.Euler(-28f, 42f, -12f), 4f); MeshKit.Box(partSet[Mats.Iron], P(num3 + 0.2f, 0.2f, -1.1f), new Vector3(0.2f, 0.2f, 0.025f), Quaternion.Euler(-35f, 62f, -18f), 4f); } partSet.Emit(implementLayout.WorkFrame, "shares"); implementLayout.Solids.Add((new Vector3(0f, num, -0.47f), new Vector3(1.6f, 0.14f, 1.6f))); implementLayout.Solids.Add((new Vector3(0f, 0.9f, -1.6f), new Vector3(0.9f, 0.3f, 0.3f))); for (int l = -1; l <= 1; l += 2) { implementLayout.Solids.Add((new Vector3((float)l * 0.64f, 0.69f, 1.25f), new Vector3(0.08f, 0.1f, 1.9f))); } implementLayout.Line0 = new Vector3(-0.6f, 0.75f, 2.15f); implementLayout.Line1 = new Vector3(0.6f, 0.75f, 2.15f); implementLayout.WorkBack = 0.98f; return implementLayout; Vector3 P(float x, float y, float z) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return new Vector3(x, y, z) - pivot; } } public static ImplementLayout SeedDrill() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_0102: 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_011b: 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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: 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_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_026c: 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_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: 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_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_039e: 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_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_04d4: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_0556: Unknown result type (might be due to invalid IL or missing references) //IL_0567: Unknown result type (might be due to invalid IL or missing references) //IL_058e: Unknown result type (might be due to invalid IL or missing references) //IL_059f: Unknown result type (might be due to invalid IL or missing references) //IL_05e7: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_063d: Unknown result type (might be due to invalid IL or missing references) //IL_0651: Unknown result type (might be due to invalid IL or missing references) //IL_0691: Unknown result type (might be due to invalid IL or missing references) //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_06a8: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06e4: Unknown result type (might be due to invalid IL or missing references) //IL_071d: Unknown result type (might be due to invalid IL or missing references) //IL_0737: Unknown result type (might be due to invalid IL or missing references) //IL_0782: Unknown result type (might be due to invalid IL or missing references) //IL_0795: Unknown result type (might be due to invalid IL or missing references) //IL_07cd: Unknown result type (might be due to invalid IL or missing references) //IL_07e6: Unknown result type (might be due to invalid IL or missing references) //IL_0821: Unknown result type (might be due to invalid IL or missing references) //IL_0835: Unknown result type (might be due to invalid IL or missing references) //IL_0849: Unknown result type (might be due to invalid IL or missing references) //IL_08b2: Unknown result type (might be due to invalid IL or missing references) //IL_08c3: Unknown result type (might be due to invalid IL or missing references) //IL_0908: Unknown result type (might be due to invalid IL or missing references) //IL_091c: Unknown result type (might be due to invalid IL or missing references) //IL_0949: Unknown result type (might be due to invalid IL or missing references) //IL_095d: Unknown result type (might be due to invalid IL or missing references) //IL_0987: Unknown result type (might be due to invalid IL or missing references) //IL_098c: Unknown result type (might be due to invalid IL or missing references) //IL_09a1: Unknown result type (might be due to invalid IL or missing references) //IL_09a6: Unknown result type (might be due to invalid IL or missing references) //IL_09bb: Unknown result type (might be due to invalid IL or missing references) //IL_09c0: Unknown result type (might be due to invalid IL or missing references) //IL_09d5: Unknown result type (might be due to invalid IL or missing references) //IL_09da: Unknown result type (might be due to invalid IL or missing references) Mats.Init(); ImplementLayout implementLayout = new ImplementLayout { Root = new GameObject("ft_seeddrill_model"), WheelX = 1.36f, HalfWidth = 1.5f }; implementLayout.Root.SetActive(false); Object.DontDestroyOnLoad((Object)(object)implementLayout.Root); PartSet partSet = new PartSet(); float num = 0.62f; for (int i = -1; i <= 1; i += 2) { Beam(partSet, Mats.DvergrWood, new Vector3((float)i * 1.22f, num, 0.38f), new Vector3((float)i * 1.22f, num, -0.98f), 0.1f, 0.12f); Beam(partSet, Mats.DvergrWood, new Vector3((float)i * 0.64f, num, 0.38f), new Vector3((float)i * 0.6f, 0.74f, 2.2f), 0.08f, 0.09f); MeshKit.Box(partSet[Mats.DvergrMetal], new Vector3((float)i * 1.22f, 0.57f, -0.13f), new Vector3(0.14f, 0.15f, 0.18f), Quaternion.identity, 4f); MeshKit.Box(partSet[Mats.Copper], new Vector3((float)i * 0.6f, 0.735f, 2.1f), new Vector3(0.1f, 0.11f, 0.12f), Quaternion.Euler(-4f, 0f, 0f), 4f); } Beam(partSet, Mats.DvergrWood, new Vector3(-1.3f, num, 0.38f), new Vector3(1.3f, num, 0.38f), 0.1f, 0.1f); Beam(partSet, Mats.DvergrWood, new Vector3(-1.3f, num, -0.98f), new Vector3(1.3f, num, -0.98f), 0.1f, 0.1f); Beam(partSet, Mats.DvergrWood, new Vector3(-0.63f, 0.71f, 1.25f), new Vector3(0.63f, 0.71f, 1.25f), 0.07f, 0.07f); Rod(partSet, Mats.DvergrMetal, new Vector3(-1.4f, 0.52f, -0.13f), new Vector3(1.4f, 0.52f, -0.13f), 0.04f); List<Vector2> sec = new List<Vector2> { new Vector2(0.7f, -0.38f), new Vector2(0.7f, 0.08f), new Vector2(1.28f, 0.28f), new Vector2(1.28f, -0.6f) }; PrismX(partSet, Mats.DvergrWood, sec, -1.32f, 1.32f); float[] array = new float[4] { -1.28f, -0.43f, 0.43f, 1.28f }; foreach (float num2 in array) { MeshKit.Box(partSet[Mats.DvergrMetal], new Vector3(num2, 0.99f, 0.19f), new Vector3(0.06f, 0.64f, 0.02f), Quaternion.Euler(-21f, 0f, 0f), 4f); MeshKit.Box(partSet[Mats.DvergrMetal], new Vector3(num2, 0.99f, -0.5f), new Vector3(0.06f, 0.6f, 0.02f), Quaternion.Euler(14f, 0f, 0f), 4f); } Beam(partSet, Mats.Copper, new Vector3(-1.32f, 1.29f, 0.28f), new Vector3(1.32f, 1.29f, 0.28f), 0.04f, 0.04f, 4f); Beam(partSet, Mats.Copper, new Vector3(-1.32f, 1.29f, -0.6f), new Vector3(1.32f, 1.29f, -0.6f), 0.04f, 0.04f, 4f); MeshKit.Box(partSet[Mats.DvergrWood], new Vector3(0f, 1.36f, -0.17f), new Vector3(2.66f, 0.03f, 0.9f), Quaternion.Euler(-9f, 0f, 0f)); for (int k = -1; k <= 1; k += 2) { array = new float[2] { -0.35f, 0.05f }; foreach (float num3 in array) { Beam(partSet, Mats.DvergrMetal, new Vector3((float)k * 1.15f, num + 0.05f, num3), new Vector3((float)k * 1.15f, 0.71999997f, num3), 0.05f, 0.05f, 4f); } } float[] array2 = new float[5] { -1.2f, -0.6f, 0f, 0.6f, 1.2f }; array = array2; foreach (float num4 in array) { Rod(partSet, Mats.Copper, new Vector3(num4, 0.71f, -0.15f), new Vector3(num4, 0.42f, -0.62f), 0.028f); MeshKit.Cylinder(partSet[Mats.Copper], new Vector3(num4, 0.47f, -0.55f), new Vector3(num4, 0.38f, -0.67f), 0.045f, 0.03f, 8); } Cog(partSet, Mats.Copper, new Vector3(-1.08f, 0.52f, -0.13f), 0.16f, 0.04f, 12); Cog(partSet, Mats.Copper, new Vector3(-1.08f, 0.82f, -0.2f), 0.1f, 0.035f, 9); Beam(partSet, Mats.DvergrMetal, new Vector3(-1.08f, 0.52f, -0.13f), new Vector3(-1.08f, 0.82f, -0.2f), 0.025f, 0.09f, 4f); partSet.Emit(implementLayout.Root.transform, "body"); Vector3 pivot = new Vector3(0f, 0.52f, -0.13f); implementLayout.WorkFrame = Frame(implementLayout.Root, "coulters", pivot); Beam(partSet, Mats.DvergrMetal, P(-1.3f, 0.36f, -0.7f), P(1.3f, 0.36f, -0.7f), 0.05f, 0.06f, 4f); for (int l = -1; l <= 1; l += 2) { Beam(partSet, Mats.DvergrMetal, P((float)l * 1.3f, 0.52f, -0.21f), P((float)l * 1.3f, 0.36f, -0.7f), 0.05f, 0.05f, 4f); } array = array2; foreach (float num5 in array) { Beam(partSet, Mats.DvergrMetal, P(num5, 0.36f, -0.7f), P(num5, 0.14f, -0.86f), 0.035f, 0.05f, 4f); MeshKit.Cylinder(partSet[Mats.Iron], P(num5 - 0.012f, 0.13f, -0.88f), P(num5 + 0.012f, 0.13f, -0.88f), 0.13f, 18); MeshKit.Box(partSet[Mats.Copper], P(num5 + 0.04f, 0.1f, -0.98f), new Vector3(0.04f, 0.14f, 0.1f), Quaternion.Euler(20f, 0f, 0f), 4f); } partSet.Emit(implementLayout.WorkFrame, "coulters"); array = new float[2] { -0.9f, 0.9f }; foreach (float num6 in array) { Spring(partSet, Mats.Copper, new Vector3(num6, num - 0.05f, -0.92f), new Vector3(num6, 0.4f, -0.72f), 0.035f, 7); } partSet.Emit(implementLayout.Root.transform, "springs"); implementLayout.Solids.Add((new Vector3(0f, num, -0.3f), new Vector3(2.6f, 0.14f, 1.45f))); for (int m = -1; m <= 1; m += 2) { implementLayout.Solids.Add((new Vector3((float)m * 0.63f, 0.69f, 1.3f), new Vector3(0.08f, 0.1f, 1.85f))); } implementLayout.BoxCenter = new Vector3(0f, 1.01f, -0.16f); implementLayout.BoxSize = new Vector3(2.66f, 0.64f, 0.86f); implementLayout.Line0 = new Vector3(-0.6f, 0.75f, 2.15f); implementLayout.Line1 = new Vector3(0.6f, 0.75f, 2.15f); implementLayout.WorkBack = 0.88f; return implementLayout; Vector3 P(float x, float y, float z) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return new Vector3(x, y, z) - pivot; } } public static ImplementLayout Reaper() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0353: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: 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_040a: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_0446: 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_010a: Unknown result type (might be due to invalid IL or missing references) //IL_011e: 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_0493: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04cb: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04d5: Unknown result type (might be due to invalid IL or missing references) //IL_0537: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Unknown result type (might be due to invalid IL or missing references) //IL_055f: 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_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: 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_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_0586: Unknown result type (might be due to invalid IL or missing references) //IL_059b: Unknown result type (might be due to invalid IL or missing references) //IL_05b0: Unknown result type (might be due to invalid IL or missing references) //IL_05c5: Unknown result type (might be due to invalid IL or missing references) //IL_06a9: Unknown result type (might be due to invalid IL or missing references) //IL_06ae: Unknown result type (might be due to invalid IL or missing references) //IL_06ce: Unknown result type (might be due to invalid IL or missing references) //IL_06e2: Unknown result type (might be due to invalid IL or missing references) //IL_063d: Unknown result type (might be due to invalid IL or missing references) //IL_0656: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0740: Unknown result type (might be due to invalid IL or missing references) //IL_0745: Unknown result type (might be due to invalid IL or missing references) //IL_074c: Unknown result type (might be due to invalid IL or missing references) //IL_0751: Unknown result type (might be due to invalid IL or missing references) //IL_0765: Unknown result type (might be due to invalid IL or missing references) //IL_076a: Unknown result type (might be due to invalid IL or missing references) //IL_0771: Unknown result type (might be due to invalid IL or missing references) //IL_0776: Unknown result type (might be due to invalid IL or missing references) //IL_083b: Unknown result type (might be due to invalid IL or missing references) //IL_084f: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02f9: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_07c5: Unknown result type (might be due to invalid IL or missing references) //IL_07d6: Unknown result type (might be due to invalid IL or missing references) //IL_07db: Unknown result type (might be due to invalid IL or missing references) //IL_07e2: Unknown result type (might be due to invalid IL or missing references) //IL_07e7: Unknown result type (might be due to invalid IL or missing references) //IL_087c: Unknown result type (might be due to invalid IL or missing references) //IL_0890: Unknown result type (might be due to invalid IL or missing references) //IL_08ba: Unknown result type (might be due to invalid IL or missing references) //IL_08bf: Unknown result type (might be due to invalid IL or missing references) //IL_08d4: Unknown result type (might be due to invalid IL or missing references) //IL_08d9: Unknown result type (might be due to invalid IL or missing references) //IL_08ee: Unknown result type (might be due to invalid IL or missing references) //IL_08f3: Unknown result type (might be due to invalid IL or missing references) //IL_0908: Unknown result type (might be due to invalid IL or missing references) //IL_090d: Unknown result type (might be due to invalid IL or missing references) Mats.Init(); ImplementLayout implementLayout = new ImplementLayout { Root = new GameObject("ft_reaper_model"), WheelX = 0.86f, HalfWidth = 1.5f }; implementLayout.Root.SetActive(false); Object.DontDestroyOnLoad((Object)(object)implementLayout.Root); PartSet partSet = new PartSet(); MeshKit.Box(partSet[Mats.Ashwood], new Vector3(0f, 0.56f, -0.049999982f), new Vector3(1.48f, 0.06f, 2f), Quaternion.identity); for (int i = -1; i <= 1; i += 2) { MeshKit.Box(partSet[Mats.Ashwood], new Vector3((float)i * 0.74f, 0.82000005f, -0.049999982f), new Vector3(0.05f, 0.52000004f, 2f), Quaternion.identity); MeshKit.Box(partSet[Mats.Ashwood], new Vector3(0f, 0.82000005f, (i < 0) ? (-1.05f) : 0.95f), new Vector3(1.48f, 0.52000004f, 0.05f), Quaternion.identity); float[] array = new float[2] { -1.05f, 0.95f }; foreach (float num in array) { MeshKit.Box(partSet[Mats.Flametal], new Vector3((float)i * 0.74f, 0.84000003f, num), new Vector3(0.08f, 0.58000004f, 0.08f), Quaternion.identity, 4f); } Beam(partSet, Mats.Flametal, new Vector3((float)i * 0.74f, 1.1f, -1.05f), new Vector3((float)i * 0.74f, 1.1f, 0.95f), 0.07f, 0.04f, 4f); Beam(partSet, Mats.Flametal, new Vector3(-0.74f, 1.1f, (i < 0) ? (-1.05f) : 0.95f), new Vector3(0.74f, 1.1f, (i < 0) ? (-1.05f) : 0.95f), 0.07f, 0.04f, 4f); MeshKit.Box(partSet[Mats.Flametal], new Vector3((float)i * 0.74f, 0.57f, -0.13f), new Vector3(0.12f, 0.14f, 0.16f), Quaternion.identity, 4f); Beam(partSet, Mats.Ashwood, new Vector3((float)i * 0.62f, 1.0300001f, 0.9f), new Vector3((float)i * 0.6f, 0.74f, 2.2f), 0.08f, 0.09f); MeshKit.Box(partSet[Mats.Flametal], new Vector3((float)i * 0.6f, 0.735f, 2.1f), new Vector3(0.1f, 0.11f, 0.12f), Quaternion.Euler(-4f, 0f, 0f), 4f); } Rod(partSet, Mats.Flametal, new Vector3(-0.9f, 0.52f, -0.13f), new Vector3(0.9f, 0.52f, -0.13f), 0.04f); Cog(partSet, Mats.BlackMetal, new Vector3(0.8f, 0.82f, 0.75f), 0.2f, 0.05f, 12); Beam(partSet, Mats.BlackMetal, new Vector3(0.8f, 0.52f, -0.13f), new Vector3(0.8f, 0.82f, 0.75f), 0.03f, 0.08f, 4f); partSet.Emit(implementLayout.Root.transform, "body"); Vector3 pivot = new Vector3(0f, 0.56f, 0.95f); implementLayout.WorkFrame = Frame(implementLayout.Root, "header", pivot); Beam(partSet, Mats.Flametal, P(-1.55f, 0.1f, 1.3f), P(1.55f, 0.1f, 1.3f), 0.06f, 0.035f, 4f); for (float num2 = -1.5f; num2 <= 1.55f; num2 += 0.1f) { List<Vector2> poly = new List<Vector2> { new Vector2(num2 - 0.025f, 1.28f), new Vector2(num2, 1.4f), new Vector2(num2 + 0.025f, 1.28f) }; partSet.Push(-pivot, Quaternion.identity); MeshKit.ExtrudeXZ(partSet[Mats.Iron], poly, 0.085f, 0.11f, 6f); partSet.Pop(); } MeshKit.Box(partSet[Mats.Ashwood], P(0f, 0.12f, 1.125f), new Vector3(3.1f, 0.03f, 0.39999998f), Quaternion.Euler(-12f, 0f, 0f)); for (int k = -1; k <= 1; k += 2) { List<Vector2> list = new List<Vector2> { new Vector2(0.05f, 0.95f), new Vector2(0.05f, 1.42f), new Vector2(0.85f, 1.1999999f), new Vector2(0.85f, 0.95f) }; PrismX(partSet, Mats.Ashwood, list.ConvertAll((Converter<Vector2, Vector2>)((Vector2 v) => new Vector2(v.x - pivot.y, v.y - pivot.z))), (float)k * 1.55f - 0.02f, (float)k * 1.55f + 0.02f); Beam(partSet, Mats.Flametal, P((float)k * 1.55f, 0.85f, 1f), P((float)k * 1.55f, 0.6f, 1.1999999f), 0.05f, 0.05f, 4f); } partSet.Emit(implementLayout.WorkFrame, "header"); Transform val = MeshKit.Child(implementLayout.WorkFrame, "reel", P(0f, 0.6f, 1.1999999f), Quaternion.identity); Rod(partSet, Mats.Flametal, new Vector3(-1.55f, 0f, 0f), new Vector3(1.55f, 0f, 0f), 0.035f); Vector3 val2 = default(Vector3); for (int num3 = 0; num3 < 5; num3++) { float num4 = (float)num3 * (float)Math.PI * 2f / 5f; ((Vector3)(ref val2))..ctor(0f, Mathf.Cos(num4), Mathf.Sin(num4)); Beam(partSet, Mats.Ashwood, new Vector3(-1.4699999f, 0f, 0f) + val2 * 0.3f, new Vector3(1.4699999f, 0f, 0f) + val2 * 0.3f, 0.05f, 0.025f); float[] array = new float[3] { -1.4499999f, 0f, 1.4499999f }; foreach (float num5 in array) { Rod(partSet, Mats.Flametal, new Vector3(num5, 0f, 0f), new Vector3(num5, 0f, 0f) + val2 * 0.3f, 0.015f, 5); } } partSet.Emit(val, "reel"); implementLayout.Reel = val; implementLayout.Solids.Add((new Vector3(0f, 0.82f, -0.05f), new Vector3(1.5f, 0.52f, 2f))); for (int num6 = -1; num6 <= 1; num6 += 2) { implementLayout.Solids.Add((new Vector3((float)num6 * 0.61f, 0.82f, 1.6f), new Vector3(0.08f, 0.1f, 1.3f))); } implementLayout.BoxCenter = new Vector3(0f, 0.84000003f, -0.049999982f); implementLayout.BoxSize = new Vector3(1.48f, 0.56000006f, 2f); implementLayout.Line0 = new Vector3(-0.6f, 0.75f, 2.15f); implementLayout.Line1 = new Vector3(0.6f, 0.75f, 2.15f); implementLayout.WorkBack = -1.3f; return implementLayout; Vector3 P(float x, float y, float z) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return new Vector3(x, y, z) - pivot; } } } internal static class ItemModels { public static GameObject SeedPouch() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //IL_0033: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to