Merge branch 'bug/1139' into bug/resist-effects
This commit is contained in:
@@ -6,13 +6,13 @@ type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff1Multiplier",
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff1Value",
|
||||
src.getModifiedItemAttr("shipBonusORECapital2"), skill="Capital Industrial Ships")
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff2Multiplier",
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff2Value",
|
||||
src.getModifiedItemAttr("shipBonusORECapital2"), skill="Capital Industrial Ships")
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff4Multiplier",
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff4Value",
|
||||
src.getModifiedItemAttr("shipBonusORECapital2"), skill="Capital Industrial Ships")
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff3Multiplier",
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "warfareBuff3Value",
|
||||
src.getModifiedItemAttr("shipBonusORECapital2"), skill="Capital Industrial Ships")
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Mining Foreman"), "buffDuration",
|
||||
src.getModifiedItemAttr("shipBonusORECapital2"), skill="Capital Industrial Ships")
|
||||
|
||||
@@ -6,13 +6,13 @@ type = "passive"
|
||||
|
||||
|
||||
def handler(fit, src, context):
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Command"), "warfareBuff4Multiplier",
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Command"), "warfareBuff4Value",
|
||||
src.getModifiedItemAttr("shipBonusORECapital3"), skill="Capital Industrial Ships")
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Command"), "buffDuration",
|
||||
src.getModifiedItemAttr("shipBonusORECapital3"), skill="Capital Industrial Ships")
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Command"), "warfareBuff1Multiplier",
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Command"), "warfareBuff1Value",
|
||||
src.getModifiedItemAttr("shipBonusORECapital3"), skill="Capital Industrial Ships")
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Command"), "warfareBuff3Multiplier",
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Command"), "warfareBuff3Value",
|
||||
src.getModifiedItemAttr("shipBonusORECapital3"), skill="Capital Industrial Ships")
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Command"), "warfareBuff2Multiplier",
|
||||
fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Shield Command"), "warfareBuff2Value",
|
||||
src.getModifiedItemAttr("shipBonusORECapital3"), skill="Capital Industrial Ships")
|
||||
|
||||
@@ -361,12 +361,13 @@ class ModifiedAttributeDict(collections.MutableMapping):
|
||||
# effect is applied.
|
||||
mod = self.fit.getModifier()
|
||||
remoteResistID = mod.getModifiedItemAttr("remoteResistanceID") or None
|
||||
attrInfo = getAttributeInfo(int(remoteResistID))
|
||||
|
||||
# We really don't have a way of getting a ships attribute by ID. Fail.
|
||||
resist = next((x for x in self.fit.ship.item.attributes.values() if x.ID == remoteResistID), None)
|
||||
# Get the attribute of the resist
|
||||
resist = self.fit.ship.itemModifiedAttributes[attrInfo.attributeName] or None
|
||||
|
||||
if remoteResistID and resist:
|
||||
boostFactor *= resist.value
|
||||
boostFactor *= resist
|
||||
|
||||
# We just transform percentage boost into multiplication factor
|
||||
self.multiply(attributeName, 1 + boostFactor / 100.0, *args, **kwargs)
|
||||
|
||||
@@ -100,6 +100,10 @@ class Drone(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut):
|
||||
def charge(self):
|
||||
return self.__charge
|
||||
|
||||
@property
|
||||
def cycleTime(self):
|
||||
return max(self.getModifiedItemAttr("duration"), 0)
|
||||
|
||||
@property
|
||||
def dealsDamage(self):
|
||||
for attr in ("emDamage", "kineticDamage", "explosiveDamage", "thermalDamage"):
|
||||
|
||||
@@ -29,6 +29,7 @@ from eos import capSim
|
||||
from eos.effectHandlerHelpers import HandledModuleList, HandledDroneCargoList, HandledImplantBoosterList, HandledProjectedDroneList, HandledProjectedModList
|
||||
from eos.enum import Enum
|
||||
from eos.saveddata.ship import Ship
|
||||
from eos.saveddata.drone import Drone
|
||||
from eos.saveddata.character import Character
|
||||
from eos.saveddata.citadel import Citadel
|
||||
from eos.saveddata.module import Module, State, Slot, Hardpoint
|
||||
@@ -1230,24 +1231,33 @@ class Fit(object):
|
||||
if force_recalc is False:
|
||||
return self.__remoteReps
|
||||
|
||||
# We are rerunning the recalcs. Explicitly set to 0 to make sure we don't duplicate anything and correctly set all values to 0.
|
||||
# We are rerunning the recalcs. Explicitly set to 0 to make sure we don't duplicate anything and correctly set
|
||||
# all values to 0.
|
||||
for remote_type in self.__remoteReps:
|
||||
self.__remoteReps[remote_type] = 0
|
||||
|
||||
for module in self.modules:
|
||||
# Skip empty and non-Active modules
|
||||
if module.isEmpty or module.state < State.ACTIVE:
|
||||
for stuff in chain(self.modules, self.drones):
|
||||
remote_type = None
|
||||
|
||||
# Only apply the charged multiplier if we have a charge in our ancil reppers (#1135)
|
||||
if stuff.charge:
|
||||
modifier = stuff.getModifiedItemAttr("chargedArmorDamageMultiplier", 1)
|
||||
else:
|
||||
modifier = 1
|
||||
|
||||
if isinstance(stuff, Module) and (stuff.isEmpty or stuff.state < State.ACTIVE):
|
||||
continue
|
||||
elif isinstance(stuff, Drone):
|
||||
# drones don't have fueled charges, so simply override modifier with the amount of drones active
|
||||
modifier = stuff.amountActive
|
||||
|
||||
# Covert cycleTime to seconds
|
||||
duration = module.cycleTime / 1000
|
||||
duration = stuff.cycleTime / 1000
|
||||
|
||||
# Skip modules with no duration.
|
||||
if not duration:
|
||||
continue
|
||||
|
||||
fueledMultiplier = module.getModifiedItemAttr("chargedArmorDamageMultiplier", 1)
|
||||
|
||||
remote_module_groups = {
|
||||
"Remote Armor Repairer" : "Armor",
|
||||
"Ancillary Remote Armor Repairer": "Armor",
|
||||
@@ -1257,26 +1267,38 @@ class Fit(object):
|
||||
"Remote Capacitor Transmitter" : "Capacitor",
|
||||
}
|
||||
|
||||
module_group = module.item.group.name
|
||||
module_group = stuff.item.group.name
|
||||
|
||||
if module_group in remote_module_groups:
|
||||
remote_type = remote_module_groups[module_group]
|
||||
else:
|
||||
elif not isinstance(stuff, Drone):
|
||||
# Module isn't in our list of remote rep modules, bail
|
||||
continue
|
||||
|
||||
if remote_type == "Hull":
|
||||
hp = module.getModifiedItemAttr("structureDamageAmount", 0)
|
||||
hp = stuff.getModifiedItemAttr("structureDamageAmount", 0)
|
||||
elif remote_type == "Armor":
|
||||
hp = module.getModifiedItemAttr("armorDamageAmount", 0)
|
||||
hp = stuff.getModifiedItemAttr("armorDamageAmount", 0)
|
||||
elif remote_type == "Shield":
|
||||
hp = module.getModifiedItemAttr("shieldBonus", 0)
|
||||
hp = stuff.getModifiedItemAttr("shieldBonus", 0)
|
||||
elif remote_type == "Capacitor":
|
||||
hp = module.getModifiedItemAttr("powerTransferAmount", 0)
|
||||
hp = stuff.getModifiedItemAttr("powerTransferAmount", 0)
|
||||
else:
|
||||
hp = 0
|
||||
|
||||
self.__remoteReps[remote_type] += (hp * fueledMultiplier) / duration
|
||||
droneShield = stuff.getModifiedItemAttr("shieldBonus", 0)
|
||||
droneArmor = stuff.getModifiedItemAttr("armorDamageAmount", 0)
|
||||
droneHull = stuff.getModifiedItemAttr("structureDamageAmount", 0)
|
||||
if droneShield:
|
||||
remote_type = "Shield"
|
||||
hp = droneShield
|
||||
elif droneArmor:
|
||||
remote_type = "Armor"
|
||||
hp = droneArmor
|
||||
elif droneHull:
|
||||
remote_type = "Hull"
|
||||
hp = droneHull
|
||||
else:
|
||||
hp = 0
|
||||
self.__remoteReps[remote_type] += (hp * modifier) / duration
|
||||
|
||||
return self.__remoteReps
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ from gui.viewColumn import ViewColumn
|
||||
from gui.bitmapLoader import BitmapLoader
|
||||
from gui.utils.numberFormatter import formatAmount
|
||||
from gui.utils.listFormatter import formatList
|
||||
from eos.saveddata.drone import Drone
|
||||
|
||||
|
||||
class Miscellanea(ViewColumn):
|
||||
@@ -417,7 +418,11 @@ class Miscellanea(ViewColumn):
|
||||
cycleTime = stuff.getModifiedItemAttr("duration")
|
||||
if not repAmount or not cycleTime:
|
||||
return "", None
|
||||
repPerSec = float(repAmount) * 1000 / cycleTime
|
||||
repPerSecPerDrone = repPerSec = float(repAmount) * 1000 / cycleTime
|
||||
|
||||
if isinstance(stuff, Drone):
|
||||
repPerSec *= stuff.amount
|
||||
|
||||
text = "{0}/s".format(formatAmount(repPerSec, 3, 0, 3))
|
||||
ttEntries = []
|
||||
if hullAmount is not None and repAmount == hullAmount:
|
||||
@@ -426,7 +431,8 @@ class Miscellanea(ViewColumn):
|
||||
ttEntries.append("armor")
|
||||
if shieldAmount is not None and repAmount == shieldAmount:
|
||||
ttEntries.append("shield")
|
||||
tooltip = "{0} repaired per second".format(formatList(ttEntries)).capitalize()
|
||||
|
||||
tooltip = "{0} HP repaired per second\n{1} HP/s per drone".format(formatList(ttEntries).capitalize(), repPerSecPerDrone)
|
||||
return text, tooltip
|
||||
elif itemGroup == "Energy Neutralizer Drone":
|
||||
neutAmount = stuff.getModifiedItemAttr("energyNeutralizerAmount")
|
||||
|
||||
Reference in New Issue
Block a user