diff --git a/rogueviz/ru/entity.cpp b/rogueviz/ru/entity.cpp index 307241b7..3960b115 100644 --- a/rogueviz/ru/entity.cpp +++ b/rogueviz/ru/entity.cpp @@ -276,6 +276,7 @@ void boar::act() { } void boar::attacked(int dmg) { + current_target = this; reduce_hp(dmg); if(destroyed) addMessage("You kill the wild boar."); else addMessage("You hit the wild boar."); auto dat = get_dat(); diff --git a/rogueviz/ru/globals.cpp b/rogueviz/ru/globals.cpp index 22641fca..ff3d9b17 100644 --- a/rogueviz/ru/globals.cpp +++ b/rogueviz/ru/globals.cpp @@ -45,6 +45,8 @@ double mscale = 100; bool non_hyperbolic; bool one_room; +struct entity *current_target; + struct ruwall { string name; string glyph; diff --git a/rogueviz/ru/ru.cpp b/rogueviz/ru/ru.cpp index da05ccd8..6f1813cc 100644 --- a/rogueviz/ru/ru.cpp +++ b/rogueviz/ru/ru.cpp @@ -257,6 +257,13 @@ void run() { else switch_mapmode_to(mapmode::poincare); }); if(cmode == mode::editmap) mouseovers = format("coordinates: %d %d (%.2lf)", mousepx, mousepy, double(get_scale_at(mousepy))); + if(cmode == mode::playing) { + titlecolor = 0xFFFFFF; + mouseovers = current_room->roomname; + displayfr(vid.fsize, vid.fsize, 2, vid.fsize, "HP " + its(m.hp) + "/" + its(m.max_hp()), titlecolor, 0); + if(current_target && current_target->existing) + displayfr(vid.xres - vid.fsize, vid.fsize, 2, vid.fsize, "HP " + its(current_target->hp) + "/" + its(current_target->max_hp()) + " " + current_target->get_name(), titlecolor, 16); + } draw_pentagon(); break;