diff options
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r-- | src/being/being.cpp | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 1a9ce201f..6dd797eac 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -3999,16 +3999,40 @@ void Being::drawPlayerSpriteAt(Graphics *restrict const graphics, localPlayer == this && mAction != BeingAction::DEAD) { + int barX = x - 50 + mapTileSize / 2 + mInfo->getHpBarOffsetX(); + int barY = y + mapTileSize - 6 + mInfo->getHpBarOffsetY(); + const int barW = 2 * 50; + const int barH = 4; + + const bool drawMpBar = + PlayerInfo::getStatEffective(Attributes::PLAYER_MATK) > 0; + if (drawMpBar) + barY -= 3; + drawHpBar(graphics, PlayerInfo::getAttribute(Attributes::PLAYER_MAX_HP), PlayerInfo::getAttribute(Attributes::PLAYER_HP), 0, UserColorId::PLAYER_HP_FG, UserColorId::PLAYER_HP_BG, - x - 50 + mapTileSize / 2 + mInfo->getHpBarOffsetX(), - y + mapTileSize - 6 + mInfo->getHpBarOffsetY(), - 2 * 50, - 4); + barX, + barY, + barW, + barH); + + if (drawMpBar) + { + drawHpBar(graphics, + PlayerInfo::getAttribute(Attributes::PLAYER_MAX_MP), + PlayerInfo::getAttribute(Attributes::PLAYER_MP), + 0, + UserColorId::PLAYER_MP_FG, + UserColorId::PLAYER_MP_BG, + barX, + barY + barH + 1, + barW, + barH); + } } } |