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

Method canBeApplied

eos/saveddata/drone.py:343–359  ·  view source on GitHub ↗

Check if drone can engage specific fitting

(self, projectedOnto)

Source from the content-addressed store, hash-verified

341 self.chargeModifiedAttributes.clear()
342
343 def canBeApplied(self, projectedOnto):
344 """Check if drone can engage specific fitting"""
345 item = self.item
346 # Do not allow to apply offensive modules on ship with offensive module immunite, with few exceptions
347 # (all effects which apply instant modification are exception, generally speaking)
348 if item.offensive and projectedOnto.ship.getModifiedItemAttr("disallowOffensiveModifiers") == 1:
349 offensiveNonModifiers = {"energyDestabilizationNew",
350 "leech",
351 "energyNosferatuFalloff",
352 "energyNeutralizerFalloff"}
353 if not offensiveNonModifiers.intersection(set(item.effects)):
354 return False
355 # If assistive modules are not allowed, do not let to apply these altogether
356 if item.assistive and projectedOnto.ship.getModifiedItemAttr("disallowAssistance") == 1:
357 return False
358 else:
359 return True
360
361 def calculateModifiedAttributes(self, fit, runTime, forceProjected=False, forcedProjRange=DEFAULT):
362 if self.projected or forceProjected:

Callers 2

checkStatesMethod · 0.45
DoMethod · 0.45

Calls 1

getModifiedItemAttrMethod · 0.45

Tested by

no test coverage detected