Moved the text attaching code to the arena.

This commit is contained in:
Zed A. Shaw 2025-12-24 00:58:38 -05:00
parent f50e713179
commit 0d23cf9537
5 changed files with 43 additions and 15 deletions

View file

@ -128,11 +128,14 @@ namespace boss {
case BattleHostState::disagree: {
std::string player_move = Random::uniform(0, 1) == 0 ? "player1" : "player3";
$ui.move_actor("player", player_move);
if(result.player_did > 0) $ui.animate_actor("player");
$ui.damage("boss", result.player_did);
} break;
case BattleHostState::not_host: {
std::string boss_move = Random::uniform(0, 1) == 0 ? "boss5" : "boss6";
$ui.move_actor("boss", boss_move);
if(result.enemy_did > 0) $ui.animate_actor("boss");
$ui.damage("player", result.enemy_did);
} break;
case BattleHostState::out_of_ap:
@ -154,7 +157,7 @@ namespace boss {
void Fight::render(sf::RenderWindow& window) {
$ui.play_animations();
$ui.render(window);
$ui.render();
}
bool Fight::handle_mouse(game::Event ev) {
@ -196,6 +199,7 @@ namespace boss {
void Fight::set_window(sf::RenderWindow* window) {
$window = window;
$ui.set_window(window);
}
bool Fight::handle_keyboard_mouse() {