Adds GetLastUsedAttackOnTargetWrapper wrapper function to Angelscript.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2021-11-19 13:10:30 +01:00
parent 47e3919734
commit ea3bc7ee33
Signed by: Deukhoofd
GPG Key ID: F63E044490819F6F
1 changed files with 8 additions and 0 deletions

View File

@ -61,6 +61,10 @@ const HistoryElement* GetLastUsedAttackWrapper(const HistoryHolder* holder, u32
return holder->GetLastUsedAttack(maxTurns).GetValue(); return holder->GetLastUsedAttack(maxTurns).GetValue();
} }
const HistoryElement* GetLastUsedAttackOnTargetWrapper(const HistoryHolder* holder, Creature* target, u32 maxTurns) {
return holder->GetLastUsedAttackOnTarget(target, maxTurns).GetValue();
}
const HistoryElement* GetLastDamageOnTargetWrapper(const HistoryHolder* holder, const Creature* c, u32 maxTurns) { const HistoryElement* GetLastDamageOnTargetWrapper(const HistoryHolder* holder, const Creature* c, u32 maxTurns) {
return holder->GetLastDamageOnTarget(c, maxTurns).GetValue(); return holder->GetLastDamageOnTarget(c, maxTurns).GetValue();
} }
@ -72,6 +76,10 @@ void RegisterBattleHistory::RegisterHistoryHolder(asIScriptEngine* engine) {
Ensure(engine->RegisterObjectMethod("BattleHistory", Ensure(engine->RegisterObjectMethod("BattleHistory",
"const AttackUseHistory@ GetLastUsedAttack(uint maxTurns = 0) const", "const AttackUseHistory@ GetLastUsedAttack(uint maxTurns = 0) const",
asFunctionPtr(GetLastUsedAttackWrapper), asCALL_CDECL_OBJFIRST) >= 0); asFunctionPtr(GetLastUsedAttackWrapper), asCALL_CDECL_OBJFIRST) >= 0);
Ensure(engine->RegisterObjectMethod(
"BattleHistory",
"const AttackUseHistory@ GetLastUsedAttackOnTarget(Pokemon@ target, uint maxTurns = 0) const",
asFunctionPtr(GetLastUsedAttackOnTargetWrapper), asCALL_CDECL_OBJFIRST) >= 0);
Ensure(engine->RegisterObjectMethod( Ensure(engine->RegisterObjectMethod(
"BattleHistory", "const DamageHistory@ GetLastDamageOnTarget(Pokemon@ target, uint maxTurns = 0) const", "BattleHistory", "const DamageHistory@ GetLastDamageOnTarget(Pokemon@ target, uint maxTurns = 0) const",
asFunctionPtr(GetLastDamageOnTargetWrapper), asCALL_CDECL_OBJFIRST) >= 0); asFunctionPtr(GetLastDamageOnTargetWrapper), asCALL_CDECL_OBJFIRST) >= 0);