update spirit

This commit is contained in:
jakciehan
2026-06-07 22:10:03 +08:00
parent 427a33c55b
commit 9c57deff6d
82 changed files with 5465 additions and 149 deletions
+6 -5
View File
@@ -44,21 +44,22 @@ describe('PlayerStateMachine — damage (req 5.3-5.6, 10.4-10.5)', () => {
expect(sm.color).toBe(PlayerColorState.Red);
});
it('Red + shuriken → death, consumes one life', () => {
it('Red + shuriken → life loss (downgraded) when lives > 1', () => {
const sm = new PlayerStateMachine(2);
const out = sm.takeHit('shuriken');
expect(out.kind).toBe('died');
expect(out.kind).toBe('downgraded');
expect(sm.lives).toBe(1);
expect(sm.isDead).toBe(false);
});
it('fireball is always lethal regardless of color', () => {
it('fireball reduces one life regardless of color', () => {
const sm = new PlayerStateMachine(2);
sm.pickupCrystalJade();
sm.pickupCrystalJade();
const out = sm.takeHit('fireball');
expect(out).toEqual({ kind: 'died', cause: 'fireball' });
expect(sm.color).toBe(PlayerColorState.Red);
expect(out.kind).toBe('downgraded');
expect(sm.lives).toBe(1);
expect(sm.isDead).toBe(false);
});
it('smoke bomb is always lethal', () => {