(fit, sFit)
| 113 | # Note this also includes data for any cap boosters as they "repair" cap. |
| 114 | @staticmethod |
| 115 | def getRepairData(fit, sFit): |
| 116 | modGroupNames = [ |
| 117 | "Shield Booster", "Armor Repair Unit", |
| 118 | "Ancillary Shield Booster", "Ancillary Armor Repairer", |
| 119 | "Hull Repair Unit", "Capacitor Booster", |
| 120 | ] |
| 121 | repairMods = EfsPort.getModsInGroups(fit, modGroupNames) |
| 122 | repairs = []; |
| 123 | for mod in repairMods: |
| 124 | stats = {} |
| 125 | EfsPort.attrDirectMap(["duration", "capacitorNeed"], stats, mod) |
| 126 | if mod.item.group.name in ["Armor Repair Unit", "Ancillary Armor Repairer"]: |
| 127 | stats["type"] = "Armor Repairer" |
| 128 | EfsPort.attrDirectMap(["armorDamageAmount"], stats, mod) |
| 129 | if mod.item.group.name == "Ancillary Armor Repairer": |
| 130 | stats["numShots"] = mod.numShots |
| 131 | EfsPort.attrDirectMap(["reloadTime", "chargedArmorDamageMultiplier"], stats, mod) |
| 132 | elif mod.item.group.name in ["Shield Booster", "Ancillary Shield Booster"]: |
| 133 | stats["type"] = "Shield Booster" |
| 134 | EfsPort.attrDirectMap(["shieldBonus"], stats, mod) |
| 135 | if mod.item.group.name == "Ancillary Shield Booster": |
| 136 | stats["numShots"] = mod.numShots |
| 137 | EfsPort.attrDirectMap(["reloadTime"], stats, mod) |
| 138 | c = mod.charge |
| 139 | if c: |
| 140 | sFit.recalc(fit) |
| 141 | CalcChangeModuleChargesCommand( |
| 142 | fit.ID, |
| 143 | projected=False, |
| 144 | chargeMap={mod.position: None}, |
| 145 | recalc=False).Do() |
| 146 | sFit.recalc(fit) |
| 147 | stats["unloadedCapacitorNeed"] = mod.getModifiedItemAttr("capacitorNeed") |
| 148 | CalcChangeModuleChargesCommand( |
| 149 | fit.ID, |
| 150 | projected=False, |
| 151 | chargeMap={mod.position: c.typeID}, |
| 152 | recalc=False).Do() |
| 153 | sFit.recalc(fit) |
| 154 | elif mod.item.group.name == "Capacitor Booster": |
| 155 | # The capacitorNeed is negative, which provides the boost. |
| 156 | stats["type"] = "Capacitor Booster" |
| 157 | stats["numShots"] = mod.numShots |
| 158 | EfsPort.attrDirectMap(["reloadTime"], stats, mod) |
| 159 | repairs.append(stats) |
| 160 | return repairs |
| 161 | |
| 162 | @staticmethod |
| 163 | def getOutgoingProjectionData(fit): |
no test coverage detected