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 Double Beds v1.0.0
plugins/DoubleBeds.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.Globalization; 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.Threading; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using DoubleBeds.Audio; using DoubleBeds.Core; using DoubleBeds.Dev; using DoubleBeds.Gameplay; using DoubleBeds.UI; using DoubleBeds.Visual; using HarmonyLib; using Jotunn.Configs; using Jotunn.Entities; using Jotunn.Managers; using Jotunn.Utils; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.Audio; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("assembly_utils")] [assembly: IgnoresAccessChecksTo("assembly_valheim")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace DoubleBeds { public static class Cfg { public static ConfigEntry<bool> WarmTogether; public static ConfigEntry<bool> OwnShelter; public static ConfigEntry<bool> EmberHeat; public static ConfigEntry<int> WarmBonus; public static ConfigEntry<KeyCode> KeyColor; public static ConfigEntry<KeyCode> KeyRecolor; public static ConfigEntry<bool> ShowPalette; public static ConfigEntry<bool> Sounds; public static ConfigEntry<float> Volume; 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Expected O, but got Unknown //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Expected O, but got Unknown //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Expected O, but got Unknown //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Expected O, but got Unknown //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Expected O, but got Unknown //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Expected O, but got Unknown ConfigurationManagerAttributes val = new ConfigurationManagerAttributes { IsAdminOnly = true }; BedKind[] all = BedKind.All; foreach (BedKind bedKind in all) { string text = char.ToUpperInvariant(bedKind.Key[0]) + bedKind.Key.Substring(1); bedKind.Recipe = c.Bind<string>("1 - Building", "Recipe" + text, bedKind.DefaultRecipe, new ConfigDescription("Build cost of the " + bedKind.Key + " bed, \"Item:amount,Item:amount\".", (AcceptableValueBase)null, new object[1] { val })); bedKind.Station = c.Bind<string>("1 - Building", "Station" + text, bedKind.DefaultStation, new ConfigDescription("Crafting station that has to be near to build the " + bedKind.Key + " bed (prefab name, empty for none).", (AcceptableValueBase)null, new object[1] { val })); bedKind.Comfort = c.Bind<int>("1 - Building", "Comfort" + text, bedKind.DefaultComfort, new ConfigDescription("Comfort of the " + bedKind.Key + " bed. Only the best bed nearby counts, as with the game's beds (bed 1, dragon bed 2).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 5), new object[1] { val })); } WarmTogether = c.Bind<bool>("2 - Sleeping", "WarmTogether", true, new ConfigDescription("Two who sleep in the same double bed keep each other warm: both wake with extra comfort for the Rested bonus.", (AcceptableValueBase)null, new object[1] { val })); WarmBonus = c.Bind<int>("2 - Sleeping", "WarmTogetherComfort", 1, new ConfigDescription("Comfort added by sleeping side by side (each level is one more minute of Rested).", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 3), new object[1] { val })); OwnShelter = c.Bind<bool>("2 - Sleeping", "ClosedBedIsShelter", true, new ConfigDescription("The box bed and the canopy bed close around their sleepers (doors, curtains) and are then their own roof and walls. Off: they need a house like any bed.", (AcceptableValueBase)null, new object[1] { val })); EmberHeat = c.Bind<bool>("2 - Sleeping", "EmberBedIsWarm", true, new ConfigDescription("The ember bed's glowing plinth counts as the fire a sleeper needs nearby. Off: it needs a fire like any bed.", (AcceptableValueBase)null, new object[1] { val })); KeyColor = c.Bind<KeyCode>("3 - Client", "KeyColor", (KeyCode)110, "While placing a bed: next blanket colour (with Shift: previous)."); KeyRecolor = c.Bind<KeyCode>("3 - Client", "KeyRecolor", (KeyCode)107, "While placing a bed: dye the blanket of the bed you look at in the chosen colour."); ShowPalette = c.Bind<bool>("3 - Client", "ShowPalette", true, "Show the colour strip while a bed is selected in the hammer."); Sounds = c.Bind<bool>("3 - Client", "Sounds", true, "Play a sound when doors slide or curtains are drawn."); Volume = c.Bind<float>("3 - Client", "Volume", 0.7f, new ConfigDescription("Volume of the doors and curtains (on top of the game's effect volume).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 1f), Array.Empty<object>())); } } public static class Lang { private static readonly (string key, string en, string de)[] Texts = new(string, string, string)[40] { ("db_piece_straw", "Straw pallet for two", "Strohlager für zwei"), ("db_piece_straw_desc", "A straw sack between four barked logs, a wool blanket and a deer hide. Two places, each with its own owner and spawn point.", "Ein Strohsack zwischen vier Rindenstämmen, dazu eine Wolldecke und ein Hirschfell. Zwei Plätze, jeder mit eigenem Besitzer und Spawnpunkt."), ("db_piece_plank", "Plank double bed", "Planken-Doppelbett"), ("db_piece_plank_desc", "The settler's bed made wide: pine planks, four posts, room for two. Each half has its own owner and spawn point.", "Das Siedlerbett in breit: Kiefernplanken, vier Pfosten, Platz für zwei. Jede Hälfte hat ihren eigenen Besitzer und Spawnpunkt."), ("db_piece_bunk", "Bunk bed", "Etagenbett"), ("db_piece_bunk_desc", "Two bunks on four posts, one above the other, with rungs at the foot. Saves room in a crowded longhouse.", "Zwei Kojen übereinander auf vier Pfosten, mit Sprossen am Fußende. Spart Platz im vollen Langhaus."), ("db_piece_box", "Box bed (lokrekkja)", "Kastenbett (Lokrekkja)"), ("db_piece_box_desc", "A closed cupboard bed of tarred boards. The doors slide shut when someone lies inside, and then its walls and roof are the sleepers' shelter.", "Ein geschlossenes Schrankbett aus geteerten Brettern. Die Türen schieben sich zu, wenn jemand darin liegt; dann sind seine Wände und sein Dach der Schutz."), ("db_piece_jarl", "Jarl's bed", "Jarlsbett"), ("db_piece_jarl_desc", "Turned posts with silver knobs, a shield on the headboard and wolf pelts over the foot. A bed for the hall's master and mistress.", "Gedrechselte Pfosten mit Silberknäufen, ein Schild am Kopfteil und Wolfsfelle über dem Fußende. Ein Bett für Herrin und Herrn der Halle."), ("db_piece_canopy", "Canopy bed", "Himmelbett"), ("db_piece_canopy_desc", "Four tarred posts with carved dragon heads carry a wool canopy. The curtains are drawn while someone sleeps, and then the bed is its own shelter.", "Vier geteerte Pfosten mit geschnitzten Drachenköpfen tragen einen Wollhimmel. Die Vorhänge werden zugezogen, solange jemand schläft; dann ist das Bett sein eigener Schutz."), ("db_piece_dvergr", "Dvergr marble bed", "Dvergr-Marmorbett"), ("db_piece_dvergr_desc", "Black marble banded in copper, a Yggdrasil-wood headboard and two Dvergr lanterns that dim while you sleep.", "Schwarzer Marmor mit Kupferbändern, ein Kopfteil aus Yggdrasilholz und zwei Dvergr-Laternen, die gedämpft leuchten, während du schläfst."), ("db_piece_ember", "Ember bed", "Glutbett"), ("db_piece_ember_desc", "A hollow grausten plinth with embers glowing behind iron grates. The bed is its own fire: no hearth needed nearby, only a house around it.", "Ein hohler Graustensockel, in dem hinter Eisengittern Glut leuchtet. Das Bett ist sein eigenes Feuer: Ein Herd daneben ist nicht nötig, nur ein Haus drumherum."), ("db_side_left", "Left", "Links"), ("db_side_right", "Right", "Rechts"), ("db_side_lower", "Lower", "Unten"), ("db_side_upper", "Upper", "Oben"), ("db_free", "free", "frei"), ("db_claim", "Claim this place ({0})", "Diesen Platz nehmen ({0})"), ("db_full", "Both places are taken", "Beide Plätze sind vergeben"), ("db_release", "Give up your place", "Deinen Platz freigeben"), ("db_msg_released", "You gave up your place ({0}).", "Du hast deinen Platz freigegeben ({0})."), ("db_msg_warm", "Warm together with {0}: +{1} comfort", "Zu zweit warm mit {0}: +{1} Komfort"), ("db_msg_samecolor", "This blanket already has that colour.", "Diese Decke hat schon diese Farbe."), ("db_msg_recolored", "Blanket dyed: {0}", "Decke gefärbt: {0}"), ("db_color_undyed", "Undyed wool", "Ungefärbte Wolle"), ("db_color_grey", "Grey wool", "Graue Wolle"), ("db_color_madder", "Madder red", "Krapprot"), ("db_color_rose", "Madder rose", "Krapprosa"), ("db_color_weld", "Weld yellow", "Waugelb"), ("db_color_green", "Woad green", "Waidgrün"), ("db_color_woad", "Woad blue", "Waidblau"), ("db_color_walnut", "Walnut brown", "Walnussbraun"), ("db_color_lichen", "Lichen purple", "Flechtenpurpur"), ("db_color_black", "Oak-gall black", "Gallapfelschwarz"), ("db_hud_title", "Blanket: {0}", "Decke: {0}"), ("db_hud_keys", "[{0}] next colour (Shift: back) [{1}] dye the bed in view", "[{0}] nächste Farbe (Umschalt: zurück) [{1}] Bett im Blick färben") }; 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 string L(string token) { if (Localization.instance == null) { return token; } return Localization.instance.Localize(token); } } public static class Pieces { [HarmonyPatch(typeof(Game), "Start")] private static class ApplyOnWorldStart { private static void Postfix() { ApplyConfig(); } } private const string BasePrefab = "bed"; private const string Category = "Furniture"; public static readonly Dictionary<string, Sprite> Icons = new Dictionary<string, Sprite>(); private static readonly Dictionary<BedKind, GameObject> Registered = new Dictionary<BedKind, GameObject>(); public static void Init() { PrefabManager.OnVanillaPrefabsAvailable += Add; SynchronizationManager.OnConfigurationSynchronized += delegate { ApplyConfig(); }; BedKind[] all = BedKind.All; foreach (BedKind obj in all) { obj.Recipe.SettingChanged += delegate { ApplyConfig(); }; obj.Station.SettingChanged += delegate { ApplyConfig(); }; obj.Comfort.SettingChanged += delegate { ApplyConfig(); }; } } public static GameObject PrefabOf(BedKind k) { if (!Registered.TryGetValue(k, out var value)) { return null; } return value; } public static void ApplyConfig() { //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Expected O, but got Unknown //IL_01e0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ObjectDB.instance == (Object)null || ObjectDB.instance.m_items.Count == 0) { return; } foreach (KeyValuePair<BedKind, GameObject> item in Registered) { BedKind key = item.Key; try { Piece val = (((Object)(object)item.Value != (Object)null) ? item.Value.GetComponent<Piece>() : null); if ((Object)(object)val == (Object)null) { continue; } List<Requirement> list = new List<Requirement>(); foreach (RequirementConfig item2 in RecipeOf(key)) { GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(item2.Item); ItemDrop val2 = ((itemPrefab != null) ? itemPrefab.GetComponent<ItemDrop>() : null); if ((Object)(object)val2 == (Object)null) { DoubleBedsPlugin.Log.LogWarning((object)(key.Prefab + " recipe: unknown item '" + item2.Item + "'.")); continue; } list.Add(new Requirement { m_resItem = val2, m_amount = item2.Amount, m_recover = true }); } if (list.Count > 0) { val.m_resources = list.ToArray(); } string text = (key.Station.Value ?? "").Trim(); if (text.Length == 0) { val.m_craftingStation = null; } else { object obj; if (!((Object)(object)ZNetScene.instance != (Object)null)) { obj = null; } else { GameObject prefab = ZNetScene.instance.GetPrefab(text); obj = ((prefab != null) ? prefab.GetComponent<CraftingStation>() : null); } CraftingStation val3 = (CraftingStation)obj; if ((Object)(object)val3 != (Object)null) { val.m_craftingStation = val3; } else { DoubleBedsPlugin.Log.LogWarning((object)(key.Prefab + ": unknown crafting station '" + text + "'.")); } } val.m_comfort = Mathf.Clamp(key.Comfort.Value, 0, 5); val.m_comfortGroup = (ComfortGroup)2; foreach (DoubleBed item3 in DoubleBed.All) { if ((Object)(object)item3 == (Object)null || item3.Kind != key || item3.IsGhost) { continue; } Piece component = ((Component)item3).GetComponent<Piece>(); if (!((Object)(object)component == (Object)null)) { component.m_comfort = val.m_comfort; if (component.m_comfort > 0) { Piece.s_allComfortPieces.Add(component); } else { Piece.s_allComfortPieces.Remove(component); } } } } catch (Exception ex) { DoubleBedsPlugin.Log.LogWarning((object)("Could not apply the recipe of " + key.Prefab + ": " + ex.Message)); } } if ((Object)(object)Player.m_localPlayer != (Object)null) { Player.m_localPlayer.UpdateAvailablePiecesList(); } } private static List<RequirementConfig> RecipeOf(BedKind k) { List<RequirementConfig> list = ParseRecipe(k.Recipe.Value, k.Prefab); if (list.Count > 0) { return list; } DoubleBedsPlugin.Log.LogWarning((object)("No valid entry in the recipe of " + k.Prefab + "; using the default.")); return ParseRecipe(k.DefaultRecipe, k.Prefab); } private static void Add() { try { Mats.Init(); BedKind[] all = BedKind.All; foreach (BedKind bedKind in all) { try { AddOne(bedKind); } catch (Exception ex) { DoubleBedsPlugin.Log.LogError((object)("Could not register " + bedKind.Prefab + ": " + ex)); } } } finally { PrefabManager.OnVanillaPrefabsAvailable -= Add; } } private static void AddOne(BedKind k) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0047: 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_006d: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) BuiltBed builtBed = BedModels.Build(k); Icons[k.Prefab] = RenderIcon(builtBed.Root, 128); PieceConfig val = new PieceConfig { Name = "$" + k.Token, Description = "$" + k.Token + "_desc", PieceTable = "Hammer", Category = "Furniture", CraftingStation = (k.Station.Value ?? "").Trim(), Icon = Icons[k.Prefab] }; foreach (RequirementConfig item in RecipeOf(k)) { val.AddRequirement(item); } CustomPiece val2 = new CustomPiece(k.Prefab, "bed", val); if ((Object)(object)val2.PiecePrefab == (Object)null) { DoubleBedsPlugin.Log.LogError((object)("Cloning bed failed; no " + k.Prefab + ".")); Object.Destroy((Object)(object)builtBed.Root); return; } Reskin(val2.PiecePrefab, builtBed, k); if (string.IsNullOrWhiteSpace(k.Station.Value)) { val2.Piece.m_craftingStation = null; } val2.Piece.m_comfort = k.Comfort.Value; val2.Piece.m_comfortGroup = (ComfortGroup)2; PieceManager.Instance.AddPiece(val2); Registered[k] = val2.PiecePrefab; } private static void Reskin(GameObject prefab, BuiltBed built, BedKind k) { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0165: 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) Transform transform = prefab.transform; for (int num = transform.childCount - 1; num >= 0; num--) { GameObject gameObject = ((Component)transform.GetChild(num)).gameObject; if (!((Object)(object)gameObject.GetComponent<EffectArea>() != (Object)null)) { Object.DestroyImmediate((Object)(object)gameObject); } } Collider[] components = prefab.GetComponents<Collider>(); for (int i = 0; i < components.Length; i++) { Object.DestroyImmediate((Object)(object)components[i]); } GameObject root = built.Root; root.transform.SetParent(transform, false); root.transform.localPosition = Vector3.zero; root.transform.localRotation = Quaternion.identity; GameObject val = ColliderSet(transform, "colliders", built.Colliders); val.tag = "leaky"; GameObject go = ColliderSet(transform, "roof", built.Roof); SetLayer(root, prefab.layer); SetLayer(val, prefab.layer); SetLayer(go, prefab.layer); Bed component = prefab.GetComponent<Bed>(); if ((Object)(object)component != (Object)null) { component.m_spawnPoint = DoubleBed.FindDeep(transform, "lie_0"); } Transform val2 = DoubleBed.FindDeep(transform, "heat"); if ((Object)(object)val2 != (Object)null) { ((Component)val2).gameObject.layer = LayerMask.NameToLayer("character_trigger"); SphereCollider obj = ((Component)val2).gameObject.AddComponent<SphereCollider>(); ((Collider)obj).isTrigger = true; obj.radius = 3f; ((Component)val2).gameObject.AddComponent<EffectArea>().m_type = (Type)1; } 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(k); component2.m_materialType = (MaterialType)0; component2.m_fragmentRoots = null; CopyEffects(component2, prefab.GetComponent<Piece>(), k); } prefab.AddComponent<DoubleBed>().KindPrefab = k.Prefab; } private static GameObject ColliderSet(Transform root, string name, List<Bounds> boxes) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_001f: 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_002e: 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) GameObject val = new GameObject(name); val.transform.SetParent(root, false); foreach (Bounds box in boxes) { Bounds current = box; BoxCollider obj = val.AddComponent<BoxCollider>(); obj.center = ((Bounds)(ref current)).center; obj.size = ((Bounds)(ref current)).size; } return val; } private static float Health(BedKind k) { if (k == BedKind.Dvergr || k == BedKind.Ember) { return 1000f; } if (k == BedKind.Box || k == BedKind.Jarl || k == BedKind.Canopy) { return 400f; } return 150f; } private static void CopyEffects(WearNTear wnt, Piece piece, BedKind k) { string text = ((k == BedKind.Dvergr) ? "blackmarble_1x1" : ((k == BedKind.Ember) ? "Piece_grausten_floor_2x2" : null)); if (text != null) { GameObject prefab = PrefabManager.Instance.GetPrefab(text); WearNTear val = (((Object)(object)prefab != (Object)null) ? prefab.GetComponent<WearNTear>() : null); if ((Object)(object)val != (Object)null) { wnt.m_hitEffect = val.m_hitEffect; wnt.m_destroyedEffect = val.m_destroyedEffect; } Piece val2 = (((Object)(object)prefab != (Object)null) ? prefab.GetComponent<Piece>() : null); if ((Object)(object)val2 != (Object)null && (Object)(object)piece != (Object)null) { piece.m_placeEffect = val2.m_placeEffect; } } } private static void SetLayer(GameObject go, int layer) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown go.layer = layer; foreach (Transform item in go.transform) { Transform val = item; if (((Object)val).name != "heat") { SetLayer(((Component)val).gameObject, layer); } } } internal static Sprite RenderIcon(GameObject visual, int px, float yaw = 35f) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_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_00e5: 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_00fa: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Expected O, but got Unknown if (GUIManager.IsHeadless()) { return null; } GameObject val = null; try { val = Object.Instantiate<GameObject>(visual); val.transform.position = Vector3.zero; val.transform.rotation = Quaternion.identity; Light[] componentsInChildren = val.GetComponentsInChildren<Light>(true); for (int i = 0; i < componentsInChildren.Length; i++) { Object.DestroyImmediate((Object)(object)((Component)componentsInChildren[i]).gameObject); } Mover[] componentsInChildren2 = val.GetComponentsInChildren<Mover>(true); for (int i = 0; i < componentsInChildren2.Length; i++) { componentsInChildren2[i].Set(0f); } Renderer[] componentsInChildren3 = val.GetComponentsInChildren<Renderer>(true); foreach (Renderer val2 in componentsInChildren3) { Material[] sharedMaterials = val2.sharedMaterials; for (int j = 0; j < sharedMaterials.Length; j++) { sharedMaterials[j] = Mats.IconTwin(sharedMaterials[j]); } val2.sharedMaterials = sharedMaterials; } return RenderManager.Instance.Render(new RenderRequest(val) { Rotation = Quaternion.Euler(24f, 0f, 0f) * Quaternion.Euler(0f, yaw, 0f), Width = px, Height = px, ParticleSimulationTime = -1f, UseCache = false }); } catch (Exception ex) { DoubleBedsPlugin.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, string what) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Expected O, but got Unknown List<RequirementConfig> list = new List<RequirementConfig>(); if (string.IsNullOrWhiteSpace(recipe)) { return list; } string[] array = recipe.Split(new char[2] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries); foreach (string text in array) { string[] array2 = text.Split(new char[1] { ':' }); if (array2.Length == 2 && int.TryParse(array2[1].Trim(), out var result) && result > 0 && array2[0].Trim().Length > 0) { list.Add(new RequirementConfig(array2[0].Trim(), result, 0, true)); continue; } DoubleBedsPlugin.Log.LogWarning((object)("Ignoring invalid recipe entry '" + text + "' for " + what + ".")); } return list; } } [BepInPlugin("zap.doublebeds", "Double Beds", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class DoubleBedsPlugin : BaseUnityPlugin { public const string PluginGuid = "zap.doublebeds"; public const string PluginName = "Double Beds"; public const string PluginVersion = "1.0.0"; private Harmony _harmony; public static DoubleBedsPlugin 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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(); _harmony = new Harmony("zap.doublebeds"); _harmony.PatchAll(typeof(DoubleBedsPlugin).Assembly); PaletteHud.Ensure(); SelfTest.TryStart(((Component)this).gameObject); } private void Update() { Selection.Update(); } private void OnDestroy() { Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } } } namespace DoubleBeds.Visual { public class BedLook : MonoBehaviour { private readonly List<Renderer> _dyed = new List<Renderer>(); private bool _found; private void Find() { if (_found) { return; } _found = true; Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren<Renderer>(true); foreach (Renderer val in componentsInChildren) { if (Mats.IsWool(val.sharedMaterial) || ((Object)val).name.Contains("_Wool_")) { _dyed.Add(val); } } } private void Awake() { Find(); } public void ApplyColor(int dyeId) { Find(); Material sharedMaterial = Mats.Wool(dyeId); foreach (Renderer item in _dyed) { if ((Object)(object)item != (Object)null) { item.sharedMaterial = sharedMaterial; } } } public static float HalfWidth(BedKind k) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return BedModels.Size(k).x * 0.5f; } } public class Mover : MonoBehaviour { public Vector3 OpenPos; public Vector3 ClosedPos; public Vector3 OpenScale = Vector3.one; public Vector3 ClosedScale = Vector3.one; public void Set(float t) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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_002a: 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) ((Component)this).transform.localPosition = Vector3.LerpUnclamped(OpenPos, ClosedPos, t); ((Component)this).transform.localScale = Vector3.LerpUnclamped(OpenScale, ClosedScale, t); } } public class Glow : MonoBehaviour { public float Base = 1f; public float Flicker = 0.15f; public float Speed = 2f; public float Sleeping = 0.45f; private Light _light; private DoubleBed _bed; private float _seed; private float _dim = 1f; private void Awake() { _light = ((Component)this).GetComponent<Light>(); _bed = ((Component)this).GetComponentInParent<DoubleBed>(); _seed = Random.value * 100f; } private void Update() { if (!((Object)(object)_light == (Object)null)) { bool flag = (Object)(object)_bed != (Object)null && _bed.Closedness > 0.5f; _dim = Mathf.MoveTowards(_dim, flag ? Sleeping : 1f, Time.deltaTime * 0.5f); float num = Mathf.PerlinNoise(Time.time * Speed + _seed, _seed) - 0.5f; _light.intensity = Base * _dim * (1f + Flicker * 2f * num); } } } internal static class BedModels { private struct Bedding { public float X; public float Z; public float Width; public float Length; public float Bottom; public float Thick; public int Pillows; public Material Mattress; public Material Wool; public Material Sheet; public Material Pillow; public Material Pelt; public Material PeltTop; public float Seed; public bool FootHang; } private static int _uvSeed; private static void Straw(PartSet ps, BuiltBed b, Material wool) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0198: 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_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) for (int i = -1; i <= 1; i += 2) { MeshKit.Cylinder(ps[Mats.Bark], new Vector3((float)i * 0.98f, 0.11f, -1.3f), new Vector3((float)i * 0.98f, 0.11f, 1.3f), 0.11f, 10, caps: true, 2f, 0.8f); MeshKit.Cylinder(ps[Mats.Bark], new Vector3(-1.1f, 0.0935f, (float)i * 1.18f), new Vector3(1.1f, 0.0935f, (float)i * 1.18f), 0.099f, 10, caps: true, 2f, 0.8f); } float num = Bed(ps, new Bedding { Z = 0.02f, Width = 1.84f, Length = 2.24f, Bottom = 0.03f, Thick = 0.26f, Pillows = 2, Mattress = Mats.Sacking, Wool = wool, Sheet = Mats.Ticking, Pillow = Mats.Sacking, Pelt = Mats.Deer, Seed = 1.3f }); Transform transform = b.Root.transform; Borrow(transform, "rug_straw", null, Mats.Straw, new Vector3(-0.55f, 0.02f, 1f), Quaternion.Euler(0f, 25f, 0f), new Vector3(0.5f, 0.8f, 0.4f)); Borrow(transform, "rug_straw", null, Mats.Straw, new Vector3(0.75f, 0.02f, -0.6f), Quaternion.Euler(0f, 110f, 0f), new Vector3(0.45f, 0.7f, 0.35f)); Borrow(transform, "rug_straw", null, Mats.Straw, new Vector3(0.2f, 0.02f, 1.1f), Quaternion.Euler(0f, 200f, 0f), new Vector3(0.4f, 0.6f, 0.3f)); Col(b, new Vector3(0f, num * 0.5f, 0f), new Vector3(2.2f, num, 2.6f)); Lie(b, 0, new Vector3(-0.46f, num + 0.01f, 0.02f)); Lie(b, 1, new Vector3(0.46f, num + 0.01f, 0.02f)); } private static void Plank(PartSet ps, BuiltBed b, Material wool) { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: 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) //IL_003a: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) Material plank = Mats.Plank; for (int i = -1; i <= 1; i += 2) { for (int j = -1; j <= 1; j += 2) { float num = ((j < 0) ? 1.05f : 0.78f); Bx(ps, plank, new Vector3((float)i * 1.04f, num * 0.5f, (float)j * 1.29f), new Vector3(0.12f, num, 0.12f)); Cap(ps, plank, new Vector3((float)i * 1.04f, num, (float)j * 1.29f), 0.07f); } } for (int k = -1; k <= 1; k += 2) { Bx(ps, plank, new Vector3((float)k * 1.04f, 0.3f, 0f), new Vector3(0.08f, 0.22f, 2.46f)); Bx(ps, plank, new Vector3(0f, 0.3f, (float)k * 1.29f), new Vector3(1.96f, 0.22f, 0.08f)); } for (int l = 0; l < 3; l++) { Bx(ps, plank, new Vector3(0f, 0.55f + (float)l * 0.19f, -1.29f), new Vector3(1.96f, 0.17f, 0.06f)); } for (int m = 0; m < 2; m++) { Bx(ps, plank, new Vector3(0f, 0.5f + (float)m * 0.16f, 1.29f), new Vector3(1.96f, 0.14f, 0.06f)); } float num2 = Bed(ps, new Bedding { Width = 1.96f, Length = 2.44f, Bottom = 0.3f, Thick = 0.2f, Pillows = 2, Mattress = Mats.Ticking, Wool = wool, Sheet = Mats.Linen, Pillow = Mats.Linen, Pelt = Mats.Deer, Seed = 2.1f }); Col(b, new Vector3(0f, num2 * 0.5f, 0f), new Vector3(2.2f, num2, 2.7f)); Col(b, new Vector3(0f, 0.75f, -1.29f), new Vector3(2.2f, 0.6f, 0.14f)); Lie(b, 0, new Vector3(-0.47f, num2 + 0.01f, 0.05f)); Lie(b, 1, new Vector3(0.47f, num2 + 0.01f, 0.05f)); } private static void Cap(PartSet ps, Material m, Vector3 at, float r) { //IL_0010: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) List<Vector2> prof = new List<Vector2> { new Vector2(0f, 0f), new Vector2(r, 0f), new Vector2(r * 1.05f, r * 0.25f), new Vector2(r * 0.8f, r * 0.8f), new Vector2(r * 0.35f, r * 1.15f), new Vector2(0f, r * 1.22f) }; MeshBuilder meshBuilder = ps[m]; meshBuilder.Push(at, Quaternion.identity); MeshKit.Lathe(meshBuilder, prof, 10, 1f, 2f, null, swapUV: true); meshBuilder.Pop(); } private static void Bunk(PartSet ps, BuiltBed b, Material wool) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0068: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0138: 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_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: 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_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_03af: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_0411: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_0460: Unknown result type (might be due to invalid IL or missing references) Material brown = Mats.Brown; for (int i = -1; i <= 1; i += 2) { for (int j = -1; j <= 1; j += 2) { Bx(ps, brown, new Vector3((float)i * 0.64f, 0.95f, (float)j * 1.25f), new Vector3(0.11f, 1.9f, 0.11f)); Cap(ps, brown, new Vector3((float)i * 0.64f, 1.9f, (float)j * 1.25f), 0.065f); Col(b, new Vector3((float)i * 0.64f, 0.95f, (float)j * 1.25f), new Vector3(0.11f, 1.9f, 0.11f)); } } float[] array = new float[2] { 0.3f, 1.2f }; foreach (float num in array) { for (int l = -1; l <= 1; l += 2) { Bx(ps, brown, new Vector3((float)l * 0.64f, num, 0f), new Vector3(0.07f, 0.16f, 2.4f)); Bx(ps, brown, new Vector3(0f, num, (float)l * 1.25f), new Vector3(1.2f, 0.16f, 0.07f)); } } for (int m = -1; m <= 1; m += 2) { Bx(ps, brown, new Vector3((float)m * 0.64f, 1.6f, 0f), new Vector3(0.05f, 0.07f, 2.4f)); } Bx(ps, Mats.Plank, new Vector3(0f, 0.64f, -1.25f), new Vector3(1.2f, 0.5f, 0.05f)); Bx(ps, Mats.Plank, new Vector3(0f, 1.58f, -1.25f), new Vector3(1.2f, 0.42f, 0.05f)); array = new float[3] { 0.62f, 0.92f, 1.52f }; foreach (float num2 in array) { MeshKit.Cylinder(ps[brown], new Vector3(-0.64f, num2, 1.27f), new Vector3(0.64f, num2, 1.27f), 0.025f, 8); } float num3 = Bed(ps, new Bedding { Width = 1.16f, Length = 2.38f, Bottom = 0.32f, Thick = 0.14f, Pillows = 1, Mattress = Mats.Ticking, Wool = wool, Sheet = Mats.Linen, Pillow = Mats.Linen, Seed = 0.7f }); float num4 = Bed(ps, new Bedding { Width = 1.16f, Length = 2.38f, Bottom = 1.24f, Thick = 0.14f, Pillows = 1, Mattress = Mats.Ticking, Wool = wool, Sheet = Mats.Linen, Pillow = Mats.Linen, Seed = 3.9f }); Col(b, new Vector3(0f, num3 * 0.5f, 0f), new Vector3(1.4f, num3, 2.62f)); Col(b, new Vector3(0f, (1.12f + num4) * 0.5f, 0f), new Vector3(1.4f, num4 - 1.12f, 2.62f)); Col(b, new Vector3(0f, 1.1f, -1.25f), new Vector3(1.4f, 1.6f, 0.1f)); Lie(b, 0, new Vector3(0f, num3 + 0.01f, 0.05f)); Lie(b, 1, new Vector3(0f, num4 + 0.01f, 0.05f)); } private static void Box(PartSet ps, BuiltBed b, Material wool) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0138: 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_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: 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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0225: 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_0259: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: 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_0319: Unknown result type (might be due to invalid IL or missing references) //IL_032d: 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_04b5: Unknown result type (might be due to invalid IL or missing references) //IL_04cf: Unknown result type (might be due to invalid IL or missing references) //IL_04e3: Unknown result type (might be due to invalid IL or missing references) //IL_04fd: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_053f: 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_056d: Unknown result type (might be due to invalid IL or missing references) //IL_0587: 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_05b5: Unknown result type (might be due to invalid IL or missing references) //IL_05c9: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_03a4: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03c5: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_0600: Unknown result type (might be due to invalid IL or missing references) //IL_0628: Unknown result type (might be due to invalid IL or missing references) //IL_0646: Unknown result type (might be due to invalid IL or missing references) //IL_0670: Unknown result type (might be due to invalid IL or missing references) //IL_0675: Unknown result type (might be due to invalid IL or missing references) Material tarred = Mats.Tarred; Material brown = Mats.Brown; Bx(ps, tarred, new Vector3(0f, 0.16f, 0f), new Vector3(2.4f, 0.32f, 2.8f)); for (int i = -1; i <= 1; i += 2) { for (int j = -1; j <= 1; j += 2) { Bx(ps, tarred, new Vector3((float)i * 1.13f, 1.1f, (float)j * 1.33f), new Vector3(0.14f, 1.56f, 0.14f)); } } Boards(ps, brown, new Vector3(1.15f, 1.06f, 0f), new Vector3(0.06f, 1.48f, 2.6f), alongZ: true); Boards(ps, brown, new Vector3(0f, 1.06f, -1.35f), new Vector3(2.2f, 1.48f, 0.06f), alongZ: false); Boards(ps, brown, new Vector3(0f, 1.06f, 1.35f), new Vector3(2.2f, 1.48f, 0.06f), alongZ: false); Bx(ps, tarred, new Vector3(0f, 1.84f, 0f), new Vector3(2.52f, 0.08f, 2.92f)); Bx(ps, tarred, new Vector3(0f, 1.91f, 0f), new Vector3(2.3f, 0.06f, 2.7f)); Bx(ps, tarred, new Vector3(-1.15f, 0.47f, 0f), new Vector3(0.08f, 0.3f, 2.6f)); Bx(ps, tarred, new Vector3(-1.15f, 1.67f, 0f), new Vector3(0.08f, 0.26f, 2.6f)); for (int k = -1; k <= 1; k += 2) { Boards(ps, brown, new Vector3(-1.15f, 1.085f, (float)k * 1.01f), new Vector3(0.06f, 0.95f, 0.58f), alongZ: true); Bx(ps, tarred, new Vector3(-1.15f, 1.085f, (float)k * 0.73f), new Vector3(0.1f, 0.95f, 0.08f)); } for (int l = -5; l <= 5; l++) { BxR(ps, Mats.Pine, new Vector3(-1.2f, 1.67f, (float)l * 0.22f), new Vector3(0.03f, 0.1f, 0.1f), Quaternion.Euler(45f, 0f, 0f)); } Bx(ps, tarred, new Vector3(-1.245f, 0.6f, 0f), new Vector3(0.05f, 0.05f, 2.7f)); Bx(ps, tarred, new Vector3(-1.245f, 1.565f, 0f), new Vector3(0.05f, 0.05f, 2.7f)); int s; for (s = -1; s <= 1; s += 2) { float num = (float)s * 0.36f; float num2 = (float)s * 1f; Movable(b, (s < 0) ? "door_head" : "door_foot", new Vector3(-1.215f, 1.083f, num), new Vector3(-1.215f, 1.083f, num2), Vector3.one, Vector3.one, Quaternion.identity, delegate(PartSet dp) { Door(dp, s); }, new Bounds(Vector3.zero, new Vector3(0.05f, 0.96f, 0.74f))); } float num3 = Bed(ps, new Bedding { Width = 2.16f, Length = 2.56f, Bottom = 0.32f, Thick = 0.2f, Pillows = 2, Mattress = Mats.Ticking, Wool = wool, Sheet = Mats.Linen, Pillow = Mats.Linen, Pelt = Mats.Deer, Seed = 4.4f }); Col(b, new Vector3(0f, num3 * 0.5f, 0f), new Vector3(2.4f, num3, 2.8f)); Col(b, new Vector3(1.15f, 1.1f, 0f), new Vector3(0.1f, 1.6f, 2.8f)); Col(b, new Vector3(0f, 1.1f, -1.35f), new Vector3(2.4f, 1.6f, 0.1f)); Col(b, new Vector3(0f, 1.1f, 1.35f), new Vector3(2.4f, 1.6f, 0.1f)); RoofCol(b, new Vector3(0f, 1.87f, 0f), new Vector3(2.52f, 0.16f, 2.92f)); Col(b, new Vector3(-1.15f, 0.47f, 0f), new Vector3(0.1f, 0.3f, 2.6f)); Col(b, new Vector3(-1.15f, 1.67f, 0f), new Vector3(0.1f, 0.26f, 2.6f)); for (int num4 = -1; num4 <= 1; num4 += 2) { Col(b, new Vector3(-1.15f, 1.085f, (float)num4 * 1.01f), new Vector3(0.1f, 0.95f, 0.6f)); } Lie(b, 0, new Vector3(-0.48f, num3 + 0.01f, 0.05f)); Lie(b, 1, new Vector3(0.48f, num3 + 0.01f, 0.05f)); MeshKit.Child(b.Root.transform, "shelter_probe", new Vector3(0f, 1.05f, 0f), Quaternion.identity); } private static void Boards(PartSet ps, Material m, Vector3 c, Vector3 size, bool alongZ) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_0065: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00be: 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_00a5: 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_00b1: 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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) float num = (alongZ ? size.z : size.x); int num2 = Mathf.Max(1, Mathf.RoundToInt(num / 0.24f)); float num3 = num / (float)num2; for (int i = 0; i < num2; i++) { float num4 = (0f - num) * 0.5f + num3 * ((float)i + 0.5f); float num5 = (float)(i * 37 % 5 - 2) * 0.003f; Vector3 c2 = (alongZ ? new Vector3(c.x + num5, c.y, c.z + num4) : new Vector3(c.x + num4, c.y, c.z + num5)); Vector3 size2 = (alongZ ? new Vector3(size.x, size.y, num3 - 0.008f) : new Vector3(num3 - 0.008f, size.y, size.z)); Bx(ps, m, c2, size2, 1.2f); } } private static void Door(PartSet ps, int side) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0081: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) Boards(ps, Mats.Brown, Vector3.zero, new Vector3(0.04f, 0.96f, 0.74f), alongZ: true); for (int i = -1; i <= 1; i += 2) { Bx(ps, Mats.Tarred, new Vector3(-0.03f, (float)i * 0.36f, 0f), new Vector3(0.025f, 0.09f, 0.74f)); } BxR(ps, Mats.Tarred, new Vector3(-0.03f, 0f, 0f), new Vector3(0.025f, 0.08f, 0.86f), Quaternion.Euler((float)side * 52f, 0f, 0f)); MeshKit.Torus(ps[Mats.Iron], new Vector3(-0.06f, 0f, (float)(-side) * 0.3f), Quaternion.Euler(0f, 0f, 90f), 0.045f, 0.008f, 12, 6); } public static Vector3 Size(BedKind k) { //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: 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_0189: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) return (Vector3)(k.Key switch { "straw" => new Vector3(2.2f, 0.45f, 2.6f), "plank" => new Vector3(2.2f, 1.12f, 2.7f), "bunk" => new Vector3(1.4f, 1.9f, 2.62f), "box" => new Vector3(2.4f, 1.95f, 2.8f), "jarl" => new Vector3(2.5f, 1.62f, 3f), "canopy" => new Vector3(2.4f, 2.25f, 2.9f), "dvergr" => new Vector3(2.4f, 1.62f, 2.9f), "ember" => new Vector3(2.5f, 1.4f, 3f), _ => new Vector3(2.2f, 1f, 2.7f), }); } private static Vector2 Off() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) _uvSeed++; float num = Mathf.Sin((float)_uvSeed * 12.9898f) * 43758.547f; float num2 = Mathf.Sin((float)_uvSeed * 78.233f) * 12345.678f; return new Vector2(num - Mathf.Floor(num), num2 - Mathf.Floor(num2)) * 4f; } public static BuiltBed Build(BedKind k) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown Mats.Init(); _uvSeed = StringExtensionMethods.GetStableHashCode(k.Prefab) & 0xFF; BuiltBed builtBed = new BuiltBed { Root = new GameObject(k.Prefab + "_model") }; PartSet partSet = new PartSet(); Material wool = Mats.Wool(k.DefaultColor); switch (k.Key) { case "straw": Straw(partSet, builtBed, wool); break; case "plank": Plank(partSet, builtBed, wool); break; case "bunk": Bunk(partSet, builtBed, wool); break; case "box": Box(partSet, builtBed, wool); break; case "jarl": Jarl(partSet, builtBed, wool); break; case "canopy": Canopy(partSet, builtBed, wool); break; case "dvergr": Dvergr(partSet, builtBed, wool); break; case "ember": Ember(partSet, builtBed, wool); break; } partSet.Emit(builtBed.Root.transform, "bed"); builtBed.Root.AddComponent<BedLook>(); return builtBed; } private static void Bx(PartSet ps, Material m, Vector3 c, Vector3 size, float uv = 1.6f) { //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_0009: 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) MeshKit.Box(ps[m], c, size, Quaternion.identity, uv, Off()); } private static void BxR(PartSet ps, Material m, Vector3 c, Vector3 size, Quaternion rot, float uv = 1.6f) { //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_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) MeshKit.Box(ps[m], c, size, rot, uv, Off()); } private static void Col(BuiltBed b, Vector3 c, Vector3 size) { //IL_0006: 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) b.Colliders.Add(new Bounds(c, size)); } private static void RoofCol(BuiltBed b, Vector3 c, Vector3 size) { //IL_0006: 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) b.Roof.Add(new Bounds(c, size)); } private static Transform Lie(BuiltBed b, int side, Vector3 at) { //IL_001c: 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_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) return MeshKit.Child(b.Root.transform, "lie_" + side, at - new Vector3(0f, 0f, 0.3f), Quaternion.identity); } private static void Turned(PartSet ps, Material m, Vector3 foot, float height, float r, Material cap = null, float capR = 0f) { //IL_0010: 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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00cc: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_015e: 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_016e: 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) List<Vector2> prof = new List<Vector2> { new Vector2(0f, 0f), new Vector2(r * 1.25f, 0f), new Vector2(r * 1.25f, 0.06f), new Vector2(r * 1.05f, 0.09f), new Vector2(r, 0.12f), new Vector2(r * 0.92f, height * 0.5f), new Vector2(r, height - 0.16f), new Vector2(r * 1.2f, height - 0.12f), new Vector2(r * 1.2f, height - 0.07f), new Vector2(r * 0.95f, height - 0.05f), new Vector2(r * 0.95f, height), new Vector2(0f, height) }; MeshBuilder meshBuilder = ps[m]; meshBuilder.Push(foot, Quaternion.identity); MeshKit.Lathe(meshBuilder, prof, 12, 2f, 1.5f, null, swapUV: true); meshBuilder.Pop(); if ((Object)(object)cap != (Object)null && capR > 0f) { MeshKit.Sphere(ps[cap], foot + Vector3.up * (height + capR * 0.8f), capR); } } private static float Bed(PartSet ps, Bedding d) { //IL_0039: 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_0264: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) float num = d.Bottom + d.Thick; SoftKit.Cushion(ps[d.Mattress], new Vector3(d.X, d.Bottom + d.Thick * 0.5f, d.Z), new Vector3(d.Width, d.Thick, d.Length), 0.35f, 0.12f, 28, 1.4f); float num2 = d.Z - d.Length * 0.5f; float num3 = d.Z + d.Length * 0.5f; Drape drape = new Drape { Top = num + 0.025f, CenterX = d.X, HalfWidth = d.Width * 0.5f - 0.07f, Z0 = num2 + 0.62f, Z1 = num3 - 0.07f, Edge = 0.08f, DropSides = d.Thick * 0.75f, DropFoot = (d.FootHang ? (d.Thick * 0.75f) : 0f), Floor = d.Bottom + 0.01f, Wave = 0.018f, Folds = 0.02f, Seed = d.Seed, HangLeft = true, HangRight = true }; SoftKit.Cover(ps[d.Wool], drape, 40, 40, 1.6f, fullUV: false, 0.03f); Drape d2 = drape; d2.Top = num + 0.05f; d2.Z0 = drape.Z0 - 0.03f; d2.Z1 = drape.Z0 + 0.24f; d2.DropFoot = 0f; d2.DropSides = d.Thick * 0.5f; d2.Floor = num - d.Thick * 0.45f; d2.HalfWidth = drape.HalfWidth + 0.01f; SoftKit.Cover(ps[d.Sheet], d2, 36, 6, 2f, fullUV: false, 0.02f); float num4 = num2 + 0.3f; if (d.Pillows == 1) { SoftKit.Cushion(ps[d.Pillow], new Vector3(d.X, num + 0.075f, num4), new Vector3(d.Width - 0.24f, 0.17f, 0.42f), 0.75f, 0.35f, 20, 2f); } else { for (int i = -1; i <= 1; i += 2) { SoftKit.Cushion(ps[d.Pillow], new Vector3(d.X + (float)i * d.Width * 0.24f, num + 0.075f, num4), new Vector3(d.Width * 0.5f - 0.12f, 0.17f, 0.42f), 0.75f, 0.35f, 20, 2f); } } if ((Object)(object)d.Pelt != (Object)null) { Drape drape2 = drape; drape2.Top = num + 0.06f; drape2.HalfWidth = d.Width * 0.5f - 0.02f; drape2.Z0 = d.Z + 0.05f; drape2.Z1 = num3 - 0.08f; drape2.DropSides = d.Thick * 0.55f; drape2.DropFoot = (d.FootHang ? (d.Thick * 0.5f) : 0f); drape2.Folds = 0.012f; SoftKit.Cover(ps[d.Pelt], drape2, 30, 24, 1f, fullUV: true, 0.01f); if ((Object)(object)d.PeltTop != (Object)null) { for (int j = 1; j <= 2; j++) { Drape d3 = drape2; d3.Top += 0.011f * (float)j; SoftKit.Cover(ps[d.PeltTop], d3, 30, 24, 1f, fullUV: true, 0.004f); } } } return num; } private static Transform Borrow(Transform parent, string prefab, string child, Material mat, Vector3 pos, Quaternion rot, Vector3 scale) { //IL_008f: 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_00a9: Unknown result type (might be due to invalid IL or missing references) GameObject val = null; try { val = PrefabManager.Instance.GetPrefab(prefab); } catch (Exception) { } if ((Object)(object)val == (Object)null) { return null; } MeshFilter[] componentsInChildren = val.GetComponentsInChildren<MeshFilter>(true); foreach (MeshFilter val2 in componentsInChildren) { if (!((Object)(object)val2.sharedMesh == (Object)null) && (child == null || !(((Object)val2).name != child))) { MeshRenderer component = ((Component)val2).GetComponent<MeshRenderer>(); MeshRenderer obj = MeshKit.Part(parent, "borrowed_" + prefab, val2.sharedMesh, mat ?? (((Object)(object)component != (Object)null) ? ((Renderer)component).sharedMaterial : null)); ((Component)obj).transform.localPosition = pos; ((Component)obj).transform.localRotation = rot; ((Component)obj).transform.localScale = scale; return ((Component)obj).transform; } } return null; } private static Light Lamp(Transform parent, Vector3 pos, Color c, float range, float intensity, float flicker, bool shadows) { //IL_0006: 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_0025: Unknown result type (might be due to invalid IL or missing references) Transform val = MeshKit.Child(parent, "light", pos, Quaternion.identity); Light obj = ((Component)val).gameObject.AddComponent<Light>(); obj.type = (LightType)2; obj.color = c; obj.range = range; obj.intensity = intensity; obj.shadows = (LightShadows)(shadows ? 2 : 0); Glow glow = ((Component)val).gameObject.AddComponent<Glow>(); glow.Base = intensity; glow.Flicker = flicker; return obj; } private static Mover Movable(BuiltBed b, string name, Vector3 closedPos, Vector3 openPos, Vector3 closedScale, Vector3 openScale, Quaternion rot, Action<PartSet> build, Bounds collider) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_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_0063: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: 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) Transform val = MeshKit.Child(b.Root.transform, name, closedPos, rot); PartSet partSet = new PartSet(); build(partSet); partSet.Emit(val, name); BoxCollider obj = ((Component)val).gameObject.AddComponent<BoxCollider>(); obj.center = ((Bounds)(ref collider)).center; obj.size = ((Bounds)(ref collider)).size; Mover mover = ((Component)val).gameObject.AddComponent<Mover>(); mover.ClosedPos = closedPos; mover.OpenPos = openPos; mover.ClosedScale = closedScale; mover.OpenScale = openScale; mover.Set(0f); return mover; } private static void Jarl(PartSet ps, BuiltBed b, Material wool) { //IL_0082: 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_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: 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_0319: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Unknown result type (might be due to invalid IL or missing references) //IL_04f6: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_0527: Unknown result type (might be due to invalid IL or missing references) //IL_0545: Unknown result type (might be due to invalid IL or missing references) Material pine = Mats.Pine; for (int i = -1; i <= 1; i += 2) { for (int j = -1; j <= 1; j += 2) { float height = ((j < 0) ? 1.5f : 1f); Turned(ps, pine, new Vector3((float)i * 1.16f, 0f, (float)j * 1.41f), height, 0.1f, Mats.Silver, 0.075f); } } for (int k = -1; k <= 1; k += 2) { Bx(ps, pine, new Vector3((float)k * 1.16f, 0.36f, 0f), new Vector3(0.12f, 0.3f, 2.7f)); Bx(ps, pine, new Vector3(0f, 0.36f, (float)k * 1.41f), new Vector3(2.2f, 0.3f, 0.12f)); } Bx(ps, Mats.Brown, new Vector3(0f, 0.97f, -1.41f), new Vector3(2.2f, 0.9f, 0.08f)); Bx(ps, pine, new Vector3(0f, 1.44f, -1.41f), new Vector3(2.24f, 0.08f, 0.12f)); Bx(ps, pine, new Vector3(0f, 1.52f, -1.41f), new Vector3(1.1f, 0.1f, 0.1f)); Bx(ps, Mats.Brown, new Vector3(0f, 0.7f, 1.41f), new Vector3(2.2f, 0.42f, 0.08f)); Bx(ps, pine, new Vector3(0f, 0.93f, 1.41f), new Vector3(2.24f, 0.06f, 0.12f)); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, 1f, -1.36f); MeshKit.Cylinder(ps[pine], val - new Vector3(0f, 0f, 0.02f), val + new Vector3(0f, 0f, 0.03f), 0.33f, 24); MeshKit.Torus(ps[Mats.Silver], val + new Vector3(0f, 0f, 0.03f), Quaternion.Euler(90f, 0f, 0f), 0.33f, 0.018f, 28, 6); MeshKit.Ellipsoid(ps[Mats.Silver], val + new Vector3(0f, 0f, 0.04f), new Vector3(0.09f, 0.09f, 0.06f), Quaternion.identity, 14); for (int l = -1; l <= 1; l += 2) { MeshKit.Torus(ps[pine], new Vector3((float)l * 0.72f, 1.05f, -1.36f), Quaternion.Euler(90f, 0f, 0f), 0.14f, 0.028f, 20, 6); MeshKit.Torus(ps[pine], new Vector3((float)l * 0.72f, 1.05f, -1.36f), Quaternion.Euler(90f, 0f, 0f), 0.06f, 0.022f, 14, 6); } for (int m = -3; m <= 3; m++) { MeshKit.Sphere(ps[Mats.Silver], new Vector3((float)m * 0.28f, 0.7f, 1.46f), 0.025f, 8, 6); } float num = Bed(ps, new Bedding { Width = 2.22f, Length = 2.72f, Bottom = 0.42f, Thick = 0.22f, Pillows = 2, FootHang = true, Mattress = Mats.Ticking, Wool = wool, Sheet = Mats.Linen, Pillow = Mats.Linen, Pelt = Mats.Wolf, PeltTop = Mats.WolfTop, Seed = 5.2f }); Col(b, new Vector3(0f, num * 0.5f, 0f), new Vector3(2.5f, num, 3f)); Col(b, new Vector3(0f, 1f, -1.41f), new Vector3(2.5f, 1.1f, 0.18f)); Col(b, new Vector3(0f, 0.75f, 1.41f), new Vector3(2.5f, 0.4f, 0.16f)); Lie(b, 0, new Vector3(-0.5f, num + 0.01f, 0.05f)); Lie(b, 1, new Vector3(0.5f, num + 0.01f, 0.05f)); } private static void Canopy(PartSet ps, BuiltBed b, Material wool) { //IL_0034: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: 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_0136: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0182: 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_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0238: 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_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0342: 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_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0397: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_040d: 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_0447: 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_0486: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_04c5: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_0518: Unknown result type (might be due to invalid IL or missing references) //IL_0543: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Unknown result type (might be due to invalid IL or missing references) //IL_05d0: Unknown result type (might be due to invalid IL or missing references) //IL_05e8: Unknown result type (might be due to invalid IL or missing references) //IL_05ed: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_06c0: Unknown result type (might be due to invalid IL or missing references) //IL_06d0: Unknown result type (might be due to invalid IL or missing references) //IL_06ed: Unknown result type (might be due to invalid IL or missing references) //IL_070b: Unknown result type (might be due to invalid IL or missing references) //IL_072b: Unknown result type (might be due to invalid IL or missing references) //IL_0730: Unknown result type (might be due to invalid IL or missing references) Material tarred = Mats.Tarred; for (int i = -1; i <= 1; i += 2) { for (int j = -1; j <= 1; j += 2) { MeshKit.Cylinder(ps[tarred], new Vector3((float)i * 1.12f, 0f, (float)j * 1.37f), new Vector3((float)i * 1.12f, 2.1799998f, (float)j * 1.37f), 0.075f, 8, caps: true, 1f, 1.2f); MeshKit.Cylinder(ps[tarred], new Vector3((float)i * 1.12f, 0f, (float)j * 1.37f), new Vector3((float)i * 1.12f, 0.12f, (float)j * 1.37f), 0.1f, 0.085f, 8); Col(b, new Vector3((float)i * 1.12f, 1.06f, (float)j * 1.37f), new Vector3(0.16f, 2.12f, 0.16f)); } } for (int k = -1; k <= 1; k += 2) { Bx(ps, tarred, new Vector3((float)k * 1.12f, 0.36f, 0f), new Vector3(0.09f, 0.24f, 2.66f)); Bx(ps, tarred, new Vector3(0f, 0.36f, (float)k * 1.37f), new Vector3(2.16f, 0.24f, 0.09f)); Bx(ps, tarred, new Vector3((float)k * 1.12f, 2.12f, 0f), new Vector3(0.08f, 0.1f, 2.86f)); Bx(ps, tarred, new Vector3(0f, 2.12f, (float)k * 1.37f), new Vector3(2.34f, 0.1f, 0.08f)); } Boards(ps, Mats.Brown, new Vector3(0f, 0.86f, -1.37f), new Vector3(2.15f, 1f, 0.06f), alongZ: false); Bx(ps, tarred, new Vector3(0f, 1.38f, -1.37f), new Vector3(2.2f, 0.07f, 0.1f)); Bx(ps, wool, new Vector3(0f, 2.185f, 0f), new Vector3(2.3f, 0.03f, 2.82f)); Valance(ps, wool, new Vector3(-1.17f, 2.1499999f, -1.41f), Quaternion.Euler(0f, -90f, 0f), 2.82f, 1.1f); Valance(ps, wool, new Vector3(1.17f, 2.1499999f, 1.41f), Quaternion.Euler(0f, 90f, 0f), 2.82f, 2.3f); Valance(ps, wool, new Vector3(1.16f, 2.1499999f, -1.42f), Quaternion.Euler(0f, 180f, 0f), 2.3f, 3.7f); Valance(ps, wool, new Vector3(-1.16f, 2.1499999f, 1.42f), Quaternion.identity, 2.3f, 4.6f); MeshBuilder meshBuilder = ps[wool]; meshBuilder.Push(new Vector3(-1.04f, 2.07f, -1.32f), Quaternion.identity); SoftKit.Curtain(meshBuilder, 2.08f, 0.66999996f, 0.16f, 0.035f, 1.6f, 0.4f); meshBuilder.Pop(); Col(b, new Vector3(0f, 1.2f, -1.37f), new Vector3(2.3f, 1.8f, 0.1f)); RoofCol(b, new Vector3(0f, 2.1799998f, 0f), new Vector3(2.34f, 0.06f, 2.86f)); float height = 1.7299999f; Curtain(b, wool, "curtain_lh", new Vector3(-1.15f, 2.07f, -1.37f), Quaternion.Euler(0f, -90f, 0f), 1.37f, height, 0.1f); Curtain(b, wool, "curtain_lf", new Vector3(-1.15f, 2.07f, 1.37f), Quaternion.Euler(0f, 90f, 0f), 1.37f, height, 1.7f); Curtain(b, wool, "curtain_rh", new Vector3(1.15f, 2.07f, -1.37f), Quaternion.Euler(0f, -90f, 0f), 1.37f, height, 2.9f); Curtain(b, wool, "curtain_rf", new Vector3(1.15f, 2.07f, 1.37f), Quaternion.Euler(0f, 90f, 0f), 1.37f, height, 0.9f); Curtain(b, wool, "curtain_fl", new Vector3(-1.12f, 2.07f, 1.4f), Quaternion.identity, 1.12f, height, 2.2f); Curtain(b, wool, "curtain_fr", new Vector3(1.12f, 2.07f, 1.4f), Quaternion.Euler(0f, 180f, 0f), 1.12f, height, 3.3f); Transform transform = b.Root.transform; for (int l = -1; l <= 1; l += 2) { Borrow(transform, "wood_dragon1", "head", Mats.Tarred, new Vector3((float)l * 1.12f, 2.1399999f, 1.37f), Quaternion.Euler(0f, (float)l * 40f, 0f), Vector3.one * 0.13f); } float num = Bed(ps, new Bedding { Width = 2.1f, Length = 2.6f, Bottom = 0.38f, Thick = 0.22f, Pillows = 2, FootHang = true, Mattress = Mats.Ticking, Wool = wool, Sheet = Mats.Linen, Pillow = Mats.Linen, Pelt = Mats.Lox, PeltTop = Mats.LoxTop, Seed = 6.6f }); Col(b, new Vector3(0f, num * 0.5f, 0f), new Vector3(2.3f, num, 2.8f)); Lie(b, 0, new Vector3(-0.48f, num + 0.01f, 0.05f)); Lie(b, 1, new Vector3(0.48f, num + 0.01f, 0.05f)); MeshKit.Child(transform, "shelter_probe", new Vector3(0f, 1.15f, 0f), Quaternion.identity); } private static void Valance(PartSet ps, Material m, Vector3 at, Quaternion rot, float width, float seed) { //IL_0008: 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) MeshBuilder meshBuilder = ps[m]; meshBuilder.Push(at, rot); SoftKit.Curtain(meshBuilder, width, 0.26f, 0.12f, 0.025f, 1.6f, seed); meshBuilder.Pop(); } private static void Curtain(BuiltBed b, Material m, string name, Vector3 post, Quaternion rot, float width, float height, float seed) { //IL_0027: 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_0029: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) Movable(b, name, post, post, Vector3.one, new Vector3(0.13f, 1f, 1f), rot, delegate(PartSet ps) { SoftKit.Curtain(ps[m], width, height, 0.15f, 0.045f, 1.6f, seed); }, new Bounds(new Vector3(width * 0.5f, (0f - height) * 0.5f, 0f), new Vector3(width, height, 0.08f))); } private static void Dvergr(PartSet ps, BuiltBed b, Material wool) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0097: 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_00e1: 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_0137: 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_019b: 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_01dc: 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_0239: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0343: 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_0358: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: 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_04e0: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_0549: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) Material marble = Mats.Marble; Bx(ps, marble, new Vector3(0f, 0.06f, 0f), new Vector3(2.4f, 0.12f, 2.9f)); Bx(ps, marble, new Vector3(0f, 0.27f, 0f), new Vector3(2.28f, 0.3f, 2.78f)); Bx(ps, Mats.Copper, new Vector3(0f, 0.405f, 0f), new Vector3(2.32f, 0.035f, 2.82f)); for (int i = -1; i <= 1; i += 2) { for (int j = -1; j <= 1; j += 2) { Bx(ps, Mats.Copper, new Vector3((float)i * 1.15f, 0.27f, (float)j * 1.4f), new Vector3(0.05f, 0.3f, 0.05f)); } } for (int k = -1; k <= 1; k += 2) { Bx(ps, marble, new Vector3((float)k * 1.05f, 0.8f, -1.36f), new Vector3(0.22f, 1.6f, 0.22f)); Bx(ps, Mats.Copper, new Vector3((float)k * 1.05f, 1.63f, -1.36f), new Vector3(0.27f, 0.06f, 0.27f)); Bx(ps, Mats.Copper, new Vector3((float)k * 1.05f, 0.45f, -1.36f), new Vector3(0.25f, 0.04f, 0.25f)); MeshKit.Cylinder(ps[Mats.Copper], new Vector3((float)k * 1.05f, 1.66f, -1.36f), new Vector3((float)k * 1.05f, 1.74f, -1.36f), 0.07f, 0.02f, 6); } Boards(ps, Mats.Ygg, new Vector3(0f, 0.97f, -1.38f), new Vector3(1.88f, 1.06f, 0.08f), alongZ: false); Bx(ps, Mats.Copper, new Vector3(0f, 1.52f, -1.38f), new Vector3(1.9f, 0.04f, 0.1f)); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, 1.05f, -1.33f); MeshKit.Cylinder(ps[Mats.Copper], val - new Vector3(0f, 0f, 0.01f), val + new Vector3(0f, 0f, 0.02f), 0.24f, 6); MeshKit.Cylinder(ps[Mats.Marble], val, val + new Vector3(0f, 0f, 0.035f), 0.18f, 6); MeshKit.Cylinder(ps[Mats.Copper], val, val + new Vector3(0f, 0f, 0.05f), 0.06f, 6); Transform transform = b.Root.transform; for (int l = -1; l <= 1; l += 2) { Borrow(transform, "piece_dvergr_lantern", "default", Mats.Lantern, new Vector3((float)l * 1.16f, 1.48f, -1.36f), Quaternion.Euler(0f, (l < 0) ? 0f : 180f, 0f), Vector3.one * 0.55f); Lamp(transform, new Vector3((float)l * 1.68f, 1.18f, -1.36f), new Color(0.55f, 0.78f, 1f), 5f, 1.1f, 0.05f, shadows: false); } float num = Bed(ps, new Bedding { Width = 2.2f, Length = 2.66f, Bottom = 0.42f, Thick = 0.2f, Pillows = 2, FootHang = true, Mattress = Mats.Linen, Wool = wool, Sheet = Mats.Linen, Pillow = Mats.Linen, Seed = 7.7f }); Col(b, new Vector3(0f, num * 0.5f, 0f), new Vector3(2.4f, num, 2.9f)); Col(b, new Vector3(0f, 0.85f, -1.36f), new Vector3(2.36f, 1.7f, 0.24f)); Lie(b, 0, new Vector3(-0.48f, num + 0.01f, 0.05f)); Lie(b, 1, new Vector3(0.48f, num + 0.01f, 0.05f)); } private static void Ember(PartSet ps, BuiltBed b, Material wool) { //IL_0039: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: 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_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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_025a: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02da: 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_039c: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_043c: 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_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04cc: Unknown result type (might be due to invalid IL or missing references) //IL_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_04f8: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Unknown result type (might be due to invalid IL or missing references) //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03f2: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Unknown result type (might be due to invalid IL or missing references) //IL_054d: Unknown result type (might be due to invalid IL or missing references) //IL_0555: Unknown result type (might be due to invalid IL or missing references) //IL_0557: Unknown result type (might be due to invalid IL or missing references) //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_056d: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_066d: Unknown result type (might be due to invalid IL or missing references) //IL_0681: Unknown result type (might be due to invalid IL or missing references) //IL_06b0: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Unknown result type (might be due to invalid IL or missing references) //IL_06d3: 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_06fe: Unknown result type (might be due to invalid IL or missing references) //IL_0712: Unknown result type (might be due to invalid IL or missing references) //IL_0730: Unknown result type (might be due to invalid IL or missing references) //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_0598: Unknown result type (might be due to invalid IL or missing references) Material grausten = Mats.Grausten; float[] array = new float[8] { -1.5f, -1.01f, -0.59f, -0.21f, 0.21f, 0.59f, 1.01f, 1.5f }; for (int i = -1; i <= 1; i += 2) { float num = (float)i * 1.19f; Bx(ps, grausten, new Vector3(num, 0.06f, 0f), new Vector3(0.12f, 0.12f, 3f)); Bx(ps, grausten, new Vector3(num, 0.43f, 0f), new Vector3(0.12f, 0.13999999f, 3f)); for (int j = 0; j < array.Length; j += 2) { Bx(ps, grausten, new Vector3(num, 0.24000001f, (array[j] + array[j + 1]) * 0.5f), new Vector3(0.12f, 0.24000001f, array[j + 1] - array[j])); } for (int k = 1; k < array.Length - 1; k += 2) { Grate(ps, new Vector3((float)i * 1.255f, 0f, (array[k] + array[k + 1]) * 0.5f), alongZ: true, array[k + 1] - array[k]); } } float[] array2 = new float[6] { -1.13f, -0.7f, -0.3f, 0.3f, 0.7f, 1.13f }; float num2 = 1.44f; Bx(ps, grausten, new Vector3(0f, 0.06f, num2), new Vector3(2.26f, 0.12f, 0.12f)); Bx(ps, grausten, new Vector3(0f, 0.43f, num2), new Vector3(2.26f, 0.13999999f, 0.12f)); for (int l = 0; l < array2.Length; l += 2) { Bx(ps, grausten, new Vector3((array2[l] + array2[l + 1]) * 0.5f, 0.24000001f, num2), new Vector3(array2[l + 1] - array2[l], 0.24000001f, 0.12f)); } for (int m = 1; m < array2.Length - 1; m += 2) { Grate(ps, new Vector3((array2[m] + array2[m + 1]) * 0.5f, 0f, 1.505f), alongZ: false, array2[m + 1] - array2[m]); } Bx(ps, grausten, new Vector3(0f, 0.25f, 0f - num2), new Vector3(2.26f, 0.5f, 0.12f)); Bx(ps, grausten, new Vector3(0f, 0.54f, 0f), new Vector3(2.54f, 0.08f, 3.04f)); Bx(ps, Mats.Glow, new Vector3(0f, 0.14f, 0f), new Vector3(2.24f, 0.04f, 2.74f)); Random random = new Random(77); Vector3 c = default(Vector3); for (int n = 0; n < 70; n++) { ((Vector3)(ref c))..ctor((float)(random.NextDouble() * 2.0 - 1.0) * 1.01f, 0.17f, (float)(random.NextDouble() * 2.0 - 1.0) * 1.26f); float num3 = 0.04f + (float)random.NextDouble() * 0.05f; MeshKit.Ellipsoid(ps[Mats.Embers], c, new Vector3(num3 * 1.3f, num3 * 0.7f, num3), Quaternion.Euler(0f, (float)random.NextDouble() * 180f, 0f), 8, 5); } for (int num4 = -1; num4 <= 1; num4 += 2) { for (int num5 = -1; num5 <= 1; num5 += 2) { Bx(ps, Mats.Flametal, new Vector3((float)num4 * 1.26f, 0.3f, (float)num5 * 1.51f), new Vector3(0.1f, 0.6f, 0.1f), 2f); } } Bx(ps, grausten, new Vector3(0f, 1f, -1.43f), new Vector3(2.5f, 0.92f, 0.14f)); Bx(ps, grausten, new Vector3(0f, 1.48f, -1.43f), new Vector3(2.6f, 0.07f, 0.22f)); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, 1.02f, -1.35f); MeshKit.Cylinder(ps[Mats.Flametal], val - new Vector3(0f, 0f, 0.02f), val + new Vector3(0f, 0f, 0.025f), 0.2f, 16); MeshKit.Cylinder(ps[Mats.Glow], val, val + new Vector3(0f, 0f, 0.03f), 0.09f, 16); for (int num6 = 0; num6 < 12; num6++) { float num7 = (float)num6 * 30f; Quaternion val2 = Quaternion.Euler(0f, 0f, num7); BxR(ps, Mats.Flametal, val + val2 * new Vector3(0f, 0.31f, 0.005f), new Vector3(0.04f, (num6 % 2 == 0) ? 0.18f : 0.12f, 0.03f), val2, 2f); } float num8 = Bed(ps, new Bedding { Width = 2.26f, Length = 2.7f, Bottom = 0.58f, Thick = 0.2f, Pillows = 2, Z = 0.06f, FootHang = true, Mattress = Mats.Ticking, Wool = wool, Sheet = Mats.Linen, Pillow = Mats.Linen, Pelt = Mats.Asksvin, Seed = 8.8f }); Transform transform = b.Root.transform; Lamp(transform, new Vector3(0f, 0.3f, 0.2f), new Color(1f, 0.45f, 0.15f), 3.4f, 1.7f, 0.25f, shadows: false); MeshKit.Child(transform, "heat", new Vector3(0f, 0.6f, 0f), Quaternion.identity); Col(b, new Vector3(0f, num8 * 0.5f, 0f), new Vector3(2.5f, num8, 3f)); Col(b, new Vector3(0f, 1f, -1.43f), new Vector3(2.6f, 1f, 0.22f)); Lie(b, 0, new Vector3(-0.5f, num8 + 0.01f, 0.1f)); Lie(b, 1, new Vector3(0.5f, num8 + 0.01f, 0.1f)); } private static void Grate(PartSet ps, Vector3 at, bool alongZ, float width) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL