Isolate player hit collision from impact FX

This commit is contained in:
Admin 2026-09-18 00:10:23 +00:00
parent beb8b976d3
commit 2f837d15e6

View File

@ -433,13 +433,10 @@ class GameScene extends Phaser.Scene {
const rawDamage = Number(shot.getData('damage')); const rawDamage = Number(shot.getData('damage'));
const damage = clamp(Number.isFinite(rawDamage) ? rawDamage : PIRATE_SHOT_DAMAGE, 1, 25); const damage = clamp(Number.isFinite(rawDamage) ? rawDamage : PIRATE_SHOT_DAMAGE, 1, 25);
const { x, y } = shot;
// Mirror the proven player-shot collision path: remove the projectile // Keep enemy -> player collision deliberately side-effect-light until the
// immediately, render impact feedback, then rate-limit hull damage only. // freeze is isolated. Projectile removal and hull mutation only.
shot.destroy(); shot.destroy();
this.spawnExplosion(x, y, 0.32);
this.flashShip(this.player, 0xffcccc);
if (this.time.now - this.lastPlayerHitAt < PLAYER_HIT_COOLDOWN_MS) return; if (this.time.now - this.lastPlayerHitAt < PLAYER_HIT_COOLDOWN_MS) return;
this.lastPlayerHitAt = this.time.now; this.lastPlayerHitAt = this.time.now;