Adds OnFaint script hook.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
59313e6da8
commit
2ea928e67b
|
@ -174,9 +174,9 @@ namespace CreatureLib::Battling {
|
||||||
void Creature::OnFaint() {
|
void Creature::OnFaint() {
|
||||||
EnsureNotNull(_battleData.Battle)
|
EnsureNotNull(_battleData.Battle)
|
||||||
EnsureNotNull(_battleData.Side)
|
EnsureNotNull(_battleData.Side)
|
||||||
// HOOK: On Faint
|
|
||||||
if (_battleData.Battle.HasValue()) {
|
if (_battleData.Battle.HasValue()) {
|
||||||
_battleData.Battle.GetValue()->TriggerEventListener<FaintEvent>(this);
|
_battleData.Battle.GetValue()->TriggerEventListener<FaintEvent>(this);
|
||||||
|
HOOK(OnFaint, this, this);
|
||||||
}
|
}
|
||||||
_library->GetExperienceLibrary()->HandleExperienceGain(this, _battleData.SeenOpponents);
|
_library->GetExperienceLibrary()->HandleExperienceGain(this, _battleData.SeenOpponents);
|
||||||
if (_battleData.Battle.HasValue() && _battleData.Side.HasValue()) {
|
if (_battleData.Battle.HasValue() && _battleData.Side.HasValue()) {
|
||||||
|
|
|
@ -99,6 +99,7 @@ namespace CreatureLib::Battling {
|
||||||
[[maybe_unused]] bool* result){};
|
[[maybe_unused]] bool* result){};
|
||||||
|
|
||||||
virtual void OnEndTurn(){};
|
virtual void OnEndTurn(){};
|
||||||
|
virtual void OnFaint([[maybe_unused]] Creature* creature){};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue