1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-05-17 06:34:07 +00:00

ru:: display room name, player HP and enemy HP in the status line

This commit is contained in:
Zeno Rogue 2025-05-03 17:40:11 +02:00
parent 999ee0b40c
commit 7875de00e4
3 changed files with 10 additions and 0 deletions

View File

@ -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();

View File

@ -45,6 +45,8 @@ double mscale = 100;
bool non_hyperbolic;
bool one_room;
struct entity *current_target;
struct ruwall {
string name;
string glyph;

View File

@ -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;