From 9ff5df1b707ffcb53777201cbbc2691341414e1a Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Mon, 6 Apr 2020 12:53:49 +0200 Subject: [PATCH] Add C interface for secondary effect data. --- CInterface/Library/AttackData.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CInterface/Library/AttackData.cpp b/CInterface/Library/AttackData.cpp index 65953ef..9332017 100644 --- a/CInterface/Library/AttackData.cpp +++ b/CInterface/Library/AttackData.cpp @@ -29,6 +29,16 @@ SIMPLE_GET_FUNC(AttackData, GetBaseUsages, uint8_t); SIMPLE_GET_FUNC(AttackData, GetTarget, AttackTarget); SIMPLE_GET_FUNC(AttackData, GetPriority, int8_t); +export bool CreatureLib_AttackData_HasSecondaryEffect(const AttackData* p) { return p->HasSecondaryEffect(); } + +export uint8_t CreatureLib_AttackData_GetSecondaryEffectChance(const AttackData* p) { + return p->GetSecondaryEffect().GetChance(); +} + +export const char* CreatureLib_AttackData_GetSecondaryEffectName(const AttackData* p) { + return p->GetSecondaryEffect().GetEffectName().c_str(); +} + export bool CreatureLib_AttackData_HasFlag(const AttackData* p, const char* key) { return p->HasFlag(ConstString::GetHash(key)); }