aboutsummaryrefslogtreecommitdiffstats
path: root/src/weapon.cpp
diff options
context:
space:
mode:
authorsalaaad2 <arthurdurant263@gmail.com>2022-01-04 23:52:04 +0100
committersalaaad2 <arthurdurant263@gmail.com>2022-01-04 23:52:04 +0100
commitb75a02c8f5c616eff6f21197c3e13056eefcb873 (patch)
treebee47f568de6d48a22d78043e05de198d5bec611 /src/weapon.cpp
parentshotty makes a sound (diff)
downloadthreshold-b75a02c8f5c616eff6f21197c3e13056eefcb873.tar.gz
threshold-b75a02c8f5c616eff6f21197c3e13056eefcb873.tar.bz2
threshold-b75a02c8f5c616eff6f21197c3e13056eefcb873.tar.xz
threshold-b75a02c8f5c616eff6f21197c3e13056eefcb873.tar.zst
threshold-b75a02c8f5c616eff6f21197c3e13056eefcb873.zip
add fury, bang sound, colors and more
Diffstat (limited to 'src/weapon.cpp')
-rw-r--r--src/weapon.cpp16
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);
+ }
}