Implements BattleRandom class with support for Effect Chance, and script hooks to modify this.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-02-16 15:08:22 +01:00
parent 579ee82f02
commit 54e366fc1b
5 changed files with 45 additions and 4 deletions

View File

@@ -7,6 +7,7 @@
#include "../Library/BattleLibrary.hpp"
#include "../TurnChoices/BaseTurnChoice.hpp"
#include "BattleParty.hpp"
#include "BattleRandom.hpp"
#include "BattleResult.hpp"
#include "BattleSide.hpp"
#include "CreatureIndex.hpp"
@@ -19,7 +20,7 @@ namespace CreatureLib::Battling {
uint8_t _numberOfSides;
uint8_t _creaturesPerSide;
std::vector<BattleSide*> _sides;
Core::Random _random;
BattleRandom _random;
ChoiceQueue* _currentTurnQueue = nullptr;
bool _hasEnded = false;
BattleResult _battleResult = BattleResult::Empty();
@@ -55,7 +56,7 @@ namespace CreatureLib::Battling {
void CheckChoicesSetAndRun();
[[nodiscard]] ChoiceQueue* GetCurrentTurnQueue() const;
Core::Random& GetRandom();
BattleRandom& GetRandom();
bool CreatureInField(const Creature* creature) const;