summaryrefslogtreecommitdiff
path: root/web/src/lib/game/line/images.ts
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/lib/game/line/images.ts')
-rw-r--r--web/src/lib/game/line/images.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/web/src/lib/game/line/images.ts b/web/src/lib/game/line/images.ts
new file mode 100644
index 0000000..78c10ac
--- /dev/null
+++ b/web/src/lib/game/line/images.ts
@@ -0,0 +1,20 @@
+/**
+ * Ability-icon image URLs. The Dart server serves the reference app's
+ * `assets/images/abilities/` under `/images/abilities/`. In Frosthaven style a
+ * token's graphic gets the `_fh` suffix when the base token has a
+ * Gloomhaven/Frosthaven variant pair (the reference's `hasGHVersion`); the
+ * decision uses the base token, not the `_black`-suffixed filename.
+ */
+
+import { hasGHVersion } from './tokens';
+
+/** The icon URL for [gfx] (already resolved to its base / `_black` / flyer form). */
+export function abilityImage(gfx: string, baseToken: string, frosthavenStyle: boolean): string {
+ const suffix = frosthavenStyle && hasGHVersion(baseToken) ? '_fh' : '';
+ return `/images/abilities/${gfx}${suffix}.png`;
+}
+
+/** The divider graphic (`divider_fh.png`, or the boss variant for left cards). */
+export function dividerImage(boss: boolean): string {
+ return boss ? '/images/abilities/divider_boss_fh.png' : '/images/abilities/divider_fh.png';
+}