Introduce new attributes which store prespool and postspool armor reps, and modify effects affecting it

This commit is contained in:
DarkPhoenix
2018-12-12 15:10:38 +03:00
parent ec1a2035cd
commit 25c5abffee
7 changed files with 38 additions and 14 deletions

View File

@@ -9,4 +9,7 @@ type = "active"
def handler(fit, module, context):
amount = module.getModifiedItemAttr("armorDamageAmount")
speed = module.getModifiedItemAttr("duration") / 1000.0
fit.extraAttributes.increase("armorRepair", amount / speed)
rps = amount / speed
fit.extraAttributes.increase("armorRepair", rps)
fit.extraAttributes.increase("armorRepairPreSpool", rps)
fit.extraAttributes.increase("armorRepairFullSpool", rps)

View File

@@ -14,4 +14,7 @@ def handler(fit, module, context):
amount = module.getModifiedItemAttr("armorDamageAmount") * multiplier
speed = module.getModifiedItemAttr("duration") / 1000.0
fit.extraAttributes.increase("armorRepair", amount / speed)
rps = amount / speed
fit.extraAttributes.increase("armorRepair", rps)
fit.extraAttributes.increase("armorRepairPreSpool", rps)
fit.extraAttributes.increase("armorRepairFullSpool", rps)

View File

@@ -9,4 +9,7 @@ def handler(fit, container, context):
if "projected" in context:
bonus = container.getModifiedItemAttr("armorDamageAmount")
duration = container.getModifiedItemAttr("duration") / 1000.0
fit.extraAttributes.increase("armorRepair", bonus / duration)
rps = bonus / duration
fit.extraAttributes.increase("armorRepair", rps)
fit.extraAttributes.increase("armorRepairPreSpool", rps)
fit.extraAttributes.increase("armorRepairFullSpool", rps)

View File

@@ -17,4 +17,7 @@ def handler(fit, module, context, **kwargs):
amount = module.getModifiedItemAttr("armorDamageAmount") * multiplier
speed = module.getModifiedItemAttr("duration") / 1000.0
fit.extraAttributes.increase("armorRepair", amount / speed, **kwargs)
rps = amount / speed
fit.extraAttributes.increase("armorRepair", rps)
fit.extraAttributes.increase("armorRepairPreSpool", rps)
fit.extraAttributes.increase("armorRepairFullSpool", rps)

View File

@@ -2,6 +2,8 @@
#
# Used by:
# Modules from group: Mutadaptive Remote Armor Repairer (5 of 5)
from eos.utils.spoolSupport import SpoolType, calculateSpoolup
@@ -14,6 +16,11 @@ def handler(fit, container, context, **kwargs):
cycleTime = container.getModifiedItemAttr("duration") / 1000.0
repSpoolMax = container.getModifiedItemAttr("repairMultiplierBonusMax")
repSpoolPerCycle = container.getModifiedItemAttr("repairMultiplierBonusPerCycle")
rps = repAmountBase * (1 + calculateSpoolup(repSpoolMax, repSpoolPerCycle, cycleTime, container.spoolType, container.spoolAmount)[0]) / cycleTime
rpsPreSpool = repAmountBase * (1 + calculateSpoolup(repSpoolMax, repSpoolPerCycle, cycleTime, SpoolType.SCALE, 0)[0]) / cycleTime
rpsFullSpool = repAmountBase * (1 + calculateSpoolup(repSpoolMax, repSpoolPerCycle, cycleTime, SpoolType.SCALE, 1)[0]) / cycleTime
# TODO: use spoolup options to fetch main value
repAmount = repAmountBase * (1 + calculateSpoolup(repSpoolMax, repSpoolPerCycle, cycleTime, SpoolType.SCALE, 1)[0])
fit.extraAttributes.increase("armorRepair", repAmount / cycleTime, **kwargs)
rps = rpsFullSpool
fit.extraAttributes.increase("armorRepair", rps, **kwargs)
fit.extraAttributes.increase("armorRepairPreSpool", rpsPreSpool, **kwargs)
fit.extraAttributes.increase("armorRepairFullSpool", rpsFullSpool, **kwargs)

View File

@@ -9,4 +9,7 @@ def handler(fit, container, context, **kwargs):
if "projected" in context:
bonus = container.getModifiedItemAttr("armorDamageAmount")
duration = container.getModifiedItemAttr("duration") / 1000.0
fit.extraAttributes.increase("armorRepair", bonus / duration, **kwargs)
rps = bonus / duration
fit.extraAttributes.increase("armorRepair", rps)
fit.extraAttributes.increase("armorRepairPreSpool", rps)
fit.extraAttributes.increase("armorRepairFullSpool", rps)

View File

@@ -29,14 +29,16 @@ pyfalog = Logger(__name__)
class Ship(ItemAttrShortcut, HandledItem):
EXTRA_ATTRIBUTES = {
"armorRepair" : 0,
"hullRepair" : 0,
"shieldRepair" : 0,
"maxActiveDrones" : 0,
"armorRepair": 0,
"armorRepairPreSpool": 0,
"armorRepairFullSpool": 0,
"hullRepair": 0,
"shieldRepair": 0,
"maxActiveDrones": 0,
"maxTargetsLockedFromSkills": 2,
"droneControlRange" : 20000,
"cloaked" : False,
"siege" : False
"droneControlRange": 20000,
"cloaked": False,
"siege": False
# We also have speedLimit for Entosis Link, but there seems to be an
# issue with naming it exactly "speedLimit" due to unknown reasons.
# Regardless, we don't have to put it here anyways - it will come up