raycaster/boss/system.cpp

36 lines
994 B
C++

#include "boss/system.hpp"
#include <fmt/core.h>
#include "components.hpp"
#include "game_level.hpp"
namespace boss {
using namespace components;
void System::load_config() {
fmt::println("load it");
}
shared_ptr<boss::Fight> System::create_bossfight() {
auto& level = GameDB::current_level();
auto prev_world = GameDB::current_world();
dbc::check(prev_world != nullptr, "Starter world for boss fights can't be null.");
auto world = GameDB::clone_load_world(prev_world);
auto& config = prev_world->get_the<GameConfig>();
auto boss_names = config.bosses.keys();
auto& level_name = boss_names[level.index % boss_names.size()];
auto& boss_data = config.bosses[level_name];
auto boss_id = world->entity();
components::configure_entity(*world, boss_id, boss_data["components"]);
return make_shared<boss::Fight>(world, boss_id);
}
void System::combat(int attack_id) {
(void)attack_id;
}
void System::ai_initialize() {
}
}