def make_paste_effect(): paste_effect = EffectFactory.make( effect_id=EosEffectId.ancillary_paste_armor_rep_boost, category_id=EffectCategoryId.passive, is_offensive=False, is_assistance=False, build_status=EffectBuildStatus.custom, modifiers=(AncillaryRepAmountModifier(),)) return paste_effect
def mkeffect(self, effect_id=None, customize=True, **kwargs): # Allocate & verify ID if effect_id is None: effect_id = self.allocate_effect_id() if effect_id in self.__effect_data: raise KeyError(effect_id) # Create, store and return effect if customize: effect = EffectFactory.make(effect_id=effect_id, **kwargs) else: effect = Effect(effect_id=effect_id, **kwargs) self.__effect_data[effect.id] = effect return effect
def __effect_decompress(self, effect_data): """Reconstruct effect from python primitives.""" return EffectFactory.make(effect_id=effect_data[0], category_id=effect_data[1], is_offensive=effect_data[2], is_assistance=effect_data[3], duration_attr_id=effect_data[4], discharge_attr_id=effect_data[5], range_attr_id=effect_data[6], falloff_attr_id=effect_data[7], tracking_speed_attr_id=effect_data[8], fitting_usage_chance_attr_id=effect_data[9], resist_attr_id=effect_data[10], build_status=effect_data[11], modifiers=tuple( self.__modifier_decompress(md) for md in effect_data[12]))
def make_missile_dmg_effect(): modifiers = [] for dmg_attr_id in (AttrId.em_dmg, AttrId.therm_dmg, AttrId.kin_dmg, AttrId.expl_dmg): modifiers.append( DogmaModifier( affectee_filter=ModAffecteeFilter.owner_skillrq, affectee_domain=ModDomain.character, affectee_filter_extra_arg=TypeId.missile_launcher_operation, affectee_attr_id=dmg_attr_id, operator=ModOperator.post_mul_immune, aggregate_mode=ModAggregateMode.stack, affector_attr_id=AttrId.missile_dmg_mult)) missile_dmg_effect = EffectFactory.make( effect_id=EosEffectId.char_missile_dmg, category_id=EffectCategoryId.passive, is_offensive=False, is_assistance=False, build_status=EffectBuildStatus.custom, modifiers=tuple(modifiers)) return missile_dmg_effect
def make_missile_dmg_effect(): modifiers = [] for dmg_attr_id in ( AttrId.em_dmg, AttrId.therm_dmg, AttrId.kin_dmg, AttrId.expl_dmg ): modifiers.append(DogmaModifier( affectee_filter=ModAffecteeFilter.owner_skillrq, affectee_domain=ModDomain.character, affectee_filter_extra_arg=TypeId.missile_launcher_operation, affectee_attr_id=dmg_attr_id, operator=ModOperator.post_mul_immune, aggregate_mode=ModAggregateMode.stack, affector_attr_id=AttrId.missile_dmg_mult)) missile_dmg_effect = EffectFactory.make( effect_id=EosEffectId.char_missile_dmg, category_id=EffectCategoryId.passive, is_offensive=False, is_assistance=False, build_status=EffectBuildStatus.custom, modifiers=tuple(modifiers)) return missile_dmg_effect
# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .direct_dmg import DoomsdayDirect EffectFactory.register_class_by_id( DoomsdayDirect, EffectId.super_weapon_amarr) EffectFactory.register_class_by_id( DoomsdayDirect, EffectId.super_weapon_caldari) EffectFactory.register_class_by_id( DoomsdayDirect, EffectId.super_weapon_gallente) EffectFactory.register_class_by_id( DoomsdayDirect, EffectId.super_weapon_minmatar)
# Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .base import RemoteArmorRepairEffect class NpcEntityRemoteArmorRepairer(RemoteArmorRepairEffect): def get_rep_amount(self, item): return item.attrs.get(AttrId.armor_dmg_amount, 0) EffectFactory.register_class_by_id( NpcEntityRemoteArmorRepairer, EffectId.npc_entity_remote_armor_repairer)
from eos.const.eos import EffectBuildStatus from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .modifier import make_hardpoint_modifiers from .modifier import make_slot_modifiers logger = getLogger(__name__) def add_hardpoint_modifiers(effect): if effect.modifiers: msg = 'hardpoint amount bonus effect has modifiers, overwriting them' logger.warning(msg) effect.modifiers = make_hardpoint_modifiers() effect.build_status = EffectBuildStatus.custom def add_slot_modifiers(effect): if effect.modifiers: msg = 'slot amount bonus effect has modifiers, overwriting them' logger.warning(msg) effect.modifiers = make_slot_modifiers() effect.build_status = EffectBuildStatus.custom EffectFactory.register_instance_by_id(add_hardpoint_modifiers, EffectId.hardpoint_modifier_effect) EffectFactory.register_instance_by_id(add_slot_modifiers, EffectId.slot_modifier)
# Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .base import RemoteArmorRepairEffect class ShipModuleRemoteArmorMutadaptiveRepairer(RemoteArmorRepairEffect): def get_rep_amount(self, item): rep_amount = item.attrs.get(AttrId.armor_dmg_amount, 0) try: spoolup_mult = 1 + item.attrs[AttrId.repair_mult_bonus_max] except KeyError: spoolup_mult = 1 return rep_amount * spoolup_mult EffectFactory.register_class_by_id( ShipModuleRemoteArmorMutadaptiveRepairer, EffectId.ship_module_remote_armor_mutadaptive_repairer)
# Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .attack_m import FighterAbilityAttackM from .kamikaze import FighterAbilityKamikaze from .launch_bomb import FighterAbilityLaunchBomb from .missiles import FighterAbilityMissiles EffectFactory.register_class_by_id( FighterAbilityAttackM, EffectId.fighter_ability_attack_m) EffectFactory.register_class_by_id( FighterAbilityKamikaze, EffectId.fighter_ability_kamikaze) EffectFactory.register_class_by_id( FighterAbilityLaunchBomb, EffectId.fighter_ability_launch_bomb) EffectFactory.register_class_by_id( FighterAbilityMissiles, EffectId.fighter_ability_missiles)
# Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .base import BaseNeutEffect class EnergyNeutralizerFalloff(BaseNeutEffect): def get_neut_amount(self, item): return item.attrs.get(AttrId.energy_neutralizer_amount, 0) EffectFactory.register_class_by_id( EnergyNeutralizerFalloff, EffectId.energy_neutralizer_falloff)
from eos.const.eos import EffectBuildStatus from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .modifier import make_ab_modifiers from .modifier import make_mwd_modifiers logger = getLogger(__name__) def add_ab_modifiers(effect): if effect.modifiers: msg = 'afterburner effect has modifiers, overwriting them' logger.info(msg) effect.modifiers = make_ab_modifiers() effect.build_status = EffectBuildStatus.custom def add_mwd_modifiers(effect): if effect.modifiers: msg = 'microwarpdrive effect has modifiers, overwriting them' logger.info(msg) effect.modifiers = make_mwd_modifiers() effect.build_status = EffectBuildStatus.custom EffectFactory.register_instance_by_id(add_ab_modifiers, EffectId.module_bonus_afterburner) EffectFactory.register_instance_by_id(add_mwd_modifiers, EffectId.module_bonus_microwarpdrive)
# Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .base import BaseCapTransmitEffect class ShipModuleRemoteCapacitorTransmitter(BaseCapTransmitEffect): def get_cap_transmit_amount(self, item): return item.attrs.get(AttrId.power_transfer_amount, 0) EffectFactory.register_class_by_id( ShipModuleRemoteCapacitorTransmitter, EffectId.ship_module_remote_capacitor_transmitter)
# # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from eos.stats_container import DmgStats from .base import DmgDealerEffect class EmpWave(DmgDealerEffect): def get_volley(self, item): em = item.attrs.get(AttrId.em_dmg, 0) therm = item.attrs.get(AttrId.therm_dmg, 0) kin = item.attrs.get(AttrId.kin_dmg, 0) expl = item.attrs.get(AttrId.expl_dmg, 0) return DmgStats(em, therm, kin, expl) def get_applied_volley(self, item, tgt_data): raise NotImplementedError EffectFactory.reg_cust_class_by_id(EmpWave, EffectId.emp_wave)
# Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .base import RemoteShieldRepairEffect class NpcEntityRemoteShieldBooster(RemoteShieldRepairEffect): def get_rep_amount(self, item): return item.attrs.get(AttrId.shield_bonus, 0) EffectFactory.register_class_by_id( NpcEntityRemoteShieldBooster, EffectId.npc_entity_remote_shield_booster)
def add_missile_dmg_modifiers_expl(effect): _add_missile_dmg_modifiers(effect, AttrId.expl_dmg) def add_drone_dmg_modifiers(effect): if effect.modifiers: msg = 'drone self skillreq dmg effect has modifiers, overwriting them' logger.warning(msg) effect.modifiers = make_drone_dmg_modifiers() effect.build_status = EffectBuildStatus.custom EffectFactory.register_instance_by_id( add_missile_rof_modifiers, EffectId.self_rof) EffectFactory.register_instance_by_id( add_missile_dmg_modifiers_em, EffectId.missile_em_dmg_bonus) EffectFactory.register_instance_by_id( add_missile_dmg_modifiers_therm, EffectId.missile_therm_dmg_bonus) EffectFactory.register_instance_by_id( add_missile_dmg_modifiers_kin, EffectId.missile_kin_dmg_bonus2) EffectFactory.register_instance_by_id( add_missile_dmg_modifiers_expl, EffectId.missile_expl_dmg_bonus) EffectFactory.register_instance_by_id( add_drone_dmg_modifiers,
# ============================================================================== """ In CCP dogma code, 'online' effect has custom processing. Actual effect has 'active' effect category, which lets all item types with it to be in active state according to eos' effect handling. We do not want any special processing, thus just fix it here. """ from logging import getLogger from eos.const.eve import EffectCategoryId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory logger = getLogger(__name__) def fix_online_category(effect): if effect.category_id == EffectCategoryId.online: msg = 'online effect category does not need to be adjusted' logger.info(msg) else: effect.category_id = EffectCategoryId.online EffectFactory.register_instance_by_id(fix_online_category, EffectId.online)
# This file is part of Eos. # # Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .base import WarfareBuffEffect class ModuleBonusWarfareLinkSkirmish(WarfareBuffEffect): friendly_only = True EffectFactory.register_class_by_id( ModuleBonusWarfareLinkSkirmish, EffectId.module_bonus_warfare_link_skirmish)
# Copyright (C) 2011 Diego Duclos # Copyright (C) 2011-2018 Anton Vorobyov # # This file is part of Eos. # # Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .direct_dmg import DoomsdayDirect EffectFactory.reg_cust_class_by_id(DoomsdayDirect, EffectId.super_weapon_amarr) EffectFactory.reg_cust_class_by_id(DoomsdayDirect, EffectId.super_weapon_caldari) EffectFactory.reg_cust_class_by_id(DoomsdayDirect, EffectId.super_weapon_gallente) EffectFactory.reg_cust_class_by_id(DoomsdayDirect, EffectId.super_weapon_minmatar)
# it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from eos.eve_obj.effect.helper_func import get_cycles_until_reload_generic from .base import LocalArmorRepairEffect class FueledArmorRepair(LocalArmorRepairEffect): def get_cycles_until_reload(self, item): return get_cycles_until_reload_generic(item) def get_rep_amount(self, item): return item.attrs.get(AttrId.armor_dmg_amount, 0) EffectFactory.register_class_by_id(FueledArmorRepair, EffectId.fueled_armor_repair)
# Copyright (C) 2011-2018 Anton Vorobyov # # This file is part of Eos. # # Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .base import WarfareBuffEffect class ModuleBonusWarfareLinkArmor(WarfareBuffEffect): friendly_only = True EffectFactory.register_class_by_id(ModuleBonusWarfareLinkArmor, EffectId.module_bonus_warfare_link_armor)
class UseMissiles(DmgDealerEffect): def get_cycles_until_reload(self, item): return get_cycles_until_reload_generic(item) def get_volley(self, item): if not self.get_cycles_until_reload(item): return DmgStats(0, 0, 0, 0) # If module can cycle until reload, it means we can assume that there's # a charge loaded charge = self.get_charge(item) charge_defeff_id = charge._type_default_effect_id if (charge_defeff_id is None or charge_defeff_id not in charge._running_effect_ids or charge_defeff_id not in (EffectId.missile_launching, EffectId.fof_missile_launching, EffectId.bomb_launching)): return DmgStats(0, 0, 0, 0) em = charge.attrs.get(AttrId.em_dmg, 0) therm = charge.attrs.get(AttrId.therm_dmg, 0) kin = charge.attrs.get(AttrId.kin_dmg, 0) expl = charge.attrs.get(AttrId.expl_dmg, 0) return DmgStats(em, therm, kin, expl) def get_applied_volley(self, item, tgt_data): raise NotImplementedError EffectFactory.reg_cust_class_by_id(UseMissiles, EffectId.use_missiles)
# # This file is part of Eos. # # Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .base import BaseNeutEffect class EntityEnergyNeutralizerFalloff(BaseNeutEffect): def get_neut_amount(self, item): return item.attrs.get(AttrId.energy_neutralizer_amount, 0) EffectFactory.register_class_by_id(EntityEnergyNeutralizerFalloff, EffectId.entity_energy_neutralizer_falloff)
# ============================================================================== # Copyright (C) 2011 Diego Duclos # Copyright (C) 2011-2018 Anton Vorobyov # # This file is part of Eos. # # Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .projectile_fired import ProjectileFired from .target_abc_attack import TargetABCAttack from .target_attack import TargetAttack EffectFactory.register_class_by_id(ProjectileFired, EffectId.projectile_fired) EffectFactory.register_class_by_id(TargetABCAttack, EffectId.target_abc_attack) EffectFactory.register_class_by_id(TargetAttack, EffectId.target_attack)
# # Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .base import BaseNeutEffect class EnergyNosferatuFalloff(BaseNeutEffect): def get_neut_amount(self, item): if item.attrs.get(AttrId.nos_override, 0): return item.attrs.get(AttrId.power_transfer_amount, 0) return 0 EffectFactory.register_class_by_id(EnergyNosferatuFalloff, EffectId.energy_nosferatu_falloff)
Effect.__init__(self, *args, **kwargs) max_range_modifier = DogmaModifier( affectee_filter=ModAffecteeFilter.domain_skillrq, affectee_domain=ModDomain.target, affectee_filter_extra_arg=TypeId.gunnery, affectee_attr_id=AttrId.max_range, operator=ModOperator.post_percent, affector_attr_id=AttrId.max_range_bonus) falloff_modifier = DogmaModifier( affectee_filter=ModAffecteeFilter.domain_skillrq, affectee_domain=ModDomain.target, affectee_filter_extra_arg=TypeId.gunnery, affectee_attr_id=AttrId.falloff, operator=ModOperator.post_percent, affector_attr_id=AttrId.falloff_bonus) tracking_speed_modifier = DogmaModifier( affectee_filter=ModAffecteeFilter.domain_skillrq, affectee_domain=ModDomain.target, affectee_filter_extra_arg=TypeId.gunnery, affectee_attr_id=AttrId.tracking_speed, operator=ModOperator.post_percent, affector_attr_id=AttrId.tracking_speed_bonus) self.modifiers = ( *self.modifiers, max_range_modifier, falloff_modifier, tracking_speed_modifier) EffectFactory.reg_cust_class_by_id( ShipModuleTrackingDisruptor, EffectId.ship_module_tracking_disruptor)
from eos.const.eos import ModAffecteeFilter from eos.const.eos import ModAggregateMode from eos.const.eos import ModDomain from eos.const.eos import ModOperator from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import Effect from eos.eve_obj.effect import EffectFactory from eos.eve_obj.modifier import DogmaModifier class RemoteWebifierFalloff(Effect): def __init__(self, *args, resist_attr_id=None, **kwargs): Effect.__init__( self, *args, resist_attr_id=AttrId.stasis_webifier_resist, **kwargs) modifier = DogmaModifier( affectee_filter=ModAffecteeFilter.item, affectee_domain=ModDomain.target, affectee_attr_id=AttrId.max_velocity, operator=ModOperator.post_percent, aggregate_mode=ModAggregateMode.stack, affector_attr_id=AttrId.speed_factor) self.modifiers = (*self.modifiers, modifier) EffectFactory.register_class_by_id( RemoteWebifierFalloff, EffectId.remote_webifier_falloff)
# GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from eos.stats_container import DmgStats from .base import DmgDealerEffect class EmpWave(DmgDealerEffect): def get_volley(self, item): em = item.attrs.get(AttrId.em_dmg, 0) therm = item.attrs.get(AttrId.therm_dmg, 0) kin = item.attrs.get(AttrId.kin_dmg, 0) expl = item.attrs.get(AttrId.expl_dmg, 0) return DmgStats(em, therm, kin, expl) def get_applied_volley(self, item, tgt_data): raise NotImplementedError EffectFactory.register_class_by_id( EmpWave, EffectId.emp_wave)
# Copyright (C) 2011-2018 Anton Vorobyov # # This file is part of Eos. # # Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .base import WarfareBuffEffect class ModuleBonusWarfareLinkMining(WarfareBuffEffect): friendly_only = True EffectFactory.register_class_by_id(ModuleBonusWarfareLinkMining, EffectId.module_bonus_warfare_link_mining)
# Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .base import LocalArmorRepairEffect class ArmorRepair(LocalArmorRepairEffect): def get_rep_amount(self, item): return item.attrs.get(AttrId.armor_dmg_amount, 0) EffectFactory.register_class_by_id( ArmorRepair, EffectId.armor_repair)
# # This file is part of Eos. # # Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .base import RemoteShieldRepairEffect class NpcEntityRemoteShieldBooster(RemoteShieldRepairEffect): def get_rep_amount(self, item): return item.attrs.get(AttrId.shield_bonus, 0) EffectFactory.register_class_by_id(NpcEntityRemoteShieldBooster, EffectId.npc_entity_remote_shield_booster)
def get_volley(self, item): if not self.get_cycles_until_reload(item): return DmgStats(0, 0, 0, 0) # If module can cycle until reload, it means we can assume that there's # a charge loaded charge = self.get_charge(item) charge_defeff_id = charge._type_default_effect_id if ( charge_defeff_id is None or charge_defeff_id not in charge._running_effect_ids or charge_defeff_id not in ( EffectId.missile_launching, EffectId.fof_missile_launching, EffectId.bomb_launching) ): return DmgStats(0, 0, 0, 0) em = charge.attrs.get(AttrId.em_dmg, 0) therm = charge.attrs.get(AttrId.therm_dmg, 0) kin = charge.attrs.get(AttrId.kin_dmg, 0) expl = charge.attrs.get(AttrId.expl_dmg, 0) return DmgStats(em, therm, kin, expl) def get_applied_volley(self, item, tgt_data): raise NotImplementedError EffectFactory.register_class_by_id( UseMissiles, EffectId.use_missiles)
# # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from eos.stats_container import DmgStats from .base import DmgDealerEffect class EmpWave(DmgDealerEffect): def get_volley(self, item): em = item.attrs.get(AttrId.em_dmg, 0) therm = item.attrs.get(AttrId.therm_dmg, 0) kin = item.attrs.get(AttrId.kin_dmg, 0) expl = item.attrs.get(AttrId.expl_dmg, 0) return DmgStats(em, therm, kin, expl) def get_applied_volley(self, item, tgt_data): raise NotImplementedError EffectFactory.register_class_by_id(EmpWave, EffectId.emp_wave)
# Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .base import RemoteArmorRepairEffect class ShipModuleRemoteArmorRepairer(RemoteArmorRepairEffect): def get_rep_amount(self, item): return item.attrs.get(AttrId.armor_dmg_amount, 0) EffectFactory.register_class_by_id( ShipModuleRemoteArmorRepairer, EffectId.ship_module_remote_armor_repairer)
from eos.const.eos import ModAffecteeFilter from eos.const.eos import ModAggregateMode from eos.const.eos import ModDomain from eos.const.eos import ModOperator from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import Effect from eos.eve_obj.effect import EffectFactory from eos.eve_obj.modifier import DogmaModifier class RemoteSensorDampFalloff(Effect): def __init__(self, *args, resist_attr_id=None, **kwargs): Effect.__init__( self, *args, resist_attr_id=AttrId.sensor_dampener_resist, **kwargs) modifier = DogmaModifier( affectee_filter=ModAffecteeFilter.item, affectee_domain=ModDomain.target, affectee_attr_id=AttrId.max_target_range, operator=ModOperator.post_percent, aggregate_mode=ModAggregateMode.stack, affector_attr_id=AttrId.max_target_range_bonus) self.modifiers = (*self.modifiers, modifier) EffectFactory.register_class_by_id( RemoteSensorDampFalloff, EffectId.remote_sensor_damp_falloff)
# it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .projectile_fired import ProjectileFired from .target_abc_attack import TargetABCAttack from .target_attack import TargetAttack EffectFactory.register_class_by_id( ProjectileFired, EffectId.projectile_fired) EffectFactory.register_class_by_id( TargetABCAttack, EffectId.target_abc_attack) EffectFactory.register_class_by_id( TargetAttack, EffectId.target_attack)
# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .base import BaseNeutEffect class EnergyNosferatuFalloff(BaseNeutEffect): def get_neut_amount(self, item): if item.attrs.get(AttrId.nos_override, 0): return item.attrs.get(AttrId.power_transfer_amount, 0) return 0 EffectFactory.register_class_by_id( EnergyNosferatuFalloff, EffectId.energy_nosferatu_falloff)
# Copyright (C) 2011-2018 Anton Vorobyov # # This file is part of Eos. # # Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .base import WarfareBuffEffect class ModuleBonusWarfareLinkShield(WarfareBuffEffect): friendly_only = True EffectFactory.register_class_by_id(ModuleBonusWarfareLinkShield, EffectId.module_bonus_warfare_link_shield)
# but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== import math from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from eos.eve_obj.effect.helper_func import get_cycles_until_reload_generic from .base import RemoteShieldRepairEffect class ShipModuleAncillaryRemoteShieldBooster(RemoteShieldRepairEffect): def get_cycles_until_reload(self, item): return get_cycles_until_reload_generic(item, default=math.inf) def get_rep_amount(self, item): return item.attrs.get(AttrId.shield_bonus, 0) EffectFactory.register_class_by_id( ShipModuleAncillaryRemoteShieldBooster, EffectId.ship_module_ancillary_remote_shield_booster)
from eos.eve_obj.effect import EffectFactory from .modifier import make_ab_modifiers from .modifier import make_mwd_modifiers logger = getLogger(__name__) def add_ab_modifiers(effect): if effect.modifiers: msg = 'afterburner effect has modifiers, overwriting them' logger.info(msg) effect.modifiers = make_ab_modifiers() effect.build_status = EffectBuildStatus.custom def add_mwd_modifiers(effect): if effect.modifiers: msg = 'microwarpdrive effect has modifiers, overwriting them' logger.info(msg) effect.modifiers = make_mwd_modifiers() effect.build_status = EffectBuildStatus.custom EffectFactory.register_instance_by_id( add_ab_modifiers, EffectId.module_bonus_afterburner) EffectFactory.register_instance_by_id( add_mwd_modifiers, EffectId.module_bonus_microwarpdrive)
from eos.eve_obj.effect import EffectFactory from .modifier import make_hardpoint_modifiers from .modifier import make_slot_modifiers logger = getLogger(__name__) def add_hardpoint_modifiers(effect): if effect.modifiers: msg = 'hardpoint amount bonus effect has modifiers, overwriting them' logger.warning(msg) effect.modifiers = make_hardpoint_modifiers() effect.build_status = EffectBuildStatus.custom def add_slot_modifiers(effect): if effect.modifiers: msg = 'slot amount bonus effect has modifiers, overwriting them' logger.warning(msg) effect.modifiers = make_slot_modifiers() effect.build_status = EffectBuildStatus.custom EffectFactory.register_instance_by_id( add_hardpoint_modifiers, EffectId.hardpoint_modifier_effect) EffectFactory.register_instance_by_id( add_slot_modifiers, EffectId.slot_modifier)
# This file is part of Eos. # # Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .base import BaseCapTransmitEffect class ShipModuleRemoteCapacitorTransmitter(BaseCapTransmitEffect): def get_cap_transmit_amount(self, item): return item.attrs.get(AttrId.power_transfer_amount, 0) EffectFactory.register_class_by_id( ShipModuleRemoteCapacitorTransmitter, EffectId.ship_module_remote_capacitor_transmitter)
# (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== import math from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from eos.eve_obj.effect.helper_func import get_cycles_until_reload_generic from .base import LocalShieldRepairEffect class FueledShieldBoosting(LocalShieldRepairEffect): def get_cycles_until_reload(self, item): return get_cycles_until_reload_generic(item, default=math.inf) def get_rep_amount(self, item): return item.attrs.get(AttrId.shield_bonus, 0) EffectFactory.register_class_by_id(FueledShieldBoosting, EffectId.fueled_shield_boosting)
affectee_domain=ModDomain.target, affectee_filter_extra_arg=TypeId.gunnery, affectee_attr_id=AttrId.max_range, operator=ModOperator.post_percent, aggregate_mode=ModAggregateMode.stack, affector_attr_id=AttrId.max_range_bonus) falloff_modifier = DogmaModifier( affectee_filter=ModAffecteeFilter.domain_skillrq, affectee_domain=ModDomain.target, affectee_filter_extra_arg=TypeId.gunnery, affectee_attr_id=AttrId.falloff, operator=ModOperator.post_percent, aggregate_mode=ModAggregateMode.stack, affector_attr_id=AttrId.falloff_bonus) tracking_speed_modifier = DogmaModifier( affectee_filter=ModAffecteeFilter.domain_skillrq, affectee_domain=ModDomain.target, affectee_filter_extra_arg=TypeId.gunnery, affectee_attr_id=AttrId.tracking_speed, operator=ModOperator.post_percent, aggregate_mode=ModAggregateMode.stack, affector_attr_id=AttrId.tracking_speed_bonus) self.modifiers = ( *self.modifiers, max_range_modifier, falloff_modifier, tracking_speed_modifier) EffectFactory.register_class_by_id( ShipModuleTrackingDisruptor, EffectId.ship_module_tracking_disruptor)
# GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== """ In CCP dogma code, 'online' effect has custom processing. Actual effect has 'active' effect category, which lets all item types with it to be in active state according to eos' effect handling. We do not want any special processing, thus just fix it here. """ from logging import getLogger from eos.const.eve import EffectCategoryId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory logger = getLogger(__name__) def fix_online_category(effect): if effect.category_id == EffectCategoryId.online: msg = 'online effect category does not need to be adjusted' logger.info(msg) else: effect.category_id = EffectCategoryId.online EffectFactory.register_instance_by_id(fix_online_category, EffectId.online)
# Copyright (C) 2011-2018 Anton Vorobyov # # This file is part of Eos. # # Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .base import WarfareBuffEffect class ModuleBonusWarfareLinkInfo(WarfareBuffEffect): friendly_only = True EffectFactory.register_class_by_id(ModuleBonusWarfareLinkInfo, EffectId.module_bonus_warfare_link_info)
# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from eos.eve_obj.effect.helper_func import get_cycles_until_reload_generic from .base import RemoteArmorRepairEffect class ShipModuleAncillaryRemoteArmorRepairer(RemoteArmorRepairEffect): def get_cycles_until_reload(self, item): return get_cycles_until_reload_generic(item) def get_rep_amount(self, item): return item.attrs.get(AttrId.armor_dmg_amount, 0) EffectFactory.register_class_by_id( ShipModuleAncillaryRemoteArmorRepairer, EffectId.ship_module_ancillary_remote_armor_repairer)
# # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from logging import getLogger from eos.const.eos import EffectBuildStatus from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .modifier import make_rah_modifiers logger = getLogger(__name__) def add_rah_modifiers(effect): if effect.modifiers: msg = 'reactive armor hardener effect has modifiers, overwriting them' logger.warning(msg) effect.modifiers = make_rah_modifiers() effect.build_status = EffectBuildStatus.custom EffectFactory.reg_cust_instance_by_id(add_rah_modifiers, EffectId.adaptive_armor_hardener)
aoe_velocity_modifier = DogmaModifier( affectee_filter=ModAffecteeFilter.owner_skillrq, affectee_domain=ModDomain.target, affectee_filter_extra_arg=TypeId.missile_launcher_operation, affectee_attr_id=AttrId.aoe_velocity, operator=ModOperator.post_percent, affector_attr_id=AttrId.aoe_velocity_bonus) max_velocity_modifier = DogmaModifier( affectee_filter=ModAffecteeFilter.owner_skillrq, affectee_domain=ModDomain.target, affectee_filter_extra_arg=TypeId.missile_launcher_operation, affectee_attr_id=AttrId.max_velocity, operator=ModOperator.post_percent, affector_attr_id=AttrId.missile_velocity_bonus) explosion_delay_modifier = DogmaModifier( affectee_filter=ModAffecteeFilter.owner_skillrq, affectee_domain=ModDomain.target, affectee_filter_extra_arg=TypeId.missile_launcher_operation, affectee_attr_id=AttrId.explosion_delay, operator=ModOperator.post_percent, affector_attr_id=AttrId.explosion_delay_bonus) self.modifiers = ( *self.modifiers, aoe_cloud_size_modifier, aoe_velocity_modifier, max_velocity_modifier, explosion_delay_modifier) EffectFactory.reg_cust_class_by_id( ShipModuleGundanceDisruptor, EffectId.ship_module_guidance_disruptor)
# Eos is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Eos is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License # along with Eos. If not, see <http://www.gnu.org/licenses/>. # ============================================================================== from eos.const.eve import AttrId from eos.const.eve import EffectId from eos.eve_obj.effect import EffectFactory from .base import LocalShieldRepairEffect class ShieldBoosting(LocalShieldRepairEffect): def get_rep_amount(self, item): return item.attrs.get(AttrId.shield_bonus, 0) EffectFactory.register_class_by_id( ShieldBoosting, EffectId.shield_boosting)