From 20a1618e4152823a1787e5f7baa95bc28b04946b Mon Sep 17 00:00:00 2001 From: burnsypet Date: Sun, 29 Oct 2017 20:40:39 +0000 Subject: [PATCH 1/5] Display warp core strength as warp speed tooltip Changes to antiwarpscramblingpassive.py: Fixed a typo of "warmScrambleStatus" to "warpScrambleStatus" Changes to targetingMiscViewMinimal.py: Extended existing tooltip to include warp core strength. Warp core strength is none for ships that do not have a hull bonus (venture etc.) or do not have any warp core stabs fitted so logic is added to default value to 0. Changes to targetingMiscViewFull.py: As above. --- eos/effects/antiwarpscramblingpassive.py | 2 +- gui/builtinStatsViews/targetingMiscViewFull.py | 16 ++++++++++++---- .../targetingMiscViewMinimal.py | 14 ++++++++++++-- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/eos/effects/antiwarpscramblingpassive.py b/eos/effects/antiwarpscramblingpassive.py index b6181e9a3..6a3165c0a 100644 --- a/eos/effects/antiwarpscramblingpassive.py +++ b/eos/effects/antiwarpscramblingpassive.py @@ -6,4 +6,4 @@ type = "passive" def handler(fit, module, context): - fit.ship.increaseItemAttr("warmScrambleStatus", module.getModifiedItemAttr("warpScrambleStrength")) + fit.ship.increaseItemAttr("warpScrambleStatus", module.getModifiedItemAttr("warpScrambleStrength")) diff --git a/gui/builtinStatsViews/targetingMiscViewFull.py b/gui/builtinStatsViews/targetingMiscViewFull.py index 1fa235ba0..7355031b9 100644 --- a/gui/builtinStatsViews/targetingMiscViewFull.py +++ b/gui/builtinStatsViews/targetingMiscViewFull.py @@ -197,7 +197,12 @@ class TargetingMiscViewFull(StatsView): elif labelName == "labelFullSigRadius": label.SetToolTip(wx.ToolTip("Probe Size: %.3f" % (fit.probeSize or 0))) elif labelName == "labelFullWarpSpeed": - label.SetToolTip(wx.ToolTip("Max Warp Distance: %.1f AU" % fit.maxWarpDistance)) + maxWarpDistance = "Max Warp Distance: %.1f AU" % fit.maxWarpDistance + if fit.ship.getModifiedItemAttr("warpScrambleStatus"): + warpScrambleStatus = "Warp Core Strength: %.1f" % abs(fit.ship.getModifiedItemAttr("warpScrambleStatus")) + else: + warpScrambleStatus = "Warp Core Strength: %.1f" % 0 + label.SetToolTip(wx.ToolTip("%s\n%s" % (maxWarpDistance, warpScrambleStatus))) elif labelName == "labelSensorStr": if fit.jamChance > 0: label.SetToolTip( @@ -222,9 +227,12 @@ class TargetingMiscViewFull(StatsView): self._cachedValues[counter] = newValues elif labelName == "labelFullWarpSpeed": if fit: - label.SetToolTip(wx.ToolTip("Max Warp Distance: %.1f AU" % fit.maxWarpDistance)) - else: - label.SetToolTip(wx.ToolTip("")) + maxWarpDistance = "Max Warp Distance: %.1f AU" % fit.maxWarpDistance + if fit.ship.getModifiedItemAttr("warpScrambleStatus"): + warpScrambleStatus = "Warp Core Strength: %.1f" % abs(fit.ship.getModifiedItemAttr("warpScrambleStatus")) + else: + warpScrambleStatus = "Warp Core Strength: %.1f" % 0 + label.SetToolTip(wx.ToolTip("%s\n%s" % (maxWarpDistance, warpScrambleStatus))) elif labelName == "labelSensorStr": if fit: if fit.jamChance > 0: diff --git a/gui/builtinStatsViews/targetingMiscViewMinimal.py b/gui/builtinStatsViews/targetingMiscViewMinimal.py index df0d9f70a..6d019dd8d 100644 --- a/gui/builtinStatsViews/targetingMiscViewMinimal.py +++ b/gui/builtinStatsViews/targetingMiscViewMinimal.py @@ -192,7 +192,12 @@ class TargetingMiscViewMinimal(StatsView): lockTime += "%5s\t%s\n" % (left, right) label.SetToolTip(wx.ToolTip(lockTime)) elif labelName == "labelFullWarpSpeed": - label.SetToolTip(wx.ToolTip("Max Warp Distance: %.1f AU" % fit.maxWarpDistance)) + maxWarpDistance = "Max Warp Distance: %.1f AU" % fit.maxWarpDistance + if fit.ship.getModifiedItemAttr("warpScrambleStatus"): + warpScrambleStatus = "Warp Core Strength: %.1f" % abs(fit.ship.getModifiedItemAttr("warpScrambleStatus")) + else: + warpScrambleStatus = "Warp Core Strength: %.1f" % 0 + label.SetToolTip(wx.ToolTip("%s\n%s" % (maxWarpDistance, warpScrambleStatus))) elif labelName == "labelSensorStr": if fit.jamChance > 0: label.SetToolTip(wx.ToolTip("Type: %s\n%.1f%% Chance of Jam" % (fit.scanType, fit.jamChance))) @@ -216,7 +221,12 @@ class TargetingMiscViewMinimal(StatsView): self._cachedValues[counter] = newValues elif labelName == "labelFullWarpSpeed": if fit: - label.SetToolTip(wx.ToolTip("Max Warp Distance: %.1f AU" % fit.maxWarpDistance)) + maxWarpDistance = "Max Warp Distance: %.1f AU" % fit.maxWarpDistance + if fit.ship.getModifiedItemAttr("warpScrambleStatus"): + warpScrambleStatus = "Warp Core Strength: %.1f" % abs(fit.ship.getModifiedItemAttr("warpScrambleStatus")) + else: + warpScrambleStatus = "Warp Core Strength: %.1f" % 0 + label.SetToolTip(wx.ToolTip("%s\n%s" % (maxWarpDistance, warpScrambleStatus))) else: label.SetToolTip(wx.ToolTip("")) elif labelName == "labelSensorStr": From d522fff511f59ddf3f2b3a4d4799fab4647dd2d3 Mon Sep 17 00:00:00 2001 From: burnsypet Date: Mon, 30 Oct 2017 21:05:46 +0000 Subject: [PATCH 2/5] Add projected warp strength to scrams Changes to effects: Added warp strength projected effects to all kinds of warp disruption modules except for WDFG (this will need some more thinking). Fixed a bug where warp disruptors appeared to reduce the warp strength of the ship they were fitted to Changes to targetingMiscView*.py: Replaced abs() with multiplication by -1 where appropriate --- eos/effects/structurewarpscrambleblockmwdwithnpceffect.py | 3 +++ eos/effects/warpscramble.py | 3 ++- eos/effects/warpscrambleblockmwdwithnpceffect.py | 4 +++- gui/builtinStatsViews/targetingMiscViewFull.py | 4 ++-- gui/builtinStatsViews/targetingMiscViewMinimal.py | 4 ++-- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/eos/effects/structurewarpscrambleblockmwdwithnpceffect.py b/eos/effects/structurewarpscrambleblockmwdwithnpceffect.py index 4103b3f42..283a1451f 100644 --- a/eos/effects/structurewarpscrambleblockmwdwithnpceffect.py +++ b/eos/effects/structurewarpscrambleblockmwdwithnpceffect.py @@ -9,6 +9,9 @@ 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: diff --git a/eos/effects/warpscramble.py b/eos/effects/warpscramble.py index 7aa194099..7424625ae 100644 --- a/eos/effects/warpscramble.py +++ b/eos/effects/warpscramble.py @@ -6,4 +6,5 @@ type = "projected", "active" def handler(fit, module, context): - fit.ship.increaseItemAttr("warpScrambleStatus", module.getModifiedItemAttr("warpScrambleStrength")) + if "projected" in context: + fit.ship.increaseItemAttr("warpScrambleStatus", module.getModifiedItemAttr("warpScrambleStrength")) diff --git a/eos/effects/warpscrambleblockmwdwithnpceffect.py b/eos/effects/warpscrambleblockmwdwithnpceffect.py index 1e417b710..d5144a4a2 100644 --- a/eos/effects/warpscrambleblockmwdwithnpceffect.py +++ b/eos/effects/warpscrambleblockmwdwithnpceffect.py @@ -2,7 +2,6 @@ # # Used by: # Modules named like: Warp Scrambler (26 of 26) - from eos.saveddata.module import State runTime = "early" @@ -12,6 +11,9 @@ 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: diff --git a/gui/builtinStatsViews/targetingMiscViewFull.py b/gui/builtinStatsViews/targetingMiscViewFull.py index 7355031b9..0ee84b9dd 100644 --- a/gui/builtinStatsViews/targetingMiscViewFull.py +++ b/gui/builtinStatsViews/targetingMiscViewFull.py @@ -199,7 +199,7 @@ class TargetingMiscViewFull(StatsView): elif labelName == "labelFullWarpSpeed": maxWarpDistance = "Max Warp Distance: %.1f AU" % fit.maxWarpDistance if fit.ship.getModifiedItemAttr("warpScrambleStatus"): - warpScrambleStatus = "Warp Core Strength: %.1f" % abs(fit.ship.getModifiedItemAttr("warpScrambleStatus")) + warpScrambleStatus = "Warp Core Strength: %.1f" % (fit.ship.getModifiedItemAttr("warpScrambleStatus") * -1) else: warpScrambleStatus = "Warp Core Strength: %.1f" % 0 label.SetToolTip(wx.ToolTip("%s\n%s" % (maxWarpDistance, warpScrambleStatus))) @@ -229,7 +229,7 @@ class TargetingMiscViewFull(StatsView): if fit: maxWarpDistance = "Max Warp Distance: %.1f AU" % fit.maxWarpDistance if fit.ship.getModifiedItemAttr("warpScrambleStatus"): - warpScrambleStatus = "Warp Core Strength: %.1f" % abs(fit.ship.getModifiedItemAttr("warpScrambleStatus")) + warpScrambleStatus = "Warp Core Strength: %.1f" % (fit.ship.getModifiedItemAttr("warpScrambleStatus") * -1) else: warpScrambleStatus = "Warp Core Strength: %.1f" % 0 label.SetToolTip(wx.ToolTip("%s\n%s" % (maxWarpDistance, warpScrambleStatus))) diff --git a/gui/builtinStatsViews/targetingMiscViewMinimal.py b/gui/builtinStatsViews/targetingMiscViewMinimal.py index 6d019dd8d..489aacf52 100644 --- a/gui/builtinStatsViews/targetingMiscViewMinimal.py +++ b/gui/builtinStatsViews/targetingMiscViewMinimal.py @@ -194,7 +194,7 @@ class TargetingMiscViewMinimal(StatsView): elif labelName == "labelFullWarpSpeed": maxWarpDistance = "Max Warp Distance: %.1f AU" % fit.maxWarpDistance if fit.ship.getModifiedItemAttr("warpScrambleStatus"): - warpScrambleStatus = "Warp Core Strength: %.1f" % abs(fit.ship.getModifiedItemAttr("warpScrambleStatus")) + warpScrambleStatus = "Warp Core Strength: %.1f" % (fit.ship.getModifiedItemAttr("warpScrambleStatus") * -1) else: warpScrambleStatus = "Warp Core Strength: %.1f" % 0 label.SetToolTip(wx.ToolTip("%s\n%s" % (maxWarpDistance, warpScrambleStatus))) @@ -223,7 +223,7 @@ class TargetingMiscViewMinimal(StatsView): if fit: maxWarpDistance = "Max Warp Distance: %.1f AU" % fit.maxWarpDistance if fit.ship.getModifiedItemAttr("warpScrambleStatus"): - warpScrambleStatus = "Warp Core Strength: %.1f" % abs(fit.ship.getModifiedItemAttr("warpScrambleStatus")) + warpScrambleStatus = "Warp Core Strength: %.1f" % (fit.ship.getModifiedItemAttr("warpScrambleStatus") * -1) else: warpScrambleStatus = "Warp Core Strength: %.1f" % 0 label.SetToolTip(wx.ToolTip("%s\n%s" % (maxWarpDistance, warpScrambleStatus))) From ea6f31c0219611efaf0a7a8a5a6630c9aadb6303 Mon Sep 17 00:00:00 2001 From: burnsypet Date: Wed, 1 Nov 2017 22:55:05 +0000 Subject: [PATCH 3/5] Added disruption effect for WDFG --- eos/effects/warpdisruptsphere.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eos/effects/warpdisruptsphere.py b/eos/effects/warpdisruptsphere.py index 3fe88bd13..257706827 100644 --- a/eos/effects/warpdisruptsphere.py +++ b/eos/effects/warpdisruptsphere.py @@ -2,7 +2,7 @@ # # Used by: # Modules from group: Warp Disrupt Field Generator (7 of 7) -type = "active" +type = "projected", "active" runTime = "early" @@ -14,3 +14,6 @@ def handler(fit, module, context): 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")) From 866d4106958da2264eeefbea643ca6ac5f5ee313 Mon Sep 17 00:00:00 2001 From: burnsypet Date: Wed, 1 Nov 2017 23:27:34 +0000 Subject: [PATCH 4/5] Added logic for WDFG MWD scrambling --- eos/effects/warpdisruptsphere.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/eos/effects/warpdisruptsphere.py b/eos/effects/warpdisruptsphere.py index 257706827..433ae319c 100644 --- a/eos/effects/warpdisruptsphere.py +++ b/eos/effects/warpdisruptsphere.py @@ -2,6 +2,8 @@ # # Used by: # Modules from group: Warp Disrupt Field Generator (7 of 7) +from eos.saveddata.module import State + type = "projected", "active" runTime = "early" @@ -17,3 +19,10 @@ 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: + pyfalog.debug("ALEX: charge is: {0} id is = {1}, so do MWD scrambling", module.charge.name, module.charge.ID) + # 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 From a02bbe39648fa99ed2580959c062fa29ae17294b Mon Sep 17 00:00:00 2001 From: burnsypet Date: Wed, 1 Nov 2017 23:31:17 +0000 Subject: [PATCH 5/5] Removed traces --- eos/effects/warpdisruptsphere.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/eos/effects/warpdisruptsphere.py b/eos/effects/warpdisruptsphere.py index 433ae319c..4a6d788e9 100644 --- a/eos/effects/warpdisruptsphere.py +++ b/eos/effects/warpdisruptsphere.py @@ -21,8 +21,6 @@ def handler(fit, module, context): fit.ship.increaseItemAttr("warpScrambleStatus", module.getModifiedItemAttr("warpScrambleStrength")) if module.charge is not None and module.charge.ID == 45010: - pyfalog.debug("ALEX: charge is: {0} id is = {1}, so do MWD scrambling", module.charge.name, module.charge.ID) - # 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