using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using UnityEngine; using UnityEngine.AI; using UnityEngine.Networking; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("Empress")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyInformationalVersion("1.1.0+5f1b735e473ca4ccf3b383128fbebd889cb564da")] [assembly: AssemblyProduct("EmpressDateEverything")] [assembly: AssemblyTitle("EmpressDateEverything")] [assembly: AssemblyVersion("1.1.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace EmpressDateEverything { [BepInPlugin("Empress.DateEverything", "Empress DateEverything", "1.1.0")] public sealed class EmpressDateEverythingPlugin : BaseUnityPlugin { internal ConfigEntry Enabled; internal ConfigEntry DebugLogging; internal ConfigEntry InteractKey; internal ConfigEntry RelationshipsKey; internal ConfigEntry MaxDateDistance; internal ConfigEntry LoveGainPerDate; internal ConfigEntry LoveDecayPerRejection; internal ConfigEntry UiScale; internal ConfigEntry ChatAutoCloseSeconds; internal ConfigEntry ShowLookPrompt; internal ConfigEntry LookPromptDistance; internal ConfigEntry PortraitFolder; internal ConfigEntry MaxRelationshipsShown; internal ConfigEntry RewardCooldownSeconds; internal ConfigEntry BetrayalSensitivity; internal ConfigEntry MaxActiveFollowers; internal ConfigEntry TextSoundsEnabled; internal ConfigEntry TypingCharactersPerSecond; internal ConfigEntry TypingSoundVolume; internal ConfigEntry CharacterMusicVolume; internal static EmpressDateEverythingPlugin Instance; private void Awake() { //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Expected O, but got Unknown //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Expected O, but got Unknown //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Expected O, but got Unknown //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Expected O, but got Unknown //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Expected O, but got Unknown //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Expected O, but got Unknown //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Expected O, but got Unknown //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Expected O, but got Unknown //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Expected O, but got Unknown //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Expected O, but got Unknown //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Expected O, but got Unknown //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03ab: Expected O, but got Unknown //IL_03df: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Expected O, but got Unknown //IL_03f4: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Invalid comparison between Unknown and I4 //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Expected O, but got Unknown Instance = this; Enabled = ((BaseUnityPlugin)this).Config.Bind("Empress DateEverything", "Enabled", true, "Turns DateEverything on or off."); DebugLogging = ((BaseUnityPlugin)this).Config.Bind("Empress DateEverything", "DebugLogging", false, "Adds tiny Empress debug logs."); InteractKey = ((BaseUnityPlugin)this).Config.Bind("Controls", "InteractKey", (KeyCode)120, "Key used to ask the thing you are looking at on a date."); RelationshipsKey = ((BaseUnityPlugin)this).Config.Bind("Controls", "RelationshipsKey", (KeyCode)287, "Key used to open the relationship board."); MaxDateDistance = ((BaseUnityPlugin)this).Config.Bind("Dating", "MaxDateDistance", 6f, new ConfigDescription("How far Empress lets your desperate little date radar reach.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 30f), Array.Empty())); LoveGainPerDate = ((BaseUnityPlugin)this).Config.Bind("Dating", "LoveGainPerDate", 7, new ConfigDescription("Base love gained from a successful date.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); LoveDecayPerRejection = ((BaseUnityPlugin)this).Config.Bind("Dating", "LoveDecayPerRejection", 2, new ConfigDescription("Love lost when you back out like a coward.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); UiScale = ((BaseUnityPlugin)this).Config.Bind("UI", "UiScale", 1f, new ConfigDescription("Scales the Empress dating UI.", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 2f), Array.Empty())); ChatAutoCloseSeconds = ((BaseUnityPlugin)this).Config.Bind("UI", "ChatAutoCloseSeconds", 0f, new ConfigDescription("Legacy setting. Date chat now stays open until you continue or close it.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 30f), Array.Empty())); ShowLookPrompt = ((BaseUnityPlugin)this).Config.Bind("UI", "ShowLookPrompt", true, "Shows the small Press X dating prompt when looking at something dateable."); LookPromptDistance = ((BaseUnityPlugin)this).Config.Bind("UI", "LookPromptDistance", 4.75f, new ConfigDescription("Maximum distance for the small look prompt and date targeting.", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 12f), Array.Empty())); PortraitFolder = ((BaseUnityPlugin)this).Config.Bind("Portraits", "PortraitFolder", Path.Combine(Paths.ConfigPath, "EmpressDateEverything", "Portraits"), "Folder for optional PNG portraits. Names can match the target, category, or default.png."); MaxRelationshipsShown = ((BaseUnityPlugin)this).Config.Bind("UI", "MaxRelationshipsShown", 30, new ConfigDescription("How many relationships the F6 board shows.", (AcceptableValueBase)(object)new AcceptableValueRange(5, 100), Array.Empty())); RewardCooldownSeconds = ((BaseUnityPlugin)this).Config.Bind("Dating", "RewardCooldownSeconds", 35, new ConfigDescription("Minimum seconds before the same relationship can gift or punish again.", (AcceptableValueBase)(object)new AcceptableValueRange(5, 240), Array.Empty())); BetrayalSensitivity = ((BaseUnityPlugin)this).Config.Bind("Dating", "BetrayalSensitivity", 62, new ConfigDescription("How quickly jealous relationships find out you are seeing someone else.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); MaxActiveFollowers = ((BaseUnityPlugin)this).Config.Bind("Followers", "MaxActiveFollowers", 3, new ConfigDescription("Maximum maxed-out dates that can physically follow you at once.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 8), Array.Empty())); TextSoundsEnabled = ((BaseUnityPlugin)this).Config.Bind("Audio", "TextSoundsEnabled", true, "Uses the Empress typing blips while date dialogue types."); TypingCharactersPerSecond = ((BaseUnityPlugin)this).Config.Bind("Audio", "TypingCharactersPerSecond", 34f, new ConfigDescription("How fast date dialogue types.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 120f), Array.Empty())); TypingSoundVolume = ((BaseUnityPlugin)this).Config.Bind("Audio", "TypingSoundVolume", 30f, new ConfigDescription("Typing blip volume from 0 to 100.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 100f), Array.Empty())); CharacterMusicVolume = ((BaseUnityPlugin)this).Config.Bind("Audio", "CharacterMusicVolume", 50f, new ConfigDescription("Character music volume from 0 to 100.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 100f), Array.Empty())); if ((int)InteractKey.Value == 101) { InteractKey.Value = (KeyCode)120; } if (Mathf.Approximately(CharacterMusicVolume.Value, 60f)) { CharacterMusicVolume.Value = 50f; } GameObject val = new GameObject("EmpressDateEverything.Runtime") { hideFlags = (HideFlags)61 }; Object.DontDestroyOnLoad((Object)val); val.AddComponent().EmpressBoot(this); EmpressLog("DateEverything is ready. The relationship sim has teeth now."); } internal static void EmpressLog(string message) { ((BaseUnityPlugin)Instance).Logger.LogInfo((object)("Empress DateEverything: " + message)); } internal static void EmpressDebug(string message) { if ((Object)(object)Instance != (Object)null && Instance.DebugLogging.Value) { ((BaseUnityPlugin)Instance).Logger.LogInfo((object)("Empress DateEverything debug: " + message)); } } internal static void EmpressWarning(string message) { ((BaseUnityPlugin)Instance).Logger.LogWarning((object)("Empress DateEverything: " + message)); } } internal sealed class EmpressDateEverythingRuntime : MonoBehaviour { private EmpressDateEverythingPlugin _plugin; private readonly Dictionary _relationships = new Dictionary(); private readonly Dictionary _portraitCache = new Dictionary(); private readonly Dictionary _followers = new Dictionary(); private readonly List _activeChoices = new List(); private readonly List _activeAnswerChoices = new List(); private readonly Random _random = new Random(); private Canvas _canvas; private Text _promptText; private GameObject _promptPanel; private GameObject _datePanel; private RawImage _portrait; private Text _dateTitle; private Text _dateSubtitle; private Text _dateBody; private Text _dateOptions; private GameObject _relationshipsPanel; private Text _relationshipsStatsText; private ScrollRect _relationshipsScroll; private RectTransform _relationshipsListRoot; private bool _cursorCaptured; private bool _previousCursorVisible; private CursorLockMode _previousCursorLockState; private Texture2D _empressCursorTexture; private EmpressDateTarget? _lookTarget; private EmpressDateTarget? _activeTarget; private bool _dateWaitingForChoice; private bool _dateWaitingForAnswer; private bool _dateWaitingAfterChoice; private float _scanTimer; private string _saveFile = ""; private Font _font; private EmpressDateAudio _audio; private Sprite _uiPanelSprite; private Sprite _uiGlassSprite; private Sprite _uiAccentSprite; private Sprite _uiFrameSprite; private string _fullDateBody = ""; private int _fullDateVisibleLength; private float _visibleDateCharacters; private int _lastVisibleDateCharacters; private string _lastCommittedKey = ""; private string _lastCommittedName = ""; private string _activeQuestion = ""; private string _activeFollowUpQuestion = ""; private bool _singleplayerLockWarned; private float _nextFollowerCleanupAt; private const int EmpressMinimumShopPriceK = 1; private static readonly string[] EmpressOpeners = new string[30] { "You lock eyes with {0}. It has no eyes, which makes this worse.", "{0} looks emotionally available. Or physically unavoidable. Same thing.", "Empress detects romantic tension between you and {0}. The lab refuses to comment.", "{0} is giving mysterious energy. Probably because it cannot legally speak.", "You approach {0} with the confidence of someone who has dated worse.", "{0} waits for you. Menacingly. Romantically. Economically.", "The air gets weird around {0}. This is either chemistry or bad ventilation.", "You ask {0} if it comes here often. It does. It lives here.", "{0} has entered the dating pool. The pool is haunted.", "Empress has created a private romantic disaster chamber for you and {0}.", "{0} seems ready for a date. Or a forklift. Hard to tell.", "You and {0} share a silence so deep HR would call it a meeting.", "{0} is not running away. Huge green flag.", "You feel a spark with {0}. Please do not lick the spark.", "{0} accepts your presence with concerning patience.", "The date begins. {0} has already seen too much.", "{0} is here, you are here, and the universe has stopped trying to be normal.", "You compliment {0}. It remains structurally committed.", "{0} has a vibe. The vibe may be asbestos.", "Empress says this counts as courtship. Empress will not elaborate.", "{0} seems flattered. Or rendered.", "You ask {0} about its dreams. It says nothing, which is brave.", "A relationship with {0} begins where good decisions go to die.", "{0} radiates the confidence of something with no browser history.", "You prepare to date {0}. The walls are gossiping.", "{0} is ready. Somehow this is your life now.", "You feel seen by {0}. This is impressive because it may be a wall.", "Empress opens a little dating UI and quietly loses respect for physics.", "{0} has been promoted from object to emotional problem.", "You begin the date. {0} refuses to split the bill." }; private static readonly string[] EmpressSweet = new string[10] { "You tell {0} it has beautiful collision. Love rises by {4}.", "{0} appreciates your gentle tone. It is still processing the concept of tone. Love rises by {4}.", "You say {0} makes this cursed job feel less cursed. Love rises by {4}.", "{0} lets the compliment sit there like a warm soup. Love rises by {4}.", "You admire {0}'s shape, purpose, and emotional load-bearing qualities. Love rises by {4}.", "{0} blushes internally. Probably. Love rises by {4}.", "You offer {0} a respectful nod. The date becomes dangerously wholesome. Love rises by {4}.", "{0} enjoys being perceived without being thrown. Love rises by {4}.", "You tell {0} it matters. Empress pretends not to tear up. Love rises by {4}.", "{0} accepts your tenderness like a tiny haunted receipt. Love rises by {4}." }; private static readonly string[] EmpressWeird = new string[10] { "You ask {0} if it has ever tasted sunlight. The answer changes you both. Love rises by {4}.", "{0} respects your commitment to being this strange in public. Love rises by {4}.", "You explain your dream where {0} was mayor. It does not object. Love rises by {4}.", "{0} hears your weird little confession and somehow stays. Love rises by {4}.", "You whisper, 'same time next apocalypse?' {0} understands. Love rises by {4}.", "{0} and you invent a secret language made mostly of panic. Love rises by {4}.", "You show {0} a dance move that should be illegal. It survives. Love rises by {4}.", "{0} finds your oddness marketable. Love rises by {4}.", "You tell {0} it would make a gorgeous witness in court. Love rises by {4}.", "The date gets so weird Empress starts taking notes. Love rises by {4}." }; private static readonly string[] EmpressDramatic = new string[10] { "You declare that {0} is the only thing in this facility that understands you. Love rises by {4}.", "{0} receives your dramatic speech with terrifying stillness. Love rises by {4}.", "You promise {0} a future neither of you can afford. Love rises by {4}.", "Thunder would strike if this building respected timing. Love rises by {4}.", "You stare at {0} like the credits are about to roll. Love rises by {4}.", "{0} becomes your tragic co-star for eleven seconds. Love rises by {4}.", "You say, 'if we survive this, dinner.' {0} cannot legally sign consent forms. Love rises by {4}.", "The date swells with impossible music only Empress can hear. Love rises by {4}.", "{0} accepts your monologue because interrupting would require animation. Love rises by {4}.", "You make this relationship everyone else's problem. Love rises by {4}." }; private static readonly string[] EmpressStatuses = new string[6] { "Stranger", "Awkward Crush", "Suspicious Situationship", "Beloved Nuisance", "Soulbound Problem", "Empress Approved Disaster" }; internal void EmpressBoot(EmpressDateEverythingPlugin plugin) { _plugin = plugin; _font = Resources.GetBuiltinResource("Arial.ttf"); _saveFile = Path.Combine(Paths.ConfigPath, "EmpressDateEverything", "relationships.empress"); Directory.CreateDirectory(Path.GetDirectoryName(_saveFile)); Directory.CreateDirectory(_plugin.PortraitFolder.Value); EmpressDateCast.EmpressInitialize(_plugin); _audio = new EmpressDateAudio(); _audio.EmpressInitialize((MonoBehaviour)(object)this, _plugin); EmpressLoad(); EmpressCreateUiSkins(); EmpressCreateUi(); } private void Update() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) if (!_plugin.Enabled.Value) { EmpressSetVisible(_promptPanel, visible: false); EmpressSetVisible(_datePanel, visible: false); EmpressSetVisible(_relationshipsPanel, visible: false); EmpressRestoreCursorState(); _audio.EmpressStopCharacterMusic(); EmpressDismissAllFollowers(); return; } if (!EmpressDateEverythingAccess.IsOfflineSingleplayer()) { EmpressApplySingleplayerLock(); return; } _singleplayerLockWarned = false; EmpressCleanupFollowers(); if (Input.GetKeyDown(_plugin.RelationshipsKey.Value)) { EmpressToggleRelationships(); } bool flag = _datePanel.activeSelf || _relationshipsPanel.activeSelf; EmpressMaintainUiCursor(flag); if (flag) { EmpressApplyUiControlLock(); } if (_relationshipsPanel.activeSelf) { EmpressSetVisible(_promptPanel, visible: false); if (Input.GetKeyDown((KeyCode)27)) { EmpressToggleRelationships(); } return; } if (_datePanel.activeSelf) { EmpressTickTyping(); EmpressDateInput(); return; } _scanTimer -= Time.unscaledDeltaTime; if (_scanTimer <= 0f) { _scanTimer = 0.08f; _lookTarget = EmpressFindTarget(); EmpressRefreshPrompt(); } if (_lookTarget != null && EmpressDateKeyDown()) { EmpressStartDate(_lookTarget); } } private bool EmpressDateKeyDown() { return Input.GetKeyDown((KeyCode)120); } private void EmpressApplySingleplayerLock() { _lookTarget = null; _activeTarget = null; _dateWaitingForChoice = false; _dateWaitingForAnswer = false; _dateWaitingAfterChoice = false; EmpressSetVisible(_datePanel, visible: false); EmpressSetVisible(_relationshipsPanel, visible: false); EmpressRestoreCursorState(); _audio.EmpressStopCharacterMusic(); EmpressDismissAllFollowers(); _promptText.text = "EMPRESS DATE EVERYTHING LOCKED :: singleplayer offline only"; EmpressSetVisible(_promptPanel, visible: true); if (!_singleplayerLockWarned) { _singleplayerLockWarned = true; EmpressDateEverythingPlugin.EmpressWarning("DateEverything is locked because this session is not offline singleplayer."); } } private void EmpressCleanupFollowers() { if (Time.unscaledTime < _nextFollowerCleanupAt) { return; } _nextFollowerCleanupAt = Time.unscaledTime + 2.5f; List list = null; foreach (KeyValuePair follower in _followers) { if ((Object)(object)follower.Value == (Object)null) { if (list == null) { list = new List(); } list.Add(follower.Key); } } if (list == null) { return; } for (int i = 0; i < list.Count; i++) { _followers.Remove(list[i]); if (_relationships.TryGetValue(list[i], out EmpressRelationship value)) { value.Following = false; } } } private void EmpressDismissAllFollowers() { foreach (EmpressDateFollower value in _followers.Values) { if ((Object)(object)value != (Object)null) { Object.Destroy((Object)(object)((Component)value).gameObject); } } _followers.Clear(); foreach (EmpressRelationship value2 in _relationships.Values) { value2.Following = false; } } private void EmpressDateInput() { if (EmpressDateKeyDown()) { EmpressRejectDate(); } else if (Input.GetKeyDown((KeyCode)27)) { EmpressRejectDate(); } else if (_visibleDateCharacters < (float)_fullDateVisibleLength && (Input.GetKeyDown((KeyCode)101) || Input.GetKeyDown((KeyCode)49) || Input.GetKeyDown((KeyCode)50) || Input.GetKeyDown((KeyCode)51) || Input.GetKeyDown((KeyCode)52) || Input.GetKeyDown((KeyCode)53))) { _visibleDateCharacters = _fullDateVisibleLength; _lastVisibleDateCharacters = _fullDateVisibleLength; _dateBody.text = _fullDateBody; _audio.EmpressStopTypingSound(); } else if (_dateWaitingForChoice) { if (Input.GetKeyDown((KeyCode)49) || Input.GetKeyDown((KeyCode)257)) { EmpressChoose(0); } else if (Input.GetKeyDown((KeyCode)50) || Input.GetKeyDown((KeyCode)258)) { EmpressChoose(1); } else if (Input.GetKeyDown((KeyCode)51) || Input.GetKeyDown((KeyCode)259)) { EmpressChoose(2); } else if (Input.GetKeyDown((KeyCode)52) || Input.GetKeyDown((KeyCode)260)) { EmpressChoose(3); } else if ((Input.GetKeyDown((KeyCode)53) || Input.GetKeyDown((KeyCode)261)) && _activeTarget != null) { EmpressToggleFollower(_activeTarget); } } else if (_dateWaitingForAnswer) { if (Input.GetKeyDown((KeyCode)49) || Input.GetKeyDown((KeyCode)257)) { EmpressAnswerQuestion(0); } else if (Input.GetKeyDown((KeyCode)50) || Input.GetKeyDown((KeyCode)258)) { EmpressAnswerQuestion(1); } else if (Input.GetKeyDown((KeyCode)51) || Input.GetKeyDown((KeyCode)259)) { EmpressAnswerQuestion(2); } else if (Input.GetKeyDown((KeyCode)52) || Input.GetKeyDown((KeyCode)260)) { EmpressAnswerQuestion(3); } } else if (_dateWaitingAfterChoice && Input.GetKeyDown((KeyCode)101) && _activeTarget != null && EmpressCanContinueDate(_activeTarget.Relationship)) { EmpressContinueDate(_activeTarget); } else if (_dateWaitingAfterChoice && (Input.GetKeyDown((KeyCode)53) || Input.GetKeyDown((KeyCode)261)) && _activeTarget != null) { EmpressToggleFollower(_activeTarget); } } private void EmpressTickTyping() { if (_fullDateBody.Length <= 0 || _visibleDateCharacters >= (float)_fullDateVisibleLength) { return; } if (_plugin.TypingCharactersPerSecond.Value <= 0.01f) { _visibleDateCharacters = _fullDateVisibleLength; _lastVisibleDateCharacters = _fullDateVisibleLength; _dateBody.text = _fullDateBody; _audio.EmpressStopTypingSound(); return; } int num = Mathf.Clamp(Mathf.FloorToInt(_visibleDateCharacters), 0, _fullDateVisibleLength); _visibleDateCharacters += _plugin.TypingCharactersPerSecond.Value * Time.unscaledDeltaTime; int num2 = Mathf.Clamp(Mathf.FloorToInt(_visibleDateCharacters), 0, _fullDateVisibleLength); if (num2 > num) { _dateBody.text = EmpressRichTextSlice(_fullDateBody, num2); if (EmpressSliceHasNonWhitespace(_fullDateBody, Mathf.Max(_lastVisibleDateCharacters, num), num2)) { _audio.EmpressPlayCharacter(num2); } _lastVisibleDateCharacters = num2; if (num2 >= _fullDateVisibleLength) { _audio.EmpressStopTypingSound(); } } } private void EmpressApplyUiControlLock() { PlayerController instance = PlayerController.instance; if ((Object)(object)instance != (Object)null) { instance.InputDisable(0.15f); } if ((Object)(object)CameraAim.Instance != (Object)null) { CameraAim.Instance.OverrideAimStop(); } } private void EmpressMaintainUiCursor(bool visible) { if (visible) { EmpressApplyUiCursor(); } else { EmpressRestoreCursorState(); } } private void EmpressCaptureCursorState() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if (!_cursorCaptured) { _previousCursorVisible = Cursor.visible; _previousCursorLockState = Cursor.lockState; _cursorCaptured = true; } } private void EmpressRestoreCursorState() { //IL_000a: 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_0034: Unknown result type (might be due to invalid IL or missing references) if (_cursorCaptured) { Cursor.SetCursor((Texture2D)null, Vector2.zero, (CursorMode)0); Cursor.visible = _previousCursorVisible; Cursor.lockState = _previousCursorLockState; if ((_previousCursorVisible || (int)_previousCursorLockState == 0) && (Object)(object)MenuCursor.instance != (Object)null) { MenuCursor.instance.Show(); } _cursorCaptured = false; } } private void EmpressApplyUiCursor() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) EmpressCaptureCursorState(); EmpressEnsureCursorTexture(); EmpressSuppressGameCursorSystems(); Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; Cursor.SetCursor(_empressCursorTexture, new Vector2((float)((Texture)_empressCursorTexture).width * 0.5f, (float)((Texture)_empressCursorTexture).height * 0.5f), (CursorMode)0); } private void EmpressSuppressGameCursorSystems() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) EmpressDateEverythingAccess.SetCursorUnlockTimer(CursorManager.instance, -1234f); if (!((Object)(object)MenuCursor.instance == (Object)null)) { EmpressDateEverythingAccess.SetMenuCursorShowTimer(MenuCursor.instance, 0f); EmpressDateEverythingAccess.SetMenuCursorOverridePosTimer(MenuCursor.instance, 0f); GameObject menuCursorMesh = EmpressDateEverythingAccess.GetMenuCursorMesh(MenuCursor.instance); if ((Object)(object)menuCursorMesh != (Object)null && menuCursorMesh.activeSelf) { menuCursorMesh.SetActive(false); } ((Component)MenuCursor.instance).transform.localScale = Vector3.zero; } } private void EmpressEnsureCursorTexture() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_empressCursorTexture != (Object)null) { return; } _empressCursorTexture = new Texture2D(32, 32, (TextureFormat)4, false) { filterMode = (FilterMode)0, hideFlags = (HideFlags)61, name = "EmpressDateEverything.Cursor" }; for (int i = 0; i < ((Texture)_empressCursorTexture).height; i++) { for (int j = 0; j < ((Texture)_empressCursorTexture).width; j++) { float num = (float)j - 15.5f; float num2 = (float)i - 15.5f; float num3 = Mathf.Sqrt(num * num + num2 * num2); Color clear = Color.clear; if (num3 <= 2.15f) { ((Color)(ref clear))..ctor(1f, 0.95f, 0.93f, 1f); } else if (num3 <= 5.15f) { ((Color)(ref clear))..ctor(0.96f, 0.55f, 0.28f, 1f); } else if (num3 <= 7.4f) { ((Color)(ref clear))..ctor(1f, 0.45f, 0.32f, 0.36f); } _empressCursorTexture.SetPixel(j, i, clear); } } _empressCursorTexture.Apply(); } private void EmpressSetDateDialog(string title, string body, string options) { _dateTitle.text = title; if ((Object)(object)_dateSubtitle != (Object)null) { _dateSubtitle.text = ((_activeTarget != null) ? EmpressBuildDateSubtitle(_activeTarget) : ""); } _fullDateBody = body; _fullDateVisibleLength = EmpressCountVisibleCharacters(body); _visibleDateCharacters = 0f; _lastVisibleDateCharacters = 0; _dateBody.text = ""; _dateOptions.text = options; _audio.EmpressStopTypingSound(); } private static bool EmpressSliceHasNonWhitespace(string text, int startVisible, int endVisible) { if (string.IsNullOrEmpty(text) || endVisible <= startVisible) { return false; } int num = 0; bool flag = false; foreach (char c in text) { if (c == '<') { flag = true; continue; } if (flag) { if (c == '>') { flag = false; } continue; } if (num >= startVisible && num < endVisible && !char.IsWhiteSpace(c)) { return true; } num++; if (num >= endVisible) { return false; } } return false; } private static int EmpressCountVisibleCharacters(string text) { if (string.IsNullOrEmpty(text)) { return 0; } int num = 0; bool flag = false; foreach (char c in text) { if (c == '<') { flag = true; } else if (flag) { if (c == '>') { flag = false; } } else { num++; } } return num; } private static string EmpressRichTextSlice(string text, int visibleCharacters) { if (string.IsNullOrEmpty(text) || visibleCharacters <= 0) { return ""; } StringBuilder stringBuilder = new StringBuilder(text.Length + 32); List list = new List(); StringBuilder stringBuilder2 = new StringBuilder(32); bool flag = false; int num = 0; foreach (char c in text) { if (flag) { stringBuilder2.Append(c); if (c == '>') { flag = false; string text2 = stringBuilder2.ToString(); stringBuilder.Append(text2); EmpressTrackRichTag(list, text2); stringBuilder2.Length = 0; } } else if (c == '<') { flag = true; stringBuilder2.Length = 0; stringBuilder2.Append(c); } else { if (num >= visibleCharacters) { break; } stringBuilder.Append(c); num++; } } for (int num2 = list.Count - 1; num2 >= 0; num2--) { stringBuilder.Append("'); } return stringBuilder.ToString(); } private static void EmpressTrackRichTag(List openTags, string tag) { if (string.IsNullOrWhiteSpace(tag) || tag.Length < 3) { return; } string text = tag.Trim().Trim('<', '>'); if (text.Length == 0 || text[0] == '!' || text[0] == '?') { return; } if (text[0] == '/') { string text2 = EmpressRichTagName(text.Substring(1)); for (int num = openTags.Count - 1; num >= 0; num--) { if (openTags[num] == text2) { openTags.RemoveAt(num); break; } } } else if (!text.EndsWith("/")) { string text3 = EmpressRichTagName(text); if (!(text3 == "br") && text3.Length != 0) { openTags.Add(text3); } } } private static string EmpressRichTagName(string tagContent) { if (string.IsNullOrWhiteSpace(tagContent)) { return ""; } string[] array = tagContent.Split(new char[2] { ' ', '=' }, 2, StringSplitOptions.RemoveEmptyEntries); if (array.Length == 0) { return ""; } return array[0].Trim().ToLowerInvariant(); } private EmpressDateTarget? EmpressFindTarget() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) Camera val = EmpressFindCamera(); if ((Object)(object)val == (Object)null) { return null; } Ray val2 = new Ray(((Component)val).transform.position, ((Component)val).transform.forward); float num = Mathf.Min(_plugin.MaxDateDistance.Value, _plugin.LookPromptDistance.Value); RaycastHit val3 = default(RaycastHit); if (!Physics.Raycast(val2, ref val3, num, -1, (QueryTriggerInteraction)2)) { return null; } Collider collider = ((RaycastHit)(ref val3)).collider; if ((Object)(object)collider == (Object)null) { return null; } Transform transform = ((Component)collider).transform; PlayerAvatar componentInParent = ((Component)transform).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { string text = EmpressCleanName(EmpressDateEverythingAccess.PlayerName(componentInParent)); if (string.IsNullOrWhiteSpace(text)) { text = "Player"; } return EmpressMakeTarget("Player", text, ((Component)componentInParent).gameObject, ((RaycastHit)(ref val3)).point); } Enemy val4 = EmpressFindEnemyFromHit(transform, ((RaycastHit)(ref val3)).point); if ((Object)(object)val4 != (Object)null) { string name = EmpressEnemyDisplayName(val4); return EmpressMakeTarget("Enemy", name, ((Component)val4).gameObject, ((RaycastHit)(ref val3)).point); } TruckDoor val5 = EmpressFindComponentFromHit(transform); if ((Object)(object)val5 != (Object)null) { return EmpressMakeTarget("Door", "Truck Door", ((Component)val5).gameObject, ((RaycastHit)(ref val3)).point); } TutorialDoor val6 = EmpressFindComponentFromHit(transform); if ((Object)(object)val6 != (Object)null) { return EmpressMakeTarget("Door", "Tutorial Door", ((Component)val6).gameObject, ((RaycastHit)(ref val3)).point); } Transform val7 = EmpressFindDoorFromHit(transform); if ((Object)(object)val7 != (Object)null) { return EmpressMakeTarget("Door", EmpressDoorDisplayName(val7), ((Component)val7).gameObject, ((RaycastHit)(ref val3)).point); } Transform val8 = EmpressFindTruckFromHit(transform); if ((Object)(object)val8 != (Object)null) { return EmpressMakeTarget("Truck", EmpressTruckDisplayName(val8), ((Component)val8).gameObject, ((RaycastHit)(ref val3)).point); } PhysGrabCart val9 = EmpressFindComponentFromHit(transform); if ((Object)(object)val9 != (Object)null) { return EmpressMakeTarget("Cart", EmpressCartDisplayName(val9), ((Component)val9).gameObject, ((RaycastHit)(ref val3)).point); } ExtractionPoint val10 = EmpressFindComponentFromHit(transform); if ((Object)(object)val10 != (Object)null) { return EmpressMakeTarget("Extractor", EmpressExtractorDisplayName(val10), ((Component)val10).gameObject, ((RaycastHit)(ref val3)).point); } ValuableObject val11 = EmpressFindComponentFromHit(transform); if ((Object)(object)val11 != (Object)null) { return EmpressMakeTarget("Valuable", EmpressValuableDisplayName(val11), ((Component)val11).gameObject, ((RaycastHit)(ref val3)).point); } ItemAttributes val12 = EmpressFindComponentFromHit(transform); if ((Object)(object)val12 != (Object)null) { return EmpressMakeTarget("Item", EmpressItemDisplayName(val12), ((Component)val12).gameObject, ((RaycastHit)(ref val3)).point); } PhysGrabObject val13 = EmpressFindComponentFromHit(transform); if ((Object)(object)val13 != (Object)null) { return EmpressMakeTarget("Object", EmpressObjectDisplayName(((Component)val13).gameObject), ((Component)val13).gameObject, ((RaycastHit)(ref val3)).point); } Transform val14 = EmpressFindStaticObjectFromHit(transform); if ((Object)(object)val14 != (Object)null) { return EmpressMakeTarget("Object", EmpressObjectDisplayName(((Component)val14).gameObject), ((Component)val14).gameObject, ((RaycastHit)(ref val3)).point); } string text2 = ((!(Mathf.Abs(((RaycastHit)(ref val3)).normal.y) > 0.75f)) ? "Wall" : ((((RaycastHit)(ref val3)).normal.y > 0f) ? "Floor" : "Ceiling")); string text3 = EmpressCleanName(((Object)((Component)collider).gameObject).name); if (string.IsNullOrWhiteSpace(text3) || text3.Equals("Cube", StringComparison.OrdinalIgnoreCase) || text3.Equals("Collider", StringComparison.OrdinalIgnoreCase)) { text3 = text2; } return EmpressMakeTarget(text2, text3, ((Component)collider).gameObject, ((RaycastHit)(ref val3)).point); } private static Enemy EmpressFindEnemyFromHit(Transform hitTransform, Vector3 hitPoint) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)hitTransform == (Object)null) { return null; } Enemy componentInParent = ((Component)hitTransform).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { return componentInParent; } EnemyParent componentInParent2 = ((Component)hitTransform).GetComponentInParent(); if ((Object)(object)componentInParent2 != (Object)null) { componentInParent = ((Component)componentInParent2).GetComponentInChildren(true); if ((Object)(object)componentInParent != (Object)null) { return componentInParent; } } if (EmpressLooksEnemyRelated(hitTransform)) { componentInParent = ((Component)hitTransform).GetComponentInChildren(true); if ((Object)(object)componentInParent != (Object)null) { return componentInParent; } } Collider[] array = Physics.OverlapSphere(hitPoint, 1.15f, -1, (QueryTriggerInteraction)2); float num = float.MaxValue; Enemy result = null; foreach (Collider val in array) { if ((Object)(object)val == (Object)null) { continue; } Enemy val2 = ((Component)val).GetComponentInParent(); if ((Object)(object)val2 == (Object)null) { EnemyParent componentInParent3 = ((Component)val).GetComponentInParent(); val2 = (((Object)(object)componentInParent3 != (Object)null) ? ((Component)componentInParent3).GetComponentInChildren(true) : null); } if (!((Object)(object)val2 == (Object)null)) { float num2 = Vector3.Distance(hitPoint, ((Component)val2).transform.position); if (num2 < num) { num = num2; result = val2; } } } return result; } private static bool EmpressLooksEnemyRelated(Transform transform) { Transform val = transform; int num = 0; while ((Object)(object)val != (Object)null && num < 8) { string text = ((Object)val).name.ToLowerInvariant(); if (text.Contains("enemy") || text.Contains("hunter") || text.Contains("runner") || text.Contains("duck") || text.Contains("gnome") || text.Contains("head") || text.Contains("shadow") || text.Contains("bang") || text.Contains("floater")) { return true; } Component[] components = ((Component)val).GetComponents(); foreach (Component val2 in components) { if ((Object)(object)val2 != (Object)null && ((object)val2).GetType().Name.StartsWith("Enemy", StringComparison.Ordinal)) { return true; } } num++; val = val.parent; } return false; } private static string EmpressEnemyDisplayName(Enemy enemy) { if ((Object)(object)enemy == (Object)null) { return "Enemy"; } EnemyParent componentInParent = ((Component)enemy).GetComponentInParent(); string text = (((Object)(object)componentInParent != (Object)null) ? EmpressCleanName(componentInParent.enemyName) : ""); if (string.IsNullOrWhiteSpace(text) || text == "Dinosaur") { text = EmpressCleanName(((Object)((Component)enemy).gameObject).name); } if (string.IsNullOrWhiteSpace(text) || text == "Enemy" || text.Length <= 2) { text = ((object)enemy).GetType().Name; } return text; } private static T EmpressFindComponentFromHit(Transform hitTransform) where T : Component { if ((Object)(object)hitTransform == (Object)null) { return default(T); } T component = ((Component)hitTransform).GetComponent(); if ((Object)(object)component != (Object)null) { return component; } component = ((Component)hitTransform).GetComponentInParent(); if ((Object)(object)component != (Object)null) { return component; } return EmpressFindComponentInChildCluster(hitTransform); } private static T EmpressFindComponentInChildCluster(Transform root) where T : Component { if ((Object)(object)root == (Object)null) { return default(T); } int num = Mathf.Min(root.childCount, 12); for (int i = 0; i < num; i++) { Transform child = root.GetChild(i); if ((Object)(object)child == (Object)null) { continue; } T component = ((Component)child).GetComponent(); if ((Object)(object)component != (Object)null) { return component; } int num2 = Mathf.Min(child.childCount, 8); for (int j = 0; j < num2; j++) { Transform child2 = child.GetChild(j); if (!((Object)(object)child2 == (Object)null)) { component = ((Component)child2).GetComponent(); if ((Object)(object)component != (Object)null) { return component; } } } } return default(T); } private static string EmpressCartDisplayName(PhysGrabCart cart) { string text = (((Object)(object)cart != (Object)null) ? EmpressObjectDisplayName(((Component)cart).gameObject) : ""); if (string.IsNullOrWhiteSpace(text) || EmpressIsGenericColliderName(text)) { text = "Cart"; } return text; } private static string EmpressExtractorDisplayName(ExtractionPoint extractor) { string text = (((Object)(object)extractor != (Object)null) ? EmpressObjectDisplayName(((Component)extractor).gameObject) : ""); if (string.IsNullOrWhiteSpace(text) || EmpressIsGenericColliderName(text)) { text = "Extractor"; } return text; } private static string EmpressValuableDisplayName(ValuableObject valuable) { string text = (((Object)(object)valuable != (Object)null) ? EmpressObjectDisplayName(((Component)valuable).gameObject) : ""); if (string.IsNullOrWhiteSpace(text) || EmpressIsGenericColliderName(text)) { text = "Valuable"; } return text; } private static string EmpressItemDisplayName(ItemAttributes item) { string text = (((Object)(object)item != (Object)null) ? EmpressDateEverythingAccess.ItemName(item) : ""); if (string.IsNullOrWhiteSpace(text) && (Object)(object)item != (Object)null) { text = EmpressDateEverythingAccess.ItemAssetName(item); } if (string.IsNullOrWhiteSpace(text) && (Object)(object)item != (Object)null) { text = EmpressObjectDisplayName(((Component)item).gameObject); } if (string.IsNullOrWhiteSpace(text) || EmpressIsGenericColliderName(text)) { text = "Item"; } return text; } private static string EmpressObjectDisplayName(GameObject gameObject) { if ((Object)(object)gameObject == (Object)null) { return ""; } Transform val = gameObject.transform; string text = ""; int num = 0; while ((Object)(object)val != (Object)null && num < 8) { string text2 = EmpressCleanName(((Object)((Component)val).gameObject).name); if (!string.IsNullOrWhiteSpace(text2)) { if (string.IsNullOrWhiteSpace(text)) { text = text2; } if (!EmpressIsGenericColliderName(text2)) { return text2; } } num++; val = val.parent; } if (!string.IsNullOrWhiteSpace(text)) { return text; } return "Object"; } private static Transform EmpressFindStaticObjectFromHit(Transform hitTransform) { if ((Object)(object)hitTransform == (Object)null) { return null; } Transform best = null; int bestScore = int.MinValue; Transform val = hitTransform; int num = 0; while ((Object)(object)val != (Object)null && num < 3) { EmpressScoreStaticCandidate(val, num, ref best, ref bestScore); int num2 = Mathf.Min(val.childCount, 10); for (int i = 0; i < num2; i++) { Transform child = val.GetChild(i); EmpressScoreStaticCandidate(child, num + 1, ref best, ref bestScore); if (!((Object)(object)child == (Object)null)) { int num3 = Mathf.Min(child.childCount, 6); for (int j = 0; j < num3; j++) { EmpressScoreStaticCandidate(child.GetChild(j), num + 2, ref best, ref bestScore); } } } num++; val = val.parent; } if (bestScore < 260) { return null; } return best; } private static void EmpressScoreStaticCandidate(Transform candidate, int depth, ref Transform best, ref int bestScore) { if (!((Object)(object)candidate == (Object)null) && EmpressDateCast.EmpressTryResolveStaticObjectLocal(((Component)candidate).gameObject, out EmpressDateCastSlot slot)) { int num = EmpressDateCast.EmpressStaticObjectPriority(slot.Key) * 100 - depth * 18; if (!EmpressIsGenericColliderName(((Object)candidate).name)) { num += 18; } if ((Object)(object)((Component)candidate).GetComponent() != (Object)null) { num += 10; } if (num > bestScore) { best = candidate; bestScore = num; } } } private static bool EmpressIsGenericColliderName(string name) { if (string.IsNullOrWhiteSpace(name)) { return true; } string text = name.Trim(); string text2 = text.Replace(" ", "").Replace("_", "").Replace("-", ""); if (text.Equals("Box", StringComparison.OrdinalIgnoreCase) || text.Equals("Cube", StringComparison.OrdinalIgnoreCase) || text.Equals("Collider", StringComparison.OrdinalIgnoreCase) || text.Equals("Trigger", StringComparison.OrdinalIgnoreCase) || text.Equals("Model", StringComparison.OrdinalIgnoreCase) || text.Equals("Mesh", StringComparison.OrdinalIgnoreCase) || text.Equals("Root", StringComparison.OrdinalIgnoreCase) || text.Equals("Pivot", StringComparison.OrdinalIgnoreCase) || text.Equals("Hitbox", StringComparison.OrdinalIgnoreCase) || text.Equals("Phys Grab Object", StringComparison.OrdinalIgnoreCase) || text.Equals("Physgrabobject", StringComparison.OrdinalIgnoreCase) || text.Equals("Object", StringComparison.OrdinalIgnoreCase)) { return true; } if (text2.Equals("SemiBoxCollider", StringComparison.OrdinalIgnoreCase) || text2.Equals("BoxCollider", StringComparison.OrdinalIgnoreCase) || text2.Equals("MeshCollider", StringComparison.OrdinalIgnoreCase) || text2.Equals("CapsuleCollider", StringComparison.OrdinalIgnoreCase) || text2.Equals("SphereCollider", StringComparison.OrdinalIgnoreCase) || text2.Equals("ColliderMesh", StringComparison.OrdinalIgnoreCase) || text2.Equals("Collision", StringComparison.OrdinalIgnoreCase) || text2.Equals("CollisionMesh", StringComparison.OrdinalIgnoreCase)) { return true; } if ((text.EndsWith(" Collider", StringComparison.OrdinalIgnoreCase) || text.EndsWith(" Trigger", StringComparison.OrdinalIgnoreCase)) && text.IndexOf("door", StringComparison.OrdinalIgnoreCase) < 0 && text.IndexOf("gate", StringComparison.OrdinalIgnoreCase) < 0 && text.IndexOf("hatch", StringComparison.OrdinalIgnoreCase) < 0 && text.IndexOf("cart", StringComparison.OrdinalIgnoreCase) < 0) { return text.IndexOf("truck", StringComparison.OrdinalIgnoreCase) < 0; } return false; } private static Transform EmpressFindDoorFromHit(Transform hitTransform) { if ((Object)(object)hitTransform == (Object)null) { return null; } Transform val = hitTransform; int num = 0; while ((Object)(object)val != (Object)null && num < 8) { if (EmpressLooksDoorRelated(val)) { return val; } num++; val = val.parent; } return EmpressFindDoorInChildren(hitTransform); } private static Transform EmpressFindDoorInChildren(Transform root) { if ((Object)(object)root == (Object)null) { return null; } Transform[] componentsInChildren = ((Component)root).GetComponentsInChildren(true); int num = Mathf.Min(componentsInChildren.Length, 64); for (int i = 0; i < num; i++) { Transform val = componentsInChildren[i]; if ((Object)(object)val != (Object)null && EmpressLooksDoorRelated(val)) { return val; } } return null; } private static bool EmpressLooksDoorRelated(Transform transform) { if ((Object)(object)transform == (Object)null) { return false; } string text = ((Object)transform).name.ToLowerInvariant(); if (text.Contains("door") || text.Contains("gate") || text.Contains("hatch") || text.Contains("shutter")) { return true; } Component[] components = ((Component)transform).GetComponents(); foreach (Component val in components) { if (!((Object)(object)val == (Object)null)) { string name = ((object)val).GetType().Name; if (name.IndexOf("Door", StringComparison.OrdinalIgnoreCase) >= 0 || name.IndexOf("Gate", StringComparison.OrdinalIgnoreCase) >= 0) { return true; } } } return false; } private static string EmpressDoorDisplayName(Transform doorTransform) { string text = (((Object)(object)doorTransform != (Object)null) ? EmpressObjectDisplayName(((Component)doorTransform).gameObject) : ""); if (!string.IsNullOrWhiteSpace(text)) { if (text.IndexOf("truck", StringComparison.OrdinalIgnoreCase) >= 0) { return "Truck Door"; } if (text.IndexOf("hatch", StringComparison.OrdinalIgnoreCase) >= 0) { return "Hatch"; } if (text.IndexOf("gate", StringComparison.OrdinalIgnoreCase) >= 0) { return "Gate"; } if (text.EndsWith(" Collider", StringComparison.OrdinalIgnoreCase) || text.EndsWith(" Trigger", StringComparison.OrdinalIgnoreCase)) { return "Door"; } } if (string.IsNullOrWhiteSpace(text) || EmpressIsGenericColliderName(text)) { text = "Doorway"; } return text; } private static Transform EmpressFindTruckFromHit(Transform hitTransform) { if ((Object)(object)hitTransform == (Object)null) { return null; } Transform val = hitTransform; int num = 0; while ((Object)(object)val != (Object)null && num < 10) { if (EmpressLooksTruckRelated(val)) { return val; } num++; val = val.parent; } return EmpressFindTruckInChildren(hitTransform); } private static Transform EmpressFindTruckInChildren(Transform root) { if ((Object)(object)root == (Object)null) { return null; } Transform[] componentsInChildren = ((Component)root).GetComponentsInChildren(true); int num = Mathf.Min(componentsInChildren.Length, 96); for (int i = 0; i < num; i++) { Transform val = componentsInChildren[i]; if ((Object)(object)val != (Object)null && EmpressLooksTruckRelated(val)) { return val; } } return null; } private static bool EmpressLooksTruckRelated(Transform transform) { if ((Object)(object)transform == (Object)null) { return false; } string text = ((Object)transform).name.ToLowerInvariant(); if (text.Contains("truck") || text.Contains("haul truck")) { return true; } Component[] components = ((Component)transform).GetComponents(); foreach (Component val in components) { if (!((Object)(object)val == (Object)null) && ((object)val).GetType().Name.IndexOf("Truck", StringComparison.OrdinalIgnoreCase) >= 0) { return true; } } return false; } private static string EmpressTruckDisplayName(Transform truckTransform) { string text = (((Object)(object)truckTransform != (Object)null) ? EmpressObjectDisplayName(((Component)truckTransform).gameObject) : ""); if (string.IsNullOrWhiteSpace(text) || EmpressIsGenericColliderName(text)) { return "Truck"; } if (text.IndexOf("truck", StringComparison.OrdinalIgnoreCase) < 0) { return "Truck"; } if (text.IndexOf("door", StringComparison.OrdinalIgnoreCase) >= 0) { return "Truck Door"; } return text; } private Camera EmpressFindCamera() { PlayerAvatar val = EmpressDateEverythingAccess.LocalPlayer(); if ((Object)(object)val != (Object)null && (Object)(object)val.localCamera != (Object)null) { Camera componentInChildren = ((Component)val.localCamera).GetComponentInChildren(true); if ((Object)(object)componentInChildren != (Object)null && ((Behaviour)componentInChildren).enabled) { return componentInChildren; } } if ((Object)(object)Camera.main != (Object)null && ((Behaviour)Camera.main).enabled) { return Camera.main; } Camera[] allCameras = Camera.allCameras; for (int i = 0; i < allCameras.Length; i++) { if ((Object)(object)allCameras[i] != (Object)null && ((Behaviour)allCameras[i]).enabled) { return allCameras[i]; } } return null; } private EmpressDateTarget EmpressMakeTarget(string category, string name, GameObject gameObject, Vector3 point) { //IL_00eb: Unknown result type (might be due to invalid IL or missing references) name = EmpressCleanName(name); if (string.IsNullOrWhiteSpace(name)) { name = category; } EmpressDateCastSlot empressDateCastSlot = EmpressDateCast.EmpressResolve(category, name, gameObject); string name2 = EmpressResolveDisplayName(category, name, empressDateCastSlot); string key = empressDateCastSlot.Key; if (!_relationships.TryGetValue(key, out EmpressRelationship value)) { value = EmpressTryRestoreCollapsedRelationship(empressDateCastSlot); } if (value == null) { value = new EmpressRelationship { Key = key, Name = name2, Category = empressDateCastSlot.Category, CastId = empressDateCastSlot.Key, PortraitFile = empressDateCastSlot.PortraitFile, Love = 0, StoryStage = 0, StoryMomentum = 0, Dates = 0, LastMetTicks = 0L }; _relationships[key] = value; } value.Name = name2; value.Category = empressDateCastSlot.Category; value.CastId = empressDateCastSlot.Key; value.PortraitFile = empressDateCastSlot.PortraitFile; value.LastSeenObject = name; return new EmpressDateTarget(key, name2, empressDateCastSlot.Category, gameObject, point, value, empressDateCastSlot, name); } private static string EmpressResolveDisplayName(string category, string observedName, EmpressDateCastSlot slot) { string text = ((slot != null) ? EmpressCleanName(slot.Name) : ""); if (!string.IsNullOrWhiteSpace(text)) { return text; } string text2 = EmpressCleanName(observedName); if (!string.IsNullOrWhiteSpace(text2)) { return text2; } return EmpressCleanName(category); } private EmpressRelationship EmpressTryRestoreCollapsedRelationship(EmpressDateCastSlot slot) { if (slot == null || string.IsNullOrWhiteSpace(slot.Key) || _relationships.ContainsKey(slot.Key)) { return null; } EmpressRelationship empressRelationship = null; foreach (KeyValuePair relationship in _relationships) { if (relationship.Key.StartsWith(slot.Key + "::", StringComparison.OrdinalIgnoreCase)) { EmpressRelationship value = relationship.Value; if (value != null && (empressRelationship == null || EmpressRelationshipScore(value) > EmpressRelationshipScore(empressRelationship))) { empressRelationship = value; } } } if (empressRelationship == null) { return null; } _relationships.Remove(empressRelationship.Key); empressRelationship.Key = slot.Key; empressRelationship.Name = EmpressResolveDisplayName(slot.Category, empressRelationship.LastSeenObject, slot); empressRelationship.Category = slot.Category; empressRelationship.CastId = slot.Key; empressRelationship.PortraitFile = slot.PortraitFile; _relationships[slot.Key] = empressRelationship; return empressRelationship; } private static int EmpressRelationshipScore(EmpressRelationship relationship) { if (relationship == null) { return int.MinValue; } return relationship.Love * 100000 + relationship.Dates * 1000 + relationship.MemoryScore * 10 + relationship.StoryStage; } private void EmpressStartDate(EmpressDateTarget target) { _activeTarget = target; _dateWaitingForChoice = true; _dateWaitingForAnswer = false; _dateWaitingAfterChoice = false; _activeChoices.Clear(); _activeAnswerChoices.Clear(); _activeChoices.AddRange(EmpressBuildChoices(target)); _activeQuestion = EmpressBuildRelationshipQuestion(target, target.Relationship); _activeFollowUpQuestion = ""; string text = EmpressBuildOpening(target); text = text + "\n\n" + ((_activeChoices.Count > 0) ? EmpressBuildQuestionPrompt(target) : EmpressBuildFinalPrompt(target)); EmpressSetDateDialog(EmpressBuildDateTitle(target), text, EmpressChoiceOptions(target)); EmpressSetPortrait(target); _audio.EmpressPlayCharacterMusic(target.Slot); EmpressSetVisible(_promptPanel, visible: false); EmpressSetVisible(_datePanel, visible: true); EmpressDateEverythingPlugin.EmpressDebug("dating " + target.Category + " " + target.Name); } private void EmpressContinueDate(EmpressDateTarget target) { _activeTarget = target; _dateWaitingForChoice = true; _dateWaitingForAnswer = false; _dateWaitingAfterChoice = false; _activeChoices.Clear(); _activeAnswerChoices.Clear(); _activeChoices.AddRange(EmpressBuildChoices(target)); _activeQuestion = EmpressBuildRelationshipQuestion(target, target.Relationship); _activeFollowUpQuestion = ""; string body = EmpressBuildContinuation(target) + "\n\n" + ((_activeChoices.Count > 0) ? EmpressBuildQuestionPrompt(target) : EmpressBuildFinalPrompt(target)); EmpressSetDateDialog(EmpressBuildDateTitle(target), body, EmpressChoiceOptions(target)); EmpressSetPortrait(target); _audio.EmpressPlayCharacterMusic(target.Slot); } private string EmpressChoiceOptions(EmpressDateTarget target) { List list = new List(); for (int i = 0; i < _activeChoices.Count && i < 4; i++) { list.Add("" + (i + 1) + ". " + _activeChoices[i].Label); } if (target.Relationship.Love >= 100) { list.Add("5. " + (target.Relationship.Following ? "Ask them to stay put" : "Ask them to follow")); } list.Add("X. Close"); return string.Join("\n", list); } private string EmpressAfterChoiceOptions(EmpressDateTarget target) { List list = new List { "F6. Relationship board" }; if (EmpressCanContinueDate(target.Relationship)) { list.Insert(0, "E. Continue date"); } if (target.Relationship.Love >= 100) { list.Add("5. " + (target.Relationship.Following ? "Dismiss follower" : "Let them follow")); } list.Add("X. Close"); return string.Join(" ", list); } private static bool EmpressCanContinueDate(EmpressRelationship relationship) { if (relationship == null) { return false; } if (relationship.Love >= 100 && !relationship.Following) { return false; } if (relationship.Following && relationship.Anger < 20 && relationship.Jealousy < 20 && relationship.Love >= 90) { return false; } return true; } private string EmpressAnswerOptions() { List list = new List(); for (int i = 0; i < _activeAnswerChoices.Count && i < 4; i++) { list.Add("" + (i + 1) + ". " + _activeAnswerChoices[i].Label); } list.Add("X. Close"); return string.Join("\n", list); } private string EmpressCurrentOptions(EmpressDateTarget target) { if (_dateWaitingForChoice) { return EmpressChoiceOptions(target); } if (!_dateWaitingForAnswer) { return EmpressAfterChoiceOptions(target); } return EmpressAnswerOptions(); } private string EmpressBuildDateTitle(EmpressDateTarget target) { return "" + EmpressRichEscape(target.Name) + ""; } private string EmpressBuildDateSubtitle(EmpressDateTarget target) { EmpressRelationship relationship = target.Relationship; return "" + EmpressRichEscape(target.Category + " :: " + EmpressStatus(relationship.Love) + " :: chapter " + (relationship.StoryStage + 1) + " :: love " + relationship.Love + "% :: trust " + relationship.Trust + "%") + ""; } private string EmpressBuildQuestionPrompt(EmpressDateTarget target) { return "" + EmpressRichEscape(target.Name) + " asks: \"" + EmpressRichEscape(_activeQuestion) + "\""; } private static string EmpressBuildFinalPrompt(EmpressDateTarget target) { if (target.Relationship.Following) { return "" + EmpressRichEscape(target.Name) + " is already following. The story is stable for now. If cheating, anger, or jealousy hits, the relationship can open back up."; } return "" + EmpressRichEscape(target.Name) + " is ready. Talking is no longer the proof. Press 5 if you want them to follow you."; } private string EmpressBuildRelationshipQuestion(EmpressDateTarget target, EmpressRelationship relationship) { if (relationship.Anger >= 45) { return "Are you here to repair this, or are you about to make me angrier on purpose?"; } if (relationship.Jealousy >= 25 && !string.IsNullOrWhiteSpace(relationship.LastOtherName)) { return "When you leave here, are you going to look for " + relationship.LastOtherName + " next?"; } if (relationship.Children > 0) { return "Do you realize our " + relationship.Children + " hypothetical children would inherit your terrible timing?"; } return EmpressStoryQuestion(target, relationship); } private static string EmpressStoryQuestion(EmpressDateTarget target, EmpressRelationship relationship) { switch (Mathf.Clamp(relationship.StoryStage, 0, 8)) { case 0: return "Is this a joke, a dare, or the beginning of something embarrassing?"; case 1: return "Are you curious about me, or are you only curious about what I can do for you?"; case 2: return "If I remember one thing from tonight, what are you hoping it is?"; case 3: return "What truth are you brave enough to give me today?"; case 4: return "What are we calling this now that it has consequences?"; case 5: return "If I asked for a future, would you mean yes or just enjoy sounding romantic?"; case 6: return "When this gets difficult, what part of us are you protecting first?"; case 7: return "Are you ready to be chosen back, loudly and inconveniently?"; default: if (!relationship.Following) { return "If I step off the map for you, are you going to treat that like a promise?"; } return "Now that I am actually with you, what are we surviving next?"; } } private List EmpressBuildChoices(EmpressDateTarget target) { EmpressRelationship relationship = target.Relationship; List list = new List(); if (relationship.Love >= 100 && relationship.Anger < 20 && relationship.Jealousy < 20) { return list; } if (relationship.Anger >= 24 || relationship.Jealousy >= 18) { EmpressTryAddChoice(list, EmpressMakeChoice("apologize", "Apologize", "You drop the bit and offer a real apology instead of hiding behind flirtation.", 0, 1, 4, 4, -2, -8, 2, 1, -1, 0, "apologetic")); EmpressTryAddChoice(list, EmpressMakeChoice("repair", "Repair trust", "You name the damage, the pattern, and the specific way you are going to stop making them carry it alone.", 0, 1, 6, 3, -3, -10, 5, 3, -3, 0, "repairing")); EmpressTryAddChoice(list, EmpressMakeChoice("reassure", "Reassure", "You reassure them that this conversation matters more than whatever panic brought you in.", 0, 2, 5, 3, -3, -5, 3, 1, -2, 0, "reassuring")); } EmpressAddStoryChoices(target, relationship, list); if (target.Category == "Enemy") { EmpressTryAddChoice(list, EmpressMakeChoice("truce", "Call truce", "You offer a truce and treat the monster in front of you like it gets to choose what happens next.", 0, 2, 5, 3, -2, -5, 3, 2, -1, 0, "peace-making")); } if (relationship.SecretDepth < 20 || relationship.Dates <= 1 || target.Category == "Valuable" || target.Category == "Extractor") { EmpressTryAddChoice(list, EmpressMakeChoice("memory", "Ask what they remember", "You ask what they remember when nobody is looking and do not blink when the answer takes its time.", 1, 1, 4, 2, 0, -1, 1, 5, 0, 0, "curious")); } EmpressTryAddChoice(list, EmpressMakeChoice("admire", "Admire", "You take a second to admire the details that make them feel singular instead of replaceable.", 0, 2, 3, 3, -1, -2, 2, 1, 0, 0, "admiring")); EmpressTryAddChoice(list, EmpressMakeChoice("need", "Ask what they need", "You ask them what they need from you instead of performing confidence.", 1, 1, 5, 2, -1, -2, 2, 4, -1, 0, "attentive")); return EmpressFinalizeChoices(relationship, list); } private void EmpressAddStoryChoices(EmpressDateTarget target, EmpressRelationship relationship, List choices) { switch (Mathf.Clamp(relationship.StoryStage, 0, 8)) { case 0: EmpressTryAddChoice(choices, EmpressMakeChoice("date", "Ask on date", "You ask for a real date, not just another stolen hallway moment between disasters.", 2, 3, 2, 4, 1, 0, 4, 1, 1, 0, "romantic")); EmpressTryAddChoice(choices, EmpressMakeChoice("admire", "Admire", "You take a second to admire the details that make them feel singular instead of replaceable.", 0, 2, 3, 3, -1, -2, 2, 1, 0, 0, "admiring")); EmpressTryAddChoice(choices, EmpressMakeChoice("listen", "Listen closely", "You stop trying to be impressive and listen for what they are not saying yet.", 1, 1, 5, 2, -1, -2, 2, 5, -1, 0, "listening")); break; case 1: EmpressTryAddChoice(choices, EmpressMakeChoice("memory", "Ask what they remember", "You ask what they remember when nobody is looking and do not blink when the answer takes its time.", 1, 1, 4, 2, 0, -1, 1, 5, 0, 0, "curious")); EmpressTryAddChoice(choices, EmpressMakeChoice("date", "Ask on date", "You ask for a real date, not just another stolen hallway moment between disasters.", 2, 3, 2, 4, 1, 0, 4, 1, 1, 0, "romantic")); EmpressTryAddChoice(choices, EmpressMakeChoice("boundary", "Respect boundary", "You ask where the line is and make it clear you are not here to shove past it.", 0, 1, 6, 2, -2, -3, 3, 2, -2, 0, "boundary-respecting")); break; case 2: EmpressTryAddChoice(choices, EmpressMakeChoice("promise", "Make a promise", "You make one promise small enough to keep and serious enough to matter.", 0, 2, 5, 2, -1, -2, 6, 2, -1, 0, "promising")); EmpressTryAddChoice(choices, EmpressMakeChoice("secret", "Share secret", "You lean in and trade them a secret you have not given anyone else in this building.", 1, 2, 5, 2, 0, -1, 2, 6, 0, 0, "confessional")); EmpressTryAddChoice(choices, EmpressMakeChoice("flirt", "Flirt", "You flirt with enough conviction to make the room feel warmer and slightly less OSHA-compliant.", 2, 4, 1, 5, 2, 0, 2, 0, 1, 0, "flirtatious")); break; case 3: EmpressTryAddChoice(choices, EmpressMakeChoice("vulnerability", "Be vulnerable", "You say the part that would be easier to bury under jokes, and you let it sit there breathing.", 1, 3, 5, 2, -1, -3, 5, 5, -2, 0, "vulnerable")); EmpressTryAddChoice(choices, EmpressMakeChoice("define", "Define relationship", "You ask what this is instead of letting it stay a haunted blur with benefits.", 1, 2, 4, 2, -1, -1, 6, 2, 0, 0, "serious")); EmpressTryAddChoice(choices, EmpressMakeChoice("date", "Ask on date", "You ask for a real date, not just another stolen hallway moment between disasters.", 2, 3, 2, 4, 1, 0, 4, 1, 1, 0, "romantic")); break; case 4: EmpressTryAddChoice(choices, EmpressMakeChoice("define", "Define relationship", "You ask what this is instead of letting it stay a haunted blur with benefits.", 1, 2, 4, 2, -1, -1, 6, 2, 0, 0, "serious")); EmpressTryAddChoice(choices, EmpressMakeChoice("future", "Talk future", "You stop pretending this is casual and talk about what a future together would actually look like.", 2, 3, 3, 4, 0, 0, 7, 1, 1, 0, "future-facing")); EmpressTryAddChoice(choices, EmpressMakeChoice("ritual", "Make a ritual", "You suggest a tiny ritual just for the two of you, something that can survive bad runs and worse timing.", 1, 2, 4, 3, -1, -1, 6, 3, -1, 0, "ritual-making")); break; case 5: EmpressTryAddChoice(choices, EmpressMakeChoice("future", "Talk future", "You stop pretending this is casual and talk about what a future together would actually look like.", 2, 3, 3, 4, 0, 0, 7, 1, 1, 0, "future-facing")); EmpressTryAddChoice(choices, EmpressMakeChoice("choose_them", "Choose them", "You make the choice explicit: not convenient, not accidental, not because they were closest. Them.", 2, 4, 4, 4, -2, -2, 8, 2, -2, 0, "chosen")); EmpressTryAddChoice(choices, EmpressMakeChoice("vulnerability", "Be vulnerable", "You say the part that would be easier to bury under jokes, and you let it sit there breathing.", 1, 3, 5, 2, -1, -3, 5, 5, -2, 0, "vulnerable")); break; case 6: EmpressTryAddChoice(choices, EmpressMakeChoice("devotion", "Show devotion", "You prove the relationship is not just words by choosing the inconvenient, loyal thing.", 2, 5, 4, 4, -2, -3, 9, 2, -2, 0, "devoted")); EmpressTryAddChoice(choices, EmpressMakeChoice("future", "Talk future", "You stop pretending this is casual and talk about what a future together would actually look like.", 2, 3, 3, 4, 0, 0, 7, 1, 1, 0, "future-facing")); EmpressTryAddChoice(choices, EmpressMakeChoice("children", "Talk children", "You ask what kind of tiny disastrous family the two of you would build if you stopped joking and started planning.", 2, 4, 4, 5, 0, 0, 8, 2, 0, 1, "family-minded")); break; default: EmpressTryAddChoice(choices, EmpressMakeChoice("devotion", "Show devotion", "You prove the relationship is not just words by choosing the inconvenient, loyal thing.", 2, 5, 4, 4, -2, -3, 9, 2, -2, 0, "devoted")); EmpressTryAddChoice(choices, EmpressMakeChoice("children", "Talk children", "You ask what kind of tiny disastrous family the two of you would build if you stopped joking and started planning.", 2, 4, 4, 5, 0, 0, 8, 2, 0, 1, "family-minded")); EmpressTryAddChoice(choices, EmpressMakeChoice("choose_them", "Choose them", "You make the choice explicit: not convenient, not accidental, not because they were closest. Them.", 2, 4, 4, 4, -2, -2, 8, 2, -2, 0, "chosen")); break; } } private static List EmpressFinalizeChoices(EmpressRelationship relationship, List choices) { EmpressRelationship relationship2 = relationship; List list = choices.Where((EmpressDateChoice choice) => choice != null && !string.Equals(choice.Id, relationship2.LastChoiceId, StringComparison.OrdinalIgnoreCase)).Take(4).ToList(); if (list.Count < 4) { foreach (EmpressDateChoice choice2 in choices) { if (choice2 != null && !list.Any((EmpressDateChoice existing) => existing.Id == choice2.Id)) { list.Add(choice2); if (list.Count >= 4) { break; } } } } return list; } private static EmpressDateChoice EmpressMakeChoice(string id, string label, string playerAction, int style, int love, int trust, int mood, int jealousy, int anger, int commitment, int secret, int suspicion, int children, string memoryTag) { return new EmpressDateChoice { Id = id, Label = label, PlayerAction = playerAction, Style = style, LoveBonus = love, TrustBonus = trust, MoodBonus = mood, JealousyBonus = jealousy, AngerBonus = anger, CommitmentBonus = commitment, SecretBonus = secret, SuspicionBonus = suspicion, ChildrenBonus = children, MemoryTag = memoryTag }; } private static void EmpressTryAddChoice(List choices, EmpressDateChoice choice) { EmpressDateChoice choice2 = choice; if (!choices.Any((EmpressDateChoice existing) => existing.Id == choice2.Id)) { choices.Add(choice2); } } private void EmpressChoose(int choiceIndex) { if (_activeTarget != null && choiceIndex >= 0 && choiceIndex < _activeChoices.Count) { EmpressDateTarget activeTarget = _activeTarget; EmpressRelationship relationship = activeTarget.Relationship; EmpressDateChoice empressDateChoice = _activeChoices[choiceIndex]; int num = Mathf.Clamp(_plugin.LoveGainPerDate.Value + empressDateChoice.LoveBonus + _random.Next(0, 4), 0, 100); int love = relationship.Love; relationship.Love = Mathf.Clamp(relationship.Love + num, 0, 100); relationship.Trust = Mathf.Clamp(relationship.Trust + empressDateChoice.TrustBonus + ((empressDateChoice.Style == 0) ? 1 : 0), 0, 100); relationship.Mood = Mathf.Clamp(relationship.Mood + empressDateChoice.MoodBonus - Mathf.RoundToInt((float)relationship.Anger * 0.04f), -100, 100); relationship.Jealousy = Mathf.Clamp(relationship.Jealousy + empressDateChoice.JealousyBonus + ((empressDateChoice.Style == 2 && !string.IsNullOrWhiteSpace(relationship.LastOtherName)) ? 1 : 0), 0, 100); relationship.Anger = Mathf.Clamp(relationship.Anger + empressDateChoice.AngerBonus, 0, 100); relationship.Commitment = Mathf.Clamp(relationship.Commitment + empressDateChoice.CommitmentBonus + ((relationship.Love >= 60) ? 1 : 0), 0, 100); relationship.SecretDepth = Mathf.Clamp(relationship.SecretDepth + empressDateChoice.SecretBonus, 0, 100); relationship.Suspicion = Mathf.Clamp(relationship.Suspicion + empressDateChoice.SuspicionBonus, 0, 100); relationship.MemoryScore = Mathf.Clamp(relationship.MemoryScore + 3 + Mathf.Max(0, num / 4) + empressDateChoice.TrustBonus + empressDateChoice.SecretBonus, 0, 9999); relationship.Children = Mathf.Clamp(relationship.Children + empressDateChoice.ChildrenBonus, 0, 99); relationship.LastStyle = empressDateChoice.MemoryTag; relationship.LastChoiceId = empressDateChoice.Id; relationship.Dates++; relationship.LastMetTicks = DateTime.UtcNow.Ticks; relationship.LastOtherName = ((_lastCommittedKey != activeTarget.Key) ? _lastCommittedName : relationship.LastOtherName); EmpressRecalculateStoryProgress(relationship, empressDateChoice, num); _activeFollowUpQuestion = ((relationship.Love >= 100 && love < 100) ? "" : EmpressFollowUpQuestion(activeTarget, relationship, empressDateChoice)); _activeAnswerChoices.Clear(); if (!string.IsNullOrWhiteSpace(_activeFollowUpQuestion)) { _activeAnswerChoices.AddRange(EmpressBuildAnswerChoices(activeTarget, relationship, empressDateChoice, _activeFollowUpQuestion)); } List list = EmpressResolveAftermath(activeTarget, relationship, empressDateChoice, num, love); relationship.LastLine = EmpressRelationshipLine(activeTarget, relationship, empressDateChoice, num, _activeFollowUpQuestion); if (list.Count > 0) { relationship.LastLine = relationship.LastLine + "\n\n" + string.Join("\n\n", list); } _lastCommittedKey = activeTarget.Key; _lastCommittedName = activeTarget.Name; _dateWaitingForChoice = false; _dateWaitingForAnswer = _activeAnswerChoices.Count > 0; _dateWaitingAfterChoice = !_dateWaitingForAnswer; EmpressSetDateDialog(EmpressBuildDateTitle(activeTarget), relationship.LastLine, _dateWaitingForAnswer ? EmpressAnswerOptions() : EmpressAfterChoiceOptions(activeTarget)); EmpressSave(); EmpressRefreshRelationships(); } } private List EmpressResolveAftermath(EmpressDateTarget target, EmpressRelationship relationship, EmpressDateChoice choice, int gain, int previousLove) { List list = new List(); string text = EmpressSpreadGossip(target, relationship, choice.Style); if (!string.IsNullOrWhiteSpace(text)) { list.Add(text); } string text2 = EmpressMaybeRelationshipConsequence(target, relationship, choice.Style); if (!string.IsNullOrWhiteSpace(text2)) { list.Add(text2); } if (choice.ChildrenBonus > 0) { list.Add("FAMILY The two of you leave the conversation with " + relationship.Children + " chaotic future child" + ((relationship.Children == 1) ? "" : "ren") + " on the mental ledger."); } if (previousLove < 100 && relationship.Love >= 100) { relationship.Commitment = 100; relationship.MemorySummary = "Maxed out on date " + relationship.Dates + "; ready to physically follow you into worse decisions."; list.Add(target.Name + " hits maximum affection. The relationship has stopped being theoretical. Press 5 to let them follow you."); } else { relationship.MemorySummary = EmpressBuildMemorySummary(target, relationship); } return list; } private static void EmpressRecalculateStoryProgress(EmpressRelationship relationship, EmpressDateChoice choice, int gain) { if (relationship != null && choice != null) { int num = gain + choice.TrustBonus + choice.CommitmentBonus * 2 + choice.SecretBonus + Mathf.Max(0, choice.MoodBonus) + ((choice.Id == "apologize" || choice.Id == "repair") ? 8 : 0); int num2 = relationship.Anger * 2 + relationship.Jealousy + relationship.Betrayals * 18 + Mathf.Max(0, choice.AngerBonus) * 3 + Mathf.Max(0, choice.JealousyBonus); int num3 = relationship.Dates * 11 + relationship.Love + relationship.Trust + relationship.Commitment * 2 + relationship.SecretDepth + relationship.Children * 10 + Mathf.RoundToInt((float)relationship.Mood * 0.25f) + num - num2; int num4 = Mathf.Clamp(num3 / 32, 0, 8); int num5 = Mathf.Clamp(relationship.StoryStage, 0, 8); if (num4 > num5 + 1) { num4 = num5 + 1; } else if (num4 < num5 - 1) { num4 = num5 - 1; } relationship.StoryStage = num4; relationship.StoryMomentum = Mathf.Clamp(num3, -999, 9999); } } private static void EmpressRecalculateStoryProgressFromAnswer(EmpressRelationship relationship, EmpressDateAnswerChoice answer) { if (relationship != null && answer != null) { int num = relationship.StoryMomentum + answer.LoveBonus + answer.TrustBonus + answer.CommitmentBonus * 2 + answer.SecretBonus + Mathf.Max(0, answer.MoodBonus) - relationship.Anger - relationship.Jealousy / 2 - Mathf.Max(0, answer.AngerBonus) * 3; int num2 = Mathf.Clamp(num / 34, 0, 8); int num3 = Mathf.Clamp(relationship.StoryStage, 0, 8); if (num2 > num3 + 1) { num2 = num3 + 1; } else if (num2 < num3 - 1) { num2 = num3 - 1; } relationship.StoryStage = num2; relationship.StoryMomentum = Mathf.Clamp(num, -999, 9999); } } private static void EmpressBackfillStoryProgress(EmpressRelationship relationship) { if (relationship != null) { int num = relationship.Dates * 11 + relationship.Love + relationship.Trust + relationship.Commitment * 2 + relationship.SecretDepth + relationship.Children * 10 + Mathf.RoundToInt((float)relationship.Mood * 0.25f) - relationship.Anger * 2 - relationship.Jealousy - relationship.Betrayals * 18; relationship.StoryStage = Mathf.Clamp(num / 32, 0, 8); relationship.StoryMomentum = Mathf.Clamp(num, -999, 9999); } } private string EmpressSpreadGossip(EmpressDateTarget target, EmpressRelationship current, int style) { string text = ""; if (!string.IsNullOrWhiteSpace(_lastCommittedKey) && _lastCommittedKey != target.Key && _relationships.TryGetValue(_lastCommittedKey, out EmpressRelationship value)) { value.Jealousy = Mathf.Clamp(value.Jealousy + ((style == 2) ? 7 : 4), 0, 100); value.Suspicion = Mathf.Clamp(value.Suspicion + Mathf.Max(3, current.Love / 12), 0, 100); value.LastOtherName = target.Name; if (EmpressRollDiscovery(value, current, style)) { value.Anger = Mathf.Clamp(value.Anger + 12 + ((style == 2) ? 8 : 3), 0, 100); value.Betrayals++; value.LastBadThing = "Found out you were seeing " + target.Name + "."; value.MemorySummary = "They remember " + target.Name + " and are deciding how dramatic to be about it."; text = value.Name + " finds out about this date. Somewhere in the building, jealousy learned your route."; } } foreach (EmpressRelationship value2 in _relationships.Values) { if (value2 != current && !(value2.Key == target.Key) && value2.Dates > 0 && (value2.Love >= 45 || value2.Commitment >= 35)) { int num = Mathf.Clamp(2 + current.Love / 18 + value2.Commitment / 18 + ((style == 2) ? 4 : 0), 2, 14); value2.Suspicion = Mathf.Clamp(value2.Suspicion + num, 0, 100); value2.Jealousy = Mathf.Clamp(value2.Jealousy + Mathf.Max(1, num / 2), 0, 100); if (string.IsNullOrWhiteSpace(value2.LastOtherName)) { value2.LastOtherName = target.Name; } if (string.IsNullOrWhiteSpace(text) && EmpressRollDiscovery(value2, current, style)) { value2.Anger = Mathf.Clamp(value2.Anger + 8 + num, 0, 100); value2.Betrayals++; value2.LastOtherName = target.Name; value2.LastBadThing = "Caught feelings leaking toward " + target.Name + "."; value2.MemorySummary = "They caught the pattern: you, " + target.Name + ", and a suspicious amount of eye contact."; text = value2.Name + " notices the pattern. They do not interrupt. That is somehow worse."; } } } current.Suspicion = Mathf.Clamp(current.Suspicion + ((style == 2 && !string.IsNullOrWhiteSpace(current.LastOtherName)) ? 4 : (-1)), 0, 100); return text; } private bool EmpressRollDiscovery(EmpressRelationship watcher, EmpressRelationship current, int style) { if (watcher == null || current == null || watcher.Key == current.Key) { return false; } int num = Mathf.Clamp(_plugin.BetrayalSensitivity.Value / 3 + watcher.Suspicion + watcher.Jealousy / 2 + watcher.Commitment / 4 + ((style == 2) ? 10 : 0) - watcher.Trust / 3, 0, 92); return _random.Next(0, 100) < num; } private string EmpressBuildMemorySummary(EmpressDateTarget target, EmpressRelationship relationship) { if (relationship.Betrayals > 0 && relationship.Anger >= 45) { return "They remember the betrayal count: " + relationship.Betrayals + ". " + relationship.LastOtherName + " is still a problem."; } if (relationship.Children > 0) { return "They keep talking like your " + relationship.Children + " hypothetical child" + ((relationship.Children == 1) ? "" : "ren") + " already need school supplies."; } if (relationship.GiftsGiven > 0 && relationship.LastGiftName.Length > 0) { return "They last gave you " + relationship.LastGiftName + " and are absolutely keeping score."; } if (relationship.SecretDepth >= 30) { return "They trust you with lore now. That is basically second base for haunted furniture."; } if (relationship.Following) { return "They are following you in physical space because maximum affection ignores architecture."; } return "They remember date " + relationship.Dates + ", your " + relationship.LastStyle + " tone, and the way you looked at " + target.ObservedName + "."; } private string EmpressBuildOpening(EmpressDateTarget target) { EmpressRelationship relationship = target.Relationship; List list = new List { EmpressStoryBeatLine(target, relationship, opening: true), (relationship.Dates <= 0 || relationship.StoryStage <= 1) ? EmpressCastLore(target) : EmpressStageLoreLine(target, relationship) }; if (relationship.Dates > 0 && relationship.StoryStage > 0) { list.Add(target.Name + " treats this like chapter " + (relationship.StoryStage + 1) + ", not a reset. Date " + (relationship.Dates + 1) + " has to answer for everything date " + relationship.Dates + " changed."); } if (!string.IsNullOrWhiteSpace(relationship.LastStyle)) { list.Add("\"Last time you were " + relationship.LastStyle + ",\" " + target.Name + " says. \"So pick carefully. I am building a pattern out of you.\""); } if (!string.IsNullOrWhiteSpace(relationship.MemorySummary)) { list.Add("Memory: " + relationship.MemorySummary); } if (relationship.Anger >= 55) { list.Add(target.Name + " is angry enough to make the UI feel watched. Gifts may become consequences if you keep playing messy."); } else if (relationship.GiftsGiven > 0 && !string.IsNullOrWhiteSpace(relationship.LastGiftName)) { list.Add(target.Name + " remembers gifting you " + relationship.LastGiftName + ". This generosity has a receipt."); } if (relationship.Love >= 100) { list.Add(relationship.Following ? (target.Name + " is already following you. Press 5 if you need them to stay put.") : (target.Name + " is maxed out and ready to follow. Press 5 to invite them off the map and into your bad decisions.")); } if (relationship.Children > 0) { list.Add(target.Name + " keeps mentioning your " + relationship.Children + " hypothetical child" + ((relationship.Children == 1) ? "" : "ren") + " like the nursery paperwork is already spiritually filed."); } if (!string.IsNullOrWhiteSpace(_lastCommittedKey) && _lastCommittedKey != target.Key && _relationships.TryGetValue(_lastCommittedKey, out EmpressRelationship value) && value.Love >= 25) { list.Add(target.Name + " glances toward " + value.Name + ". \"So that is who you have been entertaining.\""); relationship.Jealousy = Mathf.Clamp(relationship.Jealousy + 1, 0, 100); relationship.LastOtherName = value.Name; } if (relationship.Jealousy >= 12 && !string.IsNullOrWhiteSpace(relationship.LastOtherName)) { list.Add("\"Tell " + relationship.LastOtherName + " I said hi,\" " + target.Name + " says. Then softer: \"No. Do not. I want to be petty without witnesses.\""); } string text = EmpressConnectionLine(target); if (!string.IsNullOrWhiteSpace(text)) { list.Add(text); } return string.Join("\n\n", list); } private string EmpressBuildContinuation(EmpressDateTarget target) { EmpressRelationship relationship = target.Relationship; List list = new List { EmpressStoryBeatLine(target, relationship, opening: false) }; if (!string.IsNullOrWhiteSpace(relationship.MemorySummary)) { list.Add("Memory: " + relationship.MemorySummary); } if (relationship.StoryMomentum < 0) { list.Add(target.Name + " is not resetting the mood for you. The score is below zero, which means the next choice has to repair something."); } else if (relationship.StoryStage >= 5) { list.Add(target.Name + " is close enough now that casual answers start sounding like lies."); } if (relationship.Love >= 100 && !relationship.Following) { list.Add(target.Name + " has reached the point where talking is no longer the final proof. Press 5 if you want them to follow."); } return string.Join("\n\n", list); } private static string EmpressStoryBeatLine(EmpressDateTarget target, EmpressRelationship relationship, bool opening) { if (relationship.Anger >= 55) { return target.Name + " keeps distance in the conversation. This is not a fresh scene; it is repair math, and anger is currently winning."; } if (relationship.Jealousy >= 30 && !string.IsNullOrWhiteSpace(relationship.LastOtherName)) { return target.Name + " remembers " + relationship.LastOtherName + " before they look at you. The story has a triangle now, and triangles cut."; } switch (Mathf.Clamp(relationship.StoryStage, 0, 8)) { case 0: if (!opening) { return target.Name + " waits instead of filling the silence. First contact is over; now the story wants evidence."; } return target.Name + " studies you like the first page of a terrible idea.\n\n\"If this is a joke, make it a good one. If it is not, prove it.\""; case 1: return target.Name + " recognizes you now. Not fully, not safely, but enough that your next move will not vanish into the noise."; case 2: return target.Name + " keeps one detail from last time and offers one back. The relationship has started trading receipts."; case 3: return target.Name + " lets the conversation get personal enough to become risky. This is where jokes start needing courage."; case 4: return target.Name + " is done pretending this is random. The bond has a shape now, and both of you can see the edges."; case 5: return target.Name + " talks like there is a future and then watches your face to see if you flinch."; case 6: return target.Name + " moves from wanting attention to wanting loyalty. That is a heavier currency."; case 7: return target.Name + " has reached the almost-impossible part: they believe you might choose them on purpose."; default: if (!relationship.Following) { return target.Name + " stands at the edge of the map like a promise waiting for permission to move."; } return target.Name + " is already part of your route now. The story continues only if you damage it or defend it."; } } private static string EmpressStageLoreLine(EmpressDateTarget target, EmpressRelationship relationship) { switch (Mathf.Clamp(relationship.StoryStage, 0, 8)) { case 2: return target.Name + " has moved from novelty to memory. They remember what you chose, not just that you showed up."; case 3: return target.Name + " starts giving you the parts of the story that do not fit on a price tag, health bar, or tooltip."; case 4: return target.Name + " is measuring whether this relationship is a habit, a promise, or a very stylish mistake."; case 5: return target.Name + " lets the future into the room and watches what it does to your posture."; case 6: return target.Name + " has stopped asking if you care and started asking what your care can survive."; case 7: return target.Name + " is close enough to follow, but they still need the final proof to be an action."; default: if (!relationship.Following) { return target.Name + " is at the edge of follower territory. The story is waiting for the body to move."; } return target.Name + " has already crossed from story into companion. The next chapter only opens if you protect it or break it."; } } private string EmpressRelationshipLine(EmpressDateTarget target, EmpressRelationship relationship, EmpressDateChoice choice, int gain, string followUpQuestion) { List list = new List { EmpressIntimateResponse(target, relationship, choice, gain) }; if (relationship.Love >= 60 && relationship.Trust >= 25) { list.Add(target.Name + " lets the mask slip a little. There is history here now, not just a joke with a progress bar."); } else if (relationship.Love >= 30) { list.Add(target.Name + " is starting to expect you. That is sweet. That is also how curses get paperwork."); } if (relationship.Jealousy >= 18) { list.Add("\"You collect hearts like scrap,\" " + target.Name + " says. \"Cute. Dangerous. Mostly dangerous.\""); } if (relationship.Category == "Enemy" && choice.Style == 0) { list.Add("The violence in the room lowers by one emotional notch. Not enough to be safe, but enough to be interesting."); } if (relationship.Category == "Valuable" && choice.Style == 1) { list.Add(target.Name + " explains value is not price. Empress immediately writes that down and pretends she knew."); } if (relationship.Category == "Extractor" && relationship.Love >= 40) { list.Add("The extractor hums softer around you. It still wants your loot, but now it feels guilty about it."); } if (!string.IsNullOrWhiteSpace(followUpQuestion)) { list.Add("" + EmpressRichEscape(target.Name) + " asks: \"" + EmpressRichEscape(followUpQuestion) + "\""); } return string.Join("\n\n", list); } private string EmpressOpeningLine(EmpressDateTarget target, EmpressRelationship relationship) { if (relationship.Dates <= 0) { return target.Name + " studies you for a long second.\n\n\"So you are the one who keeps looking at things like they might answer back. Careful. Some of us do.\""; } if (relationship.Love >= 70) { return target.Name + " brightens in a way it would deny if anyone asked.\n\n\"There you are. I was trying not to miss you. I failed in a very undignified way.\""; } if (relationship.Jealousy >= 20) { return target.Name + " does not smile.\n\n\"I know you have been talking to others. I am not angry. I am collecting evidence.\""; } if (relationship.Trust >= 35) { return target.Name + " lowers its guard like something unlocking from the inside.\n\n\"You make this place quieter. Not safe. Just quieter. I think that matters.\""; } return EmpressFormat(EmpressPick(EmpressOpeners), target, relationship, 0); } private string EmpressIntimateResponse(EmpressDateTarget target, EmpressRelationship relationship, EmpressDateChoice choice, int gain) { return choice.PlayerAction + "\n\n" + target.Name + " answers, \"" + EmpressChoiceAnswer(target, relationship, choice) + "\"\n\n" + EmpressChoiceStatsLine(relationship, gain, choice); } private string EmpressChoiceAnswer(EmpressDateTarget target, EmpressRelationship relationship, EmpressDateChoice choice) { switch (choice.Id) { case "admire": if (relationship.Love < 65) { return "That landed. I am trying to act normal about it and failing with some style."; } return "You make me feel seen in a way that should honestly void a warranty."; case "memory": return EmpressLoreAnswer(target, relationship); case "date": if (relationship.Love < 55) { return "You asking that plainly is somehow more dangerous than flirting."; } return "Yes. A real date. Pick somewhere dramatic enough to make this feel deserved."; case "flirt": return EmpressDesireAnswer(target, relationship); case "reassure": return "Good. Because I did not want another pretty answer. I wanted something I could actually lean on."; case "apologize": if (relationship.Betrayals <= 0) { return "I was ready to stay sharp. You made that harder."; } return "That apology cost you something. I can tell. Keep doing that."; case "secret": return "That is not small. I am keeping it anyway. Do not make me regret learning your soft parts."; case "define": if (relationship.Commitment < 55) { return "I wanted you to ask that before the building did it for us."; } return "Call it a relationship. Call it mutual ruin. Either way, stop pretending it is casual."; case "future": return "A future with you sounds unstable, expensive, and weirdly comforting. I hate how much I want details."; case "children": return "Our children would be impossible and probably brilliant. I am alarmed by how quickly I started naming them."; case "truce": return "I could choose peace with you for a little while. Do not waste how rare that is."; case "need": if (relationship.Trust < 35) { return "Patience. And maybe proof you are not here for the novelty alone."; } return "Consistency. Curiosity. Fewer disappearing acts. You know, luxury items."; case "listen": return "You actually listened. That is rarer than a good hiding spot and twice as suspicious."; case "boundary": return "You respected the line without making me thank you for it. That was... annoyingly attractive."; case "promise": return "A small promise is harder to fake than a grand one. I am going to remember whether you keep it."; case "vulnerability": return "There you are. Less polished, more real. I like that version better than the charming one."; case "ritual": return "A ritual means you expect there to be a next time. I am trying not to look pleased."; case "repair": return "Repair is not romantic until someone means it. This time, I think you might."; case "choose_them": return "Chosen on purpose. Fine. That hit somewhere inconvenient."; case "devotion": return "Do not perform devotion unless you can survive being believed. I am dangerously close to believing you."; default: if (choice.Style != 0) { if (choice.Style != 1) { return EmpressDesireAnswer(target, relationship); } return EmpressLoreAnswer(target, relationship); } return EmpressTenderAnswer(target, relationship); } } private string EmpressChoiceStatsLine(EmpressRelationship relationship, int gain, EmpressDateChoice choice) { List list = new List { "Love +" + gain + "", "Trust " + relationship.Trust + "%", "Commitment " + relationship.Commitment + "%", "Jealousy " + relationship.Jealousy + "%", "Anger " + relationship.Anger + "%", "Memory " + relationship.MemoryScore + "" }; if (choice.ChildrenBonus > 0) { list.Add("Children " + relationship.Children + ""); } return string.Join(" ", list); } private string EmpressFollowUpQuestion(EmpressDateTarget target, EmpressRelationship relationship, EmpressDateChoice choice) { switch (choice.Id) { case "admire": return "What did you notice first, honestly?"; case "memory": return "If I tell you the truth, are you going to carry it or just enjoy hearing it?"; case "date": return "Where would you take me if you wanted this to feel unforgettable?"; case "flirt": return "Are you trying to tempt me, or are you just incapable of behaving normally now?"; case "reassure": return "Can you keep saying things like that when it stops being convenient?"; case "apologize": return "Do you want forgiveness, or do you want to become someone who deserves it?"; case "secret": return "Do you have another secret, or was that the brave one?"; case "define": return "What word were you hoping I would choose for us?"; case "future": return "When you picture us later, what survives with us?"; case "children": return "Would you be the soft parent, or am I supposed to do all the emotional heavy lifting again?"; case "truce": return "How long can you hold peace before instinct wins?"; case "need": return "If I answer honestly, will you stay long enough to hear the hard parts too?"; case "listen": return "What did you hear that you were not expecting?"; case "boundary": return "Can you still want me without turning every closed door into a challenge?"; case "promise": return "What promise are you willing to make small enough to keep?"; case "vulnerability": return "If I show you something fragile back, will you protect it or study it?"; case "ritual": return "What little ritual should belong to us when everything else is trying to kill the mood?"; case "repair": return "What changes after this apology, specifically?"; case "choose_them": return "What does choosing me cost you, and are you still choosing it?"; case "devotion": return "When devotion gets inconvenient, what part of you stays?"; default: if (relationship.Love < 60) { return "Are you coming back, or was this just good timing?"; } return "Are you brave enough to keep making this real?"; } } private List EmpressBuildAnswerChoices(EmpressDateTarget target, EmpressRelationship relationship, EmpressDateChoice choice, string question) { List list = new List(); switch (choice.Id) { case "date": list.Add(EmpressMakeAnswer("Make it cinematic", "You promise a date somewhere with dramatic lighting and enough danger to feel expensive.", target.Name + " laughs softly. \"That sounds stupidly perfect. Do not make me wait too long.\"", 2, 1, 2, 0, 0, 2, 1, 0, "cinematic answer")); list.Add(EmpressMakeAnswer("Keep it quiet", "You say you would take them somewhere quiet, away from alarms, quotas, and witnesses.", target.Name + " goes still in the good way. \"Quiet with you sounds dangerously close to peace.\"", 1, 3, 1, -1, -1, 3, 1, -1, "quiet answer")); list.Add(EmpressMakeAnswer("Invite chaos", "You admit the date would probably become a beautiful disaster within ten minutes.", target.Name + " grins like this was the correct answer and the wrong life choice.", 3, 0, 3, 1, 0, 1, 0, 1, "chaotic answer")); list.Add(EmpressMakeAnswer("Ask them to choose", "You ask where they would want to go if the choice was finally theirs.", target.Name + " softens. \"You giving me the choice matters more than the location.\"", 1, 4, 1, -1, -2, 4, 2, -1, "considerate answer")); break; case "children": list.Add(EmpressMakeAnswer("Be the soft parent", "You admit you would probably be the soft parent and spoil them immediately.", target.Name + " looks far too pleased. \"Terrible discipline. Excellent heart.\"", 2, 2, 3, 0, 0, 4, 1, 0, "soft parent")); list.Add(EmpressMakeAnswer("Plan responsibly", "You start talking snacks, safety, bedtime, and the horrifying logistics of family.", target.Name + " says, \"Oh. You meant it meant it.\" The affection in that sentence is dangerous.", 1, 4, 1, -1, -2, 5, 2, -1, "family planner")); list.Add(EmpressMakeAnswer("Name one now", "You suggest a ridiculous baby name with full confidence.", target.Name + " rejects the name instantly and keeps smiling anyway.", 3, 1, 4, 1, 0, 2, 0, 1, "baby name menace")); list.Add(EmpressMakeAnswer("Ask what they fear", "You ask what scares them most about being loved enough to imagine family.", target.Name + " answers slower than usual. \"Being believed. Being left after that.\"", 1, 5, 0, -2, -3, 4, 4, -1, "family honesty")); break; case "reassure": case "repair": case "apologize": list.Add(EmpressMakeAnswer("Own it plainly", "You take responsibility without dressing it up.", target.Name + " studies you for the catch and finds less than expected.", 1, 5, 0, -2, -5, 4, 1, -2, "accountable answer")); list.Add(EmpressMakeAnswer("Promise better", "You promise better behavior and give them the shape of the promise, not just the word.", target.Name + " says, \"Specifics. Good. I can work with specifics.\"", 2, 4, 1, -2, -4, 5, 1, -2, "promise answer")); list.Add(EmpressMakeAnswer("Admit fear", "You admit you got scared and turned messy instead of honest.", target.Name + " exhales like a locked door remembering it can open.", 1, 5, 0, -1, -4, 3, 4, -1, "fear answer")); list.Add(EmpressMakeAnswer("Make a joke", "You make a careful joke and immediately make it clear you are not dodging.", target.Name + " allows the joke to survive. Barely. That is progress.", 1, 2, 2, -1, -2, 1, 0, 0, "careful joke")); break; case "need": case "boundary": case "memory": case "secret": case "listen": case "promise": list.Add(EmpressMakeAnswer("Tell the truth", "You answer honestly, even the part that makes you sound less cool.", target.Name + " listens like the truth is a fragile object you handed over carefully.", 2, 5, 0, -1, -2, 3, 4, -1, "honest answer")); list.Add(EmpressMakeAnswer("Ask deeper", "You ask them to go deeper too, not as a demand but as an invitation.", target.Name + " says, \"Careful. You are making me want to be known.\"", 1, 4, 0, -1, -1, 3, 5, 0, "deeper answer")); list.Add(EmpressMakeAnswer("Protect the moment", "You keep your voice low and protect the conversation from becoming a performance.", target.Name + " relaxes around the edges. \"That. Do more of that.\"", 1, 4, 1, -1, -2, 3, 2, -1, "protective answer")); list.Add(EmpressMakeAnswer("Deflect softly", "You deflect, but softly enough that it reads as nerves instead of cruelty.", target.Name + " notices. \"Not ready, then. I can wait a little.\"", 0, 1, 0, 0, 1, 0, 0, 1, "nervous answer")); break; case "devotion": case "ritual": case "define": case "future": case "flirt": case "vulnerability": case "choose_them": list.Add(EmpressMakeAnswer("Mean it", "You say the romantic thing again, slower, so it cannot hide inside the bit.", target.Name + " looks away first. That feels like a victory.", 3, 3, 2, 0, -1, 5, 1, 0, "serious romance")); list.Add(EmpressMakeAnswer("Be vulnerable", "You let the want show without trying to win the scene.", target.Name + " answers, \"There you are. I like you better when I can see you.\"", 2, 5, 0, -1, -2, 4, 3, -1, "vulnerable answer")); list.Add(EmpressMakeAnswer("Keep it playful", "You keep it playful, but you do not take the feeling back.", target.Name + " smiles like it is pretending this did not work.", 2, 1, 4, 1, 0, 2, 0, 1, "playful answer")); list.Add(EmpressMakeAnswer("Ask what they want", "You ask what they want this to become instead of deciding alone.", target.Name + " says, \"A mutual disaster. With consent. And maybe snacks.\"", 2, 4, 2, -1, -1, 5, 2, -1, "mutual answer")); break; case "truce": list.Add(EmpressMakeAnswer("Lower your guard", "You lower your guard just enough to prove the truce is not a trick.", target.Name + " respects the risk more than the strategy.", 2, 4, 1, -1, -3, 3, 1, -2, "truce trust")); list.Add(EmpressMakeAnswer("Set a boundary", "You set a boundary and ask them to meet you there.", target.Name + " considers it. \"Boundaries are not boring. Annoying, maybe. Necessary.\"", 1, 4, 0, -1, -2, 4, 2, -2, "truce boundary")); list.Add(EmpressMakeAnswer("Stay dramatic", "You keep the truce dramatic enough that nobody forgets it is temporary.", target.Name + " seems entertained, which is at least safer than hungry.", 2, 1, 3, 1, 0, 1, 0, 1, "dramatic truce")); list.Add(EmpressMakeAnswer("Ask for mercy", "You ask for mercy with your whole chest and only a little shame.", target.Name + " says, \"Ridiculous. Effective. Fine.\"", 1, 3, 1, -1, -3, 2, 1, -1, "mercy answer")); break; default: list.Add(EmpressMakeAnswer("Answer honestly", "You answer honestly and let the silence do some of the work.", target.Name + " remembers the answer because you did not decorate it.", 2, 4, 0, -1, -2, 3, 2, -1, "honest answer")); list.Add(EmpressMakeAnswer("Make them laugh", "You give them the answer most likely to make the room less heavy.", target.Name + " tries not to laugh, which is rude because it absolutely did.", 2, 1, 4, 0, 0, 1, 0, 0, "funny answer")); list.Add(EmpressMakeAnswer("Ask back", "You answer with a question because the feeling should not be one-sided.", target.Name + " accepts the challenge and seems happier for it.", 1, 3, 1, -1, -1, 3, 3, 0, "curious answer")); list.Add(EmpressMakeAnswer("Stay mysterious", "You stay mysterious, but not so mysterious that it feels like running.", target.Name + " squints. \"Infuriating. Continue.\"", 1, 1, 1, 1, 0, 1, 1, 1, "mysterious answer")); break; } return list.Take(4).ToList(); } private static EmpressDateAnswerChoice EmpressMakeAnswer(string label, string playerLine, string characterLine, int love, int trust, int mood, int jealousy, int anger, int commitment, int secret, int suspicion, string memoryTag) { return new EmpressDateAnswerChoice { Label = label, PlayerLine = playerLine, CharacterLine = characterLine, LoveBonus = love, TrustBonus = trust, MoodBonus = mood, JealousyBonus = jealousy, AngerBonus = anger, CommitmentBonus = commitment, SecretBonus = secret, SuspicionBonus = suspicion, MemoryTag = memoryTag }; } private void EmpressAnswerQuestion(int answerIndex) { if (_activeTarget != null && answerIndex >= 0 && answerIndex < _activeAnswerChoices.Count) { EmpressDateTarget activeTarget = _activeTarget; EmpressRelationship relationship = activeTarget.Relationship; EmpressDateAnswerChoice empressDateAnswerChoice = _activeAnswerChoices[answerIndex]; relationship.Love = Mathf.Clamp(relationship.Love + empressDateAnswerChoice.LoveBonus, 0, 100); relationship.Trust = Mathf.Clamp(relationship.Trust + empressDateAnswerChoice.TrustBonus, 0, 100); relationship.Mood = Mathf.Clamp(relationship.Mood + empressDateAnswerChoice.MoodBonus, -100, 100); relationship.Jealousy = Mathf.Clamp(relationship.Jealousy + empressDateAnswerChoice.JealousyBonus, 0, 100); relationship.Anger = Mathf.Clamp(relationship.Anger + empressDateAnswerChoice.AngerBonus, 0, 100); relationship.Commitment = Mathf.Clamp(relationship.Commitment + empressDateAnswerChoice.CommitmentBonus, 0, 100); relationship.SecretDepth = Mathf.Clamp(relationship.SecretDepth + empressDateAnswerChoice.SecretBonus, 0, 100); relationship.Suspicion = Mathf.Clamp(relationship.Suspicion + empressDateAnswerChoice.SuspicionBonus, 0, 100); relationship.MemoryScore = Mathf.Clamp(relationship.MemoryScore + 3 + empressDateAnswerChoice.TrustBonus + empressDateAnswerChoice.SecretBonus + empressDateAnswerChoice.CommitmentBonus, 0, 9999); relationship.LastStyle = empressDateAnswerChoice.MemoryTag; EmpressRecalculateStoryProgressFromAnswer(relationship, empressDateAnswerChoice); relationship.MemorySummary = EmpressBuildMemorySummary(activeTarget, relationship); string body = (relationship.LastLine = relationship.LastLine + "\n\nYour answer: " + empressDateAnswerChoice.PlayerLine + "\n\n" + activeTarget.Name + " says, \"" + empressDateAnswerChoice.CharacterLine + "\"\n\n" + EmpressAnswerStatsLine(relationship, empressDateAnswerChoice)); _activeAnswerChoices.Clear(); _dateWaitingForChoice = false; _dateWaitingForAnswer = false; _dateWaitingAfterChoice = true; EmpressSetDateDialog(EmpressBuildDateTitle(activeTarget), body, EmpressAfterChoiceOptions(activeTarget)); EmpressSave(); EmpressRefreshRelationships(); } } private static string EmpressAnswerStatsLine(EmpressRelationship relationship, EmpressDateAnswerChoice answer) { List list = new List(); if (answer.LoveBonus != 0) { list.Add("Love " + EmpressSigned(answer.LoveBonus) + ""); } if (answer.TrustBonus != 0) { list.Add("Trust " + EmpressSigned(answer.TrustBonus) + ""); } if (answer.CommitmentBonus != 0) { list.Add("Commitment " + EmpressSigned(answer.CommitmentBonus) + ""); } if (answer.JealousyBonus != 0) { list.Add("Jealousy " + EmpressSigned(answer.JealousyBonus) + ""); } if (answer.AngerBonus != 0) { list.Add("Anger " + EmpressSigned(answer.AngerBonus) + ""); } list.Add("Memory " + relationship.MemoryScore + ""); return string.Join(" ", list); } private static string EmpressSigned(int value) { if (value <= 0) { return value.ToString(); } return "+" + value; } private string EmpressTenderAnswer(EmpressDateTarget target, EmpressRelationship relationship) { if (relationship.Love >= 80) { return "Do not make me admit how much I like when you are gentle. I have a reputation as an object, apparently."; } if (relationship.Trust >= 35) { return "I believe you when you are soft. That is inconvenient. I was built for simpler feelings."; } if (relationship.Category == "Enemy") { return "You are very brave to offer tenderness to teeth. I am trying to decide if that is stupid or beautiful."; } return "That was careful. I felt it. I did not know being handled gently could feel like being remembered."; } private string EmpressLoreAnswer(EmpressDateTarget target, EmpressRelationship relationship) { if (relationship.Category == "Wall" || relationship.Category == "Floor" || relationship.Category == "Ceiling") { return "This building keeps every footstep. Yours sound different now. Less like escape. More like searching."; } if (relationship.Category == "Valuable") { return "Everyone asks what I cost. You asked what I remember. That is how you become dangerous to me."; } if (relationship.Category == "Enemy") { return "I was not always hunger. The game made me simple because simple monsters are easier to survive."; } if (relationship.Category == "Item") { return "I have been held by panic, greed, and hope. Your hands are worse because they are starting to mean something."; } if (relationship.Category == "Extractor") { return "I eat what you bring me because that is my function. Sometimes I wonder if function is just loneliness with a job."; } return "My lore is not a collectible. Stay long enough and I might tell you the part that still hurts."; } private string EmpressDesireAnswer(EmpressDateTarget target, EmpressRelationship relationship) { if (relationship.Jealousy >= 18 && !string.IsNullOrWhiteSpace(relationship.LastOtherName)) { return "You say that to me after " + relationship.LastOtherName + "? Bold. Terrible. Say it again slower."; } if (relationship.Love >= 60) { return "If you are going to make me feel chosen, do it on purpose. I am tired of being an accident in your route."; } if (relationship.Category == "Door") { return "I am literally a way out and still you came closer. That is either romance or a diagnosis."; } return "Careful. I can tell the difference between a joke and a want. You are getting worse at hiding both."; } private string EmpressCastLore(EmpressDateTarget target) { string lore = target.Slot.Lore; if (!string.IsNullOrWhiteSpace(lore)) { return lore.Replace("{name}", target.Name).Replace("{seen}", target.ObservedName); } return target.Name + " has lore, but it is making you earn it."; } private string EmpressConnectionLine(EmpressDateTarget target) { if (target.Category == "Cart" && _relationships.Values.Any((EmpressRelationship relationship) => relationship.Category == "Valuable" && relationship.Love >= 20)) { return target.Name + " knows the valuables talk about you when the truck gets quiet."; } if (target.Category == "Extractor" && _relationships.Values.Any((EmpressRelationship relationship) => relationship.Category == "Cart" && relationship.Love >= 20)) { return target.Name + " says the cart is too soft on you. The cart denies everything."; } if (target.Category == "Door" && _relationships.Values.Any((EmpressRelationship relationship) => relationship.Category == "Wall" && relationship.Love >= 15)) { return target.Name + " heard about you from the walls. That should not be possible, but here we are."; } if (target.Category == "Enemy" && _relationships.Values.Any((EmpressRelationship relationship) => relationship.Category == "Player" && relationship.Love >= 25)) { return target.Name + " knows you keep promising yourself to yourself. It finds that suspicious."; } return ""; } private string EmpressMaybeRelationshipConsequence(EmpressDateTarget target, EmpressRelationship relationship, int style) { if (!EmpressConsequenceReady(relationship)) { return ""; } int num = Mathf.Clamp(relationship.Anger + relationship.Jealousy / 2 + relationship.Betrayals * 8 - relationship.Trust / 2, 0, 95); if (relationship.Anger >= 55 && _random.Next(0, 100) < num) { string text = EmpressApplyPunishment(target, relationship); if (!string.IsNullOrWhiteSpace(text)) { relationship.BadThingsDone++; relationship.LastPunishTicks = DateTime.UtcNow.Ticks; relationship.LastBadThing = text; relationship.MemorySummary = "They punished you recently and remember why."; _audio.EmpressPlayRewardCue(positive: false); return EmpressDecorateRelationshipEvent(positive: false, text, relationship.LastBadThing); } } int num2 = Mathf.Clamp(8 + relationship.Love / 2 + relationship.Trust / 3 + relationship.Commitment / 4 - relationship.Anger - relationship.Jealousy / 3, 0, 92); if (relationship.Love < 18 || _random.Next(0, 100) >= num2) { return ""; } string text2 = EmpressGrantGift(target, relationship, style); if (!string.IsNullOrWhiteSpace(text2)) { relationship.GiftsGiven++; relationship.FavorsOwed = Mathf.Clamp(relationship.FavorsOwed + 1, 0, 999); relationship.LastGiftTicks = DateTime.UtcNow.Ticks; relationship.MemorySummary = EmpressBuildMemorySummary(target, relationship); _audio.EmpressPlayRewardCue(positive: true); return EmpressDecorateRelationshipEvent(positive: true, text2, relationship.LastGiftName); } return ""; } private static string EmpressDecorateRelationshipEvent(bool positive, string line, string focus) { string value = (positive ? "#ffe09d" : "#ffb39d"); string value2 = (positive ? "GIFT" : "DRAMA"); string value3 = (positive ? "Received" : "Hit by"); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(""); stringBuilder.Append(value2); stringBuilder.Append(" "); stringBuilder.Append(line); if (!string.IsNullOrWhiteSpace(focus)) { stringBuilder.Append("\n"); stringBuilder.Append(value3); stringBuilder.Append(": "); stringBuilder.Append(focus); stringBuilder.Append(""); } return stringBuilder.ToString(); } private bool EmpressConsequenceReady(EmpressRelationship relationship) { long num = Math.Max(relationship.LastGiftTicks, relationship.LastPunishTicks); if (num <= 0) { return true; } return TimeSpan.FromTicks(Math.Max(0L, DateTime.UtcNow.Ticks - num)).TotalSeconds >= (double)_plugin.RewardCooldownSeconds.Value; } private string EmpressGrantGift(EmpressDateTarget target, EmpressRelationship relationship, int style) { int num = _random.Next(0, 7); for (int i = 0; i < 7; i++) { string text = ""; switch ((num + i) % 7) { case 0: text = EmpressTryGiftShopItem(target, relationship, style); break; case 1: text = EmpressTryGiftUpgrade(target, relationship, style); break; case 2: text = EmpressTryGiftMoney(target, relationship); break; case 3: text = EmpressTryGiftValuable(target, relationship); break; case 4: text = EmpressTryGiftObjectBlessing(target, relationship); break; case 5: text = EmpressTryGiftHeal(target, relationship); break; case 6: text = EmpressTryGiftEnemyTruce(target, relationship); break; } if (!string.IsNullOrWhiteSpace(text)) { return text; } } return ""; } private string EmpressTryGiftMoney(EmpressDateTarget target, EmpressRelationship relationship) { int runCurrency = EmpressDateEverythingAccess.GetRunCurrency(); int num = Mathf.Clamp(1 + relationship.Love / 22 + relationship.Trust / 35 + _random.Next(0, 3), 1, 9); EmpressDateEverythingAccess.SetRunCurrency(runCurrency + num); if (EmpressDateEverythingAccess.GetRunCurrency() <= runCurrency) { return ""; } relationship.LastGiftName = num + "K cash"; return target.Name + " slips " + num + "K into your run funds. Romance has become fiscally irresponsible."; } private string EmpressTryGiftHeal(EmpressDateTarget target, EmpressRelationship relationship) { PlayerAvatar val = EmpressDateEverythingAccess.LocalPlayer(); PlayerHealth playerHealth = EmpressDateEverythingAccess.GetPlayerHealth(val); if ((Object)(object)val == (Object)null || (Object)(object)playerHealth == (Object)null) { return ""; } int maxHealth = EmpressDateEverythingAccess.GetMaxHealth(playerHealth); int health = EmpressDateEverythingAccess.GetHealth(playerHealth); if (maxHealth > 0 && health >= maxHealth && relationship.Love < 70) { return ""; } int amount = Mathf.Clamp(4 + relationship.Love / 10 + relationship.Trust / 15, 5, 24); EmpressDateEverythingAccess.HealPlayer(val, amount, effect: true); EmpressDateEverythingAccess.ApplyLoveEyes(val, 3.8f); relationship.LastGiftName = "a " + amount + " HP heal"; return target.Name + " steadies you with a warm little heal. It is weirdly tender for something with no medical license."; } private string EmpressTryGiftUpgrade(EmpressDateTarget target, EmpressRelationship relationship, int style) { if (relationship.Love < 70 || relationship.Trust < 25) { return ""; } PlayerAvatar player = EmpressDateEverythingAccess.LocalPlayer(); int preference = ((target.Category == "Item") ? 3 : (style switch { 1 => 2, 0 => 1, _ => 0, })); if (!EmpressDateEverythingAccess.TryGrantUpgrade(player, preference)) { return ""; } EmpressDateEverythingAccess.ApplyUpgradeFlash(player); relationship.LastGiftName = "a player upgrade"; return target.Name + " cashes in a terrifying amount of affection and grants you an upgrade. The relationship has stats now."; } private string EmpressTryGiftShopItem(EmpressDateTarget target, EmpressRelationship relationship, int style) { if (!EmpressDateEverythingAccess.RunIsShop() && relationship.Love < 82) { return ""; } ItemAttributes val = EmpressFindBestShopItem(style == 2 || target.Key.Contains("gun") || target.Key.Contains("grenade") || target.Key.Contains("melee")); if ((Object)(object)val == (Object)null) { return ""; } if (EmpressDateEverythingAccess.GetItemValue(val) <= 1) { return ""; } EmpressDateEverythingAccess.SetItemValue(val, 1); EmpressDateEverythingAccess.ShopUpdateCost(); string text = EmpressCleanName(EmpressDateEverythingAccess.ItemName(val)); if (string.IsNullOrWhiteSpace(text)) { text = "shop item"; } relationship.LastGiftName = "a free " + text; return target.Name + " bullies the shop price down to 1K for " + text + ". If it is a weapon, that is technically a love language."; } private string EmpressTryGiftValuable(EmpressDateTarget target, EmpressRelationship relationship) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) ValuableObject val = (((Object)(object)target.GameObject != (Object)null) ? target.GameObject.GetComponentInParent() : null); if ((Object)(object)val == (Object)null) { val = EmpressFindNearbyValuable(target.Point, 10f); } if ((Object)(object)val == (Object)null) { return ""; } float valuableOriginalValue = EmpressDateEverythingAccess.GetValuableOriginalValue(val); float valuableCurrentValue = EmpressDateEverythingAccess.GetValuableCurrentValue(val); if (valuableOriginalValue <= 0f && valuableCurrentValue <= 0f) { return ""; } int num = Mathf.Clamp(Mathf.RoundToInt(Mathf.Max(new float[3] { valuableOriginalValue, valuableCurrentValue, 1000f }) * Mathf.Lerp(0.08f, 0.24f, (float)relationship.Love / 100f)), 250, 2400); EmpressDateEverythingAccess.SetValuableDollarValues(val, Mathf.Max(valuableOriginalValue, valuableCurrentValue) + (float)num, Mathf.Max(valuableCurrentValue, valuableOriginalValue) + (float)num); PhysGrabObject valuablePhysGrabObject = EmpressDateEverythingAccess.GetValuablePhysGrabObject(val); if ((Object)(object)valuablePhysGrabObject != (Object)null) { EmpressDateEverythingAccess.LightenObject(valuablePhysGrabObject, 16f); EmpressDateEverythingAccess.ProtectPhysObject(valuablePhysGrabObject, 14f); } relationship.LastGiftName = "value bloom +" + num; return target.Name + " makes nearby loot more valuable by " + num + ". Capitalism has entered the relationship."; } private string EmpressTryGiftObjectBlessing(EmpressDateTarget target, EmpressRelationship relationship) { PhysGrabObject val = EmpressFindTargetPhys(target); if ((Object)(object)val == (Object)null) { val = EmpressDateEverythingAccess.GetHeldObject(); } if ((Object)(object)val == (Object)null) { return ""; } EmpressDateEverythingAccess.LightenObject(val, 24f); EmpressDateEverythingAccess.ProtectPhysObject(val, 22f); relationship.LastGiftName = "object protection"; return target.Name + " blesses your current object handling. It is lighter, safer, and dramatically smug about it."; } private string EmpressTryGiftEnemyTruce(EmpressDateTarget target, EmpressRelationship relationship) { //IL_0071: 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) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) Enemy val = (((Object)(object)target.GameObject != (Object)null) ? target.GameObject.GetComponentInParent() : null); if ((Object)(object)val == (Object)null && target.Category != "Enemy") { return ""; } PlayerAvatar val2 = EmpressDateEverythingAccess.LocalPlayer(); Vector3 val3 = (((Object)(object)val != (Object)null) ? ((Component)val).transform.position : (((Object)(object)val2 != (Object)null) ? ((Component)val2).transform.position : target.Point)); if ((Object)(object)val != (Object)null) { EmpressDateEverythingAccess.DisableEnemyChase(val, Mathf.Lerp(3f, 9f, (float)relationship.Love / 100f)); EmpressDateEverythingAccess.FreezeEnemy(val, 0.35f); } EmpressDateEverythingAccess.DistractEnemies(val3 + Random.insideUnitSphere * 3f, 22f); relationship.LastGiftName = "enemy breathing room"; return target.Name + " redirects the nearest danger. For a moment, the building forgets where your soft parts are."; } private string EmpressApplyPunishment(EmpressDateTarget target, EmpressRelationship relationship) { int num = _random.Next(0, 4); for (int i = 0; i < 4; i++) { string text = ""; switch ((num + i) % 4) { case 0: text = EmpressTryPunishMoney(target, relationship); break; case 1: text = EmpressTryPunishShop(target, relationship); break; case 2: text = EmpressTryPunishHeldObject(target, relationship); break; case 3: text = EmpressTryPunishDanger(target, relationship); break; } if (!string.IsNullOrWhiteSpace(text)) { return text; } } return ""; } private string EmpressTryPunishMoney(EmpressDateTarget target, EmpressRelationship relationship) { int runCurrency = EmpressDateEverythingAccess.GetRunCurrency(); if (runCurrency <= 0) { return ""; } int num = Mathf.Clamp(1 + relationship.Anger / 24 + relationship.Betrayals, 1, Mathf.Min(8, runCurrency)); EmpressDateEverythingAccess.SetRunCurrency(runCurrency - num); relationship.LastGiftName = ""; return target.Name + " charges you a drama tax of " + num + "K. The receipt just says: cheating."; } private string EmpressTryPunishShop(EmpressDateTarget target, EmpressRelationship relationship) { ItemAttributes val = EmpressFindBestShopItem(preferWeapon: false); if ((Object)(object)val == (Object)null) { return ""; } int itemValue = EmpressDateEverythingAccess.GetItemValue(val); int num = Mathf.Clamp(1 + relationship.Anger / 28, 1, 6); EmpressDateEverythingAccess.SetItemValue(val, itemValue + num); EmpressDateEverythingAccess.ShopUpdateCost(); string text = EmpressCleanName(EmpressDateEverythingAccess.ItemName(val)); return target.Name + " whispers to the register. " + (string.IsNullOrWhiteSpace(text) ? "Something" : text) + " gets " + num + "K more expensive out of pure spite."; } private string EmpressTryPunishHeldObject(EmpressDateTarget target, EmpressRelationship relationship) { PhysGrabObject heldObject = EmpressDateEverythingAccess.GetHeldObject(); if ((Object)(object)heldObject == (Object)null) { return ""; } EmpressDateEverythingAccess.BurdenObject(heldObject, Mathf.Lerp(6f, 15f, (float)relationship.Anger / 100f)); return target.Name + " makes the thing in your hands feel heavier. Emotional baggage has physics now."; } private string EmpressTryPunishDanger(EmpressDateTarget target, EmpressRelationship relationship) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_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) PlayerAvatar val = EmpressDateEverythingAccess.LocalPlayer(); if ((Object)(object)val == (Object)null) { return ""; } EmpressDateEverythingAccess.DistractEnemies(((Component)val).transform.position + Random.insideUnitSphere * 2f, Mathf.Lerp(12f, 28f, (float)relationship.Anger / 100f)); return target.Name + " says nothing. Somewhere nearby, danger gets curious about your exact location."; } private ItemAttributes EmpressFindBestShopItem(bool preferWeapon) { ItemAttributes[] array = Object.FindObjectsOfType(); ItemAttributes val = null; int num = int.MinValue; foreach (ItemAttributes val2 in array) { if (!((Object)(object)val2 == (Object)null) && EmpressDateEverythingAccess.IsShopItem(val2)) { string text = EmpressDateEverythingAccess.ItemName(val2).ToLowerInvariant(); bool flag = text.Contains("gun") || text.Contains("grenade") || text.Contains("mine") || text.Contains("melee") || text.Contains("baton") || text.Contains("hammer"); int num2 = EmpressDateEverythingAccess.GetItemValue(val2) + ((preferWeapon && flag) ? 10000 : 0); if (num2 > num) { num = num2; val = val2; } } } if ((Object)(object)val == (Object)null) { List shoppingList = EmpressDateEverythingAccess.GetShoppingList(EmpressDateEverythingAccess.ShopManagerInstance); if (shoppingList != null && shoppingList.Count > 0) { val = ((IEnumerable)shoppingList).FirstOrDefault((Func)((ItemAttributes item) => (Object)(object)item != (Object)null)); } } return val; } private ValuableObject EmpressFindNearbyValuable(Vector3 origin, float radius) { //IL_0021: 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) ValuableObject[] array = Object.FindObjectsOfType(); ValuableObject result = null; float num = float.MinValue; foreach (ValuableObject val in array) { if ((Object)(object)val == (Object)null) { continue; } float num2 = Vector3.Distance(origin, ((Component)val).transform.position); if (!(num2 > radius)) { float num3 = EmpressDateEverythingAccess.GetValuableCurrentValue(val) - num2 * 50f; if (num3 > num) { num = num3; result = val; } } } return result; } private PhysGrabObject EmpressFindTargetPhys(EmpressDateTarget target) { if ((Object)(object)target.GameObject == (Object)null) { return null; } PhysGrabObject componentInParent = target.GameObject.GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { return componentInParent; } ValuableObject componentInParent2 = target.GameObject.GetComponentInParent(); if (!((Object)(object)componentInParent2 != (Object)null)) { return null; } return EmpressDateEverythingAccess.GetValuablePhysGrabObject(componentInParent2); } private void EmpressToggleFollower(EmpressDateTarget target) { //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) if (target.Relationship.Love < 100) { EmpressSetDateDialog(target.Name + " :: follower locked", target.Name + " likes you, but not enough to rip itself out of the level. Max the relationship first.", EmpressCurrentOptions(target)); return; } if (_followers.TryGetValue(target.Key, out EmpressDateFollower value) && (Object)(object)value != (Object)null) { value.EmpressDismiss(); _followers.Remove(target.Key); target.Relationship.Following = false; target.Relationship.MemorySummary = target.Name + " agreed to stop following for now."; EmpressSetDateDialog(target.Name + " :: staying put", value.EmpressUsesOriginalObject ? (target.Name + " stays exactly where it stopped, like it ripped out of the map and decided that was enough cardio.") : (target.Name + " peels away from follower mode and the clone folds back out of sight."), EmpressCurrentOptions(target)); EmpressSave(); EmpressRefreshRelationships(); return; } EmpressCleanupFollowers(); if (_followers.Count >= _plugin.MaxActiveFollowers.Value) { EmpressSetDateDialog(target.Name + " :: follower limit", "The hallway is already emotionally crowded. Dismiss another follower before inviting " + target.Name + ".", EmpressCurrentOptions(target)); return; } PlayerAvatar val = EmpressDateEverythingAccess.LocalPlayer(); if ((Object)(object)val == (Object)null) { EmpressSetDateDialog(target.Name + " :: no player link", target.Name + " tries to follow, but Empress cannot find the local player safely.", EmpressCurrentOptions(target)); return; } bool rippedOriginal; GameObject val2 = EmpressCreateFollowerObject(target, val, out rippedOriginal); if ((Object)(object)val2 == (Object)null) { EmpressSetDateDialog(target.Name + " :: follow failed", target.Name + " tugs at the map, but the level refuses to let go cleanly.", EmpressCurrentOptions(target)); return; } EmpressDateFollower empressDateFollower = val2.GetComponent(); if ((Object)(object)empressDateFollower == (Object)null) { empressDateFollower = val2.AddComponent(); } Vector3 sideOffset = EmpressFollowerOffset(_followers.Count); empressDateFollower.EmpressBind(val, target.Relationship, target.Name, sideOffset, !rippedOriginal); _followers[target.Key] = empressDateFollower; target.Relationship.Following = true; target.Relationship.FollowerSummons++; target.Relationship.MemorySummary = (rippedOriginal ? (target.Name + " ripped free from the level and became a follower.") : (target.Name + " projected its actual object shape into follower form.")); EmpressSetDateDialog(target.Name + " :: follower online", rippedOriginal ? (target.Name + " actually rips loose from the level and starts following you. Much better.") : (target.Name + " follows using a clone from the exact in-world object hierarchy instead of a fake placeholder."), EmpressCurrentOptions(target)); EmpressSave(); EmpressRefreshRelationships(); } private GameObject EmpressCreateFollowerObject(EmpressDateTarget target, PlayerAvatar player, out bool rippedOriginal) { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) rippedOriginal = false; if ((Object)(object)target.GameObject == (Object)null) { return null; } GameObject val = EmpressPickFollowerSourceObject(target); if ((Object)(object)val == (Object)null) { return null; } PhysGrabObject componentInParent = val.GetComponentInParent(); GameObject val2; if (EmpressShouldRipOriginalFollower(target, val)) { val2 = val; val2.transform.SetParent((Transform)null, true); rippedOriginal = true; if ((Object)(object)componentInParent != (Object)null) { EmpressDateEverythingAccess.PrepareFollowerPhysics(componentInParent); } } else { val2 = EmpressBuildFollowerClone(val); } EmpressPrepareFollowerVisual(val2); ((Object)val2).name = "Empress Date Follower - " + target.Name; val2.transform.position = ((Component)player).transform.position + ((Component)player).transform.TransformDirection(new Vector3(-1.25f, 0.35f, 1.25f)); val2.transform.rotation = ((Component)player).transform.rotation; return val2; } private GameObject EmpressBuildFollowerClone(GameObject sourceObject) { GameObject val; try { val = Object.Instantiate(sourceObject); } catch { return null; } EmpressPrepareFollowerVisual(val); return val; } private static void EmpressPrepareFollowerVisual(GameObject followerObject) { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) MonoBehaviour[] componentsInChildren = followerObject.GetComponentsInChildren(true); foreach (MonoBehaviour val in componentsInChildren) { if ((Object)(object)val != (Object)null && ((object)val).GetType() != typeof(EmpressDateFollower)) { ((Behaviour)val).enabled = false; } } Collider[] componentsInChildren2 = followerObject.GetComponentsInChildren(true); for (int j = 0; j < componentsInChildren2.Length; j++) { if ((Object)(object)componentsInChildren2[j] != (Object)null) { componentsInChildren2[j].enabled = false; } } Rigidbody[] componentsInChildren3 = followerObject.GetComponentsInChildren(true); foreach (Rigidbody val2 in componentsInChildren3) { if (!((Object)(object)val2 == (Object)null)) { val2.velocity = Vector3.zero; val2.angularVelocity = Vector3.zero; val2.isKinematic = true; val2.useGravity = false; val2.detectCollisions = false; } } Renderer[] componentsInChildren4 = followerObject.GetComponentsInChildren(true); foreach (Renderer val3 in componentsInChildren4) { if ((Object)(object)val3 == (Object)null) { continue; } val3.enabled = true; try { Material[] materials = val3.materials; foreach (Material val4 in materials) { if ((Object)(object)val4 != (Object)null && val4.HasProperty("_Color")) { val4.SetColor("_Color", Color.Lerp(val4.GetColor("_Color"), new Color(1f, 0.2f, 0.72f, 1f), 0.45f)); } } } catch { } } } private static Bounds EmpressBoundsFor(Transform root) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)root == (Object)null) { return new Bounds(Vector3.zero, Vector3.one); } bool flag = false; Bounds bounds = default(Bounds); ((Bounds)(ref bounds))..ctor(root.position, Vector3.zero); Renderer[] componentsInChildren = ((Component)root).GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if (!((Object)(object)val == (Object)null)) { if (!flag) { bounds = val.bounds; flag = true; } else { ((Bounds)(ref bounds)).Encapsulate(val.bounds); } } } if (flag) { return bounds; } Collider[] componentsInChildren2 = ((Component)root).GetComponentsInChildren(true); foreach (Collider val2 in componentsInChildren2) { if (!((Object)(object)val2 == (Object)null)) { if (!flag) { bounds = val2.bounds; flag = true; } else { ((Bounds)(ref bounds)).Encapsulate(val2.bounds); } } } if (!flag) { return new Bounds(root.position, Vector3.one * 0.5f); } return bounds; } private GameObject EmpressPickFollowerSourceObject(EmpressDateTarget target) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target.GameObject == (Object)null) { return null; } PhysGrabObject val = EmpressFindTargetPhys(target); if ((Object)(object)val != (Object)null) { return ((Component)val).gameObject; } if (EmpressHasVisibleGeometry(target.GameObject)) { return target.GameObject; } Renderer val2 = EmpressFindNearestRenderer(target.GameObject, target.Point); if ((Object)(object)val2 != (Object)null) { return ((Component)EmpressChooseFollowerAnchor(((Component)val2).transform)).gameObject; } return target.GameObject; } private static bool EmpressHasVisibleGeometry(GameObject gameObject) { if ((Object)(object)gameObject == (Object)null) { return false; } return gameObject.GetComponentsInChildren(true).Any((Renderer renderer) => (Object)(object)renderer != (Object)null); } private static Renderer EmpressFindNearestRenderer(GameObject gameObject, Vector3 point) { //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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) Renderer result = null; float num = float.MaxValue; if ((Object)(object)gameObject == (Object)null) { return null; } foreach (Renderer item in gameObject.GetComponentsInChildren(true).Concat(gameObject.GetComponentsInParent(true)).Distinct()) { if (!((Object)(object)item == (Object)null)) { Bounds bounds = item.bounds; float num2 = Vector3.Distance(((Bounds)(ref bounds)).center, point); if (num2 < num) { num = num2; result = item; } } } return result; } private static Transform EmpressChooseFollowerAnchor(Transform transform) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)transform == (Object)null) { return null; } Transform result = transform; Transform val = transform; while ((Object)(object)val.parent != (Object)null) { Transform parent = val.parent; Bounds val2 = EmpressBoundsFor(parent); int num = ((Component)parent).GetComponentsInChildren(true).Length; Vector3 size = ((Bounds)(ref val2)).size; if (((Vector3)(ref size)).magnitude > 8.25f || ((Bounds)(ref val2)).size.y > 4.6f || num > 22) { break; } result = parent; val = parent; if ((Object)(object)((Component)parent).GetComponent() != (Object)null) { break; } } return result; } private bool EmpressShouldRipOriginalFollower(EmpressDateTarget target, GameObject sourceObject) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_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_0055: Unknown result type (might be due to invalid IL or missing references) if (target.Category == "Player" || target.Category == "Extractor") { return false; } if ((Object)(object)sourceObject == (Object)null) { return false; } Bounds val = EmpressBoundsFor(sourceObject.transform); Vector3 size = ((Bounds)(ref val)).size; if (((Vector3)(ref size)).magnitude > 8.25f || ((Bounds)(ref val)).size.y > 4.6f) { return false; } if (sourceObject.GetComponentsInChildren(true).Length > 80) { return false; } return true; } private static Vector3 EmpressFollowerOffset(int index) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) return (Vector3)((index % 4) switch { 0 => new Vector3(-1.35f, 0.15f, 1.35f), 1 => new Vector3(1.35f, 0.15f, 1.55f), 2 => new Vector3(-1.8f, 0.15f, -1.15f), _ => new Vector3(1.8f, 0.15f, -1.15f), }); } private void EmpressRejectDate() { if (_activeTarget != null && _dateWaitingForChoice && _plugin.LoveDecayPerRejection.Value > 0) { EmpressRelationship relationship = _activeTarget.Relationship; relationship.Love = Mathf.Clamp(relationship.Love - _plugin.LoveDecayPerRejection.Value, 0, 100); EmpressSave(); } _dateWaitingForChoice = false; _dateWaitingForAnswer = false; _dateWaitingAfterChoice = false; _activeChoices.Clear(); _activeAnswerChoices.Clear(); _activeQuestion = ""; _activeFollowUpQuestion = ""; _audio.EmpressStopCharacterMusic(); EmpressSetVisible(_datePanel, visible: false); } private void EmpressRefreshPrompt() { if (!_plugin.ShowLookPrompt.Value || _lookTarget == null) { EmpressSetVisible(_promptPanel, visible: false); return; } _promptText.text = "Press X to date " + EmpressRichEscape(_lookTarget.Name) + ""; EmpressSetVisible(_promptPanel, visible: true); } private void EmpressToggleRelationships() { bool flag = !_relationshipsPanel.activeSelf; EmpressSetVisible(_relationshipsPanel, flag); if (flag) { EmpressRefreshRelationships(); } } private void EmpressRefreshRelationships() { List list = (from relationship in _relationships.Values where relationship.Dates > 0 || relationship.Love > 0 || relationship.Following || relationship.GiftsGiven > 0 || relationship.BadThingsDone > 0 || relationship.Children > 0 orderby relationship.Love descending, relationship.Dates descending select relationship).ToList(); List list2 = list.Take(_plugin.MaxRelationshipsShown.Value).ToList(); _relationshipsStatsText.text = EmpressRelationshipBoardSummary(list, list2.Count); for (int num = ((Transform)_relationshipsListRoot).childCount - 1; num >= 0; num--) { Object.DestroyImmediate((Object)(object)((Component)((Transform)_relationshipsListRoot).GetChild(num)).gameObject); } if (list2.Count == 0) { EmpressBuildRelationshipEmptyState(_relationshipsListRoot); } else { for (int i = 0; i < list2.Count; i++) { EmpressBuildRelationshipEntry(_relationshipsListRoot, list2[i]); } } LayoutRebuilder.ForceRebuildLayoutImmediate(_relationshipsListRoot); Canvas.ForceUpdateCanvases(); if ((Object)(object)_relationshipsScroll != (Object)null) { _relationshipsScroll.verticalNormalizedPosition = 1f; } } private string EmpressRelationshipBoardSummary(List active, int shownCount) { int num = active.Count((EmpressRelationship relationship) => relationship.Following); int num2 = active.Count((EmpressRelationship relationship) => relationship.Love >= 100); int num3 = active.Sum((EmpressRelationship relationship) => relationship.Children); int num4 = active.Sum((EmpressRelationship relationship) => relationship.GiftsGiven); int num5 = active.Sum((EmpressRelationship relationship) => relationship.BadThingsDone + relationship.Betrayals); return "Tracked " + active.Count + " Showing " + shownCount + " Following " + num + " Maxed " + num2 + " Scroll Mouse wheel\nGifts " + num4 + " Drama " + num5 + " Children " + num3 + ""; } private void EmpressBuildRelationshipEntry(RectTransform parent, EmpressRelationship relationship) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_013a: 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_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_040f: Unknown result type (might be due to invalid IL or missing references) //IL_0428: Unknown result type (might be due to invalid IL or missing references) //IL_0456: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04ae: Unknown result type (might be due to invalid IL or missing references) //IL_04b3: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_0532: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Unknown result type (might be due to invalid IL or missing references) //IL_055a: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("EmpressDateEverything.RelationshipCard." + EmpressFileName(relationship.Key)); val.transform.SetParent((Transform)(object)parent, false); val.AddComponent(); LayoutElement obj = val.AddComponent(); bool flag = !string.IsNullOrWhiteSpace(relationship.LastGiftName) || !string.IsNullOrWhiteSpace(relationship.LastBadThing) || !string.IsNullOrWhiteSpace(relationship.MemorySummary); obj.minHeight = (flag ? 174f : 156f); obj.preferredHeight = obj.minHeight; Color val2 = EmpressRelationshipAccentColor(relationship); Color color = default(Color); ((Color)(ref color))..ctor(0.12f + val2.r * 0.08f, 0.12f + val2.g * 0.05f, 0.16f + val2.b * 0.04f, 0.95f); EmpressApplyPanelSkin(val.AddComponent(), _uiGlassSprite, color, new Color(0f, 0f, 0f, 0.24f), new Vector2(0f, -2f), sliced: true); GameObject obj2 = EmpressPanel("Accent", val.transform, val2, new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, 8f), Vector2.zero); EmpressSetOffsets(obj2.GetComponent(), 10f, -10f, -10f, -2f); EmpressApplyPanelSkin(obj2.GetComponent(), _uiAccentSprite, val2, Color.clear, Vector2.zero, sliced: false); GameObject val3 = EmpressPanel("PortraitFrame", val.transform, new Color(0.18f, 0.17f, 0.2f, 0.98f), new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(0f, 1f), new Vector2(94f, 118f), new Vector2(16f, -18f)); EmpressApplyPanelSkin(val3.GetComponent(), _uiFrameSprite, new Color(0.98f, 0.96f, 0.88f, 0.95f), new Color(0f, 0f, 0f, 0.35f), new Vector2(0f, -3f), sliced: true); GameObject val4 = EmpressPanel("PortraitBackdrop", val3.transform, new Color(0.08f, 0.09f, 0.12f, 0.96f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(84f, 108f), Vector2.zero); EmpressApplyPanelSkin(val4.GetComponent(), _uiGlassSprite, new Color(0.12f, 0.13f, 0.17f, 0.96f), Color.clear, Vector2.zero, sliced: true); RawImage obj3 = EmpressRawImage("Portrait", val4.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(80f, 104f), Vector2.zero); EmpressApplyGraphicOutline((Graphic)(object)obj3, new Color(0.96f, 0.83f, 0.6f, 0.14f), new Vector2(1f, -1f)); EmpressSetPortraitGraphic(obj3, EmpressPortraitForRelationship(relationship)); Text obj4 = EmpressText("Title", val.transform, 24, (TextAnchor)0, new Color(1f, 0.97f, 0.9f, 1f)); EmpressStretch(((Graphic)obj4).rectTransform, 126f, 112f, -260f, -18f); obj4.text = EmpressRichEscape(relationship.Name); EmpressApplyTextSkin(obj4, new Color(0.02f, 0.02f, 0.03f, 0.8f), new Vector2(1f, -1f), new Color(0.32f, 0.18f, 0.13f, 0.14f), (FontStyle)1); Text obj5 = EmpressText("Meta", val.transform, 15, (TextAnchor)2, new Color(0.95f, 0.88f, 0.73f, 1f)); EmpressStretch(((Graphic)obj5).rectTransform, 430f, 114f, -18f, -20f); obj5.text = EmpressRelationshipMetaLine(relationship); EmpressApplyTextSkin(obj5, new Color(0.02f, 0.02f, 0.03f, 0.65f), new Vector2(1f, -1f), Color.clear, (FontStyle)1); Text obj6 = EmpressText("Body", val.transform, 15, (TextAnchor)0, new Color(0.93f, 0.92f, 0.93f, 1f)); EmpressStretch(((Graphic)obj6).rectTransform, 126f, 18f, -18f, -56f); obj6.text = EmpressRelationshipBoardCard(relationship); obj6.verticalOverflow = (VerticalWrapMode)0; EmpressApplyTextSkin(obj6, new Color(0.02f, 0.02f, 0.03f, 0.72f), new Vector2(1f, -1f), new Color(0.36f, 0.18f, 0.12f, 0.12f), (FontStyle)0); } private void EmpressBuildRelationshipEmptyState(RectTransform parent) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_005a: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("EmpressDateEverything.RelationshipEmpty"); val.transform.SetParent((Transform)(object)parent, false); val.AddComponent(); LayoutElement obj = val.AddComponent(); obj.minHeight = 150f; obj.preferredHeight = 150f; EmpressApplyPanelSkin(val.AddComponent(), _uiGlassSprite, new Color(0.13f, 0.14f, 0.18f, 0.94f), new Color(0f, 0f, 0f, 0.24f), new Vector2(0f, -2f), sliced: true); Text obj2 = EmpressText("Title", val.transform, 24, (TextAnchor)0, new Color(1f, 0.96f, 0.88f, 1f)); EmpressStretch(((Graphic)obj2).rectTransform, 22f, 84f, -22f, -24f); obj2.text = "Nothing loves you yet."; EmpressApplyTextSkin(obj2, new Color(0.02f, 0.02f, 0.03f, 0.8f), new Vector2(1f, -1f), new Color(0.32f, 0.18f, 0.13f, 0.12f), (FontStyle)1); Text obj3 = EmpressText("Body", val.transform, 17, (TextAnchor)0, new Color(0.9f, 0.88f, 0.9f, 1f)); EmpressStretch(((Graphic)obj3).rectTransform, 22f, 20f, -22f, -66f); obj3.text = "Point at something nearby and press X. Empress will turn awkward eye contact into a spreadsheet."; EmpressApplyTextSkin(obj3, new Color(0.02f, 0.02f, 0.03f, 0.72f), new Vector2(1f, -1f), Color.clear, (FontStyle)0); } private static string EmpressRelationshipMetaLine(EmpressRelationship relationship) { StringBuilder stringBuilder = new StringBuilder(); stringBuilder.Append(""); stringBuilder.Append(EmpressRichEscape(relationship.Category)); stringBuilder.Append(" chapter "); stringBuilder.Append(Mathf.Clamp(relationship.StoryStage + 1, 1, 9)); stringBuilder.Append(""); if (relationship.Following) { stringBuilder.Append(" FOLLOWING"); } else if (relationship.Love >= 100) { stringBuilder.Append(" READY"); } return stringBuilder.ToString(); } private static Color EmpressRelationshipAccentColor(EmpressRelationship relationship) { //IL_001c: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) if (relationship.Following) { return new Color(0.96f, 0.76f, 0.42f, 0.96f); } if (relationship.Anger >= 55 || relationship.Betrayals > 0) { return new Color(0.9f, 0.43f, 0.35f, 0.96f); } if (relationship.Love >= 80 || relationship.Commitment >= 70) { return new Color(0.87f, 0.5f, 0.6f, 0.96f); } if (relationship.Trust >= 45) { return new Color(0.55f, 0.78f, 0.59f, 0.96f); } return new Color(0.84f, 0.6f, 0.38f, 0.96f); } private string EmpressRelationshipBoardCard(EmpressRelationship relationship) { StringBuilder stringBuilder = new StringBuilder(420); stringBuilder.Append(""); stringBuilder.Append(EmpressRichEscape(EmpressStatus(relationship.Love))); stringBuilder.Append(" Dates "); stringBuilder.Append(relationship.Dates); stringBuilder.Append(" Gifts "); stringBuilder.Append(relationship.GiftsGiven); stringBuilder.Append(" Drama "); stringBuilder.Append(relationship.BadThingsDone); stringBuilder.Append(" Children "); stringBuilder.Append(relationship.Children); stringBuilder.Append(""); stringBuilder.AppendLine(); stringBuilder.Append("Love "); stringBuilder.Append(relationship.Love); stringBuilder.Append("% Trust "); stringBuilder.Append(relationship.Trust); stringBuilder.Append("% Commitment "); stringBuilder.Append(relationship.Commitment); stringBuilder.Append("%"); stringBuilder.AppendLine(); stringBuilder.Append("Jealousy "); stringBuilder.Append(relationship.Jealousy); stringBuilder.Append("% Anger "); stringBuilder.Append(relationship.Anger); stringBuilder.Append("% Suspicion "); stringBuilder.Append(relationship.Suspicion); stringBuilder.Append("%"); stringBuilder.AppendLine(); stringBuilder.Append("Memory "); stringBuilder.Append(relationship.MemoryScore); stringBuilder.Append(" Betrayals "); stringBuilder.Append(relationship.Betrayals); stringBuilder.Append(" Summons "); stringBuilder.Append(relationship.FollowerSummons); stringBuilder.Append(""); if (!string.IsNullOrWhiteSpace(relationship.LastOtherName)) { stringBuilder.Append(" Watching "); stringBuilder.Append(EmpressRichEscape(relationship.LastOtherName)); stringBuilder.Append(""); } string value = ""; if (!string.IsNullOrWhiteSpace(relationship.LastGiftName)) { value = "Latest gift " + EmpressRichEscape(relationship.LastGiftName) + ""; } else if (!string.IsNullOrWhiteSpace(relationship.LastBadThing)) { value = "Latest drama " + EmpressRichEscape(EmpressTrimForBoard(relationship.LastBadThing, 138)); } else if (!string.IsNullOrWhiteSpace(relationship.MemorySummary)) { value = "Memory " + EmpressRichEscape(EmpressTrimForBoard(relationship.MemorySummary, 146)); } if (!string.IsNullOrWhiteSpace(value)) { stringBuilder.AppendLine(); stringBuilder.Append(value); } return stringBuilder.ToString(); } private static string EmpressTrimForBoard(string value, int maxLength) { if (string.IsNullOrWhiteSpace(value) || value.Length <= maxLength) { return value; } return value.Substring(0, Math.Max(0, maxLength - 3)).TrimEnd() + "..."; } private void EmpressCreateUi() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03d8: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03ec: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_0439: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Unknown result type (might be due to invalid IL or missing references) //IL_04be: Unknown result type (might be due to invalid IL or missing references) //IL_0508: Unknown result type (might be due to invalid IL or missing references) //IL_0521: Unknown result type (might be due to invalid IL or missing references) //IL_0530: Unknown result type (might be due to invalid IL or missing references) //IL_055b: Unknown result type (might be due to invalid IL or missing references) //IL_056a: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_0597: Unknown result type (might be due to invalid IL or missing references) //IL_059c: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_05e9: Unknown result type (might be due to invalid IL or missing references) //IL_05ee: Unknown result type (might be due to invalid IL or missing references) //IL_061e: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_063c: Unknown result type (might be due to invalid IL or missing references) //IL_064b: Unknown result type (might be due to invalid IL or missing references) //IL_065a: Unknown result type (might be due to invalid IL or missing references) //IL_0669: Unknown result type (might be due to invalid IL or missing references) //IL_0694: Unknown result type (might be due to invalid IL or missing references) //IL_06ad: Unknown result type (might be due to invalid IL or missing references) //IL_06bc: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_06f6: Unknown result type (might be due to invalid IL or missing references) //IL_0705: Unknown result type (might be due to invalid IL or missing references) //IL_0714: Unknown result type (might be due to invalid IL or missing references) //IL_0723: Unknown result type (might be due to invalid IL or missing references) //IL_0728: Unknown result type (might be due to invalid IL or missing references) //IL_0753: Unknown result type (might be due to invalid IL or missing references) //IL_0758: Unknown result type (might be due to invalid IL or missing references) //IL_075d: Unknown result type (might be due to invalid IL or missing references) //IL_077f: Unknown result type (might be due to invalid IL or missing references) //IL_078e: Unknown result type (might be due to invalid IL or missing references) //IL_079d: Unknown result type (might be due to invalid IL or missing references) //IL_07ac: Unknown result type (might be due to invalid IL or missing references) //IL_07b1: Unknown result type (might be due to invalid IL or missing references) //IL_07da: Unknown result type (might be due to invalid IL or missing references) //IL_07e9: Unknown result type (might be due to invalid IL or missing references) //IL_0818: Unknown result type (might be due to invalid IL or missing references) //IL_0827: Unknown result type (might be due to invalid IL or missing references) //IL_0836: Unknown result type (might be due to invalid IL or missing references) //IL_0845: Unknown result type (might be due to invalid IL or missing references) //IL_084a: Unknown result type (might be due to invalid IL or missing references) //IL_084f: Unknown result type (might be due to invalid IL or missing references) //IL_0897: Unknown result type (might be due to invalid IL or missing references) //IL_08b0: Unknown result type (might be due to invalid IL or missing references) //IL_08bf: Unknown result type (might be due to invalid IL or missing references) //IL_08f3: Unknown result type (might be due to invalid IL or missing references) //IL_0940: Unknown result type (might be due to invalid IL or missing references) //IL_094f: Unknown result type (might be due to invalid IL or missing references) //IL_0968: Unknown result type (might be due to invalid IL or missing references) //IL_099c: Unknown result type (might be due to invalid IL or missing references) //IL_09e9: Unknown result type (might be due to invalid IL or missing references) //IL_09f8: Unknown result type (might be due to invalid IL or missing references) //IL_0a11: Unknown result type (might be due to invalid IL or missing references) //IL_0a45: Unknown result type (might be due to invalid IL or missing references) //IL_0a92: Unknown result type (might be due to invalid IL or missing references) //IL_0aa1: Unknown result type (might be due to invalid IL or missing references) //IL_0aba: Unknown result type (might be due to invalid IL or missing references) //IL_0aee: Unknown result type (might be due to invalid IL or missing references) //IL_0b3b: Unknown result type (might be due to invalid IL or missing references) //IL_0b4a: Unknown result type (might be due to invalid IL or missing references) //IL_0b63: Unknown result type (might be due to invalid IL or missing references) //IL_0b8f: Unknown result type (might be due to invalid IL or missing references) //IL_0b94: Unknown result type (might be due to invalid IL or missing references) //IL_0b99: Unknown result type (might be due to invalid IL or missing references) //IL_0ba8: Unknown result type (might be due to invalid IL or missing references) //IL_0bad: Unknown result type (might be due to invalid IL or missing references) //IL_0bb2: Unknown result type (might be due to invalid IL or missing references) //IL_0c1b: Unknown result type (might be due to invalid IL or missing references) //IL_0c2a: Unknown result type (might be due to invalid IL or missing references) //IL_0c39: Unknown result type (might be due to invalid IL or missing references) //IL_0c48: Unknown result type (might be due to invalid IL or missing references) //IL_0c57: Unknown result type (might be due to invalid IL or missing references) //IL_0c5c: Unknown result type (might be due to invalid IL or missing references) //IL_0c89: Unknown result type (might be due to invalid IL or missing references) //IL_0ca2: Unknown result type (might be due to invalid IL or missing references) //IL_0cb1: Unknown result type (might be due to invalid IL or missing references) //IL_0cdd: Unknown result type (might be due to invalid IL or missing references) //IL_0ce2: Unknown result type (might be due to invalid IL or missing references) //IL_0ce7: Unknown result type (might be due to invalid IL or missing references) //IL_0cf6: Unknown result type (might be due to invalid IL or missing references) //IL_0cfb: Unknown result type (might be due to invalid IL or missing references) //IL_0d00: Unknown result type (might be due to invalid IL or missing references) //IL_0d48: Unknown result type (might be due to invalid IL or missing references) //IL_0d4d: Unknown result type (might be due to invalid IL or missing references) //IL_0d52: Unknown result type (might be due to invalid IL or missing references) //IL_0d7e: Unknown result type (might be due to invalid IL or missing references) //IL_0d8d: Unknown result type (might be due to invalid IL or missing references) //IL_0d9c: Unknown result type (might be due to invalid IL or missing references) //IL_0dab: Unknown result type (might be due to invalid IL or missing references) //IL_0dba: Unknown result type (might be due to invalid IL or missing references) //IL_0dbf: Unknown result type (might be due to invalid IL or missing references) //IL_0e07: Unknown result type (might be due to invalid IL or missing references) //IL_0e20: Unknown result type (might be due to invalid IL or missing references) //IL_0e2f: Unknown result type (might be due to invalid IL or missing references) //IL_0e5e: Unknown result type (might be due to invalid IL or missing references) //IL_0ea6: Unknown result type (might be due to invalid IL or missing references) //IL_0eb5: Unknown result type (might be due to invalid IL or missing references) //IL_0ece: Unknown result type (might be due to invalid IL or missing references) //IL_0efd: Unknown result type (might be due to invalid IL or missing references) //IL_0f45: Unknown result type (might be due to invalid IL or missing references) //IL_0f54: Unknown result type (might be due to invalid IL or missing references) //IL_0f59: Unknown result type (might be due to invalid IL or missing references) //IL_0f85: Unknown result type (might be due to invalid IL or missing references) //IL_0f94: Unknown result type (might be due to invalid IL or missing references) //IL_0fa3: Unknown result type (might be due to invalid IL or missing references) //IL_0fb2: Unknown result type (might be due to invalid IL or missing references) //IL_0fc1: Unknown result type (might be due to invalid IL or missing references) //IL_0fc6: Unknown result type (might be due to invalid IL or missing references) //IL_1013: Unknown result type (might be due to invalid IL or missing references) //IL_102c: Unknown result type (might be due to invalid IL or missing references) //IL_103b: Unknown result type (might be due to invalid IL or missing references) //IL_106b: Unknown result type (might be due to invalid IL or missing references) //IL_10b8: Unknown result type (might be due to invalid IL or missing references) //IL_10c7: Unknown result type (might be due to invalid IL or missing references) //IL_10e0: Unknown result type (might be due to invalid IL or missing references) //IL_110c: Unknown result type (might be due to invalid IL or missing references) //IL_1111: Unknown result type (might be due to invalid IL or missing references) //IL_1116: Unknown result type (might be due to invalid IL or missing references) //IL_1125: Unknown result type (might be due to invalid IL or missing references) //IL_112a: Unknown result type (might be due to invalid IL or missing references) //IL_112f: Unknown result type (might be due to invalid IL or missing references) //IL_117c: Unknown result type (might be due to invalid IL or missing references) //IL_1195: Unknown result type (might be due to invalid IL or missing references) //IL_11a4: Unknown result type (might be due to invalid IL or missing references) //IL_11b6: Unknown result type (might be due to invalid IL or missing references) //IL_1206: Unknown result type (might be due to invalid IL or missing references) //IL_120d: Expected O, but got Unknown //IL_123d: Unknown result type (might be due to invalid IL or missing references) //IL_1257: Unknown result type (might be due to invalid IL or missing references) //IL_1271: Unknown result type (might be due to invalid IL or missing references) //IL_1281: Unknown result type (might be due to invalid IL or missing references) //IL_129b: Unknown result type (might be due to invalid IL or missing references) //IL_12ab: Unknown result type (might be due to invalid IL or missing references) //IL_12f2: Unknown result type (might be due to invalid IL or missing references) //IL_12fc: Expected O, but got Unknown //IL_130e: Unknown result type (might be due to invalid IL or missing references) //IL_1315: Expected O, but got Unknown //IL_133b: Unknown result type (might be due to invalid IL or missing references) //IL_1350: Unknown result type (might be due to invalid IL or missing references) //IL_1365: Unknown result type (might be due to invalid IL or missing references) //IL_137a: Unknown result type (might be due to invalid IL or missing references) //IL_138e: Unknown result type (might be due to invalid IL or missing references) //IL_13b9: Unknown result type (might be due to invalid IL or missing references) //IL_13be: Unknown result type (might be due to invalid IL or missing references) //IL_13c3: Unknown result type (might be due to invalid IL or missing references) //IL_13e4: Unknown result type (might be due to invalid IL or missing references) //IL_13e9: Unknown result type (might be due to invalid IL or missing references) //IL_13fc: Unknown result type (might be due to invalid IL or missing references) //IL_1406: Unknown result type (might be due to invalid IL or missing references) //IL_1412: Unknown result type (might be due to invalid IL or missing references) //IL_141e: Unknown result type (might be due to invalid IL or missing references) //IL_142a: Unknown result type (might be due to invalid IL or missing references) //IL_1457: Unknown result type (might be due to invalid IL or missing references) //IL_1470: Unknown result type (might be due to invalid IL or missing references) //IL_147f: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("EmpressDateEverything.Canvas"); val.transform.SetParent(((Component)this).transform, false); _canvas = val.AddComponent(); _canvas.renderMode = (RenderMode)0; _canvas.sortingOrder = 32700; CanvasScaler obj = val.AddComponent(); obj.uiScaleMode = (ScaleMode)1; obj.referenceResolution = new Vector2(1920f, 1080f); obj.scaleFactor = _plugin.UiScale.Value; val.AddComponent(); _promptPanel = EmpressPanel("EmpressDateEverything.Prompt", val.transform, new Color(0.13f, 0.12f, 0.16f, 0.88f), new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(430f, 38f), new Vector2(0f, 46f)); EmpressApplyPanelSkin(_promptPanel.GetComponent(), _uiGlassSprite, new Color(0.92f, 0.91f, 0.97f, 0.88f), new Color(0.02f, 0.02f, 0.03f, 0.45f), new Vector2(0f, -4f), sliced: true); GameObject obj2 = EmpressPanel("EmpressDateEverything.PromptAccent", _promptPanel.transform, new Color(0.88f, 0.53f, 0.32f, 0.96f), new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, 6f), Vector2.zero); EmpressSetOffsets(obj2.GetComponent(), 18f, -4f, -18f, 0f); EmpressApplyPanelSkin(obj2.GetComponent(), _uiAccentSprite, new Color(0.94f, 0.66f, 0.39f, 0.72f), Color.clear, Vector2.zero, sliced: false); _promptText = EmpressText("EmpressDateEverything.PromptText", _promptPanel.transform, 16, (TextAnchor)4, new Color(0.96f, 0.94f, 0.9f, 1f)); EmpressStretch(((Graphic)_promptText).rectTransform, 14f, 4f, -14f, -6f); EmpressApplyTextSkin(_promptText, new Color(0.08f, 0.07f, 0.09f, 0.86f), new Vector2(1f, -1f), new Color(0.3f, 0.21f, 0.1f, 0.18f), (FontStyle)1); _datePanel = EmpressPanel("EmpressDateEverything.DatePanel", val.transform, new Color(0.12f, 0.11f, 0.15f, 0.98f), new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(0.5f, 0f), new Vector2(1240f, 548f), new Vector2(0f, 74f)); EmpressApplyPanelSkin(_datePanel.GetComponent(), _uiPanelSprite, new Color(0.93f, 0.92f, 0.98f, 0.97f), new Color(0f, 0f, 0f, 0.58f), new Vector2(0f, -12f), sliced: true); GameObject obj3 = EmpressPanel("EmpressDateEverything.InnerGlow", _datePanel.transform, new Color(0.42f, 0.21f, 0.28f, 0.18f), new Vector2(0f, 0f), new Vector2(1f, 1f), new Vector2(0.5f, 0.5f), Vector2.zero, Vector2.zero); EmpressStretch(obj3.GetComponent(), 14f, 14f, -14f, -14f); EmpressApplyPanelSkin(obj3.GetComponent(), _uiGlassSprite, new Color(0.75f, 0.46f, 0.35f, 0.16f), Color.clear, Vector2.zero, sliced: true); GameObject val2 = EmpressPanel("EmpressDateEverything.DateStripe", _datePanel.transform, new Color(0.92f, 0.62f, 0.36f, 0.96f), new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, 66f), new Vector2(0f, 0f)); EmpressSetOffsets(val2.GetComponent(), 12f, -66f, -12f, -10f); EmpressApplyPanelSkin(val2.GetComponent(), _uiAccentSprite, new Color(0.94f, 0.68f, 0.42f, 0.95f), new Color(0f, 0f, 0f, 0.2f), new Vector2(0f, -2f), sliced: true); GameObject obj4 = EmpressPanel("EmpressDateEverything.DateStripeEdge", val2.transform, new Color(0.42f, 0.12f, 0.14f, 0.55f), new Vector2(0f, 0f), new Vector2(1f, 0f), new Vector2(0.5f, 0f), new Vector2(0f, 3f), Vector2.zero); EmpressSetOffsets(obj4.GetComponent(), 12f, 0f, -12f, 3f); EmpressApplyPanelSkin(obj4.GetComponent(), _uiAccentSprite, new Color(0.44f, 0.19f, 0.15f, 0.55f), Color.clear, Vector2.zero, sliced: false); GameObject val3 = EmpressPanel("EmpressDateEverything.PortraitFrame", _datePanel.transform, new Color(0.18f, 0.17f, 0.2f, 0.98f), new Vector2(0f, 0.5f), new Vector2(0f, 0.5f), new Vector2(0f, 0.5f), new Vector2(360f, 424f), new Vector2(34f, -24f)); EmpressApplyPanelSkin(val3.GetComponent(), _uiFrameSprite, new Color(0.98f, 0.96f, 0.88f, 0.96f), new Color(0f, 0f, 0f, 0.52f), new Vector2(0f, -7f), sliced: true); GameObject val4 = EmpressPanel("EmpressDateEverything.PortraitBackdrop", val3.transform, new Color(0.06f, 0.07f, 0.09f, 0.96f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(332f, 396f), Vector2.zero); EmpressApplyPanelSkin(val4.GetComponent(), _uiGlassSprite, new Color(0.14f, 0.15f, 0.19f, 0.96f), Color.clear, Vector2.zero, sliced: true); _portrait = EmpressRawImage("EmpressDateEverything.Portrait", val4.transform, new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(320f, 384f), Vector2.zero); EmpressApplyGraphicOutline((Graphic)(object)_portrait, new Color(0.96f, 0.83f, 0.6f, 0.2f), new Vector2(1f, -1f)); GameObject obj5 = EmpressPanel("EmpressDateEverything.DateSurface", _datePanel.transform, new Color(0.08f, 0.09f, 0.12f, 0.76f), new Vector2(0f, 0f), new Vector2(1f, 1f), new Vector2(0.5f, 0.5f), Vector2.zero, Vector2.zero); EmpressStretch(obj5.GetComponent(), 396f, 20f, -28f, -78f); EmpressApplyPanelSkin(obj5.GetComponent(), _uiGlassSprite, new Color(0.12f, 0.13f, 0.17f, 0.88f), new Color(0f, 0f, 0f, 0.28f), new Vector2(0f, -3f), sliced: true); _dateTitle = EmpressText("EmpressDateEverything.Title", _datePanel.transform, 30, (TextAnchor)3, new Color(1f, 0.96f, 0.86f, 1f)); EmpressStretch(((Graphic)_dateTitle).rectTransform, 414f, 501f, -40f, -6f); EmpressApplyTextSkin(_dateTitle, new Color(0.15f, 0.09f, 0.06f, 0.88f), new Vector2(2f, -2f), new Color(0.34f, 0.16f, 0.12f, 0.34f), (FontStyle)1); _dateSubtitle = EmpressText("EmpressDateEverything.Subtitle", _datePanel.transform, 16, (TextAnchor)3, new Color(1f, 0.9f, 0.66f, 1f)); EmpressStretch(((Graphic)_dateSubtitle).rectTransform, 424f, 444f, -48f, -76f); EmpressApplyTextSkin(_dateSubtitle, new Color(0.12f, 0.07f, 0.05f, 0.86f), new Vector2(1f, -1f), new Color(0.34f, 0.16f, 0.12f, 0.2f), (FontStyle)1); _dateBody = EmpressText("EmpressDateEverything.Body", _datePanel.transform, 22, (TextAnchor)0, new Color(0.95f, 0.95f, 0.95f, 1f)); EmpressStretch(((Graphic)_dateBody).rectTransform, 424f, 124f, -54f, -132f); EmpressApplyTextSkin(_dateBody, new Color(0.02f, 0.02f, 0.03f, 0.86f), new Vector2(1f, -1f), new Color(0.42f, 0.22f, 0.17f, 0.16f), (FontStyle)0); _dateOptions = EmpressText("EmpressDateEverything.Options", _datePanel.transform, 18, (TextAnchor)6, new Color(0.98f, 0.9f, 0.75f, 1f)); EmpressStretch(((Graphic)_dateOptions).rectTransform, 424f, 38f, -54f, -438f); EmpressApplyTextSkin(_dateOptions, new Color(0.04f, 0.03f, 0.03f, 0.84f), new Vector2(1f, -1f), new Color(0.35f, 0.16f, 0.11f, 0.24f), (FontStyle)1); _relationshipsPanel = EmpressPanel("EmpressDateEverything.RelationshipsOverlay", val.transform, new Color(0f, 0f, 0f, 0.7f), Vector2.zero, Vector2.one, new Vector2(0.5f, 0.5f), Vector2.zero, Vector2.zero); EmpressStretch(_relationshipsPanel.GetComponent(), 0f, 0f, 0f, 0f); ((Graphic)_relationshipsPanel.GetComponent()).raycastTarget = true; GameObject val5 = EmpressPanel("EmpressDateEverything.RelationshipsWindow", _relationshipsPanel.transform, new Color(0.12f, 0.11f, 0.15f, 0.98f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(0.5f, 0.5f), new Vector2(1080f, 736f), Vector2.zero); EmpressApplyPanelSkin(val5.GetComponent(), _uiPanelSprite, new Color(0.93f, 0.92f, 0.98f, 0.98f), new Color(0f, 0f, 0f, 0.58f), new Vector2(0f, -12f), sliced: true); GameObject obj6 = EmpressPanel("EmpressDateEverything.RelationshipsGlow", val5.transform, new Color(0.42f, 0.21f, 0.28f, 0.14f), Vector2.zero, Vector2.one, new Vector2(0.5f, 0.5f), Vector2.zero, Vector2.zero); EmpressStretch(obj6.GetComponent(), 14f, 14f, -14f, -14f); EmpressApplyPanelSkin(obj6.GetComponent(), _uiGlassSprite, new Color(0.78f, 0.48f, 0.36f, 0.12f), Color.clear, Vector2.zero, sliced: true); GameObject obj7 = EmpressPanel("EmpressDateEverything.RelationshipStripe", val5.transform, new Color(0.56f, 0.3f, 0.22f, 0.92f), new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, 66f), Vector2.zero); EmpressSetOffsets(obj7.GetComponent(), 12f, -66f, -12f, -10f); EmpressApplyPanelSkin(obj7.GetComponent(), _uiAccentSprite, new Color(0.83f, 0.58f, 0.4f, 0.94f), new Color(0f, 0f, 0f, 0.2f), new Vector2(0f, -2f), sliced: true); Text obj8 = EmpressText("EmpressDateEverything.RelationshipTitle", val5.transform, 28, (TextAnchor)3, new Color(1f, 0.97f, 0.89f, 1f)); EmpressStretch(((Graphic)obj8).rectTransform, 28f, 648f, -250f, -14f); obj8.text = "Relationship Ledger"; EmpressApplyTextSkin(obj8, new Color(0.14f, 0.08f, 0.06f, 0.82f), new Vector2(1f, -1f), new Color(0.33f, 0.14f, 0.11f, 0.2f), (FontStyle)1); Text obj9 = EmpressText("EmpressDateEverything.RelationshipHint", val5.transform, 16, (TextAnchor)5, new Color(0.98f, 0.91f, 0.78f, 0.92f)); EmpressStretch(((Graphic)obj9).rectTransform, 700f, 648f, -28f, -16f); obj9.text = "F6 closes"; EmpressApplyTextSkin(obj9, new Color(0.18f, 0.09f, 0.06f, 0.72f), new Vector2(1f, -1f), Color.clear, (FontStyle)1); GameObject val6 = EmpressPanel("EmpressDateEverything.RelationshipStats", val5.transform, new Color(0.11f, 0.12f, 0.16f, 0.94f), new Vector2(0f, 1f), new Vector2(1f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, 78f), Vector2.zero); EmpressSetOffsets(val6.GetComponent(), 22f, -148f, -22f, -84f); EmpressApplyPanelSkin(val6.GetComponent(), _uiGlassSprite, new Color(0.12f, 0.13f, 0.18f, 0.95f), new Color(0f, 0f, 0f, 0.2f), new Vector2(0f, -2f), sliced: true); _relationshipsStatsText = EmpressText("EmpressDateEverything.RelationshipStatsText", val6.transform, 18, (TextAnchor)3, new Color(0.96f, 0.94f, 0.9f, 1f)); EmpressStretch(((Graphic)_relationshipsStatsText).rectTransform, 18f, 12f, -18f, -12f); EmpressApplyTextSkin(_relationshipsStatsText, new Color(0.02f, 0.02f, 0.03f, 0.72f), new Vector2(1f, -1f), new Color(0.35f, 0.18f, 0.12f, 0.12f), (FontStyle)1); GameObject val7 = EmpressPanel("EmpressDateEverything.RelationshipViewport", val5.transform, new Color(0.08f, 0.09f, 0.12f, 0.78f), Vector2.zero, Vector2.one, new Vector2(0.5f, 0.5f), Vector2.zero, Vector2.zero); EmpressStretch(val7.GetComponent(), 22f, 22f, -22f, -164f); EmpressApplyPanelSkin(val7.GetComponent(), _uiGlassSprite, new Color(0.11f, 0.12f, 0.16f, 0.9f), new Color(0f, 0f, 0f, 0.28f), new Vector2(0f, -3f), sliced: true); val7.AddComponent().padding = Vector4.zero; _relationshipsScroll = val7.AddComponent(); _relationshipsScroll.horizontal = false; _relationshipsScroll.vertical = true; _relationshipsScroll.movementType = (MovementType)2; _relationshipsScroll.scrollSensitivity = 32f; GameObject val8 = new GameObject("EmpressDateEverything.RelationshipContent"); _relationshipsListRoot = val8.AddComponent(); ((Transform)_relationshipsListRoot).SetParent(val7.transform, false); _relationshipsListRoot.anchorMin = new Vector2(0f, 1f); _relationshipsListRoot.anchorMax = new Vector2(1f, 1f); _relationshipsListRoot.pivot = new Vector2(0.5f, 1f); _relationshipsListRoot.offsetMin = Vector2.zero; _relationshipsListRoot.offsetMax = new Vector2(-18f, 0f); _relationshipsListRoot.anchoredPosition = Vector2.zero; VerticalLayoutGroup obj10 = val8.AddComponent(); ((LayoutGroup)obj10).childAlignment = (TextAnchor)1; ((HorizontalOrVerticalLayoutGroup)obj10).childForceExpandHeight = false; ((HorizontalOrVerticalLayoutGroup)obj10).childForceExpandWidth = true; ((HorizontalOrVerticalLayoutGroup)obj10).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)obj10).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)obj10).spacing = 10f; ((LayoutGroup)obj10).padding = new RectOffset(12, 12, 12, 12); val8.AddComponent().verticalFit = (FitMode)2; GameObject val9 = new GameObject("EmpressDateEverything.RelationshipScrollbar"); val9.transform.SetParent(val7.transform, false); RectTransform obj11 = val9.AddComponent(); obj11.anchorMin = new Vector2(1f, 0f); obj11.anchorMax = new Vector2(1f, 1f); obj11.pivot = new Vector2(1f, 0.5f); obj11.offsetMin = new Vector2(-12f, 10f); obj11.offsetMax = new Vector2(-4f, -10f); EmpressApplyPanelSkin(val9.AddComponent(), _uiGlassSprite, new Color(0.16f, 0.16f, 0.19f, 0.86f), Color.clear, Vector2.zero, sliced: true); Scrollbar val10 = val9.AddComponent(); val10.direction = (Direction)2; GameObject val11 = new GameObject("Handle"); val11.transform.SetParent(val9.transform, false); RectTransform val12 = val11.AddComponent(); val12.anchorMin = Vector2.zero; val12.anchorMax = Vector2.one; val12.offsetMin = Vector2.zero; val12.offsetMax = Vector2.zero; Image val13 = val11.AddComponent(); EmpressApplyPanelSkin(val13, _uiAccentSprite, new Color(0.94f, 0.68f, 0.42f, 0.95f), new Color(0f, 0f, 0f, 0.2f), new Vector2(0f, -1f), sliced: true); val10.handleRect = val12; ((Selectable)val10).targetGraphic = (Graphic)(object)val13; _relationshipsScroll.content = _relationshipsListRoot; _relationshipsScroll.viewport = val7.GetComponent(); _relationshipsScroll.verticalScrollbar = val10; _relationshipsScroll.verticalScrollbarVisibility = (ScrollbarVisibility)0; _relationshipsScroll.verticalScrollbarSpacing = 8f; EmpressSetVisible(_promptPanel, visible: false); EmpressSetVisible(_datePanel, visible: false); EmpressSetVisible(_relationshipsPanel, visible: false); } private void EmpressCreateUiSkins() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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) _uiPanelSprite = EmpressCreateUiSprite("panel", 64, 64, new Vector4(12f, 12f, 12f, 12f), delegate(int x, int y) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) float num9 = (float)x / 63f; float num10 = (float)y / 63f; bool num11 = x < 4 || y < 4 || x > 59 || y > 59; bool flag3 = x < 8 || y < 8 || x > 55 || y > 55; float num12 = 1f - Mathf.Clamp01(Vector2.Distance(new Vector2(num9, num10), new Vector2(0.5f, 0.5f)) * 1.15f); float num13 = (((x + y) % 14 < 2) ? 0.035f : 0f); Color val5 = Color.Lerp(new Color(0.12f, 0.12f, 0.15f, 1f), new Color(0.17f, 0.17f, 0.21f, 1f), num10 * 0.65f + num12 * 0.35f); if (num11) { return new Color(0.78f, 0.66f, 0.4f, 1f); } return flag3 ? Color.Lerp(val5, new Color(0.31f, 0.22f, 0.16f, 1f), 0.24f) : (val5 + new Color(num13, num13 * 0.7f, num13 * 0.45f, 0f)); }); _uiGlassSprite = EmpressCreateUiSprite("glass", 64, 64, new Vector4(10f, 10f, 10f, 10f), delegate(int x, int y) { //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) float num5 = (float)x / 63f; float num6 = (float)y / 63f; bool num7 = x < 3 || y < 3 || x > 60 || y > 60; float num8 = Mathf.Clamp01(1f - Mathf.Abs(num5 - 0.24f) * 3.8f) * 0.18f + Mathf.Clamp01(1f - Mathf.Abs(num6 - 0.2f) * 3.2f) * 0.08f; Color val4 = Color.Lerp(new Color(0.16f, 0.17f, 0.2f, 1f), new Color(0.1f, 0.11f, 0.14f, 1f), num6); return (Color)((!num7) ? (val4 + new Color(num8, num8, num8 * 0.9f, 0f)) : new Color(0.92f, 0.86f, 0.72f, 1f)); }); _uiAccentSprite = EmpressCreateUiSprite("accent", 64, 24, new Vector4(8f, 8f, 8f, 8f), delegate(int x, int y) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) float num2 = (float)x / 63f; float num3 = (float)y / 23f; Color val = new Color(0.69f, 0.42f, 0.28f, 1f); Color val2 = default(Color); ((Color)(ref val2))..ctor(0.93f, 0.71f, 0.42f, 1f); Color val3 = Color.Lerp(val, val2, num2); float num4 = Mathf.Clamp01(1f - Mathf.Abs(num3 - 0.35f) * 3.2f) * 0.18f; return (y >= 2 && y <= 21) ? (val3 + new Color(num4, num4 * 0.75f, num4 * 0.35f, 0f)) : Color.Lerp(val3, new Color(0.34f, 0.14f, 0.09f, 1f), 0.42f); }); _uiFrameSprite = EmpressCreateUiSprite("frame", 64, 64, new Vector4(14f, 14f, 14f, 14f), delegate(int x, int y) { //IL_0072: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) bool num = x < 5 || y < 5 || x > 58 || y > 58; bool flag = x < 9 || y < 9 || x > 54 || y > 54; bool flag2 = (x < 10 && y < 10) || (x > 53 && y < 10) || (x < 10 && y > 53) || (x > 53 && y > 53); if (num) { return new Color(0.98f, 0.91f, 0.69f, 1f); } if (flag2) { return new Color(0.83f, 0.66f, 0.34f, 1f); } return flag ? new Color(0.28f, 0.24f, 0.18f, 1f) : new Color(0.11f, 0.12f, 0.15f, 1f); }); } private Sprite EmpressCreateUiSprite(string key, int width, int height, Vector4 border, Func pixel) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(width, height, (TextureFormat)4, false) { name = "EmpressDateEverything." + key }; ((Texture)val).wrapMode = (TextureWrapMode)1; ((Texture)val).filterMode = (FilterMode)1; ((Object)val).hideFlags = (HideFlags)61; for (int i = 0; i < height; i++) { for (int j = 0; j < width; j++) { val.SetPixel(j, i, pixel(j, i)); } } val.Apply(false, true); Sprite obj = Sprite.Create(val, new Rect(0f, 0f, (float)width, (float)height), new Vector2(0.5f, 0.5f), 100f, 0u, (SpriteMeshType)0, border); ((Object)obj).name = ((Object)val).name + ".sprite"; return obj; } private static void EmpressApplyPanelSkin(Image image, Sprite sprite, Color color, Color shadowColor, Vector2 shadowDistance, bool sliced) { //IL_0029: 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_0052: 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) if (!((Object)(object)image == (Object)null)) { image.sprite = sprite; image.type = (Type)((sliced && (Object)(object)sprite != (Object)null) ? 1 : 0); ((Graphic)image).color = color; if (shadowColor.a > 0.001f) { Shadow obj = ((Component)image).GetComponent() ?? ((Component)image).gameObject.AddComponent(); obj.effectColor = shadowColor; obj.effectDistance = shadowDistance; obj.useGraphicAlpha = true; } } } private static void EmpressApplyTextSkin(Text text, Color shadowColor, Vector2 shadowDistance, Color outlineColor, FontStyle fontStyle) { //IL_000b: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)text == (Object)null)) { text.fontStyle = fontStyle; text.lineSpacing = 1.06f; Shadow obj = ((Component)text).GetComponent() ?? ((Component)text).gameObject.AddComponent(); obj.effectColor = shadowColor; obj.effectDistance = shadowDistance; obj.useGraphicAlpha = true; if (outlineColor.a > 0.001f) { Outline obj2 = ((Component)text).GetComponent() ?? ((Component)text).gameObject.AddComponent(); ((Shadow)obj2).effectColor = outlineColor; ((Shadow)obj2).effectDistance = new Vector2(1f, -1f); ((Shadow)obj2).useGraphicAlpha = true; } } } private static void EmpressApplyGraphicOutline(Graphic graphic, Color outlineColor, Vector2 distance) { //IL_0009: 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_0034: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)graphic == (Object)null) && !(outlineColor.a <= 0.001f)) { Outline obj = ((Component)graphic).GetComponent() ?? ((Component)graphic).gameObject.AddComponent(); ((Shadow)obj).effectColor = outlineColor; ((Shadow)obj).effectDistance = distance; ((Shadow)obj).useGraphicAlpha = true; } } private GameObject EmpressPanel(string name, Transform parent, Color color, Vector2 anchorMin, Vector2 anchorMax, Vector2 pivot, Vector2 size, Vector2 anchored) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown GameObject val = new GameObject(name); val.transform.SetParent(parent, false); RectTransform obj = val.AddComponent(); obj.anchorMin = anchorMin; obj.anchorMax = anchorMax; obj.pivot = pivot; obj.sizeDelta = size; obj.anchoredPosition = anchored; ((Graphic)val.AddComponent()).color = color; return val; } private Text EmpressText(string name, Transform parent, int size, TextAnchor anchor, Color color) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: 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) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); Text obj = val.AddComponent(); obj.font = _font; obj.fontSize = size; obj.alignment = anchor; ((Graphic)obj).color = color; obj.horizontalOverflow = (HorizontalWrapMode)0; obj.verticalOverflow = (VerticalWrapMode)0; obj.supportRichText = true; return obj; } private RawImage EmpressRawImage(string name, Transform parent, Vector2 anchorMin, Vector2 anchorMax, Vector2 pivot, Vector2 size, Vector2 anchored) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001a: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(name); val.transform.SetParent(parent, false); RectTransform obj = val.AddComponent(); obj.anchorMin = anchorMin; obj.anchorMax = anchorMax; obj.pivot = pivot; obj.sizeDelta = size; obj.anchoredPosition = anchored; RawImage obj2 = val.AddComponent(); ((Graphic)obj2).color = Color.white; return obj2; } private static void EmpressStretch(RectTransform rect, float left, float bottom, float right, float top) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) rect.anchorMin = Vector2.zero; rect.anchorMax = Vector2.one; rect.offsetMin = new Vector2(left, bottom); rect.offsetMax = new Vector2(right, top); } private static void EmpressSetOffsets(RectTransform rect, float left, float bottom, float right, float top) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) rect.offsetMin = new Vector2(left, bottom); rect.offsetMax = new Vector2(right, top); } private static void EmpressSetVisible(GameObject gameObject, bool visible) { if ((Object)(object)gameObject != (Object)null && gameObject.activeSelf != visible) { gameObject.SetActive(visible); } } private Texture2D EmpressPortraitFor(EmpressDateTarget target) { if (!string.IsNullOrWhiteSpace(target.Relationship.PortraitFile)) { return EmpressLoadXorPortrait(target.Relationship.PortraitFile); } Directory.CreateDirectory(_plugin.PortraitFolder.Value); string[] array = new string[4] { Path.Combine(_plugin.PortraitFolder.Value, EmpressFileName(target.Key) + ".png"), Path.Combine(_plugin.PortraitFolder.Value, EmpressFileName(target.Name) + ".png"), Path.Combine(_plugin.PortraitFolder.Value, EmpressFileName(target.Category) + ".png"), Path.Combine(_plugin.PortraitFolder.Value, "default.png") }; for (int i = 0; i < array.Length; i++) { if (File.Exists(array[i])) { return EmpressLoadPortrait(array[i]); } } string[] files = Directory.GetFiles(_plugin.PortraitFolder.Value, "*.png"); if (files.Length != 0) { int num = Mathf.Abs(target.Key.GetHashCode()) % files.Length; return EmpressLoadPortrait(files[num]); } return EmpressGeneratedPortrait(target.Category); } private Texture2D EmpressPortraitForRelationship(EmpressRelationship relationship) { if (!string.IsNullOrWhiteSpace(relationship.PortraitFile)) { return EmpressLoadXorPortrait(relationship.PortraitFile); } Directory.CreateDirectory(_plugin.PortraitFolder.Value); string[] array = new string[4] { Path.Combine(_plugin.PortraitFolder.Value, EmpressFileName(relationship.Key) + ".png"), Path.Combine(_plugin.PortraitFolder.Value, EmpressFileName(relationship.Name) + ".png"), Path.Combine(_plugin.PortraitFolder.Value, EmpressFileName(relationship.Category) + ".png"), Path.Combine(_plugin.PortraitFolder.Value, "default.png") }; for (int i = 0; i < array.Length; i++) { if (File.Exists(array[i])) { return EmpressLoadPortrait(array[i]); } } return EmpressGeneratedPortrait(relationship.Category); } private void EmpressSetPortrait(EmpressDateTarget target) { EmpressSetPortraitGraphic(_portrait, EmpressPortraitFor(target)); } private static void EmpressSetPortraitGraphic(RawImage image, Texture2D texture) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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) if (!((Object)(object)image == (Object)null)) { image.texture = (Texture)(object)texture; RectTransform rectTransform = ((Graphic)image).rectTransform; Rect rect = rectTransform.rect; float width = ((Rect)(ref rect)).width; rect = rectTransform.rect; float num = Mathf.Max(0.01f, width / Mathf.Max(1f, ((Rect)(ref rect)).height)); float num2 = (((Object)(object)texture != (Object)null) ? ((float)((Texture)texture).width / Mathf.Max(1f, (float)((Texture)texture).height)) : num); if (num2 > num) { float num3 = Mathf.Clamp01(num / num2); image.uvRect = new Rect((1f - num3) * 0.5f, 0f, num3, 1f); } else { float num4 = Mathf.Clamp01(num2 / num); image.uvRect = new Rect(0f, (1f - num4) * 0.5f, 1f, num4); } } } private Texture2D EmpressLoadXorPortrait(string name) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown string key = "archive:" + name; if (_portraitCache.TryGetValue(key, out Texture2D value)) { return value; } value = new Texture2D(2, 2, (TextureFormat)4, false); try { if (!EmpressDateCast.EmpressTryGetPortrait(name, out byte[] bytes)) { return EmpressGeneratedPortrait("Missing"); } ImageConversion.LoadImage(value, bytes); ((Texture)value).filterMode = (FilterMode)1; _portraitCache[key] = value; return value; } catch (Exception ex) { EmpressDateEverythingPlugin.EmpressWarning("xor portrait failed " + name + ": " + ex.GetType().Name); return EmpressGeneratedPortrait("Error"); } } private Texture2D EmpressLoadPortrait(string path) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if (_portraitCache.TryGetValue(path, out Texture2D value)) { return value; } value = new Texture2D(2, 2, (TextureFormat)4, false); try { ImageConversion.LoadImage(value, File.ReadAllBytes(path)); ((Texture)value).filterMode = (FilterMode)0; _portraitCache[path] = value; return value; } catch (Exception ex) { EmpressDateEverythingPlugin.EmpressWarning("portrait failed " + Path.GetFileName(path) + ": " + ex.GetType().Name); return EmpressGeneratedPortrait("Error"); } } private Texture2D EmpressGeneratedPortrait(string category) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) string key = "generated:" + category; if (_portraitCache.TryGetValue(key, out Texture2D value)) { return value; } Texture2D val = new Texture2D(128, 128, (TextureFormat)4, false); Color val2 = default(Color); ((Color)(ref val2))..ctor(1f, 0.2f, 0.68f, 1f); Color val3 = default(Color); ((Color)(ref val3))..ctor(0.02f, 0f, 0.03f, 1f); Color val4 = default(Color); ((Color)(ref val4))..ctor(1f, 0.65f, 0.92f, 1f); int num = Mathf.Abs(category.GetHashCode()); for (int i = 0; i < 128; i++) { for (int j = 0; j < 128; j++) { bool flag = j < 5 || i < 5 || j > 122 || i > 122; bool flag2 = Mathf.Pow(((float)j - 64f) / 35f, 2f) + Mathf.Pow(((float)i - 58f) / 28f, 2f) < 1f && i < 92; bool flag3 = (j + i + num) % 23 < 3; val.SetPixel(j, i, (Color)(flag ? val4 : (flag2 ? val2 : (flag3 ? new Color(0.22f, 0.05f, 0.14f, 1f) : val3)))); } } ((Texture)val).filterMode = (FilterMode)0; val.Apply(false, false); _portraitCache[key] = val; return val; } private void EmpressLoad() { _relationships.Clear(); if (!File.Exists(_saveFile)) { return; } string[] array = File.ReadAllLines(_saveFile); for (int i = 0; i < array.Length; i++) { string[] array2 = array[i].Split('\t'); if (array2.Length < 6) { continue; } try { string text = EmpressDecode(array2[0]); EmpressRelationship empressRelationship = new EmpressRelationship { Key = text, Name = EmpressDecode(array2[1]), Category = EmpressDecode(array2[2]), Love = Mathf.Clamp(int.Parse(array2[3]), 0, 100), Dates = Mathf.Max(0, int.Parse(array2[4])), LastMetTicks = long.Parse(array2[5]), CastId = ((array2.Length > 6) ? EmpressDecode(array2[6]) : text), PortraitFile = ((array2.Length > 7) ? EmpressDecode(array2[7]) : ""), Trust = ((array2.Length > 8) ? Mathf.Clamp(int.Parse(array2[8]), 0, 100) : 0), Jealousy = ((array2.Length > 9) ? Mathf.Clamp(int.Parse(array2[9]), 0, 100) : 0), Mood = ((array2.Length > 10) ? Mathf.Clamp(int.Parse(array2[10]), -100, 100) : 0), LastOtherName = ((array2.Length > 11) ? EmpressDecode(array2[11]) : ""), LastStyle = ((array2.Length > 12) ? EmpressDecode(array2[12]) : ""), LastLine = ((array2.Length > 13) ? EmpressDecode(array2[13]) : ""), LastSeenObject = ((array2.Length > 14) ? EmpressDecode(array2[14]) : ""), Anger = ((array2.Length > 15) ? Mathf.Clamp(int.Parse(array2[15]), 0, 100) : 0), Suspicion = ((array2.Length > 16) ? Mathf.Clamp(int.Parse(array2[16]), 0, 100) : 0), Commitment = ((array2.Length > 17) ? Mathf.Clamp(int.Parse(array2[17]), 0, 100) : 0), SecretDepth = ((array2.Length > 18) ? Mathf.Clamp(int.Parse(array2[18]), 0, 100) : 0), MemoryScore = ((array2.Length > 19) ? Mathf.Clamp(int.Parse(array2[19]), 0, 9999) : 0), GiftsGiven = ((array2.Length > 20) ? Mathf.Max(0, int.Parse(array2[20])) : 0), BadThingsDone = ((array2.Length > 21) ? Mathf.Max(0, int.Parse(array2[21])) : 0), Betrayals = ((array2.Length > 22) ? Mathf.Max(0, int.Parse(array2[22])) : 0), FavorsOwed = ((array2.Length > 23) ? Mathf.Max(0, int.Parse(array2[23])) : 0), LastGiftTicks = ((array2.Length > 24) ? long.Parse(array2[24]) : 0), LastPunishTicks = ((array2.Length > 25) ? long.Parse(array2[25]) : 0), LastGiftName = ((array2.Length > 26) ? EmpressDecode(array2[26]) : ""), LastBadThing = ((array2.Length > 27) ? EmpressDecode(array2[27]) : ""), MemorySummary = ((array2.Length > 28) ? EmpressDecode(array2[28]) : ""), Following = false, FollowerSummons = ((array2.Length > 29) ? Mathf.Max(0, int.Parse(array2[29])) : 0), Children = ((array2.Length > 30) ? Mathf.Max(0, int.Parse(array2[30])) : 0), LastChoiceId = ((array2.Length > 31) ? EmpressDecode(array2[31]) : ""), StoryStage = ((array2.Length > 32) ? Mathf.Clamp(int.Parse(array2[32]), 0, 8) : 0), StoryMomentum = ((array2.Length > 33) ? Mathf.Clamp(int.Parse(array2[33]), -999, 9999) : 0) }; if (array2.Length <= 32) { EmpressBackfillStoryProgress(empressRelationship); } _relationships[text] = empressRelationship; if (empressRelationship.LastMetTicks > 0 && empressRelationship.LastMetTicks >= _relationships.Values.Max((EmpressRelationship item) => item.LastMetTicks)) { _lastCommittedKey = empressRelationship.Key; _lastCommittedName = empressRelationship.Name; } } catch { } } } private void EmpressSave() { Directory.CreateDirectory(Path.GetDirectoryName(_saveFile)); List list = new List(); foreach (EmpressRelationship item in _relationships.Values.OrderBy((EmpressRelationship relationship) => relationship.Key)) { if (item.Love > 0 || item.Dates > 0) { list.Add(string.Join("\t", EmpressEncode(item.Key), EmpressEncode(item.Name), EmpressEncode(item.Category), item.Love.ToString(), item.Dates.ToString(), item.LastMetTicks.ToString(), EmpressEncode(item.CastId), EmpressEncode(item.PortraitFile), item.Trust.ToString(), item.Jealousy.ToString(), item.Mood.ToString(), EmpressEncode(item.LastOtherName), EmpressEncode(item.LastStyle), EmpressEncode(item.LastLine), EmpressEncode(item.LastSeenObject), item.Anger.ToString(), item.Suspicion.ToString(), item.Commitment.ToString(), item.SecretDepth.ToString(), item.MemoryScore.ToString(), item.GiftsGiven.ToString(), item.BadThingsDone.ToString(), item.Betrayals.ToString(), item.FavorsOwed.ToString(), item.LastGiftTicks.ToString(), item.LastPunishTicks.ToString(), EmpressEncode(item.LastGiftName), EmpressEncode(item.LastBadThing), EmpressEncode(item.MemorySummary), item.FollowerSummons.ToString(), item.Children.ToString(), EmpressEncode(item.LastChoiceId), item.StoryStage.ToString(), item.StoryMomentum.ToString())); } } File.WriteAllLines(_saveFile, list); } private string EmpressPick(string[] lines) { return lines[_random.Next(0, lines.Length)]; } private string EmpressFormat(string line, EmpressDateTarget target, EmpressRelationship relationship, int gain) { return string.Format(line, target.Name, target.Category, EmpressStatus(relationship.Love), relationship.Love, gain); } private static string EmpressStatus(int love) { if (love >= 100) { return EmpressStatuses[5]; } if (love >= 80) { return EmpressStatuses[4]; } if (love >= 60) { return EmpressStatuses[3]; } if (love >= 35) { return EmpressStatuses[2]; } if (love >= 15) { return EmpressStatuses[1]; } return EmpressStatuses[0]; } private static string EmpressRichEscape(string value) { if (string.IsNullOrEmpty(value)) { return ""; } return value.Replace("&", "&").Replace("<", "<").Replace(">", ">"); } private static string EmpressCleanName(string name) { if (string.IsNullOrWhiteSpace(name)) { return ""; } name = name.Replace("(Clone)", "").Replace("_", " ").Replace("-", " ") .Trim(); while (name.Contains(" ")) { name = name.Replace(" ", " "); } if (name.Length > 42) { name = name.Substring(0, 42).Trim(); } return name; } private static string EmpressFileName(string name) { StringBuilder stringBuilder = new StringBuilder(); for (int i = 0; i < name.Length; i++) { char c = char.ToLowerInvariant(name[i]); if (char.IsLetterOrDigit(c)) { stringBuilder.Append(c); } else if (c == ' ' || c == '_' || c == '-' || c == ':') { stringBuilder.Append('_'); } } string text = stringBuilder.ToString().Trim('_'); if (!string.IsNullOrWhiteSpace(text)) { return text; } return "default"; } private static string EmpressEncode(string value) { return Convert.ToBase64String(Encoding.UTF8.GetBytes(value ?? "")); } private static string EmpressDecode(string value) { return Encoding.UTF8.GetString(Convert.FromBase64String(value)); } } internal sealed class EmpressRelationship { internal string Key = ""; internal string Name = ""; internal string Category = ""; internal string CastId = ""; internal string PortraitFile = ""; internal string LastOtherName = ""; internal string LastStyle = ""; internal string LastLine = ""; internal string LastSeenObject = ""; internal string LastGiftName = ""; internal string LastBadThing = ""; internal string MemorySummary = ""; internal string LastChoiceId = ""; internal int Love; internal int Trust; internal int Jealousy; internal int Mood; internal int Anger; internal int Suspicion; internal int Commitment; internal int SecretDepth; internal int MemoryScore; internal int GiftsGiven; internal int BadThingsDone; internal int Betrayals; internal int FavorsOwed; internal int FollowerSummons; internal int Children; internal int StoryStage; internal int StoryMomentum; internal int Dates; internal long LastMetTicks; internal long LastGiftTicks; internal long LastPunishTicks; internal bool Following; } internal sealed class EmpressDateChoice { internal string Id = ""; internal string Label = ""; internal string PlayerAction = ""; internal string MemoryTag = ""; internal int Style; internal int LoveBonus; internal int TrustBonus; internal int MoodBonus; internal int JealousyBonus; internal int AngerBonus; internal int CommitmentBonus; internal int SecretBonus; internal int SuspicionBonus; internal int ChildrenBonus; } internal sealed class EmpressDateAnswerChoice { internal string Label = ""; internal string PlayerLine = ""; internal string CharacterLine = ""; internal string MemoryTag = ""; internal int LoveBonus; internal int TrustBonus; internal int MoodBonus; internal int JealousyBonus; internal int AngerBonus; internal int CommitmentBonus; internal int SecretBonus; internal int SuspicionBonus; } internal sealed class EmpressDateTarget { internal readonly string Key; internal readonly string Name; internal readonly string Category; internal readonly GameObject GameObject; internal readonly Vector3 Point; internal readonly EmpressRelationship Relationship; internal readonly EmpressDateCastSlot Slot; internal readonly string ObservedName; internal EmpressDateTarget(string key, string name, string category, GameObject gameObject, Vector3 point, EmpressRelationship relationship, EmpressDateCastSlot slot, string observedName) { //IL_0024: 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) Key = key; Name = name; Category = category; GameObject = gameObject; Point = point; Relationship = relationship; Slot = slot; ObservedName = observedName; } } internal sealed class EmpressDateCastSlot { internal string Key = ""; internal string Name = ""; internal string Category = ""; internal string Group = ""; internal string PortraitFile = ""; internal string Lore = ""; } internal static class EmpressDateCast { private static readonly List EmpressSlots = new List(); private static readonly Dictionary EmpressByKey = new Dictionary(); private static readonly Dictionary> EmpressByGroup = new Dictionary>(); private static readonly List EmpressPortraitNames = new List(); private static readonly Dictionary EmpressPortraitBytes = new Dictionary(); internal static void EmpressInitialize(EmpressDateEverythingPlugin plugin) { EmpressLoadPortraitArchive(Path.Combine(Path.GetDirectoryName(typeof(EmpressDateEverythingPlugin).Assembly.Location) ?? Paths.PluginPath, "Assets", "EmpressPortraits.xorbin")); EmpressSlots.Clear(); EmpressByKey.Clear(); EmpressByGroup.Clear(); EmpressDateCastSlot[] array = EmpressDefinitions(); int num = Mathf.Min(array.Length, EmpressPortraitNames.Count); for (int i = 0; i < num; i++) { EmpressDateCastSlot empressDateCastSlot = array[i]; empressDateCastSlot.PortraitFile = EmpressPortraitNames[i]; EmpressSlots.Add(empressDateCastSlot); EmpressByKey[empressDateCastSlot.Key] = empressDateCastSlot; if (!EmpressByGroup.TryGetValue(empressDateCastSlot.Group, out List value)) { value = new List(); EmpressByGroup[empressDateCastSlot.Group] = value; } value.Add(empressDateCastSlot); } EmpressDateEverythingPlugin.EmpressLog("loaded " + EmpressSlots.Count + " relationship cast portraits"); } internal static bool EmpressTryGetPortrait(string name, out byte[] bytes) { return EmpressPortraitBytes.TryGetValue(name, out bytes); } private static void EmpressLoadPortraitArchive(string path) { EmpressPortraitNames.Clear(); EmpressPortraitBytes.Clear(); if (!File.Exists(path)) { EmpressDateEverythingPlugin.EmpressWarning("portrait archive missing"); return; } try { byte[] array = File.ReadAllBytes(path); for (int i = 0; i < array.Length; i++) { array[i] ^= 90; } using MemoryStream input = new MemoryStream(array); using BinaryReader binaryReader = new BinaryReader(input, Encoding.UTF8); if (Encoding.ASCII.GetString(binaryReader.ReadBytes(8)) != "EDTPACK1") { EmpressDateEverythingPlugin.EmpressWarning("portrait archive magic mismatch"); return; } int num = binaryReader.ReadInt32(); for (int j = 0; j < num; j++) { int count = binaryReader.ReadInt32(); string @string = Encoding.UTF8.GetString(binaryReader.ReadBytes(count)); int count2 = binaryReader.ReadInt32(); byte[] value = binaryReader.ReadBytes(count2); EmpressPortraitNames.Add(@string); EmpressPortraitBytes[@string] = value; } } catch (Exception ex) { EmpressDateEverythingPlugin.EmpressWarning("portrait archive failed: " + ex.GetType().Name); } } internal static EmpressDateCastSlot EmpressResolve(string category, string observedName, GameObject gameObject) { string text = (category ?? "").ToLowerInvariant(); string text2 = EmpressNormalizeScan(observedName) + EmpressScanTransformNames(gameObject); string text3 = EmpressScanComponentNames(gameObject); string scan = text2 + text3; switch (text) { case "player": return EmpressExact("player_self"); case "extractor": return EmpressExact("extractor"); case "cart": return EmpressExact("cart"); case "door": if (!EmpressHasTerm(scan, "truck")) { return EmpressExact("doorway"); } return EmpressExact("truck_door"); case "wall": return EmpressExact("wall"); case "floor": return EmpressExact("floor"); case "ceiling": return EmpressExact("ceiling"); case "enemy": return EmpressResolveEnemy(text2, text3); case "valuable": return EmpressResolveValuable(scan); case "item": return EmpressResolveItem(text2, text3); default: return EmpressResolveObject(text2, text3); } } internal static bool EmpressTryResolveStaticObjectLocal(GameObject gameObject, out EmpressDateCastSlot slot) { slot = null; if ((Object)(object)gameObject == (Object)null) { return false; } string nameScan = EmpressNormalizeScan(((Object)gameObject).name); string text = EmpressScanLocalComponentNames(gameObject); if (EmpressIsLocalGenericStaticName(((Object)gameObject).name) && text.Trim().Length == 0) { return false; } slot = EmpressResolveObject(nameScan, text); string text2 = ((slot != null) ? slot.Key : ""); if (!string.IsNullOrWhiteSpace(text2) && text2 != "object_generic") { if (!text2.StartsWith("object_", StringComparison.OrdinalIgnoreCase) && !(text2 == "shop_counter") && !(text2 == "exit_sign")) { return text2 == "camera"; } return true; } return false; } internal static int EmpressStaticObjectPriority(string key) { switch (key) { case "object_table": case "object_chair": case "object_lamp": case "object_sign": case "object_screen": case "object_painting": case "object_terminal": case "object_machine": case "object_vending": case "camera": return 5; case "object_clock": case "shop_counter": case "object_window": case "object_locker": case "object_keyboard": case "object_monitor": case "object_bed": case "object_mannequin": return 4; case "object_crate": case "object_shelf": case "object_pipe": case "object_button": case "object_barrel": return 3; case "object_box": return 2; default: return 0; } } private static EmpressDateCastSlot EmpressExact(string key) { if (EmpressByKey.TryGetValue(key, out EmpressDateCastSlot value)) { return value; } if (EmpressSlots.Count <= 0) { return new EmpressDateCastSlot { Key = "empress_missing", Name = "Missing Date", Category = "System", Group = "system", Lore = "Empress could not find a portrait slot." }; } return EmpressSlots[0]; } private static EmpressDateCastSlot EmpressPick(string groupName, string seed) { if (EmpressByGroup.TryGetValue(groupName, out List value) && value.Count > 0) { return value[Mathf.Abs(seed.GetHashCode()) % value.Count]; } return EmpressExact(groupName + "_generic"); } private static EmpressDateCastSlot EmpressResolveEnemy(string nameScan, string componentScan) { string scan = nameScan + componentScan; if (EmpressHasAnyTerm(componentScan, "enemy ceiling eye", "ceiling eye") || EmpressHasAnyTerm(nameScan, "ceiling eye")) { return EmpressExact("ceiling_eye"); } if (EmpressHasAnyTerm(scan, "hunter")) { return EmpressExact("enemy_hunter"); } if (EmpressHasAnyTerm(scan, "duck")) { return EmpressExact("enemy_duck"); } if (EmpressHasAnyTerm(scan, "gnome")) { return EmpressExact("enemy_gnome"); } if (EmpressHasAnyTerm(scan, "runner")) { return EmpressExact("enemy_runner"); } if (EmpressHasAnyTerm(scan, "shadow")) { return EmpressExact("enemy_shadow"); } if (EmpressHasAnyTerm(scan, "head", "head grabber")) { return EmpressExact("enemy_head"); } if (EmpressHasAnyTerm(scan, "bang", "bomb", "bomb thrower")) { return EmpressExact("enemy_bang"); } if (EmpressHasAnyTerm(scan, "floater")) { return EmpressExact("enemy_floater"); } if (EmpressHasAnyTerm(scan, "tick")) { return EmpressExact("enemy_tick"); } if (EmpressHasAnyTerm(scan, "slow mouth", "slowwalker", "slow walker")) { return EmpressExact("enemy_slow"); } if (EmpressHasAnyTerm(scan, "robe")) { return EmpressExact("enemy_robe"); } if (EmpressHasAnyTerm(scan, "beamer")) { return EmpressExact("enemy_beamer"); } if (EmpressHasAnyTerm(scan, "birthday boy", "birthdayboy")) { return EmpressExact("enemy_birthday"); } if (EmpressHasAnyTerm(scan, "bowtie")) { return EmpressExact("enemy_bowtie"); } if (EmpressHasAnyTerm(scan, "elsa")) { return EmpressExact("enemy_elsa"); } if (EmpressHasAnyTerm(scan, "heart hugger")) { return EmpressExact("enemy_heart_hugger"); } if (EmpressHasAnyTerm(scan, "hidden")) { return EmpressExact("enemy_hidden"); } if (EmpressHasAnyTerm(scan, "oogly")) { return EmpressExact("enemy_oogly"); } if (EmpressHasAnyTerm(scan, "spinny")) { return EmpressExact("enemy_spinny"); } if (EmpressHasAnyTerm(scan, "thin man", "thinman")) { return EmpressExact("enemy_thin_man"); } if (EmpressHasAnyTerm(scan, "tricycle")) { return EmpressExact("enemy_tricycle"); } if (EmpressHasAnyTerm(scan, "tumbler")) { return EmpressExact("enemy_tumbler"); } if (EmpressHasAnyTerm(scan, "upscream")) { return EmpressExact("enemy_upscream"); } return EmpressExact("enemy_generic"); } private static EmpressDateCastSlot EmpressResolveValuable(string scan) { if (EmpressHasAnyTerm(scan, "glass", "vase", "fragile")) { return EmpressExact("valuable_fragile"); } if (EmpressHasAnyTerm(scan, "heavy", "large", "piano")) { return EmpressExact("valuable_heavy"); } if (EmpressHasAnyTerm(scan, "gallery", "paint", "art", "statue", "canvas")) { return EmpressExact("valuable_art"); } if (EmpressHasAnyTerm(scan, "gold", "coin", "diamond")) { return EmpressExact("valuable_gold"); } if (EmpressHasAnyTerm(scan, "television", "tv", "computer", "tech", "screen")) { return EmpressExact("valuable_tech"); } if (EmpressHasAnyTerm(scan, "mirror")) { return EmpressExact("valuable_mirror"); } if (EmpressHasAnyTerm(scan, "cursed", "haunt", "skull", "ritual")) { return EmpressExact("valuable_cursed"); } if (EmpressHasAnyTerm(scan, "tiny", "small")) { return EmpressExact("valuable_tiny"); } return EmpressExact("valuable_generic"); } private static EmpressDateCastSlot EmpressResolveItem(string nameScan, string componentScan) { if (EmpressHasAnyTerm(componentScan, "map tool controller")) { return EmpressExact("map"); } if (EmpressHasAnyTerm(componentScan, "item cart laser")) { return EmpressExact("item_cart_laser"); } if (EmpressHasAnyTerm(componentScan, "item gun", "item cart cannon")) { return EmpressExact("item_gun"); } if (EmpressHasAnyTerm(componentScan, "item grenade")) { return EmpressExact("item_grenade"); } if (EmpressHasAnyTerm(componentScan, "item mine")) { return EmpressExact("item_mine"); } if (EmpressHasAnyTerm(componentScan, "item drone")) { return EmpressExact("item_drone"); } if (EmpressHasAnyTerm(componentScan, "item orb")) { return EmpressExact("item_orb"); } if (EmpressHasAnyTerm(componentScan, "item health pack")) { return EmpressExact("item_heal"); } if (EmpressHasAnyTerm(componentScan, "item melee", "item stun baton")) { return EmpressExact("item_melee"); } if (EmpressHasAnyTerm(componentScan, "item ladder")) { return EmpressExact("item_ladder"); } if (EmpressHasAnyTerm(componentScan, "item upgrade")) { return EmpressExact("item_upgrade"); } if (EmpressHasAnyTerm(componentScan, "item rubber duck", "item duck bucket")) { return EmpressExact("item_duck"); } if (EmpressHasAnyTerm(componentScan, "item light") && !EmpressHasAnyTerm(componentScan, "item drone")) { return EmpressExact("flashlight"); } if (EmpressHasAnyTerm(nameScan, "cart laser")) { return EmpressExact("item_cart_laser"); } if (EmpressHasAnyTerm(nameScan, "flashlight", "torch")) { return EmpressExact("flashlight"); } if (EmpressHasAnyTerm(nameScan, "map")) { return EmpressExact("map"); } if (EmpressHasAnyTerm(nameScan, "gun", "tranq", "cannon")) { return EmpressExact("item_gun"); } if (EmpressHasAnyTerm(nameScan, "grenade")) { return EmpressExact("item_grenade"); } if (EmpressHasAnyTerm(nameScan, "mine")) { return EmpressExact("item_mine"); } if (EmpressHasAnyTerm(nameScan, "drone")) { return EmpressExact("item_drone"); } if (EmpressHasAnyTerm(nameScan, "orb")) { return EmpressExact("item_orb"); } if (EmpressHasAnyTerm(nameScan, "heal", "health", "medkit", "med kit")) { return EmpressExact("item_heal"); } if (EmpressHasAnyTerm(nameScan, "melee", "baton", "hammer")) { return EmpressExact("item_melee"); } if (EmpressHasAnyTerm(nameScan, "ladder")) { return EmpressExact("item_ladder"); } if (EmpressHasAnyTerm(nameScan, "upgrade")) { return EmpressExact("item_upgrade"); } if (EmpressHasAnyTerm(nameScan, "rubber duck")) { return EmpressExact("item_duck"); } EmpressHasAnyTerm(nameScan, "battery", "crystal", "recharge"); return EmpressExact("item_generic"); } private static EmpressDateCastSlot EmpressResolveObject(string nameScan, string componentScan) { string scan = nameScan + componentScan; if (EmpressHasAnyTerm(scan, "shop counter", "cash register", "checkout counter", "checkout", "counter")) { return EmpressExact("shop_counter"); } if (EmpressHasAnyTerm(scan, "truck")) { return EmpressExact("truck"); } if (EmpressHasAnyTerm(scan, "exit sign")) { return EmpressExact("exit_sign"); } if (EmpressHasAnyTerm(scan, "button", "switch")) { return EmpressExact("object_button"); } if (EmpressHasAnyTerm(scan, "terminal", "charging station")) { return EmpressExact("object_terminal"); } if (EmpressHasAnyTerm(scan, "screen")) { return EmpressExact("object_screen"); } if (EmpressHasAnyTerm(scan, "monitor")) { return EmpressExact("object_screen"); } if (EmpressHasAnyTerm(scan, "keyboard")) { return EmpressExact("object_terminal"); } if (EmpressHasAnyTerm(scan, "lamp", "wall light", "ceiling light")) { return EmpressExact("object_lamp"); } if (EmpressHasAnyTerm(scan, "table", "desk")) { return EmpressExact("object_table"); } if (EmpressHasAnyTerm(scan, "chair", "stool", "seat")) { return EmpressExact("object_chair"); } if (EmpressHasAnyTerm(scan, "box")) { return EmpressExact("object_box"); } if (EmpressHasAnyTerm(scan, "barrel")) { return EmpressExact("object_barrel"); } if (EmpressHasAnyTerm(scan, "shelf", "bookcase", "rack")) { return EmpressExact("object_shelf"); } if (EmpressHasAnyTerm(scan, "crate")) { return EmpressExact("object_crate"); } if (EmpressHasAnyTerm(scan, "pipe")) { return EmpressExact("object_pipe"); } if (EmpressHasAnyTerm(scan, "mannequin")) { return EmpressExact("object_mannequin"); } if (EmpressHasAnyTerm(scan, "painting", "canvas", "dirty painting", "canvas handler")) { return EmpressExact("object_painting"); } if (EmpressHasAnyTerm(scan, "clock")) { return EmpressExact("object_clock"); } if (EmpressHasAnyTerm(scan, "bed", "mattress")) { return EmpressExact("object_bed"); } if (EmpressHasAnyTerm(scan, "locker")) { return EmpressExact("object_locker"); } if (EmpressHasAnyTerm(scan, "machine", "generator")) { return EmpressExact("object_machine"); } if (EmpressHasAnyTerm(scan, "vending")) { return EmpressExact("object_vending"); } if (EmpressHasAnyTerm(scan, "sign")) { return EmpressExact("object_sign"); } if (EmpressHasAnyTerm(scan, "window", "glass pane")) { return EmpressExact("object_window"); } if (EmpressHasAnyTerm(scan, "camera")) { return EmpressExact("camera"); } return EmpressExact("object_generic"); } private static string EmpressScanTransformNames(GameObject gameObject) { if ((Object)(object)gameObject == (Object)null) { return " "; } StringBuilder stringBuilder = new StringBuilder(160); Transform val = gameObject.transform; int num = 0; while ((Object)(object)val != (Object)null && num < 8) { EmpressAppendNormalized(stringBuilder, ((Object)val).name); num++; val = val.parent; } Transform[] componentsInChildren = gameObject.GetComponentsInChildren(true); int num2 = Mathf.Min(componentsInChildren.Length, 24); for (int i = 0; i < num2; i++) { Transform val2 = componentsInChildren[i]; if ((Object)(object)val2 != (Object)null) { EmpressAppendNormalized(stringBuilder, ((Object)val2).name); } } if (stringBuilder.Length != 0) { return stringBuilder.ToString(); } return " "; } private static string EmpressScanLocalComponentNames(GameObject gameObject) { if ((Object)(object)gameObject == (Object)null) { return " "; } StringBuilder stringBuilder = new StringBuilder(96); Component[] components = gameObject.GetComponents(); int num = Mathf.Min(components.Length, 16); for (int i = 0; i < num; i++) { Component val = components[i]; if ((Object)(object)val != (Object)null) { string name = ((object)val).GetType().Name; if (!EmpressIsGenericLocalComponent(name)) { EmpressAppendNormalized(stringBuilder, name); } } } if (stringBuilder.Length != 0) { return stringBuilder.ToString(); } return " "; } private static string EmpressScanComponentNames(GameObject gameObject) { if ((Object)(object)gameObject == (Object)null) { return " "; } StringBuilder stringBuilder = new StringBuilder(192); Transform val = gameObject.transform; int num = 0; while ((Object)(object)val != (Object)null && num < 8) { Component[] components = ((Component)val).GetComponents(); foreach (Component val2 in components) { if ((Object)(object)val2 != (Object)null) { EmpressAppendNormalized(stringBuilder, ((object)val2).GetType().Name); } } num++; val = val.parent; } Component[] componentsInChildren = gameObject.GetComponentsInChildren(true); int num2 = Mathf.Min(componentsInChildren.Length, 48); for (int j = 0; j < num2; j++) { Component val3 = componentsInChildren[j]; if ((Object)(object)val3 != (Object)null) { EmpressAppendNormalized(stringBuilder, ((object)val3).GetType().Name); } } if (stringBuilder.Length != 0) { return stringBuilder.ToString(); } return " "; } private static void EmpressAppendNormalized(StringBuilder builder, string value) { string text = EmpressNormalizeScan(value); if (text.Length > 2) { builder.Append(text); } } private static string EmpressNormalizeScan(string value) { if (string.IsNullOrWhiteSpace(value)) { return " "; } StringBuilder stringBuilder = new StringBuilder(value.Length + 8); char c = '\0'; for (int i = 0; i < value.Length; i++) { char c2 = value[i]; if (char.IsUpper(c2) && i > 0 && (char.IsLower(c) || char.IsDigit(c))) { stringBuilder.Append(' '); } stringBuilder.Append(char.IsLetterOrDigit(c2) ? char.ToLowerInvariant(c2) : ' '); c = c2; } string text = stringBuilder.ToString(); while (text.Contains(" ")) { text = text.Replace(" ", " "); } text = text.Trim(); if (text.Length != 0) { return " " + text + " "; } return " "; } private static bool EmpressIsLocalGenericStaticName(string value) { if (string.IsNullOrWhiteSpace(value)) { return true; } string text = value.Trim(); if (EmpressHasAnyTerm(EmpressNormalizeScan(text), "box collider", "mesh collider", "capsule collider", "sphere collider", "trigger collider", "collision", "collider", "trigger")) { return true; } if (!text.Equals("Box", StringComparison.OrdinalIgnoreCase) && !text.Equals("Cube", StringComparison.OrdinalIgnoreCase) && !text.Equals("Object", StringComparison.OrdinalIgnoreCase) && !text.Equals("Model", StringComparison.OrdinalIgnoreCase) && !text.Equals("Mesh", StringComparison.OrdinalIgnoreCase) && !text.Equals("Root", StringComparison.OrdinalIgnoreCase)) { return text.Equals("Pivot", StringComparison.OrdinalIgnoreCase); } return true; } private static bool EmpressIsGenericLocalComponent(string typeName) { if (string.IsNullOrWhiteSpace(typeName)) { return true; } if (!typeName.Equals("Transform", StringComparison.OrdinalIgnoreCase) && !typeName.Equals("MeshFilter", StringComparison.OrdinalIgnoreCase) && !typeName.Equals("MeshRenderer", StringComparison.OrdinalIgnoreCase) && !typeName.Equals("BoxCollider", StringComparison.OrdinalIgnoreCase) && !typeName.Equals("MeshCollider", StringComparison.OrdinalIgnoreCase) && !typeName.Equals("CapsuleCollider", StringComparison.OrdinalIgnoreCase) && !typeName.Equals("SphereCollider", StringComparison.OrdinalIgnoreCase)) { return typeName.Equals("Rigidbody", StringComparison.OrdinalIgnoreCase); } return true; } private static bool EmpressHasAnyTerm(string scan, params string[] terms) { for (int i = 0; i < terms.Length; i++) { if (EmpressHasTerm(scan, terms[i])) { return true; } } return false; } private static bool EmpressHasTerm(string scan, string term) { if (string.IsNullOrWhiteSpace(scan) || string.IsNullOrWhiteSpace(term)) { return false; } return scan.IndexOf(EmpressNormalizeScan(term), StringComparison.Ordinal) >= 0; } private static EmpressDateCastSlot[] EmpressDefinitions() { return new EmpressDateCastSlot[84] { EmpressSlot("player_self", "Your Reflection", "Player", "player", "The one person in the building who keeps choosing chaos with both hands."), EmpressSlot("extractor", "The Extractor", "Extractor", "extractor", "{name} knows exactly what you are worth and still asks for more."), EmpressSlot("cart", "The Cart", "Cart", "cart", "{name} carries everyone's baggage, including yours, and has opinions about it."), EmpressSlot("truck_door", "The Truck Door", "Door", "door", "{name} has seen every escape attempt and every embarrassing sprint back inside."), EmpressSlot("wall", "The Wall", "Wall", "world", "{name} has been listening through itself. That is rude, but intimate."), EmpressSlot("floor", "The Floor", "Floor", "world", "{name} knows every time you fell and has chosen not to laugh out loud."), EmpressSlot("ceiling", "The Ceiling", "Ceiling", "world", "{name} stares down with the patience of something that has watched worse dates."), EmpressSlot("valuable_fragile", "The Fragile Treasure", "Valuable", "valuable", "{name} believes love is handling someone like they could break."), EmpressSlot("valuable_heavy", "The Heavy Treasure", "Valuable", "valuable", "{name} refuses to be moved unless the feelings are serious."), EmpressSlot("valuable_art", "The Gallery Piece", "Valuable", "valuable", "{name} has been admired before, but not like this and not in a panic."), EmpressSlot("valuable_gold", "The Golden Problem", "Valuable", "valuable", "{name} knows desire and resale value are cousins."), EmpressSlot("valuable_tech", "The Electric Muse", "Valuable", "valuable", "{name} hums like it is thinking about you between sparks."), EmpressSlot("valuable_cursed", "The Cursed Heirloom", "Valuable", "valuable", "{name} has previous owners and unresolved endings."), EmpressSlot("valuable_tiny", "The Tiny Prize", "Valuable", "valuable", "{name} insists small things can still ruin your whole week."), EmpressSlot("valuable_mirror", "The Mirror", "Valuable", "valuable", "{name} reflects the part of you that thought dating loot was normal."), EmpressSlot("valuable_generic", "The Valuable", "Valuable", "valuable", "{name} understands being wanted for what it can give."), EmpressSlot("enemy_hunter", "The Hunter", "Enemy", "enemy", "{name} calls pursuit romance and honestly that explains a lot."), EmpressSlot("enemy_duck", "The Duck", "Enemy", "enemy", "{name} has comedic timing and emotional blackmail in equal measure."), EmpressSlot("enemy_gnome", "The Gnome", "Enemy", "enemy", "{name} knows every small thing eventually becomes everyone's problem."), EmpressSlot("enemy_runner", "The Runner", "Enemy", "enemy", "{name} thinks commitment means chasing you through three rooms."), EmpressSlot("enemy_shadow", "The Shadow", "Enemy", "enemy", "{name} has never touched sunlight but knows exactly where you hide."), EmpressSlot("enemy_head", "The Head", "Enemy", "enemy", "{name} says it has standards. You are currently pending review."), EmpressSlot("enemy_bang", "The Bombshell", "Enemy", "enemy", "{name} believes every relationship should have a fuse."), EmpressSlot("enemy_floater", "The Floater", "Enemy", "enemy", "{name} drifts through danger like it forgot gravity was invited."), EmpressSlot("enemy_tick", "The Tick", "Enemy", "enemy", "{name} is clingy in the least metaphorical way possible."), EmpressSlot("enemy_slow", "The Slow Mouth", "Enemy", "enemy", "{name} takes its time because dread is a love language."), EmpressSlot("enemy_robe", "The Robe", "Enemy", "enemy", "{name} dresses like a prophecy and flirts like a warning label."), EmpressSlot("enemy_generic", "The Threat", "Enemy", "enemy", "{name} wants you alive enough to keep making terrible choices."), EmpressSlot("item_gun", "The Gun", "Item", "item", "{name} thinks romance should be direct, loud, and questionably safe."), EmpressSlot("item_grenade", "The Grenade", "Item", "item", "{name} promises one unforgettable evening and no refunds."), EmpressSlot("item_mine", "The Mine", "Item", "item", "{name} is patient, sensitive, and bad with surprises."), EmpressSlot("item_drone", "The Drone", "Item", "item", "{name} likes hovering nearby and pretending that is not attachment."), EmpressSlot("item_orb", "The Orb", "Item", "item", "{name} contains mysteries, battery issues, and one very bright boundary."), EmpressSlot("item_heal", "The Medkit", "Item", "item", "{name} wants to fix you, which is romantic until it becomes a pattern."), EmpressSlot("item_melee", "The Baton", "Item", "item", "{name} believes in physical affection and blunt conflict resolution."), EmpressSlot("item_ladder", "The Ladder", "Item", "item", "{name} is supportive, upwardly mobile, and tired of being stepped on."), EmpressSlot("item_upgrade", "The Upgrade", "Item", "item", "{name} asks who you could become if somebody loved you correctly."), EmpressSlot("item_duck", "The Rubber Duck", "Item", "item", "{name} squeaks in a way that makes silence feel jealous."), EmpressSlot("item_cart_laser", "The Cart Laser", "Item", "item", "{name} wants to protect the cart and maybe your stupid heart."), EmpressSlot("item_generic", "The Item", "Item", "item", "{name} has utility, baggage, and one eyebrow raised at your life choices."), EmpressSlot("object_lamp", "The Lamp", "Object", "object", "{name} has been lighting the room and waiting for someone to notice."), EmpressSlot("object_screen", "The Screen", "Object", "object", "{name} knows what you look like when you think nobody is watching."), EmpressSlot("object_table", "The Table", "Object", "object", "{name} wants stability but keeps meeting people who throw furniture."), EmpressSlot("object_chair", "The Chair", "Object", "object", "{name} is emotionally available and ergonomically complicated."), EmpressSlot("object_box", "The Box", "Object", "object", "{name} has secrets because being empty is too obvious."), EmpressSlot("object_barrel", "The Barrel", "Object", "object", "{name} rolls with your nonsense and resents the pun."), EmpressSlot("object_shelf", "The Shelf", "Object", "object", "{name} is tired of holding everyone else's precious little issues."), EmpressSlot("object_crate", "The Crate", "Object", "object", "{name} is wooden, closed off, and weirdly invested in your arc."), EmpressSlot("object_pipe", "The Pipe", "Object", "object", "{name} carries pressure gracefully, which is more than anyone can say for you."), EmpressSlot("object_button", "The Button", "Object", "object", "{name} begs to be pressed and then acts surprised about consequences."), EmpressSlot("object_terminal", "The Terminal", "Object", "object", "{name} speaks in systems because feelings need an interface."), EmpressSlot("object_generic", "The Thing", "Object", "object", "{name} is not sure what it is, but it is sure you are flirting."), EmpressSlot("shop_counter", "The Shop Counter", "Shop", "object", "{name} has watched you confuse money with emotional growth."), EmpressSlot("truck", "The Truck", "Truck", "object", "{name} is the closest thing this job has to home and it knows that scares you."), EmpressSlot("haul_goal", "The Quota", "System", "object", "{name} measures love in numbers and finds you statistically dramatic."), EmpressSlot("exit_sign", "The Exit Sign", "Object", "object", "{name} keeps showing you the way out and you keep dating the building."), EmpressSlot("room_volume", "The Room", "Room", "world", "{name} remembers who entered, who screamed, and who pretended not to."), EmpressSlot("camera", "The Camera", "Object", "object", "{name} sees your angles and still wants the raw footage."), EmpressSlot("flashlight", "The Flashlight", "Item", "item", "{name} knows you only reach for it when things get dark."), EmpressSlot("map", "The Map", "Item", "item", "{name} has directions, but not for whatever this relationship is."), EmpressSlot("ceiling_eye", "The Ceiling Eye", "Enemy", "enemy", "{name} has watched your whole route and edited nothing out."), EmpressSlot("doorway", "The Doorway", "Door", "door", "{name} lives between staying and leaving, which makes it insufferably dateable."), EmpressSlot("hallway", "The Hallway", "Object", "world", "{name} says every relationship is just a corridor with worse lighting."), EmpressSlot("enemy_beamer", "The Beamer", "Enemy", "enemy", "{name} paints your survival chances in bright lines and still makes eye contact about it."), EmpressSlot("object_mannequin", "The Mannequin", "Object", "object", "{name} learned stillness from people who were afraid to be seen."), EmpressSlot("object_painting", "The Painting", "Object", "object", "{name} has watched beauty become inventory and hates how familiar that feels."), EmpressSlot("object_clock", "The Clock", "Object", "object", "{name} counts the seconds between your promises and your panic."), EmpressSlot("object_bed", "The Bed", "Object", "object", "{name} knows rest is the most intimate thing you keep refusing."), EmpressSlot("object_locker", "The Locker", "Object", "object", "{name} keeps secrets because everyone keeps stuffing things inside it and walking away."), EmpressSlot("object_machine", "The Machine", "Object", "object", "{name} was built for function and somehow developed a soft spot for malfunction."), EmpressSlot("object_vending", "The Vending Machine", "Object", "object", "{name} understands hunger, selection, and being shaken by people who want too much."), EmpressSlot("object_sign", "The Sign", "Object", "object", "{name} has been trying to warn you, but you keep reading affection into danger."), EmpressSlot("object_window", "The Window", "Object", "object", "{name} offers escape as a concept and reflection as a threat."), EmpressSlot("enemy_birthday", "The Birthday Boy", "Enemy", "enemy", "{name} turns every bad hallway into a party you were not emotionally dressed for."), EmpressSlot("enemy_bowtie", "The Bowtie", "Enemy", "enemy", "{name} looks formal while making your whole run less stable."), EmpressSlot("enemy_elsa", "The Elsa", "Enemy", "enemy", "{name} freezes the mood so hard even your excuses crack."), EmpressSlot("enemy_heart_hugger", "The Heart Hugger", "Enemy", "enemy", "{name} thinks closeness should be mandatory and frankly that is the problem."), EmpressSlot("enemy_hidden", "The Hidden", "Enemy", "enemy", "{name} disappears until it wants your full attention all at once."), EmpressSlot("enemy_oogly", "The Oogly", "Enemy", "enemy", "{name} looks like a bad idea that learned to walk toward you."), EmpressSlot("enemy_spinny", "The Spinny", "Enemy", "enemy", "{name} turns panic into choreography and expects you to keep up."), EmpressSlot("enemy_thin_man", "The Thin Man", "Enemy", "enemy", "{name} is all reach, no comfort, and somehow still very intense about you."), EmpressSlot("enemy_tricycle", "The Tricycle", "Enemy", "enemy", "{name} brings childhood energy to a deeply adult disaster."), EmpressSlot("enemy_tumbler", "The Tumbler", "Enemy", "enemy", "{name} meets every obstacle by becoming momentum on purpose."), EmpressSlot("enemy_upscream", "The Upscream", "Enemy", "enemy", "{name} rises into the room like the punchline to a curse.") }; } private static EmpressDateCastSlot EmpressSlot(string key, string name, string category, string group, string lore) { return new EmpressDateCastSlot { Key = key, Name = name, Category = category, Group = group, Lore = lore }; } } internal sealed class EmpressDateAudio { private readonly AudioClip?[] _clips = (AudioClip?[])(object)new AudioClip[2]; private readonly Dictionary _musicClips = new Dictionary(); private readonly HashSet _loadingMusic = new HashSet(); private AudioClip? _rewardPositiveClip; private AudioClip? _rewardNegativeClip; private AudioSource? _source; private AudioSource? _musicSource; private MonoBehaviour _host; private EmpressDateEverythingPlugin _plugin; private bool _loadingStarted; private bool _loaded; private string _currentMusicTrack = ""; private string _pendingMusicTrack = ""; private float _nextTypingBlipAt; internal void EmpressInitialize(MonoBehaviour host, EmpressDateEverythingPlugin plugin) { _host = host; _plugin = plugin; if ((Object)(object)_source == (Object)null) { _source = ((Component)host).gameObject.AddComponent(); _source.playOnAwake = false; _source.loop = false; _source.spatialBlend = 0f; _source.volume = Mathf.Clamp01(_plugin.TypingSoundVolume.Value / 100f); } EmpressEnsureMusicSource(host); EmpressEnsureCueClips(); if (!_loadingStarted) { _loadingStarted = true; host.StartCoroutine(EmpressLoadRoutine()); } } internal void EmpressPlayCharacter(int alternator) { if (_plugin.TextSoundsEnabled.Value && _loaded && !((Object)(object)_source == (Object)null)) { AudioClip val = _clips[Mathf.Abs(alternator) % _clips.Length]; if (!((Object)(object)val == (Object)null) && !(Time.unscaledTime < _nextTypingBlipAt)) { _nextTypingBlipAt = Time.unscaledTime + 0.045f; _source.volume = Mathf.Clamp01(_plugin.TypingSoundVolume.Value / 100f); _source.PlayOneShot(val, 0.55f); } } } internal void EmpressStopTypingSound() { _nextTypingBlipAt = 0f; if ((Object)(object)_source != (Object)null) { _source.Stop(); } } internal void EmpressPlayRewardCue(bool positive) { if (!((Object)(object)_source == (Object)null)) { AudioClip val = (positive ? _rewardPositiveClip : _rewardNegativeClip); if (!((Object)(object)val == (Object)null)) { _source.volume = Mathf.Clamp01(_plugin.TypingSoundVolume.Value / 100f); _source.PlayOneShot(val, 0.75f); } } } internal void EmpressPlayCharacterMusic(EmpressDateCastSlot slot) { if (slot == null || _plugin.CharacterMusicVolume.Value <= 0.01f) { EmpressStopCharacterMusic(); return; } string text = EmpressMusicTrackFor(slot.Key); if (string.IsNullOrWhiteSpace(text)) { EmpressStopCharacterMusic(); return; } EmpressEnsureMusicSource(_host); if ((Object)(object)_musicSource == (Object)null) { return; } _musicSource.volume = Mathf.Clamp01(_plugin.CharacterMusicVolume.Value / 100f); if (_currentMusicTrack == text && _musicSource.isPlaying) { return; } _pendingMusicTrack = text; if (_musicClips.TryGetValue(text, out AudioClip value) && (Object)(object)value != (Object)null) { EmpressStartMusic(text, value); return; } _musicSource.Stop(); _currentMusicTrack = ""; if (_loadingMusic.Add(text) && (Object)(object)_host != (Object)null) { _host.StartCoroutine(EmpressLoadMusicRoutine(text)); } } internal void EmpressStopCharacterMusic() { _pendingMusicTrack = ""; _currentMusicTrack = ""; if ((Object)(object)_musicSource != (Object)null) { _musicSource.Stop(); _musicSource.clip = null; } } private IEnumerator EmpressLoadRoutine() { string pluginDirectory = Path.GetDirectoryName(typeof(EmpressDateEverythingPlugin).Assembly.Location) ?? Paths.PluginPath; string cacheDirectory = Path.Combine(Paths.CachePath, "EmpressDateEverything"); Directory.CreateDirectory(cacheDirectory); yield return EmpressLoadClip(pluginDirectory, cacheDirectory, "EmpressTalk1.xorbin", "EmpressTalk1.mp3", 0); yield return EmpressLoadClip(pluginDirectory, cacheDirectory, "EmpressTalk2.xorbin", "EmpressTalk2.mp3", 1); _loaded = (Object)(object)_clips[0] != (Object)null || (Object)(object)_clips[1] != (Object)null; if (_loaded) { EmpressDateEverythingPlugin.EmpressLog("typing sounds ready"); } } private IEnumerator EmpressLoadClip(string pluginDirectory, string cacheDirectory, string xorName, string outputName, int index) { string path = Path.Combine(pluginDirectory, "Assets", xorName); if (!File.Exists(path)) { yield break; } string text = Path.Combine(cacheDirectory, outputName); try { byte[] array = File.ReadAllBytes(path); for (int i = 0; i < array.Length; i++) { array[i] ^= 90; } File.WriteAllBytes(text, array); } catch { yield break; } UnityWebRequest request = UnityWebRequestMultimedia.GetAudioClip(new Uri(text).AbsoluteUri, (AudioType)13); try { yield return request.SendWebRequest(); if ((int)request.result != 1) { EmpressDateEverythingPlugin.EmpressWarning("typing sound load failed: " + xorName); yield break; } AudioClip content = DownloadHandlerAudioClip.GetContent(request); if (!((Object)(object)content == (Object)null)) { ((Object)content).name = Path.GetFileNameWithoutExtension(outputName); _clips[index] = content; } } finally { ((IDisposable)request)?.Dispose(); } } private IEnumerator EmpressLoadMusicRoutine(string track) { string? path = Path.GetDirectoryName(typeof(EmpressDateEverythingPlugin).Assembly.Location) ?? Paths.PluginPath; string text = Path.Combine(Paths.CachePath, "EmpressDateEverything", "CharacterMusic"); Directory.CreateDirectory(text); string path2 = Path.Combine(path, "Assets", "CharacterMusic", track + ".xorbin"); if (!File.Exists(path2)) { EmpressDateEverythingPlugin.EmpressWarning("character music missing: " + track); _loadingMusic.Remove(track); yield break; } string text2 = Path.Combine(text, track + ".mp3"); try { byte[] array = File.ReadAllBytes(path2); for (int i = 0; i < array.Length; i++) { array[i] ^= 90; } File.WriteAllBytes(text2, array); } catch { _loadingMusic.Remove(track); yield break; } UnityWebRequest request = UnityWebRequestMultimedia.GetAudioClip(new Uri(text2).AbsoluteUri, (AudioType)13); try { yield return request.SendWebRequest(); _loadingMusic.Remove(track); if ((int)request.result != 1) { EmpressDateEverythingPlugin.EmpressWarning("character music load failed: " + track); yield break; } AudioClip content = DownloadHandlerAudioClip.GetContent(request); if (!((Object)(object)content == (Object)null)) { ((Object)content).name = track; _musicClips[track] = content; if (_pendingMusicTrack == track) { EmpressStartMusic(track, content); } } } finally { ((IDisposable)request)?.Dispose(); } } private void EmpressStartMusic(string track, AudioClip clip) { EmpressEnsureMusicSource(_host); if (!((Object)(object)_musicSource == (Object)null)) { _currentMusicTrack = track; _musicSource.clip = clip; _musicSource.loop = true; _musicSource.volume = Mathf.Clamp01(_plugin.CharacterMusicVolume.Value / 100f); _musicSource.Play(); } } private void EmpressEnsureMusicSource(MonoBehaviour host) { if (!((Object)(object)_musicSource != (Object)null) && !((Object)(object)host == (Object)null)) { _musicSource = ((Component)host).gameObject.AddComponent(); _musicSource.playOnAwake = false; _musicSource.loop = true; _musicSource.spatialBlend = 0f; _musicSource.volume = Mathf.Clamp01(_plugin.CharacterMusicVolume.Value / 100f); } } private static string EmpressMusicTrackFor(string castKey) { switch (castKey) { case "player_self": return "cm_player"; case "extractor": return "cm_extractor"; case "cart": return "cm_cart"; case "truck_door": case "doorway": return "cm_door"; case "wall": case "hallway": return "cm_wall"; case "room_volume": case "floor": return "cm_floor"; case "ceiling_eye": case "ceiling": return "cm_ceiling"; case "valuable_fragile": return "cm_valuable_fragile"; case "valuable_heavy": return "cm_valuable_heavy"; case "valuable_art": return "cm_valuable_art"; case "valuable_gold": return "cm_valuable_gold"; case "valuable_tech": return "cm_valuable_tech"; case "valuable_cursed": return "cm_valuable_cursed"; case "valuable_tiny": return "cm_valuable_tiny"; case "valuable_mirror": return "cm_valuable_mirror"; case "valuable_generic": return "cm_valuable_generic"; case "enemy_hunter": return "cm_enemy_hunter"; case "enemy_duck": return "cm_enemy_duck"; case "enemy_gnome": return "cm_enemy_gnome"; case "enemy_runner": return "cm_enemy_runner"; case "enemy_shadow": return "cm_enemy_shadow"; case "enemy_head": return "cm_enemy_head"; case "enemy_bang": return "cm_enemy_bang"; case "enemy_floater": return "cm_enemy_floater"; case "enemy_tick": return "cm_enemy_tick"; case "enemy_slow": return "cm_enemy_slow"; case "enemy_robe": return "cm_enemy_robe"; case "enemy_oogly": case "enemy_elsa": case "enemy_birthday": case "enemy_thin_man": case "enemy_tricycle": case "enemy_upscream": case "enemy_beamer": case "enemy_bowtie": case "enemy_hidden": case "enemy_spinny": case "enemy_tumbler": case "enemy_generic": case "enemy_heart_hugger": return "cm_enemy_generic"; case "item_gun": return "cm_item_gun"; case "item_grenade": return "cm_item_grenade"; case "item_mine": return "cm_item_mine"; case "item_drone": return "cm_item_drone"; case "item_orb": return "cm_item_orb"; case "item_heal": return "cm_item_heal"; case "item_melee": return "cm_item_melee"; case "item_ladder": return "cm_item_ladder"; case "item_upgrade": return "cm_item_upgrade"; case "item_duck": return "cm_item_duck"; case "item_cart_laser": return "cm_item_cart_laser"; case "item_generic": return "cm_item_generic"; case "object_lamp": case "flashlight": return "cm_object_lamp"; case "object_monitor": case "object_screen": case "object_terminal": return "cm_object_screen"; case "object_table": return "cm_object_table"; case "object_chair": return "cm_object_chair"; case "object_box": case "object_crate": return "cm_object_box"; case "object_barrel": return "cm_object_barrel"; case "object_shelf": case "object_pallet": return "cm_object_shelf"; case "object_pipe": return "cm_object_pipe"; case "object_button": case "object_switch": return "cm_object_button"; case "mystery": case "object_generic": return "cm_object_generic"; case "haul_goal": case "shop_counter": return "cm_shop"; case "truck": return "cm_truck"; case "object_sign": case "exit_sign": return "cm_exit_sign"; case "camera": return "cm_camera"; case "map": return "cm_map"; case "object_mannequin": return "cm_mannequin"; case "object_painting": return "cm_painting"; case "object_clock": return "cm_clock"; case "object_bed": case "object_plush": return "cm_soft"; case "object_safe": case "object_locker": return "cm_safe"; case "object_machine": case "object_vending": return "cm_machine"; case "object_window": return "cm_window"; case "object_rope": return "cm_rope"; case "object_bucket": return "cm_bucket"; case "object_keyboard": return "cm_keyboard"; case "object_altar": return "cm_altar"; case "object_radio": return "cm_radio"; case "object_fan": return "cm_fan"; default: return "cm_object_generic"; } } private void EmpressEnsureCueClips() { if ((Object)(object)_rewardPositiveClip == (Object)null) { _rewardPositiveClip = EmpressCreateCueClip("EmpressRewardPositive", 720f, 1040f, 0.16f, 0.18f); } if ((Object)(object)_rewardNegativeClip == (Object)null) { _rewardNegativeClip = EmpressCreateCueClip("EmpressRewardNegative", 420f, 260f, 0.18f, 0.16f); } } private static AudioClip EmpressCreateCueClip(string name, float startFrequency, float endFrequency, float lengthSeconds, float amplitude) { int num = 44100; int num2 = Mathf.Max(1, Mathf.RoundToInt(lengthSeconds * (float)num)); float[] array = new float[num2]; float num3 = 0f; for (int i = 0; i < num2; i++) { float num4 = (float)i / (float)(num2 - 1); float num5 = Mathf.Lerp(startFrequency, endFrequency, num4); num3 += MathF.PI * 2f * num5 / (float)num; float num6 = Mathf.Sin(Mathf.Clamp01(num4) * MathF.PI); array[i] = Mathf.Sin(num3) * num6 * amplitude; } AudioClip obj = AudioClip.Create(name, num2, 1, num, false); obj.SetData(array, 0); return obj; } } internal static class EmpressDateEverythingAccess { private delegate bool EmpressBoolStaticDelegate(); private delegate PlayerAvatar EmpressPlayerAvatarStaticDelegate(); private delegate string EmpressPlayerNameDelegate(PlayerAvatar player); private delegate string EmpressPlayerSteamIdDelegate(PlayerAvatar player); private delegate int EmpressStatGetDelegate(); private delegate int EmpressStatSetDelegate(int value); private delegate void EmpressVoidStaticDelegate(); private delegate void EmpressEnemyInvestigateDelegate(Vector3 position, float range, bool pathfindOnly); private delegate void EmpressPlayerHealDelegate(PlayerHealth instance, int amount, bool effect); private delegate void EmpressPlayerEffectDelegate(PlayerHealth instance, Effect effect); private delegate void EmpressPlayerEyeDelegate(PlayerHealth instance, EyeOverrideState state, float time, int priority); private delegate void EmpressPhysFloatTimeDelegate(PhysGrabObject instance, float value, float time); private delegate void EmpressPhysFloatDelegate(PhysGrabObject instance, float time); private delegate int EmpressUpgradeDelegate(PunManager instance, string steamId, int value); private delegate void EmpressEnemyFloatDelegate(Enemy instance, float time); private static readonly FieldRef? EmpressGameManagerInstance = EmpressStaticRef(typeof(GameManager), "instance"); private static readonly FieldRef? EmpressGameDirectorInstance = EmpressStaticRef(typeof(GameDirector), "instance"); private static readonly FieldRef? EmpressShopManagerInstance = EmpressStaticRef(typeof(ShopManager), "instance"); private static readonly FieldRef? EmpressPhysGrabberInstance = EmpressStaticRef(typeof(PhysGrabber), "instance"); private static readonly FieldRef? EmpressPunManagerInstance = EmpressStaticRef(typeof(PunManager), "instance"); private static readonly FieldRef? EmpressPlayerAvatarInstance = EmpressStaticRef(typeof(PlayerAvatar), "instance"); private static readonly FieldRef? EmpressPlayerName = EmpressInstanceRef("playerName"); private static readonly FieldRef? EmpressAvatarPlayerHealth = EmpressInstanceRef("playerHealth"); private static readonly FieldRef>? EmpressDirectorPlayers = EmpressInstanceRef>("PlayerList"); private static readonly FieldRef>? EmpressShopShoppingList = EmpressInstanceRef>("shoppingList"); private static readonly FieldRef? EmpressHealthCurrent = EmpressInstanceRef("health"); private static readonly FieldRef? EmpressHealthMax = EmpressInstanceRef("maxHealth"); private static readonly FieldRef? EmpressGrabberHeldObject = EmpressInstanceRef("grabbedPhysGrabObject"); private static readonly FieldRef? EmpressPhysRigidbody = EmpressInstanceRef("rb"); private static readonly FieldRef? EmpressPhysDead = EmpressInstanceRef("dead"); private static readonly FieldRef? EmpressValuableOriginal = EmpressInstanceRef("dollarValueOriginal"); private static readonly FieldRef? EmpressValuableCurrent = EmpressInstanceRef("dollarValueCurrent"); private static readonly FieldRef? EmpressValuableOverride = EmpressInstanceRef("dollarValueOverride"); private static readonly FieldRef? EmpressValuableSet = EmpressInstanceRef("dollarValueSet"); private static readonly FieldRef? EmpressValuablePhysGrab = EmpressInstanceRef("physGrabObject"); private static readonly FieldRef? EmpressItemValue = EmpressInstanceRef("value"); private static readonly FieldRef? EmpressItemShopItem = EmpressInstanceRef("shopItem"); private static readonly FieldRef? EmpressItemName = EmpressInstanceRef("itemName"); private static readonly FieldRef? EmpressItemAssetName = EmpressInstanceRef("itemAssetName"); private static readonly FieldRef? EmpressMenuCursorMesh = EmpressInstanceRef("mesh"); private static readonly FieldRef? EmpressMenuCursorShowTimer = EmpressInstanceRef("showTimer"); private static readonly FieldRef? EmpressMenuCursorOverridePosTimer = EmpressInstanceRef("overridePosTimer"); private static readonly FieldRef? EmpressCursorUnlockTimer = EmpressInstanceRef("unlockTimer"); private static readonly EmpressBoolStaticDelegate? EmpressGameMultiplayer = EmpressStaticMethod(typeof(GameManager), "Multiplayer"); private static readonly EmpressBoolStaticDelegate? EmpressRunIsShop = EmpressStaticMethod(typeof(SemiFunc), "RunIsShop"); private static readonly EmpressPlayerAvatarStaticDelegate? EmpressPlayerAvatarLocal = EmpressStaticMethod(typeof(SemiFunc), "PlayerAvatarLocal"); private static readonly EmpressPlayerSteamIdDelegate? EmpressPlayerSteamId = EmpressStaticMethod(typeof(SemiFunc), "PlayerGetSteamID", new Type[1] { typeof(PlayerAvatar) }); private static readonly EmpressStatGetDelegate? EmpressGetRunCurrency = EmpressStaticMethod(typeof(SemiFunc), "StatGetRunCurrency"); private static readonly EmpressStatSetDelegate? EmpressSetRunCurrency = EmpressStaticMethod(typeof(SemiFunc), "StatSetRunCurrency", new Type[1] { typeof(int) }); private static readonly EmpressVoidStaticDelegate? EmpressShopUpdateCost = EmpressStaticMethod(typeof(SemiFunc), "ShopUpdateCost"); private static readonly EmpressEnemyInvestigateDelegate? EmpressEnemyInvestigate = EmpressStaticMethod(typeof(SemiFunc), "EnemyInvestigate", new Type[3] { typeof(Vector3), typeof(float), typeof(bool) }); private static readonly EmpressPlayerHealDelegate? EmpressHealOther = EmpressInstanceMethod(typeof(PlayerHealth), "HealOther", new Type[2] { typeof(int), typeof(bool) }); private static readonly EmpressPlayerEffectDelegate? EmpressMaterialEffect = EmpressInstanceMethod(typeof(PlayerHealth), "MaterialEffectOverride", new Type[1] { typeof(Effect) }); private static readonly EmpressPlayerEyeDelegate? EmpressEyeMaterial = EmpressInstanceMethod(typeof(PlayerHealth), "EyeMaterialOverride", new Type[3] { typeof(EyeOverrideState), typeof(float), typeof(int) }); private static readonly EmpressPhysFloatTimeDelegate? EmpressOverrideMass = EmpressInstanceMethod(typeof(PhysGrabObject), "OverrideMass", new Type[2] { typeof(float), typeof(float) }); private static readonly EmpressPhysFloatTimeDelegate? EmpressOverrideDrag = EmpressInstanceMethod(typeof(PhysGrabObject), "OverrideDrag", new Type[2] { typeof(float), typeof(float) }); private static readonly EmpressPhysFloatTimeDelegate? EmpressOverrideAngularDrag = EmpressInstanceMethod(typeof(PhysGrabObject), "OverrideAngularDrag", new Type[2] { typeof(float), typeof(float) }); private static readonly EmpressPhysFloatDelegate? EmpressOverrideZeroGravity = EmpressInstanceMethod(typeof(PhysGrabObject), "OverrideZeroGravity", new Type[1] { typeof(float) }); private static readonly EmpressPhysFloatDelegate? EmpressOverrideIndestructible = EmpressInstanceMethod(typeof(PhysGrabObject), "OverrideIndestructible", new Type[1] { typeof(float) }); private static readonly EmpressUpgradeDelegate? EmpressUpgradeHealth = EmpressInstanceMethod(typeof(PunManager), "UpgradePlayerHealth", new Type[2] { typeof(string), typeof(int) }); private static readonly EmpressUpgradeDelegate? EmpressUpgradeEnergy = EmpressInstanceMethod(typeof(PunManager), "UpgradePlayerEnergy", new Type[2] { typeof(string), typeof(int) }); private static readonly EmpressUpgradeDelegate? EmpressUpgradeExtraJump = EmpressInstanceMethod(typeof(PunManager), "UpgradePlayerExtraJump", new Type[2] { typeof(string), typeof(int) }); private static readonly EmpressUpgradeDelegate? EmpressUpgradeLaunch = EmpressInstanceMethod(typeof(PunManager), "UpgradePlayerTumbleLaunch", new Type[2] { typeof(string), typeof(int) }); private static readonly EmpressUpgradeDelegate? EmpressUpgradeClimb = EmpressInstanceMethod(typeof(PunManager), "UpgradePlayerTumbleClimb", new Type[2] { typeof(string), typeof(int) }); private static readonly EmpressUpgradeDelegate? EmpressUpgradeWings = EmpressInstanceMethod(typeof(PunManager), "UpgradePlayerTumbleWings", new Type[2] { typeof(string), typeof(int) }); private static readonly EmpressUpgradeDelegate? EmpressUpgradeSpeed = EmpressInstanceMethod(typeof(PunManager), "UpgradePlayerSprintSpeed", new Type[2] { typeof(string), typeof(int) }); private static readonly EmpressUpgradeDelegate? EmpressUpgradeCrouchRest = EmpressInstanceMethod(typeof(PunManager), "UpgradePlayerCrouchRest", new Type[2] { typeof(string), typeof(int) }); private static readonly EmpressUpgradeDelegate? EmpressUpgradeStrength = EmpressInstanceMethod(typeof(PunManager), "UpgradePlayerGrabStrength", new Type[2] { typeof(string), typeof(int) }); private static readonly EmpressUpgradeDelegate? EmpressUpgradeThrow = EmpressInstanceMethod(typeof(PunManager), "UpgradePlayerThrowStrength", new Type[2] { typeof(string), typeof(int) }); private static readonly EmpressUpgradeDelegate? EmpressUpgradeRange = EmpressInstanceMethod(typeof(PunManager), "UpgradePlayerGrabRange", new Type[2] { typeof(string), typeof(int) }); private static readonly EmpressEnemyFloatDelegate? EmpressEnemyFreeze = EmpressInstanceMethod(typeof(Enemy), "Freeze", new Type[1] { typeof(float) }); private static readonly EmpressEnemyFloatDelegate? EmpressEnemyDisableChase = EmpressInstanceMethod(typeof(Enemy), "DisableChase", new Type[1] { typeof(float) }); private static readonly EmpressBoolStaticDelegate? EmpressPhotonInRoom = EmpressStaticGetter(typeof(PhotonNetwork), "InRoom"); private static readonly EmpressBoolStaticDelegate? EmpressPhotonIsConnected = EmpressStaticGetter(typeof(PhotonNetwork), "IsConnected"); private static readonly EmpressBoolStaticDelegate? EmpressPhotonOfflineMode = EmpressStaticGetter(typeof(PhotonNetwork), "OfflineMode"); internal static ShopManager ShopManagerInstance => EmpressGetStatic(EmpressShopManagerInstance); internal static bool IsOfflineSingleplayer() { try { if (EmpressGameMultiplayer != null && EmpressGameMultiplayer()) { return false; } if (EmpressPhotonOfflineMode == null || !EmpressPhotonOfflineMode()) { bool num = EmpressPhotonInRoom != null && EmpressPhotonInRoom(); bool flag = EmpressPhotonIsConnected != null && EmpressPhotonIsConnected(); if (num || flag) { return false; } } GameDirector val = EmpressGetStatic(EmpressGameDirectorInstance); List list = (((Object)(object)val != (Object)null) ? EmpressGet>(val, EmpressDirectorPlayers) : null); return list == null || list.Count <= 1; } catch { return true; } } internal static PlayerAvatar LocalPlayer() { try { PlayerAvatar val = ((EmpressPlayerAvatarLocal != null) ? EmpressPlayerAvatarLocal() : null); if ((Object)(object)val != (Object)null) { return val; } } catch { } try { return (EmpressPlayerAvatarInstance != null) ? EmpressPlayerAvatarInstance.Invoke((object)null) : null; } catch { return null; } } internal static bool RunIsShop() { try { return EmpressRunIsShop != null && EmpressRunIsShop(); } catch { return false; } } internal static string PlayerName(PlayerAvatar player) { try { return ((Object)(object)player != (Object)null && EmpressPlayerName != null) ? EmpressPlayerName.Invoke(player) : ""; } catch { return ""; } } internal static PlayerHealth GetPlayerHealth(PlayerAvatar player) { if (!((Object)(object)player != (Object)null)) { return null; } return EmpressGet(player, EmpressAvatarPlayerHealth); } internal static int GetHealth(PlayerHealth playerHealth) { if (!((Object)(object)playerHealth != (Object)null)) { return 0; } return EmpressGet(playerHealth, EmpressHealthCurrent); } internal static int GetMaxHealth(PlayerHealth playerHealth) { if (!((Object)(object)playerHealth != (Object)null)) { return 100; } return EmpressGet(playerHealth, EmpressHealthMax); } internal static void HealPlayer(PlayerAvatar player, int amount, bool effect) { try { PlayerHealth playerHealth = GetPlayerHealth(player); if ((Object)(object)playerHealth != (Object)null && amount > 0) { EmpressHealOther?.Invoke(playerHealth, amount, effect); } } catch { } } internal static void ApplyLoveEyes(PlayerAvatar player, float time, int priority = 8) { try { PlayerHealth playerHealth = GetPlayerHealth(player); if ((Object)(object)playerHealth != (Object)null) { EmpressEyeMaterial?.Invoke(playerHealth, (EyeOverrideState)3, time, priority); } } catch { } } internal static void ApplyUpgradeFlash(PlayerAvatar player) { try { PlayerHealth playerHealth = GetPlayerHealth(player); if ((Object)(object)playerHealth != (Object)null) { EmpressMaterialEffect?.Invoke(playerHealth, (Effect)0); } } catch { } } internal static int GetRunCurrency() { try { return (EmpressGetRunCurrency != null) ? EmpressGetRunCurrency() : 0; } catch { return 0; } } internal static void SetRunCurrency(int value) { try { EmpressSetRunCurrency?.Invoke(Mathf.Max(0, value)); } catch { } } internal static List GetShoppingList(ShopManager shopManager) { if (!((Object)(object)shopManager != (Object)null)) { return null; } return EmpressGet>(shopManager, EmpressShopShoppingList); } internal static void ShopUpdateCost() { try { EmpressShopUpdateCost?.Invoke(); } catch { } } internal static bool IsShopItem(ItemAttributes item) { if ((Object)(object)item != (Object)null) { return EmpressGet(item, EmpressItemShopItem); } return false; } internal static int GetItemValue(ItemAttributes item) { if (!((Object)(object)item != (Object)null)) { return 0; } return EmpressGet(item, EmpressItemValue); } internal static void SetItemValue(ItemAttributes item, int value) { if ((Object)(object)item != (Object)null) { EmpressSet(item, EmpressItemValue, Mathf.Max(0, value)); } } internal static string ItemName(ItemAttributes item) { try { return ((Object)(object)item != (Object)null && EmpressItemName != null) ? EmpressItemName.Invoke(item) : ""; } catch { return ""; } } internal static string ItemAssetName(ItemAttributes item) { try { return ((Object)(object)item != (Object)null && EmpressItemAssetName != null) ? EmpressItemAssetName.Invoke(item) : ""; } catch { return ""; } } internal static GameObject GetMenuCursorMesh(MenuCursor menuCursor) { if (!((Object)(object)menuCursor != (Object)null)) { return null; } return EmpressGet(menuCursor, EmpressMenuCursorMesh); } internal static void SetMenuCursorShowTimer(MenuCursor menuCursor, float value) { if ((Object)(object)menuCursor != (Object)null) { EmpressSet(menuCursor, EmpressMenuCursorShowTimer, value); } } internal static void SetMenuCursorOverridePosTimer(MenuCursor menuCursor, float value) { if ((Object)(object)menuCursor != (Object)null) { EmpressSet(menuCursor, EmpressMenuCursorOverridePosTimer, value); } } internal static void SetCursorUnlockTimer(CursorManager cursorManager, float value) { if ((Object)(object)cursorManager != (Object)null) { EmpressSet(cursorManager, EmpressCursorUnlockTimer, value); } } internal static PhysGrabObject GetHeldObject() { PhysGrabber val = EmpressGetStatic(EmpressPhysGrabberInstance); if (!((Object)(object)val != (Object)null)) { return null; } return EmpressGet(val, EmpressGrabberHeldObject); } internal static Rigidbody GetPhysRigidbody(PhysGrabObject physGrabObject) { Rigidbody val = (((Object)(object)physGrabObject != (Object)null) ? EmpressGet(physGrabObject, EmpressPhysRigidbody) : null); if (!((Object)(object)val != (Object)null)) { if (!((Object)(object)physGrabObject != (Object)null)) { return null; } return ((Component)physGrabObject).GetComponent(); } return val; } internal static bool IsPhysDead(PhysGrabObject physGrabObject) { if (!((Object)(object)physGrabObject == (Object)null)) { return EmpressGet(physGrabObject, EmpressPhysDead); } return true; } internal static void LightenObject(PhysGrabObject physGrabObject, float duration) { try { if (!((Object)(object)physGrabObject == (Object)null)) { EmpressOverrideMass?.Invoke(physGrabObject, 0.35f, duration); EmpressOverrideDrag?.Invoke(physGrabObject, 1.4f, duration); EmpressOverrideAngularDrag?.Invoke(physGrabObject, 1.2f, duration); EmpressOverrideZeroGravity?.Invoke(physGrabObject, Mathf.Min(6f, duration)); } } catch { } } internal static void BurdenObject(PhysGrabObject physGrabObject, float duration) { try { if (!((Object)(object)physGrabObject == (Object)null)) { EmpressOverrideMass?.Invoke(physGrabObject, 7.5f, duration); EmpressOverrideDrag?.Invoke(physGrabObject, 8f, duration); EmpressOverrideAngularDrag?.Invoke(physGrabObject, 6f, duration); } } catch { } } internal static void ProtectPhysObject(PhysGrabObject physGrabObject, float time) { try { if ((Object)(object)physGrabObject != (Object)null) { EmpressOverrideIndestructible?.Invoke(physGrabObject, Mathf.Max(0.1f, time)); } } catch { } } internal static void PrepareFollowerPhysics(PhysGrabObject physGrabObject) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) try { if (!((Object)(object)physGrabObject == (Object)null)) { ProtectPhysObject(physGrabObject, 9999f); LightenObject(physGrabObject, 9999f); Rigidbody physRigidbody = GetPhysRigidbody(physGrabObject); if ((Object)(object)physRigidbody != (Object)null) { physRigidbody.velocity = Vector3.zero; physRigidbody.angularVelocity = Vector3.zero; physRigidbody.useGravity = false; physRigidbody.detectCollisions = false; physRigidbody.isKinematic = true; } } } catch { } } internal static float GetValuableOriginalValue(ValuableObject valuable) { if (!((Object)(object)valuable != (Object)null)) { return 0f; } return EmpressGet(valuable, EmpressValuableOriginal); } internal static float GetValuableCurrentValue(ValuableObject valuable) { if (!((Object)(object)valuable != (Object)null)) { return 0f; } return EmpressGet(valuable, EmpressValuableCurrent); } internal static PhysGrabObject GetValuablePhysGrabObject(ValuableObject valuable) { if (!((Object)(object)valuable != (Object)null)) { return null; } return EmpressGet(valuable, EmpressValuablePhysGrab); } internal static void SetValuableDollarValues(ValuableObject valuable, float original, float current) { if (!((Object)(object)valuable == (Object)null)) { EmpressSet(valuable, EmpressValuableOriginal, original); EmpressSet(valuable, EmpressValuableCurrent, current); EmpressSet(valuable, EmpressValuableOverride, Mathf.RoundToInt(original)); EmpressSet(valuable, EmpressValuableSet, value: true); } } internal static bool TryGrantUpgrade(PlayerAvatar player, int preference) { string steamId = GetSteamId(player); PunManager val = EmpressGetStatic(EmpressPunManagerInstance); if (string.IsNullOrWhiteSpace(steamId) || (Object)(object)val == (Object)null) { return false; } EmpressUpgradeDelegate[] array = preference switch { 1 => new EmpressUpgradeDelegate[2] { EmpressUpgradeHealth, EmpressUpgradeEnergy }, 2 => new EmpressUpgradeDelegate[6] { EmpressUpgradeExtraJump, EmpressUpgradeLaunch, EmpressUpgradeClimb, EmpressUpgradeWings, EmpressUpgradeSpeed, EmpressUpgradeCrouchRest }, 3 => new EmpressUpgradeDelegate[3] { EmpressUpgradeStrength, EmpressUpgradeThrow, EmpressUpgradeRange }, _ => new EmpressUpgradeDelegate[11] { EmpressUpgradeHealth, EmpressUpgradeEnergy, EmpressUpgradeExtraJump, EmpressUpgradeLaunch, EmpressUpgradeClimb, EmpressUpgradeWings, EmpressUpgradeSpeed, EmpressUpgradeCrouchRest, EmpressUpgradeStrength, EmpressUpgradeThrow, EmpressUpgradeRange }, }; for (int i = 0; i < array.Length; i++) { EmpressUpgradeDelegate empressUpgradeDelegate = array[Random.Range(0, array.Length)]; if (empressUpgradeDelegate != null) { try { return empressUpgradeDelegate(val, steamId, 1) >= 0; } catch { } } } return false; } internal static void DistractEnemies(Vector3 position, float radius) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) try { EmpressEnemyInvestigate?.Invoke(position, radius, pathfindOnly: false); } catch { } } internal static void DisableEnemyChase(Enemy enemy, float time) { try { if ((Object)(object)enemy != (Object)null) { EmpressEnemyDisableChase?.Invoke(enemy, Mathf.Max(0.1f, time)); } } catch { } } internal static void FreezeEnemy(Enemy enemy, float time) { try { if ((Object)(object)enemy != (Object)null) { EmpressEnemyFreeze?.Invoke(enemy, Mathf.Max(0.1f, time)); } } catch { } } private static string GetSteamId(PlayerAvatar player) { try { return ((Object)(object)player != (Object)null && EmpressPlayerSteamId != null) ? (EmpressPlayerSteamId(player) ?? string.Empty) : string.Empty; } catch { return string.Empty; } } private static FieldRef? EmpressStaticRef(Type type, string name) where F : class { try { return AccessTools.FieldRefAccess(type, name); } catch (Exception ex) { EmpressDateEverythingPlugin.EmpressWarning("access wrapper failed for " + type.Name + "." + name + ": " + ex.GetType().Name); return null; } } private static FieldRef? EmpressInstanceRef(string name) where T : class { try { return AccessTools.FieldRefAccess(name); } catch (Exception ex) { EmpressDateEverythingPlugin.EmpressWarning("access wrapper failed for " + typeof(T).Name + "." + name + ": " + ex.GetType().Name); return null; } } private static TDelegate? EmpressStaticMethod(Type type, string name, Type[]? parameters = null) where TDelegate : Delegate { return EmpressMethod(AccessTools.Method(type, name, parameters, (Type[])null)); } private static TDelegate? EmpressStaticGetter(Type type, string name) where TDelegate : Delegate { return EmpressMethod(AccessTools.PropertyGetter(type, name)); } private static TDelegate? EmpressInstanceMethod(Type type, string name, Type[]? parameters = null) where TDelegate : Delegate { return EmpressMethod(AccessTools.Method(type, name, parameters, (Type[])null)); } private static TDelegate? EmpressMethod(MethodInfo methodInfo) where TDelegate : Delegate { try { return (methodInfo != null) ? AccessTools.MethodDelegate(methodInfo, (object)null, false) : null; } catch (Exception ex) { EmpressDateEverythingPlugin.EmpressWarning("method wrapper failed: " + ex.GetType().Name); return null; } } private static T EmpressGetStatic(FieldRef? fieldRef) where T : class { try { return (fieldRef != null) ? fieldRef.Invoke((object)null) : null; } catch { return null; } } private static F EmpressGet(T instance, FieldRef? fieldRef) where T : class { try { return (instance != null && fieldRef != null) ? fieldRef.Invoke(instance) : default(F); } catch { return default(F); } } private static void EmpressSet(T instance, FieldRef? fieldRef, F value) where T : class { try { if (instance != null && fieldRef != null) { fieldRef.Invoke(instance) = value; } } catch { } } } internal sealed class EmpressDateFollower : MonoBehaviour { private const float EmpressTeleportBackDistance = 32f; private Transform _target; private EmpressRelationship _relationship; private NavMeshAgent _agent; private Vector3 _sideOffset; private Vector3 _manualDestination; private Vector3 _lastPosition; private float _nextRetargetAt; private float _stuckCheckAt; private float _stuckTimer; private float _groundLift = 0.05f; private float _bodyHeight = 1.2f; private bool _agentReady; private bool _destroyOnDismiss = true; internal bool EmpressUsesOriginalObject => !_destroyOnDismiss; internal void EmpressBind(PlayerAvatar player, EmpressRelationship relationship, string displayName, Vector3 sideOffset, bool destroyOnDismiss) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) _target = (((Object)(object)player != (Object)null) ? ((Component)player).transform : null); _relationship = relationship; _sideOffset = sideOffset; _destroyOnDismiss = destroyOnDismiss; ((Object)((Component)this).gameObject).name = (string.IsNullOrWhiteSpace(displayName) ? "Empress Date Follower" : (displayName + " date follower")); EmpressRefreshGroundLift(); EmpressSetupAgent(); if ((Object)(object)_target != (Object)null) { Vector3 desired = _target.TransformPoint(_sideOffset); if (_agentReady && EmpressSampleNavMesh(desired, 8f, out var point)) { _agent.Warp(point); } else { ((Component)this).transform.position = EmpressGroundedPosition(desired); } _manualDestination = EmpressGroundedPosition(desired); } _lastPosition = ((Component)this).transform.position; } internal void EmpressDismiss() { if (_destroyOnDismiss) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } ((Behaviour)this).enabled = false; if ((Object)(object)_agent != (Object)null) { _agent.ResetPath(); ((Behaviour)_agent).enabled = false; } } private void EmpressSetupAgent() { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) _agent = ((Component)this).gameObject.GetComponent(); if ((Object)(object)_agent == (Object)null) { _agent = ((Component)this).gameObject.AddComponent(); } _agent.radius = 0.32f; _agent.height = _bodyHeight; _agent.baseOffset = _groundLift; _agent.speed = 4.6f; _agent.acceleration = 20f; _agent.angularSpeed = 720f; _agent.stoppingDistance = 0.55f; _agent.autoBraking = true; _agent.avoidancePriority = 48; _agent.updateRotation = false; _agentReady = EmpressPlaceAgentNear(((Component)this).transform.position); } private void Update() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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_00a1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_target == (Object)null || _relationship == null || !_relationship.Following) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } float num = Vector3.Distance(((Component)this).transform.position, _target.position); if (num > 32f) { EmpressPlaceAgentNear(_target.TransformPoint(_sideOffset)); _nextRetargetAt = 0f; } if (_agentReady && ((Object)(object)_agent == (Object)null || !_agent.isOnNavMesh)) { _agentReady = EmpressPlaceAgentNear(((Component)this).transform.position); } if (Time.unscaledTime >= _nextRetargetAt) { _nextRetargetAt = Time.unscaledTime + Random.Range(0.9f, 1.8f); EmpressPickDestination(num); } if (!_agentReady) { EmpressManualMove(); } EmpressCheckStuck(); EmpressFaceMovementOrPlayer(); EmpressBobSoftly(); } private void EmpressPickDestination(float distanceToPlayer) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003f: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Random.insideUnitSphere; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = _target.right; } Vector3 worldPosition = _target.TransformPoint(_sideOffset) + ((Vector3)(ref val)).normalized * Random.Range(0.25f, (distanceToPlayer > 8f) ? 1.2f : 2.2f); EmpressSetDestination(worldPosition); } private void EmpressSetDestination(Vector3 worldPosition) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_002b: Unknown result type (might be due to invalid IL or missing references) _manualDestination = EmpressGroundedPosition(worldPosition); if (_agentReady) { if (EmpressSampleNavMesh(worldPosition, 4f, out var point)) { _agent.SetDestination(point); } else { _agent.SetDestination(worldPosition); } } } private void EmpressManualMove() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) float num = 3.8f + Mathf.Clamp01(Vector3.Distance(((Component)this).transform.position, _target.position) / 10f) * 2.2f; ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, _manualDestination, num * Time.unscaledDeltaTime); } private void EmpressFaceMovementOrPlayer() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_0022: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.zero; if (_agentReady && (Object)(object)_agent != (Object)null) { Vector3 velocity = _agent.velocity; if (((Vector3)(ref velocity)).sqrMagnitude > 0.04f) { val = _agent.velocity; goto IL_0096; } } val = ((!(Vector3.Distance(((Component)this).transform.position, _manualDestination) > 0.45f)) ? (_target.position - ((Component)this).transform.position) : (_manualDestination - ((Component)this).transform.position)); goto IL_0096; IL_0096: val.y = 0f; if (!(((Vector3)(ref val)).sqrMagnitude <= 0.01f)) { Quaternion val2 = Quaternion.LookRotation(((Vector3)(ref val)).normalized, Vector3.up); ((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, val2, Mathf.Clamp01(Time.unscaledDeltaTime * 8.5f)); } } private void EmpressBobSoftly() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (!_agentReady) { Vector3 position = ((Component)this).transform.position; position.y += Mathf.Sin(Time.unscaledTime * 3.2f + (float)((Object)this).GetInstanceID() * 0.1f) * 0.0025f; ((Component)this).transform.position = position; } } private void EmpressCheckStuck() { //IL_002d: 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_0045: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) if (_agentReady && !(Time.unscaledTime < _stuckCheckAt)) { _stuckCheckAt = Time.unscaledTime + 1.1f; float num = Vector3.Distance(((Component)this).transform.position, _lastPosition); _lastPosition = ((Component)this).transform.position; if ((Object)(object)_agent != (Object)null && _agent.hasPath && _agent.remainingDistance > 1.3f && num < 0.08f) { _stuckTimer += 1.1f; } else { _stuckTimer = 0f; } if (_stuckTimer >= 3.3f) { _stuckTimer = 0f; EmpressPlaceAgentNear(_target.TransformPoint(_sideOffset)); _nextRetargetAt = 0f; } } } private bool EmpressPlaceAgentNear(Vector3 desired) { //IL_0010: 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_0025: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_agent == (Object)null) { return false; } if (EmpressSampleNavMesh(desired, 8f, out var point)) { return _agent.Warp(point); } return _agent.Warp(EmpressGroundedPosition(desired)); } private void EmpressRefreshGroundLift() { //IL_0027: 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_005e: Unknown result type (might be due to invalid IL or missing references) if (!EmpressTryGetVisualBounds(out var bounds)) { _groundLift = 0.05f; _bodyHeight = 1.2f; } else { float num = ((Component)this).transform.position.y - ((Bounds)(ref bounds)).min.y; _groundLift = Mathf.Clamp(num + 0.02f, 0.02f, 3f); _bodyHeight = Mathf.Clamp(((Bounds)(ref bounds)).size.y, 0.6f, 5f); } } private bool EmpressTryGetVisualBounds(out Bounds bounds) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_004f: 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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_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) bounds = new Bounds(((Component)this).transform.position, Vector3.zero); bool flag = false; Renderer[] componentsInChildren = ((Component)this).GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if (!((Object)(object)val == (Object)null)) { if (!flag) { bounds = val.bounds; flag = true; } else { ((Bounds)(ref bounds)).Encapsulate(val.bounds); } } } if (flag) { return true; } Collider[] componentsInChildren2 = ((Component)this).GetComponentsInChildren(true); foreach (Collider val2 in componentsInChildren2) { if (!((Object)(object)val2 == (Object)null) && !val2.isTrigger) { if (!flag) { bounds = val2.bounds; flag = true; } else { ((Bounds)(ref bounds)).Encapsulate(val2.bounds); } } } return flag; } private Vector3 EmpressGroundedPosition(Vector3 desired) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(desired + Vector3.up * 5f, Vector3.down, ref val, 16f, -1, (QueryTriggerInteraction)1)) { desired.y = ((RaycastHit)(ref val)).point.y + _groundLift; } return desired; } private static bool EmpressSampleNavMesh(Vector3 desired, float radius, out Vector3 point) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) NavMeshHit val = default(NavMeshHit); if (NavMesh.SamplePosition(desired, ref val, radius, -1)) { point = ((NavMeshHit)(ref val)).position; return true; } point = desired; return false; } } }