2023-11-11 19:03:01 +11:00
|
|
|
extends Weapon
|
|
|
|
|
|
|
|
@export var shapecast : ShapeCast3D
|
|
|
|
@export var particlesystem : GPUParticles3D
|
|
|
|
@export var status_stats : StatusStats
|
|
|
|
|
|
|
|
|
|
|
|
func _ready() -> void:
|
|
|
|
cooldown = 1.0 / stats.fire_rate
|
|
|
|
|
|
|
|
|
2023-11-13 19:36:35 +11:00
|
|
|
func set_raycast_origin(_node):
|
2023-11-11 19:03:01 +11:00
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
func shoot():
|
|
|
|
if other_cooldown <= 0 and stats != null:
|
|
|
|
other_cooldown = cooldown
|
|
|
|
particlesystem.emitting = true
|
|
|
|
$AnimationPlayer.play("shoot")
|
|
|
|
for index in shapecast.get_collision_count():
|
|
|
|
var target = shapecast.get_collider(index) as CharacterBody3D
|
|
|
|
var status = StatusOnFire.new()
|
|
|
|
status.stats = status_stats
|
|
|
|
target.status_manager.add_effect(status)
|
|
|
|
|
|
|
|
|
|
|
|
func release_trigger():
|
|
|
|
trigger_held = false
|
|
|
|
particlesystem.emitting = false
|