Rescale acumen gain
authorTheSaminator <TheSaminator@users.noreply.github.com>
Sat, 12 Feb 2022 17:08:45 +0000 (12:08 -0500)
committerTheSaminator <TheSaminator@users.noreply.github.com>
Sat, 12 Feb 2022 17:08:45 +0000 (12:08 -0500)
src/jvmMain/kotlin/starshipfights/game/server_game.kt

index e54ae90ac7afdd1640f6fe8ff97982cdcf0b5618..40d9a15eab778b830fcf733232ea7df2abc42d77 100644 (file)
@@ -187,6 +187,8 @@ suspend fun DefaultWebSocketServerSession.gameEndpoint(user: User, token: String
        receiveActionsJob.cancelAndJoin()
 }
 
+private const val SHIP_POINTS_PER_ACUMEN = 5
+
 private suspend fun onGameEnd(gameState: GameState, gameEnd: GameEvent.GameEnd, startedAt: Instant, endedAt: Instant) {
        val destroyedShipStatus = DrydockStatus.InRepair(endedAt.plus(12, ChronoUnit.HOURS))
        val damagedShipStatus = DrydockStatus.InRepair(endedAt.plus(8, ChronoUnit.HOURS))
@@ -204,8 +206,8 @@ private suspend fun onGameEnd(gameState: GameState, gameEnd: GameEvent.GameEnd,
        val hostAdmiralId = gameState.hostInfo.id.reinterpret<Admiral>()
        val guestAdmiralId = gameState.guestInfo.id.reinterpret<Admiral>()
        
-       val hostAcumenGain = shipWrecks.values.filter { it.owner == GlobalSide.GUEST && !it.isEscape }.sumOf { it.ship.pointCost }
-       val guestAcumenGain = shipWrecks.values.filter { it.owner == GlobalSide.HOST && !it.isEscape }.sumOf { it.ship.pointCost }
+       val hostAcumenGain = shipWrecks.values.filter { it.owner == GlobalSide.GUEST && !it.isEscape }.sumOf { it.ship.pointCost / SHIP_POINTS_PER_ACUMEN }
+       val guestAcumenGain = shipWrecks.values.filter { it.owner == GlobalSide.HOST && !it.isEscape }.sumOf { it.ship.pointCost / SHIP_POINTS_PER_ACUMEN }
        
        val battleRecord = BattleRecord(
                battleInfo = gameState.battleInfo,