From cabe8b5bc5d5a60ddcc6b1626778d2d0e1d16ba7 Mon Sep 17 00:00:00 2001 From: Juliano Leal Goncalves Date: Mon, 20 Sep 2021 01:10:59 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F=20Add=20'Damage.IsFixed()?= =?UTF-8?q?'=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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). --- Source/damage.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/damage.hpp b/Source/damage.hpp index db958555a..705584fb8 100644 --- a/Source/damage.hpp +++ b/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); }