Co-op robustness, audio/a11y, new towers and enemies, Uplink rebalance

Co-op (QA'd with two to three real browsers, TCP-proxy chaos scenarios):
- partner's tower changes are never dropped after a render stall or snapshot burst
- half-open connections show "reconnecting" in ~6 s instead of 45-65 s
- upgrade and next-wave are idempotent (stale commands refused), restart message,
  promoted host gets Play again, failed joins never kill a live game, listener leaks

Audio / keyboard / a11y:
- one Audio element per track, fade/stinger supersede tokens, play() retry on the
  next gesture, 5 s fallback to the synth, mute works everywhere, dialogs with
  role/aria-modal/focus handling, accessible names for sound/speed/pause

New content:
- enemies: Daemon (healer), Proxy (regenerating shield), Botnet (flyer swarm);
  waves weave them in from wave 9 (waves 1-8 unchanged)
- towers: Sandbox (stun pulse), Load Balancer (fire-rate aura); hotkeys 1-9
- glyphs/shapes, stun/heal effects, gallery e2e that pixel-checks every kind

Orbital Uplink rebalanced after playtesting (was affordable by wave ~6 and buyable
in bulk from boss rewards): 1500 credits, upgrades 1200/2000/3200, and every Uplink
already owned makes the next one 25% dearer to buy AND to upgrade (each tower
remembers its multiplier, carried in the tower list as a 9th field). Shared
TD.priceFor/upgradePrice so the UI shows exactly what the sim charges.

Also: tablet/foldable viewports in the layout matrix (tolerant colour check),
docs (README tower/enemy tables, PROTOCOL shield/stun/pm encodings, NEXT roadmap).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Tb8pW2KAN4oFkh1aK1BfD8
This commit is contained in:
Claude 2026-10-10 21:18:43 +00:00
parent 962189419a
commit 28502984ec
29 changed files with 3370 additions and 230 deletions

View file

@ -194,7 +194,8 @@ class Bot {
let gs = 0, gn = 0;
for (const g of groups) if (g.k === q.k) { gs += g.gap * g.c; gn += g.c; }
const g = (gn ? gs / gn : 1) * nSp; // seconds between consecutive packets on ONE route
const h = Math.round(TD.ENEMIES[q.k].hp * TD.hpScale(w));
const ed = TD.ENEMIES[q.k];
const h = Math.round((ed.hp + (ed.shield || 0)) * TD.hpScale(w)); // a shield is extra hit points
out.push({ ki, N: q.c, Nr: Math.max(1, q.c / nSp), h, leak: K.leak, v: K.v, armor: K.armor, air: K.air, g, spacing: Math.max(0.2, K.v * g), w: weight });
}
};
@ -230,6 +231,7 @@ class Bot {
capSpec(sp, e, slow, G) {
if (sp.type === 'throttle') return 0;
const TD = this.TD, td = TD.TOWERS[sp.type], st = sp.st;
if (!(st.dmg > 0)) return 0; // support / control towers (Load Balancer, Sandbox) deal no damage; the bot never builds them
if (e.air ? !td.air : !td.ground) return 0;
const hit0 = Math.min(perHit(st.dmg, e.armor), e.h); // no credit for overkill
let dps = hit0 * st.rate, M = 1;