From 941c57b4a87eb5b1616b2575d050122155d14a18 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sun, 1 May 2016 16:45:19 -0400 Subject: [PATCH] Fix titan fleet bonii (#577) --- eos/effects/shipbonustitana4fleetbonus.py | 3 ++- eos/effects/shipbonustitanc4fleetbonus.py | 3 ++- eos/effects/shipbonustitang4fleetbonus.py | 3 ++- eos/effects/shipbonustitanm4fleetbonus.py | 3 ++- eos/saveddata/fleet.py | 10 ++++++++++ 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/eos/effects/shipbonustitana4fleetbonus.py b/eos/effects/shipbonustitana4fleetbonus.py index b169eedf2..b84dfd698 100644 --- a/eos/effects/shipbonustitana4fleetbonus.py +++ b/eos/effects/shipbonustitana4fleetbonus.py @@ -5,9 +5,10 @@ type = "gang" gangBoost = "rechargeRate" gangBonus = "shipBonusTitanA4" +gangBonusSkill = "Amarr Titan" runTime = "late" def handler(fit, src, context): if "gang" not in context: return - fit.ship.boostItemAttr(gangBoost, src.getModifiedItemAttr(gangBonus) * src.parent.character.getSkill("Amarr Titan").level) + fit.ship.boostItemAttr(gangBoost, src.getModifiedItemAttr(gangBonus) * src.parent.character.getSkill(gangBonusSkill).level) diff --git a/eos/effects/shipbonustitanc4fleetbonus.py b/eos/effects/shipbonustitanc4fleetbonus.py index d5e909333..c9d5aff1e 100644 --- a/eos/effects/shipbonustitanc4fleetbonus.py +++ b/eos/effects/shipbonustitanc4fleetbonus.py @@ -5,9 +5,10 @@ type = "gang" gangBoost = "shieldCapacity" gangBonus = "shipBonusTitanC4" +gangBonusSkill = "Caldari Titan" runTime = "late" def handler(fit, src, context): if "gang" not in context: return - fit.ship.boostItemAttr(gangBoost, src.getModifiedItemAttr(gangBonus) * src.parent.character.getSkill("Caldari Titan").level) + fit.ship.boostItemAttr(gangBoost, src.getModifiedItemAttr(gangBonus) * src.parent.character.getSkill(gangBonusSkill).level) diff --git a/eos/effects/shipbonustitang4fleetbonus.py b/eos/effects/shipbonustitang4fleetbonus.py index 69b16ed03..7edfdce02 100644 --- a/eos/effects/shipbonustitang4fleetbonus.py +++ b/eos/effects/shipbonustitang4fleetbonus.py @@ -5,9 +5,10 @@ type = "gang" gangBoost = "armorHP" gangBonus = "shipBonusTitanG4" +gangBonusSkill = "Gallente Titan" runTime = "late" def handler(fit, src, context): if "gang" not in context: return - fit.ship.boostItemAttr(gangBoost, src.getModifiedItemAttr(gangBonus) * src.parent.character.getSkill("Gallente Titan").level) + fit.ship.boostItemAttr(gangBoost, src.getModifiedItemAttr(gangBonus) * src.parent.character.getSkill(gangBonusSkill).level) diff --git a/eos/effects/shipbonustitanm4fleetbonus.py b/eos/effects/shipbonustitanm4fleetbonus.py index 4fc14259e..931775bb2 100644 --- a/eos/effects/shipbonustitanm4fleetbonus.py +++ b/eos/effects/shipbonustitanm4fleetbonus.py @@ -5,9 +5,10 @@ type = "gang" gangBoost = "signatureRadius" gangBonus = "shipBonusTitanM4" +gangBonusSkill = "Minmatar Titan" runTime = "late" def handler(fit, src, context): if "gang" not in context: return - fit.ship.boostItemAttr(gangBoost, src.getModifiedItemAttr(gangBonus) * src.parent.character.getSkill("Minmatar Titan").level) + fit.ship.boostItemAttr(gangBoost, src.getModifiedItemAttr(gangBonus) * src.parent.character.getSkill(gangBonusSkill).level) diff --git a/eos/saveddata/fleet.py b/eos/saveddata/fleet.py index c1db0e97e..12c1e78f1 100644 --- a/eos/saveddata/fleet.py +++ b/eos/saveddata/fleet.py @@ -207,9 +207,14 @@ class Squad(object): newBoostAttr = effect.getattr("gangBonus") or "commandBonus" # Get boost amount for current boost newBoostAmount = thing.getModifiedItemAttr(newBoostAttr) or 0 + # Skill used to modify the gang bonus (for purposes of comparing old vs new) + newBoostSkill = effect.getattr("gangBonusSkill") # If skill takes part in gang boosting, multiply by skill level if type(thing) == Skill: newBoostAmount *= thing.level + # boost the gang bonus based on skill noted in effect file + if newBoostSkill: + newBoostAmount *= thing.parent.character.getSkill(newBoostSkill).level # If new boost is more powerful, replace older one with it if abs(newBoostAmount) > abs(currBoostAmount): self.wing.gang.linearBoosts[boostedAttr] = (newBoostAmount, boostInfo) @@ -287,9 +292,14 @@ class Store(object): newBoostAttr = effect.getattr("gangBonus") or "commandBonus" # Get boost amount for current boost newBoostAmount = thing.getModifiedItemAttr(newBoostAttr) or 0 + # Skill used to modify the gang bonus (for purposes of comparing old vs new) + newBoostSkill = effect.getattr("gangBonusSkill") # If skill takes part in gang boosting, multiply by skill level if type(thing) == Skill: newBoostAmount *= thing.level + # boost the gang bonus based on skill noted in effect file + if newBoostSkill: + newBoostAmount *= thing.parent.character.getSkill(newBoostSkill).level # If new boost is more powerful, replace older one with it if abs(newBoostAmount) > abs(currBoostAmount): boosts[boostedAttr] = (newBoostAmount, boostInfo)