Fixed issue where base stats of a variant got corrupted.
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:
@@ -27,15 +27,15 @@ Battling::BattleStatCalculator::CalculateBoostedStats(Battling::Creature* creatu
|
||||
uint32_t CalculateHealthStat(Battling::Creature* creature) {
|
||||
AssertNotNull(creature)
|
||||
auto level = creature->GetLevel();
|
||||
auto a = (creature->GetBaseStat(Library::Statistic::Health)) * 2 * level;
|
||||
return floor(a / 100) + level + 10;
|
||||
float a = (creature->GetBaseStat(Library::Statistic::Health)) * 2.0 * level;
|
||||
return static_cast<uint32_t>(floor(a / 100.0) + level + 10);
|
||||
}
|
||||
|
||||
uint32_t CalculateOtherStat(Battling::Creature* creature, Library::Statistic stat) {
|
||||
AssertNotNull(creature)
|
||||
auto level = creature->GetLevel();
|
||||
auto a = (creature->GetBaseStat(stat)) * 2 * level;
|
||||
return floor(a / 100) + 10;
|
||||
float a = (creature->GetBaseStat(stat)) * 2.0 * level;
|
||||
return static_cast<uint32_t>(floor(a / 100.0) + 5);
|
||||
}
|
||||
|
||||
uint32_t Battling::BattleStatCalculator::CalculateFlatStat(Battling::Creature* creature,
|
||||
|
||||
@@ -6,7 +6,7 @@ using namespace CreatureLib::Battling;
|
||||
uint32_t DamageLibrary::GetDamage(ExecutingAttack* attack, Creature* target, uint8_t hitIndex) const {
|
||||
AssertNotNull(attack)
|
||||
AssertNotNull(target)
|
||||
auto levelMod = static_cast<float>(2 * attack->GetUser()->GetLevel());
|
||||
auto levelMod = static_cast<float>(2 * attack->GetUser()->GetLevel()) / 5 + 2;
|
||||
auto hit = attack->GetAttackDataForTarget(target)->GetHit(hitIndex);
|
||||
auto bp = hit->GetBasePower();
|
||||
auto statMod = GetStatModifier(attack, target, hitIndex);
|
||||
|
||||
@@ -59,6 +59,7 @@ void Battle::CheckChoicesSetAndRun() {
|
||||
}
|
||||
side->ResetChoices();
|
||||
}
|
||||
_currentTurn++;
|
||||
TurnOrdering::OrderChoices(choices, _random.GetRNG());
|
||||
this->_currentTurnQueue = new ChoiceQueue(choices);
|
||||
TurnHandler::RunTurn(this->_currentTurnQueue);
|
||||
|
||||
@@ -26,6 +26,7 @@ namespace CreatureLib::Battling {
|
||||
bool _hasEnded = false;
|
||||
BattleResult _battleResult = BattleResult::Empty();
|
||||
EventHook _eventHook = EventHook();
|
||||
uint32_t _currentTurn = 0;
|
||||
|
||||
ScriptSet _volatile;
|
||||
|
||||
@@ -55,6 +56,7 @@ namespace CreatureLib::Battling {
|
||||
}
|
||||
|
||||
[[nodiscard]] const BattleLibrary* GetLibrary() const;
|
||||
[[nodiscard]] uint32_t GetCurrentTurn() const noexcept { return _currentTurn; }
|
||||
|
||||
virtual bool CanUse(const BaseTurnChoice* choice);
|
||||
virtual bool TrySetChoice(BaseTurnChoice* choice);
|
||||
|
||||
Reference in New Issue
Block a user