From 3472e0de54bbfa63517de8db7d665b732389ae85 Mon Sep 17 00:00:00 2001 From: mafaldo Date: Mon, 12 Feb 2018 23:43:14 +0100 Subject: Add RangedWeapon, MeleeWeapon --- src/main/cpp/RangedWeapon.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/main/cpp/RangedWeapon.cpp (limited to 'src/main/cpp/RangedWeapon.cpp') 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 +#include +#include + +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 bullet = actor.bullet(); +} -- cgit v1.2.1