1 #ifndef GAME_BATTLES_BATTLER_HPP
2 #define GAME_BATTLES_BATTLER_HPP
15 class BattlerController;
37 void init(std::vector<core::pplmn::BattlePeoplemon>&& team,
38 std::unique_ptr<BattlerController>&& controller);
95 std::vector<core::pplmn::BattlePeoplemon>&
peoplemon();
132 const std::string&
name()
const;
238 std::unique_ptr<BattlerController> controller;
239 std::vector<core::pplmn::BattlePeoplemon> team;
240 std::uint8_t currentPeoplemon;
Id
Represents an item in its simplist form.
Core classes and functionality for both the editor and game.
TurnAction
Represents an action that a battler may take on their turn.
Base class for battlers in the game. This provides storage for peoplemon and turn choices.
void notifyTurnEnd()
Notifies the battler that a turn has ended.
void startChooseToContinue()
Begins to decide whether or not to continue.
void init(std::vector< core::pplmn::BattlePeoplemon > &&team, std::unique_ptr< BattlerController > &&controller)
Initializes the battler with a team and a controller.
void pickPeoplemon(bool fromFaint, bool reviveOnly)
Initiates the process of selecting a replacement peoplemon if the current one faints.
unsigned int outNowIndex() const
Returns the index of the peoplemon that is out now.
void refresh()
Calls refresh on the controller. Should be called every update.
bool actionSelected() const
Returns whether or not the battler has chosen what to do on this turn.
bool removeItem(item::Id item)
Removes the given item from the battler's inventory.
Battler()
Creates an uninitialized battler.
int getNextXpEarnerIndex(int ci)
Returns the index of the next peoplemon that should earn XP.
bool shouldContinue() const
Returns whether or not the player has chosen to continue.
BattlerSubstate & getSubstate()
Returns the state of this battler.
bool canFight() const
Returns true if the battler has at least one non-fainted peoplemon.
core::pplmn::BattlePeoplemon & activePeoplemon()
Returns the peoplemon that is currently out.
bool isHost() const
Returns whether or not this battler is the host.
TurnAction chosenAction() const
Returns the action the battler is using this turn.
int xpEarnerCount() const
Returns how many of the current peoplemon should earn exp.
std::uint8_t chosenPeoplemon() const
Returns the peoplemon the battler is switching to this turn.
bool canSwitch() const
Returns whether or not the battler has another peoplemon besides the active one.
unsigned int selectRandomPeoplemon() const
Returns the index of a random, living Peoplemon that is not currently out.
int prizeMoney() const
Returns the amount of prize money awarded for defeating this battler.
int chosenMove() const
Returns the move the battler is using this turn.
core::item::Id chosenItem() const
Returns the item the battler is using this turn.
int getFirstXpEarner() const
Returns the index of the first peoplemon that should earn XP.
void pickAction()
Initiates the process of selecting what to do on this turn.
unsigned int getPriority() const
Returns the priority of the battler's action. Fight returns the move priority and other choices retur...
const std::string & name() const
Returns the name of the battler.
void resetXpEarners()
Resets who earns XP.
std::vector< core::pplmn::BattlePeoplemon > & peoplemon()
Returns all the peoplemon held by this battler.
int getBroCount() const
Returns the number of total bros in the party, excluding the active peoplemon.
void notifyTurnBegin()
Notifies the battler that a turn has began.
void setActivePeoplemon(unsigned int index)
Sets the Peoplemon that is out now.
Struct containing state specific to each battler. These states facilitate logic that takes place over...
Represents a Peoplemon in battle. Stores some extra state that only exists in battle....