Phone UI and touch precision overhaul, proxy fixes, Orbital Uplink, four new maps

Phone panels (reviewed + QA'd, matrix of 22 layouts with real taps/bounding boxes):
- selected-tower action bar over the board (Upgrade/Sell/Target/close), info panel
  updated in place so taps are never lost, scrollable palette for 7+ towers,
  overlays with pinned footers (Help "Got it", Play solo, Join always visible),
  tappable room chip to invite, reduced-motion/contrast/forced-colors fixes,
  paused state, partner cursor labels, bigger level pips and owner flags
- touch input rewritten around "pointerdown commits nothing": pinch never builds,
  10px tap slop, palm-proof pinch, long-press pings with any tool armed, nudge
  arrows for precise placement, hotkey repeat guard, proportional wheel zoom
- new e2e: select/sell, info-panel stability, UI states, touch precision;
  camera unit tests

Proxy/server (reproduced against real nginx 1.26 with NPM v2.16 config):
- Origin check works when the proxy drops a non-default port, TRUSTED_PROXIES for
  proxies on global IPv6/CGNAT addresses, service worker no longer serves nginx's
  502 page, DEPLOY.md corrected (NPM default read timeout is 90 s, Advanced-tab
  limits, path-prefix, cookie size, per-IP cap behaviour)

Content:
- Orbital Uplink: 4-level endgame tower (450 + 500/800/1200 credits): piercing
  armour-ignoring beam, blast and lingering slow, ground+air, range 11-14;
  glyph, beam effect, sound, help text, unit tests
- Maps: The Canyon, Archipelago, Fortress, Pinwheel (7 maps total)

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 18:03:24 +00:00
parent dad0382e10
commit a5bd09d505
22 changed files with 2423 additions and 405 deletions

View file

@ -91,8 +91,96 @@
'..........................',
],
},
canyon: {
id: 'canyon', name: 'The Canyon', difficulty: 1,
desc: 'Three ridges force a natural S-bend. Great for learning where to stack turrets.',
rows: [
'.......#.........#........',
'.......#.........#........',
'.......#.........#........',
'.......#.........#........',
'.......#.........#........',
'.......#....#....#........',
'.......#....#....#........',
'S......#....#....#........',
'.......#....#....#.......C',
'.......#....#....#........',
'.......#....#....#........',
'............#.............',
'............#.............',
'............#.............',
'............#.............',
'............#.............',
],
},
archipelago: {
id: 'archipelago', name: 'Archipelago', difficulty: 2,
desc: 'Islands of dead nodes everywhere and two gateways. Mind the gaps between them.',
rows: [
'..........................',
'..........................',
'S...##........##......##..',
'....##........##......##..',
'...................##.....',
'.........##........##.....',
'.........##...............',
'..........................',
'...............##........C',
'.....##........##.........',
'.....##...................',
'..........................',
'..........##.......##.....',
'S.........##.......##.##..',
'......................##..',
'..........................',
],
},
fortress: {
id: 'fortress', name: 'Fortress', difficulty: 2,
desc: 'The server sits inside a ring with three entrances. Wall off two, defend the third.',
rows: [
'..........................',
'..........................',
'..........................',
'S.........................',
'..........................',
'..................###.###.',
'..................#.....#.',
'..................#.....#.',
'.....................C..#.',
'..................#.....#.',
'..................#.....#.',
'..................###.###.',
'S.........................',
'..........................',
'..........................',
'..........................',
],
},
pinwheel: {
id: 'pinwheel', name: 'Pinwheel', difficulty: 3,
desc: 'Four gateways, one server in the middle, bars that twist every route.',
rows: [
'.............S............',
'..........................',
'..........................',
'................#.........',
'................#.........',
'........#####...#.........',
'................#.........',
'................#........S',
'S............C............',
'.........#................',
'.........#................',
'.........#....#####.......',
'.........#................',
'.........#................',
'..........................',
'............S.............',
],
},
};
const MAP_ORDER = ['open', 'twin', 'hub'];
const MAP_ORDER = ['open', 'canyon', 'twin', 'archipelago', 'fortress', 'hub', 'pinwheel'];
function parseMap(m) {
const rows = m.rows.length, cols = m.rows[0].length;
@ -113,7 +201,7 @@
}
// ---------------------------------------------------------------- definitions
const TOWER_ORDER = ['wall', 'filter', 'ids', 'mortar', 'throttle', 'arc'];
const TOWER_ORDER = ['wall', 'filter', 'ids', 'mortar', 'throttle', 'arc', 'uplink'];
const TARGET_MODES = ['first', 'last', 'strong', 'close'];
const TOWERS = {
wall: {
@ -168,6 +256,16 @@
{ cost: 120, dmg: 36, range: 4.2, rate: 1.4, chains: 4, chainRange: 2.2, falloff: 0.75 },
],
},
uplink: {
name: 'Orbital Uplink', key: '7', color: '#ffe27a', air: true, ground: true,
desc: 'Endgame weapon. A piercing orbital beam that ignores armour, scorches everything in its line, blasts and slows the rest around the target, and reaches across most of the map. Very expensive to build and to upgrade.',
levels: [
{ cost: 450, dmg: 260, range: 11, rate: 0.45, width: 0.5, splash: 1.3, slowOnHit: 0.4, slowFor: 1.5 },
{ cost: 500, dmg: 400, range: 12, rate: 0.5, width: 0.55, splash: 1.5, slowOnHit: 0.45, slowFor: 1.75 },
{ cost: 800, dmg: 640, range: 13, rate: 0.55, width: 0.6, splash: 1.7, slowOnHit: 0.5, slowFor: 2.0 },
{ cost: 1200, dmg: 1000, range: 14, rate: 0.6, width: 0.7, splash: 2.0, slowOnHit: 0.6, slowFor: 2.5 },
],
},
};
const ENEMY_ORDER = ['ping', 'worm', 'trojan', 'spam', 'ghost', 'rootkit'];
@ -554,7 +652,7 @@
x: s.x + 0.5, y: s.y + 0.5, cx: s.x, cy: s.y, tx: -1, ty: -1,
hp, maxhp: hp, armor: def.armor, speed: def.speed,
reward: Math.max(1, Math.round(def.reward * rewardScale(q.wave))),
leak: def.leak, slow: 0, rem: 0, dead: false, wave: q.wave,
leak: def.leak, slow: 0, slowT: 0, slowAmt: 0, rem: 0, dead: false, wave: q.wave,
};
m.rem = m.air
? Math.hypot(b.core.x - s.x, b.core.y - s.y)
@ -572,7 +670,9 @@
}
while (this.spawnQ.length && this.spawnQ[0].t <= this.time) this.spawnMonster(this.spawnQ.shift());
for (const m of this.monsters) m.slow = 0;
for (const m of this.monsters) { // slow = lingering slow (Orbital Uplink) unless a Rate Limiter says more
if (m.slowT > 0) { m.slow = m.slowAmt; m.slowT -= dt; } else m.slow = 0;
}
for (const t of this.towers) this.updateTower(t, dt);
this.updateBullets(dt);
for (const m of this.monsters) if (!m.dead) this.moveMonster(m, dt);
@ -645,9 +745,9 @@
this.emit({ e: 'leak', x: m.x, y: m.y, n: m.leak });
}
damage(m, raw, src) {
damage(m, raw, src, ignoreArmor) {
if (m.dead) return;
const d = Math.max(raw - m.armor, raw * 0.25);
const d = ignoreArmor ? raw : Math.max(raw - m.armor, raw * 0.25);
m.hp -= d;
if (src) src.dealt += d;
if (m.hp <= 0) {
@ -727,6 +827,35 @@
this.emit({ e: 'shot', k: 'mortar', x: cx, y: cy, a: Math.atan2(gy - cy, gx - cx) });
break;
}
case 'uplink': {
// A beam from the tower through the target out to full range: everything in the line takes full damage
// (armour ignored), then everything near the target is blasted for half and everything hit is slowed for a moment.
const ex = m.x - cx, ey = m.y - cy, el = Math.hypot(ex, ey) || 1, ux = ex / el, uy = ey / el;
const hit = new Set();
for (const o of this.monsters) {
if (o.dead || (o.air ? !def.air : !def.ground)) continue;
const ox = o.x - cx, oy = o.y - cy, along = ox * ux + oy * uy;
if (along < 0 || along > st.range) continue;
if (Math.abs(ox * uy - oy * ux) <= st.width) hit.add(o);
}
const r2 = st.splash * st.splash;
const blast = [];
for (const o of this.monsters) {
if (o.dead || hit.has(o) || (o.air ? !def.air : !def.ground)) continue;
const dx = o.x - m.x, dy = o.y - m.y;
if (dx * dx + dy * dy <= r2) blast.push(o);
}
const slowFor = (o) => {
const eff = Math.min(0.6, st.slowOnHit * (1 - (ENEMIES[o.kind].slowRes || 0)));
if (eff >= o.slowAmt || o.slowT <= 0) o.slowAmt = eff;
o.slowT = Math.max(o.slowT, st.slowFor);
};
for (const o of hit) { this.damage(o, st.dmg, t, true); slowFor(o); }
for (const o of blast) { this.damage(o, st.dmg * 0.5, t, true); slowFor(o); }
this.emit({ e: 'shot', k: 'uplink', x: cx, y: cy, tx: round2(m.x), ty: round2(m.y) });
this.emit({ e: 'beam', x: round2(cx), y: round2(cy), tx: round2(cx + ux * st.range), ty: round2(cy + uy * st.range), w: st.width, bx: round2(m.x), by: round2(m.y), br: st.splash });
break;
}
case 'arc': {
const pts = [[cx, cy], [m.x, m.y]];
const hit = new Set([m]);