44 lines
999 B
C++
44 lines
999 B
C++
#ifndef WEAPONS_RIFLE_H
|
|
#define WEAPONS_RIFLE_H
|
|
|
|
#include "wave_survival/player_camera.h"
|
|
#include "wave_survival/weapon_base.h"
|
|
class PlayerBody;
|
|
class HitscanMuzzle;
|
|
|
|
class Rifle : public WeaponBase {
|
|
GDCLASS(Rifle, WeaponBase);
|
|
static void _bind_methods();
|
|
void queue_start_aim();
|
|
void queue_stop_ads_anim();
|
|
void queue_start_run_anim();
|
|
void stop_run_anim();
|
|
void shoot();
|
|
void play_equip_anim();
|
|
void on_primary_fire(bool down);
|
|
void on_alt_mode(bool alt_mode);
|
|
void on_animation_changed(String new_anim);
|
|
void on_run_input(bool run);
|
|
void ready();
|
|
void process(double delta);
|
|
|
|
public:
|
|
void _notification(int what);
|
|
|
|
virtual bool allows_running() const override;
|
|
bool run_requested() const;
|
|
virtual void notify_selected() override;
|
|
bool is_animating() const;
|
|
|
|
private:
|
|
float ads_factor{ 0.5f };
|
|
float run_factor{ 1.5f };
|
|
bool request_alt_mode{ false };
|
|
bool in_alt_mode{ false };
|
|
bool running{ false };
|
|
|
|
HitscanMuzzle *muzzle{ nullptr };
|
|
};
|
|
|
|
#endif // !WEAPONS_RIFLE_H
|