From 08a1697345ff47208c794550f4eea6b31def45f3 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Sat, 18 Jul 2026 17:37:54 +0200 Subject: [PATCH] Fixes generation --- Cargo.toml | 2 +- crates/make/src/makepdf_structs.rs | 2 +- crates/monsters/src/monster_export.rs | 36 +++++++++++++---- crates/monsters/src/monster_structs.rs | 8 +++- helper_config.toml | 55 ++++++++++++++------------ ravenous_databases | 2 +- 6 files changed, 67 insertions(+), 38 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c641083..1c24ca1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ resolver = "3" # edition = "2024" # license = "MIT OR Apache-2.0" [workspace.package] -version = "0.3.3" +version = "0.3.4" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/crates/make/src/makepdf_structs.rs b/crates/make/src/makepdf_structs.rs index b04ec25..2d51273 100644 --- a/crates/make/src/makepdf_structs.rs +++ b/crates/make/src/makepdf_structs.rs @@ -238,7 +238,7 @@ pub(super) enum LineType { NoGlossary, #[regex( - r"/usr/share/texlive/texmf-dist/fonts/type1/public/fontawesome5[^\n]+", + r" ?\)?, /// Generic color describing the creature #[TEXT] pub colors: String, @@ -188,6 +191,9 @@ pub struct MonsterSingleAttack { /// The string format is up‑to‑you – many people store JSON or a custom DSL here. #[TEXT] pub effects: String, + /// The description of the whole attack + #[TEXT] + pub description_all: Option, /// Minimum parry rating required to avoid the ability’s effect. #[INTEGER] pub threshold_parry: Option, @@ -196,7 +202,7 @@ pub struct MonsterSingleAttack { pub threshold_dodge: Option, } -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, FieldsAsSlice)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Default, FieldsAsSlice)] /// All different body parts and their different resists pub struct CreatureBodyPart { #[INTEGER] diff --git a/helper_config.toml b/helper_config.toml index 4fe4f44..3807cff 100644 --- a/helper_config.toml +++ b/helper_config.toml @@ -154,19 +154,20 @@ intro = '''\begin{tblr}{ cell{1}{1}={c=2}{c}, } -\includegraphics[height=5cm]{ {{image}} } & \\ +\includegraphics[height=5cm]{ {{{image}}} } & \\ & \\ -Nom & {{name}} \\ -Dénomination & {{denomination}} \\ -Calamité & {{calamity}} \\ -Niveau de danger (HSE) & {{danger_level}} \\ +Nom & {{{name}}} \\ +Dénomination & {{{denomination}}} \\ +Calamité & {{{calamity}}} \\ +Niveau de danger (HSE) & {{{danger_level}}} \\ & \\ -Habitat & \SetCell{font=\footnotesize} {{habitat}} \\ -Dysmorphisme & \SetCell{font=\footnotesize} {{dysmorphism}} \\ -Couleurs & \SetCell{font=\footnotesize} {{colors}} \\ -Réaction à l'homme & \SetCell{font=\footnotesize} {{default_human_reaction}} \\ -Variantes & \SetCell{font=\footnotesize} {{variants}}\\ -Mœurs & \SetCell{font=\footnotesize} {{habits}} \\ +Habitat & \SetCell{font=\footnotesize} {{{habitat}}} \\ +Dysmorphisme & \SetCell{font=\footnotesize} {{{dysmorphism}}} \\ +Couleurs & \SetCell{font=\footnotesize} {{{colors}}} \\ +Réaction à l'homme & \SetCell{font=\footnotesize} {{{default_human_reaction}}} \\ +Variantes & \SetCell{font=\footnotesize} {{{variants}}}\\ +Taille & \SetCell{font=\footnotesize} {{{size}}}\\ +Mœurs & \SetCell{font=\footnotesize} {{{habits}}} \\ \end{tblr} \vfill \begin{tblr}{ @@ -175,9 +176,9 @@ Mœurs & \SetCell{font=\footnotesize} {{habits}} \\ row{2,4,6}={font=\footnotesize} } \textbf{Description} \\ -{{description}} \\ +{{{description}}} \\ \textbf{Annotations} \\ -{{annotations}} \\ +{{{annotations}}} \\ \textbf{Récompenses} \\ \end{tblr} \begin{tblr}{ @@ -188,10 +189,10 @@ Mœurs & \SetCell{font=\footnotesize} {{habits}} \\ } ''' blood_reward=''' - \SetCell[c=2]{j} Sang (base, combat, dépeçage) & & {{blood_base}}, {{blood_battle}}, {{blood_carve}} \\ + \SetCell[c=2]{j} Sang (base, combat, dépeçage) & & {{{blood_base}}}, {{{blood_battle}}}, {{{blood_carve}}} \\ ''' -rewards_row=''' {{name}} & {{category}} & {{effect}} \\ +rewards_row=''' {{{name}}} & {{{category}}} & {{{effect}}} \\ ''' rewards_end=''' \end{tblr} @@ -213,9 +214,11 @@ body_parts_intro=''' & Seuil & Prot & Intégrité & PV & Seuil & Prot & Intégrité & PV\\ \hline ''' -body_parts_row='''\SetCell{font=\footnotesize} {{body_part_name}} & ${{threshold_p1}} $ & ${{protection_p1}} $ & \SetCell{r,f}\tiny ${{integrity_p1}} $ & \SetCell{r,f}\tiny ${{life_points_p1}} $ & ${{threshold_p2}} $ & ${{protection_p2}} $ & \SetCell{r,f}\tiny ${{integrity_p2}} $ & \SetCell{r,f}\tiny ${{life_points_p2}} $\\''' +body_parts_row=''' +\SetCell{font=\footnotesize} {{{body_part_name }}} & ${{{threshold_p1 }}} $ & ${{{protection_p1}}} {{{protection_total_p1 }}} $ & \SetCell{r,f}\tiny ${{{integrity_p1}}} $ & \SetCell{r,f}\tiny ${{{life_points_p1}}} $ & ${{{threshold_p2}}} $ & ${{{protection_p2}}} {{{protection_total_p2}}} $ & \SetCell{r,f}\tiny ${{{integrity_p2}}} $ & \SetCell{r,f}\tiny ${{{life_points_p2}}} $\\ +''' body_parts_end= ''' \hline -\SetCell[c=9]{j,h} {\textbf{Notes} \\ {{annotations_master}}}\\ +\SetCell[c=9]{j,h} {\textbf{Notes} \\ {{{annotations_master}}}}\\ \hline \end{tblr}''' resists_intro=''' \begin{center} @@ -229,7 +232,7 @@ resists_intro=''' \begin{center} \SetCell{c} Res & \slash & \pierce & \blunt & \symceleste & \symfire & \symearth & \symwood & \symmagma & \symabyss & \symwater & \symwind & \symice & \symthunder \\ \hline ''' -resists_row= ''' \SetCell{font=\footnotesize} {{body_part_name}} & ${{slash}} $ & ${{pierce}} $ & ${{blunt}} $ & ${{celestial}} $ & ${{fire}} $ & ${{earth}} $ & ${{wood}} $ & ${{magma}} $ & ${{celeste}} $ & ${{water}} $ & ${{wind}} $ & ${{ice}} $ & ${{thunder}} $ \\ +resists_row= ''' \SetCell{font=\footnotesize} {{{body_part_name}}} & ${{{slash}}} $ & ${{{pierce}}} $ & ${{{blunt}}} $ & ${{{celestial}}} $ & ${{{fire}}} $ & ${{{earth}}} $ & ${{{wood}}} $ & ${{{magma}}} $ & ${{{celeste}}} $ & ${{{water}}} $ & ${{{wind}}} $ & ${{{ice}}} $ & ${{{thunder}}} $ \\ ''' resists_end=''' \end{tblr} @@ -244,10 +247,10 @@ stats='''\begin{tblr}{ & \SetCell[c=2]{c} P1 & & \SetCell[c=2]{c} P2 & & & \SetCell[c=7]{c} Stats & & & & & & & & \SetCell[c=4]{c} Mouvement & & & & \\ \cline{2-3} \cline{4-5} \cline{7-13} \cline{15-18} \rb{Initiative} & \rb{Valeur} & \rb{Actions} & \rb{Valeur} & \rb{Actions} & & \rb{Force} & \rb{Perception} & \rb{Volonté} & \rb{Res Alt} & \rb{Torque} & \rb{Vigilance} & \rb{Fatigue} & & \rb{Marche} & \rb{Trot} & \rb{Course} & \rb{Vol} \\ -\SetCell{font=\footnotesize} $t_1 $ & ${{p1_init}} $ & $4 $A & ${{p2_init}} $ & $4 $A & & ${{strength}} $ & ${{perception}} $ & ${{willpower}} $ & ${{alteration_resistance}} $ & ${{torque}} $ & ${{awareness}} $ & ${{fatigue}} $ & & ${{mvt_walk}} $ & ${{mvt_trot}} $ & ${{mvt_run}} $ & ${{mvt_flight}} $ \\ +\SetCell{font=\footnotesize} $t_1 $ & ${{{p1_init}}} $ & $4 $A & ${{{p2_init}}} $ & $4 $A & & ${{{strength}}} $ & ${{{perception}}} $ & ${{{willpower}}} $ & ${{{alteration_resistance}}} $ & ${{{torque}}} $ & ${{{awareness}}} $ & ${{{fatigue}}} $ & & ${{{mvt_walk}}} $ & ${{{mvt_trot}}} $ & ${{{mvt_run}}} $ & ${{{mvt_flight}}} $ \\ ''' init_rows=''' -\SetCell{font=\footnotesize} $t_{{turn}} $ & ${{p1_value}} $ & {{pt1_actions}} & ${{p2_value}} $ & {{p2_actions}} \\ +\SetCell{font=\footnotesize} $t_{{{turn}}} $ & ${{{p1_value}}} $ & {{{pt1_actions}}} & ${{{p2_value}}} $ & {{{p2_actions}}} \\ ''' init_end= ''' \end{tblr} @@ -268,15 +271,15 @@ attacks_intro= ''' ''' phase_row= ''' \SetHline{1}{0pt} -\SetCell[c=13]{white} {{phase_name}} & & & & & & & & & & \\ +\SetCell[c=13]{white} {{{phase_name}}} & & & & & & & & & & \\ ''' attack_before_repeat=' \hline' -attack_color='\SetCell[r={{size}}]{bg={{color}}}' # Very ugly hack, going to bed -# attack_repeatable_row= ''' & {{name}} & {{short_name}} & {{prerequisites}} & {{atk_type}} & {{targetting}} & {{cost_fatigue}} & {{cost_action}} & {{element}} & {{damage_fatigue}} &{{damage_regular}} & {{effects}} & {{threshold_parry}} & {{threshold_dodge}} \\ -attack_repeatable_row= ''' & {{name}} & {{atk_type}} & {{prerequisites}} & {{targetting}} & {{cost_fatigue}} & {{cost_action}} & {{element}} & {{damage_fatigue}} &{{damage_regular}} & {{effects}} & {{threshold_parry}} & {{threshold_dodge}} \\ +attack_color='\SetCell[r={{{size}}}]{bg={{{color}}}}' # Very ugly hack, going to bed +# attack_repeatable_row= ''' & {{{name}}} & {{{short_name}}} & {{{prerequisites}}} & {{{atk_type}}} & {{{targetting}}} & {{{cost_fatigue}}} & {{{cost_action}}} & {{{element}}} & {{{damage_fatigue}}} &{{{damage_regular}}} & {{{effects}}} & {{{threshold_parry}}} & {{{threshold_dodge}}} \\ +attack_repeatable_row= ''' & {{{name}}} & {{{atk_type}}} & {{{prerequisites}}} & {{{targetting}}} & {{{cost_fatigue}}} & {{{cost_action}}} & {{{element}}} & {{{damage_fatigue}}} &{{{damage_regular}}} & {{{effects}}} & {{{threshold_parry}}} & {{{threshold_dodge}}} \\ ''' -attack_info_row='''& \SetCell[c=12]{j} {{description}} & & & & & & & & & & \\ +attack_info_row='''& \SetCell[c=12]{j} {{{description}}} & & & & & & & & & & \\ \hline ''' attacks_end= ''' \end{tblr} @@ -294,7 +297,7 @@ intent_table=''' row{2}={font=\footnotesize}, } Plan de combat & Graphique d'intentions \\ -{{battle_plan}} & {{intent_graph}} \\ +{{{battle_plan}}} & {{{intent_graph}}} \\ \end{tblr} \vfill \pagebreak diff --git a/ravenous_databases b/ravenous_databases index 8928f53..27b578c 160000 --- a/ravenous_databases +++ b/ravenous_databases @@ -1 +1 @@ -Subproject commit 8928f53a3d02d9fe618ee03166e417a408f1fc52 +Subproject commit 27b578ce3b1202817e406ef2a762893432706eec -- 2.45.1