51 lines
1.2 KiB
C++
51 lines
1.2 KiB
C++
#ifndef WEAPONS_REVOLVER_H
|
|
#define WEAPONS_REVOLVER_H
|
|
|
|
#include "wave_survival/hitscan_muzzle.h"
|
|
#include "wave_survival/weapon_base.h"
|
|
|
|
class Revolver : public WeaponBase {
|
|
GDCLASS(Revolver, WeaponBase);
|
|
static void _bind_methods();
|
|
void queue_idle_anim();
|
|
void start_running();
|
|
void stop_running();
|
|
void interrupt_running();
|
|
void play_equip_anim();
|
|
void shoot();
|
|
void cock_hammer();
|
|
void on_primary_fire(bool pressed);
|
|
void on_alt_mode(bool pressed);
|
|
void ready();
|
|
void process(double delta);
|
|
|
|
bool animation_is_idle() const;
|
|
|
|
protected:
|
|
void _notification(int what);
|
|
virtual void notify_selected() override;
|
|
virtual bool allows_running() const override;
|
|
|
|
public:
|
|
void start_recoil();
|
|
void set_single_action_spread(float value);
|
|
float get_single_action_spread() const;
|
|
void set_double_action_spread(float value);
|
|
float get_double_action_spread() const;
|
|
|
|
private:
|
|
float single_action_spread{ 0.01f };
|
|
float double_action_spread{ 0.03f };
|
|
bool alt_active{ false };
|
|
HitscanMuzzle *muzzle{ nullptr };
|
|
|
|
float recoil_force{ 2.f };
|
|
double recoil_time{ 0.1 };
|
|
double recoil_timer{ 0.0 };
|
|
|
|
double run_animation_delay{ 0.3 };
|
|
double run_animation_timer{ 0.0 };
|
|
};
|
|
|
|
#endif // !WEAPONS_REVOLVER_H
|