Furter fixes for changing stats.
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
f9494d4c38
commit
fbfcc53a02
|
@ -42,5 +42,5 @@ uint32_t Battling::BattleStatCalculator::CalculateFlatStat(Battling::Creature* c
|
|||
|
||||
uint32_t Battling::BattleStatCalculator::CalculateBoostedStat(Battling::Creature* creature,
|
||||
Core::Statistic stat) const {
|
||||
throw NotImplementedException();
|
||||
return creature->GetFlatStat(stat) + (creature->GetBoostedStat(stat));
|
||||
}
|
||||
|
|
|
@ -44,35 +44,35 @@ namespace CreatureLib::Core {
|
|||
|
||||
inline void SetStat(Statistic stat, T value) {
|
||||
switch (stat) {
|
||||
case Health: _health = value;
|
||||
case PhysicalAttack: _physicalAttack = value;
|
||||
case PhysicalDefense: _physicalDefense = value;
|
||||
case MagicalAttack: _magicalAttack = value;
|
||||
case MagicalDefense: _magicalDefense = value;
|
||||
case Speed: _speed = value;
|
||||
case Health: _health = value; break;
|
||||
case PhysicalAttack: _physicalAttack = value; break;
|
||||
case PhysicalDefense: _physicalDefense = value; break;
|
||||
case MagicalAttack: _magicalAttack = value; break;
|
||||
case MagicalDefense: _magicalDefense = value; break;
|
||||
case Speed: _speed = value; break;
|
||||
default: throw NotReachableException();
|
||||
}
|
||||
}
|
||||
|
||||
inline void IncreaseStatBy(Statistic stat, T amount) {
|
||||
switch (stat) {
|
||||
case Health: _health += amount;
|
||||
case PhysicalAttack: _physicalAttack += amount;
|
||||
case PhysicalDefense: _physicalDefense += amount;
|
||||
case MagicalAttack: _magicalAttack += amount;
|
||||
case MagicalDefense: _magicalDefense += amount;
|
||||
case Speed: _speed += amount;
|
||||
case Health: _health += amount; break;
|
||||
case PhysicalAttack: _physicalAttack += amount; break;
|
||||
case PhysicalDefense: _physicalDefense += amount; break;
|
||||
case MagicalAttack: _magicalAttack += amount; break;
|
||||
case MagicalDefense: _magicalDefense += amount; break;
|
||||
case Speed: _speed += amount; break;
|
||||
default: throw NotReachableException();
|
||||
}
|
||||
}
|
||||
inline void DecreaseStatBy(Statistic stat, T amount) {
|
||||
switch (stat) {
|
||||
case Health: _health -= amount;
|
||||
case PhysicalAttack: _physicalAttack -= amount;
|
||||
case PhysicalDefense: _physicalDefense -= amount;
|
||||
case MagicalAttack: _magicalAttack -= amount;
|
||||
case MagicalDefense: _magicalDefense -= amount;
|
||||
case Speed: _speed -= amount;
|
||||
case Health: _health -= amount; break;
|
||||
case PhysicalAttack: _physicalAttack -= amount; break;
|
||||
case PhysicalDefense: _physicalDefense -= amount; break;
|
||||
case MagicalAttack: _magicalAttack -= amount; break;
|
||||
case MagicalDefense: _magicalDefense -= amount; break;
|
||||
case Speed: _speed -= amount; break;
|
||||
default: throw NotReachableException();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue