@linxin666/dsh-pet 0.2.7 → 0.2.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,6 +5,8 @@ import { join } from 'node:path'
5
5
  import {
6
6
  DEFAULT_FRAME_COUNTS,
7
7
  DEFAULT_PET_CELL,
8
+ DEFAULT_TRACK_PATTERNS,
9
+ PET_ROW_ORDER,
8
10
  PET_SCAN_JSON_CAP,
9
11
  codexPetsDir,
10
12
  loadPetRegistry,
@@ -168,6 +170,18 @@ describe('loadPetRegistry', () => {
168
170
  readFileSync(petAtlasFile(registry.byId('whale-girl-refined')!)),
169
171
  )).toBe(false)
170
172
  expect(registry.defaultEntry().id).toBe('whale-girl')
173
+ // Both built-in whales and every override-free pet share the one slow
174
+ // global rhythm (user request: all pets were too fast at the legacy
175
+ // hatch-pet contract pace).
176
+ for (const track of PET_ROW_ORDER) {
177
+ expect(registry.byId('whale-girl')!.tracks[track].durations)
178
+ .toEqual(DEFAULT_TRACK_PATTERNS[track].durations)
179
+ expect(registry.byId('whale-girl-refined')!.tracks[track].durations)
180
+ .toEqual(DEFAULT_TRACK_PATTERNS[track].durations)
181
+ }
182
+ expect(DEFAULT_TRACK_PATTERNS.idle.durations[0]!).toBeGreaterThanOrEqual(500)
183
+ expect(DEFAULT_TRACK_PATTERNS['running-right'].durations[0]!).toBeGreaterThanOrEqual(300)
184
+ expect(DEFAULT_TRACK_PATTERNS.waving.durations[0]!).toBeGreaterThanOrEqual(450)
171
185
  })
172
186
 
173
187
  it('scans built-in assets, the custom pets dir, and composed extras with precedence', () => {
package/src/registry.ts CHANGED
@@ -114,21 +114,25 @@ export interface PetTrackDef {
114
114
  fallback?: PetAnimation
115
115
  }
116
116
 
117
- /** Default per-track rhythm (hatch-pet contract table). */
117
+ /**
118
+ * Default per-track rhythm — the shared slow baseline every sprite2d pet
119
+ * plays unless its manifest overrides a track (user request: all pets were
120
+ * too fast at the legacy hatch-pet contract pace).
121
+ */
118
122
  export const DEFAULT_TRACK_PATTERNS: Record<PetAnimation, {
119
123
  durations: number[]
120
124
  loop: boolean
121
125
  fallback?: PetAnimation
122
126
  }> = {
123
- idle: { durations: [280, 110, 110, 140, 140, 320], loop: true },
124
- 'running-right': { durations: [120, 120, 120, 120, 120, 120, 120, 220], loop: true },
125
- 'running-left': { durations: [120, 120, 120, 120, 120, 120, 120, 220], loop: true },
126
- waving: { durations: [140, 140, 140, 280], loop: true },
127
- jumping: { durations: [140, 140, 140, 140, 280], loop: false, fallback: 'idle' },
128
- failed: { durations: [140, 140, 140, 140, 140, 140, 140, 240], loop: false, fallback: 'idle' },
129
- waiting: { durations: [150, 150, 150, 150, 150, 260], loop: true },
130
- running: { durations: [120, 120, 120, 120, 120, 220], loop: true },
131
- review: { durations: [150, 150, 150, 150, 150, 280], loop: true },
127
+ idle: { durations: [500, 500, 600, 500, 500, 600], loop: true },
128
+ 'running-right': { durations: [300, 300, 300, 300, 300, 300, 300, 400], loop: true },
129
+ 'running-left': { durations: [300, 300, 300, 300, 300, 300, 300, 400], loop: true },
130
+ waving: { durations: [450, 450, 450, 450], loop: true },
131
+ jumping: { durations: [400, 400, 400, 450, 450], loop: false, fallback: 'idle' },
132
+ failed: { durations: [550, 550, 550, 600, 650, 700, 550, 550], loop: false, fallback: 'idle' },
133
+ waiting: { durations: [550, 550, 600, 550, 550, 600], loop: true },
134
+ running: { durations: [330, 330, 330, 330, 330, 400], loop: true },
135
+ review: { durations: [650, 650, 650, 650, 650, 650], loop: true },
132
136
  }
133
137
 
134
138
  /** Manifest shape a pet directory (or 'PetConfig.pets' entry) declares. */