using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using DomsExpandedIngredientsAndEffects; using DomsExpandedIngredientsAndEffects.Effects; using DomsExpandedIngredientsAndEffects.Effects.Descriptors; using DomsExpandedIngredientsAndEffects.Framework; using DomsExpandedIngredientsAndEffects.Ingredients; using DomsExpandedIngredientsAndEffects.Patches; using DomsExpandedIngredientsAndEffects.Utilities; using FishNet; using FishNet.Connection; using FishNet.Object; using HarmonyLib; using MelonLoader; using Microsoft.CodeAnalysis; using ScheduleOne; using ScheduleOne.Audio; using ScheduleOne.AvatarFramework; using ScheduleOne.Core.Items.Framework; using ScheduleOne.DevUtilities; using ScheduleOne.Effects; using ScheduleOne.Effects.MixMaps; using ScheduleOne.Interaction; using ScheduleOne.ItemFramework; using ScheduleOne.Levelling; using ScheduleOne.Map; using ScheduleOne.Messaging; using ScheduleOne.NPCs; using ScheduleOne.ObjectScripts; using ScheduleOne.PlayerScripts; using ScheduleOne.Product; using ScheduleOne.Quests; using ScheduleOne.StationFramework; using ScheduleOne.UI; using ScheduleOne.UI.Phone.Delivery; using ScheduleOne.UI.Shop; using ScheduleOne.UI.Stations; using ScheduleOne.Weather; using TMPro; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: MelonInfo(typeof(DomsCustomEffects), "Dom's Custom Effects", "1.0.0", "Dom", null)] [assembly: MelonGame("TVGS", "Schedule I")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("DomsExpandedIngredientsAndEffects-Mono")] [assembly: AssemblyConfiguration("Mono")] [assembly: AssemblyDescription("Custom drugs and effects using S1API")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+eea8148f75a32f7711442c3d3be242370e62c997")] [assembly: AssemblyProduct("DomsExpandedIngredientsAndEffects-Mono")] [assembly: AssemblyTitle("DomsExpandedIngredientsAndEffects-Mono")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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] [Microsoft.CodeAnalysis.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] [Microsoft.CodeAnalysis.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 DomsExpandedIngredientsAndEffects { public class DomsCustomEffects : MelonMod { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__8_0; public static UnityAction <>9__15_0; internal void b__8_0() { } internal void b__15_0() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) LevelManager instance = NetworkSingleton.Instance; if (!((Object)(object)instance == (Object)null)) { if (!(instance.GetFullRank() >= new FullRank((ERank)5, 4))) { MelonCoroutines.Start(ShowRejectionMessage()); } else { OpenAlchemistShop(); } } } } private static bool _injected; public static ShopInterface _magicJuiceShop; private static Canvas _magicJuiceCanvas; private static RectTransform _magicJuiceContainer; public static bool _alchemistMessageSent; private static MSGConversation _alchemistConversation; public override void OnSceneWasInitialized(int buildIndex, string sceneName) { if (!_injected && (sceneName.ToLower().Contains("main") || sceneName.ToLower().Contains("game"))) { OnInject(); } } public override void OnInitializeMelon() { } private void OnInject() { try { MelonLogger.Msg("Mod: Starting content injection..."); Registry instance = Singleton.Instance; ProductManager instance2 = NetworkSingleton.Instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance2 == (Object)null) { MelonLogger.Error("Mod: Registry or ProductManager not found!"); return; } MoonDustIngredient moonDustIngredient = new MoonDustIngredient(); moonDustIngredient.Register(instance, instance2); LipstickIngredient lipstickIngredient = new LipstickIngredient(); lipstickIngredient.Register(instance, instance2); AirhornIngredient airhornIngredient = new AirhornIngredient(); airhornIngredient.Register(instance, instance2); MagicJuiceIngredient magicJuiceIngredient = new MagicJuiceIngredient(); magicJuiceIngredient.Register(instance, instance2); FertilizerIngredient fertilizerIngredient = new FertilizerIngredient(); fertilizerIngredient.Register(instance, instance2); HotSauceIngredient hotSauceIngredient = new HotSauceIngredient(); hotSauceIngredient.Register(instance, instance2); EffectCombination[] array = new EffectCombination[40] { new EffectCombination("moongravity", "foggy", new VoidEffectDef()), new EffectCombination("heliuminfusion", "energizing", new BunnyEffectDef()), new EffectCombination("moongravity", "toxic", new AlienEffectDef()), new EffectCombination("moongravity", "moongravity", new MartianEffectDef()), new EffectCombination("martianeffect", "alieneffect", new SuperMartianEffectDef()), new EffectCombination("heliuminfusion", "sedating", new NebulaEffectDef()), new EffectCombination("heliuminfusion", "sneaky", new PhantomEffectDef()), new EffectCombination("phantomeffect", "heliuminfusion", new WraithEffectDef()), new EffectCombination("voluptuouseffect", "energizing", new GoldRushEffectDef()), new EffectCombination("voluptuouseffect", "voideffect", new SingleEventUpsetEffectDef()), new EffectCombination("heliuminfusion", "giraffying", new TallEffectDef()), new EffectCombination("talleffect", "foggy", new InversionEffectDef()), new EffectCombination("voluptuouseffect", "calming", new SirenEffectDef()), new EffectCombination("voluptuouseffect", "balding", new DivaEffectDef()), new EffectCombination("goldrusheffect", "martianeffect", new GildedMartianEffectDef()), new EffectCombination("voluptuouseffect", "electrifying", new ChargedEffectDef()), new EffectCombination("airhornbase", "sneaky", new TrollEffectDef()), new EffectCombination("airhornbase", "energizing", new FiestaEffectDef()), new EffectCombination("trolleffect", "airhornbase", new CreepyEffectDef()), new EffectCombination("magicbase", "magicbase", new SuperMagicEffectDef()), new EffectCombination("magicbase", "calming", new MakeItRainEffectDef()), new EffectCombination("magicbase", "energizing", new SuperChargeEffectDef()), new EffectCombination("supermagic", "slippery", new ProfitBoostEffectDef()), new EffectCombination("supercharge", "supermagic", new SuperSuperChargeEffectDef()), new EffectCombination("earthyeffect", "calming", new RootBoundEffectDef()), new EffectCombination("rootbound", "toxic", new OvergrownEffectDef()), new EffectCombination("overgrown", "energizing", new BloomEffectDef()), new EffectCombination("bloom", "foggy", new CompostEffectDef()), new EffectCombination("spicyeffect", "toxic", new FiveAlarmEffectDef()), new EffectCombination("fivealarm", "energizing", new CapsaicinRushEffectDef()), new EffectCombination("capsaicinrush", "sneaky", new DragonBreathEffectDef()), new EffectCombination("dragonbreath", "sedating", new InfernoEffectDef()), new EffectCombination("voluptuouseffect", "foggy", new FemmeFataleEffectDef()), new EffectCombination("divaeffect", "toxic", new VenomKissEffectDef()), new EffectCombination("airhornbase", "toxic", new ThunderclapEffectDef()), new EffectCombination("fiestaeffect", "sedating", new WhiteNoiseEffectDef()), new EffectCombination("earthyeffect", "voluptuouseffect", new WildflowerEffectDef()), new EffectCombination("voluptuouseffect", "spicyeffect", new BurningPassionEffectDef()), new EffectCombination("earthyeffect", "airhornbase", new UpheavalEffectDef()), new EffectCombination("magicbase", "toxic", new PhantasmEffectDef()) }; foreach (EffectCombination combo in array) { CustomMixRegistry.Register(combo); } CustomMixRegistry.Register(new MultiEffectCombination(new string[2] { "heliuminfusion", "foggy" }, "longfaced", new InversionEffectDef())); MelonCoroutines.Start(AddIngredientsToShops()); MelonCoroutines.Start(SpawnMagicJuiceVendor()); _injected = true; MelonLogger.Msg("Mod: Injection complete."); } catch (Exception ex) { MelonLogger.Error("Injection Error: " + ex.Message + "\n" + ex.StackTrace); } } public static Sprite LoadCustomIcon(string fileName) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_0086: 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) try { string text = Path.Combine(Directory.GetCurrentDirectory(), "Mods", "DomsCustomEffects", "Icons", fileName); if (!File.Exists(text)) { MelonLogger.Warning("[Icon] Not found: " + text); return null; } byte[] array = File.ReadAllBytes(text); Texture2D val = new Texture2D(2, 2); ImageConversion.LoadImage(val, array); return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); } catch (Exception ex) { MelonLogger.Error("[Icon] Failed: " + ex.Message); return null; } } public static Texture2D LoadCustomTexture(string fileName) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown try { string path = Path.Combine(Directory.GetCurrentDirectory(), "Mods", "DomsCustomEffects", "Icons", fileName); if (!File.Exists(path)) { return null; } byte[] array = File.ReadAllBytes(path); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); ImageConversion.LoadImage(val, array); return val; } catch (Exception ex) { MelonLogger.Error("[Texture] Failed: " + ex.Message); return null; } } public static AudioClip LoadCustomSound(string fileName) { try { string text = Path.Combine(Directory.GetCurrentDirectory(), "Mods", "DomsCustomEffects", "Sounds", fileName); if (!File.Exists(text)) { MelonLogger.Warning("[Sound] Not found: " + text); return null; } byte[] data = File.ReadAllBytes(text); AudioClip val = WavUtility.ToAudioClip(data, fileName); if ((Object)(object)val == (Object)null) { MelonLogger.Warning("[Sound] Failed to decode " + fileName + " — try converting to .wav"); } return val; } catch (Exception ex) { MelonLogger.Error("[Sound] Failed: " + ex.Message); return null; } } private static IEnumerator AddIngredientsToShops() { yield return (object)new WaitForSeconds(2f); List shops = ShopInterface.AllShops; SetRankRequirement(FertilizerIngredient.Definition, (ERank)1, 1); SetRankRequirement(HotSauceIngredient.Definition, (ERank)2, 3); SetRankRequirement(MoonDustIngredient.Definition, (ERank)3, 5); SetRankRequirement(LipstickIngredient.Definition, (ERank)4, 3); SetRankRequirement(AirhornIngredient.Definition, (ERank)5, 1); string[] gasCodes = new string[2] { "gas_mart_central", "gas_mart_west" }; string[] array = gasCodes; foreach (string code in array) { ShopInterface shop = null; foreach (ShopInterface s in shops) { if (s.ShopCode == code) { shop = s; break; } } if ((Object)(object)shop == (Object)null) { MelonLogger.Warning("[Shop] Could not find shop: " + code); continue; } AddIngredientToShop(shop, FertilizerIngredient.Definition, 3f, canBeDelivered: true); AddIngredientToShop(shop, HotSauceIngredient.Definition, 5f, canBeDelivered: true); AddIngredientToShop(shop, MoonDustIngredient.Definition, 6f, canBeDelivered: true); AddIngredientToShop(shop, LipstickIngredient.Definition, 5f, canBeDelivered: true); AddIngredientToShop(shop, AirhornIngredient.Definition, 5f, canBeDelivered: true); } yield return null; InjectDeliveryShopEntries(); } private static void InjectDeliveryShopEntries() { //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Expected O, but got Unknown //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) DeliveryApp instance = PlayerSingleton.Instance; if ((Object)(object)instance == (Object)null) { MelonLogger.Warning("[Shop] DeliveryApp not found."); return; } DeliveryShop[] componentsInChildren = ((Component)instance).GetComponentsInChildren(true); DeliveryShop[] array = componentsInChildren; foreach (DeliveryShop val in array) { if ((Object)(object)val.MatchingShop == (Object)null || (val.MatchingShop.ShopCode != "gas_mart_central" && val.MatchingShop.ShopCode != "gas_mart_west")) { continue; } FieldInfo field = typeof(DeliveryShop).GetField("ListingEntryPrefab", BindingFlags.Instance | BindingFlags.Public); FieldInfo field2 = typeof(DeliveryShop).GetField("ListingContainer", BindingFlags.Instance | BindingFlags.Public); FieldInfo field3 = typeof(DeliveryShop).GetField("listingEntries", BindingFlags.Instance | BindingFlags.NonPublic); object? obj = field?.GetValue(val); ListingEntry val2 = (ListingEntry)((obj is ListingEntry) ? obj : null); object? obj2 = field2?.GetValue(val); RectTransform val3 = (RectTransform)((obj2 is RectTransform) ? obj2 : null); List list = field3?.GetValue(val) as List; if ((Object)(object)val2 == (Object)null || (Object)(object)val3 == (Object)null || list == null) { MelonLogger.Warning("[Shop] Could not get DeliveryShop fields for " + val.MatchingShop.ShopName + "."); continue; } foreach (ShopListing listing in val.MatchingShop.Listings) { if (listing.CanBeDelivered && !list.Exists((ListingEntry e) => ((BaseItemDefinition)(e.MatchingListing?.Item?)).ID == ((BaseItemDefinition)(listing.Item?)).ID)) { ListingEntry val4 = Object.Instantiate(val2, (Transform)(object)val3); val4.Initialize(listing); UnityEvent onQuantityChanged = val4.onQuantityChanged; object obj3 = <>c.<>9__8_0; if (obj3 == null) { UnityAction val5 = delegate { }; <>c.<>9__8_0 = val5; obj3 = (object)val5; } onQuantityChanged.AddListener((UnityAction)obj3); list.Add(val4); } } object? obj4 = typeof(DeliveryShop).GetField("ContentsContainer", BindingFlags.Instance | BindingFlags.Public)?.GetValue(val); RectTransform val6 = (RectTransform)((obj4 is RectTransform) ? obj4 : null); if ((Object)(object)val6 != (Object)null) { int num = Mathf.CeilToInt((float)list.Count / 2f); val6.sizeDelta = new Vector2(val6.sizeDelta.x, 230f + (float)num * 60f); } } } private static void SetRankRequirement(PropertyItemDefinition def, ERank rank, int tier) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Expected O, but got Unknown if (!((Object)(object)def == (Object)null)) { ((StorableItemDefinition)def).RequiresLevelToPurchase = true; ((StorableItemDefinition)def).RequiredRank = new FullRank(rank, tier); LevelManager instance = NetworkSingleton.Instance; if ((Object)(object)instance != (Object)null) { instance.AddUnlockable(new Unlockable(new FullRank(rank, tier), ((BaseItemDefinition)def).Name, ((BaseItemDefinition)def).Icon)); } } } private static void AddIngredientToShop(ShopInterface shop, PropertyItemDefinition def, float price, bool canBeDelivered = false) { //IL_007b: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown if ((Object)(object)def == (Object)null || (Object)(object)shop == (Object)null) { return; } foreach (ShopListing listing in shop.Listings) { if (((BaseItemDefinition)(listing.Item?)).ID == ((BaseItemDefinition)def).ID) { return; } } ShopListing val = new ShopListing { name = ((BaseItemDefinition)def).Name, Item = (StorableItemDefinition)(object)def, LimitedStock = false, DefaultStock = -1, CanBeDelivered = canBeDelivered }; FieldInfo field = typeof(ShopListing).GetField("OverridePrice", BindingFlags.Instance | BindingFlags.NonPublic); FieldInfo field2 = typeof(ShopListing).GetField("OverriddenPrice", BindingFlags.Instance | BindingFlags.NonPublic); field?.SetValue(val, true); field2?.SetValue(val, price); shop.Listings.Add(val); val.Initialize(shop); typeof(ShopInterface).GetMethod("CreateListingUI", BindingFlags.Instance | BindingFlags.NonPublic)?.Invoke(shop, new object[1] { val }); } private static IEnumerator SpawnMagicJuiceVendor() { yield return (object)new WaitForSeconds(3f); ShopInterface sourceShop = null; foreach (ShopInterface s in ShopInterface.AllShops) { if (s.ShopCode == "gas_mart_central") { sourceShop = s; break; } } if ((Object)(object)sourceShop == (Object)null) { MelonLogger.Warning("[Vendor] Could not find source shop to clone."); yield break; } GameObject shopGO = Object.Instantiate(((Component)sourceShop).gameObject); ((Object)shopGO).name = "MagicJuiceVendorShop"; _magicJuiceShop = shopGO.GetComponent(); _magicJuiceShop.ShopName = "The Alchemist Table"; _magicJuiceShop.ShopCode = "magic_juice_vendor"; _magicJuiceCanvas = shopGO.GetComponentInChildren(true); _magicJuiceContainer = _magicJuiceShop.Container; if ((Object)(object)_magicJuiceShop.StoreNameLabel != (Object)null) { ((TMP_Text)_magicJuiceShop.StoreNameLabel).text = "The Alchemist Table"; } FieldInfo shopScreenField = typeof(ShopInterface).GetField("shopScreen", BindingFlags.Instance | BindingFlags.NonPublic); UIScreen ownScreen = shopGO.GetComponentInChildren(true); if (shopScreenField != null && (Object)(object)ownScreen != (Object)null) { shopScreenField.SetValue(_magicJuiceShop, ownScreen); } else { MelonLogger.Warning($"[Vendor] shopScreen fix failed — field:{shopScreenField != null} screen:{(Object)(object)ownScreen != (Object)null}"); } Cart cart = shopGO.GetComponentInChildren(true); if ((Object)(object)cart != (Object)null) { cart.Shop = _magicJuiceShop; } else { MelonLogger.Warning("[Vendor] Could not find Cart component on cloned shop."); } RectTransform listingContainer = _magicJuiceShop.ListingContainer; if ((Object)(object)listingContainer != (Object)null) { for (int i = ((Transform)listingContainer).childCount - 1; i >= 0; i--) { Object.Destroy((Object)(object)((Component)((Transform)listingContainer).GetChild(i)).gameObject); } } (typeof(ShopInterface).GetField("listingUI", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(_magicJuiceShop) as List)?.Clear(); _magicJuiceShop.Listings.Clear(); yield return null; SetRankRequirement(MagicJuiceIngredient.Definition, (ERank)5, 4); AddIngredientToShop(_magicJuiceShop, MagicJuiceIngredient.Definition, 200f); SpawnVendorStand(); } private static void SpawnVendorStand() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Expected O, but got Unknown //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Expected O, but got Unknown //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Expected O, but got Unknown //IL_030d: 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_0345: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Expected O, but got Unknown //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Expected O, but got Unknown Vector3 position = default(Vector3); ((Vector3)(ref position))..ctor(-15.7f, -5.04f, 173.82f); GameObject val = new GameObject("MagicJuiceVendorStand"); val.transform.position = position; val.transform.rotation = Quaternion.Euler(0f, 30f, 0f); Shader val2 = Shader.Find("Universal Render Pipeline/Lit") ?? Shader.Find("Standard"); GameObject val3 = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)val3).name = "VendorTable"; val3.transform.SetParent(val.transform); val3.transform.localPosition = new Vector3(0f, 0.75f, 0f); val3.transform.localRotation = Quaternion.identity; val3.transform.localScale = new Vector3(1.2f, 0.1f, 0.7f); Material val4 = new Material(val2); val4.color = new Color(0.15f, 0.05f, 0.25f); val3.GetComponent().material = val4; val3.layer = LayerMask.NameToLayer("Default"); val3.GetComponent().isTrigger = false; Material val5 = new Material(val2); val5.color = new Color(0.1f, 0.03f, 0.18f); Vector3[] array = (Vector3[])(object)new Vector3[4] { new Vector3(0.55f, 0.35f, 0.3f), new Vector3(-0.55f, 0.35f, 0.3f), new Vector3(0.55f, 0.35f, -0.3f), new Vector3(-0.55f, 0.35f, -0.3f) }; Vector3[] array2 = array; foreach (Vector3 localPosition in array2) { GameObject val6 = GameObject.CreatePrimitive((PrimitiveType)3); val6.transform.SetParent(val.transform); val6.transform.localPosition = localPosition; val6.transform.localRotation = Quaternion.identity; val6.transform.localScale = new Vector3(0.07f, 0.7f, 0.07f); val6.GetComponent().material = val5; val6.layer = LayerMask.NameToLayer("Default"); val6.GetComponent().isTrigger = false; } GameObject val7 = GameObject.CreatePrimitive((PrimitiveType)0); ((Object)val7).name = "MagicOrb"; val7.transform.SetParent(val.transform); val7.transform.localPosition = new Vector3(0f, 0.92f, 0f); val7.transform.localRotation = Quaternion.identity; val7.transform.localScale = Vector3.one * 0.22f; Material val8 = new Material(val2); val8.color = new Color(0.6f, 0f, 1f); val8.EnableKeyword("_EMISSION"); val8.SetColor("_EmissionColor", new Color(0.5f, 0f, 0.9f) * 3f); val7.GetComponent().material = val8; Object.Destroy((Object)(object)val7.GetComponent()); GameObject val9 = new GameObject("InteractionCollider"); val9.transform.SetParent(val.transform); val9.transform.localPosition = new Vector3(0f, 0.55f, 0f); val9.transform.localRotation = Quaternion.identity; val9.layer = LayerMask.NameToLayer("Interaction"); BoxCollider val10 = val9.AddComponent(); ((Collider)val10).isTrigger = true; val10.size = new Vector3(1.2f, 1.4f, 0.7f); InteractableObject val11 = val9.AddComponent(); val11.SetMessage("Browse The Alchemist Table"); val11.MaxInteractionRange = 3f; val11.SetInteractableState((EInteractableState)0); UnityEvent onInteractStart = val11.onInteractStart; object obj = <>c.<>9__15_0; if (obj == null) { UnityAction val12 = delegate { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) LevelManager instance = NetworkSingleton.Instance; if (!((Object)(object)instance == (Object)null)) { if (!(instance.GetFullRank() >= new FullRank((ERank)5, 4))) { MelonCoroutines.Start(ShowRejectionMessage()); } else { OpenAlchemistShop(); } } }; <>c.<>9__15_0 = val12; obj = (object)val12; } onInteractStart.AddListener((UnityAction)obj); MelonCoroutines.Start(AddVendorMapPOI(val)); } private static void OpenAlchemistShop() { if (!((Object)(object)_magicJuiceShop == (Object)null)) { _magicJuiceShop.SetIsOpen(true); if ((Object)(object)_magicJuiceCanvas != (Object)null) { ((Behaviour)_magicJuiceCanvas).enabled = true; } if ((Object)(object)_magicJuiceContainer != (Object)null) { ((Component)_magicJuiceContainer).gameObject.SetActive(true); } MelonCoroutines.Start(WatchForShopClose()); } } private static void ForceCloseAlchemistShop() { if (!((Object)(object)_magicJuiceShop == (Object)null)) { _magicJuiceShop.SetIsOpen(false); if ((Object)(object)_magicJuiceCanvas != (Object)null) { ((Behaviour)_magicJuiceCanvas).enabled = false; } if ((Object)(object)_magicJuiceContainer != (Object)null) { ((Component)_magicJuiceContainer).gameObject.SetActive(false); } } } private static IEnumerator WatchForShopClose() { yield return (object)new WaitForSeconds(0.3f); while ((Object)(object)_magicJuiceShop != (Object)null && _magicJuiceShop.IsOpen) { if (GameInput.GetButtonDown((ButtonCode)10) || GameInput.GetButtonDown((ButtonCode)11)) { ForceCloseAlchemistShop(); yield break; } PlayerMovement player = PlayerSingleton.Instance; if ((Object)(object)player != (Object)null) { float dist = Vector3.Distance(((Component)player).transform.position, new Vector3(-15.7f, -5.04f, 173.82f)); if (dist > 8f) { ForceCloseAlchemistShop(); yield break; } } yield return null; } if ((Object)(object)_magicJuiceCanvas != (Object)null) { ((Behaviour)_magicJuiceCanvas).enabled = false; } if ((Object)(object)_magicJuiceContainer != (Object)null) { ((Component)_magicJuiceContainer).gameObject.SetActive(false); } } private static IEnumerator ShowRejectionMessage() { float elapsed = 0f; float duration = 0.9f; while (elapsed < duration) { HUD instance = Singleton.Instance; if (instance != null) { CrosshairText crosshairText = instance.CrosshairText; if (crosshairText != null) { crosshairText.Show("Get outta here kid.", Color32.op_Implicit(new Color32(byte.MaxValue, (byte)80, (byte)80, byte.MaxValue))); } } elapsed += Time.deltaTime; yield return null; } } private static IEnumerator AddVendorMapPOI(GameObject vendorGO) { yield return (object)new WaitForSeconds(1f); LevelManager lm = NetworkSingleton.Instance; if ((Object)(object)lm == (Object)null) { yield break; } POI existingPOI = Object.FindObjectOfType(); if ((Object)(object)existingPOI == (Object)null) { MelonLogger.Warning("[Vendor] Could not find POI to clone."); yield break; } GameObject poiGO = Object.Instantiate(((Component)existingPOI).gameObject, vendorGO.transform); poiGO.transform.localPosition = new Vector3(0f, 2f, 0f); POI poi = poiGO.GetComponent(); poi.SetMainText("The Alchemist Table"); poi.onUICreated.AddListener((UnityAction)delegate { MelonCoroutines.Start(SetPOIIcon(poi)); }); bool meetsRank = lm.GetFullRank() >= new FullRank((ERank)5, 4); ((Behaviour)poi).enabled = meetsRank; poiGO.SetActive(meetsRank); if (meetsRank && !_alchemistMessageSent) { _alchemistMessageSent = true; CreateAlchemistConversation(); SendAlchemistPhoneMessage(); } lm.onRankChanged = (Action)Delegate.Combine(lm.onRankChanged, (Action)delegate(FullRank before, FullRank after) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) bool flag = after >= new FullRank((ERank)5, 4); ((Behaviour)poi).enabled = flag; poiGO.SetActive(flag); if (flag && !_alchemistMessageSent) { _alchemistMessageSent = true; CreateAlchemistConversation(); SendAlchemistPhoneMessage(); } }); } private static IEnumerator SetPOIIcon(POI poi) { yield return null; if ((Object)(object)poi.IconContainer == (Object)null) { MelonLogger.Warning("[Vendor] POI IconContainer is null."); yield break; } for (int i = ((Transform)poi.IconContainer).childCount - 1; i >= 0; i--) { Object.Destroy((Object)(object)((Component)((Transform)poi.IconContainer).GetChild(i)).gameObject); } yield return null; Texture2D tex = LoadCustomTexture("MagicJuice.png"); if ((Object)(object)tex == (Object)null) { MelonLogger.Warning("[Vendor] Could not load MagicJuice.png for POI icon."); yield break; } GameObject iconGO = new GameObject("AlchemistIcon"); iconGO.transform.SetParent((Transform)(object)poi.IconContainer, false); RectTransform rect = iconGO.AddComponent(); rect.sizeDelta = new Vector2(20f, 20f); Image img = iconGO.AddComponent(); img.sprite = Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f)); ((Graphic)img).color = Color.white; img.preserveAspect = true; } private static void SendAlchemistUnlockNotification() { MelonCoroutines.Start(SendAlchemistNotificationDelayed()); } private static IEnumerator SendAlchemistNotificationDelayed() { yield return (object)new WaitForSeconds(2f); NotificationsManager nm = Singleton.Instance; if ((Object)(object)nm == (Object)null) { MelonLogger.Warning("[Vendor] NotificationsManager not found."); yield break; } Sprite notifIcon = null; Texture2D tex = LoadCustomTexture("MagicJuice.png"); if ((Object)(object)tex != (Object)null) { notifIcon = Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f)); } nm.SendNotification("The Alchemist Table", "The alchemist table beckons you to pay a visit... You can find it on the map.", notifIcon, 8f, true); } private static void CreateAlchemistConversation() { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Expected O, but got Unknown //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) try { NPC val = null; foreach (NPC item in NPCManager.NPCRegistry) { if ((Object)(object)item != (Object)null) { val = item; break; } } if ((Object)(object)val == (Object)null) { MelonLogger.Warning("[Alchemist] No NPC found to clone."); return; } GameObject val2 = Object.Instantiate(((Component)val).gameObject); ((Object)val2).name = "AlchemistFakeNPC"; val2.transform.position = new Vector3(0f, -1000f, 0f); NPC component = val2.GetComponent(); component.FirstName = "The Alchemist Table"; component.hasLastName = false; component.LastName = ""; component.ID = "the_alchemist_vendor"; val2.SetActive(false); Texture2D val3 = LoadCustomTexture("MagicJuice.png"); if ((Object)(object)val3 != (Object)null) { Sprite value = Sprite.Create(val3, new Rect(0f, 0f, (float)((Texture)val3).width, (float)((Texture)val3).height), new Vector2(0.5f, 0.5f)); typeof(NPC).GetField("MugshotSprite", BindingFlags.Instance | BindingFlags.Public)?.SetValue(component, value); } val2.SetActive(true); val2.SetActive(false); _alchemistConversation = new MSGConversation(component, "The Alchemist Table"); _alchemistConversation.SetIsKnown(true); } catch (Exception ex) { MelonLogger.Error("[Alchemist] Failed to create conversation: " + ex.Message + "\n" + ex.StackTrace); } } private static void SendAlchemistPhoneMessage() { if (_alchemistConversation == null) { MelonLogger.Warning("[Alchemist] Conversation not ready."); } else { MelonCoroutines.Start(SendAlchemistMessageDelayed()); } } private static IEnumerator SendAlchemistMessageDelayed() { yield return (object)new WaitForSeconds(2f); try { Message msg = new Message("The alchemist table beckons you to pay a visit... You can find it on the map.", (ESenderType)1, true, Random.Range(int.MinValue, int.MaxValue)); _alchemistConversation.SendMessage(msg, true, false); } catch (Exception ex) { MelonLogger.Error("[Alchemist] Failed to send message: " + ex.Message + "\n" + ex.StackTrace); } } } public static class ModInfo { public const string Name = "Dom's Custom Effects"; public const string Version = "1.1.0"; public const string Author = "Dom"; } } namespace DomsExpandedIngredientsAndEffects.Utilities { public static class SoundHelper { public static float SFXVolume { get { try { AudioManager instance = Singleton.Instance; return ((Object)(object)instance != (Object)null) ? instance.GetVolume((EAudioType)2, true) : 1f; } catch { return 1f; } } } public static float MusicVolume { get { try { AudioManager instance = Singleton.Instance; return ((Object)(object)instance != (Object)null) ? instance.GetVolume((EAudioType)4, true) : 1f; } catch { return 1f; } } } } public static class WavUtility { public static AudioClip ToAudioClip(byte[] data, string name) { try { int num = data[22] | (data[23] << 8); int num2 = data[24] | (data[25] << 8) | (data[26] << 16) | (data[27] << 24); int num3 = data[34] | (data[35] << 8); int num4 = 44; for (int i = 12; i < data.Length - 4; i++) { if (data[i] == 100 && data[i + 1] == 97 && data[i + 2] == 116 && data[i + 3] == 97) { num4 = i + 8; break; } } int num5 = (data.Length - num4) / (num3 / 8); float[] array = new float[num5]; switch (num3) { case 16: { for (int k = 0; k < num5; k++) { short num6 = (short)(data[num4 + k * 2] | (data[num4 + k * 2 + 1] << 8)); array[k] = (float)num6 / 32768f; } break; } case 8: { for (int j = 0; j < num5; j++) { array[j] = (float)(data[num4 + j] - 128) / 128f; } break; } } AudioClip val = AudioClip.Create(name, num5 / num, num, num2, false); val.SetData(array, 0); return val; } catch (Exception ex) { MelonLogger.Error("[WavUtility] Failed to parse " + name + ": " + ex.Message); return null; } } } } namespace DomsExpandedIngredientsAndEffects.Ingredients { public class AirhornIngredient : CustomIngredient { public static PropertyItemDefinition Definition { get; private set; } public override string ID => "airhorn"; public override string Name => "Airhorn"; public override string IconFileName => "Airhorn.png"; public override CustomEffect MixEffect => new AirhornBaseEffectDef(); public override CustomEffect MapEffect => new AirhornMapEffectDef(); public override Vector2 MapPosition => new Vector2(1.5f, -2f); public override float MapRadius => 0.45f; public override EDrugType TargetDrugType => (EDrugType)0; public new void Register(Registry registry, ProductManager productManager) { base.Register(registry, productManager); Definition = base.ItemDefinition; } } public class FertilizerIngredient : CustomIngredient { public static PropertyItemDefinition Definition { get; private set; } public override string ID => "dom_fertilizer"; public override string Name => "Fertilizer"; public override string IconFileName => "Fertilizer.png"; public override CustomEffect MixEffect => new EarthyEffectDef(); public override CustomEffect MapEffect => new FertilizerMapEffectDef(); public override Vector2 MapPosition => new Vector2(2.5f, 2f); public override float MapRadius => 0.45f; public override EDrugType TargetDrugType => (EDrugType)0; public new void Register(Registry registry, ProductManager productManager) { base.Register(registry, productManager); Definition = base.ItemDefinition; } } public class HotSauceIngredient : CustomIngredient { public static PropertyItemDefinition Definition { get; private set; } public override string ID => "hotsauce"; public override string Name => "Hot Sauce"; public override string IconFileName => "HotSauce.png"; public override CustomEffect MixEffect => new SpicyEffectDef(); public override CustomEffect MapEffect => new HotSauceMapEffectDef(); public override Vector2 MapPosition => new Vector2(-0.5f, -2.5f); public override float MapRadius => 0.45f; public override EDrugType TargetDrugType => (EDrugType)0; public new void Register(Registry registry, ProductManager productManager) { base.Register(registry, productManager); Definition = base.ItemDefinition; } } public class LipstickIngredient : CustomIngredient { public static PropertyItemDefinition Definition { get; private set; } public override string ID => "lipstick"; public override string Name => "Lipstick"; public override string IconFileName => "Lipstick.png"; public override CustomEffect MixEffect => new VoluptuousEffectDef(); public override CustomEffect MapEffect => new LipstickMapEffectDef(); public override Vector2 MapPosition => new Vector2(-2f, 1.5f); public override float MapRadius => 0.45f; public override EDrugType TargetDrugType => (EDrugType)0; public new void Register(Registry registry, ProductManager productManager) { base.Register(registry, productManager); Definition = base.ItemDefinition; } } public class MagicJuiceIngredient : CustomIngredient { public static PropertyItemDefinition Definition { get; private set; } public override string ID => "magicjuice"; public override string Name => "Magic Juice"; public override string IconFileName => "MagicJuice.png"; public override CustomEffect MixEffect => new MagicBaseEffectDef(); public override CustomEffect MapEffect => new MagicJuiceMapEffectDef(); public override Vector2 MapPosition => new Vector2(-3f, 1f); public override float MapRadius => 0.45f; public override EDrugType TargetDrugType => (EDrugType)0; public new void Register(Registry registry, ProductManager productManager) { base.Register(registry, productManager); Definition = base.ItemDefinition; } } public class MoonDustIngredient : CustomIngredient { public static PropertyItemDefinition Definition { get; private set; } public override string ID => "moondust"; public override string Name => "Moon Dust"; public override string IconFileName => "MoonDust.png"; public override CustomEffect MixEffect => new HeliumInfusionEffect(); public override CustomEffect MapEffect => new MoonGravityEffectDef(); public override Vector2 MapPosition => new Vector2(0f, 3.5f); public override float MapRadius => 0.45f; public override EDrugType TargetDrugType => (EDrugType)0; public new void Register(Registry registry, ProductManager productManager) { base.Register(registry, productManager); Definition = base.ItemDefinition; } } } namespace DomsExpandedIngredientsAndEffects.Helpers { public static class MelonLoggerExtensions { public static void Debug(this Instance logger, string message, bool stacktrace = true) { MelonDebug.Msg(stacktrace ? ("[" + GetCallerInfo() + "] " + message) : message); } private static string GetCallerInfo() { StackTrace stackTrace = new StackTrace(); for (int i = 2; i < stackTrace.FrameCount; i++) { StackFrame frame = stackTrace.GetFrame(i); MethodBase method = frame.GetMethod(); if (!(method?.DeclaringType == null)) { return method.DeclaringType.FullName + "." + method.Name; } } return "unknown"; } } public static class Il2CppListExtensions { public static IEnumerable AsEnumerable(this List list) { return list ?? Enumerable.Empty(); } public static object ToNativeList(this List source) { return source ?? new List(); } } public static class Utils { private static readonly Instance Logger = new Instance("DomsExpandedIngredientsAndEffects-Utils"); public static T? FindObjectByName(string objectName) where T : Object { try { T[] array = Resources.FindObjectsOfTypeAll(); foreach (T val in array) { if (!(((Object)val).name != objectName)) { Logger.Msg("Found " + typeof(T).Name + " '" + objectName + "' directly in loaded objects"); return val; } } return default(T); } catch (Exception ex) { Logger.Error("Error finding " + typeof(T).Name + " '" + objectName + "': " + ex.Message); return default(T); } } public static List GetAllComponentsInChildrenRecursive(GameObject obj) where T : Component { List list = new List(); if ((Object)(object)obj == (Object)null) { return list; } T[] components = obj.GetComponents(); if (components.Length != 0) { list.AddRange(components); } for (int i = 0; i < obj.transform.childCount; i++) { Transform child = obj.transform.GetChild(i); list.AddRange(GetAllComponentsInChildrenRecursive(((Component)child).gameObject)); } return list; } public static bool Is(object obj, out T? result) where T : class { if (obj is T val) { result = val; return true; } result = null; return false; } public static IEnumerator WaitForPlayer(IEnumerator routine) { while ((Object)(object)Player.Local == (Object)null || (Object)(object)((Component)Player.Local).gameObject == (Object)null) { yield return null; } MelonCoroutines.Start(routine); } public static IEnumerator WaitForNetwork(IEnumerator routine) { while (!InstanceFinder.IsServer && !InstanceFinder.IsClient) { yield return null; } MelonCoroutines.Start(routine); } public static IEnumerator WaitForCondition(Func condition, float timeout = float.NaN, Action? onTimeout = null, Action? onFinish = null) { float startTime = Time.time; while (!condition()) { if (!float.IsNaN(timeout) && Time.time - startTime > timeout) { onTimeout?.Invoke(); yield break; } yield return null; } onFinish?.Invoke(); } public static string GetHierarchyPath(this Transform transform) { if ((Object)(object)transform == (Object)null) { return "null"; } string text = ((Object)transform).name; Transform parent = transform.parent; while ((Object)(object)parent != (Object)null) { text = ((Object)parent).name + "/" + text; parent = parent.parent; } return text; } public static T GetOrAddComponent(this GameObject gameObject) where T : Component { T component = gameObject.GetComponent(); if ((Object)(object)component != (Object)null) { return component; } component = gameObject.AddComponent(); Logger.Msg("Added component " + typeof(T).Name + " to GameObject " + ((Object)gameObject).name); return component; } public static Material? DrawDebugVisuals(this GameObject gameObject, Color? color = null) { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) Renderer component = gameObject.GetComponent(); if ((Object)(object)component == (Object)null) { Logger.Error("GameObject " + ((Object)gameObject).name + " has no Renderer component"); return null; } Color valueOrDefault = color.GetValueOrDefault(); if (!color.HasValue) { ((Color)(ref valueOrDefault))..ctor(1f, 0f, 1f, 0.5f); color = valueOrDefault; } Shader val = Shader.Find("Universal Render Pipeline/Lit"); if ((Object)(object)val == (Object)null) { return null; } Material val2 = new Material(val); if (val2.HasProperty("_Surface")) { val2.SetFloat("_Surface", 1f); } Color value = color.Value; if (value.a <= 0f) { value.a = 0.2f; } if (val2.HasProperty("_BaseColor")) { val2.SetColor("_BaseColor", value); } if (val2.HasProperty("_EmissionColor")) { val2.EnableKeyword("_EMISSION"); val2.SetColor("_EmissionColor", new Color(value.r, value.g, value.b) * 1.5f); } val2.SetInt("_ZWrite", 0); val2.renderQueue = 3000; Material material = component.material; component.material = val2; return material; } } } namespace DomsExpandedIngredientsAndEffects.Patches { public class RegisteredCombination { public string ExistingEffectID { get; } public string IngredientEffectID { get; } public CustomEffect OutputEffect { get; } public Effect BuiltOutputEffect { get; } public RegisteredCombination(EffectCombination combo) { ExistingEffectID = combo.ExistingEffectID; IngredientEffectID = combo.IngredientEffectID; OutputEffect = combo.OutputEffect; BuiltOutputEffect = combo.OutputEffect.Build(); } } public static class CustomMixRegistry { private static List _combinations; private static List _outputEffects; private static List _multiCombinations; public static List Combinations => _combinations ?? (_combinations = new List()); public static List OutputEffects => _outputEffects ?? (_outputEffects = new List()); public static List MultiCombinations => _multiCombinations ?? (_multiCombinations = new List()); public static void Register(EffectCombination combo) { RegisteredCombination registeredCombination = new RegisteredCombination(combo); Combinations.Add(registeredCombination); OutputEffects.Add(registeredCombination.BuiltOutputEffect); } public static void Register(MultiEffectCombination combo) { MultiCombinations.Add(combo); OutputEffects.Add(combo.BuiltOutputEffect); } } public class MultiEffectCombination { public string[] RequiredEffectIDs { get; } public string IngredientEffectID { get; } public CustomEffect OutputEffect { get; } public Effect BuiltOutputEffect { get; } public MultiEffectCombination(string[] requiredEffectIDs, string ingredientEffectID, CustomEffect outputEffect) { RequiredEffectIDs = requiredEffectIDs; IngredientEffectID = ingredientEffectID; OutputEffect = outputEffect; BuiltOutputEffect = outputEffect.Build(); } } [HarmonyPatch] public class StabilityFix { [HarmonyPatch] public class UIErrorHandler { private static MethodBase TargetMethod() { return (AccessTools.TypeByName("ScheduleOne.UI.NewMixScreen") ?? AccessTools.TypeByName("Il2CppScheduleOne.UI.NewMixScreen"))?.GetMethods().FirstOrDefault((MethodInfo m) => m.Name == "Open" && m.GetParameters().Length >= 2); } [HarmonyFinalizer] public static Exception Finalizer(Exception __exception) { if (__exception != null) { MelonLogger.Error("[STABILITY] UI Crash: " + __exception.Message); } return null; } } [HarmonyPatch(typeof(MixOperation), "IsOutputKnown")] public class MixOperation_IsOutputKnown_Patch { [HarmonyPrefix] public static bool Prefix(MixOperation __instance, ref ProductDefinition knownProduct, ref bool __result) { try { if (string.IsNullOrEmpty(__instance.ProductID) || string.IsNullOrEmpty(__instance.IngredientID)) { return true; } ProductManager instance = NetworkSingleton.Instance; if ((Object)(object)instance == (Object)null) { return true; } StationRecipe recipe = instance.GetRecipe(__instance.ProductID, __instance.IngredientID); if ((Object)(object)recipe != (Object)null) { ItemDefinition obj = recipe.Product?.Item; ProductDefinition val = (ProductDefinition)(object)((obj is ProductDefinition) ? obj : null); if (val != null) { knownProduct = val; __result = true; return false; } } } catch (Exception ex) { MelonLogger.Error("[STABILITY] IsOutputKnown error: " + ex.Message); } return true; } } [HarmonyPatch(typeof(ProductManager), "GetRecipe", new Type[] { typeof(string), typeof(string) })] public class FixGetRecipePatch { [HarmonyPrefix] public static bool Prefix(ProductManager __instance, string product, string mixer, ref StationRecipe __result) { try { List mixRecipes = GetMixRecipes(__instance); if (mixRecipes == null) { return true; } foreach (StationRecipe item in mixRecipes) { if (item?.Ingredients != null && item.Ingredients.Count >= 2) { string text = ((BaseItemDefinition)(item.Ingredients[0].Items?[0]?)).ID; string text2 = ((BaseItemDefinition)(item.Ingredients[1].Items?[0]?)).ID; if ((text == product && text2 == mixer) || (text2 == product && text == mixer)) { __result = item; return false; } } } } catch { } return true; } } [HarmonyPatch(typeof(ProductManager), "GetRecipe", new Type[] { typeof(List), typeof(Effect) })] public class FixGetRecipeOverloadPatch { [HarmonyPrefix] public static bool Prefix(ProductManager __instance, List productProperties, Effect mixerProperty, ref StationRecipe __result) { try { if (productProperties == null || (Object)(object)mixerProperty == (Object)null) { return true; } List mixRecipes = GetMixRecipes(__instance); if (mixRecipes == null) { return true; } foreach (StationRecipe item in mixRecipes) { if (item?.Ingredients == null || item.Ingredients.Count < 2) { continue; } ItemDefinition obj = item.Ingredients[0].Items?[0]; PropertyItemDefinition val = (PropertyItemDefinition)(object)((obj is PropertyItemDefinition) ? obj : null); ItemDefinition obj2 = item.Ingredients[1].Items?[0]; PropertyItemDefinition val2 = (PropertyItemDefinition)(object)((obj2 is PropertyItemDefinition) ? obj2 : null); if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null) { continue; } List list = ((item.Ingredients[1].Items[0] is ProductDefinition) ? val2.Properties : val.Properties); List list2 = ((item.Ingredients[1].Items[0] is ProductDefinition) ? val.Properties : val2.Properties); if (list == null || list2 == null || list.Count != productProperties.Count || list2.Count != 1) { continue; } bool flag = true; foreach (Effect productProperty in productProperties) { if ((Object)(object)productProperty == (Object)null) { flag = false; break; } bool flag2 = false; foreach (Effect item2 in list) { if ((Object)(object)item2 != (Object)null && item2.ID == productProperty.ID) { flag2 = true; break; } } if (!flag2) { flag = false; break; } } if (!flag || !((Object)(object)list2[0] != (Object)null) || !(list2[0].ID == mixerProperty.ID)) { continue; } __result = item; return false; } } catch { } return true; } } [HarmonyPatch(typeof(ProductManager), "GetKnownProduct")] public class FixGetKnownProductPatch { [HarmonyPrefix] public static bool Prefix(ProductManager __instance, EDrugType type, List properties, ref ProductDefinition __result) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) try { if (properties == null) { return true; } for (int num = __instance.AllProducts.Count - 1; num >= 0; num--) { ProductDefinition val = __instance.AllProducts[num]; if (val?.DrugTypes != null && val.DrugTypes.Count != 0 && val.DrugTypes[0].DrugType == type && ((PropertyItemDefinition)val).Properties != null && ((PropertyItemDefinition)val).Properties.Count == properties.Count) { bool flag = true; foreach (Effect property in properties) { if ((Object)(object)property == (Object)null) { flag = false; break; } bool flag2 = false; foreach (Effect property2 in ((PropertyItemDefinition)val).Properties) { if ((Object)(object)property2 != (Object)null && property2.ID == property.ID) { flag2 = true; break; } } if (!flag2) { flag = false; break; } } if (flag) { __result = val; return false; } } } } catch (Exception ex) { MelonLogger.Error("[STABILITY] FixGetKnownProduct error: " + ex.Message); } return true; } } [HarmonyPatch(typeof(EffectMixCalculator), "MixProperties")] public class DoubleMixUpgradePatch { [HarmonyPrefix] public static bool Prefix(List __0, Effect __1, EDrugType __2, ref List __result) { try { List list = new List(); if (__0 != null) { foreach (Effect item in __0) { if ((Object)(object)item != (Object)null) { list.Add(item); } } } if ((Object)(object)__1 == (Object)null) { WriteBack(list, ref __result); return false; } string heliumID = "heliuminfusion"; string moonGravityID = "moongravity"; bool flag = false; foreach (RegisteredCombination combo2 in CustomMixRegistry.Combinations) { Effect val = EffectListFind(list, (Effect e) => e?.ID == combo2.ExistingEffectID); if ((Object)(object)val != (Object)null && __1.ID == combo2.IngredientEffectID) { int index = list.IndexOf(val); list[index] = combo2.BuiltOutputEffect; EffectListRemoveAll(list, (Effect e) => e?.ID == combo2.IngredientEffectID && (Object)(object)e != (Object)(object)combo2.BuiltOutputEffect); flag = true; break; } if (!(combo2.ExistingEffectID != combo2.IngredientEffectID)) { continue; } Effect val2 = EffectListFind(list, (Effect e) => e?.ID == combo2.IngredientEffectID); if ((Object)(object)val2 != (Object)null && __1.ID == combo2.ExistingEffectID) { int index2 = list.IndexOf(val2); list[index2] = combo2.BuiltOutputEffect; EffectListRemoveAll(list, (Effect e) => e?.ID == combo2.ExistingEffectID && (Object)(object)e != (Object)(object)combo2.BuiltOutputEffect); flag = true; break; } } if (!flag) { foreach (MultiEffectCombination combo in CustomMixRegistry.MultiCombinations) { bool flag2 = true; string[] requiredEffectIDs = combo.RequiredEffectIDs; foreach (string id2 in requiredEffectIDs) { if (!EffectListAny(list, (Effect e) => e?.ID == id2)) { flag2 = false; break; } } bool flag3 = __1.ID == combo.IngredientEffectID; bool flag4 = EffectListAny(list, (Effect e) => e?.ID == combo.IngredientEffectID); if (!flag2 || !(flag3 || flag4)) { continue; } string[] requiredEffectIDs2 = combo.RequiredEffectIDs; foreach (string id in requiredEffectIDs2) { EffectListRemoveAll(list, (Effect e) => e?.ID == id); } EffectListRemoveAll(list, (Effect e) => e?.ID == combo.IngredientEffectID); list.Add(combo.BuiltOutputEffect); flag = true; break; } } if (flag) { RunChainCheck(list); WriteBack(list, ref __result); return false; } if ((__1.ID == moonGravityID || __1.ID == heliumID) && EffectListAny(list, (Effect e) => (Object)(object)e != (Object)null && e.ID == heliumID)) { ProductManager instance = NetworkSingleton.Instance; Effect val3 = null; if (instance?.WeedMixMap?.Effects != null) { foreach (MixerMapEffect effect in instance.WeedMixMap.Effects) { if (effect?.Property?.ID == moonGravityID) { val3 = effect.Property; break; } } } if ((Object)(object)val3 == (Object)null && Singleton.Instance?.AllProperties != null) { foreach (Effect allProperty in Singleton.Instance.AllProperties) { if (allProperty?.ID == moonGravityID) { val3 = allProperty; break; } } } if ((Object)(object)val3 != (Object)null) { EffectListRemoveAll(list, (Effect e) => (Object)(object)e != (Object)null && (e.ID == heliumID || e.ID == __1.ID)); list.Add(val3); int num = EffectListCount(list, (Effect e) => (Object)(object)e != (Object)null && e.ID == moonGravityID); if (num >= 2) { foreach (RegisteredCombination combination in CustomMixRegistry.Combinations) { if (combination.ExistingEffectID == moonGravityID && combination.IngredientEffectID == moonGravityID) { EffectListRemoveAll(list, (Effect e) => (Object)(object)e != (Object)null && e.ID == moonGravityID); list.Add(combination.BuiltOutputEffect); break; } } } RunChainCheck(list); WriteBack(list, ref __result); return false; } } return true; } catch (Exception ex) { MelonLogger.Error("[STABILITY] DoubleMixUpgrade error: " + ex.Message); return true; } } [HarmonyPostfix] public static void Postfix(List __0, Effect __1, EDrugType __2, ref List __result) { try { if (__result == null) { return; } List list = new List(); foreach (Effect item in __result) { if ((Object)(object)item != (Object)null) { list.Add(item); } } RunChainCheck(list); WriteBack(list, ref __result); } catch (Exception ex) { MelonLogger.Error("[STABILITY] MixProperties Postfix error: " + ex.Message); } } private static void WriteBack(List r, ref List __result) { __result = r; } private static void RunChainCheck(List result) { bool flag = true; while (flag) { flag = false; foreach (RegisteredCombination combo in CustomMixRegistry.Combinations) { Effect val = EffectListFind(result, (Effect e) => e?.ID == combo.ExistingEffectID); Effect val2 = EffectListFind(result, (Effect e) => e?.ID == combo.IngredientEffectID); if ((Object)(object)val != (Object)null && (Object)(object)val2 != (Object)null && (Object)(object)val != (Object)(object)val2) { int index = result.IndexOf(val); result[index] = combo.BuiltOutputEffect; result.Remove(val2); flag = true; break; } } if (flag) { continue; } foreach (MultiEffectCombination combo2 in CustomMixRegistry.MultiCombinations) { bool flag2 = true; string[] requiredEffectIDs = combo2.RequiredEffectIDs; foreach (string id2 in requiredEffectIDs) { if (!EffectListAny(result, (Effect e) => e?.ID == id2)) { flag2 = false; break; } } Effect val3 = EffectListFind(result, (Effect e) => e?.ID == combo2.IngredientEffectID); if (!flag2 || !((Object)(object)val3 != (Object)null)) { continue; } string[] requiredEffectIDs2 = combo2.RequiredEffectIDs; foreach (string id in requiredEffectIDs2) { EffectListRemoveAll(result, (Effect e) => e?.ID == id); } result.Remove(val3); result.Add(combo2.BuiltOutputEffect); flag = true; break; } } } } [HarmonyPatch(typeof(PropertyUtility), "GetProperties", new Type[] { typeof(List) })] public class FixPropertyUtilityGetProperties { [HarmonyPostfix] public static void Postfix(List __0, ref List __result) { if (__0 == null || __result == null) { return; } List list = __result; if (list.Count == __0.Count) { return; } ProductManager instance = NetworkSingleton.Instance; if ((Object)(object)instance == (Object)null) { return; } foreach (string id in __0) { if (!EffectListAny(list, (Effect e) => (Object)(object)e != (Object)null && e.ID == id)) { Effect val = FindEffectInMixMaps(instance, id) ?? FindEffectInIngredients(instance, id) ?? OutputEffectsFirstOrDefault(id); if ((Object)(object)val != (Object)null) { list.Add(val); } else { MelonLogger.Warning("[STABILITY] Could not recover effect ID: " + id); } } } __result = list; } private static Effect FindEffectInMixMaps(ProductManager pm, string id) { MixerMap[] array = (MixerMap[])(object)new MixerMap[4] { pm.WeedMixMap, pm.MethMixMap, pm.CokeMixMap, pm.ShroomMixMap }; MixerMap[] array2 = array; foreach (MixerMap val in array2) { if (val?.Effects == null) { continue; } foreach (MixerMapEffect effect in val.Effects) { if (effect?.Property?.ID == id) { return effect.Property; } } } return null; } private static Effect FindEffectInIngredients(ProductManager pm, string id) { if (pm.ValidMixIngredients == null) { return null; } foreach (PropertyItemDefinition validMixIngredient in pm.ValidMixIngredients) { if (validMixIngredient?.Properties == null) { continue; } foreach (Effect property in validMixIngredient.Properties) { if (property?.ID == id) { return property; } } } return null; } } [HarmonyPatch(typeof(Contract), "SubmitPayment")] public class ProfitBoostPatch { [HarmonyPrefix] public static void Prefix(Contract __instance, ref float bonusTotal) { if (ProfitBoostEffect.IsActive) { float num = __instance.Payment * 0.15f; bonusTotal += num; } } } [HarmonyPatch(typeof(DealCompletionPopup), "PlayPopup")] public class ProfitBoostPopupPatch { [HarmonyPrefix] public static void Prefix(float basePayment, ref List bonuses) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown if (ProfitBoostEffect.IsActive) { float num = basePayment * 0.15f; bonuses = new List(bonuses); bonuses.Add(new BonusPayment("Magic Juice +15%", num)); } } } private static readonly BindingFlags _private = BindingFlags.Instance | BindingFlags.NonPublic; private static bool _isProcessing = false; private static bool _mixNamedFired = false; private static bool _mixNamedRunning = false; private static string _mixRecipesFieldName = null; private static bool EffectListAny(IEnumerable list, Func pred) { if (list == null) { return false; } foreach (Effect item in list) { if (pred(item)) { return true; } } return false; } private static Effect EffectListFind(IEnumerable list, Func pred) { if (list == null) { return null; } foreach (Effect item in list) { if (pred(item)) { return item; } } return null; } private static int EffectListCount(IEnumerable list, Func pred) { int num = 0; if (list == null) { return num; } foreach (Effect item in list) { if (pred(item)) { num++; } } return num; } private static void EffectListRemoveAll(List list, Func pred) { if (list == null) { return; } for (int num = list.Count - 1; num >= 0; num--) { if (pred(list[num])) { list.RemoveAt(num); } } } private static Effect OutputEffectsFirstOrDefault(string id) { foreach (Effect outputEffect in CustomMixRegistry.OutputEffects) { if (outputEffect?.ID == id) { return outputEffect; } } return null; } private static List GetMixRecipes(ProductManager pm) { if (_mixRecipesFieldName != null) { FieldInfo field = typeof(ProductManager).GetField(_mixRecipesFieldName, BindingFlags.Instance | BindingFlags.NonPublic); if (field != null && field.GetValue(pm) is List result) { return result; } } FieldInfo fieldInfo = AccessTools.Field(typeof(ProductManager), "mixRecipes"); if (fieldInfo != null && fieldInfo.GetValue(pm) is List result2) { _mixRecipesFieldName = "mixRecipes"; return result2; } FieldInfo[] fields = typeof(ProductManager).GetFields(BindingFlags.Instance | BindingFlags.NonPublic); foreach (FieldInfo fieldInfo2 in fields) { if (fieldInfo2.FieldType == typeof(List) && fieldInfo2.GetValue(pm) is List result3) { _mixRecipesFieldName = fieldInfo2.Name; MelonLogger.Msg("[STABILITY] Found mixRecipes field: " + fieldInfo2.Name); return result3; } } MelonLogger.Warning("[STABILITY] Could not find mixRecipes field."); return null; } [HarmonyPatch(typeof(MixingStationCanvas), "MixingDone")] [HarmonyPrefix] public static bool MixingDonePrefix() { if (_isProcessing) { return false; } _isProcessing = true; MelonCoroutines.Start(ReleaseLock()); return true; } [HarmonyPatch(typeof(MixingStationCanvas), "MixingDone")] [HarmonyFinalizer] public static Exception MixingDoneFinalizer(Exception __exception) { if (__exception != null) { MelonLogger.Error("[STABILITY] MixingDone crash: " + __exception.Message + "\n" + __exception.StackTrace); } return null; } private static IEnumerator ReleaseLock() { yield return (object)new WaitForSeconds(1.5f); _isProcessing = false; } [HarmonyPatch(typeof(MixingStationCanvas), "Open")] [HarmonyPostfix] public static void OpenPostfix() { _mixNamedFired = false; _mixNamedRunning = false; } [HarmonyPatch(typeof(MixingStationCanvas), "MixNamed")] [HarmonyPrefix] public static bool MixNamedPrefix(MixingStationCanvas __instance, string mixName) { if (_mixNamedRunning) { return false; } _mixNamedRunning = true; NewMixScreen instance = Singleton.Instance; if ((Object)(object)instance != (Object)null) { typeof(NewMixScreen).GetField("onMixNamed", BindingFlags.Instance | BindingFlags.Public)?.SetValue(instance, null); } MelonCoroutines.Start(MixNamedDelayed(__instance, mixName)); return false; } private static IEnumerator MixNamedDelayed(MixingStationCanvas canvas, string mixName) { if ((Object)(object)canvas.MixingStation == (Object)null || canvas.MixingStation.CurrentMixOperation == null) { _mixNamedRunning = false; yield break; } string productID = canvas.MixingStation.CurrentMixOperation.ProductID; string ingredientID = canvas.MixingStation.CurrentMixOperation.IngredientID; int quantity = canvas.MixingStation.CurrentMixOperation.Quantity; EQuality quality = canvas.MixingStation.CurrentMixOperation.ProductQuality; NetworkSingleton.Instance.FinishAndNameMix(productID, ingredientID, mixName); yield return null; yield return null; ProductDefinition knownProduct = default(ProductDefinition); if (canvas.MixingStation.CurrentMixOperation != null && canvas.MixingStation.CurrentMixOperation.IsOutputKnown(ref knownProduct)) { canvas.MixingStation.TryCreateOutputItems(); } else { try { ProductDefinition baseProduct = Registry.GetItem(productID); PropertyItemDefinition ingredient = Registry.GetItem(ingredientID); if ((Object)(object)baseProduct == (Object)null || (Object)(object)ingredient == (Object)null || ingredient.Properties.Count == 0) { _mixNamedRunning = false; yield break; } List outputProperties = EffectMixCalculator.MixProperties(((PropertyItemDefinition)baseProduct).Properties, ingredient.Properties[0], baseProduct.DrugType); ProductDefinition outputProduct = Object.Instantiate(baseProduct); ((Object)outputProduct).name = mixName; ((BaseItemDefinition)outputProduct).Name = mixName; ((PropertyItemDefinition)outputProduct).Initialize(outputProperties); outputProduct.GenerateAppearanceSettings(); ((BaseItemDefinition)outputProduct).ID = ProductManager.MakeIDFileSafe(mixName); if (!Registry.ItemExists(((BaseItemDefinition)outputProduct).ID)) { Singleton.Instance.AddToRegistry((ItemDefinition)(object)outputProduct); } ProductManager pm = NetworkSingleton.Instance; if ((Object)(object)pm != (Object)null) { if (!pm.AllProducts.Contains(outputProduct)) { pm.AllProducts.Add(outputProduct); } if (!ProductManager.DiscoveredProducts.Contains(outputProduct)) { ProductManager.DiscoveredProducts.Add(outputProduct); } if (!pm.ProductNames.Contains(mixName)) { pm.ProductNames.Add(mixName); } pm.SetPrice((NetworkConnection)null, ((BaseItemDefinition)outputProduct).ID, outputProduct.MarketValue); pm.CreateMixRecipe((NetworkConnection)null, ((BaseItemDefinition)baseProduct).ID, ((BaseItemDefinition)ingredient).ID, ((BaseItemDefinition)outputProduct).ID); } ItemInstance defaultInstance = ((ItemDefinition)outputProduct).GetDefaultInstance(quantity); QualityItemInstance outputInstance = (QualityItemInstance)(object)((defaultInstance is QualityItemInstance) ? defaultInstance : null); outputInstance.SetQuality(quality); canvas.MixingStation.OutputSlot.AddItem((ItemInstance)(object)outputInstance, false); canvas.MixingStation.SetMixOperation((NetworkConnection)null, (MixOperation)null, 0); } catch (Exception ex2) { Exception ex = ex2; MelonLogger.Error("[STABILITY] Manual output failed: " + ex.Message); _mixNamedRunning = false; yield break; } } float elapsed = 0f; while (canvas.MixingStation.OutputSlot.Quantity == 0) { elapsed += Time.deltaTime; if (elapsed >= 3f) { break; } yield return null; } ((Component)canvas.MixingStation.DiscoveryBox).gameObject.SetActive(false); ((Behaviour)canvas.Canvas).enabled = true; ((Component)canvas.Container).gameObject.SetActive(true); _mixNamedFired = true; Type type = typeof(MixingStationCanvas); type.GetMethod("UpdateDisplayMode", _private)?.Invoke(canvas, null); type.GetMethod("UpdateInstruction", _private)?.Invoke(canvas, null); type.GetMethod("UpdatePreview", _private)?.Invoke(canvas, null); type.GetMethod("UpdateBeginButton", _private)?.Invoke(canvas, null); _mixNamedRunning = false; } [HarmonyPatch(typeof(MixingStationCanvas), "UpdateDisplayMode")] [HarmonyPostfix] public static void UpdateDisplayModePostfix(MixingStationCanvas __instance) { if (!_mixNamedFired) { return; } try { if (!((Component)__instance.TitleContainer).gameObject.activeSelf && !((Component)__instance.MainContainer).gameObject.activeSelf && !((Component)__instance.OutputSlotUI).gameObject.activeSelf) { ((Component)__instance.TitleContainer).gameObject.SetActive(true); ((Component)__instance.MainContainer).gameObject.SetActive(true); _mixNamedFired = false; } } catch { } } } } namespace DomsExpandedIngredientsAndEffects.Framework { public abstract class CustomEffect { public abstract string ID { get; } public abstract string Name { get; } public abstract Color Color { get; } public virtual Vector2 MixDirection => Vector2.up; public virtual float MixMagnitude => 0.45f; public virtual float Addictiveness => 0.1f; public virtual int ValueChange => 0; public virtual float ValueMultiplier => 1f; public abstract Effect CreateInstance(); public Effect Build() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) Effect val = CreateInstance(); ((Object)val).name = ID; val.Name = Name; val.ID = ID; val.ProductColor = Color; val.LabelColor = Color; val.MixDirection = MixDirection; val.MixMagnitude = MixMagnitude; val.Addictiveness = Addictiveness; val.ValueChange = ValueChange; val.ValueMultiplier = ValueMultiplier; return val; } protected static Effect CreateEffectInstance(Type type) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown return (Effect)ScriptableObject.CreateInstance(type.Name); } } public abstract class CustomIngredient { public abstract string ID { get; } public abstract string Name { get; } public abstract string IconFileName { get; } public abstract CustomEffect MixEffect { get; } public abstract CustomEffect MapEffect { get; } public abstract Vector2 MapPosition { get; } public abstract float MapRadius { get; } public abstract EDrugType TargetDrugType { get; } public PropertyItemDefinition ItemDefinition { get; private set; } public void Register(Registry registry, ProductManager productManager) { //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Expected O, but got Unknown try { Effect item = MixEffect.Build(); Effect property = MapEffect.Build(); PropertyItemDefinition item2 = Registry.GetItem("iodine"); if ((Object)(object)item2 == (Object)null) { MelonLogger.Error("[" + Name + "] Could not find iodine template."); return; } ItemDefinition = Object.Instantiate(item2); ((Object)ItemDefinition).name = ID; ((BaseItemDefinition)ItemDefinition).Name = Name; ((BaseItemDefinition)ItemDefinition).ID = ID; ItemDefinition.Properties = new List { item }; if (IconFileName != null) { ((BaseItemDefinition)ItemDefinition).Icon = DomsCustomEffects.LoadCustomIcon(IconFileName); } registry.AddToRegistry((ItemDefinition)(object)ItemDefinition); productManager.ValidMixIngredients.Add(ItemDefinition); MixerMap mixerMap = productManager.GetMixerMap(TargetDrugType); if ((Object)(object)mixerMap != (Object)null) { mixerMap.Effects.Add(new MixerMapEffect { Property = property, Position = MapPosition, Radius = MapRadius }); } else { MelonLogger.Warning($"[{Name}] MixerMap not found for {TargetDrugType}."); } } catch (Exception ex) { MelonLogger.Error("[" + Name + "] Registration failed: " + ex.Message + "\n" + ex.StackTrace); } } } public class EffectCombination { public string ExistingEffectID { get; } public string IngredientEffectID { get; } public CustomEffect OutputEffect { get; } public float OutputRadius { get; } public EffectCombination(string existingEffectID, string ingredientEffectID, CustomEffect outputEffect, float outputRadius = 0.45f) { ExistingEffectID = existingEffectID; IngredientEffectID = ingredientEffectID; OutputEffect = outputEffect; OutputRadius = outputRadius; } } } namespace DomsExpandedIngredientsAndEffects.Effects { public class AirhornBaseEffect : Effect { private static AudioClip _airhornClip; public override void ApplyToPlayer(Player player) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { PlayAirhorn(((Component)player).transform.position); } } public override void ClearFromPlayer(Player player) { } public override void ApplyToNPC(NPC npc) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)npc == (Object)null)) { PlayAirhorn(((Component)npc).transform.position); } } public override void ClearFromNPC(NPC npc) { } private static void PlayAirhorn(Vector3 position) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_airhornClip == (Object)null) { _airhornClip = DomsCustomEffects.LoadCustomSound("Airhorn.wav"); } if ((Object)(object)_airhornClip == (Object)null) { MelonLogger.Warning("[Airhorn] Airhorn.wav not found in Sounds folder."); } else { AudioSource.PlayClipAtPoint(_airhornClip, position, SoundHelper.SFXVolume); } } } internal static class AirhornVisuals { internal static IEnumerator ThunderFlash() { GameObject go = FertilizerVisuals.CreateScreenOverlay(new Color(0.75f, 0.9f, 1f, 0f)); Image img = go.GetComponentInChildren(); for (float t2 = 0f; t2 < 0.08f; t2 += Time.deltaTime) { if ((Object)(object)img != (Object)null) { ((Graphic)img).color = new Color(0.75f, 0.9f, 1f, Mathf.Clamp01(t2 / 0.08f)); } yield return null; } if ((Object)(object)img != (Object)null) { ((Graphic)img).color = new Color(0.75f, 0.9f, 1f, 1f); } yield return (object)new WaitForSeconds(0.05f); for (float t = 0f; t < 0.45f; t += Time.deltaTime) { if ((Object)(object)img != (Object)null) { ((Graphic)img).color = new Color(0.75f, 0.9f, 1f, Mathf.Clamp01(1f - t / 0.45f)); } yield return null; } if ((Object)(object)go != (Object)null) { Object.Destroy((Object)(object)go); } } } public class ThunderclapEffect : Effect { private static readonly Dictionary _overlays = new Dictionary(); public override void ApplyToPlayer(Player player) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_overlays.ContainsKey(instanceID)) { return; } try { MelonCoroutines.Start(AirhornVisuals.ThunderFlash()); _overlays[instanceID] = FertilizerVisuals.CreateScreenOverlay(new Color(0.1f, 0.25f, 0.85f, 0.08f)); } catch (Exception ex) { MelonLogger.Error("[Thunderclap] Apply failed: " + ex.Message); } } public override void ClearFromPlayer(Player player) { if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_overlays.TryGetValue(instanceID, out var value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } _overlays.Remove(instanceID); } } public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } } public class WhiteNoiseEffect : Effect { private static readonly Dictionary _overlays = new Dictionary(); private static readonly Dictionary _npcSpeeds = new Dictionary(); public override void ApplyToPlayer(Player player) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_overlays.ContainsKey(instanceID)) { return; } try { _overlays[instanceID] = FertilizerVisuals.CreateScreenOverlay(new Color(0.55f, 0.55f, 0.55f, 0.32f)); } catch (Exception ex) { MelonLogger.Error("[WhiteNoise] Apply failed: " + ex.Message); } } public override void ClearFromPlayer(Player player) { if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_overlays.TryGetValue(instanceID, out var value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } _overlays.Remove(instanceID); } } public override void ApplyToNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } int instanceID = ((Object)((Component)npc).transform).GetInstanceID(); try { NavMeshAgent component = ((Component)npc).GetComponent(); if ((Object)(object)component != (Object)null) { _npcSpeeds[instanceID] = component.speed; component.speed *= 0.45f; } } catch (Exception ex) { MelonLogger.Error("[WhiteNoise] NPC slow failed: " + ex.Message); } } public override void ClearFromNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } int instanceID = ((Object)((Component)npc).transform).GetInstanceID(); try { NavMeshAgent component = ((Component)npc).GetComponent(); if ((Object)(object)component != (Object)null && _npcSpeeds.TryGetValue(instanceID, out var value)) { component.speed = value; _npcSpeeds.Remove(instanceID); } } catch (Exception ex) { MelonLogger.Error("[WhiteNoise] NPC restore failed: " + ex.Message); } } } public class AirhornMapEffect : Effect { public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } public override void ApplyToPlayer(Player player) { } public override void ClearFromPlayer(Player player) { } } public class AlienEffect : Effect { private const string STACK_KEY = "alien"; private static readonly Color AlienGreen = new Color(0.4f, 0.55f, 0.3f); public override void ApplyToPlayer(Player player) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null || !((NetworkBehaviour)player).IsOwner) { return; } Avatar avatar = player.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.AddOverride(AlienGreen, 7, "alien"); } } } public override void ClearFromPlayer(Player player) { if ((Object)(object)player == (Object)null || !((NetworkBehaviour)player).IsOwner) { return; } Avatar avatar = player.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.RemoveOverride("alien"); } } } public override void ApplyToNPC(NPC npc) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)npc == (Object)null) { return; } Avatar avatar = npc.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.AddOverride(AlienGreen, 7, "alien"); } } } public override void ClearFromNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } Avatar avatar = npc.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.RemoveOverride("alien"); } } } } public class BunnyEffect : Effect { private const string STACK_KEY = "bunny"; public override void ApplyToPlayer(Player player) { if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { PlayerMovement.JumpMultiplier = 2f; PlayerMovement.GravityMultiplier = 1f; } } public override void ClearFromPlayer(Player player) { if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { PlayerMovement.JumpMultiplier = 1f; PlayerMovement.GravityMultiplier = 1f; } } public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } } public class ChargedEffect : Effect { private const string STACK_KEY = "charged"; private static readonly Color ElectricYellow = new Color(1f, 0.95f, 0.1f); public override void ApplyToPlayer(Player player) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { AvatarEffects val = player.Avatar?.Effects; if (!((Object)(object)val == (Object)null)) { PlayerMovement.StaticMoveSpeedMultiplier = 1.3f; val.OverrideEyeColor(ElectricYellow, 0.6f, true); val.SetGlowingOn(new Color(0.5f, 0.5f, 0f), true); val.SetZapped(true, true); } } } public override void ClearFromPlayer(Player player) { if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { AvatarEffects val = player.Avatar?.Effects; if (!((Object)(object)val == (Object)null)) { PlayerMovement.StaticMoveSpeedMultiplier = 1f; val.ResetEyeColor(true); val.SetGlowingOff(true); val.SetZapped(false, true); } } } public override void ApplyToNPC(NPC npc) { //IL_0064: 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 ((Object)(object)npc == (Object)null) { return; } AvatarEffects val = npc.Avatar?.Effects; if (!((Object)(object)val == (Object)null)) { if ((Object)(object)npc.Movement?.SpeedController != (Object)null) { npc.Movement.SpeedController.SpeedMultiplier = 1.3f; } val.OverrideEyeColor(ElectricYellow, 0.6f, true); val.SetGlowingOn(new Color(0.5f, 0.5f, 0f), true); val.SetZapped(true, true); } } public override void ClearFromNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } AvatarEffects val = npc.Avatar?.Effects; if (!((Object)(object)val == (Object)null)) { if ((Object)(object)npc.Movement?.SpeedController != (Object)null) { npc.Movement.SpeedController.SpeedMultiplier = 1f; } val.ResetEyeColor(true); val.SetGlowingOff(true); val.SetZapped(false, true); } } } public class CreepyEffect : Effect { private static AudioClip _creepyClip; private static bool _playerPlaying; public override void ApplyToPlayer(Player player) { if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner && !_playerPlaying) { _playerPlaying = true; MelonCoroutines.Start(PlayCreepyLoop(((Component)player).transform, isPlayer: true)); } } public override void ClearFromPlayer(Player player) { _playerPlaying = false; } public override void ApplyToNPC(NPC npc) { if (!((Object)(object)npc == (Object)null)) { MelonCoroutines.Start(PlayCreepyLoop(((Component)npc).transform, isPlayer: false)); } } public override void ClearFromNPC(NPC npc) { } private static IEnumerator PlayCreepyLoop(Transform target, bool isPlayer) { if ((Object)(object)_creepyClip == (Object)null) { _creepyClip = DomsCustomEffects.LoadCustomSound("Creepy.wav"); } if ((Object)(object)_creepyClip == (Object)null) { MelonLogger.Warning("[Creepy] Creepy.wav not found."); } else { AudioSource.PlayClipAtPoint(_creepyClip, target.position, SoundHelper.MusicVolume); } yield break; } } internal static class CrossEffectVisuals { internal static GameObject SpawnPinkFire(Transform root) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013d: 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_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Expected O, but got Unknown //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: 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_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: 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_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Expected O, but got Unknown //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("CrossFX_PinkFire"); val.transform.SetParent(root); val.transform.localPosition = new Vector3(0f, 0.1f, 0f); val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("PinkFire_Particles"); val2.transform.SetParent(val.transform); val2.transform.localPosition = Vector3.zero; val2.transform.localRotation = Quaternion.Euler(-90f, 0f, 0f); ParticleSystem val3 = val2.AddComponent(); MainModule main = val3.main; ((MainModule)(ref main)).duration = 999f; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(1.2f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0.5f); ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(0.03f); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(1f, 0.2f, 0.6f)); ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(-0.12f); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; EmissionModule emission = val3.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(160f); ShapeModule shape = val3.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)4; ((ShapeModule)(ref shape)).angle = 35f; ((ShapeModule)(ref shape)).radius = 0.35f; ColorOverLifetimeModule colorOverLifetime = val3.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val4 = new Gradient(); val4.SetKeys((GradientColorKey[])(object)new GradientColorKey[3] { new GradientColorKey(new Color(1f, 0.8f, 0.9f), 0f), new GradientColorKey(new Color(1f, 0.2f, 0.6f), 0.4f), new GradientColorKey(new Color(0.6f, 0.05f, 0.3f), 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(0.8f, 0.5f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val4); GameObject val5 = new GameObject("PinkFire_Light"); val5.transform.SetParent(val.transform); val5.transform.localPosition = new Vector3(0f, 1f, 0f); Light val6 = val5.AddComponent(); val6.type = (LightType)2; val6.color = new Color(1f, 0.3f, 0.6f); val6.intensity = 2.5f; val6.range = 3.5f; FertilizerVisuals.SetMaterial(val2); val3.Play(); return val; } internal static IEnumerator DustFlash() { GameObject go = FertilizerVisuals.CreateScreenOverlay(new Color(0.45f, 0.28f, 0.08f, 0f)); Image img = go.GetComponentInChildren(); for (float t2 = 0f; t2 < 0.15f; t2 += Time.deltaTime) { if ((Object)(object)img != (Object)null) { ((Graphic)img).color = new Color(0.45f, 0.28f, 0.08f, Mathf.Clamp01(t2 / 0.15f) * 0.6f); } yield return null; } yield return (object)new WaitForSeconds(0.2f); for (float t = 0f; t < 0.5f; t += Time.deltaTime) { if ((Object)(object)img != (Object)null) { ((Graphic)img).color = new Color(0.45f, 0.28f, 0.08f, Mathf.Clamp01(1f - t / 0.5f) * 0.6f); } yield return null; } if ((Object)(object)go != (Object)null) { Object.Destroy((Object)(object)go); } } } public class WildflowerEffect : Effect { private static readonly Dictionary _petals = new Dictionary(); private static readonly Dictionary _overlays = new Dictionary(); public override void ApplyToPlayer(Player player) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_petals.ContainsKey(instanceID)) { return; } try { _petals[instanceID] = FertilizerVisuals.SpawnPetals(((Component)player).transform); _overlays[instanceID] = FertilizerVisuals.CreateScreenOverlay(new Color(0.55f, 0.85f, 0.2f, 0.09f)); } catch (Exception ex) { MelonLogger.Error("[Wildflower] Apply failed: " + ex.Message); } } public override void ClearFromPlayer(Player player) { if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_petals.TryGetValue(instanceID, out var value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } _petals.Remove(instanceID); } if (_overlays.TryGetValue(instanceID, out var value2)) { if ((Object)(object)value2 != (Object)null) { Object.Destroy((Object)(object)value2); } _overlays.Remove(instanceID); } } public override void ApplyToNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } int instanceID = ((Object)((Component)npc).transform).GetInstanceID(); if (_petals.ContainsKey(instanceID)) { return; } try { _petals[instanceID] = FertilizerVisuals.SpawnPetals(((Component)npc).transform); } catch (Exception ex) { MelonLogger.Error("[Wildflower] NPC apply failed: " + ex.Message); } } public override void ClearFromNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } int instanceID = ((Object)((Component)npc).transform).GetInstanceID(); if (_petals.TryGetValue(instanceID, out var value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } _petals.Remove(instanceID); } } } public class BurningPassionEffect : Effect { private static readonly Dictionary _fire = new Dictionary(); private static readonly Dictionary _overlays = new Dictionary(); public override void ApplyToPlayer(Player player) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_fire.ContainsKey(instanceID)) { return; } try { _fire[instanceID] = CrossEffectVisuals.SpawnPinkFire(((Component)player).transform); _overlays[instanceID] = FertilizerVisuals.CreateScreenOverlay(new Color(1f, 0.15f, 0.45f, 0.09f)); } catch (Exception ex) { MelonLogger.Error("[BurningPassion] Apply failed: " + ex.Message); } } public override void ClearFromPlayer(Player player) { if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_fire.TryGetValue(instanceID, out var value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } _fire.Remove(instanceID); } if (_overlays.TryGetValue(instanceID, out var value2)) { if ((Object)(object)value2 != (Object)null) { Object.Destroy((Object)(object)value2); } _overlays.Remove(instanceID); } } public override void ApplyToNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } int instanceID = ((Object)((Component)npc).transform).GetInstanceID(); if (_fire.ContainsKey(instanceID)) { return; } try { _fire[instanceID] = CrossEffectVisuals.SpawnPinkFire(((Component)npc).transform); } catch (Exception ex) { MelonLogger.Error("[BurningPassion] NPC apply failed: " + ex.Message); } } public override void ClearFromNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } int instanceID = ((Object)((Component)npc).transform).GetInstanceID(); if (_fire.TryGetValue(instanceID, out var value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } _fire.Remove(instanceID); } } } public class UpheavalEffect : Effect { private static readonly Dictionary _overlays = new Dictionary(); public override void ApplyToPlayer(Player player) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_overlays.ContainsKey(instanceID)) { return; } try { MelonCoroutines.Start(CrossEffectVisuals.DustFlash()); _overlays[instanceID] = FertilizerVisuals.CreateScreenOverlay(new Color(0.4f, 0.25f, 0.07f, 0.12f)); } catch (Exception ex) { MelonLogger.Error("[Upheaval] Apply failed: " + ex.Message); } } public override void ClearFromPlayer(Player player) { if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_overlays.TryGetValue(instanceID, out var value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } _overlays.Remove(instanceID); } } public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } } public class DivaEffect : VoluptuousEffect { private const string DIVA_KEY = "diva"; private static readonly Color DivaEye = new Color(1f, 1f, 1f); private static readonly Color PlatBlonde = new Color(1f, 0.97f, 0.85f); protected override Color EyeGlamColor => DivaEye; protected override Color GlowColor => new Color(0.3f, 0.3f, 0.3f); protected override Color LipColor => Color.white; protected override void ApplyVisuals(Avatar avatar, AvatarEffects fx, bool isPlayer) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) base.ApplyVisuals(avatar, fx, isPlayer); if (fx != null) { fx.OverrideHairColor(PlatBlonde, true); } if (fx != null) { fx.OverrideEyeColor(DivaEye, 0.5f, true); } if (isPlayer) { PlayerMovement.StaticMoveSpeedMultiplier = 1.25f; } else if ((Object)(object)avatar != (Object)null) { NPC componentInParent = ((Component)avatar).GetComponentInParent(); if ((Object)(object)componentInParent?.Movement?.SpeedController != (Object)null) { componentInParent.Movement.SpeedController.SpeedMultiplier = 1.25f; } } } public override void ClearFromPlayer(Player player) { base.ClearFromPlayer(player); if (player != null) { Avatar avatar = player.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.ResetHairColor(true); } } } PlayerMovement.StaticMoveSpeedMultiplier = 1f; } public override void ClearFromNPC(NPC npc) { base.ClearFromNPC(npc); if (npc != null) { Avatar avatar = npc.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.ResetHairColor(true); } } } if ((Object)(object)npc?.Movement?.SpeedController != (Object)null) { npc.Movement.SpeedController.SpeedMultiplier = 1f; } } } public class EarthyEffect : Effect { public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } public override void ApplyToPlayer(Player player) { } public override void ClearFromPlayer(Player player) { } } public class FertilizerMapEffect : Effect { public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } public override void ApplyToPlayer(Player player) { } public override void ClearFromPlayer(Player player) { } } internal static class FertilizerVisuals { private static Material _mat; internal static Material GetMaterial() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown if ((Object)(object)_mat != (Object)null) { return _mat; } Shader val = Shader.Find("Universal Render Pipeline/Particles/Unlit") ?? Shader.Find("Universal Render Pipeline/Particles/Lit") ?? Shader.Find("Sprites/Default") ?? Shader.Find("Universal Render Pipeline/Lit") ?? Shader.Find("Standard"); if ((Object)(object)val != (Object)null) { _mat = new Material(val); } return _mat; } internal static void SetMaterial(GameObject go) { ParticleSystemRenderer component = go.GetComponent(); if (!((Object)(object)component == (Object)null)) { Material material = GetMaterial(); if ((Object)(object)material != (Object)null) { ((Renderer)component).material = material; } } } internal static GameObject CreateScreenOverlay(Color color) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("FertEffect_Canvas"); Object.DontDestroyOnLoad((Object)(object)val); Canvas val2 = val.AddComponent(); val2.renderMode = (RenderMode)0; val2.sortingOrder = 50; val.AddComponent(); GameObject val3 = new GameObject("FertEffect_Img"); val3.transform.SetParent(val.transform, false); Image val4 = val3.AddComponent(); ((Graphic)val4).color = color; ((Graphic)val4).raycastTarget = false; RectTransform component = val3.GetComponent(); component.anchorMin = Vector2.zero; component.anchorMax = Vector2.one; component.offsetMin = Vector2.zero; component.offsetMax = Vector2.zero; return val; } internal static IEnumerator BlackoutFlash() { GameObject go = CreateScreenOverlay(new Color(0f, 0f, 0f, 0f)); Image img = go.GetComponentInChildren(); for (float t2 = 0f; t2 < 0.4f; t2 += Time.deltaTime) { if ((Object)(object)img != (Object)null) { ((Graphic)img).color = new Color(0f, 0f, 0f, Mathf.Clamp01(t2 / 0.4f)); } yield return null; } if ((Object)(object)img != (Object)null) { ((Graphic)img).color = Color.black; } yield return (object)new WaitForSeconds(0.8f); for (float t = 0f; t < 0.6f; t += Time.deltaTime) { if ((Object)(object)img != (Object)null) { ((Graphic)img).color = new Color(0f, 0f, 0f, Mathf.Clamp01(1f - t / 0.6f)); } yield return null; } if ((Object)(object)go != (Object)null) { Object.Destroy((Object)(object)go); } } internal static GameObject SpawnPetals(Transform root) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: 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_014b: Expected O, but got Unknown //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Bloom_Petals"); val.transform.SetParent(root); val.transform.localPosition = new Vector3(0f, 0.3f, 0f); val.transform.localRotation = Quaternion.Euler(-90f, 0f, 0f); ParticleSystem val2 = val.AddComponent(); MainModule main = val2.main; ((MainModule)(ref main)).duration = 999f; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(2.5f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0.4f); ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(0.05f); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(1f, 0.7f, 0.85f)); ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(-0.06f); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(18f); ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)4; ((ShapeModule)(ref shape)).angle = 55f; ((ShapeModule)(ref shape)).radius = 0.4f; ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val3 = new Gradient(); val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[3] { new GradientColorKey(new Color(1f, 0.6f, 0.85f), 0f), new GradientColorKey(new Color(1f, 0.95f, 0.7f), 0.5f), new GradientColorKey(new Color(1f, 1f, 1f), 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(0.9f, 0f), new GradientAlphaKey(0.6f, 0.6f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val3); SetMaterial(val); val2.Play(); return val; } } public class RootBoundEffect : Effect { public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } public override void ApplyToPlayer(Player player) { } public override void ClearFromPlayer(Player player) { } } public class OvergrownEffect : Effect { private static readonly Dictionary _overlays = new Dictionary(); private static readonly Dictionary _npcSpeeds = new Dictionary(); public override void ApplyToPlayer(Player player) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_overlays.ContainsKey(instanceID)) { return; } try { _overlays[instanceID] = FertilizerVisuals.CreateScreenOverlay(new Color(0f, 0.35f, 0f, 0.15f)); } catch (Exception ex) { MelonLogger.Error("[Overgrown] Overlay failed: " + ex.Message); } } public override void ClearFromPlayer(Player player) { if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_overlays.TryGetValue(instanceID, out var value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } _overlays.Remove(instanceID); } } public override void ApplyToNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } int instanceID = ((Object)((Component)npc).transform).GetInstanceID(); try { NavMeshAgent component = ((Component)npc).GetComponent(); if ((Object)(object)component != (Object)null) { _npcSpeeds[instanceID] = component.speed; component.speed *= 0.5f; } } catch (Exception ex) { MelonLogger.Error("[Overgrown] NPC slow failed: " + ex.Message); } } public override void ClearFromNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } int instanceID = ((Object)((Component)npc).transform).GetInstanceID(); try { NavMeshAgent component = ((Component)npc).GetComponent(); if ((Object)(object)component != (Object)null && _npcSpeeds.TryGetValue(instanceID, out var value)) { component.speed = value; _npcSpeeds.Remove(instanceID); } } catch (Exception ex) { MelonLogger.Error("[Overgrown] NPC restore failed: " + ex.Message); } } } public class BloomEffect : Effect { private static readonly Dictionary _petals = new Dictionary(); private static readonly Dictionary _overlays = new Dictionary(); public override void ApplyToPlayer(Player player) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_petals.ContainsKey(instanceID)) { return; } try { _petals[instanceID] = FertilizerVisuals.SpawnPetals(((Component)player).transform); _overlays[instanceID] = FertilizerVisuals.CreateScreenOverlay(new Color(1f, 0.85f, 0f, 0.08f)); } catch (Exception ex) { MelonLogger.Error("[Bloom] Apply failed: " + ex.Message); } } public override void ClearFromPlayer(Player player) { if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_petals.TryGetValue(instanceID, out var value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } _petals.Remove(instanceID); } if (_overlays.TryGetValue(instanceID, out var value2)) { if ((Object)(object)value2 != (Object)null) { Object.Destroy((Object)(object)value2); } _overlays.Remove(instanceID); } } public override void ApplyToNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } int instanceID = ((Object)((Component)npc).transform).GetInstanceID(); if (_petals.ContainsKey(instanceID)) { return; } try { _petals[instanceID] = FertilizerVisuals.SpawnPetals(((Component)npc).transform); } catch (Exception ex) { MelonLogger.Error("[Bloom] NPC petals failed: " + ex.Message); } } public override void ClearFromNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } int instanceID = ((Object)((Component)npc).transform).GetInstanceID(); if (_petals.TryGetValue(instanceID, out var value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } _petals.Remove(instanceID); } } } public class CompostEffect : Effect { private static readonly Dictionary _overlays = new Dictionary(); public override void ApplyToPlayer(Player player) { //IL_0052: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_overlays.ContainsKey(instanceID)) { return; } try { MelonCoroutines.Start(FertilizerVisuals.BlackoutFlash()); _overlays[instanceID] = FertilizerVisuals.CreateScreenOverlay(new Color(0f, 0f, 0f, 0.18f)); } catch (Exception ex) { MelonLogger.Error("[Compost] Apply failed: " + ex.Message); } } public override void ClearFromPlayer(Player player) { if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_overlays.TryGetValue(instanceID, out var value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } _overlays.Remove(instanceID); } } public override void ApplyToNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } try { NavMeshAgent component = ((Component)npc).GetComponent(); if ((Object)(object)component != (Object)null) { MelonCoroutines.Start(ConfusedShuffle(component)); } } catch (Exception ex) { MelonLogger.Error("[Compost] NPC confused failed: " + ex.Message); } } public override void ClearFromNPC(NPC npc) { } private static IEnumerator ConfusedShuffle(NavMeshAgent nav) { if (!((Object)(object)nav == (Object)null)) { float originalSpeed = nav.speed; nav.speed = 0.25f; yield return (object)new WaitForSeconds(4f); if ((Object)(object)nav != (Object)null) { nav.speed = originalSpeed; } } } } public class FiestaEffect : Effect { private static AudioClip _partyClip; public override void ApplyToPlayer(Player player) { //IL_0045: 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_008b: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null || !((NetworkBehaviour)player).IsOwner) { return; } AvatarEffects val = player.Avatar?.Effects; if (!((Object)(object)val == (Object)null)) { PlayParty(((Component)player).transform.position); PlayerMovement.StaticMoveSpeedMultiplier = 1.2f; val.OverrideEyeColor(new Color(1f, 0.5f, 0f), 0.4f, true); val.SetGlowingOn(new Color(0.4f, 0.2f, 0f), true); ParticleSystem headPoofParticles = val.HeadPoofParticles; if (headPoofParticles != null) { headPoofParticles.Play(); } } } public override void ClearFromPlayer(Player player) { if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { AvatarEffects val = player.Avatar?.Effects; if (!((Object)(object)val == (Object)null)) { PlayerMovement.StaticMoveSpeedMultiplier = 1f; val.ResetEyeColor(true); val.SetGlowingOff(true); } } } public override void ApplyToNPC(NPC npc) { //IL_003a: 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_00a8: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)npc == (Object)null) { return; } AvatarEffects val = npc.Avatar?.Effects; if (!((Object)(object)val == (Object)null)) { PlayParty(((Component)npc).transform.position); if ((Object)(object)npc.Movement?.SpeedController != (Object)null) { npc.Movement.SpeedController.SpeedMultiplier = 1.2f; } val.OverrideEyeColor(new Color(1f, 0.5f, 0f), 0.4f, true); val.SetGlowingOn(new Color(0.4f, 0.2f, 0f), true); ParticleSystem headPoofParticles = val.HeadPoofParticles; if (headPoofParticles != null) { headPoofParticles.Play(); } } } public override void ClearFromNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } AvatarEffects val = npc.Avatar?.Effects; if (!((Object)(object)val == (Object)null)) { if ((Object)(object)npc.Movement?.SpeedController != (Object)null) { npc.Movement.SpeedController.SpeedMultiplier = 1f; } val.ResetEyeColor(true); val.SetGlowingOff(true); } } private static void PlayParty(Vector3 position) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_partyClip == (Object)null) { _partyClip = DomsCustomEffects.LoadCustomSound("Party.wav"); } if ((Object)(object)_partyClip == (Object)null) { MelonLogger.Warning("[Fiesta] Party.wav not found."); } else { AudioSource.PlayClipAtPoint(_partyClip, position, SoundHelper.SFXVolume); } } } public class GildedMartianEffect : Effect { private const string STACK_KEY = "gildedmartian"; private static readonly Color GoldTone = new Color(1f, 0.84f, 0.2f); private static readonly Color OrangeTone = new Color(0.95f, 0.65f, 0.1f); private static bool _playerCycling; public override void ApplyToPlayer(Player player) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { AvatarEffects val = player.Avatar?.Effects; if (!((Object)(object)val == (Object)null)) { PlayerMovement.StaticMoveSpeedMultiplier = 1.2f; PlayerMovement.JumpMultiplier = 1.2f; val.OverrideEyeColor(GoldTone, 0.5f, true); val.SetGlowingOn(new Color(0.5f, 0.4f, 0f), true); _playerCycling = true; MelonCoroutines.Start(CycleSkin(val, isPlayer: true)); } } } public override void ClearFromPlayer(Player player) { if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { AvatarEffects val = player.Avatar?.Effects; if (!((Object)(object)val == (Object)null)) { _playerCycling = false; PlayerMovement.StaticMoveSpeedMultiplier = 1f; PlayerMovement.JumpMultiplier = 1f; val.ResetEyeColor(true); val.SetGlowingOff(true); val.SkinColorSmoother.RemoveOverride("gildedmartian"); } } } public override void ApplyToNPC(NPC npc) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)npc == (Object)null)) { AvatarEffects val = npc.Avatar?.Effects; if (!((Object)(object)val == (Object)null)) { val.OverrideEyeColor(GoldTone, 0.5f, true); val.SetGlowingOn(new Color(0.5f, 0.4f, 0f), true); MelonCoroutines.Start(CycleSkin(val, isPlayer: false)); } } } public override void ClearFromNPC(NPC npc) { if (!((Object)(object)npc == (Object)null)) { AvatarEffects val = npc.Avatar?.Effects; if (!((Object)(object)val == (Object)null)) { val.ResetEyeColor(true); val.SetGlowingOff(true); val.SkinColorSmoother.RemoveOverride("gildedmartian"); } } } private static IEnumerator CycleSkin(AvatarEffects fx, bool isPlayer) { if ((Object)(object)fx == (Object)null) { yield break; } bool showingGold = true; fx.SkinColorSmoother.AddOverride(GoldTone, 9, "gildedmartian"); while (isPlayer ? _playerCycling : ((Object)(object)fx != (Object)null)) { yield return (object)new WaitForSeconds(2f); if ((Object)(object)fx == (Object)null) { break; } showingGold = !showingGold; fx.SkinColorSmoother.AddOverride(showingGold ? GoldTone : OrangeTone, 9, "gildedmartian"); } } } public class GoldRushEffect : VoluptuousEffect { private const string GOLD_KEY = "goldrush_skin"; private static readonly Color GoldSkin = new Color(1f, 0.84f, 0.2f); protected override string LipTextureName => "GoldLips.png"; protected override Color LipColor => Color.white; protected override Color EyeGlamColor => new Color(1f, 0.75f, 0f); protected override Color GlowColor => new Color(0.4f, 0.3f, 0f); protected override void ApplyVisuals(Avatar avatar, AvatarEffects fx, bool isPlayer) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) base.ApplyVisuals(avatar, fx, isPlayer); if (fx != null) { fx.SkinColorSmoother.AddOverride(GoldSkin, 8, "goldrush_skin"); } } public override void ClearFromPlayer(Player player) { base.ClearFromPlayer(player); if (player == null) { return; } Avatar avatar = player.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.RemoveOverride("goldrush_skin"); } } } public override void ClearFromNPC(NPC npc) { base.ClearFromNPC(npc); if (npc == null) { return; } Avatar avatar = npc.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.RemoveOverride("goldrush_skin"); } } } } public class MoonDustMixerEffect : Effect { public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } public override void ApplyToPlayer(Player player) { } public override void ClearFromPlayer(Player player) { } } internal static class HotSauceVisuals { private static Material _mat; internal static Material GetMaterial() { //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown if ((Object)(object)_mat != (Object)null) { return _mat; } Shader val = Shader.Find("Universal Render Pipeline/Particles/Unlit") ?? Shader.Find("Universal Render Pipeline/Particles/Lit") ?? Shader.Find("Sprites/Default") ?? Shader.Find("Universal Render Pipeline/Lit") ?? Shader.Find("Standard"); if ((Object)(object)val == (Object)null) { MelonLogger.Warning("[HotSauce] Could not find a particle shader."); return null; } _mat = new Material(val); return _mat; } internal static void SetMaterial(GameObject go) { ParticleSystemRenderer component = go.GetComponent(); if (!((Object)(object)component == (Object)null)) { Material material = GetMaterial(); if ((Object)(object)material != (Object)null) { ((Renderer)component).material = material; } } } internal static GameObject SpawnSmoke(Transform root, float duration, Vector3 worldForward, Vector3? worldPos = null) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_0086: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Expected O, but got Unknown //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) MelonLogger.Msg($"[HotSauce] SpawnSmoke — root={((Object)root).name}, fwd={worldForward}"); GameObject val = new GameObject("HotSauce_Smoke"); val.transform.SetParent(root); val.transform.position = (Vector3)(((??)worldPos) ?? (root.position + Vector3.up * 1.6f + worldForward * 0.15f)); val.transform.rotation = Quaternion.LookRotation(worldForward) * Quaternion.Euler(-10f, 0f, 0f); ParticleSystem val2 = val.AddComponent(); MainModule main = val2.main; ((MainModule)(ref main)).duration = duration; ((MainModule)(ref main)).loop = false; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(2f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0.3f); ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(0.08f); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(0.85f, 0.85f, 0.85f, 0.8f)); ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(-0.08f); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; InheritVelocityModule inheritVelocity = val2.inheritVelocity; ((InheritVelocityModule)(ref inheritVelocity)).enabled = true; ((InheritVelocityModule)(ref inheritVelocity)).mode = (ParticleSystemInheritVelocityMode)1; ((InheritVelocityModule)(ref inheritVelocity)).curveMultiplier = 1f; EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(20f); ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)4; ((ShapeModule)(ref shape)).angle = 20f; ((ShapeModule)(ref shape)).radius = 0.02f; ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val3 = new Gradient(); val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(new Color(0.8f, 0.8f, 0.8f), 0f), new GradientColorKey(new Color(0.95f, 0.95f, 0.95f), 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[2] { new GradientAlphaKey(0.8f, 0f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val3); SetMaterial(val); val2.Play(); MelonLogger.Msg($"[HotSauce] Smoke spawned, isPlaying={val2.isPlaying}, worldPos={val.transform.position}"); return val; } internal static GameObject SpawnFireBreath(Transform root, float duration, Vector3 worldForward, Vector3? worldPos = null) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_0086: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_012c: 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_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Expected O, but got Unknown //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: 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_01fb: 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_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) MelonLogger.Msg($"[HotSauce] SpawnFireBreath — root={((Object)root).name}, fwd={worldForward}"); GameObject val = new GameObject("HotSauce_FireBreath"); val.transform.SetParent(root); val.transform.position = (Vector3)(((??)worldPos) ?? (root.position + Vector3.up * 1.6f + worldForward * 0.15f)); val.transform.rotation = Quaternion.LookRotation(worldForward) * Quaternion.Euler(-10f, 0f, 0f); ParticleSystem val2 = val.AddComponent(); MainModule main = val2.main; ((MainModule)(ref main)).duration = duration; ((MainModule)(ref main)).loop = false; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(0.8f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(1.2f); ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(0.05f); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(1f, 0.55f, 0f)); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; InheritVelocityModule inheritVelocity = val2.inheritVelocity; ((InheritVelocityModule)(ref inheritVelocity)).enabled = true; ((InheritVelocityModule)(ref inheritVelocity)).mode = (ParticleSystemInheritVelocityMode)1; ((InheritVelocityModule)(ref inheritVelocity)).curveMultiplier = 1f; EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(45f); ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)4; ((ShapeModule)(ref shape)).angle = 12f; ((ShapeModule)(ref shape)).radius = 0.02f; ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val3 = new Gradient(); val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[3] { new GradientColorKey(new Color(1f, 1f, 0f), 0f), new GradientColorKey(new Color(1f, 0.4f, 0f), 0.4f), new GradientColorKey(new Color(0.8f, 0.1f, 0f), 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(0.8f, 0.5f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val3); SetMaterial(val); val2.Play(); MelonLogger.Msg($"[HotSauce] FireBreath spawned, isPlaying={val2.isPlaying}, worldPos={val.transform.position}"); return val; } internal static GameObject SpawnBodyFire(Transform root) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: 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_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: 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_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Expected O, but got Unknown //IL_01ba: 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_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: 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_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0288: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Expected O, but got Unknown //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0384: 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_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: 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_03d4: Expected O, but got Unknown //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_03f7: Unknown result type (might be due to invalid IL or missing references) //IL_03fc: Unknown result type (might be due to invalid IL or missing references) //IL_0412: 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_0421: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_043d: 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_0462: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Expected O, but got Unknown //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04e0: Unknown result type (might be due to invalid IL or missing references) MelonLogger.Msg("[HotSauce] SpawnBodyFire — root=" + ((Object)root).name); GameObject val = new GameObject("HotSauce_BodyEffect"); val.transform.SetParent(root); val.transform.localPosition = new Vector3(0f, 0.1f, 0f); val.transform.localRotation = Quaternion.identity; GameObject val2 = new GameObject("HotSauce_BodyFire"); val2.transform.SetParent(val.transform); val2.transform.localPosition = Vector3.zero; val2.transform.localRotation = Quaternion.Euler(-90f, 0f, 0f); ParticleSystem val3 = val2.AddComponent(); MainModule main = val3.main; ((MainModule)(ref main)).duration = 999f; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(1.4f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0.36f); ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(0.032f); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(1f, 0.5f, 0f)); ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(-0.15f); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; EmissionModule emission = val3.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(330f); ShapeModule shape = val3.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)4; ((ShapeModule)(ref shape)).angle = 35f; ((ShapeModule)(ref shape)).radius = 0.35f; ColorOverLifetimeModule colorOverLifetime = val3.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val4 = new Gradient(); val4.SetKeys((GradientColorKey[])(object)new GradientColorKey[3] { new GradientColorKey(new Color(1f, 1f, 0.2f), 0f), new GradientColorKey(new Color(1f, 0.4f, 0f), 0.4f), new GradientColorKey(new Color(0.6f, 0.1f, 0f), 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(0.8f, 0.5f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val4); SetMaterial(val2); val3.Play(); GameObject val5 = new GameObject("HotSauce_BodySmoke"); val5.transform.SetParent(val.transform); val5.transform.localPosition = Vector3.zero; val5.transform.localRotation = Quaternion.Euler(-90f, 0f, 0f); ParticleSystem val6 = val5.AddComponent(); MainModule main2 = val6.main; ((MainModule)(ref main2)).duration = 999f; ((MainModule)(ref main2)).loop = true; ((MainModule)(ref main2)).startLifetime = MinMaxCurve.op_Implicit(0.9f); ((MainModule)(ref main2)).startSpeed = MinMaxCurve.op_Implicit(0.36f); ((MainModule)(ref main2)).startSize = MinMaxCurve.op_Implicit(0.028f); ((MainModule)(ref main2)).startColor = MinMaxGradient.op_Implicit(new Color(0.2f, 0.2f, 0.2f, 0.5f)); ((MainModule)(ref main2)).gravityModifier = MinMaxCurve.op_Implicit(-0.04f); ((MainModule)(ref main2)).simulationSpace = (ParticleSystemSimulationSpace)1; EmissionModule emission2 = val6.emission; ((EmissionModule)(ref emission2)).rateOverTime = MinMaxCurve.op_Implicit(220f); ShapeModule shape2 = val6.shape; ((ShapeModule)(ref shape2)).shapeType = (ParticleSystemShapeType)4; ((ShapeModule)(ref shape2)).angle = 35f; ((ShapeModule)(ref shape2)).radius = 0.35f; ColorOverLifetimeModule colorOverLifetime2 = val6.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime2)).enabled = true; Gradient val7 = new Gradient(); val7.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(new Color(0.35f, 0.3f, 0.25f), 0f), new GradientColorKey(new Color(0.15f, 0.15f, 0.15f), 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[2] { new GradientAlphaKey(0.45f, 0f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime2)).color = new MinMaxGradient(val7); SetMaterial(val5); val6.Play(); GameObject val8 = new GameObject("HotSauce_FireLight"); val8.transform.SetParent(val.transform); val8.transform.localPosition = new Vector3(0f, 1f, 0f); Light val9 = val8.AddComponent(); val9.type = (LightType)2; val9.color = new Color(1f, 0.45f, 0.1f); val9.intensity = 3f; val9.range = 4f; MelonLogger.Msg("[HotSauce] BodyFire container spawned"); return val; } } public class FiveAlarmEffect : Effect { public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } public override void ApplyToPlayer(Player player) { } public override void ClearFromPlayer(Player player) { } } public class CapsaicinRushEffect : Effect { private const float Duration = 4f; public override void ApplyToPlayer(Player player) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null)) { Vector3 val = (((Object)(object)Camera.main != (Object)null) ? ((Component)Camera.main).transform.forward : ((Component)player).transform.forward); Vector3 value = (((Object)(object)Camera.main != (Object)null) ? ((Component)Camera.main).transform.position : (((Component)player).transform.position + Vector3.up * 1.6f)) - Vector3.up * 0.2f + val * 0.25f; MelonLogger.Msg($"[CapsaicinRush] ApplyToPlayer — fwd={val}"); MelonCoroutines.Start(TimedSmoke(((Component)player).transform, val, value)); } } public override void ClearFromPlayer(Player player) { } public override void ApplyToNPC(NPC npc) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)npc == (Object)null)) { Transform transform = ((Component)npc).transform; MelonLogger.Msg("[CapsaicinRush] ApplyToNPC — transform=" + (((transform != null) ? ((Object)transform).name : null) ?? "null")); MelonCoroutines.Start(TimedSmoke(((Component)npc).transform, ((Component)npc).transform.forward)); } } public override void ClearFromNPC(NPC npc) { } private static IEnumerator TimedSmoke(Transform root, Vector3 worldForward, Vector3? worldPos = null) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)root == (Object)null) { MelonLogger.Warning("[CapsaicinRush] root is null, aborting"); yield break; } GameObject go = null; try { go = HotSauceVisuals.SpawnSmoke(root, 4f, worldForward, worldPos); } catch (Exception ex2) { Exception ex = ex2; MelonLogger.Error("[CapsaicinRush] Spawn failed: " + ex.Message + "\n" + ex.StackTrace); } if ((Object)(object)go != (Object)null) { yield return (object)new WaitForSeconds(6f); if ((Object)(object)go != (Object)null) { Object.Destroy((Object)(object)go); } } } } public class DragonBreathEffect : Effect { private const float Duration = 5f; public override void ApplyToPlayer(Player player) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null)) { Vector3 val = (((Object)(object)Camera.main != (Object)null) ? ((Component)Camera.main).transform.forward : ((Component)player).transform.forward); Vector3 value = (((Object)(object)Camera.main != (Object)null) ? ((Component)Camera.main).transform.position : (((Component)player).transform.position + Vector3.up * 1.6f)) - Vector3.up * 0.2f + val * 0.25f; MelonLogger.Msg($"[DragonBreath] ApplyToPlayer — fwd={val}"); MelonCoroutines.Start(TimedFire(((Component)player).transform, val, value)); } } public override void ClearFromPlayer(Player player) { } public override void ApplyToNPC(NPC npc) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)npc == (Object)null)) { Transform transform = ((Component)npc).transform; MelonLogger.Msg("[DragonBreath] ApplyToNPC — transform=" + (((transform != null) ? ((Object)transform).name : null) ?? "null")); MelonCoroutines.Start(TimedFire(((Component)npc).transform, ((Component)npc).transform.forward)); } } public override void ClearFromNPC(NPC npc) { } private static IEnumerator TimedFire(Transform root, Vector3 worldForward, Vector3? worldPos = null) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)root == (Object)null) { MelonLogger.Warning("[DragonBreath] root is null, aborting"); yield break; } GameObject go = null; try { go = HotSauceVisuals.SpawnFireBreath(root, 5f, worldForward, worldPos); } catch (Exception ex2) { Exception ex = ex2; MelonLogger.Error("[DragonBreath] Spawn failed: " + ex.Message + "\n" + ex.StackTrace); } if ((Object)(object)go != (Object)null) { yield return (object)new WaitForSeconds(6f); if ((Object)(object)go != (Object)null) { Object.Destroy((Object)(object)go); } } } } public class InfernoEffect : Effect { private static readonly Dictionary _active = new Dictionary(); public override void ApplyToPlayer(Player player) { if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_active.ContainsKey(instanceID)) { return; } MelonLogger.Msg($"[Inferno] ApplyToPlayer id={instanceID}"); try { _active[instanceID] = HotSauceVisuals.SpawnBodyFire(((Component)player).transform); } catch (Exception ex) { MelonLogger.Error("[Inferno] Spawn failed: " + ex.Message + "\n" + ex.StackTrace); } } public override void ClearFromPlayer(Player player) { if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_active.TryGetValue(instanceID, out var value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } _active.Remove(instanceID); } } public override void ApplyToNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } int instanceID = ((Object)((Component)npc).transform).GetInstanceID(); if (_active.ContainsKey(instanceID)) { return; } MelonLogger.Msg($"[Inferno] ApplyToNPC id={instanceID}"); try { _active[instanceID] = HotSauceVisuals.SpawnBodyFire(((Component)npc).transform); } catch (Exception ex) { MelonLogger.Error("[Inferno] Spawn failed: " + ex.Message + "\n" + ex.StackTrace); } } public override void ClearFromNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } int instanceID = ((Object)((Component)npc).transform).GetInstanceID(); if (_active.TryGetValue(instanceID, out var value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } _active.Remove(instanceID); } } } public class InversionEffect : Effect { private static bool _playerInverted; private static Coroutine _playerTimer; private static readonly Dictionary _originalNPCPositions = new Dictionary(); private static readonly Dictionary _originalBodyScale = new Dictionary(); public override void ApplyToPlayer(Player player) { //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Expected O, but got Unknown //IL_005e: 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_0067: 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) if ((Object)(object)player == (Object)null || !((NetworkBehaviour)player).IsOwner || _playerInverted) { return; } _playerInverted = true; PlayerCamera instance = PlayerSingleton.Instance; if ((Object)(object)instance != (Object)null) { Camera componentInChildren = ((Component)instance).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { Matrix4x4 projectionMatrix = componentInChildren.projectionMatrix; projectionMatrix.m11 = 0f - projectionMatrix.m11; componentInChildren.projectionMatrix = projectionMatrix; } } if (_playerTimer != null) { MelonCoroutines.Stop((object)_playerTimer); } _playerTimer = (Coroutine)MelonCoroutines.Start(AutoClearPlayer(player)); } public override void ClearFromPlayer(Player player) { if (!_playerInverted) { return; } _playerInverted = false; if (_playerTimer != null) { MelonCoroutines.Stop((object)_playerTimer); _playerTimer = null; } PlayerCamera instance = PlayerSingleton.Instance; if ((Object)(object)instance != (Object)null) { Camera componentInChildren = ((Component)instance).GetComponentInChildren(); if (componentInChildren != null) { componentInChildren.ResetProjectionMatrix(); } } } public override void ApplyToNPC(NPC npc) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)npc == (Object)null)) { int instanceID = ((Object)npc).GetInstanceID(); if ((Object)(object)npc.Avatar?.BodyContainer != (Object)null) { _originalBodyScale[instanceID] = npc.Avatar.BodyContainer.localScale; Vector3 val = _originalBodyScale[instanceID]; npc.Avatar.BodyContainer.localScale = new Vector3(val.x, 0f - val.y, val.z); } MelonCoroutines.Start(AutoClearNPC(npc)); } } public override void ClearFromNPC(NPC npc) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)npc == (Object)null)) { int instanceID = ((Object)npc).GetInstanceID(); if ((Object)(object)npc.Avatar?.BodyContainer != (Object)null && _originalBodyScale.TryGetValue(instanceID, out var value)) { npc.Avatar.BodyContainer.localScale = value; _originalBodyScale.Remove(instanceID); } } } private static IEnumerator AutoClearPlayer(Player player) { yield return (object)new WaitForSeconds(30f); if (!_playerInverted) { yield break; } _playerInverted = false; PlayerCamera playerCam = PlayerSingleton.Instance; if ((Object)(object)playerCam != (Object)null) { Camera componentInChildren = ((Component)playerCam).GetComponentInChildren(); if (componentInChildren != null) { componentInChildren.ResetProjectionMatrix(); } } } private static IEnumerator AutoClearNPC(NPC npc) { yield return (object)new WaitForSeconds(30f); if (!((Object)(object)npc == (Object)null)) { int id = ((Object)npc).GetInstanceID(); if ((Object)(object)npc.Avatar?.BodyContainer != (Object)null && _originalBodyScale.TryGetValue(id, out var orig)) { npc.Avatar.BodyContainer.localScale = orig; _originalBodyScale.Remove(id); } } } private static void ClearCamera() { Camera main = Camera.main; if ((Object)(object)main != (Object)null) { main.ResetProjectionMatrix(); } } } public class FemmeFataleEffect : Effect { private static readonly Dictionary _sparkles = new Dictionary(); private static readonly Dictionary _overlays = new Dictionary(); public override void ApplyToPlayer(Player player) { //IL_005e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_sparkles.ContainsKey(instanceID)) { return; } try { _sparkles[instanceID] = SpawnSparkles(((Component)player).transform); _overlays[instanceID] = FertilizerVisuals.CreateScreenOverlay(new Color(1f, 0.55f, 0.75f, 0.1f)); } catch (Exception ex) { MelonLogger.Error("[FemmeFatale] Apply failed: " + ex.Message); } } public override void ClearFromPlayer(Player player) { if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_sparkles.TryGetValue(instanceID, out var value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } _sparkles.Remove(instanceID); } if (_overlays.TryGetValue(instanceID, out var value2)) { if ((Object)(object)value2 != (Object)null) { Object.Destroy((Object)(object)value2); } _overlays.Remove(instanceID); } } public override void ApplyToNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } int instanceID = ((Object)((Component)npc).transform).GetInstanceID(); if (_sparkles.ContainsKey(instanceID)) { return; } try { _sparkles[instanceID] = SpawnSparkles(((Component)npc).transform); } catch (Exception ex) { MelonLogger.Error("[FemmeFatale] NPC apply failed: " + ex.Message); } } public override void ClearFromNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } int instanceID = ((Object)((Component)npc).transform).GetInstanceID(); if (_sparkles.TryGetValue(instanceID, out var value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } _sparkles.Remove(instanceID); } } private static GameObject SpawnSparkles(Transform root) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0122: 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_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: 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_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("FemmeFatale_Sparkles"); val.transform.SetParent(root); val.transform.localPosition = new Vector3(0f, 1f, 0f); val.transform.localRotation = Quaternion.identity; ParticleSystem val2 = val.AddComponent(); MainModule main = val2.main; ((MainModule)(ref main)).duration = 999f; ((MainModule)(ref main)).loop = true; ((MainModule)(ref main)).startLifetime = new MinMaxCurve(0.5f, 1f); ((MainModule)(ref main)).startSpeed = new MinMaxCurve(0.5f, 1.8f); ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(0.025f); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(1f, 0.7f, 0.9f)); ((MainModule)(ref main)).gravityModifier = MinMaxCurve.op_Implicit(-0.04f); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; EmissionModule emission = val2.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(35f); ShapeModule shape = val2.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)0; ((ShapeModule)(ref shape)).radius = 0.45f; ColorOverLifetimeModule colorOverLifetime = val2.colorOverLifetime; ((ColorOverLifetimeModule)(ref colorOverLifetime)).enabled = true; Gradient val3 = new Gradient(); val3.SetKeys((GradientColorKey[])(object)new GradientColorKey[3] { new GradientColorKey(new Color(1f, 0.6f, 0.9f), 0f), new GradientColorKey(new Color(1f, 0.95f, 0.5f), 0.5f), new GradientColorKey(new Color(1f, 1f, 1f), 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[3] { new GradientAlphaKey(1f, 0f), new GradientAlphaKey(0.6f, 0.5f), new GradientAlphaKey(0f, 1f) }); ((ColorOverLifetimeModule)(ref colorOverLifetime)).color = new MinMaxGradient(val3); FertilizerVisuals.SetMaterial(val); val2.Play(); return val; } } public class VenomKissEffect : Effect { private static readonly Dictionary _overlays = new Dictionary(); public override void ApplyToPlayer(Player player) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_overlays.ContainsKey(instanceID)) { return; } try { _overlays[instanceID] = FertilizerVisuals.CreateScreenOverlay(new Color(0.35f, 0f, 0.45f, 0.18f)); } catch (Exception ex) { MelonLogger.Error("[VenomKiss] Apply failed: " + ex.Message); } } public override void ClearFromPlayer(Player player) { if ((Object)(object)player == (Object)null) { return; } int instanceID = ((Object)((Component)player).transform).GetInstanceID(); if (_overlays.TryGetValue(instanceID, out var value)) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)value); } _overlays.Remove(instanceID); } } public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } } public class LipstickMapEffect : Effect { public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } public override void ApplyToPlayer(Player player) { } public override void ClearFromPlayer(Player player) { } } public class MagicBaseEffect : Effect { public override void ApplyToPlayer(Player player) { } public override void ClearFromPlayer(Player player) { } public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } } public class MagicJuiceMapEffect : Effect { public override void ApplyToPlayer(Player player) { } public override void ClearFromPlayer(Player player) { } public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } } public class PhantasmEffect : Effect { public override void ApplyToPlayer(Player player) { if ((Object)(object)player == (Object)null) { return; } try { MelonCoroutines.Start(WhiteFlash()); } catch (Exception ex) { MelonLogger.Error("[Phantasm] Apply failed: " + ex.Message); } } public override void ClearFromPlayer(Player player) { } public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } private static IEnumerator WhiteFlash() { GameObject go = FertilizerVisuals.CreateScreenOverlay(new Color(1f, 1f, 1f, 0f)); Image img = go.GetComponentInChildren(); for (float t2 = 0f; t2 < 0.12f; t2 += Time.deltaTime) { if ((Object)(object)img != (Object)null) { ((Graphic)img).color = new Color(1f, 1f, 1f, Mathf.Clamp01(t2 / 0.12f)); } yield return null; } if ((Object)(object)img != (Object)null) { ((Graphic)img).color = Color.white; } yield return (object)new WaitForSeconds(0.15f); for (float t = 0f; t < 0.7f; t += Time.deltaTime) { if ((Object)(object)img != (Object)null) { ((Graphic)img).color = new Color(1f, 1f, 1f, Mathf.Clamp01(1f - t / 0.7f)); } yield return null; } if ((Object)(object)go != (Object)null) { Object.Destroy((Object)(object)go); } } } public class MakeItRainEffect : Effect { private static string _originalWeatherID; private static bool _rainActive; public override void ApplyToPlayer(Player player) { if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner && !_rainActive) { _rainActive = true; MelonCoroutines.Start(DoRain()); } } public override void ClearFromPlayer(Player player) { } public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } private static IEnumerator DoRain() { EnvironmentManager em = NetworkSingleton.Instance; if ((Object)(object)em == (Object)null) { _rainActive = false; yield break; } WeatherConditions rainConditions = new WeatherConditions { Sunny = 0f, Cloudy = 1f, Rainy = 1f, Stormy = 0.5f, Snowy = 0f, Foggy = 0f, Windy = 0.8f, Hail = 0f, Sleet = 0f }; EnvironmentHandler.RaiseWeatherChange(rainConditions); MelonLogger.Msg("MAKEITRAIN IS CURRENTLY BROKEN, WILL BE FIXED IN FUTURE"); _rainActive = false; } private static string FindHeavyRainSequenceID(EnvironmentManager em) { if (!(typeof(EnvironmentManager).GetField("_weatherSequences", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(em) is List list)) { return null; } foreach (WeatherSequence item in list) { if (item.Id.ToLower().Contains("heavy") && item.Id.ToLower().Contains("rain")) { return item.Id; } } return null; } private static string FindRainSequenceID(EnvironmentManager em) { if (!(typeof(EnvironmentManager).GetField("_weatherSequences", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(em) is List list)) { return null; } foreach (WeatherSequence item in list) { if (item.Id.ToLower().Contains("rain")) { return item.Id; } } return null; } } public class MartianEffect : Effect { private const string STACK_KEY = "martian"; private static readonly Color MartianOrange = new Color(0.85f, 0.72f, 0.55f); public override void ApplyToPlayer(Player player) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null || !((NetworkBehaviour)player).IsOwner) { return; } Avatar avatar = player.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.AddOverride(MartianOrange, 7, "martian"); } } } public override void ClearFromPlayer(Player player) { if ((Object)(object)player == (Object)null || !((NetworkBehaviour)player).IsOwner) { return; } Avatar avatar = player.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.RemoveOverride("martian"); } } } public override void ApplyToNPC(NPC npc) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)npc == (Object)null) { return; } Avatar avatar = npc.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.AddOverride(MartianOrange, 7, "martian"); } } } public override void ClearFromNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } Avatar avatar = npc.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.RemoveOverride("martian"); } } } } public class MoonGravityEffect : Effect { private const string STACK_KEY = "moongravity"; public override void ApplyToPlayer(Player player) { if ((Object)(object)player != (Object)null && ((NetworkBehaviour)player).IsOwner) { PlayerMovement.JumpMultiplier = 1.3f; PlayerMovement.GravityMultiplier = 0.8f; } } public override void ClearFromPlayer(Player player) { if ((Object)(object)player != (Object)null && ((NetworkBehaviour)player).IsOwner) { PlayerMovement.JumpMultiplier = 1f; PlayerMovement.GravityMultiplier = 1f; } } public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } } public class NebulaEffect : Effect { private const string STACK_KEY = "nebula"; private static readonly Color NebulaPurple = new Color(0.6f, 0.4f, 0.8f); public override void ApplyToPlayer(Player player) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null || !((NetworkBehaviour)player).IsOwner) { return; } PlayerMovement.StaticMoveSpeedMultiplier = 0.8f; PlayerMovement.GravityMultiplier = 0.5f; Avatar avatar = player.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.AddOverride(NebulaPurple, 7, "nebula"); } } } public override void ClearFromPlayer(Player player) { if ((Object)(object)player == (Object)null || !((NetworkBehaviour)player).IsOwner) { return; } PlayerMovement.StaticMoveSpeedMultiplier = 1f; PlayerMovement.GravityMultiplier = 1f; Avatar avatar = player.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.RemoveOverride("nebula"); } } } public override void ApplyToNPC(NPC npc) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)npc == (Object)null) { return; } if ((Object)(object)npc.Movement?.SpeedController != (Object)null) { npc.Movement.SpeedController.SpeedMultiplier = 0.8f; } Avatar avatar = npc.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.AddOverride(NebulaPurple, 7, "nebula"); } } } public override void ClearFromNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } if ((Object)(object)npc.Movement?.SpeedController != (Object)null) { npc.Movement.SpeedController.SpeedMultiplier = 1f; } Avatar avatar = npc.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.RemoveOverride("nebula"); } } } } public class PhantomEffect : Effect { private const string STACK_KEY = "phantom"; private static readonly Color PhantomNavy = new Color(0.1f, 0.1f, 0.35f); public override void ApplyToPlayer(Player player) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null || !((NetworkBehaviour)player).IsOwner) { return; } PlayerMovement.StaticMoveSpeedMultiplier = 1.2f; Avatar avatar = player.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.AddOverride(PhantomNavy, 7, "phantom"); } } } public override void ClearFromPlayer(Player player) { if ((Object)(object)player == (Object)null || !((NetworkBehaviour)player).IsOwner) { return; } PlayerMovement.StaticMoveSpeedMultiplier = 1f; Avatar avatar = player.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.RemoveOverride("phantom"); } } } public override void ApplyToNPC(NPC npc) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)npc == (Object)null) { return; } if ((Object)(object)npc.Movement?.SpeedController != (Object)null) { npc.Movement.SpeedController.SpeedMultiplier = 1.2f; } Avatar avatar = npc.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.AddOverride(PhantomNavy, 7, "phantom"); } } } public override void ClearFromNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } if ((Object)(object)npc.Movement?.SpeedController != (Object)null) { npc.Movement.SpeedController.SpeedMultiplier = 1f; } Avatar avatar = npc.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.RemoveOverride("phantom"); } } } } public class ProfitBoostEffect : Effect { private static Coroutine _timer; private static bool _timerRunning; public static bool IsActive { get; private set; } public override void ApplyToPlayer(Player player) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Expected O, but got Unknown if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { IsActive = true; if (_timer != null) { MelonCoroutines.Stop((object)_timer); } _timer = (Coroutine)MelonCoroutines.Start(AutoClear()); } } public override void ClearFromPlayer(Player player) { if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner && !_timerRunning) { if (_timer != null) { MelonCoroutines.Stop((object)_timer); _timer = null; } IsActive = false; } } public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } private static IEnumerator AutoClear() { _timerRunning = true; yield return (object)new WaitForSeconds(600f); _timerRunning = false; _timer = null; IsActive = false; } } public class SingleEventUpsetEffect : Effect { private static GameObject _bsodCanvas; private static bool _active; public override void ApplyToPlayer(Player player) { if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner && !_active) { _active = true; MelonCoroutines.Start(ShowBSOD()); } } public override void ClearFromPlayer(Player player) { _active = false; if ((Object)(object)_bsodCanvas != (Object)null) { Object.Destroy((Object)(object)_bsodCanvas); } } public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } private static IEnumerator ShowBSOD() { _bsodCanvas = new GameObject("BSOD_Overlay"); Object.DontDestroyOnLoad((Object)(object)_bsodCanvas); Canvas canvas = _bsodCanvas.AddComponent(); canvas.renderMode = (RenderMode)0; canvas.sortingOrder = 9999; _bsodCanvas.AddComponent(); _bsodCanvas.AddComponent(); GameObject bg = new GameObject("BG"); bg.transform.SetParent(_bsodCanvas.transform, false); Image bgImg = bg.AddComponent(); ((Graphic)bgImg).color = new Color(0f, 0.18f, 0.62f); RectTransform bgRect = bg.GetComponent(); bgRect.anchorMin = Vector2.zero; bgRect.anchorMax = Vector2.one; bgRect.offsetMin = Vector2.zero; bgRect.offsetMax = Vector2.zero; AddText(_bsodCanvas, ":(", new Vector2(0.08f, 0.82f), new Vector2(0.5f, 0.95f), 120, (FontStyle)0); AddText(_bsodCanvas, "Your PC ran into a problem and needs to restart.\nWe're just collecting some error info, and then we'll restart for you.", new Vector2(0.08f, 0.62f), new Vector2(0.92f, 0.8f), 28, (FontStyle)0); AddText(_bsodCanvas, "100% complete", new Vector2(0.08f, 0.54f), new Vector2(0.5f, 0.62f), 26, (FontStyle)0); AddText(_bsodCanvas, "For more information about this issue and possible fixes, visit\nhttps://www.windows.com/stopcode\n\nIf you call a support person, give them this info:\nStop code: SINGLE_EVENT_UPSET\nWhat failed: MoonDust.sys", new Vector2(0.08f, 0.2f), new Vector2(0.92f, 0.52f), 22, (FontStyle)0); GameObject qr = new GameObject("QR"); qr.transform.SetParent(_bsodCanvas.transform, false); Image qrImg = qr.AddComponent(); ((Graphic)qrImg).color = Color.white; RectTransform qrRect = qr.GetComponent(); qrRect.anchorMin = new Vector2(0.75f, 0.05f); qrRect.anchorMax = new Vector2(0.92f, 0.2f); qrRect.offsetMin = Vector2.zero; qrRect.offsetMax = Vector2.zero; yield return (object)new WaitForSeconds(10f); _active = false; if ((Object)(object)_bsodCanvas != (Object)null) { Object.Destroy((Object)(object)_bsodCanvas); } } private static void AddText(GameObject parent, string content, Vector2 anchorMin, Vector2 anchorMax, int fontSize, FontStyle style) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Text"); val.transform.SetParent(parent.transform, false); Text val2 = val.AddComponent(); val2.text = content; val2.font = Resources.GetBuiltinResource("LegacyRuntime.ttf"); val2.fontSize = fontSize; val2.fontStyle = style; ((Graphic)val2).color = Color.white; val2.alignment = (TextAnchor)0; RectTransform component = val.GetComponent(); component.anchorMin = anchorMin; component.anchorMax = anchorMax; component.offsetMin = Vector2.zero; component.offsetMax = Vector2.zero; } } public class SirenEffect : VoluptuousEffect { private const string SIREN_KEY = "siren_skin"; private static readonly Color RoseGold = new Color(0.9f, 0.6f, 0.55f); private static readonly Color SirenEye = new Color(1f, 0.5f, 0.65f); protected override Color EyeGlamColor => SirenEye; protected override Color GlowColor => new Color(0.4f, 0.1f, 0.2f); protected override Color LipColor => Color.white; protected override void ApplyVisuals(Avatar avatar, AvatarEffects fx, bool isPlayer) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) base.ApplyVisuals(avatar, fx, isPlayer); if (fx != null) { fx.SkinColorSmoother.AddOverride(RoseGold, 8, "siren_skin"); } if (isPlayer) { PlayerMovement.StaticMoveSpeedMultiplier = 1.15f; } else if ((Object)(object)avatar != (Object)null) { NPC componentInParent = ((Component)avatar).GetComponentInParent(); if ((Object)(object)componentInParent?.Movement?.SpeedController != (Object)null) { componentInParent.Movement.SpeedController.SpeedMultiplier = 1.15f; } } } public override void ClearFromPlayer(Player player) { base.ClearFromPlayer(player); if (player != null) { Avatar avatar = player.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.RemoveOverride("siren_skin"); } } } PlayerMovement.StaticMoveSpeedMultiplier = 1f; } public override void ClearFromNPC(NPC npc) { base.ClearFromNPC(npc); if (npc != null) { Avatar avatar = npc.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.RemoveOverride("siren_skin"); } } } if ((Object)(object)npc?.Movement?.SpeedController != (Object)null) { npc.Movement.SpeedController.SpeedMultiplier = 1f; } } } public class SpicyEffect : Effect { public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } public override void ApplyToPlayer(Player player) { } public override void ClearFromPlayer(Player player) { } } public class HotSauceMapEffect : Effect { public override void ApplyToNPC(NPC npc) { } public override void ClearFromNPC(NPC npc) { } public override void ApplyToPlayer(Player player) { } public override void ClearFromPlayer(Player player) { } } public class SuperChargeEffect : Effect { private static Coroutine _timer; private static bool _timerRunning; public override void ApplyToPlayer(Player player) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown if ((Object)(object)player == (Object)null || !((NetworkBehaviour)player).IsOwner) { return; } PlayerMovement.StaticMoveSpeedMultiplier = 2f; PlayerMovement.JumpMultiplier = 3f; PlayerMovement.GravityMultiplier = 0.9f; Avatar avatar = player.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SetGlowingOn(new Color(0.5f, 0f, 1f), true); } } if (_timer != null) { MelonCoroutines.Stop((object)_timer); } _timer = (Coroutine)MelonCoroutines.Start(AutoClear(player)); } public override void ClearFromPlayer(Player player) { if ((Object)(object)player == (Object)null || !((NetworkBehaviour)player).IsOwner || _timerRunning) { return; } if (_timer != null) { MelonCoroutines.Stop((object)_timer); _timer = null; } PlayerMovement.StaticMoveSpeedMultiplier = 1f; PlayerMovement.JumpMultiplier = 1f; PlayerMovement.GravityMultiplier = 1f; Avatar avatar = player.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SetGlowingOff(true); } } } public override void ApplyToNPC(NPC npc) { if ((Object)(object)npc?.Movement?.SpeedController != (Object)null) { npc.Movement.SpeedController.SpeedMultiplier = 2.5f; } } public override void ClearFromNPC(NPC npc) { if ((Object)(object)npc?.Movement?.SpeedController != (Object)null) { npc.Movement.SpeedController.SpeedMultiplier = 1f; } } private static IEnumerator AutoClear(Player player) { _timerRunning = true; yield return (object)new WaitForSeconds(600f); _timerRunning = false; _timer = null; if ((Object)(object)player == (Object)null || !((NetworkBehaviour)player).IsOwner) { yield break; } PlayerMovement.StaticMoveSpeedMultiplier = 1f; PlayerMovement.JumpMultiplier = 1f; PlayerMovement.GravityMultiplier = 1f; Avatar avatar = player.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SetGlowingOff(true); } } } } public class SuperMagicEffect : Effect { private const string STACK_KEY = "supermagic"; private static readonly Color MagicPurple = new Color(0.6f, 0f, 1f); private static readonly Color MagicGold = new Color(1f, 0.84f, 0f); private static bool _playerCycling; public override void ApplyToPlayer(Player player) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { AvatarEffects val = player.Avatar?.Effects; if (!((Object)(object)val == (Object)null)) { val.OverrideEyeColor(MagicPurple, 0.6f, true); val.SetGlowingOn(new Color(0.3f, 0f, 0.5f), true); _playerCycling = true; MelonCoroutines.Start(CycleSkin(val, isPlayer: true)); } } } public override void ClearFromPlayer(Player player) { if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { AvatarEffects val = player.Avatar?.Effects; if (!((Object)(object)val == (Object)null)) { _playerCycling = false; val.ResetEyeColor(true); val.SetGlowingOff(true); val.SkinColorSmoother.RemoveOverride("supermagic"); } } } public override void ApplyToNPC(NPC npc) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)npc == (Object)null)) { AvatarEffects val = npc.Avatar?.Effects; if (!((Object)(object)val == (Object)null)) { val.OverrideEyeColor(MagicPurple, 0.6f, true); val.SetGlowingOn(new Color(0.3f, 0f, 0.5f), true); MelonCoroutines.Start(CycleSkin(val, isPlayer: false)); } } } public override void ClearFromNPC(NPC npc) { if (!((Object)(object)npc == (Object)null)) { AvatarEffects val = npc.Avatar?.Effects; if (!((Object)(object)val == (Object)null)) { val.ResetEyeColor(true); val.SetGlowingOff(true); val.SkinColorSmoother.RemoveOverride("supermagic"); } } } private static IEnumerator CycleSkin(AvatarEffects fx, bool isPlayer) { if ((Object)(object)fx == (Object)null) { yield break; } bool showingPurple = true; fx.SkinColorSmoother.AddOverride(MagicPurple, 9, "supermagic"); while (isPlayer ? _playerCycling : ((Object)(object)fx != (Object)null)) { yield return (object)new WaitForSeconds(1.5f); if ((Object)(object)fx == (Object)null) { break; } showingPurple = !showingPurple; fx.SkinColorSmoother.AddOverride(showingPurple ? MagicPurple : MagicGold, 9, "supermagic"); } } } public class SuperMartianEffect : Effect { private const string STACK_KEY = "supermartian"; private static readonly Color AlienGreen = new Color(0.4f, 0.55f, 0.3f); private static readonly Color MartianOrange = new Color(0.85f, 0.72f, 0.55f); private static Coroutine _playerCoroutine; private static bool _playerCycling; public override void ApplyToPlayer(Player player) { if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { PlayerMovement.StaticMoveSpeedMultiplier = 1.2f; PlayerMovement.JumpMultiplier = 1.2f; _playerCycling = true; object obj = MelonCoroutines.Start(CycleSkinColor(player.Avatar?.Effects, isPlayer: true)); _playerCoroutine = (Coroutine)((obj is Coroutine) ? obj : null); } } public override void ClearFromPlayer(Player player) { if ((Object)(object)player == (Object)null || !((NetworkBehaviour)player).IsOwner) { return; } PlayerMovement.StaticMoveSpeedMultiplier = 1f; PlayerMovement.JumpMultiplier = 1f; _playerCycling = false; Avatar avatar = player.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.RemoveOverride("supermartian"); } } } public override void ApplyToNPC(NPC npc) { if (!((Object)(object)npc == (Object)null)) { MelonCoroutines.Start(CycleSkinColor(npc.Avatar?.Effects, isPlayer: false)); } } public override void ClearFromNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } Avatar avatar = npc.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.RemoveOverride("supermartian"); } } } private static IEnumerator CycleSkinColor(AvatarEffects avatarEffects, bool isPlayer) { if ((Object)(object)avatarEffects == (Object)null) { yield break; } bool showingGreen = true; avatarEffects.SkinColorSmoother.AddOverride(AlienGreen, 8, "supermartian"); while (isPlayer ? _playerCycling : ((Object)(object)avatarEffects != (Object)null)) { yield return (object)new WaitForSeconds(2f); if ((Object)(object)avatarEffects == (Object)null) { break; } showingGreen = !showingGreen; Color target = (showingGreen ? AlienGreen : MartianOrange); avatarEffects.SkinColorSmoother.AddOverride(target, 8, "supermartian"); } } } public class SuperSuperChargeEffect : Effect { private static Coroutine _timer; private static bool _timerRunning; public override void ApplyToPlayer(Player player) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown if ((Object)(object)player == (Object)null || !((NetworkBehaviour)player).IsOwner) { return; } PlayerMovement.StaticMoveSpeedMultiplier = 3f; PlayerMovement.JumpMultiplier = 3f; PlayerMovement.GravityMultiplier = 0.9f; Avatar avatar = player.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SetGlowingOn(new Color(0.8f, 0f, 1f), true); } } if (_timer != null) { MelonCoroutines.Stop((object)_timer); } _timer = (Coroutine)MelonCoroutines.Start(AutoClear(player)); } public override void ClearFromPlayer(Player player) { if ((Object)(object)player == (Object)null || !((NetworkBehaviour)player).IsOwner || _timerRunning) { return; } if (_timer != null) { MelonCoroutines.Stop((object)_timer); _timer = null; } PlayerMovement.StaticMoveSpeedMultiplier = 1f; PlayerMovement.JumpMultiplier = 1f; PlayerMovement.GravityMultiplier = 1f; Avatar avatar = player.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SetGlowingOff(true); } } } public override void ApplyToNPC(NPC npc) { if ((Object)(object)npc?.Movement?.SpeedController != (Object)null) { npc.Movement.SpeedController.SpeedMultiplier = 2.5f; } } public override void ClearFromNPC(NPC npc) { if ((Object)(object)npc?.Movement?.SpeedController != (Object)null) { npc.Movement.SpeedController.SpeedMultiplier = 1f; } } private static IEnumerator AutoClear(Player player) { _timerRunning = true; yield return (object)new WaitForSeconds(1800f); _timerRunning = false; _timer = null; if ((Object)(object)player == (Object)null || !((NetworkBehaviour)player).IsOwner) { yield break; } PlayerMovement.StaticMoveSpeedMultiplier = 1f; PlayerMovement.JumpMultiplier = 1f; PlayerMovement.GravityMultiplier = 1f; Avatar avatar = player.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SetGlowingOff(true); } } } } public class TallEffect : Effect { private const string STACK_KEY = "tall"; public override void ApplyToPlayer(Player player) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { player.Avatar.Effects.SetGiraffeActive(true, true); ((Component)player).transform.localScale = Vector3.one * 1.5f; } } public override void ClearFromPlayer(Player player) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { player.Avatar.Effects.SetGiraffeActive(false, true); ((Component)player).transform.localScale = Vector3.one; } } public override void ApplyToNPC(NPC npc) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)npc == (Object)null)) { npc.Avatar.Effects.SetGiraffeActive(true, true); ((Component)npc).transform.localScale = Vector3.one * 1.5f; } } public override void ClearFromNPC(NPC npc) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)npc == (Object)null)) { npc.Avatar.Effects.SetGiraffeActive(false, true); ((Component)npc).transform.localScale = Vector3.one; } } } public class TrollEffect : Effect { private static AudioClip _knockClip; public override void ApplyToPlayer(Player player) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { MelonCoroutines.Start(KnockDelay(((Component)player).transform.position)); } } public override void ClearFromPlayer(Player player) { } public override void ApplyToNPC(NPC npc) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)npc == (Object)null)) { MelonCoroutines.Start(KnockDelay(((Component)npc).transform.position)); } } public override void ClearFromNPC(NPC npc) { } private static IEnumerator KnockDelay(Vector3 position) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) yield return (object)new WaitForSeconds(300f); if ((Object)(object)_knockClip == (Object)null) { _knockClip = DomsCustomEffects.LoadCustomSound("Knock.wav"); } if ((Object)(object)_knockClip == (Object)null) { MelonLogger.Warning("[Troll] Knock.wav not found in Sounds folder."); } else { AudioSource.PlayClipAtPoint(_knockClip, position, SoundHelper.SFXVolume); } } } public class VoidEffect : Effect { private const string STACK_KEY = "void"; public override void ApplyToPlayer(Player player) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { PlayerMovement.StaticMoveSpeedMultiplier = 0.85f; AvatarEffects val = player.Avatar?.Effects; if ((Object)(object)val != (Object)null) { val.SkinColorSmoother.AddOverride(Color.black, 7, "void"); } } } public override void ClearFromPlayer(Player player) { if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { PlayerMovement.StaticMoveSpeedMultiplier = 1f; AvatarEffects val = player.Avatar?.Effects; if ((Object)(object)val != (Object)null) { val.SkinColorSmoother.RemoveOverride("void"); } } } public override void ApplyToNPC(NPC npc) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)npc == (Object)null)) { if ((Object)(object)npc.Movement?.SpeedController != (Object)null) { npc.Movement.SpeedController.SpeedMultiplier = 0.85f; } AvatarEffects val = npc.Avatar?.Effects; if ((Object)(object)val != (Object)null) { val.SkinColorSmoother.AddOverride(Color.black, 7, "void"); } } } public override void ClearFromNPC(NPC npc) { if (!((Object)(object)npc == (Object)null)) { if ((Object)(object)npc.Movement?.SpeedController != (Object)null) { npc.Movement.SpeedController.SpeedMultiplier = 1f; } AvatarEffects val = npc.Avatar?.Effects; if ((Object)(object)val != (Object)null) { val.SkinColorSmoother.RemoveOverride("void"); } } } } public class VoluptuousEffect : Effect { protected const string STACK_KEY = "voluptuous"; private static readonly Dictionary _textureCache = new Dictionary(); private static readonly Dictionary> _lashObjects = new Dictionary>(); private static readonly Dictionary _originalHipScale = new Dictionary(); private static readonly Dictionary _originalGenderShape = new Dictionary(); private static readonly Dictionary _originalWeightShape = new Dictionary(); private static readonly Dictionary _originalHipPos = new Dictionary(); protected virtual int LIP_LAYER => 2; protected virtual string LipTextureName => "Lips.png"; protected virtual Color LipColor => Color.white; protected virtual Color EyeGlamColor => new Color(0.9f, 0.4f, 0.6f); protected virtual Color GlowColor => new Color(0.3f, 0.05f, 0.1f); public override void ApplyToPlayer(Player player) { if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { Avatar avatar = player.Avatar; AvatarEffects val = avatar?.Effects; if (!((Object)(object)val == (Object)null)) { ApplyVisuals(avatar, val, isPlayer: true); MelonCoroutines.Start(AutoClear(player, null, 900f)); } } } public override void ClearFromPlayer(Player player) { if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { ClearVisuals(player.Avatar, player.Avatar?.Effects); } } public override void ApplyToNPC(NPC npc) { if (!((Object)(object)npc == (Object)null)) { Avatar avatar = npc.Avatar; AvatarEffects val = avatar?.Effects; if (!((Object)(object)val == (Object)null)) { ApplyVisuals(avatar, val, isPlayer: false); MelonCoroutines.Start(AutoClear(null, npc, 900f)); } } } public override void ClearFromNPC(NPC npc) { if (!((Object)(object)npc == (Object)null)) { ClearVisuals(npc.Avatar, npc.Avatar?.Effects); } } protected virtual void ApplyVisuals(Avatar avatar, AvatarEffects fx, bool isPlayer) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) fx.OverrideEyeColor(EyeGlamColor, 0.3f, true); fx.SetGlowingOn(GlowColor, true); ApplyBoobs(avatar); ApplyButtScale(avatar); ApplyLipLayer(avatar); ApplyEyelashes(avatar); } private void ApplyBoobs(Avatar avatar) { if (avatar?.ShapeKeyMeshes == null) { return; } int instanceID = ((Object)avatar).GetInstanceID(); SkinnedMeshRenderer[] shapeKeyMeshes = avatar.ShapeKeyMeshes; foreach (SkinnedMeshRenderer val in shapeKeyMeshes) { if (!((Object)(object)val == (Object)null) && val.sharedMesh.blendShapeCount >= 2) { if (!_originalGenderShape.ContainsKey(instanceID)) { _originalGenderShape[instanceID] = val.GetBlendShapeWeight(0); } if (!_originalWeightShape.ContainsKey(instanceID)) { _originalWeightShape[instanceID] = val.GetBlendShapeWeight(1); } val.SetBlendShapeWeight(0, Mathf.Clamp(_originalGenderShape[instanceID] + 80f, 0f, 100f)); } } } private void ClearBoobs(Avatar avatar) { if (avatar?.ShapeKeyMeshes == null) { return; } int instanceID = ((Object)avatar).GetInstanceID(); if (!_originalGenderShape.TryGetValue(instanceID, out var value)) { return; } SkinnedMeshRenderer[] shapeKeyMeshes = avatar.ShapeKeyMeshes; foreach (SkinnedMeshRenderer val in shapeKeyMeshes) { if ((Object)(object)val != (Object)null && val.sharedMesh.blendShapeCount >= 1) { val.SetBlendShapeWeight(0, value); } } _originalGenderShape.Remove(instanceID); } protected void ClearVisuals(Avatar avatar, AvatarEffects fx) { if ((Object)(object)fx != (Object)null) { fx.ResetEyeColor(true); fx.SetGlowingOff(true); } ClearBoobs(avatar); ClearButtScale(avatar); ClearLipLayer(avatar); ClearEyelashes(avatar); } private IEnumerator AutoClear(Player player, NPC npc, float delay) { yield return (object)new WaitForSeconds(delay); if ((Object)(object)player != (Object)null) { ClearVisuals(player.Avatar, player.Avatar?.Effects); } if ((Object)(object)npc != (Object)null) { ClearVisuals(npc.Avatar, npc.Avatar?.Effects); } } private void ApplyButtScale(Avatar avatar) { //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) if (avatar?.ShapeKeyMeshes == null) { return; } int instanceID = ((Object)avatar).GetInstanceID(); SkinnedMeshRenderer[] shapeKeyMeshes = avatar.ShapeKeyMeshes; foreach (SkinnedMeshRenderer val in shapeKeyMeshes) { if (!((Object)(object)val == (Object)null) && val.sharedMesh.blendShapeCount >= 2) { if (!_originalWeightShape.ContainsKey(instanceID)) { _originalWeightShape[instanceID] = val.GetBlendShapeWeight(1); } val.SetBlendShapeWeight(1, Mathf.Clamp(_originalWeightShape[instanceID] + 80f, 0f, 100f)); } } if ((Object)(object)avatar.HipBone != (Object)null) { if (!_originalHipPos.ContainsKey(instanceID)) { _originalHipPos[instanceID] = avatar.HipBone.localPosition; } avatar.HipBone.localPosition = _originalHipPos[instanceID] + new Vector3(0f, 0f, -0.06f); } } private void ClearButtScale(Avatar avatar) { //IL_00be: Unknown result type (might be due to invalid IL or missing references) if (avatar?.ShapeKeyMeshes == null) { return; } int instanceID = ((Object)avatar).GetInstanceID(); if (_originalWeightShape.TryGetValue(instanceID, out var value)) { SkinnedMeshRenderer[] shapeKeyMeshes = avatar.ShapeKeyMeshes; foreach (SkinnedMeshRenderer val in shapeKeyMeshes) { if ((Object)(object)val != (Object)null && val.sharedMesh.blendShapeCount >= 2) { val.SetBlendShapeWeight(1, value); } } _originalWeightShape.Remove(instanceID); } if ((Object)(object)avatar.HipBone != (Object)null && _originalHipPos.TryGetValue(instanceID, out var value2)) { avatar.HipBone.localPosition = value2; _originalHipPos.Remove(instanceID); } } protected void ApplyLipLayer(Avatar avatar) { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)avatar?.FaceMesh == (Object)null)) { Texture2D cachedTexture = GetCachedTexture(LipTextureName); if ((Object)(object)cachedTexture == (Object)null) { MelonLogger.Warning("[Voluptuous] " + LipTextureName + " not found."); return; } ((Renderer)avatar.FaceMesh).material.SetTexture("_Layer_" + LIP_LAYER + "_Texture", (Texture)(object)cachedTexture); ((Renderer)avatar.FaceMesh).material.SetColor("_Layer_" + LIP_LAYER + "_Color", LipColor); } } protected void ClearLipLayer(Avatar avatar) { //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)avatar?.FaceMesh == (Object)null)) { ((Renderer)avatar.FaceMesh).material.SetTexture("_Layer_" + LIP_LAYER + "_Texture", (Texture)null); ((Renderer)avatar.FaceMesh).material.SetColor("_Layer_" + LIP_LAYER + "_Color", Color.clear); } } private static Texture2D GetCachedTexture(string fileName) { if (_textureCache.TryGetValue(fileName, out var value) && (Object)(object)value != (Object)null) { return value; } string text = Path.Combine(Directory.GetCurrentDirectory(), "Mods", "DomsCustomEffects", "Icons", fileName); Texture2D val = DomsCustomEffects.LoadCustomTexture(fileName); if ((Object)(object)val != (Object)null) { _textureCache[fileName] = val; } return val; } protected void ApplyEyelashes(Avatar avatar) { if ((Object)(object)avatar?.Eyes == (Object)null) { return; } int instanceID = ((Object)avatar).GetInstanceID(); if (!_lashObjects.ContainsKey(instanceID)) { List list = new List(); if ((Object)(object)avatar.Eyes.leftEye != (Object)null) { list.AddRange(BuildLashRow(((Component)avatar.Eyes.leftEye).transform, isLeft: true)); } if ((Object)(object)avatar.Eyes.rightEye != (Object)null) { list.AddRange(BuildLashRow(((Component)avatar.Eyes.rightEye).transform, isLeft: false)); } if (list.Count == 0) { MelonLogger.Warning("[Voluptuous] No eye transforms for lashes."); } _lashObjects[instanceID] = list; } } protected void ClearEyelashes(Avatar avatar) { if ((Object)(object)avatar == (Object)null) { return; } int instanceID = ((Object)avatar).GetInstanceID(); if (!_lashObjects.TryGetValue(instanceID, out var value)) { return; } foreach (GameObject item in value) { if ((Object)(object)item != (Object)null) { Object.Destroy((Object)(object)item); } } _lashObjects.Remove(instanceID); } private static List BuildLashRow(Transform eyeTransform, bool isLeft) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) List list = new List(); int num = 9; float num2 = 0.008f; float num3 = 0.014f; float num4 = (isLeft ? 1f : (-1f)); Material val = new Material(Shader.Find("Unlit/Color")); val.color = Color.black; for (int i = 0; i < num; i++) { float num5 = (float)i / (float)(num - 1) - 0.5f; float num6 = num5 * num2 * num4; float num7 = Mathf.Abs(num5) * 20f; GameObject val2 = new GameObject(string.Format("Lash_{0}_{1}", isLeft ? "L" : "R", i)); val2.transform.SetParent(eyeTransform, false); val2.transform.localPosition = new Vector3(num6, 0.003f, 0.006f); val2.transform.localRotation = Quaternion.Euler(0f - num7 - 10f, 0f, 0f); LineRenderer val3 = val2.AddComponent(); val3.useWorldSpace = false; val3.positionCount = 2; val3.SetPosition(0, Vector3.zero); val3.SetPosition(1, new Vector3(0f, num3, 0f)); val3.startWidth = 0.0012f; val3.endWidth = 0.0001f; ((Renderer)val3).sharedMaterial = val; ((Renderer)val3).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val3).receiveShadows = false; ((Renderer)val3).sortingOrder = 10; list.Add(val2); } return list; } } public class WraithEffect : Effect { private const string STACK_KEY = "wraith"; private static readonly Color WraithNavy = new Color(0.1f, 0.1f, 0.35f); private static readonly Color WraithBlack = new Color(0.02f, 0.02f, 0.05f); private static bool _playerCycling; public override void ApplyToPlayer(Player player) { if (!((Object)(object)player == (Object)null) && ((NetworkBehaviour)player).IsOwner) { PlayerMovement.StaticMoveSpeedMultiplier = 1.3f; PlayerMovement.GravityMultiplier = 0.7f; _playerCycling = true; MelonCoroutines.Start(CycleSkinColor(player.Avatar?.Effects, isPlayer: true)); } } public override void ClearFromPlayer(Player player) { if ((Object)(object)player == (Object)null || !((NetworkBehaviour)player).IsOwner) { return; } PlayerMovement.StaticMoveSpeedMultiplier = 1f; PlayerMovement.GravityMultiplier = 1f; _playerCycling = false; Avatar avatar = player.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.RemoveOverride("wraith"); } } } public override void ApplyToNPC(NPC npc) { if (!((Object)(object)npc == (Object)null)) { if ((Object)(object)npc.Movement?.SpeedController != (Object)null) { npc.Movement.SpeedController.SpeedMultiplier = 1.3f; } MelonCoroutines.Start(CycleSkinColor(npc.Avatar?.Effects, isPlayer: false)); } } public override void ClearFromNPC(NPC npc) { if ((Object)(object)npc == (Object)null) { return; } if ((Object)(object)npc.Movement?.SpeedController != (Object)null) { npc.Movement.SpeedController.SpeedMultiplier = 1f; } Avatar avatar = npc.Avatar; if (avatar != null) { AvatarEffects effects = avatar.Effects; if (effects != null) { effects.SkinColorSmoother.RemoveOverride("wraith"); } } } private static IEnumerator CycleSkinColor(AvatarEffects avatarEffects, bool isPlayer) { if ((Object)(object)avatarEffects == (Object)null) { yield break; } bool showingNavy = true; avatarEffects.SkinColorSmoother.AddOverride(WraithNavy, 8, "wraith"); while (isPlayer ? _playerCycling : ((Object)(object)avatarEffects != (Object)null)) { yield return (object)new WaitForSeconds(1.5f); if ((Object)(object)avatarEffects == (Object)null) { break; } showingNavy = !showingNavy; avatarEffects.SkinColorSmoother.AddOverride(showingNavy ? WraithNavy : WraithBlack, 8, "wraith"); } } } } namespace DomsExpandedIngredientsAndEffects.Effects.Descriptors { public class AirhornBaseEffectDef : CustomEffect { public override string ID => "airhornbase"; public override string Name => "Airhorn"; public override Color Color => new Color(1f, 0.5f, 0f); public override float Addictiveness => 0.05f; public override int ValueChange => 5; public override float ValueMultiplier => 1f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class ThunderclapEffectDef : CustomEffect { public override string ID => "thunderclap"; public override string Name => "Thunderclap"; public override Color Color => new Color(0.2f, 0.5f, 1f); public override float Addictiveness => 0.4f; public override int ValueChange => 20; public override float ValueMultiplier => 1.2f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class WhiteNoiseEffectDef : CustomEffect { public override string ID => "whitenoise"; public override string Name => "White Noise"; public override Color Color => new Color(0.8f, 0.8f, 0.85f); public override float Addictiveness => 0.5f; public override int ValueChange => 30; public override float ValueMultiplier => 1.35f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class AirhornMapEffectDef : CustomEffect { public override string ID => "airhornmap"; public override string Name => "Airhorn"; public override Color Color => new Color(1f, 0.5f, 0f); public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class AlienEffectDef : CustomEffect { public override string ID => "alieneffect"; public override string Name => "Alien"; public override Color Color => new Color(0.4f, 0.55f, 0.3f); public override float Addictiveness => 0.5f; public override int ValueChange => 30; public override float ValueMultiplier => 1.25f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class BunnyEffectDef : CustomEffect { public override string ID => "bunnyeffect"; public override string Name => "Bunny"; public override Color Color => new Color(1f, 0.75f, 0.8f); public override float Addictiveness => 0.15f; public override int ValueChange => 20; public override float ValueMultiplier => 1.2f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class ChargedEffectDef : CustomEffect { public override string ID => "chargedeffect"; public override string Name => "Charged"; public override Color Color => new Color(1f, 0.95f, 0.1f); public override float Addictiveness => 0.4f; public override int ValueChange => 35; public override float ValueMultiplier => 1.4f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class CreepyEffectDef : CustomEffect { public override string ID => "creepyeffect"; public override string Name => "Creepy"; public override Color Color => new Color(0.15f, 0f, 0.2f); public override float Addictiveness => 0.2f; public override int ValueChange => 20; public override float ValueMultiplier => 1.1f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class WildflowerEffectDef : CustomEffect { public override string ID => "wildflower"; public override string Name => "Wildflower"; public override Color Color => new Color(0.5f, 0.9f, 0.25f); public override float Addictiveness => 0.38f; public override int ValueChange => 18; public override float ValueMultiplier => 1.16f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class BurningPassionEffectDef : CustomEffect { public override string ID => "burningpassion"; public override string Name => "Burning Passion"; public override Color Color => new Color(1f, 0.15f, 0.5f); public override float Addictiveness => 0.52f; public override int ValueChange => 28; public override float ValueMultiplier => 1.24f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class UpheavalEffectDef : CustomEffect { public override string ID => "upheaval"; public override string Name => "Upheaval"; public override Color Color => new Color(0.55f, 0.35f, 0.1f); public override float Addictiveness => 0.42f; public override int ValueChange => 20; public override float ValueMultiplier => 1.18f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class DivaEffectDef : CustomEffect { public override string ID => "divaeffect"; public override string Name => "Diva"; public override Color Color => new Color(1f, 0.97f, 0.85f); public override float Addictiveness => 0.35f; public override int ValueChange => 25; public override float ValueMultiplier => 1.3f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class EarthyEffectDef : CustomEffect { public override string ID => "earthyeffect"; public override string Name => "Earthy"; public override Color Color => new Color(0.72f, 0.48f, 0.18f); public override float Addictiveness => 0.05f; public override int ValueChange => 6; public override float ValueMultiplier => 1f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class FertilizerMapEffectDef : CustomEffect { public override string ID => "fertilizermap"; public override string Name => "Fertilizer"; public override Color Color => new Color(0.72f, 0.48f, 0.18f); public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class RootBoundEffectDef : CustomEffect { public override string ID => "rootbound"; public override string Name => "Root Bound"; public override Color Color => new Color(0.3f, 0.6f, 0.2f); public override float Addictiveness => 0.23f; public override int ValueChange => 13; public override float ValueMultiplier => 1.08f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class OvergrownEffectDef : CustomEffect { public override string ID => "overgrown"; public override string Name => "Overgrown"; public override Color Color => new Color(0.1f, 0.8f, 0.3f); public override float Addictiveness => 0.4f; public override int ValueChange => 20; public override float ValueMultiplier => 1.14f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class BloomEffectDef : CustomEffect { public override string ID => "bloom"; public override string Name => "Bloom"; public override Color Color => new Color(1f, 0.85f, 0.1f); public override float Addictiveness => 0.68f; public override int ValueChange => 30; public override float ValueMultiplier => 1.25f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class CompostEffectDef : CustomEffect { public override string ID => "compost"; public override string Name => "Compost"; public override Color Color => new Color(0.6f, 0.25f, 0.55f); public override float Addictiveness => 1f; public override int ValueChange => 38; public override float ValueMultiplier => 1.38f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class FiestaEffectDef : CustomEffect { public override string ID => "fiestaeffect"; public override string Name => "Fiesta"; public override Color Color => new Color(1f, 0.5f, 0f); public override float Addictiveness => 0.3f; public override int ValueChange => 18; public override float ValueMultiplier => 1.2f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class GildedMartianEffectDef : CustomEffect { public override string ID => "gildedmartianeffect"; public override string Name => "Gilded Martian"; public override Color Color => new Color(1f, 0.75f, 0.15f); public override float Addictiveness => 0.7f; public override int ValueChange => 80; public override float ValueMultiplier => 1.6f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class GoldRushEffectDef : CustomEffect { public override string ID => "goldrusheffect"; public override string Name => "Gold Rush"; public override Color Color => new Color(1f, 0.84f, 0.2f); public override float Addictiveness => 0.45f; public override int ValueChange => 18; public override float ValueMultiplier => 1.4f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class HeliumInfusionEffect : CustomEffect { public override string ID => "heliuminfusion"; public override string Name => "Helium Infusion"; public override Color Color => new Color(0.4f, 0.7f, 1f); public override float Addictiveness => 0.1f; public override int ValueChange => 4; public override float ValueMultiplier => 1.1f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class FiveAlarmEffectDef : CustomEffect { public override string ID => "fivealarm"; public override string Name => "Five Alarm"; public override Color Color => new Color(0.85f, 0.05f, 0.05f); public override float Addictiveness => 0.35f; public override int ValueChange => 18; public override float ValueMultiplier => 1.15f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class CapsaicinRushEffectDef : CustomEffect { public override string ID => "capsaicinrush"; public override string Name => "Capsaicin Rush"; public override Color Color => new Color(1f, 0f, 0.5f); public override float Addictiveness => 0.55f; public override int ValueChange => 27; public override float ValueMultiplier => 1.2f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class DragonBreathEffectDef : CustomEffect { public override string ID => "dragonbreath"; public override string Name => "Dragon Breath"; public override Color Color => new Color(1f, 0.5f, 0f); public override float Addictiveness => 0.75f; public override int ValueChange => 36; public override float ValueMultiplier => 1.3f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class InfernoEffectDef : CustomEffect { public override string ID => "inferno"; public override string Name => "Inferno"; public override Color Color => new Color(1f, 0.9f, 0f); public override float Addictiveness => 1f; public override int ValueChange => 55; public override float ValueMultiplier => 1.4f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class InversionEffectDef : CustomEffect { public override string ID => "inversioneffect"; public override string Name => "Inversion"; public override Color Color => new Color(0.4f, 0f, 0.8f); public override float Addictiveness => 0.35f; public override int ValueChange => 28; public override float ValueMultiplier => 1.25f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class FemmeFataleEffectDef : CustomEffect { public override string ID => "femmefatale"; public override string Name => "Femme Fatale"; public override Color Color => new Color(1f, 0.4f, 0.7f); public override float Addictiveness => 0.3f; public override int ValueChange => 20; public override float ValueMultiplier => 1.19f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class VenomKissEffectDef : CustomEffect { public override string ID => "venomkiss"; public override string Name => "Venom Kiss"; public override Color Color => new Color(0.4f, 0f, 0.55f); public override float Addictiveness => 0.5f; public override int ValueChange => 30; public override float ValueMultiplier => 1.26f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class LipstickMapEffectDef : CustomEffect { public override string ID => "lipstickmap"; public override string Name => "Lipstick"; public override Color Color => new Color(0.9f, 0.1f, 0.3f); public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class MagicBaseEffectDef : CustomEffect { public override string ID => "magicbase"; public override string Name => "Magic"; public override Color Color => new Color(0.6f, 0f, 1f); public override float Addictiveness => 0f; public override int ValueChange => 0; public override float ValueMultiplier => 1f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class MagicJuiceMapEffectDef : CustomEffect { public override string ID => "magicjuicemap"; public override string Name => "Magic Juice"; public override Color Color => new Color(0.6f, 0f, 1f); public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class PhantasmEffectDef : CustomEffect { public override string ID => "phantasm"; public override string Name => "Phantasm"; public override Color Color => new Color(0.7f, 0.88f, 1f); public override float Addictiveness => 0f; public override int ValueChange => 0; public override float ValueMultiplier => 1f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class MakeItRainEffectDef : CustomEffect { public override string ID => "makeitrain"; public override string Name => "Make It Rain"; public override Color Color => new Color(0.3f, 0.5f, 1f); public override float Addictiveness => 0.1f; public override int ValueChange => 0; public override float ValueMultiplier => 1f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class MartianEffectDef : CustomEffect { public override string ID => "martianeffect"; public override string Name => "Martian"; public override Color Color => new Color(0.85f, 0.72f, 0.55f); public override float Addictiveness => 0.8f; public override int ValueChange => 50; public override float ValueMultiplier => 1.2f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class MoonGravityEffectDef : CustomEffect { public override string ID => "moongravity"; public override string Name => "Moon Gravity"; public override Color Color => new Color(0.6f, 0.2f, 0.8f); public override Vector2 MixDirection { get { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) Vector2 val = new Vector2(0f, 1f); return ((Vector2)(ref val)).normalized; } } public override float MixMagnitude => 0.45f; public override float Addictiveness => 0.35f; public override int ValueChange => 17; public override float ValueMultiplier => 1.1f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class NebulaEffectDef : CustomEffect { public override string ID => "nebulaeffect"; public override string Name => "Nebula"; public override Color Color => new Color(0.6f, 0.4f, 0.8f); public override float Addictiveness => 0.2f; public override int ValueChange => 18; public override float ValueMultiplier => 1.15f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class PhantomEffectDef : CustomEffect { public override string ID => "phantomeffect"; public override string Name => "Phantom"; public override Color Color => new Color(0.1f, 0.1f, 0.35f); public override float Addictiveness => 0.25f; public override int ValueChange => 22; public override float ValueMultiplier => 1.2f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class ProfitBoostEffectDef : CustomEffect { public override string ID => "profitboost"; public override string Name => "Profit Boost"; public override Color Color => new Color(0.2f, 0.9f, 0.2f); public override float Addictiveness => 0.15f; public override int ValueChange => 0; public override float ValueMultiplier => 1f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class SingleEventUpsetEffectDef : CustomEffect { public override string ID => "singleeventupset"; public override string Name => "Single Event Upset"; public override Color Color => new Color(0f, 0.18f, 0.62f); public override float Addictiveness => 0.4f; public override int ValueChange => 30; public override float ValueMultiplier => 1.2f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class SirenEffectDef : CustomEffect { public override string ID => "sireneffect"; public override string Name => "Siren"; public override Color Color => new Color(0.9f, 0.6f, 0.55f); public override float Addictiveness => 0.3f; public override int ValueChange => 20; public override float ValueMultiplier => 1.25f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class SpicyEffectDef : CustomEffect { public override string ID => "spicyeffect"; public override string Name => "Spicy"; public override Color Color => new Color(1f, 0.18f, 0f); public override float Addictiveness => 0.07f; public override int ValueChange => 10; public override float ValueMultiplier => 1.05f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class HotSauceMapEffectDef : CustomEffect { public override string ID => "hotsaucemap"; public override string Name => "Hot Sauce"; public override Color Color => new Color(1f, 0.18f, 0f); public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class SuperChargeEffectDef : CustomEffect { public override string ID => "supercharge"; public override string Name => "Super Charge"; public override Color Color => new Color(0.5f, 0f, 1f); public override float Addictiveness => 0.2f; public override int ValueChange => 0; public override float ValueMultiplier => 1f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class SuperMagicEffectDef : CustomEffect { public override string ID => "supermagic"; public override string Name => "Super Magic"; public override Color Color => new Color(0.6f, 0f, 1f); public override float Addictiveness => 0.25f; public override int ValueChange => 0; public override float ValueMultiplier => 1f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class SuperMartianEffectDef : CustomEffect { public override string ID => "supermartianeffect"; public override string Name => "Super Martian"; public override Color Color => new Color(0.6f, 0.6f, 0.4f); public override float Addictiveness => 1f; public override int ValueChange => 100; public override float ValueMultiplier => 1.5f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class SuperSuperChargeEffectDef : CustomEffect { public override string ID => "supersupercharge"; public override string Name => "Superercharge"; public override Color Color => new Color(0.8f, 0f, 1f); public override float Addictiveness => 0.3f; public override int ValueChange => 0; public override float ValueMultiplier => 1f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class TallEffectDef : CustomEffect { public override string ID => "talleffect"; public override string Name => "Tall"; public override Color Color => new Color(0.4f, 0.8f, 0.4f); public override float Addictiveness => 0.15f; public override int ValueChange => 12; public override float ValueMultiplier => 1.1f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class TrollEffectDef : CustomEffect { public override string ID => "trolleffect"; public override string Name => "Troll"; public override Color Color => new Color(0.2f, 0.8f, 0.2f); public override float Addictiveness => 0.1f; public override int ValueChange => 8; public override float ValueMultiplier => 1.05f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class VoidEffectDef : CustomEffect { public override string ID => "voideffect"; public override string Name => "Void"; public override Color Color => Color.black; public override float Addictiveness => 0.4f; public override int ValueChange => 25; public override float ValueMultiplier => 1.3f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class VoluptuousEffectDef : CustomEffect { public override string ID => "voluptuouseffect"; public override string Name => "Voluptuous"; public override Color Color => new Color(0.9f, 0.1f, 0.3f); public override float Addictiveness => 0.3f; public override int ValueChange => 15; public override float ValueMultiplier => 1.2f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } public class WraithEffectDef : CustomEffect { public override string ID => "wraitheffect"; public override string Name => "Wraith"; public override Color Color => new Color(0.1f, 0.1f, 0.3f); public override float Addictiveness => 0.45f; public override int ValueChange => 40; public override float ValueMultiplier => 1.35f; public override Effect CreateInstance() { return (Effect)(object)ScriptableObject.CreateInstance(); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { internal IgnoresAccessChecksToAttribute(string assemblyName) { } } }