Commit graph

42 commits

Author SHA1 Message Date
7e46b190f1
Ensure backward compatibility for single-player mode
Added explicit tests documenting that createCombatState, drawCards,
playCard, and endTurn all accept the original single-string/no-index
signatures and keep state.player and state.enemy aliases in sync.
2026-02-23 23:30:06 -05:00
62425eadd7
Update combat orchestration for multiplayer turns
startTurn resets energy/block for all players and draws 5 cards each,
also resets playersReady. resolveEnemyTurn iterates all enemies,
resets each enemy's block, and has each enemy act against player 0.
checkCombatEnd checks all enemies (victory) and any player (defeat).
2026-02-23 23:30:06 -05:00
e03b9b2dd7
Update effect resolver for indexed player/enemy targets
Added tests and verified resolveEffects handles {type, index}
descriptors for multi-player and multi-enemy state. getEntity and
setEntity helpers resolve either legacy string keys or typed index
objects, so all existing string-based call sites continue working.
2026-02-23 23:29:14 -05:00
86287a30c2
Update draw and play functions for player indexing
Added tests covering drawCards(state, playerIndex, count) and
playCard(state, playerIndex, handIndex, targetIndex) signatures.
Also tests the per-player endTurn path with playersReady tracking.
2026-02-23 23:29:14 -05:00
b2056d8368
Expand state model for multiple players and enemies
createCombatState now accepts arrays of characters and enemy IDs,
producing players[] and enemies[] arrays. Backward compat aliases
(state.player, state.enemy) are kept in sync. effects.js updated
to resolve entity descriptors as either legacy string keys or
{type, index} objects so both old and new call sites work.
2026-02-23 23:29:13 -05:00
57d15914f4
Complete watcher card extraction into cards.json
Merged 120 watcher cards from watcher_cards.json into the unified
cards.json database, replacing the previous 8 stub entries. Deleted
watcher_cards.json since the data is now consolidated.
2026-02-23 23:28:56 -05:00
6c5f935610
Add a roadmap and reference file 2026-02-23 23:23:12 -05:00
eb094a5138
Add data validation tests for cards and enemies 2026-02-23 23:23:12 -05:00
a11439eb58
Switch cards.js to load full cards.json database 2026-02-23 23:23:12 -05:00
426443bc9e
Update combat test to match real jaw_worm board game data 2026-02-23 23:23:12 -05:00
bdb83e40a2
Extract Act 1 enemy data from board game sheets 2026-02-23 23:23:12 -05:00
6ad8dd05e8
Apply biome formatting to cards.json 2026-02-23 23:23:12 -05:00
8a9439ed74
Update starter-ironclad.json with extracted data and image paths 2026-02-23 23:23:12 -05:00
429e1bbc2a
Map watcher card images to data 2026-02-23 23:23:12 -05:00
f3f092185b
Map defect card images to data 2026-02-23 18:53:22 -05:00
a4f449fef9
Map silent card images to data 2026-02-23 18:51:50 -05:00
0785efffe4
Map ironclad card images to data 2026-02-23 18:44:47 -05:00
ef3da3e30f
Merge per-character card data into unified cards.json 2026-02-23 18:34:05 -05:00
64dfee517c
Add dev recipe to justfile 2026-02-23 18:19:34 -05:00
dd80f894f8
Replace JSON imports with fetch for browser compatibility 2026-02-23 18:15:13 -05:00
29a4a380ca
Add justfile and update package.json scripts 2026-02-23 18:02:05 -05:00
820bb6e395
Add typescript and tsconfig for type checking 2026-02-23 18:01:59 -05:00
aa9412dc61
Apply biome formatting to main module 2026-02-23 17:54:41 -05:00
8a7facb35e
Wire up main module with event handling and game loop 2026-02-23 17:54:41 -05:00
87d2724c3c
Apply biome formatting to render module 2026-02-23 17:54:41 -05:00
5a73afa22b
Add render module for state-to-DOM projection 2026-02-23 17:54:41 -05:00
e0f4916bce
Fix button types and apply biome formatting 2026-02-23 17:54:41 -05:00
933b6fc452
Add HTML shell, CSS layout, and dev server 2026-02-23 17:54:41 -05:00
fcf8de7f75
Fix biome lint warnings in combat module 2026-02-23 17:54:41 -05:00
222b5c25b0
Format with biome 2026-02-23 17:54:41 -05:00
45d62144bf
Add combat orchestration with turn flow and win/loss check 2026-02-23 17:54:41 -05:00
35d2176bc2
Add die roll and enemy action resolver 2026-02-23 17:54:41 -05:00
0bb8f236c0
Add effect resolver with hit, block, status, draw 2026-02-23 17:54:41 -05:00
a1f242d54e
Add state module with combat init, draw, play, end turn 2026-02-23 17:54:41 -05:00
08214fc8cb
Add card data module with ironclad starter deck 2026-02-23 17:54:41 -05:00
690ffbe43c
Project scaffold with bun and biome 2026-02-23 17:54:41 -05:00
41b4c54f7d
Add card data 2026-02-23 17:54:25 -05:00
912bb2eb49
Add a simple readme 2026-02-23 17:16:02 -05:00
00229f2b8e
Update agent config 2026-02-23 17:15:55 -05:00
541f29d64d
Add two design plans 2026-02-23 17:15:04 -05:00
759779b319
Improve the rule docs 2026-02-23 17:14:53 -05:00
26958ac195
Add rules 2026-02-23 15:23:12 -05:00