else -> false
} && felinaeShipPowerMode == FelinaeShipPowerMode.INERTIALESS_DRIVE
+ val remainingInertialessDriveJumps: Int
+ get() = when (val movement = ship.movement) {
+ is FelinaeShipMovement -> movement.inertialessDriveShots - usedInertialessDriveShots
+ else -> 0
+ }
+
val canUseDisruptionPulse: Boolean
get() = ship.canUseDisruptionPulse && modulesStatus[ShipModule.Turrets].canBeUsed && when (val durability = ship.durability) {
is FelinaeShipDurability -> usedDisruptionPulseShots < durability.disruptionPulseShots
else -> 0
}
- val remainingInertialessDriveJumps: Int
- get() = when (val movement = ship.movement) {
- is FelinaeShipMovement -> movement.inertialessDriveShots - usedInertialessDriveShots
- else -> 0
- }
-
val canUseRecoalescence: Boolean
get() = ship.canUseRecoalescence && felinaeShipPowerMode == FelinaeShipPowerMode.HULL_RECOALESCENSE && !isDoneCurrentPhase && hullAmount < durability.maxHullPoints && recoalescenceMaxHullDamage < (ship.durability.maxHullPoints - 1)
val maxVelocity = movement.moveSpeed
val curVelocity = currentVelocity
val ratio = curVelocity / maxVelocity
- val exponent = -ratio / sqrt(1 + abs(4 * ratio))
- return -expm1(exponent)
+ val exponent = ratio / sqrt(1 + abs(4 * ratio))
+ return -expm1(-exponent)
}
fun ShipInstance.impact(damage: Int, ignoreShields: Boolean = false) = if (durability is FelinaeShipDurability && Random.nextDouble() < felinaeArmorIgnoreDamageChance())