Example #1
0
def test_s2_tempura(transformer_skill: SkillTransformer):
    # Mitsuba S2 in Tempura
    # https://dragalialost.wiki/w/Mitsuba
    skill_data_base = transformer_skill.transform_supportive(103502024)

    assert skill_data_base.max_level == 2

    expected_buffs_lv_1 = {
        BuffEffectInfo("DAG_119_04_2_BUF_LV01", HitTargetSimple.TEAM, BuffParameter.CRT_DAMAGE_BUFF, 0.5, 15, 0),
        BuffEffectInfo("DAG_119_04_2_INSP_LV01", HitTargetSimple.TEAM, BuffParameter.INSPIRE_LEVEL, 2, 0, 1)
    }
    expected_buffs_lv_2 = {
        BuffEffectInfo("DAG_119_04_2_BUF_LV02", HitTargetSimple.TEAM, BuffParameter.CRT_DAMAGE_BUFF, 0.5, 15, 0),
        BuffEffectInfo("DAG_119_04_2_INSP_LV02", HitTargetSimple.TEAM, BuffParameter.INSPIRE_LEVEL, 3, 0, 1)
    }
    expected_base_buffs = [expected_buffs_lv_1, expected_buffs_lv_2]

    # Base data
    skill_data = skill_data_base.with_conditions()

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_2)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)
def test_s2(transformer_skill: SkillTransformer):
    # Original Celliera S2
    # https://dragalialost.wiki/w/Celliera
    skill_data_base = transformer_skill.transform_supportive(102402012)

    assert skill_data_base.max_level == 3

    expected_buffs_lv_1 = {
        BuffEffectInfo("BUF_107_LV01", HitTargetSimple.SELF,
                       BuffParameter.ATK_BUFF, 0.2, 10, 0),
    }
    expected_buffs_lv_2 = {
        BuffEffectInfo("BUF_107_LV02", HitTargetSimple.SELF,
                       BuffParameter.ATK_BUFF, 0.25, 10, 0),
    }
    expected_buffs_lv_3 = {
        BuffEffectInfo("BUF_107_LV03", HitTargetSimple.SELF,
                       BuffParameter.ATK_BUFF, 0.25, 0, 0),
    }
    expected_base_buffs = [
        expected_buffs_lv_1, expected_buffs_lv_2, expected_buffs_lv_3
    ]

    # Base data
    skill_data = skill_data_base.with_conditions()

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_3)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)
Example #3
0
def test_s1(transformer_skill: SkillTransformer):
    # Patia S1
    # https://dragalialost.wiki/w/Patia
    skill_data_base = transformer_skill.transform_supportive(105405021)

    assert skill_data_base.max_level == 4

    expected_buffs = {
        tuple(): {
            BuffEffectInfo(
                "BUF_184_ATK_LV04", HitTargetSimple.TEAM, BuffParameter.ATK_BUFF, 0.15, 15, 0
            ),
            BuffEffectInfo(
                "BUF_184_DEF_LV04", HitTargetSimple.TEAM, BuffParameter.DEF_BUFF, 0.25, 15, 0
            ),
        },
    }

    for condition, buff_units in expected_buffs.items():
        skill_data = skill_data_base.with_conditions(ConditionComposite(condition))

        expected_buffs = buff_units
        actual_buffs = skill_data.buffs[-1]

        check_buff_unit_match(actual_buffs, expected_buffs, message=condition)
def test_self_debuff(transformer_skill: SkillTransformer):
    # Durant S2
    # https://dragalialost.wiki/w/Yue
    skill_data_base = transformer_skill.transform_supportive(102405022)

    assert skill_data_base.max_level == 2

    expected_buffs_lv_1 = {
        BuffEffectInfo("BUF_169_CRT_LV01", HitTargetSimple.SELF,
                       BuffParameter.CRT_RATE_BUFF, 0.25, 20, 0),
        BuffEffectInfo("DEBUF_102_DEF_LV01", HitTargetSimple.SELF,
                       BuffParameter.DEF_BUFF, -0.25, 20, 0),
    }
    expected_buffs_lv_2 = {
        BuffEffectInfo("BUF_169_CRT_LV02", HitTargetSimple.SELF,
                       BuffParameter.CRT_RATE_BUFF, 0.30, 20, 0),
        BuffEffectInfo("DEBUF_102_DEF_LV02", HitTargetSimple.SELF,
                       BuffParameter.DEF_BUFF, -0.25, 20, 0),
    }

    expected_base_buffs = [expected_buffs_lv_1, expected_buffs_lv_2]

    skill_data = skill_data_base.with_conditions()

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_2)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)
def test_s2(transformer_skill: SkillTransformer):
    # Lea S2
    # https://dragalialost.wiki/w/Lea
    skill_data_base = transformer_skill.transform_supportive(101501032)

    assert skill_data_base.max_level == 3

    expected_buffs_lv_1 = {
        BuffEffectInfo("BUF_221_DMG", HitTargetSimple.SELF, BuffParameter.HP_DECREASE_BY_MAX, 0.2, 0, 0),
    }
    expected_buffs_lv_2 = {
        BuffEffectInfo("BUF_221_DMG", HitTargetSimple.SELF, BuffParameter.HP_DECREASE_BY_MAX, 0.2, 0, 0),
    }
    expected_buffs_lv_3 = {
        BuffEffectInfo("BUF_221_DMG", HitTargetSimple.SELF, BuffParameter.HP_DECREASE_BY_MAX, 0.2, 0, 0),
    }
    expected_base_buffs = [expected_buffs_lv_1, expected_buffs_lv_2, expected_buffs_lv_3]

    # Base data
    skill_data = skill_data_base.with_conditions(ConditionComposite(Condition.SELF_HP_GTE_60))

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_3)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)
def test_elemental_resistances(transformer_skill: SkillTransformer):
    # Pecorine S1
    # https://dragalialost.wiki/w/Pecorine
    skill_data_base = transformer_skill.transform_supportive(101504041)

    assert skill_data_base.max_level == 3

    expected_buffs_lv_1 = {
        BuffEffectInfo("SWD_127_04_BUF_LV01", HitTargetSimple.SELF,
                       BuffParameter.RESISTANCE_SHADOW_BUFF, 0.05, 10, 0)
    }
    expected_buffs_lv_2 = {
        BuffEffectInfo("SWD_127_04_BUF_LV02", HitTargetSimple.SELF,
                       BuffParameter.RESISTANCE_SHADOW_BUFF, 0.08, 10, 0)
    }
    expected_buffs_lv_3 = {
        BuffEffectInfo("SWD_127_04_BUF_LV03", HitTargetSimple.SELF,
                       BuffParameter.RESISTANCE_SHADOW_BUFF, 0.1, 10, 0)
    }

    expected_base_buffs = [
        expected_buffs_lv_1, expected_buffs_lv_2, expected_buffs_lv_3
    ]

    skill_data = skill_data_base.with_conditions()

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_3)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)
def test_has_phase_1(transformer_skill: SkillTransformer):
    # Summer Julietta S2 - P1
    # https://dragalialost.wiki/w/Summer_Julietta
    skill_data_base = transformer_skill.transform_supportive(104502012)

    expected_buffs_lv_1 = {
        BuffEffectInfo("AXE_107_04_ATK_LV01", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.ATK_BUFF, 0.15, 15, 0),
    }
    expected_buffs_lv_2 = {
        BuffEffectInfo("AXE_107_04_ATK_LV02", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.ATK_BUFF, 0.15, 15, 0),
    }
    expected_buffs_lv_3 = {
        BuffEffectInfo("AXE_107_04_ATK_LV03", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.ATK_BUFF, 0.15, 15, 0),
    }

    expected_base_buffs = [
        expected_buffs_lv_1, expected_buffs_lv_2, expected_buffs_lv_3
    ]

    skill_data = skill_data_base.with_conditions()

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_3)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)
Example #8
0
def test_fs_spd(transformer_skill: SkillTransformer):
    # Linnea S2
    # https://dragalialost.wiki/w/Linnea
    skill_data_base = transformer_skill.transform_supportive(102505032)

    assert skill_data_base.max_level == 2

    expected_buffs_lv_1 = {
        BuffEffectInfo("BUF_205_BAC_LV01", HitTargetSimple.SELF,
                       BuffParameter.FS_SPD, 0.2, 15, 0),
    }
    expected_buffs_lv_2 = {
        BuffEffectInfo("BUF_205_BAC_LV02", HitTargetSimple.SELF,
                       BuffParameter.FS_SPD, 0.3, 15, 0),
    }
    expected_base_buffs = [expected_buffs_lv_1, expected_buffs_lv_2]

    skill_data = skill_data_base.with_conditions()

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_2)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)
def test_multi_effect_to_nearby_1(transformer_skill: SkillTransformer):
    # Halloween Odetta S2
    # https://dragalialost.wiki/w/Halloween_Odetta
    skill_data_base = transformer_skill.transform_supportive(101402012)

    assert skill_data_base.max_level == 3

    expected_buffs_lv_1 = {
        BuffEffectInfo("BUF_166_ATK_LV01", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.ATK_BUFF, 0.15, 15, 0)
    }
    expected_buffs_lv_2 = {
        BuffEffectInfo("BUF_166_ATK_LV02", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.ATK_BUFF, 0.20, 15, 0)
    }
    expected_buffs_lv_3 = {
        BuffEffectInfo("BUF_166_ATK_LV03", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.ATK_BUFF, 0.25, 15, 0)
    }
    expected_base_buffs = [
        expected_buffs_lv_1, expected_buffs_lv_2, expected_buffs_lv_3
    ]

    skill_data = skill_data_base.with_conditions()

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_3)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)
def test_single_effect_to_team(transformer_skill: SkillTransformer):
    # Kirsty S2
    # https://dragalialost.wiki/w/Kirsty
    skill_data_base = transformer_skill.transform_supportive(105503022)

    assert skill_data_base.max_level == 3

    expected_buffs_lv_1 = {
        BuffEffectInfo("BUF_ALL_ATK_SSR_30_LV01", HitTargetSimple.TEAM,
                       BuffParameter.ATK_BUFF, 0.15, 15, 0)
    }
    expected_buffs_lv_2 = {
        BuffEffectInfo("BUF_ALL_ATK_SSR_30_LV02", HitTargetSimple.TEAM,
                       BuffParameter.ATK_BUFF, 0.2, 15, 0)
    }
    expected_buffs_lv_3 = {
        BuffEffectInfo("BUF_174_ATK_LV03", HitTargetSimple.TEAM,
                       BuffParameter.ATK_BUFF, 0.2, 15, 0)
    }
    expected_base_buffs = [
        expected_buffs_lv_1, expected_buffs_lv_2, expected_buffs_lv_3
    ]

    skill_data = skill_data_base.with_conditions()

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_3)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)
def test_has_phase_3(transformer_skill: SkillTransformer):
    # Summer Julietta S2 - P3
    # https://dragalialost.wiki/w/Summer_Julietta
    skill_data_base = transformer_skill.transform_supportive(104502014)

    expected_base_buffs_lv_1 = {
        BuffEffectInfo("AXE_107_04_ATK_LV01", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.ATK_BUFF, 0.15, 15, 0),
    }
    expected_base_buffs_lv_2 = {
        BuffEffectInfo("AXE_107_04_ATK_LV02", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.ATK_BUFF, 0.15, 15, 0),
    }
    expected_base_buffs_lv_3 = {
        BuffEffectInfo("AXE_107_04_ATK_LV03", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.ATK_BUFF, 0.15, 15, 0),
    }

    addl_buffs = [{
        BuffEffectInfo("AXE_107_04_CRT_LV01", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.CRT_RATE_BUFF, 0.08, 15, 0),
        BuffEffectInfo("AXE_107_04_SLD_LV01", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.SHIELD_SINGLE_DMG, 0.2, 0, 1),
    },
                  {
                      BuffEffectInfo("AXE_107_04_CRT_LV02",
                                     HitTargetSimple.SELF_SURROUNDING,
                                     BuffParameter.CRT_RATE_BUFF, 0.1, 15, 0),
                      BuffEffectInfo("AXE_107_04_SLD_LV02",
                                     HitTargetSimple.SELF_SURROUNDING,
                                     BuffParameter.SHIELD_SINGLE_DMG, 0.3, 0,
                                     1),
                  },
                  {
                      BuffEffectInfo("AXE_107_04_CRT_LV03",
                                     HitTargetSimple.SELF_SURROUNDING,
                                     BuffParameter.CRT_RATE_BUFF, 0.13, 15, 0),
                      BuffEffectInfo("AXE_107_04_SLD_LV03",
                                     HitTargetSimple.SELF_SURROUNDING,
                                     BuffParameter.SHIELD_SINGLE_DMG, 0.4, 0,
                                     1),
                  }]

    expected_base_buffs = [
        expected_base_buffs_lv_1, expected_base_buffs_lv_2,
        expected_base_buffs_lv_3
    ]

    assert skill_data_base.max_level == 3

    skill_data = skill_data_base.with_conditions()

    check_buff_unit_match(skill_data.max_lv_buffs,
                          expected_base_buffs_lv_3 | addl_buffs[-1])

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv] | addl_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)
def test_single_effect_to_team_limited(transformer_skill: SkillTransformer):
    # Emma S1
    # https://dragalialost.wiki/w/Emma
    skill_data_base = transformer_skill.transform_supportive(105401031)

    assert skill_data_base.max_level == 3

    expected_buffs_lv_1 = {
        BuffEffectInfo("BUF_160_ATK_FIRE_LV01", HitTargetSimple.TEAM,
                       BuffParameter.ATK_BUFF, 0.15, 15, 0)
    }
    expected_buffs_lv_2 = {
        BuffEffectInfo("BUF_160_ATK_FIRE_LV02", HitTargetSimple.TEAM,
                       BuffParameter.ATK_BUFF, 0.20, 15, 0)
    }
    expected_buffs_lv_3 = {
        BuffEffectInfo("BUF_160_ATK_FIRE_LV03", HitTargetSimple.TEAM,
                       BuffParameter.ATK_BUFF, 0.25, 15, 0)
    }
    expected_base_buffs = [
        expected_buffs_lv_1, expected_buffs_lv_2, expected_buffs_lv_3
    ]

    # Base data
    skill_data = skill_data_base.with_conditions()

    assert skill_data.max_lv_buffs == set()
    assert skill_data.buffs == [set()] * skill_data_base.max_level

    # Flame-attuned (should be effective)
    skill_data = skill_data_base.with_conditions(
        ConditionComposite(Condition.TARGET_FLAME))

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_3)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)

    # Water-attuned (should be ineffective)
    skill_data = skill_data_base.with_conditions(
        ConditionComposite(Condition.TARGET_WATER))

    assert skill_data.max_lv_buffs == set()
    assert skill_data.buffs == [set()] * skill_data_base.max_level
def test_hp_drain(transformer_skill: SkillTransformer):
    # Yue S2
    # https://dragalialost.wiki/w/Yue
    skill_data_base = transformer_skill.transform_supportive(104401022)

    assert skill_data_base.max_level == 2

    expected_buffs_lv_1 = {
        BuffEffectInfo("BUF_136_LV01", HitTargetSimple.SELF,
                       BuffParameter.CRT_RATE_BUFF, 0.25, 20, 0),
        BuffEffectInfo("BUF_136_LV01", HitTargetSimple.SELF,
                       BuffParameter.HP_DRAIN_DAMAGE, 0.02, 20, 0),
        BuffEffectInfo("BUF_136_LV01", HitTargetSimple.SELF,
                       BuffParameter.DEF_BUFF, -0.4, 20, 0),
    }
    expected_buffs_lv_2 = {
        BuffEffectInfo("BUF_136_LV02", HitTargetSimple.SELF,
                       BuffParameter.CRT_RATE_BUFF, 0.3, 20, 0),
        BuffEffectInfo("BUF_136_LV02", HitTargetSimple.SELF,
                       BuffParameter.HP_DRAIN_DAMAGE, 0.03, 20, 0),
        BuffEffectInfo("BUF_136_LV02", HitTargetSimple.SELF,
                       BuffParameter.DEF_BUFF, -0.4, 20, 0),
    }

    expected_base_buffs = [expected_buffs_lv_1, expected_buffs_lv_2]

    skill_data = skill_data_base.with_conditions()

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_2)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)
def test_s2(transformer_skill: SkillTransformer):
    # Lucretia S2
    # https://dragalialost.wiki/w/Lucretia
    skill_data_base = transformer_skill.transform_supportive(107504012)

    assert skill_data_base.max_level == 3

    expected_buffs_lv_1 = {
        BuffEffectInfo("BUF_119_ATACK_LV01", HitTargetSimple.SELF, BuffParameter.ATK_BUFF, 0.1, 10, 0),
        BuffEffectInfo("BUF_119_TENSION_LV01", HitTargetSimple.SELF, BuffParameter.ENERGY_LEVEL, 1, 0, 1)
    }
    expected_buffs_lv_2 = {
        BuffEffectInfo("BUF_119_ATACK_LV02", HitTargetSimple.SELF, BuffParameter.ATK_BUFF, 0.1, 10, 0),
        BuffEffectInfo("BUF_119_TENSION_LV02", HitTargetSimple.SELF, BuffParameter.ENERGY_LEVEL, 2, 0, 1)
    }
    expected_buffs_lv_3 = {
        BuffEffectInfo("BUF_119_ATACK_LV03", HitTargetSimple.SELF, BuffParameter.ATK_BUFF, 0.15, 15, 0),
        BuffEffectInfo("BUF_119_TENSION_LV03", HitTargetSimple.SELF, BuffParameter.ENERGY_LEVEL, 3, 0, 1)
    }
    expected_base_buffs = [expected_buffs_lv_1, expected_buffs_lv_2, expected_buffs_lv_3]

    # Base data
    skill_data = skill_data_base.with_conditions()

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_3)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)
Example #15
0
def test_shield_dmg(transformer_skill: SkillTransformer):
    # Yuya S2
    # https://dragalialost.wiki/w/Yuya
    skill_data_base = transformer_skill.transform_supportive(103401022)

    assert skill_data_base.max_level == 3

    expected_buffs_lv_1 = {
        BuffEffectInfo("BUF_165_DEF_LV01", HitTargetSimple.TEAM,
                       BuffParameter.DEF_BUFF, 0.1, 15, 0),
        BuffEffectInfo("BUF_165_SIELD_LV01", HitTargetSimple.TEAM,
                       BuffParameter.SHIELD_SINGLE_DMG, 0.15, 0, 1),
        BuffEffectInfo("BUF_ALL_ATK_SR_30_LV01", HitTargetSimple.TEAM,
                       BuffParameter.ATK_BUFF, 0.1, 15, 0),
    }
    expected_buffs_lv_2 = {
        BuffEffectInfo("BUF_165_DEF_LV02", HitTargetSimple.TEAM,
                       BuffParameter.DEF_BUFF, 0.1, 15, 0),
        BuffEffectInfo("BUF_165_SIELD_LV02", HitTargetSimple.TEAM,
                       BuffParameter.SHIELD_SINGLE_DMG, 0.2, 0, 1),
        BuffEffectInfo("BUF_ALL_ATK_SR_30_LV02", HitTargetSimple.TEAM,
                       BuffParameter.ATK_BUFF, 0.15, 15, 0),
    }
    expected_buffs_lv_3 = {
        BuffEffectInfo("BUF_165_DEF_LV03", HitTargetSimple.TEAM,
                       BuffParameter.DEF_BUFF, 0.1, 15, 0),
        BuffEffectInfo("BUF_165_SIELD_LV03", HitTargetSimple.TEAM,
                       BuffParameter.SHIELD_SINGLE_DMG, 0.3, 0, 1),
        BuffEffectInfo("BUF_165_ATK_LV03", HitTargetSimple.TEAM,
                       BuffParameter.ATK_BUFF, 0.15, 15, 0),
    }
    expected_base_buffs = [
        expected_buffs_lv_1, expected_buffs_lv_2, expected_buffs_lv_3
    ]

    skill_data = skill_data_base.with_conditions()

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_3)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)
def test_multi_effect_to_team(transformer_skill: SkillTransformer):
    # Patia S1
    # https://dragalialost.wiki/w/Patia
    skill_data_base = transformer_skill.transform_supportive(105405021)

    assert skill_data_base.max_level == 4

    expected_buffs_lv_1 = {
        BuffEffectInfo("BUF_184_DEF_LV01", HitTargetSimple.TEAM,
                       BuffParameter.DEF_BUFF, 0.15, 15, 0)
    }
    expected_buffs_lv_2 = {
        BuffEffectInfo("BUF_184_DEF_LV02", HitTargetSimple.TEAM,
                       BuffParameter.DEF_BUFF, 0.2, 15, 0)
    }
    expected_buffs_lv_3 = {
        BuffEffectInfo("BUF_184_DEF_LV03", HitTargetSimple.TEAM,
                       BuffParameter.DEF_BUFF, 0.25, 15, 0)
    }
    expected_buffs_lv_4 = {
        BuffEffectInfo("BUF_184_DEF_LV04", HitTargetSimple.TEAM,
                       BuffParameter.DEF_BUFF, 0.25, 15, 0),
        BuffEffectInfo("BUF_184_ATK_LV04", HitTargetSimple.TEAM,
                       BuffParameter.ATK_BUFF, 0.15, 15, 0)
    }
    expected_base_buffs = [
        expected_buffs_lv_1, expected_buffs_lv_2, expected_buffs_lv_3,
        expected_buffs_lv_4
    ]

    skill_data = skill_data_base.with_conditions()

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_4)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)
Example #17
0
def test_partial_attacking(transformer_skill: SkillTransformer):
    # Elisanne S1
    # https://dragalialost.wiki/w/Elisanne
    skill_data_base = transformer_skill.transform_supportive(105402011)

    assert skill_data_base.max_level == 4

    expected_buffs_lv_1 = {
        BuffEffectInfo("BUF_ALL_ATK_SR_30_LV01", HitTargetSimple.TEAM,
                       BuffParameter.ATK_BUFF, 0.1, 15, 0)
    }
    expected_buffs_lv_2 = {
        BuffEffectInfo("BUF_ALL_ATK_SR_30_LV02", HitTargetSimple.TEAM,
                       BuffParameter.ATK_BUFF, 0.15, 15, 0)
    }
    expected_buffs_lv_3 = {
        BuffEffectInfo("BUF_ALL_ATK_SR_30_LV03", HitTargetSimple.TEAM,
                       BuffParameter.ATK_BUFF, 0.20, 15, 0)
    }
    expected_buffs_lv_4 = {
        BuffEffectInfo("BUF_ALL_ATK_SR_30_LV04", HitTargetSimple.TEAM,
                       BuffParameter.ATK_BUFF, 0.25, 15, 0)
    }

    expected_base_buffs = [
        expected_buffs_lv_1, expected_buffs_lv_2, expected_buffs_lv_3,
        expected_buffs_lv_4
    ]

    skill_data = skill_data_base.with_conditions()

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_4)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)
Example #18
0
def test_has_pre_condition(transformer_skill: SkillTransformer):
    # Veronica S1
    # https://dragalialost.wiki/w/Veronica
    skill_data = transformer_skill.transform_supportive(107505011)

    possible_entries = skill_data.get_all_possible_entries()

    expected_buffs_lv_max = {
        ConditionComposite(Condition.SELF_HP_GTE_50): {
            BuffEffectInfo("BUF_200_DMG_LV04", HitTargetSimple.SELF, BuffParameter.HP_DECREASE_BY_MAX, 0.1, 0, 0),
            BuffEffectInfo("BUF_200_SPC_LV04", HitTargetSimple.SELF, BuffParameter.SP_CHARGE_PCT_USED, 0.2, 0, 0)
        }
    }

    assert set(expected_buffs_lv_max.keys()) == {entry.condition_comp for entry in possible_entries}

    for entry in possible_entries:
        check_buff_unit_match(
            entry.max_lv_buffs, expected_buffs_lv_max[entry.condition_comp], message=entry.condition_comp
        )
        del expected_buffs_lv_max[entry.condition_comp]

    assert len(expected_buffs_lv_max) == 0, f"Conditions not tested: {set(expected_buffs_lv_max.keys())}"
def test_single_effect_field(transformer_skill: SkillTransformer):
    # Gala Euden S1
    # https://dragalialost.wiki/w/Gala_Prince
    skill_data_base = transformer_skill.transform_supportive(101504031)

    assert skill_data_base.max_level == 4

    expected_buffs_lv_1 = {
        BuffEffectInfo("SWD_115_04_ATK_FLD_LV01", HitTargetSimple.FIELD,
                       BuffParameter.ATK_BUFF, 0.10, 10, 0)
    }
    expected_buffs_lv_2 = {
        BuffEffectInfo("SWD_115_04_ATK_FLD_LV02", HitTargetSimple.FIELD,
                       BuffParameter.ATK_BUFF, 0.15, 10, 0)
    }
    expected_buffs_lv_3 = {
        BuffEffectInfo("SWD_115_04_ATK_FLD_LV03", HitTargetSimple.FIELD,
                       BuffParameter.ATK_BUFF, 0.20, 10, 0)
    }
    expected_buffs_lv_4 = {
        BuffEffectInfo("SWD_115_04_ATK_FLD_LV04", HitTargetSimple.FIELD,
                       BuffParameter.ATK_BUFF, 0.20, 10, 0)
    }
    expected_base_buffs = [
        expected_buffs_lv_1, expected_buffs_lv_2, expected_buffs_lv_3,
        expected_buffs_lv_4
    ]

    skill_data = skill_data_base.with_conditions()

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_4)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)
def test_with_attack_one_time_use(transformer_skill: SkillTransformer):
    # Lazry S1 @ High Power
    # https://dragalialost.wiki/w/Lazry
    skill_data_base = transformer_skill.transform_supportive(104502033)

    expected_buffs_lv_1 = {
        BuffEffectInfo("AXE_117_04_PLUS_BUF_LV01", HitTargetSimple.SELF,
                       BuffParameter.SKILL_DAMAGE_BUFF, 0.2, 0, 1),
    }
    expected_buffs_lv_2 = {
        BuffEffectInfo("AXE_117_04_PLUS_BUF_LV02", HitTargetSimple.SELF,
                       BuffParameter.SKILL_DAMAGE_BUFF, 0.2, 0, 1),
    }
    expected_buffs_lv_3 = {
        BuffEffectInfo("AXE_117_04_PLUS_BUF_LV03", HitTargetSimple.SELF,
                       BuffParameter.SKILL_DAMAGE_BUFF, 0.2, 0, 1),
    }
    expected_buffs_lv_4 = {
        BuffEffectInfo("AXE_117_04_PLUS_BUF_LV04", HitTargetSimple.SELF,
                       BuffParameter.SKILL_DAMAGE_BUFF, 0.2, 0, 1),
    }

    expected_base_buffs = [
        expected_buffs_lv_1, expected_buffs_lv_2, expected_buffs_lv_3,
        expected_buffs_lv_4
    ]

    skill_data = skill_data_base.with_conditions()

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_4)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)
Example #21
0
def test_fs_dmg_up(transformer_skill: SkillTransformer):
    # MH Sarisse S2
    # https://dragalialost.wiki/w/Hunter_Sarisse
    skill_data_base = transformer_skill.transform_supportive(106502021)

    assert skill_data_base.max_level == 3

    expected_buffs_lv_1 = {
        BuffEffectInfo("BOW_112_04_BA_LV01", HitTargetSimple.SELF,
                       BuffParameter.FS_DAMAGE_BUFF, 0.6, 0, 1, 1)
    }
    expected_buffs_lv_2 = {
        BuffEffectInfo("BOW_112_04_BA_LV02", HitTargetSimple.SELF,
                       BuffParameter.FS_DAMAGE_BUFF, 0.8, 0, 1, 1)
    }
    expected_buffs_lv_3 = {
        BuffEffectInfo("BOW_112_04_BA_LV03", HitTargetSimple.SELF,
                       BuffParameter.FS_DAMAGE_BUFF, 1, 0, 1, 1)
    }
    expected_base_buffs = [
        expected_buffs_lv_1, expected_buffs_lv_2, expected_buffs_lv_3
    ]

    skill_data = skill_data_base.with_conditions()

    check_buff_unit_match(skill_data.max_lv_buffs,
                          expected_buffs_lv_3,
                          check_stack_count=True)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs,
                              expected_buffs,
                              check_stack_count=True)
Example #22
0
def test_teammate_coverage(transformer_skill: SkillTransformer):
    # Summer Cleo S2
    # https://dragalialost.wiki/w/Summer_Cleo
    skill_data = transformer_skill.transform_supportive(106504012)

    possible_entries = skill_data.get_all_possible_entries()

    base_buffs_at_max = {
        BuffEffectInfo("BOW_108_04_ATK_LV03", HitTargetSimple.SELF_SURROUNDING, BuffParameter.ATK_BUFF, 0.05, 10, 0),
        BuffEffectInfo(
            "BOW_108_04_CRT_LV03", HitTargetSimple.SELF_SURROUNDING, BuffParameter.CRT_RATE_BUFF, 0.03, 10, 0
        ),
        BuffEffectInfo(
            "BOW_108_04_SKILL_LV03", HitTargetSimple.SELF_SURROUNDING, BuffParameter.SKILL_DAMAGE_BUFF, 0.1, 10, 0
        ),
        BuffEffectInfo("BOW_108_04_SPB_LV03", HitTargetSimple.SELF_SURROUNDING, BuffParameter.SP_RATE, 0.1, 10, 0)
    }
    on_0_plus_buffs = {
        BuffEffectInfo("BOW_108_04_DEF_LV03", HitTargetSimple.SELF, BuffParameter.DEF_BUFF, 0.1, 10, 0)
    }
    on_1_plus_buffs = on_0_plus_buffs | {
        BuffEffectInfo("BOW_108_04_CRTDMG_LV03", HitTargetSimple.SELF, BuffParameter.CRT_DAMAGE_BUFF, 0.1, 10, 0)
    }
    on_2_plus_buffs = on_1_plus_buffs | {
        BuffEffectInfo("BOW_108_04_SP_LV03", HitTargetSimple.SELF, BuffParameter.SP_CHARGE_PCT_S1, 1, 0, 0)
    }

    expected_buffs_lv_max = {
        ConditionComposite(Condition.COVER_TEAMMATE_0): base_buffs_at_max | on_0_plus_buffs,
        ConditionComposite(Condition.COVER_TEAMMATE_1): base_buffs_at_max | on_1_plus_buffs,
        ConditionComposite(Condition.COVER_TEAMMATE_2): base_buffs_at_max | on_2_plus_buffs,
        ConditionComposite(Condition.COVER_TEAMMATE_3): base_buffs_at_max | on_2_plus_buffs,
    }

    assert set(expected_buffs_lv_max.keys()) == {entry.condition_comp for entry in possible_entries}

    for entry in possible_entries:
        check_buff_unit_match(
            entry.max_lv_buffs, expected_buffs_lv_max[entry.condition_comp], message=entry.condition_comp
        )
        del expected_buffs_lv_max[entry.condition_comp]

    assert len(expected_buffs_lv_max) == 0, f"Conditions not tested: {set(expected_buffs_lv_max.keys())}"
Example #23
0
def test_element_restricted(transformer_skill: SkillTransformer):
    # Emma S1
    # https://dragalialost.wiki/w/Emma
    skill_data = transformer_skill.transform_supportive(105401031)

    possible_entries = skill_data.get_all_possible_entries()

    expected_buffs_lv_max = {
        ConditionComposite(Condition.TARGET_FLAME): {
            BuffEffectInfo("BUF_160_ATK_FIRE_LV03", HitTargetSimple.TEAM, BuffParameter.ATK_BUFF, 0.25, 15, 0)
        },
    }

    assert set(expected_buffs_lv_max.keys()) == {entry.condition_comp for entry in possible_entries}

    for entry in possible_entries:
        check_buff_unit_match(
            entry.max_lv_buffs, expected_buffs_lv_max[entry.condition_comp], message=entry.condition_comp
        )
        del expected_buffs_lv_max[entry.condition_comp]

    assert len(expected_buffs_lv_max) == 0, f"Conditions not tested: {set(expected_buffs_lv_max.keys())}"
Example #24
0
def test_no_condition(transformer_skill: SkillTransformer):
    # Kirsty S2
    # https://dragalialost.wiki/w/Kirsty
    skill_data = transformer_skill.transform_supportive(105503022)

    possible_entries = skill_data.get_all_possible_entries()

    expected_buffs_lv_max = {
        ConditionComposite(): {
            BuffEffectInfo("BUF_174_ATK_LV03", HitTargetSimple.TEAM, BuffParameter.ATK_BUFF, 0.2, 15, 0)
        },
    }

    assert set(expected_buffs_lv_max.keys()) == {entry.condition_comp for entry in possible_entries}

    for entry in possible_entries:
        check_buff_unit_match(
            entry.max_lv_buffs, expected_buffs_lv_max[entry.condition_comp], message=entry.condition_comp
        )

        del expected_buffs_lv_max[entry.condition_comp]

    assert len(expected_buffs_lv_max) == 0, f"Conditions not tested: {set(expected_buffs_lv_max.keys())}"
def test_with_attack(transformer_skill: SkillTransformer):
    # Marth S2 - P3
    # https://dragalialost.wiki/w/Marth
    skill_data_base = transformer_skill.transform_supportive(101501024)

    expected_buffs_lv_1 = {
        BuffEffectInfo("SWD_107_04_ALL_SPD_LV01", HitTargetSimple.TEAM,
                       BuffParameter.ASPD_BUFF, 0.2, 10, 0),
        BuffEffectInfo("SWD_107_04_ALL_ATK_LV01", HitTargetSimple.TEAM,
                       BuffParameter.ATK_BUFF, 0.1, 10, 0),
    }
    expected_buffs_lv_2 = {
        BuffEffectInfo("SWD_107_04_ALL_SPD_LV02", HitTargetSimple.TEAM,
                       BuffParameter.ASPD_BUFF, 0.3, 10, 0),
        BuffEffectInfo("SWD_107_04_ALL_ATK_LV02", HitTargetSimple.TEAM,
                       BuffParameter.ATK_BUFF, 0.1, 10, 0),
    }
    expected_buffs_lv_3 = {
        BuffEffectInfo("SWD_107_04_ALL_SPD_LV03", HitTargetSimple.TEAM,
                       BuffParameter.ASPD_BUFF, 0.3, 10, 0),
        BuffEffectInfo("SWD_107_04_ALL_ATK_LV03", HitTargetSimple.TEAM,
                       BuffParameter.ATK_BUFF, 0.1, 10, 0),
    }

    expected_base_buffs = [
        expected_buffs_lv_1, expected_buffs_lv_2, expected_buffs_lv_3
    ]

    skill_data = skill_data_base.with_conditions()

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_3)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)
def test_multi_effect_to_nearby_2(transformer_skill: SkillTransformer):
    # Summer Cleo S2
    # https://dragalialost.wiki/w/Summer_Cleo
    skill_data_base = transformer_skill.transform_supportive(106504012)

    expected_base_buffs_lv_1 = {
        BuffEffectInfo("BOW_108_04_ATK_LV01", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.ATK_BUFF, 0.03, 10, 0),
        BuffEffectInfo("BOW_108_04_CRT_LV01", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.CRT_RATE_BUFF, 0.02, 10, 0),
        BuffEffectInfo("BOW_108_04_SKILL_LV01",
                       HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.SKILL_DAMAGE_BUFF, 0.1, 10, 0),
        BuffEffectInfo("BOW_108_04_SPB_LV01", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.SP_RATE, 0.1, 10, 0),
    }
    expected_base_buffs_lv_2 = {
        BuffEffectInfo("BOW_108_04_ATK_LV02", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.ATK_BUFF, 0.05, 10, 0),
        BuffEffectInfo("BOW_108_04_CRT_LV02", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.CRT_RATE_BUFF, 0.03, 10, 0),
        BuffEffectInfo("BOW_108_04_SKILL_LV02",
                       HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.SKILL_DAMAGE_BUFF, 0.1, 10, 0),
        BuffEffectInfo("BOW_108_04_SPB_LV02", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.SP_RATE, 0.1, 10, 0),
    }
    expected_base_buffs_lv_3 = {
        BuffEffectInfo("BOW_108_04_ATK_LV03", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.ATK_BUFF, 0.05, 10, 0),
        BuffEffectInfo("BOW_108_04_CRT_LV03", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.CRT_RATE_BUFF, 0.03, 10, 0),
        BuffEffectInfo("BOW_108_04_SKILL_LV03",
                       HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.SKILL_DAMAGE_BUFF, 0.1, 10, 0),
        BuffEffectInfo("BOW_108_04_SPB_LV03", HitTargetSimple.SELF_SURROUNDING,
                       BuffParameter.SP_RATE, 0.1, 10, 0),
    }

    on_0_plus_buffs = {
        BuffEffectInfo("BOW_108_04_DEF_LV03", HitTargetSimple.SELF,
                       BuffParameter.DEF_BUFF, 0.1, 10, 0),
    }
    on_1_plus_buffs = on_0_plus_buffs | {
        BuffEffectInfo("BOW_108_04_CRTDMG_LV03", HitTargetSimple.SELF,
                       BuffParameter.CRT_DAMAGE_BUFF, 0.1, 10, 0),
    }
    on_2_plus_buffs = on_1_plus_buffs | {
        BuffEffectInfo("BOW_108_04_SP_LV03", HitTargetSimple.SELF,
                       BuffParameter.SP_CHARGE_PCT_S1, 1, 0, 0),
    }

    expected_base_buffs = [
        expected_base_buffs_lv_1, expected_base_buffs_lv_2,
        expected_base_buffs_lv_3
    ]

    # arr[i][j] is the additional buffs granted, i = skill level / j = count of teammates covered
    expected_additional_buffs = [[set(), set(), set(),
                                  set()], [set(), set(),
                                           set(), set()],
                                 [
                                     on_0_plus_buffs, on_1_plus_buffs,
                                     on_2_plus_buffs, on_2_plus_buffs
                                 ]]

    assert skill_data_base.max_level == 3

    for cond_enum, teammate_count in ConditionCategories.skill_teammates_covered.conversion_dict.items(
    ):
        skill_data = skill_data_base.with_conditions(
            ConditionComposite(cond_enum))

        check_buff_unit_match(
            skill_data.max_lv_buffs, expected_base_buffs_lv_3
            | expected_additional_buffs[-1][teammate_count])

        for skill_lv in range(skill_data_base.max_level):
            actual_buffs = skill_data.buffs[skill_lv]
            expected_buffs = expected_base_buffs[
                skill_lv] | expected_additional_buffs[skill_lv][teammate_count]

            check_buff_unit_match(actual_buffs, expected_buffs)
def test_s2(transformer_skill: SkillTransformer):
    # Gala Leonidas S2
    # https://dragalialost.wiki/w/Gala_Leonidas
    skill_data_base = transformer_skill.transform_supportive(109501012)

    assert skill_data_base.max_level == 2

    expected_buffs = {
        (Condition.ACTION_COND_LV_1,): [
            {
                BuffEffectInfo(
                    "GUN_107_04_BUF_LV01", HitTargetSimple.SELF, BuffParameter.DAMAGE_REDUCTION, 0.1, 40, 0
                ),
            },
            {
                BuffEffectInfo(
                    "GUN_107_04_BUF_LV02", HitTargetSimple.SELF, BuffParameter.DAMAGE_REDUCTION, 0.1, 40, 0
                ),
            }
        ],
        (Condition.ACTION_COND_LV_2,): [
            {
                BuffEffectInfo(
                    "GUN_107_04_BUF_LV01", HitTargetSimple.SELF, BuffParameter.DAMAGE_REDUCTION, 0.1, 40, 0
                ),
                BuffEffectInfo(
                    "GUN_107_04_BUF_LV01", HitTargetSimple.SELF, BuffParameter.ATK_BUFF, 0.05, 40, 0
                ),
            },
            {
                BuffEffectInfo(
                    "GUN_107_04_BUF_LV02", HitTargetSimple.SELF, BuffParameter.DAMAGE_REDUCTION, 0.1, 40, 0
                ),
                BuffEffectInfo(
                    "GUN_107_04_BUF_LV02", HitTargetSimple.SELF, BuffParameter.ATK_BUFF, 0.05, 40, 0
                ),
            }
        ],
        (Condition.ACTION_COND_LV_3,): [
            {
                BuffEffectInfo(
                    "GUN_107_04_BUF_LV01", HitTargetSimple.SELF, BuffParameter.DAMAGE_REDUCTION, 0.15, 40, 0
                ),
                BuffEffectInfo(
                    "GUN_107_04_BUF_LV01", HitTargetSimple.SELF, BuffParameter.ATK_BUFF, 0.05, 40, 0
                ),
            },
            {
                BuffEffectInfo(
                    "GUN_107_04_BUF_LV02", HitTargetSimple.SELF, BuffParameter.DAMAGE_REDUCTION, 0.15, 40, 0
                ),
                BuffEffectInfo(
                    "GUN_107_04_BUF_LV02", HitTargetSimple.SELF, BuffParameter.ATK_BUFF, 0.05, 40, 0
                ),
            }
        ],
        (Condition.ACTION_COND_LV_4,): [
            {
                BuffEffectInfo(
                    "GUN_107_04_BUF_LV01", HitTargetSimple.SELF, BuffParameter.DAMAGE_REDUCTION, 0.2, 40, 0
                ),
                BuffEffectInfo(
                    "GUN_107_04_BUF_LV01", HitTargetSimple.SELF, BuffParameter.ATK_BUFF, 0.1, 40, 0
                ),
            },
            {
                BuffEffectInfo(
                    "GUN_107_04_BUF_LV02", HitTargetSimple.SELF, BuffParameter.DAMAGE_REDUCTION, 0.2, 40, 0
                ),
                BuffEffectInfo(
                    "GUN_107_04_BUF_LV02", HitTargetSimple.SELF, BuffParameter.ATK_BUFF, 0.1, 40, 0
                ),
            }
        ],
        (Condition.ACTION_COND_LV_5,): [
            {
                BuffEffectInfo("GUN_107_04_BUF_LV01", HitTargetSimple.SELF, BuffParameter.DAMAGE_REDUCTION, 0.2, 0, 0),
                BuffEffectInfo("GUN_107_04_BUF_LV01", HitTargetSimple.SELF, BuffParameter.ATK_BUFF, 0.1, 0, 0),
            },
            {
                BuffEffectInfo("GUN_107_04_BUF_LV02", HitTargetSimple.SELF, BuffParameter.DAMAGE_REDUCTION, 0.2, 0, 0),
                BuffEffectInfo("GUN_107_04_BUF_LV02", HitTargetSimple.SELF, BuffParameter.ATK_BUFF, 0.1, 0, 0),
            }
        ],
    }

    for condition, buff_units in expected_buffs.items():
        skill_data = skill_data_base.with_conditions(ConditionComposite(condition))

        check_buff_unit_match(skill_data.max_lv_buffs, buff_units[skill_data.max_level - 1], message=condition)

        for skill_lv in range(skill_data_base.max_level):
            expected_buffs = buff_units[skill_lv]
            actual_buffs = skill_data.buffs[skill_lv]

            check_buff_unit_match(actual_buffs, expected_buffs, message=condition)
Example #28
0
def test_shield_hp(transformer_skill: SkillTransformer):
    # Grace S1
    # https://dragalialost.wiki/w/Linnea
    skill_data_base = transformer_skill.transform_supportive(108505031)

    # SkillData.Ability - Ability.Condition & IDStr to Label

    assert skill_data_base.max_level == 3

    expected_buffs_lv_1_gte_40 = {
        BuffEffectInfo("BUF_189_BARRIER_LV03", HitTargetSimple.TEAM,
                       BuffParameter.SHIELD_LIFE, 0.3, 0, 0),
        BuffEffectInfo("BUF_189_DMG_LV03", HitTargetSimple.SELF,
                       BuffParameter.HP_FIX_BY_MAX, 0.3, 0, 0),
    }
    expected_buffs_lv_2_gte_40 = {
        BuffEffectInfo("BUF_189_BARRIER_LV03", HitTargetSimple.TEAM,
                       BuffParameter.SHIELD_LIFE, 0.3, 0, 0),
        BuffEffectInfo("BUF_189_DMG_LV03", HitTargetSimple.SELF,
                       BuffParameter.HP_FIX_BY_MAX, 0.3, 0, 0),
    }
    expected_buffs_lv_3_gte_40 = {
        BuffEffectInfo("BUF_189_BARRIER_LV03", HitTargetSimple.TEAM,
                       BuffParameter.SHIELD_LIFE, 0.3, 0, 0),
        BuffEffectInfo("BUF_189_DMG_LV03", HitTargetSimple.SELF,
                       BuffParameter.HP_FIX_BY_MAX, 0.3, 0, 0),
    }
    expected_buffs_lv_1_lt_40 = {
        BuffEffectInfo("BUF_ALL_DEF_SSR_30_LV01", HitTargetSimple.TEAM,
                       BuffParameter.DEF_BUFF, 0.2, 15, 0),
    }
    expected_buffs_lv_2_lt_40 = {
        BuffEffectInfo("BUF_ALL_DEF_SSR_30_LV02", HitTargetSimple.TEAM,
                       BuffParameter.DEF_BUFF, 0.25, 15, 0),
    }
    expected_buffs_lv_3_lt_40 = {
        BuffEffectInfo("BUF_ALL_DEF_SSR_30_LV03", HitTargetSimple.TEAM,
                       BuffParameter.DEF_BUFF, 0.3, 15, 0),
    }
    expected_base_buffs_gte_40 = [
        expected_buffs_lv_1_gte_40, expected_buffs_lv_2_gte_40,
        expected_buffs_lv_3_gte_40
    ]
    expected_base_buffs_lt_40 = [
        expected_buffs_lv_1_lt_40, expected_buffs_lv_2_lt_40,
        expected_buffs_lv_3_lt_40
    ]

    # No conditions

    skill_data = skill_data_base.with_conditions()

    assert skill_data.max_lv_buffs == set()

    # HP >= 40%

    skill_data = skill_data_base.with_conditions(
        ConditionComposite(Condition.SELF_HP_GTE_40))

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_3_gte_40)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs_gte_40[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)

    # HP < 40%

    skill_data = skill_data_base.with_conditions(
        ConditionComposite(Condition.SELF_HP_LT_40))

    check_buff_unit_match(skill_data.max_lv_buffs, expected_buffs_lv_3_lt_40)

    for skill_lv in range(skill_data_base.max_level):
        expected_buffs = expected_base_buffs_lt_40[skill_lv]
        actual_buffs = skill_data.buffs[skill_lv]

        check_buff_unit_match(actual_buffs, expected_buffs)