CreatureLib/CInterface/Battling/Script.cpp

94 lines
5.3 KiB
C++
Raw Normal View History

2020-03-25 18:47:37 +00:00
#include "../../src/Battling/ScriptHandling/Script.hpp"
#include "../Core.hpp"
2020-03-25 18:47:37 +00:00
using namespace CreatureLib::Battling;
export void CreatureLib_Script_Destruct(Script* p) { delete p; }
export uint8_t CreatureLib_Script_Stack(Script* p) { Try(p->Stack()); }
export uint8_t CreatureLib_Script_OnRemove(Script* p) { Try(p->OnRemove()); }
export const char* CreatureLib_Script_GetName(Script* p) { return p->GetName().c_str(); }
export uint8_t CreatureLib_Script_OnBeforeTurn(Script* p, const BaseTurnChoice* choice) {
Try(p->OnBeforeTurn(choice));
}
2020-06-26 15:08:23 +00:00
export uint8_t CreatureLib_Script_ChangeAttack(Script* p, AttackTurnChoice* choice, ArbUt::StringView* outAttack) {
2020-03-25 18:47:37 +00:00
Try(p->ChangeAttack(choice, outAttack));
}
export uint8_t CreatureLib_Script_PreventAttack(Script* p, ExecutingAttack* attack, bool* outResult) {
Try(p->PreventAttack(attack, outResult));
}
export uint8_t CreatureLib_Script_FailAttack(Script* p, ExecutingAttack* attack, bool* outResult) {
Try(p->FailAttack(attack, outResult));
}
export uint8_t CreatureLib_Script_StopBeforeAttack(Script* p, ExecutingAttack* attack, bool* outResult) {
Try(p->StopBeforeAttack(attack, outResult));
}
export uint8_t CreatureLib_Script_OnBeforeAttack(Script* p, ExecutingAttack* attack) { Try(p->OnBeforeAttack(attack)); }
export uint8_t CreatureLib_Script_FailIncomingAttack(Script* p, ExecutingAttack* attack, Creature* target,
bool* outResult) {
Try(p->FailIncomingAttack(attack, target, outResult));
}
export uint8_t CreatureLib_Script_IsInvulnerable(Script* p, ExecutingAttack* attack, Creature* target,
bool* outResult) {
Try(p->IsInvulnerable(attack, target, outResult));
}
export uint8_t CreatureLib_Script_OnAttackMiss(Script* p, ExecutingAttack* attack, Creature* target) {
Try(p->OnAttackMiss(attack, target));
}
export uint8_t CreatureLib_Script_ChangeAttackType(Script* p, ExecutingAttack* attack, Creature* target,
uint8_t hitNumber, uint8_t* outType) {
Try(p->ChangeAttackType(attack, target, hitNumber, outType))
}
export uint8_t CreatureLib_Script_OverrideBasePower(Script* p, ExecutingAttack* attack, Creature* target,
uint8_t hitNumber, uint8_t* basePower) {
Try(p->OverrideBasePower(attack, target, hitNumber, basePower));
}
export uint8_t CreatureLib_Script_ChangeDamageStatsUser(Script* p, ExecutingAttack* attack, Creature* target,
uint8_t hitNumber, Creature** statsUser) {
Try(p->ChangeDamageStatsUser(attack, target, hitNumber, statsUser));
}
export uint8_t CreatureLib_Script_BypassDefensiveStat(Script* p, ExecutingAttack* attack, Creature* target,
uint8_t hitNumber, bool* bypass) {
Try(p->BypassDefensiveStat(attack, target, hitNumber, bypass));
}
export uint8_t CreatureLib_Script_BypassOffensiveStat(Script* p, ExecutingAttack* attack, Creature* target,
uint8_t hitNumber, bool* bypass) {
Try(p->BypassOffensiveStat(attack, target, hitNumber, bypass));
}
export uint8_t CreatureLib_Script_ModifyStatModifier(Script* p, ExecutingAttack* attack, Creature* target,
uint8_t hitNumber, float* modifier) {
Try(p->ModifyStatModifier(attack, target, hitNumber, modifier));
}
export uint8_t CreatureLib_Script_ModifyDamageModifier(Script* p, ExecutingAttack* attack, Creature* target,
uint8_t hitNumber, float* modifier) {
Try(p->ModifyDamageModifier(attack, target, hitNumber, modifier));
}
export uint8_t CreatureLib_Script_OverrideDamage(Script* p, ExecutingAttack* attack, Creature* target,
uint8_t hitNumber, uint32_t* damage) {
Try(p->OverrideDamage(attack, target, hitNumber, damage));
}
export uint8_t CreatureLib_Script_PreventSecondaryEffects(Script* p, ExecutingAttack* attack, Creature* target,
uint8_t hitNumber, bool* outResult) {
Try(p->PreventSecondaryEffects(attack, target, hitNumber, outResult));
}
export uint8_t CreatureLib_Script_OnSecondaryEffect(Script* p, ExecutingAttack* attack, Creature* target,
uint8_t hitNumber) {
Try(p->OnSecondaryEffect(attack, target, hitNumber));
}
export uint8_t CreatureLib_Script_OnAfterHits(Script* p, ExecutingAttack* attack, Creature* target) {
Try(p->OnAfterHits(attack, target));
}
export uint8_t CreatureLib_Script_PreventSelfSwitch(Script* p, const SwitchTurnChoice* choice, bool* outResult) {
Try(p->PreventSelfSwitch(choice, outResult));
}
export uint8_t CreatureLib_Script_ModifyEffectChance(Script* p, const ExecutingAttack* attack, Creature* target,
float* chance) {
Try(p->ModifyEffectChance(attack, target, chance));
}
export uint8_t CreatureLib_Script_ModifyIncomingEffectChance(Script* p, const ExecutingAttack* attack, Creature* target,
float* chance) {
Try(p->ModifyIncomingEffectChance(attack, target, chance));
}