Commit Graph

141 Commits

Author SHA1 Message Date
4e305e392a refactor(type): material types. 2026-09-21 19:16:33 +08:00
50bd679fad feat: 渲染端配置加载 2026-09-21 10:09:20 +08:00
d65b107819 refactor: 渲染端配置文件 2026-09-20 23:49:27 +08:00
cc434a6c66 refactor: 加载系统重构 2026-09-20 20:53:46 +08:00
d12790280a feat: 完成数据端数据类型的构建 2026-09-20 19:11:43 +08:00
ed0b95b1c4 feat: CoreState 配置添加 loadStarter 2026-09-18 20:36:03 +08:00
f5a6ed8cf6 refactor: 加载系统 2026-09-18 20:30:40 +08:00
ae5a956492 chore: 删除 IDirectionMapper,全换成 IFaceHandler 2026-09-18 08:26:57 +08:00
4aaea68b65 refactor: 寻路系统改进 2026-09-17 21:21:08 +08:00
e9e9939bd8 refactor: 删除 data-state 中的 legacy 文件夹 2026-09-17 19:37:30 +08:00
a2a8e6ec35 refactor: ReplaySystem.route -> ReplaySystem.array,修复 disabled 标记在 setReplayArray 中清零可能导致意外记录的问题 2026-09-17 19:18:30 +08:00
a027b04d14 chore: 清空类型错误 2026-09-17 18:38:29 +08:00
e2e27d9ff2 refactor: 删除 data-fallback 2026-09-17 18:24:07 +08:00
10755475a4 refactor: 删除 legacy-plugin-data 2026-09-17 18:21:35 +08:00
7121c93914 test: update replay command assertions after ReplayCode rename
49aacb0 renamed ReplayMoveCommand -> ReplayMove (and siblings); sync the two stale expectations in data-state/src/replay/commands.test.ts (constructor names + core.ts source assertions).
2026-09-17 13:15:30 +08:00
fe595b7983 refactor: 存档系统应处于渲染层 2026-09-16 21:54:12 +08:00
49aacb087a refactor: 调整录像命名 2026-09-16 21:51:19 +08:00
513a9c354c fix: 读档的 executor 未执行 2026-09-16 21:44:52 +08:00
b2626bd438 fix(07-09): keep hero attribute instance stable and clear generic variance
- HeroAttribute.loadState replaces its private base object; the HeroAttribute wrapper identity is preserved so equipment/combat references stay valid across load (#06-17-1/#06-17-2).

- Clone the incoming base attribute in the constructor so the shared HERO_DEFAULT_ATTRIBUTE is no longer mutated across CoreState instances.

- Use any for the hero position in combat handler/aura/enemy-view generics to clear the 45 new type errors introduced by HeroAttribute implementing ISaveableContent.
2026-09-16 19:35:54 +08:00
1ff22dd07d feat: 寻路系统接线 2026-09-15 21:28:52 +08:00
95ea6609c6 fix(07-07): #06-09-5 warn code 178 for unloaded save keys
- core.ts loadState: 差集方向改为 loaded.difference(total),178 = 存档出现但未加载的 key
- saveablesRoundTrip.test.ts:322-334 改写为「缺 key 不触发 178、仍触发 177」负向见证并更名
- saveablesRoundTrip.test.ts:337-349 取消 it.skip,承担「多出 key 触发 178」正向见证
2026-09-15 21:10:33 +08:00
25e8c0662a test(06): normalize CRLF line endings for enemy comparer/special tests 2026-09-15 13:00:04 +08:00
6d3d4dbaed fix(state): replace removed noRoute with replaySystem disable/revert in hero events 2026-09-14 20:20:20 +08:00
82205a9dc1 feat: 录像存储 2026-09-14 18:17:37 +08:00
cee843981f feat: 录像记录 & CoreState 存储接口 2026-09-14 18:09:45 +08:00
136a9845d6 test(06): fix lint and type errors in data-layer test files 2026-09-14 14:03:25 +08:00
e72231d9fa test(06-02): close GuardAura converter and capability coverage gap
- add a normal case for GuardAuraConverter.convert (code 26 -> GuardAura)
- assert GuardAura priority/couldApplyBase/couldApplySpecial/range/applySpecial
- keeps D-30 per-public-method coverage symmetric with CommonAura
2026-09-14 13:35:51 +08:00
7b956705d3 test(06-02): cover map damage views, converter and reducer
- Zone/Repulse/Laser/Between/Ambush views: range params, damage info, guards
- MainMapDamageConverter: per-special view order and laser face lookup
- MainMapDamageReducer: sum, max-damage type and catch/repulse union
2026-09-14 09:06:59 +08:00
b36a4ee8a9 test(06-02): cover aura converters and special registration
- CommonAura/CommonAuraConverter: range selection, buff math, capabilities
- GuardAura/GuardAuraConverter: 3x3 range, guard locator registration, own-locator and missing-source no-ops
- registerSpecials: code 0-27 registered once, guard default, name/description generation
2026-09-14 09:05:34 +08:00
5b76cf4dc9 test(06-02): cover damage calculator, final effect and comparer
- MainDamageCalculator: base, defeat, all special branches, guard recursion/warn 137, negative-damage flag, critical limit
- MainEnemyFinalEffect: solid/mimic/unchanged branches and priority
- MainEnemyComparer: base attributes, special count/code/value deep equality
2026-09-14 09:04:23 +08:00
c80516deb7 fix(event): 采纳七个内建并修正 touched-jsdoc 门禁
- event.test.ts 与 03-EVENT-CONTRACT.md 同步为七个内建(移除 touchFront/EventTouchFront)

- check-touched-jsdoc 按 dev.md 豁免继承/implements 成员,补充防误删说明

- 刷新 Phase 01-03 验证指纹,三个阶段恢复 passed
2026-09-13 23:38:46 +08:00
b623e8ac98 fix: 勇士事件移动时不应记录录像 2026-09-13 20:42:48 +08:00
0ba70e1a63 docs(event-contract): sync with current built-in names and collection design
- built-in names: setBlock/moveBlock/removeBlock/moveHero/stepHero/touchFront/
  insertEvents/insertEvent (class names Event*)
- removeBlock: static by default, dynamic:true also removes dynamic tiles
- touchFront: steps the hero forward; the mover produces the OnTouch on bump
- GameEventSystem.collectEvent owns source collection; mover enter/leave/hit reuse it
- IBlockEventEnv gains required system and nullable heroFloor; utils.ts keeps only
  getPossibleMap/getPossibleLayer
2026-09-13 20:40:15 +08:00
a66be585d1 feat(event): rework built-ins and centralize trigger collection
- rename deleteBlock -> removeBlock (dynamic tiles need dynamic:true),
  moveHeroStep -> stepHero; touchFront steps forward and lets the mover bump
- GameEventSystem.collectEvent owns point/tile source collection; moverImpl
  enter/leave/hit reuse it with OnEnter/OnLeave/OnTouch
- IBlockEventEnv gains required system field and nullable heroFloor
- MapLayer.removeBlock added and setBlock guarded by inMap; GameMap owns floorId
- IObjectMover.push accepts readonly steps
- update event/eventDispatch tests to the current implementation (fixtures
  supply system, hero location snapshots, renamed registrations)

Verified: data type gate 0 in-scope; vitest 19 files / 112 tests pass; prettier
and eslint clean on touched files.
2026-09-13 20:37:32 +08:00
f0fd2f54a1 refactor(event): class-based built-ins, shared utils, single registration
- rewrite every built-in as EventXxx implements BuiltInFunction<P, E>
  (setBlock/moveBlock/deleteBlock/moveHero/moveHeroStep/touchFront/
  insertEvents/insertEvent), matching the EventSetBlock reference style
- move shared helpers to event/utils.ts (getPossibleMap, getPossibleLayer,
  getEventExecutor, enter/exitEventInsert); utils is not exported via index
- move per-class helpers into private methods (EventTouchFront and
  EventInsertEvents collectInvocations)
- use IObjectMover.push for move sequences instead of manual step calls
- registrations.ts: one createEventRegistrations() writing the eight entries
  in order, categories separated by single-line comments
- remove EventBuiltinName; classes own short string names
- update event tests; core.ts uses createEventRegistrations
2026-09-13 19:17:32 +08:00
5a05eecad1 wip(event): scaffold EventSetBlock class, utils helpers, anon-tokyo workspace dep
- data-state: add @motajs/anon-tokyo workspace dependency
- map.ts: new EventSetBlock BuiltInFunction class (reference style)
- utils.ts: getPossibleMap/getPossibleLayer helpers (not yet wired)

Checkpoint of user-authored in-progress event refactor.
2026-09-13 19:04:25 +08:00
46a38fa0c6 refactor: 录像系统指令 2026-09-13 16:38:19 +08:00
dd4e66a335 refactor(replay): rewrite remaining commands and register in CoreState
- ReplayUseItemCommand / ReplayEquipCommand / ReplayUnequipCommand now extend
  BaseReplayCommand with fixed numeric params and per-false-position logger
  error codes (2006-2010); string item/slot params removed, autoUnload is a
  required bool.
- remove isNumber/isItem/isBoolean/isSlot/resolveSlot helpers; all logic now
  lives in the command classes.
- drop createReplayCommandItems/registerReplayCommandItems; CoreState owns a
  private registerReplayCommand() registering the eight stable codes directly.
- prune unused replay boundary types from replay/types.ts.
- fix ReplaySandbox: a replay ending on a run of moves now finalizes the
  trailing run through notExecuted (previously the last move never started).
- rewrite commands.test.ts for the base-class design and direct registration.

Verified: data type gate 0 in-scope; vitest 19 files / 112 tests pass; prettier
and eslint clean on touched files.
2026-09-13 15:39:12 +08:00
37bfb77301 refactor(replay): add command base class and rewrite move/teleport
- BaseReplayCommand with name/paramTypes and assertParameter guard
- add optional IReplayCommand.notExecuted for trailing-step finalization
- sandbox invokes previous command notExecuted when the next command differs
- rewrite ReplayMoveCommand (batched step + notExecuted start/await) and ReplayTeleportCommand
- add replay logger error codes 2001-2005 and warn 175

NOTE: command tests still reference the pre-rewrite class names; updated in follow-up.
2026-09-13 15:16:51 +08:00
521413fea4 style(03-19): normalize touched event JSDoc to multiline
- Convert map, hero, event, and registration-assembly function JSDoc
  into multiline form for every touched declaration
- Preserve export-only barrels, class-owned registration order, direct
  Statement[] insertion, hero front-touch ownership, and Chinese event
  test comments
2026-09-12 13:26:13 +08:00
cabee3cc01 style(03-19): normalize touched replay JSDoc to multiline
- Convert replay command, helper, and registry JSDoc into multiline form
- Add declaration-aware script/check-touched-jsdoc.ts scanner that
  inventories constructors as explicit exemptions and fails any other
  touched top-level function or class method without multiline JSDoc
2026-09-12 13:24:06 +08:00
a69130c8ad test(03-18): cover event registration ownership and barrel purity
- Assert the real eight-entry class registry, fresh per-group instances,
  and the three-map/three-hero/two-control ownership split
- Prove every class owns its stable name and function, classes originate
  from their owning modules, and hero owns the front-touch registration
- Verify both event barrels stay export-only while prior public event
  symbols remain reachable from the data-state root index
2026-09-11 23:10:37 +08:00
0dc30aace8 refactor(03-18): move event registration assembly out of the barrel
- Add event/registrations.ts as the sole direct-construction assembler for
  the eight class-based registrations in stable map/hero/control order
- Reduce event/index.ts and data-state/src/index.ts to export-only barrels
  that re-export the four public registration creators
- Point CoreState at event/registrations and record the ownership and
  public-export boundaries in the event contract
2026-09-11 23:02:15 +08:00
cb716f699e refactor(03-18): own event registrations as explicit classes
- Replace generic per-invocation registration factories with explicit
  SetBlock/MoveBlock/DeleteBlock, MoveHero/MoveHeroStep/TouchFront, and
  InsertEvents/InsertEvent registration classes
- Move eventTouchFront, invocation collection, and target resolution into
  the hero event layer while keeping awaited OnTouch behavior
- Keep map and control modules limited to their own registration ownership
2026-09-11 22:59:16 +08:00
febdcdc967 refactor: align state system replay and path contracts 2026-09-11 22:36:09 +08:00
4bd6a463d6 test(03-17): cover replay registry construction
- Assert direct stable registry construction
- Guard against formatter suppressions and duplicate directional classes
- Retain deferred movement and pathfinding ordering coverage
2026-09-11 22:22:21 +08:00
df7d1e12c2 fix(03-17): await replay movement completion
- Remove replay-safety decoration from command implementations
- Await directional and pathfinding controller completion
- Collapse directional commands into one parameterized class
2026-09-11 22:21:01 +08:00
4e318e6ce1 refactor(03-15): order replay class internals consistently
- Keep private command actions before their execute callers per project conventions
2026-09-11 14:32:20 +08:00
f5c6b06c59 test(03-15): cover independent replay command ownership
- Verify distinct command classes, fresh instances, stable order, and extension registration
- Add structural ownership regressions without changing replay or user-owned decorator boundaries
2026-09-11 14:28:24 +08:00
13162b2406 fix(03-15): split replay commands into independent classes
- Replace the shared replay entrance object with eight owned instruction classes
- Preserve stable registration order and replay command extension boundaries
2026-09-11 14:22:01 +08:00