Classes trigrams
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
177948cca7
commit
822e06dc3b
|
|
@ -25,6 +25,20 @@ build:
|
|||
# Always excluded, in addition to the exclusions from the selected preset.
|
||||
disabled_chapters: []
|
||||
|
||||
# Canonical three-letter identifiers used in compact tables and graphs.
|
||||
schools:
|
||||
trigrams:
|
||||
artilleur: ART
|
||||
einerjar: EIN
|
||||
franc-tireur: FTI
|
||||
guerrier-mage: GMA
|
||||
heavy-weapon-specialist: ALD
|
||||
lancier: LAN
|
||||
mage-bestial: MBE
|
||||
maitre-lames: MLA
|
||||
protecteur: PRO
|
||||
sangremage: SGM
|
||||
|
||||
# Chapter IDs are defined in main.typ. Presets only list what they hide, so new
|
||||
# chapters remain visible by default and a custom exclusion stays easy to audit.
|
||||
presets:
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
#import "@preview/primaviz:0.6.0": bar-chart, horizontal-bar-chart
|
||||
#import "class_alterations.typ": *
|
||||
#import "class_costs.typ": class-display-names
|
||||
#import "report_style.typ": chart-theme, metric-card, rounded
|
||||
#import "report_style.typ": chart-theme, metric-card, report-theme, rounded
|
||||
#import "../generation/radar_graphs.typ": school-sources
|
||||
#import "../theme/tables.typ" as tables
|
||||
#import "../build_config.typ": school-tiers
|
||||
#import "../build_config.typ": school-tiers, school-trigram
|
||||
|
||||
#let school-alteration-report() = {
|
||||
pagebreak()
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
labels: school-alteration-counts.map(item => item.label.replace("_", " ")),
|
||||
values: school-alteration-counts.map(item => item.count),
|
||||
),
|
||||
width: 100%, height: 175pt, show-values: true, theme: chart-theme,
|
||||
width: 100%, height: calc.max(175pt, school-alteration-counts.len() * 13pt), show-values: true, theme: chart-theme,
|
||||
)
|
||||
|
||||
heading(level: 3)[Mentions par classe et par tier]
|
||||
|
|
@ -59,6 +59,37 @@
|
|||
),
|
||||
)
|
||||
|
||||
pagebreak(weak: true)
|
||||
heading(level: 3)[Types d’altération par classe]
|
||||
[La matrice croît verticalement lorsque de nouvelles altérations sont ajoutées.
|
||||
La teinte indique le nombre de mentions; une cellule blanche signifie zéro.]
|
||||
let matrix = ()
|
||||
for alteration in school-alteration-counts {
|
||||
matrix.push(alteration.label.replace("_", " "))
|
||||
for name in school-sources.keys() {
|
||||
let count = school-alterations(class: name, subtype: alteration.label).len()
|
||||
let shade = if count == 0 { report-theme.parchment-light } else {
|
||||
report-theme.chart-2.transparentize(calc.max(16%, 82% - count * 9%))
|
||||
}
|
||||
matrix.push(table.cell(fill: shade)[#count])
|
||||
}
|
||||
matrix.push(str(alteration.count))
|
||||
}
|
||||
tables.set-table-style(
|
||||
table(
|
||||
columns: (1.3fr,) + (0.56fr,) * school-sources.len() + (0.5fr,),
|
||||
align: (left,) + (center,) * school-sources.len() + (right,),
|
||||
table.header(
|
||||
[Altération],
|
||||
..school-sources.keys().map(name => [#school-trigram(name)]),
|
||||
[Total],
|
||||
),
|
||||
..matrix,
|
||||
),
|
||||
table-theme: "steingrund",
|
||||
text-size: 6.6pt,
|
||||
)
|
||||
|
||||
heading(level: 3)[Contraintes moyennes par altération]
|
||||
let rows = school-alteration-profiles.map(profile => (
|
||||
profile.subtype.replace("_", " "), str(profile.count),
|
||||
|
|
@ -77,25 +108,6 @@
|
|||
text-size: 7.4pt,
|
||||
)
|
||||
|
||||
heading(level: 3)[Matrice classe × altération]
|
||||
let matrix = ()
|
||||
for name in school-sources.keys() {
|
||||
matrix.push(class-display-names.at(name))
|
||||
for alteration in school-alteration-counts {
|
||||
matrix.push(str(school-alterations(class: name, subtype: alteration.label).len()))
|
||||
}
|
||||
}
|
||||
tables.set-table-style(
|
||||
table(
|
||||
columns: (1.45fr,) + (0.85fr,) * school-alteration-counts.len(),
|
||||
align: (left,) + (right,) * school-alteration-counts.len(),
|
||||
table.header([Classe], ..school-alteration-counts.map(item => [#item.label.replace("_", " ")])),
|
||||
..matrix,
|
||||
),
|
||||
table-theme: "steingrund",
|
||||
text-size: 7pt,
|
||||
)
|
||||
|
||||
heading(level: 3)[Audit des mentions]
|
||||
let audit = all-school-alterations.map(item => (
|
||||
item.display, "T" + str(item.tier), item.technique,
|
||||
|
|
|
|||
|
|
@ -3,22 +3,10 @@
|
|||
#import "class_categories.typ": *
|
||||
#import "report_style.typ": chart-theme, metric-card
|
||||
#import "../theme/tables.typ" as tables
|
||||
#import "../build_config.typ": school-trigram
|
||||
|
||||
#let percent-label(value) = str(calc.round(value / 1%, digits: 1)) + " %"
|
||||
|
||||
#let class-short-labels = (
|
||||
artilleur: "Art.",
|
||||
einerjar: "Ein.",
|
||||
franc-tireur: "F.-tir.",
|
||||
guerrier-mage: "G. mage",
|
||||
heavy-weapon-specialist: "A. lourdes",
|
||||
lancier: "Lanc.",
|
||||
mage-bestial: "M. best.",
|
||||
maitre-lames: "M.-lames",
|
||||
protecteur: "Prot.",
|
||||
sangremage: "Sang.",
|
||||
)
|
||||
|
||||
#let school-tier-matrix(exclusive) = {
|
||||
let rows = ()
|
||||
for school in exclusive-by-class {
|
||||
|
|
@ -146,7 +134,7 @@
|
|||
align: (left,) + (center,) * exclusive-by-class.len(),
|
||||
table.header(
|
||||
[Catégorie],
|
||||
..exclusive-by-class.map(item => [#class-short-labels.at(item.name)]),
|
||||
..exclusive-by-class.map(item => [#school-trigram(item.name)]),
|
||||
),
|
||||
..category-matrix,
|
||||
),
|
||||
|
|
|
|||
|
|
@ -3,24 +3,11 @@
|
|||
#import "class_costs.typ": *
|
||||
#import "report_style.typ": chart-theme, metric-card, report-theme, rounded
|
||||
#import "../theme/tables.typ" as tables
|
||||
#import "../build_config.typ": school-tiers
|
||||
#import "../build_config.typ": school-tiers, school-trigram
|
||||
#import "class_alteration_report.typ": school-alteration-report
|
||||
#import "class_category_report.typ": school-category-report
|
||||
#import "report_config.typ": chapter-enabled
|
||||
|
||||
#let class-chart-labels = (
|
||||
artilleur: "Art.",
|
||||
einerjar: "Ein.",
|
||||
franc-tireur: "F.-tir.",
|
||||
guerrier-mage: "G. mage",
|
||||
heavy-weapon-specialist: "A. lourdes",
|
||||
lancier: "Lanc.",
|
||||
mage-bestial: "M. best.",
|
||||
maitre-lames: "M.-lames",
|
||||
protecteur: "Prot.",
|
||||
sangremage: "Sang.",
|
||||
)
|
||||
|
||||
#let cost-series(metrics) = (
|
||||
(
|
||||
name: "Sang",
|
||||
|
|
@ -102,7 +89,7 @@
|
|||
#let tier-comparison(classes, tier-number) = {
|
||||
let names = classes.keys()
|
||||
let tier-index = tier-number - 1
|
||||
let labels = names.map(name => class-chart-labels.at(name))
|
||||
let labels = names.map(school-trigram)
|
||||
let metrics = classes.values().map(class-data => class-data.tiers.at(tier-index))
|
||||
|
||||
heading(level: 3)[Tier #tier-number]
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
#let document-config = config.document
|
||||
#let raw-build-config = config.build
|
||||
#let presets = config.presets
|
||||
#let school-trigrams = config.schools.trigrams
|
||||
|
||||
// `--input preset=...` is the lightweight entry point for alternate editions.
|
||||
#let selected-preset = sys.inputs.at("preset", default: raw-build-config.preset)
|
||||
|
|
@ -34,4 +35,25 @@
|
|||
#let origin-enabled(id) = selected-origin == "" or selected-origin == id
|
||||
#let school-enabled(id) = selected-school == "" or selected-school == id
|
||||
|
||||
#let school-trigram(name) = {
|
||||
let normalized = lower(name).replace("_", "-").replace(" ", "-")
|
||||
let canonical = (
|
||||
franc-tirreur: "franc-tireur",
|
||||
specialiste-armes-lourdes: "heavy-weapon-specialist",
|
||||
).at(normalized, default: normalized)
|
||||
if canonical not in school-trigrams {
|
||||
panic("Unknown school trigram: " + name)
|
||||
}
|
||||
school-trigrams.at(canonical)
|
||||
}
|
||||
|
||||
#assert(max-tier-exclusive > 1, message: "build.max_tier_exclusive must be greater than 1")
|
||||
#assert(
|
||||
school-trigrams.values().all(value => value.match(regex("^[A-Z]{3}$")) != none),
|
||||
message: "Every schools.trigrams value must contain exactly three uppercase letters",
|
||||
)
|
||||
#assert.eq(
|
||||
school-trigrams.values().dedup().len(),
|
||||
school-trigrams.len(),
|
||||
message: "schools.trigrams values must be unique",
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in New Issue