| 577 | |
| 578 | @staticmethod |
| 579 | def getResistance(fit, effect): |
| 580 | # Resistances are applicable only to projected effects |
| 581 | if isinstance(effect.type, (tuple, list)): |
| 582 | effectType = effect.type |
| 583 | else: |
| 584 | effectType = (effect.type,) |
| 585 | if 'projected' not in effectType: |
| 586 | return 1 |
| 587 | remoteResistID = getResistanceAttrID(modifyingItem=fit.getModifier(), effect=effect) |
| 588 | if not remoteResistID: |
| 589 | return 1 |
| 590 | attrInfo = getAttributeInfo(remoteResistID) |
| 591 | # Get the attribute of the resist |
| 592 | resist = fit.ship.itemModifiedAttributes[attrInfo.attributeName] or None |
| 593 | return resist or 1 |
| 594 | |
| 595 | |
| 596 | class Affliction: |