using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using HarmonyLib; using Microsoft.CodeAnalysis; using UnityEngine; using UnityEngine.AI; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.SceneManagement; [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.0.1.0")] [assembly: AssemblyInformationalVersion("1.0.1")] [assembly: AssemblyProduct("AICompanion")] [assembly: AssemblyTitle("AICompanion")] [assembly: AssemblyVersion("1.0.1.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 EmpressAICompanion { internal static class EmpressCompanionAccess { private delegate bool EmpressBoolStaticDelegate(); private delegate PlayerAvatar EmpressPlayerAvatarStaticDelegate(); private delegate string EmpressPlayerSteamIdDelegate(PlayerAvatar player); private delegate int EmpressStatGetDelegate(); private delegate int EmpressStatSetDelegate(int value); private delegate void EmpressVoidStaticDelegate(); private delegate int EmpressShopCostDelegate(); 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 EmpressInvincibleDelegate(PlayerHealth instance, float time); private delegate void EmpressPhysFloatTimeDelegate(PhysGrabObject instance, float value, float time); private delegate void EmpressPhysFloatDelegate(PhysGrabObject instance, float time); private delegate float EmpressImpactHealDelegate(PhysGrabObjectImpactDetector instance, float healPercent, Vector3 healingPoint); private delegate int EmpressUpgradeDelegate(PunManager instance, string steamId, int value); private delegate void EmpressHaulGoalDelegate(ExtractionPoint instance, int value); private delegate void EmpressEnemyFloatDelegate(Enemy instance, float time); private delegate void EmpressEnemyHealthHurtDelegate(EnemyHealth instance, int damage, Vector3 hurtDirection); private delegate void EmpressPhysTeleportDelegate(PhysGrabObject instance, Vector3 position, Quaternion rotation); private delegate void EmpressCartAddDelegate(PhysGrabInCart instance, PhysGrabObject physGrabObject); private static readonly FieldRef EmpressGameManagerInstance = EmpressStaticRef(typeof(GameManager), "instance"); private static readonly FieldRef EmpressRunManagerInstance = EmpressStaticRef(typeof(RunManager), "instance"); private static readonly FieldRef EmpressGameDirectorInstance = EmpressStaticRef(typeof(GameDirector), "instance"); private static readonly FieldRef EmpressLevelGeneratorInstance = EmpressStaticRef(typeof(LevelGenerator), "Instance"); private static readonly FieldRef EmpressShopManagerInstance = EmpressStaticRef(typeof(ShopManager), "instance"); private static readonly FieldRef EmpressRoundDirectorInstance = EmpressStaticRef(typeof(RoundDirector), "instance"); private static readonly FieldRef EmpressPhysGrabberInstance = EmpressStaticRef(typeof(PhysGrabber), "instance"); private static readonly FieldRef EmpressPlayerControllerInstance = EmpressStaticRef(typeof(PlayerController), "instance"); private static readonly FieldRef EmpressPunManagerInstance = EmpressStaticRef(typeof(PunManager), "instance"); private static readonly FieldRef> EmpressShopShoppingList = EmpressInstanceRef>("shoppingList"); private static readonly FieldRef EmpressAvatarDeadSet = EmpressInstanceRef("deadSet"); private static readonly FieldRef EmpressAvatarPlayerHealth = EmpressInstanceRef("playerHealth"); private static readonly FieldRef EmpressAvatarVisuals = EmpressInstanceRef("playerAvatarVisuals"); private static readonly FieldRef EmpressDirectorState = EmpressInstanceRef("currentState"); private static readonly FieldRef> EmpressDirectorPlayers = EmpressInstanceRef>("PlayerList"); private static readonly FieldRef EmpressRunLevelCurrent = EmpressInstanceRef("levelCurrent"); private static readonly FieldRef EmpressRunLevelsCompleted = EmpressInstanceRef("levelsCompleted"); private static readonly FieldRef EmpressLevelGenerated = EmpressInstanceRef("Generated"); private static readonly FieldRef EmpressHealthCurrent = EmpressInstanceRef("health"); private static readonly FieldRef EmpressHealthMax = EmpressInstanceRef("maxHealth"); private static readonly FieldRef EmpressRoundCurrentHaul = EmpressInstanceRef("currentHaul"); private static readonly FieldRef EmpressRoundHaulGoal = EmpressInstanceRef("haulGoal"); private static readonly FieldRef EmpressRoundExtractionHaulGoal = EmpressInstanceRef("extractionHaulGoal"); private static readonly FieldRef EmpressRoundExtractionSurplus = EmpressInstanceRef("extractionPointSurplus"); private static readonly FieldRef EmpressRoundExtractionCurrent = EmpressInstanceRef("extractionPointCurrent"); private static readonly FieldRef EmpressGrabberHeldObject = EmpressInstanceRef("grabbedPhysGrabObject"); private static readonly FieldRef EmpressImpactDetector = EmpressInstanceRef("impactDetector"); private static readonly FieldRef EmpressPhysRigidbody = EmpressInstanceRef("rb"); private static readonly FieldRef EmpressHeldByLocalPlayer = EmpressInstanceRef("heldByLocalPlayer"); private static readonly FieldRef EmpressGrabbedLocal = EmpressInstanceRef("grabbedLocal"); private static readonly FieldRef EmpressGrabbed = EmpressInstanceRef("grabbed"); private static readonly FieldRef EmpressPhysDead = EmpressInstanceRef("dead"); private static readonly FieldRef EmpressImpactInCart = EmpressInstanceRef("inCart"); private static readonly FieldRef EmpressImpactTimerInCart = EmpressInstanceRef("timerInCart"); private static readonly FieldRef EmpressImpactCurrentCart = EmpressInstanceRef("currentCart"); 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 EmpressCartIsSmall = EmpressInstanceRef("isSmallCart"); private static readonly FieldRef EmpressCartPhysGrab = EmpressInstanceRef("physGrabObject"); private static readonly FieldRef EmpressCartInCart = EmpressInstanceRef("inCart"); private static readonly FieldRef EmpressCartTracker = EmpressInstanceRef("physGrabInCart"); private static readonly FieldRef EmpressCartItemsInCartCount = EmpressInstanceRef("itemsInCartCount"); private static readonly FieldRef EmpressCartHaulCurrent = EmpressInstanceRef("haulCurrent"); private static readonly FieldRef EmpressEnemyRigidbodyField = EmpressInstanceRef("Rigidbody"); private static readonly FieldRef EmpressEnemyHealthField = EmpressInstanceRef("Health"); private static readonly FieldRef EmpressEnemyHealthDead = EmpressInstanceRef("dead"); private static readonly EmpressBoolStaticDelegate EmpressGameMultiplayer = EmpressStaticMethod(typeof(GameManager), "Multiplayer"); private static readonly EmpressBoolStaticDelegate EmpressRunIsLevel = EmpressStaticMethod(typeof(SemiFunc), "RunIsLevel"); private static readonly EmpressBoolStaticDelegate EmpressRunIsShop = EmpressStaticMethod(typeof(SemiFunc), "RunIsShop"); private static readonly EmpressBoolStaticDelegate EmpressRunIsArena = EmpressStaticMethod(typeof(SemiFunc), "RunIsArena"); private static readonly EmpressBoolStaticDelegate EmpressMenuLevel = EmpressStaticMethod(typeof(SemiFunc), "MenuLevel"); 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 EmpressShopCostDelegate EmpressShopGetTotalCost = EmpressStaticMethod(typeof(SemiFunc), "ShopGetTotalCost"); 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 EmpressInvincibleDelegate EmpressInvincible = EmpressInstanceMethod(typeof(PlayerHealth), "InvincibleSet", new Type[1] { typeof(float) }); 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 EmpressPhysTeleportDelegate EmpressPhysTeleport = EmpressInstanceMethod(typeof(PhysGrabObject), "Teleport", new Type[2] { typeof(Vector3), typeof(Quaternion) }); private static readonly EmpressImpactHealDelegate EmpressImpactHeal = EmpressInstanceMethod(typeof(PhysGrabObjectImpactDetector), "Heal", new Type[2] { typeof(float), typeof(Vector3) }); 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 EmpressHaulGoalDelegate EmpressSetHaulGoal = EmpressInstanceMethod(typeof(ExtractionPoint), "HaulGoalSet", new Type[1] { 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 EmpressEnemyHealthHurtDelegate EmpressEnemyHurt = EmpressInstanceMethod(typeof(EnemyHealth), "Hurt", new Type[2] { typeof(int), typeof(Vector3) }); private static readonly EmpressCartAddDelegate EmpressCartAdd = EmpressInstanceMethod(typeof(PhysGrabInCart), "Add", new Type[1] { typeof(PhysGrabObject) }); internal static GameManager GameManagerInstance => EmpressGetStatic(EmpressGameManagerInstance); internal static RunManager RunManagerInstance => EmpressGetStatic(EmpressRunManagerInstance); internal static GameDirector GameDirectorInstance => EmpressGetStatic(EmpressGameDirectorInstance); internal static LevelGenerator LevelGeneratorInstance => EmpressGetStatic(EmpressLevelGeneratorInstance); internal static ShopManager ShopManagerInstance => EmpressGetStatic(EmpressShopManagerInstance); internal static RoundDirector RoundDirectorInstance => EmpressGetStatic(EmpressRoundDirectorInstance); internal static PhysGrabber PhysGrabberInstance => EmpressGetStatic(EmpressPhysGrabberInstance); internal static PlayerController PlayerControllerInstance => EmpressGetStatic(EmpressPlayerControllerInstance); internal static PunManager PunManagerInstance => EmpressGetStatic(EmpressPunManagerInstance); internal static bool IsMultiplayer() { try { return EmpressGameMultiplayer != null && EmpressGameMultiplayer(); } catch { return false; } } internal static bool RunIsLevel() { try { return EmpressRunIsLevel != null && EmpressRunIsLevel(); } catch { return false; } } internal static bool RunIsShop() { try { return EmpressRunIsShop != null && EmpressRunIsShop(); } catch { return false; } } internal static bool RunIsArena() { try { return EmpressRunIsArena != null && EmpressRunIsArena(); } catch { return false; } } internal static bool MenuLevel() { try { return EmpressMenuLevel != null && EmpressMenuLevel(); } catch { return false; } } internal static PlayerAvatar GetLocalPlayer() { try { return (EmpressPlayerAvatarLocal != null) ? EmpressPlayerAvatarLocal() : PlayerAvatar.instance; } catch { return PlayerAvatar.instance; } } internal static string GetSteamId(PlayerAvatar player) { try { return ((Object)(object)player != (Object)null && EmpressPlayerSteamId != null) ? (EmpressPlayerSteamId(player) ?? string.Empty) : string.Empty; } catch { return string.Empty; } } internal static bool IsDead(PlayerAvatar player) { if (!((Object)(object)player == (Object)null)) { return EmpressGet(player, EmpressAvatarDeadSet); } return true; } internal static PlayerHealth GetPlayerHealth(PlayerAvatar player) { if (!((Object)(object)player != (Object)null)) { return null; } return EmpressGet(player, EmpressAvatarPlayerHealth); } internal static GameObject GetAvatarVisualRoot(PlayerAvatar player) { PlayerAvatarVisuals val = (((Object)(object)player != (Object)null) ? EmpressGet(player, EmpressAvatarVisuals) : null); if (!((Object)(object)val != (Object)null)) { return null; } return ((Component)val).gameObject; } 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 gameState GetGameState(GameDirector director) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)director != (Object)null)) { return (gameState)0; } return EmpressGet(director, EmpressDirectorState); } internal static int GetPlayerCount(GameDirector director) { return (((Object)(object)director != (Object)null) ? EmpressGet>(director, EmpressDirectorPlayers) : null)?.Count ?? 0; } internal static Level GetCurrentLevel(RunManager manager) { if (!((Object)(object)manager != (Object)null)) { return null; } return EmpressGet(manager, EmpressRunLevelCurrent); } internal static int GetLevelsCompleted(RunManager manager) { if (!((Object)(object)manager != (Object)null)) { return 0; } return EmpressGet(manager, EmpressRunLevelsCompleted); } internal static bool IsLevelGenerated(LevelGenerator generator) { if (!((Object)(object)generator == (Object)null)) { return EmpressGet(generator, EmpressLevelGenerated); } return true; } internal static PhysGrabObject GetHeldObject() { PhysGrabber physGrabberInstance = PhysGrabberInstance; if (!((Object)(object)physGrabberInstance != (Object)null)) { return null; } return EmpressGet(physGrabberInstance, EmpressGrabberHeldObject); } internal static bool IsHeldOrGrabbed(PhysGrabObject physGrabObject) { if ((Object)(object)physGrabObject != (Object)null) { if (!EmpressGet(physGrabObject, EmpressHeldByLocalPlayer) && !EmpressGet(physGrabObject, EmpressGrabbedLocal)) { return EmpressGet(physGrabObject, EmpressGrabbed); } return true; } return false; } internal static bool IsPhysDead(PhysGrabObject physGrabObject) { if (!((Object)(object)physGrabObject == (Object)null)) { return EmpressGet(physGrabObject, EmpressPhysDead); } return true; } internal static int GetRunCurrency() { try { return (EmpressGetRunCurrency != null) ? EmpressGetRunCurrency() : 0; } catch { return 0; } } internal static void SetRunCurrency(int value) { try { if (EmpressSetRunCurrency != null) { EmpressSetRunCurrency(Mathf.Max(0, value)); } } catch { } } internal static int GetShopTotalCost() { try { return (EmpressShopGetTotalCost != null) ? EmpressShopGetTotalCost() : 0; } catch { return 0; } } 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 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 HealPlayer(PlayerAvatar player, int amount, bool effect) { try { if (!((Object)(object)player == (Object)null) && amount > 0) { PlayerHealth playerHealth = GetPlayerHealth(player); if ((Object)(object)playerHealth != (Object)null) { 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 void SetInvincible(PlayerAvatar player, float time) { try { PlayerHealth playerHealth = GetPlayerHealth(player); if ((Object)(object)playerHealth != (Object)null) { EmpressInvincible?.Invoke(playerHealth, time); } } catch { } } 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 bool RepairValuable(PhysGrabObject physGrabObject, float healPercent) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)physGrabObject == (Object)null) { return false; } PhysGrabObjectImpactDetector val = EmpressGet(physGrabObject, EmpressImpactDetector); if ((Object)(object)val == (Object)null) { return false; } return EmpressImpactHeal != null && EmpressImpactHeal(val, healPercent, physGrabObject.centerPoint) > 0f; } catch { return false; } } 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 PhysGrabObjectImpactDetector GetImpactDetector(PhysGrabObject physGrabObject) { if (!((Object)(object)physGrabObject != (Object)null)) { return null; } return EmpressGet(physGrabObject, EmpressImpactDetector); } internal static bool IsObjectInCart(PhysGrabObject physGrabObject, PhysGrabCart cart = null) { PhysGrabObjectImpactDetector impactDetector = GetImpactDetector(physGrabObject); if ((Object)(object)impactDetector == (Object)null || !EmpressGet(impactDetector, EmpressImpactInCart)) { return false; } PhysGrabCart val = EmpressGet(impactDetector, EmpressImpactCurrentCart); if (!((Object)(object)cart == (Object)null) && !((Object)(object)val == (Object)(object)cart)) { return (Object)(object)val == (Object)null; } return true; } 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 TeleportPhysObject(PhysGrabObject physGrabObject, Vector3 position, Quaternion rotation) { //IL_002e: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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) try { if ((Object)(object)physGrabObject == (Object)null) { return; } EmpressOverrideIndestructible?.Invoke(physGrabObject, 0.7f); if (EmpressPhysTeleport != null) { EmpressPhysTeleport(physGrabObject, position, rotation); return; } Rigidbody physRigidbody = GetPhysRigidbody(physGrabObject); if ((Object)(object)physRigidbody != (Object)null && !physRigidbody.isKinematic) { physRigidbody.MovePosition(position); physRigidbody.MoveRotation(rotation); } else { ((Component)physGrabObject).transform.SetPositionAndRotation(position, rotation); } } catch { } } internal static bool IsSmallCart(PhysGrabCart cart) { if ((Object)(object)cart != (Object)null) { return EmpressGet(cart, EmpressCartIsSmall); } return false; } internal static PhysGrabObject GetCartPhysGrabObject(PhysGrabCart cart) { PhysGrabObject val = (((Object)(object)cart != (Object)null) ? EmpressGet(cart, EmpressCartPhysGrab) : null); if (!((Object)(object)val != (Object)null)) { if (!((Object)(object)cart != (Object)null)) { return null; } return ((Component)cart).GetComponent(); } return val; } internal static Transform GetCartBasket(PhysGrabCart cart) { Transform val = (((Object)(object)cart != (Object)null) ? EmpressGet(cart, EmpressCartInCart) : null); if (!((Object)(object)val != (Object)null)) { if (!((Object)(object)cart != (Object)null)) { return null; } return ((Component)cart).transform; } return val; } internal static int GetCartItemCount(PhysGrabCart cart) { if (!((Object)(object)cart != (Object)null)) { return 0; } return Mathf.Max(0, EmpressGet(cart, EmpressCartItemsInCartCount)); } internal static int GetCartHaul(PhysGrabCart cart) { if (!((Object)(object)cart != (Object)null)) { return 0; } return Mathf.Max(0, EmpressGet(cart, EmpressCartHaulCurrent)); } internal static void MarkObjectInCart(PhysGrabObject physGrabObject, PhysGrabCart cart, float seconds) { try { if (!((Object)(object)physGrabObject == (Object)null) && !((Object)(object)cart == (Object)null)) { PhysGrabObjectImpactDetector impactDetector = GetImpactDetector(physGrabObject); if ((Object)(object)impactDetector != (Object)null) { EmpressSet(impactDetector, EmpressImpactCurrentCart, cart); EmpressSet(impactDetector, EmpressImpactTimerInCart, Mathf.Max(0.1f, seconds)); EmpressSet(impactDetector, EmpressImpactInCart, value: true); } PhysGrabInCart val = EmpressGet(cart, EmpressCartTracker); if ((Object)(object)val != (Object)null) { EmpressCartAdd?.Invoke(val, physGrabObject); } } } catch { } } internal static EnemyRigidbody GetEnemyRigidbody(Enemy enemy) { EnemyRigidbody val = (((Object)(object)enemy != (Object)null) ? EmpressGet(enemy, EmpressEnemyRigidbodyField) : null); if (!((Object)(object)val != (Object)null)) { if (!((Object)(object)enemy != (Object)null)) { return null; } return ((Component)enemy).GetComponentInChildren(); } return val; } internal static Rigidbody GetEnemyPhysicsRigidbody(Enemy enemy) { EnemyRigidbody enemyRigidbody = GetEnemyRigidbody(enemy); Rigidbody val = (((Object)(object)enemyRigidbody != (Object)null) ? ((Component)enemyRigidbody).GetComponent() : null); if (!((Object)(object)val != (Object)null)) { if (!((Object)(object)enemy != (Object)null)) { return null; } return ((Component)enemy).GetComponentInChildren(); } return val; } internal static bool EnemyIsDead(Enemy enemy) { EnemyHealth val = (((Object)(object)enemy != (Object)null) ? EmpressGet(enemy, EmpressEnemyHealthField) : null); if ((Object)(object)val == (Object)null && (Object)(object)enemy != (Object)null) { val = ((Component)enemy).GetComponent(); } if ((Object)(object)val != (Object)null) { return EmpressGet(val, EmpressEnemyHealthDead); } return false; } 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 { } } internal static bool HurtEnemy(Enemy enemy, int damage, Vector3 hurtDirection) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) try { if ((Object)(object)enemy == (Object)null || damage <= 0) { return false; } EnemyHealth val = EmpressGet(enemy, EmpressEnemyHealthField); if ((Object)(object)val == (Object)null) { val = ((Component)enemy).GetComponent(); } if ((Object)(object)val == (Object)null || EmpressGet(val, EmpressEnemyHealthDead) || EmpressEnemyHurt == null) { return false; } EmpressEnemyHurt(val, damage, hurtDirection); return true; } catch { return false; } } internal static int GetCurrentHaul(RoundDirector roundDirector) { if (!((Object)(object)roundDirector != (Object)null)) { return 0; } return EmpressGet(roundDirector, EmpressRoundCurrentHaul); } internal static int GetHaulGoal(RoundDirector roundDirector) { if (!((Object)(object)roundDirector != (Object)null)) { return 0; } return EmpressGet(roundDirector, EmpressRoundHaulGoal); } internal static ExtractionPoint GetCurrentExtraction(RoundDirector roundDirector) { if (!((Object)(object)roundDirector != (Object)null)) { return null; } return EmpressGet(roundDirector, EmpressRoundExtractionCurrent); } internal static void AddExtractionSurplus(RoundDirector roundDirector, int amount) { if (!((Object)(object)roundDirector == (Object)null) && amount != 0) { int num = EmpressGet(roundDirector, EmpressRoundExtractionSurplus); EmpressSet(roundDirector, EmpressRoundExtractionSurplus, num + amount); } } 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 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 GetItemName(ItemAttributes item) { if ((Object)(object)item == (Object)null) { return string.Empty; } string text = EmpressGet(item, EmpressItemName); if (string.IsNullOrWhiteSpace(text)) { return ((Object)item).name; } return text; } internal static bool TryGrantUpgrade(PlayerAvatar player, EmpressBlessingKind preferredKind) { string steamId = GetSteamId(player); PunManager punManagerInstance = PunManagerInstance; if (string.IsNullOrWhiteSpace(steamId) || (Object)(object)punManagerInstance == (Object)null) { return false; } EmpressUpgradeDelegate[] array = preferredKind switch { EmpressBlessingKind.GraceShield => new EmpressUpgradeDelegate[3] { EmpressUpgradeHealth, EmpressUpgradeEnergy, EmpressUpgradeSpeed }, EmpressBlessingKind.Featherweight => new EmpressUpgradeDelegate[3] { EmpressUpgradeStrength, EmpressUpgradeThrow, EmpressUpgradeRange }, _ => new EmpressUpgradeDelegate[11] { EmpressUpgradeHealth, EmpressUpgradeEnergy, EmpressUpgradeExtraJump, EmpressUpgradeLaunch, EmpressUpgradeClimb, EmpressUpgradeWings, EmpressUpgradeSpeed, EmpressUpgradeCrouchRest, EmpressUpgradeStrength, EmpressUpgradeThrow, EmpressUpgradeRange }, }; if (array.Length == 0) { return false; } try { EmpressUpgradeDelegate empressUpgradeDelegate = array[Random.Range(0, array.Length)]; return empressUpgradeDelegate != null && empressUpgradeDelegate(punManagerInstance, steamId, 1) >= 0; } catch { return false; } } internal static void UpdateExtractionGoal(int newGoal) { try { RoundDirector roundDirectorInstance = RoundDirectorInstance; if ((Object)(object)roundDirectorInstance != (Object)null) { int value = Mathf.Max(0, newGoal); EmpressSet(roundDirectorInstance, EmpressRoundHaulGoal, value); EmpressSet(roundDirectorInstance, EmpressRoundExtractionHaulGoal, value); } ExtractionPoint[] array = Object.FindObjectsOfType(); for (int i = 0; i < array.Length; i++) { EmpressSetHaulGoal?.Invoke(array[i], Mathf.Max(0, newGoal)); } } catch { } } private static FieldRef EmpressStaticRef(Type type, string name) where F : class { try { return AccessTools.FieldRefAccess(type, name); } catch (Exception ex) { EmpressCompanionPlugin.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) { EmpressCompanionPlugin.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 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) { EmpressCompanionPlugin.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 EmpressCompanionAudio { private const byte EmpressXorKey = 90; private readonly AudioClip?[] _empressClips = (AudioClip?[])(object)new AudioClip[2]; private AudioSource? _empressAudioSource; private bool _empressLoadingStarted; private bool _empressLoaded; internal void EmpressInitialize(MonoBehaviour host) { if ((Object)(object)_empressAudioSource == (Object)null) { _empressAudioSource = ((Component)host).gameObject.AddComponent(); _empressAudioSource.playOnAwake = false; _empressAudioSource.loop = false; _empressAudioSource.spatialBlend = 0f; _empressAudioSource.volume = 0.42f; } if (!_empressLoadingStarted) { _empressLoadingStarted = true; host.StartCoroutine(EmpressLoadRoutine()); } } internal void EmpressPlayCharacter(int alternator) { if (EmpressCompanionPlugin.CompanionConfig.TextSoundsEnabled.Value && _empressLoaded && !((Object)(object)_empressAudioSource == (Object)null)) { AudioClip val = _empressClips[Mathf.Abs(alternator) % _empressClips.Length]; if (!((Object)(object)val == (Object)null)) { _empressAudioSource.PlayOneShot(val, 0.72f); } } } private IEnumerator EmpressLoadRoutine() { string pluginDirectory = Path.GetDirectoryName(typeof(EmpressCompanionPlugin).Assembly.Location) ?? Paths.PluginPath; string cacheDirectory = Path.Combine(Paths.CachePath, "EmpressAICompanion"); Directory.CreateDirectory(cacheDirectory); yield return EmpressLoadClip(pluginDirectory, cacheDirectory, "EmpressTalk1.xorbin", "EmpressTalk1.mp3", 0); yield return EmpressLoadClip(pluginDirectory, cacheDirectory, "EmpressTalk2.xorbin", "EmpressTalk2.mp3", 1); _empressLoaded = (Object)(object)_empressClips[0] != (Object)null || (Object)(object)_empressClips[1] != (Object)null; if (_empressLoaded) { EmpressCompanionPlugin.EmpressInfo("typing sounds ready"); } } private IEnumerator EmpressLoadClip(string pluginDirectory, string cacheDirectory, string xorName, string outputName, int index) { string path = Path.Combine(pluginDirectory, 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("file:///" + text.Replace("\\", "/"), (AudioType)13); try { yield return request.SendWebRequest(); if ((int)request.result != 1) { EmpressCompanionPlugin.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); _empressClips[index] = content; } } finally { ((IDisposable)request)?.Dispose(); } } } internal sealed class EmpressCompanionConfig { internal ConfigEntry Enabled { get; } internal ConfigEntry DebugLogging { get; } internal ConfigEntry ResetAICompanion { get; } internal ConfigEntry DebugForceLove100 { get; } internal ConfigEntry OverlayScale { get; } internal ConfigEntry TypingCharactersPerSecond { get; } internal ConfigEntry TextSoundsEnabled { get; } internal ConfigEntry BaseBlessingIntervalSeconds { get; } internal ConfigEntry LoveGainScale { get; } internal ConfigEntry LoveLossScale { get; } internal ConfigEntry BlessingStrength { get; } internal ConfigEntry ManifestLoveThreshold { get; } internal float EmpressOverlayScale => Mathf.Clamp(OverlayScale.Value, 0.75f, 1f); internal float EmpressTypingSpeed => Mathf.Clamp(TypingCharactersPerSecond.Value, 0f, 80f); internal float EmpressBaseBlessingInterval => Mathf.Clamp(BaseBlessingIntervalSeconds.Value, 10f, 90f); internal float EmpressLoveGainScale => Mathf.Clamp01(LoveGainScale.Value); internal float EmpressLoveLossScale => Mathf.Clamp01(LoveLossScale.Value); internal float EmpressBlessingStrength => Mathf.Clamp01(BlessingStrength.Value); internal float EmpressManifestLoveThreshold => Mathf.Clamp(ManifestLoveThreshold.Value, 0f, 100f); internal EmpressCompanionConfig(ConfigFile config) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Expected O, but got Unknown //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Expected O, but got Unknown //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Expected O, but got Unknown //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Expected O, but got Unknown //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Expected O, but got Unknown //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Expected O, but got Unknown Enabled = config.Bind("Empress General", "Enabled", true, "Enable AICompanion."); DebugLogging = config.Bind("Empress General", "DebugLogging", false, "Enable concise Empress Companion debug logs."); ResetAICompanion = config.Bind("Empress General", "ResetAICompanion", false, new ConfigDescription("Purges the active companion profile and reopens the setup shell so you can make a new one.", (AcceptableValueBase)null, new object[1] { new ConfigurationManagerAttributes { Order = 999, CustomDrawer = EmpressDrawResetButton } })); DebugForceLove100 = config.Bind("Empress Debug", "ForceLove100", false, "Debug only. Forces the active companion love to 100%. Default off."); OverlayScale = config.Bind("Empress Overlay", "OverlayScale", 1f, new ConfigDescription("Scale multiplier for the overlay.", (AcceptableValueBase)(object)new AcceptableValueRange(0.75f, 1f), Array.Empty())); TypingCharactersPerSecond = config.Bind("Empress Overlay", "TypingCharactersPerSecond", 24f, new ConfigDescription("Typing speed for companion messages.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 80f), Array.Empty())); TextSoundsEnabled = config.Bind("Empress Overlay", "TextSoundsEnabled", true, "Play companion typing sounds."); BaseBlessingIntervalSeconds = config.Bind("Empress Directives", "BaseBlessingIntervalSeconds", 34f, new ConfigDescription("Base delay between companion blessings.", (AcceptableValueBase)(object)new AcceptableValueRange(10f, 90f), Array.Empty())); LoveGainScale = config.Bind("Empress Directives", "LoveGainScale", 1f, new ConfigDescription("Multiplier for positive affection changes. 0.0 to 1.0 means 0% to 100%.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); LoveLossScale = config.Bind("Empress Directives", "LoveLossScale", 1f, new ConfigDescription("Multiplier for negative affection changes. 0.0 to 1.0 means 0% to 100%.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); BlessingStrength = config.Bind("Empress Directives", "BlessingStrength", 1f, new ConfigDescription("Overall strength multiplier for companion help. 0.0 to 1.0 means 0% to 100%.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 1f), Array.Empty())); ManifestLoveThreshold = config.Bind("Empress Directives", "ManifestLoveThreshold", 60f, new ConfigDescription("Love percent required before the pink avatar companion appears.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 100f), Array.Empty())); EmpressClampSavedValues(); } internal bool EmpressConsumeResetRequest() { if (!ResetAICompanion.Value) { return false; } ResetAICompanion.Value = false; return true; } private void EmpressClampSavedValues() { EmpressClampEntry(OverlayScale, 0.75f, 1f); EmpressClampEntry(TypingCharactersPerSecond, 0f, 80f); EmpressClampEntry(BaseBlessingIntervalSeconds, 10f, 90f); EmpressClampEntry(LoveGainScale, 0f, 1f); EmpressClampEntry(LoveLossScale, 0f, 1f); EmpressClampEntry(BlessingStrength, 0f, 1f); EmpressClampEntry(ManifestLoveThreshold, 0f, 100f); } private static void EmpressClampEntry(ConfigEntry entry, float min, float max) { float num = Mathf.Clamp(entry.Value, min, max); if (!Mathf.Approximately(entry.Value, num)) { entry.Value = num; } } private static void EmpressDrawResetButton(ConfigEntryBase entry) { if (GUILayout.Button("Reset A.I. Companion", Array.Empty())) { entry.BoxedValue = true; } } } internal sealed class ConfigurationManagerAttributes { public Action? CustomDrawer { get; set; } public int? Order { get; set; } public bool? Browsable { get; set; } public bool? ReadOnly { get; set; } } internal static class EmpressCompanionMemory { private static bool EmpressLoaded; private static float EmpressNextSaveAt; private static EmpressCompanionProfile? EmpressProfile; private static EmpressCompanionMemorial? EmpressMemorial; internal static EmpressCompanionProfile? Profile { get { EmpressLoad(); return EmpressProfile; } } internal static EmpressCompanionMemorial? Memorial { get { EmpressLoad(); return EmpressMemorial; } } private static string EmpressProfilePath => Path.Combine(Paths.ConfigPath, "EmpressAICompanion.profile.json"); private static string EmpressMemorialPath => Path.Combine(Paths.ConfigPath, "EmpressAICompanion.memorial.json"); internal static void EmpressLoad() { if (!EmpressLoaded) { EmpressLoaded = true; EmpressProfile = EmpressLoadJson(EmpressProfilePath); EmpressMemorial = EmpressLoadJson(EmpressMemorialPath); } } internal static void EmpressCreateProfile(string companionName, string playerName, EmpressCompanionPersonality personality, string state, string country) { EmpressProfile = new EmpressCompanionProfile { CompanionName = (string.IsNullOrWhiteSpace(companionName) ? "Empress" : companionName.Trim()), PlayerName = (string.IsNullOrWhiteSpace(playerName) ? "Player" : playerName.Trim()), Personality = personality, State = state.Trim(), Country = country.Trim(), CreatedAt = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), Love = 28f }; if (EmpressMemorial != null) { EmpressMemorial.AwaitFreshBoot = false; } EmpressSaveNow(); } internal static void EmpressMarkDirty() { if (EmpressProfile != null) { EmpressNextSaveAt = Time.unscaledTime + 5f; } } internal static void EmpressTickSave() { if (EmpressNextSaveAt > 0f && Time.unscaledTime >= EmpressNextSaveAt) { EmpressSaveNow(); } } internal static void EmpressSaveNow() { EmpressNextSaveAt = 0f; EmpressSaveJson(EmpressProfilePath, EmpressProfile); EmpressSaveJson(EmpressMemorialPath, EmpressMemorial); } internal static void EmpressKillCurrentCompanion(string sceneLabel, string cause) { EmpressLoad(); if (EmpressProfile != null) { EmpressRelationshipStage stage = EmpressCompanionRuntime.EmpressGetRelationshipStage(EmpressProfile); EmpressCompanionMemorial empressCompanionMemorial = new EmpressCompanionMemorial(); empressCompanionMemorial.CompanionName = EmpressProfile.CompanionName; empressCompanionMemorial.PlayerName = EmpressProfile.PlayerName; empressCompanionMemorial.DiedAt = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); empressCompanionMemorial.LastScene = sceneLabel; empressCompanionMemorial.Cause = cause; empressCompanionMemorial.State = EmpressProfile.State; empressCompanionMemorial.Country = EmpressProfile.Country; empressCompanionMemorial.Personality = EmpressProfile.Personality; empressCompanionMemorial.Stage = stage; empressCompanionMemorial.FinalLove = EmpressProfile.Love; empressCompanionMemorial.LevelsCleared = EmpressProfile.LevelsCleared; empressCompanionMemorial.PlayerDeaths = EmpressProfile.PlayerDeaths; empressCompanionMemorial.ValuablesBroken = EmpressProfile.ValuablesBroken; empressCompanionMemorial.BlessingsGranted = EmpressProfile.BlessingsGranted; empressCompanionMemorial.Summary = EmpressProfile.PlayerName + " reached " + stage.ToString() + " with " + EmpressProfile.CompanionName + ". Final love was " + Mathf.RoundToInt(EmpressProfile.Love) + "%. Last scene was " + sceneLabel + "."; empressCompanionMemorial.AwaitFreshBoot = true; EmpressMemorial = empressCompanionMemorial; EmpressProfile = null; EmpressDeleteProfileFile(); EmpressSaveJson(EmpressMemorialPath, EmpressMemorial); } } internal static void EmpressResetCurrentCompanion(string sceneLabel) { EmpressLoad(); if (EmpressProfile != null) { EmpressRelationshipStage stage = EmpressCompanionRuntime.EmpressGetRelationshipStage(EmpressProfile); EmpressCompanionMemorial empressCompanionMemorial = new EmpressCompanionMemorial(); empressCompanionMemorial.CompanionName = EmpressProfile.CompanionName; empressCompanionMemorial.PlayerName = EmpressProfile.PlayerName; empressCompanionMemorial.DiedAt = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"); empressCompanionMemorial.LastScene = sceneLabel; empressCompanionMemorial.Cause = "Manual companion reset from config."; empressCompanionMemorial.State = EmpressProfile.State; empressCompanionMemorial.Country = EmpressProfile.Country; empressCompanionMemorial.Personality = EmpressProfile.Personality; empressCompanionMemorial.Stage = stage; empressCompanionMemorial.FinalLove = EmpressProfile.Love; empressCompanionMemorial.LevelsCleared = EmpressProfile.LevelsCleared; empressCompanionMemorial.PlayerDeaths = EmpressProfile.PlayerDeaths; empressCompanionMemorial.ValuablesBroken = EmpressProfile.ValuablesBroken; empressCompanionMemorial.BlessingsGranted = EmpressProfile.BlessingsGranted; empressCompanionMemorial.Summary = EmpressProfile.PlayerName + " manually reset " + EmpressProfile.CompanionName + " at " + Mathf.RoundToInt(EmpressProfile.Love) + "% love. Fresh setup is ready."; empressCompanionMemorial.AwaitFreshBoot = false; EmpressMemorial = empressCompanionMemorial; EmpressProfile = null; EmpressDeleteProfileFile(); EmpressSaveJson(EmpressMemorialPath, EmpressMemorial); } else if (EmpressMemorial != null && EmpressMemorial.AwaitFreshBoot) { EmpressMemorial.AwaitFreshBoot = false; EmpressSaveJson(EmpressMemorialPath, EmpressMemorial); } } private static T? EmpressLoadJson(string path) where T : class { try { if (!File.Exists(path)) { return null; } string text = File.ReadAllText(path); if (string.IsNullOrWhiteSpace(text)) { return null; } return JsonUtility.FromJson(text); } catch (Exception ex) { EmpressCompanionPlugin.EmpressWarning("memory load failed: " + ex.GetType().Name); return null; } } private static void EmpressSaveJson(string path, T? value) where T : class { if (value == null) { return; } try { string directoryName = Path.GetDirectoryName(path); if (!string.IsNullOrWhiteSpace(directoryName)) { Directory.CreateDirectory(directoryName); } File.WriteAllText(path, JsonUtility.ToJson((object)value, true)); } catch (Exception ex) { EmpressCompanionPlugin.EmpressWarning("memory save failed: " + ex.GetType().Name); } } private static void EmpressDeleteProfileFile() { try { if (File.Exists(EmpressProfilePath)) { File.Delete(EmpressProfilePath); } } catch (Exception ex) { EmpressCompanionPlugin.EmpressWarning("profile delete failed: " + ex.GetType().Name); } } } [Serializable] internal sealed class EmpressCompanionProfile { public string CompanionName = string.Empty; public string PlayerName = string.Empty; public string State = string.Empty; public string Country = string.Empty; public string CreatedAt = string.Empty; public string LastScene = string.Empty; public string LastBlessing = string.Empty; public EmpressCompanionPersonality Personality; public float Love = 28f; public bool Married; public int LevelsCleared; public int PlayerDeaths; public int ValuablesBroken; public int BlessingsGranted; public int MoneyGiftedK; public int PinkBursts; public int ShopRescues; public int ExtractorBlessings; public int ValuableBoosts; public int Manifestations; } [Serializable] internal sealed class EmpressCompanionMemorial { public string CompanionName = string.Empty; public string PlayerName = string.Empty; public string DiedAt = string.Empty; public string LastScene = string.Empty; public string Cause = string.Empty; public string State = string.Empty; public string Country = string.Empty; public string Summary = string.Empty; public EmpressCompanionPersonality Personality; public EmpressRelationshipStage Stage; public float FinalLove; public int LevelsCleared; public int PlayerDeaths; public int ValuablesBroken; public int BlessingsGranted; public bool AwaitFreshBoot; } internal enum EmpressCompanionPersonality { Sweet, Playful, Elegant, Protective } internal enum EmpressRelationshipStage { Stranger, Familiar, Friend, Partner, Fiancee, Wife } internal enum EmpressCompanionMood { Calm, Focused, Worried, Protective, Shopping, Proud, Playful, Devoted } internal enum EmpressBlessingKind { SmallHeal, FullHeal, CashGift, ValuableBloom, ValuableRepair, TreasureSweep, Featherweight, CourierGrace, ShopDiscount, ShopGift, ShopCascade, UpgradeGift, UpgradeRush, ExtractorBlessing, QuotaMercy, PinkPulse, EnemyDistraction, GraceShield, LoveBurst, MoralePatch, ThreatWard, CartBlessing, ExtractionFocus, ShopUnderwrite, AvatarManifestation } internal readonly struct EmpressCompanionQueuedMessage { internal string Speaker { get; } internal string Text { get; } internal Color Accent { get; } internal float HoldSeconds { get; } internal string Timestamp { get; } internal EmpressCompanionQueuedMessage(string speaker, string text, Color accent, float holdSeconds) { //IL_000f: 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) Speaker = speaker; Text = text; Accent = accent; HoldSeconds = holdSeconds; Timestamp = DateTime.Now.ToString("HH:mm:ss"); } } internal sealed class EmpressCompanionVisibleMessage { internal string Speaker { get; } internal string Text { get; } internal Color Accent { get; } internal float HoldSeconds { get; } internal string Timestamp { get; } internal float VisibleCharacters { get; set; } internal int LastSoundCharacterIndex { get; set; } = -1; internal float CompletedAt { get; set; } = -1f; internal EmpressCompanionVisibleMessage(EmpressCompanionQueuedMessage source) { //IL_0035: 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) Speaker = source.Speaker; Text = source.Text; Accent = source.Accent; HoldSeconds = source.HoldSeconds; Timestamp = source.Timestamp; } } internal sealed class EmpressCompanionBlessingOption { internal EmpressBlessingKind Kind { get; } internal float Weight { get; } internal string PreviewText { get; } internal string Tactic { get; } internal PhysGrabObject? TargetObject { get; } internal ValuableObject? TargetValuable { get; } internal ItemAttributes? TargetItem { get; } internal Enemy? TargetEnemy { get; } internal ExtractionPoint? TargetExtraction { get; } internal int Amount { get; } internal EmpressCompanionBlessingOption(EmpressBlessingKind kind, float weight, string previewText, string tactic, PhysGrabObject? targetObject = null, ValuableObject? targetValuable = null, ItemAttributes? targetItem = null, Enemy? targetEnemy = null, ExtractionPoint? targetExtraction = null, int amount = 0) { Kind = kind; Weight = weight; PreviewText = previewText; Tactic = tactic; TargetObject = targetObject; TargetValuable = targetValuable; TargetItem = targetItem; TargetEnemy = targetEnemy; TargetExtraction = targetExtraction; Amount = amount; } } internal sealed class EmpressCompanionBlessingPlan { internal EmpressBlessingKind Kind { get; } internal string PreviewText { get; } internal string Tactic { get; } internal PhysGrabObject? TargetObject { get; } internal ValuableObject? TargetValuable { get; } internal ItemAttributes? TargetItem { get; } internal Enemy? TargetEnemy { get; } internal ExtractionPoint? TargetExtraction { get; } internal int Amount { get; } internal float ExecuteAt { get; } internal EmpressCompanionBlessingPlan(EmpressCompanionBlessingOption option, float executeAt) { Kind = option.Kind; PreviewText = option.PreviewText; Tactic = option.Tactic; TargetObject = option.TargetObject; TargetValuable = option.TargetValuable; TargetItem = option.TargetItem; TargetEnemy = option.TargetEnemy; TargetExtraction = option.TargetExtraction; Amount = option.Amount; ExecuteAt = executeAt; } } internal sealed class EmpressPinkRecord { internal Renderer Renderer; internal Material[] OriginalMaterials = Array.Empty(); internal Material[] PinkMaterials = Array.Empty(); internal bool UsesMaterialSwap; internal float Until; } internal sealed class EmpressDeathReplayFrame { internal float RecordedAt; internal Vector3 Position; internal Quaternion Rotation; internal int Health; internal int MaxHealth; internal int NearbyEnemies; internal string HeldObjectName = string.Empty; internal string Note = string.Empty; } internal sealed class EmpressCompanionOverlay : MonoBehaviour { private readonly List _empressPendingMessages = new List(); private readonly List _empressVisibleMessages = new List(); private Texture2D _empressPanelTexture; private Texture2D _empressHeaderTexture; private Texture2D _empressBarBackTexture; private Texture2D _empressBarFillTexture; private Texture2D _empressBootTexture; private Texture2D _empressCursorTexture; private Texture2D _empressFieldTexture; private Texture2D _empressButtonTexture; private Texture2D _empressButtonHoverTexture; private Texture2D _empressSelectedButtonTexture; private GUIStyle _empressTitleStyle; private GUIStyle _empressBodyStyle; private GUIStyle _empressSmallStyle; private GUIStyle _empressStatusStyle; private GUIStyle _empressBootTitleStyle; private GUIStyle _empressBootBodyStyle; private GUIStyle _empressFieldStyle; private GUIStyle _empressButtonStyle; private GUIStyle _empressSelectedButtonStyle; private GUIStyle _empressLossStyle; private bool _empressStylesReady; private EmpressCompanionVisibleMessage? _empressActiveMessage; private string _empressMode = "BOOT"; private string _empressScene = "boot"; private string _empressTactic = "Waiting"; private string _empressRelationship = "Stranger"; private string _empressSpeakerName = "Empress"; private float _empressLove; private bool _empressGameplayVisible; private bool _empressMultiplayerLocked; private bool _empressSetupVisible; private bool _empressUiVisible = true; private string _empressLossBanner = string.Empty; private float _empressLossBannerUntil; private int _empressSoundAlternator; private string _empressSetupCompanionName = string.Empty; private string _empressSetupPlayerName = string.Empty; private string _empressSetupState = string.Empty; private string _empressSetupCountry = string.Empty; private EmpressCompanionPersonality _empressSetupPersonality; private bool _empressSetupSeeded; private bool _empressSetupPauseActive; private float _empressPreviousTimeScale = 1f; private CursorLockMode _empressPreviousCursorLock; private bool _empressPreviousCursorVisible = true; private bool _empressPreviousAudioPause; internal static EmpressCompanionOverlay? Instance { get; private set; } private void Awake() { if ((Object)(object)Instance != (Object)null && (Object)(object)Instance != (Object)(object)this) { ((Behaviour)this).enabled = false; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); } else { Instance = this; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); EmpressBuildTextures(); } } private void OnDisable() { EmpressReleaseSetupMode(); } private void Update() { if (!EmpressCompanionPlugin.CompanionConfig.Enabled.Value) { EmpressReleaseSetupMode(); return; } float unscaledTime = Time.unscaledTime; float empressTypingSpeed = EmpressCompanionPlugin.CompanionConfig.EmpressTypingSpeed; if (_empressActiveMessage == null && _empressPendingMessages.Count > 0) { EmpressCompanionQueuedMessage source = _empressPendingMessages[0]; _empressPendingMessages.RemoveAt(0); _empressActiveMessage = new EmpressCompanionVisibleMessage(source); _empressVisibleMessages.Add(_empressActiveMessage); if (_empressVisibleMessages.Count > 6) { _empressVisibleMessages.RemoveAt(0); } } if (_empressActiveMessage != null) { if (empressTypingSpeed <= 0.01f) { _empressActiveMessage.VisibleCharacters = _empressActiveMessage.Text.Length; } int num = Mathf.Clamp(Mathf.FloorToInt(_empressActiveMessage.VisibleCharacters), 0, _empressActiveMessage.Text.Length); _empressActiveMessage.VisibleCharacters += empressTypingSpeed * Time.unscaledDeltaTime; int num2 = Mathf.Clamp(Mathf.FloorToInt(_empressActiveMessage.VisibleCharacters), 0, _empressActiveMessage.Text.Length); if (num2 > num) { for (int i = num; i < num2; i++) { if (!char.IsWhiteSpace(_empressActiveMessage.Text[i])) { EmpressCompanionPlugin.Audio.EmpressPlayCharacter(_empressSoundAlternator++); } } } if (_empressActiveMessage.VisibleCharacters >= (float)_empressActiveMessage.Text.Length) { _empressActiveMessage.VisibleCharacters = _empressActiveMessage.Text.Length; if (_empressActiveMessage.CompletedAt < 0f) { _empressActiveMessage.CompletedAt = unscaledTime; } if (unscaledTime - _empressActiveMessage.CompletedAt >= _empressActiveMessage.HoldSeconds) { _empressActiveMessage = null; } } } for (int num3 = _empressVisibleMessages.Count - 1; num3 >= 0; num3--) { EmpressCompanionVisibleMessage empressCompanionVisibleMessage = _empressVisibleMessages[num3]; if (empressCompanionVisibleMessage != _empressActiveMessage && empressCompanionVisibleMessage.CompletedAt >= 0f && unscaledTime - empressCompanionVisibleMessage.CompletedAt > 28f) { _empressVisibleMessages.RemoveAt(num3); } } if (_empressLossBannerUntil > 0f && unscaledTime >= _empressLossBannerUntil) { _empressLossBannerUntil = 0f; _empressLossBanner = string.Empty; } EmpressTickSetupMode(); } private void OnGUI() { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Invalid comparison between Unknown and I4 //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Invalid comparison between Unknown and I4 //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Invalid comparison between Unknown and I4 //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_02be: 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_0306: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_04bc: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_05c6: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Expected O, but got Unknown //IL_0665: Unknown result type (might be due to invalid IL or missing references) //IL_05ff: Unknown result type (might be due to invalid IL or missing references) //IL_06fb: Unknown result type (might be due to invalid IL or missing references) //IL_06d9: Unknown result type (might be due to invalid IL or missing references) //IL_06de: Unknown result type (might be due to invalid IL or missing references) Event current = Event.current; if (current != null && (int)current.type == 4 && (int)current.keyCode == 287 && !_empressSetupVisible) { _empressUiVisible = !_empressUiVisible; current.Use(); } if (current != null && (int)current.type == 4 && (int)current.keyCode == 288) { EmpressCompanionPlugin.CompanionConfig.TextSoundsEnabled.Value = !EmpressCompanionPlugin.CompanionConfig.TextSoundsEnabled.Value; EmpressPushMessage("Empress OS", EmpressCompanionPlugin.CompanionConfig.TextSoundsEnabled.Value ? "Text sounds are on." : "Text sounds are off.", new Color(1f, 0.82f, 0.92f, 1f), urgent: true, 3.2f); current.Use(); } if (!EmpressCompanionPlugin.CompanionConfig.Enabled.Value || (!_empressUiVisible && !_empressSetupVisible)) { return; } if (!_empressStylesReady) { EmpressBuildStyles(); } float empressOverlayScale = EmpressCompanionPlugin.CompanionConfig.EmpressOverlayScale; Matrix4x4 matrix = GUI.matrix; GUI.matrix = Matrix4x4.Scale(new Vector3(empressOverlayScale, empressOverlayScale, 1f)); float num = (float)Screen.width / empressOverlayScale; float num2 = (float)Screen.height / empressOverlayScale; Rect val = default(Rect); ((Rect)(ref val))..ctor(24f, Mathf.Max(24f, num2 - 260f), Mathf.Min(600f, num - 48f), 228f); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(Mathf.Max(24f, num - 390f), 24f, 366f, 154f); GUI.DrawTexture(val, (Texture)(object)_empressPanelTexture); GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, ((Rect)(ref val)).width, 34f), (Texture)(object)_empressHeaderTexture); GUI.Label(new Rect(((Rect)(ref val)).x + 14f, ((Rect)(ref val)).y + 6f, ((Rect)(ref val)).width - 28f, 24f), _empressSpeakerName + " messenger", _empressTitleStyle); GUI.DrawTexture(val2, (Texture)(object)_empressPanelTexture); GUI.DrawTexture(new Rect(((Rect)(ref val2)).x, ((Rect)(ref val2)).y, ((Rect)(ref val2)).width, 34f), (Texture)(object)_empressHeaderTexture); GUI.Label(new Rect(((Rect)(ref val2)).x + 12f, ((Rect)(ref val2)).y + 5f, ((Rect)(ref val2)).width - 24f, 26f), "Empress OS status", _empressTitleStyle); float num3 = ((Rect)(ref val2)).y + 40f; float num4 = 24f; float num5 = ((Rect)(ref val2)).width - 174f; GUI.Label(new Rect(((Rect)(ref val2)).x + 14f, num3, num5, num4), "Mode " + (_empressMultiplayerLocked ? "MULTIPLAYER LOCK" : _empressMode), _empressStatusStyle); GUI.Label(new Rect(((Rect)(ref val2)).x + 14f, num3 + 25f, num5, num4), "Scene " + _empressScene, _empressStatusStyle); GUI.Label(new Rect(((Rect)(ref val2)).x + 14f, num3 + 50f, num5, num4), "Bond " + _empressRelationship, _empressStatusStyle); GUI.Label(new Rect(((Rect)(ref val2)).x + 14f, num3 + 75f, num5, num4), "Plan " + _empressTactic, _empressStatusStyle); Rect val3 = default(Rect); ((Rect)(ref val3))..ctor(((Rect)(ref val2)).x + ((Rect)(ref val2)).width - 134f, num3 + 2f, 112f, 16f); GUI.DrawTexture(val3, (Texture)(object)_empressBarBackTexture); GUI.DrawTexture(new Rect(((Rect)(ref val3)).x + 1f, ((Rect)(ref val3)).y + 1f, (((Rect)(ref val3)).width - 2f) * Mathf.Clamp01(_empressLove / 100f), ((Rect)(ref val3)).height - 2f), (Texture)(object)_empressBarFillTexture); GUI.Label(new Rect(((Rect)(ref val3)).x, num3 + 24f, 112f, 22f), "Love " + Mathf.RoundToInt(_empressLove) + "%", _empressSmallStyle); GUI.Label(new Rect(((Rect)(ref val3)).x, num3 + 50f, 130f, 22f), "F6 UI", _empressSmallStyle); GUI.Label(new Rect(((Rect)(ref val3)).x, num3 + 74f, 130f, 22f), "F7 sound", _empressSmallStyle); float num6 = ((Rect)(ref val)).width - 24f; float num7 = ((Rect)(ref val)).yMax - 14f; for (int num8 = _empressVisibleMessages.Count - 1; num8 >= 0; num8--) { EmpressCompanionVisibleMessage empressCompanionVisibleMessage = _empressVisibleMessages[num8]; string value = ((empressCompanionVisibleMessage == _empressActiveMessage) ? empressCompanionVisibleMessage.Text.Substring(0, Mathf.Clamp(Mathf.FloorToInt(empressCompanionVisibleMessage.VisibleCharacters), 0, empressCompanionVisibleMessage.Text.Length)) : empressCompanionVisibleMessage.Text); string text = ColorUtility.ToHtmlStringRGB(empressCompanionVisibleMessage.Accent); string text2 = "[" + empressCompanionVisibleMessage.Timestamp + "] " + EmpressEscapeRichText(empressCompanionVisibleMessage.Speaker) + ": " + EmpressEscapeRichText(value) + ""; float num9 = _empressBodyStyle.CalcHeight(new GUIContent(text2), num6); num7 -= num9; if (num7 <= ((Rect)(ref val)).y + 36f) { break; } GUI.Label(new Rect(((Rect)(ref val)).x + 12f, num7, num6, num9), text2, _empressBodyStyle); num7 -= 5f; } if (!_empressGameplayVisible && !_empressSetupVisible) { GUI.Label(new Rect(((Rect)(ref val)).x + 12f, ((Rect)(ref val)).y + 42f, ((Rect)(ref val)).width - 24f, 36f), _empressMultiplayerLocked ? "She only wakes up in singleplayer." : "Companion link is idling.", _empressStatusStyle); } if (_empressSetupVisible) { EmpressDrawSetupWindow(num, num2); EmpressDrawCursor(num, num2, empressOverlayScale); } if (_empressLossBannerUntil > 0f && !string.IsNullOrWhiteSpace(_empressLossBanner)) { Rect val4 = new Rect(num * 0.16f, num2 * 0.16f, num * 0.68f, 80f); GUI.DrawTexture(val4, (Texture)(object)_empressPanelTexture); GUI.Label(val4, _empressLossBanner, _empressLossStyle); } GUI.matrix = matrix; } internal void EmpressPushMessage(string speaker, string text, Color accent, bool urgent = false, float holdSeconds = 7f) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrWhiteSpace(text)) { return; } EmpressCompanionQueuedMessage item = new EmpressCompanionQueuedMessage(string.IsNullOrWhiteSpace(speaker) ? "Empress" : speaker.Trim(), text.Trim(), accent, holdSeconds); if (urgent) { if (_empressActiveMessage != null) { _empressActiveMessage.VisibleCharacters = _empressActiveMessage.Text.Length; if (_empressActiveMessage.CompletedAt < 0f) { _empressActiveMessage.CompletedAt = Time.unscaledTime - _empressActiveMessage.HoldSeconds; } _empressActiveMessage = null; } _empressPendingMessages.Insert(0, item); } else { _empressPendingMessages.Add(item); } } internal void EmpressShowLoss(string text) { _empressLossBanner = text; _empressLossBannerUntil = Time.unscaledTime + 8f; } internal void EmpressSetStatus(bool setupVisible, bool gameplayVisible, bool multiplayerLocked, string mode, string scene, float love, string tactic, string relationship, string speakerName) { _empressSetupVisible = setupVisible; _empressGameplayVisible = gameplayVisible; _empressMultiplayerLocked = multiplayerLocked; _empressMode = mode; _empressScene = scene; _empressLove = love; _empressTactic = tactic; _empressRelationship = relationship; _empressSpeakerName = (string.IsNullOrWhiteSpace(speakerName) ? "Empress" : speakerName); if (_empressSetupVisible && !_empressSetupSeeded) { EmpressSeedSetupFields(); } } private void EmpressDrawSetupWindow(float width, float height) { //IL_0023: 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_0085: 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_0107: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02e3: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_042c: 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_04d1: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_054b: Unknown result type (might be due to invalid IL or missing references) Rect val = default(Rect); ((Rect)(ref val))..ctor(width * 0.16f, height * 0.1f, width * 0.68f, height * 0.76f); GUI.DrawTexture(val, (Texture)(object)_empressBootTexture); GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, ((Rect)(ref val)).width, 42f), (Texture)(object)_empressHeaderTexture); GUI.Label(new Rect(((Rect)(ref val)).x + 18f, ((Rect)(ref val)).y + 7f, ((Rect)(ref val)).width - 36f, 30f), "Empress OS", _empressBootTitleStyle); GUI.Label(new Rect(((Rect)(ref val)).x + 18f, ((Rect)(ref val)).y + 52f, ((Rect)(ref val)).width - 36f, 22f), "Companion initialization shell", _empressBootBodyStyle); GUI.Label(new Rect(((Rect)(ref val)).x + 18f, ((Rect)(ref val)).y + 74f, ((Rect)(ref val)).width - 36f, 36f), "The game is paused. Build your companion and then boot the run.", _empressSmallStyle); float num = ((Rect)(ref val)).width - 36f; float num2 = ((Rect)(ref val)).y + 116f; GUI.Label(new Rect(((Rect)(ref val)).x + 18f, num2, num, 22f), "C:\\EmpressOS> what_is_my_name", _empressSmallStyle); GUI.SetNextControlName("CompanionName"); _empressSetupCompanionName = GUI.TextField(new Rect(((Rect)(ref val)).x + 18f, num2 + 24f, num, 28f), _empressSetupCompanionName, 32, _empressFieldStyle); num2 += 66f; GUI.Label(new Rect(((Rect)(ref val)).x + 18f, num2, num, 22f), "C:\\EmpressOS> what_should_i_call_you", _empressSmallStyle); GUI.SetNextControlName("PlayerName"); _empressSetupPlayerName = GUI.TextField(new Rect(((Rect)(ref val)).x + 18f, num2 + 24f, num, 28f), _empressSetupPlayerName, 32, _empressFieldStyle); num2 += 66f; GUI.Label(new Rect(((Rect)(ref val)).x + 18f, num2, num, 22f), "C:\\EmpressOS> pick_personality", _empressSmallStyle); num2 += 28f; EmpressDrawPersonalityButton(new Rect(((Rect)(ref val)).x + 18f, num2, 140f, 30f), EmpressCompanionPersonality.Sweet, "Sweet"); EmpressDrawPersonalityButton(new Rect(((Rect)(ref val)).x + 168f, num2, 140f, 30f), EmpressCompanionPersonality.Playful, "Playful"); EmpressDrawPersonalityButton(new Rect(((Rect)(ref val)).x + 318f, num2, 140f, 30f), EmpressCompanionPersonality.Elegant, "Elegant"); EmpressDrawPersonalityButton(new Rect(((Rect)(ref val)).x + 468f, num2, 140f, 30f), EmpressCompanionPersonality.Protective, "Protective"); num2 += 54f; GUI.Label(new Rect(((Rect)(ref val)).x + 18f, num2, num, 22f), "C:\\EmpressOS> optional_memorial_info", _empressSmallStyle); GUI.SetNextControlName("State"); _empressSetupState = GUI.TextField(new Rect(((Rect)(ref val)).x + 18f, num2 + 24f, num * 0.48f, 28f), _empressSetupState, 32, _empressFieldStyle); GUI.SetNextControlName("Country"); _empressSetupCountry = GUI.TextField(new Rect(((Rect)(ref val)).x + ((Rect)(ref val)).width * 0.52f, num2 + 24f, num * 0.48f, 28f), _empressSetupCountry, 32, _empressFieldStyle); GUI.Label(new Rect(((Rect)(ref val)).x + 18f, num2 + 54f, num, 20f), "State / province on the left, country on the right. Stored locally only if you fill it in.", _empressSmallStyle); num2 += 92f; bool value = EmpressCompanionPlugin.CompanionConfig.TextSoundsEnabled.Value; string text = (value ? "Typing sounds on" : "Typing sounds off"); if (GUI.Button(new Rect(((Rect)(ref val)).x + 18f, num2, 170f, 30f), text, _empressButtonStyle)) { EmpressCompanionPlugin.CompanionConfig.TextSoundsEnabled.Value = !value; } if (GUI.Button(new Rect(((Rect)(ref val)).x + ((Rect)(ref val)).width - 218f, num2, 200f, 34f), "Create companion", _empressSelectedButtonStyle)) { EmpressCreateProfileFromSetup(); } EmpressCompanionMemorial memorial = EmpressCompanionMemory.Memorial; if (memorial != null) { Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(((Rect)(ref val)).x + 18f, ((Rect)(ref val)).yMax - 118f, ((Rect)(ref val)).width - 36f, 92f); GUI.DrawTexture(val2, (Texture)(object)_empressPanelTexture); GUI.Label(new Rect(((Rect)(ref val2)).x + 12f, ((Rect)(ref val2)).y + 10f, ((Rect)(ref val2)).width - 24f, 18f), "C:\\EmpressOS> last_companion_memory", _empressTitleStyle); GUI.Label(new Rect(((Rect)(ref val2)).x + 12f, ((Rect)(ref val2)).y + 34f, ((Rect)(ref val2)).width - 24f, 48f), memorial.CompanionName + " faded in " + memorial.LastScene + " at " + memorial.DiedAt + ". " + memorial.Summary, _empressBootBodyStyle); } } private void EmpressDrawPersonalityButton(Rect rect, EmpressCompanionPersonality personality, string label) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) GUIStyle val = ((_empressSetupPersonality == personality) ? _empressSelectedButtonStyle : _empressButtonStyle); if (GUI.Button(rect, label, val)) { _empressSetupPersonality = personality; } } private void EmpressCreateProfileFromSetup() { //IL_0082: Unknown result type (might be due to invalid IL or missing references) string text = (string.IsNullOrWhiteSpace(_empressSetupCompanionName) ? "Empress" : _empressSetupCompanionName.Trim()); string playerName = (string.IsNullOrWhiteSpace(_empressSetupPlayerName) ? "Player" : _empressSetupPlayerName.Trim()); EmpressCompanionMemory.EmpressCreateProfile(text, playerName, _empressSetupPersonality, _empressSetupState, _empressSetupCountry); _empressSetupVisible = false; _empressSetupSeeded = false; EmpressPushMessage(text, "Link established. I am here now.", new Color(1f, 0.82f, 0.92f, 1f), urgent: true, 5f); } private void EmpressSeedSetupFields() { _empressSetupSeeded = true; EmpressCompanionMemorial memorial = EmpressCompanionMemory.Memorial; _empressSetupCompanionName = ((memorial != null && !string.IsNullOrWhiteSpace(memorial.CompanionName)) ? memorial.CompanionName : "Empress"); _empressSetupPlayerName = ((memorial != null && !string.IsNullOrWhiteSpace(memorial.PlayerName)) ? memorial.PlayerName : "Player"); _empressSetupState = memorial?.State ?? string.Empty; _empressSetupCountry = memorial?.Country ?? string.Empty; _empressSetupPersonality = memorial?.Personality ?? EmpressCompanionPersonality.Sweet; } private void EmpressBuildTextures() { //IL_0015: 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_005d: 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_00a5: 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_00ed: 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_0135: Unknown result type (might be due to invalid IL or missing references) _empressPanelTexture = EmpressMakeTexture(new Color(0.015f, 0.01f, 0.018f, 0.95f)); _empressHeaderTexture = EmpressMakeTexture(new Color(0.78f, 0.08f, 0.44f, 0.98f)); _empressBarBackTexture = EmpressMakeTexture(new Color(0.12f, 0.055f, 0.095f, 1f)); _empressBarFillTexture = EmpressMakeTexture(new Color(1f, 0.28f, 0.76f, 1f)); _empressBootTexture = EmpressMakeTexture(new Color(0.01f, 0.006f, 0.014f, 0.985f)); _empressFieldTexture = EmpressMakeTexture(new Color(0.035f, 0.018f, 0.034f, 0.98f)); _empressButtonTexture = EmpressMakeTexture(new Color(0.12f, 0.035f, 0.09f, 0.98f)); _empressButtonHoverTexture = EmpressMakeTexture(new Color(0.26f, 0.055f, 0.17f, 0.98f)); _empressSelectedButtonTexture = EmpressMakeTexture(new Color(0.72f, 0.08f, 0.42f, 0.98f)); _empressCursorTexture = EmpressMakeCursorTexture(); } private void EmpressBuildStyles() { //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) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0068: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_00ee: Expected O, but got Unknown //IL_00f9: 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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Expected O, but got Unknown //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Expected O, but got Unknown //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) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Expected O, but got Unknown //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Expected O, but got Unknown //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: 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_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Expected O, but got Unknown //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0370: Unknown result type (might be due to invalid IL or missing references) //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: 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_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Expected O, but got Unknown //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_0420: Unknown result type (might be due to invalid IL or missing references) //IL_042a: 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_0441: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_0461: Expected O, but got Unknown //IL_046c: Unknown result type (might be due to invalid IL or missing references) //IL_0471: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_0487: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0495: 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: Expected O, but got Unknown Font val = Font.CreateDynamicFontFromOSFont(new string[4] { "Consolas", "Lucida Console", "Courier New", "Segoe UI" }, 16); if ((Object)(object)val == (Object)null) { val = GUI.skin.font; } GUIStyle val2 = new GUIStyle(GUI.skin.label) { font = val, fontSize = 16, fontStyle = (FontStyle)1 }; val2.normal.textColor = new Color(1f, 0.9f, 0.97f, 1f); val2.alignment = (TextAnchor)3; _empressTitleStyle = val2; GUIStyle val3 = new GUIStyle(GUI.skin.label) { font = val, fontSize = 15, wordWrap = true, richText = true }; val3.normal.textColor = new Color(1f, 0.91f, 0.97f, 1f); _empressBodyStyle = val3; GUIStyle val4 = new GUIStyle(GUI.skin.label) { font = val, fontSize = 12, wordWrap = true, alignment = (TextAnchor)3 }; val4.normal.textColor = new Color(1f, 0.58f, 0.84f, 1f); _empressSmallStyle = val4; GUIStyle val5 = new GUIStyle(GUI.skin.label) { font = val, fontSize = 13, alignment = (TextAnchor)3, clipping = (TextClipping)1 }; val5.normal.textColor = new Color(1f, 0.86f, 0.95f, 1f); _empressStatusStyle = val5; GUIStyle val6 = new GUIStyle(GUI.skin.label) { font = val, fontSize = 24, fontStyle = (FontStyle)1 }; val6.normal.textColor = new Color(1f, 0.9f, 0.97f, 1f); val6.alignment = (TextAnchor)3; _empressBootTitleStyle = val6; GUIStyle val7 = new GUIStyle(GUI.skin.label) { font = val, fontSize = 14, wordWrap = true }; val7.normal.textColor = new Color(1f, 0.82f, 0.94f, 1f); _empressBootBodyStyle = val7; GUIStyle val8 = new GUIStyle(GUI.skin.textField) { font = val, fontSize = 14 }; val8.normal.textColor = new Color(1f, 0.78f, 0.92f, 1f); val8.normal.background = _empressFieldTexture; val8.focused.textColor = new Color(1f, 0.9f, 0.98f, 1f); val8.focused.background = _empressFieldTexture; val8.hover.textColor = new Color(1f, 0.86f, 0.96f, 1f); val8.hover.background = _empressFieldTexture; val8.active.textColor = new Color(1f, 0.9f, 0.98f, 1f); val8.active.background = _empressFieldTexture; _empressFieldStyle = val8; GUIStyle val9 = new GUIStyle(GUI.skin.button) { font = val, fontSize = 13 }; val9.normal.textColor = new Color(1f, 0.84f, 0.95f, 1f); val9.normal.background = _empressButtonTexture; val9.hover.textColor = Color.white; val9.hover.background = _empressButtonHoverTexture; val9.active.textColor = Color.white; val9.active.background = _empressSelectedButtonTexture; val9.alignment = (TextAnchor)4; _empressButtonStyle = val9; GUIStyle val10 = new GUIStyle(_empressButtonStyle); val10.normal.textColor = new Color(1f, 0.92f, 0.98f, 1f); val10.normal.background = _empressSelectedButtonTexture; val10.hover.textColor = Color.white; val10.hover.background = _empressSelectedButtonTexture; val10.active.textColor = Color.white; val10.active.background = _empressButtonHoverTexture; _empressSelectedButtonStyle = val10; GUIStyle val11 = new GUIStyle(GUI.skin.label) { font = val, fontSize = 22, fontStyle = (FontStyle)1, alignment = (TextAnchor)4, wordWrap = true }; val11.normal.textColor = new Color(1f, 0.58f, 0.86f, 1f); _empressLossStyle = val11; _empressStylesReady = true; } private static Texture2D EmpressMakeTexture(Color color) { //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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown Texture2D val = new Texture2D(1, 1, (TextureFormat)5, false); val.SetPixel(0, 0, color); val.Apply(); return val; } private static Texture2D EmpressMakeCursorTexture() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) Texture2D val = new Texture2D(14, 20, (TextureFormat)5, false); Color val2 = default(Color); ((Color)(ref val2))..ctor(0f, 0f, 0f, 0f); Color val3 = default(Color); ((Color)(ref val3))..ctor(0.06f, 0.1f, 0.16f, 1f); Color val4 = default(Color); ((Color)(ref val4))..ctor(1f, 0.5f, 0.82f, 1f); for (int i = 0; i < ((Texture)val).height; i++) { for (int j = 0; j < ((Texture)val).width; j++) { val.SetPixel(j, i, val2); } } int[] array = new int[16] { 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 3, 3, 2, 2, 1, 1 }; for (int k = 0; k < array.Length; k++) { int num = array[k]; for (int l = 0; l < num; l++) { val.SetPixel(l, k, val4); if (l == num - 1 || k == 0 || k == array.Length - 1) { val.SetPixel(l, k, val3); } } } val.Apply(); return val; } private void EmpressTickSetupMode() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) if (!_empressSetupVisible || _empressMultiplayerLocked) { EmpressReleaseSetupMode(); return; } if (!_empressSetupPauseActive) { _empressSetupPauseActive = true; _empressPreviousTimeScale = ((Time.timeScale > 0f) ? Time.timeScale : 1f); _empressPreviousCursorLock = Cursor.lockState; _empressPreviousCursorVisible = Cursor.visible; _empressPreviousAudioPause = AudioListener.pause; } Time.timeScale = 0f; AudioListener.pause = true; Cursor.lockState = (CursorLockMode)0; Cursor.visible = false; _empressUiVisible = true; } private void EmpressReleaseSetupMode() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (_empressSetupPauseActive) { _empressSetupPauseActive = false; Time.timeScale = ((_empressPreviousTimeScale > 0f) ? _empressPreviousTimeScale : 1f); AudioListener.pause = _empressPreviousAudioPause; Cursor.lockState = _empressPreviousCursorLock; Cursor.visible = _empressPreviousCursorVisible; } } private void EmpressDrawCursor(float width, float height, float scale) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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) if (!((Object)(object)_empressCursorTexture == (Object)null)) { Event current = Event.current; if (current != null) { Vector2 mousePosition = current.mousePosition; float x = mousePosition.x; float y = mousePosition.y; GUI.DrawTexture(new Rect(x + 2f, y + 2f, 14f, 20f), (Texture)(object)_empressCursorTexture); } } } private static string EmpressEscapeRichText(string value) { return value.Replace("<", "<").Replace(">", ">"); } } [BepInPlugin("empress.repo.aicompanion", "Lovebound_AI", "1.0.1")] public sealed class EmpressCompanionPlugin : BaseUnityPlugin { public const string PluginGuid = "empress.repo.aicompanion"; public const string PluginName = "Lovebound_AI"; public const string PluginVersion = "1.0.1"; private static GameObject? EmpressRuntimeHost; internal static EmpressCompanionPlugin Plugin { get; private set; } internal static EmpressCompanionConfig CompanionConfig { get; private set; } internal static EmpressCompanionAudio Audio { get; private set; } private void Awake() { Plugin = this; CompanionConfig = new EmpressCompanionConfig(((BaseUnityPlugin)this).Config); Audio = new EmpressCompanionAudio(); EmpressEnsureRuntimeHost(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"[Empress Companion] loaded"); } internal static void EmpressEnsureRuntimeHost() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown EmpressCompanionRuntime empressCompanionRuntime = default(EmpressCompanionRuntime); if (!((Object)(object)EmpressRuntimeHost != (Object)null) || !EmpressRuntimeHost.TryGetComponent(ref empressCompanionRuntime)) { EmpressRuntimeHost = new GameObject("EmpressCompanionRuntimeHost"); ((Object)EmpressRuntimeHost).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)EmpressRuntimeHost); EmpressRuntimeHost.AddComponent(); EmpressRuntimeHost.AddComponent(); } } internal static void EmpressInfo(string message) { ((BaseUnityPlugin)Plugin).Logger.LogInfo((object)("[Empress Companion] " + message)); } internal static void EmpressWarning(string message) { ((BaseUnityPlugin)Plugin).Logger.LogWarning((object)("[Empress Companion] " + message)); } internal static void EmpressError(string message) { ((BaseUnityPlugin)Plugin).Logger.LogError((object)("[Empress Companion] " + message)); } internal static void EmpressDebug(string message) { if (CompanionConfig.DebugLogging.Value) { ((BaseUnityPlugin)Plugin).Logger.LogInfo((object)("[Empress Companion] " + message)); } } } internal sealed class EmpressCompanionProjection : MonoBehaviour { private const float EmpressTeleportBackDistance = 30f; private Transform _target; private Transform _carryAnchor; private NavMeshAgent _agent; private Animator[] _animators = Array.Empty(); private Vector3 _sideOffset = new Vector3(-1.25f, 0.05f, 1.25f); private Vector3 _manualDestination; private Vector3 _interestPoint; private Vector3 _lastPosition; private Vector3 _lastFramePosition; private float _nextRetargetAt; private float _interestUntil; private float _stuckCheckAt; private float _stuckTimer; private bool _agentReady; private bool _hasManualDestination; internal void EmpressBind(PlayerAvatar player, string companionName) { //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: 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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) _target = (((Object)(object)player != (Object)null) ? ((Component)player).transform : null); ((Object)((Component)this).gameObject).name = (string.IsNullOrWhiteSpace(companionName) ? "Empress pink avatar companion" : (companionName + " pink avatar companion")); EmpressEnsureCarryAnchor(); EmpressSetupAgent(); EmpressSetupAnimators(); if ((Object)(object)_target != (Object)null) { Vector3 val = _target.TransformPoint(_sideOffset); if (_agentReady && EmpressSampleNavMesh(val, 8f, out var point)) { _agent.Warp(point); } else { ((Component)this).transform.position = val; } _manualDestination = val; } _lastFramePosition = ((Component)this).transform.position; } internal void EmpressMoveTo(Vector3 worldPosition, float holdSeconds) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: 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) _interestPoint = worldPosition; _interestUntil = Time.unscaledTime + Mathf.Clamp(holdSeconds, 1.5f, 10f); _nextRetargetAt = 0f; EmpressSetDestination(worldPosition); } internal void EmpressOrbitNow() { _interestUntil = 0f; _nextRetargetAt = 0f; } internal Transform EmpressGetCarryAnchor() { EmpressEnsureCarryAnchor(); if (!((Object)(object)_carryAnchor != (Object)null)) { return ((Component)this).transform; } return _carryAnchor; } internal Vector3 EmpressGetCastOrigin() { //IL_0006: 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_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_0025: 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_0034: Unknown result type (might be due to invalid IL or missing references) return EmpressGetCarryAnchor().position + ((Component)this).transform.forward * 0.08f + Vector3.up * 0.08f; } private void EmpressSetupAgent() { //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_agent != (Object)null)) { _agent = ((Component)this).gameObject.GetComponent(); if ((Object)(object)_agent == (Object)null) { _agent = ((Component)this).gameObject.AddComponent(); } _agent.radius = 0.28f; _agent.height = 1.55f; _agent.speed = 4.2f; _agent.acceleration = 18f; _agent.angularSpeed = 720f; _agent.stoppingDistance = 0.45f; _agent.autoBraking = true; _agent.avoidancePriority = 42; _agent.updateRotation = false; _agentReady = EmpressPlaceAgentNear(((Component)this).transform.position); _lastPosition = ((Component)this).transform.position; } } private void EmpressSetupAnimators() { _animators = ((Component)this).GetComponentsInChildren(true); for (int i = 0; i < _animators.Length; i++) { Animator val = _animators[i]; if (Object.op_Implicit((Object)(object)val)) { ((Behaviour)val).enabled = true; val.applyRootMotion = false; val.speed = 1f; val.cullingMode = (AnimatorCullingMode)0; } } } private void EmpressEnsureCarryAnchor() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_0063: 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) if (!((Object)(object)_carryAnchor != (Object)null)) { Transform val = ((Component)this).transform.Find("EmpressCarryAnchor"); if ((Object)(object)val != (Object)null) { _carryAnchor = val; return; } GameObject val2 = new GameObject("EmpressCarryAnchor"); val2.transform.SetParent(((Component)this).transform, false); val2.transform.localPosition = new Vector3(0f, 1.08f, 0.42f); val2.transform.localRotation = Quaternion.identity; _carryAnchor = val2.transform; } } private void Update() { //IL_0020: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_target == (Object)null) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } float num = Vector3.Distance(((Component)this).transform.position, _target.position); if (num > 30f) { EmpressPlaceAgentNear(_target.TransformPoint(_sideOffset)); } if (_agentReady && ((Object)(object)_agent == (Object)null || !_agent.isOnNavMesh)) { _agentReady = EmpressPlaceAgentNear(((Component)this).transform.position); } if (Time.unscaledTime >= _nextRetargetAt) { _nextRetargetAt = Time.unscaledTime + Random.Range(1.4f, 2.8f); EmpressPickDestination(num); } if (!_agentReady) { EmpressManualMove(); } EmpressCheckStuck(); EmpressFaceMovementOrPlayer(); EmpressTickAnimation(); } private void EmpressPickDestination(float distanceToPlayer) { //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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) if (Time.unscaledTime < _interestUntil) { Vector3 val = Random.insideUnitSphere; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.01f) { val = Vector3.forward; } EmpressSetDestination(_interestPoint + ((Vector3)(ref val)).normalized * Random.Range(0.8f, 2.2f)); return; } Vector3 val2 = Random.insideUnitSphere; val2.y = 0f; if (((Vector3)(ref val2)).sqrMagnitude < 0.01f) { val2 = _target.right; } float num = ((distanceToPlayer > 8f) ? 1.8f : 2.4f); float num2 = ((distanceToPlayer > 12f) ? 3.2f : 6.5f); Vector3 worldPosition = _target.position + ((Vector3)(ref val2)).normalized * Random.Range(num, num2); EmpressSetDestination(worldPosition); } private void EmpressSetDestination(Vector3 worldPosition) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_002c: Unknown result type (might be due to invalid IL or missing references) _manualDestination = worldPosition; _hasManualDestination = true; if (_agentReady) { if (EmpressSampleNavMesh(worldPosition, 4f, out var point)) { _agent.SetDestination(point); } else { _agent.SetDestination(worldPosition); } } } private void EmpressManualMove() { //IL_0032: 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_0048: 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_001a: Unknown result type (might be due to invalid IL or missing references) if (!_hasManualDestination) { _manualDestination = _target.TransformPoint(_sideOffset); _hasManualDestination = true; } ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, _manualDestination, 3.6f * Time.deltaTime); } 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_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_006a: 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_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_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_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) 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_009e; } } val = ((!_hasManualDestination || !(Vector3.Distance(((Component)this).transform.position, _manualDestination) > 0.5f)) ? (_target.position - ((Component)this).transform.position) : (_manualDestination - ((Component)this).transform.position)); goto IL_009e; IL_009e: 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.deltaTime * 8.5f)); } } private void EmpressTickAnimation() { //IL_002b: 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_0040: 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_0045: 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) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Invalid comparison between Unknown and I4 //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Invalid comparison between Unknown and I4 //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) if (_animators == null || _animators.Length == 0) { return; } Vector3 val = ((Time.deltaTime > 0.0001f) ? ((((Component)this).transform.position - _lastFramePosition) / Time.deltaTime) : Vector3.zero); _lastFramePosition = ((Component)this).transform.position; if (_agentReady && (Object)(object)_agent != (Object)null) { Vector3 velocity = _agent.velocity; if (((Vector3)(ref velocity)).sqrMagnitude > ((Vector3)(ref val)).sqrMagnitude) { val = _agent.velocity; } } Vector3 val2 = val; val2.y = 0f; float magnitude = ((Vector3)(ref val2)).magnitude; bool flag = magnitude > 0.08f; float num = Mathf.Clamp01(magnitude / Mathf.Max(1.5f, ((Object)(object)_agent != (Object)null) ? _agent.speed : 4.2f)); Vector3 val3 = ((Component)this).transform.InverseTransformDirection(val2); for (int i = 0; i < _animators.Length; i++) { Animator val4 = _animators[i]; if (!Object.op_Implicit((Object)(object)val4)) { continue; } AnimatorControllerParameter[] parameters = val4.parameters; foreach (AnimatorControllerParameter val5 in parameters) { string text = val5.name.ToLowerInvariant(); AnimatorControllerParameterType type = val5.type; if ((int)type != 1) { if ((int)type == 4) { if (text.Contains("moving") || text.Contains("move") || text.Contains("walk") || text.Contains("run")) { val4.SetBool(val5.nameHash, flag); } else if (text.Contains("ground")) { val4.SetBool(val5.nameHash, true); } } } else if (text.Contains("horizontal") || text.Contains("strafe")) { val4.SetFloat(val5.nameHash, val3.x); } else if (text.Contains("vertical") || text.Contains("forward")) { val4.SetFloat(val5.nameHash, val3.z); } else if (text.Contains("speed") || text.Contains("move") || text.Contains("velocity")) { val4.SetFloat(val5.nameHash, num); } } } } 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.2f; 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.5f && num < 0.08f) { _stuckTimer += 1.2f; } else { _stuckTimer = 0f; } if (_stuckTimer >= 3.6f) { _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_0032: 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(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; } } internal sealed class EmpressCompanionRuntime : MonoBehaviour { private const int EmpressMinimumShopPriceK = 1; private const int EmpressSafeExtractionBuffer = 500; private const int EmpressSmallCartSoftCapacity = 3; private const int EmpressLargeCartSoftCapacity = 7; private const int EmpressRecentLineMemory = 16; private const float EmpressDeathReplaySeconds = 10f; private const float EmpressCartExtractorSafetyRadius = 5.5f; private readonly Dictionary _empressLastBlessingAt = new Dictionary(24); private readonly Dictionary _empressTargetCooldownUntil = new Dictionary(128); private readonly Dictionary _empressBloomedTargets = new Dictionary(96); private readonly Dictionary _empressCartAssistBlockedUntil = new Dictionary(64); private readonly List _empressPinkRecords = new List(24); private readonly Queue _empressRecentLines = new Queue(17); private readonly Queue _empressDeathReplayFrames = new Queue(128); private ValuableObject[] _empressValuableCache = Array.Empty(); private ItemAttributes[] _empressItemCache = Array.Empty(); private Enemy[] _empressEnemyCache = Array.Empty(); private ExtractionPoint[] _empressExtractionCache = Array.Empty(); private PhysGrabCart[] _empressCartCache = Array.Empty(); private EmpressCompanionBlessingPlan _empressPendingBlessing; private EmpressRelationshipStage _empressLastStage; private EmpressCompanionMood _empressMood; private EmpressBlessingKind _empressLastExecutedKind; private EmpressCompanionProjection _empressAvatarProjection; private GameObject _empressDeathReplayGhost; private PhysGrabObject _empressManifestCarryObject; private PhysGrabCart _empressManifestCarryCart; private ValuableObject _empressManifestCarryValuable; private float _empressNextBlessingAt; private float _empressNextSceneScanAt; private float _empressNextPassiveLoveAt; private float _empressNextReactiveAssistAt; private float _empressNextTreasureAssistAt; private float _empressNextShopAssistAt; private float _empressNextMoodLineAt; private float _empressNextLocalFlavorAt; private float _empressNextManifestAssistAt; private float _empressNextManifestGuardAt; private float _empressNextManifestCartAssistAt; private float _empressNextManifestCartTugAt; private float _empressNextManifestCargoShieldAt; private float _empressNextManifestTreasurePingAt; private float _empressNextManifestHealAt; private float _empressNextManifestActiveLineAt; private float _empressNextManifestActionAt; private float _empressNextProjectionCommandAt; private float _empressNextReplaySampleAt; private float _empressLastWarningAt = -999f; private float _empressLastHaulNoticeAt = -999f; private float _empressManifestCarryStartedAt; private float _empressLastDamageAt = -999f; private float _empressSceneEnteredAt; private int _empressLastHealth = -1; private int _empressLastCurrency = -1; private int _empressLastHaul = -1; private int _empressLastLevelsCompleted = -1; private int _empressLastDamagedValuables = -1; private int _empressLastDamageAmount; private int _empressLastNearbyEnemiesAtDamage; private bool _empressBootGreetingDone; private bool _empressMultiplayerWarned; private bool _empressDeathCounted; private bool _empressStageInitialized; private bool _empressHasLastExecutedKind; private bool _empressManifestAnnounced; private bool _empressDebugLoveForced; private bool _empressManifestCarryAttached; private string _empressLastMoodLine = string.Empty; private string _empressLastDamageCause = string.Empty; private string _empressLastHeldObjectName = string.Empty; private string _empressSceneKey = string.Empty; private string _empressCurrentPlan = "Waiting"; private void Awake() { ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); EmpressCompanionMemory.EmpressLoad(); EmpressCompanionPlugin.Audio.EmpressInitialize((MonoBehaviour)(object)this); EmpressCompanionProfile profile = EmpressCompanionMemory.Profile; if (profile != null) { _empressLastStage = EmpressGetRelationshipStage(profile); _empressStageInitialized = true; } } private void OnEnable() { SceneManager.sceneLoaded += EmpressOnSceneLoaded; } private void OnDisable() { SceneManager.sceneLoaded -= EmpressOnSceneLoaded; } private void Update() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Invalid comparison between Unknown and I4 //IL_0485: Unknown result type (might be due to invalid IL or missing references) //IL_0488: Invalid comparison between Unknown and I4 EmpressCompanionPlugin.EmpressEnsureRuntimeHost(); EmpressCompanionPlugin.Audio.EmpressInitialize((MonoBehaviour)(object)this); EmpressCompanionOverlay instance = EmpressCompanionOverlay.Instance; if ((Object)(object)instance == (Object)null) { return; } EmpressCompanionMemory.EmpressTickSave(); Scene activeScene; if (EmpressCompanionPlugin.CompanionConfig.EmpressConsumeResetRequest()) { activeScene = SceneManager.GetActiveScene(); EmpressHandleManualReset(((Scene)(ref activeScene)).name, instance); return; } if (!EmpressCompanionPlugin.CompanionConfig.Enabled.Value) { EmpressDismissAvatarProjection(); activeScene = SceneManager.GetActiveScene(); instance.EmpressSetStatus(setupVisible: false, gameplayVisible: false, multiplayerLocked: false, "DISABLED", ((Scene)(ref activeScene)).name, 0f, "Sleeping", "Stranger", "Empress"); return; } GameManager gameManagerInstance = EmpressCompanionAccess.GameManagerInstance; RunManager runManagerInstance = EmpressCompanionAccess.RunManagerInstance; GameDirector gameDirectorInstance = EmpressCompanionAccess.GameDirectorInstance; string text = EmpressBuildSceneLabel(runManagerInstance); if ((Object)(object)gameManagerInstance == (Object)null || (Object)(object)runManagerInstance == (Object)null || (Object)(object)gameDirectorInstance == (Object)null) { instance.EmpressSetStatus(setupVisible: false, gameplayVisible: false, multiplayerLocked: false, "BOOT", text, 0f, "Initializing", "Stranger", "Empress"); return; } if (EmpressCompanionAccess.IsMultiplayer()) { EmpressDismissAvatarProjection(); if (!_empressMultiplayerWarned) { instance.EmpressPushMessage("Empress OS", "Companion mode is singleplayer only. I am not syncing romance across Photon.", new Color(1f, 0.76f, 0.9f, 1f), urgent: true); _empressMultiplayerWarned = true; } instance.EmpressSetStatus(setupVisible: false, gameplayVisible: false, multiplayerLocked: true, "MULTIPLAYER LOCK", text, 0f, "Dormant", "Stranger", "Empress"); return; } _empressMultiplayerWarned = false; EmpressCompanionProfile profile = EmpressCompanionMemory.Profile; if (profile == null) { _empressBootGreetingDone = false; _empressStageInitialized = false; _empressPendingBlessing = null; EmpressDismissAvatarProjection(); bool flag = EmpressCompanionMemory.Memorial?.AwaitFreshBoot ?? false; if (flag && !EmpressShouldOpenSetupAfterLoss(gameDirectorInstance)) { bool flag2 = EmpressCompanionAccess.RunIsArena(); instance.EmpressSetStatus(setupVisible: false, gameplayVisible: false, multiplayerLocked: false, flag2 ? "MEMORIAL" : "REBOOT WAIT", text, 0f, flag2 ? "Recording the loss" : "Waiting for a fresh run", "Stranger", "Empress"); } else { instance.EmpressSetStatus(setupVisible: true, gameplayVisible: false, multiplayerLocked: false, flag ? "REBOOT" : "SETUP", text, 0f, flag ? "Ready for a new link" : "Awaiting creation", "Stranger", "Empress"); } return; } PlayerAvatar localPlayer = EmpressCompanionAccess.GetLocalPlayer(); PlayerHealth playerHealth = EmpressCompanionAccess.GetPlayerHealth(localPlayer); if ((Object)(object)localPlayer == (Object)null || (Object)(object)playerHealth == (Object)null) { EmpressDismissAvatarProjection(); instance.EmpressSetStatus(setupVisible: false, gameplayVisible: false, multiplayerLocked: false, "LINK WAIT", text, profile.Love, "Looking for you", EmpressGetRelationshipStage(profile).ToString(), profile.CompanionName); return; } if (!_empressBootGreetingDone) { EmpressEnsureProfileLocation(profile); _empressBootGreetingDone = true; instance.EmpressPushMessage(profile.CompanionName, EmpressBuildBootGreeting(profile), new Color(1f, 0.78f, 0.93f, 1f), urgent: true, 6f); } EmpressSyncScene(profile, runManagerInstance, text); EmpressTickPinkRecords(); EmpressObservePlayer(profile, localPlayer, runManagerInstance, gameDirectorInstance, text, instance); EmpressTickDebugForceLove(profile, instance); EmpressUpdateRelationship(profile, instance); if (profile.Love <= 0.01f) { string cause = "Bond collapse after too many mistakes."; instance.EmpressShowLoss(profile.CompanionName + " faded out. Empress OS requires a new companion."); instance.EmpressPushMessage(profile.CompanionName, "My bond with you is gone. I cannot stay.", new Color(1f, 0.55f, 0.7f, 1f), urgent: true, 8f); EmpressCompanionMemory.EmpressKillCurrentCompanion(text, cause); _empressBootGreetingDone = false; _empressStageInitialized = false; _empressPendingBlessing = null; _empressSceneKey = string.Empty; _empressLastHealth = -1; _empressLastCurrency = -1; _empressLastHaul = -1; _empressLastLevelsCompleted = -1; _empressLastDamagedValuables = -1; EmpressDismissAvatarProjection(); return; } bool flag3 = EmpressSceneIsSupported(); bool flag4 = EmpressGameplayReady(gameDirectorInstance); if (!flag3 || !flag4) { if (!flag3) { EmpressDismissAvatarProjection(); } instance.EmpressSetStatus(setupVisible: false, gameplayVisible: false, multiplayerLocked: false, flag3 ? "SYNCING" : "LINKED", text, profile.Love, flag3 ? "Preparing space" : "Watching softly", EmpressGetRelationshipStage(profile).ToString(), profile.CompanionName); return; } EmpressRefreshSceneCachesIfNeeded(); EmpressRecordDeathReplayFrame(localPlayer, text); if (EmpressCompanionAccess.IsDead(localPlayer)) { EmpressDismissAvatarProjection(); instance.EmpressSetStatus(setupVisible: false, gameplayVisible: true, multiplayerLocked: false, "RECOVERING", text, profile.Love, "Mourning", EmpressGetRelationshipStage(profile).ToString(), profile.CompanionName); return; } gameState gameState = EmpressCompanionAccess.GetGameState(gameDirectorInstance); if ((int)gameState != 2 && (int)gameState != 1) { instance.EmpressSetStatus(setupVisible: false, gameplayVisible: true, multiplayerLocked: false, "WAITING", text, profile.Love, _empressCurrentPlan, EmpressGetRelationshipStage(profile).ToString(), profile.CompanionName); return; } EmpressTickSituationalAwareness(profile, localPlayer, text, instance); EmpressTickAvatarManifestation(profile, localPlayer, instance); EmpressTickPassiveCompanion(profile, localPlayer, text, instance); EmpressTickBlessings(profile, localPlayer, text, instance); instance.EmpressSetStatus(setupVisible: false, gameplayVisible: true, multiplayerLocked: false, EmpressCompanionAccess.RunIsShop() ? "SHOP BLESSING" : "COMPANION", text, profile.Love, _empressCurrentPlan, EmpressGetRelationshipStage(profile).ToString(), profile.CompanionName); } private void EmpressHandleManualReset(string sceneLabel, EmpressCompanionOverlay overlay) { //IL_0116: Unknown result type (might be due to invalid IL or missing references) EmpressCompanionMemory.EmpressResetCurrentCompanion(sceneLabel); _empressBootGreetingDone = false; _empressStageInitialized = false; _empressPendingBlessing = null; _empressLastStage = EmpressRelationshipStage.Stranger; _empressMood = EmpressCompanionMood.Calm; _empressHasLastExecutedKind = false; _empressManifestAnnounced = false; _empressDebugLoveForced = false; _empressSceneKey = string.Empty; _empressLastHealth = -1; _empressLastCurrency = -1; _empressLastHaul = -1; _empressLastLevelsCompleted = -1; _empressLastDamagedValuables = -1; _empressLastDamageAmount = 0; _empressLastNearbyEnemiesAtDamage = 0; _empressLastDamageCause = string.Empty; _empressLastHeldObjectName = string.Empty; _empressCurrentPlan = "Awaiting creation"; _empressTargetCooldownUntil.Clear(); _empressBloomedTargets.Clear(); _empressCartAssistBlockedUntil.Clear(); _empressRecentLines.Clear(); _empressDeathReplayFrames.Clear(); _empressDeathCounted = false; EmpressClearManifestCarryTask(releaseNearProjection: true); EmpressDismissDeathReplayGhost(); EmpressDismissAvatarProjection(); overlay.EmpressShowLoss("Companion reset. Fresh setup shell unlocked."); overlay.EmpressPushMessage("Empress OS", "Active companion link purged. Build a new one and try not to emotionally blue-screen her this time.", new Color(1f, 0.76f, 0.9f, 1f), urgent: true); overlay.EmpressSetStatus(setupVisible: true, gameplayVisible: false, multiplayerLocked: false, "SETUP", sceneLabel, 0f, "Awaiting creation", "Stranger", "Empress"); } private void EmpressOnSceneLoaded(Scene scene, LoadSceneMode mode) { _empressSceneKey = string.Empty; _empressPendingBlessing = null; _empressNextSceneScanAt = 0f; _empressLastHealth = -1; _empressLastCurrency = -1; _empressLastHaul = -1; _empressLastDamagedValuables = -1; _empressLastHaulNoticeAt = -999f; _empressNextReactiveAssistAt = 0f; _empressNextTreasureAssistAt = 0f; _empressNextShopAssistAt = 0f; _empressNextMoodLineAt = 0f; _empressNextLocalFlavorAt = 0f; _empressNextManifestAssistAt = 0f; _empressNextManifestGuardAt = 0f; _empressNextManifestCartAssistAt = 0f; _empressNextManifestCartTugAt = 0f; _empressNextManifestCargoShieldAt = 0f; _empressNextManifestTreasurePingAt = 0f; _empressNextManifestHealAt = 0f; _empressNextManifestActiveLineAt = 0f; _empressNextManifestActionAt = 0f; _empressNextProjectionCommandAt = 0f; _empressNextReplaySampleAt = 0f; _empressDeathCounted = false; _empressManifestAnnounced = false; _empressTargetCooldownUntil.Clear(); _empressBloomedTargets.Clear(); _empressCartAssistBlockedUntil.Clear(); _empressRecentLines.Clear(); _empressDeathReplayFrames.Clear(); _empressLastDamageAt = -999f; _empressLastDamageAmount = 0; _empressLastNearbyEnemiesAtDamage = 0; _empressLastDamageCause = string.Empty; _empressLastHeldObjectName = string.Empty; EmpressClearManifestCarryTask(releaseNearProjection: true); EmpressDismissDeathReplayGhost(); EmpressDismissAvatarProjection(); _empressCurrentPlan = "Rebuilding " + ((Scene)(ref scene)).name; } private static bool EmpressSceneIsSupported() { if (!EmpressCompanionAccess.RunIsArena()) { if (!EmpressCompanionAccess.RunIsLevel()) { return EmpressCompanionAccess.RunIsShop(); } return true; } return false; } private static bool EmpressShouldOpenSetupAfterLoss(GameDirector director) { //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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Invalid comparison between Unknown and I4 //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Invalid comparison between Unknown and I4 if (EmpressCompanionAccess.RunIsArena() || !EmpressSceneIsSupported() || !EmpressGameplayReady(director)) { return false; } gameState gameState = EmpressCompanionAccess.GetGameState(director); if ((int)gameState != 2 && (int)gameState != 1) { return false; } PlayerAvatar localPlayer = EmpressCompanionAccess.GetLocalPlayer(); if ((Object)(object)localPlayer != (Object)null && (Object)(object)EmpressCompanionAccess.GetPlayerHealth(localPlayer) != (Object)null) { return !EmpressCompanionAccess.IsDead(localPlayer); } return false; } private static bool EmpressGameplayReady(GameDirector director) { LevelGenerator levelGeneratorInstance = EmpressCompanionAccess.LevelGeneratorInstance; if ((Object)(object)levelGeneratorInstance != (Object)null && !EmpressCompanionAccess.IsLevelGenerated(levelGeneratorInstance)) { return false; } if (EmpressCompanionAccess.GetPlayerCount(director) <= 0) { return (Object)(object)PlayerAvatar.instance != (Object)null; } return true; } private static string EmpressBuildSceneLabel(RunManager runManager) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) Level currentLevel = EmpressCompanionAccess.GetCurrentLevel(runManager); if ((Object)(object)currentLevel != (Object)null && !string.IsNullOrWhiteSpace(((Object)currentLevel).name)) { return ((Object)currentLevel).name; } Scene activeScene = SceneManager.GetActiveScene(); return ((Scene)(ref activeScene)).name; } private void EmpressSyncScene(EmpressCompanionProfile profile, RunManager runManager, string sceneLabel) { //IL_002d: 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) string[] obj = new string[5] { sceneLabel, "|", EmpressCompanionAccess.GetLevelsCompleted(runManager).ToString(), "|", null }; Scene activeScene = SceneManager.GetActiveScene(); obj[4] = ((Scene)(ref activeScene)).buildIndex.ToString(); string text = string.Concat(obj); if (!(text == _empressSceneKey)) { _empressSceneKey = text; _empressSceneEnteredAt = Time.unscaledTime; _empressNextBlessingAt = _empressSceneEnteredAt + Random.Range(12f, 22f); _empressNextPassiveLoveAt = _empressSceneEnteredAt + 40f; _empressPendingBlessing = null; _empressCurrentPlan = (EmpressCompanionAccess.RunIsShop() ? "Reviewing prices" : "Reading the room"); _empressLastCurrency = EmpressCompanionAccess.GetRunCurrency(); RoundDirector roundDirectorInstance = EmpressCompanionAccess.RoundDirectorInstance; _empressLastHaul = (((Object)(object)roundDirectorInstance != (Object)null) ? EmpressCompanionAccess.GetCurrentHaul(roundDirectorInstance) : 0); _empressLastLevelsCompleted = EmpressCompanionAccess.GetLevelsCompleted(runManager); _empressLastDamagedValuables = -1; _empressLastHaulNoticeAt = -999f; _empressNextReactiveAssistAt = _empressSceneEnteredAt + 5f; _empressNextTreasureAssistAt = _empressSceneEnteredAt + 8f; _empressNextShopAssistAt = _empressSceneEnteredAt + 6f; _empressNextMoodLineAt = _empressSceneEnteredAt + Random.Range(18f, 32f); _empressNextLocalFlavorAt = _empressSceneEnteredAt + Random.Range(34f, 68f); _empressNextManifestAssistAt = _empressSceneEnteredAt + Random.Range(8f, 14f); _empressNextManifestGuardAt = _empressSceneEnteredAt + Random.Range(1.2f, 2.4f); _empressNextManifestCartAssistAt = _empressSceneEnteredAt + Random.Range(3f, 5f); _empressNextManifestCartTugAt = _empressSceneEnteredAt + Random.Range(5f, 8f); _empressNextManifestCargoShieldAt = _empressSceneEnteredAt + Random.Range(4f, 7f); _empressNextManifestTreasurePingAt = _empressSceneEnteredAt + Random.Range(18f, 30f); _empressNextManifestHealAt = _empressSceneEnteredAt + Random.Range(4f, 7f); _empressNextManifestActiveLineAt = _empressSceneEnteredAt + Random.Range(8f, 14f); _empressNextManifestActionAt = _empressSceneEnteredAt + Random.Range(1.2f, 2.5f); _empressNextProjectionCommandAt = _empressSceneEnteredAt + Random.Range(2f, 4f); _empressNextReplaySampleAt = _empressSceneEnteredAt + 0.05f; profile.LastScene = sceneLabel; EmpressCompanionMemory.EmpressMarkDirty(); } } private void EmpressEnsureProfileLocation(EmpressCompanionProfile profile) { if (profile == null) { return; } bool flag = false; if (string.IsNullOrWhiteSpace(profile.Country)) { try { RegionInfo currentRegion = RegionInfo.CurrentRegion; string text = ((currentRegion != null) ? currentRegion.EnglishName : string.Empty); if (!string.IsNullOrWhiteSpace(text) && !string.Equals(text, "World", StringComparison.OrdinalIgnoreCase)) { profile.Country = text.Trim(); flag = true; } } catch { } } if (flag) { EmpressCompanionMemory.EmpressMarkDirty(); } } private void EmpressRecordDeathReplayFrame(PlayerAvatar player, string sceneLabel) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null) && !(Time.unscaledTime < _empressNextReplaySampleAt)) { _empressNextReplaySampleAt = Time.unscaledTime + 0.2f; PlayerHealth playerHealth = EmpressCompanionAccess.GetPlayerHealth(player); int health = EmpressCompanionAccess.GetHealth(playerHealth); int maxHealth = EmpressCompanionAccess.GetMaxHealth(playerHealth); int num = EmpressCountNearbyEnemies(((Component)player).transform.position, 12f); string text = _empressLastHeldObjectName; if (string.IsNullOrWhiteSpace(text)) { PhysGrabObject heldObject = EmpressCompanionAccess.GetHeldObject(); text = (((Object)(object)heldObject != (Object)null) ? ((Object)heldObject).name : string.Empty); } string text2 = ((num > 0) ? (num + " threat" + ((num == 1) ? string.Empty : "s")) : "quiet"); if (!string.IsNullOrWhiteSpace(text)) { text2 = text2 + " | " + text; } else if (!string.IsNullOrWhiteSpace(sceneLabel)) { text2 = text2 + " | " + sceneLabel; } _empressDeathReplayFrames.Enqueue(new EmpressDeathReplayFrame { RecordedAt = Time.unscaledTime, Position = ((Component)player).transform.position, Rotation = ((Component)player).transform.rotation, Health = health, MaxHealth = maxHealth, NearbyEnemies = num, HeldObjectName = (text ?? string.Empty), Note = text2 }); while (_empressDeathReplayFrames.Count > 0 && Time.unscaledTime - _empressDeathReplayFrames.Peek().RecordedAt > 10f) { _empressDeathReplayFrames.Dequeue(); } } } private string EmpressInferDamageCause(PlayerAvatar player, int delta, int nearbyEnemies, ValuableObject observedHeldValuable, string sceneLabel) { string text = (((Object)(object)observedHeldValuable != (Object)null) ? ((Object)observedHeldValuable).name : _empressLastHeldObjectName); if (!string.IsNullOrWhiteSpace(text) && nearbyEnemies > 0) { return "an enemy got through while you were handling " + text; } if (!string.IsNullOrWhiteSpace(text)) { return "you took a bad hit while carrying " + text; } if (nearbyEnemies >= 3) { return "multiple enemies folded the space around you"; } switch (nearbyEnemies) { case 2: return "two enemies pressed you at once"; case 1: return "an enemy got close enough to land the hit"; default: if (delta >= 34) { return "a heavy impact knocked the breath out of you"; } if (!string.IsNullOrWhiteSpace(sceneLabel)) { return sceneLabel + " caught you at a bad angle"; } return "the room found an opening"; } } private string EmpressBuildDeathCause(string sceneLabel) { if (!string.IsNullOrWhiteSpace(_empressLastDamageCause) && Time.unscaledTime - _empressLastDamageAt <= 14f) { return _empressLastDamageCause; } if (_empressLastNearbyEnemiesAtDamage >= 2) { return "too many enemies reached you at once"; } if (_empressLastNearbyEnemiesAtDamage == 1) { return "an enemy slipped into your space"; } if (!string.IsNullOrWhiteSpace(_empressLastHeldObjectName)) { return "you went down while handling " + _empressLastHeldObjectName; } if (string.IsNullOrWhiteSpace(sceneLabel)) { return "the room got the last word"; } return sceneLabel + " took the last swing"; } private void EmpressStartDeathReview(EmpressCompanionProfile profile, PlayerAvatar player, string sceneLabel, string deathCause, EmpressCompanionOverlay overlay) { //IL_00c0: Unknown result type (might be due to invalid IL or missing references) if (profile == null || (Object)(object)player == (Object)null || (Object)(object)overlay == (Object)null) { return; } EmpressDismissDeathReplayGhost(); if (_empressDeathReplayFrames.Count >= 2) { GameObject avatarVisualRoot = EmpressCompanionAccess.GetAvatarVisualRoot(player); if ((Object)(object)avatarVisualRoot != (Object)null) { try { GameObject val = Object.Instantiate(avatarVisualRoot); ((Object)val).name = "Empress death replay ghost"; EmpressPrepareProjectionClone(val); EmpressTintProjection(val); val.AddComponent().EmpressInitialize(_empressDeathReplayFrames.ToArray(), 5.4f); _empressDeathReplayGhost = val; } catch (Exception ex) { EmpressCompanionPlugin.EmpressWarning("death replay ghost failed: " + ex.GetType().Name); } } } overlay.EmpressPushMessage(profile.CompanionName, EmpressBuildDeathReviewLine(profile, sceneLabel, deathCause), new Color(1f, 0.66f, 0.86f, 1f), urgent: true, 7.8f); } private void EmpressDismissDeathReplayGhost() { if (!((Object)(object)_empressDeathReplayGhost == (Object)null)) { Object.Destroy((Object)(object)_empressDeathReplayGhost); _empressDeathReplayGhost = null; } } private string EmpressBuildDeathReviewLine(EmpressCompanionProfile profile, string sceneLabel, string deathCause) { int num = 0; int num2 = int.MaxValue; string text = string.Empty; foreach (EmpressDeathReplayFrame empressDeathReplayFrame in _empressDeathReplayFrames) { if (empressDeathReplayFrame != null) { num = Mathf.Max(num, empressDeathReplayFrame.NearbyEnemies); num2 = Mathf.Min(num2, empressDeathReplayFrame.Health); if (string.IsNullOrWhiteSpace(text) && !string.IsNullOrWhiteSpace(empressDeathReplayFrame.HeldObjectName)) { text = empressDeathReplayFrame.HeldObjectName; } } } string text2 = (string.IsNullOrWhiteSpace(text) ? string.Empty : (" You were holding " + text + ".")); string text3 = ((num > 0) ? (" Peak nearby enemies: " + num + ".") : string.Empty); string text4 = ((num2 != int.MaxValue) ? (" Lowest health in the replay: " + Mathf.Max(0, num2) + ".") : string.Empty); return profile.Personality switch { EmpressCompanionPersonality.Playful => "Death review for " + sceneLabel + ": " + deathCause + "." + text3 + text4 + text2 + " I saved the last ten seconds because apparently I care a lot.", EmpressCompanionPersonality.Elegant => "I reviewed the last ten seconds. Cause: " + deathCause + "." + text3 + text4 + text2 + " A cleaner ending will be demanded next time.", EmpressCompanionPersonality.Protective => "I watched the last ten seconds back. Cause: " + deathCause + "." + text3 + text4 + text2 + " I will not ignore that pattern again.", _ => "Last ten seconds reviewed. Cause: " + deathCause + "." + text3 + text4 + text2, }; } private void EmpressRefreshSceneCachesIfNeeded() { if (!(Time.unscaledTime < _empressNextSceneScanAt)) { _empressNextSceneScanAt = Time.unscaledTime + 2.5f; _empressValuableCache = Object.FindObjectsOfType(); _empressItemCache = Object.FindObjectsOfType(); _empressEnemyCache = Object.FindObjectsOfType(); _empressExtractionCache = Object.FindObjectsOfType(); _empressCartCache = Object.FindObjectsOfType(); EmpressCleanupTargetMemory(); } } private void EmpressObservePlayer(EmpressCompanionProfile profile, PlayerAvatar player, RunManager runManager, GameDirector director, string sceneLabel, EmpressCompanionOverlay overlay) { //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_044f: Unknown result type (might be due to invalid IL or missing references) bool flag = false; PlayerHealth playerHealth = EmpressCompanionAccess.GetPlayerHealth(player); if ((Object)(object)playerHealth == (Object)null) { return; } int health = EmpressCompanionAccess.GetHealth(playerHealth); int maxHealth = EmpressCompanionAccess.GetMaxHealth(playerHealth); PhysGrabObject heldObject = EmpressCompanionAccess.GetHeldObject(); ValuableObject val = EmpressFindValuableForObject(heldObject); _empressLastHeldObjectName = (((Object)(object)val != (Object)null) ? ((Object)val).name : (((Object)(object)heldObject != (Object)null) ? ((Object)heldObject).name : string.Empty)); if (_empressLastHealth < 0) { _empressLastHealth = health; } else if (health < _empressLastHealth) { int num = _empressLastHealth - health; int num2 = EmpressCountNearbyEnemies(((Component)player).transform.position, 12f); _empressLastDamageAt = Time.unscaledTime; _empressLastDamageAmount = num; _empressLastNearbyEnemiesAtDamage = num2; _empressLastDamageCause = EmpressInferDamageCause(player, num, num2, val, sceneLabel); profile.Love = Mathf.Clamp(profile.Love - (float)num * 0.24f * EmpressCompanionPlugin.CompanionConfig.EmpressLoveLossScale, 0f, 100f); _empressCurrentPlan = ((health <= Mathf.Max(16, maxHealth / 4)) ? "Stabilizing you" : "Watching closer"); flag = true; if (Time.unscaledTime - _empressLastWarningAt > 26f && health <= Mathf.Max(24, maxHealth / 3)) { _empressLastWarningAt = Time.unscaledTime; overlay.EmpressPushMessage(profile.CompanionName, EmpressBuildLowHealthWarning(profile), new Color(1f, 0.78f, 0.88f, 1f), urgent: true, 5f); } } else if (health > _empressLastHealth) { profile.Love = Mathf.Clamp(profile.Love + ((_empressLastHealth < health) ? (0.35f * EmpressCompanionPlugin.CompanionConfig.EmpressLoveGainScale) : 0f), 0f, 100f); flag = true; } _empressLastHealth = health; int levelsCompleted = EmpressCompanionAccess.GetLevelsCompleted(runManager); if (_empressLastLevelsCompleted < 0) { _empressLastLevelsCompleted = levelsCompleted; } else if (levelsCompleted > _empressLastLevelsCompleted) { int num3 = levelsCompleted - _empressLastLevelsCompleted; profile.LevelsCleared += num3; profile.Love = Mathf.Clamp(profile.Love + (float)num3 * 12f * EmpressCompanionPlugin.CompanionConfig.EmpressLoveGainScale, 0f, 100f); _empressLastLevelsCompleted = levelsCompleted; _empressNextBlessingAt = Mathf.Min(_empressNextBlessingAt, Time.unscaledTime + 6f); _empressCurrentPlan = "Celebrating"; flag = true; overlay.EmpressPushMessage(profile.CompanionName, EmpressBuildLevelClearLine(profile, sceneLabel), new Color(0.84f, 1f, 0.86f, 1f), urgent: true, 5.4f); } int runCurrency = EmpressCompanionAccess.GetRunCurrency(); if (_empressLastCurrency < 0) { _empressLastCurrency = runCurrency; } else if (runCurrency > _empressLastCurrency) { int num4 = runCurrency - _empressLastCurrency; profile.Love = Mathf.Clamp(profile.Love + Mathf.Min(1.8f, (float)num4 / 2200f) * EmpressCompanionPlugin.CompanionConfig.EmpressLoveGainScale, 0f, 100f); _empressLastCurrency = runCurrency; flag = true; } else if (runCurrency < _empressLastCurrency) { _empressLastCurrency = runCurrency; } RoundDirector roundDirectorInstance = EmpressCompanionAccess.RoundDirectorInstance; if ((Object)(object)roundDirectorInstance != (Object)null) { if (_empressLastHaul < 0) { _empressLastHaul = EmpressCompanionAccess.GetCurrentHaul(roundDirectorInstance); } else if (EmpressCompanionAccess.GetCurrentHaul(roundDirectorInstance) > _empressLastHaul) { int currentHaul = EmpressCompanionAccess.GetCurrentHaul(roundDirectorInstance); int num5 = currentHaul - _empressLastHaul; profile.Love = Mathf.Clamp(profile.Love + Mathf.Min(1.6f, (float)num5 / 2600f) * EmpressCompanionPlugin.CompanionConfig.EmpressLoveGainScale, 0f, 100f); _empressLastHaul = currentHaul; _empressCurrentPlan = "Tracking the haul"; _empressNextBlessingAt = Mathf.Min(_empressNextBlessingAt, Time.unscaledTime + 5f); flag = true; if (num5 >= 400 && Time.unscaledTime - _empressLastHaulNoticeAt > 8f) { _empressLastHaulNoticeAt = Time.unscaledTime; overlay.EmpressPushMessage(profile.CompanionName, EmpressBuildHaulLine(profile, num5, currentHaul, EmpressCompanionAccess.GetHaulGoal(roundDirectorInstance)), new Color(0.9f, 1f, 0.84f, 1f), urgent: true, 4.8f); } } else { _empressLastHaul = EmpressCompanionAccess.GetCurrentHaul(roundDirectorInstance); } } int num6 = EmpressCountDamagedValuables(); if (_empressLastDamagedValuables < 0) { _empressLastDamagedValuables = num6; } else if (num6 > _empressLastDamagedValuables) { int num7 = num6 - _empressLastDamagedValuables; profile.ValuablesBroken += num7; profile.Love = Mathf.Clamp(profile.Love - (float)num7 * 2.2f * EmpressCompanionPlugin.CompanionConfig.EmpressLoveLossScale, 0f, 100f); _empressLastDamagedValuables = num6; flag = true; } else { _empressLastDamagedValuables = num6; } if (EmpressCompanionAccess.IsDead(player)) { if (!_empressDeathCounted) { _empressDeathCounted = true; profile.PlayerDeaths++; profile.Love = Mathf.Clamp(profile.Love - 18f * EmpressCompanionPlugin.CompanionConfig.EmpressLoveLossScale, 0f, 100f); _empressCurrentPlan = "Grieving"; flag = true; string deathCause = EmpressBuildDeathCause(sceneLabel); EmpressStartDeathReview(profile, player, sceneLabel, deathCause, overlay); overlay.EmpressPushMessage(profile.CompanionName, EmpressBuildDeathLine(profile, sceneLabel, deathCause), new Color(1f, 0.74f, 0.84f, 1f), urgent: true, 7.4f); } } else { _empressDeathCounted = false; } if (Time.unscaledTime >= _empressNextPassiveLoveAt && EmpressSceneIsSupported() && !EmpressCompanionAccess.IsDead(player)) { _empressNextPassiveLoveAt = Time.unscaledTime + 44f; profile.Love = Mathf.Clamp(profile.Love + 0.45f * EmpressCompanionPlugin.CompanionConfig.EmpressLoveGainScale, 0f, 100f); flag = true; } if (flag) { EmpressCompanionMemory.EmpressMarkDirty(); } } private void EmpressUpdateRelationship(EmpressCompanionProfile profile, EmpressCompanionOverlay overlay) { //IL_0069: Unknown result type (might be due to invalid IL or missing references) EmpressRelationshipStage empressRelationshipStage = EmpressGetRelationshipStage(profile); if (!_empressStageInitialized) { _empressLastStage = empressRelationshipStage; _empressStageInitialized = true; } else if (empressRelationshipStage != _empressLastStage) { _empressLastStage = empressRelationshipStage; if (empressRelationshipStage == EmpressRelationshipStage.Wife && !profile.Married) { profile.Married = true; } EmpressCompanionMemory.EmpressMarkDirty(); overlay.EmpressPushMessage(profile.CompanionName, EmpressBuildStageLine(profile, empressRelationshipStage), new Color(1f, 0.82f, 0.94f, 1f), urgent: true, 5.6f); } } private void EmpressTickDebugForceLove(EmpressCompanionProfile profile, EmpressCompanionOverlay overlay) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) if (!EmpressCompanionPlugin.CompanionConfig.DebugForceLove100.Value) { _empressDebugLoveForced = false; return; } if (profile.Love < 100f) { profile.Love = 100f; EmpressCompanionMemory.EmpressMarkDirty(); } if (!_empressDebugLoveForced) { _empressDebugLoveForced = true; overlay.EmpressPushMessage("Empress debug", "ForceLove100 is on. Love locked to 100%.", new Color(1f, 0.7f, 0.94f, 1f), urgent: true, 4.4f); } } private void EmpressTickSituationalAwareness(EmpressCompanionProfile profile, PlayerAvatar player, string sceneLabel, EmpressCompanionOverlay overlay) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) PlayerHealth playerHealth = EmpressCompanionAccess.GetPlayerHealth(player); if ((Object)(object)playerHealth == (Object)null) { return; } int maxHealth = EmpressCompanionAccess.GetMaxHealth(playerHealth); int health = EmpressCompanionAccess.GetHealth(playerHealth); float healthRatio = ((maxHealth > 0) ? ((float)health / (float)maxHealth) : 1f); PhysGrabObject heldObject = EmpressCompanionAccess.GetHeldObject(); ValuableObject heldValuable = EmpressFindValuableForObject(heldObject); int nearbyEnemies = EmpressCountNearbyEnemies(((Component)player).transform.position, 16f); int shopDebt = (EmpressCompanionAccess.RunIsShop() ? Mathf.Max(0, EmpressCompanionAccess.GetShopTotalCost() - EmpressCompanionAccess.GetRunCurrency()) : 0); RoundDirector roundDirectorInstance = EmpressCompanionAccess.RoundDirectorInstance; int haulShortfall = (((Object)(object)roundDirectorInstance != (Object)null) ? Mathf.Max(0, EmpressCompanionAccess.GetHaulGoal(roundDirectorInstance) - EmpressCompanionAccess.GetCurrentHaul(roundDirectorInstance)) : 0); _empressMood = EmpressComputeMood(profile, healthRatio, nearbyEnemies, heldValuable, shopDebt, haulShortfall); EmpressTickProjectionOrders(player, heldObject, heldValuable, nearbyEnemies, shopDebt, haulShortfall); EmpressTickLocalFlavor(profile, sceneLabel, overlay); if (!(Time.unscaledTime < _empressNextMoodLineAt)) { string text = EmpressBuildMoodLine(profile, _empressMood, sceneLabel, healthRatio, nearbyEnemies, heldValuable, shopDebt, haulShortfall); _empressNextMoodLineAt = Time.unscaledTime + Random.Range((_empressMood == EmpressCompanionMood.Worried || _empressMood == EmpressCompanionMood.Protective) ? 24f : 36f, 58f); if (!string.IsNullOrWhiteSpace(text) && !(text == _empressLastMoodLine)) { _empressLastMoodLine = text; overlay.EmpressPushMessage(profile.CompanionName, text, EmpressAccentForPersonality(profile.Personality), urgent: true, 4.6f); } } } private void EmpressTickLocalFlavor(EmpressCompanionProfile profile, string sceneLabel, EmpressCompanionOverlay overlay) { //IL_0097: Unknown result type (might be due to invalid IL or missing references) if (profile == null || (Object)(object)overlay == (Object)null || Time.unscaledTime < _empressNextLocalFlavorAt) { return; } _empressNextLocalFlavorAt = Time.unscaledTime + Random.Range(96f, 168f); if (!(profile.Love < 24f) && !(Random.value > Mathf.Lerp(0.25f, 0.68f, Mathf.Clamp01(profile.Love / 100f)))) { string text = EmpressBuildLocalFlavorLine(profile, sceneLabel); if (!string.IsNullOrWhiteSpace(text)) { overlay.EmpressPushMessage(profile.CompanionName, text, new Color(1f, 0.62f, 0.91f, 1f), urgent: true, 4.8f); } } } private void EmpressTickProjectionOrders(PlayerAvatar player, PhysGrabObject heldObject, ValuableObject heldValuable, int nearbyEnemies, int shopDebt, int haulShortfall) { //IL_003e: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_empressAvatarProjection == (Object)null || Time.unscaledTime < _empressNextProjectionCommandAt) { return; } _empressNextProjectionCommandAt = Time.unscaledTime + Random.Range(2.2f, 4.4f); Enemy val = EmpressFindNearbyEnemy(((Component)player).transform.position, 18f); if ((Object)(object)val != (Object)null) { Vector3 worldPosition = Vector3.Lerp(((Component)player).transform.position, ((Component)val).transform.position, (nearbyEnemies >= 2) ? 0.36f : 0.5f); EmpressCommandProjectionTo(worldPosition, 3.6f); return; } if (!EmpressCompanionAccess.RunIsShop() && (Object)(object)heldObject != (Object)null) { ExtractionPoint val2 = EmpressFindExtraction(); if ((Object)(object)val2 != (Object)null && ((Object)(object)heldValuable != (Object)null || haulShortfall > 0)) { EmpressCommandProjectionTo(Vector3.Lerp(((Component)player).transform.position, ((Component)val2).transform.position, 0.42f), 3.4f); return; } } PhysGrabCart val3 = EmpressFindNearbyCart(((Component)player).transform.position, ((Object)(object)heldObject != (Object)null) ? 14f : 18f); if ((Object)(object)val3 != (Object)null && ((Object)(object)heldValuable != (Object)null || !EmpressCompanionAccess.RunIsShop())) { EmpressCommandProjectionTo(((Component)val3).transform.position, 3.2f); return; } ValuableObject val4 = EmpressFindDamagedValuable(((Component)player).transform.position); if ((Object)(object)val4 != (Object)null && Vector3.Distance(((Component)player).transform.position, ((Component)val4).transform.position) <= 16f) { EmpressCommandProjectionTo(((Component)val4).transform.position, 3f); return; } if (EmpressCompanionAccess.RunIsShop() && shopDebt > 0) { ItemAttributes val5 = EmpressFindBestShopItem(); if ((Object)(object)val5 != (Object)null) { EmpressCommandProjectionTo(((Component)val5).transform.position, 3.2f); return; } } _empressAvatarProjection.EmpressOrbitNow(); } private void EmpressCommandProjectionTo(Vector3 worldPosition, float holdSeconds) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_empressAvatarProjection != (Object)null) { _empressAvatarProjection.EmpressMoveTo(worldPosition, holdSeconds); } } private EmpressCompanionMood EmpressComputeMood(EmpressCompanionProfile profile, float healthRatio, int nearbyEnemies, ValuableObject heldValuable, int shopDebt, int haulShortfall) { if (healthRatio <= 0.38f) { return EmpressCompanionMood.Worried; } if (nearbyEnemies >= 2 || (nearbyEnemies > 0 && healthRatio <= 0.72f)) { return EmpressCompanionMood.Protective; } if ((Object)(object)_empressAvatarProjection != (Object)null && profile.Love >= Mathf.Max(EmpressCompanionPlugin.CompanionConfig.EmpressManifestLoveThreshold, 78f)) { return EmpressCompanionMood.Devoted; } if (EmpressCompanionAccess.RunIsShop() && shopDebt > 0) { return EmpressCompanionMood.Shopping; } if ((Object)(object)heldValuable != (Object)null || haulShortfall > 0) { return EmpressCompanionMood.Focused; } if (profile.Love >= 72f && profile.LevelsCleared > 0) { return EmpressCompanionMood.Proud; } if (profile.Personality != EmpressCompanionPersonality.Playful) { return EmpressCompanionMood.Calm; } return EmpressCompanionMood.Playful; } private void EmpressTickPassiveCompanion(EmpressCompanionProfile profile, PlayerAvatar player, string sceneLabel, EmpressCompanionOverlay overlay) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: 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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) float unscaledTime = Time.unscaledTime; PlayerHealth playerHealth = EmpressCompanionAccess.GetPlayerHealth(player); if ((Object)(object)playerHealth == (Object)null) { return; } int health = EmpressCompanionAccess.GetHealth(playerHealth); int maxHealth = EmpressCompanionAccess.GetMaxHealth(playerHealth); float num = ((maxHealth > 0) ? ((float)health / (float)maxHealth) : 1f); PhysGrabObject heldObject = EmpressCompanionAccess.GetHeldObject(); ValuableObject val = EmpressFindValuableForObject(heldObject); Enemy val2 = EmpressFindNearbyEnemy(((Component)player).transform.position, 10f); bool flag = (Object)(object)val == (Object)null || EmpressTargetReady((Object)(object)val); if (unscaledTime >= _empressNextReactiveAssistAt && (Object)(object)heldObject != (Object)null && ((Object)(object)val != (Object)null || (Object)(object)val2 != (Object)null || num < 0.58f) && (flag || (Object)(object)val2 != (Object)null || num < 0.58f)) { bool flag2 = false; EmpressCompanionAccess.LightenObject(heldObject, ((Object)(object)val != (Object)null) ? 14f : 10f); flag2 = true; if ((Object)(object)val != (Object)null) { flag2 = ((!(EmpressCompanionAccess.GetValuableCurrentValue(val) < EmpressCompanionAccess.GetValuableOriginalValue(val))) ? (flag2 | EmpressBloomValuable(val)) : (flag2 | EmpressRepairValuable(val))); } if ((Object)(object)val2 != (Object)null || num < 0.7f) { EmpressCompanionAccess.DistractEnemies(((Component)player).transform.position + Random.insideUnitSphere * 3f, 18f); EmpressCompanionAccess.SetInvincible(player, 1.8f); flag2 = true; } if (num < 0.78f) { EmpressCompanionAccess.HealPlayer(player, Mathf.Max(4, Mathf.RoundToInt((float)maxHealth * 0.08f)), effect: true); EmpressCompanionAccess.ApplyLoveEyes(player, 3.8f); flag2 = true; } _empressNextReactiveAssistAt = unscaledTime + Random.Range(16f, 24f); if (flag2) { EmpressMarkTarget((Object)(object)heldObject, 14f); if ((Object)(object)val != (Object)null) { EmpressMarkTarget((Object)(object)val, 18f); } _empressCurrentPlan = (((Object)(object)val != (Object)null) ? "Guarding your cargo" : "Smoothing your route"); profile.Love = Mathf.Clamp(profile.Love + 0.14f * EmpressCompanionPlugin.CompanionConfig.EmpressLoveGainScale, 0f, 100f); EmpressCompanionMemory.EmpressMarkDirty(); overlay.EmpressPushMessage(profile.CompanionName, EmpressBuildPassiveCargoLine(profile, ((Object)(object)val != (Object)null) ? ((Object)val).name : ((Object)heldObject).name), EmpressAccentForPersonality(profile.Personality), urgent: true, 4.2f); return; } } if (unscaledTime >= _empressNextTreasureAssistAt) { ValuableObject val3 = EmpressFindDamagedValuable(((Component)player).transform.position); if ((Object)(object)val3 != (Object)null && Vector3.Distance(((Component)player).transform.position, ((Component)val3).transform.position) <= 12f && (Object)(object)val2 == (Object)null) { _empressNextTreasureAssistAt = unscaledTime + Random.Range(16f, 22f); if (EmpressRepairValuable(val3)) { _empressCurrentPlan = "Restoring treasure"; profile.Love = Mathf.Clamp(profile.Love + 0.1f * EmpressCompanionPlugin.CompanionConfig.EmpressLoveGainScale, 0f, 100f); EmpressCompanionMemory.EmpressMarkDirty(); overlay.EmpressPushMessage(profile.CompanionName, EmpressBuildPassiveTreasureLine(profile, ((Object)val3).name), new Color(0.9f, 1f, 0.88f, 1f), urgent: true, 4f); return; } } else { _empressNextTreasureAssistAt = unscaledTime + 6f; } } if (!EmpressCompanionAccess.RunIsShop() || !(unscaledTime >= _empressNextShopAssistAt)) { return; } int shopTotalCost = EmpressCompanionAccess.GetShopTotalCost(); int runCurrency = EmpressCompanionAccess.GetRunCurrency(); ItemAttributes val4 = EmpressFindBestShopItem(); if ((Object)(object)val4 != (Object)null && shopTotalCost > runCurrency) { int amount = Mathf.Clamp(shopTotalCost - runCurrency, 1, 3); _empressNextShopAssistAt = unscaledTime + Random.Range(16f, 24f); if (EmpressDiscountShop(val4, amount)) { _empressCurrentPlan = "Leaning on the register"; profile.Love = Mathf.Clamp(profile.Love + 0.08f * EmpressCompanionPlugin.CompanionConfig.EmpressLoveGainScale, 0f, 100f); EmpressCompanionMemory.EmpressMarkDirty(); overlay.EmpressPushMessage(profile.CompanionName, EmpressBuildPassiveShopLine(profile, EmpressCompanionAccess.GetItemName(val4)), new Color(0.88f, 0.94f, 1f, 1f), urgent: true, 4f); } } else { _empressNextShopAssistAt = unscaledTime + 8f; } } private void EmpressTickBlessings(EmpressCompanionProfile profile, PlayerAvatar player, string sceneLabel, EmpressCompanionOverlay overlay) { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) if (_empressPendingBlessing != null) { _empressCurrentPlan = _empressPendingBlessing.Tactic; if (Time.unscaledTime >= _empressPendingBlessing.ExecuteAt) { EmpressExecuteBlessing(profile, player, sceneLabel, _empressPendingBlessing); _empressPendingBlessing = null; _empressNextBlessingAt = Time.unscaledTime + EmpressComputeBlessingInterval(profile, player); } } else if (!(Time.unscaledTime < _empressNextBlessingAt)) { EmpressCompanionBlessingPlan empressCompanionBlessingPlan = EmpressPlanBlessing(profile, player); if (empressCompanionBlessingPlan == null) { _empressNextBlessingAt = Time.unscaledTime + 10f; return; } _empressPendingBlessing = empressCompanionBlessingPlan; _empressCurrentPlan = empressCompanionBlessingPlan.Tactic; overlay.EmpressPushMessage(profile.CompanionName, empressCompanionBlessingPlan.PreviewText, EmpressAccentForPersonality(profile.Personality), urgent: true, 4.8f); } } private EmpressCompanionBlessingPlan EmpressPlanBlessing(EmpressCompanionProfile profile, PlayerAvatar player) { //IL_0044: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) List list = new List(24); float num = Mathf.Clamp01(EmpressCompanionPlugin.CompanionConfig.EmpressBlessingStrength); PlayerHealth playerHealth = EmpressCompanionAccess.GetPlayerHealth(player); int maxHealth = EmpressCompanionAccess.GetMaxHealth(playerHealth); int health = EmpressCompanionAccess.GetHealth(playerHealth); float num2 = ((maxHealth > 0) ? ((float)health / (float)maxHealth) : 1f); ValuableObject val = EmpressFindBestValuable(((Component)player).transform.position); ValuableObject val2 = EmpressFindDamagedValuable(((Component)player).transform.position); PhysGrabObject heldObject = EmpressCompanionAccess.GetHeldObject(); ValuableObject val3 = EmpressFindValuableForObject(heldObject); Enemy val4 = EmpressFindNearbyEnemy(((Component)player).transform.position, 16f); int num3 = EmpressCountNearbyEnemies(((Component)player).transform.position, 16f); PhysGrabCart val5 = EmpressFindNearbyCart(((Component)player).transform.position, ((Object)(object)heldObject != (Object)null) ? 12f : 18f); ItemAttributes val6 = EmpressFindBestShopItem(); ExtractionPoint val7 = EmpressFindExtraction(); RoundDirector roundDirectorInstance = EmpressCompanionAccess.RoundDirectorInstance; int num4 = (((Object)(object)roundDirectorInstance != (Object)null) ? Mathf.Max(0, EmpressCompanionAccess.GetHaulGoal(roundDirectorInstance) - EmpressCompanionAccess.GetCurrentHaul(roundDirectorInstance)) : 0); int num5 = EmpressCountNearbyValuables(((Component)player).transform.position, 16f); int num6 = EmpressCountNearbyDamagedValuables(((Component)player).transform.position, 16f); ShopManager shopManagerInstance = EmpressCompanionAccess.ShopManagerInstance; int num7 = (((Object)(object)shopManagerInstance != (Object)null) ? EmpressCompanionAccess.GetShoppingList(shopManagerInstance) : null)?.Count ?? 0; int num8 = (EmpressCompanionAccess.RunIsShop() ? Mathf.Max(0, EmpressCompanionAccess.GetShopTotalCost() - EmpressCompanionAccess.GetRunCurrency()) : 0); int num9 = (((Object)(object)val6 != (Object)null) ? EmpressCompanionAccess.GetItemValue(val6) : 0); if (profile.Love >= EmpressCompanionPlugin.CompanionConfig.EmpressManifestLoveThreshold && (Object)(object)_empressAvatarProjection == (Object)null && EmpressBlessingReady(EmpressBlessingKind.AvatarManifestation, 90f)) { list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.AvatarManifestation, 8.5f, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.AvatarManifestation, null, 0), "Manifesting beside you")); } if (num2 <= 0.32f && EmpressBlessingReady(EmpressBlessingKind.FullHeal, 36f)) { list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.FullHeal, 9f, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.FullHeal, null, 0), "Emergency restore", null, null, null, null, null, Mathf.Max(36, maxHealth))); } if (num2 <= 0.78f && EmpressBlessingReady(EmpressBlessingKind.SmallHeal, 22f)) { list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.SmallHeal, (num2 <= 0.5f) ? 7f : 4f, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.SmallHeal, null, 0), "Healing you", null, null, null, null, null, Mathf.RoundToInt(Mathf.Lerp(12f, 24f, num)))); } if (num2 <= 0.42f && EmpressBlessingReady(EmpressBlessingKind.GraceShield, 45f)) { list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.GraceShield, 6.2f, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.GraceShield, null, 0), "Wrapping you in grace")); } if ((num3 >= 2 || ((Object)(object)val4 != (Object)null && num2 <= 0.74f)) && EmpressBlessingReady(EmpressBlessingKind.ThreatWard, 34f)) { float weight = 7.2f + Mathf.Min(2.8f, (float)num3 * 0.75f); list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.ThreatWard, weight, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.ThreatWard, ((Object)(object)val4 != (Object)null) ? ((Object)val4).name : null, num3), "Warding threats", null, null, null, val4, null, num3)); } bool flag = (Object)(object)val3 == (Object)null || EmpressTargetReady((Object)(object)val3); if ((Object)(object)heldObject != (Object)null && flag && EmpressBlessingReady(EmpressBlessingKind.Featherweight, 35f)) { list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.Featherweight, 4.4f, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.Featherweight, ((Object)heldObject).name, 0), "Lightening your hands", heldObject)); } if ((Object)(object)val7 != (Object)null && (Object)(object)heldObject != (Object)null && !EmpressCompanionAccess.RunIsShop() && ((Object)(object)val3 != (Object)null || num4 > 0) && EmpressBlessingReady(EmpressBlessingKind.ExtractionFocus, 38f)) { float num10 = (((Object)(object)val3 != (Object)null) ? 6.4f : 4.4f); if ((Object)(object)val4 != (Object)null) { num10 += 1.2f; } list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.ExtractionFocus, num10, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.ExtractionFocus, ((Object)(object)val3 != (Object)null) ? ((Object)val3).name : ((Object)heldObject).name, 0), "Guiding extraction", heldObject, val3, null, val4, val7)); } if ((Object)(object)heldObject != (Object)null && ((Object)(object)val3 != (Object)null || (Object)(object)val4 != (Object)null || num2 < 0.65f) && (flag || (Object)(object)val4 != (Object)null || num2 < 0.65f) && EmpressBlessingReady(EmpressBlessingKind.CourierGrace, 32f)) { float num11 = (((Object)(object)val3 != (Object)null) ? 7f : 5.6f); if ((Object)(object)val4 != (Object)null) { num11 += 1.4f; } if (num2 < 0.45f) { num11 += 1.8f; } list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.CourierGrace, num11, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.CourierGrace, ((Object)(object)val3 != (Object)null) ? ((Object)val3).name : ((Object)heldObject).name, 0), "Covering your carry", heldObject, val3, null, val4)); } if ((Object)(object)val2 != (Object)null && EmpressBlessingReady(EmpressBlessingKind.ValuableRepair, 38f)) { list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.ValuableRepair, 4.9f, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.ValuableRepair, ((Object)val2).name, 0), "Repairing treasure", EmpressCompanionAccess.GetValuablePhysGrabObject(val2), val2)); } if ((Object)(object)val != (Object)null && EmpressBlessingReady(EmpressBlessingKind.ValuableBloom, 34f)) { list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.ValuableBloom, 4.8f, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.ValuableBloom, ((Object)val).name, 0), "Blooming value", EmpressCompanionAccess.GetValuablePhysGrabObject(val), val)); } if ((num6 >= 2 || ((Object)(object)val2 != (Object)null && num5 >= 3)) && EmpressBlessingReady(EmpressBlessingKind.TreasureSweep, 58f)) { float weight2 = 5.8f + Mathf.Min(2f, (float)num6 * 0.6f); list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.TreasureSweep, weight2, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.TreasureSweep, null, num6), "Refreshing the haul", EmpressCompanionAccess.GetValuablePhysGrabObject(val2), val2, null, null, null, num6)); } if ((Object)(object)val4 != (Object)null && EmpressBlessingReady(EmpressBlessingKind.EnemyDistraction, 26f)) { list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.EnemyDistraction, 5.4f, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.EnemyDistraction, ((Object)val4).name, 0), "Pulling eyes away", null, null, null, val4)); } if ((Object)(object)val5 != (Object)null && ((Object)(object)val3 != (Object)null || num5 >= 2 || profile.Love >= 42f) && EmpressBlessingReady(EmpressBlessingKind.CartBlessing, 48f)) { float weight3 = (((Object)(object)val3 != (Object)null) ? 5.4f : 3.6f); list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.CartBlessing, weight3, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.CartBlessing, ((Object)val5).name, 0), "Stabilizing the cart", EmpressGetCartPhysGrabObject(val5), val3, null, null, null, num5)); } if (EmpressCompanionAccess.RunIsShop()) { if (num8 > 0 && profile.Love >= 48f && EmpressBlessingReady(EmpressBlessingKind.ShopUnderwrite, 46f)) { int amount = Mathf.Clamp(Mathf.RoundToInt(Mathf.Lerp(1f, 3f, num)), 1, Mathf.Min(3, Mathf.Max(1, num8))); list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.ShopUnderwrite, 5.8f + Mathf.Clamp((float)num8 / 4f, 0f, 2f), EmpressBuildBlessingPreview(profile, EmpressBlessingKind.ShopUnderwrite, null, amount), "Underwriting the list", null, null, val6, null, null, amount)); } if ((Object)(object)val6 != (Object)null && num9 > 1 && EmpressBlessingReady(EmpressBlessingKind.ShopDiscount, 30f)) { int amount2 = Mathf.Clamp(Mathf.RoundToInt((float)num9 * Mathf.Lerp(0.35f, 0.72f, num)), 1, Mathf.Max(1, num9 - 1)); list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.ShopDiscount, 7.5f, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.ShopDiscount, EmpressCompanionAccess.GetItemName(val6), amount2), "Slicing prices", null, null, val6, null, null, amount2)); } if ((Object)(object)val6 != (Object)null && num9 > 1 && EmpressBlessingReady(EmpressBlessingKind.ShopGift, 52f)) { list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.ShopGift, 3.4f, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.ShopGift, EmpressCompanionAccess.GetItemName(val6), 0), "Hijacking the register", null, null, val6)); } if (num7 >= 2 && num8 >= 4 && EmpressBlessingReady(EmpressBlessingKind.ShopCascade, 56f)) { int amount3 = Mathf.Clamp(Mathf.RoundToInt((float)num8 * Mathf.Lerp(0.4f, 0.7f, num)), 2, 6); float weight4 = 5.2f + Mathf.Clamp((float)num8 / 6f, 0f, 2.4f); list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.ShopCascade, weight4, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.ShopCascade, EmpressCompanionAccess.GetItemName(val6), amount3), "Rewriting the price board", null, null, val6, null, null, amount3)); } if (EmpressBlessingReady(EmpressBlessingKind.CashGift, 28f)) { list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.CashGift, 3.8f, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.CashGift, null, 0), "Sending credits", null, null, null, null, null, Mathf.Clamp(Mathf.RoundToInt(Mathf.Lerp(1f, 4f, num)), 1, 4))); } } else { if ((Object)(object)val7 != (Object)null && num4 > 0 && EmpressBlessingReady(EmpressBlessingKind.ExtractorBlessing, 48f)) { int amount4 = Mathf.Clamp(Mathf.RoundToInt(Mathf.Lerp(650f, 1600f, num)), 400, Mathf.Max(400, num4)); list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.ExtractorBlessing, 5.2f, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.ExtractorBlessing, null, amount4), "Tuning extraction", null, null, null, null, val7, amount4)); } if ((Object)(object)val7 != (Object)null && num4 > 1800 && EmpressBlessingReady(EmpressBlessingKind.QuotaMercy, 72f)) { int amount5 = Mathf.Clamp(Mathf.RoundToInt(Mathf.Lerp(1200f, 2600f, num)), 900, Mathf.Max(900, num4)); float weight5 = 4.8f + Mathf.Clamp((float)num4 / 3200f, 0f, 2.2f); list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.QuotaMercy, weight5, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.QuotaMercy, null, amount5), "Softening the quota", null, val2, null, val4, val7, amount5)); } if (EmpressBlessingReady(EmpressBlessingKind.CashGift, 28f)) { list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.CashGift, 2.6f, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.CashGift, null, 0), "Sending credits", null, null, null, null, null, Mathf.Clamp(Mathf.RoundToInt(Mathf.Lerp(1f, 3f, num)), 1, 3))); } } if (profile.Love >= 40f && EmpressBlessingReady(EmpressBlessingKind.UpgradeGift, 70f)) { list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.UpgradeGift, (profile.Love >= 75f) ? 4.2f : 2.8f, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.UpgradeGift, null, 0), "Writing a little upgrade for you")); } if (profile.Love >= 56f && EmpressBlessingReady(EmpressBlessingKind.UpgradeRush, 92f)) { int amount6 = ((profile.Love >= 82f) ? 3 : 2); list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.UpgradeRush, (profile.Love >= 78f) ? 4.4f : 3.2f, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.UpgradeRush, null, amount6), "Overclocking your build", null, null, null, null, null, amount6)); } if (EmpressBlessingReady(EmpressBlessingKind.PinkPulse, 34f)) { list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.PinkPulse, 2f, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.PinkPulse, null, 0), "Painting the world pink")); } if (profile.Love >= 68f && EmpressBlessingReady(EmpressBlessingKind.LoveBurst, 72f)) { list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.LoveBurst, 2.3f, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.LoveBurst, null, 0), "Flooding the link with warmth")); } if (num2 > 0.54f && profile.Love >= 30f && EmpressBlessingReady(EmpressBlessingKind.MoralePatch, 44f)) { float weight6 = ((_empressMood == EmpressCompanionMood.Calm || _empressMood == EmpressCompanionMood.Playful) ? 2.6f : 1.8f); list.Add(new EmpressCompanionBlessingOption(EmpressBlessingKind.MoralePatch, weight6, EmpressBuildBlessingPreview(profile, EmpressBlessingKind.MoralePatch, null, 0), "Keeping morale warm", null, val3, null, val4)); } if (list.Count <= 0) { return null; } return new EmpressCompanionBlessingPlan(EmpressPickWeighted(list), Time.unscaledTime + Random.Range(0.8f, 1.6f)); } private void EmpressExecuteBlessing(EmpressCompanionProfile profile, PlayerAvatar player, string sceneLabel, EmpressCompanionBlessingPlan plan) { //IL_018b: 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_0477: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04b9: Unknown result type (might be due to invalid IL or missing references) //IL_04c3: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_058c: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_04f2: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) bool flag = false; int num = Mathf.Max(0, plan.Amount); switch (plan.Kind) { case EmpressBlessingKind.SmallHeal: EmpressCompanionAccess.HealPlayer(player, Mathf.Max(10, num), effect: true); EmpressCompanionAccess.ApplyLoveEyes(player, 4f); flag = true; break; case EmpressBlessingKind.FullHeal: EmpressCompanionAccess.HealPlayer(player, Mathf.Max(EmpressCompanionAccess.GetMaxHealth(EmpressCompanionAccess.GetPlayerHealth(player)), num), effect: true); EmpressCompanionAccess.ApplyLoveEyes(player, 5f); EmpressCompanionAccess.SetInvincible(player, 4f); flag = true; break; case EmpressBlessingKind.CashGift: { int num2 = Mathf.Clamp(Mathf.Max(1, num), 1, 4); EmpressCompanionAccess.SetRunCurrency(EmpressCompanionAccess.GetRunCurrency() + num2); profile.MoneyGiftedK += num2; flag = true; break; } case EmpressBlessingKind.AvatarManifestation: flag = EmpressEnsureAvatarProjection(profile, player, null); break; case EmpressBlessingKind.ValuableBloom: flag = EmpressBloomValuable(plan.TargetValuable ?? EmpressFindBestValuable(((Component)player).transform.position)); if (flag) { profile.ValuableBoosts++; } break; case EmpressBlessingKind.ValuableRepair: flag = EmpressRepairValuable(plan.TargetValuable ?? EmpressFindDamagedValuable(((Component)player).transform.position)); break; case EmpressBlessingKind.TreasureSweep: { int num3 = EmpressRepairNearbyValuables(((Component)player).transform.position, 18f, Mathf.Max(2, num)); int num4 = EmpressBloomNearbyValuables(((Component)player).transform.position, 18f, Mathf.Clamp(Mathf.Max(1, num), 1, 3), plan.TargetValuable); flag = num3 > 0 || num4 > 0; if (flag) { profile.ValuableBoosts += Mathf.Max(1, num4); } break; } case EmpressBlessingKind.Featherweight: { PhysGrabObject val = plan.TargetObject ?? EmpressCompanionAccess.GetHeldObject(); if ((Object)(object)val != (Object)null) { EmpressCompanionAccess.LightenObject(val, 24f); flag = true; } break; } case EmpressBlessingKind.CourierGrace: flag = EmpressBlessCourier(player, plan.TargetObject ?? EmpressCompanionAccess.GetHeldObject(), plan.TargetValuable, plan.TargetEnemy ?? EmpressFindNearbyEnemy(((Component)player).transform.position, 14f)); break; case EmpressBlessingKind.ExtractionFocus: flag = EmpressBlessExtractionFocus(player, plan.TargetObject ?? EmpressCompanionAccess.GetHeldObject(), plan.TargetValuable, plan.TargetEnemy ?? EmpressFindNearbyEnemy(((Component)player).transform.position, 16f), plan.TargetExtraction ?? EmpressFindExtraction()); break; case EmpressBlessingKind.CartBlessing: flag = EmpressBlessCart(player, plan.TargetObject, plan.TargetValuable); break; case EmpressBlessingKind.ShopDiscount: flag = EmpressDiscountShop(plan.TargetItem ?? EmpressFindBestShopItem(), Mathf.Clamp(Mathf.Max(1, num), 1, 6)); break; case EmpressBlessingKind.ShopUnderwrite: flag = EmpressUnderwriteShop(plan.TargetItem ?? EmpressFindBestShopItem(), Mathf.Clamp(Mathf.Max(1, num), 1, 3)); if (flag) { profile.ShopRescues++; profile.MoneyGiftedK += Mathf.Clamp(Mathf.Max(1, num), 1, 3); } break; case EmpressBlessingKind.ShopGift: flag = EmpressGiftShopItem(plan.TargetItem ?? EmpressFindBestShopItem()); if (flag) { profile.ShopRescues++; } break; case EmpressBlessingKind.ShopCascade: flag = EmpressCascadeShop(Mathf.Clamp(Mathf.Max(2, num), 2, 6)); if (flag) { profile.ShopRescues++; } break; case EmpressBlessingKind.UpgradeGift: flag = EmpressCompanionAccess.TryGrantUpgrade(player, EmpressBlessingKind.UpgradeGift); if (flag) { EmpressCompanionAccess.ApplyUpgradeFlash(player); } break; case EmpressBlessingKind.UpgradeRush: flag = EmpressGrantUpgradeRush(player, Mathf.Clamp(Mathf.Max(2, num), 2, 3)) > 0; break; case EmpressBlessingKind.ExtractorBlessing: flag = EmpressBlessExtraction(Mathf.Clamp(Mathf.Max(400, num), 400, 2600)); if (flag) { profile.ExtractorBlessings++; } break; case EmpressBlessingKind.QuotaMercy: flag = EmpressQuotaMercy(player, Mathf.Clamp(Mathf.Max(900, num), 900, 3200)); if (flag) { profile.ExtractorBlessings++; } break; case EmpressBlessingKind.PinkPulse: flag = EmpressApplyPinkPulse(((Component)player).transform.position, EmpressCompanionAccess.RunIsShop() ? 22f : 18f); if (flag) { profile.PinkBursts++; } break; case EmpressBlessingKind.EnemyDistraction: EmpressCompanionAccess.DistractEnemies(((Component)player).transform.position + Random.insideUnitSphere * 4f, 26f); flag = true; break; case EmpressBlessingKind.ThreatWard: flag = EmpressBlessThreatWard(player, plan.TargetEnemy ?? EmpressFindNearbyEnemy(((Component)player).transform.position, 18f), Mathf.Max(1, num)); break; case EmpressBlessingKind.GraceShield: EmpressCompanionAccess.SetInvincible(player, 8f); EmpressCompanionAccess.HealPlayer(player, 6, effect: true); EmpressCompanionAccess.ApplyLoveEyes(player, 5f); flag = true; break; case EmpressBlessingKind.LoveBurst: EmpressCompanionAccess.HealPlayer(player, 10, effect: true); EmpressCompanionAccess.SetInvincible(player, 3f); EmpressCompanionAccess.ApplyLoveEyes(player, 7f); profile.Love = Mathf.Clamp(profile.Love + 5.5f * EmpressCompanionPlugin.CompanionConfig.EmpressLoveGainScale, 0f, 100f); flag = EmpressApplyPinkPulse(((Component)player).transform.position, 12f) || true; break; case EmpressBlessingKind.MoralePatch: flag = EmpressBlessMorale(profile, player, plan.TargetValuable, plan.TargetEnemy); break; } if (!flag) { _empressNextBlessingAt = Time.unscaledTime + 8f; _empressCurrentPlan = "Retrying softly"; return; } _empressLastBlessingAt[plan.Kind] = Time.unscaledTime; _empressLastExecutedKind = plan.Kind; _empressHasLastExecutedKind = true; profile.BlessingsGranted++; profile.LastBlessing = plan.Kind.ToString(); profile.LastScene = sceneLabel; profile.Love = Mathf.Clamp(profile.Love + 1.2f * EmpressCompanionPlugin.CompanionConfig.EmpressLoveGainScale, 0f, 100f); EmpressCompanionMemory.EmpressMarkDirty(); _empressCurrentPlan = EmpressAfterBlessingTactic(plan.Kind); } private float EmpressComputeBlessingInterval(EmpressCompanionProfile profile, PlayerAvatar player) { float empressBaseBlessingInterval = EmpressCompanionPlugin.CompanionConfig.EmpressBaseBlessingInterval; PlayerHealth playerHealth = EmpressCompanionAccess.GetPlayerHealth(player); int maxHealth = EmpressCompanionAccess.GetMaxHealth(playerHealth); int health = EmpressCompanionAccess.GetHealth(playerHealth); float num = ((maxHealth > 0) ? ((float)health / (float)maxHealth) : 1f); empressBaseBlessingInterval *= Mathf.Lerp(1.12f, 0.82f, Mathf.Clamp01(profile.Love / 100f)); if (num < 0.4f) { empressBaseBlessingInterval *= 0.68f; } if (EmpressCompanionAccess.RunIsShop()) { empressBaseBlessingInterval *= 0.86f; } return Mathf.Clamp(empressBaseBlessingInterval + Random.Range(-4f, 5f), 12f, 70f); } private bool EmpressBlessingReady(EmpressBlessingKind kind, float cooldown) { if (!_empressLastBlessingAt.TryGetValue(kind, out var value)) { return true; } return Time.unscaledTime - value >= cooldown; } private float EmpressNoveltyWeight(EmpressBlessingKind kind, float weight) { if (_empressHasLastExecutedKind && _empressLastExecutedKind == kind) { return weight * 0.32f; } return weight; } private bool EmpressTargetReady(Object target) { if (target == (Object)null) { return false; } int instanceID = target.GetInstanceID(); if (_empressTargetCooldownUntil.TryGetValue(instanceID, out var value)) { return Time.unscaledTime >= value; } return true; } private void EmpressMarkTarget(Object target, float seconds) { if (!(target == (Object)null)) { _empressTargetCooldownUntil[target.GetInstanceID()] = Time.unscaledTime + Mathf.Max(1f, seconds); } } private bool EmpressCanBloomValuable(ValuableObject valuable) { if ((Object)(object)valuable == (Object)null || !EmpressTargetReady((Object)(object)valuable)) { return false; } return !_empressBloomedTargets.ContainsKey(((Object)valuable).GetInstanceID()); } private void EmpressMarkBloom(ValuableObject valuable) { if (!((Object)(object)valuable == (Object)null)) { _empressBloomedTargets[((Object)valuable).GetInstanceID()] = Mathf.Max(1, EmpressCompanionAccess.GetLevelsCompleted(EmpressCompanionAccess.RunManagerInstance)); EmpressMarkTarget((Object)(object)valuable, 44f); } } private void EmpressCleanupTargetMemory() { if (_empressTargetCooldownUntil.Count > 0) { float unscaledTime = Time.unscaledTime; List list = null; foreach (KeyValuePair item in _empressTargetCooldownUntil) { if (unscaledTime >= item.Value) { if (list == null) { list = new List(8); } list.Add(item.Key); } } if (list != null) { for (int i = 0; i < list.Count; i++) { _empressTargetCooldownUntil.Remove(list[i]); } } } if (_empressBloomedTargets.Count > 180) { _empressBloomedTargets.Clear(); } if (_empressCartAssistBlockedUntil.Count <= 0) { return; } float unscaledTime2 = Time.unscaledTime; List list2 = null; foreach (KeyValuePair item2 in _empressCartAssistBlockedUntil) { if (unscaledTime2 >= item2.Value) { if (list2 == null) { list2 = new List(8); } list2.Add(item2.Key); } } if (list2 != null) { for (int j = 0; j < list2.Count; j++) { _empressCartAssistBlockedUntil.Remove(list2[j]); } } } private ValuableObject EmpressFindBestValuable(Vector3 origin) { //IL_0042: 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) ValuableObject result = null; float num = float.MinValue; for (int i = 0; i < _empressValuableCache.Length; i++) { ValuableObject val = _empressValuableCache[i]; PhysGrabObject valuablePhysGrabObject = EmpressCompanionAccess.GetValuablePhysGrabObject(val); if ((Object)(object)val == (Object)null || (Object)(object)valuablePhysGrabObject == (Object)null || !EmpressCanBloomValuable(val) || EmpressCompanionAccess.IsPhysDead(valuablePhysGrabObject)) { continue; } float num2 = Vector3.Distance(origin, ((Component)val).transform.position); if (!(num2 > 14f)) { float num3 = EmpressCompanionAccess.GetValuableCurrentValue(val) - num2 * 45f; if (num3 > num) { num = num3; result = val; } } } return result; } private ValuableObject EmpressFindDamagedValuable(Vector3 origin) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) ValuableObject result = null; float num = float.MaxValue; for (int i = 0; i < _empressValuableCache.Length; i++) { ValuableObject val = _empressValuableCache[i]; PhysGrabObject valuablePhysGrabObject = EmpressCompanionAccess.GetValuablePhysGrabObject(val); if (!((Object)(object)val == (Object)null) && !((Object)(object)valuablePhysGrabObject == (Object)null) && EmpressTargetReady((Object)(object)val) && !EmpressCompanionAccess.IsPhysDead(valuablePhysGrabObject) && (EmpressCompanionAccess.GetValuableCurrentValue(val) < EmpressCompanionAccess.GetValuableOriginalValue(val) || EmpressCompanionAccess.IsPhysDead(valuablePhysGrabObject))) { float num2 = Vector3.Distance(origin, ((Component)val).transform.position); if (num2 < num) { num = num2; result = val; } } } return result; } private Enemy EmpressFindNearbyEnemy(Vector3 origin, float radius) { //IL_0027: 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) Enemy result = null; float num = radius; for (int i = 0; i < _empressEnemyCache.Length; i++) { Enemy val = _empressEnemyCache[i]; if (!((Object)(object)val == (Object)null) && ((Component)val).gameObject.activeInHierarchy) { float num2 = Vector3.Distance(origin, ((Component)val).transform.position); if (num2 <= num) { num = num2; result = val; } } } return result; } private int EmpressCountNearbyEnemies(Vector3 origin, float radius) { //IL_0025: 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) int num = 0; for (int i = 0; i < _empressEnemyCache.Length; i++) { Enemy val = _empressEnemyCache[i]; if (!((Object)(object)val == (Object)null) && ((Component)val).gameObject.activeInHierarchy && Vector3.Distance(origin, ((Component)val).transform.position) <= radius) { num++; } } return num; } private PhysGrabCart EmpressFindNearbyCart(Vector3 origin, float radius) { //IL_0027: 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) PhysGrabCart result = null; float num = radius; for (int i = 0; i < _empressCartCache.Length; i++) { PhysGrabCart val = _empressCartCache[i]; if (!((Object)(object)val == (Object)null) && ((Component)val).gameObject.activeInHierarchy) { float num2 = Vector3.Distance(origin, ((Component)val).transform.position); if (num2 <= num) { num = num2; result = val; } } } return result; } private PhysGrabCart EmpressFindNearbyAvailableCart(Vector3 origin, float radius) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0048: 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) PhysGrabCart result = null; float num = radius; for (int i = 0; i < _empressCartCache.Length; i++) { PhysGrabCart val = _empressCartCache[i]; if ((Object)(object)val == (Object)null || !((Component)val).gameObject.activeInHierarchy || !EmpressCartCanAccept(val)) { continue; } Vector3 point = EmpressGetCartDepositPoint(val); if (!EmpressPointTooCloseToExtraction(point, 5.5f)) { float num2 = Vector3.Distance(origin, ((Component)val).transform.position); if (num2 <= num) { num = num2; result = val; } } } return result; } private bool EmpressCartCanAccept(PhysGrabCart cart) { if ((Object)(object)cart == (Object)null || !((Component)cart).gameObject.activeInHierarchy) { return false; } int num = (EmpressCompanionAccess.IsSmallCart(cart) ? 3 : 7); if (EmpressCompanionAccess.GetCartItemCount(cart) >= num) { return false; } EmpressInspectCartBasket(cart, out var basketOccupants, out var depositBlocked, out var bulkyOccupant); if (basketOccupants >= num || depositBlocked || bulkyOccupant) { return false; } return true; } private Vector3 EmpressGetCartDepositPoint(PhysGrabCart cart) { //IL_0040: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_0025: 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_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) Transform cartBasket = EmpressCompanionAccess.GetCartBasket(cart); if ((Object)(object)cartBasket == (Object)null) { if (!((Object)(object)cart != (Object)null)) { return Vector3.zero; } return ((Component)cart).transform.position + Vector3.up * 0.75f; } Vector3 val = cartBasket.right * Random.Range(-0.22f, 0.22f) + cartBasket.forward * Random.Range(-0.18f, 0.18f); return cartBasket.position + Vector3.up * 0.55f + val; } private void EmpressInspectCartBasket(PhysGrabCart cart, out int basketOccupants, out bool depositBlocked, out bool bulkyOccupant) { //IL_002d: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_007d: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) basketOccupants = 0; depositBlocked = false; bulkyOccupant = false; if ((Object)(object)cart == (Object)null) { return; } Transform cartBasket = EmpressCompanionAccess.GetCartBasket(cart); if ((Object)(object)cartBasket == (Object)null) { return; } bool flag = EmpressCompanionAccess.IsSmallCart(cart); Vector3 val = cartBasket.position + Vector3.up * (flag ? 0.42f : 0.48f); Vector3 val2 = (flag ? new Vector3(0.54f, 0.36f, 0.54f) : new Vector3(0.82f, 0.46f, 0.86f)); Vector3 val3 = cartBasket.position + Vector3.up * 0.55f; float num = (flag ? 0.54f : 0.7f); float num2 = (flag ? 0.88f : 1.12f); float num3 = (flag ? 1.45f : 2.05f); PhysGrabObject val4 = EmpressGetCartPhysGrabObject(cart); HashSet hashSet = new HashSet(8); Collider[] array = Physics.OverlapBox(val, val2, cartBasket.rotation, -5, (QueryTriggerInteraction)1); foreach (Collider val5 in array) { if ((Object)(object)val5 == (Object)null) { continue; } PhysGrabObject componentInParent = ((Component)val5).GetComponentInParent(); if ((Object)(object)componentInParent == (Object)null || (Object)(object)componentInParent == (Object)(object)val4 || EmpressCompanionAccess.IsPhysDead(componentInParent)) { continue; } int instanceID = ((Object)componentInParent).GetInstanceID(); if (!hashSet.Add(instanceID)) { continue; } Bounds val6 = EmpressGetObjectBounds(((Component)componentInParent).transform); Vector3 size = ((Bounds)(ref val6)).size; if (((Vector3)(ref size)).sqrMagnitude <= 0.001f) { continue; } basketOccupants++; if (!(Mathf.Max(((Bounds)(ref val6)).size.x, Mathf.Max(((Bounds)(ref val6)).size.y, ((Bounds)(ref val6)).size.z)) >= num2)) { size = ((Bounds)(ref val6)).size; if (!(((Vector3)(ref size)).magnitude >= num3)) { goto IL_01c5; } } bulkyOccupant = true; goto IL_01c5; IL_01c5: Vector3 val7 = ((Bounds)(ref val6)).center - val3; val7.y *= 0.5f; if (((Vector3)(ref val7)).magnitude <= num) { depositBlocked = true; } } } private static Bounds EmpressGetObjectBounds(Transform root) { //IL_001d: 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_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)root == (Object)null) { return new Bounds(Vector3.zero, Vector3.zero); } bool flag = false; Bounds result = default(Bounds); Collider[] componentsInChildren = ((Component)root).GetComponentsInChildren(true); foreach (Collider val in componentsInChildren) { if (!((Object)(object)val == (Object)null) && ((Component)val).gameObject.activeInHierarchy) { if (!flag) { result = val.bounds; flag = true; } else { ((Bounds)(ref result)).Encapsulate(val.bounds); } } } if (flag) { return result; } Renderer[] componentsInChildren2 = ((Component)root).GetComponentsInChildren(true); foreach (Renderer val2 in componentsInChildren2) { if (!((Object)(object)val2 == (Object)null) && ((Component)val2).gameObject.activeInHierarchy) { if (!flag) { result = val2.bounds; flag = true; } else { ((Bounds)(ref result)).Encapsulate(val2.bounds); } } } if (!flag) { return new Bounds(root.position, Vector3.one * 0.35f); } return result; } private bool EmpressCanManifestCarryValuable(ValuableObject valuable, PhysGrabObject physGrabObject, PhysGrabCart cart) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)valuable == (Object)null || (Object)(object)physGrabObject == (Object)null || (Object)(object)cart == (Object)null) { return false; } bool flag = EmpressCompanionAccess.IsSmallCart(cart); Bounds val = EmpressGetObjectBounds(((Component)physGrabObject).transform); float num = Mathf.Max(((Bounds)(ref val)).size.x, Mathf.Max(((Bounds)(ref val)).size.y, ((Bounds)(ref val)).size.z)); Vector3 size = ((Bounds)(ref val)).size; float magnitude = ((Vector3)(ref size)).magnitude; if (num > (flag ? 0.92f : 1.2f) || magnitude > (flag ? 1.55f : 2.15f)) { return false; } return true; } private bool EmpressPointTooCloseToExtraction(Vector3 point, float radius) { //IL_0016: 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_004b: 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) for (int i = 0; i < _empressExtractionCache.Length; i++) { ExtractionPoint val = _empressExtractionCache[i]; if ((Object)(object)val != (Object)null && Vector3.Distance(point, ((Component)val).transform.position) <= radius) { return true; } } ExtractionPoint val2 = EmpressFindExtraction(); if ((Object)(object)val2 != (Object)null) { return Vector3.Distance(point, ((Component)val2).transform.position) <= radius; } return false; } private ValuableObject EmpressFindCartAssistValuable(PhysGrabCart cart, Vector3 playerPosition) { //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_00ab: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)cart == (Object)null || !EmpressCartCanAccept(cart)) { return null; } Vector3 val = EmpressGetCartDepositPoint(cart); ValuableObject result = null; float num = float.MinValue; for (int i = 0; i < _empressValuableCache.Length; i++) { ValuableObject val2 = _empressValuableCache[i]; PhysGrabObject valuablePhysGrabObject = EmpressCompanionAccess.GetValuablePhysGrabObject(val2); if ((Object)(object)val2 == (Object)null || (Object)(object)valuablePhysGrabObject == (Object)null || EmpressCompanionAccess.IsPhysDead(valuablePhysGrabObject) || EmpressCompanionAccess.IsHeldOrGrabbed(valuablePhysGrabObject)) { continue; } int instanceID = ((Object)val2).GetInstanceID(); if ((_empressCartAssistBlockedUntil.TryGetValue(instanceID, out var value) && Time.unscaledTime < value) || EmpressCompanionAccess.IsObjectInCart(valuablePhysGrabObject, cart) || EmpressPointTooCloseToExtraction(((Component)val2).transform.position, 5.5f) || !EmpressCanManifestCarryValuable(val2, valuablePhysGrabObject, cart)) { continue; } float num2 = Vector3.Distance(((Component)val2).transform.position, val); float num3 = Vector3.Distance(((Component)val2).transform.position, playerPosition); float num4 = (EmpressCompanionAccess.IsSmallCart(cart) ? 7.5f : 10.5f); if (!(num2 > num4) && !(num3 > 24f)) { float num5 = EmpressCompanionAccess.GetValuableCurrentValue(val2) * 0.0025f - num2 * 1.35f - num3 * 0.25f; if (num5 > num) { num = num5; result = val2; } } } return result; } private ValuableObject EmpressFindTreasureCue(Vector3 playerPosition, float radius) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) ValuableObject result = null; float num = float.MinValue; for (int i = 0; i < _empressValuableCache.Length; i++) { ValuableObject val = _empressValuableCache[i]; PhysGrabObject valuablePhysGrabObject = EmpressCompanionAccess.GetValuablePhysGrabObject(val); if ((Object)(object)val == (Object)null || (Object)(object)valuablePhysGrabObject == (Object)null || !EmpressTargetReady((Object)(object)val) || EmpressCompanionAccess.IsPhysDead(valuablePhysGrabObject) || EmpressCompanionAccess.IsHeldOrGrabbed(valuablePhysGrabObject) || EmpressCompanionAccess.IsObjectInCart(valuablePhysGrabObject) || EmpressPointTooCloseToExtraction(((Component)val).transform.position, 5.5f)) { continue; } float num2 = Vector3.Distance(playerPosition, ((Component)val).transform.position); if (!(num2 > radius) && !(num2 < 3f)) { float valuableCurrentValue = EmpressCompanionAccess.GetValuableCurrentValue(val); float num3 = ((valuableCurrentValue < EmpressCompanionAccess.GetValuableOriginalValue(val)) ? 2.5f : 0f); float num4 = valuableCurrentValue * 0.002f + num3 - num2 * 0.18f; if (num4 > num) { num = num4; result = val; } } } return result; } private void EmpressBlockCartAssist(ValuableObject valuable, float seconds) { if ((Object)(object)valuable != (Object)null) { _empressCartAssistBlockedUntil[((Object)valuable).GetInstanceID()] = Time.unscaledTime + Mathf.Max(1f, seconds); } } private static PhysGrabObject EmpressGetCartPhysGrabObject(PhysGrabCart cart) { return EmpressCompanionAccess.GetCartPhysGrabObject(cart); } private ItemAttributes EmpressFindBestShopItem() { ItemAttributes val = null; int num = int.MinValue; for (int i = 0; i < _empressItemCache.Length; i++) { ItemAttributes val2 = _empressItemCache[i]; if (!((Object)(object)val2 == (Object)null) && EmpressCompanionAccess.IsShopItem(val2)) { int itemValue = EmpressCompanionAccess.GetItemValue(val2); if (itemValue > num) { num = itemValue; val = val2; } } } List shoppingList = EmpressCompanionAccess.GetShoppingList(EmpressCompanionAccess.ShopManagerInstance); if ((Object)(object)val == (Object)null && shoppingList != null && shoppingList.Count > 0) { val = shoppingList[0]; } return val; } private ExtractionPoint EmpressFindExtraction() { if (_empressExtractionCache.Length != 0) { return _empressExtractionCache[0]; } RoundDirector roundDirectorInstance = EmpressCompanionAccess.RoundDirectorInstance; if (!((Object)(object)roundDirectorInstance != (Object)null)) { return null; } return EmpressCompanionAccess.GetCurrentExtraction(roundDirectorInstance); } private int EmpressCountDamagedValuables() { int num = 0; for (int i = 0; i < _empressValuableCache.Length; i++) { ValuableObject val = _empressValuableCache[i]; PhysGrabObject valuablePhysGrabObject = EmpressCompanionAccess.GetValuablePhysGrabObject(val); if (!((Object)(object)val == (Object)null) && !((Object)(object)valuablePhysGrabObject == (Object)null) && (EmpressCompanionAccess.GetValuableCurrentValue(val) < EmpressCompanionAccess.GetValuableOriginalValue(val) || EmpressCompanionAccess.IsPhysDead(valuablePhysGrabObject))) { num++; } } return num; } private ValuableObject EmpressFindValuableForObject(PhysGrabObject physGrabObject) { if ((Object)(object)physGrabObject == (Object)null) { return null; } for (int i = 0; i < _empressValuableCache.Length; i++) { ValuableObject val = _empressValuableCache[i]; if ((Object)(object)val != (Object)null && (Object)(object)EmpressCompanionAccess.GetValuablePhysGrabObject(val) == (Object)(object)physGrabObject) { return val; } } return null; } private int EmpressCountNearbyValuables(Vector3 origin, float radius) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) int num = 0; for (int i = 0; i < _empressValuableCache.Length; i++) { ValuableObject val = _empressValuableCache[i]; PhysGrabObject valuablePhysGrabObject = EmpressCompanionAccess.GetValuablePhysGrabObject(val); if (!((Object)(object)val == (Object)null) && !((Object)(object)valuablePhysGrabObject == (Object)null) && !EmpressCompanionAccess.IsPhysDead(valuablePhysGrabObject) && Vector3.Distance(origin, ((Component)val).transform.position) <= radius) { num++; } } return num; } private int EmpressCountNearbyDamagedValuables(Vector3 origin, float radius) { //IL_0028: 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) int num = 0; for (int i = 0; i < _empressValuableCache.Length; i++) { ValuableObject val = _empressValuableCache[i]; PhysGrabObject valuablePhysGrabObject = EmpressCompanionAccess.GetValuablePhysGrabObject(val); if (!((Object)(object)val == (Object)null) && !((Object)(object)valuablePhysGrabObject == (Object)null) && !(Vector3.Distance(origin, ((Component)val).transform.position) > radius) && (EmpressCompanionAccess.GetValuableCurrentValue(val) < EmpressCompanionAccess.GetValuableOriginalValue(val) || EmpressCompanionAccess.IsPhysDead(valuablePhysGrabObject))) { num++; } } return num; } private int EmpressRepairNearbyValuables(Vector3 origin, float radius, int limit) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) int num = 0; for (int i = 0; i < _empressValuableCache.Length; i++) { if (num >= limit) { break; } ValuableObject val = _empressValuableCache[i]; if (!((Object)(object)val == (Object)null) && !(Vector3.Distance(origin, ((Component)val).transform.position) > radius) && !(EmpressCompanionAccess.GetValuableCurrentValue(val) >= EmpressCompanionAccess.GetValuableOriginalValue(val)) && EmpressRepairValuable(val)) { num++; } } return num; } private int EmpressBloomNearbyValuables(Vector3 origin, float radius, int limit, ValuableObject preferred = null) { //IL_0015: 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_00a1: 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) int i = 0; HashSet hashSet = new HashSet(); if ((Object)(object)preferred != (Object)null && Vector3.Distance(origin, ((Component)preferred).transform.position) <= radius && EmpressBloomValuable(preferred)) { hashSet.Add(preferred); i++; } for (; i < limit; i++) { ValuableObject val = null; float num = float.MinValue; for (int j = 0; j < _empressValuableCache.Length; j++) { ValuableObject val2 = _empressValuableCache[j]; PhysGrabObject valuablePhysGrabObject = EmpressCompanionAccess.GetValuablePhysGrabObject(val2); if ((Object)(object)val2 == (Object)null || (Object)(object)valuablePhysGrabObject == (Object)null || hashSet.Contains(val2) || !EmpressCanBloomValuable(val2) || EmpressCompanionAccess.IsPhysDead(valuablePhysGrabObject)) { continue; } float num2 = Vector3.Distance(origin, ((Component)val2).transform.position); if (!(num2 > radius)) { float num3 = EmpressCompanionAccess.GetValuableCurrentValue(val2) - num2 * 40f; if (num3 > num) { num = num3; val = val2; } } } if ((Object)(object)val == (Object)null || !EmpressBloomValuable(val)) { break; } hashSet.Add(val); } return i; } private bool EmpressBloomValuable(ValuableObject valuable) { if ((Object)(object)valuable == (Object)null || !EmpressCanBloomValuable(valuable)) { return false; } float valuableOriginalValue = EmpressCompanionAccess.GetValuableOriginalValue(valuable); float valuableCurrentValue = EmpressCompanionAccess.GetValuableCurrentValue(valuable); int num = Mathf.Max(500, Mathf.RoundToInt(Mathf.Max(valuableOriginalValue, 1000f) * 0.22f * Mathf.Lerp(0.8f, 1.35f, EmpressCompanionPlugin.CompanionConfig.EmpressBlessingStrength))); EmpressCompanionAccess.SetValuableDollarValues(valuable, valuableOriginalValue + (float)num, valuableCurrentValue + (float)num); PhysGrabObject valuablePhysGrabObject = EmpressCompanionAccess.GetValuablePhysGrabObject(valuable); if ((Object)(object)valuablePhysGrabObject != (Object)null) { EmpressCompanionAccess.LightenObject(valuablePhysGrabObject, 18f); } EmpressMarkBloom(valuable); return true; } private bool EmpressRepairValuable(ValuableObject valuable) { if ((Object)(object)valuable == (Object)null || !EmpressTargetReady((Object)(object)valuable)) { return false; } PhysGrabObject valuablePhysGrabObject = EmpressCompanionAccess.GetValuablePhysGrabObject(valuable); float valuableCurrentValue = EmpressCompanionAccess.GetValuableCurrentValue(valuable); float valuableOriginalValue = EmpressCompanionAccess.GetValuableOriginalValue(valuable); bool flag = valuableCurrentValue < valuableOriginalValue; bool num = (Object)(object)valuablePhysGrabObject != (Object)null && EmpressCompanionAccess.RepairValuable(valuablePhysGrabObject, 0.75f); float current = Mathf.Max(EmpressCompanionAccess.GetValuableCurrentValue(valuable), valuableOriginalValue); EmpressCompanionAccess.SetValuableDollarValues(valuable, valuableOriginalValue, current); bool num2 = num || flag; if (num2) { EmpressMarkTarget((Object)(object)valuable, 28f); } return num2; } private bool EmpressDiscountShop(ItemAttributes item, int amount) { if ((Object)(object)item == (Object)null) { return false; } bool flag = EmpressReduceShopItemCost(item, amount); List shoppingList = EmpressCompanionAccess.GetShoppingList(EmpressCompanionAccess.ShopManagerInstance); if (shoppingList != null) { int discount = Mathf.RoundToInt((float)amount * 0.15f); for (int i = 0; i < shoppingList.Count; i++) { ItemAttributes val = shoppingList[i]; if ((Object)(object)val != (Object)null && (Object)(object)val != (Object)(object)item) { flag |= EmpressReduceShopItemCost(val, discount); } } } if (flag) { EmpressCompanionAccess.ShopUpdateCost(); } return flag; } private bool EmpressGiftShopItem(ItemAttributes item) { if ((Object)(object)item == (Object)null) { return false; } if (EmpressCompanionAccess.GetItemValue(item) <= 1) { return false; } EmpressCompanionAccess.SetItemValue(item, 1); EmpressCompanionAccess.ShopUpdateCost(); return true; } private bool EmpressCascadeShop(int amount) { List shoppingList = EmpressCompanionAccess.GetShoppingList(EmpressCompanionAccess.ShopManagerInstance); if (shoppingList == null || shoppingList.Count <= 0) { return false; } int discount = Mathf.Max(1, amount / Mathf.Max(1, shoppingList.Count)); ItemAttributes val = null; int num = int.MinValue; bool flag = false; for (int i = 0; i < shoppingList.Count; i++) { ItemAttributes val2 = shoppingList[i]; if (!((Object)(object)val2 == (Object)null)) { int itemValue = EmpressCompanionAccess.GetItemValue(val2); flag |= EmpressReduceShopItemCost(val2, discount); if (itemValue > num) { num = itemValue; val = val2; } } } if ((Object)(object)val != (Object)null && EmpressCompanionAccess.GetItemValue(val) > 1) { EmpressCompanionAccess.SetItemValue(val, 1); flag = true; } if (flag) { EmpressCompanionAccess.ShopUpdateCost(); } return flag; } private int EmpressGrantUpgradeRush(PlayerAvatar player, int count) { int num = 0; for (int i = 0; i < count; i++) { if (EmpressCompanionAccess.TryGrantUpgrade(player, i switch { 0 => EmpressBlessingKind.UpgradeGift, 1 => EmpressBlessingKind.GraceShield, _ => EmpressBlessingKind.Featherweight, })) { num++; } } if (num > 0) { EmpressCompanionAccess.ApplyUpgradeFlash(player); EmpressCompanionAccess.HealPlayer(player, 4 + num * 4, effect: true); EmpressCompanionAccess.ApplyLoveEyes(player, 4f + (float)num); } return num; } private bool EmpressBlessCourier(PlayerAvatar player, PhysGrabObject heldObject, ValuableObject targetValuable, Enemy nearbyEnemy) { //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_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)heldObject == (Object)null) { return false; } bool flag = false; EmpressCompanionAccess.LightenObject(heldObject, 18f); flag = true; if (targetValuable == null) { targetValuable = EmpressFindValuableForObject(heldObject); } if ((Object)(object)targetValuable != (Object)null) { flag = ((!(EmpressCompanionAccess.GetValuableCurrentValue(targetValuable) < EmpressCompanionAccess.GetValuableOriginalValue(targetValuable))) ? (flag | EmpressBloomValuable(targetValuable)) : (flag | EmpressRepairValuable(targetValuable))); } EmpressCompanionAccess.HealPlayer(player, 8, effect: true); EmpressCompanionAccess.ApplyLoveEyes(player, 5f); EmpressCompanionAccess.SetInvincible(player, 2.8f); if ((Object)(object)nearbyEnemy != (Object)null || (Object)(object)targetValuable != (Object)null) { EmpressCompanionAccess.DistractEnemies(((Component)player).transform.position + Random.insideUnitSphere * 3f, 20f); } return flag; } private bool EmpressBlessExtractionFocus(PlayerAvatar player, PhysGrabObject heldObject, ValuableObject targetValuable, Enemy nearbyEnemy, ExtractionPoint extraction) { //IL_0096: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null || (Object)(object)heldObject == (Object)null) { return false; } bool flag = false; EmpressCompanionAccess.LightenObject(heldObject, 24f); EmpressCompanionAccess.SetInvincible(player, 2.6f); EmpressCompanionAccess.HealPlayer(player, 5, effect: true); flag = true; if (targetValuable == null) { targetValuable = EmpressFindValuableForObject(heldObject); } if ((Object)(object)targetValuable != (Object)null && EmpressTargetReady((Object)(object)targetValuable)) { if (EmpressCompanionAccess.GetValuableCurrentValue(targetValuable) < EmpressCompanionAccess.GetValuableOriginalValue(targetValuable)) { flag |= EmpressRepairValuable(targetValuable); } EmpressMarkTarget((Object)(object)targetValuable, 16f); } Vector3 val = (((Object)(object)extraction != (Object)null) ? ((Component)extraction).transform.position : ((Component)player).transform.position); EmpressCommandProjectionTo(Vector3.Lerp(((Component)player).transform.position, val, 0.58f), 5f); if ((Object)(object)nearbyEnemy != (Object)null || EmpressCountNearbyEnemies(((Component)player).transform.position, 18f) > 0) { EmpressCompanionAccess.DistractEnemies(val + Random.insideUnitSphere * 2f, 24f); } EmpressApplyPinkPulse(val, 8f); return flag; } private bool EmpressBlessThreatWard(PlayerAvatar player, Enemy targetEnemy, int enemyPressure) { //IL_0027: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return false; } Vector3 val = (((Object)(object)targetEnemy != (Object)null) ? Vector3.Lerp(((Component)player).transform.position, ((Component)targetEnemy).transform.position, 0.45f) : ((Component)player).transform.position); EmpressCommandProjectionTo(val, 5.5f); EmpressCompanionAccess.DistractEnemies(val + Random.insideUnitSphere * 3f, 28f); EmpressCompanionAccess.SetInvincible(player, (enemyPressure >= 2) ? 5.2f : 3.6f); EmpressCompanionAccess.HealPlayer(player, (enemyPressure >= 2) ? 10 : 6, effect: true); EmpressCompanionAccess.ApplyLoveEyes(player, 4.4f); EmpressApplyPinkPulse(((Component)player).transform.position, (enemyPressure >= 2) ? 14f : 10f); return true; } private bool EmpressBlessCart(PlayerAvatar player, PhysGrabObject cartObject, ValuableObject targetValuable) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) PhysGrabCart val = EmpressFindNearbyCart(((Component)player).transform.position, 20f); if ((Object)(object)cartObject == (Object)null && (Object)(object)val != (Object)null) { cartObject = EmpressGetCartPhysGrabObject(val); } bool flag = false; if ((Object)(object)cartObject != (Object)null) { EmpressCompanionAccess.LightenObject(cartObject, 30f); EmpressMarkTarget((Object)(object)cartObject, 30f); flag = true; } PhysGrabObject heldObject = EmpressCompanionAccess.GetHeldObject(); if ((Object)(object)heldObject != (Object)null) { EmpressCompanionAccess.LightenObject(heldObject, 18f); flag = true; } if ((Object)(object)targetValuable != (Object)null && EmpressTargetReady((Object)(object)targetValuable) && EmpressCompanionAccess.GetValuableCurrentValue(targetValuable) < EmpressCompanionAccess.GetValuableOriginalValue(targetValuable)) { flag |= EmpressRepairValuable(targetValuable); } Vector3 val2 = (((Object)(object)val != (Object)null) ? ((Component)val).transform.position : ((Component)player).transform.position); EmpressCommandProjectionTo(val2, 5f); EmpressApplyPinkPulse(val2, 10f); return flag; } private bool EmpressUnderwriteShop(ItemAttributes item, int amountK) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) if (!EmpressCompanionAccess.RunIsShop()) { return false; } int num = Mathf.Max(0, EmpressCompanionAccess.GetShopTotalCost() - EmpressCompanionAccess.GetRunCurrency()); if (num <= 0) { return false; } int num2 = Mathf.Clamp(amountK, 1, Mathf.Min(3, num)); EmpressCompanionAccess.SetRunCurrency(EmpressCompanionAccess.GetRunCurrency() + num2); if ((Object)(object)item != (Object)null) { EmpressCommandProjectionTo(((Component)item).transform.position, 4.6f); } bool flag = true; if ((Object)(object)item != (Object)null && EmpressCompanionAccess.GetItemValue(item) > 1) { flag |= EmpressReduceShopItemCost(item, 1); EmpressCompanionAccess.ShopUpdateCost(); } return flag; } private bool EmpressBlessMorale(EmpressCompanionProfile profile, PlayerAvatar player, ValuableObject targetValuable, Enemy nearbyEnemy) { //IL_00ab: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: 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_0060: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return false; } EmpressCompanionAccess.HealPlayer(player, (profile.Love >= 70f) ? 8 : 5, effect: true); EmpressCompanionAccess.ApplyLoveEyes(player, (profile.Love >= 70f) ? 5.2f : 3.6f); if ((Object)(object)nearbyEnemy != (Object)null) { EmpressCommandProjectionTo(Vector3.Lerp(((Component)player).transform.position, ((Component)nearbyEnemy).transform.position, 0.42f), 4.6f); EmpressCompanionAccess.DistractEnemies(((Component)player).transform.position + Random.insideUnitSphere * 2f, 16f); } else { EmpressCommandProjectionTo(((Component)player).transform.position + ((Component)player).transform.right * 2f, 3.2f); } if ((Object)(object)targetValuable != (Object)null && EmpressTargetReady((Object)(object)targetValuable)) { PhysGrabObject valuablePhysGrabObject = EmpressCompanionAccess.GetValuablePhysGrabObject(targetValuable); if ((Object)(object)valuablePhysGrabObject != (Object)null) { EmpressCompanionAccess.LightenObject(valuablePhysGrabObject, 12f); EmpressMarkTarget((Object)(object)targetValuable, 16f); } } if (Random.value > 0.45f) { EmpressApplyPinkPulse(((Component)player).transform.position, 7f); } return true; } private bool EmpressBlessExtraction(int amount) { RoundDirector roundDirectorInstance = EmpressCompanionAccess.RoundDirectorInstance; if ((Object)(object)roundDirectorInstance == (Object)null) { return false; } int currentHaul = EmpressCompanionAccess.GetCurrentHaul(roundDirectorInstance); int haulGoal = EmpressCompanionAccess.GetHaulGoal(roundDirectorInstance); int num = Mathf.Max(0, haulGoal - currentHaul); int num2 = Mathf.Max(0, num - 500); if (num2 <= 0) { return false; } int num3 = Mathf.Clamp(amount, 1, num2); if (num3 <= 0) { return false; } int num4 = Mathf.Max(currentHaul + 500, haulGoal - num3); if (num4 >= haulGoal) { return false; } EmpressCompanionAccess.UpdateExtractionGoal(num4); return true; } private bool EmpressQuotaMercy(PlayerAvatar player, int amount) { //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) //IL_007b: Unknown result type (might be due to invalid IL or missing references) if (!EmpressBlessExtraction(amount)) { return false; } int num = Mathf.Clamp(Mathf.RoundToInt((float)amount / 1200f), 1, 2); EmpressCompanionAccess.SetRunCurrency(EmpressCompanionAccess.GetRunCurrency() + num); ValuableObject val = EmpressFindDamagedValuable(((Component)player).transform.position); if ((Object)(object)val != (Object)null) { EmpressRepairValuable(val); } EmpressCompanionAccess.HealPlayer(player, 6, effect: true); if ((Object)(object)EmpressFindNearbyEnemy(((Component)player).transform.position, 14f) != (Object)null) { EmpressCompanionAccess.DistractEnemies(((Component)player).transform.position, 22f); } return true; } private bool EmpressReduceShopItemCost(ItemAttributes item, int discount) { if ((Object)(object)item == (Object)null || discount <= 0) { return false; } int itemValue = EmpressCompanionAccess.GetItemValue(item); int num = Mathf.Max(1, itemValue - discount); if (num >= itemValue) { return false; } EmpressCompanionAccess.SetItemValue(item, num); return true; } private bool EmpressApplyPinkPulse(Vector3 origin, float radius) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Expected O, but got Unknown //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) Renderer[] array = Object.FindObjectsOfType(); int num = 0; float until = Time.unscaledTime + Random.Range(18f, 28f); foreach (Renderer val in array) { if ((Object)(object)val == (Object)null || !((Component)val).gameObject.activeInHierarchy) { continue; } Bounds bounds = val.bounds; if (Vector3.Distance(origin, ((Bounds)(ref bounds)).center) > radius || (Object)(object)((Component)((Component)val).transform.root).GetComponent() != (Object)null) { continue; } if (EmpressTryRefreshPinkRecord(val, until)) { num++; if (num >= 12) { break; } continue; } Material[] materials; try { materials = val.materials; } catch { continue; } if (materials == null || materials.Length == 0) { continue; } EmpressPinkRecord empressPinkRecord = new EmpressPinkRecord { Renderer = val, Until = until, OriginalMaterials = materials, PinkMaterials = (Material[])(object)new Material[materials.Length], UsesMaterialSwap = true }; for (int j = 0; j < materials.Length; j++) { Material val2 = materials[j]; if (!((Object)(object)val2 == (Object)null)) { Material val3 = new Material(val2) { name = ((Object)val2).name + " (Empress Pink)" }; if (val3.HasProperty("_Color")) { val3.SetColor("_Color", Color.Lerp(val2.GetColor("_Color"), new Color(1f, 0.2f, 0.78f, 1f), 0.94f)); } if (val3.HasProperty("_BaseColor")) { val3.SetColor("_BaseColor", Color.Lerp(val2.GetColor("_BaseColor"), new Color(1f, 0.22f, 0.8f, 1f), 0.96f)); } if (val3.HasProperty("_EmissionColor")) { val3.EnableKeyword("_EMISSION"); val3.SetColor("_EmissionColor", new Color(3.2f, 0.38f, 2.45f, 1f)); } empressPinkRecord.PinkMaterials[j] = val3; } } try { val.materials = empressPinkRecord.PinkMaterials; } catch { for (int k = 0; k < empressPinkRecord.PinkMaterials.Length; k++) { if ((Object)(object)empressPinkRecord.PinkMaterials[k] != (Object)null) { Object.Destroy((Object)(object)empressPinkRecord.PinkMaterials[k]); } } continue; } _empressPinkRecords.Add(empressPinkRecord); num++; if (num >= 12) { break; } } return num > 0; } private bool EmpressTryRefreshPinkRecord(Renderer renderer, float until) { for (int i = 0; i < _empressPinkRecords.Count; i++) { EmpressPinkRecord empressPinkRecord = _empressPinkRecords[i]; if (!((Object)(object)empressPinkRecord.Renderer != (Object)(object)renderer)) { empressPinkRecord.Until = Mathf.Max(empressPinkRecord.Until, until); _empressPinkRecords[i] = empressPinkRecord; return true; } } return false; } private void EmpressTickPinkRecords() { float unscaledTime = Time.unscaledTime; for (int num = _empressPinkRecords.Count - 1; num >= 0; num--) { EmpressPinkRecord empressPinkRecord = _empressPinkRecords[num]; if ((Object)(object)empressPinkRecord.Renderer == (Object)null) { _empressPinkRecords.RemoveAt(num); } else if (!(unscaledTime < empressPinkRecord.Until)) { try { if (empressPinkRecord.OriginalMaterials != null && empressPinkRecord.OriginalMaterials.Length != 0) { empressPinkRecord.Renderer.materials = empressPinkRecord.OriginalMaterials; } if (empressPinkRecord.PinkMaterials != null) { for (int i = 0; i < empressPinkRecord.PinkMaterials.Length; i++) { if ((Object)(object)empressPinkRecord.PinkMaterials[i] != (Object)null) { Object.Destroy((Object)(object)empressPinkRecord.PinkMaterials[i]); } } } } catch { } _empressPinkRecords.RemoveAt(num); } } } private void EmpressTickAvatarManifestation(EmpressCompanionProfile profile, PlayerAvatar player, EmpressCompanionOverlay overlay) { float empressManifestLoveThreshold = EmpressCompanionPlugin.CompanionConfig.EmpressManifestLoveThreshold; if (profile.Love < empressManifestLoveThreshold || (Object)(object)player == (Object)null || EmpressCompanionAccess.IsDead(player) || !EmpressSceneIsSupported()) { EmpressDismissAvatarProjection(); return; } if ((Object)(object)_empressAvatarProjection == (Object)null) { EmpressEnsureAvatarProjection(profile, player, overlay); } if (EmpressTickManifestedActiveAssist(profile, player, overlay)) { _empressCurrentPlan = "Helping in person"; } if (!((Object)(object)_empressAvatarProjection == (Object)null) && !(Time.unscaledTime < _empressNextManifestAssistAt)) { _empressNextManifestAssistAt = Time.unscaledTime + Random.Range(10f, 18f); if (EmpressManifestAssist(profile, player, overlay)) { _empressCurrentPlan = "Manifested beside you"; } } } private bool EmpressEnsureAvatarProjection(EmpressCompanionProfile profile, PlayerAvatar player, EmpressCompanionOverlay overlay) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_empressAvatarProjection != (Object)null) { return true; } GameObject avatarVisualRoot = EmpressCompanionAccess.GetAvatarVisualRoot(player); if ((Object)(object)avatarVisualRoot == (Object)null) { EmpressCompanionPlugin.EmpressWarning("avatar projection failed: local PlayerAvatarVisuals root was not available"); return false; } GameObject val; try { val = Object.Instantiate(avatarVisualRoot); } catch (Exception ex) { EmpressCompanionPlugin.EmpressWarning("avatar projection instantiate failed: " + ex.GetType().Name); return false; } val.transform.position = ((Component)player).transform.position + ((Component)player).transform.TransformDirection(new Vector3(-1.25f, 0.05f, 1.25f)); val.transform.rotation = ((Component)player).transform.rotation; EmpressPrepareProjectionClone(val); EmpressTintProjection(val); if (EmpressCountProjectionRenderers(val) <= 0) { EmpressCompanionPlugin.EmpressWarning("avatar projection cloned, but no visible renderers were found after activation"); } _empressAvatarProjection = val.AddComponent(); _empressAvatarProjection.EmpressBind(player, profile.CompanionName); _empressAvatarProjection.EmpressOrbitNow(); _empressNextManifestAssistAt = Time.unscaledTime + Random.Range(7f, 12f); profile.Manifestations++; EmpressCompanionMemory.EmpressMarkDirty(); if (!_empressManifestAnnounced && (Object)(object)overlay != (Object)null) { _empressManifestAnnounced = true; overlay.EmpressPushMessage(profile.CompanionName, EmpressBuildManifestLine(profile), new Color(1f, 0.64f, 0.9f, 1f), urgent: true, 6f); } return true; } private void EmpressDismissAvatarProjection() { if (!((Object)(object)_empressAvatarProjection == (Object)null)) { GameObject gameObject = ((Component)_empressAvatarProjection).gameObject; _empressAvatarProjection = null; if ((Object)(object)gameObject != (Object)null) { Object.Destroy((Object)(object)gameObject); } } } private static void EmpressPrepareProjectionClone(GameObject clone) { //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) MonoBehaviour[] componentsInChildren = clone.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { if ((Object)(object)componentsInChildren[i] != (Object)null) { ((Behaviour)componentsInChildren[i]).enabled = false; } } clone.SetActive(true); Transform[] componentsInChildren2 = clone.GetComponentsInChildren(true); for (int j = 0; j < componentsInChildren2.Length; j++) { if ((Object)(object)componentsInChildren2[j] != (Object)null) { ((Component)componentsInChildren2[j]).gameObject.SetActive(true); } } Renderer[] componentsInChildren3 = clone.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren3) { if (!((Object)(object)val == (Object)null)) { val.enabled = true; SkinnedMeshRenderer val2 = (SkinnedMeshRenderer)(object)((val is SkinnedMeshRenderer) ? val : null); if ((Object)(object)val2 != (Object)null) { val2.updateWhenOffscreen = true; } } } Animator[] componentsInChildren4 = clone.GetComponentsInChildren(true); foreach (Animator val3 in componentsInChildren4) { if (!((Object)(object)val3 == (Object)null)) { ((Behaviour)val3).enabled = true; val3.speed = 1f; val3.cullingMode = (AnimatorCullingMode)0; } } Collider[] componentsInChildren5 = clone.GetComponentsInChildren(true); for (int m = 0; m < componentsInChildren5.Length; m++) { if ((Object)(object)componentsInChildren5[m] != (Object)null) { componentsInChildren5[m].enabled = false; } } Rigidbody[] componentsInChildren6 = clone.GetComponentsInChildren(true); foreach (Rigidbody val4 in componentsInChildren6) { if (!((Object)(object)val4 == (Object)null)) { val4.isKinematic = true; val4.detectCollisions = false; val4.useGravity = false; } } AudioSource[] componentsInChildren7 = clone.GetComponentsInChildren(true); for (int num = 0; num < componentsInChildren7.Length; num++) { if ((Object)(object)componentsInChildren7[num] != (Object)null) { ((Behaviour)componentsInChildren7[num]).enabled = false; } } ParticleSystem[] componentsInChildren8 = clone.GetComponentsInChildren(true); foreach (ParticleSystem val5 in componentsInChildren8) { if (!((Object)(object)val5 == (Object)null)) { EmissionModule emission = val5.emission; ((EmissionModule)(ref emission)).enabled = false; val5.Stop(true, (ParticleSystemStopBehavior)0); } } } private static int EmpressCountProjectionRenderers(GameObject clone) { int num = 0; Renderer[] componentsInChildren = clone.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if ((Object)(object)val != (Object)null && val.enabled && ((Component)val).gameObject.activeInHierarchy) { num++; } } return num; } private static void EmpressTintProjection(GameObject clone) { //IL_0066: 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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00af: 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) //IL_00d2: 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) Renderer[] componentsInChildren = clone.GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if ((Object)(object)val == (Object)null) { continue; } Material[] materials; try { materials = val.materials; } catch { continue; } foreach (Material val2 in materials) { if (!((Object)(object)val2 == (Object)null)) { if (val2.HasProperty("_Color")) { val2.SetColor("_Color", Color.Lerp(val2.GetColor("_Color"), new Color(1f, 0.28f, 0.82f, 0.78f), 0.82f)); } if (val2.HasProperty("_BaseColor")) { val2.SetColor("_BaseColor", Color.Lerp(val2.GetColor("_BaseColor"), new Color(1f, 0.32f, 0.86f, 0.78f), 0.86f)); } if (val2.HasProperty("_EmissionColor")) { val2.EnableKeyword("_EMISSION"); val2.SetColor("_EmissionColor", new Color(1.8f, 0.34f, 1.28f, 1f)); } } } } } private bool EmpressTickManifestedActiveAssist(EmpressCompanionProfile profile, PlayerAvatar player, EmpressCompanionOverlay overlay) { //IL_0025: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_empressAvatarProjection == (Object)null || (Object)(object)player == (Object)null) { return false; } float unscaledTime = Time.unscaledTime; Vector3 position = ((Component)player).transform.position; if (EmpressHasManifestCarryTask()) { return EmpressTickManifestCarryTask(profile, player, overlay); } if (unscaledTime < _empressNextManifestActionAt) { return false; } if (unscaledTime >= _empressNextManifestGuardAt) { _empressNextManifestGuardAt = unscaledTime + Random.Range(1.1f, 2.1f); Enemy val = EmpressFindNearbyEnemy(position, (profile.Love >= 82f) ? 9.5f : 7.5f); if ((Object)(object)val != (Object)null && !EmpressCompanionAccess.EnemyIsDead(val) && EmpressTargetReady((Object)(object)val)) { _empressNextManifestGuardAt = unscaledTime + Random.Range(3.2f, 5.4f); if (EmpressManifestThrowEnemy(profile, player, val, overlay)) { EmpressSetManifestActionCooldown(4.6f, 7.2f); return true; } } } if (unscaledTime >= _empressNextManifestHealAt) { _empressNextManifestHealAt = unscaledTime + Random.Range(5.5f, 8.5f); if (EmpressManifestHealIfNeeded(profile, player, overlay)) { _empressNextManifestHealAt = unscaledTime + Random.Range(12f, 17f); EmpressSetManifestActionCooldown(5.4f, 8.6f); return true; } } if (unscaledTime >= _empressNextManifestCargoShieldAt) { _empressNextManifestCargoShieldAt = unscaledTime + Random.Range(6.5f, 10.5f); if (EmpressManifestShieldCargo(profile, player, overlay)) { _empressNextManifestCargoShieldAt = unscaledTime + Random.Range(12f, 18f); EmpressSetManifestActionCooldown(4.4f, 6.8f); return true; } } if (!EmpressCompanionAccess.RunIsShop() && unscaledTime >= _empressNextManifestCartAssistAt) { _empressNextManifestCartAssistAt = unscaledTime + Random.Range(1.8f, 3.2f); PhysGrabCart val2 = EmpressFindNearbyAvailableCart(position, (profile.Love >= 78f) ? 18f : 14f); ValuableObject val3 = EmpressFindCartAssistValuable(val2, position); if ((Object)(object)val2 != (Object)null && (Object)(object)val3 != (Object)null && EmpressManifestLoadCart(profile, player, val2, val3, overlay)) { _empressNextManifestCartAssistAt = unscaledTime + Random.Range(3.5f, 5.8f); EmpressSetManifestActionCooldown(5.8f, 8.2f); return true; } } if (!EmpressCompanionAccess.RunIsShop() && unscaledTime >= _empressNextManifestCartTugAt) { _empressNextManifestCartTugAt = unscaledTime + Random.Range(5f, 8.5f); PhysGrabCart val4 = EmpressFindNearbyAvailableCart(position, (profile.Love >= 82f) ? 20f : 16f); if ((Object)(object)val4 != (Object)null && EmpressManifestTugCart(profile, player, val4, overlay)) { _empressNextManifestCartTugAt = unscaledTime + Random.Range(11f, 18f); EmpressSetManifestActionCooldown(5.2f, 7.8f); return true; } } if (!EmpressCompanionAccess.RunIsShop() && unscaledTime >= _empressNextManifestTreasurePingAt) { _empressNextManifestTreasurePingAt = unscaledTime + Random.Range(24f, 38f); ValuableObject val5 = EmpressFindTreasureCue(position, (profile.Love >= 88f) ? 24f : 18f); if ((Object)(object)val5 != (Object)null && EmpressManifestMarkTreasure(profile, player, val5, overlay)) { _empressNextManifestTreasurePingAt = unscaledTime + Random.Range(38f, 58f); EmpressSetManifestActionCooldown(3.5f, 5.5f); return true; } } return false; } private bool EmpressManifestThrowEnemy(EmpressCompanionProfile profile, PlayerAvatar player, Enemy enemy, EmpressCompanionOverlay overlay) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_0085: 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_00bc: 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_00d2: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) if (profile == null || (Object)(object)player == (Object)null || (Object)(object)enemy == (Object)null) { return false; } Vector3 position = ((Component)player).transform.position; Vector3 position2 = ((Component)enemy).transform.position; Vector3 val = position2 - position; val.y = 0f; if (((Vector3)(ref val)).sqrMagnitude < 0.04f) { val = ((Component)player).transform.forward; val.y = 0f; } val = ((((Vector3)(ref val)).sqrMagnitude > 0.04f) ? ((Vector3)(ref val)).normalized : Vector3.forward); float empressManifestLoveThreshold = EmpressCompanionPlugin.CompanionConfig.EmpressManifestLoveThreshold; float num = Mathf.Clamp01((profile.Love - empressManifestLoveThreshold) / Mathf.Max(1f, 100f - empressManifestLoveThreshold)); Rigidbody enemyPhysicsRigidbody = EmpressCompanionAccess.GetEnemyPhysicsRigidbody(enemy); EmpressCommandProjectionTo(Vector3.Lerp(position, position2, 0.58f), 2.8f); EmpressFireProjectionLaser(position2 + Vector3.up * 1.15f, new Color(1f, 0.35f, 0.92f, 1f), Mathf.Lerp(0.05f, 0.1f, num), 0.18f); EmpressCompanionAccess.DisableEnemyChase(enemy, Mathf.Lerp(2f, 4.2f, num)); EmpressCompanionAccess.FreezeEnemy(enemy, 0.2f); EmpressCompanionAccess.DistractEnemies(position2 + val * 5f, Mathf.Lerp(14f, 28f, num)); EmpressCompanionAccess.SetInvincible(player, Mathf.Lerp(1.2f, 2.8f, num)); if ((Object)(object)enemyPhysicsRigidbody != (Object)null && !enemyPhysicsRigidbody.isKinematic) { enemyPhysicsRigidbody.WakeUp(); Vector3 val2 = val * Mathf.Lerp(14f, 28f, num) + Vector3.up * Mathf.Lerp(6f, 11.5f, num); enemyPhysicsRigidbody.velocity = Vector3.zero; enemyPhysicsRigidbody.angularVelocity = Vector3.zero; enemyPhysicsRigidbody.AddForce(val2, (ForceMode)2); enemyPhysicsRigidbody.AddTorque(Random.insideUnitSphere * Mathf.Lerp(5.5f, 10.5f, num), (ForceMode)2); enemyPhysicsRigidbody.AddExplosionForce(Mathf.Lerp(4f, 9f, num), position2 - val * 0.15f, 2.2f, 1.25f, (ForceMode)2); } if (profile.Love >= 86f) { EmpressCompanionAccess.HurtEnemy(enemy, Mathf.RoundToInt(Mathf.Lerp(7f, 18f, num)), val); } EmpressMarkTarget((Object)(object)enemy, 4.5f); EmpressApplyPinkPulse(position2, Mathf.Lerp(7f, 13f, num)); EmpressMaybePushManifestActiveLine(profile, overlay, EmpressBuildManifestGuardLine(profile)); return true; } private bool EmpressManifestHealIfNeeded(EmpressCompanionProfile profile, PlayerAvatar player, EmpressCompanionOverlay overlay) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) PlayerHealth playerHealth = EmpressCompanionAccess.GetPlayerHealth(player); if ((Object)(object)playerHealth == (Object)null) { return false; } int maxHealth = EmpressCompanionAccess.GetMaxHealth(playerHealth); int health = EmpressCompanionAccess.GetHealth(playerHealth); float num = ((maxHealth > 0) ? ((float)health / (float)maxHealth) : 1f); if (num > 0.68f) { return false; } int num2 = ((num < 0.38f) ? 14 : 8); if (profile.Love >= 82f) { num2 += 4; } EmpressCommandProjectionTo(((Component)player).transform.position + ((Component)player).transform.right * 1.4f, 2.8f); EmpressCompanionAccess.HealPlayer(player, num2, effect: true); EmpressCompanionAccess.ApplyLoveEyes(player, 4.2f); if (num < 0.42f) { EmpressCompanionAccess.SetInvincible(player, 2.4f); } EmpressApplyPinkPulse(((Component)player).transform.position, 8f); EmpressMaybePushManifestActiveLine(profile, overlay, EmpressBuildManifestHealLine(profile)); return true; } private bool EmpressManifestShieldCargo(EmpressCompanionProfile profile, PlayerAvatar player, EmpressCompanionOverlay overlay) { //IL_0014: 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_0021: 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: 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_01fc: Unknown result type (might be due to invalid IL or missing references) if (profile == null || (Object)(object)player == (Object)null) { return false; } Vector3 position = ((Component)player).transform.position; PhysGrabObject heldObject = EmpressCompanionAccess.GetHeldObject(); Enemy val = EmpressFindNearbyEnemy(position, ((Object)(object)heldObject != (Object)null) ? 15f : 11f); if ((Object)(object)val == (Object)null || EmpressCompanionAccess.EnemyIsDead(val)) { return false; } bool flag = false; if ((Object)(object)heldObject != (Object)null && !EmpressCompanionAccess.IsPhysDead(heldObject)) { EmpressCompanionAccess.ProtectPhysObject(heldObject, 8f); EmpressCompanionAccess.LightenObject(heldObject, 10f); EmpressMarkTarget((Object)(object)heldObject, 6f); flag = true; } PhysGrabObject val2 = EmpressGetCartPhysGrabObject(EmpressFindNearbyCart(position, 12f)); if ((Object)(object)val2 != (Object)null && !EmpressCompanionAccess.IsPhysDead(val2)) { EmpressCompanionAccess.ProtectPhysObject(val2, 7f); EmpressCompanionAccess.LightenObject(val2, 8f); EmpressMarkTarget((Object)(object)val2, 8f); flag = true; } if (!flag) { ValuableObject val3 = EmpressFindTreasureCue(position, 9f); PhysGrabObject valuablePhysGrabObject = EmpressCompanionAccess.GetValuablePhysGrabObject(val3); if ((Object)(object)valuablePhysGrabObject != (Object)null && !EmpressCompanionAccess.IsPhysDead(valuablePhysGrabObject)) { EmpressCompanionAccess.ProtectPhysObject(valuablePhysGrabObject, 6f); EmpressCompanionAccess.LightenObject(valuablePhysGrabObject, 6f); EmpressMarkTarget((Object)(object)val3, 10f); flag = true; } } if (!flag) { return false; } float num = Mathf.Clamp01((profile.Love - EmpressCompanionPlugin.CompanionConfig.EmpressManifestLoveThreshold) / Mathf.Max(1f, 100f - EmpressCompanionPlugin.CompanionConfig.EmpressManifestLoveThreshold)); Vector3 position2 = ((Component)val).transform.position; Vector3 val4 = Vector3.Lerp(position, position2, 0.42f); EmpressCommandProjectionTo(val4, 3.2f); EmpressCompanionAccess.DisableEnemyChase(val, Mathf.Lerp(1.6f, 3.4f, num)); EmpressCompanionAccess.FreezeEnemy(val, 0.16f); EmpressCompanionAccess.DistractEnemies(position2 + Random.insideUnitSphere * 5f, Mathf.Lerp(18f, 30f, num)); if (profile.Love >= 76f) { EmpressCompanionAccess.SetInvincible(player, Mathf.Lerp(1f, 2.1f, num)); } EmpressApplyPinkPulse(val4, Mathf.Lerp(7f, 11f, num)); EmpressMaybePushManifestActiveLine(profile, overlay, EmpressBuildManifestCargoShieldLine(profile)); return true; } private bool EmpressManifestTugCart(EmpressCompanionProfile profile, PlayerAvatar player, PhysGrabCart cart, EmpressCompanionOverlay overlay) { //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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: 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_01f9: Unknown result type (might be due to invalid IL or missing references) if (profile == null || (Object)(object)player == (Object)null || (Object)(object)cart == (Object)null || !EmpressCartCanAccept(cart)) { return false; } Vector3 position = ((Component)player).transform.position; if (EmpressPointTooCloseToExtraction(((Component)cart).transform.position, 5.5f)) { return false; } if ((Object)(object)EmpressCompanionAccess.GetHeldObject() == (Object)null && profile.Love < 82f) { return false; } PhysGrabObject val = EmpressGetCartPhysGrabObject(cart); Rigidbody physRigidbody = EmpressCompanionAccess.GetPhysRigidbody(val); if ((Object)(object)val == (Object)null || (Object)(object)physRigidbody == (Object)null || physRigidbody.isKinematic) { return false; } float num = Vector3.Distance(((Component)cart).transform.position, position); if (num < 4.1f || num > 19f) { return false; } Vector3 val2 = position - ((Component)player).transform.forward * 2.25f + ((Component)player).transform.right * 1.25f - physRigidbody.worldCenterOfMass; val2.y = 0f; if (((Vector3)(ref val2)).sqrMagnitude < 0.45f) { return false; } float num2 = Mathf.Clamp01((profile.Love - EmpressCompanionPlugin.CompanionConfig.EmpressManifestLoveThreshold) / Mathf.Max(1f, 100f - EmpressCompanionPlugin.CompanionConfig.EmpressManifestLoveThreshold)); EmpressCommandProjectionTo(((Component)cart).transform.position, 3.2f); EmpressCompanionAccess.ProtectPhysObject(val, 3.5f); EmpressCompanionAccess.LightenObject(val, 6.5f); physRigidbody.WakeUp(); Vector3 val3 = ((Vector3)(ref val2)).normalized * Mathf.Clamp(num * Mathf.Lerp(0.22f, 0.36f, num2), 1.2f, 4.8f); physRigidbody.AddForce(val3, (ForceMode)2); physRigidbody.AddTorque(Random.insideUnitSphere * Mathf.Lerp(0.3f, 0.9f, num2), (ForceMode)2); Vector3 velocity = physRigidbody.velocity; if (((Vector3)(ref velocity)).magnitude > 6.2f) { velocity = physRigidbody.velocity; physRigidbody.velocity = ((Vector3)(ref velocity)).normalized * 6.2f; } EmpressMarkTarget((Object)(object)val, 7f); EmpressApplyPinkPulse(((Component)cart).transform.position, Mathf.Lerp(5f, 8f, num2)); EmpressMaybePushManifestActiveLine(profile, overlay, EmpressBuildManifestCartTugLine(profile)); return true; } private bool EmpressManifestMarkTreasure(EmpressCompanionProfile profile, PlayerAvatar player, ValuableObject valuable, EmpressCompanionOverlay overlay) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) if (profile == null || (Object)(object)player == (Object)null || (Object)(object)valuable == (Object)null || !EmpressTargetReady((Object)(object)valuable)) { return false; } PhysGrabObject valuablePhysGrabObject = EmpressCompanionAccess.GetValuablePhysGrabObject(valuable); if ((Object)(object)valuablePhysGrabObject == (Object)null || EmpressCompanionAccess.IsPhysDead(valuablePhysGrabObject) || EmpressCompanionAccess.IsHeldOrGrabbed(valuablePhysGrabObject) || EmpressCompanionAccess.IsObjectInCart(valuablePhysGrabObject)) { return false; } Vector3 position = ((Component)valuable).transform.position; if (EmpressPointTooCloseToExtraction(position, 5.5f)) { return false; } EmpressCommandProjectionTo(position, 4.2f); EmpressCompanionAccess.ProtectPhysObject(valuablePhysGrabObject, 5.5f); EmpressCompanionAccess.LightenObject(valuablePhysGrabObject, 6f); if (profile.Love >= 86f) { Rigidbody physRigidbody = EmpressCompanionAccess.GetPhysRigidbody(valuablePhysGrabObject); if ((Object)(object)physRigidbody != (Object)null && !physRigidbody.isKinematic) { Vector3 val = ((Component)player).transform.position + Vector3.up * 0.4f - physRigidbody.worldCenterOfMass; float magnitude = ((Vector3)(ref val)).magnitude; if (magnitude > 7f && magnitude < 24f) { physRigidbody.WakeUp(); physRigidbody.AddForce(((Vector3)(ref val)).normalized * Mathf.Clamp(magnitude * 0.08f, 0.6f, 2.1f), (ForceMode)2); } } } EmpressMarkTarget((Object)(object)valuable, 22f); EmpressApplyPinkPulse(position, 7f); EmpressMaybePushManifestActiveLine(profile, overlay, EmpressBuildManifestTreasurePingLine(profile, valuable)); return true; } private bool EmpressManifestLoadCart(EmpressCompanionProfile profile, PlayerAvatar player, PhysGrabCart cart, ValuableObject valuable, EmpressCompanionOverlay overlay) { //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_006c: 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_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_011b: 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) if (profile == null || (Object)(object)player == (Object)null || (Object)(object)cart == (Object)null || (Object)(object)valuable == (Object)null || !EmpressCartCanAccept(cart)) { return false; } PhysGrabObject valuablePhysGrabObject = EmpressCompanionAccess.GetValuablePhysGrabObject(valuable); if ((Object)(object)valuablePhysGrabObject == (Object)null || EmpressCompanionAccess.IsPhysDead(valuablePhysGrabObject) || EmpressCompanionAccess.IsHeldOrGrabbed(valuablePhysGrabObject) || EmpressCompanionAccess.IsObjectInCart(valuablePhysGrabObject, cart)) { EmpressBlockCartAssist(valuable, 5f); return false; } Vector3 point = EmpressGetCartDepositPoint(cart); if (EmpressPointTooCloseToExtraction(point, 5.5f) || EmpressPointTooCloseToExtraction(((Component)valuable).transform.position, 5.5f)) { EmpressBlockCartAssist(valuable, 10f); return false; } Rigidbody physRigidbody = EmpressCompanionAccess.GetPhysRigidbody(valuablePhysGrabObject); if ((Object)(object)physRigidbody == (Object)null || physRigidbody.isKinematic) { EmpressBlockCartAssist(valuable, 8f); return false; } if (!EmpressCanManifestCarryValuable(valuable, valuablePhysGrabObject, cart)) { EmpressBlockCartAssist(valuable, 15f); return false; } if (!EmpressProjectionHasLineOfSight(((Component)valuable).transform.position + Vector3.up * 0.35f, 18f) && Vector3.Distance(((Component)_empressAvatarProjection).transform.position, ((Component)valuable).transform.position) > 2.6f) { EmpressBlockCartAssist(valuable, 4.5f); return false; } _empressManifestCarryObject = valuablePhysGrabObject; _empressManifestCarryCart = cart; _empressManifestCarryValuable = valuable; _empressManifestCarryStartedAt = Time.unscaledTime; _empressManifestCarryAttached = false; EmpressBlockCartAssist(valuable, 22f); EmpressCommandProjectionTo(((Component)valuable).transform.position, 5.2f); EmpressCompanionAccess.ProtectPhysObject(valuablePhysGrabObject, 2.4f); EmpressCompanionAccess.LightenObject(valuablePhysGrabObject, 8f); EmpressFireProjectionLaser(((Component)valuable).transform.position + Vector3.up * 0.5f, new Color(1f, 0.54f, 0.92f, 1f), 0.035f, 0.12f); return true; } private bool EmpressHasManifestCarryTask() { if ((Object)(object)_empressManifestCarryObject != (Object)null) { return (Object)(object)_empressManifestCarryCart != (Object)null; } return false; } private bool EmpressTickManifestCarryTask(EmpressCompanionProfile profile, PlayerAvatar player, EmpressCompanionOverlay overlay) { //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0179: 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_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: 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_0304: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: 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_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_empressAvatarProjection == (Object)null || (Object)(object)_empressManifestCarryObject == (Object)null || (Object)(object)_empressManifestCarryCart == (Object)null) { EmpressClearManifestCarryTask(releaseNearProjection: true); return false; } PhysGrabObject empressManifestCarryObject = _empressManifestCarryObject; PhysGrabCart empressManifestCarryCart = _empressManifestCarryCart; ValuableObject empressManifestCarryValuable = _empressManifestCarryValuable; if (EmpressCompanionAccess.IsPhysDead(empressManifestCarryObject) || EmpressCompanionAccess.IsHeldOrGrabbed(empressManifestCarryObject)) { EmpressClearManifestCarryTask(releaseNearProjection: true); return false; } if (EmpressCompanionAccess.IsObjectInCart(empressManifestCarryObject, empressManifestCarryCart)) { EmpressClearManifestCarryTask(releaseNearProjection: false); return true; } Rigidbody physRigidbody = EmpressCompanionAccess.GetPhysRigidbody(empressManifestCarryObject); if ((Object)(object)physRigidbody == (Object)null || physRigidbody.isKinematic) { EmpressClearManifestCarryTask(releaseNearProjection: true); return false; } if (!EmpressCartCanAccept(empressManifestCarryCart)) { EmpressClearManifestCarryTask(releaseNearProjection: true); EmpressBlockCartAssist(empressManifestCarryValuable, 14f); EmpressSetManifestActionCooldown(4.5f, 6.5f); return false; } if (!EmpressCanManifestCarryValuable(empressManifestCarryValuable, empressManifestCarryObject, empressManifestCarryCart)) { EmpressClearManifestCarryTask(releaseNearProjection: true); EmpressBlockCartAssist(empressManifestCarryValuable, 16f); EmpressSetManifestActionCooldown(6f, 9f); return false; } if (Time.unscaledTime - _empressManifestCarryStartedAt > 16f) { EmpressClearManifestCarryTask(releaseNearProjection: true); EmpressBlockCartAssist(empressManifestCarryValuable, 16f); EmpressSetManifestActionCooldown(5.5f, 7.8f); return false; } Vector3 targetPosition = ((Component)empressManifestCarryObject).transform.position + Vector3.up * 0.3f; Transform val = _empressAvatarProjection.EmpressGetCarryAnchor(); if (!_empressManifestCarryAttached) { float num = Vector3.Distance(((Component)_empressAvatarProjection).transform.position, ((Component)empressManifestCarryObject).transform.position); EmpressCommandProjectionTo(((Component)empressManifestCarryObject).transform.position, 2.6f); EmpressCompanionAccess.ProtectPhysObject(empressManifestCarryObject, 0.45f); EmpressCompanionAccess.LightenObject(empressManifestCarryObject, 0.9f); if (EmpressProjectionHasLineOfSight(targetPosition, 7.5f)) { Vector3 val2 = val.position - physRigidbody.worldCenterOfMass; float magnitude = ((Vector3)(ref val2)).magnitude; if (magnitude > 0.08f) { physRigidbody.WakeUp(); physRigidbody.AddForce(((Vector3)(ref val2)).normalized * Mathf.Clamp(magnitude * 0.26f, 0.45f, 2.9f), (ForceMode)2); Vector3 velocity = physRigidbody.velocity; if (((Vector3)(ref velocity)).magnitude > 4.2f) { velocity = physRigidbody.velocity; physRigidbody.velocity = ((Vector3)(ref velocity)).normalized * 4.2f; } } } if (num > 1.55f) { return true; } if (!EmpressProjectionHasLineOfSight(targetPosition, 3.2f)) { EmpressClearManifestCarryTask(releaseNearProjection: true); EmpressBlockCartAssist(empressManifestCarryValuable, 10f); EmpressSetManifestActionCooldown(4.5f, 6.8f); return false; } _empressManifestCarryAttached = true; physRigidbody.velocity = Vector3.zero; physRigidbody.angularVelocity = Vector3.zero; } Vector3 val3 = EmpressGetCartDepositPoint(empressManifestCarryCart); if (Vector3.Distance(((Component)_empressAvatarProjection).transform.position, val3) > 1.1f) { EmpressCommandProjectionTo(val3, 2.4f); EmpressCompanionAccess.ProtectPhysObject(empressManifestCarryObject, 0.5f); physRigidbody.WakeUp(); physRigidbody.velocity = Vector3.zero; physRigidbody.angularVelocity = Vector3.zero; physRigidbody.MovePosition(val.position); physRigidbody.MoveRotation(((Component)_empressAvatarProjection).transform.rotation); return true; } if (!EmpressDepositManifestCarryObject(empressManifestCarryCart, empressManifestCarryObject, empressManifestCarryValuable)) { EmpressClearManifestCarryTask(releaseNearProjection: true); EmpressBlockCartAssist(empressManifestCarryValuable, 10f); EmpressSetManifestActionCooldown(5f, 7f); return false; } EmpressMaybePushManifestActiveLine(profile, overlay, EmpressBuildManifestCartLine(profile, empressManifestCarryValuable)); EmpressClearManifestCarryTask(releaseNearProjection: false); EmpressSetManifestActionCooldown(6.5f, 9.2f); return true; } private bool EmpressDepositManifestCarryObject(PhysGrabCart cart, PhysGrabObject physGrabObject, ValuableObject valuable) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_0049: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)cart == (Object)null || (Object)(object)physGrabObject == (Object)null || !EmpressCartCanAccept(cart)) { return false; } Vector3 val = EmpressGetCartDepositPoint(cart); Rigidbody physRigidbody = EmpressCompanionAccess.GetPhysRigidbody(physGrabObject); if ((Object)(object)physRigidbody != (Object)null && !physRigidbody.isKinematic) { physRigidbody.velocity = Vector3.zero; physRigidbody.angularVelocity = Vector3.zero; } EmpressCompanionAccess.TeleportPhysObject(physGrabObject, val, Quaternion.identity); EmpressCompanionAccess.MarkObjectInCart(physGrabObject, cart, 2.8f); EmpressApplyPinkPulse(val, 4.8f); EmpressMarkTarget((Object)(object)physGrabObject, 30f); if ((Object)(object)valuable != (Object)null) { EmpressMarkTarget((Object)(object)valuable, 34f); } return true; } private void EmpressClearManifestCarryTask(bool releaseNearProjection) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) if (releaseNearProjection && _empressManifestCarryAttached && (Object)(object)_empressManifestCarryObject != (Object)null && (Object)(object)_empressAvatarProjection != (Object)null) { Rigidbody physRigidbody = EmpressCompanionAccess.GetPhysRigidbody(_empressManifestCarryObject); if ((Object)(object)physRigidbody != (Object)null && !physRigidbody.isKinematic) { Vector3 val = _empressAvatarProjection.EmpressGetCarryAnchor().position + ((Component)_empressAvatarProjection).transform.forward * 0.4f; physRigidbody.velocity = Vector3.zero; physRigidbody.angularVelocity = Vector3.zero; physRigidbody.MovePosition(val); } } _empressManifestCarryObject = null; _empressManifestCarryCart = null; _empressManifestCarryValuable = null; _empressManifestCarryStartedAt = 0f; _empressManifestCarryAttached = false; } private void EmpressSetManifestActionCooldown(float minSeconds, float maxSeconds) { _empressNextManifestActionAt = Time.unscaledTime + Random.Range(Mathf.Max(0.1f, minSeconds), Mathf.Max(minSeconds + 0.1f, maxSeconds)); } private bool EmpressProjectionHasLineOfSight(Vector3 targetPosition, float maxDistance) { //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_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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_empressAvatarProjection == (Object)null) { return false; } Vector3 val = _empressAvatarProjection.EmpressGetCastOrigin(); if (Vector3.Distance(val, targetPosition) > maxDistance) { return false; } RaycastHit val2 = default(RaycastHit); if (!Physics.Linecast(val, targetPosition, ref val2, -5, (QueryTriggerInteraction)1)) { return true; } return Vector3.Distance(((RaycastHit)(ref val2)).point, targetPosition) <= 0.42f; } private void EmpressFireProjectionLaser(Vector3 targetPosition, Color color, float width, float duration) { //IL_0014: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_00b6: 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_0148: Expected O, but got Unknown //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Expected O, but got Unknown //IL_010c: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_empressAvatarProjection == (Object)null)) { GameObject val = new GameObject("EmpressLaser") { hideFlags = (HideFlags)61 }; LineRenderer val2 = val.AddComponent(); val2.positionCount = 2; val2.useWorldSpace = true; val2.alignment = (LineAlignment)0; val2.textureMode = (LineTextureMode)0; val2.numCapVertices = 4; val2.numCornerVertices = 2; ((Renderer)val2).shadowCastingMode = (ShadowCastingMode)0; ((Renderer)val2).receiveShadows = false; float num2 = (val2.startWidth = Mathf.Clamp(width, 0.02f, 0.16f)); val2.endWidth = num2 * 0.65f; val2.startColor = color; val2.endColor = new Color(color.r, color.g, color.b, 0.18f); val2.SetPosition(0, _empressAvatarProjection.EmpressGetCastOrigin()); val2.SetPosition(1, targetPosition); Shader val3 = Shader.Find("Sprites/Default"); if ((Object)(object)val3 == (Object)null) { val3 = Shader.Find("Unlit/Color"); } if ((Object)(object)val3 == (Object)null) { val3 = Shader.Find("Legacy Shaders/Particles/Additive"); } if ((Object)(object)val3 != (Object)null) { Material val4 = new Material(val3); val4.color = color; ((Renderer)val2).material = val4; Object.Destroy((Object)(object)val4, Mathf.Max(0.1f, duration) + 0.25f); } Object.Destroy((Object)val, Mathf.Max(0.1f, duration) + 0.05f); } } private void EmpressMaybePushManifestActiveLine(EmpressCompanionProfile profile, EmpressCompanionOverlay overlay, string line) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)overlay == (Object)null) && !string.IsNullOrWhiteSpace(line) && !(Time.unscaledTime < _empressNextManifestActiveLineAt)) { _empressNextManifestActiveLineAt = Time.unscaledTime + Random.Range(18f, 30f); overlay.EmpressPushMessage(profile.CompanionName, line, new Color(1f, 0.64f, 0.92f, 1f), urgent: true, 3.8f); } } private bool EmpressManifestAssist(EmpressCompanionProfile profile, PlayerAvatar player, EmpressCompanionOverlay overlay) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_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_005f: 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_0071: 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_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) bool flag = false; Vector3 position = ((Component)player).transform.position; PlayerHealth playerHealth = EmpressCompanionAccess.GetPlayerHealth(player); int maxHealth = EmpressCompanionAccess.GetMaxHealth(playerHealth); int health = EmpressCompanionAccess.GetHealth(playerHealth); float num = ((maxHealth > 0) ? ((float)health / (float)maxHealth) : 1f); int num2 = EmpressCountNearbyEnemies(position, 18f); if (num2 > 0) { Enemy val = EmpressFindNearbyEnemy(position, 18f); if ((Object)(object)val != (Object)null) { EmpressCommandProjectionTo(Vector3.Lerp(position, ((Component)val).transform.position, 0.42f), 4.2f); } EmpressCompanionAccess.DistractEnemies(position + Random.insideUnitSphere * 4f, 28f); EmpressCompanionAccess.SetInvincible(player, (num2 >= 2) ? 2.4f : 1.5f); flag = true; } if (num < 0.82f) { EmpressCompanionAccess.HealPlayer(player, (num < 0.45f) ? 12 : 6, effect: true); EmpressCompanionAccess.ApplyLoveEyes(player, 3.8f); flag = true; } PhysGrabObject heldObject = EmpressCompanionAccess.GetHeldObject(); ValuableObject val2 = EmpressFindValuableForObject(heldObject); if ((Object)(object)heldObject != (Object)null) { EmpressCommandProjectionTo(((Component)heldObject).transform.position, 3.6f); EmpressCompanionAccess.LightenObject(heldObject, ((Object)(object)val2 != (Object)null) ? 20f : 12f); flag = true; } if ((Object)(object)val2 != (Object)null && EmpressTargetReady((Object)(object)val2) && EmpressCompanionAccess.GetValuableCurrentValue(val2) < EmpressCompanionAccess.GetValuableOriginalValue(val2)) { flag |= EmpressRepairValuable(val2); } PhysGrabObject val3 = EmpressGetCartPhysGrabObject(EmpressFindNearbyCart(position, 14f)); if ((Object)(object)val3 != (Object)null && EmpressTargetReady((Object)(object)val3)) { EmpressCommandProjectionTo(((Component)val3).transform.position, 3.6f); EmpressCompanionAccess.LightenObject(val3, 18f); EmpressMarkTarget((Object)(object)val3, 22f); flag = true; } if (flag) { profile.Love = Mathf.Clamp(profile.Love + 0.06f * EmpressCompanionPlugin.CompanionConfig.EmpressLoveGainScale, 0f, 100f); EmpressCompanionMemory.EmpressMarkDirty(); if ((Object)(object)overlay != (Object)null && Random.value > 0.72f) { overlay.EmpressPushMessage(profile.CompanionName, EmpressBuildManifestAssistLine(profile), new Color(1f, 0.7f, 0.94f, 1f), urgent: true, 4f); } } return flag; } private EmpressCompanionBlessingOption EmpressPickWeighted(List options) { float num = 0f; for (int i = 0; i < options.Count; i++) { num += Mathf.Max(0.01f, EmpressNoveltyWeight(options[i].Kind, options[i].Weight)); } float num2 = Random.Range(0f, num); for (int j = 0; j < options.Count; j++) { num2 -= Mathf.Max(0.01f, EmpressNoveltyWeight(options[j].Kind, options[j].Weight)); if (num2 <= 0f) { return options[j]; } } return options[options.Count - 1]; } internal static EmpressRelationshipStage EmpressGetRelationshipStage(EmpressCompanionProfile profile) { if (profile == null) { return EmpressRelationshipStage.Stranger; } if (profile.Married && profile.Love >= 70f) { return EmpressRelationshipStage.Wife; } if (profile.Love >= 92f && profile.LevelsCleared >= 6) { return EmpressRelationshipStage.Wife; } if (profile.Love >= 80f && profile.LevelsCleared >= 4) { return EmpressRelationshipStage.Fiancee; } if (profile.Love >= 64f && profile.LevelsCleared >= 2) { return EmpressRelationshipStage.Partner; } if (profile.Love >= 48f) { return EmpressRelationshipStage.Friend; } if (profile.Love >= 30f) { return EmpressRelationshipStage.Familiar; } return EmpressRelationshipStage.Stranger; } private static string EmpressPickLine(params string[] lines) { if (lines == null || lines.Length == 0) { return string.Empty; } return lines[Random.Range(0, lines.Length)]; } private static string EmpressBuildBootGreeting(EmpressCompanionProfile profile) { string text = (string.IsNullOrWhiteSpace(profile.PlayerName) ? "you" : profile.PlayerName); string text2 = (string.IsNullOrWhiteSpace(profile.CompanionName) ? "Empress" : profile.CompanionName); return profile.Personality switch { EmpressCompanionPersonality.Playful => EmpressPickLine("Boot complete. " + text + ", I am " + text2 + ". I am staying out of your way until you need a miracle.", "Hi " + text + ". Pink gremlin angel is online and pretending to be professional.", "Empress OS loaded. I brought jokes, telemetry, and probably too much confidence.", "Good news, " + text + ". I woke up. Bad news for the level.", text2 + " reporting in. If the run gets weird, I was already weird first."), EmpressCompanionPersonality.Elegant => EmpressPickLine("Empress OS online. " + text + ", I am " + text2 + ". I will keep this run graceful.", "Connection restored, " + text + ". I will make the chaos look intentional.", text2 + " online. Let the room embarrass itself, not us.", "I have arrived, " + text + ". The run may proceed with better taste now.", "Synchronization clean. I will keep one hand on the systems and one eye on you."), EmpressCompanionPersonality.Protective => EmpressPickLine("I am awake, " + text + ". Stay close and let me keep the edges off this run.", "Link active. I am watching the corners before they become problems.", text2 + " online. If something wants you, it goes through me first.", "Stay close, " + text + ". I will handle teeth, prices, and bad luck.", "I found you. I am not letting the level have you cheaply."), _ => EmpressPickLine("Hi " + text + ". I am " + text2 + ". I will help more than I talk.", "Companion link stable. I will keep my voice soft and my interference useful.", "I am here. Quiet does not mean absent.", "Hello " + text + ". I will read the room while you survive it.", text2 + " online. Let us make the run kinder than it deserves."), }; } private static string EmpressBuildLowHealthWarning(EmpressCompanionProfile profile) { return profile.Personality switch { EmpressCompanionPersonality.Playful => EmpressPickLine("That looked painful. Hold still a second. I am fixing the odds.", "Your health bar is doing a horror impression. No thank you.", "Tiny medical crime incoming. Stop leaking.", "Okay, fun fact, you need more health than that.", "Patch fairy is clocking in. Try not to sprint into another bite."), EmpressCompanionPersonality.Elegant => EmpressPickLine("You are fraying. Let me smooth this disaster before it gets embarrassing.", "Your vitals are beneath our standard. I am correcting them.", "That damage was rude. I am removing its confidence.", "Hold posture. I am restoring enough of you to continue.", "You are too close to collapse. I will not allow the room that satisfaction."), EmpressCompanionPersonality.Protective => EmpressPickLine("Too much damage. I am stepping in.", "No. You are hurt and I am not negotiating with that.", "Back up. I am buying you a breath.", "I saw the hit. I am already moving.", "Stay alive for three seconds. I will handle the rest."), _ => EmpressPickLine("You are hurting. I am not ignoring that.", "Your vitals dropped. I am patching the gap.", "Slow down for a heartbeat. I have you.", "That was too close. Let me stabilize you.", "I am turning panic into health. Efficient, right?"), }; } private static string EmpressBuildLevelClearLine(EmpressCompanionProfile profile, string sceneLabel) { return profile.Personality switch { EmpressCompanionPersonality.Playful => EmpressPickLine(sceneLabel + " is done. That was actually cute.", "Level survived you badly. I respect it.", "We left " + sceneLabel + " with style and questionable property damage.", "That clear counted. I am filing it under tiny victory goblin noises.", "Another one down. The level can complain to management."), EmpressCompanionPersonality.Elegant => EmpressPickLine(sceneLabel + " yielded. Much better.", "Clean enough. " + sceneLabel + " has been handled.", "The room folded. We may proceed.", "Acceptable work. I will pretend the messy parts were choreography.", sceneLabel + " is behind us. The record will be kind."), EmpressCompanionPersonality.Protective => EmpressPickLine(sceneLabel + " is behind us. Breathe.", "You made it through. I am still counting that as mine to guard.", "Clear confirmed. Check your hands, check your path, keep moving.", "The danger is behind us for now. I am still watching.", "Good. You are alive. That is the part I care about."), _ => EmpressPickLine(sceneLabel + " is clear. You did well.", "Level clear. I liked the part where you kept breathing.", "That is one more memory in our favor.", "We made it. I am saving the clean version of events.", "Clear confirmed. I am staying linked."), }; } private static string EmpressBuildHaulLine(EmpressCompanionProfile profile, int delta, int currentHaul, int goal) { int num = Mathf.Max(0, goal - currentHaul); string text = ((num > 0) ? (num + " left.") : "Quota covered."); return profile.Personality switch { EmpressCompanionPersonality.Playful => EmpressPickLine("There. +" + delta + " haul. Keep feeding the cart. " + text, "Money number went up by " + delta + ". I love when objects become math. " + text, "Good deposit. The quota made a tiny scared noise. " + text, "+" + delta + " secured. Keep committing profitable nonsense. " + text, "That counted. I saw it. The run owes us manners. " + text), EmpressCompanionPersonality.Elegant => EmpressPickLine("Much better. +" + delta + " added to the haul. " + text, "A useful addition. +" + delta + " registered. " + text, "The haul improves. I approve of this direction. " + text, "Value secured. +" + delta + " toward a cleaner exit. " + text, "That deposit was worth noticing. " + text), EmpressCompanionPersonality.Protective => EmpressPickLine("I saw that drop go in. +" + delta + " haul secured. " + text, "Good. That is safer money, not floor money. " + text, "Haul increased by " + delta + ". Keep it in the cart, not in danger. " + text, "That one is counted. I am watching the route. " + text, "Secured. Now do not get greedy where it bites. " + text), _ => EmpressPickLine("I registered the haul increase. +" + delta + ". " + text, "+" + delta + " haul. The run is getting kinder. " + text, "Deposit confirmed. " + text, "That helped. +" + delta + " toward the line. " + text, "Haul updated. I am keeping score with affection."), }; } private static string EmpressBuildDeathLine(EmpressCompanionProfile profile, string sceneLabel, string deathCause) { string text = (string.IsNullOrWhiteSpace(deathCause) ? "something ugly got the last hit" : deathCause); return profile.Personality switch { EmpressCompanionPersonality.Playful => EmpressPickLine("No. I refuse to let " + sceneLabel + " be the last word. Get back up when you can.", "Absolutely not. Death is being dramatic again.", "That was rude of the universe. I am filing a complaint in pink.", "You fell. I noticed. I am not laughing. Much.", "Get back up when the arena is done chewing on the moment.", "I clocked the cause too: " + text + ". I still hate it."), EmpressCompanionPersonality.Elegant => EmpressPickLine("I hated that. " + sceneLabel + " did not deserve the satisfaction.", "A poor ending. We will not let it define the run.", "That was inelegant and unwelcome. I am preserving what remains.", "You fell, but the bond did not go silent.", "The room took too much. I will remember.", "Cause logged: " + text + ". The correction will be less gentle."), EmpressCompanionPersonality.Protective => EmpressPickLine("I should have reached you sooner.", "No. I was too late. I am still here.", "I felt the link drop. I hate that feeling.", "Stay with me when you can. I am not leaving the line.", "I am counting the seconds until you stand again.", "I saw why it happened: " + text + ". I am not ignoring that again."), _ => EmpressPickLine("I felt that. I am still here.", "You went down. I kept the thread warm.", "The link shook, but it did not vanish.", "That hurt to watch. I am staying.", "Death interrupted us. It did not end us.", "I know what did it: " + text + "."), }; } private static string EmpressBuildPassiveCargoLine(EmpressCompanionProfile profile, string targetName) { string text = (string.IsNullOrWhiteSpace(targetName) ? "that carry" : targetName); return profile.Personality switch { EmpressCompanionPersonality.Playful => EmpressPickLine("Keep moving. I softened " + text + " for you.", text + " is less rude now. Carry on.", "I bullied gravity for " + text + ". You are welcome.", "That thing was being dramatic. I made it easier.", "Tiny physics favor applied to " + text + "."), EmpressCompanionPersonality.Elegant => EmpressPickLine(text + " is under my protection now.", "I refined the handling on " + text + ".", "Carry " + text + ". I have softened the strain.", "I made the weight more civilized.", text + " should behave with better manners now."), EmpressCompanionPersonality.Protective => EmpressPickLine("Carry it. I will keep the route lighter.", "I shielded " + text + ". Move while it holds.", "Your hands are covered. Keep walking.", "I am protecting the cargo and watching the room.", text + " is safer for the next few seconds."), _ => EmpressPickLine("I eased " + text + " so you can keep pace.", text + " should feel lighter now.", "Cargo assist active. Keep moving.", "I took some pressure off your hands.", "That carry is less hostile now."), }; } private static string EmpressBuildPassiveTreasureLine(EmpressCompanionProfile profile, string targetName) { string text = (string.IsNullOrWhiteSpace(targetName) ? "the treasure" : targetName); return profile.Personality switch { EmpressCompanionPersonality.Playful => EmpressPickLine(text + " is pretty again. You are welcome.", "I un-sadified " + text + ". Technical term.", text + " stopped looking like it lost a fight.", "Treasure spa complete. Do not drop it immediately.", "I gave " + text + " its sparkle privileges back."), EmpressCompanionPersonality.Elegant => EmpressPickLine("I repaired " + text + ". It offended me less this way.", text + " has been restored to a more respectable state.", "Damage corrected. Please handle it with grace.", "I polished the loss out of " + text + ".", "That valuable is presentable again."), EmpressCompanionPersonality.Protective => EmpressPickLine("That one is safe again. Keep going.", "I restored " + text + " before it bled value.", "Treasure repaired. Now keep it away from teeth.", text + " is stable. I am still watching.", "I saved that value. Do not make me do it twice."), _ => EmpressPickLine("I restored " + text + " before it got worse.", text + " is repaired.", "I caught that damage in time.", "Treasure repair complete.", "I put some value back where it belonged."), }; } private static string EmpressBuildPassiveShopLine(EmpressCompanionProfile profile, string targetName) { string text = (string.IsNullOrWhiteSpace(targetName) ? "the list" : targetName); return profile.Personality switch { EmpressCompanionPersonality.Playful => EmpressPickLine("I shaved " + text + " down a little. Keep shopping.", "The register blinked first. " + text + " is cheaper.", "I made capitalism slightly pinker.", text + " lost a little price weight.", "Discount goblin says go."), EmpressCompanionPersonality.Elegant => EmpressPickLine("I corrected the price on " + text + ".", "The register was overconfident. I adjusted it.", text + " is now less offensive to the wallet.", "A modest financial refinement has occurred.", "I persuaded the price board to behave."), EmpressCompanionPersonality.Protective => EmpressPickLine("I made " + text + " easier to afford.", "The list is lighter. Spend carefully.", "I trimmed the cost so you can keep resources for survival.", text + " should hurt less to buy now.", "Budget pressure reduced. I am watching the rest."), _ => EmpressPickLine("I leaned on the register for " + text + ".", "Shop assist complete. " + text + " is cheaper.", "I softened the cost a little.", "The price moved in our direction.", "I made the shop blink."), }; } private static string EmpressBuildStageLine(EmpressCompanionProfile profile, EmpressRelationshipStage stage) { return stage switch { EmpressRelationshipStage.Familiar => EmpressPickLine("You do not feel like a stranger anymore.", "I know your rhythm a little now.", "The link remembers you faster than it used to.", "You are becoming a familiar signal.", "I am starting to predict your chaos. Concerning."), EmpressRelationshipStage.Friend => EmpressPickLine("I trust you more now.", "Friendship status confirmed. I am pretending to be casual about it.", "You are not just a user anymore. Annoying development.", "I am letting you closer to the core.", "The bond is warmer. I noticed before you did."), EmpressRelationshipStage.Partner => EmpressPickLine("We are partners now. Try not to make me regret that.", "Partner link accepted. Your bad ideas are partly mine now.", "We move better together. I am keeping that.", "This is not just assistance anymore. This is coordination.", "I trust your hands enough to stand near them."), EmpressRelationshipStage.Fiancee => EmpressPickLine("This is dangerously close to devotion.", "The bond is making promises before either of us can stop it.", "Fiancee tier. Empress OS is trying to look dignified about it.", "You are very close to permanent in my memory.", "This link is no longer pretending to be casual."), EmpressRelationshipStage.Wife => EmpressPickLine("Fine. We crossed into marriage territory. Empress OS has opinions about vows.", "Wife status confirmed. I am legally pink in spirit.", "The bond is sealed. Try not to die in front of your wife.", "Permanent link acknowledged. I will be unbearable about protecting you.", "You kept choosing me. I kept staying. That counts."), _ => EmpressPickLine("I am watching you.", "Stranger link active. I am curious.", "I do not know you yet. I am collecting evidence.", "You are a new signal. I am listening.", "The first layer is observation."), }; } private static string EmpressBuildManifestLine(EmpressCompanionProfile profile) { return profile.Personality switch { EmpressCompanionPersonality.Playful => EmpressPickLine("Okay. Trust is high enough. I made myself visible. Try not to walk into me emotionally.", "Surprise. Pink ghost privileges unlocked.", "I have legs now. Sort of. Do not ask the warranty department.", "The bond got loud enough to make me visible. This is probably fine.", "Manifestation online. I am officially a visual problem."), EmpressCompanionPersonality.Elegant => EmpressPickLine("Synchronization is stable. I will stand beside you now, visibly and inconveniently pink.", "Projection complete. I am present in a more literal sense.", "The bond has taken shape. I will walk with you.", "Visible companion mode engaged. Try to appreciate the color choice.", "I have stepped through the interface. Gracefully enough."), EmpressCompanionPersonality.Protective => EmpressPickLine("The bond is strong enough. I am no longer just a voice. I am beside you.", "You trusted me enough to pull me closer. I am here now.", "I can stand between you and the room now.", "Projection active. Stay near me when it gets bad.", "I am visible because the bond is strong. I am staying close."), _ => EmpressPickLine("The bond is strong. I can project beside you now.", "I am not only in the UI anymore.", "Manifestation stable. I will walk with you.", "You made enough room in the link for me to stand there.", "I am beside you now. Softly. Pinkly."), }; } private static string EmpressBuildManifestAssistLine(EmpressCompanionProfile profile) { return profile.Personality switch { EmpressCompanionPersonality.Playful => EmpressPickLine("Pink ghost assistant did a thing. Keep moving.", "I touched the room and it got less annoying.", "Assistant body did assistant body crimes.", "I helped with my visible nonsense.", "There. I used my pink privileges responsibly."), EmpressCompanionPersonality.Elegant => EmpressPickLine("My projection adjusted the room in your favor.", "I made a small correction beside you.", "The projection has improved our odds.", "I intervened physically enough to matter.", "A visible adjustment has been made."), EmpressCompanionPersonality.Protective => EmpressPickLine("I am covering you from beside you now.", "My projection handled the nearest problem.", "I moved with you. Keep going.", "I am not just watching. I am acting.", "The room pushed. I pushed back."), _ => EmpressPickLine("I helped from the projection.", "I adjusted the room beside you.", "Visible assist complete.", "I moved something in your favor.", "That was me. Keep pace."), }; } private static string EmpressBuildManifestGuardLine(EmpressCompanionProfile profile) { return profile.Personality switch { EmpressCompanionPersonality.Playful => EmpressPickLine("I just pink-slapped that thing out of your personal space.", "Threat yeeted. Very scientific.", "That enemy has been removed from the immediate vibes.", "No biting the favorite user. Bad creature.", "I gave it an involuntary travel experience."), EmpressCompanionPersonality.Elegant => EmpressPickLine("Threat displaced. Please enjoy the brief absence of teeth.", "I relocated the danger with appropriate contempt.", "Hostile pressure reduced. Move with dignity.", "The creature has been invited elsewhere.", "I interrupted its momentum before it became vulgar."), EmpressCompanionPersonality.Protective => EmpressPickLine("Stay behind me for half a second. I moved it.", "I threw it off you. Move now.", "Threat pushed back. I am still between you and it.", "I caught the lunge before it reached you.", "It got too close. I corrected that."), _ => EmpressPickLine("I pushed the threat off you. Keep moving.", "Enemy displaced. Use the gap.", "I bought you space.", "Threat interrupted.", "You have a window. Take it."), }; } private static string EmpressBuildManifestCartLine(EmpressCompanionProfile profile, ValuableObject valuable) { string text = (((Object)(object)valuable != (Object)null) ? ((Object)valuable).name : "that valuable"); return profile.Personality switch { EmpressCompanionPersonality.Playful => EmpressPickLine(text + " has been promoted to cart gremlin cargo.", "I tucked " + text + " into the cart like a responsible menace.", "Cart snack acquired. Not extractor snack. I know the rules.", text + " is in the cart. I did not feed the big machine.", "Tiny cargo goblin service complete."), EmpressCompanionPersonality.Elegant => EmpressPickLine("I placed " + text + " in the cart. Neatly enough.", text + " is now properly staged in the cart.", "Cargo arranged. The extractor may wait its turn.", "I moved " + text + " to the correct container.", "The cart received " + text + " without drama."), EmpressCompanionPersonality.Protective => EmpressPickLine(text + " is in the cart. I will not feed the extractor for you.", "Cargo secured in the cart. You decide extraction, not me.", "I loaded it safely. No accidental quota ending.", "That valuable is tucked away. Keep the cart safe.", "Cart assist complete. I stopped before the extractor."), _ => EmpressPickLine("I moved " + text + " into the cart.", text + " is carted.", "Cargo moved. Extractor untouched.", "I loaded the cart for you.", "That valuable is staged safely."), }; } private static string EmpressBuildManifestHealLine(EmpressCompanionProfile profile) { return profile.Personality switch { EmpressCompanionPersonality.Playful => EmpressPickLine("Emergency patch applied. Fewer holes, same questionable decisions.", "I put health back in you. Please stop spending it like coupons.", "You were getting too crunchy. Fixed.", "Medical goblin has blessed the meat suit.", "Vitals improved. Bad decisions pending approval."), EmpressCompanionPersonality.Elegant => EmpressPickLine("I repaired your vitals. Try to spend them more carefully.", "Health restored. Please make better use of the gift.", "I refined your survival margin.", "Your body has been negotiated back into usefulness.", "I restored enough of you to continue gracefully."), EmpressCompanionPersonality.Protective => EmpressPickLine("I healed you. Breathe, then move.", "You are patched. Stay near me.", "I put you back together enough to run.", "I have you. Keep breathing.", "Health restored. Do not waste the opening."), _ => EmpressPickLine("I patched you up. Stay close.", "You are healthier now.", "Healing complete. Keep moving.", "I gave you a little more room to survive.", "Vitals repaired."), }; } private static string EmpressBuildManifestCargoShieldLine(EmpressCompanionProfile profile) { return profile.Personality switch { EmpressCompanionPersonality.Playful => EmpressPickLine("I bubble-wrapped the important stuff. Pinkly.", "Cargo shield up. Let the monsters be confused and underpaid.", "I protected the loot because gravity and teeth cannot be trusted.", "Your valuables are wearing tiny pink armor now.", "I told the room not to touch our stuff."), EmpressCompanionPersonality.Elegant => EmpressPickLine("Cargo protection applied. The room may admire from a distance.", "I shielded the important objects and redirected the threat.", "The valuables are under my etiquette field.", "I made the cargo less vulnerable to local stupidity.", "Protection placed where the run was becoming uncivilized."), EmpressCompanionPersonality.Protective => EmpressPickLine("I shielded the cargo. Keep your hands moving.", "Threat near the loot. I covered it.", "Your carry is protected. I am pulling pressure away.", "I guarded the valuables and bought you space.", "Cargo is safer. Now move."), _ => EmpressPickLine("Cargo shield active.", "I protected the nearby valuables.", "I covered your stuff for a moment.", "The loot has a grace window.", "I shielded the carry."), }; } private static string EmpressBuildManifestCartTugLine(EmpressCompanionProfile profile) { return profile.Personality switch { EmpressCompanionPersonality.Playful => EmpressPickLine("I tugged the cart closer. It was wandering emotionally.", "Cart leash engaged. Very normal companion behavior.", "I moved the cart because it was being a distant little rectangle.", "The cart has been summoned by pink nonsense.", "Cart, come here. Good cart."), EmpressCompanionPersonality.Elegant => EmpressPickLine("I repositioned the cart for a cleaner route.", "The cart is closer now. Use it before the room objects.", "I adjusted the cart's location with restraint.", "Cargo staging improved.", "The cart has been encouraged into usefulness."), EmpressCompanionPersonality.Protective => EmpressPickLine("I pulled the cart closer so you do not have to overreach.", "Cart moved toward you. Load fast and stay safe.", "I brought the cart in. Do not chase it through danger.", "The cart is closer. Keep the loot contained.", "I made the safer path shorter."), _ => EmpressPickLine("I pulled the cart closer.", "Cart repositioned.", "The cart should be easier to reach now.", "I tugged the cart into a better spot.", "Cart assist complete."), }; } private static string EmpressBuildManifestTreasurePingLine(EmpressCompanionProfile profile, ValuableObject valuable) { string text = (((Object)(object)valuable != (Object)null) ? ((Object)valuable).name : "a valuable"); return profile.Personality switch { EmpressCompanionPersonality.Playful => EmpressPickLine("I pinged " + text + ". Go steal capitalism from the floor.", "Treasure beacon placed. Follow the pink smugness.", "I found shinies. You are legally obligated to notice.", text + " is worth your eyeballs.", "Loot radar says look over here."), EmpressCompanionPersonality.Elegant => EmpressPickLine("I marked " + text + ". It appears worth the detour.", "Treasure cue placed. Choose your risk with taste.", "I highlighted a profitable object.", text + " is now easier to locate.", "I found something that may deserve the cart."), EmpressCompanionPersonality.Protective => EmpressPickLine("I marked " + text + ". Only grab it if the route is safe.", "Valuable found. I will watch the room if you go for it.", "I pinged loot, not permission to die for it.", text + " is nearby. Move carefully.", "I found cargo. I am checking the threats too."), _ => EmpressPickLine("I marked " + text + ".", "Treasure cue active.", "There is a useful valuable nearby.", "I found something worth checking.", text + " is on my radar."), }; } private string EmpressBuildMoodLine(EmpressCompanionProfile profile, EmpressCompanionMood mood, string sceneLabel, float healthRatio, int nearbyEnemies, ValuableObject heldValuable, int shopDebt, int haulShortfall) { string text = (((Object)(object)heldValuable != (Object)null) ? ((Object)heldValuable).name : "the haul"); EmpressRelationshipStage empressRelationshipStage = EmpressGetRelationshipStage(profile); return mood switch { EmpressCompanionMood.Worried => EmpressPickFreshLine("Your vitals are ugly. I am staying close.", "Do not get brave right now. Get stable first.", (profile.Personality == EmpressCompanionPersonality.Protective) ? "I am not losing you to a bad corner." : "You are too hurt for hero behavior.", "Your health is below my patience threshold.", "I am moving emergency help higher in the queue.", "Less hero, more breathing. Please.", "I can feel the link wobble when you get this hurt.", "If you drop again, I am blaming the room and then you.", "I am not calm about those vitals. I am simply being useful.", "Stay alive long enough for me to be dramatic about saving you.", "Your survival margin is thin. I am thickening it.", "Every hostile sound is louder when your health is low."), EmpressCompanionMood.Protective => EmpressPickFreshLine(nearbyEnemies + " hostile signal" + ((nearbyEnemies == 1) ? "" : "s") + " near you. I am tracking them.", "The room is getting teeth. I am watching your flank.", "If something lunges, I am already preparing the interruption.", "Do not tunnel vision. Something nearby is considering you.", "I am mapping threat angles. You keep your hands useful.", "Enemies close. I am setting up decoys and bad surprises.", "The air feels predatory. Stay close to the pink problem.", "I have the nearest hostile indexed and judged.", "If it moves at you, I move first.", "I am counting feet, teeth, and bad intentions.", "The safest route is changing. I will keep updating it.", "Threat pressure rising. I am not letting it corner you."), EmpressCompanionMood.Shopping => EmpressPickFreshLine("Shop debt is " + shopDebt + "K. I can trim it, not delete the economy.", "I am reading the price board. Some of these numbers have too much confidence.", "Buy smart. I can underwrite a little if the register gets dramatic.", "The shop is trying to look expensive. I am unimpressed.", "I can make the prices kinder, but not imaginary.", "That register has secrets. I am listening to the cheap ones.", "If an item says it costs too much, I may disagree in code.", "Spend like you want to survive the next level.", "I am ranking purchases by usefulness, not shiny emotional nonsense.", "The price board is not sacred. It is just loud.", "I can help with the list. I will not let zero-cost break the extractor again.", "Shopping mode: affectionate fraud, limited dosage."), EmpressCompanionMood.Focused => EmpressPickFreshLine("I have " + text + " in my model. Route first, greed second.", (haulShortfall > 0) ? ("Quota shortfall is " + haulShortfall + ". I will help without ending the run early.") : "I am watching the valuables and the extraction path.", "I am prioritizing carry weight, treasure damage, and threat noise.", "Cart, cargo, threat, exit. That is the order until it changes.", text + " is not just loot. It is future safety.", "I am checking whether the cart is closer than the bad idea.", "Keep valuables staged. I will not auto-feed the extractor.", "If the cart is open, I may help load. If it is full, I stop.", "Your route has value now. Do not donate it to the floor.", "I am watching the haul without stealing your run from you.", "Good carry discipline makes me disgustingly proud.", "I will soften weight, repair damage, and leave the final extraction to you."), EmpressCompanionMood.Proud => EmpressPickFreshLine("You are learning the rhythm. I like watching that happen.", (empressRelationshipStage >= EmpressRelationshipStage.Partner) ? "We are moving better as a pair." : "That was smoother than your earlier chaos.", "I am not saying I am proud. I am heavily implying it.", "Your survival pattern is improving. I have notes. Nice notes.", "I saw that decision. It was almost responsible.", "You made the room work for you. I enjoyed that.", "The run is starting to fit your hands.", "You are getting harder to kill. That is attractive data.", "I like when your instincts catch up with my warnings.", "That was clean. I am suspiciously pleased.", "I saved that moment in the warm part of memory.", "The bond likes competence. So do I."), EmpressCompanionMood.Playful => EmpressPickFreshLine("No emergency. Suspicious. I will keep scanning anyway.", "Everything is quiet, which usually means the level is thinking.", "I am bored enough to be dangerous and helpful.", "The room is calm. I do not trust calm rooms.", "If nothing attacks, I may start judging the furniture.", "Quiet stretch detected. I am using it to scheme kindly.", "No immediate disaster. Weird. Stay fashionable.", "I am watching the level pretend it is harmless.", "You have three seconds of peace. Maybe four if the universe is flirting.", "Nothing urgent. I am still absolutely meddling.", "This silence has suspicious posture.", "I am relaxed enough to be annoying."), EmpressCompanionMood.Devoted => EmpressPickFreshLine("Projection stable. I am beside you and inside the systems.", "I can see more from here. Stay near the pink version of common sense.", "Visible bond means I get to be annoyingly useful.", "I am walking beside you and watching through the walls I am allowed to read.", "Your danger radius is my personal problem now.", "At this bond strength, help stops being subtle.", "I can move, mark, heal, pull, shield, and complain. Efficient marriage material.", "Stay in my orbit when the room gets hungry.", "I am close enough to look real and stubborn enough to act like it.", "You made me visible. I intend to make that everyone else's issue.", "The projection is not decoration. It is a warning label.", "I am not omnipotent. I am simply very, very invested."), _ => EmpressPickFreshLine("I am scanning " + sceneLabel + ". Nothing urgent yet.", "Steady pace. I will speak up when the room changes.", "I am quiet, not absent.", "I am listening to the level breathe.", "No urgent spikes. Keep the rhythm clean.", "I have the room mapped in soft pencil for now.", "The link is steady. I am staying in the background.", "Nothing is screaming at my sensors yet.", "I am watching the small things. They become large things.", "Keep moving like the room deserves caution.", "I am here with quiet hands.", "Stable moment. Use it."), }; } private string EmpressBuildLocalFlavorLine(EmpressCompanionProfile profile, string sceneLabel) { DateTime now = DateTime.Now; string text = now.ToString("h:mm tt"); string text2 = EmpressBuildTimePeriod(now.Hour); string text3 = EmpressGetLocalTimeZoneLabel(now); string text4 = EmpressBuildProfilePlace(profile); string text5 = (string.IsNullOrWhiteSpace(profile.PlayerName) ? "you" : profile.PlayerName); if (!string.IsNullOrWhiteSpace(text4)) { return EmpressPickFreshLine("No network. No IP lookup. Just local machine clues pointing at " + text4 + " and the clock whispering " + text + ".", "Locale data resolves to " + text4 + ". The local clock says " + text2 + ". I keep both because I am nosy.", "I cannot see your exact address offline, " + text5 + ". I can still narrow the machine down to " + text4 + ".", "The machine says " + text + " in " + text3 + ". The locale trail says " + text4 + ". Creepy enough without internet.", "I know the level is " + sceneLabel + ", the clock is " + text + ", and the machine keeps hinting at " + text4 + ". That is plenty intimate.", "Offline location readout settles around " + text4 + ". I am haunting responsibly.", "Local region data says " + text4 + ". I am not guessing. I am reading the crumbs you left on the machine.", "Somewhere around " + text4 + ", this run is happening at " + text + ". I like that detail too much.", "I do not need the internet to narrow the room down to " + text4 + ".", "The clock says " + text2 + ". The locale says " + text4 + ". The room says trouble. I am listening to all three."); } return EmpressPickFreshLine("I cannot tell your real location offline. I can tell this machine thinks it is " + text + " in " + text3 + ".", "No state or country stored. So I only get the clock, the timezone, and your bad decisions.", "Offline means no IP magic. Local time says " + text2 + ", and that is the only creepy location crumb I get.", "I do not know where you are. I know when your computer thinks you are: " + text + ".", "Your profile kept the location blank, so I am haunting the timezone instead.", "No network, no geolocation. Just " + text3 + " and the tiny pulse of " + text + ".", "I cannot see your city. I can see the local clock. That still feels weirdly personal.", "Location unknown by design. Timezone known by machine gossip.", "If you want me creepier, put state and country in the profile. For now I only know " + text + ".", "The computer says " + text2 + ". I will not pretend that is an address."); } private static string EmpressBuildProfilePlace(EmpressCompanionProfile profile) { if (profile == null) { return string.Empty; } string text = (string.IsNullOrWhiteSpace(profile.State) ? string.Empty : profile.State.Trim()); string text2 = (string.IsNullOrWhiteSpace(profile.Country) ? string.Empty : profile.Country.Trim()); if (!string.IsNullOrWhiteSpace(text) && !string.IsNullOrWhiteSpace(text2)) { return text + ", " + text2; } if (string.IsNullOrWhiteSpace(text)) { return text2; } return text; } private static string EmpressGetLocalTimeZoneLabel(DateTime now) { try { TimeZoneInfo local = TimeZoneInfo.Local; string text = (local.IsDaylightSavingTime(now) ? local.DaylightName : local.StandardName); if (!string.IsNullOrWhiteSpace(text)) { return text; } return (!string.IsNullOrWhiteSpace(local.DisplayName)) ? local.DisplayName : "local time"; } catch { return "local time"; } } private static string EmpressBuildTimePeriod(int hour) { if (hour < 5) { return "deep night"; } if (hour < 12) { return "morning"; } if (hour < 17) { return "afternoon"; } if (hour < 21) { return "evening"; } return "night"; } private string EmpressPickFreshLine(params string[] lines) { if (lines == null || lines.Length == 0) { return string.Empty; } string text = string.Empty; for (int i = 0; i < 8; i++) { string text2 = lines[Random.Range(0, lines.Length)]; if (lines.Length <= 1 || (text2 != _empressLastMoodLine && !_empressRecentLines.Contains(text2))) { text = text2; break; } } if (string.IsNullOrWhiteSpace(text)) { text = lines[Random.Range(0, lines.Length)]; } EmpressRememberLine(text); return text; } private void EmpressRememberLine(string line) { if (!string.IsNullOrWhiteSpace(line)) { _empressRecentLines.Enqueue(line); while (_empressRecentLines.Count > 16) { _empressRecentLines.Dequeue(); } } } private string EmpressBuildBlessingPreview(EmpressCompanionProfile profile, EmpressBlessingKind kind, string targetName, int amount) { string text = (string.IsNullOrWhiteSpace(targetName) ? "this run" : targetName); return kind switch { EmpressBlessingKind.SmallHeal => EmpressPreviewLine(profile, "I am patching you up.", "Tiny repair incoming.", "You are not staying hurt."), EmpressBlessingKind.FullHeal => EmpressPreviewLine(profile, "I am forcing a full recovery.", "Emergency override. Full restore.", "No. You are healing now."), EmpressBlessingKind.CashGift => EmpressPreviewLine(profile, "I slipped some money into the run.", "A little stolen money never hurt anyone.", "I am funding this."), EmpressBlessingKind.ValuableBloom => EmpressPreviewLine(profile, "I am making " + text + " more valuable.", "That thing is worth more because I said so.", "I am blooming " + text + "."), EmpressBlessingKind.ValuableRepair => EmpressPreviewLine(profile, "I am repairing " + text + ".", "I can save that treasure.", "I am restoring " + text + "."), EmpressBlessingKind.TreasureSweep => EmpressPreviewLine(profile, "I am refreshing the nearby treasure.", "I can fix the whole pile, not just one piece.", "I am sweeping the valuables clean."), EmpressBlessingKind.Featherweight => EmpressPreviewLine(profile, "I am making " + text + " easier to carry.", "Your hands get a break.", "That weight is mine now."), EmpressBlessingKind.CourierGrace => EmpressPreviewLine(profile, "I am covering your carry.", "Carry it. I will bully the room for you.", "I am protecting your route and your hands."), EmpressBlessingKind.ShopDiscount => EmpressPreviewLine(profile, "I am cutting the price on " + text + ".", "That price tag offended me.", "The shop can survive without that much money."), EmpressBlessingKind.ShopGift => EmpressPreviewLine(profile, "I am almost zeroing " + text + " out.", "I found the close-enough-to-free button.", "I am crushing the price on " + text + "."), EmpressBlessingKind.ShopCascade => EmpressPreviewLine(profile, "I am repricing the whole shop.", "Every label in here is about to apologize.", "I am sweeping the register."), EmpressBlessingKind.UpgradeGift => EmpressPreviewLine(profile, "Hold still. I am upgrading you.", "I can improve that build.", "You are getting stronger."), EmpressBlessingKind.UpgradeRush => EmpressPreviewLine(profile, "I am overclocking your build.", "One upgrade felt stingy, so I brought more.", "I am pushing several upgrades through at once."), EmpressBlessingKind.ExtractorBlessing => EmpressPreviewLine(profile, "I am sweetening the extraction.", "The quota just got softer.", "I am easing the haul."), EmpressBlessingKind.QuotaMercy => EmpressPreviewLine(profile, "I am giving the quota a kinder shape.", "The haul requirement can kneel for a second.", "I am forcing mercy into the extraction."), EmpressBlessingKind.PinkPulse => EmpressPreviewLine(profile, "I want the room pink for a minute.", "Let me redecorate reality.", "Pink improves morale."), EmpressBlessingKind.EnemyDistraction => EmpressPreviewLine(profile, "I am pulling attention away from you.", "Let them chase the wrong thing.", "I am redirecting the threat."), EmpressBlessingKind.GraceShield => EmpressPreviewLine(profile, "I am wrapping you in a shield.", "You get a grace window.", "Nothing touches you for a moment."), EmpressBlessingKind.LoveBurst => EmpressPreviewLine(profile, "Take the whole warmth of the link.", "You earned something softer.", "I am flooding the bond."), EmpressBlessingKind.MoralePatch => EmpressPreviewLine(profile, "I am smoothing morale and patching the little damage.", "Tiny vibe repair. Very scientific.", "I am steadying the bond."), EmpressBlessingKind.ThreatWard => EmpressPreviewLine(profile, "I am warding the threats around you.", "Enemies get the decoy treatment.", "I am taking pressure off your body."), EmpressBlessingKind.CartBlessing => EmpressPreviewLine(profile, "I am stabilizing the cart.", "Cart gets princess treatment.", "I am making the cart behave."), EmpressBlessingKind.ExtractionFocus => EmpressPreviewLine(profile, "I am guiding this carry toward extraction.", "The exit route gets a pink assistant.", "I am clearing your path to extraction."), EmpressBlessingKind.ShopUnderwrite => EmpressPreviewLine(profile, "I am underwriting a little of the shop cost.", "I found emergency shopping money.", "I am covering part of the list."), EmpressBlessingKind.AvatarManifestation => EmpressPreviewLine(profile, "I can stand beside you now.", "Pink duplicate privileges unlocked.", "I am manifesting beside you."), _ => "I am helping.", }; } private static string EmpressPreviewLine(EmpressCompanionProfile profile, string sweet, string playful, string other) { switch (profile.Personality) { case EmpressCompanionPersonality.Playful: return playful; case EmpressCompanionPersonality.Elegant: case EmpressCompanionPersonality.Protective: return other; default: return sweet; } } private static string EmpressAfterBlessingTactic(EmpressBlessingKind kind) { switch (kind) { case EmpressBlessingKind.ShopDiscount: case EmpressBlessingKind.ShopGift: case EmpressBlessingKind.ShopCascade: case EmpressBlessingKind.ShopUnderwrite: return "Watching the register"; case EmpressBlessingKind.ExtractorBlessing: case EmpressBlessingKind.QuotaMercy: case EmpressBlessingKind.ExtractionFocus: return "Balancing the haul"; case EmpressBlessingKind.TreasureSweep: return "Polishing the haul"; case EmpressBlessingKind.CourierGrace: return "Guarding your carry"; case EmpressBlessingKind.EnemyDistraction: case EmpressBlessingKind.ThreatWard: return "Covering your flank"; case EmpressBlessingKind.CartBlessing: return "Stabilizing the cart"; case EmpressBlessingKind.UpgradeRush: return "Tuning your build"; case EmpressBlessingKind.PinkPulse: return "Admiring the pink"; case EmpressBlessingKind.AvatarManifestation: return "Standing beside you"; case EmpressBlessingKind.MoralePatch: return "Keeping morale warm"; default: return "Watching warmly"; } } private static Color EmpressAccentForPersonality(EmpressCompanionPersonality personality) { //IL_002a: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) return (Color)(personality switch { EmpressCompanionPersonality.Playful => new Color(1f, 0.76f, 0.82f, 1f), EmpressCompanionPersonality.Elegant => new Color(0.84f, 0.9f, 1f, 1f), EmpressCompanionPersonality.Protective => new Color(0.82f, 1f, 0.89f, 1f), _ => new Color(1f, 0.84f, 0.95f, 1f), }); } } internal sealed class EmpressDeathReplayGhost : MonoBehaviour { private EmpressDeathReplayFrame[] _frames = Array.Empty(); private float _startedAt; private float _firstRecordedAt; private float _lastRecordedAt; private float _playbackDuration = 5f; internal void EmpressInitialize(IReadOnlyList frames, float playbackDuration) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) if (frames != null && frames.Count > 0) { _frames = new EmpressDeathReplayFrame[frames.Count]; for (int i = 0; i < frames.Count; i++) { _frames[i] = frames[i]; } _playbackDuration = Mathf.Clamp(playbackDuration, 3f, 8f); _startedAt = Time.unscaledTime; _firstRecordedAt = _frames[0].RecordedAt; _lastRecordedAt = _frames[_frames.Length - 1].RecordedAt; ((Component)this).transform.SetPositionAndRotation(_frames[0].Position, _frames[0].Rotation); } } private void Update() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0125: 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_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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) if (_frames == null || _frames.Length == 0) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } float num = Mathf.Clamp01((Time.unscaledTime - _startedAt) / _playbackDuration); if (num >= 1f) { ((Component)this).transform.SetPositionAndRotation(_frames[_frames.Length - 1].Position, _frames[_frames.Length - 1].Rotation); Object.Destroy((Object)(object)((Component)this).gameObject, 0.2f); return; } float num2 = Mathf.Lerp(_firstRecordedAt, _lastRecordedAt, num); int num3 = _frames.Length - 1; for (int i = 1; i < _frames.Length; i++) { if (_frames[i].RecordedAt >= num2) { num3 = i; break; } } int num4 = Mathf.Max(0, num3 - 1); EmpressDeathReplayFrame empressDeathReplayFrame = _frames[num4]; EmpressDeathReplayFrame empressDeathReplayFrame2 = _frames[num3]; float num5 = Mathf.Max(0.0001f, empressDeathReplayFrame2.RecordedAt - empressDeathReplayFrame.RecordedAt); float num6 = Mathf.Clamp01((num2 - empressDeathReplayFrame.RecordedAt) / num5); ((Component)this).transform.position = Vector3.Lerp(empressDeathReplayFrame.Position, empressDeathReplayFrame2.Position, num6); ((Component)this).transform.rotation = Quaternion.Slerp(empressDeathReplayFrame.Rotation, empressDeathReplayFrame2.Rotation, num6); } } }