Add battle stuff
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
class_name BattleSingleton extends Node
|
||||
const BattleCutsceneAction = preload("res://battle/cutscene/BattleCutsceneAction.gd")
|
||||
const BattleCutsceneAction = preload("res://cutscene/battle/BattleCutsceneAction.gd")
|
||||
|
||||
enum BattlePosition {
|
||||
LEFT_TOP_BACK,
|
||||
@@ -34,7 +34,10 @@ func startBattle(params) -> void:
|
||||
assert(!active)
|
||||
|
||||
# Get the cutscene (or create a default one).
|
||||
battleCutscene = params.get('cutscene', Cutscene.new())
|
||||
if params.has('cutscene'):
|
||||
battleCutscene = params['cutscene']
|
||||
else:
|
||||
battleCutscene = Cutscene.new()
|
||||
|
||||
# Update fighters for each fighter scene.
|
||||
for pos in BattlePosition.values():
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
uid://bo4kp86ebt2mq
|
||||
@@ -1,14 +0,0 @@
|
||||
class_name BattleAction
|
||||
const BattleFighter = preload("res://battle/fighter/BattleFighter.gd")
|
||||
|
||||
static func playerDecisionCallable(_params:Dictionary) -> int:
|
||||
BATTLE.battleScene.actionBox.visible = true
|
||||
var move = await BATTLE.battleScene.actionBox.decisionMade
|
||||
BATTLE.battleScene.actionBox.visible = false
|
||||
return Cutscene.CUTSCENE_CONTINUE
|
||||
|
||||
static func getPlayerDecisionCallable(fighter:BattleFighter) -> Dictionary:
|
||||
return {
|
||||
"function": playerDecisionCallable,
|
||||
"fighter": fighter
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
uid://duetkvkhddyc7
|
||||
@@ -37,8 +37,8 @@ var luck:int
|
||||
|
||||
# Moves
|
||||
var movePrimary:BattleMove
|
||||
var movesMagical:Array[BattleMove] = []
|
||||
var movesAbility:Array[BattleMove] = []
|
||||
var movesMagical:Array[BattleMove]
|
||||
var movesAbility:Array[BattleMove]
|
||||
|
||||
# Signals
|
||||
signal healthChanged(difference:int, crit:bool)
|
||||
@@ -56,8 +56,10 @@ func _init(params:Dictionary) -> void:
|
||||
self.team = params.get('team', FighterTeam.ENEMY)
|
||||
self.controller = params.get('controller', FighterController.PLAYER)
|
||||
self.movePrimary = params.get('movePrimary', null)
|
||||
self.movesMagical = params.get('movesMagical', [])
|
||||
self.movesAbility = params.get('movesAbility', [])
|
||||
if params.has('movesMagical'):
|
||||
movesMagical.append_array(params['movesMagical'])
|
||||
if params.has('movesAbility'):
|
||||
movesAbility.append_array(params['movesAbility'])
|
||||
|
||||
self.health = self.maxHealth
|
||||
self.mp = self.maxMp
|
||||
|
||||
Reference in New Issue
Block a user