Player prog
This commit is contained in:
@@ -55,11 +55,5 @@ func startBattle(params) -> void:
|
||||
if !battleCutscene.running:
|
||||
battleCutscene.start()
|
||||
|
||||
# Wait 3 seconds then simulate damage for testing
|
||||
var fighter = fighterMap[BattlePosition.RIGHT_TOP_FRONT]
|
||||
while true:
|
||||
await get_tree().create_timer(0.3).timeout
|
||||
fighter.damage(10, false)
|
||||
|
||||
func getFighterAtPosition(battlePos:BattlePosition) -> BattleFighter:
|
||||
return fighterMap.get(battlePos, null)
|
||||
|
||||
@@ -35,6 +35,11 @@ var luck:int
|
||||
|
||||
# Equipment
|
||||
|
||||
# Moves
|
||||
var movePrimary:BattleMove
|
||||
var movesMagical:Array[BattleMove] = []
|
||||
var movesAbility:Array[BattleMove] = []
|
||||
|
||||
# Signals
|
||||
signal healthChanged(difference:int, crit:bool)
|
||||
signal mpChanged(difference:int)
|
||||
@@ -50,6 +55,9 @@ func _init(params:Dictionary) -> void:
|
||||
self.luck = params.get('luck', 1)
|
||||
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', [])
|
||||
|
||||
self.health = self.maxHealth
|
||||
self.mp = self.maxMp
|
||||
|
||||
@@ -33,4 +33,20 @@ static var MOVE_PUNCH = BattleMove.new({
|
||||
"power": 15,
|
||||
"accuracy": 0.95,
|
||||
"moveType": MoveType.PHYSICAL
|
||||
})
|
||||
|
||||
static var MOVE_FIRE1 = BattleMove.new({
|
||||
"name": "Fire",
|
||||
"power": 25,
|
||||
"mpCost": 5,
|
||||
"accuracy": 0.9,
|
||||
"moveType": MoveType.MAGICAL
|
||||
})
|
||||
|
||||
static var MOVE_HEAL1 = BattleMove.new({
|
||||
"name": "Heal",
|
||||
"power": -20,
|
||||
"mpCost": 8,
|
||||
"accuracy": 1.0,
|
||||
"moveType": MoveType.ABILITY
|
||||
})
|
||||
@@ -15,12 +15,12 @@ func _ready() -> void:
|
||||
|
||||
func onAttackPressed() -> void:
|
||||
print("Attack button pressed")
|
||||
decisionMade.emit(null)
|
||||
decisionMade.emit(BattleMove.MOVE_PUNCH)
|
||||
|
||||
func onMagicPressed() -> void:
|
||||
print("Magic button pressed")
|
||||
decisionMade.emit(null)
|
||||
decisionMade.emit(BattleMove.MOVE_FIRE1)
|
||||
|
||||
func onItemPressed() -> void:
|
||||
print("Item button pressed")
|
||||
decisionMade.emit(null)
|
||||
decisionMade.emit(null)
|
||||
@@ -3,7 +3,9 @@ class_name PartySingleton extends Node
|
||||
static var PARTY_JOHN = PartyMember.new({
|
||||
'name': "John",
|
||||
'team': BattleFighter.FighterTeam.PLAYER,
|
||||
"maxHealth": 9999999999
|
||||
"maxHealth": 9999999999,
|
||||
"movePrimary": BattleMove.MOVE_PUNCH,
|
||||
"movesMagical": [ BattleMove.MOVE_FIRE1 ],
|
||||
})
|
||||
|
||||
static var BACKPACK = Inventory.new()
|
||||
|
||||
@@ -11,6 +11,8 @@ func _enter_tree() -> void:
|
||||
# SCENE.setScene(SceneSingleton.SceneType.INITIAL)
|
||||
|
||||
SCENE.setScene(SceneSingleton.SceneType.BATTLE)
|
||||
# Wait a frame
|
||||
await get_tree().process_frame
|
||||
BATTLE.startBattle({
|
||||
'fighters': {
|
||||
BATTLE.BattlePosition.RIGHT_TOP_FRONT: PartySingleton.PARTY_JOHN,
|
||||
|
||||
Reference in New Issue
Block a user