Report on alterations
Build Successful The Ravenous rulebook and balance report were built successfully.
Ravenous/ravenous_typst/pipeline/head This commit looks good
Details
Build Successful The Ravenous rulebook and balance report were built successfully.
Ravenous/ravenous_typst/pipeline/head This commit looks good
Details
This commit is contained in:
parent
b7a18b74ff
commit
124dfa636f
|
|
@ -2,6 +2,7 @@
|
|||
#import "/setup/theme/themes.typ" as themes
|
||||
#import "/setup/analysis/class_cost_report.typ": render-class-cost-report
|
||||
#import "/setup/analysis/origin_report.typ": render-origin-report
|
||||
#import "/setup/analysis/alteration_report.typ": alteration-report
|
||||
#import "/setup/analysis/craft_report.typ": render-craft-report
|
||||
#import "/setup/analysis/report_config.typ": chapter-family-enabled
|
||||
|
||||
|
|
@ -88,4 +89,6 @@
|
|||
|
||||
#if chapter-family-enabled("origins") { render-origin-report() }
|
||||
|
||||
#if chapter-family-enabled("alterations") { alteration-report() }
|
||||
|
||||
#if chapter-family-enabled("craft") { render-craft-report() }
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ chapters:
|
|||
- origins.resistances
|
||||
- origins.gauge
|
||||
- origins.passives
|
||||
- alterations.overview
|
||||
- craft.summary
|
||||
- craft.elements
|
||||
- craft.mechanics
|
||||
|
|
|
|||
|
|
@ -0,0 +1,88 @@
|
|||
// Descriptive inventory of glossary alterations and their resistance metadata.
|
||||
#let glossary-sources = (
|
||||
yaml("/data/src/glossaries/alterations.yml"),
|
||||
yaml("/data/src/glossaries/terms.yml"),
|
||||
)
|
||||
#let alteration-source = glossary-sources.flatten().filter(item => item.key.starts-with("al_"))
|
||||
#let element-source = yaml("/data/src/glossaries/elements.yml")
|
||||
|
||||
#let meta-category-label(group) = (
|
||||
"Altérations mineures": "Mineures",
|
||||
"Altérations : Marques": "Marques",
|
||||
"Altérations majeures": "Majeures",
|
||||
"Altérations transcendantales": "Transcendantales",
|
||||
).at(group, default: group)
|
||||
|
||||
#let category-label(macro) = {
|
||||
if macro == none { return none }
|
||||
let key = macro.trim().replace(regex("^@"), "")
|
||||
let found = element-source.find(item => item.key == key)
|
||||
if found == none { macro } else if found.at("long", default: none) != none {
|
||||
found.long
|
||||
} else if type(found.short) == str {
|
||||
found.short
|
||||
} else {
|
||||
macro
|
||||
}
|
||||
}
|
||||
|
||||
#let alterations = alteration-source.map(item => {
|
||||
let custom = item.at("custom", default: (:))
|
||||
(
|
||||
key: item.key,
|
||||
name: item.short,
|
||||
meta-category: meta-category-label(item.group),
|
||||
category-macro: custom.at("category", default: none),
|
||||
category: category-label(custom.at("category", default: none)),
|
||||
resisted-by: custom.at("resisted_by", default: none),
|
||||
difficulty: custom.at("difficulty", default: none),
|
||||
)
|
||||
})
|
||||
|
||||
#let configured-alterations = alterations.filter(item => item.resisted-by != none)
|
||||
#let unconfigured-alterations = alterations.filter(item => item.resisted-by == none)
|
||||
#let categorized-alterations = alterations.filter(item => item.category != none)
|
||||
#let uncategorized-alterations = alterations.filter(item => item.category == none)
|
||||
#let alteration-meta-categories = alterations.map(item => item.meta-category).dedup()
|
||||
#let alteration-categories = categorized-alterations.map(item => item.category).dedup()
|
||||
#let characteristic-order = ("Force", "Agilité", "Perception", "Psyché", "Volonté", "Intelligence", "Chance", "Charisme")
|
||||
#let detected-characteristics(item) = if item.resisted-by == none { () } else {
|
||||
characteristic-order.filter(characteristic => characteristic in item.resisted-by)
|
||||
}
|
||||
#let resisting-characteristics = characteristic-order.filter(characteristic => (
|
||||
configured-alterations.any(item => characteristic in detected-characteristics(item))
|
||||
))
|
||||
#let alteration-difficulties = configured-alterations.map(item => item.difficulty).filter(value => value != none).dedup().sorted(key: str)
|
||||
|
||||
#let meta-category-count(meta-category) = alterations.filter(item => item.meta-category == meta-category).len()
|
||||
#let category-count(category) = categorized-alterations.filter(item => item.category == category).len()
|
||||
#let characteristic-count(characteristic, meta-category: none) = configured-alterations.filter(item => (
|
||||
characteristic in detected-characteristics(item) and (meta-category == none or item.meta-category == meta-category)
|
||||
)).len()
|
||||
#let difficulty-count(difficulty) = configured-alterations.filter(item => item.difficulty == difficulty).len()
|
||||
|
||||
#let meta-category-counts = alteration-meta-categories.map(meta-category => (
|
||||
label: meta-category,
|
||||
count: meta-category-count(meta-category),
|
||||
)).sorted(key: item => -item.count)
|
||||
|
||||
#let category-counts = alteration-categories.map(category => (
|
||||
label: category, count: category-count(category),
|
||||
)).sorted(key: item => -item.count)
|
||||
|
||||
#let characteristic-counts = resisting-characteristics.map(characteristic => (
|
||||
label: characteristic,
|
||||
count: characteristic-count(characteristic),
|
||||
)).sorted(key: item => -item.count)
|
||||
|
||||
#let difficulty-counts = alteration-difficulties.map(difficulty => (
|
||||
label: if type(difficulty) == int { "Difficulté " + str(difficulty) } else { upper(str(difficulty)) },
|
||||
count: difficulty-count(difficulty),
|
||||
))
|
||||
|
||||
#let meta-category-leader = meta-category-counts.first()
|
||||
#let category-leader = if category-counts.len() == 0 { none } else { category-counts.first() }
|
||||
#let characteristic-leader = characteristic-counts.first()
|
||||
#let represented-pairs = configured-alterations.map(item => detected-characteristics(item).map(characteristic => (
|
||||
item.meta-category + "/" + characteristic
|
||||
))).flatten().dedup().len()
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
// Descriptive presentation of alteration resistance metadata.
|
||||
#import "@preview/primaviz:0.6.0": bar-chart, horizontal-bar-chart
|
||||
#import "alteration_metrics.typ": *
|
||||
#import "report_style.typ": chart-theme, metric-card, report-theme
|
||||
#import "../theme/tables.typ" as tables
|
||||
|
||||
#let synthesis-bubble(label, value, note) = block(
|
||||
width: 100%,
|
||||
fill: report-theme.parchment,
|
||||
stroke: 0.7pt + report-theme.border,
|
||||
inset: 9pt,
|
||||
radius: 5pt,
|
||||
)[
|
||||
#text(size: 6.5pt, tracking: 0.07em, weight: "bold", fill: report-theme.heading-subtle)[#upper(label)]
|
||||
#v(2pt)
|
||||
#text(size: 11pt, weight: "bold", fill: report-theme.heading)[#value]
|
||||
#v(2pt)
|
||||
#text(size: 7.2pt, fill: report-theme.muted-ink)[#note]
|
||||
]
|
||||
|
||||
#let alteration-report() = {
|
||||
pagebreak()
|
||||
heading(level: 1)[Altérations]
|
||||
heading(level: 2)[Altérations — Résistances et catégories]
|
||||
|
||||
grid(
|
||||
columns: (1fr,) * 4,
|
||||
column-gutter: 8pt,
|
||||
metric-card("Entrées", alterations.len()),
|
||||
metric-card("Documentées", configured-alterations.len(), note: [avec résistance]),
|
||||
metric-card("Méta-catégories", alteration-meta-categories.len()),
|
||||
metric-card("Catégories", alteration-categories.len(), note: [classifications `custom.category`]),
|
||||
)
|
||||
|
||||
[Cette section restitue uniquement les métadonnées du glossaire : méta-catégorie (`group`), catégorie
|
||||
(`custom.category`),
|
||||
caractéristique de résistance et difficulté. Elle ne produit ni score de
|
||||
puissance, ni pondération d’équilibrage.]
|
||||
|
||||
heading(level: 3)[Caractéristiques représentées]
|
||||
grid(
|
||||
columns: (1fr, 1fr),
|
||||
column-gutter: 12pt,
|
||||
horizontal-bar-chart(
|
||||
(labels: characteristic-counts.map(item => item.label), values: characteristic-counts.map(item => item.count)),
|
||||
width: 100%, height: 175pt, title: [Résistances par caractéristique], show-values: true, theme: chart-theme,
|
||||
),
|
||||
horizontal-bar-chart(
|
||||
(labels: meta-category-counts.map(item => item.label), values: meta-category-counts.map(item => item.count)),
|
||||
width: 100%, height: 175pt, title: [Altérations par méta-catégorie], show-values: true, theme: chart-theme,
|
||||
),
|
||||
)
|
||||
|
||||
heading(level: 3)[Composition des méta-catégories]
|
||||
let matrix = ()
|
||||
for meta-category in alteration-meta-categories {
|
||||
matrix.push(meta-category)
|
||||
for characteristic in resisting-characteristics {
|
||||
let count = characteristic-count(characteristic, meta-category: meta-category)
|
||||
let shade = if count == 0 { report-theme.parchment-light } else {
|
||||
report-theme.chart-2.transparentize(calc.max(18%, 82% - count * 7%))
|
||||
}
|
||||
matrix.push(table.cell(fill: shade)[#count])
|
||||
}
|
||||
}
|
||||
tables.set-table-style(
|
||||
table(
|
||||
columns: (1.45fr,) + (0.72fr,) * resisting-characteristics.len(),
|
||||
align: (left,) + (center,) * resisting-characteristics.len(),
|
||||
table.header([Méta-catégorie], ..resisting-characteristics),
|
||||
..matrix,
|
||||
),
|
||||
table-theme: "steingrund",
|
||||
text-size: 7pt,
|
||||
)
|
||||
|
||||
heading(level: 3)[Synthèse descriptive]
|
||||
grid(
|
||||
columns: (1fr, 1fr, 1fr),
|
||||
column-gutter: 10pt,
|
||||
row-gutter: 10pt,
|
||||
synthesis-bubble(
|
||||
"Caractéristique dominante",
|
||||
characteristic-leader.label + " · " + str(characteristic-leader.count),
|
||||
[plus grand nombre d’altérations résistées],
|
||||
),
|
||||
synthesis-bubble(
|
||||
"Méta-catégorie dominante",
|
||||
meta-category-leader.label + " · " + str(meta-category-leader.count),
|
||||
[plus grand nombre d’entrées du glossaire],
|
||||
),
|
||||
synthesis-bubble(
|
||||
"Couples représentés",
|
||||
str(represented-pairs),
|
||||
[combinaisons méta-catégorie × caractéristique présentes],
|
||||
),
|
||||
synthesis-bubble(
|
||||
"Difficultés présentes",
|
||||
alteration-difficulties.map(str).join(" · "),
|
||||
[valeurs distinctes déclarées],
|
||||
),
|
||||
synthesis-bubble(
|
||||
"Métadonnées manquantes",
|
||||
str(unconfigured-alterations.len()),
|
||||
if unconfigured-alterations.len() == 0 { [aucune entrée] } else {
|
||||
let names = unconfigured-alterations.map(item => item.name)
|
||||
[#names.slice(0, calc.min(4, names.len())).join(", ")#if names.len() > 4 { [ +#(names.len() - 4)] }]
|
||||
},
|
||||
),
|
||||
synthesis-bubble(
|
||||
"Difficulté la plus fréquente",
|
||||
difficulty-counts.sorted(key: item => -item.count).first().label,
|
||||
[#difficulty-counts.sorted(key: item => -item.count).first().count altérations],
|
||||
),
|
||||
)
|
||||
|
||||
heading(level: 3)[Catégories déclarées]
|
||||
if category-counts.len() == 0 {
|
||||
[Aucune catégorie `custom.category` n’est encore déclarée.]
|
||||
} else {
|
||||
grid(
|
||||
columns: (1.2fr, 0.8fr),
|
||||
column-gutter: 12pt,
|
||||
horizontal-bar-chart(
|
||||
(labels: category-counts.map(item => item.label), values: category-counts.map(item => item.count)),
|
||||
width: 100%, height: 145pt, show-values: true, theme: chart-theme,
|
||||
),
|
||||
synthesis-bubble(
|
||||
"Couverture catégorielle",
|
||||
str(categorized-alterations.len()) + " / " + str(alterations.len()),
|
||||
[#uncategorized-alterations.len() altérations restent sans `custom.category`],
|
||||
),
|
||||
)
|
||||
}
|
||||
|
||||
heading(level: 3)[Difficultés déclarées]
|
||||
bar-chart(
|
||||
(labels: difficulty-counts.map(item => item.label), values: difficulty-counts.map(item => item.count)),
|
||||
width: 100%, height: 145pt, show-values: true, theme: chart-theme,
|
||||
)
|
||||
|
||||
heading(level: 3)[Inventaire complet]
|
||||
let rows = alterations.map(item => (
|
||||
item.name,
|
||||
item.meta-category,
|
||||
if item.category == none { [—] } else { item.category },
|
||||
if item.category-macro == none { [—] } else { item.category-macro },
|
||||
if item.resisted-by == none { [—] } else { item.resisted-by },
|
||||
if item.difficulty == none { [—] } else { str(item.difficulty) },
|
||||
))
|
||||
tables.set-table-style(
|
||||
table(
|
||||
columns: (1.15fr, 1.05fr, 0.9fr, 0.8fr, 0.85fr, 0.55fr),
|
||||
align: (left, left, left, left, left, right),
|
||||
table.header([Altération], [Méta-catégorie], [Catégorie], [Macro], [Résistée par], [Difficulté]),
|
||||
..rows.flatten(),
|
||||
),
|
||||
table-theme: "steingrund",
|
||||
text-size: 7.5pt,
|
||||
)
|
||||
}
|
||||
Loading…
Reference in New Issue