#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;

	void set_ads_factor(float value);
	float get_ads_factor() const;
	void set_run_factor(float value);
	float get_run_factor() const;
	void set_recoil_force(float value);
	float get_recoil_force() const;
	void set_recoil_time(float value);
	float get_recoil_time() 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 };

	float recoil_force{ 3.f };
	float recoil_time{ 0.05f };

	HitscanMuzzle *muzzle{ nullptr };
};

#endif // !WEAPONS_RIFLE_H
