thresholds

This commit is contained in:
Dandaedre 2026-07-29 20:36:25 +02:00
parent f34d581522
commit 34bf67df88
Signed by: Dandaedre
GPG Key ID: 440C6592E8A26D99
4 changed files with 4 additions and 2 deletions

View File

@ -29,12 +29,14 @@ macro_rules! template_load {
}
handlebars_helper!(plus: |x:i64 ,y:Option<i64>| x+y.unwrap_or(0));
handlebars_helper!(threshold_bonus: |x:i64| format!("{:+}",x-8));
fn load_templates(config: &Config) -> Result<Handlebars<'_>> {
let mut templates = Handlebars::new();
template_load!(templates, &config.monster, common_part);
template_load!(templates, &config.monster, master_part);
templates.register_helper("plus", Box::new(plus));
templates.register_helper("threshold_bonus", Box::new(threshold_bonus));
Ok(templates)
}

View File

@ -211,7 +211,7 @@ master_part = '''
\hline
{{#with stats as |s|}}
{{#each ../body_parts.body_parts}}
\SetCell{font=\footnotesize} {{{body_part_name}}} & ${{{threshold_p1}}} $ & ${{{plus s.strength protection_p1}}}[{{{protection_p1}}}]$ & \SetCell{r,f}\tiny ${{{integrity_p1}}} $ & \SetCell{r,f}\tiny ${{{life_points_p1}}} $ & ${{{threshold_p2}}} $ & ${{{plus s.strength protection_p1}}}[{{{protection_p1}}}]$ & \SetCell{r,f}\tiny ${{{integrity_p2}}} $ & \SetCell{r,f}\tiny ${{{life_points_p2}}} $\\
\SetCell{font=\footnotesize} {{{body_part_name}}} & ${{{threshold_p1}}} ${\tiny ({{{threshold_bonus threshold_p1~}}}) } & ${{{plus s.strength protection_p1}}}[{{{protection_p1}}}]$ & \SetCell{r,f}\tiny ${{{integrity_p1}}} $ & \SetCell{r,f}\tiny ${{{life_points_p1}}} $ & ${{{threshold_p2}}} ${\tiny ({{{threshold_bonus threshold_p1~}}}) } & ${{{plus s.strength protection_p1}}}[{{{protection_p1}}}]$ & \SetCell{r,f}\tiny ${{{integrity_p2}}} $ & \SetCell{r,f}\tiny ${{{life_points_p2}}} $\\
{{/each}}
{{/with}}
{{#if data.annotations_master}}

0
monsters.db Normal file
View File

@ -1 +1 @@
Subproject commit 4abdb938413f15ae04f38a94b9a5bb0755023946
Subproject commit 100d805aa2741d86d8fefa2d4916ff398a1a9fcc