[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:
Zed A. Shaw 2025-12-11 13:49:53 -05:00
parent 9739441a9c
commit 986b2612d4
9 changed files with 100 additions and 32 deletions

View file

@ -4,7 +4,7 @@
#include "dinkyecs.hpp"
#include <optional>
#include "components.hpp"
#include <set>
#include <unordered_map>
namespace combat {
@ -32,7 +32,8 @@ namespace combat {
struct BattleEngine {
std::unordered_map<DinkyECS::Entity, Combatant> $combatants;
std::vector<BattleResult> $pending_actions;
std::set<std::string> $player_requests;
std::unordered_map<std::string, ai::Action> $player_requests;
components::Combat* $host_combat = nullptr;
void add_enemy(Combatant ba);
Combatant& get_enemy(DinkyECS::Entity entity);
@ -41,7 +42,9 @@ namespace combat {
void dump();
void set(DinkyECS::Entity entity, const std::string& state, bool setting);
void set_all(const std::string& state, bool setting);
void player_request(const std::string& request);
bool player_request(const std::string& request);
int player_pending_ap();
void clear_requests();
void ap_refresh();
};
}