aboutsummaryrefslogtreecommitdiffstats
path: root/src/wp_shotty.cpp
diff options
context:
space:
mode:
authorsalaaad2 <arthurdurant263@gmail.com>2022-01-07 13:52:28 +0100
committersalaaad2 <arthurdurant263@gmail.com>2022-01-07 13:52:28 +0100
commit990ca25986157ce629b07d43257e0fbf36071317 (patch)
tree84dc750555b2fdad82fdcdea16d031c247a95809 /src/wp_shotty.cpp
parentadd new weapon, AR and add switching weapons (diff)
downloadthreshold-990ca25986157ce629b07d43257e0fbf36071317.tar.gz
threshold-990ca25986157ce629b07d43257e0fbf36071317.tar.bz2
threshold-990ca25986157ce629b07d43257e0fbf36071317.tar.xz
threshold-990ca25986157ce629b07d43257e0fbf36071317.tar.zst
threshold-990ca25986157ce629b07d43257e0fbf36071317.zip
references are weaird, man
Diffstat (limited to 'src/wp_shotty.cpp')
-rw-r--r--src/wp_shotty.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/wp_shotty.cpp b/src/wp_shotty.cpp
index cdb6898..580450e 100644
--- a/src/wp_shotty.cpp
+++ b/src/wp_shotty.cpp
@@ -7,19 +7,22 @@
#include "entity.hpp"
wp_shotty::wp_shotty(const char *s, const char *r)
- : AWeapon(10, 10, 10, s, r)
+ : AWeapon(10, 10, 10, 1.0, s, r)
{}
int wp_shotty::bang(std::vector<Entity> * enemies, Vector2 playerDirection, Vector2 playerPosition, int * victims)
{
- if (barrel == 0)
+ if (barrel == 0 ||
+ GetTime() < (t + cooldown))
{
return (1);
} else {
barrel--;
PlaySound(shot);
+ t = GetTime();
+ std::cout << "current time : " << t << "supposed time before next shot : " << (t + cooldown) << std::endl;
// here
//
auto rot1 = Vector2Rotate(playerDirection, -0.2f);