class_name Weapon extends Node2D

@onready var bulletPoint = $BulletPoint
@onready var cooldownTimer = $cooldownTimer

@onready var shoot = $shoot

@export var damage: int = 1
@export var cooldown: float = 0.1
@export var penetration: int = 1
@export var spread: float = 0.1
@export var range: float = 8.0
@export var bulletSpeed: float = 10

func attack():
	shoot.play()
	randomize()
	if cooldownTimer.is_stopped():
		cooldownTimer.start(cooldown)


func getSpread() -> float:
	var rng = RandomNumberGenerator.new()
	return rng.randf_range(-spread, spread)
