aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/cpp/RangedWeapon.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main/cpp/RangedWeapon.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/main/cpp/RangedWeapon.cpp b/src/main/cpp/RangedWeapon.cpp
new file mode 100644
index 0000000..eb33780
--- /dev/null
+++ b/src/main/cpp/RangedWeapon.cpp
@@ -0,0 +1,25 @@
+#include "RangedWeapon.hpp"
+#include "Actor.hpp"
+
+#include <string>
+#include <algorithm>
+#include <vector>
+
+RangedWeapon::RangedWeapon(const std::string &name)
+: Weapon(name)
+{
+}
+
+bool RangedWeapon::use(Actor &user, Actor &actor)
+{
+ //TODO implement attack probability
+ if (_charged) {
+ actor.damage(user.attack() + _damage - actor.defence());
+ _charged = false;
+ }
+}
+
+void RangedWeapon::reload(Actor &actor)
+{
+ //std::vector<Item> bullet = actor.bullet();
+}