13#include <aegis/system.hpp>
20#include <etl/vector.h>
40class BattleSystem :
public ae::SystemRouter<BattleSystem, Event::ExecuteBattle>,
public ae::Singleton<BattleSystem>
63 void update(ae::q20_12_t )
override;
BattleStartCondition
Describes how the Battle was started eg. PartyAdvantage if Player surprised the enemy.
Generic events used across multiple systems.
Orchestrates rendering text from a bitmap.
etl::vector< PartyMember *, 4 > partyMembers
PersonaBase * personaBeforeSwitch
SwitchPersona switchPersona
bool allEnemiesKnockedDown()
Evaluates if an All-Out Attack condition is met.
void calculateTurnOrder()
Calculates the initial turn queue at the start of an encounter.
bool allOutAttackWasPossibleThisKnockDown
static constexpr u32 ACTION_PERSONA
void on_receive_unknown(const etl::imessage &msg)
Fallback handler for unhandled ETL messages.
BattlePhase alertReturnPhase
etl::vector< BattleParticipant *, 13 > battleParticipants
void setMusicComponent(MusicComponent *music)
static bool getParticipantByHigherAgility(BattleParticipant *a, BattleParticipant *b)
Sorting predicate used to order combatants by agility.
bool isSingleTarget(SkillType type)
Determines if a skill targets a single entity.
static constexpr u32 ACTION_GUARD
u32 currentParticipantIndex
void handleDeadParticipants()
Sweeps the field for dead participants and evaluates encounter end conditions.
void advanceTurn()
Progresses the battle state machine to the next logical step.
BattleStartCondition battleStartCondition
void on_receive(const Event::ExecuteBattle &msg)
ETL message handler that initializes and starts a new battle.
bool switchedPersonaThisTurn
void update(ae::q20_12_t) override
Core update loop that processes the battle state machine and turn resolution.
etl::vector< BattleParticipant *, 13 > getAliveEnemies()
Filters the enemy roster for living combatants.
void setNextPhase(BattlePhase nextPhase)
Safely transitions the state machine to a new BattlePhase.
BattleParticipant * currentParticipantTurn
static constexpr u32 ACTION_SWITCH
std::array< ActionBase *, 4 > actions
bool pendingPersonaSwitch
static constexpr u32 ACTION_ATTACK
etl::vector< Enemy *, 8 > enemies
BattleMenu * battleMenuCmpt
Event::BattleResult battleResult
MusicComponent * musicCmpt
void applyResult(const TurnResult &r, BattleParticipant *target=nullptr)
Resolves the mathematical and state changes of a combat action against a target.
Holds routerIDs used for systems.
constexpr etl::message_router_id_t kBattleSystemRouterID
ae::q20_12_t currentTurnOrderAgility
Holds data on how the battle concluded.
Event payload to start the BattleSystem.
Result of a singular turn. Note that currently multi target skills do use a seperate turn result for ...