[BREAKING] Battle system now runs the turn based combat better, and lots of interesting things like if you don't choose an action the host AI rebels and does it for you.
This commit is contained in:
parent
9739441a9c
commit
986b2612d4
9 changed files with 100 additions and 32 deletions
|
|
@ -59,6 +59,7 @@ TEST_CASE("battle operations fantasy", "[combat-battle]") {
|
|||
battle.player_request("use_healing");
|
||||
battle.player_request("kill_enemy");
|
||||
|
||||
battle.ap_refresh();
|
||||
battle.plan();
|
||||
|
||||
while(auto act = battle.next()) {
|
||||
|
|
@ -112,11 +113,18 @@ TEST_CASE("boss/systems.cpp works", "[combat-battle]") {
|
|||
|
||||
System::initialize_actor_ai(*fight->$world, fight->$boss_id);
|
||||
|
||||
battle.set(host, "tough_personality", false);
|
||||
battle.set(host, "have_healing", false);
|
||||
battle.set(host, "health_good", host_combat.hp > 20);
|
||||
// NEED UPDATE STATE
|
||||
battle.set_all("enemy_found", true);
|
||||
battle.set_all("in_combat", true);
|
||||
battle.set_all("tough_personality", true);
|
||||
battle.set_all("health_good", true);
|
||||
|
||||
battle.ap_refresh();
|
||||
|
||||
battle.player_request("kill_enemy");
|
||||
int pending_ap = battle.player_pending_ap();
|
||||
|
||||
REQUIRE(pending_ap < host_combat.ap);
|
||||
|
||||
System::plan_battle(battle, fight->$world, fight->$boss_id);
|
||||
|
||||
|
|
@ -124,4 +132,6 @@ TEST_CASE("boss/systems.cpp works", "[combat-battle]") {
|
|||
dbc::log("ACTION!");
|
||||
System::combat(*action, fight->$world, fight->$boss_id, 0);
|
||||
}
|
||||
|
||||
REQUIRE(host_combat.ap == pending_ap);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue