Add prespool/fullspool support to non-sustainable tank calculation
This commit is contained in:
@@ -42,13 +42,18 @@ class DamagePattern(object):
|
||||
return ehp
|
||||
|
||||
def calculateEffectiveTank(self, fit, tankInfo):
|
||||
ehps = {}
|
||||
passiveShield = fit.calculateShieldRecharge()
|
||||
ehps["passiveShield"] = self.effectivify(fit, passiveShield, "shield")
|
||||
for type in ("shield", "armor", "hull"):
|
||||
ehps["%sRepair" % type] = self.effectivify(fit, tankInfo["%sRepair" % type], type)
|
||||
|
||||
return ehps
|
||||
typeMap = {
|
||||
"passiveShield": "shield",
|
||||
"shieldRepair": "shield",
|
||||
"armorRepair": "armor",
|
||||
"armorRepairPreSpool": "armor",
|
||||
"armorRepairFullSpool": "armor",
|
||||
"hullRepair": "hull"}
|
||||
ereps = {}
|
||||
for field in tankInfo:
|
||||
if field in typeMap:
|
||||
ereps[field] = self.effectivify(fit, tankInfo[field], typeMap[field])
|
||||
return ereps
|
||||
|
||||
def effectivify(self, fit, amount, type):
|
||||
type = type if type != "hull" else ""
|
||||
|
||||
@@ -1404,11 +1404,14 @@ class Fit(object):
|
||||
|
||||
@property
|
||||
def tank(self):
|
||||
hps = {"passiveShield": self.calculateShieldRecharge()}
|
||||
for type in ("shield", "armor", "hull"):
|
||||
hps["%sRepair" % type] = self.extraAttributes["%sRepair" % type]
|
||||
|
||||
return hps
|
||||
reps = {
|
||||
"passiveShield": self.calculateShieldRecharge(),
|
||||
"shieldRepair": self.extraAttributes["shieldRepair"],
|
||||
"armorRepair": self.extraAttributes["armorRepair"],
|
||||
"armorRepairPreSpool": self.extraAttributes["armorRepairPreSpool"],
|
||||
"armorRepairFullSpool": self.extraAttributes["armorRepairFullSpool"],
|
||||
"hullRepair": self.extraAttributes["hullRepair"]}
|
||||
return reps
|
||||
|
||||
@property
|
||||
def effectiveTank(self):
|
||||
@@ -1416,7 +1419,7 @@ class Fit(object):
|
||||
if self.damagePattern is None:
|
||||
ehps = self.tank
|
||||
else:
|
||||
ehps = self.damagePattern.calculateEffectiveTank(self, self.extraAttributes)
|
||||
ehps = self.damagePattern.calculateEffectiveTank(self, self.tank)
|
||||
|
||||
self.__effectiveTank = ehps
|
||||
|
||||
|
||||
Reference in New Issue
Block a user