import type { Entity } from '../../core/entity'; import type { Game } from '../../core/game'; import type { AABB, Hit } from '../../core/types'; import { overlaps } from '../../physics/world'; /** * Como game.hitArea pero con memoria: `seen` evita golpear dos veces a la misma entidad * durante una acción continua (embestida, aliento, picado). Ignora al equipo 'hero'. */ export function strike(game: Game, box: AABB, hit: Hit, exclude?: Entity, seen?: Set): Entity[] { const out: Entity[] = []; for (const e of game.entities) { if (e.dead || e === exclude || e.team === 'hero' || seen?.has(e)) continue; if (!overlaps(box, e.bounds(), 0)) continue; seen?.add(e); if (e.takeHit(hit)) out.push(e); } return out; }