Signed-off-by: Deukhoofd <Deukhoofd@gmail.com>
This commit is contained in:
@@ -54,12 +54,12 @@ void Battle::CheckChoicesSetAndRun() {
|
||||
for (auto choice : side->GetChoices()) {
|
||||
AssertNotNull(choice)
|
||||
if (choice->GetKind() == TurnChoiceKind::Attack) {
|
||||
auto attack = ((AttackTurnChoice*)choice.get())->GetAttack();
|
||||
auto attack = std::static_pointer_cast<AttackTurnChoice>(choice);
|
||||
uint8_t uses = 1;
|
||||
// HOOK: change number of uses needed.
|
||||
if (attack->GetRemainingUses() < uses) {
|
||||
if (attack->GetAttack()->GetRemainingUses() < uses) {
|
||||
choice = std::shared_ptr<BaseTurnChoice>(_library->GetMiscLibrary()->ReplacementAttack(
|
||||
choice->GetUser().GetRaw(), ((AttackTurnChoice*)choice.get())->GetTarget()));
|
||||
choice->GetUser().GetRaw(), attack->GetTarget()));
|
||||
}
|
||||
// HOOK: Check if we need to change the move
|
||||
}
|
||||
@@ -74,7 +74,7 @@ void Battle::CheckChoicesSetAndRun() {
|
||||
}
|
||||
_currentTurn++;
|
||||
try {
|
||||
TurnOrdering::OrderChoices(choices, _random.GetRNG());
|
||||
TurnOrdering::OrderChoices(choices);
|
||||
} catch (const std::exception& e) {
|
||||
THROW("Exception during turn ordering: '" << e.what() << "'.")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user