From ecc471c96f83c7c6c5efa20d8bfc1e136be7bb0f Mon Sep 17 00:00:00 2001 From: TheSaminator Date: Sat, 11 Jun 2022 09:37:24 -0400 Subject: [PATCH] Boarding comparison fixes --- .../kotlin/net/starshipfights/game/ship_boarding.kt | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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 } -- 2.25.1