Swap playWithMaxUnits after applying boosts

This commit is contained in:
Marcel Schwarz 2020-06-01 18:29:17 +02:00
parent 2820c7357a
commit 64d2c04fcb

View File

@ -88,6 +88,13 @@ class RoundCalculatorService {
if boosts[playerMoveWithSecMaxUnits.key]!.0 { if boosts[playerMoveWithSecMaxUnits.key]!.0 {
playerMoveWithSecMaxUnits.value.unitCount = Int(Double(playerMoveWithSecMaxUnits.value.unitCount) * ATK_BOOST_MULTIPLICATOR) playerMoveWithSecMaxUnits.value.unitCount = Int(Double(playerMoveWithSecMaxUnits.value.unitCount) * ATK_BOOST_MULTIPLICATOR)
} }
if playerMoveWithMaxUnits.value.unitCount < playerMoveWithSecMaxUnits.value.unitCount {
let temp = playerMoveWithMaxUnits
playerMoveWithMaxUnits = playerMoveWithSecMaxUnits
playerMoveWithSecMaxUnits = temp
}
playerMoveWithMaxUnits.value.unitCount -= playerMoveWithSecMaxUnits.value.unitCount playerMoveWithMaxUnits.value.unitCount -= playerMoveWithSecMaxUnits.value.unitCount
} }