From d7914c6eaa1780c9c61ddb7dc2273f4bfa6abe5b Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Wed, 29 Jul 2026 20:36:25 +0200 Subject: [PATCH] thresholds --- Cargo.toml | 2 +- crates/monsters/src/monster_export.rs | 2 ++ helper_config.toml | 2 +- monsters.db | 0 ravenous_databases | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 monsters.db diff --git a/Cargo.toml b/Cargo.toml index 451587b..965d4ed 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.27" +version = "0.3.28" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 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 -- 2.45.1