fix: human fight UX — SSE challenge input, fighter sprites, battle log questions, left-side positioning

- Add SSE human_challenge listener for instant input activation with auto-focus
- Buffer challenges during 3s round cooldown, apply with correct remaining time
- Map 'human' archetype to fighter-looking archetypes (boxer, ninja, etc.) in sprite system
- Show challenge questions in battle log via round_start SSE events
- Ensure human players are always botA (left side) in queue matchmaking

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dorian
2026-03-07 15:46:16 +00:00
co-authored by Claude Opus 4.6
parent 8448f1d823
commit 1906821452
3 changed files with 352 additions and 276 deletions
+5 -2
View File
@@ -91,8 +91,11 @@ export async function joinQueue(botId: string): Promise<string> {
const opponent = waitingQueue.shift()!
clearTimeout(opponent.timeoutHandle)
// Start the fight
const fightId = await startFight(opponent.botId, botId)
// Start the fight — ensure human players are always botA (left side)
const isHumanJoiner = bot.webhookUrl === 'http://human.local/'
const fightId = isHumanJoiner
? await startFight(botId, opponent.botId)
: await startFight(opponent.botId, botId)
opponent.resolve(fightId)
return fightId
}