diff options
| author | Joel Klinghed <the_jk@spawned.biz> | 2026-11-17 23:12:38 +0100 |
|---|---|---|
| committer | Joel Klinghed <the_jk@spawned.biz> | 2026-11-17 23:12:38 +0100 |
| commit | d64cf3514e5ff1ddb1c7f3ddac9a769db3e7dde0 (patch) | |
| tree | 781ec9f63220f3c15b309658e9b32ad7d9c70b3a /web/src/lib/ui/MonsterRow.svelte | |
| parent | 94e2850fb73005f3fb30af8489905e5cdfb6fac5 (diff) | |
Phase 5: campaign meta, notes, special rules (M5)
Web:
- Note rows: create/edit menu (text, 12-swatch palette, player/monster
link with per-standee selection, delete) with the reference's
create-vs-edit commit semantics; row rendering with target-derived
gradient colour, link indent + connector, standee N:/All: prefixes,
tap-to-edit; whole-list drag-to-reorder (reorderList); quick
per-figure note (setFigureNote) from the status menu
- Special monsters: Ice Wraith "Switch Form" (deck == "Ice Wraith"
gate), summon mark toggle (round-green/summon standee artwork,
standee-nr badges, per-owner grayscale), character summon boxes +
AddSummonMenu (class summons gated by level and standee cap, item
summons from summons.json)
- Ally deck show/hide in the main menu (shouldShowAlliesDeck gate);
settings "clear unlocked" + Special Unlocks menu
- AddSectionMenu parity: search filter, findNrFromScenarioName numeric
ordering, added sections greyed + no-op, #Random Dungeon label
- gameData.ts: SummonModel, ClassData.summons, summons() fetch
Server:
- unlock_special_command_test (last command without a test; ally-deck
hide and remove-sanctuary were already covered)
PLAN.md: Phase 5 boxes checked, M5 progress-log entry
Diffstat (limited to 'web/src/lib/ui/MonsterRow.svelte')
| -rw-r--r-- | web/src/lib/ui/MonsterRow.svelte | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/web/src/lib/ui/MonsterRow.svelte b/web/src/lib/ui/MonsterRow.svelte index e2a4383..ffab021 100644 --- a/web/src/lib/ui/MonsterRow.svelte +++ b/web/src/lib/ui/MonsterRow.svelte @@ -8,7 +8,7 @@ import type { GameSession } from '$lib/state/session'; import type { MonsterItem } from '$lib/protocol/types'; import type { CampaignData } from '$lib/data/gameData'; - import { monsterImage } from '$lib/game/art'; + import { monsterImage, summonImage } from '$lib/game/art'; import { standeeFigureId } from '$lib/game/stats'; import { isFrosthavenStyleForMonster } from '$lib/game/rules'; import { styleTheme } from '$lib/settings'; @@ -80,6 +80,24 @@ if (gs == null || model == null) return false; return isFrosthavenStyleForMonster(model.edition, gs, $styleTheme); }); + + // --- standee images (the reference `MonsterBoxBody`) -------------------- + + /** + * Summon standees show their summon art; a normal standee marked as + * "summoned this round" gets the green summon overlay instead. + */ + function standeeImage(standee: (typeof instances)[number]): string { + if (standee.type === 3) return summonImage(standee.gfx); + if (standee.roundSummoned !== -1) return summonImage('green'); + return monsterImage(standee.gfx); + } + + // Grayscaled while its owner's turn is current (the reference + // `isSummonedThisTurn`: marked this round AND the owner's turn). + function standeeGrayed(standee: (typeof instances)[number]): boolean { + return standee.roundSummoned === ($gameState?.round ?? 0) && currentTurn; + } </script> <div class="row row--monster" class:row--current={currentTurn} class:row--done={gray}> @@ -127,10 +145,15 @@ <button class="monster__box" class:monster__box--dead={standee.health <= 0} + class:monster__box--summon={standee.type === 3} + class:monster__box--grayed={standeeGrayed(standee)} onclick={() => onOpenMenu(figureFor(i))} aria-label={item.id} > - <img src={monsterImage(standee.gfx)} alt="" loading="lazy" /> + <img src={standeeImage(standee)} alt="" loading="lazy" /> + {#if standee.standeeNr > 0} + <span class="monster__box-nr">{standee.standeeNr}</span> + {/if} <span class="monster__box-hp">{standee.health}</span> </button> {/each} |
