From 34bf67df8860950c8573dac586ee0bbb67ac53f3 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Wed, 29 Jul 2026 20:36:25 +0200 Subject: [PATCH] thresholds --- crates/monsters/src/monster_export.rs | 2 ++ helper_config.toml | 2 +- monsters.db | 0 ravenous_databases | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 monsters.db diff --git a/crates/monsters/src/monster_export.rs b/crates/monsters/src/monster_export.rs index c4e2d70..1be5960 100644 --- a/crates/monsters/src/monster_export.rs +++ b/crates/monsters/src/monster_export.rs @@ -29,12 +29,14 @@ macro_rules! template_load { } handlebars_helper!(plus: |x:i64 ,y:Option| x+y.unwrap_or(0)); +handlebars_helper!(threshold_bonus: |x:i64| format!("{:+}",x-8)); fn load_templates(config: &Config) -> Result> { 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) } diff --git a/helper_config.toml b/helper_config.toml index 6ec2ab8..2d348b5 100644 --- a/helper_config.toml +++ b/helper_config.toml @@ -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}} diff --git a/monsters.db b/monsters.db new file mode 100644 index 0000000..e69de29 diff --git a/ravenous_databases b/ravenous_databases index 4abdb93..100d805 160000 --- a/ravenous_databases +++ b/ravenous_databases @@ -1 +1 @@ -Subproject commit 4abdb938413f15ae04f38a94b9a5bb0755023946 +Subproject commit 100d805aa2741d86d8fefa2d4916ff398a1a9fcc