Added support for volatile status effects including confusion and flinching. Also, all elements are now supported.
This commit is contained in:
@@ -23,8 +23,8 @@ class BattleEngine(val player: Party, val enemy: Party)(implicit val rng: Random
|
||||
val queue = rng.shuffle(actions).sorted // Shuffle to randomize in the event of a tie
|
||||
queue.foreach(useMove)
|
||||
val eotQueue = Seq(player.lead, enemy.lead).sortBy(_(Speed))
|
||||
eotQueue.foreach(mon => mon.status.map(_.onResidual(mon)))
|
||||
|
||||
eotQueue.foreach(mon => mon.statuses.map(_.onResidual(mon)))
|
||||
|
||||
if (!player.lead.isAlive) {
|
||||
if (player.canFight) {
|
||||
val replace = player.pollReplacement(enemy)
|
||||
@@ -51,7 +51,7 @@ class BattleEngine(val player: Party, val enemy: Party)(implicit val rng: Random
|
||||
val move = action.move
|
||||
val target = action.target
|
||||
if (user.isAlive) {
|
||||
if (user.status.forall(_.onBeforeMove(user, move, target))) {
|
||||
if (user.statuses.forall(_.onBeforeMove(user, move, target))) {
|
||||
move.useMove(user, target)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user