(src, tgt, tgtSpeed, srcScramRange, tgtScrammables, tpMods, tpDrones, tpFighters, distance)
| 139 | |
| 140 | |
| 141 | def getSigRadiusMult(src, tgt, tgtSpeed, srcScramRange, tgtScrammables, tpMods, tpDrones, tpFighters, distance): |
| 142 | # Can blow non-immune ships and target profiles |
| 143 | if tgt.isFit and tgt.item.ship.getModifiedItemAttr('disallowOffensiveModifiers'): |
| 144 | return 1 |
| 145 | inLockRange = checkLockRange(src=src, distance=distance) |
| 146 | inDroneRange = checkDroneControlRange(src=src, distance=distance) |
| 147 | initSig = tgt.getSigRadius() |
| 148 | # No scrams or distance is longer than longest scram - nullify scrammables list |
| 149 | if not inLockRange or srcScramRange is None or (distance is not None and distance > srcScramRange): |
| 150 | tgtScrammables = () |
| 151 | # TPing modules |
| 152 | appliedMultipliers = {} |
| 153 | if inLockRange: |
| 154 | for tpData in tpMods: |
| 155 | appliedBoost = tpData.boost * calculateRangeFactor( |
| 156 | srcOptimalRange=tpData.optimal, |
| 157 | srcFalloffRange=tpData.falloff, |
| 158 | distance=distance) |
| 159 | if appliedBoost: |
| 160 | appliedMultipliers.setdefault(tpData.stackingGroup, []).append((1 + appliedBoost / 100, tpData.resAttrID)) |
| 161 | # TPing drones |
| 162 | mobileTps = [] |
| 163 | if inLockRange: |
| 164 | mobileTps.extend(tpFighters) |
| 165 | if inLockRange and inDroneRange: |
| 166 | mobileTps.extend(tpDrones) |
| 167 | droneOpt = GraphSettings.getInstance().get('mobileDroneMode') |
| 168 | atkRadius = src.getRadius() |
| 169 | for mtpData in mobileTps: |
| 170 | # Faster than target or set to follow it - apply full TP |
| 171 | if (droneOpt == GraphDpsDroneMode.auto and mtpData.speed >= tgtSpeed) or droneOpt == GraphDpsDroneMode.followTarget: |
| 172 | appliedMtpBoost = mtpData.boost |
| 173 | # Otherwise project from the center of the ship |
| 174 | else: |
| 175 | if distance is None: |
| 176 | rangeFactorDistance = None |
| 177 | else: |
| 178 | rangeFactorDistance = distance + atkRadius - mtpData.radius |
| 179 | appliedMtpBoost = mtpData.boost * calculateRangeFactor( |
| 180 | srcOptimalRange=mtpData.optimal, |
| 181 | srcFalloffRange=mtpData.falloff, |
| 182 | distance=rangeFactorDistance) |
| 183 | appliedMultipliers.setdefault(mtpData.stackingGroup, []).append((1 + appliedMtpBoost / 100, mtpData.resAttrID)) |
| 184 | modifiedSig = tgt.getSigRadius(extraMultipliers=appliedMultipliers, ignoreAfflictors=tgtScrammables) |
| 185 | if modifiedSig == math.inf and initSig == math.inf: |
| 186 | return 1 |
| 187 | mult = modifiedSig / initSig |
| 188 | # Ensure consistent results - round off a little to avoid float errors |
| 189 | return floatUnerr(mult) |
no test coverage detected