From 4fc93f70896f998b517c2bf8427a0f84389d95fd Mon Sep 17 00:00:00 2001 From: Neugeniko Date: Sat, 17 Mar 2018 09:39:50 +1100 Subject: [PATCH 1/9] Respect 'Factor in Reload' preference for sustainable tank (tidied up). --- eos/saveddata/fit.py | 59 ++++++++++++++++++++++++++++++++++++-------- 1 file changed, 49 insertions(+), 10 deletions(-) diff --git a/eos/saveddata/fit.py b/eos/saveddata/fit.py index efb094966..a096a1e72 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,35 @@ 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 +1179,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() From e1e90cc23e02e208256364d63ff587a57a9f3738 Mon Sep 17 00:00:00 2001 From: Neugeniko Date: Sat, 17 Mar 2018 13:43:19 +1100 Subject: [PATCH 2/9] pep 8 --- eos/saveddata/fit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eos/saveddata/fit.py b/eos/saveddata/fit.py index a096a1e72..61202fdac 100644 --- a/eos/saveddata/fit.py +++ b/eos/saveddata/fit.py @@ -1169,8 +1169,8 @@ class Fit(object): # 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( - "chargedArmorDamageMultiplier") or 1) - / _mod.getModifiedItemAttr("capacitorNeed"), reverse=True) + "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. From 96b701687b89ea76157d07ffd80b1c2d28d45314 Mon Sep 17 00:00:00 2001 From: Neugeniko Date: Sat, 17 Mar 2018 13:53:03 +1100 Subject: [PATCH 3/9] pep 8 --- eos/saveddata/fit.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/eos/saveddata/fit.py b/eos/saveddata/fit.py index 61202fdac..77726c7bc 100644 --- a/eos/saveddata/fit.py +++ b/eos/saveddata/fit.py @@ -1169,8 +1169,7 @@ class Fit(object): # 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( - "chargedArmorDamageMultiplier") or 1) - / _mod.getModifiedItemAttr("capacitorNeed"), reverse=True) + "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. From 5f1c2d6676829aa610178f9d4479b40421d00f31 Mon Sep 17 00:00:00 2001 From: Neugeniko Date: Wed, 7 Mar 2018 15:25:57 +1100 Subject: [PATCH 4/9] Redefine Warp Disruption Field Generators operation If we are applying effects onto our self, disallowAssistance all the time, and go into low mass/high sig etc mode when no script is loaded. If we are projecting effects, modify warpScrambleStatus all the time, and turn off modules requiring 'High Speed Maneuvering' (MWDs) or "Micro Jump Drive Operation" (MJD etc) if a scrambling script is loaded. (cherry picked from commit 77a66a66ea9360f76d09b1c15fbab12e367e1855) --- eos/effects/warpdisruptsphere.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/eos/effects/warpdisruptsphere.py b/eos/effects/warpdisruptsphere.py index 4a6d788e9..7cddfcb86 100644 --- a/eos/effects/warpdisruptsphere.py +++ b/eos/effects/warpdisruptsphere.py @@ -1,3 +1,4 @@ + # warpDisruptSphere # # Used by: @@ -9,18 +10,23 @@ 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) From 3fda62e32005daf6a4dd7efe8b0a9fe8d299b68e Mon Sep 17 00:00:00 2001 From: Neugeniko Date: Wed, 7 Mar 2018 15:27:53 +1100 Subject: [PATCH 5/9] Redefne structure mounted disruptor operation If we are projecting effects, modify warpScrambleStatus all the time, and turn off modules requiring 'High Speed Maneuvering' (MWDs) or "Micro Jump Drive Operation" (MJD etc) if a scrambling script is loaded. (cherry picked from commit 0994158abdf8f452beeee0fe081b612bd7cec042) --- ...tructurewarpscrambleblockmwdwithnpceffect.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) 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 From 0713251685daacc4c518c753e01c7134106164f6 Mon Sep 17 00:00:00 2001 From: Neugeniko Date: Wed, 7 Mar 2018 15:29:31 +1100 Subject: [PATCH 6/9] Redefine scrambler operation. If we are projecting effects, modify warpScrambleStatus all the time, and turn off modules requiring 'High Speed Maneuvering' (MWDs) or "Micro Jump Drive Operation" (MJD etc) if a scrambling script is loaded. (cherry picked from commit 04c62aabeab9c3abf982c5a82421fc9d10dee928) --- eos/effects/warpscrambleblockmwdwithnpceffect.py | 2 ++ 1 file changed, 2 insertions(+) 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 From 0f7dd7cc0ce97f78868d558b5ee4c0db66ce0692 Mon Sep 17 00:00:00 2001 From: Neugeniko Date: Sat, 10 Mar 2018 00:50:58 +1100 Subject: [PATCH 7/9] Correct the structure guidance enhancers to apply bonuses to relevant charges. (cherry picked from commit 5c20ee7ade37fa2df17c640f4a016d8178fbe92b) --- eos/effects/structuremissileguidanceenhancer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) From 68e5b22fe2444bef185a01d0955606f6f9f0422a Mon Sep 17 00:00:00 2001 From: Neugeniko Date: Sat, 10 Mar 2018 10:08:22 +1100 Subject: [PATCH 8/9] Implement effect for Standup Warp Disruption Burst Projector. Make active so we can see its effect on capacitor. (cherry picked from commit 03c2088e6b0f786fa7d68a5d61817e6e60aa1258) --- eos/effects/doomsdayaoebubble.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 eos/effects/doomsdayaoebubble.py 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 From 329338051539dc498e9af59f1f8cde0fed3aa542 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sat, 24 Mar 2018 18:18:16 -0400 Subject: [PATCH 9/9] styling fix --- eos/effects/warpdisruptsphere.py | 1 - 1 file changed, 1 deletion(-) diff --git a/eos/effects/warpdisruptsphere.py b/eos/effects/warpdisruptsphere.py index 7cddfcb86..22787465b 100644 --- a/eos/effects/warpdisruptsphere.py +++ b/eos/effects/warpdisruptsphere.py @@ -11,7 +11,6 @@ runTime = "early" def handler(fit, module, context): - if "projected" in context: fit.ship.increaseItemAttr("warpScrambleStatus", module.getModifiedItemAttr("warpScrambleStrength")) if module.charge is not None and module.charge.ID == 45010: