diff --git a/eos/effects/doomsdayaoebubble.py b/eos/effects/doomsdayaoebubble.py new file mode 100644 index 000000000..c4945d697 --- /dev/null +++ b/eos/effects/doomsdayaoebubble.py @@ -0,0 +1,9 @@ +# doomsdayAOEBubble +# +# Used by: +# Module: Standup Warp Disruption Burst Projector +type = "projected", "active" + + +def handler(fit, module, context): + return diff --git a/eos/effects/structuremissileguidanceenhancer.py b/eos/effects/structuremissileguidanceenhancer.py index d422bb1b6..9c0ce2515 100644 --- a/eos/effects/structuremissileguidanceenhancer.py +++ b/eos/effects/structuremissileguidanceenhancer.py @@ -1,14 +1,15 @@ # Not used by any item -type = "active" +type = "passive" def handler(fit, container, context): + missileGroups = ("Structure Anti-Capital Missile", "Structure Anti-Subcapital Missile") for srcAttr, tgtAttr in ( ("aoeCloudSizeBonus", "aoeCloudSize"), ("aoeVelocityBonus", "aoeVelocity"), ("missileVelocityBonus", "maxVelocity"), ("explosionDelayBonus", "explosionDelay"), ): - fit.modules.filteredChargeBoost(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"), + fit.modules.filteredChargeBoost(lambda mod: mod.charge.group.name in missileGroups, tgtAttr, container.getModifiedItemAttr(srcAttr), stackingPenalties=True) diff --git a/eos/effects/structurewarpscrambleblockmwdwithnpceffect.py b/eos/effects/structurewarpscrambleblockmwdwithnpceffect.py index 283a1451f..aee7b22f9 100644 --- a/eos/effects/structurewarpscrambleblockmwdwithnpceffect.py +++ b/eos/effects/structurewarpscrambleblockmwdwithnpceffect.py @@ -7,12 +7,11 @@ type = "projected", "active" def handler(fit, module, context): - if "projected" not in context: - return - - fit.ship.increaseItemAttr("warpScrambleStatus", module.getModifiedItemAttr("warpScrambleStrength")) - - # this is such a dirty hack - for mod in fit.modules: - if not mod.isEmpty and mod.item.requiresSkill("High Speed Maneuvering") and mod.state > State.ONLINE: - mod.state = State.ONLINE + if "projected" in context: + fit.ship.increaseItemAttr("warpScrambleStatus", module.getModifiedItemAttr("warpScrambleStrength")) + if module.charge is not None and module.charge.ID == 47336: + for mod in fit.modules: + if not mod.isEmpty and mod.item.requiresSkill("High Speed Maneuvering") and mod.state > State.ONLINE: + mod.state = State.ONLINE + if not mod.isEmpty and mod.item.requiresSkill("Micro Jump Drive Operation") and mod.state > State.ONLINE: + mod.state = State.ONLINE diff --git a/eos/effects/warpdisruptsphere.py b/eos/effects/warpdisruptsphere.py index 4a6d788e9..22787465b 100644 --- a/eos/effects/warpdisruptsphere.py +++ b/eos/effects/warpdisruptsphere.py @@ -1,3 +1,4 @@ + # warpDisruptSphere # # Used by: @@ -9,18 +10,22 @@ runTime = "early" def handler(fit, module, context): - fit.ship.boostItemAttr("mass", module.getModifiedItemAttr("massBonusPercentage")) - fit.ship.boostItemAttr("signatureRadius", module.getModifiedItemAttr("signatureRadiusBonus")) - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Propulsion Module", - "speedBoostFactor", module.getModifiedItemAttr("speedBoostFactorBonus")) - fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Propulsion Module", - "speedFactor", module.getModifiedItemAttr("speedFactorBonus")) - fit.ship.forceItemAttr("disallowAssistance", 1) if "projected" in context: fit.ship.increaseItemAttr("warpScrambleStatus", module.getModifiedItemAttr("warpScrambleStrength")) - if module.charge is not None and module.charge.ID == 45010: for mod in fit.modules: if not mod.isEmpty and mod.item.requiresSkill("High Speed Maneuvering") and mod.state > State.ONLINE: mod.state = State.ONLINE + if not mod.isEmpty and mod.item.requiresSkill("Micro Jump Drive Operation") and mod.state > State.ONLINE: + mod.state = State.ONLINE + else: + if module.charge is None: + fit.ship.boostItemAttr("mass", module.getModifiedItemAttr("massBonusPercentage")) + fit.ship.boostItemAttr("signatureRadius", module.getModifiedItemAttr("signatureRadiusBonus")) + fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Propulsion Module", + "speedBoostFactor", module.getModifiedItemAttr("speedBoostFactorBonus")) + fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Propulsion Module", + "speedFactor", module.getModifiedItemAttr("speedFactorBonus")) + + fit.ship.forceItemAttr("disallowAssistance", 1) diff --git a/eos/effects/warpscrambleblockmwdwithnpceffect.py b/eos/effects/warpscrambleblockmwdwithnpceffect.py index d5144a4a2..f8241436d 100644 --- a/eos/effects/warpscrambleblockmwdwithnpceffect.py +++ b/eos/effects/warpscrambleblockmwdwithnpceffect.py @@ -18,3 +18,5 @@ def handler(fit, module, context): for mod in fit.modules: if not mod.isEmpty and mod.item.requiresSkill("High Speed Maneuvering") and mod.state > State.ONLINE: mod.state = State.ONLINE + if not mod.isEmpty and mod.item.requiresSkill("Micro Jump Drive Operation") and mod.state > State.ONLINE: + mod.state = State.ONLINE diff --git a/eos/saveddata/fit.py b/eos/saveddata/fit.py index 67fb1f28e..fa9432291 100644 --- a/eos/saveddata/fit.py +++ b/eos/saveddata/fit.py @@ -1084,7 +1084,7 @@ class Fit(object): def calculateSustainableTank(self, effective=True): if self.__sustainableTank is None: - if self.capStable: + if self.capStable and not self.factorReload: sustainable = { "armorRepair" : self.extraAttributes["armorRepair"], "shieldRepair": self.extraAttributes["shieldRepair"], @@ -1142,16 +1142,34 @@ class Fit(object): usesCap = False except AttributeError: usesCap = False - # Modules which do not use cap are not penalized based on cap use - if usesCap: - cycleTime = mod.getModifiedItemAttr("duration") - amount = mod.getModifiedItemAttr(groupAttrMap[mod.item.group.name]) + + cycleTime = mod.rawCycleTime + amount = mod.getModifiedItemAttr(groupAttrMap[mod.item.group.name]) + # Normal Repairers + if usesCap and not mod.charge: sustainable[attr] -= amount / (cycleTime / 1000.0) repairers.append(mod) + # Ancillary Armor reps etc + elif usesCap and mod.charge: + if mod.charge.name == "Nanite Repair Paste": + multiplier = mod.getModifiedItemAttr("chargedArmorDamageMultiplier") or 1 + else: + multiplier = 1 + sustainable[attr] -= amount * multiplier / (cycleTime / 1000.0) + repairers.append(mod) + # Ancillary Shield boosters etc + elif not usesCap: + if self.factorReload and mod.charge: + reloadtime = mod.reloadTime + else: + reloadtime = 0.0 + offdutycycle = reloadtime / ((max(mod.numShots, 1) * cycleTime) + reloadtime) + sustainable[attr] -= amount * offdutycycle / (cycleTime / 1000.0) # Sort repairers by efficiency. We want to use the most efficient repairers first repairers.sort(key=lambda _mod: _mod.getModifiedItemAttr( - groupAttrMap[_mod.item.group.name]) / _mod.getModifiedItemAttr("capacitorNeed"), reverse=True) + groupAttrMap[_mod.item.group.name]) * (_mod.getModifiedItemAttr( + "chargedArmorDamageMultiplier") or 1) / _mod.getModifiedItemAttr("capacitorNeed"), reverse=True) # Loop through every module until we're above peak recharge # Most efficient first, as we sorted earlier. @@ -1160,15 +1178,35 @@ class Fit(object): for mod in repairers: if capUsed > totalPeakRecharge: break - cycleTime = mod.cycleTime + + if self.factorReload and mod.charge: + reloadtime = mod.reloadTime + else: + reloadtime = 0.0 + + cycleTime = mod.rawCycleTime capPerSec = mod.capUse + if capPerSec is not None and cycleTime is not None: # Check how much this repper can work sustainability = min(1, (totalPeakRecharge - capUsed) / capPerSec) - - # Add the sustainable amount amount = mod.getModifiedItemAttr(groupAttrMap[mod.item.group.name]) - sustainable[groupStoreMap[mod.item.group.name]] += sustainability * (amount / (cycleTime / 1000.0)) + # Add the sustainable amount + + if not mod.charge: + sustainable[groupStoreMap[mod.item.group.name]] += sustainability * amount / ( + cycleTime / 1000.0) + else: + if mod.charge.name == "Nanite Repair Paste": + multiplier = mod.getModifiedItemAttr("chargedArmorDamageMultiplier") or 1 + else: + multiplier = 1 + ondutycycle = (max(mod.numShots, 1) * cycleTime) / ( + (max(mod.numShots, 1) * cycleTime) + reloadtime) + sustainable[groupStoreMap[ + mod.item.group.name]] += sustainability * amount * ondutycycle * multiplier / ( + cycleTime / 1000.0) + capUsed += capPerSec sustainable["passiveShield"] = self.calculateShieldRecharge()