pool.module
README.md
SecondWind.pool
Health for crowds: hundreds of units in one table with no component per entity, for RTS armies, swarms and tower-defence waves that one machine simulates. Pool.new(opts), then add(key, { maxHealth, armor, absorb, regen, team }), damage(key, amount, { type, team, by }) (returns dealt, died, reason), heal, kill, tick(dt) for regeneration, fraction, isAlive, count. It uses SecondWind's own rules from SecondWind.logic: armour soak and the damage types that bypass it, the eight damage types, and team checks with friendly fire. onDeath and onDamage callbacks report what happened.