Commit Graph

37 Commits

Author SHA1 Message Date
hypercross 8ec95cbf81 refactor: rename 'user' target to 'source' in slay-the-spire-like
Updates the card effect and intent target types from 'user' to 'source'
within the desert data files and combat effect system to maintain
consistency. Also reformat command tests to use 2-space indentation.
2026-04-23 00:35:28 +08:00
hypercross f4c96a4a72 refactor: update turn start triggers in desert sample
Fixes logic in `defendNext` to ensure effects are applied after
buff updates by calling `next()` before mutation. Also updates
indentation and formatting to match project style guidelines.
2026-04-22 20:13:31 +08:00
hypercross a5e2e4888e refactor(slay-the-spire-like): update combat targeting and effect logic
Refactor combat targeting types and effect application logic in the
Slay the Spire-like sample.

- Update `getEffectTargets` to use `IntentEffectTarget` and more
  descriptive target keys (e.g., `eachEnemy`, `randomEnemy`).
- Update `promptMainAction` to use `enemy` instead of `single` for
  card target types.
- Refactor `addInstantEffectTriggers` to remove unused effect loading
  and improve enemy/card instantiation logic
2026-04-22 19:35:37 +08:00
hypercross 38fd46618e refactor(slay-the-spire-like): use data definitions in system types
Remove redundant type definitions in `system/types.ts` and instead
import them from the generated CSV declaration files. Also update
declaration files to use single quotes for consistency with project
style rules.
2026-04-22 19:26:58 +08:00
hypercross 72647a8268 refactor(samples): export desert data types
Export type definitions from desert CSV declaration files and
update the content module to use these exported types instead of
generic system types.
2026-04-22 16:48:54 +08:00
hypercross dbbbba14e2 refactor(slay-the-spire-like): update card effect and intent schemas
Refactor the data schemas for desert card effects and intents to use
dedicated type aliases for triggers, targets, and effect lists. This
improves type safety and consistency across the sample data.
2026-04-22 16:13:48 +08:00
hypercross 888b7b822d refactor(slay-the-spire-like): extract types in desert data schemas 2026-04-22 16:00:15 +08:00
hypercross bb4528cd27 refactor(samples): update desert card and effect schemas 2026-04-22 15:59:41 +08:00
hypercross 877cc9d779 refactor: update schema definitions in slay-the-spire-like data
Refactor CSV schema headers in the desert sample to use named type
aliases instead of inline union strings. This improves readability and
maintains consistency with the project's use of `inline-schema`.

Changes include:
- Updating `card.csv` to use `CardType`, `CardCostType`, and
  `CardTargetType`.
- Updating `encounter.csv` to use `EncounterType` and `EnemyList`.
- Updating `intent.csv` to use `IntentEffectTarget` and replacing
  `self` with `user` for effect targets.
2026-04-22 15:57:52 +08:00
hypercross 2eec668851 refactor: update damage triggers and combat start logic
- Update `defend` effect lifecycle to `temporary` in desert data
- Refactor `onDamage` triggers to improve readability and logic flow
- Implement shuffle and draw actions on `onCombatStart` trigger
2026-04-22 11:06:19 +08:00
hypercross 270b9b744e refactor(slay-the-spire-like): rename getNeighborItems to
getAdjacentItems
2026-04-21 23:22:19 +08:00
hypercross 2823089f06 feat(samples): update card effect schema in desert data
Update the `card.csv` schema to use `inject effects` instead of
`effects`
to match the expected property name for card effects.
2026-04-21 22:21:28 +08:00
hypercross 5e172c61bb refactor(slay-the-spire-like): use IRunContext in combat system
Update the combat system to use `IRunContext` instead of passing
raw inventory objects. This provides a cleaner abstraction for
accessing item data and managing consumed uses.

- Update `canPlayCard` and `payCardCost` to use `IRunContext`
- Pass `IRunContext` through the trigger registration chain
- Fix logic in `canPlayCard` for "uses" cost validation
- Update combat effect tests to use a mock `IRunContext`
2026-04-20 11:25:52 +08:00
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 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 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 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 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 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 f775d51a58 feat: effect and triggers 2026-04-17 12:58:12 +08:00
hypercross 65afe6dc8f refactor: remove card effect cycle, just use instant instead 2026-04-17 11:13:28 +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