From aa872f4f35890027e65c930cc9cc603b5db22906 Mon Sep 17 00:00:00 2001 From: salaaad2 Date: Sat, 22 Jan 2022 07:39:54 +0100 Subject: Weapons: amazing job adding another weapon salade ! outstanding --- src/wp_nadelauncher.cpp | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/wp_nadelauncher.cpp (limited to 'src/wp_nadelauncher.cpp') diff --git a/src/wp_nadelauncher.cpp b/src/wp_nadelauncher.cpp new file mode 100644 index 0000000..7352b42 --- /dev/null +++ b/src/wp_nadelauncher.cpp @@ -0,0 +1,39 @@ +#include "wp_nadelauncher.hpp" + +#include +#include +#include + +#include "entity.hpp" +#include "projectile.hpp" + +wp_nadelauncher::wp_nadelauncher(const char* s, const char* r) + : AWeapon(300.0f, 1, 30, 0.0, s, r, "nade", true) {} + +int wp_nadelauncher::bang(std::vector* enemies, Entity* player) { + if (barrel == 0) { + return (1); + } else { + Projectile* proj = new Projectile(); + proj->dir = player->direction; + proj->radius = player->radius; + proj->posX = player->posX; + proj->posY = player->posY; + + barrel--; + PlaySound(shot); + t = GetTime(); + // here + // + // + // there + if (barrel == 0) { + empty = true; + } + return (0); + } +} + +Projectile const& wp_nadelauncher::getProjectile() const { + return (projectile); +} -- cgit v1.2.3