Implemented better script handling.
This commit is contained in:
@@ -7,6 +7,8 @@
|
||||
#include "LearnedAttack.hpp"
|
||||
#include "DamageSource.hpp"
|
||||
#include "../ScriptHandling/ScriptSet.hpp"
|
||||
#include "../ScriptHandling/ScriptAggregator.hpp"
|
||||
#include "../ScriptHandling/ScriptSource.hpp"
|
||||
|
||||
namespace CreatureLib::Battling{
|
||||
// Forward declare battle class
|
||||
@@ -14,7 +16,7 @@ namespace CreatureLib::Battling{
|
||||
class BattleSide;
|
||||
class BattleLibrary;
|
||||
|
||||
class Creature {
|
||||
class Creature : public ScriptSource{
|
||||
GetProperty(const Library::CreatureSpecies*, Species);
|
||||
GetProperty(const Library::SpeciesVariant*, Variant);
|
||||
GetProperty(uint8_t, Level);
|
||||
@@ -63,9 +65,9 @@ namespace CreatureLib::Battling{
|
||||
[[nodiscard]] const std::vector<uint8_t>& GetTypes() const;
|
||||
[[nodiscard]] bool HasType(uint8_t type) const;
|
||||
|
||||
void ExecuteScripts(Hook hook, const std::vector<std::any>& args){
|
||||
_status->Execute(hook, args);
|
||||
_volatile.Execute(hook, args);
|
||||
void GetActiveScripts(ScriptAggregator& aggr) override{
|
||||
aggr.Add(_status);
|
||||
aggr.Add(&_volatile);
|
||||
}
|
||||
|
||||
//region Stat APIs
|
||||
|
||||
Reference in New Issue
Block a user