Render origin good draft

This commit is contained in:
Dandaedre 2026-08-18 22:30:25 +02:00 committed by vky
parent a2a3b49015
commit 30b268ff9f
Signed by: vky
GPG Key ID: 26F26F83B3CAA4BA
2 changed files with 77 additions and 96 deletions

View File

@ -1,5 +1,13 @@
#import "../setup/setup.typ": theme
// =============================================================================
// CREATURE RENDERER
// =============================================================================
// -----------------------------------------------------------------------------
// STAGE NAMES
// -----------------------------------------------------------------------------
#let stage-name(number) = {
(
(
@ -19,18 +27,26 @@
// FLUFF
// -----------------------------------------------------------------------------
#let fluff(text, author) = {
#let fluff(content, author) = {
block(
width: 100%,
inset: (left: 10pt, right: 10pt, top: 7pt, bottom: 7pt),
inset: (
left: 10pt,
right: 10pt,
top: 7pt,
bottom: 7pt,
),
stroke: (left: 2pt + theme.blood),
fill: theme.parchment-light,
)[
#emph[« #text »]
#emph[« #content »]
#align(right)[
text(size: 9pt, fill: theme.muted)[
--- #author.
#text(
size: 9pt,
fill: theme.muted,
)[
--- #author.
]
]
]
@ -40,7 +56,7 @@
// ABILITY
// -----------------------------------------------------------------------------
#let render-ability(type, content, name: none) = {
#let render-ability(type, description, name: none) = {
let label = if type == "actif" {
"Actif"
} else {
@ -49,7 +65,12 @@
block(
width: 100%,
inset: (top: 4pt, bottom: 4pt, left: 7pt, right: 7pt),
inset: (
top: 4pt,
bottom: 4pt,
left: 7pt,
right: 7pt,
),
stroke: (left: 1.5pt + theme.dark-gold),
fill: theme.parchment-light,
)[
@ -62,17 +83,30 @@
]
#if name != none [
#h(4pt)
#text(
weight: "bold",
fill: theme.blood,
)[ #name ]
]
)[
#name
]
#description
] else {
let passives = description.split(",")
if passives.len() > 0 {
passives
.map(passive => (
box(
inset: (left: 5pt, right: 5pt, top: 3pt, bottom: 3pt),
radius: 8pt,
stroke: 0.5pt + theme.border,
fill: theme.parchment-dark,
)[#text(size: 8.5pt)[#passive]]
))
.join(" ")
}
}
#if name != none [ — ]
#text[
#content
]
]
}
@ -87,16 +121,16 @@
inset: 7pt,
radius: 2pt,
stroke: 0.5pt + theme.border,
fill: theme.parchment-dark,
fill: theme.parchment-light,
)[
#text(
size: 9pt,
weight: "bold",
fill: theme.dark-gold,
)[Les caractéristiques maximum à la création]
)[
Les caractéristiques maximum à la création
]
#v(2pt)
#(
stats
.max
@ -128,72 +162,32 @@
weight: "bold",
fill: theme.blood,
)[
#theme.section-symbol
#text(size: 8pt)[#theme.small-symbol]
#h(4pt)
#stage-name(stage.number)
#h(4pt)
#theme.section-symbol
#text(size: 8pt)[#theme.small-symbol]
]
]
#v(5pt)
#for ability-data in stage.abilities {
render-ability(
ability-data.type,
ability-data.at("description", default: none),
name: ability-data.at("name", default: none),
ability-data.at(
"description",
default: none,
),
name: ability-data.at(
"name",
default: none,
),
)
v(4pt)
}
]
}
// -----------------------------------------------------------------------------
// PASSIVE SUMMARY
// -----------------------------------------------------------------------------
#let render-passives(passives) = {
if passives.len() > 0 {
block(
width: 100%,
inset: (top: 5pt, bottom: 5pt, left: 7pt, right: 7pt),
fill: theme.parchment-dark,
radius: 3pt,
)[
#text(
weight: "bold",
fill: theme.dark-gold,
)[Passifs]
#h(5pt)
#for passive in passives {
block(
inset: (x: 6pt, y: 3pt),
radius: 8pt,
stroke: 0.5pt + theme.border,
fill: theme.parchment-light,
)[
#text(size: 9pt)[#passive]
]
h(3pt)
}
]
}
}
#let get-unnamed-passives(data) = {
data
.stades
.map(stage => stage.abilities)
.flatten()
.filter(ability => (
ability.type == "passif" and ability.at("name", default: none) == none
))
.map(ability => ability.at("description", default: none))
}
// -----------------------------------------------------------------------------
// CREATURE
// -----------------------------------------------------------------------------
@ -202,7 +196,6 @@
// ---------------------------------------------------------------------------
// TITLE
// ---------------------------------------------------------------------------
align(center)[
#text(
size: 20pt,
@ -211,13 +204,13 @@
)[
#data.name
]
#v(3pt)
#line(
length: 45%,
stroke: 1pt + theme.dark-gold,
)
#text(
size: 8pt,
fill: theme.dark-gold,
)[
#theme.section-symbol
]
]
v(8pt)
@ -230,13 +223,13 @@
data.fluff.text,
data.fluff.author,
)
#v(8pt)
]
// ---------------------------------------------------------------------------
// IMAGE
// ---------------------------------------------------------------------------
if data.image != none [
#align(center)[
#block(
@ -257,29 +250,28 @@
// ---------------------------------------------------------------------------
// DESCRIPTION
// ---------------------------------------------------------------------------
data.description
v(6pt)
// ---------------------------------------------------------------------------
// STATS
// ---------------------------------------------------------------------------
let passives = get-unnamed-passives(data)
render-passives(passives)
v(8pt)
if data.stats != none [
#render-stats(data.stats)
#v(8pt)
]
// ---------------------------------------------------------------------------
// STAGES
// ---------------------------------------------------------------------------
for stage in data.stades [
#render-stage(stage)
#v(8pt)
]
}
#let abyssal = yaml("../data/src/origines/abyssal_1.yml")
#heading(level: 1, numbering: none)[Abyssal]

View File

@ -69,7 +69,7 @@ stades:
- number: 2
abilities:
- type: passive
description: |
description: >
Jauge +3, +1 Agilité, Torque +1, +2 Vitesse, -2 Points de Fatigue,
Résistance (Mentale) +1, Résistance (Horreur) +1,
Résistance (Abyssal) (+), Initiative +3
@ -78,7 +78,7 @@ stades:
abilities:
- type: named
name: "Cruelle Justice"
description: |
description: >
À chaque fois que vous subissez une altération, vous pouvez faire
que votre prochaine attaque possède cette même propriété en plus
de ses autres propriétés au niveau 1. Au moment où vous portez cette
@ -87,16 +87,5 @@ stades:
procédé jusqu'à trois fois.
- type: passive
description: |
description: >
Jauge +2, -1 PV (Toutes localisations), +4 Vitesse, +1 Action, Initiative +2
- number: 3
abilities:
- type: passif
description: "Résiste aux dégâts de feu."
- type: actif
name: "Explosion abyssale"
description: "..."
- type: passif
name: "Sang corrompu"
description: "..."