Commit Graph

249 Commits

Author SHA1 Message Date
hypercross 5019bc6324 refactor(slay-the-spire-like): use IRunContext for combat logic
Decouple combat systems from the inventory and progress state by
introducing `IRunContext`. This replaces direct access to
`GridInventory` and `GameItemMeta` with abstract methods for
retrieving item data, neighbors, and managing consumed uses.
2026-04-20 11:03:44 +08:00
hypercross 9bed2ca13e refactor(slay-the-spire-like): rename depletion to consumedUses
Rename `depletion` to `consumedUses` in `GameItemMeta` to better reflect
its purpose. Update combat effect logic and tests to use the new field
name. Also apply consistent formatting and import organization to
combat effect modules.
2026-04-20 10:28:58 +08:00
hypercross 08c6a67d16 refactor: use English IDs for desert card effects
Replace Chinese card names with English IDs in the desert card effect
CSV to ensure consistency with the card identifiers. Update tests to
verify the data import using the new English identifiers.
2026-04-20 00:23:41 +08:00
hypercross dda8f4cfe9 style: reformat card-events.ts with 2-space indentation 2026-04-20 00:00:42 +08:00
hypercross 2f2e4e56b5 refactor: decouple card effects from card data in desert sample
Moves card effects from `card.csv` to a dedicated `cardEffect.csv` file.
This allows for more granular control over card triggers (onPlay,
onDraw, onDiscard) and targets, improving the data model for the
slay-the-spire-like sample. Also updates triggers and tests to
reflect this new structure.
2026-04-20 00:00:41 +08:00
hypercross 601eb0f417 refactor: reformat code and introduce IGameContextExport
- Reformat `src/core/game.ts` and sample types to use 2-space
  indentation
- Add `IGameContextExport` to hide internal test properties
- Update `CombatGameContext` to use the exported context type
2026-04-20 00:00:41 +08:00
hyper a82b6b0685 docs: fleshed out agents.md 2026-04-19 18:36:10 +08:00
hypercross 1e1d04777f refactor: reformat code and fix type signatures in GameHost
Reformat `src/core/game-host.ts` to use double quotes and consistent
spacing. Update `createGameHost` to correctly propagate the `TResult`
generic from `GameModule`.
2026-04-19 15:44:59 +08:00
hypercross 8142fbfa60 refactor: simplify buildCombatState and fix formatting in encounter
system

Refactor `buildCombatState` to derive encounter data directly from
`runState` instead of requiring it as an argument. Also apply
consistent 2-space indentation and formatting to the encounter
lifecycle module.
2026-04-19 15:42:47 +08:00
hypercross 89d96d838b refactor(slay-the-spire-like): wrap content module getters in functions 2026-04-19 15:23:17 +08:00
hypercross 6b50e9014a feat(samples/slay-the-spire-like): make ContentModule required 2026-04-19 15:22:45 +08:00
hypercross 39ac37b5f2 style: format slay-the-spire-like index with double quotes 2026-04-19 15:22:02 +08:00
hypercross b264cea305 refactor(slay-the-spire-like): update data export pattern
Convert static data exports to getter functions and update the
ContentModule type to reflect these changes.
2026-04-19 15:20:31 +08:00
hypercross 6577897a42 feat(samples/slay-the-spire-like): add ContentModule type definition 2026-04-19 15:10:17 +08:00
hypercross 4e9e426519 feat(samples): add Item type to desert data
Export the Item type from item.csv and add explicit typing to
startingItems in the desert sample data.
2026-04-19 14:47:58 +08:00
hypercross 4f509da373 docs(samples): update intent.csv comment style 2026-04-19 14:39:54 +08:00
hypercross 63733bc62d refactor: update imports and add starting items to desert sample
- Convert single quotes to double quotes for local imports
- Reformat barrel exports in `src/index.ts` for better readability
- Add `startingItems` to the desert sample data in `slay-the-spire-like`
2026-04-19 13:51:03 +08:00
hyper 3aa92b2d2a refactor: rename that to desert triggers 2026-04-18 15:28:47 +08:00
hyper fa92b5d865 refactor: reorganize trigger code 2026-04-18 15:08:50 +08:00
hyper e46822b45b refactor: avoid globalThis 2026-04-18 14:40:56 +08:00
hyper 03add589c6 refactor: use stacks for the hp of summons 2026-04-18 14:30:20 +08:00
hypercross 4f5747d81d chore: tests for desert triggers 2026-04-17 18:07:49 +08:00
hypercross 0222b66bed feat: export middleware chain 2026-04-17 17:27:46 +08:00
hypercross 90ca8fa761 feat: more effects 2026-04-17 17:15:31 +08:00
hypercross 131af2c0bb feat: implmenet some effects for the design 2026-04-17 16:57:29 +08:00
hypercross 02c159f8ae refactor: move .d.ts to per-file for yarn 2026-04-17 16:55:08 +08:00
hypercross e09e24e274 refactor: barrel export 2026-04-17 16:10:19 +08:00
hypercross a80852bc59 fix: encounter generation 2026-04-17 15:45:52 +08:00
hypercross af0906561c fix: add effect triggering fixes 2026-04-17 15:30:28 +08:00
hypercross aedf82d264 fix: type issues 2026-04-17 15:14:01 +08:00
hypercross 2f085cc0b6 refactor: update csv types 2026-04-17 14:46:09 +08:00
hypercross fb66ec55c4 feat: cost implementation for card play 2026-04-17 14:10:28 +08:00
hypercross f775d51a58 feat: effect and triggers 2026-04-17 12:58:12 +08:00
hypercross aa36f3ea67 feat: enemy intent update 2026-04-17 12:42:29 +08:00
hypercross 0f04af2c6e refactor: update progress 2026-04-17 12:23:10 +08:00
hypercross c11bceeb44 refactor: update generator 2026-04-17 12:10:10 +08:00
hypercross 1d749f59a6 feat: add posture damage & item effect update trigger 2026-04-17 11:57:40 +08:00
hypercross 65afe6dc8f refactor: remove card effect cycle, just use instant instead 2026-04-17 11:13:28 +08:00
hypercross 3a135a4ad1 refactor: reorg 2026-04-17 11:06:09 +08:00
hypercross 1c238aec3a refactor: type rewrite 2026-04-17 10:18:37 +08:00
hypercross a469b4024a refactor: combat rewrite 2026-04-17 09:27:20 +08:00
hypercross 7d8684a16f refactor: middle ware triggers 2026-04-17 08:33:02 +08:00
hypercross 3dc566c2fd refactor: types 2026-04-17 01:28:43 +08:00
hypercross 3f3490fad8 refactor: reorg 2026-04-17 01:05:48 +08:00
hypercross 5e55b58c43 refactor: data reorg complete 2026-04-17 01:01:26 +08:00
hypercross f8c008b67d wip: data reorg 2026-04-17 00:52:47 +08:00
hypercross c0fa0e91b2 refactor: avoid using types from the csv 2026-04-17 00:28:25 +08:00
hypercross e3014e47a8 refactor: adjust implementation details for combat 2026-04-16 21:52:28 +08:00
hyper f7b59a1790 refactor: bunch of reorg updates 2026-04-16 19:27:25 +08:00
hyper b28ec823a7 refactor: reorganize csv data 2026-04-16 19:14:58 +08:00
hyper b18e232cc8 chore: todos 2026-04-16 19:14:46 +08:00
hyper 8c783da857 fix: align data with design 2026-04-16 17:52:20 +08:00
hyper a010a0bca6 refactor: update doc and .d.ts 2026-04-16 17:14:13 +08:00
hypercross 693c279e0f fix: resolve inconsistencies in slay-the-spire-like design docs 2026-04-16 14:07:28 +08:00
hypercross 94c7c91745 feat: slay-the-spire-like combat procedures 2026-04-16 14:00:49 +08:00
hypercross 976ee43ed3 chore: AGENTS.md updated 2026-04-16 12:29:02 +08:00
hypercross 6984e54bdf refactor: add status cards and rules. 2026-04-15 16:28:18 +08:00
hypercross 7b954bb5a5 refactor: add more effect 2026-04-15 15:41:20 +08:00
hypercross 7472095822 refactor: add team effect 2026-04-15 15:21:44 +08:00
hypercross e5da41c1cb refactor: op -> player 2026-04-15 15:19:58 +08:00
hypercross 509e121275 refactor: add timing to effect 2026-04-15 15:16:45 +08:00
hypercross e77e2d0737 refactor: self-referencing intent table! 2026-04-15 14:59:34 +08:00
hypercross 09148f5b13 refactor: update inline-schema to import accessors 2026-04-15 14:56:48 +08:00
hypercross 7e98e5e546 chore: add identifier to fields 2026-04-15 14:30:56 +08:00
hypercross 33095d5226 chore: add tests for data loading 2026-04-15 13:27:12 +08:00
hypercross 726856af35 feat: add enemy/effect data 2026-04-15 13:15:09 +08:00
hypercross 630e35ad4e feat: add enemy intent data 2026-04-15 12:43:41 +08:00
hypercross 5860f2a247 feat: upgrade yarn-spinner-loader to 0.2.0 and add encounters.yarnproject test 2026-04-15 10:19:03 +08:00
hypercross 760cfc9954 feat: deck generation 2026-04-14 15:46:08 +08:00
hypercross 4fbd65e98c fix: encounter data assignment 2026-04-14 14:35:23 +08:00
hypercross 204198b10f refactor: add progress 2026-04-14 13:35:26 +08:00
hypercross 6b724df7e7 refactor: add price 2026-04-14 11:54:44 +08:00
hypercross e35871accd refactor: types on the inventory 2026-04-14 11:11:29 +08:00
hyper ef9557cba7 refactor: minimize repetitions 2026-04-13 21:18:06 +08:00
hyper 1e5e4e9f7e fix: fix map gen again 2026-04-13 20:06:23 +08:00
hyper c30db2f8a4 refactor: update encounter table design 2026-04-13 19:29:53 +08:00
hyper 5d1dc487f8 refactor: map gen? 2026-04-13 19:06:37 +08:00
hypercross 06a2236a1d refactor: redesign map gen 2026-04-13 14:56:33 +08:00
hypercross fe361dc877 fix: avoid paths corssing each other 2026-04-13 12:56:39 +08:00
hypercross 17dca6303c fix: export 2026-04-13 12:20:55 +08:00
hypercross d1aa6dbd32 fix: export for stsl 2026-04-13 12:19:49 +08:00
hypercross 88eeee6ab7 feat: add encounter map 2026-04-13 11:59:56 +08:00
hypercross 2a4383ff10 feat: add grid-inventory 2026-04-13 11:07:57 +08:00
hyper 4bfc6db60f chore: add data import test 2026-04-12 21:04:38 +08:00
hyper 6281044f14 feat: add som shape parsing 2026-04-12 20:44:35 +08:00
hyper 18eae59891 feat: add hero fighter item pool 1 2026-04-12 20:34:08 +08:00
hyper 6dc85b443e feat: shape parsing 2026-04-12 20:26:46 +08:00
hyper d5f65fa6cd chore: export TicTactToePart 2026-04-12 16:28:50 +08:00
hypercross 6ac5ac4b9a chore: update inline-schema output 2026-04-12 10:13:57 +08:00
hyper eb4716200a refactor: some thoughts on design 2026-04-11 18:03:57 +08:00
hyper 547d378d50 feat: fleshing out the design 2026-04-11 17:07:59 +08:00
hyper 330aa43d7b feat: ideas for slay-the-backpack 2026-04-10 20:48:50 +08:00
hyper 617057988d feat: regicide full 2026-04-10 13:43:12 +08:00
hyper 28e548d3de feat: regicide code 2026-04-10 13:24:29 +08:00
hyper 8b271448d2 feat: regicide rule 2026-04-10 13:15:03 +08:00
hyper 9d6e7a75f8 refactor: add export for createPart 2026-04-10 12:34:47 +08:00
hypercross 244a8bb35a fix: onitama win con 2026-04-08 12:25:50 +08:00
hypercross cbf6dce237 fix: export more stuff 2026-04-08 09:28:44 +08:00
hypercross 35df1801c5 fix: export new getCardMoveCandidates 2026-04-08 09:04:24 +08:00
hypercross 5b310f400d fix: fix onitama black orientation 2026-04-08 09:00:25 +08:00