From 0c1fc5be9d5857c6c73724e0d950e765b12400c7 Mon Sep 17 00:00:00 2001 From: David Gay Date: Sun, 15 Oct 2023 01:45:26 -0400 Subject: Add racial modifiers when generating henchmen --- src/rules/npcs.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/rules/npcs.rs b/src/rules/npcs.rs index 206151c..4ee687f 100644 --- a/src/rules/npcs.rs +++ b/src/rules/npcs.rs @@ -42,6 +42,7 @@ impl Npc { // Roll 3d6 down the line. let mut roll_result = roll_formula("3d6").unwrap(); let class_ref = self.class.unwrap(); + let race_ref = self.race.unwrap(); // For ability scores which are prime requisites of the class, // increase all dice by 1 which do not already show a 6. @@ -59,6 +60,13 @@ impl Npc { .copied() .unwrap_or(0) as u32; + // Add racial ability score modifiers. + total += race_ref + .npc_ability_score_modifiers + .get(&ability) + .copied() + .unwrap_or(0) as u32; + ability_score_rolls.insert(ability, total); } @@ -70,7 +78,6 @@ impl Npc { self.ability_scores = Some(score_collection); - // TODO: Modify results for race. // TODO: Apply racial minimums and maximums. // TODO: Verify legality of class based on alignment. // TODO: Verify legality of class based on race. -- cgit v1.2.3