Now have enough state to show what's going on in the fight, next is to use graphics and stuff to make it better.
This commit is contained in:
parent
a8863cf687
commit
f50e713179
9 changed files with 55 additions and 16 deletions
|
|
@ -116,19 +116,29 @@ namespace boss {
|
|||
}
|
||||
|
||||
void Fight::do_combat(std::any data) {
|
||||
using combat::BattleHostState;
|
||||
|
||||
dbc::check(data.type() == typeid(components::CombatResult),
|
||||
fmt::format("Boss Fight received any data={}", data.type().name()));
|
||||
fmt::format("Boss Fight wrong any data={}", data.type().name()));
|
||||
|
||||
auto result = std::any_cast<components::CombatResult>(data);
|
||||
|
||||
$ui.zoom("", 1.0);
|
||||
std::string boss_move = Random::uniform(0, 1) == 0 ? "boss5" : "boss6";
|
||||
std::string player_move = Random::uniform(0, 1) == 0 ? "player1" : "player3";
|
||||
$ui.move_actor("player", player_move);
|
||||
$ui.move_actor("boss", boss_move);
|
||||
switch(result.host_state) {
|
||||
case BattleHostState::agree:
|
||||
case BattleHostState::disagree: {
|
||||
std::string player_move = Random::uniform(0, 1) == 0 ? "player1" : "player3";
|
||||
$ui.move_actor("player", player_move);
|
||||
$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);
|
||||
$ui.damage("player", result.enemy_did);
|
||||
} break;
|
||||
case BattleHostState::out_of_ap:
|
||||
break;
|
||||
}
|
||||
|
||||
$ui.damage("player", result.enemy_did);
|
||||
$ui.damage("boss", result.player_did);
|
||||
}
|
||||
|
||||
void Fight::END(game::Event ev, std::any) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue