aboutsummaryrefslogtreecommitdiffstats
path: root/src/wp_shotty.cpp
diff options
context:
space:
mode:
authorsalaaad2 <arthurdurant263@gmail.com>2022-01-17 01:31:38 +0100
committersalaaad2 <arthurdurant263@gmail.com>2022-01-17 01:31:38 +0100
commitc8b23f73e44fd5be7d653cc82e89212da4e5bc72 (patch)
treeb6f215212227ea4c2ffd079d52553078ee9f1ea8 /src/wp_shotty.cpp
parentwhat ? (diff)
downloadthreshold-c8b23f73e44fd5be7d653cc82e89212da4e5bc72.tar.gz
threshold-c8b23f73e44fd5be7d653cc82e89212da4e5bc72.tar.bz2
threshold-c8b23f73e44fd5be7d653cc82e89212da4e5bc72.tar.xz
threshold-c8b23f73e44fd5be7d653cc82e89212da4e5bc72.tar.zst
threshold-c8b23f73e44fd5be7d653cc82e89212da4e5bc72.zip
buff shotty & audio is now working I guess ???? ?
Diffstat (limited to 'src/wp_shotty.cpp')
-rw-r--r--src/wp_shotty.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wp_shotty.cpp b/src/wp_shotty.cpp
index f2a5d22..7d61ab3 100644
--- a/src/wp_shotty.cpp
+++ b/src/wp_shotty.cpp
@@ -7,7 +7,7 @@
#include "entity.hpp"
wp_shotty::wp_shotty(const char* s, const char* r)
- : AWeapon(100.0f, 10, 10, 0.5, s, r, "shotty") {}
+ : AWeapon(100.0f, 3, 10, 0.5, s, r, "shotty") {}
int wp_shotty::bang(std::vector<Entity>* enemies, Entity* player) {
if (barrel == 0 || GetTime() < (t + cooldown)) {
@@ -44,8 +44,8 @@ int wp_shotty::bang(std::vector<Entity>* enemies, Entity* player) {
playerPosition, add2,
(en->radius * 2))) { // enemy hit
std::cout << "hit" << std::endl;
- en->hp--;
- if (en->hp == 0) {
+ en->hp -= damage;
+ if (en->hp <= 0) {
en->direction.x = (playerDirection.x / 2);
en->direction.y = (playerDirection.y / 2);
player->victims += 1;