Adds OnEndTurn script hook.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
parent
23bd0da646
commit
21231761ef
|
@ -24,6 +24,16 @@ void TurnHandler::RunTurn(const ArbUt::BorrowedPtr<ChoiceQueue>& queue, const Ar
|
||||||
<< CreatureLib::Battling::TurnChoiceKindHelper::ToString(item->GetKind()) << " "
|
<< CreatureLib::Battling::TurnChoiceKindHelper::ToString(item->GetKind()) << " "
|
||||||
<< " with message");
|
<< " with message");
|
||||||
}
|
}
|
||||||
|
if (!battle->HasEnded()) {
|
||||||
|
for (const auto& side : battle->GetSides()) {
|
||||||
|
for (const auto& creature : side->GetCreatures()) {
|
||||||
|
if (!creature.HasValue()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
HOOK(OnEndTurn, creature.GetValue());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
queue->HasCompletedQueue = true;
|
queue->HasCompletedQueue = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -85,6 +85,8 @@ namespace CreatureLib::Battling {
|
||||||
virtual void PreventRunAway([[maybe_unused]] const FleeTurnChoice* choice, [[maybe_unused]] bool* result){};
|
virtual void PreventRunAway([[maybe_unused]] const FleeTurnChoice* choice, [[maybe_unused]] bool* result){};
|
||||||
virtual void PreventOpponentRunAway([[maybe_unused]] const FleeTurnChoice* choice,
|
virtual void PreventOpponentRunAway([[maybe_unused]] const FleeTurnChoice* choice,
|
||||||
[[maybe_unused]] bool* result){};
|
[[maybe_unused]] bool* result){};
|
||||||
|
|
||||||
|
virtual void OnEndTurn(){};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue