Implements Change Effectiveness script hook in AngelScript.
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:
@@ -4,6 +4,7 @@
|
||||
#define ANGELSCRIPT_DLL_LIBRARY_IMPORT
|
||||
#include <CreatureLib/Library/Exceptions/NotImplementedException.hpp>
|
||||
#include <angelscript.h>
|
||||
#include <cstdint>
|
||||
#include "../../../extern/angelscript_addons/scriptarray/scriptarray.h"
|
||||
#include "../../Battling/PkmnScript.hpp"
|
||||
#include "AngelScriptTypeInfo.hpp"
|
||||
@@ -167,6 +168,16 @@ public:
|
||||
})
|
||||
}
|
||||
|
||||
void ChangeEffectiveness(CreatureLib::Battling::ExecutingAttack* attack, CreatureLib::Battling::Creature* target,
|
||||
uint8_t hitNumber, float* effectiveness) override {
|
||||
CALL_HOOK(ChangeEffectiveness, {
|
||||
ctx->SetArgObject(0, (void*)attack);
|
||||
ctx->SetArgObject(1, (void*)target);
|
||||
ctx->SetArgByte(2, hitNumber);
|
||||
ctx->SetArgAddress(3, effectiveness);
|
||||
})
|
||||
}
|
||||
|
||||
void PreventSecondaryEffects(const CreatureLib::Battling::ExecutingAttack* attack,
|
||||
CreatureLib::Battling::Creature* target, uint8_t hitNumber, bool* outResult) override {
|
||||
CALL_HOOK(PreventSecondaryEffects, {
|
||||
|
||||
Reference in New Issue
Block a user