예제 #1
0
 def __init__(self, *args, **kwargs):
     Effect.__init__(self, *args, **kwargs)
     aoe_cloud_size_modifier = DogmaModifier(
         affectee_filter=ModAffecteeFilter.owner_skillrq,
         affectee_domain=ModDomain.target,
         affectee_filter_extra_arg=TypeId.missile_launcher_operation,
         affectee_attr_id=AttrId.aoe_cloud_size,
         operator=ModOperator.post_percent,
         affector_attr_id=AttrId.aoe_cloud_size_bonus)
     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)
예제 #2
0
 def __init__(self, *args, **kwargs):
     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)
예제 #3
0
 def __init__(self, *args, **kwargs):
     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,
         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)
예제 #4
0
파일: web.py 프로젝트: jnowaczek/eos
 def __init__(self, *args, resist_attr_id=None, **kwargs):
     Effect.__init__(self,
                     *args,
                     resist_attr_id=AttrId.stasis_webifier_resistance,
                     **kwargs)
     modifier = DogmaModifier(affectee_filter=ModAffecteeFilter.item,
                              affectee_domain=ModDomain.target,
                              affectee_attr_id=AttrId.max_velocity,
                              operator=ModOperator.post_percent,
                              affector_attr_id=AttrId.speed_factor)
     self.modifiers = (*self.modifiers, modifier)
예제 #5
0
파일: damp.py 프로젝트: pyfa-org/eos
 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)
예제 #6
0
파일: web.py 프로젝트: DarkFenX/eos
 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)
예제 #7
0
파일: environment.py 프로젝트: pyfa-org/eos
 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
예제 #8
0
    def run(data):
        """Convert data into eve objects.

        Args:
            data: Dictionary in {table name: {table, rows}} format.

        Returns:
            3 iterables, which contain types, attributes and effects.
        """
        # Before actually instantiating anything, we need to collect some data
        # in convenient form
        # Format: {group ID: group row}
        groups_keyed = {}
        for row in data['evegroups']:
            groups_keyed[row['groupID']] = row
        # Format: {type ID: default effect ID}
        types_defeff_map = {}
        for row in data['dgmtypeeffects']:
            if row.get('isDefault') is True:
                types_defeff_map[row['typeID']] = row['effectID']
        # Format: {type ID: {effect IDs}}
        types_effects = {}
        for row in data['dgmtypeeffects']:
            types_effects.setdefault(row['typeID'], set()).add(row['effectID'])
        # Format: {type ID: {attribute ID: value}}
        types_attrs = {}
        for row in data['dgmtypeattribs']:
            type_attrs = types_attrs.setdefault(row['typeID'], {})
            type_attrs[row['attributeID']] = row['value']
        # Format: {type ID: {ability ID: (cooldown, charge quantity)}}
        types_abilities_data = {}
        for row in data['typefighterabils']:
            type_id = row['typeID']
            type_abilities_data = types_abilities_data.setdefault(type_id, {})
            type_abilities_data[row['abilityID']] = AbilityData(
                cooldown_time=row.get('cooldownSeconds', 0),
                charge_quantity=row.get('chargeCount', math.inf))

        # Convert attributes
        attrs = []
        for row in data['dgmattribs']:
            attrs.append(
                Attribute(attr_id=row['attributeID'],
                          max_attr_id=row.get('maxAttributeID'),
                          default_value=row.get('defaultValue'),
                          high_is_good=row.get('highIsGood'),
                          stackable=row.get('stackable')))

        # Convert effects
        effects = []
        mod_builder = ModBuilder(data['dgmexpressions'])
        for row in data['dgmeffects']:
            modifiers, build_status = mod_builder.build(row)
            effects.append(
                Effect(
                    effect_id=row['effectID'],
                    category_id=row.get('effectCategory'),
                    is_offensive=row.get('isOffensive'),
                    is_assistance=row.get('isAssistance'),
                    duration_attr_id=row.get('durationAttributeID'),
                    discharge_attr_id=row.get('dischargeAttributeID'),
                    range_attr_id=row.get('rangeAttributeID'),
                    falloff_attr_id=row.get('falloffAttributeID'),
                    tracking_speed_attr_id=row.get('trackingSpeedAttributeID'),
                    fitting_usage_chance_attr_id=(
                        row.get('fittingUsageChanceAttributeID')),
                    resist_attr_id=row.get('resistanceID'),
                    build_status=build_status,
                    modifiers=tuple(modifiers)))

        # Convert types
        types = []
        effect_map = {e.id: e for e in effects}
        for row in data['evetypes']:
            type_id = row['typeID']
            type_group = row.get('groupID')
            type_effect_ids = types_effects.get(type_id, set())
            type_effect_ids.intersection_update(effect_map)
            types.append(
                Type(type_id=type_id,
                     group_id=type_group,
                     category_id=groups_keyed.get(type_group,
                                                  {}).get('categoryID'),
                     attrs=types_attrs.get(type_id, {}),
                     effects=tuple(effect_map[eid] for eid in type_effect_ids),
                     default_effect=effect_map.get(
                         types_defeff_map.get(type_id)),
                     abilities_data=types_abilities_data.get(type_id, {})))

        return types, attrs, effects