import { PRICES, VALUES } from "../engine/catalog.js"; import { esc, icon, token } from "./art.js"; const names = { kava: "Kava", copra: "Copra", beef: "Beef" }; export function exportGoodHelp(good, state = "available") { if (state === "delivered") return `${names[good]}: already delivered`; if (state === "empty") return `${names[good]}: empty`; return `${names[good]}: −${PRICES[good]} vatus → +${VALUES[good]} prosperity`; } export function exportReference(colorBlind = false) { const completionHelp = "Completing a ship adds 2 to the good's reward."; const amount = (kind, value, help) => value === 1 ? icon(kind, help) : token(kind, value, help); return `
${Object.keys( PRICES, ) .map((good) => { const help = exportGoodHelp(good); return `${icon(good, help, false, colorBlind)}${amount("coin", PRICES[good], help)}${amount("point", VALUES[good], help)}`; }) .join( "", )}${icon("buy", completionHelp)}${icon("check", completionHelp)}${token("point", 2)}
`; }