Implements Change Effectiveness script hook in AngelScript.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-04-19 13:41:41 +02:00
parent 95209e51a4
commit 6abef0ddc8
4 changed files with 30 additions and 3 deletions

View File

@@ -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, {