diff --git a/rogueviz/ru/geometry.cpp b/rogueviz/ru/geometry.cpp index 3d9855ab..47d73d1b 100644 --- a/rogueviz/ru/geometry.cpp +++ b/rogueviz/ru/geometry.cpp @@ -1,5 +1,9 @@ namespace rogue_unlike { +int randround(ld x) { + return x + randd(); + } + hyperpoint to_hyper(ld x, ld y) { if(non_hyperbolic) return hyperpoint(x, y, 1, 1); y -= t_margin_at; diff --git a/rogueviz/ru/man.cpp b/rogueviz/ru/man.cpp index 652b3f67..d149fe97 100644 --- a/rogueviz/ru/man.cpp +++ b/rogueviz/ru/man.cpp @@ -52,8 +52,11 @@ void man::act() { stable_where = where; } + auto h = max_hp(); current = next; next.reset(); + if(h != max_hp()) + hp = randround(1. * hp * max_hp() / h); auto dat = get_dat(); if(on_floor) on_floor_when = gframeid;