First draft for recipies
Build Successful The Ravenous rulebook, player books, master handbook, and balance reports were built successfully.
Ravenous/ravenous_typst/pipeline/head This commit looks good
Details
Build Successful The Ravenous rulebook, player books, master handbook, and balance reports were built successfully.
Ravenous/ravenous_typst/pipeline/head This commit looks good
Details
This commit is contained in:
parent
8992a2d5ae
commit
dd480b9914
|
|
@ -40,6 +40,9 @@ pipeline {
|
|||
PLAYER_SOURCE_FILE = "player_handbook.typ"
|
||||
PLAYER_OUTPUT_FILE = "Player/Ravenous_player_handbook_build.pdf"
|
||||
PLAYER_PUBLISHED_FILE = "Ravenous_player_handbook.pdf"
|
||||
COOKBOOK_SOURCE_FILE = "cookbook.typ"
|
||||
COOKBOOK_OUTPUT_FILE = "Player/Ravenous_cookbook_build.pdf"
|
||||
COOKBOOK_PUBLISHED_FILE = "Ravenous_cookbook.pdf"
|
||||
SCREEN_SOURCE_FILE = "master_screen.typ"
|
||||
SCREEN_PLAINTEXT_FILE = "Master/Ravenous_master_screen_plaintext.pdf"
|
||||
SCREEN_OUTPUT_FILE = "Master/Ravenous_master_screen_build.pdf"
|
||||
|
|
@ -118,6 +121,12 @@ pipeline {
|
|||
--input disabled_chapters="${PLAYER_DISABLED_CHAPTERS}" \
|
||||
"${PLAYER_SOURCE_FILE}" "${PLAYER_OUTPUT_FILE}"
|
||||
|
||||
echo "Building ${COOKBOOK_SOURCE_FILE} -> ${COOKBOOK_OUTPUT_FILE}"
|
||||
typst compile \
|
||||
--input preset=player-handbook \
|
||||
--input theme="${PLAYER_THEME}" \
|
||||
"${COOKBOOK_SOURCE_FILE}" "${COOKBOOK_OUTPUT_FILE}"
|
||||
|
||||
echo "Building ${MASTER_SOURCE_FILE} -> ${MASTER_PLAINTEXT_FILE}"
|
||||
typst compile "${MASTER_SOURCE_FILE}" "${MASTER_PLAINTEXT_FILE}"
|
||||
|
||||
|
|
@ -145,6 +154,7 @@ pipeline {
|
|||
test -f "${OUTPUT_FILE}"
|
||||
test -f "${BALANCE_OUTPUT_FILE}"
|
||||
test -f "${PLAYER_OUTPUT_FILE}"
|
||||
test -f "${COOKBOOK_OUTPUT_FILE}"
|
||||
test -f "${MASTER_OUTPUT_FILE}"
|
||||
test -f "${MASTER_BALANCE_OUTPUT_FILE}"
|
||||
test -f "${SCREEN_OUTPUT_FILE}"
|
||||
|
|
@ -157,6 +167,7 @@ pipeline {
|
|||
"${OUTPUT_FILE}" \
|
||||
"${BALANCE_OUTPUT_FILE}" \
|
||||
"${PLAYER_OUTPUT_FILE}" \
|
||||
"${COOKBOOK_OUTPUT_FILE}" \
|
||||
"${MASTER_OUTPUT_FILE}" \
|
||||
"${MASTER_BALANCE_OUTPUT_FILE}" \
|
||||
"${SCREEN_OUTPUT_FILE}"
|
||||
|
|
@ -167,7 +178,7 @@ pipeline {
|
|||
stage('Archive PDFs') {
|
||||
steps {
|
||||
archiveArtifacts(
|
||||
artifacts: "${OUTPUT_FILE},${PLAYER_OUTPUT_FILE},${BALANCE_OUTPUT_FILE},${MASTER_OUTPUT_FILE},${MASTER_BALANCE_OUTPUT_FILE},${SCREEN_OUTPUT_FILE}",
|
||||
artifacts: "${OUTPUT_FILE},${PLAYER_OUTPUT_FILE},${COOKBOOK_OUTPUT_FILE},${BALANCE_OUTPUT_FILE},${MASTER_OUTPUT_FILE},${MASTER_BALANCE_OUTPUT_FILE},${SCREEN_OUTPUT_FILE}",
|
||||
fingerprint: true
|
||||
)
|
||||
}
|
||||
|
|
@ -215,8 +226,8 @@ pipeline {
|
|||
publishChecks(
|
||||
conclusion: 'SUCCESS',
|
||||
name: 'Build Successful',
|
||||
summary: 'The Ravenous rulebook, player handbook, master handbook, and balance reports were built successfully.',
|
||||
text: 'All six PDFs were compiled and published successfully.',
|
||||
summary: 'The Ravenous rulebook, player books, master handbook, and balance reports were built successfully.',
|
||||
text: 'All seven PDFs were compiled and published successfully.',
|
||||
title: 'Build Successful'
|
||||
)
|
||||
|
||||
|
|
@ -283,6 +294,10 @@ def deployTo(String targetDir) {
|
|||
"${env.PLAYER_OUTPUT_FILE}" \
|
||||
"${targetDir}/Player/${env.PLAYER_PUBLISHED_FILE}"
|
||||
|
||||
rsync -a \
|
||||
"${env.COOKBOOK_OUTPUT_FILE}" \
|
||||
"${targetDir}/Player/${env.COOKBOOK_PUBLISHED_FILE}"
|
||||
|
||||
rsync -a \
|
||||
"${env.MASTER_OUTPUT_FILE}" \
|
||||
"${targetDir}/Master/${env.MASTER_PUBLISHED_FILE}"
|
||||
|
|
@ -300,6 +315,7 @@ def deployTo(String targetDir) {
|
|||
"${targetDir}/${env.PUBLISHED_FILE}" \
|
||||
"${targetDir}/Report/${env.BALANCE_PUBLISHED_FILE}" \
|
||||
"${targetDir}/Player/${env.PLAYER_PUBLISHED_FILE}" \
|
||||
"${targetDir}/Player/${env.COOKBOOK_PUBLISHED_FILE}" \
|
||||
"${targetDir}/Master/${env.MASTER_PUBLISHED_FILE}" \
|
||||
"${targetDir}/Report/${env.MASTER_BALANCE_PUBLISHED_FILE}" \
|
||||
"${targetDir}/Master/${env.SCREEN_PUBLISHED_FILE}"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
// Importable cookbook chapter. This file deliberately owns no document setup,
|
||||
// cover, or page configuration so it can later be included from main.typ.
|
||||
#import "/setup/setup.typ": recipe
|
||||
|
||||
= Restauration
|
||||
|
||||
#recipe("restoration", "varak-forestier")
|
||||
#recipe("restoration", "aile-croustillante-du-veilleur")
|
||||
#recipe("restoration", "bison-des-rizieres")
|
||||
#recipe("restoration", "cuisses-orage-sur-terre")
|
||||
#recipe("restoration", "jambon-du-dernier-rempart")
|
||||
|
||||
#pagebreak()
|
||||
= Alchimie
|
||||
|
||||
#recipe("alchemy", "baume-de-toutes-plaies")
|
||||
#recipe("alchemy", "venin-du-patient")
|
||||
#recipe("alchemy", "fiole-du-soleil-bref")
|
||||
#recipe("alchemy", "elan-de-la-bete-double")
|
||||
|
||||
#pagebreak()
|
||||
= Forge
|
||||
|
||||
#recipe("forge", "lame-du-guet")
|
||||
#recipe("forge", "brise-montagne")
|
||||
#recipe("forge", "cuirasse-des-brumes")
|
||||
#recipe("forge", "rempart-vagabond")
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
// Player-facing collection of ready-made craft recipes.
|
||||
#import "/setup/setup.typ": config_main, disable-warnings, build-config, theme
|
||||
#show: config_main
|
||||
|
||||
#if not build-config.warnings { disable-warnings() }
|
||||
|
||||
#page(numbering: none)[
|
||||
#align(center + horizon)[
|
||||
#text(size: 42pt, weight: "bold", fill: theme.blood)[RAVENOUS]
|
||||
#v(0.7em)
|
||||
#text(size: 18pt, tracking: 0.08em, fill: theme.gold)[LIVRE DE RECETTES]
|
||||
#v(2em)
|
||||
#text(size: 11pt, style: "italic")[Cuisine et alchimie à l'usage des chasseurs]
|
||||
]
|
||||
]
|
||||
#pagebreak()
|
||||
|
||||
#include "chapters/cookbook.typ"
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
restoration:
|
||||
varak-forestier:
|
||||
name: Varak forestier
|
||||
flavor: Un steak puissant adouci par les courges et enfoui sous une généreuse poêlée de champignons.
|
||||
main: [Varak (Tigre)]
|
||||
sides: [Perkol (Courges), Falisum (Champignons)]
|
||||
seasonings: []
|
||||
|
||||
aile-croustillante-du-veilleur:
|
||||
name: Aile croustillante du veilleur
|
||||
flavor: Une volaille dorée, servie sur des navets fondants et relevée juste assez pour garder les chasseurs alertes.
|
||||
main: [Volmet (Volaille)]
|
||||
sides: [Biadok (Navets)]
|
||||
seasonings: [Cramenbouche]
|
||||
|
||||
bison-des-rizieres:
|
||||
name: Bison des rizières
|
||||
flavor: "Le solide repas des longues marches : un steak de Gorkul, du riz et une pointe de force béhémoth."
|
||||
main: [Gorkul (Bison)]
|
||||
sides: [Antaris (Riz)]
|
||||
seasonings: [Keraspon Salés (Béhémoth)]
|
||||
|
||||
cuisses-orage-sur-terre:
|
||||
name: Cuisses d'orage sur terre
|
||||
flavor: Le froid de la Gelora rencontre une sauce draconique, accompagné de patates assez robustes pour soutenir le mélange.
|
||||
main: [Gelora (Grenouille des Glaces)]
|
||||
sides: [Taltos (Patates)]
|
||||
seasonings: [Brakenflame (Dragon)]
|
||||
|
||||
jambon-du-dernier-rempart:
|
||||
name: Jambon du dernier rempart
|
||||
flavor: Un plat généreux et lourd, conçu pour remettre sur pied ceux qui comptent retourner au front.
|
||||
main: [Borekkoï (Béhémoth)]
|
||||
sides: [Ardanta (Racine)]
|
||||
seasonings: [Sauce Brakenn (Baloth)]
|
||||
|
||||
alchemy:
|
||||
baume-de-toutes-plaies:
|
||||
name: Baume de toutes plaies
|
||||
flavor: Une préparation végétale épaisse qui se répand sur chaque blessure avant de se résorber sans laisser de trace.
|
||||
solvents: [Sève de Al'thraost]
|
||||
reagents: [Mogrine]
|
||||
transmutations: [Renaturalisation majeure]
|
||||
|
||||
venin-du-patient:
|
||||
name: Venin du patient
|
||||
flavor: Un enduit sombre qui s'accroche aux armes et laisse le poison faire son œuvre longtemps après l'impact.
|
||||
solvents: [Sébum Borekkoï]
|
||||
reagents: [Coripore Rabique]
|
||||
transmutations: [Surrinfusion progressive]
|
||||
|
||||
fiole-du-soleil-bref:
|
||||
name: Fiole du soleil bref
|
||||
flavor: Le verre s'illumine une fraction de seconde avant qu'une vague de feu n'engloutisse les alentours.
|
||||
solvents: [Sève de Al'thraost]
|
||||
reagents: [Delicates Romoreti]
|
||||
transmutations: [Enrichissement instable]
|
||||
|
||||
elan-de-la-bete-double:
|
||||
name: Élan de la bête double
|
||||
flavor: Deux essences animales suspendues dans un plasma abyssal pour aiguiser ensemble force et agilité.
|
||||
solvents: [Plasma d'Yggdrishen]
|
||||
reagents: [Varak (Tigre), Baloth Joueur (Baloth)]
|
||||
transmutations: [Quintessentiation zélée]
|
||||
|
||||
forge:
|
||||
lame-du-guet:
|
||||
name: Lame du guet
|
||||
flavor: Une épée équilibrée et fiable, pensée pour les longues patrouilles loin des ateliers.
|
||||
base: { shape: Épée, nature: Medium }
|
||||
materials: [Acier, Vif Argent]
|
||||
finishings: [Affilage, Rematriçage]
|
||||
|
||||
brise-montagne:
|
||||
name: Brise-montagne
|
||||
flavor: Un marteau dont chaque couche de métal semble avoir été posée pour abattre quelque chose de plus grand que son porteur.
|
||||
base: { shape: Marteau, nature: Heavy }
|
||||
materials: [Quakeite, Fer]
|
||||
finishings: [Dentelage Sangrétique, Renforcement]
|
||||
|
||||
cuirasse-des-brumes:
|
||||
name: Cuirasse des brumes
|
||||
flavor: Une armure étonnamment discrète dont les plaques claires se fondent dans les pluies du Nord.
|
||||
base: { shape: Armure, nature: Medium }
|
||||
materials: [Mithril, Vistalt]
|
||||
finishings: [Peaufinage, Cure de cohésion]
|
||||
|
||||
rempart-vagabond:
|
||||
name: Rempart vagabond
|
||||
flavor: Ce lourd bouclier porte les traces de dizaines de routes et refuse pourtant obstinément de céder.
|
||||
base: { shape: Bouclier, nature: Heavy }
|
||||
materials: [Acier, Barylium]
|
||||
finishings: [Renforcement, Sangrification Profonde]
|
||||
|
|
@ -0,0 +1,450 @@
|
|||
// Data-driven, player-facing craft recipes.
|
||||
//
|
||||
// Ingredient names intentionally match the first column of the craft CSVs.
|
||||
// This keeps cookbook recipes readable while leaving the source tables as the
|
||||
// single source of truth for costs, difficulty, toxicity, and effects.
|
||||
#import "core/macros.typ" as macros
|
||||
#import "theme/variables.typ": theme
|
||||
#import "/chapters/craft/forge-data.typ": equipments
|
||||
#let ddlvl = macros.ddlvl
|
||||
|
||||
#let restoration-main = csv("/data/src/craft/restoration_main.csv")
|
||||
#let restoration-sides = csv("/data/src/craft/restoration_sides.csv")
|
||||
#let restoration-seasonings = csv("/data/src/craft/restoration_seasoning.csv")
|
||||
#let alchemy-solvents = csv("/data/src/craft/alchemy_solvants.csv")
|
||||
#let alchemy-reagents = csv("/data/src/craft/alchemy_reagents.csv")
|
||||
#let alchemy-transmutations = csv("/data/src/craft/alchemy_transmutations.csv")
|
||||
#let forge-materials = csv("/data/src/craft/forge_materials.csv")
|
||||
#let forge-finishings = csv("/data/src/craft/forge_finishing.csv")
|
||||
#let recipe-catalog = yaml("/data/config/recipes.yaml")
|
||||
|
||||
#let number(value) = if type(value) == int or type(value) == float {
|
||||
value
|
||||
} else {
|
||||
// Craft CSVs store values as renderable calls such as `#ddlvl(-2)`.
|
||||
// Re-evaluate those calls with numeric stand-ins so recipes can total them.
|
||||
eval(
|
||||
value.replace("#", ""),
|
||||
mode: "code",
|
||||
scope: (
|
||||
ddlvl: (n, ..args) => n,
|
||||
toxlvl: (n, ..args) => n,
|
||||
winelvl: (n, ..args) => n,
|
||||
timelvl: (n, ..args) => n,
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
#let markup(value) = if type(value) != str {
|
||||
value
|
||||
} else if value == "" {
|
||||
[]
|
||||
} else {
|
||||
eval(value, mode: "markup", scope: macros.bigscope)
|
||||
}
|
||||
|
||||
#let find-ingredient(data, ingredient, stage) = {
|
||||
let matches = data.slice(1).filter(row => row.first() == ingredient)
|
||||
if matches.len() == 0 {
|
||||
panic("Unknown " + stage + " ingredient: " + ingredient)
|
||||
}
|
||||
matches.first()
|
||||
}
|
||||
|
||||
#let component(
|
||||
name,
|
||||
stage,
|
||||
tier,
|
||||
cost,
|
||||
difficulty,
|
||||
toxicity,
|
||||
effect,
|
||||
satiety: 0,
|
||||
finishing: 0,
|
||||
detail: none,
|
||||
) = (
|
||||
name: name,
|
||||
stage: stage,
|
||||
tier: number(tier),
|
||||
cost: number(cost),
|
||||
difficulty: number(difficulty),
|
||||
toxicity: number(toxicity),
|
||||
satiety: number(satiety),
|
||||
finishing: number(finishing),
|
||||
effect: markup(effect),
|
||||
detail: detail,
|
||||
)
|
||||
|
||||
#let restoration-component(name, stage) = {
|
||||
if stage == "Principal" {
|
||||
let row = find-ingredient(restoration-main, name, stage)
|
||||
component(
|
||||
row.at(0), stage, row.at(2), row.at(3), row.at(4), row.at(5), row.at(7),
|
||||
satiety: row.at(6),
|
||||
detail: row.at(1),
|
||||
)
|
||||
} else if stage == "Accompagnement" {
|
||||
let row = find-ingredient(restoration-sides, name, stage)
|
||||
component(
|
||||
row.at(0), stage, row.at(1), row.at(2), row.at(3), row.at(4), row.at(6),
|
||||
satiety: row.at(5),
|
||||
)
|
||||
} else {
|
||||
let row = find-ingredient(restoration-seasonings, name, stage)
|
||||
component(
|
||||
row.at(0), stage, row.at(1), row.at(3), 0, row.at(4), row.at(5),
|
||||
finishing: row.at(2),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#let alchemy-component(name, stage) = {
|
||||
if stage == "Solvant" {
|
||||
let row = find-ingredient(alchemy-solvents, name, stage)
|
||||
component(row.at(0), stage, row.at(1), row.at(2), row.at(3), row.at(4), row.at(5))
|
||||
} else if stage == "Réagent" {
|
||||
let row = find-ingredient(alchemy-reagents, name, stage)
|
||||
component(
|
||||
row.at(0), stage, row.at(2), row.at(3), row.at(4), row.at(5), row.at(7),
|
||||
detail: [#row.at(1) — #row.at(6)],
|
||||
)
|
||||
} else {
|
||||
let row = find-ingredient(alchemy-transmutations, name, stage)
|
||||
component(
|
||||
row.at(0), stage, row.at(1), row.at(3), 0, 0, row.at(5),
|
||||
finishing: row.at(2),
|
||||
detail: [Production : #row.at(4)],
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#let find-equipment(shape, nature) = {
|
||||
let matches = equipments.filter(item => (
|
||||
item.shape_name == shape
|
||||
and (item.nature_name == nature or item.nature_category == nature)
|
||||
))
|
||||
if matches.len() == 0 {
|
||||
panic("Unknown forge equipment: " + shape + " + " + nature)
|
||||
}
|
||||
matches.first()
|
||||
}
|
||||
|
||||
#let forge-display-name(item) = {
|
||||
let feminine = item.shape_name in ("Épée", "Hache", "Arbalète", "Armure")
|
||||
let plural = item.shape_name == "Griffes"
|
||||
let adjective = if feminine or plural {
|
||||
(
|
||||
Light: "légère",
|
||||
Medium: "moyenne",
|
||||
Heavy: "lourde",
|
||||
SuperHeavy: "super-lourde",
|
||||
).at(item.nature_category) + if plural { "s" } else { "" }
|
||||
} else {
|
||||
(
|
||||
Light: "léger",
|
||||
Medium: "moyen",
|
||||
Heavy: "lourd",
|
||||
SuperHeavy: "super-lourd",
|
||||
).at(item.nature_category)
|
||||
}
|
||||
item.shape_name + " " + adjective
|
||||
}
|
||||
|
||||
#let forge-base-component(item) = component(
|
||||
forge-display-name(item),
|
||||
"Base",
|
||||
item.tier,
|
||||
item.cost,
|
||||
item.difficulty,
|
||||
0,
|
||||
[Dégâts #item.damage, dégâts par réussite #item.p_damage, réussites max #item.rmax, brise-armure #item.armor_break, protection #item.protection, intégrité #item.integrity.],
|
||||
detail: item.shape_name + " + " + item.nature_name,
|
||||
)
|
||||
|
||||
#let forge-material-component(name, target) = {
|
||||
let row = find-ingredient(forge-materials, name, "Matériau")
|
||||
let effect-index = if target == "Weapons" { 4 } else { 5 }
|
||||
component(
|
||||
row.at(0),
|
||||
"Matériau",
|
||||
row.at(1),
|
||||
row.at(2),
|
||||
row.at(3),
|
||||
0,
|
||||
row.at(effect-index),
|
||||
)
|
||||
}
|
||||
|
||||
#let forge-finishing-component(name, stage) = {
|
||||
let row = find-ingredient(forge-finishings, name, stage)
|
||||
component(
|
||||
row.at(0),
|
||||
stage,
|
||||
row.at(2),
|
||||
row.at(4),
|
||||
0,
|
||||
0,
|
||||
row.at(5),
|
||||
finishing: row.at(3),
|
||||
)
|
||||
}
|
||||
|
||||
#let assemble(craft, stages) = {
|
||||
let components = stages.map(stage => stage.ingredients.map(
|
||||
name => (stage.load)(name, stage.name),
|
||||
)).flatten()
|
||||
if components.len() == 0 { panic("A recipe needs at least one ingredient") }
|
||||
|
||||
let tier = 0
|
||||
let cost = 0
|
||||
let difficulty = 0
|
||||
let toxicity = 0
|
||||
let satiety = 0
|
||||
let finishing = 0
|
||||
for item in components {
|
||||
tier = calc.max(tier, item.tier)
|
||||
cost += item.cost
|
||||
difficulty += item.difficulty
|
||||
toxicity += item.toxicity
|
||||
satiety += item.satiety
|
||||
finishing += item.finishing
|
||||
}
|
||||
|
||||
(
|
||||
craft: craft,
|
||||
stages: stages,
|
||||
components: components,
|
||||
tier: tier,
|
||||
cost: cost,
|
||||
difficulty: difficulty,
|
||||
toxicity: toxicity,
|
||||
satiety: satiety,
|
||||
finishing: finishing,
|
||||
)
|
||||
}
|
||||
|
||||
// Build the calculated restoration data without rendering it.
|
||||
#let restoration(main: (), sides: (), seasonings: ()) = assemble(
|
||||
"Restauration",
|
||||
(
|
||||
(name: "Principal", ingredients: main, load: restoration-component),
|
||||
(name: "Accompagnement", ingredients: sides, load: restoration-component),
|
||||
(name: "Assaisonnement", ingredients: seasonings, load: restoration-component),
|
||||
),
|
||||
)
|
||||
|
||||
// Build the calculated alchemy data without rendering it.
|
||||
#let alchemy(solvents: (), reagents: (), transmutations: ()) = assemble(
|
||||
"Alchimie",
|
||||
(
|
||||
(name: "Solvant", ingredients: solvents, load: alchemy-component),
|
||||
(name: "Réagent", ingredients: reagents, load: alchemy-component),
|
||||
(name: "Transmutation", ingredients: transmutations, load: alchemy-component),
|
||||
),
|
||||
)
|
||||
|
||||
// Forge bases come from weapons.db; materials and finishings remain CSV-backed.
|
||||
#let forge(shape, nature, materials: (), finishings: ()) = {
|
||||
let equipment = find-equipment(shape, nature)
|
||||
let result = assemble(
|
||||
"Forge",
|
||||
(
|
||||
(
|
||||
name: "Base",
|
||||
ingredients: (forge-display-name(equipment),),
|
||||
load: (..args) => forge-base-component(equipment),
|
||||
),
|
||||
(
|
||||
name: "Matériau",
|
||||
ingredients: materials,
|
||||
load: (name, ..args) => forge-material-component(name, equipment.apply_category),
|
||||
),
|
||||
(
|
||||
name: "Finition",
|
||||
ingredients: finishings,
|
||||
load: forge-finishing-component,
|
||||
),
|
||||
),
|
||||
)
|
||||
result.insert("equipment", equipment)
|
||||
result
|
||||
}
|
||||
|
||||
#let metric(label, value) = block(
|
||||
width: 100%,
|
||||
inset: (x: 3.5pt, y: 3pt),
|
||||
fill: theme.parchment-light,
|
||||
stroke: 0.4pt + theme.border,
|
||||
radius: 2pt,
|
||||
)[
|
||||
#text(size: 6.2pt, fill: theme.muted)[#label]\
|
||||
#text(size: 7.8pt, weight: "bold")[#value]
|
||||
]
|
||||
|
||||
// Render any calculated craft data as a complete cookbook card.
|
||||
#let render-recipe(name, ingredients, flavor: none) = {
|
||||
let craft = ingredients.craft
|
||||
let metrics = if craft == "Forge" {
|
||||
let item = ingredients.equipment
|
||||
(
|
||||
([Maîtrise], ingredients.tier),
|
||||
([Coût], ddlvl(ingredients.cost)),
|
||||
([Difficulté], ddlvl(ingredients.difficulty)),
|
||||
([Finition], if ingredients.finishing == 0 { [—] } else { ddlvl(ingredients.finishing) }),
|
||||
([Dég. / réussite], [#item.damage / +#item.p_damage]),
|
||||
([Prot. / Int.], [#item.protection / #item.integrity]),
|
||||
)
|
||||
} else {
|
||||
(
|
||||
([Maîtrise], ingredients.tier),
|
||||
([Coût], ddlvl(ingredients.cost)),
|
||||
([Difficulté], ddlvl(ingredients.difficulty)),
|
||||
([Toxicité], ddlvl(ingredients.toxicity)),
|
||||
([Satiété], if ingredients.satiety == 0 { [—] } else { ddlvl(ingredients.satiety) }),
|
||||
([Finition], if ingredients.finishing == 0 { [—] } else { ddlvl(ingredients.finishing) }),
|
||||
)
|
||||
}
|
||||
block(
|
||||
width: 100%,
|
||||
breakable: false,
|
||||
above: 6pt,
|
||||
below: 6pt,
|
||||
fill: theme.parchment,
|
||||
stroke: 0.75pt + theme.gold,
|
||||
inset: 8.5pt,
|
||||
radius: 4pt,
|
||||
)[
|
||||
#text(size: 6.2pt, weight: "bold", tracking: 0.08em, fill: theme.dark-gold)[#craft]
|
||||
#h(0.65em)
|
||||
#text(size: 12.5pt, weight: "bold", fill: theme.heading)[#name]
|
||||
#if flavor != none {
|
||||
linebreak()
|
||||
v(2.5pt)
|
||||
text(size: 7.6pt, style: "italic", fill: theme.muted)[#flavor]
|
||||
}
|
||||
#v(5pt)
|
||||
#grid(
|
||||
columns: (1fr, 1fr, 1fr, 1fr, 1fr, 1fr),
|
||||
gutter: 3pt,
|
||||
..metrics.map(pair => metric(pair.at(0), pair.at(1))),
|
||||
)
|
||||
#v(5pt)
|
||||
#grid(
|
||||
columns: (0.9fr, 2.1fr),
|
||||
column-gutter: 8pt,
|
||||
align: top,
|
||||
text(size: 7.1pt)[
|
||||
#text(size: 6.6pt, weight: "bold", fill: theme.dark-gold)[Ingrédients]
|
||||
#for stage in ingredients.stages {
|
||||
if stage.ingredients.len() > 0 {
|
||||
[
|
||||
- *#stage.name* : #stage.ingredients.join([, ])
|
||||
]
|
||||
}
|
||||
}
|
||||
],
|
||||
text(size: 7.1pt)[
|
||||
#text(size: 6.6pt, weight: "bold", fill: theme.dark-gold)[Effets]
|
||||
#for item in ingredients.components {
|
||||
[
|
||||
- *#item.name*#if item.detail != none { [ (#item.detail)] } : #item.effect
|
||||
]
|
||||
}
|
||||
],
|
||||
)
|
||||
]
|
||||
}
|
||||
|
||||
#let restoration-recipe(
|
||||
name,
|
||||
flavor: none,
|
||||
main: (),
|
||||
sides: (),
|
||||
seasonings: (),
|
||||
) = render-recipe(
|
||||
name,
|
||||
restoration(
|
||||
main: main,
|
||||
sides: sides,
|
||||
seasonings: seasonings,
|
||||
),
|
||||
flavor: flavor,
|
||||
)
|
||||
|
||||
#let alchemy-recipe(
|
||||
name,
|
||||
flavor: none,
|
||||
solvents: (),
|
||||
reagents: (),
|
||||
transmutations: (),
|
||||
) = render-recipe(
|
||||
name,
|
||||
alchemy(
|
||||
solvents: solvents,
|
||||
reagents: reagents,
|
||||
transmutations: transmutations,
|
||||
),
|
||||
flavor: flavor,
|
||||
)
|
||||
|
||||
#let forge-recipe(
|
||||
name,
|
||||
shape,
|
||||
nature,
|
||||
flavor: none,
|
||||
materials: (),
|
||||
finishings: (),
|
||||
) = render-recipe(
|
||||
name,
|
||||
forge(
|
||||
shape,
|
||||
nature,
|
||||
materials: materials,
|
||||
finishings: finishings,
|
||||
),
|
||||
flavor: flavor,
|
||||
)
|
||||
|
||||
// Render a catalog entry from data/config/recipes.yaml. This is the public
|
||||
// authoring API used by books and chapters: `#recipe("restoration", "name")`.
|
||||
#let recipe(module, recipe-name) = {
|
||||
if module not in recipe-catalog {
|
||||
panic("Unknown recipe module: " + module)
|
||||
}
|
||||
let recipes = recipe-catalog.at(module)
|
||||
if recipe-name not in recipes {
|
||||
panic("Unknown recipe in " + module + ": " + recipe-name)
|
||||
}
|
||||
let entry = recipes.at(recipe-name)
|
||||
let flavor = entry.at("flavor", default: none)
|
||||
|
||||
if module == "restoration" {
|
||||
restoration-recipe(
|
||||
entry.name,
|
||||
flavor: flavor,
|
||||
main: entry.at("main", default: ()),
|
||||
sides: entry.at("sides", default: ()),
|
||||
seasonings: entry.at("seasonings", default: ()),
|
||||
)
|
||||
} else if module == "alchemy" {
|
||||
alchemy-recipe(
|
||||
entry.name,
|
||||
flavor: flavor,
|
||||
solvents: entry.at("solvents", default: ()),
|
||||
reagents: entry.at("reagents", default: ()),
|
||||
transmutations: entry.at("transmutations", default: ()),
|
||||
)
|
||||
} else if module == "forge" {
|
||||
let base = entry.at("base")
|
||||
forge-recipe(
|
||||
entry.name,
|
||||
base.shape,
|
||||
base.nature,
|
||||
flavor: flavor,
|
||||
materials: entry.at("materials", default: ()),
|
||||
finishings: entry.at("finishings", default: ()),
|
||||
)
|
||||
} else {
|
||||
panic("Recipe module has no constructor: " + module)
|
||||
}
|
||||
}
|
||||
|
|
@ -27,6 +27,7 @@
|
|||
#let st = setup.st
|
||||
#let csv-table = setup.csv-table
|
||||
#let craft-table = setup.craft-table
|
||||
#let recipe = setup.recipe
|
||||
|
||||
#let gls = setup.gls
|
||||
#let gls-description = setup.gls-description
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#import "theme/tables.typ" as st
|
||||
#import "generation/csv-table.typ" as csv_import
|
||||
#import "generation/radar_graphs.typ" as radar
|
||||
#import "craft_recipes.typ" as craft_recipes
|
||||
|
||||
//----- Re-expose shared project data -----
|
||||
#let ravenous = ravenous
|
||||
|
|
@ -32,6 +33,7 @@
|
|||
#let bigscope = macros.bigscope
|
||||
#let csv-table = csv_import.csv-table
|
||||
#let craft-table = csv_import.craft-table
|
||||
#let recipe = craft_recipes.recipe
|
||||
#let radar-fields = radar.radar-fields
|
||||
#let radar-graph = radar.radar-graph
|
||||
#let balancing-totals = radar.balancing-totals
|
||||
|
|
|
|||
Loading…
Reference in New Issue