aboutsummaryrefslogtreecommitdiff
path: root/backend/ExpConsumableObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backend/ExpConsumableObject.cpp')
-rw-r--r--backend/ExpConsumableObject.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/backend/ExpConsumableObject.cpp b/backend/ExpConsumableObject.cpp
new file mode 100644
index 0000000..77aa37e
--- /dev/null
+++ b/backend/ExpConsumableObject.cpp
@@ -0,0 +1,10 @@
+#include "Player.h"
+#include "RNG.h"
+#include "ExpConsumableObject.h"
+
+void ExpConsumableObject::consume(Player & player) {
+ float min = static_cast<float>(this->get_potency().min) / 100;
+ float max = static_cast<float>(this->get_potency().max) / 100;
+ player.add_attack(RNG::get().rand_double(min, max));
+}
+