mtd/PCs/Universal/ClassCards/Blowdart/blowdartweapon.gd

18 lines
530 B
GDScript

extends Weapon
class_name BlowdartWeapon
@export var status_stats : StatusStats
func shoot():
if other_cooldown <= 0 and stats != null:
other_cooldown = cooldown
$AnimationPlayer.play("shoot")
if $RayCast3D.is_colliding():
var target = $RayCast3D.get_collider()
if target != null:
var target_hitbox = target.shape_owner_get_owner($RayCast3D.get_collider_shape())
if target_hitbox is Hitbox:
var status = StatusPoison.new()
status.stats = status_stats
target.status_manager.add_effect(status)