MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / _bestWeaponDpsAtDistance

Function _bestWeaponDpsAtDistance

graphs/data/fitDamageEnvelope/getter.py:237–255  ·  view source on GitHub ↗
(weapon, src, tgt, atkSpeed, atkAngle, distance, tgtSpeed, tgtAngle, tgtSigRadius, profile,
                             inLockRange)

Source from the content-addressed store, hash-verified

235
236
237def _bestWeaponDpsAtDistance(weapon, src, tgt, atkSpeed, atkAngle, distance, tgtSpeed, tgtAngle, tgtSigRadius, profile,
238 inLockRange):
239 if not inLockRange:
240 # Special case: FoF missiles ignore lock range
241 candidates = [c for c in weapon['candidates'] if c.get('isFoF')]
242 if not candidates:
243 return 0
244 else:
245 candidates = weapon['candidates']
246 best = 0
247 for snap in candidates:
248 if snap['kind'] == 'turret':
249 mult = _turretApplication(snap, src, tgt, atkSpeed, atkAngle, distance, tgtSpeed, tgtAngle, tgtSigRadius)
250 else:
251 mult = _missileApplication(snap, distance, tgtSpeed, tgtSigRadius)
252 scalar = _typedDmgScalar(snap['dmg'], mult, profile)
253 if scalar > best:
254 best = scalar
255 return best
256
257
258class Distance2EnvelopeDpsGetter(SmoothPointGetter):

Callers 1

_calculatePointMethod · 0.85

Calls 4

_turretApplicationFunction · 0.85
_missileApplicationFunction · 0.85
_typedDmgScalarFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected