Fixed replacementattack not being complete.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
a7b87ab4f8
commit
970ca8ddd5
|
@ -34,5 +34,7 @@ CreatureLib::Battling::MiscLibrary::ReplacementAttack(Creature* user, CreatureIn
|
|||
auto sideTarget = 0;
|
||||
if (user->GetBattleSide()->GetSideIndex() == 0)
|
||||
sideTarget = 1;
|
||||
return new AttackTurnChoice(user, GetReplacementAttack(), target);
|
||||
auto side = user->GetBattle()->GetSides()[sideTarget];
|
||||
auto random_mon = side->GetRandomCreatureIndex();
|
||||
return new AttackTurnChoice(user, GetReplacementAttack(), CreatureIndex(side->GetSideIndex(), random_mon));
|
||||
}
|
||||
|
|
|
@ -68,3 +68,7 @@ void BattleSide::GetActiveScripts(std::vector<ScriptWrapper>& scripts) {
|
|||
scripts.emplace_back(&_volatile);
|
||||
_battle->GetActiveScripts(scripts);
|
||||
}
|
||||
uint8_t BattleSide::GetRandomCreatureIndex() {
|
||||
// TODO: Consider adding parameter to only get index for available creatures.
|
||||
return _battle->GetRandom()->Get(_creaturesPerSide);
|
||||
}
|
||||
|
|
|
@ -79,6 +79,8 @@ namespace CreatureLib::Battling {
|
|||
bool HasFled() { return _hasFled; }
|
||||
|
||||
void MarkAsFled() { _hasFled = true; }
|
||||
|
||||
uint8_t GetRandomCreatureIndex();
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue