aboutsummaryrefslogtreecommitdiff
path: root/frontend/cmd/hit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/cmd/hit.cpp')
-rw-r--r--frontend/cmd/hit.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/frontend/cmd/hit.cpp b/frontend/cmd/hit.cpp
index d3cb683..2f39e8a 100644
--- a/frontend/cmd/hit.cpp
+++ b/frontend/cmd/hit.cpp
@@ -3,20 +3,20 @@
#include "backend/RNG.h"
#include "backend/print.h"
-#include "../Player.h"
+#include "../GameController.h"
#include "../strings.h"
using namespace std;
-FollowupAction Player::cmd_hit(string & target_name) {
+FollowupAction GameController::cmd_hit(string & target_name) {
RNG & rng = RNG::get();
- for (Enemy * enemy : this->location.get_enemies()) {
+ for (Enemy * enemy : this->player.get_location().get_enemies()) {
if (str_lower(enemy->get_name().c_str()) != str_lower(target_name)) continue;
- if (rng.rand_double() > this->get_attack()) {
+ if (rng.rand_double() > this->player.get_attack()) {
lprtf("Je hebt gemist!\n");
} else {
- unsigned damage = rng.rand_int(this->weapon->get_damage_min(), this->weapon->get_damage_max() + 1);
+ unsigned damage = rng.rand_int(this->player.weapon->get_damage_min(), this->player.weapon->get_damage_max() + 1);
enemy->take_damage(damage);
lprtf("Je hebt %s geraakt en %d schade aangericht!\n", enemy->get_displayname().c_str(), damage);
}