shooter/weapon/Rifle.cpp

21 lines
832 B
C++
Raw Normal View History

2021-09-13 15:53:43 +03:00
//
// Created by Иван Ильин on 06.06.2021.
//
2021-10-09 13:41:12 +03:00
#include "../engine/ResourceManager.h"
2021-09-13 15:53:43 +03:00
#include "Rifle.h"
Rifle::Rifle(int ammo, const std::string &weaponName) : Weapon(weaponName, "obj/rifle.obj", "obj/rifle_mat.txt", Vec3D{3, 3, 3}, Vec3D{-1.2, 1, 0.3}, Vec3D{0, Consts::PI, 0}) {
2021-10-09 13:41:12 +03:00
fireSound.setBuffer(*ResourceManager::loadSoundBuffer("sound/weapons/shotgun.ogg"));
reloadSound.setBuffer(*ResourceManager::loadSoundBuffer("sound/weapons/reload_ak47.ogg"));
2021-09-13 15:53:43 +03:00
_initialPack = 5;
_clipCapacity = 1; // 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 = 1;
_fireDelay = 1; // time delay between fires
_damage = 30000;
_spreading = 0.5;
}