You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
673 B
GDScript

extends AnimatedSprite3D
class_name Throw
@onready var character: Character = (get_owner() as Character)
@onready var status: Status = (%Status as Status)
func _process(delta) -> void:
if status.throw_target == 0:
return
var target: Character = Global.character_mgr.get_character(status.throw_target)
if not target:
return
var thorw_pos_2d: Vector2 = status.skill_dir.normalized() * position.x
var thow_pos: Vector3 = Vector3(thorw_pos_2d.x, position.y, thorw_pos_2d.y)
var target_pos: Vector3 = thow_pos + character.pos()
target.set_pos(target_pos)
target.set_status("is_right", (scale.x>0) == status.is_right)