Adds Script Hook to change stat boost changes
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-02-12 15:05:42 +01:00
parent 6da591dd92
commit 34f1e43269
3 changed files with 80 additions and 81 deletions

View File

@@ -74,24 +74,24 @@ namespace CreatureLib::Library {
inline bool IncreaseStatBy(Statistic stat, T amount) {
switch (stat) {
case CreatureLib::Library::Statistic::Health: ModifyStat(_health, +) break;
case CreatureLib::Library::Statistic::PhysicalAttack: ModifyStat(_physicalAttack, +) break;
case CreatureLib::Library::Statistic::PhysicalDefense: ModifyStat(_physicalDefense, +) break;
case CreatureLib::Library::Statistic::MagicalAttack: ModifyStat(_magicalAttack, +) break;
case CreatureLib::Library::Statistic::MagicalDefense: ModifyStat(_magicalDefense, +) break;
case CreatureLib::Library::Statistic::Speed: ModifyStat(_speed, +) break;
default: NOT_REACHABLE;
case CreatureLib::Library::Statistic::Health:
ModifyStat(_health, +) case CreatureLib::Library::Statistic::PhysicalAttack
: ModifyStat(_physicalAttack, +) case CreatureLib::Library::Statistic::PhysicalDefense
: ModifyStat(_physicalDefense, +) case CreatureLib::Library::Statistic::MagicalAttack
: ModifyStat(_magicalAttack, +) case CreatureLib::Library::Statistic::MagicalDefense
: ModifyStat(_magicalDefense, +) case CreatureLib::Library::Statistic::Speed
: ModifyStat(_speed, +) default : NOT_REACHABLE;
}
}
inline bool DecreaseStatBy(Statistic stat, T amount) {
switch (stat) {
case CreatureLib::Library::Statistic::Health: ModifyStat(_health, -) break;
case CreatureLib::Library::Statistic::PhysicalAttack: ModifyStat(_physicalAttack, -) break;
case CreatureLib::Library::Statistic::PhysicalDefense: ModifyStat(_physicalDefense, -) break;
case CreatureLib::Library::Statistic::MagicalAttack: ModifyStat(_magicalAttack, -) break;
case CreatureLib::Library::Statistic::MagicalDefense: ModifyStat(_magicalDefense, -) break;
case CreatureLib::Library::Statistic::Speed: ModifyStat(_speed, -) break;
default: NOT_REACHABLE;
case CreatureLib::Library::Statistic::Health:
ModifyStat(_health, -) case CreatureLib::Library::Statistic::PhysicalAttack
: ModifyStat(_physicalAttack, -) case CreatureLib::Library::Statistic::PhysicalDefense
: ModifyStat(_physicalDefense, -) case CreatureLib::Library::Statistic::MagicalAttack
: ModifyStat(_magicalAttack, -) case CreatureLib::Library::Statistic::MagicalDefense
: ModifyStat(_magicalDefense, -) case CreatureLib::Library::Statistic::Speed
: ModifyStat(_speed, -) default : NOT_REACHABLE;
}
}
};