idlerpg.sh 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +171 -0
- package/dist/affix/AffixRegistry.d.ts +68 -0
- package/dist/affix/AffixRegistry.d.ts.map +1 -0
- package/dist/affix/AffixRegistry.js +245 -0
- package/dist/affix/AffixRegistry.js.map +1 -0
- package/dist/affix/PluginLoader.d.ts +66 -0
- package/dist/affix/PluginLoader.d.ts.map +1 -0
- package/dist/affix/PluginLoader.js +321 -0
- package/dist/affix/PluginLoader.js.map +1 -0
- package/dist/affix/builtin.d.ts +6 -0
- package/dist/affix/builtin.d.ts.map +1 -0
- package/dist/affix/builtin.js +311 -0
- package/dist/affix/builtin.js.map +1 -0
- package/dist/affix/index.d.ts +8 -0
- package/dist/affix/index.d.ts.map +1 -0
- package/dist/affix/index.js +11 -0
- package/dist/affix/index.js.map +1 -0
- package/dist/affix/types.d.ts +152 -0
- package/dist/affix/types.d.ts.map +1 -0
- package/dist/affix/types.js +8 -0
- package/dist/affix/types.js.map +1 -0
- package/dist/ai/PlayKitClient.d.ts +208 -0
- package/dist/ai/PlayKitClient.d.ts.map +1 -0
- package/dist/ai/PlayKitClient.js +721 -0
- package/dist/ai/PlayKitClient.js.map +1 -0
- package/dist/ai/index.d.ts +5 -0
- package/dist/ai/index.d.ts.map +1 -0
- package/dist/ai/index.js +8 -0
- package/dist/ai/index.js.map +1 -0
- package/dist/app/App.d.ts +85 -0
- package/dist/app/App.d.ts.map +1 -0
- package/dist/app/App.js +296 -0
- package/dist/app/App.js.map +1 -0
- package/dist/app/EventBus.d.ts +222 -0
- package/dist/app/EventBus.d.ts.map +1 -0
- package/dist/app/EventBus.js +88 -0
- package/dist/app/EventBus.js.map +1 -0
- package/dist/app/Keybind.d.ts +83 -0
- package/dist/app/Keybind.d.ts.map +1 -0
- package/dist/app/Keybind.js +184 -0
- package/dist/app/Keybind.js.map +1 -0
- package/dist/app/Router.d.ts +123 -0
- package/dist/app/Router.d.ts.map +1 -0
- package/dist/app/Router.js +142 -0
- package/dist/app/Router.js.map +1 -0
- package/dist/app/ScreenManager.d.ts +97 -0
- package/dist/app/ScreenManager.d.ts.map +1 -0
- package/dist/app/ScreenManager.js +216 -0
- package/dist/app/ScreenManager.js.map +1 -0
- package/dist/app/index.d.ts +14 -0
- package/dist/app/index.d.ts.map +1 -0
- package/dist/app/index.js +19 -0
- package/dist/app/index.js.map +1 -0
- package/dist/app/screens/BaseScreen.d.ts +101 -0
- package/dist/app/screens/BaseScreen.d.ts.map +1 -0
- package/dist/app/screens/BaseScreen.js +132 -0
- package/dist/app/screens/BaseScreen.js.map +1 -0
- package/dist/app/screens/CharacterCreationScreen.d.ts +42 -0
- package/dist/app/screens/CharacterCreationScreen.d.ts.map +1 -0
- package/dist/app/screens/CharacterCreationScreen.js +467 -0
- package/dist/app/screens/CharacterCreationScreen.js.map +1 -0
- package/dist/app/screens/CombatScreen.d.ts +30 -0
- package/dist/app/screens/CombatScreen.d.ts.map +1 -0
- package/dist/app/screens/CombatScreen.js +309 -0
- package/dist/app/screens/CombatScreen.js.map +1 -0
- package/dist/app/screens/DialogScreen.d.ts +29 -0
- package/dist/app/screens/DialogScreen.d.ts.map +1 -0
- package/dist/app/screens/DialogScreen.js +295 -0
- package/dist/app/screens/DialogScreen.js.map +1 -0
- package/dist/app/screens/ExploreScreen.d.ts +50 -0
- package/dist/app/screens/ExploreScreen.d.ts.map +1 -0
- package/dist/app/screens/ExploreScreen.js +308 -0
- package/dist/app/screens/ExploreScreen.js.map +1 -0
- package/dist/app/screens/HelpScreen.d.ts +12 -0
- package/dist/app/screens/HelpScreen.d.ts.map +1 -0
- package/dist/app/screens/HelpScreen.js +155 -0
- package/dist/app/screens/HelpScreen.js.map +1 -0
- package/dist/app/screens/InventoryScreen.d.ts +27 -0
- package/dist/app/screens/InventoryScreen.d.ts.map +1 -0
- package/dist/app/screens/InventoryScreen.js +326 -0
- package/dist/app/screens/InventoryScreen.js.map +1 -0
- package/dist/app/screens/PrologueScreen.d.ts +24 -0
- package/dist/app/screens/PrologueScreen.d.ts.map +1 -0
- package/dist/app/screens/PrologueScreen.js +176 -0
- package/dist/app/screens/PrologueScreen.js.map +1 -0
- package/dist/app/screens/TitleScreen.d.ts +42 -0
- package/dist/app/screens/TitleScreen.d.ts.map +1 -0
- package/dist/app/screens/TitleScreen.js +380 -0
- package/dist/app/screens/TitleScreen.js.map +1 -0
- package/dist/app/screens/TravelScreen.d.ts +22 -0
- package/dist/app/screens/TravelScreen.d.ts.map +1 -0
- package/dist/app/screens/TravelScreen.js +122 -0
- package/dist/app/screens/TravelScreen.js.map +1 -0
- package/dist/app/screens/index.d.ts +14 -0
- package/dist/app/screens/index.d.ts.map +1 -0
- package/dist/app/screens/index.js +17 -0
- package/dist/app/screens/index.js.map +1 -0
- package/dist/commands/CommandRegistry.d.ts +91 -0
- package/dist/commands/CommandRegistry.d.ts.map +1 -0
- package/dist/commands/CommandRegistry.js +159 -0
- package/dist/commands/CommandRegistry.js.map +1 -0
- package/dist/commands/index.d.ts +7 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +10 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/core/Actor.d.ts +103 -0
- package/dist/core/Actor.d.ts.map +1 -0
- package/dist/core/Actor.js +409 -0
- package/dist/core/Actor.js.map +1 -0
- package/dist/core/Combat.d.ts +37 -0
- package/dist/core/Combat.d.ts.map +1 -0
- package/dist/core/Combat.js +294 -0
- package/dist/core/Combat.js.map +1 -0
- package/dist/core/DungeonRunner.d.ts +169 -0
- package/dist/core/DungeonRunner.d.ts.map +1 -0
- package/dist/core/DungeonRunner.js +627 -0
- package/dist/core/DungeonRunner.js.map +1 -0
- package/dist/core/Game.d.ts +133 -0
- package/dist/core/Game.d.ts.map +1 -0
- package/dist/core/Game.js +644 -0
- package/dist/core/Game.js.map +1 -0
- package/dist/core/IdleCombat.d.ts +61 -0
- package/dist/core/IdleCombat.d.ts.map +1 -0
- package/dist/core/IdleCombat.js +461 -0
- package/dist/core/IdleCombat.js.map +1 -0
- package/dist/core/IdleGameManager.d.ts +198 -0
- package/dist/core/IdleGameManager.d.ts.map +1 -0
- package/dist/core/IdleGameManager.js +688 -0
- package/dist/core/IdleGameManager.js.map +1 -0
- package/dist/core/IdleSaveManager.d.ts +109 -0
- package/dist/core/IdleSaveManager.d.ts.map +1 -0
- package/dist/core/IdleSaveManager.js +296 -0
- package/dist/core/IdleSaveManager.js.map +1 -0
- package/dist/core/NewGameFlowManager.d.ts +64 -0
- package/dist/core/NewGameFlowManager.d.ts.map +1 -0
- package/dist/core/NewGameFlowManager.js +153 -0
- package/dist/core/NewGameFlowManager.js.map +1 -0
- package/dist/core/Player.d.ts +65 -0
- package/dist/core/Player.d.ts.map +1 -0
- package/dist/core/Player.js +261 -0
- package/dist/core/Player.js.map +1 -0
- package/dist/core/RoomHandlers.d.ts +75 -0
- package/dist/core/RoomHandlers.d.ts.map +1 -0
- package/dist/core/RoomHandlers.js +383 -0
- package/dist/core/RoomHandlers.js.map +1 -0
- package/dist/core/SaveManager.d.ts +84 -0
- package/dist/core/SaveManager.d.ts.map +1 -0
- package/dist/core/SaveManager.js +281 -0
- package/dist/core/SaveManager.js.map +1 -0
- package/dist/core/SaveMigration.d.ts +69 -0
- package/dist/core/SaveMigration.d.ts.map +1 -0
- package/dist/core/SaveMigration.js +408 -0
- package/dist/core/SaveMigration.js.map +1 -0
- package/dist/core/StateAdapter.d.ts +79 -0
- package/dist/core/StateAdapter.d.ts.map +1 -0
- package/dist/core/StateAdapter.js +397 -0
- package/dist/core/StateAdapter.js.map +1 -0
- package/dist/core/Team.d.ts +145 -0
- package/dist/core/Team.d.ts.map +1 -0
- package/dist/core/Team.js +371 -0
- package/dist/core/Team.js.map +1 -0
- package/dist/core/TeamCombat.d.ts +88 -0
- package/dist/core/TeamCombat.d.ts.map +1 -0
- package/dist/core/TeamCombat.js +405 -0
- package/dist/core/TeamCombat.js.map +1 -0
- package/dist/core/TeamDungeonRunner.d.ts +186 -0
- package/dist/core/TeamDungeonRunner.d.ts.map +1 -0
- package/dist/core/TeamDungeonRunner.js +758 -0
- package/dist/core/TeamDungeonRunner.js.map +1 -0
- package/dist/core/TimeManager.d.ts +114 -0
- package/dist/core/TimeManager.d.ts.map +1 -0
- package/dist/core/TimeManager.js +318 -0
- package/dist/core/TimeManager.js.map +1 -0
- package/dist/core/index.d.ts +9 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +12 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/timeConstants.d.ts +135 -0
- package/dist/core/timeConstants.d.ts.map +1 -0
- package/dist/core/timeConstants.js +157 -0
- package/dist/core/timeConstants.js.map +1 -0
- package/dist/core/types.d.ts +780 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +16 -0
- package/dist/core/types.js.map +1 -0
- package/dist/data/continents/index.d.ts +163 -0
- package/dist/data/continents/index.d.ts.map +1 -0
- package/dist/data/continents/index.js +31 -0
- package/dist/data/continents/index.js.map +1 -0
- package/dist/data/continents/verdantia.d.ts +294 -0
- package/dist/data/continents/verdantia.d.ts.map +1 -0
- package/dist/data/continents/verdantia.js +327 -0
- package/dist/data/continents/verdantia.js.map +1 -0
- package/dist/handlers/DialogHandler.d.ts +95 -0
- package/dist/handlers/DialogHandler.d.ts.map +1 -0
- package/dist/handlers/DialogHandler.js +450 -0
- package/dist/handlers/DialogHandler.js.map +1 -0
- package/dist/handlers/SaveLoadHandler.d.ts +60 -0
- package/dist/handlers/SaveLoadHandler.d.ts.map +1 -0
- package/dist/handlers/SaveLoadHandler.js +187 -0
- package/dist/handlers/SaveLoadHandler.js.map +1 -0
- package/dist/handlers/TitleScreenHandler.d.ts +43 -0
- package/dist/handlers/TitleScreenHandler.d.ts.map +1 -0
- package/dist/handlers/TitleScreenHandler.js +508 -0
- package/dist/handlers/TitleScreenHandler.js.map +1 -0
- package/dist/handlers/WorkshopHandler.d.ts +75 -0
- package/dist/handlers/WorkshopHandler.d.ts.map +1 -0
- package/dist/handlers/WorkshopHandler.js +401 -0
- package/dist/handlers/WorkshopHandler.js.map +1 -0
- package/dist/handlers/index.d.ts +12 -0
- package/dist/handlers/index.d.ts.map +1 -0
- package/dist/handlers/index.js +14 -0
- package/dist/handlers/index.js.map +1 -0
- package/dist/handlers/types.d.ts +34 -0
- package/dist/handlers/types.d.ts.map +1 -0
- package/dist/handlers/types.js +8 -0
- package/dist/handlers/types.js.map +1 -0
- package/dist/i18n/en.d.ts +3 -0
- package/dist/i18n/en.d.ts.map +1 -0
- package/dist/i18n/en.js +130 -0
- package/dist/i18n/en.js.map +1 -0
- package/dist/i18n/index.d.ts +40 -0
- package/dist/i18n/index.d.ts.map +1 -0
- package/dist/i18n/index.js +105 -0
- package/dist/i18n/index.js.map +1 -0
- package/dist/i18n/types.d.ts +133 -0
- package/dist/i18n/types.d.ts.map +1 -0
- package/dist/i18n/types.js +8 -0
- package/dist/i18n/types.js.map +1 -0
- package/dist/i18n/zh.d.ts +3 -0
- package/dist/i18n/zh.d.ts.map +1 -0
- package/dist/i18n/zh.js +130 -0
- package/dist/i18n/zh.js.map +1 -0
- package/dist/instrument.d.ts +8 -0
- package/dist/instrument.d.ts.map +1 -0
- package/dist/instrument.js +33 -0
- package/dist/instrument.js.map +1 -0
- package/dist/main-new.d.ts +12 -0
- package/dist/main-new.d.ts.map +1 -0
- package/dist/main-new.js +32 -0
- package/dist/main-new.js.map +1 -0
- package/dist/main.d.ts +7 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +2816 -0
- package/dist/main.js.map +1 -0
- package/dist/map/ContinentManager.d.ts +88 -0
- package/dist/map/ContinentManager.d.ts.map +1 -0
- package/dist/map/ContinentManager.js +241 -0
- package/dist/map/ContinentManager.js.map +1 -0
- package/dist/map/DungeonGenerator.d.ts +32 -0
- package/dist/map/DungeonGenerator.d.ts.map +1 -0
- package/dist/map/DungeonGenerator.js +615 -0
- package/dist/map/DungeonGenerator.js.map +1 -0
- package/dist/map/MapGenerator.d.ts +27 -0
- package/dist/map/MapGenerator.d.ts.map +1 -0
- package/dist/map/MapGenerator.js +485 -0
- package/dist/map/MapGenerator.js.map +1 -0
- package/dist/map/index.d.ts +5 -0
- package/dist/map/index.d.ts.map +1 -0
- package/dist/map/index.js +8 -0
- package/dist/map/index.js.map +1 -0
- package/dist/npc/NPCGenerator.d.ts +68 -0
- package/dist/npc/NPCGenerator.d.ts.map +1 -0
- package/dist/npc/NPCGenerator.js +468 -0
- package/dist/npc/NPCGenerator.js.map +1 -0
- package/dist/npc/NPCManager.d.ts +86 -0
- package/dist/npc/NPCManager.d.ts.map +1 -0
- package/dist/npc/NPCManager.js +217 -0
- package/dist/npc/NPCManager.js.map +1 -0
- package/dist/npc/fixedNPCs.d.ts +7 -0
- package/dist/npc/fixedNPCs.d.ts.map +1 -0
- package/dist/npc/fixedNPCs.js +196 -0
- package/dist/npc/fixedNPCs.js.map +1 -0
- package/dist/npc/index.d.ts +9 -0
- package/dist/npc/index.d.ts.map +1 -0
- package/dist/npc/index.js +12 -0
- package/dist/npc/index.js.map +1 -0
- package/dist/npc/traits.d.ts +33 -0
- package/dist/npc/traits.d.ts.map +1 -0
- package/dist/npc/traits.js +795 -0
- package/dist/npc/traits.js.map +1 -0
- package/dist/npc/types.d.ts +193 -0
- package/dist/npc/types.d.ts.map +1 -0
- package/dist/npc/types.js +9 -0
- package/dist/npc/types.js.map +1 -0
- package/dist/quest/QuestManager.d.ts +79 -0
- package/dist/quest/QuestManager.d.ts.map +1 -0
- package/dist/quest/QuestManager.js +273 -0
- package/dist/quest/QuestManager.js.map +1 -0
- package/dist/quest/index.d.ts +6 -0
- package/dist/quest/index.d.ts.map +1 -0
- package/dist/quest/index.js +9 -0
- package/dist/quest/index.js.map +1 -0
- package/dist/quest/types.d.ts +81 -0
- package/dist/quest/types.d.ts.map +1 -0
- package/dist/quest/types.js +8 -0
- package/dist/quest/types.js.map +1 -0
- package/dist/strategy/StrategyExecutor.d.ts +159 -0
- package/dist/strategy/StrategyExecutor.d.ts.map +1 -0
- package/dist/strategy/StrategyExecutor.js +479 -0
- package/dist/strategy/StrategyExecutor.js.map +1 -0
- package/dist/strategy/StrategyParser.d.ts +48 -0
- package/dist/strategy/StrategyParser.d.ts.map +1 -0
- package/dist/strategy/StrategyParser.js +321 -0
- package/dist/strategy/StrategyParser.js.map +1 -0
- package/dist/strategy/defaultStrategy.d.ts +40 -0
- package/dist/strategy/defaultStrategy.d.ts.map +1 -0
- package/dist/strategy/defaultStrategy.js +254 -0
- package/dist/strategy/defaultStrategy.js.map +1 -0
- package/dist/strategy/index.d.ts +8 -0
- package/dist/strategy/index.d.ts.map +1 -0
- package/dist/strategy/index.js +14 -0
- package/dist/strategy/index.js.map +1 -0
- package/dist/tui/ExploreMenu.d.ts +106 -0
- package/dist/tui/ExploreMenu.d.ts.map +1 -0
- package/dist/tui/ExploreMenu.js +282 -0
- package/dist/tui/ExploreMenu.js.map +1 -0
- package/dist/tui/GameUI.d.ts +313 -0
- package/dist/tui/GameUI.d.ts.map +1 -0
- package/dist/tui/GameUI.js +2116 -0
- package/dist/tui/GameUI.js.map +1 -0
- package/dist/tui/GameUIAdapter.d.ts +207 -0
- package/dist/tui/GameUIAdapter.d.ts.map +1 -0
- package/dist/tui/GameUIAdapter.js +1342 -0
- package/dist/tui/GameUIAdapter.js.map +1 -0
- package/dist/tui/Input.d.ts +139 -0
- package/dist/tui/Input.d.ts.map +1 -0
- package/dist/tui/Input.js +278 -0
- package/dist/tui/Input.js.map +1 -0
- package/dist/tui/Menu.d.ts +110 -0
- package/dist/tui/Menu.d.ts.map +1 -0
- package/dist/tui/Menu.js +365 -0
- package/dist/tui/Menu.js.map +1 -0
- package/dist/tui/Screen.d.ts +228 -0
- package/dist/tui/Screen.d.ts.map +1 -0
- package/dist/tui/Screen.js +502 -0
- package/dist/tui/Screen.js.map +1 -0
- package/dist/tui/components/Box.d.ts +36 -0
- package/dist/tui/components/Box.d.ts.map +1 -0
- package/dist/tui/components/Box.js +43 -0
- package/dist/tui/components/Box.js.map +1 -0
- package/dist/tui/components/List.d.ts +69 -0
- package/dist/tui/components/List.d.ts.map +1 -0
- package/dist/tui/components/List.js +136 -0
- package/dist/tui/components/List.js.map +1 -0
- package/dist/tui/components/ProgressBar.d.ts +42 -0
- package/dist/tui/components/ProgressBar.d.ts.map +1 -0
- package/dist/tui/components/ProgressBar.js +75 -0
- package/dist/tui/components/ProgressBar.js.map +1 -0
- package/dist/tui/components/index.d.ts +8 -0
- package/dist/tui/components/index.d.ts.map +1 -0
- package/dist/tui/components/index.js +11 -0
- package/dist/tui/components/index.js.map +1 -0
- package/dist/tui/core/BaseSection.d.ts +98 -0
- package/dist/tui/core/BaseSection.d.ts.map +1 -0
- package/dist/tui/core/BaseSection.js +174 -0
- package/dist/tui/core/BaseSection.js.map +1 -0
- package/dist/tui/core/Component.d.ts +61 -0
- package/dist/tui/core/Component.d.ts.map +1 -0
- package/dist/tui/core/Component.js +32 -0
- package/dist/tui/core/Component.js.map +1 -0
- package/dist/tui/core/Section.d.ts +101 -0
- package/dist/tui/core/Section.d.ts.map +1 -0
- package/dist/tui/core/Section.js +24 -0
- package/dist/tui/core/Section.js.map +1 -0
- package/dist/tui/core/SectionManager.d.ts +108 -0
- package/dist/tui/core/SectionManager.d.ts.map +1 -0
- package/dist/tui/core/SectionManager.js +258 -0
- package/dist/tui/core/SectionManager.js.map +1 -0
- package/dist/tui/core/index.d.ts +9 -0
- package/dist/tui/core/index.d.ts.map +1 -0
- package/dist/tui/core/index.js +12 -0
- package/dist/tui/core/index.js.map +1 -0
- package/dist/tui/index.d.ts +15 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +23 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/screens/BaseScreen.d.ts +62 -0
- package/dist/tui/screens/BaseScreen.d.ts.map +1 -0
- package/dist/tui/screens/BaseScreen.js +55 -0
- package/dist/tui/screens/BaseScreen.js.map +1 -0
- package/dist/tui/screens/CombatScreen.d.ts +43 -0
- package/dist/tui/screens/CombatScreen.d.ts.map +1 -0
- package/dist/tui/screens/CombatScreen.js +125 -0
- package/dist/tui/screens/CombatScreen.js.map +1 -0
- package/dist/tui/screens/DialogScreen.d.ts +53 -0
- package/dist/tui/screens/DialogScreen.d.ts.map +1 -0
- package/dist/tui/screens/DialogScreen.js +90 -0
- package/dist/tui/screens/DialogScreen.js.map +1 -0
- package/dist/tui/screens/DungeonScreen.d.ts +80 -0
- package/dist/tui/screens/DungeonScreen.d.ts.map +1 -0
- package/dist/tui/screens/DungeonScreen.js +317 -0
- package/dist/tui/screens/DungeonScreen.js.map +1 -0
- package/dist/tui/screens/ExploreScreen.d.ts +69 -0
- package/dist/tui/screens/ExploreScreen.d.ts.map +1 -0
- package/dist/tui/screens/ExploreScreen.js +224 -0
- package/dist/tui/screens/ExploreScreen.js.map +1 -0
- package/dist/tui/screens/SectionScreen.d.ts +84 -0
- package/dist/tui/screens/SectionScreen.d.ts.map +1 -0
- package/dist/tui/screens/SectionScreen.js +156 -0
- package/dist/tui/screens/SectionScreen.js.map +1 -0
- package/dist/tui/screens/TitleScreen.d.ts +40 -0
- package/dist/tui/screens/TitleScreen.d.ts.map +1 -0
- package/dist/tui/screens/TitleScreen.js +253 -0
- package/dist/tui/screens/TitleScreen.js.map +1 -0
- package/dist/tui/screens/TownScreen.d.ts +98 -0
- package/dist/tui/screens/TownScreen.d.ts.map +1 -0
- package/dist/tui/screens/TownScreen.js +370 -0
- package/dist/tui/screens/TownScreen.js.map +1 -0
- package/dist/tui/screens/TravelScreen.d.ts +67 -0
- package/dist/tui/screens/TravelScreen.d.ts.map +1 -0
- package/dist/tui/screens/TravelScreen.js +286 -0
- package/dist/tui/screens/TravelScreen.js.map +1 -0
- package/dist/tui/screens/index.d.ts +8 -0
- package/dist/tui/screens/index.d.ts.map +1 -0
- package/dist/tui/screens/index.js +17 -0
- package/dist/tui/screens/index.js.map +1 -0
- package/dist/tui/sections/ActionsSection.d.ts +71 -0
- package/dist/tui/sections/ActionsSection.d.ts.map +1 -0
- package/dist/tui/sections/ActionsSection.js +184 -0
- package/dist/tui/sections/ActionsSection.js.map +1 -0
- package/dist/tui/sections/DungeonSection.d.ts +65 -0
- package/dist/tui/sections/DungeonSection.d.ts.map +1 -0
- package/dist/tui/sections/DungeonSection.js +144 -0
- package/dist/tui/sections/DungeonSection.js.map +1 -0
- package/dist/tui/sections/EventsSection.d.ts +50 -0
- package/dist/tui/sections/EventsSection.d.ts.map +1 -0
- package/dist/tui/sections/EventsSection.js +134 -0
- package/dist/tui/sections/EventsSection.js.map +1 -0
- package/dist/tui/sections/MapSection.d.ts +66 -0
- package/dist/tui/sections/MapSection.d.ts.map +1 -0
- package/dist/tui/sections/MapSection.js +669 -0
- package/dist/tui/sections/MapSection.js.map +1 -0
- package/dist/tui/sections/StatusSection.d.ts +47 -0
- package/dist/tui/sections/StatusSection.d.ts.map +1 -0
- package/dist/tui/sections/StatusSection.js +133 -0
- package/dist/tui/sections/StatusSection.js.map +1 -0
- package/dist/tui/sections/TeamSection.d.ts +71 -0
- package/dist/tui/sections/TeamSection.d.ts.map +1 -0
- package/dist/tui/sections/TeamSection.js +224 -0
- package/dist/tui/sections/TeamSection.js.map +1 -0
- package/dist/tui/sections/TravelingSection.d.ts +51 -0
- package/dist/tui/sections/TravelingSection.d.ts.map +1 -0
- package/dist/tui/sections/TravelingSection.js +106 -0
- package/dist/tui/sections/TravelingSection.js.map +1 -0
- package/dist/tui/sections/index.d.ts +9 -0
- package/dist/tui/sections/index.d.ts.map +1 -0
- package/dist/tui/sections/index.js +12 -0
- package/dist/tui/sections/index.js.map +1 -0
- package/dist/ui/Terminal.d.ts +68 -0
- package/dist/ui/Terminal.d.ts.map +1 -0
- package/dist/ui/Terminal.js +297 -0
- package/dist/ui/Terminal.js.map +1 -0
- package/dist/ui/index.d.ts +5 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +8 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/utils/configMigration.d.ts +14 -0
- package/dist/utils/configMigration.d.ts.map +1 -0
- package/dist/utils/configMigration.js +92 -0
- package/dist/utils/configMigration.js.map +1 -0
- package/dist/utils/errorHandler.d.ts +86 -0
- package/dist/utils/errorHandler.d.ts.map +1 -0
- package/dist/utils/errorHandler.js +224 -0
- package/dist/utils/errorHandler.js.map +1 -0
- package/dist/utils/logger.d.ts +14 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +43 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/weapon/WeaponFactory.d.ts +32 -0
- package/dist/weapon/WeaponFactory.d.ts.map +1 -0
- package/dist/weapon/WeaponFactory.js +216 -0
- package/dist/weapon/WeaponFactory.js.map +1 -0
- package/dist/weapon/index.d.ts +5 -0
- package/dist/weapon/index.d.ts.map +1 -0
- package/dist/weapon/index.js +8 -0
- package/dist/weapon/index.js.map +1 -0
- package/package.json +46 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TeamSection.js","sources":["tui/sections/TeamSection.ts"],"sourceRoot":"/","sourcesContent":["/**\r\n * Team Section - Displays team member status in the UI\r\n * Shows all active team members with their HP, MP, level, and role\r\n */\r\n\r\nimport { BaseSection, type BaseSectionConfig } from '../core/BaseSection.js';\r\nimport type { RenderContext } from '../core/Component.js';\r\nimport { ANSI } from '../Screen.js';\r\nimport type { Actor, Team, TeamFormation } from '../../core/types.js';\r\nimport { getActiveMembers, getReserveMembers, getFormationDisplayName } from '../../core/Team.js';\r\nimport { getActorRoleIcon, getActorStatusString } from '../../core/Actor.js';\r\n\r\n/**\r\n * Team section data\r\n */\r\nexport interface TeamSectionData {\r\n team: Team;\r\n actors: Record<string, Actor>;\r\n showReserve?: boolean;\r\n}\r\n\r\n/**\r\n * Callback type for actor selection\r\n */\r\nexport type ActorSelectedCallback = (actor: Actor) => void;\r\n\r\n/**\r\n * Team Section - Shows all team members and their status\r\n */\r\nexport class TeamSection extends BaseSection {\r\n private data: TeamSectionData | null = null;\r\n private showReserve: boolean = false;\r\n private onActorSelected: ActorSelectedCallback | null = null;\r\n\r\n constructor() {\r\n const config: BaseSectionConfig = {\r\n id: 'team',\r\n title: 'Team',\r\n canEnter: true,\r\n hints: {\r\n focused: '↑↓ Select | Enter View | F Formation',\r\n entered: 'Enter View Details | Esc Back',\r\n unfocused: '',\r\n },\r\n };\r\n super(config);\r\n }\r\n\r\n /**\r\n * Update section data\r\n */\r\n update(data: TeamSectionData): void {\r\n this.data = data;\r\n this.showReserve = data.showReserve ?? false;\r\n }\r\n\r\n /**\r\n * Render team content\r\n */\r\n protected renderContent(ctx: RenderContext): void {\r\n if (!this.data) return;\r\n\r\n const { screen, bounds } = ctx;\r\n const { team, actors } = this.data;\r\n const { x, y, width, height } = bounds;\r\n\r\n let lineY = y + 1;\r\n const maxContentHeight = height - 2;\r\n\r\n // Team name and formation\r\n const headerLine = `${team.name} | ${getFormationDisplayName(team.formation)}`;\r\n screen.write(x + 2, lineY, headerLine.slice(0, width - 4), ANSI.fg.cyan);\r\n lineY++;\r\n\r\n // Active members header\r\n const activeMembers = getActiveMembers(team, actors);\r\n screen.write(x + 2, lineY, `Active (${activeMembers.length}/4):`, ANSI.fg.white);\r\n lineY++;\r\n\r\n // Render active members\r\n activeMembers.forEach((actor, index) => {\r\n if (lineY >= y + maxContentHeight) return;\r\n\r\n const isSelected = this.state.entered && this.state.selectedIndex === index;\r\n const prefix = isSelected ? '▶ ' : ' ';\r\n const line = this.formatActorLine(actor, index, width - 6);\r\n\r\n const color = isSelected ? ANSI.fg.yellow : this.getActorColor(actor);\r\n screen.write(x + 2, lineY, prefix + line, color);\r\n lineY++;\r\n });\r\n\r\n // Show reserve if enabled\r\n if (this.showReserve) {\r\n const reserveMembers = getReserveMembers(team, actors);\r\n if (reserveMembers.length > 0 && lineY < y + maxContentHeight - 1) {\r\n lineY++;\r\n screen.write(x + 2, lineY, `Reserve (${reserveMembers.length}):`, ANSI.fg.gray);\r\n lineY++;\r\n\r\n reserveMembers.forEach((actor, index) => {\r\n if (lineY >= y + maxContentHeight) return;\r\n\r\n const isSelected = this.state.entered && this.state.selectedIndex === activeMembers.length + index;\r\n const prefix = isSelected ? '▶ ' : ' ';\r\n const line = this.formatActorLine(actor, -1, width - 6);\r\n\r\n const color = isSelected ? ANSI.fg.yellow : ANSI.fg.gray;\r\n screen.write(x + 2, lineY, prefix + line, color);\r\n lineY++;\r\n });\r\n }\r\n }\r\n\r\n // Show shared gold at bottom\r\n if (lineY < y + maxContentHeight) {\r\n lineY = y + maxContentHeight - 1;\r\n const goldLine = `Team Gold: ${team.sharedGold}`;\r\n screen.write(x + 2, lineY, goldLine, ANSI.fg.yellow);\r\n }\r\n }\r\n\r\n /**\r\n * Format a single actor line\r\n */\r\n private formatActorLine(actor: Actor, position: number, maxWidth: number): string {\r\n const roleIcon = getActorRoleIcon(actor.role);\r\n const hpPercent = Math.floor((actor.stats.hp / actor.stats.maxHp) * 100);\r\n const mpPercent = Math.floor((actor.stats.mp / actor.stats.maxMp) * 100);\r\n\r\n // Position indicator for active members\r\n const posStr = position >= 0 ? `[${position + 1}]` : '';\r\n\r\n // Status indicator\r\n const statusIcon = actor.status === 'active' ? '' :\r\n actor.status === 'reserve' ? '[R]' :\r\n actor.status === 'injured' ? '[!]' : '[X]';\r\n\r\n const line = `${posStr}${roleIcon} ${actor.name} Lv${actor.stats.level} HP:${hpPercent}% MP:${mpPercent}% ${statusIcon}`;\r\n return line.slice(0, maxWidth);\r\n }\r\n\r\n /**\r\n * Get color based on actor status\r\n */\r\n private getActorColor(actor: Actor): string {\r\n if (actor.status === 'dead') return ANSI.fg.red;\r\n if (actor.status === 'injured') return ANSI.fg.yellow;\r\n\r\n // Color based on HP\r\n const hpPercent = actor.stats.hp / actor.stats.maxHp;\r\n if (hpPercent > 0.7) return ANSI.fg.green;\r\n if (hpPercent > 0.3) return ANSI.fg.yellow;\r\n return ANSI.fg.red;\r\n }\r\n\r\n /**\r\n * Get total item count\r\n */\r\n getItemCount(): number {\r\n if (!this.data) return 0;\r\n const { team, actors } = this.data;\r\n const activeCount = getActiveMembers(team, actors).length;\r\n const reserveCount = this.showReserve ? getReserveMembers(team, actors).length : 0;\r\n return activeCount + reserveCount;\r\n }\r\n\r\n /**\r\n * Handle key input when entered\r\n */\r\n handleKeyInput(key: { name: string }): boolean {\r\n if (!this.data) return false;\r\n\r\n const itemCount = this.getItemCount();\r\n\r\n switch (key.name) {\r\n case 'up':\r\n if (this.state.selectedIndex > 0) {\r\n this.state.selectedIndex--;\r\n return true;\r\n }\r\n break;\r\n\r\n case 'down':\r\n if (this.state.selectedIndex < itemCount - 1) {\r\n this.state.selectedIndex++;\r\n return true;\r\n }\r\n break;\r\n\r\n case 'r':\r\n // Toggle reserve display\r\n this.showReserve = !this.showReserve;\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Activate selected item (view details)\r\n */\r\n activateItem(): boolean {\r\n if (!this.data || this.state.selectedIndex < 0) return false;\r\n\r\n const { team, actors } = this.data;\r\n const activeMembers = getActiveMembers(team, actors);\r\n const reserveMembers = this.showReserve ? getReserveMembers(team, actors) : [];\r\n const allMembers = [...activeMembers, ...reserveMembers];\r\n\r\n if (this.state.selectedIndex >= allMembers.length) return false;\r\n\r\n const selectedActor = allMembers[this.state.selectedIndex];\r\n // Notify via callback for viewing actor details\r\n this.onActorSelected?.(selectedActor);\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Get the selected actor\r\n */\r\n getSelectedActor(): Actor | null {\r\n if (!this.data || this.state.selectedIndex < 0) return null;\r\n\r\n const { team, actors } = this.data;\r\n const activeMembers = getActiveMembers(team, actors);\r\n const reserveMembers = this.showReserve ? getReserveMembers(team, actors) : [];\r\n const allMembers = [...activeMembers, ...reserveMembers];\r\n\r\n return allMembers[this.state.selectedIndex] ?? null;\r\n }\r\n\r\n /**\r\n * Reset selection\r\n */\r\n resetSelection(): void {\r\n this.state.selectedIndex = 0;\r\n }\r\n}\r\n\r\n/**\r\n * Create a compact team status display for status bars\r\n */\r\nexport function renderCompactTeamStatus(\r\n team: Team,\r\n actors: Record<string, Actor>,\r\n width: number\r\n): string[] {\r\n const lines: string[] = [];\r\n const activeMembers = getActiveMembers(team, actors);\r\n\r\n activeMembers.forEach((actor, index) => {\r\n const roleIcon = getActorRoleIcon(actor.role);\r\n const hpPercent = Math.floor((actor.stats.hp / actor.stats.maxHp) * 100);\r\n const hpBar = createHpBar(actor.stats.hp / actor.stats.maxHp, 8);\r\n\r\n const line = `${index + 1}${roleIcon}${actor.name.slice(0, 6)} ${hpBar} ${hpPercent}%`;\r\n lines.push(line.slice(0, width));\r\n });\r\n\r\n return lines;\r\n}\r\n\r\n/**\r\n * Create a simple HP bar\r\n */\r\nfunction createHpBar(percent: number, width: number): string {\r\n const filled = Math.floor(percent * width);\r\n const empty = width - filled;\r\n return '[' + '█'.repeat(filled) + '░'.repeat(empty) + ']';\r\n}\r\n"],"names":[],"mappings":"AAAA;;;GAGG;;;AAEH,OAAO,EAAE,WAAW,EAA0B,MAAM,wBAAwB,CAAC;AAE7E,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEpC,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAClG,OAAO,EAAE,gBAAgB,EAAwB,MAAM,qBAAqB,CAAC;AAgB7E;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,WAAW;IAClC,IAAI,GAA2B,IAAI,CAAC;IACpC,WAAW,GAAY,KAAK,CAAC;IAC7B,eAAe,GAAiC,IAAI,CAAC;IAE7D;QACE,MAAM,MAAM,GAAsB;YAChC,EAAE,EAAE,MAAM;YACV,KAAK,EAAE,MAAM;YACb,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE;gBACL,OAAO,EAAE,sCAAsC;gBAC/C,OAAO,EAAE,+BAA+B;gBACxC,SAAS,EAAE,EAAE;aACd;SACF,CAAC;QACF,KAAK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CAAC,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,CAAC;IAC3C,MAAM,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;IAC7B,OAAO,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,GAAG,CAAC;AAC5D,CAAC","debug_id":"9a9c7e96-1d70-5f08-b96a-e5ecbe47d7c1"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Traveling Section - Shows travel status during travel phase
|
|
3
|
+
* Replaces ActionsSection when player is traveling
|
|
4
|
+
*/
|
|
5
|
+
import { BaseSection } from '../core/BaseSection.js';
|
|
6
|
+
import type { RenderContext } from '../core/Component.js';
|
|
7
|
+
import type { KeyEvent } from '../Input.js';
|
|
8
|
+
/**
|
|
9
|
+
* Travel data for display
|
|
10
|
+
*/
|
|
11
|
+
export interface TravelingData {
|
|
12
|
+
fromName: string;
|
|
13
|
+
toName: string;
|
|
14
|
+
progress: number;
|
|
15
|
+
duration: number;
|
|
16
|
+
events: string[];
|
|
17
|
+
phase: 'traveling_to_dungeon' | 'returning_to_town';
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Traveling Section - Shows travel progress
|
|
21
|
+
*/
|
|
22
|
+
export declare class TravelingSection extends BaseSection {
|
|
23
|
+
private data;
|
|
24
|
+
private onCancelTravel?;
|
|
25
|
+
constructor();
|
|
26
|
+
/**
|
|
27
|
+
* Set callback for cancel travel
|
|
28
|
+
*/
|
|
29
|
+
setOnCancelTravel(callback: () => void): void;
|
|
30
|
+
/**
|
|
31
|
+
* Update travel data
|
|
32
|
+
*/
|
|
33
|
+
update(data: TravelingData): void;
|
|
34
|
+
/**
|
|
35
|
+
* Render travel content
|
|
36
|
+
*/
|
|
37
|
+
protected renderContent(ctx: RenderContext): void;
|
|
38
|
+
/**
|
|
39
|
+
* Get item count (none, this section has no selectable items)
|
|
40
|
+
*/
|
|
41
|
+
getItemCount(): number;
|
|
42
|
+
/**
|
|
43
|
+
* Activate item (no-op)
|
|
44
|
+
*/
|
|
45
|
+
activateItem(): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Handle custom keys - 'q' to cancel travel
|
|
48
|
+
*/
|
|
49
|
+
protected handleCustomKey(key: KeyEvent): boolean;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=TravelingSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TravelingSection.d.ts","sourceRoot":"/","sources":["tui/sections/TravelingSection.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAA0B,MAAM,wBAAwB,CAAC;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAG5C;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,sBAAsB,GAAG,mBAAmB,CAAC;CACrD;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAC/C,OAAO,CAAC,IAAI,CAA8B;IAC1C,OAAO,CAAC,cAAc,CAAC,CAAa;;IAgBpC;;OAEG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAI7C;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,aAAa,GAAG,IAAI;IAIjC;;OAEG;IACH,SAAS,CAAC,aAAa,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI;IA8CjD;;OAEG;IACH,YAAY,IAAI,MAAM;IAItB;;OAEG;IACH,YAAY,IAAI,OAAO;IAIvB;;OAEG;IACH,SAAS,CAAC,eAAe,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO;CAOlD"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Traveling Section - Shows travel status during travel phase
|
|
3
|
+
* Replaces ActionsSection when player is traveling
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="7a45580a-92eb-56f6-9a24-7cbeca5daef8")}catch(e){}}();
|
|
7
|
+
import { BaseSection } from '../core/BaseSection.js';
|
|
8
|
+
import { ANSI } from '../Screen.js';
|
|
9
|
+
/**
|
|
10
|
+
* Traveling Section - Shows travel progress
|
|
11
|
+
*/
|
|
12
|
+
export class TravelingSection extends BaseSection {
|
|
13
|
+
data = null;
|
|
14
|
+
onCancelTravel;
|
|
15
|
+
constructor() {
|
|
16
|
+
const config = {
|
|
17
|
+
id: 'traveling',
|
|
18
|
+
title: 'Traveling',
|
|
19
|
+
canEnter: true, // Allow entering to cancel
|
|
20
|
+
hints: {
|
|
21
|
+
focused: 'Enter: enter section',
|
|
22
|
+
entered: '[Q] Cancel travel [Esc] Exit section',
|
|
23
|
+
unfocused: '',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
super(config);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Set callback for cancel travel
|
|
30
|
+
*/
|
|
31
|
+
setOnCancelTravel(callback) {
|
|
32
|
+
this.onCancelTravel = callback;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Update travel data
|
|
36
|
+
*/
|
|
37
|
+
update(data) {
|
|
38
|
+
this.data = data;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Render travel content
|
|
42
|
+
*/
|
|
43
|
+
renderContent(ctx) {
|
|
44
|
+
if (!this.data)
|
|
45
|
+
return;
|
|
46
|
+
const { screen, bounds } = ctx;
|
|
47
|
+
const { x, y, width, height } = bounds;
|
|
48
|
+
let lineY = y + 2;
|
|
49
|
+
// Title based on phase
|
|
50
|
+
const title = this.data.phase === 'traveling_to_dungeon'
|
|
51
|
+
? '-> Traveling to Dungeon'
|
|
52
|
+
: '<- Returning to Town';
|
|
53
|
+
screen.write(x + 2, lineY++, title, ANSI.fg.cyan, undefined, ANSI.bold);
|
|
54
|
+
lineY++;
|
|
55
|
+
// From / To
|
|
56
|
+
screen.write(x + 2, lineY++, `From: ${this.data.fromName}`, ANSI.fg.gray);
|
|
57
|
+
screen.write(x + 2, lineY++, `To: ${this.data.toName}`, ANSI.fg.yellow);
|
|
58
|
+
lineY++;
|
|
59
|
+
// Progress bar
|
|
60
|
+
const barWidth = Math.min(width - 6, 20);
|
|
61
|
+
screen.drawProgressBar(x + 2, lineY++, barWidth, this.data.progress, 1, ANSI.fg.cyan);
|
|
62
|
+
// Percentage
|
|
63
|
+
const pct = Math.floor(this.data.progress * 100);
|
|
64
|
+
screen.write(x + 2, lineY++, `${pct}% complete`, ANSI.fg.cyan);
|
|
65
|
+
lineY++;
|
|
66
|
+
// Time remaining
|
|
67
|
+
const remaining = Math.ceil(this.data.duration * (1 - this.data.progress));
|
|
68
|
+
screen.write(x + 2, lineY++, `${remaining}s remaining`, ANSI.fg.gray);
|
|
69
|
+
lineY++;
|
|
70
|
+
// Events
|
|
71
|
+
if (this.data.events.length > 0) {
|
|
72
|
+
screen.write(x + 2, lineY++, '--- Events ---', ANSI.fg.cyan);
|
|
73
|
+
const maxEvents = Math.min(3, height - lineY + y - 3);
|
|
74
|
+
for (const ev of this.data.events.slice(-maxEvents)) {
|
|
75
|
+
if (lineY >= y + height - 2)
|
|
76
|
+
break;
|
|
77
|
+
const eventText = `* ${ev}`.slice(0, width - 4);
|
|
78
|
+
screen.write(x + 2, lineY++, eventText, ANSI.fg.white);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Get item count (none, this section has no selectable items)
|
|
84
|
+
*/
|
|
85
|
+
getItemCount() {
|
|
86
|
+
return 0;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Activate item (no-op)
|
|
90
|
+
*/
|
|
91
|
+
activateItem() {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Handle custom keys - 'q' to cancel travel
|
|
96
|
+
*/
|
|
97
|
+
handleCustomKey(key) {
|
|
98
|
+
if (this.state.entered && key.raw?.toLowerCase() === 'q') {
|
|
99
|
+
this.onCancelTravel?.();
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=TravelingSection.js.map
|
|
106
|
+
//# debugId=7a45580a-92eb-56f6-9a24-7cbeca5daef8
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TravelingSection.js","sources":["tui/sections/TravelingSection.ts"],"sourceRoot":"/","sourcesContent":["/**\r\n * Traveling Section - Shows travel status during travel phase\r\n * Replaces ActionsSection when player is traveling\r\n */\r\n\r\nimport { BaseSection, type BaseSectionConfig } from '../core/BaseSection.js';\r\nimport type { RenderContext } from '../core/Component.js';\r\nimport type { KeyEvent } from '../Input.js';\r\nimport { ANSI } from '../Screen.js';\r\n\r\n/**\r\n * Travel data for display\r\n */\r\nexport interface TravelingData {\r\n fromName: string;\r\n toName: string;\r\n progress: number; // 0-1\r\n duration: number; // seconds\r\n events: string[];\r\n phase: 'traveling_to_dungeon' | 'returning_to_town';\r\n}\r\n\r\n/**\r\n * Traveling Section - Shows travel progress\r\n */\r\nexport class TravelingSection extends BaseSection {\r\n private data: TravelingData | null = null;\r\n private onCancelTravel?: () => void;\r\n\r\n constructor() {\r\n const config: BaseSectionConfig = {\r\n id: 'traveling',\r\n title: 'Traveling',\r\n canEnter: true, // Allow entering to cancel\r\n hints: {\r\n focused: 'Enter: enter section',\r\n entered: '[Q] Cancel travel [Esc] Exit section',\r\n unfocused: '',\r\n },\r\n };\r\n super(config);\r\n }\r\n\r\n /**\r\n * Set callback for cancel travel\r\n */\r\n setOnCancelTravel(callback: () => void): void {\r\n this.onCancelTravel = callback;\r\n }\r\n\r\n /**\r\n * Update travel data\r\n */\r\n update(data: TravelingData): void {\r\n this.data = data;\r\n }\r\n\r\n /**\r\n * Render travel content\r\n */\r\n protected renderContent(ctx: RenderContext): void {\r\n if (!this.data) return;\r\n\r\n const { screen, bounds } = ctx;\r\n const { x, y, width, height } = bounds;\r\n\r\n let lineY = y + 2;\r\n\r\n // Title based on phase\r\n const title = this.data.phase === 'traveling_to_dungeon'\r\n ? '-> Traveling to Dungeon'\r\n : '<- Returning to Town';\r\n screen.write(x + 2, lineY++, title, ANSI.fg.cyan, undefined, ANSI.bold);\r\n lineY++;\r\n\r\n // From / To\r\n screen.write(x + 2, lineY++, `From: ${this.data.fromName}`, ANSI.fg.gray);\r\n screen.write(x + 2, lineY++, `To: ${this.data.toName}`, ANSI.fg.yellow);\r\n lineY++;\r\n\r\n // Progress bar\r\n const barWidth = Math.min(width - 6, 20);\r\n screen.drawProgressBar(x + 2, lineY++, barWidth, this.data.progress, 1, ANSI.fg.cyan);\r\n\r\n // Percentage\r\n const pct = Math.floor(this.data.progress * 100);\r\n screen.write(x + 2, lineY++, `${pct}% complete`, ANSI.fg.cyan);\r\n lineY++;\r\n\r\n // Time remaining\r\n const remaining = Math.ceil(this.data.duration * (1 - this.data.progress));\r\n screen.write(x + 2, lineY++, `${remaining}s remaining`, ANSI.fg.gray);\r\n lineY++;\r\n\r\n // Events\r\n if (this.data.events.length > 0) {\r\n screen.write(x + 2, lineY++, '--- Events ---', ANSI.fg.cyan);\r\n const maxEvents = Math.min(3, height - lineY + y - 3);\r\n for (const ev of this.data.events.slice(-maxEvents)) {\r\n if (lineY >= y + height - 2) break;\r\n const eventText = `* ${ev}`.slice(0, width - 4);\r\n screen.write(x + 2, lineY++, eventText, ANSI.fg.white);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Get item count (none, this section has no selectable items)\r\n */\r\n getItemCount(): number {\r\n return 0;\r\n }\r\n\r\n /**\r\n * Activate item (no-op)\r\n */\r\n activateItem(): boolean {\r\n return false;\r\n }\r\n\r\n /**\r\n * Handle custom keys - 'q' to cancel travel\r\n */\r\n protected handleCustomKey(key: KeyEvent): boolean {\r\n if (this.state.entered && key.raw?.toLowerCase() === 'q') {\r\n this.onCancelTravel?.();\r\n return true;\r\n }\r\n return false;\r\n }\r\n}\r\n"],"names":[],"mappings":"AAAA;;;GAGG;;;AAEH,OAAO,EAAE,WAAW,EAA0B,MAAM,wBAAwB,CAAC;AAG7E,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAcpC;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IACvC,IAAI,GAAyB,IAAI,CAAC;IAClC,cAAc,CAAc;IAEpC;QACE,MAAM,MAAM,GAAsB;YAChC,EAAE,EAAE,WAAW;YACf,KAAK,EAAE,WAAW;YAClB,QAAQ,EAAE,IAAI,EAAG,2BAA2B;YAC5C,KAAK,EAAE;gBACL,OAAO,EAAE,sBAAsB;gBAC/B,OAAO,EAAE,uCAAuC;gBAChD,SAAS,EAAE,EAAE;aACd;SACF,CAAC;QACF,KAAK,CAAC,MAAM,CAAC,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,iBAAiB,CAAC,QAAoB;QACpC,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC;IACjC,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,IAAmB;QACxB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED;;OAEG;IACO,aAAa,CAAC,GAAkB;QACxC,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,OAAO;QAEvB,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,GA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;YACzD,CAAC;QACH,CAAC;IACH,CAAC;IAED;;OAEG;IACH,YAAY;QACV,OAAO,CAAC,CAAC;IACX,CAAC;IAED;;OAEG;IACH,YAAY;QACV,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACO,eAAe,CAAC,GAAa;QACrC,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,GAAG,CAAC,GAAG,EAAE,WAAW,EAAE,KAAK,GAAG,EAAE,CAAC;YACzD,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;YACxB,OAAO,IAAI,CAAC;QACd,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF","debug_id":"7a45580a-92eb-56f6-9a24-7cbeca5daef8"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"/","sources":["tui/sections/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TUI Sections Module
|
|
3
|
+
* Exports all section implementations
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="8e2d60e6-af1e-5486-b7f9-d6e14ce459ec")}catch(e){}}();
|
|
7
|
+
export * from './StatusSection.js';
|
|
8
|
+
export * from './EventsSection.js';
|
|
9
|
+
export * from './ActionsSection.js';
|
|
10
|
+
export * from './MapSection.js';
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
12
|
+
//# debugId=8e2d60e6-af1e-5486-b7f9-d6e14ce459ec
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["tui/sections/index.ts"],"sourceRoot":"/","sourcesContent":["/**\r\n * TUI Sections Module\r\n * Exports all section implementations\r\n */\r\n\r\nexport * from './StatusSection.js';\r\nexport * from './EventsSection.js';\r\nexport * from './ActionsSection.js';\r\nexport * from './MapSection.js';\r\n"],"names":[],"mappings":"AAAA;;;GAGG;;;AAEH,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC","debug_id":"8e2d60e6-af1e-5486-b7f9-d6e14ce459ec"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Terminal UI rendering utilities
|
|
3
|
+
*/
|
|
4
|
+
import type { GameState, Player, CombatState } from '../core/types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Apply color to text
|
|
7
|
+
*/
|
|
8
|
+
export declare function color(text: string, ...codes: string[]): string;
|
|
9
|
+
/**
|
|
10
|
+
* Clear the terminal screen
|
|
11
|
+
*/
|
|
12
|
+
export declare function clearScreen(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Move cursor to position
|
|
15
|
+
*/
|
|
16
|
+
export declare function moveCursor(row: number, col: number): void;
|
|
17
|
+
/**
|
|
18
|
+
* Hide cursor
|
|
19
|
+
*/
|
|
20
|
+
export declare function hideCursor(): void;
|
|
21
|
+
/**
|
|
22
|
+
* Show cursor
|
|
23
|
+
*/
|
|
24
|
+
export declare function showCursor(): void;
|
|
25
|
+
/**
|
|
26
|
+
* Draw a box with content
|
|
27
|
+
*/
|
|
28
|
+
export declare function drawBox(title: string, content: string[], width?: number): string[];
|
|
29
|
+
/**
|
|
30
|
+
* Draw a progress bar
|
|
31
|
+
*/
|
|
32
|
+
export declare function progressBar(current: number, max: number, width?: number, filled?: string, empty?: string): string;
|
|
33
|
+
/**
|
|
34
|
+
* Format time in mm:ss
|
|
35
|
+
*/
|
|
36
|
+
export declare function formatTime(seconds: number): string;
|
|
37
|
+
/**
|
|
38
|
+
* Render the main game UI
|
|
39
|
+
*/
|
|
40
|
+
export declare function renderMainUI(state: GameState): string[];
|
|
41
|
+
/**
|
|
42
|
+
* Render mini map
|
|
43
|
+
*/
|
|
44
|
+
export declare function renderMiniMap(state: GameState): string[];
|
|
45
|
+
/**
|
|
46
|
+
* Render status panel
|
|
47
|
+
*/
|
|
48
|
+
export declare function renderStatus(state: GameState): string[];
|
|
49
|
+
/**
|
|
50
|
+
* Render event log
|
|
51
|
+
*/
|
|
52
|
+
export declare function renderEventLog(state: GameState): string[];
|
|
53
|
+
/**
|
|
54
|
+
* Render combat UI
|
|
55
|
+
*/
|
|
56
|
+
export declare function renderCombatUI(combat: CombatState, player: Player): string[];
|
|
57
|
+
/**
|
|
58
|
+
* Render NPC dialog UI
|
|
59
|
+
*/
|
|
60
|
+
export declare function renderDialogUI(npcName: string, history: Array<{
|
|
61
|
+
role: string;
|
|
62
|
+
content: string;
|
|
63
|
+
}>, isStreaming: boolean): string[];
|
|
64
|
+
/**
|
|
65
|
+
* Print lines to terminal
|
|
66
|
+
*/
|
|
67
|
+
export declare function render(lines: string[]): void;
|
|
68
|
+
//# sourceMappingURL=Terminal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Terminal.d.ts","sourceRoot":"/","sources":["ui/Terminal.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,EAAQ,WAAW,EAAE,MAAM,kBAAkB,CAAC;AA6B7E;;GAEG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAE9D;AAED;;GAEG;AACH,wBAAgB,WAAW,IAAI,IAAI,CAElC;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAEzD;AAED;;GAEG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
|
2
|
+
* Terminal UI rendering utilities
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="db6c6406-9f88-5f5d-a139-9a49d9ec32ba")}catch(e){}}();
|
|
6
|
+
import { getStrings } from '../i18n/index.js';
|
|
7
|
+
// ANSI color codes
|
|
8
|
+
const COLORS = {
|
|
9
|
+
reset: '\x1b[0m',
|
|
10
|
+
bold: '\x1b[1m',
|
|
11
|
+
dim: '\x1b[2m',
|
|
12
|
+
// Foreground
|
|
13
|
+
black: '\x1b[30m',
|
|
14
|
+
red: '\x1b[31m',
|
|
15
|
+
green: '\x1b[32m',
|
|
16
|
+
yellow: '\x1b[33m',
|
|
17
|
+
blue: '\x1b[34m',
|
|
18
|
+
magenta: '\x1b[35m',
|
|
19
|
+
cyan: '\x1b[36m',
|
|
20
|
+
white: '\x1b[37m',
|
|
21
|
+
// Background
|
|
22
|
+
bgBlack: '\x1b[40m',
|
|
23
|
+
bgRed: '\x1b[41m',
|
|
24
|
+
bgGreen: '\x1b[42m',
|
|
25
|
+
bgYellow: '\x1b[43m',
|
|
26
|
+
bgBlue: '\x1b[44m',
|
|
27
|
+
bgMagenta: '\x1b[45m',
|
|
28
|
+
bgCyan: '\x1b[46m',
|
|
29
|
+
bgWhite: '\x1b[47m',
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Apply color to text
|
|
33
|
+
*/
|
|
34
|
+
export function color(text, ...codes) {
|
|
35
|
+
return codes.join('') + text + COLORS.reset;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Clear the terminal screen
|
|
39
|
+
*/
|
|
40
|
+
export function clearScreen() {
|
|
41
|
+
process.stdout.write('\x1Bc');
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Move cursor to position
|
|
45
|
+
*/
|
|
46
|
+
export function moveCursor(row, col) {
|
|
47
|
+
process.stdout.write(`\x1b[${row};${col}H`);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Hide cursor
|
|
51
|
+
*/
|
|
52
|
+
export function hideCursor() {
|
|
53
|
+
process.stdout.write('\x1b[?25l');
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Show cursor
|
|
57
|
+
*/
|
|
58
|
+
export function showCursor() {
|
|
59
|
+
process.stdout.write('\x1b[?25h');
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Draw a box with content
|
|
63
|
+
*/
|
|
64
|
+
export function drawBox(title, content, width = 40) {
|
|
65
|
+
const lines = [];
|
|
66
|
+
const innerWidth = width - 4;
|
|
67
|
+
// Top border with title
|
|
68
|
+
const titleStr = title ? `─ ${title} ` : '';
|
|
69
|
+
lines.push('┌' + titleStr + '─'.repeat(width - 2 - titleStr.length) + '┐');
|
|
70
|
+
// Content
|
|
71
|
+
for (const line of content) {
|
|
72
|
+
const trimmed = line.slice(0, innerWidth);
|
|
73
|
+
lines.push('│ ' + trimmed.padEnd(innerWidth) + ' │');
|
|
74
|
+
}
|
|
75
|
+
// Bottom border
|
|
76
|
+
lines.push('└' + '─'.repeat(width - 2) + '┘');
|
|
77
|
+
return lines;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Draw a progress bar
|
|
81
|
+
*/
|
|
82
|
+
export function progressBar(current, max, width = 20, filled = '█', empty = '░') {
|
|
83
|
+
const ratio = Math.max(0, Math.min(1, current / max));
|
|
84
|
+
const filledCount = Math.floor(ratio * width);
|
|
85
|
+
const emptyCount = width - filledCount;
|
|
86
|
+
return filled.repeat(filledCount) + empty.repeat(emptyCount);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Format time in mm:ss
|
|
90
|
+
*/
|
|
91
|
+
export function formatTime(seconds) {
|
|
92
|
+
const mins = Math.floor(seconds / 60);
|
|
93
|
+
const secs = Math.floor(seconds % 60);
|
|
94
|
+
return `${mins.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Render the main game UI
|
|
98
|
+
*/
|
|
99
|
+
export function renderMainUI(state) {
|
|
100
|
+
const lines = [];
|
|
101
|
+
const s = getStrings();
|
|
102
|
+
const width = 70;
|
|
103
|
+
// Header
|
|
104
|
+
lines.push('╔' + '═'.repeat(width - 2) + '╗');
|
|
105
|
+
lines.push('║ ' + color(s.game.title, COLORS.bold, COLORS.cyan) +
|
|
106
|
+
' │ ' + `${s.status.level}.${state.player.stats.level} ${state.player.name}` +
|
|
107
|
+
' │ ' + `${s.status.hp}:${state.player.stats.hp}/${state.player.stats.maxHp}` +
|
|
108
|
+
' │ ⏰ ' + new Date().toLocaleTimeString().padEnd(width - 60) + '║');
|
|
109
|
+
lines.push('╠' + '═'.repeat(width - 2) + '╣');
|
|
110
|
+
// Map section (left) and Status section (right)
|
|
111
|
+
const mapLines = renderMiniMap(state);
|
|
112
|
+
const statusLines = renderStatus(state);
|
|
113
|
+
lines.push('║' + ' '.repeat(width - 2) + '║');
|
|
114
|
+
const maxLines = Math.max(mapLines.length, statusLines.length);
|
|
115
|
+
for (let i = 0; i < maxLines; i++) {
|
|
116
|
+
const mapPart = (mapLines[i] || '').padEnd(35);
|
|
117
|
+
const statusPart = (statusLines[i] || '').padEnd(30);
|
|
118
|
+
lines.push('║ ' + mapPart + ' ' + statusPart + ' ║');
|
|
119
|
+
}
|
|
120
|
+
lines.push('║' + ' '.repeat(width - 2) + '║');
|
|
121
|
+
// Event log
|
|
122
|
+
lines.push('║ ┌─── Event Log ' + '─'.repeat(width - 21) + '┐ ║');
|
|
123
|
+
const eventLines = renderEventLog(state);
|
|
124
|
+
for (const event of eventLines.slice(-5)) {
|
|
125
|
+
lines.push('║ │ ' + event.padEnd(width - 8) + ' │ ║');
|
|
126
|
+
}
|
|
127
|
+
lines.push('║ └' + '─'.repeat(width - 6) + '┘ ║');
|
|
128
|
+
lines.push('║' + ' '.repeat(width - 2) + '║');
|
|
129
|
+
// Controls
|
|
130
|
+
const controls = '[M]ap [I]nventory [C]haracter [Q]uests [W]orkshop [N]PC [H]elp';
|
|
131
|
+
lines.push('║ ' + controls.padEnd(width - 4) + '║');
|
|
132
|
+
lines.push('╚' + '═'.repeat(width - 2) + '╝');
|
|
133
|
+
return lines;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Render mini map
|
|
137
|
+
*/
|
|
138
|
+
export function renderMiniMap(state) {
|
|
139
|
+
const lines = [];
|
|
140
|
+
const s = getStrings();
|
|
141
|
+
lines.push('┌─── ' + s.ui.map + ' ───────────────────┐');
|
|
142
|
+
lines.push('│ │');
|
|
143
|
+
lines.push('│ [?]━━━[T]━━━[?] │');
|
|
144
|
+
lines.push('│ │ │ │');
|
|
145
|
+
// Current room indicator
|
|
146
|
+
const currentSymbol = state.currentRoom.type === 'town' ? '[T]' : '[@]';
|
|
147
|
+
lines.push('│ [D]━━━' + currentSymbol + '━━━[!] │');
|
|
148
|
+
lines.push('│ │ ↑ │ │');
|
|
149
|
+
lines.push('│ [S]━━━[·]━━━[B] │');
|
|
150
|
+
lines.push('│ │');
|
|
151
|
+
lines.push('│ [@]' + s.map.player + ' [T]' + s.map.town + ' [D]' + s.map.dungeon + ' │');
|
|
152
|
+
lines.push('│ [S]' + s.map.shop + ' [B]' + s.map.boss + ' [?]' + s.map.unexplored + ' │');
|
|
153
|
+
lines.push('└────────────────────────────────┘');
|
|
154
|
+
return lines;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Render status panel
|
|
158
|
+
*/
|
|
159
|
+
export function renderStatus(state) {
|
|
160
|
+
const lines = [];
|
|
161
|
+
const p = state.player;
|
|
162
|
+
const s = getStrings();
|
|
163
|
+
lines.push('┌─── Status ────────────┐');
|
|
164
|
+
lines.push('│ │');
|
|
165
|
+
lines.push('│ ' + s.status.location + ': ' + state.currentRoom.name.slice(0, 14).padEnd(14) + ' │');
|
|
166
|
+
if (state.player.activeQuests.length > 0) {
|
|
167
|
+
const quest = state.player.activeQuests[0];
|
|
168
|
+
lines.push('│ ' + s.status.quest + ': ' + quest.name.slice(0, 14).padEnd(14) + ' │');
|
|
169
|
+
lines.push('│ ' + s.status.progress + ': ' + progressBar(50, 100, 12) + ' │');
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
lines.push('│ ' + s.status.quest + ': None'.padEnd(20) + ' │');
|
|
173
|
+
lines.push('│ │');
|
|
174
|
+
}
|
|
175
|
+
lines.push('│ │');
|
|
176
|
+
lines.push('│ ' + s.status.equipment + ': │');
|
|
177
|
+
if (p.equipment.weapon) {
|
|
178
|
+
lines.push('│ ' + p.equipment.weapon.name.slice(0, 18).padEnd(18) + ' │');
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
lines.push('│ (none)'.padEnd(24) + ' │');
|
|
182
|
+
}
|
|
183
|
+
lines.push('│ │');
|
|
184
|
+
lines.push('│ ' + s.status.gold + ': ' + p.stats.gold.toString().padEnd(16) + ' │');
|
|
185
|
+
lines.push('└────────────────────────┘');
|
|
186
|
+
return lines;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Render event log
|
|
190
|
+
*/
|
|
191
|
+
export function renderEventLog(state) {
|
|
192
|
+
const logs = [];
|
|
193
|
+
const time = new Date().toLocaleTimeString().slice(0, 5);
|
|
194
|
+
// Always show current location
|
|
195
|
+
logs.push(`[${time}] Location: ${state.currentRoom.name}`);
|
|
196
|
+
// Show pending events
|
|
197
|
+
for (const event of state.pendingEvents.slice(-4)) {
|
|
198
|
+
const eventTime = new Date(event.timestamp).toLocaleTimeString().slice(0, 5);
|
|
199
|
+
logs.push(`[${eventTime}] ${event.title}: ${event.description.slice(0, 40)}...`);
|
|
200
|
+
}
|
|
201
|
+
// Show phase-specific info
|
|
202
|
+
if (state.phase === 'traveling' && state.travelState) {
|
|
203
|
+
const progress = Math.floor(state.travelState.progress * 100);
|
|
204
|
+
logs.push(`[${time}] Traveling... ${progress}% complete`);
|
|
205
|
+
}
|
|
206
|
+
if (state.phase === 'combat' && state.combat) {
|
|
207
|
+
const enemyInfo = state.combat.enemies
|
|
208
|
+
.filter(e => e.hp > 0)
|
|
209
|
+
.map(e => `${e.name}(${e.hp}HP)`)
|
|
210
|
+
.join(', ');
|
|
211
|
+
logs.push(`[${time}] Fighting: ${enemyInfo}`);
|
|
212
|
+
}
|
|
213
|
+
// Show active quest progress
|
|
214
|
+
if (state.player.activeQuests.length > 0) {
|
|
215
|
+
const quest = state.player.activeQuests[0];
|
|
216
|
+
const completed = quest.objectives.filter(o => o.isComplete).length;
|
|
217
|
+
const total = quest.objectives.length;
|
|
218
|
+
logs.push(`[${time}] Quest "${quest.name}": ${completed}/${total} objectives`);
|
|
219
|
+
}
|
|
220
|
+
// Fill remaining slots with room description if needed
|
|
221
|
+
if (logs.length < 3) {
|
|
222
|
+
logs.push(`[${time}] ${state.currentRoom.description}`);
|
|
223
|
+
}
|
|
224
|
+
return logs.slice(0, 5);
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Render combat UI
|
|
228
|
+
*/
|
|
229
|
+
export function renderCombatUI(combat, player) {
|
|
230
|
+
const lines = [];
|
|
231
|
+
const s = getStrings();
|
|
232
|
+
const width = 60;
|
|
233
|
+
lines.push('┌─ Combat ' + '─'.repeat(width - 11) + '┐');
|
|
234
|
+
lines.push('│' + ' '.repeat(width - 2) + '│');
|
|
235
|
+
// Player HP bar
|
|
236
|
+
const playerHpBar = progressBar(combat.playerHp, player.stats.maxHp, 20);
|
|
237
|
+
lines.push(`│ [${player.name}] HP: ${playerHpBar} ${combat.playerHp}/${player.stats.maxHp}`.padEnd(width - 1) + '│');
|
|
238
|
+
lines.push('│' + ' '.repeat(width - 2) + '│');
|
|
239
|
+
// Enemy HP bars
|
|
240
|
+
for (const enemy of combat.enemies) {
|
|
241
|
+
const enemyHpBar = progressBar(enemy.hp, enemy.maxHp, 15);
|
|
242
|
+
const status = enemy.hp <= 0 ? color('DEFEATED', COLORS.dim) : '';
|
|
243
|
+
lines.push(`│ vs [${enemy.name}] HP: ${enemyHpBar} ${enemy.hp}/${enemy.maxHp} ${status}`.padEnd(width - 1) + '│');
|
|
244
|
+
}
|
|
245
|
+
lines.push('│' + ' '.repeat(width - 2) + '│');
|
|
246
|
+
// Combat log
|
|
247
|
+
lines.push('│ ─── Battle Log ───'.padEnd(width - 1) + '│');
|
|
248
|
+
for (const entry of combat.log.slice(-5)) {
|
|
249
|
+
lines.push('│ > ' + entry.message.slice(0, width - 8).padEnd(width - 6) + '│');
|
|
250
|
+
}
|
|
251
|
+
lines.push('│' + ' '.repeat(width - 2) + '│');
|
|
252
|
+
// Strategy options
|
|
253
|
+
lines.push('│ Strategy: [1]Aggressive [2]Defensive [3]Balanced [4]Skills'.padEnd(width - 1) + '│');
|
|
254
|
+
lines.push('│ Current: ' + combat.strategy.padEnd(width - 13) + '│');
|
|
255
|
+
lines.push('└' + '─'.repeat(width - 2) + '┘');
|
|
256
|
+
return lines;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Render NPC dialog UI
|
|
260
|
+
*/
|
|
261
|
+
export function renderDialogUI(npcName, history, isStreaming) {
|
|
262
|
+
const lines = [];
|
|
263
|
+
const s = getStrings();
|
|
264
|
+
const width = 70;
|
|
265
|
+
lines.push('╔' + '═'.repeat(width - 2) + '╗');
|
|
266
|
+
lines.push('║ ◈ ' + s.npc.talkTo + ' [' + npcName + ']' + ' '.repeat(width - 20 - npcName.length) + '║');
|
|
267
|
+
lines.push('╠' + '═'.repeat(width - 2) + '╣');
|
|
268
|
+
lines.push('║' + ' '.repeat(width - 2) + '║');
|
|
269
|
+
// Dialog history
|
|
270
|
+
for (const entry of history.slice(-6)) {
|
|
271
|
+
const prefix = entry.role === 'player' ? '[You] ' : `[${npcName}] `;
|
|
272
|
+
const text = prefix + entry.content;
|
|
273
|
+
// Word wrap
|
|
274
|
+
const maxLen = width - 6;
|
|
275
|
+
for (let i = 0; i < text.length; i += maxLen) {
|
|
276
|
+
const line = text.slice(i, i + maxLen);
|
|
277
|
+
lines.push('║ ' + line.padEnd(width - 4) + '║');
|
|
278
|
+
}
|
|
279
|
+
lines.push('║' + ' '.repeat(width - 2) + '║');
|
|
280
|
+
}
|
|
281
|
+
if (isStreaming) {
|
|
282
|
+
lines.push('║ ' + color('▌' + s.npc.waitingForResponse, COLORS.dim).padEnd(width - 4) + '║');
|
|
283
|
+
}
|
|
284
|
+
lines.push('║' + ' '.repeat(width - 2) + '║');
|
|
285
|
+
lines.push('║ ' + 'Your response: _'.padEnd(width - 4) + '║');
|
|
286
|
+
lines.push('║' + ' '.repeat(width - 2) + '║');
|
|
287
|
+
lines.push('╚' + '═'.repeat(width - 2) + '╝');
|
|
288
|
+
return lines;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Print lines to terminal
|
|
292
|
+
*/
|
|
293
|
+
export function render(lines) {
|
|
294
|
+
console.log(lines.join('\n'));
|
|
295
|
+
}
|
|
296
|
+
//# sourceMappingURL=Terminal.js.map
|
|
297
|
+
//# debugId=db6c6406-9f88-5f5d-a139-9a49d9ec32ba
|