RegenSystem{} for health regen (mana NYI)
This commit is contained in:
parent
6cef899ef6
commit
0169a88091
8 changed files with 86 additions and 16 deletions
|
|
@ -539,7 +539,6 @@ fn skip_turn(ecs: &mut World) -> bool {
|
|||
}
|
||||
}
|
||||
|
||||
let mut did_heal = false;
|
||||
if can_heal {
|
||||
let mut health_components = ecs.write_storage::<Pools>();
|
||||
let pools = health_components.get_mut(*player_entity).unwrap();
|
||||
|
|
@ -547,15 +546,10 @@ fn skip_turn(ecs: &mut World) -> bool {
|
|||
let roll = rng.roll_dice(1, 6);
|
||||
if (roll == 6) && pools.hit_points.current < pools.hit_points.max {
|
||||
pools.hit_points.current += 1;
|
||||
did_heal = true;
|
||||
}
|
||||
}
|
||||
|
||||
if did_heal {
|
||||
gamelog::Logger::new().append("You wait a turn, and").colour(rltk::GREEN).append("recover a hit point.").log();
|
||||
} else {
|
||||
gamelog::Logger::new().append("You wait a turn.").log();
|
||||
}
|
||||
gamelog::Logger::new().append("You wait a turn.").log();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue