Change battle actions to use battle decisions instead.

This commit is contained in:
2026-01-15 19:09:46 -06:00
parent 3b7de160dc
commit 274cbef780
15 changed files with 173 additions and 41 deletions

View File

@@ -1,11 +1,10 @@
class_name ActionBox extends GridContainer
const BattleMove = preload("res://battle/fighter/BattleMove.gd")
@export var btnAttack:Button
@export var btnMagic:Button
@export var btnItem:Button
signal decisionMade(move:BattleMove)
signal decisionMade(move:BattleDecision)
func _ready() -> void:
btnAttack.pressed.connect(onAttackPressed)
@@ -15,12 +14,12 @@ func _ready() -> void:
func onAttackPressed() -> void:
print("Attack button pressed")
decisionMade.emit(BattleMove.MOVE_PUNCH)
decisionMade.emit(BattleDecision.new(BattleMove.MOVE_PUNCH, null, null))
func onMagicPressed() -> void:
print("Magic button pressed")
decisionMade.emit(BattleMove.MOVE_FIRE1)
decisionMade.emit(BattleDecision.new(BattleMove.MOVE_FIRE1, null, null))
func onItemPressed() -> void:
print("Item button pressed")
decisionMade.emit(null)