#ifndef HITSCAN_MUZZLE_H
#define HITSCAN_MUZZLE_H

#include "scene/3d/physics/ray_cast_3d.h"

class HitscanMuzzle : public RayCast3D {
	GDCLASS(HitscanMuzzle, RayCast3D);
	static void _bind_methods();
	void instantiate_impact_effect();
	void try_deal_damage();
	void ready();

public:
	void _notification(int what);
	void shoot();
	void shoot_multiple(int count);

	void set_spread(float spread);
	float get_spread() const;
	void set_damage(int damage);
	int get_damage() const;
	void set_ray_count(int amount);
	int get_ray_count() const;

private:
	float spread{ 0.001f };
	int damage{ 1 };
	int ray_count{ 1 };

	Transform3D home_transform{};
	Ref<PackedScene> impact_effect{};
};

#endif // !HITSCAN_MUZZLE_H
