Implemented and fixed all code required to run at least a single turn.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -50,11 +50,12 @@ void Battle::CheckChoicesSetAndRun() {
|
||||
side->ResetChoices();
|
||||
}
|
||||
TurnOrdering::OrderChoices(choices, _random);
|
||||
auto choiceQueue = new ChoiceQueue(choices);
|
||||
this->_currentTurnQueue = choiceQueue;
|
||||
TurnHandler::RunTurn(this, choiceQueue);
|
||||
if (choiceQueue->HasCompletedQueue)
|
||||
_currentTurnQueue = nullptr;
|
||||
this->_currentTurnQueue = new ChoiceQueue(choices);
|
||||
TurnHandler::RunTurn(this, this->_currentTurnQueue);
|
||||
if (this->_currentTurnQueue->HasCompletedQueue) {
|
||||
delete this->_currentTurnQueue;
|
||||
this->_currentTurnQueue = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
ChoiceQueue* Battle::GetCurrentTurnQueue() const { return _currentTurnQueue; }
|
||||
@@ -85,3 +86,7 @@ void Battle::FillRecall(uint8_t side, uint8_t, Creature* c) {
|
||||
}
|
||||
|
||||
void Battle::GetActiveScripts(std::vector<ScriptWrapper>& scripts) { scripts.emplace_back(&_volatile); }
|
||||
void Battle::SwitchCreature(uint8_t sideIndex, uint8_t index, Creature* c) {
|
||||
auto side = this->_sides[sideIndex];
|
||||
side->SetCreature(c, index);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user