Calculate damage multiplier for turret-based weapons.
(chanceToHit)
| 361 | # Turret-specific math |
| 362 | @lru_cache(maxsize=50) |
| 363 | def _calcTurretMult(chanceToHit): |
| 364 | """Calculate damage multiplier for turret-based weapons.""" |
| 365 | # https://wiki.eveuniversity.org/Turret_mechanics#Damage |
| 366 | wreckingChance = min(chanceToHit, 0.01) |
| 367 | wreckingPart = wreckingChance * 3 |
| 368 | normalChance = chanceToHit - wreckingChance |
| 369 | if normalChance > 0: |
| 370 | avgDamageMult = (0.01 + chanceToHit) / 2 + 0.49 |
| 371 | normalPart = normalChance * avgDamageMult |
| 372 | else: |
| 373 | normalPart = 0 |
| 374 | totalMult = normalPart + wreckingPart |
| 375 | return totalMult |
| 376 | |
| 377 | |
| 378 | @lru_cache(maxsize=1000) |
no outgoing calls
no test coverage detected