示例#1
0
def test_fs_dmg_up_on_got_hit(transformer_ability: AbilityTransformer):
    # MH Berserk - 10150104
    # https://dragalialost.wiki/w/Hunter_Berserker
    ex_ability_data = transformer_ability.transform_chained_ex_ability(
        400000706)

    expected_info = {
        AbilityEffectInfo(
            400000706,
            ConditionComposite([Condition.TARGET_FLAME, Condition.ON_HIT]),
            BuffParameter.FS_DAMAGE_BUFF,
            0.2,
            duration_count=1,
        ),
    }

    check_ability_effect_unit_match(ex_ability_data.effect_units,
                                    expected_info)
示例#2
0
def test_elem_res_when_hp_above(transformer_ability: AbilityTransformer):
    # Forager Cleo - 10750203
    # https://dragalialost.wiki/w/Forager_Cleo
    ex_ability_data = transformer_ability.transform_chained_ex_ability(
        400000168)

    expected_info = {
        AbilityEffectInfo(400000168,
                          ConditionComposite([
                              Condition.TARGET_WATER, Condition.SELF_HP_GTE_80
                          ]),
                          BuffParameter.RESISTANCE_FLAME_PASSIVE,
                          0.06,
                          duration_sec=0),
    }

    check_ability_effect_unit_match(ex_ability_data.effect_units,
                                    expected_info)
示例#3
0
def test_elem_res_on_team_amp_up(transformer_ability: AbilityTransformer):
    # Myriam - 10750303
    # https://dragalialost.wiki/w/Myriam
    ex_ability_data = transformer_ability.transform_chained_ex_ability(
        400000906)

    expected_info = {
        AbilityEffectInfo(400000906,
                          ConditionComposite([
                              Condition.TARGET_WIND, Condition.SELF_TEAM_AMP_UP
                          ]),
                          BuffParameter.RESISTANCE_WATER_PASSIVE,
                          0.06,
                          duration_sec=0),
    }

    check_ability_effect_unit_match(ex_ability_data.effect_units,
                                    expected_info)
示例#4
0
def test_fill_dragon_gauge_by_combo_count(
        transformer_ability: AbilityTransformer):
    # Gala Leonidas - 10950101
    # https://dragalialost.wiki/w/Gala_Leonidas
    ex_ability_data = transformer_ability.transform_chained_ex_ability(
        400000823)

    expected_info = {
        # The effect of clearing the action condition when the combo counter resets is omitted
        AbilityEffectInfo(
            400000823,
            ConditionComposite(
                [Condition.TARGET_FLAME, Condition.ON_COMBO_DIV_BY_50]),
            BuffParameter.DRAGON_GAUGE_FILL, 0.03),
    }

    check_ability_effect_unit_match(ex_ability_data.effect_units,
                                    expected_info)
示例#5
0
def test_grant_shield_upon_hp_below(transformer_ability: AbilityTransformer):
    # Grace - 10850503
    # https://dragalialost.wiki/w/Grace
    ex_ability_data = transformer_ability.transform_chained_ex_ability(
        400000657)

    expected_info = {
        AbilityEffectInfo(400000657,
                          ConditionComposite(
                              [Condition.TARGET_SHADOW,
                               Condition.ON_HP_LT_40]),
                          BuffParameter.SHIELD_SINGLE_DMG,
                          0.5,
                          duration_sec=0),
    }

    check_ability_effect_unit_match(ex_ability_data.effect_units,
                                    expected_info)
示例#6
0
def test_transform_all_character_chained_ex(
        transformer_ability: AbilityTransformer, asset_manager: AssetManager):
    unknown_abilities = UnknownAbilityDataCollection()
    counter: int = 0

    # Not checking all abilities in the ability asset directly
    # because there are some unused or deprecated ability inside.
    # We don't want to spend time handling unused things.
    for chara_data in asset_manager.asset_chara_data.playable_data:
        cex_id = chara_data.cex_id_at_max_level
        counter += 1

        try:
            chained_ex_ability_data = transformer_ability.transform_chained_ex_ability(
                cex_id)

            unknown_abilities.add_data_if_needed(chara_data,
                                                 cex_id,
                                                 chained_ex_ability_data,
                                                 check_effective_for_team=True)
        except (AbilityConditionUnconvertibleError,
                AbilityVariantUnconvertibleError) as ex:
            # Condition/Variant unconvertible (most likely due to unknown/unhandled condition/variant)
            chained_ex_ability_data = asset_manager.asset_ability_data.get_data_by_id(
                cex_id)

            condition_ids = ({
                cex_id:
                chained_ex_ability_data.condition.condition_code
            } if chained_ex_ability_data.condition.is_unknown_condition else
                             {})

            unknown_abilities.add_data(
                UnknownAbilityData(
                    chara_id=chara_data.id,
                    ability_id=cex_id,
                    condition_ids=condition_ids,
                    variant_ids={
                        cex_id:
                        chained_ex_ability_data.unknown_variant_type_ids
                    },
                    error=ex))

    unknown_abilities.print_and_fail_if_any(counter)
示例#7
0
def test_atk_up_on_team_amp_up(transformer_ability: AbilityTransformer):
    # Child Ranzal - 10450103
    # https://dragalialost.wiki/w/Child_Ranzal
    ex_ability_data = transformer_ability.transform_chained_ex_ability(
        400000912)

    expected_info = {
        AbilityEffectInfo(400000912,
                          ConditionComposite([
                              Condition.TARGET_FLAME,
                              Condition.SELF_TEAM_AMP_UP
                          ]),
                          BuffParameter.ATK_PASSIVE,
                          0.08,
                          duration_sec=0),
    }

    check_ability_effect_unit_match(ex_ability_data.effect_units,
                                    expected_info)
def test_potent_resist_3(transformer_ability: AbilityTransformer):
    # Summer Cleo S2 (AB2 @ Max - Curse Res +100% & ATK +15% 10s, CD 15s)
    # https://dragalialost.wiki/w/Summer_Cleo
    ability_data = transformer_ability.transform_ability(937)

    expected_info = {
        AbilityEffectInfo(937,
                          ConditionComposite(),
                          BuffParameter.RESISTANCE_CURSE,
                          1.0,
                          cooldown_sec=0),
        AbilityEffectInfo(685,
                          ConditionComposite(Condition.ON_HIT_BY_CURSE),
                          BuffParameter.ATK_BUFF,
                          0.15,
                          cooldown_sec=15),
    }

    check_ability_effect_unit_match(ability_data.effect_units, expected_info)
def test_potent_resist_2(transformer_ability: AbilityTransformer):
    # Summer Julietta (AB2 @ Max - Stun Res +100% & ATK +15% 10s, CD 15s)
    # https://dragalialost.wiki/w/Marty
    ability_data = transformer_ability.transform_ability(678)

    expected_info = {
        AbilityEffectInfo(678,
                          ConditionComposite(),
                          BuffParameter.RESISTANCE_STUN,
                          1.0,
                          cooldown_sec=0),
        AbilityEffectInfo(701,
                          ConditionComposite(Condition.ON_HIT_BY_STUN),
                          BuffParameter.ATK_BUFF,
                          0.15,
                          cooldown_sec=15),
    }

    check_ability_effect_unit_match(ability_data.effect_units, expected_info)
示例#10
0
def test_inspire_level_up_on_energy_level_up_prob(
        transformer_ability: AbilityTransformer):
    # Lucretia - 10750401 (CEX Lv4)
    # https://dragalialost.wiki/w/Lucretia
    ex_ability_data = transformer_ability.transform_chained_ex_ability(
        400000539)

    expected_info = {
        AbilityEffectInfo(400000539,
                          ConditionComposite([
                              Condition.TARGET_LIGHT, Condition.ON_ENERGY_LV_UP
                          ]),
                          BuffParameter.INSPIRE_LEVEL,
                          1,
                          probability=80),
    }

    check_ability_effect_unit_match(ex_ability_data.effect_units,
                                    expected_info)
示例#11
0
def test_atk_up_on_hp_above(transformer_ability: AbilityTransformer):
    # Original Karina - 10440201
    # https://dragalialost.wiki/w/Karina
    ex_ability_data = transformer_ability.transform_chained_ex_ability(
        400000155)

    expected_info = {
        # The effect of clearing the action condition when the HP drops below the threshold is omitted
        AbilityEffectInfo(400000155,
                          ConditionComposite(
                              [Condition.TARGET_WATER,
                               Condition.ON_HP_GTE_60]),
                          BuffParameter.ATK_BUFF,
                          0.05,
                          duration_sec=0),
    }

    check_ability_effect_unit_match(ex_ability_data.effect_units,
                                    expected_info)
示例#12
0
def test_elem_res_on_energy_level_up(transformer_ability: AbilityTransformer):
    # Elias - 10640403
    # https://dragalialost.wiki/w/Elias
    ex_ability_data = transformer_ability.transform_chained_ex_ability(
        400000751)

    expected_info = {
        AbilityEffectInfo(400000751,
                          ConditionComposite([
                              Condition.TARGET_LIGHT, Condition.ON_ENERGY_LV_UP
                          ]),
                          BuffParameter.RESISTANCE_SHADOW_BUFF,
                          0.07,
                          duration_sec=15,
                          cooldown_sec=15),
    }

    check_ability_effect_unit_match(ex_ability_data.effect_units,
                                    expected_info)
示例#13
0
def test_crt_up_by_combo_count(transformer_ability: AbilityTransformer):
    # Kimono Elisanne - 10550103
    # https://dragalialost.wiki/w/Kimono_Elisanne
    ex_ability_data = transformer_ability.transform_chained_ex_ability(
        400000838)

    expected_info = {
        AbilityEffectInfo(400000838,
                          ConditionComposite([
                              Condition.TARGET_FLAME,
                              Condition.ON_COMBO_DIV_BY_10
                          ]),
                          BuffParameter.CRT_RATE_PASSIVE,
                          0.01,
                          max_stack_count=20),
    }

    check_ability_effect_unit_match(ex_ability_data.effect_units,
                                    expected_info)
示例#14
0
def test_burn_res_on_team_amp_up(transformer_ability: AbilityTransformer):
    # Humanoid Mercury - 10350204
    # https://dragalialost.wiki/w/Humanoid_Mercury
    ex_ability_data = transformer_ability.transform_chained_ex_ability(
        400000922)

    expected_info = {
        AbilityEffectInfo(400000922,
                          ConditionComposite([
                              Condition.TARGET_WATER,
                              Condition.SELF_TEAM_AMP_UP
                          ]),
                          BuffParameter.RESISTANCE_BURN,
                          1,
                          duration_sec=0),
    }

    check_ability_effect_unit_match(ex_ability_data.effect_units,
                                    expected_info)
示例#15
0
def test_hp_and_def(transformer_ability: AbilityTransformer):
    # Chrom - 10150105
    # https://dragalialost.wiki/w/Chrom
    ex_ability_data = transformer_ability.transform_ex_ability(101060010)

    expected_info = {
        AbilityEffectInfo(101060010,
                          ConditionComposite(),
                          BuffParameter.DEF_PASSIVE,
                          0.1,
                          max_occurrences=1),
        AbilityEffectInfo(101060010,
                          ConditionComposite(),
                          BuffParameter.HP_RAISE_BY_MAX,
                          0.1,
                          max_occurrences=1),
    }

    check_ability_effect_unit_match(ex_ability_data.effect_units,
                                    expected_info)
示例#16
0
def test_elem_res_in_buff_field(transformer_ability: AbilityTransformer):
    # Opera Karina - 10650504
    # https://dragalialost.wiki/w/Opera_Karina
    ex_ability_data = transformer_ability.transform_chained_ex_ability(
        400000799)

    expected_info = {
        # The effect of clearing the action condition when leaving the buff field is omitted
        AbilityEffectInfo(400000799,
                          ConditionComposite([
                              Condition.TARGET_SHADOW,
                              Condition.ON_ENTERED_BUFF_FIELD
                          ]),
                          BuffParameter.RESISTANCE_LIGHT_BUFF,
                          0.07,
                          duration_sec=0),
    }

    check_ability_effect_unit_match(ex_ability_data.effect_units,
                                    expected_info)
示例#17
0
def test_shapeshifting_boost(transformer_ability: AbilityTransformer):
    # Gala Euden - 10150403
    # https://dragalialost.wiki/w/Gala_Euden
    ex_ability_data = transformer_ability.transform_ex_ability(136000008)

    expected_info = {
        AbilityEffectInfo(136000008,
                          ConditionComposite(),
                          BuffParameter.DRAGON_DAMAGE,
                          0.1,
                          max_occurrences=1),
        AbilityEffectInfo(136000008,
                          ConditionComposite(),
                          BuffParameter.DRAGON_TIME,
                          0.2,
                          max_occurrences=1),
    }

    check_ability_effect_unit_match(ex_ability_data.effect_units,
                                    expected_info)
示例#18
0
def test_od_punisher(transformer_ability: AbilityTransformer):
    # Seimei - 10750104
    # https://dragalialost.wiki/w/Seimei
    ex_ability_data = transformer_ability.transform_ex_ability(106000008)

    expected_info = {
        AbilityEffectInfo(106000008,
                          ConditionComposite(Condition.TARGET_OD_STATE),
                          BuffParameter.OD_GAUGE_DAMAGE,
                          0.10,
                          max_occurrences=1),
        AbilityEffectInfo(106000008,
                          ConditionComposite(Condition.TARGET_OD_STATE),
                          BuffParameter.OD_STATE_PUNISHER,
                          0.15,
                          max_occurrences=1),
    }

    check_ability_effect_unit_match(ex_ability_data.effect_units,
                                    expected_info)
示例#19
0
def test_elem_res_on_combo_count_above(
        transformer_ability: AbilityTransformer):
    # Summer Cleo - 10650401
    # https://dragalialost.wiki/w/Karina
    ex_ability_data = transformer_ability.transform_chained_ex_ability(
        400000489)

    expected_info = {
        # The effect of clearing the action condition when the combo counter resets is omitted
        AbilityEffectInfo(400000489,
                          ConditionComposite([
                              Condition.TARGET_LIGHT, Condition.ON_COMBO_GTE_10
                          ]),
                          BuffParameter.RESISTANCE_SHADOW_BUFF,
                          0.1,
                          duration_sec=0),
    }

    check_ability_effect_unit_match(ex_ability_data.effect_units,
                                    expected_info)
    def __init__(self, config_path: str):
        config = ConfigParser()
        config.read(config_path)

        dir_resource = config.get("Asset", "Resource")
        dir_custom = config.get("Asset", "Custom")

        dir_export = config.get("Export", "Dir")

        print(f"Resource Root Path: {dir_resource}")
        print(f"Custom Asset Path: {dir_custom}")
        print()
        print(f"Export directory: {dir_export}")
        print()

        self._asset_manager: AssetManager = AssetManager(
            dir_resource, custom_asset_dir=dir_custom)
        self._transformer_ability: AbilityTransformer = AbilityTransformer(
            self._asset_manager)
        self._dir_export: str = dir_export
示例#21
0
def test_atk_up_on_dodged(transformer_ability: AbilityTransformer):
    # Yoshitsune - 10950202
    # https://dragalialost.wiki/w/Yoshitsune
    ex_ability_data = transformer_ability.transform_chained_ex_ability(
        400000853)

    expected_info = {
        AbilityEffectInfo(400000853,
                          ConditionComposite([
                              Condition.TARGET_WATER,
                              Condition.ON_DODGE_SUCCESS
                          ]),
                          BuffParameter.ATK_BUFF,
                          0.1,
                          duration_sec=15,
                          cooldown_sec=15),
    }

    check_ability_effect_unit_match(ex_ability_data.effect_units,
                                    expected_info)
示例#22
0
def test_inflicted_target(transformer_ability: AbilityTransformer):
    # Valentine's Orion - 10130103
    # https://dragalialost.wiki/w/Valentine%27s_Orion
    ex_ability_data = transformer_ability.transform_chained_ex_ability(
        400000037)

    expected_info = {
        AbilityEffectInfo(400000037,
                          ConditionComposite([
                              Condition.TARGET_FLAME,
                              Condition.ON_INFLICTED_BURN
                          ]),
                          BuffParameter.ATK_BUFF,
                          0.08,
                          duration_sec=15,
                          cooldown_sec=10),
    }

    check_ability_effect_unit_match(ex_ability_data.effect_units,
                                    expected_info)
def test_atk_up_shapeshifted(transformer_ability: AbilityTransformer):
    # Euden (AB1 @ Max - ATK +10%/+15%/+15% for each transform)
    # https://dragalialost.wiki/w/The_Prince
    ability_data = transformer_ability.transform_ability(700)

    expected_info = {
        AbilityEffectInfo(
            700, ConditionComposite(Condition.SELF_SHAPESHIFTED_1_TIME),
            BuffParameter.ATK_BUFF, 0.1
        ),
        AbilityEffectInfo(
            700, ConditionComposite(Condition.SELF_SHAPESHIFTED_2_TIMES),
            BuffParameter.ATK_BUFF, 0.15
        ),
        AbilityEffectInfo(
            700, ConditionComposite(Condition.SELF_SHAPESHIFTED_3_TIMES),
            BuffParameter.ATK_BUFF, 0.15
        ),
    }

    check_ability_effect_unit_match(ability_data.effect_units, expected_info)
示例#24
0
def test_energy_level_up_by_combo_count(
        transformer_ability: AbilityTransformer):
    # Gala Sarisse - 10650101
    # https://dragalialost.wiki/w/Gala_Sarisse
    ex_ability_data = transformer_ability.transform_chained_ex_ability(
        400000709)

    expected_info = {
        # The effect of clearing the action condition when the combo counter resets is omitted
        AbilityEffectInfo(400000709,
                          ConditionComposite([
                              Condition.TARGET_FLAME,
                              Condition.ON_COMBO_DIV_BY_20
                          ]),
                          BuffParameter.ENERGY_LEVEL,
                          1,
                          duration_count=0,
                          max_stack_count=0),
    }

    check_ability_effect_unit_match(ex_ability_data.effect_units,
                                    expected_info)