Beginning state machine for controlling the boss fight UI is up.
This commit is contained in:
parent
1537a81aac
commit
9739441a9c
8 changed files with 173 additions and 135 deletions
|
|
@ -82,14 +82,6 @@ namespace boss {
|
|||
void System::plan_battle(BattleEngine& battle, std::shared_ptr<DinkyECS::World> world, DinkyECS::Entity boss_id) {
|
||||
// REFACTOR: make this loop the list of entities in the battle then
|
||||
// use their world state to configure the plan
|
||||
auto& level = GameDB::current_level();
|
||||
auto& player_combat = world->get<Combat>(level.player);
|
||||
|
||||
battle.set(level.player, "tough_personality", false);
|
||||
battle.set(level.player, "have_healing", false);
|
||||
battle.set(level.player, "health_good", player_combat.hp > 20);
|
||||
|
||||
battle.player_request("kill_enemy");
|
||||
battle.plan();
|
||||
}
|
||||
|
||||
|
|
@ -105,15 +97,18 @@ namespace boss {
|
|||
|
||||
switch(host_state) {
|
||||
case BattleHostState::agree:
|
||||
dbc::log("host_agrees");
|
||||
// BUG: this is hard coding only one boss, how to select targets?
|
||||
if(wants_to == "kill_enemy") {
|
||||
result.player_did = player_combat.attack(boss_combat);
|
||||
}
|
||||
break;
|
||||
case BattleHostState::disagree:
|
||||
dbc::log("host_DISagrees");
|
||||
fmt::println("HOST DISAGREES! {}", wants_to);
|
||||
break;
|
||||
case BattleHostState::not_host:
|
||||
dbc::log("kill_enemy");
|
||||
if(wants_to == "kill_enemy") {
|
||||
result.enemy_did = enemy.combat->attack(player_combat);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue