Between Scenes (Scene #{state.game.current_scene_number} Concluded)

Upkeep and tallying. Nominate a crewmate to Rank Up, redraw hand cards for resting Deep players, and ready up for the next scene.

{#if state.player.is_dead && !state.player.is_ghost}

💀 Your Pi-Rat Has Died!

Your story arc is complete! You went out in a blaze of glory (or retired honorably). You must now choose how your journey continues:

{#if !isRolling}

Ghosts look back into the living world, watch over friends, and help their crew. New recruits start fresh at Rank 1 with surprise Secret Techniques and a name based on their smell.

{:else}

Create Your New Recruit

{#if rollingError}
{rollingError}
{/if}
{/if}
{:else}

1. Pirate Ranking (Voting)

Every player (including the Deep) nominates one crewmate who best exemplified pirate qualities in the previous scene. Previous Deep players are ineligible to receive votes.

{#if state.game.phase === 'deep_upkeep'}

✔️ Voting complete! Results tallied.

{:else if state.votes.find(v => v.voter_player_id === state.player.id)}

✔️ Vote submitted! Waiting for other players to submit their nominations.

{:else}
{/if} {#if state.game.phase !== 'deep_upkeep'}

Nomination Progress:

{#each state.players as p} {@const voted = state.votes.some(v => v.voter_player_id === p.id)}
{p.name} {voted ? 'Done' : 'Voting...'}
{/each}
{/if}

2. Resting Deep Upkeep

{#if state.player.role === "deep"}

You controlled the Deep in the last scene and your Pi-Rat was resting. You will discard your current hand and redraw back up to your maximum hand size.

{#if state.game.phase === 'between_scenes'}

Voting is currently in progress. Hand refresh will begin after voting concludes.

{:else if state.game.phase === 'deep_upkeep'}

Your Hand Size Limit: {maxHandSize} cards.
Drag cards to the "Discard Pile" zone to discard them, or click them to move them.

Hand (Keep)

{#each keepCards as card}
handleDragStart(e, card)} on:click={() => moveToDiscard(card)} style="cursor: pointer;" title="Click or drag to discard">
{card.startsWith('Joker') ? '🃏' : card.slice(0, -1)} {card.startsWith('Joker') ? '' : {'C': '♣️', 'S': '♠️', 'H': '♥️', 'D': '♦️'}[card.slice(-1)]}
{#if card.startsWith('Joker')} 🃏 {:else} {{'C': '♣️', 'S': '♠️', 'H': '♥️', 'D': '♦️'}[card.slice(-1)]} {/if}
{card.startsWith('Joker') ? '🃏' : card.slice(0, -1)} {card.startsWith('Joker') ? '' : {'C': '♣️', 'S': '♠️', 'H': '♥️', 'D': '♦️'}[card.slice(-1)]}
{:else}

No cards in hand.

{/each}

Discard Pile

{#each discardCards as card}
handleDragStart(e, card)} on:click={() => moveToKeep(card)} style="cursor: pointer;" title="Click or drag to keep">
{card.startsWith('Joker') ? '🃏' : card.slice(0, -1)} {card.startsWith('Joker') ? '' : {'C': '♣️', 'S': '♠️', 'H': '♥️', 'D': '♦️'}[card.slice(-1)]}
{#if card.startsWith('Joker')} 🃏 {:else} {{'C': '♣️', 'S': '♠️', 'H': '♥️', 'D': '♦️'}[card.slice(-1)]} {/if}
{card.startsWith('Joker') ? '🃏' : card.slice(0, -1)} {card.startsWith('Joker') ? '' : {'C': '♣️', 'S': '♠️', 'H': '♥️', 'D': '♦️'}[card.slice(-1)]}
{:else}

Drag cards here to discard them.

{/each}
{#if isOverLimit}

⚠️ Discard Required: You have selected {keepCards.length} cards to keep, which exceeds your maximum hand limit of {maxHandSize}. Please discard at least {keepCards.length - maxHandSize} card(s).

{/if} {/if}
{:else} {#if state.game.phase === 'between_scenes'}

Your Pi-Rat was active. Your hand cards carry over to the next scene.

{:else if state.game.phase === 'deep_upkeep'}

Waiting for resting Deep player to refresh their hand...

{/if} {/if}

Crew Rank Ledger:

    {#each state.players as p}
  • {p.name}: Rank {p.rank} {#if p.role === 'deep'}Deep{:else if p.is_ghost}Ghost{:else}Pi-Rat{/if}
  • {/each}
{#if state.game.phase === 'deep_upkeep'} {#if state.player.role === 'deep'}

⚠️ Please complete your Hand Refresh above to proceed to the next scene.

{:else}

Waiting for resting Deep player to refresh their hand...

{/if} {:else} {#if !state.votes.find(v => v.voter_player_id === state.player.id)}

⚠️ You must nominate a crewmate above before you can ready up.

{:else} {#if state.player.is_ready}

Ready! Waiting for other players to ready up...

{:else} {/if} {/if} {/if} {#if state.player.is_creator && state.game.phase === 'between_scenes'}

All good stories end. When the crew agrees the legend is complete:

{/if}
{/if}