Adds OnFaint script hook to Angelscript.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
545e321018
commit
47e3919734
|
@ -332,3 +332,9 @@ CreatureLib::Battling::BattleScript* AngelScriptScript::Clone(const ArbUt::Optio
|
|||
|
||||
return new AngelScriptScript(owner, GetAngelscriptOwner()->GetType(), _resolver, _type, obj, _ctxPool);
|
||||
}
|
||||
void AngelScriptScript::OnFaint(CreatureLib::Battling::Creature* creature, CreatureLib::Battling::DamageSource source) {
|
||||
CALL_HOOK(OnFaint, {
|
||||
ctx->SetArgObject(0, (void*)creature);
|
||||
ctx->SetArgWord(1, static_cast<asWORD>(source));
|
||||
})
|
||||
}
|
||||
|
|
|
@ -134,6 +134,8 @@ public:
|
|||
uint32_t* experienceGain) override;
|
||||
void DoesShareExperience(CreatureLib::Battling::Creature* faintedMon, CreatureLib::Battling::Creature* winningMon,
|
||||
bool* shareExperience) override;
|
||||
|
||||
void OnFaint(CreatureLib::Battling::Creature* creature, CreatureLib::Battling::DamageSource source) override;
|
||||
};
|
||||
|
||||
#undef CALL_HOOK
|
||||
|
|
|
@ -165,6 +165,7 @@ public:
|
|||
SCRIPT_HOOK_FUNCTION(PreventOpponentSwitch, "void PreventOpponentSwitch(SwitchTurnChoice@ choice, bool& result)");
|
||||
|
||||
SCRIPT_HOOK_FUNCTION(OnEndTurn, "void OnEndTurn()");
|
||||
SCRIPT_HOOK_FUNCTION(OnFaint, "void OnFaint(Pokemon@ pokemon, DamageSource damageSource)");
|
||||
};
|
||||
|
||||
#undef SCRIPT_HOOK_FUNCTION
|
||||
|
|
|
@ -51,6 +51,7 @@ shared abstract class PkmnScript {
|
|||
void PreventOpponentRunAway(FleeTurnChoice@ choice, bool& result){};
|
||||
void PreventOpponentSwitch(SwitchTurnChoice@ choice, bool& result){};
|
||||
void OnEndTurn(){};
|
||||
void OnFaint(Pokemon@ pokemon, DamageSource damageSource){};
|
||||
|
||||
// PkmnLib methods
|
||||
void ModifyCriticalStage(ExecutingMove@ attack, Pokemon@ target, uint8 hit, uint8& critStage){};
|
||||
|
|
Loading…
Reference in New Issue