From: TheSaminator Date: Sat, 11 Jun 2022 13:39:30 +0000 (-0400) Subject: Subplot fix X-Git-Url: https://gitweb.starshipfights.net/?a=commitdiff_plain;h=6c3314c155cfd6814c3e17ab1375a342a6d84ef9;p=starship-fights Subplot fix --- diff --git a/src/commonMain/kotlin/net/starshipfights/game/game_subplots.kt b/src/commonMain/kotlin/net/starshipfights/game/game_subplots.kt index cc662dd..a407335 100644 --- a/src/commonMain/kotlin/net/starshipfights/game/game_subplots.kt +++ b/src/commonMain/kotlin/net/starshipfights/game/game_subplots.kt @@ -181,10 +181,10 @@ sealed class Subplot { if (gameState.ships[againstShip] != null) return gameState val myShips = gameState.ships.values.filter { it.owner == forPlayer } - val lowestShipTier = myShips.minOf { it.ship.shipType.weightClass } - val shipsNotOfLowestTier = myShips.filter { it.ship.shipType.weightClass != lowestShipTier }.ifEmpty { myShips } + val highestShipTier = myShips.maxOf { it.ship.shipType.weightClass } + val shipsNotOfHighestTier = myShips.filter { it.ship.shipType.weightClass != highestShipTier }.ifEmpty { myShips } - val arkancideShip = shipsNotOfLowestTier.random().id + val arkancideShip = shipsNotOfHighestTier.random().id return gameState.modifySubplotData(PlausibleDeniability(forPlayer, arkancideShip, SubplotOutcome.UNDECIDED)) }