From b75a02c8f5c616eff6f21197c3e13056eefcb873 Mon Sep 17 00:00:00 2001 From: salaaad2 Date: Tue, 4 Jan 2022 23:52:04 +0100 Subject: add fury, bang sound, colors and more --- src/weapon.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/weapon.cpp') 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); + } } -- cgit v1.2.3