2021-09-13 15:53:43 +03:00
|
|
|
//
|
|
|
|
// Created by Иван Ильин on 03.06.2021.
|
|
|
|
//
|
|
|
|
|
2021-10-09 13:41:12 +03:00
|
|
|
#include "../engine/ResourceManager.h"
|
2021-09-13 15:53:43 +03:00
|
|
|
#include "Gun.h"
|
2021-10-16 20:22:55 +03:00
|
|
|
#include "../ShooterConsts.h"
|
2021-09-13 15:53:43 +03:00
|
|
|
|
|
|
|
using namespace std;
|
|
|
|
|
2021-10-16 20:22:55 +03:00
|
|
|
Gun::Gun(int ammo, const std::string& weaponName) : Weapon(weaponName, ShooterConsts::GUN_OBJ, "obj/gun_mat.txt", Vec3D{3, 3, 3}, Vec3D{-0.8, 1.3, 0.3}, Vec3D{0, Consts::PI, 0}) {
|
|
|
|
fireSound.setBuffer(*ResourceManager::loadSoundBuffer(ShooterConsts::GUN_FIRE_SOUND));
|
|
|
|
reloadSound.setBuffer(*ResourceManager::loadSoundBuffer(ShooterConsts::GUN_RELOAD_SOUND));
|
2021-09-13 15:53:43 +03:00
|
|
|
|
|
|
|
_initialPack = 30;
|
|
|
|
_clipCapacity = 6; // how much ammo can be stored in one clip
|
|
|
|
_stockAmmo = ammo - _clipCapacity; // how much ammo do you have in stock
|
|
|
|
_clipAmmo = _clipCapacity; // how much ammo do you have in current clip
|
|
|
|
_reloadTime = 2;
|
|
|
|
_fireDelay = 0.3; // time delay between fires
|
|
|
|
_damage = 800;
|
|
|
|
_spreading = 3.0;
|
|
|
|
}
|