Implements clamped statistics for stat boost.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-04-22 21:48:00 +02:00
parent 75baf19ebd
commit 97fa37ea7d
3 changed files with 105 additions and 5 deletions

View File

@@ -2,6 +2,7 @@
#define CREATURELIB_BATTLECREATURE_HPP
#include <Arbutils/Collections/List.hpp>
#include "../../Library/ClampedStatisticSet.hpp"
#include "../../Library/CreatureData/CreatureSpecies.hpp"
#include "../../Library/Items/Item.hpp"
#include "../ScriptHandling/ScriptAggregator.hpp"
@@ -36,7 +37,7 @@ namespace CreatureLib::Battling {
const Library::Item* _heldItem;
uint32_t _currentHealth;
Library::StatisticSet<int8_t> _statBoost;
Library::ClampedStatisticSet<int8_t, -6, 6> _statBoost;
Library::StatisticSet<uint32_t> _flatStats;
Library::StatisticSet<uint32_t> _boostedStats;
@@ -139,7 +140,7 @@ namespace CreatureLib::Battling {
// region Stat APIs
void ChangeStatBoost(Library::Statistic stat, int8_t diffAmount);
bool ChangeStatBoost(Library::Statistic stat, int8_t diffAmount);
[[nodiscard]] uint32_t GetFlatStat(Library::Statistic stat) const noexcept;
[[nodiscard]] uint32_t GetBoostedStat(Library::Statistic stat) const noexcept;
[[nodiscard]] uint32_t GetBaseStat(Library::Statistic stat) const noexcept;