Browse Source

🏷️ Add 'Damage.IsFixed()' method

Will be used in a few places where it is important to make the distinction between fixed and variable damage (i.e. printing values, oil applicaiton, etc).
julealgon/Enhancements/DamageStruct
Juliano Leal Goncalves 5 years ago
parent
commit
cabe8b5bc5
  1. 7
      Source/damage.hpp

7
Source/damage.hpp

@ -21,9 +21,14 @@ struct Damage {
{
}
[[nodiscard]] bool IsFixed() const
{
return minValue == maxValue;
}
int GetValue() const
{
return minValue == maxValue
return IsFixed()
? minValue
: minValue + GenerateRnd(maxValue - minValue + 1);
}

Loading…
Cancel
Save