Check if fighter can engage specific fitting
(self, projectedOnto)
| 378 | [x.clear() for x in self.abilities] |
| 379 | |
| 380 | def canBeApplied(self, projectedOnto): |
| 381 | """Check if fighter can engage specific fitting""" |
| 382 | item = self.item |
| 383 | # Do not allow to apply offensive modules on ship with offensive module immunite, with few exceptions |
| 384 | # (all effects which apply instant modification are exception, generally speaking) |
| 385 | if item.offensive and projectedOnto.ship.getModifiedItemAttr("disallowOffensiveModifiers") == 1: |
| 386 | offensiveNonModifiers = {"energyDestabilizationNew", |
| 387 | "leech", |
| 388 | "energyNosferatuFalloff", |
| 389 | "energyNeutralizerFalloff"} |
| 390 | if not offensiveNonModifiers.intersection(set(item.effects)): |
| 391 | return False |
| 392 | # If assistive modules are not allowed, do not let to apply these altogether |
| 393 | if item.assistive and projectedOnto.ship.getModifiedItemAttr("disallowAssistance") == 1: |
| 394 | return False |
| 395 | else: |
| 396 | return True |
| 397 | |
| 398 | def calculateModifiedAttributes(self, fit, runTime, forceProjected=False, forcedProjRange=DEFAULT): |
| 399 | if not self.active: |
nothing calls this directly
no test coverage detected