More refactoring to get the GUI dumber.

This commit is contained in:
Zed A. Shaw 2024-10-30 02:13:31 -04:00
parent 2fdbd63f4c
commit 009b1e63a7
6 changed files with 86 additions and 75 deletions

View file

@ -98,21 +98,21 @@ void System::combat(DinkyECS::World &world, Player &player) {
int player_dmg = player_combat.attack(enemy_combat);
if(player_dmg > 0) {
world.send<GUIEvent>(GUIEvent::HIT, entity);
world.send<Events::GUI>(Events::GUI::HIT, entity);
} else {
world.send<GUIEvent>(GUIEvent::MISS, entity);
world.send<Events::GUI>(Events::GUI::MISS, entity);
}
if(enemy_combat.hp > 0) {
int enemy_dmg = enemy_combat.attack(player_combat);
if(enemy_dmg > 0) {
world.send<GUIEvent>(GUIEvent::HIT, player.entity);
world.send<Events::GUI>(Events::GUI::HIT, player.entity);
} else {
world.send<GUIEvent>(GUIEvent::MISS, player.entity);
world.send<Events::GUI>(Events::GUI::MISS, player.entity);
}
} else {
world.send<GUIEvent>(GUIEvent::DEAD, entity);
world.send<Events::GUI>(Events::GUI::DEAD, entity);
}
}
}