// IltHubState.cs — Persisted per-character state for the ILT Hub (Infinite Leaftide tools). // // Lives in \ilt-hub.json, deliberately separate from the combat settings // profile (Default.json / /ra settings) so ILT data never leaks into combat profiles and // non-ILT characters stay untouched. Serialized with the NativeAOT source-generated // RynthAiJsonContext (IncludeFields = true), so plain public fields are used throughout. using System; using System.Collections.Generic; namespace RynthCore.Plugin.RynthAi.IltHub; /// Root of everything the Hub remembers between sessions. public sealed class IltHubState { /// Bumped when the shape changes in a way that needs a migration. public int SchemaVersion = 1; // ── Window / shell ────────────────────────────────────────────────────── /// /// Hub UI on screen: the Mini Remote or any ILT section window (IltHubController.Tick keeps it /// current). Bank auto-refresh and the gear / split-arrow scans run only while it is true. /// public bool WindowVisible; /// Unused since the tabbed Hub window was retired; kept so old files still load. public int SelectedTab; public bool GamesHudVisible = true; /// /// "This world is an ACECustom/ILT shard even though its name isn't InfiniteLeaftide." /// World-identity override ONLY: it makes the Hub ask the server for its options, it /// never turns a feature on by itself. /// public bool ForceLeaftideFeatures; /// True once the one-time UtilityBelt sidecar import has run for this character. public bool UbSidecarsImported; /// Last-seen server feature bits. Cache only — overwritten by every login refresh. public IltServerOptionsSnapshot ServerOptions = new(); public IltBankState Bank = new(); public IltPetState Pet = new(); public IltCharacterState Character = new(); public IltGearState Gear = new(); public IltGamesState Games = new(); public IltGuardianState Guardian = new(); } /// Cached result of the server-options check (see IltServerOptions). public sealed class IltServerOptionsSnapshot { public string WorldName = string.Empty; /// "ilt-features" (structured dump), "probe" (command probing) or "" (never refreshed). public string Source = string.Empty; public DateTime LastRefreshUtc = DateTime.MinValue; /// Feature key → -1 unknown, 0 off, 1 on. public Dictionary Bits = new(StringComparer.OrdinalIgnoreCase); } // ── Banking ───────────────────────────────────────────────────────────────── public sealed class IltBankState { public long Pyreals; public long Luminance; public long LegendaryKeys; public long MythicalKeys; public long EnlightenedCoins; public long WeaklyEnlightenedCoins; public DateTime LastUpdated = DateTime.MinValue; /// Last transfer recipient typed into the transfer form. public string TransferTarget = string.Empty; public int TransferCurrencyIndex; /// Re-issue /bank every N seconds while the Hub is open (0 = manual only). public int AutoRefreshSeconds = 120; } /// One "Transferred …" / "Received …" bank line seen in chat. public sealed class IltBankTransaction { public DateTime Timestamp; /// "Sent" or "Received". public string Type = string.Empty; public string Currency = string.Empty; public long Amount; public string OtherPlayer = string.Empty; public string Description = string.Empty; } // ── Pet ───────────────────────────────────────────────────────────────────── public sealed class IltPetState { // Healing-pet automation (UB "HealingBuddy" subset). public bool HealingEnabled; /// Exact name of the heal-pet essence to use; empty = auto-detect (Healing Buddy / Dule box). public string HealPetName = string.Empty; public int HealthThresholdPercent = 80; /// Do not summon when current HP is below this (summoning mid-death wastes the use). 0 = off. public int MinHealthPoints = 100; public bool AutoDespawnAfterHeal = true; public int RespawnDelaySeconds = 2; public int PetTimeoutSeconds = 30; /// /// Allow a combat summon from an EMPTY essence when the Summon Essence Refill Charm is /// active (server refills from banked pyreals). Still requires the server flag to be on. /// public bool UsePyrealRefillPath; /// Last captured /pets and /shinies rosters (display only). public List PetLog = new(); public List ShinyLog = new(); // ── Pet roster (UB Pets-tab style) ── /// Roster type shown in the Pet tab (IltPetKind: 0 Combat, 1 Healing, 2 Cosmetic). public int RosterKind; /// Roster sort (IltPetSort: 0 Priority, 1 Bond, 2 Potency, 3 Breed ready, 4 Level, 5 Uses, 6 Name). public int RosterSort; /// User type overrides by essence name; essences not listed are auto-classified. public List Assignments = new(); /// Essence name of the chosen cosmetic (display) pet; empty = none. public string CosmeticPetName = string.Empty; /// Keep the cosmetic pet summoned while in peace mode; it is dismissed when a combat pet is needed. public bool KeepCosmeticOut; /// Seconds to wait before re-summoning the cosmetic pet after it despawns. public int CosmeticRespawnSeconds = 15; } /// A user's choice of summon type for one essence (matched by name, case-insensitive). public sealed class IltPetAssignment { public string Name = string.Empty; /// IltPetKind as int (0 Combat, 1 Healing, 2 Cosmetic). public int Kind; } // ── Character ─────────────────────────────────────────────────────────────── public sealed class IltCharacterState { /// Item → coin conversion table used by the session-rates strip. public List ItemConversions = new() { new IltItemConversion { ItemName = "Strawberry Jam Jar", ItemsPerConversion = 100, CoinsPerConversion = 10 }, new IltItemConversion { ItemName = "Ancient Pyreal", ItemsPerConversion = 100, CoinsPerConversion = 37 }, }; /// Augmentation planner targets, keyed by aug type (lowercase). public Dictionary AugTargets = new(StringComparer.OrdinalIgnoreCase); /// Luminance price of one Enlightened Coin (planner math only; 0 = don't price coins). public long LumPerEnlightenedCoin; /// Enlightenment planner target level (0 = current + 5). public int EnlTargetLevel; public int EnlightenedCoinsPerToken = 20; /// /// Auto-enlighten preference. Even when true it stays DISARMED each session until the /// player confirms in the Hub, and the server's own Yes/No dialog is never auto-clicked. /// public bool AutoEnlightenEnabled; public int AutoEnlightenCheckSeconds = 30; /// Spend unassigned XP with /attr before sending /enl (enlightening wipes unspent XP). public bool AutoEnlightenSpendXpFirst; /// Quest Tracker search box contents. public string QuestFilter = string.Empty; public string QbFilter = string.Empty; /// Starred quest flag keys (lowercase), shown on the floating favorites HUD. public List QuestFavorites = new(); /// Quest tracker lists starred quests only. public bool QuestFavoritesOnly; /// Floating quest favorites HUD is shown. public bool ShowQuestFavoritesHud; public bool QuestFavoritesHudLocked; // ILT section windows, opened from the Mini Remote's Options (IltSections). /// The "Quests" window (tracker + quest bonus) is open. public bool QuestTrackerPoppedOut; /// The "Pets" window is open. public bool PetsWindowOpen; /// The "ILT Character" window (world status, session rates) is open. public bool CharacterWindowOpen; /// The "Banking" window is open. public bool BankingWindowOpen; /// The "Gear" window is open. public bool GearWindowOpen; /// The "Games" window is open. public bool GamesWindowOpen; /// The "Guardian" window (riddle translator, attribute tracker) is open. public bool GuardianWindowOpen; /// /// Registry charms this character has carried, keyed by charm name. Lets the Charms Tracking /// tab report "acquired" for charms that are now in storage (the client only sees carried items). /// public Dictionary CharmsSeen = new(StringComparer.OrdinalIgnoreCase); } /// Last time a charm was seen in the character's possession, with its best tier. public sealed class IltCharmSeen { public int Tier; public int MaxTier; public DateTime LastSeenUtc; } public sealed class IltItemConversion { public string ItemName = string.Empty; public int ItemsPerConversion = 100; public int CoinsPerConversion; } // ── Gear ──────────────────────────────────────────────────────────────────── public sealed class IltGearState { // Dispel (Rune of Dispel on harmful debuffs) public bool AutoDispel; public int DispelCooldownSeconds = 10; /// Spell-name substrings that are ALWAYS dispelled. public List DispelInclusions = new(); /// Spell-name substrings that are NEVER dispelled. public List DispelExclusions = new(); // Surging Strength (Empowered Volcanic Ember keeper) public bool SurgingStrength; public int SurgingCooldownSeconds = 15; // Aetheria / corrupted-weapon chunking public bool AutoChunkAetheria; public bool AutoChunkCorrupted; public bool ChunkInCombat; public int ChunkIntervalMs = 2000; /// Only chunk aetheria whose max level is below this (Coalesced always chunks). public int ChunkAetheriaUnderLevel = 4; // Auto-clap (/clap all) public bool AutoClap; public int ClapIntervalMinutes = 30; // Guardian Hand charm (WCID unpublished — name match until set) public uint GuardianHandWcid; public string GuardianHandName = "Guardian Hand"; // Split arrows (White Quartz imbue on missile weapons) public int SplitArrowTarget = 3; public bool SplitIgnoreImbued = true; // Equipment profiles (.utl suits) and VTank .usd import public string LastEquipProfile = string.Empty; public string LastUsdPath = string.Empty; } // ── Games ─────────────────────────────────────────────────────────────────── public sealed class IltGamesState { public long BlackjackBet = 1_000_000; public long FellowshipBlackjackBet = 1_000_000; public int PowerballQuantity = 1; } // ── Guardian (Temple of Enlightenment) ────────────────────────────────────── public sealed class IltGuardianState { /// Translate incoming guardian tells and show the answer (Guardian window + Mini Remote). public bool AutoDetectFromChat = true; /// After a chat answer, give the item to the guardian automatically. public bool AutoHandIn; /// Temple guardian only: buy one of the item from the nearest vendor when none is carried. public bool BuyMissingFromVendor = true; /// Assumed attribute turn-in cooldown when only /qb wait stamps are known (hours). public int CooldownHoursAssumed = 20; /// Turn-ins counted from /qb wait-stamp transitions, keyed by attribute (fallback when /myquests lacks the flag). public Dictionary TurnInCounts = new(StringComparer.OrdinalIgnoreCase); /// Estimated end of each attribute's cooldown (UTC), keyed by attribute (same fallback). public Dictionary CooldownUntilUtc = new(StringComparer.OrdinalIgnoreCase); }