96 lines
5.4 KiB
C++
96 lines
5.4 KiB
C++
#include "../../src/Battling/ScriptHandling/BattleScript.hpp"
|
|
#include "../Core.hpp"
|
|
using namespace CreatureLib::Battling;
|
|
|
|
export_func void CreatureLib_Script_Destruct(BattleScript* p) { delete p; }
|
|
|
|
export_func u8 CreatureLib_Script_Stack(BattleScript* p) { Try(p->Stack()); }
|
|
export_func u8 CreatureLib_Script_OnRemove(BattleScript* p) { Try(p->OnRemove()); }
|
|
export_func const char* CreatureLib_Script_GetName(BattleScript* p) { return p->GetName().c_str(); }
|
|
|
|
export_func u8 CreatureLib_Script_OnBeforeTurn(BattleScript* p, const BaseTurnChoice* choice) {
|
|
Try(p->OnBeforeTurn(choice));
|
|
}
|
|
export_func u8 CreatureLib_Script_ChangeAttack(BattleScript* p, AttackTurnChoice* choice, const char*& outAttack) {
|
|
Try(auto sv = ArbUt::StringView(outAttack); p->ChangeAttack(choice, &sv); outAttack = sv.c_str(););
|
|
}
|
|
export_func u8 CreatureLib_Script_PreventAttack(BattleScript* p, ExecutingAttack* attack, bool* outResult) {
|
|
Try(p->PreventAttack(attack, outResult));
|
|
}
|
|
export_func u8 CreatureLib_Script_FailAttack(BattleScript* p, ExecutingAttack* attack, bool* outResult) {
|
|
Try(p->FailAttack(attack, outResult));
|
|
}
|
|
export_func u8 CreatureLib_Script_StopBeforeAttack(BattleScript* p, ExecutingAttack* attack, bool* outResult) {
|
|
Try(p->StopBeforeAttack(attack, outResult));
|
|
}
|
|
export_func u8 CreatureLib_Script_OnBeforeAttack(BattleScript* p, ExecutingAttack* attack) {
|
|
Try(p->OnBeforeAttack(attack));
|
|
}
|
|
|
|
export_func u8 CreatureLib_Script_FailIncomingAttack(BattleScript* p, ExecutingAttack* attack, Creature* target,
|
|
bool* outResult) {
|
|
Try(p->FailIncomingAttack(attack, target, outResult));
|
|
}
|
|
|
|
export_func u8 CreatureLib_Script_IsInvulnerable(BattleScript* p, ExecutingAttack* attack, Creature* target,
|
|
bool* outResult) {
|
|
Try(p->IsInvulnerable(attack, target, outResult));
|
|
}
|
|
export_func u8 CreatureLib_Script_OnAttackMiss(BattleScript* p, ExecutingAttack* attack, Creature* target) {
|
|
Try(p->OnAttackMiss(attack, target));
|
|
}
|
|
export_func u8 CreatureLib_Script_ChangeAttackType(BattleScript* p, ExecutingAttack* attack, Creature* target,
|
|
u8 hitNumber, u8* outType) {
|
|
Try(p->ChangeAttackType(attack, target, hitNumber, outType))
|
|
}
|
|
export_func u8 CreatureLib_Script_OverrideBasePower(BattleScript* p, ExecutingAttack* attack, Creature* target,
|
|
u8 hitNumber, u8* basePower) {
|
|
Try(p->OverrideBasePower(attack, target, hitNumber, basePower));
|
|
}
|
|
export_func u8 CreatureLib_Script_ChangeDamageStatsUser(BattleScript* p, ExecutingAttack* attack, Creature* target,
|
|
u8 hitNumber, Creature** statsUser) {
|
|
Try(p->ChangeDamageStatsUser(attack, target, hitNumber, statsUser));
|
|
}
|
|
export_func u8 CreatureLib_Script_BypassDefensiveStat(BattleScript* p, ExecutingAttack* attack, Creature* target,
|
|
u8 hitNumber, bool* bypass) {
|
|
Try(p->BypassDefensiveStat(attack, target, hitNumber, bypass));
|
|
}
|
|
export_func u8 CreatureLib_Script_BypassOffensiveStat(BattleScript* p, ExecutingAttack* attack, Creature* target,
|
|
u8 hitNumber, bool* bypass) {
|
|
Try(p->BypassOffensiveStat(attack, target, hitNumber, bypass));
|
|
}
|
|
export_func u8 CreatureLib_Script_ModifyStatModifier(BattleScript* p, ExecutingAttack* attack, Creature* target,
|
|
u8 hitNumber, float* modifier) {
|
|
Try(p->ModifyStatModifier(attack, target, hitNumber, modifier));
|
|
}
|
|
export_func u8 CreatureLib_Script_ModifyDamageModifier(BattleScript* p, ExecutingAttack* attack, Creature* target,
|
|
u8 hitNumber, float* modifier) {
|
|
Try(p->ModifyDamageModifier(attack, target, hitNumber, modifier));
|
|
}
|
|
export_func u8 CreatureLib_Script_OverrideDamage(BattleScript* p, ExecutingAttack* attack, Creature* target,
|
|
u8 hitNumber, u32* damage) {
|
|
Try(p->OverrideDamage(attack, target, hitNumber, damage));
|
|
}
|
|
export_func u8 CreatureLib_Script_PreventSecondaryEffects(BattleScript* p, ExecutingAttack* attack, Creature* target,
|
|
u8 hitNumber, bool* outResult) {
|
|
Try(p->PreventSecondaryEffects(attack, target, hitNumber, outResult));
|
|
}
|
|
export_func u8 CreatureLib_Script_OnSecondaryEffect(BattleScript* p, ExecutingAttack* attack, Creature* target,
|
|
u8 hitNumber) {
|
|
Try(p->OnSecondaryEffect(attack, target, hitNumber));
|
|
}
|
|
export_func u8 CreatureLib_Script_OnAfterHits(BattleScript* p, ExecutingAttack* attack, Creature* target) {
|
|
Try(p->OnAfterHits(attack, target));
|
|
}
|
|
export_func u8 CreatureLib_Script_PreventSelfSwitch(BattleScript* p, const SwitchTurnChoice* choice, bool* outResult) {
|
|
Try(p->PreventSelfSwitch(choice, outResult));
|
|
}
|
|
export_func u8 CreatureLib_Script_ModifyEffectChance(BattleScript* p, const ExecutingAttack* attack, Creature* target,
|
|
float* chance) {
|
|
Try(p->ModifyEffectChance(attack, target, chance));
|
|
}
|
|
export_func u8 CreatureLib_Script_ModifyIncomingEffectChance(BattleScript* p, const ExecutingAttack* attack,
|
|
Creature* target, float* chance) {
|
|
Try(p->ModifyIncomingEffectChance(attack, target, chance));
|
|
}
|