Make the choosing of moves do something(new move_selected method)

This commit is contained in:
CactiChameleon9 2022-03-24 17:20:11 +00:00
parent 363c53d0e7
commit c68a84f99b
3 changed files with 17 additions and 1 deletions

View File

@ -115,3 +115,16 @@ func _physics_process(delta: float) -> void:
emit_signal("turn_completed")
_has_sent_turn_completed = true
func _on_move_selected(move_num) -> void:
#get move properties TODO
var target_move = get_node(("Move" + move_num))
var move_name = target_move.getName()
var move_damage = target_move.getDamage()
var move_points = target_move.getPoints()
var move_pattern = target_move.getPattern()
#run attack function
attack(move_damage, move_points, move_pattern)

View File

@ -120,7 +120,6 @@ texture = ExtResource( 2 )
position = Vector2( 2, -12 )
hframes = 4
vframes = 6
frame = 12
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
autoplay = "Idle"
@ -136,3 +135,5 @@ anims/Idle = SubResource( 5 )
[node name="UnitPopup" parent="Canvas" instance=ExtResource( 3 )]
margin_right = 40.0
margin_bottom = 88.0
[connection signal="move_selected" from="Canvas/UnitPopup" to="." method="_on_move_selected"]

View File

@ -1,6 +1,8 @@
extends PopupPanel
signal move_selected(move_num)
func _move_selected(move_num: int) -> void:
print(move_num)
hide()
emit_signal("move_selected", move_num)