Add teaching mode: admin can seed themselves as scene-1 Deep
An admin can now opt into "teaching mode" from the lobby, seeding themselves as the Rank-3 player who must play the Deep in the first scene (instead of leaving it to the random starting-rank roll), so they can run the table for new crews. - Game.teaching_deep_player_id (+ Alembic migration) - maybe_finish_assign_techniques honors it before rolling ranks, so both the normal flow and the dev-mode skip path respect it - Admin-gated POST .../teaching-mode toggle (pre-rank phases only) - Lobby checkbox UI, greyed out if another admin already volunteered Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -24,6 +24,19 @@
|
||||
starting = false;
|
||||
}
|
||||
}
|
||||
|
||||
$: teaching = state.game.teaching_deep_player_id === state.player.id;
|
||||
$: teachingTakenByOther = state.game.teaching_deep_player_id && !teaching;
|
||||
|
||||
async function toggleTeaching() {
|
||||
try {
|
||||
await apiRequest(`/game/${state.game.id}/player/${state.player.id}/teaching-mode`, 'POST', {
|
||||
enabled: !teaching
|
||||
});
|
||||
} catch (err) {
|
||||
console.error("Failed to toggle teaching mode:", err);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="lobby-view text-center">
|
||||
@@ -72,6 +85,22 @@
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{#if state.player.is_admin}
|
||||
<div class="teaching-box glass-panel">
|
||||
<label class="checkbox-label" class:disabled={teachingTakenByOther}>
|
||||
<input type="checkbox" checked={teaching} disabled={teachingTakenByOther} on:change={toggleTeaching}>
|
||||
<span>📚 <strong>Teaching mode:</strong> I'll be the Deep for the first scene</span>
|
||||
</label>
|
||||
<p class="info-text">
|
||||
{#if teachingTakenByOther}
|
||||
Another admin has already volunteered to teach as the Deep.
|
||||
{:else}
|
||||
Seeds you as the Rank-3 player who must play the Deep in scene 1, so you can run the table for new crews. Otherwise it's assigned at random.
|
||||
{/if}
|
||||
</p>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<div class="lobby-action">
|
||||
{#if state.player.is_admin}
|
||||
{#if state.players.length >= 3 || state.game.dev_mode}
|
||||
|
||||
Reference in New Issue
Block a user