Check if drone can engage specific fitting
(self, projectedOnto)
| 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: |
no test coverage detected