Adds Script Hook to change stat boost changes
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user