Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of NewtsBargain v1.2.0
NewtsBargain.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Reflection; using System.Runtime.CompilerServices; using System.Text; using System.Text.RegularExpressions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.NewtMonster; using HG; using HarmonyLib; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using RoR2; using RoR2.Achievements; using RoR2.ContentManagement; using RoR2.ExpansionManagement; using RoR2.UI; using RoR2.UI.LogBook; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.UI; [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: AssemblyVersion("0.0.0.0")] namespace NewtsBargain; [BepInPlugin("binma.newtsbargain", "Newt's Bargain", "1.2.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { internal enum ElegyDrop { NewtOnly, LunarPods, Everywhere } internal static class Fixed { internal static readonly On Yes = new On(); } internal class On { internal bool Value => true; } internal static class LoreChance { internal static int Value => 50; } internal static class TalkFade { internal static float Value => 12f; } internal static class OnlyFromNewt { internal static bool Value => true; } internal static class LunarPods { internal static bool Value => ElegyDrops.Value == ElegyDrop.LunarPods; } internal static class Everywhere { internal static bool Value => ElegyDrops.Value == ElegyDrop.Everywhere; } internal static class SilentNewt { internal static bool Value => true; } internal static class TradesPerVisit { internal static int Value => 1; } internal static class ElegyNeedsLunar { internal static bool Value => true; } internal static Plugin Instance; internal static ManualLogSource Log; internal static ConfigEntry<ElegyDrop> ElegyDrops; internal static ConfigEntry<bool> NewtSpeaks; internal static readonly On PearlTrade = Fixed.Yes; internal static readonly On UnkillableNewt = Fixed.Yes; internal static readonly On VoidReflect = Fixed.Yes; internal static readonly On TransmitterTranslates = Fixed.Yes; internal static readonly On Purify = Fixed.Yes; internal static readonly On Refine = Fixed.Yes; internal static readonly On WavyText = Fixed.Yes; internal const string ElegyName = "LunarPortalOnUse"; internal static ConfigEntry<bool> AlwaysTranslate; internal static ConfigEntry<bool> Chatter; internal static int Cost => 1; internal static int RefineCostValue => 3; internal static int IrradiantCostValue => 1; private void Awake() { //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Expected O, but got Unknown Instance = this; Log = ((BaseUnityPlugin)this).Logger; ElegyDrops = ((BaseUnityPlugin)this).Config.Bind<ElegyDrop>("Elegy of Extinction", "Where Elegy drops", ElegyDrop.LunarPods, "NewtOnly: only Newt's barter (and Recyclers, once unlocked). LunarPods: once unlocked, also Lunar Pods on stages (never the Bazaar's). Everywhere: once unlocked, anywhere lunar equipment can drop."); NewtSpeaks = ((BaseUnityPlugin)this).Config.Bind<bool>("Newt", "Newt speaks", true, "Newt talks in his own tongue in the Bazaar and can be talked to. Other mods' chat lines for him stay silent either way."); Chatter = ((BaseUnityPlugin)this).Config.Bind<bool>("Newt", "Newt comments on the Bazaar", true, "Newt remarks on what happens in his shop: greetings, cauldrons, Lunar Buds, portals, being shot, kicking you out and so on. Off: he only speaks when you talk to him, when you barter, and to hint at purifying void items or at Brother's Promise (Enemies Returns)."); AlwaysTranslate = ((BaseUnityPlugin)this).Config.Bind<bool>("Translation", "Always translate Newt", false, "Everyone understands Newt at all times. Set by the host."); try { if (Traverse.Create((object)((BaseUnityPlugin)this).Config).Property("OrphanedEntries", (object[])null).GetValue() is IDictionary { Count: >0 } dictionary) { dictionary.Clear(); ((BaseUnityPlugin)this).Config.Save(); } } catch (Exception ex) { Log.LogWarning((object)("Couldn't tidy old config entries: " + ex.Message)); } NetworkingAPI.RegisterMessageType<NewtFxMessage>(); NetworkingAPI.RegisterMessageType<NewtChatMessage>(); NetworkingAPI.RegisterMessageType<NewtTalkState>(); TradeMenu.Init(); Unlock.Init(); PurifyHint.Init(); RockHint.Init(); EveryOther.Init(); Talk.Init(); Harmony val = new Harmony("binma.newtsbargain"); Type[] types = typeof(Plugin).Assembly.GetTypes(); foreach (Type type in types) { if (type.GetCustomAttributes(typeof(HarmonyPatch), inherit: false).Length != 0) { try { val.CreateClassProcessor(type).Patch(); } catch (Exception ex2) { Log.LogError((object)("Patch " + type.Name + " failed: " + ex2)); } } } Trade.Setup(val); NewtEvents.Init(val); ConstructorCompat.Init(val); } internal static void Delay(float seconds, Action action) { if (Object.op_Implicit((Object)(object)Instance)) { ((MonoBehaviour)Instance).StartCoroutine(DelayRoutine(seconds, action)); } } private static IEnumerator DelayRoutine(float seconds, Action action) { yield return (object)new WaitForSeconds(seconds); try { action(); } catch (Exception ex) { Log.LogError((object)ex); } } } internal static class Trade { internal enum Deal { None, Elegy, Purify, Refine } private static Type erTrader; private static FieldInfo erTake; private static FieldInfo erGive; private static FieldInfo erAvailable; private static MethodInfo erSetAvailable; private static readonly Dictionary<string, int> dealsThisVisit = new Dictionary<string, int>(); private static readonly List<ItemIndex> lunarScratch = new List<ItemIndex>(); private static Dictionary<ItemIndex, List<ItemIndex>> voidPairs; internal static void Setup(Harmony harmony) { //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got Unknown //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Expected O, but got Unknown erTrader = AccessTools.TypeByName("EnemiesReturns.Behaviors.Judgement.Newt.NewtTrader"); if (erTrader != null) { erTake = AccessTools.Field(erTrader, "itemToTake"); erGive = AccessTools.Field(erTrader, "itemToGive"); erAvailable = AccessTools.Field(erTrader, "available"); erSetAvailable = AccessTools.PropertySetter(erTrader, "Networkavailable"); try { harmony.Patch((MethodBase)AccessTools.Method(erTrader, "GetInteractability", (Type[])null, (Type[])null), new HarmonyMethod(typeof(Trade), "ErInteractability", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); harmony.Patch((MethodBase)AccessTools.Method(erTrader, "OnInteractionBegin", (Type[])null, (Type[])null), new HarmonyMethod(typeof(Trade), "ErInteract", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); harmony.Patch((MethodBase)AccessTools.Method(erTrader, "GetContextString", (Type[])null, (Type[])null), new HarmonyMethod(typeof(Trade), "ErContext", (Type[])null), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null); } catch (Exception ex) { Plugin.Log.LogError((object)("Enemies Returns Newt hook failed: " + ex)); } } RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Expected O, but got Unknown try { Type type = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (Assembly assembly in assemblies) { type = assembly.GetType("RefurbishedRoboMando.HiddenSkin", throwOnError: false); if (type != null) { break; } } MethodInfo methodInfo = ((!(type != null)) ? null : AccessTools.Method(type, "ChangeSkin", (Type[])null, (Type[])null)); if (!(methodInfo == null)) { Harmony obj = harmony; MethodInfo methodInfo2 = methodInfo; HarmonyMethod val = new HarmonyMethod(typeof(Trade), "SwallowSkinError", (Type[])null); obj.Patch((MethodBase)methodInfo2, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, val, (HarmonyMethod)null); Plugin.Log.LogInfo((object)"Guarded RoboMando's hidden skin so revives finish."); } } catch (Exception ex2) { Plugin.Log.LogError((object)("RoboMando skin guard failed: " + ex2)); } }); RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(AddOwnTraderIfNeeded)); } private static Exception SwallowSkinError(Exception __exception) { return null; } private static void AddOwnTraderIfNeeded() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) try { GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Shopkeeper/ShopkeeperBody.prefab").WaitForCompletion(); if (!Object.op_Implicit((Object)(object)val) || (erTrader != null && Object.op_Implicit((Object)(object)val.GetComponent(erTrader))) || Object.op_Implicit((Object)(object)val.GetComponent<PearlTrader>())) { return; } val.AddComponent<PearlTrader>(); if (!Object.op_Implicit((Object)(object)val.GetComponent<Highlight>())) { Highlight val2 = val.AddComponent<Highlight>(); Transform val3 = val.transform.Find("ModelBase/mdlNewtShopkeeper/NewtMesh"); if (Object.op_Implicit((Object)(object)val3)) { val2.targetRenderer = ((Component)val3).GetComponent<Renderer>(); } } if (!Object.op_Implicit((Object)(object)val.GetComponent<EntityLocator>())) { val.AddComponent<EntityLocator>().entity = val; } Plugin.Log.LogInfo((object)"Added the pearl trade to Newt."); } catch (Exception ex) { Plugin.Log.LogError((object)("Newt setup failed: " + ex)); } } internal static Inventory Inv(Interactor activator) { if (!Object.op_Implicit((Object)(object)activator)) { return null; } CharacterBody component = ((Component)activator).GetComponent<CharacterBody>(); return (!Object.op_Implicit((Object)(object)component)) ? null : component.inventory; } internal static void ResetVisit() { dealsThisVisit.Clear(); } private static uint Key(Inventory inv) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) NetworkIdentity val = ((!Object.op_Implicit((Object)(object)inv)) ? null : ((Component)inv).GetComponent<NetworkIdentity>()); int result; if (Object.op_Implicit((Object)(object)val)) { NetworkInstanceId netId = val.netId; result = (int)((NetworkInstanceId)(ref netId)).Value; } else { result = 0; } return (uint)result; } private static int Used(Inventory inv, Deal d) { dealsThisVisit.TryGetValue(Key(inv) + ":" + d, out var value); return value; } private static void Count(Inventory inv, Deal d) { dealsThisVisit[Key(inv) + ":" + d] = Used(inv, d) + 1; } private static int Pearls(Inventory inv) { return Object.op_Implicit((Object)(object)inv) ? inv.GetItemCountPermanent(Items.Pearl) : 0; } private static int Irradiants(Inventory inv) { return Object.op_Implicit((Object)(object)inv) ? inv.GetItemCountPermanent(Items.ShinyPearl) : 0; } internal static ItemIndex LunarToTake(Inventory inv, bool random) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Invalid comparison between Unknown and I4 //IL_005a: 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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) lunarScratch.Clear(); if (!Object.op_Implicit((Object)(object)inv)) { return (ItemIndex)(-1); } foreach (ItemIndex item in inv.itemAcquisitionOrder) { ItemDef itemDef = ItemCatalog.GetItemDef(item); if (Object.op_Implicit((Object)(object)itemDef) && (int)itemDef.tier == 3 && !itemDef.hidden && inv.GetItemCountPermanent(item) > 0 && !((Object)(object)itemDef == (Object)(object)Items.LunarPrimaryReplacement) && !((Object)(object)itemDef == (Object)(object)Items.LunarSecondaryReplacement) && !((Object)(object)itemDef == (Object)(object)Items.LunarUtilityReplacement) && !((Object)(object)itemDef == (Object)(object)Items.LunarSpecialReplacement)) { lunarScratch.Add(item); } } if (lunarScratch.Count == 0) { return (ItemIndex)(-1); } return (!random) ? lunarScratch[0] : lunarScratch[Random.Range(0, lunarScratch.Count)]; } private static Dictionary<ItemIndex, List<ItemIndex>> VoidPairs() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_008a: 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 (voidPairs != null) { return voidPairs; } voidPairs = new Dictionary<ItemIndex, List<ItemIndex>>(); try { Enumerator<Pair> enumerator = ItemCatalog.GetItemPairsForRelationship(ItemRelationshipTypes.ContagiousItem).GetEnumerator(); try { while (enumerator.MoveNext()) { Pair current = enumerator.Current; if (Object.op_Implicit((Object)(object)current.itemDef1) && Object.op_Implicit((Object)(object)current.itemDef2)) { if (!voidPairs.TryGetValue(current.itemDef2.itemIndex, out var value)) { value = (voidPairs[current.itemDef2.itemIndex] = new List<ItemIndex>()); } if (!value.Contains(current.itemDef1.itemIndex)) { value.Add(current.itemDef1.itemIndex); } } } } finally { ((IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose(); } } catch (Exception ex) { Plugin.Log.LogError((object)ex); } return voidPairs; } internal static bool HasVoidItem(Inventory inv) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)inv)) { return false; } Dictionary<ItemIndex, List<ItemIndex>> dictionary = VoidPairs(); foreach (ItemIndex item in inv.itemAcquisitionOrder) { if (dictionary.ContainsKey(item) && inv.GetItemCountPermanent(item) > 0) { return true; } } return false; } private static bool NeedsIrradiant(ItemDef voidDef) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Invalid comparison between Unknown and I4 //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Invalid comparison between Unknown and I4 return (int)voidDef.tier == 8 || (int)voidDef.tier == 9; } internal static ItemIndex VoidToPurify(Inventory inv) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)inv)) { Dictionary<ItemIndex, List<ItemIndex>> dictionary = VoidPairs(); foreach (ItemIndex item in inv.itemAcquisitionOrder) { if (dictionary.ContainsKey(item) && inv.GetItemCountPermanent(item) > 0) { ItemDef itemDef = ItemCatalog.GetItemDef(item); if (Object.op_Implicit((Object)(object)itemDef) && ((!NeedsIrradiant(itemDef)) ? (Pearls(inv) >= 1) : (Irradiants(inv) >= 1))) { return item; } } } return (ItemIndex)(-1); } return (ItemIndex)(-1); } internal static Deal NextDeal(Inventory inv) { //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Invalid comparison between Unknown and I4 //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)inv)) { return Deal.None; } if (Plugin.PearlTrade.Value && Used(inv, Deal.Elegy) < Math.Max(1, Plugin.TradesPerVisit.Value) && (Pearls(inv) >= Plugin.Cost || Irradiants(inv) >= Plugin.IrradiantCostValue) && (!Plugin.ElegyNeedsLunar.Value || (int)LunarToTake(inv, random: false) != -1)) { return Deal.Elegy; } if (Plugin.Purify.Value && Used(inv, Deal.Purify) < 1 && (int)VoidToPurify(inv) != -1) { return Deal.Purify; } if (Plugin.Refine.Value && Used(inv, Deal.Refine) < 1 && Pearls(inv) >= Plugin.RefineCostValue) { return Deal.Refine; } return Deal.None; } internal static bool HasPearl(Inventory inv) { return NextDeal(inv) != Deal.None; } internal static bool ElegyAvailable(Inventory inv) { //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Invalid comparison between Unknown and I4 return Object.op_Implicit((Object)(object)inv) && Plugin.PearlTrade.Value && Used(inv, Deal.Elegy) < Math.Max(1, Plugin.TradesPerVisit.Value) && (Pearls(inv) >= Plugin.Cost || Irradiants(inv) >= Plugin.IrradiantCostValue) && (!Plugin.ElegyNeedsLunar.Value || (int)LunarToTake(inv, random: false) != -1); } internal static bool ElegyOffered() { return Plugin.PearlTrade.Value; } internal static bool ElegyDone(Inventory inv) { return Used(inv, Deal.Elegy) >= Math.Max(1, Plugin.TradesPerVisit.Value); } internal static string ElegyCost(Inventory inv) { string text = ((Pearls(inv) >= Plugin.Cost || Irradiants(inv) < Plugin.IrradiantCostValue) ? ((Plugin.Cost != 1) ? (Plugin.Cost + " Pearls") : "1 Pearl") : ((Plugin.IrradiantCostValue != 1) ? (Plugin.IrradiantCostValue + " Irradiant Pearls") : "1 Irradiant Pearl")); return (!Plugin.ElegyNeedsLunar.Value) ? text : (text + " + a lunar item"); } internal static bool RefineAvailable(Inventory inv) { return Object.op_Implicit((Object)(object)inv) && Plugin.Refine.Value && Used(inv, Deal.Refine) < 1 && Pearls(inv) >= Plugin.RefineCostValue; } internal static bool RefineDone(Inventory inv) { return Used(inv, Deal.Refine) >= 1; } internal static bool PurifyOffered(Inventory inv) { return Object.op_Implicit((Object)(object)inv) && Plugin.Purify.Value && Used(inv, Deal.Purify) < 1 && HasVoidItem(inv); } internal static bool RockAvailable(Component trader, Inventory inv) { return Object.op_Implicit((Object)(object)trader) && ErRock(trader, inv); } internal static ItemDef RockGive(Component trader) { return (ItemDef)((!Object.op_Implicit((Object)(object)trader) || !(erGive != null)) ? null : /*isinst with value type is only supported in some contexts*/); } internal static ItemDef RockTake(Component trader) { return (ItemDef)((!Object.op_Implicit((Object)(object)trader) || !(erTake != null)) ? null : /*isinst with value type is only supported in some contexts*/); } internal static void DoRock(Component trader, Inventory inv) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (RockAvailable(trader, inv)) { ItemDef val = (ItemDef)erTake.GetValue(trader); object? value = erGive.GetValue(trader); ItemDef val2 = (ItemDef)((value is ItemDef) ? value : null); inv.RemoveItemPermanent(val, inv.GetItemCountPermanent(val)); if (erSetAvailable != null) { erSetAvailable.Invoke(trader, new object[1] { false }); } if (Object.op_Implicit((Object)(object)val2)) { Give(trader.gameObject, PickupCatalog.FindPickupIndex(val2.itemIndex)); } NewtVoice.Say(NewtVoice.RockLines); } } private static string Name(ItemIndex i) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) ItemDef itemDef = ItemCatalog.GetItemDef(i); return (!Object.op_Implicit((Object)(object)itemDef)) ? "?" : Language.GetString(itemDef.nameToken); } internal static string ContextFor(Inventory inv) { switch (NextDeal(inv)) { case Deal.Elegy: { string text = ((Pearls(inv) >= Plugin.Cost) ? ((Plugin.Cost != 1) ? (Plugin.Cost + " Pearls") : "a Pearl") : ((Plugin.IrradiantCostValue != 1) ? (Plugin.IrradiantCostValue + " Irradiant Pearls") : "an Irradiant Pearl")); return (!Plugin.ElegyNeedsLunar.Value) ? ("Offer " + text) : ("Offer a lunar item and " + text); } case Deal.Purify: return "Purify a void item"; case Deal.Refine: return "Offer " + Plugin.RefineCostValue + " Pearls"; default: return string.Empty; } } internal static void PearlTrade(GameObject newt, Inventory inv) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Invalid comparison between Unknown and I4 //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) switch (NextDeal(inv)) { case Deal.Elegy: ElegyTrade(newt, inv); break; case Deal.Purify: { ItemIndex val = VoidToPurify(inv); if ((int)val != -1) { DoPurify(newt, inv, val, RollResult(val)); } break; } case Deal.Refine: RefineTrade(newt, inv); break; } } internal static void ElegyTrade(GameObject newt, Inventory inv) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Invalid comparison between Unknown and I4 //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) EquipmentIndex val = EquipmentCatalog.FindEquipmentIndex("LunarPortalOnUse"); if ((int)val == -1) { Plugin.Log.LogWarning((object)"Elegy of Extinction not found."); return; } if (Plugin.ElegyNeedsLunar.Value) { ItemIndex val2 = LunarToTake(inv, random: true); if ((int)val2 == -1) { return; } inv.RemoveItemPermanent(val2, 1); } Count(inv, Deal.Elegy); if (Pearls(inv) >= Plugin.Cost) { inv.RemoveItemPermanent(Items.Pearl, Plugin.Cost); } else { inv.RemoveItemPermanent(Items.ShinyPearl, Plugin.IrradiantCostValue); } Give(newt, PickupCatalog.FindPickupIndex(val)); NewtVoice.Say(NewtVoice.PearlLines); NewtFxMessage.Send(((Component)inv).gameObject, 2); } internal static ItemIndex RollResult(ItemIndex v) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) if ((int)v == -1 || !VoidPairs().TryGetValue(v, out var value) || value.Count == 0) { return (ItemIndex)(-1); } List<ItemIndex> list = value.FindAll((ItemIndex o) => Object.op_Implicit((Object)(object)Run.instance) && Run.instance.IsItemAvailable(o)); if (list.Count == 0) { list = value; } return list[Random.Range(0, list.Count)]; } internal static bool IsVoid(ItemIndex i) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return VoidPairs().ContainsKey(i); } internal static List<ItemIndex> Counterparts(ItemIndex v) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) if (!VoidPairs().TryGetValue(v, out var value)) { return new List<ItemIndex>(); } List<ItemIndex> list = value.FindAll((ItemIndex o) => !Object.op_Implicit((Object)(object)Run.instance) || Run.instance.IsItemAvailable(o)); return (list.Count <= 0) ? value : list; } internal static bool CostsIrradiant(ItemIndex v) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) ItemDef itemDef = ItemCatalog.GetItemDef(v); return Object.op_Implicit((Object)(object)itemDef) && NeedsIrradiant(itemDef); } internal static bool CanAfford(Inventory inv, ItemIndex v) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) return (!CostsIrradiant(v)) ? (Pearls(inv) >= 1) : (Irradiants(inv) >= 1); } internal static int PearlCount(Inventory inv) { return Pearls(inv); } internal static int IrradiantCount(Inventory inv) { return Irradiants(inv); } internal static bool PurifyUsed(Inventory inv) { return Used(inv, Deal.Purify) >= 1; } internal static void DoPurify(GameObject newt, Inventory inv, ItemIndex v, ItemIndex result) { //IL_0000: 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) //IL_0014: Invalid comparison between Unknown and I4 //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_0074: Unknown result type (might be due to invalid IL or missing references) ItemDef itemDef = ItemCatalog.GetItemDef(v); if (!Object.op_Implicit((Object)(object)itemDef) || (int)result == -1) { return; } Count(inv, Deal.Purify); PurifyHint.purifiedThisRun = true; int itemCountPermanent = inv.GetItemCountPermanent(v); inv.RemoveItemPermanent((!NeedsIrradiant(itemDef)) ? Items.Pearl : Items.ShinyPearl, 1); inv.RemoveItemPermanent(v, itemCountPermanent); inv.GiveItemPermanent(result, itemCountPermanent); CharacterMaster component = ((Component)inv).GetComponent<CharacterMaster>(); if (Object.op_Implicit((Object)(object)component)) { try { CharacterMasterNotificationQueue.SendTransformNotification(component, v, result, (TransformationType)0); } catch { } } NewtFxMessage.Send(newt, 4); NewtVoice.Say(NewtVoice.PurifyLines); Talk.Sync(inv); } internal static void RefineTrade(GameObject newt, Inventory inv) { //IL_001d: 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) Count(inv, Deal.Refine); inv.RemoveItemPermanent(Items.Pearl, Plugin.RefineCostValue); Give(newt, PickupCatalog.FindPickupIndex(Items.ShinyPearl.itemIndex)); NewtVoice.Say(NewtVoice.RefineLines); } private static bool ErRock(object trader, Inventory inv) { if (!Object.op_Implicit((Object)(object)inv) || erTake == null) { return false; } bool flag = erAvailable != null && (bool)erAvailable.GetValue(trader); object? value = erTake.GetValue(trader); ItemDef val = (ItemDef)((value is ItemDef) ? value : null); return flag && Object.op_Implicit((Object)(object)val) && inv.GetItemCountPermanent(val) > 0; } private static bool ErInteractability(object __instance, Interactor __0, ref Interactability __result) { try { Inventory inv = Inv(__0); __result = (Interactability)((Talk.NeedsIntro(inv) || ErRock(__instance, inv) || HasPearl(inv) || Talk.CanChat(inv)) ? 2 : 0); return false; } catch (Exception ex) { Plugin.Log.LogError((object)ex); return true; } } private static bool ErContext(object __instance, Interactor __0, ref string __result) { try { Inventory inv = Inv(__0); if (Talk.NeedsIntro(inv)) { __result = "Talk to Newt"; return false; } if (Talk.FirstOfVisit(inv)) { __result = "Talk to Newt"; return false; } if (ErRock(__instance, inv) || HasPearl(inv)) { __result = "Barter"; return false; } if (Talk.CanChat(inv)) { __result = "Talk to Newt"; return false; } } catch (Exception ex) { Plugin.Log.LogError((object)ex); } return true; } private static bool ErInteract(object __instance, Interactor __0) { try { if (!NetworkServer.active) { return false; } Component val = (Component)((__instance is Component) ? __instance : null); Inventory val2 = Inv(__0); if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val2)) { return false; } if (Talk.NeedsIntro(val2)) { Talk.Intro(__0, val2); return false; } if (Talk.FirstOfVisit(val2)) { Talk.Chat(val2); } else if (ErRock(__instance, val2) || HasPearl(val2)) { TradeMenu.Open(val.gameObject, val2, val, __0); } else if (Talk.CanChat(val2)) { Talk.Chat(val2); } } catch (Exception ex) { Plugin.Log.LogError((object)ex); } return false; } internal static void Give(GameObject newt, PickupIndex pickup) { //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) NetworkIdentity component = newt.GetComponent<NetworkIdentity>(); NewtFxMessage.Send(newt, 0); Plugin.Delay(1.2f, delegate { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0060: 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) if (Object.op_Implicit((Object)(object)newt) && NetworkServer.active) { Vector3 val = Vector3.up * 20f + newt.transform.forward * 8f; PickupDropletController.CreatePickupDroplet(new UniquePickup(pickup), newt.transform.position, val, false); } }); } internal static void PlayTalk(GameObject newt) { CharacterBody component = newt.GetComponent<CharacterBody>(); Transform val = ((!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.modelLocator)) ? null : component.modelLocator.modelTransform); Animator val2 = ((!Object.op_Implicit((Object)(object)val)) ? null : ((Component)val).GetComponent<Animator>()); if (Object.op_Implicit((Object)(object)val2)) { int layerIndex = val2.GetLayerIndex("Body"); if (layerIndex >= 0) { val2.Play("Spawn", layerIndex, 0.25f); } } } internal static void PurifyStomp(GameObject newt) { CharacterBody component = newt.GetComponent<CharacterBody>(); Transform val = ((!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.modelLocator)) ? null : component.modelLocator.modelTransform); Animator val2 = ((!Object.op_Implicit((Object)(object)val)) ? null : ((Component)val).GetComponent<Animator>()); if (Object.op_Implicit((Object)(object)val2)) { newt.AddComponent<StompLightning>().anim = val2; } } internal static void PlayFx(GameObject newt) { CharacterBody component = newt.GetComponent<CharacterBody>(); Transform val = ((!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.modelLocator)) ? null : component.modelLocator.modelTransform); Animator val2 = ((!Object.op_Implicit((Object)(object)val)) ? null : ((Component)val).GetComponent<Animator>()); if (Object.op_Implicit((Object)(object)val2)) { int layerIndex = val2.GetLayerIndex("Body"); if (layerIndex >= 0) { val2.SetFloat("Stomp.playbackRate", 1f); val2.Play("Stomp", layerIndex, 0f); } } string spawnSoundString = SpawnState.spawnSoundString; if (!string.IsNullOrEmpty(spawnSoundString)) { Util.PlaySound(spawnSoundString, newt); } } } public class StompLightning : MonoBehaviour { internal Animator anim; private float age; private void FixedUpdate() { age += Time.fixedDeltaTime; if (!Object.op_Implicit((Object)(object)anim) || age > 4f) { Object.Destroy((Object)(object)this); } else if (!(anim.GetFloat("Stomp.hitBoxActive") <= 0.5f)) { string stompSoundString = KickFromShop.stompSoundString; if (!string.IsNullOrEmpty(stompSoundString)) { Util.PlaySound(stompSoundString, ((Component)this).gameObject); } GameObject stompEffectPrefab = KickFromShop.stompEffectPrefab; if (Object.op_Implicit((Object)(object)stompEffectPrefab)) { EffectManager.SimpleMuzzleFlash(stompEffectPrefab, ((Component)this).gameObject, "HealthBarOrigin", false); } Object.Destroy((Object)(object)this); } } } public class PearlTrader : MonoBehaviour, IInteractable { public string GetContextString(Interactor activator) { Inventory inv = Trade.Inv(activator); if (Talk.NeedsIntro(inv) || Talk.FirstOfVisit(inv)) { return "Talk to Newt"; } if (Trade.HasPearl(inv)) { return "Barter"; } return "Talk to Newt"; } public Interactability GetInteractability(Interactor activator) { Inventory inv = Trade.Inv(activator); return (Interactability)((Talk.NeedsIntro(inv) || Trade.HasPearl(inv) || Talk.CanChat(inv)) ? 2 : 0); } public void OnInteractionBegin(Interactor activator) { if (NetworkServer.active) { Inventory inv = Trade.Inv(activator); if (Talk.NeedsIntro(inv)) { Talk.Intro(activator, inv); } else if (Talk.FirstOfVisit(inv)) { Talk.Chat(inv); } else if (Trade.HasPearl(inv)) { TradeMenu.Open(((Component)this).gameObject, inv, null, activator); } else if (Talk.CanChat(inv)) { Talk.Chat(inv); } } } public bool ShouldIgnoreSpherecastForInteractibility(Interactor activator) { return false; } public bool ShouldShowOnScanner() { return false; } public bool ShouldProximityHighlight() { return true; } public int GetInteractablePriority(Interactor activator) { return 0; } public bool ShouldSpawnLesserInteractionRewards(Interactor activator) { return false; } } public class NewtChatMessage : INetMessage, ISerializableObject { private NetworkInstanceId user; private string text; private bool keep; private static readonly FieldInfo logField = AccessTools.Field(typeof(Chat), "log"); private static readonly MethodInfo buildChat = AccessTools.Method(typeof(ChatBox), "BuildChat", (Type[])null, (Type[])null); private static readonly MethodInfo scrollToBottom = AccessTools.Method(typeof(ChatBox), "ScrollToBottom", (Type[])null, (Type[])null); public NewtChatMessage() { } public NewtChatMessage(NetworkInstanceId user, string text, bool keep) { //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) this.user = user; this.text = text; this.keep = keep; } public void Serialize(NetworkWriter writer) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) writer.Write(user); writer.Write(text); writer.Write(keep); } private static void RemoveFromChat(string text) { try { List<string> list = ((!(logField != null)) ? null : (logField.GetValue(null) as List<string>)); if (list == null) { return; } int num = list.LastIndexOf(text); if (num < 0) { return; } list.RemoveAt(num); ChatBox[] array = Object.FindObjectsOfType<ChatBox>(); foreach (ChatBox val in array) { if (Object.op_Implicit((Object)(object)val) && ((Behaviour)val).enabled) { if (buildChat != null) { buildChat.Invoke(val, null); } if (scrollToBottom != null) { scrollToBottom.Invoke(val, null); } } } } catch (Exception ex) { Plugin.Log.LogError((object)ex); } } public void Deserialize(NetworkReader reader) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) user = reader.ReadNetworkId(); text = reader.ReadString(); keep = reader.ReadBoolean(); } public void OnReceived() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) try { foreach (NetworkUser readOnlyLocalPlayers in NetworkUser.readOnlyLocalPlayersList) { if (!Object.op_Implicit((Object)(object)readOnlyLocalPlayers) || !(((NetworkBehaviour)readOnlyLocalPlayers).netId == user)) { continue; } Chat.AddMessage(text); float value = Plugin.TalkFade.Value; if (value > 0f && !keep) { List<string> list = ((!(logField != null)) ? null : (logField.GetValue(null) as List<string>)); string stored = ((list == null || list.Count <= 0) ? text : list[list.Count - 1]); Plugin.Delay(value, delegate { RemoveFromChat(stored); }); } break; } } catch (Exception ex) { Plugin.Log.LogError((object)ex); } } } public class NewtTalkState : INetMessage, ISerializableObject { private uint key; private bool intro; private bool chat; private bool first; public NewtTalkState() { } public NewtTalkState(uint key, bool intro, bool chat, bool first) { this.key = key; this.intro = intro; this.chat = chat; this.first = first; } public void Serialize(NetworkWriter writer) { writer.Write(key); writer.Write(intro); writer.Write(chat); writer.Write(first); } public void Deserialize(NetworkReader reader) { key = reader.ReadUInt32(); intro = reader.ReadBoolean(); chat = reader.ReadBoolean(); first = reader.ReadBoolean(); } public void OnReceived() { if (!NetworkServer.active) { Talk.ClientState(key, intro, chat, first); } } } public class NewtFxMessage : INetMessage, ISerializableObject { internal const string VoiceSound = "Play_newtShopkeep_VO"; private NetworkInstanceId id; private byte mode; public NewtFxMessage() { } public NewtFxMessage(NetworkInstanceId id, byte mode = 0) { //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) this.id = id; this.mode = mode; } public void Serialize(NetworkWriter writer) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) writer.Write(id); writer.Write(mode); } public void Deserialize(NetworkReader reader) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) id = reader.ReadNetworkId(); mode = reader.ReadByte(); } public void OnReceived() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) try { GameObject val = Util.FindNetworkObject(id); if (!Object.op_Implicit((Object)(object)val)) { return; } if (mode == 2) { if (NewtsBargainAchievement.Traded != null) { NewtsBargainAchievement.Traded(val); } } else if (mode == 1) { Util.PlaySound("Play_newtShopkeep_VO", val); } else if (mode == 3) { Trade.PlayTalk(val); } else if (mode == 4) { Trade.PlayFx(val); Trade.PurifyStomp(val); } else { Trade.PlayFx(val); } } catch (Exception ex) { Plugin.Log.LogError((object)ex); } } internal static void Send(GameObject newt, byte mode) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) NetworkIdentity val = ((!Object.op_Implicit((Object)(object)newt)) ? null : newt.GetComponent<NetworkIdentity>()); if (Object.op_Implicit((Object)(object)val)) { NetMessageExtensions.Send((INetMessage)(object)new NewtFxMessage(val.netId, mode), (NetworkDestination)1); } } } internal static class SilentNewt { internal static bool Blocked(ChatMessageBase msg) { if (NewtVoice.Speaking || !Plugin.SilentNewt.Value || msg == null) { return false; } string value = Traverse.Create((object)msg).Field("baseToken").GetValue<string>(); if (string.IsNullOrEmpty(value)) { return false; } return value.StartsWith("ENEMIES_RETURNS_JUDGEMENT_NEWT", StringComparison.Ordinal) || value.IndexOf("SHOPKEEPER", StringComparison.OrdinalIgnoreCase) >= 0 || value.IndexOf("NEWT_", StringComparison.OrdinalIgnoreCase) >= 0; } } internal static class Talk { private static readonly Dictionary<uint, int> introStep = new Dictionary<uint, int>(); private static readonly Dictionary<uint, int> toldAtStage = new Dictionary<uint, int>(); private static readonly HashSet<uint> reminded = new HashSet<uint>(); private static readonly Dictionary<uint, int> talksThisVisit = new Dictionary<uint, int>(); private static readonly HashSet<string> loreSaid = new HashSet<string>(); private static readonly Dictionary<uint, int> metAtStage = new Dictionary<uint, int>(); private static readonly Dictionary<uint, bool> loreNext = new Dictionary<uint, bool>(); private static readonly Dictionary<uint, bool> hintNext = new Dictionary<uint, bool>(); private static readonly Dictionary<uint, bool> clientIntro = new Dictionary<uint, bool>(); private static readonly Dictionary<uint, bool> clientChat = new Dictionary<uint, bool>(); private static readonly Dictionary<uint, bool> clientFirst = new Dictionary<uint, bool>(); internal const string Context = "Talk to Newt"; private static readonly FieldInfo unlockablesField = AccessTools.Field(typeof(NetworkUser), "unlockables"); internal static void ClientState(uint key, bool intro, bool chat, bool first) { clientIntro[key] = intro; clientChat[key] = chat; clientFirst[key] = first; } internal static void Init() { Run.onRunStartGlobal += delegate { clientIntro.Clear(); clientChat.Clear(); loreNext.Clear(); hintNext.Clear(); }; Stage.onStageStartGlobal += delegate { clientChat.Clear(); clientFirst.Clear(); }; Run.onRunStartGlobal += delegate { introStep.Clear(); toldAtStage.Clear(); reminded.Clear(); talksThisVisit.Clear(); loreSaid.Clear(); metAtStage.Clear(); }; Stage.onServerStageBegin += delegate { talksThisVisit.Clear(); loreNext.Clear(); hintNext.Clear(); }; } private static uint Key(Inventory inv) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) NetworkIdentity val = ((!Object.op_Implicit((Object)(object)inv)) ? null : ((Component)inv).GetComponent<NetworkIdentity>()); int result; if (Object.op_Implicit((Object)(object)val)) { NetworkInstanceId netId = val.netId; result = (int)((NetworkInstanceId)(ref netId)).Value; } else { result = 0; } return (uint)result; } internal static bool NeedsIntro(Inventory inv) { if (!Object.op_Implicit((Object)(object)inv) || !Plugin.NewtSpeaks.Value) { return false; } bool value; if (!NetworkServer.active) { return !clientIntro.TryGetValue(Key(inv), out value) || value; } introStep.TryGetValue(Key(inv), out var value2); return value2 < 2; } private static bool ReminderDue(Inventory inv) { uint num = Key(inv); if (reminded.Contains(num) || !toldAtStage.TryGetValue(num, out var value) || !Object.op_Implicit((Object)(object)Run.instance)) { return false; } return Run.instance.stageClearCount >= value + 2; } internal static bool FirstOfVisit(Inventory inv) { if (!Object.op_Implicit((Object)(object)inv) || !Plugin.NewtSpeaks.Value) { return false; } bool value; if (!NetworkServer.active) { return !clientFirst.TryGetValue(Key(inv), out value) || value; } if (ReminderDue(inv)) { return true; } talksThisVisit.TryGetValue(Key(inv), out var value2); return value2 == 0; } internal static bool CanChat(Inventory inv) { if (!Object.op_Implicit((Object)(object)inv) || !Plugin.NewtSpeaks.Value) { return false; } bool value; if (!NetworkServer.active) { return !clientChat.TryGetValue(Key(inv), out value) || value; } if (ReminderDue(inv)) { return true; } talksThisVisit.TryGetValue(Key(inv), out var value2); if (value2 == 0) { return true; } return value2 == 1 && loreNext.TryGetValue(Key(inv), out value) && value; } internal static void Sync(Inventory inv) { try { if (NetworkServer.active && Object.op_Implicit((Object)(object)inv)) { NetMessageExtensions.Send((INetMessage)(object)new NewtTalkState(Key(inv), NeedsIntro(inv), CanChat(inv), FirstOfVisit(inv)), (NetworkDestination)1); } } catch (Exception ex) { Plugin.Log.LogError((object)ex); } } private static bool IntroVisit(Inventory inv) { int value; return Object.op_Implicit((Object)(object)Run.instance) && metAtStage.TryGetValue(Key(inv), out value) && Run.instance.stageClearCount == value; } private static void Animate() { } private static NetworkUser UserOf(Inventory inv) { CharacterMaster val = ((!Object.op_Implicit((Object)(object)inv)) ? null : ((Component)inv).GetComponent<CharacterMaster>()); return (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val.playerCharacterMasterController)) ? null : val.playerCharacterMasterController.networkUser; } internal static void Intro(Interactor who, Inventory inv) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) uint key = Key(inv); introStep.TryGetValue(key, out var value); introStep[key] = value + 1; Animate(); NetworkUser target = UserOf(inv); if (value == 0) { metAtStage[key] = (Object.op_Implicit((Object)(object)Run.instance) ? Run.instance.stageClearCount : 0); CharacterBody val = ((!Object.op_Implicit((Object)(object)who)) ? null : ((Component)who).GetComponent<CharacterBody>()); string bodyName = ((!Object.op_Implicit((Object)(object)val)) ? string.Empty : (BodyCatalog.GetBodyName(val.bodyIndex) ?? string.Empty)); NewtVoice.Say(new Line[1] { CharacterLine(bodyName) }, 0.3f, target); } else { NewtVoice.Say(NewtVoice.TradeIntro, 0.3f, target, keep: true); toldAtStage[key] = (Object.op_Implicit((Object)(object)Run.instance) ? Run.instance.stageClearCount : 0); } Sync(inv); } internal static void Chat(Inventory inv) { uint num = Key(inv); if (ReminderDue(inv)) { reminded.Add(num); Animate(); NewtVoice.Say(NewtVoice.TradeIntro, 0.3f, UserOf(inv), keep: true); Sync(inv); return; } talksThisVisit.TryGetValue(num, out var value); talksThisVisit[num] = value + 1; Animate(); NetworkUser target = UserOf(inv); switch (value) { case 0: { NewtVoice.Say(StageLineFor(inv, num), 0.3f, target); bool flag = !IntroVisit(inv) && RockHint.Rolls(inv); hintNext[num] = flag; loreNext[num] = flag || (!IntroVisit(inv) && LoreCandidates().Count > 0 && Random.Range(0, 100) < Plugin.LoreChance.Value); break; } case 1: { if (hintNext.TryGetValue(num, out var value2) && value2) { NewtVoice.Say(NewtVoice.RockHintLines, 0.3f, target); RockHint.Said(); } else { Line[] array = LorePool(); if (array.Length > 0) { NewtVoice.Say(array, 0.3f, target); } } loreNext[num] = false; hintNext[num] = false; break; } } Sync(inv); } private static Line CharacterLine(string bodyName) { if (bodyName == "MageBody") { if (!EveryoneHasArtificer()) { return NewtVoice.ArtificerStillFrozen; } return (NetworkUser.readOnlyInstancesList.Count <= 1) ? NewtVoice.ArtificerAlone : NewtVoice.ArtificerWithCompany; } if (NewtVoice.CharacterLines.TryGetValue(bodyName, out var value)) { return value; } if (bodyName.IndexOf("Chirr", StringComparison.OrdinalIgnoreCase) >= 0 && NewtVoice.CharacterLines.TryGetValue("ChirrBody", out value)) { return value; } if (bodyName.IndexOf("Heretic", StringComparison.OrdinalIgnoreCase) >= 0 && NewtVoice.CharacterLines.TryGetValue("HereticBody", out value)) { return value; } return NewtVoice.NewFace; } private static Line[] StageLineFor(Inventory inv, uint k) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) CharacterMaster val = ((!Object.op_Implicit((Object)(object)inv)) ? null : ((Component)inv).GetComponent<CharacterMaster>()); CharacterBody val2 = ((!Object.op_Implicit((Object)(object)val)) ? null : val.GetBody()); string bodyName = ((!Object.op_Implicit((Object)(object)val2)) ? string.Empty : (BodyCatalog.GetBodyName(val2.bodyIndex) ?? string.Empty)); int num = ((!Object.op_Implicit((Object)(object)Run.instance)) ? 1 : Run.instance.stageClearCount); if (num < 5) { Line[] array = OwnLines(NewtVoice.CharacterStage, bodyName); return (array == null) ? StageLines() : new Line[1] { array[Math.Max(0, Math.Min(3, num - 1))] }; } Line[][] array2 = OwnLines(NewtVoice.CharacterLoop, bodyName); if (array2 == null) { return NewtVoice.TalkLoop; } int num2 = num % 5; return array2[(num2 != 0) ? (num2 - 1) : 3]; } private static T OwnLines<T>(Dictionary<string, T> table, string bodyName) where T : class { if (table.TryGetValue(bodyName, out var value)) { return value; } if (bodyName.IndexOf("Chirr", StringComparison.OrdinalIgnoreCase) >= 0 && table.TryGetValue("ChirrBody", out value)) { return value; } if (bodyName.IndexOf("Heretic", StringComparison.OrdinalIgnoreCase) >= 0 && table.TryGetValue("HereticBody", out value)) { return value; } return (T)null; } private static Line[] StageLines() { int num = ((!Object.op_Implicit((Object)(object)Run.instance)) ? 1 : Run.instance.stageClearCount); if (num >= 5) { return NewtVoice.TalkLoop; } if (num == 4) { return NewtVoice.TalkStage45; } if (num >= 2) { return NewtVoice.TalkStage23; } return NewtVoice.TalkStage1; } private static Line[] LorePool() { List<Line> list = LoreCandidates(); if (list.Count == 0) { return new Line[0]; } Line line = list[Random.Range(0, list.Count)]; loreSaid.Add(line.Tongue); return new Line[1] { line }; } private static List<Line> LoreCandidates() { List<Line> list = new List<Line>(); LoreLine[] lore = NewtVoice.Lore; for (int i = 0; i < lore.Length; i++) { LoreLine loreLine = lore[i]; if (!loreSaid.Contains(loreLine.line.Tongue) && (loreLine.dlc == null || Dlc(loreLine.dlc)) && (!loreLine.needsArtificerFree || EveryoneHasArtificer())) { list.Add(loreLine.line); } } return list; } internal static bool Dlc(string name) { //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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) try { Run instance = Run.instance; if (!Object.op_Implicit((Object)(object)instance)) { return false; } Enumerator<ExpansionDef> enumerator = ExpansionCatalog.expansionDefs.GetEnumerator(); try { while (enumerator.MoveNext()) { ExpansionDef current = enumerator.Current; if (Object.op_Implicit((Object)(object)current) && ((Object)current).name == name) { return instance.IsExpansionEnabled(current); } } } finally { ((IDisposable)enumerator/*cast due to .constrained prefix*/).Dispose(); } } catch (Exception ex) { Plugin.Log.LogError((object)ex); } return false; } internal static bool EveryoneHasArtificer() { try { UnlockableDef unlockableDef = UnlockableCatalog.GetUnlockableDef("Characters.Mage"); if (!Object.op_Implicit((Object)(object)unlockableDef) || unlockablesField == null) { return true; } foreach (NetworkUser readOnlyInstances in NetworkUser.readOnlyInstancesList) { if (unlockablesField.GetValue(readOnlyInstances) is List<UnlockableDef> list && !list.Contains(unlockableDef)) { return false; } } } catch (Exception ex) { Plugin.Log.LogError((object)ex); } return true; } } internal struct LoreLine { public Line line; public string dlc; public bool needsArtificerFree; public LoreLine(Line line, string dlc = null, bool needsArtificerFree = false) { this.line = line; this.dlc = dlc; this.needsArtificerFree = needsArtificerFree; } } internal class VoidRipple : MonoBehaviour { internal TMP_Text text; private void LateUpdate() { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: 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_0142: 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_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) try { if (!Plugin.WavyText.Value || !Object.op_Implicit((Object)(object)text) || !((Behaviour)text).isActiveAndEnabled || text.text == null || text.text.IndexOf("newtvoid", StringComparison.Ordinal) < 0) { return; } text.ForceMeshUpdate(false, false); TMP_TextInfo textInfo = text.textInfo; bool flag = false; float unscaledTime = Time.unscaledTime; for (int i = 0; i < textInfo.linkCount; i++) { TMP_LinkInfo val = textInfo.linkInfo[i]; if (((TMP_LinkInfo)(ref val)).GetLinkID() != "newtvoid") { continue; } for (int j = val.linkTextfirstCharacterIndex; j < val.linkTextfirstCharacterIndex + val.linkTextLength && j < textInfo.characterCount; j++) { TMP_CharacterInfo val2 = textInfo.characterInfo[j]; if (val2.isVisible) { Vector3[] vertices = textInfo.meshInfo[val2.materialReferenceIndex].vertices; float num = val2.pointSize * 0.035f; Vector3 val3 = new Vector3(Mathf.Sin(unscaledTime * 37f + (float)j * 1.7f), Mathf.Cos(unscaledTime * 41f + (float)j * 2.3f), 0f) * num; for (int k = 0; k < 4; k++) { ref Vector3 reference = ref vertices[val2.vertexIndex + k]; reference += val3; } flag = true; } } } if (flag) { text.UpdateVertexData((TMP_VertexDataUpdateFlags)1); } } catch { } } } [HarmonyPatch(typeof(ChatBox), "Start")] internal static class VoidRipplePatch { private static void Postfix(ChatBox __instance) { try { TMP_InputField value = Traverse.Create((object)__instance).Field("messagesText").GetValue<TMP_InputField>(); TMP_Text val = ((!Object.op_Implicit((Object)(object)value)) ? null : value.textComponent); if (Object.op_Implicit((Object)(object)val) && !Object.op_Implicit((Object)(object)((Component)val).GetComponent<VoidRipple>())) { ((Component)val).gameObject.AddComponent<VoidRipple>().text = val; } } catch (Exception ex) { Plugin.Log.LogError((object)ex); } } } [HarmonyPatch] internal static class WaveStripPatch { private static readonly Regex voffset = new Regex("</?voffset[^>]*>"); private static IEnumerable<MethodBase> TargetMethods() { MethodInfo[] methods = typeof(Chat).GetMethods(BindingFlags.Static | BindingFlags.Public); foreach (MethodInfo m in methods) { if (m.Name == "AddMessage" && m.GetParameters().Length == 1 && m.GetParameters()[0].ParameterType == typeof(string)) { yield return m; } } } private static void Prefix(ref string __0) { if (!Plugin.WavyText.Value && __0 != null && __0.IndexOf(">Newt:", StringComparison.Ordinal) >= 0) { __0 = voffset.Replace(__0, string.Empty); } } } internal static class RockHint { private static bool hinted; private const float Chance = 0.35f; internal static void Init() { Run.onRunStartGlobal += delegate { hinted = false; }; } private static ItemIndex Find(string name) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) return ItemCatalog.FindItemIndex(name); } private static bool Installed() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 return (int)Find("TradableRock") != -1; } private static bool SomeoneHas(ItemIndex i) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Invalid comparison between Unknown and I4 //IL_005b: Unknown result type (might be due to invalid IL or missing references) if ((int)i == -1) { return false; } foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if (Object.op_Implicit((Object)(object)instance) && Object.op_Implicit((Object)(object)instance.master) && Object.op_Implicit((Object)(object)instance.master.inventory) && instance.master.inventory.GetItemCountPermanent(i) > 0) { return true; } } return false; } internal static bool CarriedNow() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) try { return Installed() && SomeoneHas(Find("TradableRock")); } catch (Exception ex) { Plugin.Log.LogError((object)ex); return false; } } internal static bool Rolls(Inventory inv) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Invalid comparison between Unknown and I4 //IL_00f3: Unknown result type (might be due to invalid IL or missing references) try { if (hinted || !Object.op_Implicit((Object)(object)inv) || !Installed() || !Object.op_Implicit((Object)(object)Run.instance) || Run.instance.stageClearCount < 5) { return false; } if (Run.instance.GetEventFlag("ER_PileOfDirtDropped")) { return false; } if (SomeoneHas(Find("TradableRock")) || SomeoneHas(Find("LunarFlower")) || SomeoneHas(Find("VoidFlower"))) { return false; } if (IsHeretic(inv)) { return true; } int num = 0; foreach (ItemIndex item in inv.itemAcquisitionOrder) { ItemDef itemDef = ItemCatalog.GetItemDef(item); if (Object.op_Implicit((Object)(object)itemDef) && (int)itemDef.tier == 3) { num += inv.GetItemCountPermanent(item); } } float num2 = Mathf.Min(0.85f, 0.1f + 0.08f * (float)num); return Random.value < num2; } catch (Exception ex) { Plugin.Log.LogError((object)ex); return false; } } internal static void Said() { hinted = true; } private static bool IsHeretic(Inventory inv) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) CharacterMaster component = ((Component)inv).GetComponent<CharacterMaster>(); CharacterBody val = ((!Object.op_Implicit((Object)(object)component)) ? null : component.GetBody()); string text = ((!Object.op_Implicit((Object)(object)val)) ? string.Empty : (BodyCatalog.GetBodyName(val.bodyIndex) ?? string.Empty)); return text.IndexOf("Heretic", StringComparison.OrdinalIgnoreCase) >= 0 || NewtVoice.HasAllHeresies(inv); } } internal static class PurifyHint { internal static bool purifiedThisRun; internal static bool Unlocked; private static int hintsThisRun; private const float Chance = 0.25f; private const int MaxPerRun = 2; internal static void Init() { Run.onRunStartGlobal += delegate { purifiedThisRun = false; hintsThisRun = 0; Unlocked = false; }; } internal static void NoteArrival() { if (SomeoneHasVoid()) { Unlocked = true; } } internal static bool TakeTurn() { try { if (!Plugin.Purify.Value || purifiedThisRun || hintsThisRun >= 2) { return false; } if (!SomeoneHasVoid() || (hintsThisRun > 0 && Random.value >= 0.25f)) { return false; } hintsThisRun++; return true; } catch (Exception ex) { Plugin.Log.LogError((object)ex); return false; } } private static bool SomeoneHasVoid() { foreach (PlayerCharacterMasterController instance in PlayerCharacterMasterController.instances) { if (Object.op_Implicit((Object)(object)instance) && Object.op_Implicit((Object)(object)instance.master) && Trade.HasVoidItem(instance.master.inventory)) { return true; } } return false; } } internal static class ChefCompat { internal static bool ChefHere() { try { NetworkIdentity[] array = Object.FindObjectsOfType<NetworkIdentity>(); foreach (NetworkIdentity val in array) { if (Object.op_Implicit((Object)(object)val) && ((Object)((Component)val).gameObject).name.StartsWith("MealPrep", StringComparison.OrdinalIgnoreCase)) { return true; } } } catch (Exception ex) { Plugin.Log.LogError((object)ex); } return false; } } [HarmonyPatch] internal static class ChatPatch { private static IEnumerable<MethodBase> TargetMethods() { MethodInfo[] methods = typeof(Chat).GetMethods(BindingFlags.Static | BindingFlags.Public); foreach (MethodInfo m in methods) { if (m.Name == "SendBroadcastChat" && m.GetParameters().Length >= 1 && typeof(ChatMessageBase).IsAssignableFrom(m.GetParameters()[0].ParameterType)) { yield return m; } } } private static bool Prefix(ChatMessageBase __0) { try { if (VoidReflectDeathPatch.active && __0 != null) { Traverse val = Traverse.Create((object)__0).Field("baseToken"); string value = val.GetValue<string>(); if (value != null && value.StartsWith("PLAYER_DEATH_QUOTE", StringComparison.Ordinal)) { val.SetValue((object)"NEWTSBARGAIN_DEATH_QUOTE"); } } return !SilentNewt.Blocked(__0); } catch (Exception ex) { Plugin.Log.LogError((object)ex); return true; } } } internal static class Unlock { private class Provider : IContentPackProvider { private readonly ContentPack pack = new ContentPack(); public string identifier => "binma.newtsbargain"; public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { pack.unlockableDefs.Add((UnlockableDef[])(object)new UnlockableDef[1] { Def }); args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(pack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } } internal const string AchievementId = "BinmaNewtsBargain"; internal const string UnlockName = "Items.Binma.ElegyOfExtinction"; internal const string NameToken = "ACHIEVEMENT_BINMANEWTSBARGAIN_NAME"; internal const string DescToken = "ACHIEVEMENT_BINMANEWTSBARGAIN_DESCRIPTION"; internal static UnlockableDef Def; internal static readonly Dictionary<string, string> Tokens = new Dictionary<string, string> { { "ACHIEVEMENT_BINMANEWTSBARGAIN_NAME", "Newt's Bargain" }, { "ACHIEVEMENT_BINMANEWTSBARGAIN_DESCRIPTION", "Trade a lunar item and a Pearl to the Keeper of the Bazaar." }, { "NEWTSBARGAIN_DEATH_QUOTE", "{0} was lost to the void at the hands of the Shopkeeper." } }; internal static void Init() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown Def = ScriptableObject.CreateInstance<UnlockableDef>(); Def.cachedName = "Items.Binma.ElegyOfExtinction"; Def.nameToken = "EQUIPMENT_LUNARPORTALONUSE_NAME"; ContentManager.collectContentPackProviders += (CollectContentPackProvidersDelegate)delegate(AddContentPackProviderDelegate add) { add.Invoke((IContentPackProvider)(object)new Provider()); }; RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, new Action(Attach)); } private static void Attach() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Invalid comparison between Unknown and I4 //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) try { Def.getHowToUnlockString = () => Language.GetStringFormatted("UNLOCK_VIA_ACHIEVEMENT_FORMAT", new object[2] { Language.GetString("ACHIEVEMENT_BINMANEWTSBARGAIN_NAME"), Language.GetString("ACHIEVEMENT_BINMANEWTSBARGAIN_DESCRIPTION") }); Def.getUnlockedString = () => Language.GetStringFormatted("UNLOCKED_FORMAT", new object[2] { Language.GetString("ACHIEVEMENT_BINMANEWTSBARGAIN_NAME"), Language.GetString("ACHIEVEMENT_BINMANEWTSBARGAIN_DESCRIPTION") }); EquipmentIndex val = EquipmentCatalog.FindEquipmentIndex("LunarPortalOnUse"); if ((int)val == -1) { return; } EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(val); equipmentDef.unlockableDef = Def; PickupDef pickupDef = PickupCatalog.GetPickupDef(PickupCatalog.FindPickupIndex(val)); if (pickupDef != null) { pickupDef.unlockableDef = Def; } if (Object.op_Implicit((Object)(object)equipmentDef.pickupIconSprite)) { Def.achievementIcon = equipmentDef.pickupIconSprite; AchievementDef achievementDef = AchievementManager.GetAchievementDef("BinmaNewtsBargain"); if (achievementDef != null) { achievementDef.SetAchievedIcon(equipmentDef.pickupIconSprite); } } } catch (Exception ex) { Plugin.Log.LogError((object)ex); } } } [RegisterAchievement("BinmaNewtsBargain", "Items.Binma.ElegyOfExtinction", null, 5u, null)] public class NewtsBargainAchievement : BaseAchievement { internal static Action<GameObject> Traded; public override void OnInstall() { ((BaseAchievement)this).OnInstall(); Traded = (Action<GameObject>)Delegate.Combine(Traded, new Action<GameObject>(Check)); } public override void OnUninstall() { Traded = (Action<GameObject>)Delegate.Remove(Traded, new Action<GameObject>(Check)); ((BaseAchievement)this).OnUninstall(); } private void Check(GameObject master) { try { if (Object.op_Implicit((Object)(object)master) && ((BaseAchievement)this).localUser != null && (Object)(object)((BaseAchievement)this).localUser.cachedMasterObject == (Object)(object)master) { ((BaseAchievement)this).Grant(); } } catch (Exception ex) { Plugin.Log.LogError((object)ex); } } } [HarmonyPatch(typeof(Language), "GetLocalizedStringByToken")] internal static class LanguagePatch { private static void Postfix(string __0, ref string __result) { if (__0 != null && (__result == null || __result == __0) && Unlock.Tokens.TryGetValue(__0, out var value)) { __result = value; } } } internal static class ElegyLists { internal static void Strip(Run run) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Invalid comparison between Unknown and I4 //IL_0047: 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_003a: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)run) || !Plugin.OnlyFromNewt.Value) { return; } EquipmentIndex val = EquipmentCatalog.FindEquipmentIndex("LunarPortalOnUse"); if ((int)val == -1 || (Plugin.Everywhere.Value && run.IsEquipmentAvailable(val))) { return; } PickupIndex pickup = PickupCatalog.FindPickupIndex(val); FieldInfo[] fields = typeof(Run).GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); foreach (FieldInfo fieldInfo in fields) { if (!(fieldInfo.FieldType != typeof(List<PickupIndex>)) && fieldInfo.GetValue(run) is List<PickupIndex> list) { list.RemoveAll((PickupIndex p) => p == pickup); } } } } [HarmonyPatch(typeof(PickupDropTable), "RegenerateAll")] internal static class DropTableRegenPatch { private static void Prefix(Run __0) { try { ElegyLists.Strip(__0); } catch (Exception ex) { Plugin.Log.LogError((object)ex); } } } [HarmonyPatch(typeof(Run), "BuildDropTable")] internal static class DropTablePatch { private static readonly MethodInfo regenAll = AccessTools.Method(typeof(PickupDropTable), "RegenerateAll", (Type[])null, (Type[])null); private static void Postfix(Run __instance) { try { ElegyLists.Strip(__instance); if (regenAll != null && Plugin.OnlyFromNewt.Value) { regenAll.Invoke(null, new object[1] { __instance }); } } catch (Exception ex) { Plugin.Log.LogError((object)ex); } } } [HarmonyPatch(typeof(LogBookController), "GetPickupTooltipContent")] internal static class TooltipGuard { private static void Prefix(ref Entry __0) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) try { if (__0 == null || !(__0.extraData is PickupIndex)) { return; } PickupDef pickupDef = PickupCatalog.GetPickupDef((PickupIndex)__0.extraData); UnlockableDef u = pickupDef?.unlockableDef; if (!Object.op_Implicit((Object)(object)u)) { return; } if (u.getHowToUnlockString == null) { Plugin.Log.LogWarning((object)("Unlockable '" + u.cachedName + "' on " + pickupDef.internalName + " had no unlock text; filled it in so the logbook doesn't break.")); u.getHowToUnlockString = () => Language.GetString("UNIDENTIFIED"); } if (u.getUnlockedString == null) { u.getUnlockedString = () => Language.GetString(u.nameToken ?? string.Empty); } } catch (Exception ex) { Plugin.Log.LogError((object)ex); } } } [HarmonyPatch(typeof(ChestBehavior), "Roll")] internal static class LunarPodPatch { private static readonly MethodInfo setPickup = AccessTools.PropertySetter(typeof(ChestBehavior), "currentPickup"); private static void Postfix(ChestBehavior __instance) { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Invalid comparison between Unknown and I4 //IL_00a8: 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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) try { if (!NetworkServer.active || !Plugin.LunarPods.Value || !Plugin.OnlyFromNewt.Value || Plugin.Everywhere.Value || !Object.op_Implicit((Object)(object)__instance) || ((Object)((Component)__instance).gameObject).name.IndexOf("LunarChest", StringComparison.OrdinalIgnoreCase) < 0) { return; } SceneDef sceneDefForCurrentScene = SceneCatalog.GetSceneDefForCurrentScene(); if (!Object.op_Implicit((Object)(object)sceneDefForCurrentScene) || sceneDefForCurrentScene.cachedName == "bazaar") { return; } Run instance = Run.instance; EquipmentIndex val = EquipmentCatalog.FindEquipmentIndex("LunarPortalOnUse"); if (Object.op_Implicit((Object)(object)instance) && (int)val != -1 && instance.IsEquipmentAvailable(val)) { int num = ((instance.availableLunarCombinedDropList != null) ? instance.availableLunarCombinedDropList.Count : 0); if (!(instance.treasureRng.nextNormalizedFloat >= 1f / (float)(num + 1)) && setPickup != null) { setPickup.Invoke(__instance, new object[1] { (object)new UniquePickup(PickupCatalog.FindPickupIndex(val)) }); } } } catch (Exception ex) { Plugin.Log.LogError((object)ex); } } } internal struct Line { public readonly string Tongue; public readonly string English; public Line(string tongue, string english) { Tongue = tongue; English = english; } } internal static class NewtVoice { internal static bool Speaking; internal static readonly Line[] Greet = new Line[5] { new Line("Vëshaal. Far? No. Back.", "Traveler. You think you came far. You came back."), new Line("Säethïr. Rivers return. Sëiä.", "Again. Rivers return to where they began. So it is."), new Line("Vëshaal. Ënnuvaal waits here.", "Traveler. Time waits here."), new Line("Säethïr. Early, late. Same.", "Again. Early or late, it is the same here."), new Line("Vëshaal. Answers sought. Coins spent. Sëiä.", "Traveler. Many seek answers. Most spend coins. So it is.") }; internal static readonly Line[] GreetLoop = new Line[5] { new Line("Säethïr, vëshaal. Dhäl did not keep you. Ënnuvaal never does.", "Again, traveler. The road did not keep you. Time never does."), new Line("Back from the end, vëshaal. It is only another beginning. Sëiä.", "Back from the end, traveler. It is only another beginning. So it is."), new Line("Ënnuvaal turned a page, and here you are on it again.", "Time turned a page, and here you are on it again."), new Line("Säethïr. My shelves remember you, vëshaal. Sëiä.", "Again. My shelves remember you, traveler. So it is."), new Line("You reached the end of Dhäl and found its beginning, vëshaal.", "You reached the end of the road and found its beginning, traveler.") }; internal static readonly Line[] PearlLines = new Line[3] { new Line("Thëssarïn. Fair. Väelith ūm.", "Pearls. Fair. The door is yours."), new Line("Thëssarïn for passage. Sëiä.", "Pearls for passage. So it is."), new Line("Thëssarïn kaë. Dhäl is yours. Walk wisely.", "Pearls given. The path is yours. Walk it wisely.") }; internal static readonly Line[] PurifyLines = new Line[6] { new Line("Ënnuvaal unwinds what Nūllaveth twisted. Sëiä.", "Time unwinds what the void twisted. So it is."), new Line("Back to before. Ënnuvaal remembers its shape.", "Back to before. Time remembers its shape."), new Line("The void borrows. Ënnuvaal collects. Sëiä.", "The void borrows. Time collects. So it is."), new Line("Turned back, vëshaal. As it was meant to be. Sëiä.", "Turned back, traveler. As it was meant to be. So it is."), new Line("Nūllaveth forgets. Ënnuvaal never does.", "The void forgets. Time never does."), new Line("An hour undone. It is yours again. Sëiä.", "An hour undone. It is yours again. So it is.") }; internal static readonly Line[] TradeIntro = new Line[2] { new Line("Pearls, vëshaal. Bring them, and we will mïnthar. Sëiä.", "Pearls, traveler. Bring them, and we will trade. So it is."), new Line("Bring me Pearls, vëshaal, and my shelves hold more than coin can buy. Sëiä.", "Bring me Pearls, traveler, and my shelves hold more than coin can buy. So it is.") }; internal static readonly Line NewFace = new Line("A new face. Ënnuvaal collects them, vëshaal.", "A new face. Time collects them, traveler."); internal static readonly Line ArtificerAlone = new Line("Ah. The one Ënnuvaal held. Welcome back, lïraëth.", "Ah. The one time held. Welcome back, freed one."); internal static readonly Line ArtificerWithCompany = new Line("Lïraëth. You brought company this time. Ënnuvaal approves. Sëiä.", "Freed one. You brought company this time. Time approves. So it is."); internal static readonly Line ArtificerStillFrozen = new Line("Lïraëth? And yet you are still frozen over there. Ënnuvaal plays its games again.", "Freed one? And yet you are still frozen over there. Time plays its games again."); internal static readonly Dictionary<string, Line> CharacterLines = new Dictionary<string, Line> { { "CommandoBody", new Line("You fight for the ones who sell the stars. Ënnuvaal has watched your kind fall from the sky before, vëshaal.", "You fight for the ones who sell the stars. Time has watched your kind fall from the sky before, traveler.") }, { "NemCommandoBody", new Line("A familiar face, but not his story. Ënnuvaal knows the difference.", "A familiar face, but not his story. Time knows the difference.") }, { "RobomandoBody", new Line("A machine wearing a soldier's purpose. Ënnuvaal judges the will, not the shape.", "A machine wearing a soldier's purpose. Time judges the will, not the shape.") }, { "HuntressBody", new Line("Quiet steps, sharp eyes. Säalun watches hunters too, vëshaal.", "Quiet steps, sharp eyes. The moon watches hunters too, traveler.") }, { "Bandit2Body", new Line("A thief in my shop. Bold. Keep your hands where Ënnuvaal can see them. Sëiä.", "A thief in my shop. Bold. Keep your hands where time can see them. So it is.") }, { "ToolbotBody", new Line("Many arms, one purpose. You were built to carry. Carry well, vëshaal.", "Many arms, one purpose. You were built to carry. Carry well, traveler.") }, { "HANDOverclockedBody", new Line("A janitor, fighting. Ënnuvaal has seen stranger work. Barely.", "A janitor, fighting. Time has seen stranger work. Barely.") }, { "EngiBody", new Line("You build, and hide behind what you build. The väarun did the same. Sëiä.", "You build, and hide behind what you build. The brothers did the same. So it is.") }, { "MercBody", new Line("Fast blade, faster mind. Ënnuvaal can barely keep up with you, vëshaal.", "Fast blade, faster mind. Time can barely keep up with you, traveler.") }, { "NemMercBody", new Line("A blade from another tide of Ënnuvaal. You should not be here. Neither should I. Sëiä.", "A blade from another tide of time. You should not be here. Neither should I. So it is.") }, { "TreebotBody", new Line("Root and steel, fused. The planet grows strange things, vëshaal.", "Root and steel, fused. The planet grows strange things, traveler.") }, { "LoaderBody", new Line("Iron fists, steady heart. You came to build, not to fight. Ënnuvaal laughs at plans.", "Iron fists, steady heart. You came to build, not to fight. Time laughs at plans.") }, { "MinerBody", new Line("You dig for treasure. The planet buries more than gold, vëshaal.", "You dig for treasure. The planet buries more than gold, traveler.") }, { "CrocoBody", new Line("Caged once, free now. Ënnuvaal remembers your poison. Sëiä.", "Caged once, free now. Time remembers your poison. So it is.") }, { "ChirrBody", new Line("You befriend the planet's children. Few do. Lïessaë walks with you, vëshaal.", "You befriend the planet's children. Few do. Fortune walks with you, traveler.") }, { "CaptainBody", new Line("Captain of a ship that should not have come. Your orders do not reach Säalun, vëshaal.", "Captain of a ship that should not have come. Your orders do not reach the moon, traveler.") }, { "Executioner2Body", new Line("Every kill feeds your weapon. Nūllaveth would approve. I do not. Sëiä.", "Every kill feeds your weapon. The void would approve. I do not. So it is.") }, { "RocketSurvivorBody", new Line("Loud. Too loud for between Ënnuvaal. Mind my shelves, vëshaal.", "Loud. Too loud for between time. Mind my shelves, traveler.") }, { "HereticBody", new Line("Kur-skan. Pieces of you scattered to both poles of Säalun, and still you fly. Sëiä.", "Kur-skan. Pieces of you scattered to both poles of the moon, and still you fly. So it is.") }, { "RailgunnerBody", new Line("You see far, vëshaal. See farther. Ënnuvaal hides in the distance.", "You see far, traveler. See farther. Time hides in the distance.") }, { "VoidSurvivorBody", new Line("A soldier, unmade by Nūllaveth. You escaped the simulation. Not the hunger. Sëiä.", "A soldier, unmade by the void. You escaped the simulation. Not the hunger. So it is.") }, { "SeekerBody", new Line("You seek. Good. Ënnuvaal rewards those who ask, vëshaal.", "You seek. Good. Time rewards those who ask, traveler.") }, { "FalseSonBody", new Line("Son of khöraan and Ǽurëlith. You wear one face, and carry another's rage. Which will you keep? Sëiä.", "Son of stone and gold. You wear one face, and carry another's rage. Which will you keep? So it is.") }, { "ChefBody", new Line("A cook among warriors. Bring me something warm, vëshaal. Ënnuvaal is cold here.", "A cook among warriors. Bring me something warm, traveler. Time is cold here.") }, { "DroneTechBody", new Line("You command the little machines. The Rüstaal watch how you treat them, vëshaal.", "You command the little machines. The metal ones watch how you treat them, traveler.") }, { "DrifterBody", new Line("Freed from a prison of the Rüstaal. You keep what others throw away. Ënnuvaal does too.", "Freed from a prison of the metal ones. You keep what others throw away. Time does too.") }, { "Enforcer2Body", new Line("Shield raised, vëshaal. Nothing here will strike you. Mostly. Sëiä.", "Shield raised, traveler. Nothing here will strike you. Mostly. So it is.") }, { "AcolyteBody", new Line("Devotion brought you here, vëshaal. Ënnuvaal tests devotion. Sëiä.", "Devotion brought you here, traveler. Time tests devotion. So it is.") } }; internal static readonly Dictionary<string, Line[]> CharacterStage = new Dictionary<string, Line[]> { { "CommandoBody", new Line[4] { new Line("Those who sell the stars sent you for a lost ship. You found me instead, vëshaal.", "Those who sell the stars sent you for a lost ship. You found me instead, traveler."), new Line("Still standing, soldier. Your pistols speak louder than your orders. Sëiä.", "Still standing, soldier. Your pistols speak louder than your orders. So it is."), new Line("Halfway up the mountain, soldier. The view grows worse from here. Sëiä.", "Halfway up the mountain, soldier. The view grows worse from here. So it is."), new Line("Säalun hangs low over you now. Soldiers march toward it. Few march back.", "The moon hangs low over you now. Soldiers march toward it. Few march back.") } }, { "MageBody", new Line[4] { new Line("Fire and Ïlun, so early on Dhäl. Ënnuvaal remembers the cold, lïraëth.", "Fire and frost, so early on the road. Time remembers the cold, freed one."), new Line("Your gauntlets hum, lïraëth. The High Court would be proud. Perhaps.", "Your gauntlets hum, freed one. The High Court would be proud. Perhaps."), new Line("Ïlun follows you, lïraëth. It always will. Keep burning.", "The cold follows you, freed one. It always will. Keep burning."), new Line("Säalun watched you freeze once. Burn brighter this time, lïraëth. Sëiä.", "The moon watched you freeze once. Burn brighter this time, freed one. So it is.") } }, { "NemCommandoBody", new Line[4] { new Line("A soldier who already walked this Dhäl. Do you remember the ending?", "A soldier who already walked this road. Do you remember the ending?"), new Line("Your blade remembers more than you do, vëshaal. Sëiä.", "Your blade remembers more than you do, traveler. So it is."), new Line("This stretch of Dhäl feels familiar to you. I can tell. Sëiä.", "This stretch of road feels familiar to you. I can tell. So it is."), new Line("You reached Säalun once before. It did not end well. Ënnuvaal gives you another try.", "You reached the moon once before. It did not end well. Time gives you another try.") } }, { "RobomandoBody", new Line[4] { new Line("Small machine. Long Dhäl. Ënnuvaal is patient with the young.", "Small machine. Long road. Time is patient with the young."), new Line("Still ticking. The Rüstaal would be curious about you, vëshaal.", "Still ticking. The metal ones would be curious about you, traveler."), new Line("Your joints creak, little mëkhaal. Dhäl does not care. Oil them.", "Your joints creak, little machine. The road does not care. Oil them."), new Line("A machine walking toward Säalun. Steel does not fear. Good. Sëiä.", "A machine walking toward the moon. Steel does not fear. Good. So it is.") } }, { "HuntressBody", new Line[4] { new Line("Fresh tracks, thïrrava. Ūrthaal does not know you yet.", "Fresh tracks, huntress. The planet does not know you yet."), new Line("Your arrows find their marks. The planet has started running from you. Sëiä.", "Your arrows find their marks. The planet has started running from you. So it is."), new Line("The prey grows larger, huntress. So do your arrows. Sëiä.", "The prey grows larger, huntress. So do your arrows. So it is."), new Line("Säalun is the greatest prey you will ever chase. Aim true.", "The moon is the greatest prey you will ever chase. Aim true.") } }, { "Bandit2Body", new Line[4] { new Line("Early to rob me, skëlvar. Come back when you have something worth stealing.", "Early to rob me, thief. Come back when you have something worth stealing."), new Line("Your pockets grow heavier. I count my shelves twice now. Sëiä.", "Your pockets grow heavier. I count my shelves twice now. So it is."), new Line("Halfway rich, skëlvar. Halfway is the dangerous part.", "Halfway rich, thief. Halfway is the dangerous part."), new Line("A king keeps his treasure on Säalun. Kings do not share, vëshaal.", "A king keeps his treasure on the moon. Kings do not share, traveler.") } }, { "ToolbotBody", new Line[4] { new Line("Freshly unloaded. Do not drop your krätenn on my floor.", "Freshly unloaded. Do not drop your crates on my floor."), new Line("Your cargo grows. Ënnuvaal measures you in crates, vëshaal. Sëiä.", "Your cargo grows. Time measures you in crates, traveler. So it is."), new Line("Heavier load, steeper Dhäl. Your treads will hold. Probably. Sëiä.", "Heavier load, steeper road. Your treads will hold. Probably. So it is."), new Line("A delivery to Säalun. He did not order you. He will sign for you anyway.", "A delivery to the moon. He did not order you. He will sign for you anyway.") } }, { "HANDOverclockedBody", new Line[4] { new Line("Sweep quickly, janitor. Ënnuvaal leaves dust in every corner.", "Sweep quickly, janitor. Time leaves dust in every corner."), new Line("Still working overtime. Your drones do the cleaning now? Sëiä.", "Still working overtime. Your drones do the cleaning now? So it is."), new Line("The mess grows the deeper you go. Job security, düstaal.", "The mess grows the deeper you go. Job security, janitor."), new Line("Säalun is a mess. Bring a bigger mop, vëshaal.", "The moon is a mess. Bring a bigger mop, traveler.") } }, { "EngiBody", new Line[4] { new Line("Turrets already? You plan for a long Dhäl, vëshaal.", "Turrets already? You plan for a long road, traveler."), new Line("Your machines grow. The väarun built too. Look where it led them. Sëiä.", "Your machines grow. The brothers built too. Look where it led them. So it is."), new Line("Your tërraval have seen things now. They hold the line better for it.", "Your turrets have seen things now. They hold the line better for it."), new Line("Säalun is full of things built to last. Yours will be tested there.", "The moon is full of things built to last. Yours will be tested there.") } }, { "MercBody", new Line[4] { new Line("So early, and your blade is already red. Slow down. Ënnuvaal insists.", "So early, and your blade is already red. Slow down. Time insists."), new Line("Faster every stage, vëshaal. Even Ënnuvaal takes notes. Sëiä.", "Faster every stage, traveler. Even time takes notes. So it is."), new Line("Your blade is a blur now. The planet blinks, and you are past it. Sëiä.", "Your blade is a blur now. The planet blinks, and you are past it. So it is."), new Line("A duel waits on Säalun. His hammer swings faster than it looks.", "A duel waits on the moon. His hammer swings faster than it looks.") } }, { "NemMercBody", new Line[4] { new Line("You came from another ëbbaal. This one does not know you yet.", "You came from another tide. This one does not know you yet."), new Line("Your blade drinks deeper here. Careful, vëshaal. Sëiä.", "Your blade drinks deeper here. Careful, traveler. So it is."), new Line("This ëbbaal pulls harder the deeper you wade. Keep your footing.", "This tide pulls harder the deeper you wade. Keep your footing."), new Line("Two tides meet on Säalun. Neither should be there.", "Two tides meet on the moon. Neither should be there.") } }, { "TreebotBody", new Line[4] { new Line("A small sprout. The planet watches what you will become, vëshaal.", "A small sprout. The planet watches what you will become, traveler."), new Line("Deeper roots now. You give of yourself to heal. Sëiä.", "Deeper roots now. You give of yourself to heal. So it is."), new Line("Your branches are thick now. The planet leans on you. Sëiä.", "Your branches are thick now. The planet leans on you. So it is."), new Line("A lïessaë climbing toward Säalun. Khöraan and steel wilt there. Will you?", "A flower climbing toward the moon. Stone and steel wilt there. Will you?") } }, { "LoaderBody", new Line[4] { new Line("A böraal, far from the site. Ūrthaal does not need building.", "A builder, far from the site. The planet does not need building."), new Line("Your fists build momentum. Do not swing at my shelves, vëshaal. Sëiä.", "Your fists build momentum. Do not swing at my shelves, traveler. So it is."), new Line("Halfway built. The hardest steel goes in last, böraal.", "Halfway built. The hardest steel goes in last, builder."), new Line("Säalun was built, and never finished. Bring your hook.", "The moon was built, and never finished. Bring your hook.") } }, { "MinerBody", new Line[4] { new Line("Shallow digging, vëshaal. The good things lie deeper.", "Shallow digging, traveler. The good things lie deeper."), new Line("Deeper now. You smell Ǽurëlith. So does Ënnuvaal. Sëiä.", "Deeper now. You smell gold. So does time. So it is."), new Line("Past the topsoil now. Ūrthaal grumbles when you dig this deep.", "Past the topsoil now. The planet grumbles when you dig this deep."), new Line("Säalun's depths hold more than ore. Dig carefully, vëshaal.", "The moon's depths hold more than ore. Dig carefully, traveler.") } }, { "CrocoBody", new Line[4] { new Line("You walk like the bars are still there, väar. Ënnuvaal sees the shape they left. Sëiä.", "You walk like the bars are still there, brother. Time sees the shape they left. So it is."), new Line("The door stood open long ago. Still, you count the steps to it, väar.", "The door stood open long ago. Still, you count the steps to it, brother."), new Line("A cage taught you where Ūrthaal ends. Ūrthaal has no such edge. That frightens you. Sëiä.", "A cage taught you where the planet ends. The planet has no such edge. That frightens you. So it is."), new Line("Säalun holds a king who built bars from his own hatred and called them a throne. Do not build yours, väar. Sëiä.", "The moon holds a king who built bars from his own hatred and called them a throne. Do not build yours, brother. So it is.") } }, { "ChirrBody", new Line[4] { new Line("Ūrthaal's children greet you, ämïr. Not all of them stay friendly.", "The planet's children greet you, friend. Not all of them stay friendly."), new Line("More friends at your side. The planet's children speak of you. Sëiä.", "More friends at your side. The planet's children speak of you. So it is."), new Line("Your friends follow you deeper. Few would. Sëiä.", "Your friends follow you deeper. Few would. So it is."), new Line("Säalun's children are not like the planet's. They will not be befriended.", "The moon's children are not like the planet's. They will not be befriended.") } }, { "CaptainBody", new Line[4] { new Line("A captain without a deck. Your crew is scattered, vëshaal.", "A captain without a deck. Your crew is scattered, traveler."), new Line("Beacons from above, captain. Your ship still answers. For now. Sëiä.", "Beacons from above, captain. Your ship still answers. For now. So it is."), new Line("The beacons fall faster now, vöranth. Your ship knows you are close.", "The beacons fall faster now, captain. Your ship knows you are close."), new Line("Säalun pulled your ship down, captain. Now you climb to meet it.", "The moon pulled your ship down, captain. Now you climb to meet it.") } }, { "Executioner2Body", new Line[4] { new Line("Your weapon is hungry already. Feed it slowly, vëshaal.", "Your weapon is hungry already. Feed it slowly, traveler."), new Line("Your charges stack higher. The planet's creatures grow fewer. Sëiä.", "Your charges stack higher. The planet's creatures grow fewer. So it is."), new Line("The planet goes quiet when you pass. Your weapon prefers it loud. Sëiä.", "The planet goes quiet when you pass. Your weapon prefers it loud. So it is."), new Line("Säalun's guardians are many. Your weapon will feast.", "The moon's guardians are many. Your weapon will feast.") } }, { "RocketSurvivorBody", new Line[4] { new Line("Explosions this early. Ënnuvaal covers its ears, vëshaal.", "Explosions this early. Time covers its ears, traveler."), new Line("Louder still. My shelves are rattling. Sëiä.", "Louder still. My shelves are rattling. So it is."), new Line("Half of Ūrthaal heard you. The other half will soon.", "Half the planet heard you. The other half will soon."), new Line("Bring your biggest rocket to Säalun. He will not be impressed. Bring it anyway.", "Bring your biggest rocket to the moon. He will not be impressed. Bring it anyway.") } }, { "HereticBody", new Line[4] { new Line("Kur-skan. Four heresies, one body. Ūrthaal does not know what to make of you.", "Kur-skan. Four heresies, one body. The planet does not know what to make of you."), new Line("Säalun calls to its stolen pieces. Do you hear it, Kur-skan? Sëiä.", "The moon calls to its stolen pieces. Do you hear it, Kur-skan? So it is."), new Line("Your heresies grow restless the closer you get. Sëiä.", "Your heresies grow restless the closer you get. So it is."), new Line("Back to Säalun, where your heresies were born. He will want them back.", "Back to the moon, where your heresies were born. He will want them back.") } }, { "RailgunnerBody", new Line[4] { new Line("Scope steady, vëshaal. The planet is wide, but you see all of it.", "Scope steady, traveler. The planet is wide, but you see all of it."), new Line("Every shot lands. The creatures hide behind khöraan now. Sëiä.", "Every shot lands. The creatures hide behind stone now. So it is."), new Line("The targets grow bigger in your vëstraal. Fewer misses. Not that you miss.", "The targets grow bigger in your scope. Fewer misses. Not that you miss."), new Line("Säalun is far. Not too far for you.", "The moon is far. Not too far for you.") } }, { "VoidSurvivorBody", new Line[4] { new Line("Nūllaveth still whispers to you. Do not listen too long.", "The Void still whispers to you. Do not listen too long."), new Line("Your corruption grows. Hold on to yourself, vëshaal. Sëiä.", "Your corruption grows. Hold on to yourself, traveler. So it is."), new Line("Nūllaveth tugs harder this deep. Do not let go of yourself.", "The Void tugs harder this deep. Do not let go of yourself."), new Line("Säalun sits closer to Nūllaveth than he admits. You will feel it there.", "The moon sits closer to The Void than he admits. You will feel it there.") } }, { "SeekerBody", new Line[4] { new Line("Still searching? Answers come slowly, ësyrën.", "Still searching? Answers come slowly, seeker."), new Line("Your chakras bloom. Your Dhäl narrows. Good. Sëiä.", "Your chakras bloom. Your path narrows. Good. So it is."), new Line("Your questions grow sharper. The answers grow quieter. Sëiä.", "Your questions grow sharper. The answers grow quieter. So it is."), new Line("What you seek waits above. Or below. Ënnuvaal will not say.", "What you seek waits above. Or below. Time will not say.") } }, { "FalseSonBody", new Line[4] { new Line("Son of khöraan and Ǽurëlith. Shaped by devoted hands, woken by a golden heart. Sëiä.", "Son of stone and gold. Shaped by devoted hands, woken by a golden heart. So it is."), new Line("Hatred in one hand, passion in the other. Carry both carefully, son. Sëiä.", "Hatred in one hand, passion in the other. Carry both carefully, son. So it is."), new Line("Khöraan grows heavy the deeper you walk, son. You carry it well. Sëiä.", "Stone grows heavy the deeper you walk, son. You carry it well. So it is."), new Line("The one whose rage you carry waits on Säalun. Will you give it back?", "The one whose rage you carry waits on the moon. Will you give it back?") } }, { "ChefBody", new Line[4] { new Line("The kitchen opens ëarvun. What is on the m