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:
Zed A. Shaw 2025-04-07 14:02:32 -04:00
parent ca328e10dc
commit 0e2f213871
7 changed files with 88 additions and 32 deletions

View file

@ -7,19 +7,31 @@
namespace combat {
struct BattleAction {
struct Combatant {
DinkyECS::Entity entity;
ai::EntityAI &ai;
components::Combat &combat;
};
struct BattleEngine {
std::unordered_map<DinkyECS::Entity, BattleAction> combatants;
std::vector<BattleAction> pending_actions;
enum class BattleAction {
ATTACK, BLOCK, ESCAPE
};
void add_enemy(BattleAction ba);
struct BattleResult {
Combatant &state;
BattleAction action;
};
struct BattleEngine {
std::unordered_map<DinkyECS::Entity, Combatant> combatants;
std::vector<BattleResult> pending_actions;
void add_enemy(Combatant ba);
bool plan();
std::optional<BattleAction> next();
std::optional<BattleResult> next();
void dump();
void set(DinkyECS::Entity entity, std::string state, bool setting);
void set_all(std::string state, bool setting);
void queue(DinkyECS::Entity entity, BattleAction action);
};
}