gloomhaven-box.js 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. const genGloomhavenBox = () => {
  2. const items = [];
  3. // map-tiles
  4. Array.from("abcdefghijkl").forEach((l, index) => {
  5. items.push({
  6. type: "image",
  7. content: `https://raw.githubusercontent.com/romgar/gloomhaven/master/images/map-tiles/${l}1a.png`,
  8. backContent: `https://raw.githubusercontent.com/romgar/gloomhaven/master/images/map-tiles/${l}1b.png`,
  9. text: `${l}1a`,
  10. backText: `${l}1b`,
  11. x: 558,
  12. y: 80,
  13. });
  14. items.push({
  15. type: "image",
  16. content: `https://raw.githubusercontent.com/romgar/gloomhaven/master/images/map-tiles/${l}2a.png`,
  17. backContent: `https://raw.githubusercontent.com/romgar/gloomhaven/master/images/map-tiles/${l}2b.png`,
  18. text: `${l}2a`,
  19. backText: `${l}2b`,
  20. x: 558,
  21. y: 80,
  22. });
  23. });
  24. // character-mats
  25. items.push({
  26. type: "image",
  27. content:
  28. "https://raw.githubusercontent.com/romgar/gloomhaven/master/images/character-mats/brute.png",
  29. backContent:
  30. "https://raw.githubusercontent.com/romgar/gloomhaven/master/images/character-mats/brute-back.png",
  31. width: 300,
  32. x: 500,
  33. y: 500,
  34. });
  35. items.push({
  36. type: "image",
  37. content:
  38. "https://raw.githubusercontent.com/romgar/gloomhaven/master/images/character-mats/spellweaver.png",
  39. backContent:
  40. "https://raw.githubusercontent.com/romgar/gloomhaven/master/images/character-mats/spellweaver-back.png",
  41. width: 300,
  42. x: 500,
  43. y: 700,
  44. });
  45. items.push({
  46. type: "image",
  47. content:
  48. "https://raw.githubusercontent.com/romgar/gloomhaven/master/images/character-perks/brute-perks.png",
  49. width: 300,
  50. x: 1000,
  51. y: 500,
  52. });
  53. items.push({
  54. type: "image",
  55. content:
  56. "https://raw.githubusercontent.com/romgar/gloomhaven/master/images/character-perks/spellweaver-perks.png",
  57. width: 300,
  58. x: 1000,
  59. y: 700,
  60. });
  61. // Attack modifiers
  62. [...Array(19).keys()].forEach((_, index) => {
  63. const number = index < 9 ? "0" + (index + 1) : "" + (index + 1);
  64. items.push({
  65. type: "image",
  66. content: `https://raw.githubusercontent.com/romgar/gloomhaven/master/images/attack-modifiers/base/player/am-p-${number}.png`,
  67. backContent: "/games/gloom/attackback.png",
  68. width: 100,
  69. flipped: true,
  70. x: 300,
  71. y: 200,
  72. });
  73. });
  74. [...Array(19).keys()].forEach((_, index) => {
  75. const number = index < 9 ? "0" + (index + 1) : "" + (index + 1);
  76. items.push({
  77. type: "image",
  78. content: `https://raw.githubusercontent.com/romgar/gloomhaven/master/images/attack-modifiers/base/player/am-p-${number}.png`,
  79. backContent: "/games/gloom/attackback.png",
  80. width: 100,
  81. flipped: true,
  82. x: 300,
  83. y: 600,
  84. });
  85. });
  86. [...Array(19).keys()].forEach((_, index) => {
  87. const number = index < 9 ? "0" + (index + 1) : "" + (index + 1);
  88. items.push({
  89. type: "image",
  90. content: `https://raw.githubusercontent.com/romgar/gloomhaven/master/images/attack-modifiers/base/monster/am-m-${number}.png`,
  91. backContent: "/games/gloom/attackback.png",
  92. width: 100,
  93. flipped: true,
  94. x: 1000,
  95. y: 300,
  96. });
  97. });
  98. // monster tokens
  99. [...Array(10).keys()].forEach((_, index) => {
  100. items.push({
  101. type: "image",
  102. content:
  103. "https://raw.githubusercontent.com/romgar/gloomhaven/master/images/monster-tokens/bandit-guard.png",
  104. x: 1400 + 60 * index,
  105. y: 0,
  106. width: 60,
  107. text: `${index}`,
  108. overlay: {
  109. content: `https://raw.githubusercontent.com/romgar/gloomhaven/master/images/monster-tokens/${
  110. index < 7 ? "normal" : "elite"
  111. }-monster-overlay.svg`,
  112. },
  113. });
  114. items.push({
  115. type: "image",
  116. content:
  117. "https://raw.githubusercontent.com/romgar/gloomhaven/master/images/monster-tokens/bandit-archer.png",
  118. x: 1400 + 60 * index,
  119. y: 50,
  120. width: 60,
  121. text: `${index}`,
  122. overlay: {
  123. content: `https://raw.githubusercontent.com/romgar/gloomhaven/master/images/monster-tokens/${
  124. index < 7 ? "normal" : "elite"
  125. }-monster-overlay.svg`,
  126. },
  127. });
  128. items.push({
  129. type: "image",
  130. content:
  131. "https://raw.githubusercontent.com/romgar/gloomhaven/master/images/monster-tokens/living-bones.png",
  132. x: 1400 + 60 * index,
  133. y: 100,
  134. width: 60,
  135. text: `${index}`,
  136. overlay: {
  137. content: `https://raw.githubusercontent.com/romgar/gloomhaven/master/images/monster-tokens/${
  138. index < 7 ? "normal" : "elite"
  139. }-monster-overlay.svg`,
  140. },
  141. });
  142. });
  143. const monsters = ["bandit-guard", "bandit-archer", "living-bones"];
  144. monsters.forEach((monsterName, index) => {
  145. items.push({
  146. type: "image",
  147. content: `https://raw.githubusercontent.com//romgar/gloomhaven/master/images/monster-stat-cards/${monsterName}-0.png`,
  148. x: 1300 + 200 * index,
  149. y: 300,
  150. width: 200,
  151. });
  152. });
  153. // Overlay tokens
  154. [...Array(20).keys()].forEach((_, index) => {
  155. items.push({
  156. type: "image",
  157. content:
  158. "https://raw.githubusercontent.com//romgar/gloomhaven/master/images/overlay-tokens/treasures/coin-1.png",
  159. x: 1100 + 20 * index,
  160. y: 200,
  161. width: 50,
  162. });
  163. });
  164. items.push({
  165. type: "counter",
  166. label: "Life #1",
  167. value: 0,
  168. x: 100,
  169. y: 100,
  170. width: 50,
  171. });
  172. items.push({
  173. type: "counter",
  174. label: "Life #2",
  175. value: 0,
  176. x: 100,
  177. y: 300,
  178. width: 50,
  179. });
  180. items.push({
  181. type: "counter",
  182. label: "XP #1",
  183. value: 0,
  184. x: 300,
  185. y: 100,
  186. width: 50,
  187. });
  188. items.push({
  189. type: "counter",
  190. label: "XP #2",
  191. value: 0,
  192. x: 300,
  193. y: 300,
  194. width: 50,
  195. });
  196. items.push({
  197. type: "counter",
  198. label: "Gold #1",
  199. value: 0,
  200. x: 100,
  201. y: 600,
  202. width: 50,
  203. });
  204. items.push({
  205. type: "counter",
  206. label: "Gold #2",
  207. value: 0,
  208. x: 100,
  209. y: 900,
  210. width: 50,
  211. });
  212. items.push({
  213. type: "image",
  214. content:
  215. "https://raw.githubusercontent.com//romgar/gloomhaven/master/images/overlay-tokens/treasures/treasure.png",
  216. x: 1100,
  217. y: 250,
  218. width: 50,
  219. });
  220. [...Array(2).keys()].forEach((_, index) => {
  221. items.push({
  222. type: "image",
  223. content:
  224. "https://raw.githubusercontent.com//romgar/gloomhaven/master/images/overlay-tokens/doors/stone-door.png",
  225. x: 1100 + 20 * index,
  226. y: 300,
  227. width: 50,
  228. });
  229. });
  230. [...Array(2).keys()].forEach((_, index) => {
  231. items.push({
  232. type: "image",
  233. content:
  234. "https://raw.githubusercontent.com//romgar/gloomhaven/master/images/overlay-tokens/traps/spike-pit-trap.png",
  235. x: 1100 + 20 * index,
  236. y: 350,
  237. width: 50,
  238. });
  239. });
  240. [...Array(2).keys()].forEach((_, index) => {
  241. items.push({
  242. type: "image",
  243. content:
  244. "https://raw.githubusercontent.com//romgar/gloomhaven/master/images/overlay-tokens/obstacles/table.png",
  245. x: 1100 + 20 * index,
  246. y: 400,
  247. width: 50,
  248. });
  249. });
  250. // Character ability cards
  251. const brute = {
  252. code: "BR",
  253. abilityCards: {
  254. "level-1": [
  255. "eye-for-an-eye",
  256. "grab-and-go",
  257. "leaping-cleave",
  258. "overwhelming-assault",
  259. "provoking-roar",
  260. "shield-bash",
  261. "spare-dagger",
  262. "sweeping-blow",
  263. "trample",
  264. "warding-strength",
  265. ],
  266. "level-X": ["balanced-measure", "skewer", "wall-of-doom"],
  267. "level-2": ["fatal-advance", "juggernaut"],
  268. "level-3": ["brute-force", "hook-and-chain"],
  269. "level-4": ["devastating-hack", "unstoppable-charge"],
  270. "level-5": ["skirmishing-maneuver", "whirlwind"],
  271. "level-6": ["immovable-phalanx", "quietus"],
  272. "level-7": ["crippling-offensive", "defensive-tactics"],
  273. "level-8": ["frenzied-onslaught", "selfish-retribution"],
  274. "level-9": ["face-your-end", "king-of-the-hill"],
  275. },
  276. backCard:
  277. "https://raw.githubusercontent.com//romgar/gloomhaven/master/images/character-ability-cards/BR/br-back.png",
  278. icon:
  279. "https://raw.githubusercontent.com/romgar/gloomhaven/master/images/character-icons/brute-icon.png",
  280. token:
  281. "https://raw.githubusercontent.com/romgar/gloomhaven/master/images/character-icons/brute-character-token.png",
  282. };
  283. brute.abilityCards["level-1"].forEach((abilityName, index) => {
  284. items.push({
  285. type: "image",
  286. content: `https://raw.githubusercontent.com//romgar/gloomhaven/master/images/character-ability-cards/${brute.code}/${abilityName}.png`,
  287. backContent: `${brute.backCard}`,
  288. x: 0 + 100 * index,
  289. y: 1000,
  290. width: 100,
  291. });
  292. });
  293. items.push({
  294. type: "image",
  295. content: brute.icon,
  296. x: 450,
  297. y: 500,
  298. width: 40,
  299. });
  300. [...Array(5).keys()].forEach((_, index) => {
  301. items.push({
  302. type: "image",
  303. content: brute.token,
  304. x: 350 + 20 * index,
  305. y: 500,
  306. width: 20,
  307. });
  308. });
  309. const spellWeaver = {
  310. code: "SW",
  311. abilityCards: {
  312. "level-1": [
  313. "fire-orbs",
  314. "flame-strike",
  315. "freezing-nova",
  316. "frost-armor",
  317. "impaling-eruption",
  318. "mana-bolt",
  319. "reviving-ether",
  320. "ride-the-wind",
  321. ],
  322. "level-X": ["crackling-air", "hardened-spikes", "aid-from-the-ether"],
  323. "level-2": ["flashing-burst", "icy-blast"],
  324. "level-3": ["elemental-aid", "cold-fire"],
  325. "level-4": ["forked-beam", "spirit-of-doom"],
  326. "level-5": ["engulfed-in-flames", "chromatic-explosion"],
  327. "level-6": ["frozen-night", "living-torch"],
  328. "level-7": ["stone-fists", "twin-restoration"],
  329. "level-8": ["zephyr-wings", "cold-front"],
  330. "level-9": ["inferno", "black-hole"],
  331. },
  332. backCard:
  333. "https://raw.githubusercontent.com//romgar/gloomhaven/master/images/character-ability-cards/SW/sw-back.png",
  334. icon:
  335. "https://raw.githubusercontent.com/romgar/gloomhaven/master/images/character-icons/spellweaver-icon.png",
  336. token:
  337. "https://raw.githubusercontent.com/romgar/gloomhaven/master/images/character-icons/spellweaver-character-token.png",
  338. };
  339. spellWeaver.abilityCards["level-1"].forEach((abilityName, index) => {
  340. items.push({
  341. type: "image",
  342. content: `https://raw.githubusercontent.com//romgar/gloomhaven/master/images/character-ability-cards/${spellWeaver.code}/${abilityName}.png`,
  343. backContent: `${spellWeaver.backCard}`,
  344. x: 0 + 100 * index,
  345. y: 1150,
  346. width: 100,
  347. });
  348. });
  349. items.push({
  350. type: "image",
  351. content: spellWeaver.icon,
  352. x: 450,
  353. y: 700,
  354. width: 40,
  355. });
  356. [...Array(5).keys()].forEach((_, index) => {
  357. items.push({
  358. type: "image",
  359. content: spellWeaver.token,
  360. x: 350 + 20 * index,
  361. y: 700,
  362. width: 20,
  363. });
  364. });
  365. const elements = ["ice", "air", "earth", "fire", "dark", "light"];
  366. elements.forEach((elementName, index) => {
  367. items.push({
  368. type: "image",
  369. content: `https://raw.githubusercontent.com/romgar/gloomhaven/master/images/elements/${elementName}-element.svg`,
  370. x: 0 + 30 * index,
  371. y: 0,
  372. width: 30,
  373. });
  374. });
  375. items.push({
  376. type: "image",
  377. content:
  378. "https://raw.githubusercontent.com/romgar/gloomhaven/master/images/elements/element-matboard.png",
  379. x: 0,
  380. y: 100,
  381. width: 300,
  382. });
  383. const ailments = [
  384. "reinforcement",
  385. "disarm",
  386. "immobilise",
  387. "wound",
  388. "stun",
  389. "invisible",
  390. "confusion",
  391. "poison",
  392. ];
  393. [...Array(5).keys()].forEach((_, rowIndex) => {
  394. ailments.forEach((ailmentName, index) => {
  395. items.push({
  396. type: "image",
  397. content: `https://raw.githubusercontent.com/romgar/gloomhaven/master/images/ailments/${ailmentName}.png`,
  398. x: 0 + 30 * index,
  399. y: 100 + 40 * rowIndex,
  400. width: 30,
  401. });
  402. });
  403. const battleGoals = [
  404. "aggressor",
  405. "diehard",
  406. "dynamo",
  407. "executioner",
  408. "explorer",
  409. "fasthealer",
  410. "hoarder",
  411. "hunter",
  412. "indigent",
  413. "layabout",
  414. "masochist",
  415. "neutralizer",
  416. "opener",
  417. "pacifist",
  418. "plunderer",
  419. "professional",
  420. "protector",
  421. "purist",
  422. "sadist",
  423. "scrambler",
  424. "straggler",
  425. "streamliner",
  426. "workhorse",
  427. "zealot",
  428. ];
  429. battleGoals.forEach((battleGoalName, index) => {
  430. items.push({
  431. type: "image",
  432. content: `https://raw.githubusercontent.com/romgar/gloomhaven/master/images/battle-goals/${battleGoalName}.png`,
  433. backContent:
  434. "https://raw.githubusercontent.com/romgar/gloomhaven/master/images/battle-goals/battlegoal-back.png",
  435. x: 200 + 1 * index,
  436. y: 0 + 1 * index,
  437. flipped: true,
  438. width: 30,
  439. });
  440. });
  441. const characterItems = [
  442. "boots-of-striding",
  443. "cloak-of-invisibility",
  444. "eagle-eye-goggles",
  445. "heater-shield",
  446. "hide-armor",
  447. "iron-helmet",
  448. "leather-armor",
  449. "minor-healing-potion",
  450. "minor-power-potion",
  451. "minor-stamina-potion",
  452. "piercing-bow",
  453. "poison-dagger",
  454. "war-hammer",
  455. "winged-shoes",
  456. ];
  457. characterItems.forEach((itemName, index) => {
  458. items.push({
  459. type: "image",
  460. content: `https://raw.githubusercontent.com/romgar/gloomhaven/master/images/items/1-14/${itemName}.png`,
  461. x: 1500 + 40 * index,
  462. y: 1500,
  463. flipped: true,
  464. width: 40,
  465. });
  466. });
  467. });
  468. return {
  469. items,
  470. board: { size: 3000, scale: 0.5 },
  471. };
  472. };
  473. export const gameBox = genGloomhavenBox();
  474. export default gameBox;