]> Untitled Git - frog-ninja.git/blob - player/moves/slash.gd
Added slash move
[frog-ninja.git] / player / moves / slash.gd
1 extends Move
2 class_name Slash
3
4
5 @onready var timer: Timer = $Timer
6
7 var finished := false
8
9
10 func should_enter(input: InputPacket) -> String:
11         if finished:
12                 input.actions.sort_custom(moves_priority_sort)
13                 return input.actions[0]
14         return "slash"
15
16
17 func on_enter_state():
18         finished = false
19         player.skin.animation_tree.animation_finished.connect(_on_animation_finished)
20         player.skin.transition_slash()
21
22
23 func _on_animation_finished(n: String):
24         finished = true
25         player.skin.animation_tree.animation_finished.disconnect(_on_animation_finished)