A sprung Ward earns its victim a modal, not a buried log line
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
0d2b25ad74
commit
db0eeebcd5
@@ -52,10 +52,16 @@
|
||||
let fxCancels: (() => void)[] = [];
|
||||
/** A trap drawn by YOU earns a modal; buried log lines get missed. */
|
||||
let trapNotice = $state<string | null>(null);
|
||||
/** A Ward sprung on YOU earns the same courtesy. */
|
||||
let wardBite = $state<{ owner: string; amount: number } | null>(null);
|
||||
function playFx(events: Parameters<typeof scheduleFx>[0]) {
|
||||
if (!view) return;
|
||||
for (const e of events) {
|
||||
if (e.type === "trapSprung" && e.player === view.you && e.cardId) trapNotice = e.cardId;
|
||||
if (e.type === "wardSprung" && e.victim === view.you) {
|
||||
const dmg = events.find((d) => d.type === "damaged" && d.player === e.victim && d.source === "warded treasure");
|
||||
wardBite = { owner: e.owner, amount: dmg?.type === "damaged" ? dmg.amount : 0 };
|
||||
}
|
||||
}
|
||||
if (!prefs.flourishes) return;
|
||||
fxCancels.push(scheduleFx(
|
||||
@@ -1339,6 +1345,21 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if wardBite}
|
||||
<div class="scrim attack-scrim" role="alertdialog" aria-label="a warded treasure">
|
||||
<div class="attack-notice">
|
||||
<div class="attack-headline">The treasure bites back!</div>
|
||||
<div class="attack-card"><Card card={{ instanceId: "ward-notice", cardId: "ward" }} /></div>
|
||||
<div class="attack-power">
|
||||
{wardBite.amount > 0
|
||||
? `${wardBite.owner}'s treasure was warded — it bites you for ${wardBite.amount} point${wardBite.amount === 1 ? "" : "s"}.`
|
||||
: `${wardBite.owner}'s treasure was warded — but its bite finds no purchase.`}
|
||||
</div>
|
||||
<button class="stamp big" onclick={() => (wardBite = null)}>Grit your teeth</button>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if view && view.outOfTurnWindow?.playerId === view.you && !momentSeen}
|
||||
<div class="scrim attack-scrim" role="alertdialog" aria-label="your interruption">
|
||||
<div class="attack-notice">
|
||||
|
||||
Reference in New Issue
Block a user