(snapshot, distance, tgtSpeed, tgtSigRadius)
| 56 | |
| 57 | |
| 58 | def _missileApplication(snapshot, distance, tgtSpeed, tgtSigRadius): |
| 59 | rangeData = snapshot['missileMaxRangeData'] |
| 60 | if rangeData is None: |
| 61 | return 0 |
| 62 | lowerRange, higherRange, higherChance = rangeData |
| 63 | if distance is None or distance <= lowerRange: |
| 64 | distanceFactor = 1 |
| 65 | elif lowerRange < distance <= higherRange: |
| 66 | distanceFactor = higherChance |
| 67 | else: |
| 68 | distanceFactor = 0 |
| 69 | if distanceFactor == 0: |
| 70 | return 0 |
| 71 | applicationFactor = _calcMissileFactor(atkEr=snapshot['aoeCloudSize'], atkEv=snapshot['aoeVelocity'], |
| 72 | atkDrf=snapshot['aoeDamageReductionFactor'], tgtSpeed=tgtSpeed, tgtSigRadius=tgtSigRadius) |
| 73 | return distanceFactor * applicationFactor |
| 74 | |
| 75 | |
| 76 | def _snapshotTurret(mod, dmgTyped, charge): |
no test coverage detected