3 #include <BLIB/Util/Random.hpp>
18 const pplmn::WildPeoplemon DebugWild{
28 currentWild = DebugWild.generate();
37 BL_LOG_INFO <<
"Starting wild battle";
45 void WildPeoplemon::startBattle() {
46 std::unique_ptr<battle::Battle> battle =
51 std::vector<pplmn::BattlePeoplemon> team;
52 team.emplace_back(¤tWild);
54 battle->state.enemy().init(
56 std::make_unique<battle::AIController>(currentWild.
name(), std::vector<item::Id>{}));
57 battle->setController(std::make_unique<battle::LocalBattleController>());
59 bl::event::Dispatcher::dispatch<event::BattleStarted>({std::move(battle)});
Core classes and functionality for both the editor and game.
static std::unique_ptr< Battle > create(bl::engine::Engine &engine, const std::string &location, system::Player &player, Type type)
Creates the battle struct and initializes the player battler.
Fired when an entity completes a move from one tile to another.
const bl::ecs::Entity entity
The entity that moved.
const bl::tmap::Position & position
The current position of the entity.
Represents a class of catchable peoplemon.
const pplmn::WildPeoplemon & selectWild() const
Selects a wild peoplemon from the set based on frequency, or returns a level 100 Ben if the set is em...
const CatchRegion * getCatchRegion(const bl::tmap::Position &position) const
Returns the catch region at the given position if the position is on a catch tile.
const std::string & getLocationName(const bl::tmap::Position &pos) const
Returns the name of the town or route at the given position.
const std::string & name() const
Returns the name of this peoplemon, custom or defualt.
OwnedPeoplemon generate() const
Generate an OwnedPeoplemon from the template.
static unsigned int WildPeoplemonChance()
player::State & state()
Returns the state of the player.
const bl::tmap::Position & position() const
Returns the current position of the player.
bl::ecs::Entity player() const
Returns the id of the player entity.
Owns all primary systems and a reference to the engine.
const bl::engine::Engine & engine() const
Const accessor for the Engine.
Player & player()
Returns the player system.
World & world()
Modifiable accessor for the world system.
void init()
Subscribes to the game event bus.
void startDebugBattle()
Starts a wild Peoplemon battle for debugging.
WildPeoplemon(Systems &owner)
Construct a new Wild Peoplemon system.
map::Map & activeMap()
Returns a reference to the active map.