diff options
Diffstat (limited to 'src/weapon.cpp')
-rw-r--r-- | src/weapon.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/weapon.cpp b/src/weapon.cpp index a774676..a516fdc 100644 --- a/src/weapon.cpp +++ b/src/weapon.cpp @@ -16,11 +16,23 @@ 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 = 20; } Weapon::~Weapon() {} -void Weapon::bang() const +void Weapon::refill() { - PlaySound(shot); + auto time = GetTime(); +} + +int Weapon::bang() +{ + if (barrel == 0) + { + refill(); + } else { + barrel--; + PlaySound(shot); + } } |