Add backend support for damage stats separation (prespool and postspool)
This commit is contained in:
@@ -303,7 +303,7 @@ class EfsPort():
|
||||
weaponSystems = []
|
||||
groups = {}
|
||||
for mod in fit.modules:
|
||||
if mod.dps > 0:
|
||||
if mod.getDps() > 0:
|
||||
# Group weapon + ammo combinations that occur more than once
|
||||
keystr = str(mod.itemID) + "-" + str(mod.chargeID)
|
||||
if keystr in groups:
|
||||
@@ -320,6 +320,7 @@ class EfsPort():
|
||||
explosionRadius = 0
|
||||
explosionVelocity = 0
|
||||
aoeFieldRange = 0
|
||||
typeing = 'None'
|
||||
if stats.charge:
|
||||
name = stats.item.name + ", " + stats.charge.name
|
||||
else:
|
||||
@@ -345,10 +346,10 @@ class EfsPort():
|
||||
else:
|
||||
maxRange = stats.maxRange
|
||||
statDict = {
|
||||
"dps": stats.dps * n, "capUse": stats.capUse * n, "falloff": stats.falloff,
|
||||
"dps": stats.getDps(spool=True) * n, "capUse": stats.capUse * n, "falloff": stats.falloff,
|
||||
"type": typeing, "name": name, "optimal": maxRange,
|
||||
"numCharges": stats.numCharges, "numShots": stats.numShots, "reloadTime": stats.reloadTime,
|
||||
"cycleTime": stats.cycleTime, "volley": stats.volley * n, "tracking": tracking,
|
||||
"cycleTime": stats.cycleTime, "volley": stats.getVolley(spool=True) * n, "tracking": tracking,
|
||||
"maxVelocity": maxVelocity, "explosionDelay": explosionDelay, "damageReductionFactor": damageReductionFactor,
|
||||
"explosionRadius": explosionRadius, "explosionVelocity": explosionVelocity, "aoeFieldRange": aoeFieldRange,
|
||||
"damageMultiplierBonusMax": stats.getModifiedItemAttr("damageMultiplierBonusMax"),
|
||||
@@ -356,19 +357,19 @@ class EfsPort():
|
||||
}
|
||||
weaponSystems.append(statDict)
|
||||
for drone in fit.drones:
|
||||
if drone.dps[0] > 0 and drone.amountActive > 0:
|
||||
if drone.getDps() > 0 and drone.amountActive > 0:
|
||||
droneAttr = drone.getModifiedItemAttr
|
||||
# Drones are using the old tracking formula for trackingSpeed. This updates it to match turrets.
|
||||
newTracking = droneAttr("trackingSpeed") / (droneAttr("optimalSigRadius") / 40000)
|
||||
statDict = {
|
||||
"dps": drone.dps[0], "cycleTime": drone.cycleTime, "type": "Drone",
|
||||
"dps": drone.getDps(), "cycleTime": drone.cycleTime, "type": "Drone",
|
||||
"optimal": drone.maxRange, "name": drone.item.name, "falloff": drone.falloff,
|
||||
"maxSpeed": droneAttr("maxVelocity"), "tracking": newTracking,
|
||||
"volley": drone.dps[1]
|
||||
"volley": drone.getVolley()
|
||||
}
|
||||
weaponSystems.append(statDict)
|
||||
for fighter in fit.fighters:
|
||||
if fighter.dps[0] > 0 and fighter.amountActive > 0:
|
||||
if fighter.getDps() > 0 and fighter.amountActive > 0:
|
||||
fighterAttr = fighter.getModifiedItemAttr
|
||||
abilities = []
|
||||
if "fighterAbilityAttackMissileDamageEM" in fighter.item.attributes.keys():
|
||||
@@ -380,10 +381,10 @@ class EfsPort():
|
||||
ability = EfsPort.getFighterAbilityData(fighterAttr, fighter, baseRef)
|
||||
abilities.append(ability)
|
||||
statDict = {
|
||||
"dps": fighter.dps[0], "type": "Fighter", "name": fighter.item.name,
|
||||
"dps": fighter.getDps(), "type": "Fighter", "name": fighter.item.name,
|
||||
"maxSpeed": fighterAttr("maxVelocity"), "abilities": abilities,
|
||||
"ehp": fighterAttr("shieldCapacity") / 0.8875 * fighter.amountActive,
|
||||
"volley": fighter.dps[1], "signatureRadius": fighterAttr("signatureRadius")
|
||||
"volley": fighter.getVolley(), "signatureRadius": fighterAttr("signatureRadius")
|
||||
}
|
||||
weaponSystems.append(statDict)
|
||||
return weaponSystems
|
||||
@@ -622,11 +623,11 @@ class EfsPort():
|
||||
shipSize = EfsPort.getShipSize(fit.ship.item.groupID)
|
||||
try:
|
||||
dataDict = {
|
||||
"name": fitName, "ehp": fit.ehp, "droneDPS": fit.droneDPS,
|
||||
"droneVolley": fit.droneVolley, "hp": fit.hp, "maxTargets": fit.maxTargets,
|
||||
"maxSpeed": fit.maxSpeed, "weaponVolley": fit.weaponVolley, "totalVolley": fit.totalVolley,
|
||||
"name": fitName, "ehp": fit.ehp, "droneDPS": fit.getDroneDps(),
|
||||
"droneVolley": fit.getDroneVolley(), "hp": fit.hp, "maxTargets": fit.maxTargets,
|
||||
"maxSpeed": fit.maxSpeed, "weaponVolley": fit.getWeaponVolley(spool=True), "totalVolley": fit.getTotalVolley(spool=True),
|
||||
"maxTargetRange": fit.maxTargetRange, "scanStrength": fit.scanStrength,
|
||||
"weaponDPS": fit.weaponDPS, "alignTime": fit.alignTime, "signatureRadius": fitModAttr("signatureRadius"),
|
||||
"weaponDPS": fit.getWeaponDps(spool=True), "alignTime": fit.alignTime, "signatureRadius": fitModAttr("signatureRadius"),
|
||||
"weapons": weaponSystems, "scanRes": fitModAttr("scanResolution"),
|
||||
"capUsed": fit.capUsed, "capRecharge": fit.capRecharge,
|
||||
"rigSlots": fitModAttr("rigSlots"), "lowSlots": fitModAttr("lowSlots"),
|
||||
|
||||
Reference in New Issue
Block a user