Player prog

This commit is contained in:
2026-01-11 20:22:15 -06:00
parent 7defac68c4
commit 8a599a054c
6 changed files with 32 additions and 10 deletions

View File

@@ -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)

View File

@@ -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

View File

@@ -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
})

View File

@@ -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)