summaryrefslogtreecommitdiff
path: root/src/rules
diff options
context:
space:
mode:
authorDavid Gay <eapoems@riseup.net>2023-10-15 01:45:26 -0400
committerDavid Gay <eapoems@riseup.net>2023-10-15 01:49:19 -0400
commit0c1fc5be9d5857c6c73724e0d950e765b12400c7 (patch)
treea616fd4246067da4a79a8fda8d3ccfc2585c1895 /src/rules
parent1591a38ea4d1c7dd5075773a8c7b5b321f8de8c7 (diff)
Add racial modifiers when generating henchmen
Diffstat (limited to 'src/rules')
-rw-r--r--src/rules/npcs.rs9
1 files changed, 8 insertions, 1 deletions
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.