Initial setup for script hooks (likely to be revamped)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include "../../Library/Items/Item.hpp"
|
||||
#include "LearnedAttack.hpp"
|
||||
#include "DamageSource.hpp"
|
||||
#include "../ScriptHandling/ScriptSet.hpp"
|
||||
|
||||
namespace CreatureLib::Battling{
|
||||
// Forward declare battle class
|
||||
@@ -40,6 +41,9 @@ namespace CreatureLib::Battling{
|
||||
int8_t _talentIndex;
|
||||
std::vector<LearnedAttack*> _attacks;
|
||||
|
||||
Script* _status = nullptr;
|
||||
ScriptSet _volatile = {};
|
||||
|
||||
public:
|
||||
Creature(const Library::CreatureSpecies* species, const Library::SpeciesVariant* variant, uint8_t level,
|
||||
uint32_t experience, Core::StatisticSet<uint8_t > statExp, Core::StatisticSet<uint8_t > statPotential,
|
||||
@@ -59,6 +63,11 @@ 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);
|
||||
}
|
||||
|
||||
//region Stat APIs
|
||||
|
||||
void SetBattle(Battle* battle);
|
||||
|
||||
Reference in New Issue
Block a user