Exemplo n.º 1
0
def test(transformer_ability: AbilityTransformer):
    # Veronica (AB3 @ Max - Skill prep & skill fill 5%)
    # https://dragalialost.wiki/w/Veronica

    ability_data = transformer_ability.transform_ability(721)

    cond_quest_start = ConditionComposite(Condition.QUEST_START)
    cond_skill_used = ConditionComposite(Condition.SKILL_USED_ALL)

    expected_info = {
        AbilityEffectInfo(721, cond_quest_start,
                          BuffParameter.SP_CHARGE_PCT_S1, 1),
        AbilityEffectInfo(721, cond_quest_start,
                          BuffParameter.SP_CHARGE_PCT_S2, 1),
        AbilityEffectInfo(721, cond_quest_start,
                          BuffParameter.SP_CHARGE_PCT_S3, 1),
        AbilityEffectInfo(721, cond_quest_start,
                          BuffParameter.SP_CHARGE_PCT_S4, 1),
        AbilityEffectInfo(723, cond_skill_used, BuffParameter.SP_CHARGE_PCT_S1,
                          0.05),
        AbilityEffectInfo(723, cond_skill_used, BuffParameter.SP_CHARGE_PCT_S2,
                          0.05),
        AbilityEffectInfo(723, cond_skill_used, BuffParameter.SP_CHARGE_PCT_S3,
                          0.05),
        AbilityEffectInfo(723, cond_skill_used, BuffParameter.SP_CHARGE_PCT_S4,
                          0.05),
    }

    check_ability_effect_unit_match(ability_data.effect_units, expected_info)
def test_transform_all_character_ability(
        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:
        for ability_id in chara_data.ability_ids_all_level:
            counter += 1

            try:
                ability_data = transformer_ability.transform_ability(
                    ability_id)

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

                unknown_abilities.add_data(
                    UnknownAbilityData(
                        chara_data.id, ability_id,
                        ({
                            ability_id: ability_data.condition.condition_code
                        } if ability_data.condition.is_unknown_condition else
                         {}),
                        {ability_id: ability_data.unknown_variant_type_ids},
                        ex))

    unknown_abilities.print_and_fail_if_any(counter)
Exemplo n.º 3
0
def test_dummy(transformer_ability: AbilityTransformer):
    # Gala Leonidas (AB1 @ Lv1 - Nothing)
    # https://dragalialost.wiki/w/Gala_Leonidas
    ability_data = transformer_ability.transform_ability(1460)

    expected_info = set()

    check_ability_effect_unit_match(ability_data.effect_units, expected_info)
Exemplo n.º 4
0
def test_player_exp(transformer_ability: AbilityTransformer):
    # Euden (AB3 @ Lv2 - Player EXP +15%)
    # https://dragalialost.wiki/w/The_Prince
    ability_data = transformer_ability.transform_ability(110150003)

    expected_info = {
        AbilityEffectInfo(110150003, ConditionComposite(), BuffParameter.PLAYER_EXP, 0.15),
    }

    check_ability_effect_unit_match(ability_data.effect_units, expected_info)
def test_atk_up_on_def_buffed(transformer_ability: AbilityTransformer):
    # Valentine's Orion (AB1 @ Max - DEF doublebuff - ATK +15% (Buff))
    # https://dragalialost.wiki/w/Valentine%27s_Orion
    ability_data = transformer_ability.transform_ability(210000607)

    expected_info = {
        AbilityEffectInfo(210000607, ConditionComposite(Condition.ON_BUFFED_DEF), BuffParameter.ATK_BUFF, 0.15),
    }

    check_ability_effect_unit_match(ability_data.effect_units, expected_info)
def test_sp_rate_up(transformer_ability: AbilityTransformer):
    # Marty (AB1 @ Max - SP Rate +10%)
    # https://dragalialost.wiki/w/Marty
    ability_data = transformer_ability.transform_ability(938)

    expected_info = {
        AbilityEffectInfo(938, ConditionComposite(), BuffParameter.SP_RATE,
                          0.1),
    }

    check_ability_effect_unit_match(ability_data.effect_units, expected_info)
def test_resist_1(transformer_ability: AbilityTransformer):
    # Marty (AB3 @ Max - Stun Res +50%)
    # https://dragalialost.wiki/w/Marty
    ability_data = transformer_ability.transform_ability(110020604)

    expected_info = {
        AbilityEffectInfo(110020604, ConditionComposite(),
                          BuffParameter.RESISTANCE_STUN, 0.5),
    }

    check_ability_effect_unit_match(ability_data.effect_units, expected_info)
def test_resist_2(transformer_ability: AbilityTransformer):
    # Wedding Elisanne (AB2 @ Max - Bog Res +100%)
    # https://dragalialost.wiki/w/Wedding_Elisanne
    ability_data = transformer_ability.transform_ability(110020906)

    expected_info = {
        AbilityEffectInfo(110020906, ConditionComposite(),
                          BuffParameter.RESISTANCE_BOG, 1.0),
    }

    check_ability_effect_unit_match(ability_data.effect_units, expected_info)
def test_atk_up_gte_70_hp(transformer_ability: AbilityTransformer):
    # Karl (AB1 @ Max - RP +13% when HP = 100%)
    # https://dragalialost.wiki/w/Karl
    ability_data = transformer_ability.transform_ability(719)

    expected_info = {
        AbilityEffectInfo(719, ConditionComposite(Condition.SELF_HP_GTE_70),
                          BuffParameter.ATK_PASSIVE, 0.15),
    }

    check_ability_effect_unit_match(ability_data.effect_units, expected_info)
def test_atk_up_full_hp(transformer_ability: AbilityTransformer):
    # Yukata Cassandra (AB1 @ Max - ATK +20% when HP = 100%)
    # https://dragalialost.wiki/w/Yukata_Cassandra
    ability_data = transformer_ability.transform_ability(210000307)

    expected_info = {
        AbilityEffectInfo(210000307,
                          ConditionComposite(Condition.SELF_HP_FULL),
                          BuffParameter.ATK_PASSIVE, 0.2),
    }

    check_ability_effect_unit_match(ability_data.effect_units, expected_info)
def test_def_up_on_lt_30_hp(transformer_ability: AbilityTransformer):
    # Raemond (AB1 @ Max - DEF +50% for 15s when HP < 30%)
    # https://dragalialost.wiki/w/Karl
    ability_data = transformer_ability.transform_ability(210001704)

    expected_info = {
        AbilityEffectInfo(
            210001704, ConditionComposite(Condition.ON_HP_LT_30), BuffParameter.DEF_BUFF, 0.5,
            max_occurrences=1
        ),
    }

    check_ability_effect_unit_match(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)
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)