2020-02-16 16:50:16 +00:00
|
|
|
#ifndef PKMNLIB_BATTLE_HPP
|
|
|
|
#define PKMNLIB_BATTLE_HPP
|
|
|
|
|
|
|
|
#include <CreatureLib/Battling/Models/Battle.hpp>
|
2020-04-18 14:21:38 +00:00
|
|
|
#include "../EventHooks/WeatherChangeEvent.hpp"
|
2020-02-16 16:50:16 +00:00
|
|
|
#include "../Library/BattleLibrary.hpp"
|
2020-04-18 13:35:01 +00:00
|
|
|
#include "../PkmnScriptCategory.hpp"
|
2020-02-16 16:50:16 +00:00
|
|
|
|
|
|
|
namespace PkmnLib::Battling {
|
2020-02-17 15:56:44 +00:00
|
|
|
class Battle : public CreatureLib::Battling::Battle {
|
2020-04-18 13:35:01 +00:00
|
|
|
private:
|
2020-06-02 18:37:21 +00:00
|
|
|
std::unique_ptr<CreatureLib::Battling::Script> _weatherScript = nullptr;
|
2020-04-18 13:35:01 +00:00
|
|
|
|
2020-02-16 16:50:16 +00:00
|
|
|
public:
|
2020-05-27 15:26:25 +00:00
|
|
|
Battle(const BattleLibrary* library, const ArbUt::List<CreatureLib::Battling::BattleParty*>& parties,
|
2020-02-16 16:50:16 +00:00
|
|
|
bool canFlee = true, uint8_t numberOfSides = 2, uint8_t creaturesPerSide = 1)
|
|
|
|
: CreatureLib::Battling::Battle(library, parties, canFlee, numberOfSides, creaturesPerSide) {}
|
2020-04-18 13:35:01 +00:00
|
|
|
|
2020-05-27 15:26:25 +00:00
|
|
|
void SetWeather(const ArbUt::CaseInsensitiveConstString& name);
|
2020-04-26 18:01:11 +00:00
|
|
|
void ClearWeather();
|
2020-05-27 15:26:25 +00:00
|
|
|
const ArbUt::CaseInsensitiveConstString& GetWeatherName() noexcept { return _weatherScript->GetName(); }
|
2020-04-18 13:35:01 +00:00
|
|
|
|
2020-04-25 09:43:04 +00:00
|
|
|
size_t ScriptCount() const override { return CreatureLib::Battling::Battle::ScriptCount() + 1; }
|
2020-05-27 15:26:25 +00:00
|
|
|
void GetActiveScripts(ArbUt::List<CreatureLib::Battling::ScriptWrapper>& scripts) override {
|
2020-04-18 13:35:01 +00:00
|
|
|
CreatureLib::Battling::Battle::GetActiveScripts(scripts);
|
2020-04-23 21:31:17 +00:00
|
|
|
scripts.Append(CreatureLib::Battling::ScriptWrapper(
|
|
|
|
CreatureLib::Battling::ScriptWrapper::FromScript(&_weatherScript)));
|
2020-04-18 13:35:01 +00:00
|
|
|
}
|
2020-02-16 16:50:16 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // PKMNLIB_BATTLE_HPP
|