From: TheSaminator Date: Sat, 11 Jun 2022 13:37:24 +0000 (-0400) Subject: Boarding comparison fixes X-Git-Url: https://gitweb.starshipfights.net/?a=commitdiff_plain;h=ecc471c96f83c7c6c5efa20d8bfc1e136be7bb0f;p=starship-fights Boarding comparison fixes --- diff --git a/src/commonMain/kotlin/net/starshipfights/game/ship_boarding.kt b/src/commonMain/kotlin/net/starshipfights/game/ship_boarding.kt index 599e299..f9e2633 100644 --- a/src/commonMain/kotlin/net/starshipfights/game/ship_boarding.kt +++ b/src/commonMain/kotlin/net/starshipfights/game/ship_boarding.kt @@ -41,17 +41,15 @@ fun weightClassBoardingModifier(weightClass: ShipWeightClass): Int = when (weigh } fun troopsBoardingModifier(troopsAmount: Int, totalTroops: Int): Int = when { - troopsAmount < totalTroops / 3 -> 0 - troopsAmount < (totalTroops * 2) / 3 -> 2 + troopsAmount * 3 < totalTroops -> 0 + troopsAmount * 3 < totalTroops * 2 -> 2 troopsAmount < totalTroops -> 3 - troopsAmount == totalTroops -> 4 else -> 4 } fun hullBoardingModifier(hullAmount: Int, totalHull: Int): Int = when { - hullAmount < totalHull / 2 -> 1 + hullAmount * 2 < totalHull -> 1 hullAmount < totalHull -> 3 - hullAmount == totalHull -> 5 else -> 5 } @@ -69,7 +67,7 @@ fun shieldsBoardingAssaultModifier(shieldsAmount: Int, totalShields: Int): Int = fun shieldsBoardingDefenseModifier(shieldsAmount: Int, totalShields: Int): Int = when { shieldsAmount == 0 -> 0 - shieldsAmount <= totalShields / 2 -> 1 + shieldsAmount * 2 <= totalShields -> 1 shieldsAmount < totalShields -> 2 else -> 3 }