Make GetRandom in Battle class a pointer.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
f3b5f9e8f9
commit
428483e73d
|
@ -5,6 +5,6 @@ bool CreatureLib::Battling::MiscLibrary::IsCritical(CreatureLib::Battling::Execu
|
||||||
CreatureLib::Battling::Creature* target, uint8_t hit) const {
|
CreatureLib::Battling::Creature* target, uint8_t hit) const {
|
||||||
auto rand = target->GetBattle()->GetRandom();
|
auto rand = target->GetBattle()->GetRandom();
|
||||||
// HOOK: Increase chance for critical hits.
|
// HOOK: Increase chance for critical hits.
|
||||||
return rand.Get(10) <= 0;
|
return rand->Get(10) <= 0;
|
||||||
}
|
}
|
||||||
bool CreatureLib::Battling::MiscLibrary::CanFlee(FleeTurnChoice* switchChoice) const { return true; }
|
bool CreatureLib::Battling::MiscLibrary::CanFlee(FleeTurnChoice* switchChoice) const { return true; }
|
||||||
|
|
|
@ -69,7 +69,7 @@ void Battle::CheckChoicesSetAndRun() {
|
||||||
|
|
||||||
ChoiceQueue* Battle::GetCurrentTurnQueue() const { return _currentTurnQueue; }
|
ChoiceQueue* Battle::GetCurrentTurnQueue() const { return _currentTurnQueue; }
|
||||||
|
|
||||||
BattleRandom& Battle::GetRandom() { return _random; }
|
BattleRandom* Battle::GetRandom() { return &_random; }
|
||||||
|
|
||||||
bool Battle::CreatureInField(const Creature* creature) const {
|
bool Battle::CreatureInField(const Creature* creature) const {
|
||||||
for (auto s : _sides) {
|
for (auto s : _sides) {
|
||||||
|
|
|
@ -56,7 +56,7 @@ namespace CreatureLib::Battling {
|
||||||
void CheckChoicesSetAndRun();
|
void CheckChoicesSetAndRun();
|
||||||
|
|
||||||
[[nodiscard]] ChoiceQueue* GetCurrentTurnQueue() const;
|
[[nodiscard]] ChoiceQueue* GetCurrentTurnQueue() const;
|
||||||
BattleRandom& GetRandom();
|
BattleRandom* GetRandom();
|
||||||
|
|
||||||
bool CreatureInField(const Creature* creature) const;
|
bool CreatureInField(const Creature* creature) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue