parameters: (full_data_set, pregen_converter_group)
docstring: Generate fallback types and other standard objects for effects and resistances.
  
          :param full_data_set: GenieObjectContainer instance that
                                contains all relevant data for the conversion
                                process.
          :type full_data_set: ...dataformat.aoc.genie_object_container.GenieObjectContainer
          :param pregen_converter_group: GenieObjectGroup instance that stores
                                         pregenerated API objects for referencing with
                                         ForwardRef
          :type pregen_converter_group: ...dataformat.aoc.genie_object_container.GenieObjectGroup
docstring_summary: Generate fallback types and other standard objects for effects and resistances.
docstring_tokens: Generate fallback types and other standard objects for effects and resistances .
function: def generate_misc_effect_objects(full_data_set, pregen_converter_group):
          """
          Generate fallback types and other standard objects for effects and resistances.
  
          :param full_data_set: GenieObjectContainer instance that
                                contains all relevant data for the conversion
                                process.
          :type full_data_set: ...dataformat.aoc.genie_object_container.GenieObjectContainer
          :param pregen_converter_group: GenieObjectGroup instance that stores
                                         pregenerated API objects for referencing with
                                         ForwardRef
          :type pregen_converter_group: ...dataformat.aoc.genie_object_container.GenieObjectGroup
          """
          pregen_nyan_objects = full_data_set.pregen_nyan_objects
          api_objects = full_data_set.nyan_api_objects
  
          # =======================================================================
          # Min change value (lower cealing for attack effects)
          # =======================================================================
          min_change_parent = "engine.util.attribute.AttributeAmount"
          min_change_location = "data/effect/discrete/flat_attribute_change/"
  
          change_ref_in_modpack = "effect.discrete.flat_attribute_change.min_damage.AoE2MinChangeAmount"
          change_raw_api_object = RawAPIObject(change_ref_in_modpack,
                                               "AoE2MinChangeAmount",
                                               api_objects,
                                               min_change_location)
          change_raw_api_object.set_filename("min_damage")
          change_raw_api_object.add_raw_parent(min_change_parent)
  
          attribute = ForwardRef(pregen_converter_group, "util.attribute.types.Health")
          change_raw_api_object.add_raw_member("type",
                                               attribute,
                                               min_change_parent)
          change_raw_api_object.add_raw_member("amount",
                                               0,
                                               min_change_parent)
  
          pregen_converter_group.add_raw_api_object(change_raw_api_object)
          pregen_nyan_objects.update({change_ref_in_modpack: change_raw_api_object})
  
          # =======================================================================
          # Min change value (lower cealing for heal effects)
          # =======================================================================
          min_change_parent = "engine.util.attribute.AttributeRate"
          min_change_location = "data/effect/discrete/flat_attribute_change/"
  
          change_ref_in_modpack = "effect.discrete.flat_attribute_change.min_heal.AoE2MinChangeAmount"
          change_raw_api_object = RawAPIObject(change_ref_in_modpack,
                                               "AoE2MinChangeAmount",
                                               api_objects,
                                               min_change_location)
          change_raw_api_object.set_filename("min_heal")
          change_raw_api_object.add_raw_parent(min_change_parent)
  
          attribute = ForwardRef(pregen_converter_group, "util.attribute.types.Health")
          change_raw_api_object.add_raw_member("type",
                                               attribute,
                                               min_change_parent)
          change_raw_api_object.add_raw_member("rate",
                                               0,
                                               min_change_parent)
  
          pregen_converter_group.add_raw_api_object(change_raw_api_object)
          pregen_nyan_objects.update({change_ref_in_modpack: change_raw_api_object})
  
          # =======================================================================
          # Fallback effect for attacking (= minimum damage)
          # =======================================================================
          effect_parent = "engine.effect.discrete.flat_attribute_change.FlatAttributeChange"
          fallback_parent = "engine.effect.discrete.flat_attribute_change.type.FlatAttributeChangeDecrease"
          fallback_location = "data/effect/discrete/flat_attribute_change/"
  
          fallback_ref_in_modpack = "effect.discrete.flat_attribute_change.fallback.AoE2AttackFallback"
          fallback_raw_api_object = RawAPIObject(fallback_ref_in_modpack,
                                                 "AoE2AttackFallback",
                                                 api_objects,
                                                 fallback_location)
          fallback_raw_api_object.set_filename("fallback")
          fallback_raw_api_object.add_raw_parent(fallback_parent)
  
          # Type
          type_ref = "engine.util.attribute_change_type.type.Fallback"
          change_type = api_objects[type_ref]
          fallback_raw_api_object.add_raw_member("type",
                                                 change_type,
                                                 effect_parent)
  
          # Min value (optional)
          # =================================================================================
          amount_name = f"{fallback_ref_in_modpack}.LowerCealing"
          amount_raw_api_object = RawAPIObject(amount_name, "LowerCealing", api_objects)
          amount_raw_api_object.add_raw_parent("engine.util.attribute.AttributeAmount")
          amount_location = ForwardRef(pregen_converter_group, fallback_ref_in_modpack)
          amount_raw_api_object.set_location(amount_location)
  
          attribute = ForwardRef(pregen_converter_group, "util.attribute.types.Health")
          amount_raw_api_object.add_raw_member("type",
                                               attribute,
                                               "engine.util.attribute.AttributeAmount")
          amount_raw_api_object.add_raw_member("amount",
                                               1,
                                               "engine.util.attribute.AttributeAmount")
  
          pregen_converter_group.add_raw_api_object(amount_raw_api_object)
          pregen_nyan_objects.update({amount_name: amount_raw_api_object})
          # =================================================================================
          amount_forward_ref = ForwardRef(pregen_converter_group, amount_name)
          fallback_raw_api_object.add_raw_member("min_change_value",
                                                 amount_forward_ref,
                                                 effect_parent)
  
          # Max value (optional; not needed
  
          # Change value
          # =================================================================================
          amount_name = f"{fallback_ref_in_modpack}.ChangeAmount"
          amount_raw_api_object = RawAPIObject(amount_name, "ChangeAmount", api_objects)
          amount_raw_api_object.add_raw_parent("engine.util.attribute.AttributeAmount")
          amount_location = ForwardRef(pregen_converter_group, fallback_ref_in_modpack)
          amount_raw_api_object.set_location(amount_location)
  
          attribute = ForwardRef(pregen_converter_group, "util.attribute.types.Health")
          amount_raw_api_object.add_raw_member("type",
                                               attribute,
                                               "engine.util.attribute.AttributeAmount")
          amount_raw_api_object.add_raw_member("amount",
                                               1,
                                               "engine.util.attribute.AttributeAmount")
  
          pregen_converter_group.add_raw_api_object(amount_raw_api_object)
          pregen_nyan_objects.update({amount_name: amount_raw_api_object})
  
          # =================================================================================
          amount_forward_ref = ForwardRef(pregen_converter_group, amount_name)
          fallback_raw_api_object.add_raw_member("change_value",
                                                 amount_forward_ref,
                                                 effect_parent)
  
          # Ignore protection
          fallback_raw_api_object.add_raw_member("ignore_protection",
                                                 [],
                                                 effect_parent)
  
          pregen_converter_group.add_raw_api_object(fallback_raw_api_object)
          pregen_nyan_objects.update({fallback_ref_in_modpack: fallback_raw_api_object})
  
          # =======================================================================
          # Fallback resistance
          # =======================================================================
          effect_parent = "engine.resistance.discrete.flat_attribute_change.FlatAttributeChange"
          fallback_parent = "engine.resistance.discrete.flat_attribute_change.type.FlatAttributeChangeDecrease"
          fallback_location = "data/resistance/discrete/flat_attribute_change/"
  
          fallback_ref_in_modpack = "resistance.discrete.flat_attribute_change.fallback.AoE2AttackFallback"
          fallback_raw_api_object = RawAPIObject(fallback_ref_in_modpack,
                                                 "AoE2AttackFallback",
                                                 api_objects,
                                                 fallback_location)
          fallback_raw_api_object.set_filename("fallback")
          fallback_raw_api_object.add_raw_parent(fallback_parent)
  
          # Type
          type_ref = "engine.util.attribute_change_type.type.Fallback"
          change_type = api_objects[type_ref]
          fallback_raw_api_object.add_raw_member("type",
                                                 change_type,
                                                 effect_parent)
  
          # Block value
          # =================================================================================
          amount_name = f"{fallback_ref_in_modpack}.BlockAmount"
          amount_raw_api_object = RawAPIObject(amount_name, "BlockAmount", api_objects)
          amount_raw_api_object.add_raw_parent("engine.util.attribute.AttributeAmount")
          amount_location = ForwardRef(pregen_converter_group, fallback_ref_in_modpack)
          amount_raw_api_object.set_location(amount_location)
  
          attribute = ForwardRef(pregen_converter_group, "util.attribute.types.Health")
          amount_raw_api_object.add_raw_member("type",
                                               attribute,
                                               "engine.util.attribute.AttributeAmount")
          amount_raw_api_object.add_raw_member("amount",
                                               0,
                                               "engine.util.attribute.AttributeAmount")
  
          pregen_converter_group.add_raw_api_object(amount_raw_api_object)
          pregen_nyan_objects.update({amount_name: amount_raw_api_object})
  
          # =================================================================================
          amount_forward_ref = ForwardRef(pregen_converter_group, amount_name)
          fallback_raw_api_object.add_raw_member("block_value",
                                                 amount_forward_ref,
                                                 effect_parent)
  
          pregen_converter_group.add_raw_api_object(fallback_raw_api_object)
          pregen_nyan_objects.update({fallback_ref_in_modpack: fallback_raw_api_object})
  
          # =======================================================================
          # Property Construct
          # =======================================================================
          prop_ref_in_modpack = "resistance.property.types.BuildingConstruct"
          prop_raw_api_object = RawAPIObject(prop_ref_in_modpack,
                                             "BuildingConstruct",
                                             api_objects,
                                             "data/resistance/property/")
          prop_raw_api_object.set_filename("types")
          prop_raw_api_object.add_raw_parent("engine.resistance.property.type.Stacked")
  
          pregen_converter_group.add_raw_api_object(prop_raw_api_object)
          pregen_nyan_objects.update({prop_ref_in_modpack: prop_raw_api_object})
  
          prop_raw_api_object.add_raw_member("stack_limit",
                                             MemberSpecialValue.NYAN_INF,
                                             "engine.resistance.property.type.Stacked")
  
          prop_raw_api_object.add_raw_member("distribution_type",
                                             api_objects["engine.util.distribution_type.type.Mean"],
                                             "engine.resistance.property.type.Stacked")
  
          # Calculation type Construct
          # =======================================================================
          calc_parent = "engine.util.calculation_type.type.Hyperbolic"
  
          calc_ref_in_modpack = "util.calculation_type.construct_calculation.ConstructCalcType"
          calc_raw_api_object = RawAPIObject(calc_ref_in_modpack,
                                             "BuildingConstruct",
                                             api_objects)
          calc_location = ForwardRef(pregen_converter_group, prop_ref_in_modpack)
          calc_raw_api_object.set_location(calc_location)
          calc_raw_api_object.add_raw_parent(calc_parent)
  
          pregen_converter_group.add_raw_api_object(calc_raw_api_object)
          pregen_nyan_objects.update({calc_ref_in_modpack: calc_raw_api_object})
  
          # Formula: (scale_factor / (count_effectors - shift_x)) + shift_y
          # AoE2: (3 / (vil_count + 2))
  
          # Shift x
          calc_raw_api_object.add_raw_member("shift_x",
                                             -2,
                                             calc_parent)
  
          # Shift y
          calc_raw_api_object.add_raw_member("shift_y",
                                             0,
                                             calc_parent)
  
          # Scale
          calc_raw_api_object.add_raw_member("scale_factor",
                                             3,
                                             calc_parent)
  
          calc_forward_ref = ForwardRef(pregen_converter_group, calc_ref_in_modpack)
          prop_raw_api_object.add_raw_member("calculation_type",
                                             calc_forward_ref,
                                             "engine.resistance.property.type.Stacked")
  
          # =======================================================================
          # Property Repair
          # =======================================================================
          prop_ref_in_modpack = "resistance.property.types.BuildingRepair"
          prop_raw_api_object = RawAPIObject(prop_ref_in_modpack,
                                             "BuildingRepair",
                                             api_objects,
                                             "data/resistance/property/")
          prop_raw_api_object.set_filename("types")
          prop_raw_api_object.add_raw_parent("engine.resistance.property.type.Stacked")
  
          pregen_converter_group.add_raw_api_object(prop_raw_api_object)
          pregen_nyan_objects.update({prop_ref_in_modpack: prop_raw_api_object})
  
          prop_raw_api_object.add_raw_member("stack_limit",
                                             MemberSpecialValue.NYAN_INF,
                                             "engine.resistance.property.type.Stacked")
  
          prop_raw_api_object.add_raw_member("distribution_type",
                                             api_objects["engine.util.distribution_type.type.Mean"],
                                             "engine.resistance.property.type.Stacked")
  
          # =======================================================================
          # Calculation type Repair
          # =======================================================================
          calc_parent = "engine.util.calculation_type.type.Linear"
  
          calc_ref_in_modpack = "util.calculation_type.construct_calculation.BuildingRepair"
          calc_raw_api_object = RawAPIObject(calc_ref_in_modpack,
                                             "BuildingRepair",
                                             api_objects)
          calc_location = ForwardRef(pregen_converter_group, prop_ref_in_modpack)
          calc_raw_api_object.set_location(calc_location)
          calc_raw_api_object.add_raw_parent(calc_parent)
  
          pregen_converter_group.add_raw_api_object(calc_raw_api_object)
          pregen_nyan_objects.update({calc_ref_in_modpack: calc_raw_api_object})
  
          # Formula: (scale_factor * (count_effectors - shift_x)) + shift_y
          # AoE2: (0.333334 * (vil_count + 2))
  
          # Shift x
          calc_raw_api_object.add_raw_member("shift_x",
                                             -2,
                                             calc_parent)
  
          # Shift y
          calc_raw_api_object.add_raw_member("shift_y",
                                             0,
                                             calc_parent)
  
          # Scale
          calc_raw_api_object.add_raw_member("scale_factor",
                                             1 / 3,
                                             calc_parent)
  
          calc_forward_ref = ForwardRef(pregen_converter_group, calc_ref_in_modpack)
          prop_raw_api_object.add_raw_member("calculation_type",
                                             calc_forward_ref,
                                             "engine.resistance.property.type.Stacked")
function_tokens: def generate_misc_effect_objects ( full_data_set , pregen_converter_group ) : pregen_nyan_objects = full_data_set . pregen_nyan_objects api_objects = full_data_set . nyan_api_objects # ======================================================================= # Min change value (lower cealing for attack effects) # ======================================================================= min_change_parent = "engine.util.attribute.AttributeAmount" min_change_location = "data/effect/discrete/flat_attribute_change/" change_ref_in_modpack = "effect.discrete.flat_attribute_change.min_damage.AoE2MinChangeAmount" change_raw_api_object = RawAPIObject ( change_ref_in_modpack , "AoE2MinChangeAmount" , api_objects , min_change_location ) change_raw_api_object . set_filename ( "min_damage" ) change_raw_api_object . add_raw_parent ( min_change_parent ) attribute = ForwardRef ( pregen_converter_group , "util.attribute.types.Health" ) change_raw_api_object . add_raw_member ( "type" , attribute , min_change_parent ) change_raw_api_object . add_raw_member ( "amount" , 0 , min_change_parent ) pregen_converter_group . add_raw_api_object ( change_raw_api_object ) pregen_nyan_objects . update ( { change_ref_in_modpack : change_raw_api_object } ) # ======================================================================= # Min change value (lower cealing for heal effects) # ======================================================================= min_change_parent = "engine.util.attribute.AttributeRate" min_change_location = "data/effect/discrete/flat_attribute_change/" change_ref_in_modpack = "effect.discrete.flat_attribute_change.min_heal.AoE2MinChangeAmount" change_raw_api_object = RawAPIObject ( change_ref_in_modpack , "AoE2MinChangeAmount" , api_objects , min_change_location ) change_raw_api_object . set_filename ( "min_heal" ) change_raw_api_object . add_raw_parent ( min_change_parent ) attribute = ForwardRef ( pregen_converter_group , "util.attribute.types.Health" ) change_raw_api_object . add_raw_member ( "type" , attribute , min_change_parent ) change_raw_api_object . add_raw_member ( "rate" , 0 , min_change_parent ) pregen_converter_group . add_raw_api_object ( change_raw_api_object ) pregen_nyan_objects . update ( { change_ref_in_modpack : change_raw_api_object } ) # ======================================================================= # Fallback effect for attacking (= minimum damage) # ======================================================================= effect_parent = "engine.effect.discrete.flat_attribute_change.FlatAttributeChange" fallback_parent = "engine.effect.discrete.flat_attribute_change.type.FlatAttributeChangeDecrease" fallback_location = "data/effect/discrete/flat_attribute_change/" fallback_ref_in_modpack = "effect.discrete.flat_attribute_change.fallback.AoE2AttackFallback" fallback_raw_api_object = RawAPIObject ( fallback_ref_in_modpack , "AoE2AttackFallback" , api_objects , fallback_location ) fallback_raw_api_object . set_filename ( "fallback" ) fallback_raw_api_object . add_raw_parent ( fallback_parent ) # Type type_ref = "engine.util.attribute_change_type.type.Fallback" change_type = api_objects [ type_ref ] fallback_raw_api_object . add_raw_member ( "type" , change_type , effect_parent ) # Min value (optional) # ================================================================================= amount_name = f"{fallback_ref_in_modpack}.LowerCealing" amount_raw_api_object = RawAPIObject ( amount_name , "LowerCealing" , api_objects ) amount_raw_api_object . add_raw_parent ( "engine.util.attribute.AttributeAmount" ) amount_location = ForwardRef ( pregen_converter_group , fallback_ref_in_modpack ) amount_raw_api_object . set_location ( amount_location ) attribute = ForwardRef ( pregen_converter_group , "util.attribute.types.Health" ) amount_raw_api_object . add_raw_member ( "type" , attribute , "engine.util.attribute.AttributeAmount" ) amount_raw_api_object . add_raw_member ( "amount" , 1 , "engine.util.attribute.AttributeAmount" ) pregen_converter_group . add_raw_api_object ( amount_raw_api_object ) pregen_nyan_objects . update ( { amount_name : amount_raw_api_object } ) # ================================================================================= amount_forward_ref = ForwardRef ( pregen_converter_group , amount_name ) fallback_raw_api_object . add_raw_member ( "min_change_value" , amount_forward_ref , effect_parent ) # Max value (optional; not needed # Change value # ================================================================================= amount_name = f"{fallback_ref_in_modpack}.ChangeAmount" amount_raw_api_object = RawAPIObject ( amount_name , "ChangeAmount" , api_objects ) amount_raw_api_object . add_raw_parent ( "engine.util.attribute.AttributeAmount" ) amount_location = ForwardRef ( pregen_converter_group , fallback_ref_in_modpack ) amount_raw_api_object . set_location ( amount_location ) attribute = ForwardRef ( pregen_converter_group , "util.attribute.types.Health" ) amount_raw_api_object . add_raw_member ( "type" , attribute , "engine.util.attribute.AttributeAmount" ) amount_raw_api_object . add_raw_member ( "amount" , 1 , "engine.util.attribute.AttributeAmount" ) pregen_converter_group . add_raw_api_object ( amount_raw_api_object ) pregen_nyan_objects . update ( { amount_name : amount_raw_api_object } ) # ================================================================================= amount_forward_ref = ForwardRef ( pregen_converter_group , amount_name ) fallback_raw_api_object . add_raw_member ( "change_value" , amount_forward_ref , effect_parent ) # Ignore protection fallback_raw_api_object . add_raw_member ( "ignore_protection" , [ ] , effect_parent ) pregen_converter_group . add_raw_api_object ( fallback_raw_api_object ) pregen_nyan_objects . update ( { fallback_ref_in_modpack : fallback_raw_api_object } ) # ======================================================================= # Fallback resistance # ======================================================================= effect_parent = "engine.resistance.discrete.flat_attribute_change.FlatAttributeChange" fallback_parent = "engine.resistance.discrete.flat_attribute_change.type.FlatAttributeChangeDecrease" fallback_location = "data/resistance/discrete/flat_attribute_change/" fallback_ref_in_modpack = "resistance.discrete.flat_attribute_change.fallback.AoE2AttackFallback" fallback_raw_api_object = RawAPIObject ( fallback_ref_in_modpack , "AoE2AttackFallback" , api_objects , fallback_location ) fallback_raw_api_object . set_filename ( "fallback" ) fallback_raw_api_object . add_raw_parent ( fallback_parent ) # Type type_ref = "engine.util.attribute_change_type.type.Fallback" change_type = api_objects [ type_ref ] fallback_raw_api_object . add_raw_member ( "type" , change_type , effect_parent ) # Block value # ================================================================================= amount_name = f"{fallback_ref_in_modpack}.BlockAmount" amount_raw_api_object = RawAPIObject ( amount_name , "BlockAmount" , api_objects ) amount_raw_api_object . add_raw_parent ( "engine.util.attribute.AttributeAmount" ) amount_location = ForwardRef ( pregen_converter_group , fallback_ref_in_modpack ) amount_raw_api_object . set_location ( amount_location ) attribute = ForwardRef ( pregen_converter_group , "util.attribute.types.Health" ) amount_raw_api_object . add_raw_member ( "type" , attribute , "engine.util.attribute.AttributeAmount" ) amount_raw_api_object . add_raw_member ( "amount" , 0 , "engine.util.attribute.AttributeAmount" ) pregen_converter_group . add_raw_api_object ( amount_raw_api_object ) pregen_nyan_objects . update ( { amount_name : amount_raw_api_object } ) # ================================================================================= amount_forward_ref = ForwardRef ( pregen_converter_group , amount_name ) fallback_raw_api_object . add_raw_member ( "block_value" , amount_forward_ref , effect_parent ) pregen_converter_group . add_raw_api_object ( fallback_raw_api_object ) pregen_nyan_objects . update ( { fallback_ref_in_modpack : fallback_raw_api_object } ) # ======================================================================= # Property Construct # ======================================================================= prop_ref_in_modpack = "resistance.property.types.BuildingConstruct" prop_raw_api_object = RawAPIObject ( prop_ref_in_modpack , "BuildingConstruct" , api_objects , "data/resistance/property/" ) prop_raw_api_object . set_filename ( "types" ) prop_raw_api_object . add_raw_parent ( "engine.resistance.property.type.Stacked" ) pregen_converter_group . add_raw_api_object ( prop_raw_api_object ) pregen_nyan_objects . update ( { prop_ref_in_modpack : prop_raw_api_object } ) prop_raw_api_object . add_raw_member ( "stack_limit" , MemberSpecialValue . NYAN_INF , "engine.resistance.property.type.Stacked" ) prop_raw_api_object . add_raw_member ( "distribution_type" , api_objects [ "engine.util.distribution_type.type.Mean" ] , "engine.resistance.property.type.Stacked" ) # Calculation type Construct # ======================================================================= calc_parent = "engine.util.calculation_type.type.Hyperbolic" calc_ref_in_modpack = "util.calculation_type.construct_calculation.ConstructCalcType" calc_raw_api_object = RawAPIObject ( calc_ref_in_modpack , "BuildingConstruct" , api_objects ) calc_location = ForwardRef ( pregen_converter_group , prop_ref_in_modpack ) calc_raw_api_object . set_location ( calc_location ) calc_raw_api_object . add_raw_parent ( calc_parent ) pregen_converter_group . add_raw_api_object ( calc_raw_api_object ) pregen_nyan_objects . update ( { calc_ref_in_modpack : calc_raw_api_object } ) # Formula: (scale_factor / (count_effectors - shift_x)) + shift_y # AoE2: (3 / (vil_count + 2)) # Shift x calc_raw_api_object . add_raw_member ( "shift_x" , - 2 , calc_parent ) # Shift y calc_raw_api_object . add_raw_member ( "shift_y" , 0 , calc_parent ) # Scale calc_raw_api_object . add_raw_member ( "scale_factor" , 3 , calc_parent ) calc_forward_ref = ForwardRef ( pregen_converter_group , calc_ref_in_modpack ) prop_raw_api_object . add_raw_member ( "calculation_type" , calc_forward_ref , "engine.resistance.property.type.Stacked" ) # ======================================================================= # Property Repair # ======================================================================= prop_ref_in_modpack = "resistance.property.types.BuildingRepair" prop_raw_api_object = RawAPIObject ( prop_ref_in_modpack , "BuildingRepair" , api_objects , "data/resistance/property/" ) prop_raw_api_object . set_filename ( "types" ) prop_raw_api_object . add_raw_parent ( "engine.resistance.property.type.Stacked" ) pregen_converter_group . add_raw_api_object ( prop_raw_api_object ) pregen_nyan_objects . update ( { prop_ref_in_modpack : prop_raw_api_object } ) prop_raw_api_object . add_raw_member ( "stack_limit" , MemberSpecialValue . NYAN_INF , "engine.resistance.property.type.Stacked" ) prop_raw_api_object . add_raw_member ( "distribution_type" , api_objects [ "engine.util.distribution_type.type.Mean" ] , "engine.resistance.property.type.Stacked" ) # ======================================================================= # Calculation type Repair # ======================================================================= calc_parent = "engine.util.calculation_type.type.Linear" calc_ref_in_modpack = "util.calculation_type.construct_calculation.BuildingRepair" calc_raw_api_object = RawAPIObject ( calc_ref_in_modpack , "BuildingRepair" , api_objects ) calc_location = ForwardRef ( pregen_converter_group , prop_ref_in_modpack ) calc_raw_api_object . set_location ( calc_location ) calc_raw_api_object . add_raw_parent ( calc_parent ) pregen_converter_group . add_raw_api_object ( calc_raw_api_object ) pregen_nyan_objects . update ( { calc_ref_in_modpack : calc_raw_api_object } ) # Formula: (scale_factor * (count_effectors - shift_x)) + shift_y # AoE2: (0.333334 * (vil_count + 2)) # Shift x calc_raw_api_object . add_raw_member ( "shift_x" , - 2 , calc_parent ) # Shift y calc_raw_api_object . add_raw_member ( "shift_y" , 0 , calc_parent ) # Scale calc_raw_api_object . add_raw_member ( "scale_factor" , 1 / 3 , calc_parent ) calc_forward_ref = ForwardRef ( pregen_converter_group , calc_ref_in_modpack ) prop_raw_api_object . add_raw_member ( "calculation_type" , calc_forward_ref , "engine.resistance.property.type.Stacked" )