From 97742b08c80b6bdd67f3569691d202a5667c82c1 Mon Sep 17 00:00:00 2001 From: Neugeniko Date: Sun, 11 Mar 2018 21:38:46 +1100 Subject: [PATCH 01/21] Attribute disallowRepeatingAction has been renamed to disallowRepeatingActivation in the database. Make appropriate modification to instances of this attribute name in code. (cherry picked from commit ff607e4b03dd0a89cf8cdc7ccd61a60b9964cbb3) --- eos/saveddata/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eos/saveddata/module.py b/eos/saveddata/module.py index 7d70045db..17917287d 100644 --- a/eos/saveddata/module.py +++ b/eos/saveddata/module.py @@ -756,7 +756,7 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): @property def disallowRepeatingAction(self): - return self.getModifiedItemAttr("disallowRepeatingAction", 0) + return self.getModifiedItemAttr("disallowRepeatingActivation", 0) @property def reactivationDelay(self): From 1513b070715b92271d7b1d44d4079df2ea31869c Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sun, 11 Mar 2018 19:40:38 -0400 Subject: [PATCH 02/21] set cargo amoutninput to select all instead of inserstion end --- gui/builtinContextMenus/amount.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gui/builtinContextMenus/amount.py b/gui/builtinContextMenus/amount.py index 6484595eb..ed23e606a 100644 --- a/gui/builtinContextMenus/amount.py +++ b/gui/builtinContextMenus/amount.py @@ -72,6 +72,7 @@ class AmountChanger(wx.Dialog): self.input = wx.TextCtrl(self, wx.ID_ANY, style=wx.TE_PROCESS_ENTER) self.input.SetValue(str(value)) + self.input.SelectAll() bSizer1.Add(self.input, 0, wx.LEFT | wx.RIGHT | wx.EXPAND, 15) @@ -82,7 +83,6 @@ class AmountChanger(wx.Dialog): bSizer1.Add(bSizer3, 0, wx.ALL | wx.EXPAND, 10) self.input.SetFocus() - self.input.SetInsertionPointEnd() self.input.Bind(wx.EVT_CHAR, self.onChar) self.input.Bind(wx.EVT_TEXT_ENTER, self.processEnter) self.SetSizer(bSizer1) From da7b95041d360499e6fb30d3f877d81103f1c2dc Mon Sep 17 00:00:00 2001 From: Neugeniko Date: Wed, 14 Mar 2018 13:40:31 +1100 Subject: [PATCH 03/21] Allow variable reload time in CapSim. --- eos/capSim.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/eos/capSim.py b/eos/capSim.py index d57567ae6..0c806f1a3 100644 --- a/eos/capSim.py +++ b/eos/capSim.py @@ -71,7 +71,7 @@ class CapSimulator(object): disable_period = False # Loop over modules, clearing clipSize if applicable, and group modules based on attributes - for (duration, capNeed, clipSize, disableStagger) in self.modules: + for (duration, capNeed, clipSize, disableStagger, reloadTime) in self.modules: if self.scale: duration, capNeed = self.scale_activation(duration, capNeed) @@ -81,22 +81,22 @@ class CapSimulator(object): clipSize = 0 # Group modules based on their properties - if (duration, capNeed, clipSize, disableStagger) in mods: - mods[(duration, capNeed, clipSize, disableStagger)] += 1 + if (duration, capNeed, clipSize, disableStagger, reloadTime) in mods: + mods[(duration, capNeed, clipSize, disableStagger, reloadTime)] += 1 else: - mods[(duration, capNeed, clipSize, disableStagger)] = 1 + mods[(duration, capNeed, clipSize, disableStagger, reloadTime)] = 1 # Loop over grouped modules, configure staggering and push to the simulation state - for (duration, capNeed, clipSize, disableStagger), amount in mods.iteritems(): + for (duration, capNeed, clipSize, disableStagger, reloadTime), amount in mods.iteritems(): if self.stagger and not disableStagger: if clipSize == 0: duration = int(duration / amount) else: - stagger_amount = (duration * clipSize + 10000) / (amount * clipSize) + stagger_amount = (duration * clipSize + reloadTime) / (amount * clipSize) for i in range(1, amount): heapq.heappush(self.state, [i * stagger_amount, duration, - capNeed, 0, clipSize]) + capNeed, 0, clipSize, reloadTime]) else: capNeed *= amount @@ -106,7 +106,7 @@ class CapSimulator(object): if clipSize: disable_period = True - heapq.heappush(self.state, [0, duration, capNeed, 0, clipSize]) + heapq.heappush(self.state, [0, duration, capNeed, 0, clipSize, reloadTime]) if disable_period: self.period = self.t_max @@ -143,7 +143,7 @@ class CapSimulator(object): while 1: activation = pop(state) - t_now, duration, capNeed, shot, clipSize = activation + t_now, duration, capNeed, shot, clipSize, reloadTime = activation if t_now >= t_max: break @@ -179,7 +179,7 @@ class CapSimulator(object): if clipSize: if shot % clipSize == 0: shot = 0 - t_now += 10000 # include reload time + t_now += reloadTime # include reload time activation[0] = t_now activation[3] = shot From 044e032ab3ecec5332c231d17467a8875749dfac Mon Sep 17 00:00:00 2001 From: Neugeniko Date: Wed, 14 Mar 2018 13:40:49 +1100 Subject: [PATCH 04/21] Allow variable reload time in CapSim. --- eos/saveddata/fit.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/eos/saveddata/fit.py b/eos/saveddata/fit.py index efb094966..67fb1f28e 100644 --- a/eos/saveddata/fit.py +++ b/eos/saveddata/fit.py @@ -1186,7 +1186,7 @@ class Fit(object): rechargeRate = self.ship.getModifiedItemAttr("shieldRechargeRate") / 1000.0 return 10 / rechargeRate * sqrt(percent) * (1 - sqrt(percent)) * capacity - def addDrain(self, src, cycleTime, capNeed, clipSize=0): + def addDrain(self, src, cycleTime, capNeed, clipSize=0, reloadTime=0): """ Used for both cap drains and cap fills (fills have negative capNeed) """ energyNeutralizerSignatureResolution = src.getModifiedItemAttr("energyNeutralizerSignatureResolution") @@ -1196,7 +1196,7 @@ class Fit(object): if energyNeutralizerSignatureResolution: capNeed = capNeed * min(1, signatureRadius / energyNeutralizerSignatureResolution) - self.__extraDrains.append((cycleTime, capNeed, clipSize)) + self.__extraDrains.append((cycleTime, capNeed, clipSize, reloadTime)) def removeDrain(self, i): del self.__extraDrains[i] @@ -1214,6 +1214,7 @@ class Fit(object): cycleTime = mod.rawCycleTime or 0 reactivationTime = mod.getModifiedItemAttr("moduleReactivationDelay") or 0 fullCycleTime = cycleTime + reactivationTime + reloadTime = mod.reloadTime if fullCycleTime > 0: capNeed = mod.capUse if capNeed > 0: @@ -1225,11 +1226,11 @@ class Fit(object): disableStagger = mod.hardpoint == Hardpoint.TURRET drains.append((int(fullCycleTime), mod.getModifiedItemAttr("capacitorNeed") or 0, - mod.numShots or 0, disableStagger)) + mod.numShots or 0, disableStagger, reloadTime)) - for fullCycleTime, capNeed, clipSize in self.iterDrains(): + for fullCycleTime, capNeed, clipSize, reloadTime in self.iterDrains(): # Stagger incoming effects for cap simulation - drains.append((int(fullCycleTime), capNeed, clipSize, False)) + drains.append((int(fullCycleTime), capNeed, clipSize, False, reloadTime)) if capNeed > 0: capUsed += capNeed / (fullCycleTime / 1000.0) else: From 023ea43611ceec0ab3fcc7b5ced0af5d6179d080 Mon Sep 17 00:00:00 2001 From: Neugeniko Date: Wed, 14 Mar 2018 15:39:20 +1100 Subject: [PATCH 05/21] Divide by numShots not need as we do that below. --- eos/saveddata/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eos/saveddata/module.py b/eos/saveddata/module.py index 17917287d..642309aef 100644 --- a/eos/saveddata/module.py +++ b/eos/saveddata/module.py @@ -723,7 +723,7 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): Currently would apply to bomb launchers and defender missiles """ - effective_reload_time = ((self.reactivationDelay * (numShots - 1)) + max(raw_reload_time, self.reactivationDelay, 0)) / numShots + effective_reload_time = ((self.reactivationDelay * (numShots - 1)) + max(raw_reload_time, self.reactivationDelay, 0)) else: """ Applies to MJD/MJFG From 61086989dc90d879af2239e0add135952d02f8c0 Mon Sep 17 00:00:00 2001 From: Neugeniko Date: Wed, 14 Mar 2018 16:04:15 +1100 Subject: [PATCH 06/21] Need to wait speed + reactivation delay between void bomb. --- eos/effects/usemissiles.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eos/effects/usemissiles.py b/eos/effects/usemissiles.py index d77c56e3e..57a58372b 100644 --- a/eos/effects/usemissiles.py +++ b/eos/effects/usemissiles.py @@ -15,12 +15,13 @@ def handler(fit, src, context): if src.item.group.name == 'Missile Launcher Bomb': # Bomb Launcher Cooldown Timer moduleReactivationDelay = src.getModifiedItemAttr("moduleReactivationDelay") + speed = src.getModifiedItemAttr("speed") # Void and Focused Void Bombs neutAmount = src.getModifiedChargeAttr("energyNeutralizerAmount") - if moduleReactivationDelay and neutAmount: - fit.addDrain(src, moduleReactivationDelay, neutAmount, 0) + if moduleReactivationDelay and neutAmount and speed: + fit.addDrain(src, speed + moduleReactivationDelay, neutAmount, 0) # Lockbreaker Bombs ecmStrengthBonus = src.getModifiedChargeAttr("scan{0}StrengthBonus".format(fit.scanType)) From 234f36c8c0a33bd00bfe397744496bc18e27415e Mon Sep 17 00:00:00 2001 From: Neugeniko Date: Fri, 16 Mar 2018 15:57:14 +1100 Subject: [PATCH 07/21] Zero reload times when reloads are off so we can group modules with normally different reload times. --- eos/capSim.py | 1 + 1 file changed, 1 insertion(+) diff --git a/eos/capSim.py b/eos/capSim.py index 0c806f1a3..3a2f965c3 100644 --- a/eos/capSim.py +++ b/eos/capSim.py @@ -79,6 +79,7 @@ class CapSimulator(object): # a cap booster module. if not self.reload and capNeed > 0: clipSize = 0 + reloadTime = 0 # Group modules based on their properties if (duration, capNeed, clipSize, disableStagger, reloadTime) in mods: From 4fc93f70896f998b517c2bf8427a0f84389d95fd Mon Sep 17 00:00:00 2001 From: Neugeniko Date: Sat, 17 Mar 2018 09:39:50 +1100 Subject: [PATCH 08/21] 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 65ec8cf4ee18191d562fe74f02529a01ace257cd Mon Sep 17 00:00:00 2001 From: Neugeniko Date: Sat, 17 Mar 2018 11:44:29 +1100 Subject: [PATCH 09/21] Take into consideration reactivation time for non repeatable modules like the assault DC and MJD when calculating their 'actual' cycle time. --- eos/saveddata/module.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eos/saveddata/module.py b/eos/saveddata/module.py index 17917287d..5d58f7d93 100644 --- a/eos/saveddata/module.py +++ b/eos/saveddata/module.py @@ -713,7 +713,7 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): # Module can only fire one shot at a time, think bomb launchers or defender launchers if self.disallowRepeatingAction: - if numShots > 1: + if numShots > 0: """ The actual mechanics behind this is complex. Behavior will be (for 3 ammo): fire, reactivation delay, fire, reactivation delay, fire, max(reactivation delay, reload) @@ -729,6 +729,7 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): Applies to MJD/MJFG """ effective_reload_time = max(raw_reload_time, self.reactivationDelay, 0) + speed = speed + effective_reload_time else: """ Currently no other modules would have a reactivation delay, so for sanities sake don't try and account for it. From f41ecae8c8d1860da3561fdc210592673b40e563 Mon Sep 17 00:00:00 2001 From: Neugeniko Date: Sat, 17 Mar 2018 13:23:58 +1100 Subject: [PATCH 10/21] Add a minimal effects files for mjfg, lance dd's, reaper dd's, bosonic dd's and gtfo dd's. --- eos/effects/doomsdaybeamdot.py | 9 +++++++++ eos/effects/doomsdayconedot.py | 9 +++++++++ eos/effects/doomsdayhog.py | 9 +++++++++ eos/effects/doomsdayslash.py | 9 +++++++++ eos/effects/microjumpportaldrive.py | 9 +++++++++ 5 files changed, 45 insertions(+) create mode 100644 eos/effects/doomsdaybeamdot.py create mode 100644 eos/effects/doomsdayconedot.py create mode 100644 eos/effects/doomsdayhog.py create mode 100644 eos/effects/doomsdayslash.py create mode 100644 eos/effects/microjumpportaldrive.py diff --git a/eos/effects/doomsdaybeamdot.py b/eos/effects/doomsdaybeamdot.py new file mode 100644 index 000000000..fff941579 --- /dev/null +++ b/eos/effects/doomsdaybeamdot.py @@ -0,0 +1,9 @@ +# doomsdayBeamDOT +# +# Used by: +# Module: Lance type modules +type = "active" + + +def handler(fit, src, context): + pass diff --git a/eos/effects/doomsdayconedot.py b/eos/effects/doomsdayconedot.py new file mode 100644 index 000000000..3e92fb8f6 --- /dev/null +++ b/eos/effects/doomsdayconedot.py @@ -0,0 +1,9 @@ +# doomsdayConeDOT +# +# Used by: +# Module: Bosonic Field Generator +type = "active" + + +def handler(fit, src, context): + pass diff --git a/eos/effects/doomsdayhog.py b/eos/effects/doomsdayhog.py new file mode 100644 index 000000000..182d0c29f --- /dev/null +++ b/eos/effects/doomsdayhog.py @@ -0,0 +1,9 @@ +# doomsdayHOG +# +# Used by: +# Module: GTFO - Gravitational Transportation Field Oscillator +type = "active" + + +def handler(fit, src, context): + pass diff --git a/eos/effects/doomsdayslash.py b/eos/effects/doomsdayslash.py new file mode 100644 index 000000000..e6b55ede9 --- /dev/null +++ b/eos/effects/doomsdayslash.py @@ -0,0 +1,9 @@ +# doomsdaySlash +# +# Used by: +# Module: Reaper type modules +type = "active" + + +def handler(fit, src, context): + pass diff --git a/eos/effects/microjumpportaldrive.py b/eos/effects/microjumpportaldrive.py new file mode 100644 index 000000000..40925b491 --- /dev/null +++ b/eos/effects/microjumpportaldrive.py @@ -0,0 +1,9 @@ +# microJumpPortalDrive +# +# Used by: +# Module: MJFG - Micro Jump Field Generator (used on command destroyers) +type = "active" + + +def handler(fit, src, context): + pass From e1e90cc23e02e208256364d63ff587a57a9f3738 Mon Sep 17 00:00:00 2001 From: Neugeniko Date: Sat, 17 Mar 2018 13:43:19 +1100 Subject: [PATCH 11/21] 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 12/21] 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 687d53953478af17fd045b396094c2acbc43489e Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Thu, 15 Mar 2018 15:39:10 +1100 Subject: [PATCH 13/21] Enable misc info for doomsdays. --- gui/builtinViewColumns/misc.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/gui/builtinViewColumns/misc.py b/gui/builtinViewColumns/misc.py index e99e89eae..a3c84b4a7 100644 --- a/gui/builtinViewColumns/misc.py +++ b/gui/builtinViewColumns/misc.py @@ -76,6 +76,31 @@ class Miscellanea(ViewColumn): stuff.getModifiedItemAttr("boosterDuration") text = "{0} min".format(formatAmount(stuff.getModifiedItemAttr("boosterDuration") / 1000 / 60, 3, 0, 3)) return text, "Booster Duration" + elif itemGroup in ("Super Weapon", "Structure Doomsday Weapon"): + doomsday_duration = stuff.getModifiedItemAttr("doomsdayDamageDuration", 1) + doomsday_dottime = stuff.getModifiedItemAttr("doomsdayDamageCycleTime", 1) + func = stuff.getModifiedItemAttr + + volley = sum( + map( + lambda attr: (func("%sDamage" % attr) or 0), + ("em", "thermal", "kinetic", "explosive") + ) + ) + volley *= stuff.getModifiedItemAttr("damageMultiplier") or 1 + + if volley <= 0: + text = "" + tooltip = "" + elif max(doomsday_duration / doomsday_dottime, 1) > 1: + text = "{0} dmg over {1} s".format(formatAmount(volley * (doomsday_duration / doomsday_dottime), 3, 0, 3), doomsday_duration / 1000) + tooltip = "Raw damage done over time" + else: + text = "{0} dmg".format(formatAmount(volley * (doomsday_duration / doomsday_dottime), 3, 0, 3)) + tooltip = "Raw damage done" + return text, tooltip + + pass elif itemGroup in ("Energy Weapon", "Hybrid Weapon", "Projectile Weapon", "Combat Drone", "Fighter Drone"): trackingSpeed = stuff.getModifiedItemAttr("trackingSpeed") if not trackingSpeed: From 2f1ad2139210592c4fc0ccee4cccc445db75ddc0 Mon Sep 17 00:00:00 2001 From: Ebag333 Date: Thu, 15 Mar 2018 15:40:32 +1100 Subject: [PATCH 14/21] Calculate DPS for beam type doomsdays. --- eos/saveddata/module.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/eos/saveddata/module.py b/eos/saveddata/module.py index 17917287d..a7902129f 100644 --- a/eos/saveddata/module.py +++ b/eos/saveddata/module.py @@ -339,8 +339,15 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): volley *= self.getModifiedItemAttr("damageMultiplier") or 1 if volley: cycleTime = self.cycleTime + # Some weapons repeat multiple times in one cycle (think doomsdays) + # Get the number of times it fires off + weaponDoT = max( + self.getModifiedItemAttr("doomsdayDamageDuration", 1) / self.getModifiedItemAttr("doomsdayDamageCycleTime", 1), + 1 + ) + self.__volley = volley - self.__dps = volley / (cycleTime / 1000.0) + self.__dps = (volley * weaponDoT) / (cycleTime / 1000.0) return self.__dps, self.__volley From bd90ec4bf046c79a066dd836a9c67f4947aec060 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Wed, 21 Mar 2018 22:12:21 -0400 Subject: [PATCH 15/21] Don't fail an api update when a skill has been removed (#1473) --- eos/saveddata/character.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/eos/saveddata/character.py b/eos/saveddata/character.py index 1f911f57f..3c0e629d1 100644 --- a/eos/saveddata/character.py +++ b/eos/saveddata/character.py @@ -121,8 +121,12 @@ class Character(object): def apiUpdateCharSheet(self, skills, secStatus=0): for skillRow in skills: - skill = self.getSkill(int(skillRow["typeID"])) - skill.setLevel(int(skillRow["level"]), persist=True, ignoreRestrict=True) + try: + skill = self.getSkill(int(skillRow["typeID"])) + skill.setLevel(int(skillRow["level"]), persist=True, ignoreRestrict=True) + except: + # if setting a skill doesn't work, it's not the end of the world, just quietly pass + pass self.secStatus = secStatus From 5f1c2d6676829aa610178f9d4479b40421d00f31 Mon Sep 17 00:00:00 2001 From: Neugeniko Date: Wed, 7 Mar 2018 15:25:57 +1100 Subject: [PATCH 16/21] 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 17/21] 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 18/21] 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 19/21] 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 20/21] 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 21/21] 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: