ADD: Added the ability for EFS exports to contain the following information: shieldrecharge rate, inertia, energy|neutraliser Resistance

This commit is contained in:
Gareth Williams
2021-01-09 22:34:29 +01:00
parent 2d645b8f91
commit e430848be9
2 changed files with 17 additions and 3 deletions

View File

@@ -539,7 +539,7 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
return DmgTypes(0, 0, 0, 0) return DmgTypes(0, 0, 0, 0)
return volleyParams[min(volleyParams)] return volleyParams[min(volleyParams)]
def getDps(self, spoolOptions=None, targetProfile=None, ignoreState=False): def getDps(self, spoolOptions=None, targetProfile=None, ignoreState=False, getSpreadDPS=False):
dmgDuringCycle = DmgTypes(0, 0, 0, 0) dmgDuringCycle = DmgTypes(0, 0, 0, 0)
cycleParams = self.getCycleParameters() cycleParams = self.getCycleParameters()
if cycleParams is None: if cycleParams is None:
@@ -556,7 +556,12 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
thermal=dmgDuringCycle.thermal * dpsFactor, thermal=dmgDuringCycle.thermal * dpsFactor,
kinetic=dmgDuringCycle.kinetic * dpsFactor, kinetic=dmgDuringCycle.kinetic * dpsFactor,
explosive=dmgDuringCycle.explosive * dpsFactor) explosive=dmgDuringCycle.explosive * dpsFactor)
return dps if not getSpreadDPS:
return dps
return {'em':dmgDuringCycle.em * dpsFactor,
'therm': dmgDuringCycle.thermal * dpsFactor,
'kin': dmgDuringCycle.kinetic * dpsFactor,
'exp': dmgDuringCycle.explosive * dpsFactor}
def isRemoteRepping(self, ignoreState=False): def isRemoteRepping(self, ignoreState=False):
repParams = self.getRepAmountParameters(ignoreState=ignoreState) repParams = self.getRepAmountParameters(ignoreState=ignoreState)

View File

@@ -414,6 +414,10 @@ class EfsPort:
maxRange = 300000 maxRange = 300000
else: else:
maxRange = stats.maxRange maxRange = stats.maxRange
dps_spread_dict = stats.getDps(spoolOptions=spoolOptions, getSpreadDPS=True)
dps_spread_dict.update((x, y*n) for x, y in dps_spread_dict.items())
statDict = { statDict = {
"dps": stats.getDps(spoolOptions=spoolOptions).total * n, "capUse": stats.capUse * n, "falloff": stats.falloff, "dps": stats.getDps(spoolOptions=spoolOptions).total * n, "capUse": stats.capUse * n, "falloff": stats.falloff,
"type": typeing, "name": name, "optimal": maxRange, "type": typeing, "name": name, "optimal": maxRange,
@@ -422,7 +426,8 @@ class EfsPort:
"maxVelocity": maxVelocity, "explosionDelay": explosionDelay, "damageReductionFactor": damageReductionFactor, "maxVelocity": maxVelocity, "explosionDelay": explosionDelay, "damageReductionFactor": damageReductionFactor,
"explosionRadius": explosionRadius, "explosionVelocity": explosionVelocity, "aoeFieldRange": aoeFieldRange, "explosionRadius": explosionRadius, "explosionVelocity": explosionVelocity, "aoeFieldRange": aoeFieldRange,
"damageMultiplierBonusMax": stats.getModifiedItemAttr("damageMultiplierBonusMax"), "damageMultiplierBonusMax": stats.getModifiedItemAttr("damageMultiplierBonusMax"),
"damageMultiplierBonusPerCycle": stats.getModifiedItemAttr("damageMultiplierBonusPerCycle") "damageMultiplierBonusPerCycle": stats.getModifiedItemAttr("damageMultiplierBonusPerCycle"),
"dps_spread": dps_spread_dict
} }
weaponSystems.append(statDict) weaponSystems.append(statDict)
for drone in fit.drones: for drone in fit.drones:
@@ -663,6 +668,7 @@ class EfsPort:
modTypeIDs = modInfo["modTypeIDs"] modTypeIDs = modInfo["modTypeIDs"]
weaponSystems = EfsPort.getWeaponSystemData(fit) weaponSystems = EfsPort.getWeaponSystemData(fit)
turretSlots = fitModAttr("turretSlotsLeft") if fitModAttr("turretSlotsLeft") is not None else 0 turretSlots = fitModAttr("turretSlotsLeft") if fitModAttr("turretSlotsLeft") is not None else 0
launcherSlots = fitModAttr("launcherSlotsLeft") if fitModAttr("launcherSlotsLeft") is not None else 0 launcherSlots = fitModAttr("launcherSlotsLeft") if fitModAttr("launcherSlotsLeft") is not None else 0
droneBandwidth = fitModAttr("droneBandwidth") if fitModAttr("droneBandwidth") is not None else 0 droneBandwidth = fitModAttr("droneBandwidth") if fitModAttr("droneBandwidth") is not None else 0
@@ -686,6 +692,7 @@ class EfsPort:
"exp": fitModAttr("shieldExplosiveDamageResonance"), "kin": fitModAttr("shieldKineticDamageResonance"), "exp": fitModAttr("shieldExplosiveDamageResonance"), "kin": fitModAttr("shieldKineticDamageResonance"),
"therm": fitModAttr("shieldThermalDamageResonance"), "em": fitModAttr("shieldEmDamageResonance") "therm": fitModAttr("shieldThermalDamageResonance"), "em": fitModAttr("shieldEmDamageResonance")
} }
resonance = {"hull": hullResonance, "armor": armorResonance, "shield": shieldResonance} resonance = {"hull": hullResonance, "armor": armorResonance, "shield": shieldResonance}
shipSize = EfsPort.getShipSize(fit.ship.item.groupID) shipSize = EfsPort.getShipSize(fit.ship.item.groupID)
# Export at maximum spool for consistency, spoolup data is exported anyway. # Export at maximum spool for consistency, spoolup data is exported anyway.
@@ -735,6 +742,8 @@ class EfsPort:
"effectiveLaunchers": effectiveLauncherSlots, "effectiveDroneBandwidth": effectiveDroneBandwidth, "effectiveLaunchers": effectiveLauncherSlots, "effectiveDroneBandwidth": effectiveDroneBandwidth,
"resonance": resonance, "typeID": fit.shipID, "groupID": fit.ship.item.groupID, "shipSize": shipSize, "resonance": resonance, "typeID": fit.shipID, "groupID": fit.ship.item.groupID, "shipSize": shipSize,
"droneControlRange": fitModAttr("droneControlRange"), "mass": fitModAttr("mass"), "droneControlRange": fitModAttr("droneControlRange"), "mass": fitModAttr("mass"),
"shieldrechargetime": fitModAttr("shieldRechargeRate"), 'shipinertia': fitModAttr("agility"),
"energyWarfareResistance": fitModAttr("energyWarfareResistance"),
"unpropedSpeed": propData["unpropedSpeed"], "unpropedSig": propData["unpropedSig"], "unpropedSpeed": propData["unpropedSpeed"], "unpropedSig": propData["unpropedSig"],
"usingMWD": propData["usingMWD"], "mwdPropSpeed": mwdPropSpeed, "projections": projections, "usingMWD": propData["usingMWD"], "mwdPropSpeed": mwdPropSpeed, "projections": projections,
"repairs": repairs, "modTypeIDs": modTypeIDs, "moduleNames": moduleNames, "cargoItemIDs": cargoIDs, "repairs": repairs, "modTypeIDs": modTypeIDs, "moduleNames": moduleNames, "cargoItemIDs": cargoIDs,