thresholds #169

Merged
Dandaedre merged 1 commits from database_monsters into main 2026-07-29 20:40:08 +02:00
5 changed files with 5 additions and 3 deletions

View File

@ -6,7 +6,7 @@ resolver = "3"
# edition = "2024"
# license = "MIT OR Apache-2.0"
[workspace.package]
version = "0.3.27"
version = "0.3.28"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

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