fixed some attributes double-dipping, and added COMBAT_LOGGING

This commit is contained in:
Llywelwyn 2023-07-28 17:12:02 +01:00
parent c2759e9e8e
commit 6e6d364aa5
5 changed files with 119 additions and 19 deletions

View file

@ -17,6 +17,9 @@ pub fn player_hp_at_level(rng: &mut rltk::RandomNumberGenerator, constitution: i
}
pub fn npc_hp(rng: &mut rltk::RandomNumberGenerator, constitution: i32, level: i32) -> i32 {
if level == 0 {
return rng.roll_dice(1, 4);
}
let mut total = 1;
for _i in 0..level {
total += rng.roll_dice(1, 8) + attr_bonus(constitution);