2020-02-04 18:34:30 +00:00
|
|
|
#include "BasicScriptClass.hpp"
|
|
|
|
#include <cassert>
|
|
|
|
|
|
|
|
void BasicScriptClass::Register(asIScriptEngine* engine) {
|
2020-02-05 16:06:15 +00:00
|
|
|
// As far as I am aware at the moment you can't create an abstract class with virtual members through the application
|
|
|
|
// registry interface. As such, we just create it from string.
|
2020-02-04 18:34:30 +00:00
|
|
|
[[maybe_unused]] int r = engine->GetModuleByIndex(0)->AddScriptSection("PkmnScript", R"(
|
|
|
|
shared abstract class PkmnScript {
|
|
|
|
void Stack(){};
|
2020-02-06 15:25:55 +00:00
|
|
|
void OnRemove(){};
|
2020-02-04 18:34:30 +00:00
|
|
|
void PreventAttack(ExecutingMove@ attack, bool& result){};
|
|
|
|
void FailAttack(ExecutingMove@ attack, bool& result){};
|
|
|
|
void StopBeforeAttack(ExecutingMove@ attack, bool& result){};
|
2020-02-05 16:06:15 +00:00
|
|
|
void OnBeforeAttack(ExecutingMove@ attack){};
|
|
|
|
void FailIncomingAttack(ExecutingMove@ attack, Pokemon@ target, bool& result){};
|
|
|
|
void IsInvulnerable(ExecutingMove@ attack, Pokemon@ target, bool& result){};
|
|
|
|
void OnAttackMiss(ExecutingMove@ attack, Pokemon@ target){};
|
|
|
|
void ChangeAttackType(ExecutingMove@ attack, Pokemon@ target, uint8 hit, uint8& outType){};
|
|
|
|
void OnStatusMove(ExecutingMove@ attack, Pokemon@ target, uint8 hit){};
|
|
|
|
void PreventSecondaryEffects(ExecutingMove@ attack, Pokemon@ target, uint8 hit, bool& outResult){};
|
|
|
|
void OnSecondaryEffect(ExecutingMove@ attack, Pokemon@ target, uint8 hit){};
|
|
|
|
void OnAfterHits(ExecutingMove@ attack, Pokemon@ target){};
|
|
|
|
|
2020-02-16 14:21:58 +00:00
|
|
|
void ModifyEffectChance(ExecutingMove@ attack, Pokemon@ target, uint16& chance){};
|
2020-02-16 16:50:16 +00:00
|
|
|
void ModifyIncomingEffectChance(ExecutingMove@ attack, Pokemon@ target, uint16& chance){};
|
2020-02-04 18:34:30 +00:00
|
|
|
}
|
|
|
|
)");
|
|
|
|
assert(r >= 0);
|
|
|
|
|
|
|
|
}
|