From 44db2ca29486031a69cafc40bcfa516eced2fb86 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Sun, 26 Jul 2026 19:22:31 +0200 Subject: [PATCH] Minor fixes --- crates/monsters/src/monster_analysis.rs | 2 +- .../src/monster_analysis/defense_analysis.rs | 7 +++---- crates/monsters/src/monster_structs.rs | 16 ++++++++-------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/crates/monsters/src/monster_analysis.rs b/crates/monsters/src/monster_analysis.rs index e40c26c..617a6d2 100644 --- a/crates/monsters/src/monster_analysis.rs +++ b/crates/monsters/src/monster_analysis.rs @@ -37,7 +37,7 @@ pub fn show_balancing_data( table.add_row(vec![ creature.id.to_cell(), match creature.balancing.monster_groupsize { - 0 | 1 => creature.name.clone(), + 1. => creature.name.clone(), n => format!("{} x {}", creature.name, n), } .to_cell() diff --git a/crates/monsters/src/monster_analysis/defense_analysis.rs b/crates/monsters/src/monster_analysis/defense_analysis.rs index 6ca82c2..585485e 100644 --- a/crates/monsters/src/monster_analysis/defense_analysis.rs +++ b/crates/monsters/src/monster_analysis/defense_analysis.rs @@ -24,8 +24,7 @@ pub(crate) fn display_player_attacks( .body_parts .iter() .map(|body_part| { - let ratio = creature.balancing.monster_groupsize as f64 - / creature.balancing.player_groupsize as f64; + let ratio = creature.balancing.monster_groupsize / creature.balancing.player_groupsize; let damage_done_p1 = damage_done_to_part(body_part, &profiles[&ProfileStance::Neutral], Phases::P1); let damage_done_p2 = @@ -244,10 +243,10 @@ pub struct DefenseReport { /// (Fixed) The number of monsters in a single group. /// Usually `1`, but can be > 1 for bosses that spawn multiple instances. #[SKIP] - pub monster_groupsize: i64, + pub monster_groupsize: f64, /// (Fixed) Number of players this fight was designed for. #[SKIP] - pub player_groupsize: i64, + pub player_groupsize: f64, /// (Fixed) Health points during phase 1. #[SKIP] pub health_p1: i64, diff --git a/crates/monsters/src/monster_structs.rs b/crates/monsters/src/monster_structs.rs index b14d694..af2b2b3 100644 --- a/crates/monsters/src/monster_structs.rs +++ b/crates/monsters/src/monster_structs.rs @@ -57,7 +57,7 @@ pub struct FullMonster { } /// One row from the `creature` table. -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, FieldsAsSlice)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, FieldsAsSlice)] pub struct CreatureData { /// Primary key – auto‑incremented by SQLite. #[INTEGER] @@ -74,8 +74,8 @@ pub struct CreatureData { #[TEXT] pub image: String, /// The HSE danger level - #[INTEGER] - pub danger_level: i64, + #[REAL] + pub danger_level: f64, /// The footprints and such #[TEXT] pub traces: Option, @@ -413,7 +413,7 @@ pub struct CreatureStats { pub blood_carve: i64, } /// Balancing metadata for a creature. -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, FieldsAsSlice)] +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, FieldsAsSlice)] pub struct CreatureBalancing { #[INTEGER] pub creature_id: i64, @@ -432,12 +432,12 @@ pub struct CreatureBalancing { #[INTEGER] /// (GOAL) Avg. turns to kill a single target. pub time_to_player_kill: i64, - #[INTEGER] + #[REAL] /// (FIXED) Size of a single monster group (usually one). - pub monster_groupsize: i64, - #[INTEGER] + pub monster_groupsize: f64, + #[REAL] /// (FIXED) The number of players this fight was designed for - pub player_groupsize: i64, + pub player_groupsize: f64, } /// Balancing info on all the player depending on their level