update spirit
This commit is contained in:
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user