summaryrefslogtreecommitdiff
path: root/src/rules/npcs.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/rules/npcs.rs')
-rw-r--r--src/rules/npcs.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/rules/npcs.rs b/src/rules/npcs.rs
index 4ee687f..fae1c69 100644
--- a/src/rules/npcs.rs
+++ b/src/rules/npcs.rs
@@ -2,6 +2,7 @@ use crate::dice::roll_formula;
use crate::rules::ability_scores::{AbilityScore, AbilityScoreCollection};
use crate::rules::classes::Class;
use crate::rules::races::Race;
+use log::debug;
use std::collections::HashMap;
// use std::fmt;
@@ -39,8 +40,10 @@ impl Npc {
AbilityScore::Constitution,
AbilityScore::Charisma,
] {
+ debug!("Generating score for {}", &ability.abbr());
// Roll 3d6 down the line.
let mut roll_result = roll_formula("3d6").unwrap();
+ debug!("Rolled {}", roll_result.total());
let class_ref = self.class.unwrap();
let race_ref = self.race.unwrap();
@@ -49,6 +52,7 @@ impl Npc {
if class_ref.prime_requisites.contains(&ability) {
roll_result.increase_sides_below_max(6, 1);
}
+ debug!("Bumped prime requisites, now at {}", roll_result.total());
// At this point we don't need the individual dice anymore.
let mut total = roll_result.total();
@@ -59,6 +63,7 @@ impl Npc {
.get(&ability)
.copied()
.unwrap_or(0) as u32;
+ debug!("After adding NPC class modifiers, now at {}", total);
// Add racial ability score modifiers.
total += race_ref
@@ -66,6 +71,7 @@ impl Npc {
.get(&ability)
.copied()
.unwrap_or(0) as u32;
+ debug!("After adding racial modifiers, now at {}", total);
ability_score_rolls.insert(ability, total);
}