Merged some conflicts with the new damage animations
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)
|
||||
|
||||
@@ -52,7 +52,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()
|
||||
}
|
||||
@@ -68,7 +70,6 @@ class BattleUI extends SignalConsumer {
|
||||
val r = 25
|
||||
val color = Color.AliceBlue
|
||||
val center = findCenter(target)
|
||||
print(center)
|
||||
|
||||
val circle = new Circle {
|
||||
radius = r
|
||||
|
||||
@@ -6,6 +6,7 @@ import javafx.scene.{control => jfxsc}
|
||||
import scalafx.Includes._
|
||||
import scalafx.scene.control._
|
||||
|
||||
import fmon._
|
||||
import fmon.stat.Monster
|
||||
import fmon.stat._
|
||||
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
package fmon
|
||||
|
||||
import scala.language.implicitConversions
|
||||
import scala.util.Random
|
||||
|
||||
import fmon.util._
|
||||
|
||||
|
||||
package object battle {
|
||||
implicit def rngDice(rng : Random) = new Dice(rng)
|
||||
implicit def int2Helper(x : Int) = new IntFraction(x)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user