aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/cpp/RangedWeapon.cpp
blob: eb3378075004afde1981693b08d0df9d3d67b3ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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();
}