Expose spoolup time to caller
This commit is contained in:
@@ -75,7 +75,7 @@ class FitDpsGraph(Graph):
|
||||
pyfalog.critical(e)
|
||||
|
||||
for mod in fit.modules:
|
||||
dps = mod.getDps(targetResists=fit.targetResists).total
|
||||
dps = mod.getDps(targetResists=fit.targetResists)[0].total
|
||||
if mod.hardpoint == Hardpoint.TURRET:
|
||||
if mod.state >= State.ACTIVE:
|
||||
total += dps * self.calculateTurretMultiplier(mod, data)
|
||||
|
||||
@@ -1366,7 +1366,7 @@ class Fit(object):
|
||||
remoteReps = {}
|
||||
|
||||
for module in self.modules:
|
||||
rrType, rrAmount = module.getRemoteReps(spoolType=spoolType, spoolAmount=spoolAmount)
|
||||
rrType, rrAmount, spoolTime = module.getRemoteReps(spoolType=spoolType, spoolAmount=spoolAmount)
|
||||
if rrType:
|
||||
if rrType not in remoteReps:
|
||||
remoteReps[rrType] = 0
|
||||
@@ -1461,8 +1461,8 @@ class Fit(object):
|
||||
weaponDps = DmgTypes(0, 0, 0, 0)
|
||||
|
||||
for mod in self.modules:
|
||||
weaponVolley += mod.getVolley(spoolType=spoolType, spoolAmount=spoolAmount, targetResists=self.targetResists)
|
||||
weaponDps += mod.getDps(spoolType=spoolType, spoolAmount=spoolAmount, targetResists=self.targetResists)
|
||||
weaponVolley += mod.getVolley(spoolType=spoolType, spoolAmount=spoolAmount, targetResists=self.targetResists)[0]
|
||||
weaponDps += mod.getDps(spoolType=spoolType, spoolAmount=spoolAmount, targetResists=self.targetResists)[0]
|
||||
|
||||
self.__weaponVolleyMap[(spoolType, spoolAmount)] = weaponVolley
|
||||
self.__weaponDpsMap[(spoolType, spoolAmount)] = weaponDps
|
||||
|
||||
@@ -434,7 +434,7 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
|
||||
|
||||
def getVolley(self, spoolType=None, spoolAmount=None, targetResists=None):
|
||||
if self.isEmpty or self.state < State.ACTIVE:
|
||||
return DmgTypes(0, 0, 0, 0)
|
||||
return DmgTypes(0, 0, 0, 0), 0
|
||||
if self.__baseVolley is None:
|
||||
dmgGetter = self.getModifiedChargeAttr if self.charge else self.getModifiedItemAttr
|
||||
dmgMult = self.getModifiedItemAttr("damageMultiplier", 1)
|
||||
@@ -443,25 +443,26 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
|
||||
thermal=(dmgGetter("thermalDamage", 0)) * dmgMult,
|
||||
kinetic=(dmgGetter("kineticDamage", 0)) * dmgMult,
|
||||
explosive=(dmgGetter("explosiveDamage", 0)) * dmgMult)
|
||||
spoolMultiplier = 1 + calculateSpoolup(
|
||||
spoolBoost, spoolTime = calculateSpoolup(
|
||||
self.getModifiedItemAttr("damageMultiplierBonusMax", 0),
|
||||
self.getModifiedItemAttr("damageMultiplierBonusPerCycle", 0),
|
||||
self.cycleTime / 1000,
|
||||
spoolType if spoolType is not None else self.spoolType,
|
||||
# Using spool type as condition as it should define if we're using
|
||||
# passed spoolup parameters or not
|
||||
spoolAmount if spoolType is not None else self.spoolAmount)[0]
|
||||
spoolAmount if spoolType is not None else self.spoolAmount)
|
||||
spoolMultiplier = 1 + spoolBoost
|
||||
volley = DmgTypes(
|
||||
em=self.__baseVolley.em * spoolMultiplier * (1 - getattr(targetResists, "emAmount", 0)),
|
||||
thermal=self.__baseVolley.thermal * spoolMultiplier * (1 - getattr(targetResists, "thermalAmount", 0)),
|
||||
kinetic=self.__baseVolley.kinetic * spoolMultiplier * (1 - getattr(targetResists, "kineticAmount", 0)),
|
||||
explosive=self.__baseVolley.explosive * spoolMultiplier * (1 - getattr(targetResists, "explosiveAmount", 0)))
|
||||
return volley
|
||||
return volley, spoolTime
|
||||
|
||||
def getDps(self, spoolType=None, spoolAmount=None, targetResists=None):
|
||||
volley = self.getVolley(spoolType=spoolType, spoolAmount=spoolAmount, targetResists=targetResists)
|
||||
volley, spoolTime = self.getVolley(spoolType=spoolType, spoolAmount=spoolAmount, targetResists=targetResists)
|
||||
if not volley:
|
||||
return DmgTypes(0, 0, 0, 0)
|
||||
return DmgTypes(0, 0, 0, 0), 0
|
||||
# Some weapons repeat multiple times in one cycle (bosonic doomsdays)
|
||||
# Get the number of times it fires off
|
||||
volleysPerCycle = max(self.getModifiedItemAttr("doomsdayDamageDuration", 1) / self.getModifiedItemAttr("doomsdayDamageCycleTime", 1), 1)
|
||||
@@ -471,11 +472,11 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
|
||||
thermal=volley.thermal * dpsFactor,
|
||||
kinetic=volley.kinetic * dpsFactor,
|
||||
explosive=volley.explosive * dpsFactor)
|
||||
return dps
|
||||
return dps, spoolTime
|
||||
|
||||
def getRemoteReps(self, spoolType=None, spoolAmount=None, ignoreState=False):
|
||||
if self.isEmpty or (self.state < State.ACTIVE and not ignoreState):
|
||||
return (None, 0)
|
||||
return (None, 0, 0)
|
||||
|
||||
def getBaseRemoteReps(module):
|
||||
remoteModuleGroups = {
|
||||
@@ -510,17 +511,20 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
|
||||
self.__baseRemoteReps = getBaseRemoteReps(self)
|
||||
|
||||
rrType, rrAmount = self.__baseRemoteReps
|
||||
spoolTime = 0
|
||||
|
||||
if rrType and rrAmount and self.item.group.name == "Mutadaptive Remote Armor Repairer":
|
||||
spoolMultiplier = 1 + calculateSpoolup(
|
||||
spoolBoost, spoolTime = calculateSpoolup(
|
||||
self.getModifiedItemAttr("repairMultiplierBonusMax", 0),
|
||||
self.getModifiedItemAttr("repairMultiplierBonusPerCycle", 0),
|
||||
self.cycleTime / 1000,
|
||||
spoolType if spoolType is not None else self.spoolType,
|
||||
# Using spool type as condition as it should define if we're using
|
||||
# passed spoolup parameters or not
|
||||
spoolAmount if spoolType is not None else self.spoolAmount)[0]
|
||||
rrAmount *= spoolMultiplier
|
||||
return rrType, rrAmount
|
||||
spoolAmount if spoolType is not None else self.spoolAmount)
|
||||
rrAmount *= (1 + spoolBoost)
|
||||
|
||||
return rrType, rrAmount, spoolTime
|
||||
|
||||
@property
|
||||
def reloadTime(self):
|
||||
|
||||
@@ -303,7 +303,7 @@ class EfsPort():
|
||||
weaponSystems = []
|
||||
groups = {}
|
||||
for mod in fit.modules:
|
||||
if mod.getDps().total > 0:
|
||||
if mod.getDps()[0].total > 0:
|
||||
# Group weapon + ammo combinations that occur more than once
|
||||
keystr = str(mod.itemID) + "-" + str(mod.chargeID)
|
||||
if keystr in groups:
|
||||
@@ -346,10 +346,10 @@ class EfsPort():
|
||||
else:
|
||||
maxRange = stats.maxRange
|
||||
statDict = {
|
||||
"dps": stats.getDps().total * n, "capUse": stats.capUse * n, "falloff": stats.falloff,
|
||||
"dps": stats.getDps()[0].total * 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.getVolley().total * n, "tracking": tracking,
|
||||
"cycleTime": stats.cycleTime, "volley": stats.getVolley()[0].total * n, "tracking": tracking,
|
||||
"maxVelocity": maxVelocity, "explosionDelay": explosionDelay, "damageReductionFactor": damageReductionFactor,
|
||||
"explosionRadius": explosionRadius, "explosionVelocity": explosionVelocity, "aoeFieldRange": aoeFieldRange,
|
||||
"damageMultiplierBonusMax": stats.getModifiedItemAttr("damageMultiplierBonusMax"),
|
||||
|
||||
Reference in New Issue
Block a user