summaryrefslogtreecommitdiff
path: root/web/src/lib/game/line/images.ts
blob: 78c10acd7db962fa628c880bbfdc0d56b95c2103 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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';
}