There's now an hp status indicator 'doll' when you click on it your host (character) will tell you how they're doing for HP.

This commit is contained in:
Zed A. Shaw 2025-04-26 00:57:23 -04:00
parent dac9b1b3de
commit ad1d08ca96
11 changed files with 37 additions and 7 deletions

View file

@ -408,6 +408,22 @@ std::wstring System::draw_map(GameLevel level, size_t view_x, size_t view_y, int
return result;
}
void System::player_status(GameLevel &level) {
auto& combat = level.world->get<Combat>(level.player);
float percent = float(combat.hp) / float(combat.max_hp);
if(percent > 0.8) {
sound::play("hp_status_80");
} else if(percent > 0.6) {
sound::play("hp_status_60");
} else if(percent > 0.3) {
sound::play("hp_status_30");
} else if(percent > 0.1) {
sound::play("hp_status_10");
} else {
sound::play("hp_status_00");
}
}
std::shared_ptr<sf::Shader> System::sprite_effect(GameLevel &level, DinkyECS::Entity entity) {
if(level.world->has<SpriteEffect>(entity)) {