aboutsummaryrefslogtreecommitdiffstats
path: root/src/weapon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/weapon.cpp')
-rw-r--r--src/weapon.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/weapon.cpp b/src/weapon.cpp
index 3f5dcec..507c5b3 100644
--- a/src/weapon.cpp
+++ b/src/weapon.cpp
@@ -8,6 +8,8 @@
#include "weapon.hpp"
+#include <iostream>
+
Weapon::Weapon(float const & rg, unsigned int const & dmg, const char *s, const char *r) :
range(rg), damage(dmg)
{
@@ -16,24 +18,26 @@ Weapon::Weapon(float const & rg, unsigned int const & dmg, const char *s, const
reload = LoadSound(r);
SetSoundVolume(shot, 0.3f);
SetSoundVolume(reload, 0.3f);
- max = barrel = 200;
+ max = barrel = 5;
}
Weapon::~Weapon() {}
void Weapon::refill()
{
- auto time = GetTime();
+ std::cout << "reload" << std::endl;
+ PlaySound(reload);
+ barrel = max;
}
int Weapon::bang()
{
if (barrel == 0)
{
- refill();
return (1);
} else {
barrel--;
+ std::cout << "BANG : " << barrel << "shots left" << std::endl;
PlaySound(shot);
return (0);
}