feat(game): skill XP on task completion + power bands in duration (#45)
CI / build + unit + e2e (pull_request) Successful in 2m48s
CI / build + unit + e2e (pull_request) Successful in 2m48s
This commit is contained in:
@@ -163,6 +163,15 @@ describe('queueTask', () => {
|
||||
expect(active.task.remaining).toBe(computeDuration('EXPLORE', 0, CREW[0], [CREW[1]]))
|
||||
expect(active.task.queuedAtTurn).toBe(10)
|
||||
})
|
||||
|
||||
it('power-band param: a powerOf returning 2 halves a solo EXPLORE (ceil(4/2) = 2); the default flat 1 still stores 4 (backward-compatible)', () => {
|
||||
// CASS (id 3) is a SCIENTIST — the preferred EXPLORE role, so no mismatch penalty; her
|
||||
// trait pair (CALM IN A CRISIS −1 / FORGETS TO EAT +1) cancels on EXPLORE.
|
||||
const withPower = queueTask(state(), { type: 'EXPLORE', payload: { planetId: 5 }, leadCrewId: 3, helperCrewIds: [] }, () => 2)
|
||||
expect(withPower.task.remaining).toBe(2) // ceil(4/2)
|
||||
const defaultPower = queueTask(state(), { type: 'EXPLORE', payload: { planetId: 5 }, leadCrewId: 3, helperCrewIds: [] })
|
||||
expect(defaultPower.task.remaining).toBe(4) // no powerOf → the default flat 1
|
||||
})
|
||||
})
|
||||
|
||||
// --- The turn tick: decrement, resolve, FIFO auto-start (pure — no DB) -------------------
|
||||
|
||||
Reference in New Issue
Block a user