Commit Graph

129 Commits

Author SHA1 Message Date
163e2cc11b refactor(app): drop dead newSession param, unused import, restore main javadoc
- Remove unused `saves` parameter from `newSession(GameIO, SaveService)`
  → signature is now `newSession(GameIO)`, call site updated accordingly
- Remove unused `import thb.jeanluc.adventure.menu.MenuAction` (switch
  uses unqualified constants; import was dead, compile confirmed clean)
- Restore `/** Standard JVM entry point. @param args ignored */` Javadoc
  on `main` and restore full log message "Fatal error during game startup"

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 15:25:01 +02:00
1f15bfe330 feat(app): main-menu shell loop wiring; gitignore saves/
Replace App.run with a main-menu shell (New Game / Load / Settings /
Quit) above the game loop, wire SaveCommand + MenuCommand into the
registry with an autosave callback, and remove the now-unused
QuitCommand. Migrate GameTest from QuitCommand to MenuCommand.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 15:17:46 +02:00
9632d27b25 feat(game): autosave on quest completion 2026-06-01 15:12:18 +02:00
4b2357cd5b feat(command): save + menu commands (QuitCommand removal deferred to Task 11) 2026-06-01 15:10:10 +02:00
e564253f23 test(menu): cover pickSlot selection and Back sentinel
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 15:03:18 +02:00
6921af053a feat(menu): MainMenu, SettingsMenu, MenuAction (frontend-agnostic) 2026-06-01 14:58:41 +02:00
735a92ca6e test(settings): cover corrupt settings file falls back to defaults
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 14:56:14 +02:00
dfc50f0d9f feat(settings): Settings + SettingsStore; runtime-togglable ConsoleIO 2026-06-01 14:52:28 +02:00
404221525c test(save): cover version mismatch + slug; clean up tmp on move failure
Add loadRejectsIncompatibleVersion test asserting SaveException on schema
version 999, assert derived slug in listReturnsSlotMetadata, and harden
save() to delete the orphaned .tmp file when the non-atomic fallback move
also fails before re-throwing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 14:50:10 +02:00
8eb433e02d feat(save): SaveService disk persistence (atomic write, list, load) 2026-06-01 14:44:32 +02:00
1172f7c3fd fix(save): restore visited set before setting current room; strengthen null-tolerance test
Reorder apply() so visitedRoomIds is restored before setCurrentRoom() is
called, ensuring the current room is never accidentally stripped from the
visited set by the subsequent clear(). Also adds a post-condition assertion
to applyToleratesMissingCollections that proves null roomItemIds leaves
room item tables empty after apply.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 14:42:15 +02:00
80a5112508 feat(save): SaveCodec capture/apply over a fresh world; tolerate null collections
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 14:34:48 +02:00
6d703c7caf feat(save): SaveData/SaveSlotInfo/SaveException model 2026-06-01 14:29:55 +02:00
b73d0aaa82 feat(io): GameIO.choose numbered-menu primitive (console default) 2026-06-01 14:26:43 +02:00
beba1c7e72 feat: restore hooks for flags, quest progress, switch state 2026-06-01 14:21:56 +02:00
c1826c7df8 test(game): strengthen legacy-constructor delegation assertions
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-01 14:19:54 +02:00
dd2b1b331f feat(game): GameSession bundles savable state; turn + autosave hook 2026-06-01 14:15:44 +02:00
aa0852cf10 docs: implementation plan for main menu + save/load
13 TDD tasks: GameSession + delegation, restore hooks, GameIO.choose,
SaveData/SaveCodec/SaveService (JSON), Settings + mutable ConsoleIO,
menu package, save/menu commands, quest autosave, App shell loop,
SwingIO buttons, docs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 14:11:42 +02:00
2f96b7896b docs: spec for main menu + save/load (+ minimal settings)
Brainstormed design for backlog #6/#7: shell loop above the game loop,
GameIO.choose() primitive (console default + Swing buttons), GameSession
bundling savable state, JSON SaveData delta over the YAML world, single
active slot, autosave (quest-complete + quit + every 10 turns), and minimal
runtime-togglable settings (color/glyph mode).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 14:00:32 +02:00
9ea07470a9 feat(content): dark dungeon needs the lit lamp
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 23:08:42 +02:00
3cac6cb796 feat: darkness gating for go/look/take/examine + HUD light
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 23:07:36 +02:00
e65e3b600a feat: Room.dark + Item.light flags and Light helper
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 23:04:42 +02:00
acd797bf65 docs: implementation plan for light & darkness
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 23:02:01 +02:00
5d11d7730c docs: spec for light & darkness (model B, blocking)
Room.dark + Item.light flags, a Light helper (isLit/carryingLight), and command
gating: can't enter a dark room without a lit light source; look/take/examine
obscured in the dark; HUD light field wired. Entry-gate prevents soft-locks.
Demo: dark dungeon needs the lit lamp. Fuel/timed light out of scope.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 23:00:15 +02:00
7295463805 feat(content): victory & flee endings; front-door flee switch
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 22:50:46 +02:00
3189b057a0 feat(game): EndingEngine + per-turn end check with summary
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 22:49:00 +02:00
f9bd2d9a67 feat: Ending model + endings.yaml loading (ordered, optional)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 22:47:38 +02:00
3ac9540a6a docs: implementation plan for win-condition & endings
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 22:45:12 +02:00
0f40ee637d docs: spec for win-condition & endings (sub-project 3.3)
Priority-ordered condition-driven endings + an end-of-game summary (turns,
quests X/Y, rank). EndingEngine mirrors the quest engine; Game ends the loop
when an ending fires. endings.yaml optional; World gains 5/6/7-arg back-compat
constructors. Two reachable demo endings (victory, flee) with no new mechanics.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 22:44:01 +02:00
55944a0343 feat(content): demo quest 'restore_power'; document quests command
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 22:34:57 +02:00
e360a754a6 feat(io): GUI quest-box under the map
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 22:33:57 +02:00
c2e5789118 feat(io,command): quests command, QuestText, per-turn quest tick
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 22:31:33 +02:00
fe9ac65f25 feat(loader): quests.yaml loading + startQuest effect mapping
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 22:29:52 +02:00
423cf85c39 feat(game): QuestEngine (auto-advance + announcements) and QuestView
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 22:27:18 +02:00
4e0e951a8d feat(game): Quest model, QuestLog, START_QUEST effect
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 22:25:58 +02:00
84ab176b47 docs: implementation plan for quests & quest-log
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 22:24:20 +02:00
20d4f1470a docs: spec for quests & quest-log (sub-project 3.2)
Condition-driven multi-stage quests on top of the foundation: Quest/QuestStage
data, QuestLog + QuestEngine (per-turn auto-advance with announcements),
START_QUEST effect, QuestView display via a console 'quests' command and a GUI
quest-box under the map. quests.yaml optional; World gains a 5-arg back-compat
constructor. Win/endings deferred to 3.3.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 22:20:49 +02:00
93a5da3af7 feat(content): demo the state engine (generator unlocks/lights the cellar)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 22:01:57 +02:00
acaae3c4f7 feat: switchable items apply effects when turned on
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 21:59:46 +02:00
ab008ee562 feat: NPC reactions gated by conditions, applying effects
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 21:57:23 +02:00
9d23cb01b7 feat: conditional NPC dialogue
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 21:55:15 +02:00
8cb2b360e6 feat: state-dependent room descriptions (LookCommand resolution)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 21:52:57 +02:00
e3b80736dd feat: condition-locked exits (+ room/dialogue state plumbing)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 21:52:06 +02:00
c339d13244 feat(loader): ConditionDto/EffectDto with toModel mapping
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 21:47:11 +02:00
bf10f11438 feat(game): world-state engine (GameState, Condition/Effect, evaluator/applier)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 21:46:29 +02:00
c4542165ab docs: implementation plan for quest foundation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 21:44:37 +02:00
f79382c43a docs: spec for quest foundation (world-state + conditions/effects)
Approach A: one typed condition/effect vocabulary (GameState + Conditions +
Effects) reused by five integration points (locked exits, state-dependent
descriptions, conditional NPC dialogue, reactions with requires/effects,
switch effects). All new YAML fields optional. Light/dark, item-combination,
quest objects, endings deferred.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 21:39:59 +02:00
fdc4915431 docs: note quest-log GUI box (under map) for quest sub-project
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 21:37:37 +02:00
8b1232b2fc fix(io): auto-scale GUI text with window size, consistent with the map
Body text/HUD font now derives from a window-relative auto-scale (starting
at uiScale, growing as the window grows) and is re-applied on resize, so the
text tracks the window like the map does. Ctrl +/- zoom still multiplies on
top of both. Removes the resize hiccup where only the map reacted.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 21:26:09 +02:00
5fb2446373 fix(io): fit the GUI map to the side panel; re-fit on resize
MapPanel now scales the map to fit the side panel (min over width/height),
with the Ctrl +/- zoom as a multiplier on top, so it no longer overflows
and scrolls at normal zoom. The map re-fits whenever the window/side panel
is resized; side panel grows a little more (28%, max 460px) before capping.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-05-31 21:21:27 +02:00