Update to the latest CreatureLib version.

This commit is contained in:
2020-04-06 20:03:44 +02:00
parent 29a82a5e75
commit 48ef465c82
41 changed files with 297 additions and 221 deletions

View File

@@ -2,7 +2,7 @@
#define PKMNLIB_ANGELSCRIPTSCRIPT_HPP
#include <CreatureLib/Battling/ScriptHandling/Script.hpp>
#define ANGELSCRIPT_DLL_LIBRARY_IMPORT
#include <CreatureLib/Core/Exceptions/NotImplementedException.hpp>
#include <CreatureLib/Library/Exceptions/NotImplementedException.hpp>
#include <angelscript.h>
#include "../../Battling/PkmnScript.hpp"
#include "AngelScriptTypeInfo.hpp"
@@ -21,9 +21,9 @@ public:
~AngelScriptScript() override { _obj->Release(); }
[[nodiscard]] const ConstString& GetName() const override { return _type->GetName(); }
[[nodiscard]] const ConstString& GetName() const noexcept override { return _type->GetName(); }
asIScriptFunction* PrepareMethod(const char* name, asIScriptContext* ctx) {
asIScriptFunction* PrepareMethod(const ConstString& name, asIScriptContext* ctx) {
auto func = _type->GetFunction(name);
ctx->Prepare(func);
ctx->SetObject(_obj);
@@ -71,7 +71,7 @@ public:
throw NotImplementedException(); // TODO
}
void ChangeAttack(CreatureLib::Battling::AttackTurnChoice* choice, std::string* outAttack) override {
void ChangeAttack(CreatureLib::Battling::AttackTurnChoice* choice, ConstString* outAttack) override {
throw NotImplementedException(); // TODO
}
@@ -246,7 +246,7 @@ public:
})
}
void OverrideDamage(CreatureLib::Battling::ExecutingAttack* attack, CreatureLib::Battling::Creature* target,
uint8_t hitIndex, int32_t* damage) override {
uint8_t hitIndex, uint32_t* damage) override {
CALL_HOOK(OverrideDamage, {
ctx->SetArgObject(0, (void*)attack);
ctx->SetArgObject(1, (void*)target);