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
|
|
@ -5,8 +5,16 @@
|
|||
#include "battle.hpp"
|
||||
#include "simplefsm.hpp"
|
||||
#include "dinkyecs.hpp"
|
||||
#include "boss/system.hpp"
|
||||
#include "backend.hpp"
|
||||
#include "game_level.hpp"
|
||||
#include "animation.hpp"
|
||||
#include "components.hpp"
|
||||
#include "ai.hpp"
|
||||
|
||||
using namespace combat;
|
||||
using namespace boss;
|
||||
using namespace components;
|
||||
|
||||
TEST_CASE("battle operations fantasy", "[combat-battle]") {
|
||||
ai::reset();
|
||||
|
|
@ -85,3 +93,35 @@ TEST_CASE("battle operations fantasy", "[combat-battle]") {
|
|||
REQUIRE(!battle.next());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("boss/systems.cpp works", "[combat-battle]") {
|
||||
components::init();
|
||||
sfml::Backend backend;
|
||||
guecs::init(&backend);
|
||||
ai::reset();
|
||||
ai::init("ai");
|
||||
animation::init();
|
||||
GameDB::init();
|
||||
cinematic::init();
|
||||
auto host = GameDB::current_level().player;
|
||||
|
||||
auto fight = System::create_bossfight();
|
||||
auto battle = System::create_battle(fight->$world, fight->$boss_id);
|
||||
auto& host_combat = fight->$world->get<Combat>(host);
|
||||
|
||||
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);
|
||||
|
||||
battle.player_request("kill_enemy");
|
||||
|
||||
System::plan_battle(battle, fight->$world, fight->$boss_id);
|
||||
|
||||
while(auto action = battle.next()) {
|
||||
dbc::log("ACTION!");
|
||||
System::combat(*action, fight->$world, fight->$boss_id, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue