aboutsummaryrefslogtreecommitdiffstats
path: root/src/wp_shotty.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/wp_shotty.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/wp_shotty.cpp b/src/wp_shotty.cpp
index 580450e..ae978f4 100644
--- a/src/wp_shotty.cpp
+++ b/src/wp_shotty.cpp
@@ -7,18 +7,20 @@
#include "entity.hpp"
wp_shotty::wp_shotty(const char *s, const char *r)
- : AWeapon(10, 10, 10, 1.0, s, r)
+ : AWeapon(10, 10, 10, 0.5, s, r)
{}
-int wp_shotty::bang(std::vector<Entity> * enemies, Vector2 playerDirection, Vector2 playerPosition, int * victims)
+int wp_shotty::bang(std::vector<Entity> * enemies, Entity * player)
{
if (barrel == 0 ||
GetTime() < (t + cooldown))
{
return (1);
} else {
+ Vector2 playerDirection = player->direction;
+ Vector2 playerPosition = (Vector2){player->posX, player->posY};
barrel--;
PlaySound(shot);
t = GetTime();
@@ -48,7 +50,8 @@ int wp_shotty::bang(std::vector<Entity> * enemies, Vector2 playerDirection, Vect
en->direction.x = (playerDirection.x / 2);
en->direction.y = (playerDirection.y / 2);
}
- *victims += 1;
+ player->victims += 1;
+ player->fury += 1;
}
}
// shotty cone