Display rank-up vote winner on the post-voting upkeep screen
The post-voting (deep_upkeep) screen now names who won the rank-up vote and their new rank, instead of just "Voting complete!". Adds Game.last_rank_up_player_id (+ migration), set when votes are tallied and cleared when the next scene begins; falls back to a "no one ranked up" message when there were no votes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -13,6 +13,10 @@
|
||||
|
||||
// Helpers
|
||||
$: hand = state.player.hand_cards ? JSON.parse(state.player.hand_cards) : [];
|
||||
// Winner of the rank-up vote, surfaced on the post-voting (deep_upkeep) screen.
|
||||
$: rankUpWinner = state.game.last_rank_up_player_id
|
||||
? state.players.find(p => p.id === state.game.last_rank_up_player_id)
|
||||
: null;
|
||||
|
||||
// A nominee must be another living, in-play Pi-Rat: not the voter, not a
|
||||
// previous-scene Deep, and not dead / awaiting-recruit (they'd reset to
|
||||
@@ -202,7 +206,11 @@
|
||||
|
||||
{#if state.game.phase === 'deep_upkeep'}
|
||||
<div class="voted-confirmation-box glass-panel">
|
||||
<p class="success-text">✔️ Voting complete! Results tallied.</p>
|
||||
{#if rankUpWinner}
|
||||
<p class="success-text">🏆 {displayName(rankUpWinner)} won the vote and ranked up to Rank {rankUpWinner.rank}!</p>
|
||||
{:else}
|
||||
<p class="success-text">✔️ Voting complete! No one ranked up this time.</p>
|
||||
{/if}
|
||||
</div>
|
||||
{:else if hasVoted}
|
||||
<div class="voted-confirmation-box glass-panel">
|
||||
|
||||
Reference in New Issue
Block a user