summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorDavid Gay <eapoems@riseup.net>2023-10-16 16:30:23 -0400
committerDavid Gay <eapoems@riseup.net>2023-10-16 16:30:23 -0400
commitf2c4ff69213c3e98bc0e679b4acce2a0d0019876 (patch)
tree584c12a4141950d55413ce3895c097d4cc141781 /src/main.rs
parent84837a689e71d0e695fa016f1e667bbeb16b515b (diff)
NPC personalities
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 20e4bcf..95f92b7 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -39,8 +39,12 @@ fn main() {
Some(race_ref),
Some(class_ref),
None,
+ None,
);
+
npc.roll_henchman_ability_scores();
+ npc.randomize_personality();
+
let ability_scores = npc.ability_scores.unwrap();
let output_csv = henchman_matches.get_flag("csv");
@@ -49,7 +53,7 @@ fn main() {
// string literal at compile time.
if output_csv {
println!(
- "{},{},{},{},{},{},{},{},{}",
+ "{},{},{},{},{},{},{},{},{},\"{}\"",
npc.alignment
.unwrap()
.split_whitespace()
@@ -66,11 +70,12 @@ fn main() {
.get_score(AbilityScore::Constitution)
.unwrap(),
ability_scores.get_score(AbilityScore::Dexterity).unwrap(),
- ability_scores.get_score(AbilityScore::Charisma).unwrap()
+ ability_scores.get_score(AbilityScore::Charisma).unwrap(),
+ npc.personality.unwrap(),
);
} else {
println!(
- "{} {} {}. STR {}, INT {}, WIS {}, CON {}, DEX {}, CHA {}",
+ "{} {} {}. STR {}, INT {}, WIS {}, CON {}, DEX {}, CHA {}. {}",
npc.alignment.unwrap(),
npc.race.unwrap().name,
npc.class.unwrap().name,
@@ -83,7 +88,8 @@ fn main() {
.get_score(AbilityScore::Constitution)
.unwrap(),
ability_scores.get_score(AbilityScore::Dexterity).unwrap(),
- ability_scores.get_score(AbilityScore::Charisma).unwrap()
+ ability_scores.get_score(AbilityScore::Charisma).unwrap(),
+ npc.personality.unwrap(),
);
};
}