Some mods target the Mono version of the game, which is available by opting into the Steam beta branch "alternate"
Decompiled source of Drug Pack v2.2.9
Mods/WoodStudios.DrugPack.dll
Decompiled 39 minutes 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.IO.Compression; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using System.Text.Json; using AngelDustLabMod; using DP_AngelDustLab.FybCommon; using DP_AngelDustLab.WoodKit; using DP_AngelDustLab.WoodLabs; using DP_DmtLab.FybCommon; using DP_DmtLab.WoodKit; using DP_DmtLab.WoodLabs; using DP_EdiblesKitchen.FybCommon; using DP_EdiblesKitchen.WoodKit; using DP_EdiblesKitchen.WoodLabs; using DP_LsdLab.FybCommon; using DP_LsdLab.WoodKit; using DP_LsdLab.WoodLabs; using DP_PillPress.FybCommon; using DP_PillPress.WoodKit; using DP_PillPress.WoodLabs; using DP_PoppyLab.FybCommon; using DP_PoppyLab.WoodKit; using DP_PoppyLab.WoodLabs; using DP_PreRollShop.FybCommon; using DP_PreRollShop.WoodKit; using DP_PreRollShop.WoodLabs; using DP_TobaccoBarn.FybCommon; using DP_TobaccoBarn.WoodKit; using DP_TobaccoBarn.WoodLabs; using DP_VapeLab.FybCommon; using DP_VapeLab.WoodKit; using DP_VapeLab.WoodLabs; using DmtLabMod; using DrugPack; using EdiblesKitchenMod; using HarmonyLib; using HoldTheFort; using Il2CppFishNet; using Il2CppInterop.Runtime; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppScheduleOne; using Il2CppScheduleOne.AvatarFramework; using Il2CppScheduleOne.AvatarFramework.Animation; using Il2CppScheduleOne.Building; using Il2CppScheduleOne.Core.Items.Framework; using Il2CppScheduleOne.DevUtilities; using Il2CppScheduleOne.Economy; using Il2CppScheduleOne.Effects.MixMaps; using Il2CppScheduleOne.Employees; using Il2CppScheduleOne.EntityFramework; using Il2CppScheduleOne.Equipping; using Il2CppScheduleOne.Instancing; using Il2CppScheduleOne.ItemFramework; using Il2CppScheduleOne.Map; using Il2CppScheduleOne.Messaging; using Il2CppScheduleOne.NPCs; using Il2CppScheduleOne.NPCs.Behaviour; using Il2CppScheduleOne.NPCs.Relation; using Il2CppScheduleOne.Networking; using Il2CppScheduleOne.ObjectScripts; using Il2CppScheduleOne.Packaging; using Il2CppScheduleOne.Persistence; using Il2CppScheduleOne.PlayerScripts; using Il2CppScheduleOne.PlayerTasks; using Il2CppScheduleOne.Product; using Il2CppScheduleOne.Product.Packaging; using Il2CppScheduleOne.Property; using Il2CppScheduleOne.Quests; using Il2CppScheduleOne.Storage; using Il2CppScheduleOne.Tiles; using Il2CppScheduleOne.UI; using Il2CppScheduleOne.UI.Phone; using Il2CppScheduleOne.UI.Phone.ProductManagerApp; using Il2CppScheduleOne.UI.Relations; using Il2CppScheduleOne.UI.Shop; using Il2CppScheduleOne.Weather; using Il2CppSteamworks; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using Il2CppSystem.Reflection; using LsdLabMod; using MelonLoader; using MelonLoader.Preferences; using MelonLoader.Utils; using Microsoft.CodeAnalysis; using PillPressMod; using PoppyLabMod; using PreRollShopMod; using S1API.DeadDrops; using S1API.Economy; using S1API.Entities; using S1API.Entities.Customer; using S1API.Entities.Relation; using S1API.Entities.Schedule; using S1API.Entities.Supplier; using S1API.GameTime; using S1API.Items; using S1API.Items.Storable; using S1API.Lifecycle; using S1API.Map; using S1API.Messaging; using S1API.Money; using S1API.Products; using S1API.Properties; using S1API.Properties.Interfaces; using S1API.Rendering; using S1API.Shops; using Schedule2; using Schedule2.Game; using TobaccoBarnMod; using UnityEngine; using UnityEngine.AI; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.Rendering; using UnityEngine.Rendering.Universal; using UnityEngine.UI; using VapeLabMod; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: MelonInfo(typeof(DrugPackMod), "Drug Pack - All In One", "2.2.9", "Wood Studios", null)] [assembly: MelonGame("TVGS", "Schedule I")] [assembly: MelonOptionalDependencies(new string[] { "HoldTheFort" })] [assembly: AssemblyTitle("WoodStudios.DrugPack")] [assembly: AssemblyProduct("WoodStudios.DrugPack")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.2.9.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [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 Schedule2 { internal static class Res { private static readonly Assembly Asm = typeof(Res).Assembly; public static Stream Open(string name) { Stream manifestResourceStream = Asm.GetManifestResourceStream(name); if (manifestResourceStream == null) { return null; } int num = manifestResourceStream.ReadByte(); int num2 = manifestResourceStream.ReadByte(); manifestResourceStream.Position = 0L; if (num != 31 || num2 != 139) { return manifestResourceStream; } MemoryStream memoryStream = new MemoryStream(); using (GZipStream gZipStream = new GZipStream(manifestResourceStream, CompressionMode.Decompress)) { gZipStream.CopyTo(memoryStream); } memoryStream.Position = 0L; return memoryStream; } } } namespace Schedule2.Game { internal static class Sfx { public static AudioClip Create(string name, int lengthSamples, int channels, int frequency, bool stream) { return AudioClip.Create(name, lengthSamples, channels, frequency, stream); } public static bool SetData(AudioClip clip, Il2CppStructArray<float> data, int offset) { if ((Object)(object)clip != (Object)null) { return clip.SetData(data, offset); } return false; } } internal static class Gate { public static bool LabOpen(string title) { return true; } } } namespace VapeLabMod { public sealed class SkyeVance : DP_VapeLab.WoodLabs.LabSupplierNpc { } public sealed class VapeCore : LabModule { private static Color Teal => new Color(0.16f, 0.78f, 0.78f); internal static DP_VapeLab.WoodLabs.LabDef Build() { //IL_0048: 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_0054: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_0150: 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_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: 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) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: 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_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_058e: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_0694: Unknown result type (might be due to invalid IL or missing references) //IL_0699: 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_0710: 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_0735: Unknown result type (might be due to invalid IL or missing references) //IL_0760: Unknown result type (might be due to invalid IL or missing references) //IL_0765: Unknown result type (might be due to invalid IL or missing references) //IL_0785: Unknown result type (might be due to invalid IL or missing references) //IL_078a: Unknown result type (might be due to invalid IL or missing references) //IL_07aa: Unknown result type (might be due to invalid IL or missing references) //IL_07af: Unknown result type (might be due to invalid IL or missing references) //IL_07cf: Unknown result type (might be due to invalid IL or missing references) //IL_07d4: Unknown result type (might be due to invalid IL or missing references) DP_VapeLab.WoodLabs.LabDef labDef = new DP_VapeLab.WoodLabs.LabDef { Title = "Vape Lab", Folder = "VapeLab", Prefix = "vl_", Ns = "woodstudios.vapelab", Short = "vapes", KindName = "Vapes", Accent = Teal, Compat = (DrugType)0, InputType = (DrugType)0, InputName = "weed", Template = "ogkush", Region = (Region)1, DevKey = (KeyCode)44, DevRow = 0 }; labDef.Products = new DP_VapeLab.WoodLabs.ProductSpec[5] { new DP_VapeLab.WoodLabs.ProductSpec { Key = "live-rosin", Name = "Live Rosin", Base = true, Price = 95f, Addictiveness = 0.25f, Model = "VL_Rosin.glb", Description = "Golden, sticky rosin pressed from your own weed. Sell it as it is, or fill vape carts with it.", Properties = (PropertyBase[])(object)new PropertyBase[3] { Property.Euphoric, Property.Focused, Property.Calming }, IconEuler = new Vector3(35f, 20f, 0f), BagScale = 0.9f }, Vape("mango-haze", "Mango Haze Vape", 80f, new Color(1f, 0.58f, 0.08f), "Ripe mango over a smooth, sunny high.", Property.TropicThunder, Property.Euphoric, Property.Energizing), Vape("blue-razz", "Blue Razz Ice Vape", 85f, new Color(0.15f, 0.42f, 1f), "Sour blue raspberry with an icy finish that wakes you right up.", Property.Electrifying, Property.Refreshing, Property.Focused), Vape("mint-frost", "Mint Frost Vape", 75f, new Color(0.4f, 0.95f, 0.68f), "Cool mint and a clear head.", Property.Refreshing, Property.Calming, Property.BrightEyed), Vape("strawberry-cloud", "Strawberry Cloud Vape", 90f, new Color(1f, 0.28f, 0.45f), "Sweet strawberry clouds and a mellow, easy float.", Property.Euphoric, Property.Calming, Property.Sneaky) }; labDef.Items = new DP_VapeLab.WoodLabs.ItemDef[6] { new DP_VapeLab.WoodLabs.ItemDef { Id = "vl_filterbags", Name = "Rosin Filter Bags", Price = 15f, Stack = 20, Model = "VL_Bags.glb", Color = new Color(0.9f, 0.88f, 0.8f), Description = "A pack of fine mesh filter bags for the Rosin Press. One pack presses one batch." }, new DP_VapeLab.WoodLabs.ItemDef { Id = "vl_cart", Name = "Empty Vape Cart", Price = 4f, Stack = 50, Model = "VL_Cart.glb", Color = new Color(0.8f, 0.85f, 0.88f), IconTilt = new Vector3(0f, 0f, 30f), IconCopies = 3, Description = "An empty glass vape cartridge on a slim battery. The Cart Filling Station fills ten a batch." }, Terp("vl_terp_mango", "Mango Terpenes", new Color(1f, 0.58f, 0.08f), "A dropper bottle of food-grade terpenes. One bottle flavours a batch of ten carts at the Cart Filling Station."), Terp("vl_terp_razz", "Blue Razz Terpenes", new Color(0.15f, 0.42f, 1f), "A dropper bottle of food-grade terpenes. One bottle flavours a batch of ten carts at the Cart Filling Station."), Terp("vl_terp_mint", "Mint Terpenes", new Color(0.4f, 0.95f, 0.68f), "A dropper bottle of food-grade terpenes. One bottle flavours a batch of ten carts at the Cart Filling Station."), Terp("vl_terp_straw", "Strawberry Terpenes", new Color(1f, 0.28f, 0.45f), "A dropper bottle of food-grade terpenes. One bottle flavours a batch of ten carts at the Cart Filling Station.") }; labDef.Stations = new DP_VapeLab.WoodLabs.StationSpec[2] { new DP_VapeLab.WoodLabs.StationSpec { Id = "vl_press", Name = "Rosin Press", Price = 1800f, Model = "VL_Press.glb", Verb = "Pressing", Box = new Vector3(0.8f, 1.32f, 0.62f), Description = "A heated rosin press on a steel cart. Load five of your weed and a pack of filter bags and it presses three Live Rosin, as good as the weed that went in.", Bob = new string[1] { "Platen:0.035:2.6" }, Lamp = "Lamp", Tray = "Tray", Busy = "Heat", Recipes = new DP_VapeLab.WoodLabs.RecipeSpec[1] { new DP_VapeLab.WoodLabs.RecipeSpec { Name = "Live Rosin", Note = "Presses your weed (any strain, loose or packed) into golden Live Rosin.", Inputs = new DP_VapeLab.WoodLabs.InputSpec[2] { new DP_VapeLab.WoodLabs.InputSpec { AnyOfType = true, Qty = 5, Label = "Weed (any strain)" }, new DP_VapeLab.WoodLabs.InputSpec { Item = "vl_filterbags", Qty = 1 } }, OutProduct = "live-rosin", OutQty = 3, Minutes = 60f } } }, new DP_VapeLab.WoodLabs.StationSpec { Id = "vl_filler", Name = "Cart Filling Station", Price = 2600f, Model = "VL_Filler.glb", Verb = "Filling", Box = new Vector3(1.5f, 1.05f, 0.7f), Description = "A bench with a heated dispenser that fills vape carts ten at a time. Load Live Rosin, empty carts and a bottle of terpenes for the flavour.", Slide = new string[1] { "Head:0.32:2.2" }, Lamp = "Lamp", Tray = "Rack", Busy = "Glow", Recipes = new DP_VapeLab.WoodLabs.RecipeSpec[4] { Fill("Mango Haze", "mango-haze", "vl_terp_mango"), Fill("Blue Razz Ice", "blue-razz", "vl_terp_razz"), Fill("Mint Frost", "mint-frost", "vl_terp_mint"), Fill("Strawberry Cloud", "strawberry-cloud", "vl_terp_straw") } } }; labDef.Pack = new DP_VapeLab.WoodLabs.PackSpec { Id = "vl_box", Name = "Vape Box", Model = "VL_Box.glb", Template = "jar", Price = 5f, Tint = new Color(0.08f, 0.32f, 0.34f), Description = "A slim retail box that holds five vapes. Pack vapes into it at a packaging station, the same as a jar." }; labDef.Supplier = new DP_VapeLab.WoodLabs.PersonSpec { Id = "vl_skye", First = "Skye", Last = "Vance", Gender = 1f, Height = 1f, Weight = 0.35f, Skin = new Color32((byte)232, (byte)196, (byte)170, byte.MaxValue), Hair = "Avatar/Hair/messybob/MessyBob", HairCol = new Color(0.12f, 0.62f, 0.62f), Face = "Avatar/Layers/Face/Face_SmugPout", Top = "Avatar/Layers/Top/V-Neck", TopCol = new Color(0.06f, 0.06f, 0.07f), Bottom = "Avatar/Layers/Bottom/CargoPants", BottomCol = new Color(0.3f, 0.31f, 0.3f), Shoes = "Avatar/Accessories/Feet/CombatBoots/CombatBoots", ShoeCol = new Color(0.08f, 0.08f, 0.08f), Chest = "Avatar/Accessories/Chest/CollarJacket/CollarJacket", ChestCol = new Color(0.1f, 0.35f, 0.36f) }; labDef.StashDrop = "3ed706ba-458d-44b5-95cd-d65e4a699043"; labDef.StashText = "Forgot to say: whatever you order goes on your tab. Leave what you owe in my stash {where}. It's marked on your map."; labDef.SupplierIntro = "Hey, it's Skye. Word is you grow good weed. I kit out vape labs: a Rosin Press, a Cart Filling Station, filter bags, empty carts, terpenes and Vape Boxes. Text me an order and I'll leave it at a dead drop. Press your weed into Live Rosin, fill carts with it and my crowd in Westville will buy every vape you make."; labDef.Customers = Array.Empty<DP_VapeLab.WoodLabs.PersonSpec>(); return labDef; } private static DP_VapeLab.WoodLabs.ProductSpec Vape(string key, string name, float price, Color tint, string blurb, params PropertyBase[] props) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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) DP_VapeLab.WoodLabs.ProductSpec productSpec = new DP_VapeLab.WoodLabs.ProductSpec(); productSpec.Key = key; productSpec.Name = name; productSpec.Price = price; productSpec.Tint = tint; productSpec.Model = "VL_Pen.glb"; productSpec.Properties = props; productSpec.Addictiveness = 0.3f; productSpec.Description = blurb + " A vape cart filled with Live Rosin pressed from your own weed."; productSpec.IconEuler = new Vector3(-40f, 70f, 0f); productSpec.BagScale = 0.55f; productSpec.JarEuler = new Vector3(-90f, 0f, 0f); productSpec.Jar = (Vector3[])(object)new Vector3[3] { new Vector3(-0.018f, 0.045f, 0f), new Vector3(0.016f, 0.045f, 0.012f), new Vector3(0.006f, 0.045f, -0.02f) }; return productSpec; } private static DP_VapeLab.WoodLabs.ItemDef Terp(string id, string name, Color c, string desc) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) return new DP_VapeLab.WoodLabs.ItemDef { Id = id, Name = name, Price = 30f, Stack = 20, Model = "VL_Terp.glb", Color = c, Tint = c, Description = desc }; } private static DP_VapeLab.WoodLabs.RecipeSpec Fill(string name, string product, string terp) { DP_VapeLab.WoodLabs.RecipeSpec recipeSpec = new DP_VapeLab.WoodLabs.RecipeSpec(); recipeSpec.Name = name; recipeSpec.Note = "Fills ten carts with Live Rosin and terpenes. The vapes are as good as the rosin."; recipeSpec.Inputs = new DP_VapeLab.WoodLabs.InputSpec[3] { new DP_VapeLab.WoodLabs.InputSpec { Product = "live-rosin", Qty = 3 }, new DP_VapeLab.WoodLabs.InputSpec { Item = "vl_cart", Qty = 10 }, new DP_VapeLab.WoodLabs.InputSpec { Item = terp, Qty = 1 } }; recipeSpec.OutProduct = product; recipeSpec.OutQty = 10; recipeSpec.Minutes = 90f; return recipeSpec; } public override void OnInitializeMelon() { try { DP_VapeLab.WoodLabs.LabHost.Init(this, Build(), base.HarmonyInstance); base.LoggerInstance.Msg("Vape Lab loaded. Skye Vance texts you once you're in your save; order the gear from her."); } catch (Exception ex) { base.LoggerInstance.Error("Vape Lab couldn't start: " + ex.Message + ". It needs MelonLoader 0.7 and S1API (Bars fork) 3.2.3 or newer."); } } public override void OnUpdate() { DP_VapeLab.WoodLabs.LabHost.Update(); } public override void OnGUI() { DP_VapeLab.WoodLabs.LabHost.OnGUI(); } } } namespace TobaccoBarnMod { internal static class LegalTobacco { private static bool _logged; public static void Patch(Harmony h) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown try { h.Patch((MethodBase)AccessTools.Method(typeof(BodySearchBehaviour), "DoesPlayerContainItemsOfInterest", (Type[])null, (Type[])null), (HarmonyMethod)null, new HarmonyMethod(typeof(LegalTobacco), "Postfix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } catch (Exception ex) { Instance log = DP_TobaccoBarn.WoodKit.Kit.Log; if (log != null) { log.Warning("Tobacco Barn: legal tobacco at body searches (" + ex.Message + ")."); } } } private static void Postfix(BodySearchBehaviour __instance, ref bool __result) { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) if (!__result) { return; } try { PlayerInventory instance = PlayerSingleton<PlayerInventory>.Instance; List<HotbarSlot> val = ((instance != null) ? instance.hotbarSlots : null); if (val == null) { return; } bool flag = false; for (int i = 0; i < val.Count; i++) { HotbarSlot obj = val[i]; ItemInstance val2 = ((obj != null) ? ((ItemSlot)obj).ItemInstance : null); if (val2 == null) { continue; } ProductItemInstance val3 = ((Il2CppObjectBase)val2).TryCast<ProductItemInstance>(); if (val3 != null) { if (DP_TobaccoBarn.WoodLabs.LabHost.Def != null && DP_TobaccoBarn.WoodLabs.LabHost.Def.IsOurs(((BaseItemInstance)val3).ID)) { flag = true; continue; } PackagingDefinition appliedPackaging = val3.AppliedPackaging; if ((Object)(object)appliedPackaging == (Object)null || appliedPackaging.StealthLevel <= __instance.MaxStealthLevel) { return; } } else { ItemDefinition definition = val2.Definition; if ((Object)(object)definition != (Object)null && (int)((BaseItemDefinition)definition).legalStatus != 0) { return; } } } if (!flag) { return; } __result = false; if (!_logged) { _logged = true; Instance log = DP_TobaccoBarn.WoodKit.Kit.Log; if (log != null) { log.Msg("Tobacco Barn: a body search found only tobacco, which is legal."); } } } catch { } } } internal static class Smoke { private const string Ns = "woodstudios.tobaccobarn:products/"; private const float HoldTime = 1.3f; private const float Cooldown = 6f; private static float _hold; private static float _cool; private static int _startQty = -1; private static readonly List<(Transform t, float born, Vector3 drift)> _puffs = new List<(Transform, float, Vector3)>(); private static Material _puffMat; private static string _lastId; private static int _lastQty = -1; private static float _held; private static float _upAt = -10f; public static void Update() { Animate(); ItemInstanceRef(out var inst, out var id); if (inst == null || id == null || !id.StartsWith("woodstudios.tobaccobarn:products/", StringComparison.OrdinalIgnoreCase) || id.EndsWith("rolling-tobacco", StringComparison.OrdinalIgnoreCase)) { _lastId = null; _lastQty = -1; _held = 0f; return; } int num; float held; if (Input.GetMouseButton(0)) { num = ((!Cursor.visible) ? 1 : 0); if (num != 0) { held = _held + Time.deltaTime; goto IL_0075; } } else { num = 0; } held = 0f; goto IL_0075; IL_0075: _held = held; int quantity = ((BaseItemInstance)inst).Quantity; if (num != 0) { _upAt = Time.unscaledTime; } if (id == _lastId && _lastQty >= 0 && quantity < _lastQty && !Cursor.visible && Time.unscaledTime - _upAt < 8f) { Kit_Warn_Info("Tobacco Barn: smoked one (" + _lastQty + " -> " + quantity + ")."); Puff(); string text = (id.Contains("cigar") ? "cigar" : (id.Contains("pods") ? "pod" : "cigarette")); DP_TobaccoBarn.FybCommon.FortifyApi.Hint((text == "cigar") ? "A slow, rich smoke." : ((text == "pod") ? "Sweet vapour. Nice buzz." : "That hits the spot.")); } _lastId = id; _lastQty = quantity; } private static void ItemInstanceRef(out ItemInstance inst, out string id) { inst = null; id = null; try { PlayerInventory instance = PlayerSingleton<PlayerInventory>.Instance; inst = (((Object)(object)instance != (Object)null && instance.equippedSlot != null) ? ((ItemSlot)instance.equippedSlot).ItemInstance : null); id = ((inst != null) ? ((BaseItemInstance)inst).ID : null); } catch { inst = null; id = null; } } private static void Puff() { //IL_0126: 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_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0191: 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_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) Camera main = Camera.main; if ((Object)(object)main == (Object)null) { return; } if ((Object)(object)_puffMat == (Object)null) { _puffMat = new Material(Shader.Find("Universal Render Pipeline/Unlit") ?? Shader.Find("Unlit/Color")); try { _puffMat.SetFloat("_Surface", 1f); _puffMat.SetInt("_SrcBlend", 5); _puffMat.SetInt("_DstBlend", 10); _puffMat.SetInt("_ZWrite", 0); _puffMat.renderQueue = 3000; _puffMat.EnableKeyword("_SURFACE_TYPE_TRANSPARENT"); } catch { } } for (int i = 0; i < 4; i++) { GameObject val = GameObject.CreatePrimitive((PrimitiveType)0); Object.Destroy((Object)(object)val.GetComponent<Collider>()); ((Object)val).name = "tb_SmokePuff"; Material val2 = new Material(_puffMat); val2.color = new Color(0.86f, 0.86f, 0.88f, 0.3f); try { val2.SetColor("_BaseColor", val2.color); } catch { } ((Renderer)val.GetComponent<MeshRenderer>()).sharedMaterial = val2; val.transform.position = ((Component)main).transform.position + ((Component)main).transform.forward * (0.55f + (float)i * 0.1f) + Vector3.down * 0.18f + ((Component)main).transform.right * Random.Range(-0.08f, 0.08f); val.transform.localScale = Vector3.one * 0.05f; Vector3 item = ((Component)main).transform.forward * Random.Range(0.35f, 0.6f) + Vector3.up * Random.Range(0.3f, 0.5f) + Random.insideUnitSphere * 0.15f; _puffs.Add((val.transform, Time.time + (float)i * 0.25f, item)); } } private static void Animate() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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) for (int num = _puffs.Count - 1; num >= 0; num--) { var (val, num2, val2) = _puffs[num]; if ((Object)(object)val == (Object)null) { _puffs.RemoveAt(num); } else { float num3 = Time.time - num2; if (!(num3 < 0f)) { if (num3 > 3f) { Object.Destroy((Object)(object)((Component)val).gameObject); _puffs.RemoveAt(num); } else { val.position += val2 * Time.deltaTime; val.localScale = Vector3.one * Mathf.Lerp(0.05f, 0.32f, num3 / 3f); try { Material sharedMaterial = ((Renderer)((Component)val).GetComponent<MeshRenderer>()).sharedMaterial; Color color = sharedMaterial.color; color.a = Mathf.Lerp(0.3f, 0f, num3 / 3f); sharedMaterial.color = color; sharedMaterial.SetColor("_BaseColor", color); } catch { } } } } } } private static void Kit_Warn_Info(string s) { try { Instance log = DP_TobaccoBarn.WoodKit.Kit.Log; if (log != null) { log.Msg(s); } } catch { } } private static void Kit_Warn(string s) { try { Instance log = DP_TobaccoBarn.WoodKit.Kit.Log; if (log != null) { log.Warning(s); } } catch { } } } public static class SmokeDev { public static string Give() { try { ItemDefinition item = Registry.GetItem("woodstudios.tobaccobarn:products/classic-reds"); if ((Object)(object)item == (Object)null) { return "no item"; } PlayerSingleton<PlayerInventory>.Instance.AddItemToInventory(item.GetDefaultInstance(3)); return "gave 3 Classic Reds"; } catch (Exception ex) { return "give failed: " + ex.Message; } } public static string Now() { try { PlayerInventory instance = PlayerSingleton<PlayerInventory>.Instance; object obj; if (instance == null) { obj = null; } else { HotbarSlot equippedSlot = instance.equippedSlot; obj = ((equippedSlot != null) ? ((ItemSlot)equippedSlot).ItemInstance : null); } ItemInstance val = (ItemInstance)obj; if (val == null) { return "nothing in hand"; } int quantity = ((BaseItemInstance)val).Quantity; ProductItemInstance val2 = ((Il2CppObjectBase)val).TryCast<ProductItemInstance>(); string text = ""; try { if (val2 != null) { Player.Local.ConsumeProduct(val2); } } catch (Exception ex) { text = " (consume: " + ex.Message + ")"; } if (((BaseItemInstance)val).Quantity >= quantity) { ((BaseItemInstance)val).ChangeQuantity(-1); } return ((BaseItemInstance)val).ID + " " + quantity + " -> " + ((BaseItemInstance)val).Quantity + ((val2 == null) ? " not a product" : "") + text; } catch (Exception ex2) { return "smoke failed: " + ex2.Message; } } } public sealed class TobaccoCore : LabModule { private static Color Leaf => new Color(0.85f, 0.6f, 0.22f); internal static DP_TobaccoBarn.WoodLabs.LabDef Build() { //IL_0048: 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_0054: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: 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_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0534: 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_05af: Unknown result type (might be due to invalid IL or missing references) //IL_05b4: Unknown result type (might be due to invalid IL or missing references) //IL_0610: Unknown result type (might be due to invalid IL or missing references) //IL_0615: Unknown result type (might be due to invalid IL or missing references) //IL_062a: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Unknown result type (might be due to invalid IL or missing references) //IL_06a5: Unknown result type (might be due to invalid IL or missing references) //IL_07a3: Unknown result type (might be due to invalid IL or missing references) //IL_07a8: Unknown result type (might be due to invalid IL or missing references) //IL_0920: Unknown result type (might be due to invalid IL or missing references) //IL_0925: Unknown result type (might be due to invalid IL or missing references) //IL_0b97: Unknown result type (might be due to invalid IL or missing references) //IL_0b9c: Unknown result type (might be due to invalid IL or missing references) //IL_0c0e: Unknown result type (might be due to invalid IL or missing references) //IL_0c13: Unknown result type (might be due to invalid IL or missing references) //IL_0c33: Unknown result type (might be due to invalid IL or missing references) //IL_0c38: Unknown result type (might be due to invalid IL or missing references) //IL_0c63: Unknown result type (might be due to invalid IL or missing references) //IL_0c68: Unknown result type (might be due to invalid IL or missing references) //IL_0c88: Unknown result type (might be due to invalid IL or missing references) //IL_0c8d: Unknown result type (might be due to invalid IL or missing references) //IL_0cad: Unknown result type (might be due to invalid IL or missing references) //IL_0cb2: Unknown result type (might be due to invalid IL or missing references) //IL_0cd2: Unknown result type (might be due to invalid IL or missing references) //IL_0cd7: Unknown result type (might be due to invalid IL or missing references) //IL_0cf7: Unknown result type (might be due to invalid IL or missing references) //IL_0cfc: Unknown result type (might be due to invalid IL or missing references) DP_TobaccoBarn.WoodLabs.LabDef labDef = new DP_TobaccoBarn.WoodLabs.LabDef { Title = "Tobacco Barn", Folder = "TobaccoBarn", Prefix = "tb_", Ns = "woodstudios.tobaccobarn", Short = "tobacco", KindName = "Tobacco", Accent = Leaf, Compat = (DrugType)0, InputType = (DrugType)0, InputName = "tobacco", Template = "ogkush", Region = (Region)2, DevKey = (KeyCode)13, DevRow = 8 }; labDef.Products = new DP_TobaccoBarn.WoodLabs.ProductSpec[5] { new DP_TobaccoBarn.WoodLabs.ProductSpec { Key = "rolling-tobacco", Name = "Rolling Tobacco", Base = true, Price = 18f, Addictiveness = 0.3f, Model = "TB_Pouch.glb", Description = "Your own cured, shredded leaf in a zip pouch. Sell it as it is, or make it into cigarettes, cigars and pods at a Smoke Shop Bench.", Properties = (PropertyBase[])(object)new PropertyBase[1] { Property.Calming }, IconEuler = new Vector3(20f, 30f, 0f) }, new DP_TobaccoBarn.WoodLabs.ProductSpec { Key = "classic-reds", Name = "Classic Reds", Price = 28f, Addictiveness = 0.45f, Model = "TB_PackRed.glb", Description = "A flip-top pack of twenty, red and white, made from your own leaf. The everyday smoke. Legal to carry.", Properties = (PropertyBase[])(object)new PropertyBase[2] { Property.Calming, Property.Focused }, IconEuler = new Vector3(15f, 30f, 0f) }, new DP_TobaccoBarn.WoodLabs.ProductSpec { Key = "arctic-menthols", Name = "Arctic Menthols", Price = 32f, Addictiveness = 0.45f, Model = "TB_PackMint.glb", Description = "A green and white pack of twenty with cool menthol filters. Legal to carry.", Properties = (PropertyBase[])(object)new PropertyBase[3] { Property.Refreshing, Property.Calming, Property.Focused }, IconEuler = new Vector3(15f, 30f, 0f) }, new DP_TobaccoBarn.WoodLabs.ProductSpec { Key = "buzz-pods", Name = "Buzz Pods", Price = 38f, Addictiveness = 0.5f, Model = "TB_Pods.glb", Description = "A blister of nicotine vape pods filled from your own tobacco. Sweet, quick and hard to put down. Legal to carry.", Properties = (PropertyBase[])(object)new PropertyBase[3] { Property.Energizing, Property.Focused, Property.BrightEyed }, IconEuler = new Vector3(20f, 30f, 0f) }, new DP_TobaccoBarn.WoodLabs.ProductSpec { Key = "golden-leaf-cigar", Name = "Golden Leaf Cigar", Price = 60f, Addictiveness = 0.35f, Model = "TB_Cigar.glb", Description = "A thick hand-rolled cigar of your own leaf with a gold band. A slow Sunday smoke. Legal to carry.", Properties = (PropertyBase[])(object)new PropertyBase[3] { Property.ThoughtProvoking, Property.Calming, Property.Sedating }, IconEuler = new Vector3(15f, 35f, 25f) } }; labDef.Items = new DP_TobaccoBarn.WoodLabs.ItemDef[7] { new DP_TobaccoBarn.WoodLabs.ItemDef { Id = "tb_seeds", Name = "Tobacco Seeds", Price = 15f, Stack = 20, Model = "TB_Seeds.glb", Color = new Color(0.25f, 0.5f, 0.2f), Description = "A packet of tiny tobacco seeds. Sow a packet in a Grow Bed with a jug of Plant Food." }, new DP_TobaccoBarn.WoodLabs.ItemDef { Id = "tb_food", Name = "Plant Food", Price = 10f, Stack = 10, Model = "TB_Food.glb", Color = new Color(0.2f, 0.55f, 0.85f), Description = "A jug of plant food for the Grow Bed. One jug and a packet of seeds grow ten green tobacco leaves." }, new DP_TobaccoBarn.WoodLabs.ItemDef { Id = "tb_greenleaf", Name = "Green Tobacco Leaves", Price = 3f, Stack = 40, Model = "TB_GreenLeaf.glb", Color = new Color(0.3f, 0.55f, 0.15f), IconTilt = new Vector3(-62f, 0f, 12f), Description = "Fresh tobacco leaves from your Grow Bed. Hang ten on a Curing Rack to cure them into Rolling Tobacco." }, new DP_TobaccoBarn.WoodLabs.ItemDef { Id = "tb_tubes", Name = "Filter Tubes", Price = 8f, Stack = 20, Model = "TB_Tubes.glb", Color = new Color(0.8f, 0.2f, 0.15f), Description = "A box of empty cigarette tubes with filters. One box and two Rolling Tobacco make five packs of Classic Reds at a Smoke Shop Bench." }, new DP_TobaccoBarn.WoodLabs.ItemDef { Id = "tb_menthol", Name = "Menthol Filters", Price = 12f, Stack = 20, Model = "TB_Tubes.glb", Color = new Color(0.2f, 0.65f, 0.45f), Tint = new Color(0.12f, 0.55f, 0.35f), Description = "A box of cigarette tubes with cool menthol filters. One box and two Rolling Tobacco make five packs of Arctic Menthols at a Smoke Shop Bench." }, new DP_TobaccoBarn.WoodLabs.ItemDef { Id = "tb_pods", Name = "Empty Pods", Price = 14f, Stack = 20, Model = "TB_EmptyPods.glb", Color = new Color(0.3f, 0.3f, 0.75f), Description = "A tray of empty vape pods. One tray and two Rolling Tobacco fill four Buzz Pods at a Smoke Shop Bench." }, new DP_TobaccoBarn.WoodLabs.ItemDef { Id = "tb_bands", Name = "Cigar Bands", Price = 12f, Stack = 20, Model = "TB_Bands.glb", Color = new Color(0.9f, 0.7f, 0.2f), IconTilt = new Vector3(-50f, 0f, 0f), Description = "A roll of gold paper cigar bands. One roll and three Rolling Tobacco make three Golden Leaf Cigars at a Smoke Shop Bench." } }; labDef.Stations = new DP_TobaccoBarn.WoodLabs.StationSpec[3] { new DP_TobaccoBarn.WoodLabs.StationSpec { Id = "tb_growbed", Name = "Tobacco Grow Bed", Price = 1200f, Model = "TB_GrowBed.glb", Verb = "Growing", Box = new Vector3(1.6f, 0.62f, 0.7f), Description = "A long raised bed with a grow light. Sow tobacco seeds with plant food and it grows ten big green leaves in eight hours, day or night.", Lamp = "GrowLight", Busy = "Plants", Tray = "Ready", Recipes = new DP_TobaccoBarn.WoodLabs.RecipeSpec[1] { new DP_TobaccoBarn.WoodLabs.RecipeSpec { Name = "Tobacco Leaves", Note = "A packet of seeds and a jug of plant food grow ten green leaves.", Minutes = 480f, OutItem = "tb_greenleaf", OutQty = 10, Inputs = new DP_TobaccoBarn.WoodLabs.InputSpec[2] { new DP_TobaccoBarn.WoodLabs.InputSpec { Item = "tb_seeds" }, new DP_TobaccoBarn.WoodLabs.InputSpec { Item = "tb_food" } } } } }, new DP_TobaccoBarn.WoodLabs.StationSpec { Id = "tb_rack", Name = "Curing Rack", Price = 1600f, Model = "TB_Rack.glb", Verb = "Curing", Box = new Vector3(1.3f, 1.8f, 0.6f), Description = "A barn-wood rack with a heat lamp and a fan. Hang green leaves on it and they cure golden brown, then get shredded into Rolling Tobacco.", Spin = new string[1] { "Fan:z:240" }, Lamp = "HeatLamp", Busy = "Hanging", Tray = "Ready", Recipes = new DP_TobaccoBarn.WoodLabs.RecipeSpec[2] { new DP_TobaccoBarn.WoodLabs.RecipeSpec { Name = "Air Cure", Note = "Ten green leaves cure into six pouches of Standard Rolling Tobacco in six hours.", Quality = 2, Minutes = 360f, OutProduct = "rolling-tobacco", OutQty = 6, Inputs = new DP_TobaccoBarn.WoodLabs.InputSpec[1] { new DP_TobaccoBarn.WoodLabs.InputSpec { Item = "tb_greenleaf", Qty = 10 } } }, new DP_TobaccoBarn.WoodLabs.RecipeSpec { Name = "Slow Cure", Note = "Twelve hours of slow curing make Premium Rolling Tobacco (and everything made from it).", Quality = 3, Minutes = 720f, OutProduct = "rolling-tobacco", OutQty = 6, Inputs = new DP_TobaccoBarn.WoodLabs.InputSpec[1] { new DP_TobaccoBarn.WoodLabs.InputSpec { Item = "tb_greenleaf", Qty = 10 } } } } }, new DP_TobaccoBarn.WoodLabs.StationSpec { Id = "tb_bench", Name = "Smoke Shop Bench", Price = 2200f, Model = "TB_Bench.glb", Verb = "Making", Box = new Vector3(1.4f, 1.05f, 0.65f), Description = "A workbench with a cigarette filling machine, a cigar mould and a pod filler. Makes packs of cigarettes, menthols, cigars and nicotine pods from your Rolling Tobacco.", Slide = new string[1] { "Plunger:0.025:0.5" }, Lamp = "Lamp", Tray = "Tray", Recipes = new DP_TobaccoBarn.WoodLabs.RecipeSpec[4] { new DP_TobaccoBarn.WoodLabs.RecipeSpec { Name = "Classic Reds", Note = "Two Rolling Tobacco and a box of filter tubes make five packs.", Minutes = 40f, OutProduct = "classic-reds", OutQty = 5, Inputs = new DP_TobaccoBarn.WoodLabs.InputSpec[2] { new DP_TobaccoBarn.WoodLabs.InputSpec { Product = "rolling-tobacco", Qty = 2 }, new DP_TobaccoBarn.WoodLabs.InputSpec { Item = "tb_tubes" } } }, new DP_TobaccoBarn.WoodLabs.RecipeSpec { Name = "Arctic Menthols", Note = "Two Rolling Tobacco and a box of menthol filters make five packs.", Minutes = 40f, OutProduct = "arctic-menthols", OutQty = 5, Inputs = new DP_TobaccoBarn.WoodLabs.InputSpec[2] { new DP_TobaccoBarn.WoodLabs.InputSpec { Product = "rolling-tobacco", Qty = 2 }, new DP_TobaccoBarn.WoodLabs.InputSpec { Item = "tb_menthol" } } }, new DP_TobaccoBarn.WoodLabs.RecipeSpec { Name = "Buzz Pods", Note = "Two Rolling Tobacco and a tray of empty pods fill four Buzz Pods.", Minutes = 60f, OutProduct = "buzz-pods", OutQty = 4, Inputs = new DP_TobaccoBarn.WoodLabs.InputSpec[2] { new DP_TobaccoBarn.WoodLabs.InputSpec { Product = "rolling-tobacco", Qty = 2 }, new DP_TobaccoBarn.WoodLabs.InputSpec { Item = "tb_pods" } } }, new DP_TobaccoBarn.WoodLabs.RecipeSpec { Name = "Golden Leaf Cigars", Note = "Three Rolling Tobacco and a roll of bands make three cigars.", Minutes = 90f, OutProduct = "golden-leaf-cigar", OutQty = 3, Inputs = new DP_TobaccoBarn.WoodLabs.InputSpec[2] { new DP_TobaccoBarn.WoodLabs.InputSpec { Product = "rolling-tobacco", Qty = 3 }, new DP_TobaccoBarn.WoodLabs.InputSpec { Item = "tb_bands" } } } } } }; labDef.Pack = new DP_TobaccoBarn.WoodLabs.PackSpec { Id = "tb_tin", Name = "Tobacco Tin", Model = "TB_Tin.glb", Template = "jar", Price = 3f, Tint = new Color(0.55f, 0.32f, 0.12f), Description = "A flat tin with a leaf on the lid that holds five pouches, packs, pods or cigars. Pack them into it at a packaging station, the same as a jar." }; labDef.Supplier = new DP_TobaccoBarn.WoodLabs.PersonSpec { Id = "tb_vern", First = "Vern", Last = "Dooley", Gender = 0f, Height = 0.98f, Weight = 0.6f, Skin = new Color32((byte)226, (byte)184, (byte)152, byte.MaxValue), Hair = "Avatar/Hair/balding/Balding", HairCol = new Color(0.7f, 0.68f, 0.64f), Face = "Avatar/Layers/Face/Face_SlightSmile", Top = "Avatar/Layers/Top/FlannelButtonUp", TopCol = new Color(0.55f, 0.16f, 0.12f), Bottom = "Avatar/Layers/Bottom/Jeans", BottomCol = new Color(0.16f, 0.2f, 0.3f), Shoes = "Avatar/Accessories/Feet/CombatBoots/CombatBoots", ShoeCol = new Color(0.35f, 0.22f, 0.12f), Head = "Avatar/Accessories/Head/PorkpieHat/PorkpieHat", HeadCol = new Color(0.3f, 0.24f, 0.16f), Chest = "Avatar/Accessories/Chest/OpenVest/OpenVest", ChestCol = new Color(0.22f, 0.15f, 0.08f) }; labDef.StashDrop = "64d10032-64a9-4cd9-8750-8048d71c5029"; labDef.StashText = "Almost forgot: what you order goes on your tab, and you settle up at my stash {where}. It's marked on your map."; labDef.SupplierIntro = "Vern Dooley here, I run the smoke shop. Heard you've got a green thumb. Tobacco's legal, steady money and the cops couldn't care less. I can sell you a Grow Bed, a Curing Rack, a Smoke Shop Bench, seeds, plant food, filter tubes, menthol filters, empty pods, cigar bands and tins. Text me an order and I'll leave it at a drop. Grow it, cure it, roll it, and my regulars Downtown will smoke all you make."; labDef.Customers = Array.Empty<DP_TobaccoBarn.WoodLabs.PersonSpec>(); return labDef; } public override void OnInitializeMelon() { try { DP_TobaccoBarn.WoodLabs.LabHost.Init(this, Build(), base.HarmonyInstance); LegalTobacco.Patch(base.HarmonyInstance); base.LoggerInstance.Msg("Tobacco Barn loaded. Vern Dooley texts you once you're in your save; order the Grow Bed from him."); } catch (Exception ex) { base.LoggerInstance.Error("Tobacco Barn couldn't start: " + ex.Message + ". It needs MelonLoader 0.7 and S1API (Bars fork) 3.2.3 or newer."); } } public override void OnUpdate() { DP_TobaccoBarn.WoodLabs.LabHost.Update(); try { Smoke.Update(); } catch { } } public override void OnGUI() { DP_TobaccoBarn.WoodLabs.LabHost.OnGUI(); } } public sealed class VernDooley : DP_TobaccoBarn.WoodLabs.LabSupplierNpc { } } namespace PreRollShopMod { public sealed class PreRollCore : LabModule { private static Color Leaf => new Color(0.45f, 0.8f, 0.32f); internal static DP_PreRollShop.WoodLabs.LabDef Build() { //IL_0048: 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_0054: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: 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_022a: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_033e: 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_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) //IL_0463: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_04de: 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_053f: Unknown result type (might be due to invalid IL or missing references) //IL_0544: 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_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_085f: Unknown result type (might be due to invalid IL or missing references) //IL_0864: Unknown result type (might be due to invalid IL or missing references) //IL_096b: Unknown result type (might be due to invalid IL or missing references) //IL_0970: Unknown result type (might be due to invalid IL or missing references) //IL_09dc: Unknown result type (might be due to invalid IL or missing references) //IL_09e1: Unknown result type (might be due to invalid IL or missing references) //IL_0a01: Unknown result type (might be due to invalid IL or missing references) //IL_0a06: Unknown result type (might be due to invalid IL or missing references) //IL_0a31: Unknown result type (might be due to invalid IL or missing references) //IL_0a36: Unknown result type (might be due to invalid IL or missing references) //IL_0a56: Unknown result type (might be due to invalid IL or missing references) //IL_0a5b: Unknown result type (might be due to invalid IL or missing references) //IL_0a7b: Unknown result type (might be due to invalid IL or missing references) //IL_0a80: Unknown result type (might be due to invalid IL or missing references) //IL_0aa0: Unknown result type (might be due to invalid IL or missing references) //IL_0aa5: Unknown result type (might be due to invalid IL or missing references) //IL_0ac5: Unknown result type (might be due to invalid IL or missing references) //IL_0aca: Unknown result type (might be due to invalid IL or missing references) DP_PreRollShop.WoodLabs.LabDef labDef = new DP_PreRollShop.WoodLabs.LabDef { Title = "Pre-Roll Shop", Folder = "PreRollShop", Prefix = "pr_", Ns = "woodstudios.prerollshop", Short = "prerolls", KindName = "Pre-Rolls", Accent = Leaf, Compat = (DrugType)0, InputType = (DrugType)0, InputName = "weed", Template = "ogkush", Region = (Region)0, DevKey = (KeyCode)118, DevRow = 4 }; labDef.Products = new DP_PreRollShop.WoodLabs.ProductSpec[5] { new DP_PreRollShop.WoodLabs.ProductSpec { Key = "classic-preroll", Name = "Classic Pre-Roll", Price = 30f, Addictiveness = 0.15f, Model = "PR_Preroll.glb", Description = "A tight white joint with a crutch, rolled from your own weed. Easy to sell, easy to smoke.", Properties = (PropertyBase[])(object)new PropertyBase[2] { Property.Euphoric, Property.Calming }, IconEuler = new Vector3(15f, 35f, 25f) }, new DP_PreRollShop.WoodLabs.ProductSpec { Key = "king-cone", Name = "King Cone", Price = 45f, Addictiveness = 0.15f, Model = "PR_Cone.glb", Description = "A big hemp cone packed full and twisted shut. Lasts the whole party.", Properties = (PropertyBase[])(object)new PropertyBase[3] { Property.Euphoric, Property.Focused, Property.Munchies }, IconEuler = new Vector3(15f, 35f, 25f) }, new DP_PreRollShop.WoodLabs.ProductSpec { Key = "fat-blunt", Name = "Fat Blunt", Base = true, Price = 60f, Addictiveness = 0.2f, Model = "PR_Blunt.glb", Description = "Your weed rolled in a tobacco-leaf wrap. Sell it as it is, or cure it into Kush Cigars in a Humidor.", Properties = (PropertyBase[])(object)new PropertyBase[3] { Property.Sedating, Property.Munchies, Property.Calming }, IconEuler = new Vector3(15f, 35f, 25f) }, new DP_PreRollShop.WoodLabs.ProductSpec { Key = "gold-leaf-joint", Name = "Gold Leaf Joint", Price = 150f, Addictiveness = 0.15f, Model = "PR_Gold.glb", Description = "A joint rolled in 24K gold paper with a black tip. For people who want everyone to see what they're smoking.", Properties = (PropertyBase[])(object)new PropertyBase[3] { Property.Euphoric, Property.Glowie, Property.Energizing }, IconEuler = new Vector3(15f, 35f, 25f) }, new DP_PreRollShop.WoodLabs.ProductSpec { Key = "kush-cigar", Name = "Kush Cigar", Price = 190f, Addictiveness = 0.2f, Model = "PR_Cigar.glb", Description = "Fat Blunts cured in a cedar Humidor and wrapped in a whole leaf, with a red and gold band. A slow, heavy smoke.", Properties = (PropertyBase[])(object)new PropertyBase[3] { Property.ThoughtProvoking, Property.Calming, Property.Sedating }, IconEuler = new Vector3(15f, 35f, 25f) } }; labDef.Items = new DP_PreRollShop.WoodLabs.ItemDef[5] { new DP_PreRollShop.WoodLabs.ItemDef { Id = "pr_papers", Name = "Rolling Papers", Price = 6f, Stack = 20, Model = "PR_Papers.glb", Color = new Color(0.12f, 0.42f, 0.16f), Description = "A booklet of thin white rolling papers. One booklet and three of your weed roll six Classic Pre-Rolls on a Rolling Machine." }, new DP_PreRollShop.WoodLabs.ItemDef { Id = "pr_cones", Name = "King Cones", Price = 10f, Stack = 20, Model = "PR_ConePack.glb", Color = new Color(0.85f, 0.8f, 0.65f), Description = "A box of pre-made hemp cones. One box and three of your weed fill five King Cones on a Rolling Machine." }, new DP_PreRollShop.WoodLabs.ItemDef { Id = "pr_wraps", Name = "Blunt Wraps", Price = 8f, Stack = 20, Model = "PR_Wraps.glb", Color = new Color(0.4f, 0.12f, 0.55f), IconTilt = new Vector3(-62f, 0f, 0f), Description = "A foil pouch of tobacco-leaf wraps. One pouch and four of your weed roll four Fat Blunts on a Rolling Machine." }, new DP_PreRollShop.WoodLabs.ItemDef { Id = "pr_goldpapers", Name = "Gold Papers", Price = 45f, Stack = 10, Model = "PR_GoldPapers.glb", Color = new Color(0.95f, 0.72f, 0.25f), Description = "A booklet of 24K gold rolling papers. One booklet and two of your weed roll two Gold Leaf Joints on a Rolling Machine." }, new DP_PreRollShop.WoodLabs.ItemDef { Id = "pr_leaf", Name = "Cigar Leaf", Price = 20f, Stack = 10, Model = "PR_Leaf.glb", Color = new Color(0.3f, 0.16f, 0.07f), IconTilt = new Vector3(-62f, 0f, 12f), Description = "Whole cured tobacco leaves, tied in a bundle. One bundle and three Fat Blunts cure into two Kush Cigars in a Humidor." } }; labDef.Stations = new DP_PreRollShop.WoodLabs.StationSpec[2] { new DP_PreRollShop.WoodLabs.StationSpec { Id = "pr_roller", Name = "Rolling Machine", Price = 1800f, Model = "PR_Roller.glb", Verb = "Rolling", Box = new Vector3(0.96f, 1f, 0.58f), Description = "A cone-filling machine on a butcher-block bench. Its plate buzzes your weed into papers, cones and wraps, a whole batch at a time.", Slide = new string[1] { "Shaker:0.003:0.06" }, Lamp = "Lamp", Tray = "Tray", Recipes = new DP_PreRollShop.WoodLabs.RecipeSpec[4] { new DP_PreRollShop.WoodLabs.RecipeSpec { Name = "Classic Pre-Rolls", Note = "Three of your weed and a booklet of papers roll six pre-rolls.", Minutes = 40f, OutProduct = "classic-preroll", OutQty = 6, Inputs = new DP_PreRollShop.WoodLabs.InputSpec[2] { new DP_PreRollShop.WoodLabs.InputSpec { AnyOfType = true, Qty = 3, Label = "Weed (any strain)" }, new DP_PreRollShop.WoodLabs.InputSpec { Item = "pr_papers" } } }, new DP_PreRollShop.WoodLabs.RecipeSpec { Name = "King Cones", Note = "Three of your weed and a box of cones fill five King Cones.", Minutes = 45f, OutProduct = "king-cone", OutQty = 5, Inputs = new DP_PreRollShop.WoodLabs.InputSpec[2] { new DP_PreRollShop.WoodLabs.InputSpec { AnyOfType = true, Qty = 3, Label = "Weed (any strain)" }, new DP_PreRollShop.WoodLabs.InputSpec { Item = "pr_cones" } } }, new DP_PreRollShop.WoodLabs.RecipeSpec { Name = "Fat Blunts", Note = "Four of your weed and a pouch of wraps roll four Fat Blunts.", Minutes = 50f, OutProduct = "fat-blunt", OutQty = 4, Inputs = new DP_PreRollShop.WoodLabs.InputSpec[2] { new DP_PreRollShop.WoodLabs.InputSpec { AnyOfType = true, Qty = 4, Label = "Weed (any strain)" }, new DP_PreRollShop.WoodLabs.InputSpec { Item = "pr_wraps" } } }, new DP_PreRollShop.WoodLabs.RecipeSpec { Name = "Gold Leaf Joints", Note = "Two of your weed and a booklet of gold papers roll two Gold Leaf Joints.", Minutes = 60f, OutProduct = "gold-leaf-joint", OutQty = 2, Inputs = new DP_PreRollShop.WoodLabs.InputSpec[2] { new DP_PreRollShop.WoodLabs.InputSpec { AnyOfType = true, Qty = 2, Label = "Weed (any strain)" }, new DP_PreRollShop.WoodLabs.InputSpec { Item = "pr_goldpapers" } } } } }, new DP_PreRollShop.WoodLabs.StationSpec { Id = "pr_humidor", Name = "Humidor", Price = 2400f, Model = "PR_Humidor.glb", Verb = "Curing", Box = new Vector3(0.76f, 1.5f, 0.48f), Description = "A walnut and cedar humidor with a glass door and a brass hygrometer. It cures Fat Blunts in whole leaves into Kush Cigars, slowly.", Lamp = "Lamp", Busy = "Mist", Tray = "Tray", Recipes = new DP_PreRollShop.WoodLabs.RecipeSpec[1] { new DP_PreRollShop.WoodLabs.RecipeSpec { Name = "Kush Cigars", Note = "Three Fat Blunts and a bundle of cigar leaf cure into two Kush Cigars.", Minutes = 360f, OutProduct = "kush-cigar", OutQty = 2, Inputs = new DP_PreRollShop.WoodLabs.InputSpec[2] { new DP_PreRollShop.WoodLabs.InputSpec { Product = "fat-blunt", Qty = 3 }, new DP_PreRollShop.WoodLabs.InputSpec { Item = "pr_leaf" } } } } } }; labDef.Pack = new DP_PreRollShop.WoodLabs.PackSpec { Id = "pr_box", Name = "Pre-Roll Box", Model = "PR_Box.glb", Template = "jar", Price = 3f, Tint = new Color(0.15f, 0.45f, 0.18f), Description = "A flip-top cardboard box that holds five pre-rolls, cones, blunts or cigars. Pack them into it at a packaging station, the same as a jar." }; labDef.Supplier = new DP_PreRollShop.WoodLabs.PersonSpec { Id = "pr_rolo", First = "Rolo", Last = "Mendes", Gender = 0f, Height = 1.02f, Weight = 0.4f, Skin = new Color32((byte)176, (byte)124, (byte)92, byte.MaxValue), Hair = "Avatar/Hair/closebuzzcut/CloseBuzzCut", HairCol = new Color(0.06f, 0.05f, 0.04f), Face = "Avatar/Layers/Face/Face_SmugPout", Top = "Avatar/Layers/Top/T-Shirt", TopCol = new Color(0.18f, 0.55f, 0.24f), Bottom = "Avatar/Layers/Bottom/CargoPants", BottomCol = new Color(0.2f, 0.2f, 0.22f), Shoes = "Avatar/Accessories/Feet/Sneakers/Sneakers", ShoeCol = new Color(0.95f, 0.95f, 0.95f), Head = "Avatar/Accessories/Head/Cap/Cap", HeadCol = new Color(0.08f, 0.08f, 0.1f), Neck = "Avatar/Accessories/Neck/GoldChain/GoldChain", NeckCol = new Color(0.9f, 0.72f, 0.3f) }; labDef.StashDrop = "555e565d-2f65-4882-9edb-7167168b2e00"; labDef.OldStashDrop = "d66b3fd6-7b7f-4e98-b000-6d5a197f7437"; labDef.StashText = "One more thing, fam: everything you order goes on your tab. Leave what you owe in my stash {where}. It's marked on your map."; labDef.SupplierIntro = "Yo, it's Rolo. Word is you grow. You should be rolling it too: people pay double for a pre-roll. I can set you up with a Rolling Machine, a Humidor, papers, cones, blunt wraps, gold papers, cigar leaf and Pre-Roll Boxes. Text me an order and I'll leave it at a drop. Roll it, cure the blunts into cigars, and my people in Northtown will smoke everything you make."; labDef.Customers = Array.Empty<DP_PreRollShop.WoodLabs.PersonSpec>(); return labDef; } public override void OnInitializeMelon() { try { DP_PreRollShop.WoodLabs.LabHost.Init(this, Build(), base.HarmonyInstance); base.LoggerInstance.Msg("Pre-Roll Shop loaded. Rolo Mendes texts you once you're in your save; order the Rolling Machine from him."); } catch (Exception ex) { base.LoggerInstance.Error("Pre-Roll Shop couldn't start: " + ex.Message + ". It needs MelonLoader 0.7 and S1API (Bars fork) 3.2.3 or newer."); } } public override void OnUpdate() { DP_PreRollShop.WoodLabs.LabHost.Update(); } public override void OnGUI() { DP_PreRollShop.WoodLabs.LabHost.OnGUI(); } } public sealed class RoloMendes : DP_PreRollShop.WoodLabs.LabSupplierNpc { } } namespace PoppyLabMod { public sealed class PoppyCore : LabModule { internal static DP_PoppyLab.WoodLabs.LabDef Build() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: 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_0336: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_0497: Unknown result type (might be due to invalid IL or missing references) //IL_049c: 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_0527: Unknown result type (might be due to invalid IL or missing references) //IL_052c: Unknown result type (might be due to invalid IL or missing references) //IL_06a8: Unknown result type (might be due to invalid IL or missing references) //IL_06ad: Unknown result type (might be due to invalid IL or missing references) //IL_07a2: Unknown result type (might be due to invalid IL or missing references) //IL_07a7: Unknown result type (might be due to invalid IL or missing references) //IL_0819: Unknown result type (might be due to invalid IL or missing references) //IL_081e: Unknown result type (might be due to invalid IL or missing references) //IL_083e: Unknown result type (might be due to invalid IL or missing references) //IL_0843: Unknown result type (might be due to invalid IL or missing references) //IL_086e: Unknown result type (might be due to invalid IL or missing references) //IL_0873: Unknown result type (might be due to invalid IL or missing references) //IL_0893: Unknown result type (might be due to invalid IL or missing references) //IL_0898: Unknown result type (might be due to invalid IL or missing references) //IL_08b8: Unknown result type (might be due to invalid IL or missing references) //IL_08bd: Unknown result type (might be due to invalid IL or missing references) //IL_08dd: Unknown result type (might be due to invalid IL or missing references) //IL_08e2: Unknown result type (might be due to invalid IL or missing references) //IL_0902: Unknown result type (might be due to invalid IL or missing references) //IL_0907: Unknown result type (might be due to invalid IL or missing references) DP_PoppyLab.WoodLabs.LabDef labDef = new DP_PoppyLab.WoodLabs.LabDef { Title = "Poppy Lab", Folder = "PoppyLab", Prefix = "pl_", Ns = "woodstudios.poppylab", Short = "poppy", KindName = "Poppy", Accent = new Color(0.86f, 0.22f, 0.16f), Compat = (DrugType)5, InputType = (DrugType)5, InputName = "pods", Template = "meth", Region = (Region)3, DevKey = (KeyCode)46, DevRow = 1 }; labDef.Products = new DP_PoppyLab.WoodLabs.ProductSpec[4] { new DP_PoppyLab.WoodLabs.ProductSpec { Key = "poppy-pods", Name = "Poppy Pods", Base = true, UnlistOnce = true, Price = 20f, Addictiveness = 0.2f, Model = "PL_Pods.glb", Description = "Dried poppy pods from your own planter. Cook them down in a Resin Kettle, or sell them as they are.", Properties = (PropertyBase[])(object)new PropertyBase[2] { Property.Sedating, Property.Calming }, IconEuler = new Vector3(25f, 30f, 0f) }, Tar("black-tar", "Black Tar", 120f, new Color(0.07f, 0.035f, 0.02f), "Thick, dark and heavy. The classic.", Property.Sedating, Property.Euphoric, Property.Foggy), Tar("golden-lotus", "Golden Lotus", 165f, new Color(0.85f, 0.55f, 0.08f), "Cooked down with lotus essence: smooth, golden and floaty.", Property.Euphoric, Property.Calming, Property.AntiGravity), Tar("red-dragon", "Red Dragon", 145f, new Color(0.45f, 0.04f, 0.03f), "Cooked down with dragon pepper oil. It bites, then it hits.", Property.Spicy, Property.Euphoric, Property.Energizing) }; labDef.Items = new DP_PoppyLab.WoodLabs.ItemDef[6] { new DP_PoppyLab.WoodLabs.ItemDef { Id = "pl_seeds", Name = "Poppy Seeds", Price = 25f, Stack = 20, Model = "PL_Seeds.glb", Color = new Color(0.86f, 0.22f, 0.16f), Description = "A packet of poppy seeds. Sow a packet in a Poppy Planter with a bag of soil." }, new DP_PoppyLab.WoodLabs.ItemDef { Id = "pl_soil", Name = "Planter Soil", Price = 12f, Stack = 10, Model = "PL_Soil.glb", Color = new Color(0.35f, 0.25f, 0.15f), Description = "A bag of plain potting soil for the Poppy Planter. Grows Standard pods." }, new DP_PoppyLab.WoodLabs.ItemDef { Id = "pl_richsoil", Name = "Rich Planter Mix", Price = 40f, Stack = 10, Model = "PL_Soil.glb", Color = new Color(0.2f, 0.45f, 0.2f), Tint = new Color(0.16f, 0.42f, 0.18f), Description = "A bag of rich, fed potting mix for the Poppy Planter. Grows Premium pods." }, new DP_PoppyLab.WoodLabs.ItemDef { Id = "pl_fuel", Name = "Kettle Fuel", Price = 18f, Stack = 10, Model = "PL_Fuel.glb", Color = new Color(0.2f, 0.4f, 0.8f), Description = "A canister of burner fuel for the Resin Kettle. One canister runs one batch." }, new DP_PoppyLab.WoodLabs.ItemDef { Id = "pl_lotus", Name = "Lotus Essence", Price = 45f, Stack = 10, Model = "PL_Vial.glb", Color = new Color(0.9f, 0.65f, 0.15f), Tint = new Color(0.9f, 0.62f, 0.12f), Description = "A vial of golden lotus essence. One vial turns a batch at the Resin Kettle into Golden Lotus." }, new DP_PoppyLab.WoodLabs.ItemDef { Id = "pl_pepper", Name = "Dragon Pepper Oil", Price = 40f, Stack = 10, Model = "PL_Vial.glb", Color = new Color(0.75f, 0.1f, 0.06f), Tint = new Color(0.7f, 0.06f, 0.04f), Description = "A vial of fiery pepper oil. One vial turns a batch at the Resin Kettle into Red Dragon." } }; labDef.Stations = new DP_PoppyLab.WoodLabs.StationSpec[2] { new DP_PoppyLab.WoodLabs.StationSpec { Id = "pl_planter", Name = "Poppy Planter", Price = 1500f, Model = "PL_Planter.glb", Verb = "Growing", Box = new Vector3(1.5f, 0.62f, 0.65f), Description = "A raised wooden planter with a grow light. Sow poppy seeds in soil and it grows a tray of poppy pods in eight hours, day or night.", Lamp = "GrowLight", Busy = "Plants", Tray = "Ready", Recipes = new DP_PoppyLab.WoodLabs.RecipeSpec[2] { new DP_PoppyLab.WoodLabs.RecipeSpec { Name = "Poppy Pods", Note = "Plain soil grows Standard pods.", Quality = 2, Minutes = 480f, OutProduct = "poppy-pods", OutQty = 12, Inputs = new DP_PoppyLab.WoodLabs.InputSpec[2] { new DP_PoppyLab.WoodLabs.InputSpec { Item = "pl_seeds" }, new DP_PoppyLab.WoodLabs.InputSpec { Item = "pl_soil" } } }, new DP_PoppyLab.WoodLabs.RecipeSpec { Name = "Premium Pods", Note = "Rich planter mix grows Premium pods.", Quality = 3, Minutes = 480f, OutProduct = "poppy-pods", OutQty = 12, Inputs = new DP_PoppyLab.WoodLabs.InputSpec[2] { new DP_PoppyLab.WoodLabs.InputSpec { Item = "pl_seeds" }, new DP_PoppyLab.WoodLabs.InputSpec { Item = "pl_richsoil" } } } } }, new DP_PoppyLab.WoodLabs.StationSpec { Id = "pl_kettle", Name = "Resin Kettle", Price = 2200f, Model = "PL_Kettle.glb", Verb = "Cooking", Box = new Vector3(1.1f, 1.15f, 0.62f), Description = "A copper kettle over a gas burner, with a cooling tray. Cook poppy pods down with a canister of fuel; add an essence for the fancier blends.", Spin = new string[1] { "Stirrer:y:70" }, Busy = "Flame", Lamp = "Dial", Tray = "Cooling", Recipes = new DP_PoppyLab.WoodLabs.RecipeSpec[3] { Cook("Black Tar", "black-tar", null, "Pods and fuel. Dark, heavy, the classic."), Cook("Golden Lotus", "golden-lotus", "pl_lotus", "Add a vial of Lotus Essence for a smooth, golden batch."), Cook("Red Dragon", "red-dragon", "pl_pepper", "Add a vial of Dragon Pepper Oil for a batch with a bite.") } } }; labDef.Pack = new DP_PoppyLab.WoodLabs.PackSpec { Id = "pl_tin", Name = "Tar Tin", Model = "PL_Tin.glb", Template = "jar", Price = 4f, Tint = new Color(0.32f, 0.07f, 0.05f), Description = "A small round tin that holds five. Pack your tar into it at a packaging station, the same as a jar." }; labDef.Supplier = new DP_PoppyLab.WoodLabs.PersonSpec { Id = "pl_silas", First = "Silas", Last = "Rourke", Gender = 0f, Height = 0.98f, Weight = 0.55f, Skin = new Color32((byte)214, (byte)170, (byte)140, byte.MaxValue), Hair = "Avatar/Hair/receding/Receding", HairCol = new Color(0.62f, 0.6f, 0.58f), Face = "Avatar/Layers/Face/Face_SlightFrown", Top = "Avatar/Layers/Top/RolledButtonUp", TopCol = new Color(0.3f, 0.32f, 0.36f), Bottom = "Avatar/Layers/Bottom/Jeans", BottomCol = new Color(0.15f, 0.17f, 0.22f), Shoes = "Avatar/Accessories/Feet/CombatBoots/CombatBoots", ShoeCol = new Color(0.22f, 0.15f, 0.1f), Head = "Avatar/Accessories/Head/FlatCap/FlatCap", HeadCol = new Color(0.25f, 0.22f, 0.2f), Chest = "Avatar/Accessories/Chest/OpenVest/OpenVest", ChestCol = new Color(0.12f, 0.12f, 0.14f) }; labDef.StashDrop = "eff8fff2-0f89-4936-aef5-c4d383ea4f50"; labDef.StashText = "One more thing. Orders go on your tab, and what you owe goes in my stash, {where}. It's marked on your map."; labDef.SupplierIntro = "Silas Rourke here. A friend says you can keep your mouth shut. I deal in old-world goods: poppy seeds, planters, the Resin Kettle and everything that goes in it, and tins to sell it in. Text me what you need and I'll leave it at a drop. The dock crowd pays well for good tar."; labDef.Customers = Array.Empty<DP_PoppyLab.WoodLabs.PersonSpec>(); return labDef; } private static DP_PoppyLab.WoodLabs.ProductSpec Tar(string key, string name, float price, Color tint, string blurb, params PropertyBase[] props) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) return new DP_PoppyLab.WoodLabs.ProductSpec { Key = key, Name = name, Price = price, Tint = tint, Model = "PL_Tar.glb", Properties = props, Addictiveness = 0.55f, Description = blurb + " Cooked down from poppy pods you grew yourself.", IconEuler = new Vector3(35f, 25f, 0f), BagScale = 0.9f }; } private static DP_PoppyLab.WoodLabs.RecipeSpec Cook(string name, string product, string extra, string note) { List<DP_PoppyLab.WoodLabs.InputSpec> list = new List<DP_PoppyLab.WoodLabs.InputSpec> { new DP_PoppyLab.WoodLabs.InputSpec { Product = "poppy-pods", Qty = 10 }, new DP_PoppyLab.WoodLabs.InputSpec { Item = "pl_fuel", Qty = 1 } }; if (extra != null) { list.Add(new DP_PoppyLab.WoodLabs.InputSpec { Item = extra, Qty = 1 }); } return new DP_PoppyLab.WoodLabs.RecipeSpec { Name = name, Note = note + " As good as the pods that go in.", Inputs = list.ToArray(), OutProduct = product, OutQty = 4, Minutes = ((extra != null) ? 150f : 120f) }; } public override void OnInitializeMelon() { try { DP_PoppyLab.WoodLabs.LabHost.Init(this, Build(), base.HarmonyInstance); base.LoggerInstance.Msg("Poppy Lab loaded. Silas Rourke texts you once you're in your save; order the gear from him."); } catch (Exception ex) { base.LoggerInstance.Error("Poppy Lab couldn't start: " + ex.Message + ". It needs MelonLoader 0.7 and S1API (Bars fork) 3.2.3 or newer."); } } public override void OnUpdate() { DP_PoppyLab.WoodLabs.LabHost.Update(); } public override void OnGUI() { DP_PoppyLab.WoodLabs.LabHost.OnGUI(); } } public sealed class SilasRourke : DP_PoppyLab.WoodLabs.LabSupplierNpc { } } namespace PillPressMod { public sealed class FelixHale : DP_PillPress.WoodLabs.LabSupplierNpc { } public sealed class PillCore : LabModule { internal static MelonPreferences_Entry<string> StampPref; private static Color Pink => new Color(0.98f, 0.36f, 0.68f); internal static DP_PillPress.WoodLabs.LabDef Build() { //IL_0048: 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_0054: 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_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_06e5: Unknown result type (might be due to invalid IL or missing references) //IL_06ea: Unknown result type (might be due to invalid IL or missing references) //IL_075c: Unknown result type (might be due to invalid IL or missing references) //IL_0761: Unknown result type (might be due to invalid IL or missing references) //IL_0781: Unknown result type (might be due to invalid IL or missing references) //IL_0786: Unknown result type (might be due to invalid IL or missing references) //IL_07b1: Unknown result type (might be due to invalid IL or missing references) //IL_07b6: Unknown result type (might be due to invalid IL or missing references) //IL_07d6: Unknown result type (might be due to invalid IL or missing references) //IL_07db: Unknown result type (might be due to invalid IL or missing references) //IL_07fb: Unknown result type (might be due to invalid IL or missing references) //IL_0800: Unknown result type (might be due to invalid IL or missing references) //IL_0820: Unknown result type (might be due to invalid IL or missing references) //IL_0825: Unknown result type (might be due to invalid IL or missing references) DP_PillPress.WoodLabs.LabDef labDef = new DP_PillPress.WoodLabs.LabDef { Title = "Pill Press", Folder = "PillPress", Prefix = "pp_", Ns = "woodstudios.pillpress", Short = "pills", KindName = "Pills", Accent = Pink, Compat = (DrugType)3, InputType = (DrugType)1, InputName = "product", Template = "cocaine", Region = (Region)5, DevKey = (KeyCode)8, DevRow = 5 }; labDef.Products = new DP_PillPress.WoodLabs.ProductSpec[4] { new DP_PillPress.WoodLabs.ProductSpec { Key = "blue-diamonds", Name = "Blue Diamonds", Price = 115f, Addictiveness = 0.45f, Model = "PP_Diamonds.glb", Description = "Diamond-shaped blue pills pressed from your own meth, each one stamped with your mark.", Properties = (PropertyBase[])(object)new PropertyBase[3] { Property.Energizing, Property.Euphoric, Property.Electrifying }, IconEuler = new Vector3(55f, 20f, 0f) }, new DP_PillPress.WoodLabs.ProductSpec { Key = "snow-caps", Name = "Snow Caps", Price = 190f, Addictiveness = 0.5f, Model = "PP_SnowCaps.glb", Description = "Round white pills pressed from your own cocaine, stamped with your mark. Clean, bright and expensive.", Properties = (PropertyBase[])(object)new PropertyBase[3] { Property.Energizing, Property.BrightEyed, Property.Focused }, IconEuler = new Vector3(55f, 20f, 0f) }, new DP_PillPress.WoodLabs.ProductSpec { Key = "dream-tabs", Name = "Dream Tabs", Price = 95f, Addictiveness = 0.15f, Model = "PP_DreamTabs.glb", Description = "Violet pills pressed from your own shrooms, stamped with your mark. Easier to dose than a handful of caps.", Properties = (PropertyBase[])(object)new PropertyBase[3] { Property.ThoughtProvoking, Property.Euphoric, Property.Calming }, IconEuler = new Vector3(55f, 20f, 0f) }, new DP_PillPress.WoodLabs.ProductSpec { Key = "green-gels", Name = "Green Gels", Price = 60f, Addictiveness = 0.1f, Model = "PP_GreenGels.glb", Description = "Soft green capsules filled with oil from your own weed. No smoke, no smell, just a slow calm.", Properties = (PropertyBase[])(object)new PropertyBase[3] { Property.Calming, Property.Sedating, Property.Munchies }, IconEuler = new Vector3(45f, 20f, 0f) } }; labDef.Items = new DP_PillPress.WoodLabs.ItemDef[2] { new DP_PillPress.WoodLabs.ItemDef { Id = "pp_binder", Name = "Pill Binder", Price = 15f, Stack = 20, Model = "PP_Binder.glb", Color = new Color(0.85f, 0.85f, 0.88f), Description = "A tub of pressing powder that holds a pill together. One tub and four of your product press six pills on a Pill Press." }, new DP_PillPress.WoodLabs.ItemDef { Id = "pp_gelcaps", Name = "Gel Caps", Price = 10f, Stack = 20, Model = "PP_GelCaps.glb", Color = new Color(0.2f, 0.6f, 0.2f), Description = "A box of empty softgel shells. One box and four of your weed fill six Green Gels on a Pill Press." } }; string text = "(any, loose or packed)"; labDef.Stations = new DP_PillPress.WoodLabs.StationSpec[1] { new DP_PillPress.WoodLabs.StationSpec { Id = "pp_press", Name = "Pill Press", Price = 4500f, Model = "PP_Press.glb", Verb = "Pressing", Box = new Vector3(0.84f, 1.32f, 0.6f), Description = "A rotary tablet press with twelve punches on a spinning turret. Feed it your product and binder and it presses stamped pills into the tray, a batch at a time.", Spin = new string[1] { "Turret:y:220" }, Lamp = "Lamp", Tray = "Tray", Recipes = new DP_PillPress.WoodLabs.RecipeSpec[4] { new DP_PillPress.WoodLabs.RecipeSpec { Name = "Blue Diamonds", Note = "Four of your meth and a tub of binder press six Blue Diamonds.", Minutes = 60f, OutProduct = "blue-diamonds", OutQty = 6, Inputs = new DP_PillPress.WoodLabs.InputSpec[2] { new DP_PillPress.WoodLabs.InputSpec { AnyOfType = true, Type = (DrugType)1, Qty = 4, Label = "Meth " + text }, new DP_PillPress.WoodLabs.InputSpec { Item = "pp_binder" } } }, new DP_PillPress.WoodLabs.RecipeSpec { Name = "Snow Caps", Note = "Four of your cocaine and a tub of binder press six Snow Caps.", Minutes = 60f, OutProduct = "snow-caps", OutQty = 6, Inputs = new DP_PillPress.WoodLabs.InputSpec[2] { new DP_PillPress.WoodLabs.InputSpec { AnyOfType = true, Type = (DrugType)2, Qty = 4, Label = "Cocaine " + text }, new DP_PillPress.WoodLabs.InputSpec { Item = "pp_binder" } } }, new DP_PillPress.WoodLabs.RecipeSpec { Name = "Dream Tabs", Note = "Five of your shrooms and a tub of binder press six Dream Tabs.", Minutes = 50f, OutProduct = "dream-tabs", OutQty = 6, Inputs = new DP_PillPress.WoodLabs.InputSpec[2] { new DP_PillPress.WoodLabs.InputSpec { AnyOfType = true, Type = (DrugType)4, Qty = 5, Label = "Shrooms " + text }, new DP_PillPress.WoodLabs.InputSpec { Item = "pp_binder" } } }, new DP_PillPress.WoodLabs.RecipeSpec { Name = "Green Gels", Note = "Four of your weed and a box of gel caps fill six Green Gels.", Minutes = 45f, OutProduct = "green-gels", OutQty = 6, Inputs = new DP_PillPress.WoodLabs.InputSpec[2] { new DP_PillPress.WoodLabs.InputSpec { AnyOfType = true, Type = (DrugType)0, Qty = 4, Label = "Weed " + text }, new DP_PillPress.WoodLabs.InputSpec { Item = "pp_gelcaps" } } } } } }; labDef.Pack = new DP_PillPress.WoodLabs.PackSpec { Id = "pp_bottle", Name = "Pill Bottle", Model = "PP_Bottle.glb", Template = "jar", Price = 4f, Tint = new Color(0.45f, 0.18f, 0.03f), Description = "An amber pill bottle with a child-proof cap that holds five. Pack pills into it at a packaging station, the same as a jar." }; labDef.Supplier = new DP_PillPress.WoodLabs.PersonSpec { Id = "pp_felix", First = "Felix", Last = "Hale", Gender = 0f, Height = 0.98f, Weight = 0.3f, Skin = new Color32((byte)232, (byte)200, (byte)175, byte.MaxValue), Hair = "Avatar/Hair/receding/Receding", HairCol = new Color(0.35f, 0.3f, 0.25f), Face = "Avatar/Layers/Face/Face_SlightFrown", Top = "Avatar/Layers/Top/Buttonup", TopCol = new Color(0.92f, 0.93f, 0.95f), Bottom = "Avatar/Layers/Bottom/Jeans", BottomCol = new Color(0.1f, 0.1f, 0.12f), Shoes = "Avatar/Accessories/Feet/CombatBoots/CombatBoots", ShoeCol = new Color(0.08f, 0.06f, 0.05f), Head = "Avatar/Accessories/Head/SmallRoundGlasses/SmallRoundGlasses", HeadCol = new Color(0.75f, 0.6f, 0.3f) }; labDef.StashDrop = "51e8f8ec-adcb-4800-8020-55cc24f9ba40"; labDef.StashText = "One more thing. Everything you order goes on your tab. Leave what you owe in my stash {where}. It's marked on your map. Don't make me ask twice."; labDef.SupplierIntro = "This is Dr. Hale. Former pharmacist, current consultant. I hear you make product. Pressed into pills, it sells for more and nobody asks what's in the baggie. I can supply a rotary Pill Press, binder, gel caps and Pill Bottles. Text me an order and I'll leave it at a drop. Your pills carry your stamp, and my clients Uptown pay well for a stamp they trust."; labDef.Customers = Array.Empty<DP_PillPress.WoodLabs.PersonSpec>(); labDef.Decorate = Stamp.Decorate; return labDef; } public override void OnInitializeMelon() { try { DP_PillPress.WoodLabs.LabHost.Init(this, Build(), base.HarmonyInstance); StampPref = (MelonPreferences.GetCategory("PillPress") ?? MelonPreferences.CreateCategory("PillPress", "Pill Press")).CreateEntry<string>("Stamp", "crown", "Pill stamp", "The stamp pressed into your pills when Brand It isn't installed (with Brand It, your brand's stamp is used). One of: " + string.Join(", ", Stamp.Names) + ".", false, false, (ValueValidator)null, (string)null); base.LoggerInstance.Msg("Pill Press loaded. Dr. Felix Hale texts you once you're in your save; order the press from him."); } catch (Exception ex) { base.LoggerInstance.Error("Pill Press couldn't start: " + ex.Message + ". It needs MelonLoader 0.7 and S1API (Bars fork) 3.2.3 or newer."); } } public override void OnUpdate() { DP_PillPress.WoodLabs.LabHost.Update(); try { Stamp.Update(); } catch { } } public override void OnGUI() { DP_PillPress.WoodLabs.LabHost.OnGUI(); } } internal static class Stamp { private sealed class Face { public Material M; public Color Base; } public static readonly string[] Names = new string[31] { "crown", "skull", "leaf", "star", "flame", "diamond", "bolt", "moon", "eye", "heart", "rocket", "spade", "dice", "mushroom", "cherry", "dollar", "anchor", "ghost", "sun", "alien", "snowflake", "butterfly", "mountain", "target", "cat", "palm", "pill", "lips", "spiral", "rose", "wolf" }; private static readonly List<Face> Faces = new List<Face>(); private static readonly Dictionary<string, Texture2D> Made = new Dictionary<string, Texture2D>(); private static List<byte[]> _masks; private static int _size; private static int _applied = -1; private static float _next; private const int Tex = 128; private static Type _brand; private static bool _looked; private static bool LoadSet() { if (_masks != null) { return _masks.Count > 0; } _masks = new List<byte[]>(); try { using Stream stream = Res.Open("PillPressMod.res.stamps.bin"); if (stream == null) { Instance log = DP_PillPress.WoodKit.Kit.Log; if (log != null) { log.Warning("Pill Press: the stamps are missing, so pills come out plain."); } return false; } BinaryReader binaryReader = new BinaryReader(new ZLibStream(stream, CompressionMode.Decompress)); if (Encoding.ASCII.GetString(binaryReader.ReadBytes(4)) != "BIS1") { return false; } int num = binaryReader.ReadInt32(); _size = binaryReader.ReadInt32(); for (int i = 0; i < num; i++) { binaryReader.ReadBytes(binaryReader.ReadInt32()); _masks.Add(binaryReader.ReadBytes(_size * _size)); } } catch (Exception ex) { Instance log2 = DP_PillPress.WoodKit.Kit.Log; if (log2 != null) { log2.Warning("Pill Press: the stamps couldn't be read (" + ex.Message + ")."); } } return _masks.Count > 0; } private static float Sample(int i, float u, float v) { byte[] j = _masks[i]; float num = u * (float)_size - 0.5f; float num2 = v * (float)_size - 0.5f; int num3 = (int)Math.Floor(num); int num4 = (int)Math.Floor(num2); float num5 = num - (float)num3; float num6 = num2 - (float)num4; float num7 = P(num3, num4); float num8 = P(num3 + 1, num4); float num9 = P(num3, num4 + 1); float num10 = P(num3 + 1, num4 + 1); return (num7 + (num8 - num7) * num5) * (1f - num6) + (num9 + (num10 - num9) * num5) * num6; float P(int px, int py) { if (px >= 0 && py >= 0 && px < _size && py < _size) { return (float)(int)j[py * _size + px] * 0.003921569f; } return 0f; } } private static int? BrandItStamp() { if (!_looked) { _looked = true; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { try { Type type = assembly.GetType("BrandItMod.Brand", throwOnError: false); if (type != null) { _brand = type; break; } } catch { } } if (_brand != null) { Instance log = DP_PillPress.WoodKit.Kit.Log; if (log != null) { log.Msg("Pill Press: Brand It is installed, so your pills carry your brand's stamp."); } } } if (_brand == null) { return null; } try { object obj2 = _brand.GetField("Current", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(null); object obj3 = obj2?.GetType().GetField("Stamp", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)?.GetValue(obj2); if (obj3 is int) { return (int)obj3; } } catch { } return null; } private static int Wanted() { int num = _masks?.Count ?? 0; if (num == 0) { return -1; } int? num2 = BrandItStamp(); if (num2.HasValue) { return (num2.Value % num + num) % num; } string name = (PillCore.StampPref?.Value ?? "crown").Trim(); int num3 = Array.FindIndex(Names, (string x) => string.Equals(x, name, StringComparison.OrdinalIgnoreCase)); if (num3 < 0 || num3 >= num) { return 0; } return num3; } public static void Decorate(DP_PillPress.WoodLabs.ProductSpec p, GameObject go) { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) foreach (Renderer componentsInChild in go.GetComponentsInChildren<Renderer>(true)) { Il2CppReferenceArray<Material> sharedMaterials = componentsInChild.sharedMaterials; bool flag = false; for (int i = 0; i < ((Il2CppArrayBase<Material>)(object)sharedMaterials).Length; i++) { Material i2 = ((Il2CppArrayBase<Material>)(object)sharedMaterials)[i]; if ((Object)(object)i2 == (Object)null || !((Object)i2).name.Contains("pp_stamp")) { continue; } Face face = Faces.Find((Face f) => (Object)(object)f.M != (Object)null && ((Object)f.M).name == ((Object)i2).name + "_pp"); if (face == null) { Material m = new Material(i2) { name = ((Object)i2).name + "_pp", hideFlags = (HideFlags)32 }; face = new Face { M = m, Base = (i2.HasProperty("_BaseColor") ? i2.GetColor("_BaseColor") : i2.color) }; Faces.Add(face); if (LoadSet()) { Apply(face, Wanted()); } } ((Il2CppArrayBase<Material>)(object)sharedMaterials)[i] = face.M; flag = true; } if (flag) { componentsInChild.sharedMaterials = sharedMaterials; } } } public static void Update() { if (Faces.Count == 0 || Time.unscaledTime < _next) { return; } _next = Time.unscaledTime + 2f; if (!LoadSet()) { return; } int num = Wanted(); if (num < 0 || num == _applied) { return; } foreach (Face face in Faces) { Apply(face, num); } _applied = num; Instance log = DP_PillPress.WoodKit.Kit.Log; if (log != null) { log.Msg("Pill Press: pills are stamped with the " + ((num < Names.Length) ? Names[num] : ("#" + num)) + "."); } } private static void Apply(Face f, int stamp)
Mods/WoodStudios.MixLimitFix.dll
Decompiled 39 minutes agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using HarmonyLib; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppScheduleOne.Economy; using Il2CppScheduleOne.NPCs; using Il2CppScheduleOne.Product; using Il2CppScheduleOne.Product.Packaging; using Il2CppSystem.Collections.Generic; using MelonLoader; using Microsoft.CodeAnalysis; using UnityEngine; using WoodStudios.MixLimitFix; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: MelonInfo(typeof(Main), "Mix Limit Fix", "1.2.0", "Wood Studios", null)] [assembly: MelonGame("TVGS", "Schedule I")] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyVersion("0.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace WoodStudios.MixLimitFix { internal static class DealFix { private static float _sweepAt = -1f; private static int _added; private static Action<string> _log; public static void Apply(Harmony h, Action<string> log) { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown _log = log; try { string[] array = new string[3] { "AdjustAffinity", "RpcLogic___AdjustAffinity_3036964899", "RpcWriter___Server_AdjustAffinity_3036964899" }; foreach (string text in array) { MethodInfo methodInfo = AccessTools.Method(typeof(Customer), text, (Type[])null, (Type[])null); if (methodInfo != null) { Patches patchInfo = Harmony.GetPatchInfo((MethodBase)methodInfo); if (patchInfo != null && patchInfo.Prefixes?.Any((Patch p) => p.PatchMethod?.DeclaringType?.Name == "AffinityFix") == true) { log?.Invoke("Deal fix: already applied by Drug Pack."); return; } } if (methodInfo != null) { h.Patch((MethodBase)methodInfo, new HarmonyMethod(typeof(DealFix), "Prefix", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } } log?.Invoke("Deal fix: customers accept every drug type the labs make (no more freeze after selling poppy or pill products)."); } catch (Exception ex) { log?.Invoke("Deal fix couldn't start: " + ex.Message); } } private static void Prefix(Customer __instance, EDrugType drugType) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) try { Ensure(__instance, drugType); } catch { } } public static bool Ensure(Customer c, EDrugType type) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) CustomerAffinityData obj = ((c != null) ? c.currentAffinityData : null); List<ProductTypeAffinity> val = ((obj != null) ? obj.ProductAffinities : null); if (val == null) { return false; } for (int i = 0; i < val.Count; i++) { ProductTypeAffinity val2 = val[i]; if (val2 != null && val2.DrugType == type) { return false; } } ProductTypeAffinity val3 = new ProductTypeAffinity(); val3.DrugType = type; val3.Affinity = 0f; val.Add(val3); _added++; return true; } public static void Update() { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) if (Time.unscaledTime < _sweepAt) { return; } _sweepAt = Time.unscaledTime + 20f; try { Il2CppArrayBase<Customer> val = Object.FindObjectsOfType<Customer>(); if (val == null || val.Length == 0) { return; } int added = _added; foreach (Customer item in val) { if ((Object)(object)item == (Object)null) { continue; } foreach (EDrugType value in Enum.GetValues(typeof(EDrugType))) { Ensure(item, value); } } if (_added > added) { _log?.Invoke("Deal fix: gave " + (_added - added) + " customer drug-type entries a neutral starting point."); } } catch { } } } public class Main : MelonMod { internal const int OldPayload = 65536; internal const int NewPayload = 2097152; internal const int OldCount = 256; internal const int NewCount = 1024; private static readonly (string Type, string Method, int Old, int New, int Expected)[] Targets = new(string, string, int, int, int)[5] { ("S1API.Internal.Products.CustomProductManifestData", "Serialize", 65536, 2097152, 2), ("S1API.Internal.Products.CustomProductManifestData", "TryDeserialize", 65536, 2097152, 2), ("S1API.Internal.Products.CustomProductManifestData", "Create", 256, 1024, 1), ("S1API.Internal.Products.CustomProductManifestData", "TryValidate", 256, 1024, 3), ("S1API.Internal.Products.CustomProductSavePersistence", "RestoreBeforeBaseLoaders", 256, 1024, 1) }; private static int _old; private static int _new; private static int _hits; public override void OnInitializeMelon() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Expected O, but got Unknown Harmony val = new Harmony("woodstudios.mixlimitfix"); int num = 0; (string, string, int, int, int)[] targets = Targets; for (int i = 0; i < targets.Length; i++) { (string, string, int, int, int) tuple = targets[i]; try { Type type = AccessTools.TypeByName(tuple.Item1); MethodInfo methodInfo = ((type == null) ? null : AccessTools.Method(type, tuple.Item2, (Type[])null, (Type[])null)); if (methodInfo == null) { ((MelonBase)this).LoggerInstance.Warning(tuple.Item1 + "." + tuple.Item2 + " not found; this S1API version may not need the fix."); continue; } Patches patchInfo = Harmony.GetPatchInfo((MethodBase)methodInfo); if (patchInfo != null && patchInfo.Transpilers?.Any((Patch p) => p.owner == "woodstudios.mixlimitfix") == true) { num++; continue; } _old = tuple.Item3; _new = tuple.Item4; val.Patch((MethodBase)methodInfo, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(typeof(Main), "Raise", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null); if (_hits != tuple.Item5) { ((MelonBase)this).LoggerInstance.Warning($"{tuple.Item2}: changed {_hits} of {tuple.Item5} limits (S1API may have changed)."); } _hits = 0; num++; } catch (Exception ex) { ((MelonBase)this).LoggerInstance.Warning("Could not patch " + tuple.Item2 + ": " + ex.Message); } } ((MelonBase)this).LoggerInstance.Msg($"Custom product limits raised ({num}/{Targets.Length}): up to {1024} products and {2048} KB."); if (AppDomain.CurrentDomain.GetAssemblies().Any((Assembly a) => a.GetName().Name == "WoodStudios.DrugPack")) { ((MelonBase)this).LoggerInstance.Msg("Drug Pack is installed; it applies the deal and mixed-product save fixes itself."); return; } DealFix.Apply(val, delegate(string s) { ((MelonBase)this).LoggerInstance.Msg(s); }); MixSaveFix.Apply(val, delegate(string s) { ((MelonBase)this).LoggerInstance.Msg(s); }); } public override void OnUpdate() { DealFix.Update(); SupplierFix.Update(); } private static IEnumerable<CodeInstruction> Raise(IEnumerable<CodeInstruction> code) { foreach (CodeInstruction item in code) { if ((item.opcode == OpCodes.Ldc_I4 || item.opcode == OpCodes.Ldc_I4_S) && item.operand is int num && num == _old) { item.operand = _new; item.opcode = OpCodes.Ldc_I4; _hits++; } yield return item; } } } internal static class MixSaveFix { private static bool _done; public static void Apply(Harmony h, Action<string> log) { //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown if (_done) { return; } _done = true; try { Type type = AccessTools.TypeByName("S1API.Internal.Products.CustomProductSavePersistence"); MethodInfo methodInfo = ((type == null) ? null : AccessTools.Method(type, "RestoreFallback", (Type[])null, (Type[])null)); if (methodInfo == null) { log?.Invoke("Mixed-product save fix: not needed with this S1API."); return; } Patches patchInfo = Harmony.GetPatchInfo((MethodBase)methodInfo); if (patchInfo != null && patchInfo.Transpilers?.Any((Patch p) => p.PatchMethod?.DeclaringType?.Name == "MixSaveFix") == true) { log?.Invoke("Mixed-product save fix: already applied by Drug Pack."); return; } h.Patch((MethodBase)methodInfo, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(typeof(MixSaveFix), "Transpile", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null); log?.Invoke("Mixed-product save fix applied: mixes of modded products now come back after reloading."); } catch (Exception ex) { log?.Invoke("Mixed-product save fix failed: " + ex.Message); } } private static IEnumerable<CodeInstruction> Transpile(IEnumerable<CodeInstruction> code) { foreach (CodeInstruction item in code) { if (item.opcode == OpCodes.Isinst && item.operand is Type type) { if (type == typeof(ProductDefinition)) { item.opcode = OpCodes.Call; item.operand = AccessTools.Method(typeof(MixSaveFix), "AsProduct", (Type[])null, (Type[])null); } else if (type == typeof(PackagingDefinition)) { item.opcode = OpCodes.Call; item.operand = AccessTools.Method(typeof(MixSaveFix), "AsPackaging", (Type[])null, (Type[])null); } } yield return item; } } public static ProductDefinition AsProduct(object o) { ProductDefinition val = (ProductDefinition)((o is ProductDefinition) ? o : null); if (val != null) { return val; } try { object obj = ((o is Il2CppObjectBase) ? o : null); return (obj != null) ? ((Il2CppObjectBase)obj).TryCast<ProductDefinition>() : null; } catch { return null; } } public static PackagingDefinition AsPackaging(object o) { PackagingDefinition val = (PackagingDefinition)((o is PackagingDefinition) ? o : null); if (val != null) { return val; } try { object obj = ((o is Il2CppObjectBase) ? o : null); return (obj != null) ? ((Il2CppObjectBase)obj).TryCast<PackagingDefinition>() : null; } catch { return null; } } } internal static class SupplierFix { private static readonly List<FieldInfo> Fields = new List<FieldInfo>(); private static bool _found; private static float _next; private static void Find() { _found = true; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { Type[] types; try { types = assembly.GetTypes(); } catch (ReflectionTypeLoadException ex) { types = ex.Types; } catch { continue; } Type[] array = types; foreach (Type type in array) { if (!(type == null) && !(type.Name != "LabNpcs")) { FieldInfo field = type.GetField("SupplierNpc", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); if (field != null && field.FieldType.Name == "LabSupplierNpc") { Fields.Add(field); } } } } } public static void Update() { if (Time.unscaledTime < _next) { return; } _next = Time.unscaledTime + 1f; if (!_found) { Find(); } foreach (FieldInfo field in Fields) { try { object value = field.GetValue(null); if (value == null) { continue; } object? obj = value.GetType().GetProperty("gameObject")?.GetValue(value); GameObject val = (GameObject)((obj is GameObject) ? obj : null); if (!((Object)(object)val == (Object)null)) { NPC component = val.GetComponent<NPC>(); object obj2; if (component == null) { obj2 = null; } else { NPCMovement movement = component.Movement; obj2 = ((movement != null) ? movement._capsuleCollider : null); } CapsuleCollider val2 = (CapsuleCollider)obj2; if ((Object)(object)val2 != (Object)null && ((Collider)val2).enabled != component.isVisible) { ((Collider)val2).enabled = component.isVisible; } } } catch { } } } } }