Added moves with a cooldown
This commit is contained in:
@@ -18,10 +18,17 @@ class BattleEngine(val player: Party, val enemy: Party)(implicit val reader: Sig
|
||||
|
||||
def playTurn(): Unit = {
|
||||
val playerAction = player.pollAction(enemy)
|
||||
playTurn(playerAction)
|
||||
playTurnImp(playerAction)
|
||||
}
|
||||
|
||||
def playTurn(playerAction: Action): Unit = {
|
||||
playTurnImp(playerAction)
|
||||
while (player.lead.isLocked) {
|
||||
playTurn()
|
||||
}
|
||||
}
|
||||
|
||||
def playTurnImp(playerAction: Action): Unit = {
|
||||
val enemyAction = enemy.pollAction(player)
|
||||
|
||||
val actions = Seq(playerAction, enemyAction)
|
||||
|
||||
@@ -39,7 +39,9 @@ class BattleUI extends SignalConsumer {
|
||||
}
|
||||
|
||||
def onMove(move: Move): Unit = {
|
||||
val action = Action(engine.player.lead, move, engine.enemy.lead)
|
||||
implicit val rng = engine.rng
|
||||
implicit val reader = engine
|
||||
val action = Action(engine.player.lead, move, engine.player.pollTarget(move, engine.player.lead, engine.enemy))
|
||||
engine.playTurn(action)
|
||||
updateUI()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user