Added in a new art for a 'gold savior' and refined the battle engine more but it's not quite what I want.
This commit is contained in:
parent
ca328e10dc
commit
0e2f213871
7 changed files with 88 additions and 32 deletions
16
systems.cpp
16
systems.cpp
|
@ -223,20 +223,24 @@ void System::combat(GameLevel &level) {
|
|||
}
|
||||
}
|
||||
|
||||
battle.set_all("enemy_found", true);
|
||||
battle.set_all("in_combat", true);
|
||||
battle.plan();
|
||||
}
|
||||
|
||||
while(auto enemy = battle.next()) {
|
||||
while(auto act = battle.next()) {
|
||||
auto [enemy, action] = *act;
|
||||
|
||||
Events::Combat result {
|
||||
player_combat.attack(enemy->combat), 0
|
||||
player_combat.attack(enemy.combat), 0
|
||||
};
|
||||
|
||||
if(enemy->ai.wants_to("kill_enemy")) {
|
||||
result.enemy_did = enemy->combat.attack(player_combat);
|
||||
animate_entity(world, enemy->entity);
|
||||
if(enemy.ai.wants_to("kill_enemy")) {
|
||||
result.enemy_did = enemy.combat.attack(player_combat);
|
||||
animate_entity(world, enemy.entity);
|
||||
}
|
||||
|
||||
world.send<Events::GUI>(Events::GUI::COMBAT, enemy->entity, result);
|
||||
world.send<Events::GUI>(Events::GUI::COMBAT, enemy.entity, result);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue