From 46538092bf86ee8582e33300221faff5c1528355 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 12 Nov 2021 13:00:34 +0100 Subject: [PATCH] Support for failing a MoveTurnChoice in Angelscript. --- .../TypeRegistry/Battling/RegisterTurnChoices.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterTurnChoices.cpp b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterTurnChoices.cpp index 7e345fb..d76d6dd 100644 --- a/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterTurnChoices.cpp +++ b/src/ScriptResolving/AngelScript/TypeRegistry/Battling/RegisterTurnChoices.cpp @@ -39,6 +39,12 @@ void RegisterTurnChoices::RegisterMoveTurnChoice(asIScriptEngine* engine) { GetAttack); REGISTER_GETTER("MoveTurnChoice", "int8 get_Priority() const property", CreatureLib::Battling::AttackTurnChoice, GetPriority); + REGISTER_GETTER("MoveTurnChoice", "bool get_HasFailed() const property", CreatureLib::Battling::AttackTurnChoice, + HasFailed); + + r = engine->RegisterObjectMethod("MoveTurnChoice", "void Fail()", + asMETHOD(CreatureLib::Battling::AttackTurnChoice, Fail), asCALL_THISCALL); + Ensure(r >= 0); r = engine->RegisterObjectMethod( "BaseTurnChoice", "MoveTurnChoice@ opCast()",