Polish pause actions and duplicate weapons

This commit is contained in:
MeatSlicer Developer committed 2026-07-30 22:57:36 +10:00
1 parent 3e603c349d
commit d96d492a43
4 files changed
+37 -6

No files matched your search

+10
View File
@@ -1259,12 +1259,22 @@ console.log('== weapon swap (R) ==');
ctx.spawnPickup('weapon', p.x, p.y, { wid: 'repeater' });
step(2, 16);
check('picked up special', p.weapon.id === 'repeater');
p.weapon.ammo = 5;
ctx.spawnPickup('weapon', p.x, p.y, { wid: 'repeater' });
step(2, 16);
check('duplicate active weapon refills ammo instead of replacing it', p.weapon.id === 'repeater' && p.weapon.ammo > 5 && !p.holstered);
check('duplicate active weapon does not create a dropped-weapon loop', !ctx.G.pickups.some(k => k.type === 'weapon'));
p.weapon.ammo = 77;
const playSwapToast = ctx.G.toasts[ctx.G.toasts.length - 1];
tap('r');
check('R swaps to pistol', p.weapon.id === 'bonepopper' && p.holstered && p.holstered.id === 'repeater');
check('play weapon swap emits a toast', ctx.G.toasts[ctx.G.toasts.length - 1] !== playSwapToast);
check('holster keeps remaining ammo', p.holstered.ammo === 77);
p.holstered.ammo = 5;
ctx.spawnPickup('weapon', p.x, p.y, { wid: 'repeater' });
step(2, 16);
check('duplicate holstered weapon refills ammo without forcing a swap', p.weapon.id === 'bonepopper' && p.holstered.id === 'repeater' && p.holstered.ammo > 5);
p.holstered.ammo = 77;
tap('r');
check('R swaps back', p.weapon.id === 'repeater' && p.weapon.ammo === 77 && !p.holstered);
// picking up another special drops the old one with its ammo