title image, ui tweaks

This commit is contained in:
Llywelwyn 2023-07-29 02:21:36 +01:00
parent 2d4758ced1
commit be2c8a35a5
11 changed files with 238 additions and 171 deletions

View file

@ -47,6 +47,7 @@ pub fn skill_bonus(skill: Skill, skills: &Skills) -> i32 {
}
}
/// Roll 4d6 and drop the lowest, for rolling d20-style stats
pub fn roll_4d6(rng: &mut rltk::RandomNumberGenerator) -> i32 {
let mut rolls: Vec<i32> = Vec::new();
for _i in 0..4 {
@ -55,10 +56,8 @@ pub fn roll_4d6(rng: &mut rltk::RandomNumberGenerator) -> i32 {
rolls.sort_unstable();
let mut roll = 0;
rltk::console::log(format!("roll 0"));
for i in 1..rolls.len() {
roll += rolls[i];
rltk::console::log(format!("+ {}", rolls[i]));
}
return roll;