Can now see an enemy take damage, and a damage number, but the effect is inverted.
This commit is contained in:
parent
f175a5d4aa
commit
8208d146de
5 changed files with 26 additions and 11 deletions
|
|
@ -129,14 +129,14 @@ namespace boss {
|
|||
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);
|
||||
$ui.damage("player", 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);
|
||||
$ui.damage("boss", result.enemy_did);
|
||||
} break;
|
||||
case BattleHostState::out_of_ap:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -109,11 +109,10 @@ namespace boss {
|
|||
}
|
||||
|
||||
void UI::damage(const std::string& actor, int amount) {
|
||||
// BUG: the $arena should really do this
|
||||
if(amount == 0) {
|
||||
$arena.attach_text(actor, "MISS!");
|
||||
} else {
|
||||
$arena.attach_text(actor, "HIT!");
|
||||
$arena.attach_text(actor, fmt::format("{}", amount));
|
||||
|
||||
if(amount > 0) {
|
||||
$arena.apply_effect(actor, "flame");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue