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.
|
|
|
|
extends Sprite2D
|
|
|
|
|
|
|
|
|
|
@export var SpecialActions: Array[Action] = []
|
|
|
|
|
|
|
|
|
|
@onready var ATB = $battle_menu/ATB
|
|
|
|
|
@onready var ActionState = $battle_menu/ActionPanel/ActionState
|
|
|
|
|
@onready var Actions = $Combatant/Actions
|
|
|
|
|
var NextAction
|
|
|
|
|
var ActionReady = false
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func _process(delta):
|
|
|
|
|
|
|
|
|
|
var combatant = $Combatant
|
|
|
|
|
if ActionReady and ATB.value == 100:
|
|
|
|
|
NextAction.execute()
|
|
|
|
|
ActionState.text = "Action Executing: %s" % NextAction.ActionName
|
|
|
|
|
combatant.ATBCurrent = 0
|
|
|
|
|
ATB.value = 0
|
|
|
|
|
ActionReady = false
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
combatant.tick_atb(delta)
|
|
|
|
|
ATB.value = combatant.ATBCurrent
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
func do_action(a):
|
|
|
|
|
|
|
|
|
|
var action = Actions.get_node(a)
|
|
|
|
|
if !action:
|
|
|
|
|
push_error("Unknown battle action: %s" % a)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
ActionState.text = "Action Queued: %s" % action.ActionName
|
|
|
|
|
NextAction = action
|
|
|
|
|
ActionReady = true
|
|
|
|
|
|
|
|
|
|
func action_done():
|
|
|
|
|
ActionState.text = ""
|