diff --git a/config.py b/config.py index ebf698a92..72a68259d 100644 --- a/config.py +++ b/config.py @@ -18,8 +18,8 @@ debug = False saveInRoot = False # Version data -version = "1.14.0" -tag = "Stable" +version = "1.14.1" +tag = "git" expansionName = "Galatea" expansionVersion = "1.2" evemonMinVersion = "4081" diff --git a/eos/config.py b/eos/config.py index 35e2fe0dc..042605466 100644 --- a/eos/config.py +++ b/eos/config.py @@ -5,7 +5,7 @@ debug = False gamedataCache = True saveddataCache = True gamedata_connectionstring = 'sqlite:///' + unicode(realpath(join(dirname(abspath(__file__)), "..", "staticdata", "eve.db")), sys.getfilesystemencoding()) -saveddata_connectionstring = 'sqlite:///:memory:' +saveddata_connectionstring = 'sqlite:///' + unicode(realpath(join(dirname(abspath(__file__)), "..", "saveddata", "saveddata.db")), sys.getfilesystemencoding()) #Autodetect path, only change if the autodetection bugs out. path = dirname(unicode(__file__, sys.getfilesystemencoding())) diff --git a/eos/effects/elitebonusheavyinterdictorswarpdisruptfieldgeneratorwarpscramblerange2.py b/eos/effects/elitebonusheavyinterdictorswarpdisruptfieldgeneratorwarpscramblerange2.py index f73326783..edf638622 100644 --- a/eos/effects/elitebonusheavyinterdictorswarpdisruptfieldgeneratorwarpscramblerange2.py +++ b/eos/effects/elitebonusheavyinterdictorswarpdisruptfieldgeneratorwarpscramblerange2.py @@ -1,7 +1,7 @@ # eliteBonusHeavyInterdictorsWarpDisruptFieldGeneratorWarpScrambleRange2 # # Used by: -# Ships from group: Heavy Interdiction Cruiser (4 of 5) +# Ships from group: Heavy Interdiction Cruiser (5 of 5) type = "passive" def handler(fit, ship, context): fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Warp Disrupt Field Generator", diff --git a/eos/effects/interceptor2warpscramblerange.py b/eos/effects/interceptor2warpscramblerange.py index e188fe9c6..7e69a885f 100644 --- a/eos/effects/interceptor2warpscramblerange.py +++ b/eos/effects/interceptor2warpscramblerange.py @@ -1,7 +1,7 @@ # Interceptor2WarpScrambleRange # # Used by: -# Ships from group: Interceptor (5 of 10) +# Ships from group: Interceptor (6 of 10) type = "passive" def handler(fit, ship, context): fit.modules.filteredItemBoost(lambda mod: mod.item.group.name == "Warp Scrambler", diff --git a/eos/effects/interceptormwdsignatureradiusbonus.py b/eos/effects/interceptormwdsignatureradiusbonus.py index 8b52a1147..146fce80e 100644 --- a/eos/effects/interceptormwdsignatureradiusbonus.py +++ b/eos/effects/interceptormwdsignatureradiusbonus.py @@ -1,7 +1,7 @@ # interceptorMWDSignatureRadiusBonus # # Used by: -# Ships from group: Interceptor (9 of 10) +# Ships from group: Interceptor (10 of 10) type = "passive" def handler(fit, ship, context): fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("High Speed Maneuvering"), diff --git a/eos/effects/offensivedefensivereduction.py b/eos/effects/offensivedefensivereduction.py index cc6abc5f5..43ae14ed5 100644 --- a/eos/effects/offensivedefensivereduction.py +++ b/eos/effects/offensivedefensivereduction.py @@ -4,7 +4,7 @@ # Celestials named like: Drifter Incursion (6 of 6) # Celestials named like: Incursion ship attributes effects (3 of 3) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): damages = ("em", "thermal", "kinetic", "explosive") for damage in damages: diff --git a/eos/effects/onlinejumpdriveconsumptionamountbonuspercentage.py b/eos/effects/onlinejumpdriveconsumptionamountbonuspercentage.py index 870fea06c..b9ef93dce 100644 --- a/eos/effects/onlinejumpdriveconsumptionamountbonuspercentage.py +++ b/eos/effects/onlinejumpdriveconsumptionamountbonuspercentage.py @@ -3,6 +3,6 @@ # Used by: # Modules from group: Jump Drive Economizer (3 of 3) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.ship.boostItemAttr("jumpDriveConsumptionAmount", module.getModifiedItemAttr("consumptionQuantityBonusPercentage"), stackingPenalties=True) diff --git a/eos/effects/shipbonuswdfgnullspeedeffects.py b/eos/effects/shipbonuswdfgnullspeedeffects.py new file mode 100644 index 000000000..448c54db5 --- /dev/null +++ b/eos/effects/shipbonuswdfgnullspeedeffects.py @@ -0,0 +1,13 @@ +# shipBonusWDFGnullSpeedEffects +# +# Used by: +# Ship: Fiend +runTime = "early" +type = "passive" +def handler(fit, ship, context): + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Propulsion Jamming"), + "speedFactorBonus", ship.getModifiedItemAttr("shipBonusAT")) + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Propulsion Jamming"), + "speedBoostFactorBonus", ship.getModifiedItemAttr("shipBonusAT")) + fit.modules.filteredItemBoost(lambda mod: mod.item.requiresSkill("Propulsion Jamming"), + "massBonusPercentage", ship.getModifiedItemAttr("shipBonusAT")) diff --git a/eos/effects/shipcappropulsionjamming.py b/eos/effects/shipcappropulsionjamming.py index 9f7e60a39..1b3bb08c1 100644 --- a/eos/effects/shipcappropulsionjamming.py +++ b/eos/effects/shipcappropulsionjamming.py @@ -1,7 +1,7 @@ # shipCapPropulsionJamming # # Used by: -# Ships from group: Interceptor (9 of 10) +# Ships from group: Interceptor (10 of 10) # Ship: Atron # Ship: Condor # Ship: Executioner diff --git a/eos/effects/shipshieldemresistancerookie.py b/eos/effects/shipshieldemresistancerookie.py index e0e1b7f82..c767db3fd 100644 --- a/eos/effects/shipshieldemresistancerookie.py +++ b/eos/effects/shipshieldemresistancerookie.py @@ -1,9 +1,8 @@ # shipShieldEMResistanceRookie # # Used by: -# Ship: Broadsword +# Ships from group: Heavy Interdiction Cruiser (3 of 5) # Ship: Ibis -# Ship: Onyx # Ship: Taipan type = "passive" def handler(fit, ship, context): diff --git a/eos/effects/shipshieldexplosiveresistancerookie.py b/eos/effects/shipshieldexplosiveresistancerookie.py index 9b95a0429..7ef2c5713 100644 --- a/eos/effects/shipshieldexplosiveresistancerookie.py +++ b/eos/effects/shipshieldexplosiveresistancerookie.py @@ -1,9 +1,8 @@ # shipShieldExplosiveResistanceRookie # # Used by: -# Ship: Broadsword +# Ships from group: Heavy Interdiction Cruiser (3 of 5) # Ship: Ibis -# Ship: Onyx # Ship: Taipan type = "passive" def handler(fit, ship, context): diff --git a/eos/effects/shipshieldkineticresistancerookie.py b/eos/effects/shipshieldkineticresistancerookie.py index a7b4e2b0b..5ede0d774 100644 --- a/eos/effects/shipshieldkineticresistancerookie.py +++ b/eos/effects/shipshieldkineticresistancerookie.py @@ -1,9 +1,8 @@ # shipShieldKineticResistanceRookie # # Used by: -# Ship: Broadsword +# Ships from group: Heavy Interdiction Cruiser (3 of 5) # Ship: Ibis -# Ship: Onyx # Ship: Taipan type = "passive" def handler(fit, ship, context): diff --git a/eos/effects/shipshieldthermalresistancerookie.py b/eos/effects/shipshieldthermalresistancerookie.py index 74f1cc7f6..4190a1a32 100644 --- a/eos/effects/shipshieldthermalresistancerookie.py +++ b/eos/effects/shipshieldthermalresistancerookie.py @@ -1,9 +1,8 @@ # shipShieldThermalResistanceRookie # # Used by: -# Ship: Broadsword +# Ships from group: Heavy Interdiction Cruiser (3 of 5) # Ship: Ibis -# Ship: Onyx # Ship: Taipan type = "passive" def handler(fit, ship, context): diff --git a/eos/effects/systemagility.py b/eos/effects/systemagility.py index 7f1769d6a..0e3158c5d 100644 --- a/eos/effects/systemagility.py +++ b/eos/effects/systemagility.py @@ -3,6 +3,6 @@ # Used by: # Celestials named like: Black Hole Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.ship.multiplyItemAttr("agility", beacon.getModifiedItemAttr("agilityMultiplier"), stackingPenalties=True) diff --git a/eos/effects/systemaoecloudsize.py b/eos/effects/systemaoecloudsize.py index 2d051ab12..33183dcd7 100644 --- a/eos/effects/systemaoecloudsize.py +++ b/eos/effects/systemaoecloudsize.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Magnetar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"), "aoeCloudSize", beacon.getModifiedItemAttr("aoeCloudSizeMultiplier")) diff --git a/eos/effects/systemaoevelocity.py b/eos/effects/systemaoevelocity.py index bc74a548f..c9a568f89 100644 --- a/eos/effects/systemaoevelocity.py +++ b/eos/effects/systemaoevelocity.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Black Hole Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"), "aoeVelocity", beacon.getModifiedItemAttr("aoeVelocityMultiplier")) diff --git a/eos/effects/systemarmoremresistance.py b/eos/effects/systemarmoremresistance.py index 91764f575..20db294de 100644 --- a/eos/effects/systemarmoremresistance.py +++ b/eos/effects/systemarmoremresistance.py @@ -4,7 +4,7 @@ # Celestials named like: Incursion Effect (2 of 2) # Celestials named like: Pulsar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.ship.boostItemAttr("armorEmDamageResonance", beacon.getModifiedItemAttr("armorEmDamageResistanceBonus"), stackingPenalties=True) diff --git a/eos/effects/systemarmorexplosiveresistance.py b/eos/effects/systemarmorexplosiveresistance.py index 65426f8bf..01548413d 100644 --- a/eos/effects/systemarmorexplosiveresistance.py +++ b/eos/effects/systemarmorexplosiveresistance.py @@ -4,7 +4,7 @@ # Celestials named like: Incursion Effect (2 of 2) # Celestials named like: Pulsar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.ship.boostItemAttr("armorExplosiveDamageResonance", beacon.getModifiedItemAttr("armorExplosiveDamageResistanceBonus"), stackingPenalties=True) diff --git a/eos/effects/systemarmorhp.py b/eos/effects/systemarmorhp.py index 2dd315604..c40db3037 100644 --- a/eos/effects/systemarmorhp.py +++ b/eos/effects/systemarmorhp.py @@ -3,6 +3,6 @@ # Used by: # Celestials named like: Wolf Rayet Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.ship.multiplyItemAttr("armorHP", beacon.getModifiedItemAttr("armorHPMultiplier")) diff --git a/eos/effects/systemarmorkineticresistance.py b/eos/effects/systemarmorkineticresistance.py index ec32499dc..21c426f3a 100644 --- a/eos/effects/systemarmorkineticresistance.py +++ b/eos/effects/systemarmorkineticresistance.py @@ -4,7 +4,7 @@ # Celestials named like: Incursion Effect (2 of 2) # Celestials named like: Pulsar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.ship.boostItemAttr("armorKineticDamageResonance", beacon.getModifiedItemAttr("armorKineticDamageResistanceBonus"), stackingPenalties=True) diff --git a/eos/effects/systemarmorremoterepairamount.py b/eos/effects/systemarmorremoterepairamount.py index d187cfcf3..ec0e84f4b 100644 --- a/eos/effects/systemarmorremoterepairamount.py +++ b/eos/effects/systemarmorremoterepairamount.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Cataclysmic Variable Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.group.name == "Remote Armor Repairer", "armorDamageAmount", module.getModifiedItemAttr("armorDamageAmountMultiplierRemote"), diff --git a/eos/effects/systemarmorrepairamount.py b/eos/effects/systemarmorrepairamount.py index 64dd8ed4f..1c659a1b2 100644 --- a/eos/effects/systemarmorrepairamount.py +++ b/eos/effects/systemarmorrepairamount.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Cataclysmic Variable Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.group.name == "Armor Repair Unit", "armorDamageAmount", module.getModifiedItemAttr("armorDamageAmountMultiplier"), diff --git a/eos/effects/systemarmorthermalresistance.py b/eos/effects/systemarmorthermalresistance.py index 568c6ad9c..4c06d397b 100644 --- a/eos/effects/systemarmorthermalresistance.py +++ b/eos/effects/systemarmorthermalresistance.py @@ -4,7 +4,7 @@ # Celestials named like: Incursion Effect (2 of 2) # Celestials named like: Pulsar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.ship.boostItemAttr("armorThermalDamageResonance", beacon.getModifiedItemAttr("armorThermalDamageResistanceBonus"), stackingPenalties=True) diff --git a/eos/effects/systemcapacitorcapacity.py b/eos/effects/systemcapacitorcapacity.py index 6c6a64570..4cc9d40a5 100644 --- a/eos/effects/systemcapacitorcapacity.py +++ b/eos/effects/systemcapacitorcapacity.py @@ -3,6 +3,6 @@ # Used by: # Celestials named like: Cataclysmic Variable Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.ship.multiplyItemAttr("capacitorCapacity", beacon.getModifiedItemAttr("capacitorCapacityMultiplierSystem")) diff --git a/eos/effects/systemcapacitorrecharge.py b/eos/effects/systemcapacitorrecharge.py index 00a9ec633..21750d5d4 100644 --- a/eos/effects/systemcapacitorrecharge.py +++ b/eos/effects/systemcapacitorrecharge.py @@ -4,6 +4,6 @@ # Celestials named like: Cataclysmic Variable Effect Beacon Class (6 of 6) # Celestials named like: Pulsar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.ship.multiplyItemAttr("rechargeRate", beacon.getModifiedItemAttr("rechargeRateMultiplier")) diff --git a/eos/effects/systemdamagedrones.py b/eos/effects/systemdamagedrones.py index 889c75378..dc85ce0ae 100644 --- a/eos/effects/systemdamagedrones.py +++ b/eos/effects/systemdamagedrones.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Magnetar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.drones.filteredItemMultiply(lambda drone: drone.item.requiresSkill("Drones"), "damageMultiplier", beacon.getModifiedItemAttr("damageMultiplierMultiplier"), diff --git a/eos/effects/systemdamageembombs.py b/eos/effects/systemdamageembombs.py index 9205a41ee..760f5eb44 100644 --- a/eos/effects/systemdamageembombs.py +++ b/eos/effects/systemdamageembombs.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Bomb Deployment"), "emDamage", beacon.getModifiedItemAttr("smartbombDamageMultiplier"), diff --git a/eos/effects/systemdamageemmissiles.py b/eos/effects/systemdamageemmissiles.py index eb12ddce3..34d12f2bc 100644 --- a/eos/effects/systemdamageemmissiles.py +++ b/eos/effects/systemdamageemmissiles.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Magnetar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"), "emDamage", beacon.getModifiedItemAttr("damageMultiplierMultiplier"), diff --git a/eos/effects/systemdamageexplosivebombs.py b/eos/effects/systemdamageexplosivebombs.py index 8526cf3b0..c3057cb81 100644 --- a/eos/effects/systemdamageexplosivebombs.py +++ b/eos/effects/systemdamageexplosivebombs.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Bomb Deployment"), "explosiveDamage", beacon.getModifiedItemAttr("smartbombDamageMultiplier"), diff --git a/eos/effects/systemdamageexplosivemissiles.py b/eos/effects/systemdamageexplosivemissiles.py index ade40917f..e8c224f08 100644 --- a/eos/effects/systemdamageexplosivemissiles.py +++ b/eos/effects/systemdamageexplosivemissiles.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Magnetar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"), "explosiveDamage", beacon.getModifiedItemAttr("damageMultiplierMultiplier"), diff --git a/eos/effects/systemdamagefighters.py b/eos/effects/systemdamagefighters.py index efb96b7fc..63e02a999 100644 --- a/eos/effects/systemdamagefighters.py +++ b/eos/effects/systemdamagefighters.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Magnetar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.drones.filteredItemMultiply(lambda drone: drone.item.requiresSkill("Fighters"), "damageMultiplier", beacon.getModifiedItemAttr("damageMultiplierMultiplier"), diff --git a/eos/effects/systemdamagekineticbombs.py b/eos/effects/systemdamagekineticbombs.py index f777d4774..152e2b71a 100644 --- a/eos/effects/systemdamagekineticbombs.py +++ b/eos/effects/systemdamagekineticbombs.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Bomb Deployment"), "kineticDamage", beacon.getModifiedItemAttr("smartbombDamageMultiplier"), diff --git a/eos/effects/systemdamagekineticmissiles.py b/eos/effects/systemdamagekineticmissiles.py index cb35e4613..293f5873c 100644 --- a/eos/effects/systemdamagekineticmissiles.py +++ b/eos/effects/systemdamagekineticmissiles.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Magnetar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"), "kineticDamage", beacon.getModifiedItemAttr("damageMultiplierMultiplier"), diff --git a/eos/effects/systemdamagemultipliergunnery.py b/eos/effects/systemdamagemultipliergunnery.py index d940a0b73..1b6e32aa1 100644 --- a/eos/effects/systemdamagemultipliergunnery.py +++ b/eos/effects/systemdamagemultipliergunnery.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Magnetar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.requiresSkill("Gunnery"), "damageMultiplier", beacon.getModifiedItemAttr("damageMultiplierMultiplier"), diff --git a/eos/effects/systemdamagethermalbombs.py b/eos/effects/systemdamagethermalbombs.py index e1800c932..8293ee78c 100644 --- a/eos/effects/systemdamagethermalbombs.py +++ b/eos/effects/systemdamagethermalbombs.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Bomb Deployment"), "thermalDamage", beacon.getModifiedItemAttr("smartbombDamageMultiplier"), diff --git a/eos/effects/systemdamagethermalmissiles.py b/eos/effects/systemdamagethermalmissiles.py index 2738832a7..86187101a 100644 --- a/eos/effects/systemdamagethermalmissiles.py +++ b/eos/effects/systemdamagethermalmissiles.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Magnetar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"), "thermalDamage", beacon.getModifiedItemAttr("damageMultiplierMultiplier"), diff --git a/eos/effects/systemdronetracking.py b/eos/effects/systemdronetracking.py index aceb2ec6a..941d70749 100644 --- a/eos/effects/systemdronetracking.py +++ b/eos/effects/systemdronetracking.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Magnetar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.drones.filteredItemMultiply(lambda drone: True, "trackingSpeed", beacon.getModifiedItemAttr("trackingSpeedMultiplier"), diff --git a/eos/effects/systemenergyneutmultiplier.py b/eos/effects/systemenergyneutmultiplier.py index 7ea78415a..bafb24f06 100644 --- a/eos/effects/systemenergyneutmultiplier.py +++ b/eos/effects/systemenergyneutmultiplier.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Pulsar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.group.name == "Energy Destabilizer", "energyDestabilizationAmount", beacon.getModifiedItemAttr("energyWarfareStrengthMultiplier"), diff --git a/eos/effects/systemenergyvampiremultiplier.py b/eos/effects/systemenergyvampiremultiplier.py index 220ec1d0d..1d6c71d01 100644 --- a/eos/effects/systemenergyvampiremultiplier.py +++ b/eos/effects/systemenergyvampiremultiplier.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Pulsar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.group.name == "Energy Vampire", "powerTransferAmount", beacon.getModifiedItemAttr("energyWarfareStrengthMultiplier"), diff --git a/eos/effects/systemgravimetricecmbomb.py b/eos/effects/systemgravimetricecmbomb.py index bd673cc04..42c8d5c92 100644 --- a/eos/effects/systemgravimetricecmbomb.py +++ b/eos/effects/systemgravimetricecmbomb.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Bomb Deployment"), "scanGravimetricStrengthBonus", beacon.getModifiedItemAttr("smartbombDamageMultiplier"), diff --git a/eos/effects/systemheatdamage.py b/eos/effects/systemheatdamage.py index f4ee3063d..eb016f647 100644 --- a/eos/effects/systemheatdamage.py +++ b/eos/effects/systemheatdamage.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: "heatDamage" in mod.itemModifiedAttributes, "heatDamage", module.getModifiedItemAttr("heatDamageMultiplier")) diff --git a/eos/effects/systemladarecmbomb.py b/eos/effects/systemladarecmbomb.py index e9456fc2f..daa0780a5 100644 --- a/eos/effects/systemladarecmbomb.py +++ b/eos/effects/systemladarecmbomb.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Bomb Deployment"), "scanLadarStrengthBonus", beacon.getModifiedItemAttr("smartbombDamageMultiplier"), diff --git a/eos/effects/systemmagnetrometricecmbomb.py b/eos/effects/systemmagnetrometricecmbomb.py index 2032879eb..d9d51f07c 100644 --- a/eos/effects/systemmagnetrometricecmbomb.py +++ b/eos/effects/systemmagnetrometricecmbomb.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Bomb Deployment"), "scanMagnetometricStrengthBonus", beacon.getModifiedItemAttr("smartbombDamageMultiplier"), diff --git a/eos/effects/systemmaxvelocity.py b/eos/effects/systemmaxvelocity.py index 9f3e78ec3..012136c8c 100644 --- a/eos/effects/systemmaxvelocity.py +++ b/eos/effects/systemmaxvelocity.py @@ -3,6 +3,6 @@ # Used by: # Celestials named like: Black Hole Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.ship.multiplyItemAttr("maxVelocity", beacon.getModifiedItemAttr("maxVelocityMultiplier"), stackingPenalties=True, penaltyGroup="postMul") diff --git a/eos/effects/systemmaxvelocitypercentage.py b/eos/effects/systemmaxvelocitypercentage.py index e6d9952cc..36b0f6280 100644 --- a/eos/effects/systemmaxvelocitypercentage.py +++ b/eos/effects/systemmaxvelocitypercentage.py @@ -3,6 +3,6 @@ # Used by: # Celestials named like: Drifter Incursion (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.ship.boostItemAttr("maxVelocity", beacon.getModifiedItemAttr("maxVelocityMultiplier"), stackingPenalties=True) diff --git a/eos/effects/systemmissilevelocity.py b/eos/effects/systemmissilevelocity.py index 416270bb1..7e4d0f599 100644 --- a/eos/effects/systemmissilevelocity.py +++ b/eos/effects/systemmissilevelocity.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Black Hole Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Missile Launcher Operation"), "maxVelocity", beacon.getModifiedItemAttr("missileVelocityMultiplier"), diff --git a/eos/effects/systemneutbombs.py b/eos/effects/systemneutbombs.py index 7e4d76f9d..a87d4e691 100644 --- a/eos/effects/systemneutbombs.py +++ b/eos/effects/systemneutbombs.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Bomb Deployment"), "energyDestabilizationAmount", beacon.getModifiedItemAttr("smartbombDamageMultiplier"), diff --git a/eos/effects/systemoverloadarmor.py b/eos/effects/systemoverloadarmor.py index 57cd9e1cf..1ce7a9e66 100644 --- a/eos/effects/systemoverloadarmor.py +++ b/eos/effects/systemoverloadarmor.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: "overloadArmorDamageAmount" in mod.itemModifiedAttributes, "overloadArmorDamageAmount", module.getModifiedItemAttr("overloadBonusMultiplier")) diff --git a/eos/effects/systemoverloaddamagemodifier.py b/eos/effects/systemoverloaddamagemodifier.py index e8185f964..5f7537099 100644 --- a/eos/effects/systemoverloaddamagemodifier.py +++ b/eos/effects/systemoverloaddamagemodifier.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: "overloadDamageModifier" in mod.itemModifiedAttributes, "overloadDamageModifier", module.getModifiedItemAttr("overloadBonusMultiplier")) diff --git a/eos/effects/systemoverloaddurationbonus.py b/eos/effects/systemoverloaddurationbonus.py index ca07346aa..e612af53c 100644 --- a/eos/effects/systemoverloaddurationbonus.py +++ b/eos/effects/systemoverloaddurationbonus.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: "overloadDurationBonus" in mod.itemModifiedAttributes, "overloadDurationBonus", module.getModifiedItemAttr("overloadBonusMultiplier")) diff --git a/eos/effects/systemoverloadeccmstrength.py b/eos/effects/systemoverloadeccmstrength.py index 21c554aab..e032ed52f 100644 --- a/eos/effects/systemoverloadeccmstrength.py +++ b/eos/effects/systemoverloadeccmstrength.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: "overloadECCMStrenghtBonus" in mod.itemModifiedAttributes, "overloadECCMStrenghtBonus", module.getModifiedItemAttr("overloadBonusMultiplier")) diff --git a/eos/effects/systemoverloadecmstrength.py b/eos/effects/systemoverloadecmstrength.py index 327409edf..b61e36e54 100644 --- a/eos/effects/systemoverloadecmstrength.py +++ b/eos/effects/systemoverloadecmstrength.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: "overloadECMStrenghtBonus" in mod.itemModifiedAttributes, "overloadECMStrenghtBonus", module.getModifiedItemAttr("overloadBonusMultiplier")) diff --git a/eos/effects/systemoverloadhardening.py b/eos/effects/systemoverloadhardening.py index 89d312cfa..96f20ec17 100644 --- a/eos/effects/systemoverloadhardening.py +++ b/eos/effects/systemoverloadhardening.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: "overloadHardeningBonus" in mod.itemModifiedAttributes, "overloadHardeningBonus", module.getModifiedItemAttr("overloadBonusMultiplier")) diff --git a/eos/effects/systemoverloadrange.py b/eos/effects/systemoverloadrange.py index 305ab0201..76912f5e3 100644 --- a/eos/effects/systemoverloadrange.py +++ b/eos/effects/systemoverloadrange.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: "overloadRangeBonus" in mod.itemModifiedAttributes, "overloadRangeBonus", module.getModifiedItemAttr("overloadBonusMultiplier")) diff --git a/eos/effects/systemoverloadrof.py b/eos/effects/systemoverloadrof.py index e632a3aff..bdc8fdb5a 100644 --- a/eos/effects/systemoverloadrof.py +++ b/eos/effects/systemoverloadrof.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: "overloadRofBonus" in mod.itemModifiedAttributes, "overloadRofBonus", module.getModifiedItemAttr("overloadBonusMultiplier")) diff --git a/eos/effects/systemoverloadselfduration.py b/eos/effects/systemoverloadselfduration.py index f050d320a..46ba2d01b 100644 --- a/eos/effects/systemoverloadselfduration.py +++ b/eos/effects/systemoverloadselfduration.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: "overloadSelfDurationBonus" in mod.itemModifiedAttributes, "overloadSelfDurationBonus", module.getModifiedItemAttr("overloadBonusMultiplier")) diff --git a/eos/effects/systemoverloadshieldbonus.py b/eos/effects/systemoverloadshieldbonus.py index 455ba7624..359f92d18 100644 --- a/eos/effects/systemoverloadshieldbonus.py +++ b/eos/effects/systemoverloadshieldbonus.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: "overloadShieldBonus" in mod.itemModifiedAttributes, "overloadShieldBonus", module.getModifiedItemAttr("overloadBonusMultiplier")) diff --git a/eos/effects/systemoverloadspeedfactor.py b/eos/effects/systemoverloadspeedfactor.py index 804193105..b2e4a098a 100644 --- a/eos/effects/systemoverloadspeedfactor.py +++ b/eos/effects/systemoverloadspeedfactor.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: "overloadSpeedFactorBonus" in mod.itemModifiedAttributes, "overloadSpeedFactorBonus", module.getModifiedItemAttr("overloadBonusMultiplier")) diff --git a/eos/effects/systemradarecmbomb.py b/eos/effects/systemradarecmbomb.py index 614e6a1bc..b7fb110bf 100644 --- a/eos/effects/systemradarecmbomb.py +++ b/eos/effects/systemradarecmbomb.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Bomb Deployment"), "scanRadarStrengthBonus", beacon.getModifiedItemAttr("smartbombDamageMultiplier"), diff --git a/eos/effects/systemremotecaptransmitteramount.py b/eos/effects/systemremotecaptransmitteramount.py index e49f813b5..df0166d28 100644 --- a/eos/effects/systemremotecaptransmitteramount.py +++ b/eos/effects/systemremotecaptransmitteramount.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Cataclysmic Variable Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.group.name == "Remote Capacitor Transmitter", "powerTransferAmount", beacon.getModifiedItemAttr("energyTransferAmountBonus"), diff --git a/eos/effects/systemrocketemdamage.py b/eos/effects/systemrocketemdamage.py index 2ac5011ac..0284ef7e9 100644 --- a/eos/effects/systemrocketemdamage.py +++ b/eos/effects/systemrocketemdamage.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Wolf Rayet Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Rockets"), "emDamage", beacon.getModifiedItemAttr("smallWeaponDamageMultiplier"), diff --git a/eos/effects/systemrocketexplosivedamage.py b/eos/effects/systemrocketexplosivedamage.py index 80b7a7eed..3c636a444 100644 --- a/eos/effects/systemrocketexplosivedamage.py +++ b/eos/effects/systemrocketexplosivedamage.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Wolf Rayet Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Rockets"), "explosiveDamage", beacon.getModifiedItemAttr("smallWeaponDamageMultiplier"), diff --git a/eos/effects/systemrocketkineticdamage.py b/eos/effects/systemrocketkineticdamage.py index bfa2bd3e9..f91272907 100644 --- a/eos/effects/systemrocketkineticdamage.py +++ b/eos/effects/systemrocketkineticdamage.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Wolf Rayet Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Rockets"), "kineticDamage", beacon.getModifiedItemAttr("smallWeaponDamageMultiplier"), diff --git a/eos/effects/systemrocketthermaldamage.py b/eos/effects/systemrocketthermaldamage.py index ebc368570..a6b530695 100644 --- a/eos/effects/systemrocketthermaldamage.py +++ b/eos/effects/systemrocketthermaldamage.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Wolf Rayet Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Rockets"), "thermalDamage", beacon.getModifiedItemAttr("smallWeaponDamageMultiplier"), diff --git a/eos/effects/systemshieldemresistance.py b/eos/effects/systemshieldemresistance.py index 18ab70b2b..b5b7d3bfa 100644 --- a/eos/effects/systemshieldemresistance.py +++ b/eos/effects/systemshieldemresistance.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Wolf Rayet Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.ship.boostItemAttr("shieldEmDamageResonance", beacon.getModifiedItemAttr("shieldEmDamageResistanceBonus"), stackingPenalties=True) diff --git a/eos/effects/systemshieldexplosiveresistance.py b/eos/effects/systemshieldexplosiveresistance.py index bbcae6623..54d1a97a8 100644 --- a/eos/effects/systemshieldexplosiveresistance.py +++ b/eos/effects/systemshieldexplosiveresistance.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Wolf Rayet Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.ship.boostItemAttr("shieldExplosiveDamageResonance", beacon.getModifiedItemAttr("shieldExplosiveDamageResistanceBonus"), stackingPenalties=True) diff --git a/eos/effects/systemshieldhp.py b/eos/effects/systemshieldhp.py index 79cb58de7..bede89d71 100644 --- a/eos/effects/systemshieldhp.py +++ b/eos/effects/systemshieldhp.py @@ -3,6 +3,6 @@ # Used by: # Celestials named like: Pulsar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.ship.multiplyItemAttr("shieldCapacity", beacon.getModifiedItemAttr("shieldCapacityMultiplier")) diff --git a/eos/effects/systemshieldkineticresistance.py b/eos/effects/systemshieldkineticresistance.py index e5c617ce2..780e10972 100644 --- a/eos/effects/systemshieldkineticresistance.py +++ b/eos/effects/systemshieldkineticresistance.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Wolf Rayet Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.ship.boostItemAttr("shieldKineticDamageResonance", beacon.getModifiedItemAttr("shieldKineticDamageResistanceBonus"), stackingPenalties=True) diff --git a/eos/effects/systemshieldremoterepairamount.py b/eos/effects/systemshieldremoterepairamount.py index 53dd39cea..e1b1b4582 100644 --- a/eos/effects/systemshieldremoterepairamount.py +++ b/eos/effects/systemshieldremoterepairamount.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Cataclysmic Variable Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.group.name == "Remote Shield Booster", "shieldBonus", module.getModifiedItemAttr("shieldBonusMultiplierRemote"), diff --git a/eos/effects/systemshieldrepairamountshieldskills.py b/eos/effects/systemshieldrepairamountshieldskills.py index 474d5c445..7ce51af06 100644 --- a/eos/effects/systemshieldrepairamountshieldskills.py +++ b/eos/effects/systemshieldrepairamountshieldskills.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Cataclysmic Variable Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.requiresSkill("Shield Operation") or mod.item.requiresSkill("Capital Shield Operation"), "shieldBonus", module.getModifiedItemAttr("shieldBonusMultiplier"), diff --git a/eos/effects/systemshieldthermalresistance.py b/eos/effects/systemshieldthermalresistance.py index 14ad2406e..ff18eaca2 100644 --- a/eos/effects/systemshieldthermalresistance.py +++ b/eos/effects/systemshieldthermalresistance.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Wolf Rayet Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.ship.boostItemAttr("shieldThermalDamageResonance", beacon.getModifiedItemAttr("shieldThermalDamageResistanceBonus"), stackingPenalties=True) diff --git a/eos/effects/systemsignatureradius.py b/eos/effects/systemsignatureradius.py index b2a882934..25d67f217 100644 --- a/eos/effects/systemsignatureradius.py +++ b/eos/effects/systemsignatureradius.py @@ -4,7 +4,7 @@ # Celestials named like: Pulsar Effect Beacon Class (6 of 6) # Celestials named like: Wolf Rayet Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.ship.multiplyItemAttr("signatureRadius", beacon.getModifiedItemAttr("signatureRadiusMultiplier"), stackingPenalties=True, penaltyGroup="postMul") diff --git a/eos/effects/systemsmallenergydamage.py b/eos/effects/systemsmallenergydamage.py index 4452797d2..a260eaf78 100644 --- a/eos/effects/systemsmallenergydamage.py +++ b/eos/effects/systemsmallenergydamage.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Wolf Rayet Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.requiresSkill("Small Energy Turret"), "damageMultiplier", module.getModifiedItemAttr("smallWeaponDamageMultiplier"), diff --git a/eos/effects/systemsmallhybriddamage.py b/eos/effects/systemsmallhybriddamage.py index 574e6041c..d727e6c88 100644 --- a/eos/effects/systemsmallhybriddamage.py +++ b/eos/effects/systemsmallhybriddamage.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Wolf Rayet Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.requiresSkill("Small Hybrid Turret"), "damageMultiplier", module.getModifiedItemAttr("smallWeaponDamageMultiplier"), diff --git a/eos/effects/systemsmallprojectiledamage.py b/eos/effects/systemsmallprojectiledamage.py index 4a0f2d485..6cc11e8d5 100644 --- a/eos/effects/systemsmallprojectiledamage.py +++ b/eos/effects/systemsmallprojectiledamage.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Wolf Rayet Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.requiresSkill("Small Projectile Turret"), "damageMultiplier", module.getModifiedItemAttr("smallWeaponDamageMultiplier"), diff --git a/eos/effects/systemsmartbombemdamage.py b/eos/effects/systemsmartbombemdamage.py index 20f06d156..6e9d8c6a4 100644 --- a/eos/effects/systemsmartbombemdamage.py +++ b/eos/effects/systemsmartbombemdamage.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.group.name == "Smart Bomb", "emDamage", module.getModifiedItemAttr("smartbombDamageMultiplier")) diff --git a/eos/effects/systemsmartbombexplosivedamage.py b/eos/effects/systemsmartbombexplosivedamage.py index 40e6ffde9..f0bbcd277 100644 --- a/eos/effects/systemsmartbombexplosivedamage.py +++ b/eos/effects/systemsmartbombexplosivedamage.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.group.name == "Smart Bomb", "explosiveDamage", module.getModifiedItemAttr("smartbombDamageMultiplier")) diff --git a/eos/effects/systemsmartbombkineticdamage.py b/eos/effects/systemsmartbombkineticdamage.py index 41d317e4d..9b03e0806 100644 --- a/eos/effects/systemsmartbombkineticdamage.py +++ b/eos/effects/systemsmartbombkineticdamage.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.group.name == "Smart Bomb", "kineticDamage", module.getModifiedItemAttr("smartbombDamageMultiplier")) diff --git a/eos/effects/systemsmartbombrange.py b/eos/effects/systemsmartbombrange.py index e134c2e46..02912bdfc 100644 --- a/eos/effects/systemsmartbombrange.py +++ b/eos/effects/systemsmartbombrange.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.group.name == "Smart Bomb", "empFieldRange", module.getModifiedItemAttr("empFieldRangeMultiplier")) diff --git a/eos/effects/systemsmartbombthermaldamage.py b/eos/effects/systemsmartbombthermaldamage.py index 0237c98f4..94344a587 100644 --- a/eos/effects/systemsmartbombthermaldamage.py +++ b/eos/effects/systemsmartbombthermaldamage.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Red Giant Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.group.name == "Smart Bomb", "thermalDamage", module.getModifiedItemAttr("smartbombDamageMultiplier")) diff --git a/eos/effects/systemstandardmissileemdamage.py b/eos/effects/systemstandardmissileemdamage.py index a78db2840..2dcadb7b9 100644 --- a/eos/effects/systemstandardmissileemdamage.py +++ b/eos/effects/systemstandardmissileemdamage.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Wolf Rayet Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Light Missiles"), "emDamage", beacon.getModifiedItemAttr("smallWeaponDamageMultiplier"), diff --git a/eos/effects/systemstandardmissileexplosivedamage.py b/eos/effects/systemstandardmissileexplosivedamage.py index f1569408b..60d790ce9 100644 --- a/eos/effects/systemstandardmissileexplosivedamage.py +++ b/eos/effects/systemstandardmissileexplosivedamage.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Wolf Rayet Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Light Missiles"), "explosiveDamage", beacon.getModifiedItemAttr("smallWeaponDamageMultiplier"), diff --git a/eos/effects/systemstandardmissilekineticdamage.py b/eos/effects/systemstandardmissilekineticdamage.py index b805c32bc..f7e454bdc 100644 --- a/eos/effects/systemstandardmissilekineticdamage.py +++ b/eos/effects/systemstandardmissilekineticdamage.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Wolf Rayet Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Light Missiles"), "kineticDamage", beacon.getModifiedItemAttr("smallWeaponDamageMultiplier"), diff --git a/eos/effects/systemstandardmissilethermaldamage.py b/eos/effects/systemstandardmissilethermaldamage.py index b35c8b2c8..68dfff8b9 100644 --- a/eos/effects/systemstandardmissilethermaldamage.py +++ b/eos/effects/systemstandardmissilethermaldamage.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Wolf Rayet Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredChargeMultiply(lambda mod: mod.charge.requiresSkill("Light Missiles"), "thermalDamage", beacon.getModifiedItemAttr("smallWeaponDamageMultiplier"), diff --git a/eos/effects/systemtargetingrange.py b/eos/effects/systemtargetingrange.py index c8a353210..8e1bc0187 100644 --- a/eos/effects/systemtargetingrange.py +++ b/eos/effects/systemtargetingrange.py @@ -4,7 +4,7 @@ # Celestials named like: Black Hole Effect Beacon Class (6 of 6) # Celestials named like: Magnetar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.ship.multiplyItemAttr("maxTargetRange", beacon.getModifiedItemAttr("maxTargetRangeMultiplier"), stackingPenalties=True, penaltyGroup="postMul") diff --git a/eos/effects/systemtargetpaintermultiplier.py b/eos/effects/systemtargetpaintermultiplier.py index 0ccd138e0..b7f02c2a4 100644 --- a/eos/effects/systemtargetpaintermultiplier.py +++ b/eos/effects/systemtargetpaintermultiplier.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Magnetar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.requiresSkill("Target Painting"), "signatureRadiusBonus", beacon.getModifiedItemAttr("targetPainterStrengthMultiplier"), diff --git a/eos/effects/systemtracking.py b/eos/effects/systemtracking.py index e2c71754c..652d6f2eb 100644 --- a/eos/effects/systemtracking.py +++ b/eos/effects/systemtracking.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Magnetar Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, module, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.requiresSkill("Gunnery"), "trackingSpeed", module.getModifiedItemAttr("trackingSpeedMultiplier"), diff --git a/eos/effects/systemwebifierstrengthmultiplier.py b/eos/effects/systemwebifierstrengthmultiplier.py index d43cf9cf0..7e190e51f 100644 --- a/eos/effects/systemwebifierstrengthmultiplier.py +++ b/eos/effects/systemwebifierstrengthmultiplier.py @@ -3,7 +3,7 @@ # Used by: # Celestials named like: Black Hole Effect Beacon Class (6 of 6) runTime = "early" -type = ("projected", "offline") +type = ("projected", "passive") def handler(fit, beacon, context): fit.modules.filteredItemMultiply(lambda mod: mod.item.group.name == "Stasis Web", "speedFactor", beacon.getModifiedItemAttr("stasisWebStrengthMultiplier"), diff --git a/eos/effects/warpscrambleblockmwdwithnpceffect.py b/eos/effects/warpscrambleblockmwdwithnpceffect.py index 292fcba3d..8c7f55f80 100644 --- a/eos/effects/warpscrambleblockmwdwithnpceffect.py +++ b/eos/effects/warpscrambleblockmwdwithnpceffect.py @@ -4,5 +4,13 @@ # Variations of module: Warp Scrambler I (19 of 19) runTime = "early" type = "projected", "active" + +from eos.types import State + def handler(fit, module, context): - pass \ No newline at end of file + if "projected" not in context: + return + # 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 diff --git a/eos/modifiedAttributeDict.py b/eos/modifiedAttributeDict.py index d4b2fdd22..de63420d1 100644 --- a/eos/modifiedAttributeDict.py +++ b/eos/modifiedAttributeDict.py @@ -250,11 +250,11 @@ class ModifiedAttributeDict(collections.MutableMapping): def increase(self, attributeName, increase, position="pre", skill=None): """Increase value of given attribute by given number""" - # Increases applied before multiplications and after them are - # written in separate maps if skill: increase *= self.__handleSkill(skill) + # Increases applied before multiplications and after them are + # written in separate maps if position == "pre": tbl = self.__preIncreases elif position == "post": @@ -269,11 +269,11 @@ class ModifiedAttributeDict(collections.MutableMapping): def multiply(self, attributeName, multiplier, stackingPenalties=False, penaltyGroup="default", skill=None): """Multiply value of given attribute by given factor""" - # If we're asked to do stacking penalized multiplication, append values - # to per penalty group lists if skill: multiplier *= self.__handleSkill(skill) + # If we're asked to do stacking penalized multiplication, append values + # to per penalty group lists if stackingPenalties: if not attributeName in self.__penalizedMultipliers: self.__penalizedMultipliers[attributeName] = {} @@ -291,9 +291,10 @@ class ModifiedAttributeDict(collections.MutableMapping): def boost(self, attributeName, boostFactor, skill=None, *args, **kwargs): """Boost value by some percentage""" - # We just transform percentage boost into multiplication factor if skill: boostFactor *= self.__handleSkill(skill) + + # We just transform percentage boost into multiplication factor self.multiply(attributeName, 1 + boostFactor / 100.0, *args, **kwargs) def force(self, attributeName, value): diff --git a/eos/saveddata/character.py b/eos/saveddata/character.py index 84e5a6763..06559b8eb 100644 --- a/eos/saveddata/character.py +++ b/eos/saveddata/character.py @@ -21,11 +21,11 @@ from sqlalchemy.orm import validates, reconstructor from eos.effectHandlerHelpers import HandledItem +import eos.db import eos + class Character(object): - __all5 = None - __all0 = None __itemList = None __itemIDMap = None __itemNameMap = None @@ -33,7 +33,6 @@ class Character(object): @classmethod def getSkillList(cls): if cls.__itemList is None: - import eos.db cls.__itemList = eos.db.getItemsByCategory("Skill") return cls.__itemList @@ -66,36 +65,39 @@ class Character(object): @classmethod def getAll5(cls): - if cls.__all5 is None: - import eos.db - all5 = eos.db.getCharacter("All 5") - if all5 is None: - all5 = Character("All 5") - all5.defaultLevel = 5 - eos.db.add(all5) + all5 = eos.db.getCharacter("All 5") - cls.__all5 = all5 - return cls.__all5 + if all5 is None: + # We do not have to be afraid of committing here and saving + # edited character data. If this ever runs, it will be during the + # get character list phase when pyfa first starts + all5 = Character("All 5", 5) + eos.db.save(all5) + + return all5 @classmethod def getAll0(cls): - if cls.__all0 is None: - import eos.db - all0 = eos.db.getCharacter("All 0") - if all0 is None: - all0 = Character("All 0") - all0.defaultLevel = None - eos.db.add(all0) + all0 = eos.db.getCharacter("All 0") - cls.__all0 = all0 - return cls.__all0 + if all0 is None: + all0 = Character("All 0") + eos.db.save(all0) - def __init__(self, name): + return all0 + + def __init__(self, name, defaultLevel=None, initSkills=True): self.name = name self.__owner = None - self.defaultLevel = None + self.defaultLevel = defaultLevel self.__skills = [] self.__skillIdMap = {} + self.dirtySkills = set() + + if initSkills: + for item in self.getSkillList(): + self.addSkill(Skill(item.ID, self.defaultLevel)) + self.__implants = eos.saveddata.fit.HandledImplantBoosterList() self.apiKey = None @@ -104,14 +106,18 @@ class Character(object): self.__skillIdMap = {} for skill in self.__skills: self.__skillIdMap[skill.itemID] = skill + self.dirtySkills = set() def apiUpdateCharSheet(self, skills): del self.__skills[:] self.__skillIdMap.clear() for skillRow in skills: - self.addSkill(Skill(skillRow["typeID"], skillRow["level"])) + @property + def ro(self): + return self == self.getAll0() or self == self.getAll5() + @property def owner(self): return self.__owner @@ -120,6 +126,10 @@ class Character(object): def owner(self, owner): self.__owner = owner + @property + def skills(self): + return self.__skills + def addSkill(self, skill): self.__skills.append(skill) self.__skillIdMap[skill.itemID] = skill @@ -137,11 +147,7 @@ class Character(object): skill = self.__skillIdMap.get(item.ID) if skill is None: - if self.defaultLevel is None: - skill = Skill(item, 0, False, False) - else: - skill = Skill(item, self.defaultLevel, False, True) - + skill = Skill(item, self.defaultLevel, False, True) self.addSkill(skill) return skill @@ -150,40 +156,57 @@ class Character(object): def implants(self): return self.__implants - def iterSkills(self): - for item in self.getSkillList(): - yield self.getSkill(item) + @property + def isDirty(self): + return len(self.dirtySkills) > 0 + + def saveLevels(self): + if self == self.getAll5() or self == self.getAll0(): + raise ReadOnlyException("This character is read-only") + + for skill in self.dirtySkills.copy(): + skill.saveLevel() + + self.dirtySkills = set() + eos.db.commit() + + def revertLevels(self): + for skill in self.dirtySkills.copy(): + skill.revert() + + self.dirtySkills = set() def filteredSkillIncrease(self, filter, *args, **kwargs): - for element in self.iterSkills(): + for element in self.skills: if filter(element): element.increaseItemAttr(*args, **kwargs) def filteredSkillMultiply(self, filter, *args, **kwargs): - for element in self.iterSkills(): + for element in self.skills: if filter(element): element.multiplyItemAttr(*args, **kwargs) def filteredSkillBoost(self, filter, *args, **kwargs): - for element in self.iterSkills(): + for element in self.skills: if filter(element): element.boostItemAttr(*args, **kwargs) def calculateModifiedAttributes(self, fit, runTime, forceProjected = False): if forceProjected: return - for skill in self.iterSkills(): + for skill in self.skills: fit.register(skill) skill.calculateModifiedAttributes(fit, runTime) def clear(self): - for skill in self.iterSkills(): + for skill in self.skills: skill.clear() def __deepcopy__(self, memo): - copy = Character("%s copy" % self.name) + copy = Character("%s copy" % self.name, initSkills=False) copy.apiKey = self.apiKey copy.apiID = self.apiID - for skill in self.iterSkills(): + + for skill in self.skills: copy.addSkill(Skill(skill.itemID, skill.level, False, skill.learned)) return copy @@ -199,7 +222,7 @@ class Character(object): else: return val class Skill(HandledItem): - def __init__(self, item, level = 0, ro = False, learned = True): + def __init__(self, item, level=0, ro=False, learned=True): self.__item = item if not isinstance(item, int) else None self.itemID = item.ID if not isinstance(item, int) else item self.__level = level if learned else None @@ -214,14 +237,28 @@ class Skill(HandledItem): def build(self, ro): self.__ro = ro self.__suppressed = False + self.activeLevel = self.__level + + def saveLevel(self): + self.__level = self.activeLevel + + if self in self.character.dirtySkills: + self.character.dirtySkills.remove(self) + + def revert(self): + self.level = self.__level + + @property + def isDirty(self): + return self.__level != self.activeLevel @property def learned(self): - return self.__level is not None + return self.activeLevel is not None @property def level(self): - return self.__level or 0 + return self.activeLevel or 0 @level.setter def level(self, level): @@ -231,7 +268,12 @@ class Skill(HandledItem): if hasattr(self, "_Skill__ro") and self.__ro == True: raise ReadOnlyException() - self.__level = level + self.activeLevel = level + self.character.dirtySkills.add(self) + + if self.activeLevel == self.__level and self in self.character.dirtySkills: + self.character.dirtySkills.remove(self) + @property def item(self): diff --git a/eos/saveddata/fit.py b/eos/saveddata/fit.py index 29df2dbcf..7ed04ed43 100644 --- a/eos/saveddata/fit.py +++ b/eos/saveddata/fit.py @@ -401,7 +401,7 @@ class Fit(object): return self.__origin def __calculateGangBoosts(self, runTime): - logger.debug("Applying gang boosts in `%s` runtime for %s", runTime, repr(self)) + logger.debug("Applying gang boosts in `%s` runtime for %r", runTime, self) for name, info in self.gangBoosts.iteritems(): # Unpack all data required to run effect properly effect, thing = info[1] @@ -425,12 +425,12 @@ class Fit(object): pass def calculateModifiedAttributes(self, targetFit=None, withBoosters=False, dirtyStorage=None): - timer = Timer('Fit: {}, {}'.format(self.ID, self.name), logger) - logger.debug("Starting fit calculation on: %s, withBoosters: %s", repr(self), withBoosters) + timer = Timer(u'Fit: {}, {}'.format(self.ID, self.name), logger) + logger.debug("Starting fit calculation on: %r, withBoosters: %s", self, withBoosters) shadow = False if targetFit: - logger.debug("Applying projections to target: %s", repr(targetFit)) + logger.debug("Applying projections to target: %r", targetFit) projectionInfo = self.getProjectionInfo(targetFit.ID) logger.debug("ProjectionInfo: %s", projectionInfo) if self == targetFit: @@ -438,7 +438,7 @@ class Fit(object): shadow = True self = copy.deepcopy(self) self.fleet = copied.fleet - logger.debug("Handling self projection - making shadow copy of fit. %s => %s", repr(copied), repr(self)) + logger.debug("Handling self projection - making shadow copy of fit. %r => %r", copied, self) # we delete the fit because when we copy a fit, flush() is # called to properly handle projection updates. However, we do # not want to save this fit to the database, so simply remove it @@ -447,7 +447,7 @@ class Fit(object): if self.fleet is not None and withBoosters is True: logger.debug("Fleet is set, gathering gang boosts") self.gangBoosts = self.fleet.recalculateLinear(withBoosters=withBoosters) - timer.checkpoint("Done calculating gang boosts for %s"%repr(self)) + timer.checkpoint("Done calculating gang boosts for %r"%self) elif self.fleet is None: self.gangBoosts = None @@ -473,7 +473,7 @@ class Fit(object): # projection have modifying stuff applied, such as gang boosts and other # local modules that may help if self.__calculated and not projected: - logger.debug("Fit has already been calculated and is not projected, returning: %s", repr(self)) + logger.debug("Fit has already been calculated and is not projected, returning: %r", self) return # Mark fit as calculated @@ -604,8 +604,8 @@ class Fit(object): Slot.RIG: "rigSlots", Slot.SUBSYSTEM: "maxSubSystems"} - if type == Slot.MODE: - # Mode slot doesn't really exist, return default 0 + if type in (Slot.MODE, Slot.SYSTEM): + # These slots don't really exist, return default 0 return 0 slotsUsed = self.getSlotsUsed(type, countDummies) @@ -1000,11 +1000,11 @@ class Fit(object): return copy def __repr__(self): - return "Fit(ID={}, ship={}, name={}) at {}".format( + return u"Fit(ID={}, ship={}, name={}) at {}".format( self.ID, self.ship.item.name, self.name, hex(id(self)) - ) + ).encode('utf8') def __str__(self): - return "{} ({})".format( + return u"{} ({})".format( self.name, self.ship.item.name - ) + ).encode('utf8') diff --git a/eos/saveddata/fleet.py b/eos/saveddata/fleet.py index f1445ae3a..c1db0e97e 100644 --- a/eos/saveddata/fleet.py +++ b/eos/saveddata/fleet.py @@ -247,7 +247,7 @@ class Store(object): dict.clear() # Go through everything which can be used as gang booster - for thing in chain(fitBooster.modules, fitBooster.implants, fitBooster.character.iterSkills(), (fitBooster.ship,)): + for thing in chain(fitBooster.modules, fitBooster.implants, fitBooster.character.skills, (fitBooster.ship,)): if thing.item is None: continue for effect in thing.item.effects.itervalues(): diff --git a/eos/saveddata/module.py b/eos/saveddata/module.py index 32a28c28e..161ed2dbf 100644 --- a/eos/saveddata/module.py +++ b/eos/saveddata/module.py @@ -35,12 +35,17 @@ class State(Enum): OVERHEATED = 2 class Slot(Enum): + # These are self-explanatory LOW = 1 MED = 2 HIGH = 3 RIG = 4 SUBSYSTEM = 5 - MODE = 6 # not a real slot, need for pyfa display rack separation + # not a real slot, need for pyfa display rack separation + MODE = 6 + # system effects. They are projected "modules" and pyfa assumes all modules + # have a slot. In this case, make one up. + SYSTEM = 7 class Hardpoint(Enum): NONE = 0 @@ -528,7 +533,7 @@ class Module(HandledItem, HandledCharge, ItemAttrShortcut, ChargeAttrShortcut): if effectName in item.effects: return slot if item.group.name == "Effect Beacon": - return Slot.RIG + return Slot.SYSTEM raise ValueError("Passed item does not fit in any known slot") diff --git a/eos/saveddata/ship.py b/eos/saveddata/ship.py index 0be3cecf4..094c02c3f 100644 --- a/eos/saveddata/ship.py +++ b/eos/saveddata/ship.py @@ -70,6 +70,14 @@ class Ship(ItemAttrShortcut, HandledItem): if forceProjected: return for effect in self.item.effects.itervalues(): if effect.runTime == runTime and effect.isType("passive"): + # Ships have effects that utilize the level of a skill as an + # additional operator to the modifier. These are defined in + # the effect itself, and these skillbooks are registered when + # they are provided. However, we must re-register the ship + # before each effect, otherwise effects that do not have + # skillbook modifiers will use the stale modifier value + # GH issue #351 + fit.register(self) effect.handler(fit, self, ("ship",)) def validateModeItem(self, item): diff --git a/gui/builtinContextMenus/changeAffectingSkills.py b/gui/builtinContextMenus/changeAffectingSkills.py index 79493d7d4..3bc4c1e7d 100644 --- a/gui/builtinContextMenus/changeAffectingSkills.py +++ b/gui/builtinContextMenus/changeAffectingSkills.py @@ -21,8 +21,8 @@ class ChangeAffectingSkills(ContextMenu): self.charID = fit.character.ID - if self.sChar.getCharName(self.charID) in ("All 0", "All 5"): - return False + #if self.sChar.getCharName(self.charID) in ("All 0", "All 5"): + # return False if srcContext == "fittingShip": fitID = self.mainFrame.getActiveFit() @@ -94,6 +94,7 @@ class ChangeAffectingSkills(ContextMenu): fitID = self.mainFrame.getActiveFit() self.sFit.changeChar(fitID, self.charID) + wx.PostEvent(self.mainFrame, GE.CharListUpdated()) wx.PostEvent(self.mainFrame, GE.FitChanged(fitID=fitID)) ChangeAffectingSkills.register() diff --git a/gui/characterEditor.py b/gui/characterEditor.py index cf2b23ea8..2d42d7cc6 100644 --- a/gui/characterEditor.py +++ b/gui/characterEditor.py @@ -35,6 +35,9 @@ class CharacterEditor(wx.Frame): size=wx.Size(641, 600), style=wx.DEFAULT_FRAME_STYLE|wx.FRAME_FLOAT_ON_PARENT|wx.TAB_TRAVERSAL) i = wx.IconFromBitmap(BitmapLoader.getBitmap("character_small", "gui")) + + self.mainFrame = parent + self.SetIcon(i) self.disableWin= wx.WindowDisabler(self) @@ -45,8 +48,6 @@ class CharacterEditor(wx.Frame): self.navSizer = wx.BoxSizer(wx.HORIZONTAL) sChar = service.Character.getInstance() - charList = sChar.getCharacterList() - charList.sort(key=lambda t: t[1]) self.btnSave = wx.Button(self, wx.ID_SAVE) self.btnSave.Hide() @@ -56,15 +57,15 @@ class CharacterEditor(wx.Frame): self.characterRename.Hide() self.characterRename.Bind(wx.EVT_TEXT_ENTER, self.processRename) - self.skillTreeChoice = wx.Choice(self, wx.ID_ANY, style=0) + self.charChoice = wx.Choice(self, wx.ID_ANY, style=0) + self.navSizer.Add(self.charChoice, 1, wx.ALL | wx.EXPAND, 5) + + charList = sChar.getCharacterList() for id, name, active in charList: - i = self.skillTreeChoice.Append(name, id) + i = self.charChoice.Append(name, id) if active: - self.skillTreeChoice.SetSelection(i) - - self.navSizer.Add(self.skillTreeChoice, 1, wx.ALL | wx.EXPAND, 5) - self.navSizer.Add(self.btnSave, 0, wx.ALIGN_CENTER) + self.charChoice.SetSelection(i) buttons = (("new", wx.ART_NEW), ("rename", BitmapLoader.getBitmap("rename", "gui")), @@ -111,12 +112,26 @@ class CharacterEditor(wx.Frame): bSizerButtons = wx.BoxSizer(wx.HORIZONTAL) + self.btnSave = wx.Button(self, wx.ID_ANY, "Save") + self.btnSaveAs = wx.Button(self, wx.ID_ANY, "Save As...") + self.btnRevert = wx.Button(self, wx.ID_ANY, "Revert") self.btnOK = wx.Button(self, wx.ID_OK) + + bSizerButtons.Add(self.btnSave, 0, wx.ALL, 5) + bSizerButtons.Add(self.btnSaveAs, 0, wx.ALL, 5) + bSizerButtons.Add(self.btnRevert, 0, wx.ALL, 5) + bSizerButtons.AddStretchSpacer() bSizerButtons.Add(self.btnOK, 0, wx.ALL, 5) + + + self.btnSave.Bind(wx.EVT_BUTTON, self.saveChar) + self.btnSaveAs.Bind(wx.EVT_BUTTON, self.saveCharAs) + self.btnRevert.Bind(wx.EVT_BUTTON, self.revertChar) self.btnOK.Bind(wx.EVT_BUTTON, self.editingFinished) - mainSizer.Add(bSizerButtons, 0, wx.ALIGN_RIGHT, 5) + mainSizer.Add(bSizerButtons, 0, wx.EXPAND, 5) + self.btnRestrict() self.SetSizer(mainSizer) self.Layout() @@ -129,7 +144,28 @@ class CharacterEditor(wx.Frame): self.registerEvents() - self.mainFrame = gui.mainFrame.MainFrame.getInstance() + def btnRestrict(self): + sChar = service.Character.getInstance() + charID = self.getActiveCharacter() + char = sChar.getCharacter(charID) + + # enable/disable character saving stuff + self.btnSave.Enable(not char.ro and char.isDirty) + self.btnSaveAs.Enable(char.isDirty) + self.btnRevert.Enable(char.isDirty) + + def refreshCharacterList(self, event=None): + sChar = service.Character.getInstance() + charList = sChar.getCharacterList() + active = self.getActiveCharacter() + self.charChoice.Clear() + + for id, name, _ in charList: + i = self.charChoice.Append(name, id) + if active == id: + self.charChoice.SetSelection(i) + + self.btnRestrict() def editingFinished(self, event): del self.disableWin @@ -138,7 +174,29 @@ class CharacterEditor(wx.Frame): def registerEvents(self): self.Bind(wx.EVT_CLOSE, self.closeEvent) - self.skillTreeChoice.Bind(wx.EVT_CHOICE, self.charChanged) + self.Bind(GE.CHAR_LIST_UPDATED, self.refreshCharacterList) + self.charChoice.Bind(wx.EVT_CHOICE, self.charChanged) + + def saveChar(self, event): + sChr = service.Character.getInstance() + charID = self.getActiveCharacter() + sChr.saveCharacter(charID) + self.sview.populateSkillTree() + wx.PostEvent(self, GE.CharListUpdated()) + + def saveCharAs(self, event): + charID = self.getActiveCharacter() + dlg = SaveCharacterAs(self, charID) + dlg.ShowModal() + dlg.Destroy() + self.sview.populateSkillTree() + + def revertChar(self, event): + sChr = service.Character.getInstance() + charID = self.getActiveCharacter() + sChr.revertCharacter(charID) + self.sview.populateSkillTree() + wx.PostEvent(self, GE.CharListUpdated()) def closeEvent(self, event): del self.disableWin @@ -148,7 +206,7 @@ class CharacterEditor(wx.Frame): def restrict(self): self.btnRename.Enable(False) self.btnDelete.Enable(False) - self.aview.stDisabledTip.Show(True) + self.aview.stDisabledTip.Show() self.aview.inputID.Enable(False) self.aview.inputKey.Enable(False) self.aview.charChoice.Enable(False) @@ -160,7 +218,7 @@ class CharacterEditor(wx.Frame): def unrestrict(self): self.btnRename.Enable(True) self.btnDelete.Enable(True) - self.aview.stDisabledTip.Show(False) + self.aview.stDisabledTip.Hide() self.aview.inputID.Enable(True) self.aview.inputKey.Enable(True) self.aview.btnFetchCharList.Enable(True) @@ -169,7 +227,6 @@ class CharacterEditor(wx.Frame): self.aview.Layout() def charChanged(self, event): - self.sview.skillTreeListCtrl.DeleteChildren(self.sview.root) self.sview.populateSkillTree() sChar = service.Character.getInstance() charID = self.getActiveCharacter() @@ -183,14 +240,14 @@ class CharacterEditor(wx.Frame): event.Skip() def getActiveCharacter(self): - selection = self.skillTreeChoice.GetCurrentSelection() - return self.skillTreeChoice.GetClientData(selection) if selection is not None else None + selection = self.charChoice.GetCurrentSelection() + return self.charChoice.GetClientData(selection) if selection is not None else None def new(self, event): sChar = service.Character.getInstance() charID = sChar.new() - id = self.skillTreeChoice.Append(sChar.getCharName(charID), charID) - self.skillTreeChoice.SetSelection(id) + id = self.charChoice.Append(sChar.getCharName(charID), charID) + self.charChoice.SetSelection(id) self.unrestrict() self.btnSave.SetLabel("Create") self.rename(None) @@ -199,9 +256,9 @@ class CharacterEditor(wx.Frame): def rename(self, event): if event is not None: self.btnSave.SetLabel("Rename") - self.skillTreeChoice.Hide() + self.charChoice.Hide() self.characterRename.Show() - self.navSizer.Replace(self.skillTreeChoice, self.characterRename) + self.navSizer.Replace(self.charChoice, self.characterRename) self.characterRename.SetFocus() for btn in (self.btnNew, self.btnCopy, self.btnRename, self.btnDelete): btn.Hide() @@ -224,24 +281,21 @@ class CharacterEditor(wx.Frame): charID = self.getActiveCharacter() sChar.rename(charID, newName) - self.skillTreeChoice.Show() + self.charChoice.Show() self.characterRename.Hide() - self.navSizer.Replace(self.characterRename, self.skillTreeChoice) + self.navSizer.Replace(self.characterRename, self.charChoice) for btn in (self.btnNew, self.btnCopy, self.btnRename, self.btnDelete): btn.Show() self.btnSave.Hide() self.navSizer.Layout() - selection = self.skillTreeChoice.GetCurrentSelection() - self.skillTreeChoice.Delete(selection) - self.skillTreeChoice.Insert(newName, selection, charID) - self.skillTreeChoice.SetSelection(selection) + self.refreshCharacterList() def copy(self, event): sChar = service.Character.getInstance() charID = sChar.copy(self.getActiveCharacter()) - id = self.skillTreeChoice.Append(sChar.getCharName(charID), charID) - self.skillTreeChoice.SetSelection(id) + id = self.charChoice.Append(sChar.getCharName(charID), charID) + self.charChoice.SetSelection(id) self.unrestrict() self.btnSave.SetLabel("Copy") self.rename(None) @@ -250,9 +304,9 @@ class CharacterEditor(wx.Frame): def delete(self, event): sChar = service.Character.getInstance() sChar.delete(self.getActiveCharacter()) - sel = self.skillTreeChoice.GetSelection() - self.skillTreeChoice.Delete(sel) - self.skillTreeChoice.SetSelection(sel - 1) + sel = self.charChoice.GetSelection() + self.charChoice.Delete(sel) + self.charChoice.SetSelection(sel - 1) newSelection = self.getActiveCharacter() if sChar.getCharName(newSelection) in ("All 0", "All 5"): self.restrict() @@ -314,6 +368,14 @@ class SkillTreeView (wx.Panel): self.levelIds[id] = level self.levelChangeMenu.Append(id, "Level %d" % level) + self.levelChangeMenu.AppendSeparator() + self.revertID = wx.NewId() + self.levelChangeMenu.Append(self.revertID, "Revert") + + + self.saveID = wx.NewId() + self.levelChangeMenu.Append(self.saveID, "Save") + self.levelChangeMenu.Bind(wx.EVT_MENU, self.changeLevel) self.SetSizer(pmainSizer) @@ -321,15 +383,22 @@ class SkillTreeView (wx.Panel): def populateSkillTree(self): sChar = service.Character.getInstance() + charID = self.Parent.Parent.getActiveCharacter() + dirtySkills = sChar.getDirtySkills(charID) + dirtyGroups = set([skill.item.group.ID for skill in dirtySkills]) + groups = sChar.getSkillGroups() imageId = self.skillBookImageId root = self.root tree = self.skillTreeListCtrl + tree.DeleteChildren(root) for id, name in groups: childId = tree.AppendItem(root, name, imageId) tree.SetPyData(childId, id) tree.AppendItem(childId, "dummy") + if id in dirtyGroups: + tree.SetItemTextColour(childId, wx.BLUE) tree.SortChildren(root) @@ -346,8 +415,10 @@ class SkillTreeView (wx.Panel): for id, name in sChar.getSkills(tree.GetPyData(root)): iconId = self.skillBookImageId childId = tree.AppendItem(root, name, iconId, data=wx.TreeItemData(id)) - level = sChar.getSkillLevel(char, id) + level, dirty = sChar.getSkillLevel(char, id) tree.SetItemText(childId, "Level %d" % level if isinstance(level, int) else level, 1) + if dirty: + tree.SetItemTextColour(childId, wx.BLUE) tree.SortChildren(root) @@ -372,18 +443,34 @@ class SkillTreeView (wx.Panel): def changeLevel(self, event): level = self.levelIds.get(event.Id) + + sChar = service.Character.getInstance() + charID = self.Parent.Parent.getActiveCharacter() + selection = self.skillTreeListCtrl.GetSelection() + skillID = self.skillTreeListCtrl.GetPyData(selection) + if level is not None: - sChar = service.Character.getInstance() - charID = self.Parent.Parent.getActiveCharacter() - selection = self.skillTreeListCtrl.GetSelection() - skillID = self.skillTreeListCtrl.GetPyData(selection) - self.skillTreeListCtrl.SetItemText(selection, "Level %d" % level if isinstance(level, int) else level, 1) - sChar.changeLevel(charID, skillID, level) + sChar.changeLevel(charID, skillID, level, persist=True) + elif event.Id == self.revertID: + sChar.revertLevel(charID, skillID) + elif event.Id == self.saveID: + sChar.saveSkill(charID, skillID) + self.skillTreeListCtrl.SetItemTextColour(selection, None) + + dirtySkills = sChar.getDirtySkills(charID) + dirtyGroups = set([skill.item.group.ID for skill in dirtySkills]) + + parentID = self.skillTreeListCtrl.GetItemParent(selection) + groupID = self.skillTreeListCtrl.GetPyData(parentID) + + if groupID not in dirtyGroups: + self.skillTreeListCtrl.SetItemTextColour(parentID, None) + + wx.PostEvent(self.Parent.Parent, GE.CharListUpdated()) event.Skip() - class ImplantsTreeView (wx.Panel): def addMarketViewImage(self, iconFile): if iconFile is None: @@ -544,6 +631,7 @@ class APIView (wx.Panel): u"Please select another character or make a new one.", style=wx.ALIGN_CENTER ) self.stDisabledTip.Wrap( -1 ) hintSizer.Add( self.stDisabledTip, 0, wx.TOP | wx.BOTTOM, 10 ) + self.stDisabledTip.Hide() hintSizer.AddStretchSpacer() pmainSizer.Add(hintSizer, 0, wx.EXPAND, 5) @@ -649,7 +737,7 @@ class APIView (wx.Panel): sChar = service.Character.getInstance() try: - list = sChar.charList(self.Parent.Parent.getActiveCharacter(), self.inputID.GetLineText(0), self.inputKey.GetLineText(0)) + list = sChar.apiCharList(self.Parent.Parent.getActiveCharacter(), self.inputID.GetLineText(0), self.inputKey.GetLineText(0)) except service.network.AuthenticationError, e: self.stStatus.SetLabel("Authentication failure. Please check keyID and vCode combination.") except service.network.TimeoutError, e: @@ -677,3 +765,34 @@ class APIView (wx.Panel): self.stStatus.SetLabel("Successfully fetched %s\'s skills from EVE API." % charName) except Exception, e: self.stStatus.SetLabel("Unable to retrieve %s\'s skills. Error message:\n%s" % (charName, e)) + +class SaveCharacterAs(wx.Dialog): + + def __init__(self, parent, charID): + wx.Dialog.__init__(self, parent, title="Save Character As...", size=wx.Size(300, 60)) + self.charID = charID + self.parent = parent + sChar = service.Character.getInstance() + name = sChar.getCharName(charID) + bSizer1 = wx.BoxSizer(wx.HORIZONTAL) + + self.input = wx.TextCtrl(self, wx.ID_ANY, name, style=wx.TE_PROCESS_ENTER) + + bSizer1.Add(self.input, 1, wx.ALL, 5) + self.input.Bind(wx.EVT_TEXT_ENTER, self.change) + self.button = wx.Button(self, wx.ID_OK, u"Save") + bSizer1.Add(self.button, 0, wx.ALL, 5) + + self.SetSizer(bSizer1) + self.Layout() + self.Centre(wx.BOTH) + self.button.Bind(wx.EVT_BUTTON, self.change) + + def change(self, event): + sChar = service.Character.getInstance() + sChar.saveCharacterAs(self.charID, self.input.GetLineText(0)) + wx.PostEvent(self.parent, GE.CharListUpdated()) + + event.Skip() + self.Destroy() + diff --git a/gui/characterSelection.py b/gui/characterSelection.py index 2860493ea..990dc8bf5 100644 --- a/gui/characterSelection.py +++ b/gui/characterSelection.py @@ -81,7 +81,6 @@ class CharacterSelection(wx.Panel): choice.Clear() charList = sChar.getCharacterList() - sChar.getCharacterList() picked = False for id, name, active in charList: diff --git a/gui/mainFrame.py b/gui/mainFrame.py index 38ad1e968..df9c6ff87 100644 --- a/gui/mainFrame.py +++ b/gui/mainFrame.py @@ -43,7 +43,7 @@ from gui.marketBrowser import MarketBrowser, ItemSelected from gui.multiSwitch import MultiSwitch from gui.statsPane import StatsPane from gui.shipBrowser import ShipBrowser, FitSelected, ImportSelected, Stage3Selected -from gui.characterEditor import CharacterEditor +from gui.characterEditor import CharacterEditor, SaveCharacterAs from gui.characterSelection import CharacterSelection from gui.patternEditor import DmgPatternEditorDlg from gui.resistsEditor import ResistsEditorDlg @@ -416,6 +416,12 @@ class MainFrame(wx.Frame): self.Bind(wx.EVT_MENU, self.goWiki, id = menuBar.wikiId) # EVE Forums self.Bind(wx.EVT_MENU, self.goForums, id = menuBar.forumId) + # Save current character + self.Bind(wx.EVT_MENU, self.saveChar, id = menuBar.saveCharId) + # Save current character as another character + self.Bind(wx.EVT_MENU, self.saveCharAs, id = menuBar.saveCharAsId) + # Save current character + self.Bind(wx.EVT_MENU, self.revertChar, id = menuBar.revertCharId) #Clipboard exports self.Bind(wx.EVT_MENU, self.exportToClipboard, id=wx.ID_COPY) @@ -480,6 +486,24 @@ class MainFrame(wx.Frame): atable = wx.AcceleratorTable(actb) self.SetAcceleratorTable(atable) + def saveChar(self, event): + sChr = service.Character.getInstance() + charID = self.charSelection.getActiveCharacter() + sChr.saveCharacter(charID) + wx.PostEvent(self, GE.CharListUpdated()) + + def saveCharAs(self, event): + charID = self.charSelection.getActiveCharacter() + dlg = SaveCharacterAs(self, charID) + dlg.ShowModal() + dlg.Destroy() + + def revertChar(self, event): + sChr = service.Character.getInstance() + charID = self.charSelection.getActiveCharacter() + sChr.revertCharacter(charID) + wx.PostEvent(self, GE.CharListUpdated()) + def AdditionsTabSelect(self, event): selTab = self.additionsSelect.index(event.GetId()) diff --git a/gui/mainMenuBar.py b/gui/mainMenuBar.py index 880dfc385..7c971ae4d 100644 --- a/gui/mainMenuBar.py +++ b/gui/mainMenuBar.py @@ -23,6 +23,7 @@ from gui.bitmapLoader import BitmapLoader import gui.mainFrame import gui.graphFrame import gui.globalEvents as GE +import service class MainMenuBar(wx.MenuBar): def __init__(self): @@ -36,6 +37,9 @@ class MainMenuBar(wx.MenuBar): self.exportHtmlId = wx.NewId() self.wikiId = wx.NewId() self.forumId = wx.NewId() + self.saveCharId = wx.NewId() + self.saveCharAsId = wx.NewId() + self.revertCharId = wx.NewId() self.mainFrame = gui.mainFrame.MainFrame.getInstance() @@ -70,7 +74,10 @@ class MainMenuBar(wx.MenuBar): pasteText = "&From Clipboard" + ("\tCTRL+V" if 'wxMSW' in wx.PlatformInfo else "") editMenu.Append(wx.ID_COPY, copyText, "Export a fit to the clipboard") editMenu.Append(wx.ID_PASTE, pasteText, "Import a fit from the clipboard") - + editMenu.AppendSeparator() + editMenu.Append(self.saveCharId, "Save Character") + editMenu.Append(self.saveCharAsId, "Save Character As...") + editMenu.Append(self.revertCharId, "Revert Character") # Character menu windowMenu = wx.Menu() self.Append(windowMenu, "&Window") @@ -113,5 +120,14 @@ class MainMenuBar(wx.MenuBar): self.Enable(wx.ID_SAVEAS, enable) self.Enable(wx.ID_COPY, enable) self.Enable(self.exportSkillsNeededId, enable) - event.Skip() + sChar = service.Character.getInstance() + charID = self.mainFrame.charSelection.getActiveCharacter() + char = sChar.getCharacter(charID) + + # enable/disable character saving stuff + self.Enable(self.saveCharId, not char.ro and char.isDirty) + self.Enable(self.saveCharAsId, char.isDirty) + self.Enable(self.revertCharId, char.isDirty) + + event.Skip() diff --git a/service/character.py b/service/character.py index 1f2c78900..83e50bbaa 100644 --- a/service/character.py +++ b/service/character.py @@ -171,32 +171,49 @@ class Character(object): thread.start() def all0(self): - all0 = eos.types.Character.getAll0() - eos.db.commit() - return all0 + return eos.types.Character.getAll0() def all0ID(self): return self.all0().ID def all5(self): - all5 = eos.types.Character.getAll5() - eos.db.commit() - return all5 + return eos.types.Character.getAll5() def all5ID(self): return self.all5().ID def getCharacterList(self): baseChars = [eos.types.Character.getAll0(), eos.types.Character.getAll5()] - # Flush incase all0 & all5 weren't in the db yet - eos.db.commit() sFit = service.Fit.getInstance() - return map(lambda c: (c.ID, c.name, c == sFit.character), eos.db.getCharacterList()) + + return map(lambda c: (c.ID, c.name if not c.isDirty else "{} *".format(c.name), c == sFit.character), eos.db.getCharacterList()) def getCharacter(self, charID): char = eos.db.getCharacter(charID) return char + def saveCharacter(self, charID): + """Save edited skills""" + if charID == self.all5ID() or charID == self.all0ID(): + return + char = eos.db.getCharacter(charID) + char.saveLevels() + + def saveCharacterAs(self, charID, newName): + """Save edited skills as a new character""" + char = eos.db.getCharacter(charID) + newChar = copy.deepcopy(char) + newChar.name = newName + eos.db.save(newChar) + + # revert old char + char.revertLevels() + + def revertCharacter(self, charID): + """Rollback edited skills""" + char = eos.db.getCharacter(charID) + char.revertLevels() + def getSkillGroups(self): cat = eos.db.getCategory(16) groups = [] @@ -221,20 +238,23 @@ class Character(object): def getSkillLevel(self, charID, skillID): skill = eos.db.getCharacter(charID).getSkill(skillID) - return skill.level if skill.learned else "Not learned" + return (skill.level if skill.learned else "Not learned", skill.isDirty) - def rename(self, charID, newName): - char = eos.db.getCharacter(charID) - char.name = newName - eos.db.commit() + def getDirtySkills(self, charID): + return eos.db.getCharacter(charID).dirtySkills + + def getCharName(self, charID): + return eos.db.getCharacter(charID).name def new(self): char = eos.types.Character("New Character") eos.db.save(char) return char.ID - def getCharName(self, charID): - return eos.db.getCharacter(charID).name + def rename(self, charID, newName): + char = eos.db.getCharacter(charID) + char.name = newName + eos.db.commit() def copy(self, charID): char = eos.db.getCharacter(charID) @@ -259,7 +279,7 @@ class Character(object): id, key, default, _ = self.getApiDetails(charID) return id is not "" and key is not "" and default is not "" - def charList(self, charID, userID, apiKey): + def apiCharList(self, charID, userID, apiKey): char = eos.db.getCharacter(charID) char.apiID = userID @@ -298,7 +318,7 @@ class Character(object): char.apiUpdateCharSheet(skills) eos.db.commit() - def changeLevel(self, charID, skillID, level): + def changeLevel(self, charID, skillID, level, persist=False): char = eos.db.getCharacter(charID) skill = char.getSkill(skillID) if isinstance(level, basestring) or level > 5 or level < 0: @@ -306,8 +326,21 @@ class Character(object): else: skill.level = level + if persist: + skill.saveLevel() + eos.db.commit() + def revertLevel(self, charID, skillID): + char = eos.db.getCharacter(charID) + skill = char.getSkill(skillID) + skill.revert() + + def saveSkill(self, charID, skillID): + char = eos.db.getCharacter(charID) + skill = char.getSkill(skillID) + skill.saveLevel() + def addImplant(self, charID, itemID): char = eos.db.getCharacter(charID) implant = eos.types.Implant(eos.db.getItem(itemID)) diff --git a/service/fit.py b/service/fit.py index ce400bdf1..e905dde9f 100644 --- a/service/fit.py +++ b/service/fit.py @@ -932,21 +932,32 @@ class Fit(object): self.checkStates(fit, base) # Old state : New State - localMap = {State.OVERHEATED: State.ACTIVE, - State.ACTIVE: State.ONLINE, - State.OFFLINE: State.ONLINE, - State.ONLINE: State.ACTIVE} - projectedMap = {State.OVERHEATED: State.ACTIVE, - State.ACTIVE: State.OFFLINE, - State.OFFLINE: State.ACTIVE, - State.ONLINE: State.ACTIVE} # Just in case + localMap = { + State.OVERHEATED: State.ACTIVE, + State.ACTIVE: State.ONLINE, + State.OFFLINE: State.ONLINE, + State.ONLINE: State.ACTIVE} + projectedMap = { + State.OVERHEATED: State.ACTIVE, + State.ACTIVE: State.OFFLINE, + State.OFFLINE: State.ACTIVE, + State.ONLINE: State.ACTIVE} # Just in case + # For system effects. They should only ever be online or offline + projectedSystem = { + State.OFFLINE: State.ONLINE, + State.ONLINE: State.OFFLINE} def __getProposedState(self, mod, click, proposedState=None): - if mod.slot is Slot.SUBSYSTEM or mod.isEmpty: + if mod.slot == Slot.SUBSYSTEM or mod.isEmpty: return State.ONLINE + if mod.slot == Slot.SYSTEM: + transitionMap = self.projectedSystem + else: + transitionMap = self.projectedMap if mod.projected else self.localMap + currState = mod.state - transitionMap = self.projectedMap if mod.projected else self.localMap + if proposedState is not None: state = proposedState elif click == "right": diff --git a/service/market.py b/service/market.py index ae31f31b9..e0a77b8b3 100644 --- a/service/market.py +++ b/service/market.py @@ -233,8 +233,6 @@ class Market(): "Mobile Decoy Unit": False, # Seems to be left over test mod for deployables "Tournament Micro Jump Unit": False, # Normally seen only on tournament arenas "Council Diplomatic Shuttle": False, # CSM X celebration] - "Imp": False, # AT13 prize - "Fiend": False, # AT13 prize } # do not publish ships that we convert diff --git a/staticdata/eve.db b/staticdata/eve.db index 58076e353..785349e3f 100644 Binary files a/staticdata/eve.db and b/staticdata/eve.db differ diff --git a/utils/timer.py b/utils/timer.py index da355cba9..e852d8603 100644 --- a/utils/timer.py +++ b/utils/timer.py @@ -16,7 +16,7 @@ class Timer(): return (time.time() - self.__last)*1000 def checkpoint(self, name=''): - text = 'Timer - {timer} - {checkpoint} - {last:.2f}ms ({elapsed:.2f}ms elapsed)'.format( + text = u'Timer - {timer} - {checkpoint} - {last:.2f}ms ({elapsed:.2f}ms elapsed)'.format( timer=self.name, checkpoint=name, last=self.last,