(mod, src, tgt, distance, tgtSigRadius)
| 236 | |
| 237 | |
| 238 | def getBombMult(mod, src, tgt, distance, tgtSigRadius): |
| 239 | modRange = mod.maxRange |
| 240 | if modRange is None: |
| 241 | return 0 |
| 242 | blastRadius = mod.getModifiedChargeAttr('explosionRange') |
| 243 | atkRadius = src.getRadius() |
| 244 | tgtRadius = tgt.getRadius() |
| 245 | # Bomb starts in the center of the ship |
| 246 | # Also here we assume that it affects target as long as blast |
| 247 | # touches its surface, not center - I did not check this |
| 248 | if distance is not None and distance < max(0, modRange - atkRadius - tgtRadius - blastRadius): |
| 249 | return 0 |
| 250 | if distance is not None and distance > max(0, modRange - atkRadius + tgtRadius + blastRadius): |
| 251 | return 0 |
| 252 | return _calcBombFactor( |
| 253 | atkEr=mod.getModifiedChargeAttr('aoeCloudSize'), |
| 254 | tgtSigRadius=tgtSigRadius) |
| 255 | |
| 256 | |
| 257 | def getGuidedBombMult(mod, src, distance, tgtSigRadius): |
no test coverage detected