From d110dd4c76d73e357ea51f32d507c817aaf50710 Mon Sep 17 00:00:00 2001 From: blitzmann Date: Sun, 20 May 2018 14:33:37 -0400 Subject: [PATCH] Implement xeon gas and electric store weather effects --- eos/effects/weatherelectricstorm.py | 13 ++++++++++--- eos/effects/weatherxenongas.py | 13 ++++++++++--- eos/saveddata/fit.py | 18 ++++++++++++++++++ 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/eos/effects/weatherelectricstorm.py b/eos/effects/weatherelectricstorm.py index 726601d67..708ce8925 100644 --- a/eos/effects/weatherelectricstorm.py +++ b/eos/effects/weatherelectricstorm.py @@ -1,6 +1,13 @@ runTime = "early" -type = ("projected", "passive") +type = ("projected", "passive", "gang") -def handler(fit, beacon, context): - pass +def handler(fit, beacon, context, **kwargs): + for x in range(1, 3): + if beacon.getModifiedItemAttr("warfareBuff{}ID".format(x)): + value = beacon.getModifiedItemAttr("warfareBuff{}Value".format(x)) + id = beacon.getModifiedItemAttr("warfareBuff{}ID".format(x)) + + if id: + fit.addCommandBonus(id, value, beacon, kwargs['effect'], 'early') + diff --git a/eos/effects/weatherxenongas.py b/eos/effects/weatherxenongas.py index 726601d67..708ce8925 100644 --- a/eos/effects/weatherxenongas.py +++ b/eos/effects/weatherxenongas.py @@ -1,6 +1,13 @@ runTime = "early" -type = ("projected", "passive") +type = ("projected", "passive", "gang") -def handler(fit, beacon, context): - pass +def handler(fit, beacon, context, **kwargs): + for x in range(1, 3): + if beacon.getModifiedItemAttr("warfareBuff{}ID".format(x)): + value = beacon.getModifiedItemAttr("warfareBuff{}Value".format(x)) + id = beacon.getModifiedItemAttr("warfareBuff{}ID".format(x)) + + if id: + fit.addCommandBonus(id, value, beacon, kwargs['effect'], 'early') + diff --git a/eos/saveddata/fit.py b/eos/saveddata/fit.py index b9b01f229..19a8dd479 100644 --- a/eos/saveddata/fit.py +++ b/eos/saveddata/fit.py @@ -672,6 +672,24 @@ class Fit(object): groups = ("Energy Weapon", "Hybrid Weapon") self.modules.filteredItemBoost(lambda mod: mod.item.group.name in groups, "maxRange", value, stackingPenalties=True) + # Abysmal Weather Effects + + if warfareBuffID == 90: # Weather_electric_storm_EM_resistance_penalty + for tankType in ("shield", "armor"): + self.ship.boostItemAttr("{}EmDamageResonance".format(tankType), value) + self.ship.boostItemAttr("emDamageResonance", value) # for hull + + if warfareBuffID == 92: # Weather_electric_storm_capacitor_recharge_bonus + self.ship.boostItemAttr("rechargeRate", value, stackingPenalties=True) + + if warfareBuffID == 93: # Weather_xenon_gas_explosive_resistance_penalty + for tankType in ("shield", "armor"): + self.ship.boostItemAttr("{}ExplosiveDamageResonance".format(tankType), value) + self.ship.boostItemAttr("explosiveDamageResonance", value) # for hull + + if warfareBuffID == 94: # Weather_xenon_gas_shield_hp_bonus + self.ship.boostItemAttr("shieldCapacity", value) # for hull + if warfareBuffID == 95: # Weather_infernal_thermal_resistance_penalty for tankType in ("shield", "armor"): self.ship.boostItemAttr("{}ThermalDamageResonance".format(tankType), value)