Ejemplo n.º 1
0
def test_og_alex_s2(transformer_skill: SkillTransformer):
    # Original Alex S2
    # https://dragalialost.wiki/w/Alex
    skill_data_base = transformer_skill.transform_attacking(103405022)

    # Not BK
    skill_data = skill_data_base.with_conditions()

    assert skill_data.hit_count == [4, 4, 4]
    assert skill_data.hit_count_at_max == 4
    assert skill_data.total_mod == pytest.approx(
        [1.64 * 3 + 3.27, 1.82 * 3 + 3.62, 2.01 * 3 + 4.02])
    assert skill_data.total_mod_at_max == pytest.approx(2.01 * 3 + 4.02)
    assert skill_data.mods == approx_matrix([[1.64] * 2 + [3.27] + [1.64],
                                             [1.82] * 2 + [3.62] + [1.82],
                                             [2.01] * 2 + [4.02] + [2.01]])
    assert skill_data.mods_at_max == pytest.approx([2.01] * 2 + [4.02] +
                                                   [2.01])
    assert skill_data.max_level == 3

    # In BK
    skill_data = skill_data_base.with_conditions(
        ConditionComposite(Condition.TARGET_BK_STATE))

    assert skill_data.hit_count == [4, 4, 4]
    assert skill_data.hit_count_at_max == 4
    assert skill_data.total_mod == pytest.approx(
        [3.28 * 3 + 6.54, 3.64 * 3 + 7.24, 2.01 * 3 + 4.02])
    assert skill_data.total_mod_at_max == pytest.approx(2.01 * 3 + 4.02)
    assert skill_data.mods == approx_matrix([[3.28] * 2 + [6.54] + [3.28],
                                             [3.64] * 2 + [7.24] + [3.64],
                                             [2.01] * 2 + [4.02] + [2.01]])
    assert skill_data.mods_at_max == pytest.approx([2.01] * 2 + [4.02] +
                                                   [2.01])
    assert skill_data.max_level == 3
Ejemplo n.º 2
0
def test_s2(transformer_skill: SkillTransformer):
    # Dragonyule Malora S2
    # https://dragalialost.wiki/w/Dragonyule_Malora
    skill_data_base = transformer_skill.transform_attacking(104504022)

    # Base data
    skill_data = skill_data_base.with_conditions()

    assert skill_data.hit_count == [3, 3]
    assert skill_data.hit_count_at_max == 3
    assert skill_data.total_mod == pytest.approx([3.86 * 3, 4.32 * 3])
    assert skill_data.total_mod_at_max == pytest.approx(4.32 * 3)
    assert skill_data.mods == approx_matrix([[3.86] * 3, [4.32] * 3])
    assert skill_data.mods_at_max == pytest.approx([4.32] * 3)
    assert skill_data.max_level == 2

    # Target DEF down
    skill_data = skill_data_base.with_conditions(
        ConditionComposite(Condition.TARGET_DEF_DOWN))

    assert skill_data.hit_count == [3, 3]
    assert skill_data.hit_count_at_max == 3
    assert skill_data.total_mod == pytest.approx([6.948 * 3, 7.776 * 3])
    assert skill_data.total_mod_at_max == pytest.approx(7.776 * 3)
    assert skill_data.mods == approx_matrix([[6.948] * 3, [7.776] * 3])
    assert skill_data.mods_at_max == pytest.approx([7.776] * 3)
    assert skill_data.max_level == 2
def test_s2_chained(transformer_skill: SkillTransformer):
    # Gala Alex S2 @ Chained
    # https://dragalialost.wiki/w/Gala_Alex
    skill_data_base = transformer_skill.transform_attacking(101505026)

    # Base

    skill_data = skill_data_base.with_conditions()

    assert skill_data.hit_count == [2, 2, 2]
    assert skill_data.hit_count_at_max == 2
    assert skill_data.total_mod == pytest.approx(
        [4.97 + 3.97, 5.53 + 4.42, 5.53 + 4.42])
    assert skill_data.total_mod_at_max == pytest.approx(5.53 + 4.42)
    assert skill_data.mods == approx_matrix([[4.97, 3.97], [5.53, 4.42],
                                             [5.53, 4.42]])
    assert skill_data.mods_at_max == pytest.approx([5.53, 4.42])
    assert skill_data.max_level == 3

    # Poisoned

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

    assert skill_data.hit_count == [2, 2, 2]
    assert skill_data.hit_count_at_max == 2
    assert skill_data.total_mod == pytest.approx(
        [5.467 + 4.367, 6.083 + 4.862, 6.083 + 4.862])
    assert skill_data.total_mod_at_max == pytest.approx(6.083 + 4.862)
    assert skill_data.mods == approx_matrix([[5.467, 4.367], [6.083, 4.862],
                                             [6.083, 4.862]])
    assert skill_data.mods_at_max == pytest.approx([6.083, 4.862])
    assert skill_data.max_level == 3
Ejemplo n.º 4
0
def test_label_has_whitespaces(transformer_skill: SkillTransformer):
    """
    The text label of the action of Xander S2 (Lv 3) contains a whitespace at the end of the action label.

    Expected: ``SWD_004_04_H02_LV01``
    Actual:   ``SWD_004_04_H02_LV01 ``
    """
    # Xander S2
    # https://dragalialost.wiki/w/Xander
    skill_data_base = transformer_skill.transform_attacking(101502012)

    # Base data
    skill_data = skill_data_base.with_conditions()

    assert skill_data.hit_count == [3, 3, 3]
    assert skill_data.hit_count_at_max == 3
    assert skill_data.total_mod == pytest.approx(
        [4.906 * 3, 5.456 * 3, 5.566 * 3])
    assert skill_data.total_mod_at_max == pytest.approx(5.566 * 3)
    assert skill_data.mods == approx_matrix([[4.906] * 3, [5.456] * 3,
                                             [5.566] * 3])
    assert skill_data.mods_at_max == pytest.approx([5.566] * 3)
    assert skill_data.max_level == 3

    # With buffs
    condition_to_dmg_up_rate = {
        (Condition.SELF_BUFF_0, ): 1 + 0,
        (Condition.SELF_BUFF_10, ): 1 + 0.05 * 10,
        (Condition.SELF_BUFF_15, ): 1 + 0.05 * 15,
        (Condition.SELF_BUFF_20, ): 1 + 0.05 * 20,
        (Condition.SELF_BUFF_25, ): 1 + 0.05 * 25,
        (Condition.SELF_BUFF_30, ): 1 + 0.05 * 30,
        (Condition.SELF_BUFF_35, ): 1 + 0.05 * 35,
        (Condition.SELF_BUFF_40, ): 1 + 0.05 * 40,
        (Condition.SELF_BUFF_45, ): 1 + 0.05 * 45,
        (Condition.SELF_BUFF_50, ): 1 + 0.05 * 50,
    }

    for conditions, boost_rate in condition_to_dmg_up_rate.items():
        skill_data = skill_data_base.with_conditions(
            ConditionComposite(conditions))

        assert skill_data.hit_count == [3, 3, 3]
        assert skill_data.hit_count_at_max == 3
        assert skill_data.total_mod == pytest.approx(
            [4.906 * 3, 5.456 * 3, 5.566 * 3 * boost_rate])
        assert skill_data.total_mod_at_max == pytest.approx(5.566 * 3 *
                                                            boost_rate)
        assert skill_data.mods == approx_matrix([[4.906] * 3, [5.456] * 3,
                                                 [5.566 * boost_rate] * 3])
        assert skill_data.mods_at_max == pytest.approx([5.566 * boost_rate] *
                                                       3)
        assert skill_data.max_level == 3
Ejemplo n.º 5
0
def test_buff_related_1(transformer_skill: SkillTransformer):
    # For indirect buff boost tests, refer to each character instead (such as Lapis)

    # Karina S1
    # https://dragalialost.wiki/w/Karina
    skill_data_base = transformer_skill.transform_attacking(104402011)

    # Base data
    skill_data = skill_data_base.with_conditions()

    assert skill_data.hit_count == [2, 2, 2, 2]
    assert skill_data.hit_count_at_max == 2
    assert skill_data.total_mod == pytest.approx(
        [5.96 * 2, 6.63 * 2, 7.36 * 2, 8.18 * 2])
    assert skill_data.total_mod_at_max == pytest.approx(16.36)
    assert skill_data.mods == approx_matrix([[5.96] * 2, [6.63] * 2,
                                             [7.36] * 2, [8.18] * 2])
    assert skill_data.mods_at_max == pytest.approx([8.18] * 2)
    assert skill_data.max_level == 4

    # With buffs
    condition_to_dmg_up_rate = {
        (Condition.SELF_BUFF_0, ): 1 + 0,
        (Condition.SELF_BUFF_10, ): 1 + 0.05 * 10,
        (Condition.SELF_BUFF_15, ): 1 + 0.05 * 15,
        (Condition.SELF_BUFF_20, ): 1 + 0.05 * 20,
        (Condition.SELF_BUFF_25, ): 1 + 0.05 * 25,
        (Condition.SELF_BUFF_30, ): 1 + 0.05 * 30,
        (Condition.SELF_BUFF_35, ): 1 + 0.05 * 35,
        (Condition.SELF_BUFF_40, ): 1 + 0.05 * 40,
        (Condition.SELF_BUFF_45, ): 1 + 0.05 * 45,
        (Condition.SELF_BUFF_50, ): 1 + 0.05 * 50,
    }

    for conditions, boost_rate in condition_to_dmg_up_rate.items():
        skill_data = skill_data_base.with_conditions(
            ConditionComposite(conditions))

        assert skill_data.hit_count == [2, 2, 2, 2]
        assert skill_data.hit_count_at_max == 2
        assert skill_data.total_mod == pytest.approx([
            5.96 * 2 * boost_rate, 6.63 * 2 * boost_rate,
            7.36 * 2 * boost_rate, 8.18 * 2 * boost_rate
        ])
        assert skill_data.total_mod_at_max == pytest.approx(8.18 * 2 *
                                                            boost_rate)
        assert skill_data.mods == approx_matrix([[5.96 * boost_rate] * 2,
                                                 [6.63 * boost_rate] * 2,
                                                 [7.36 * boost_rate] * 2,
                                                 [8.18 * boost_rate] * 2])
        assert skill_data.mods_at_max == pytest.approx([8.18 * boost_rate] * 2)
        assert skill_data.max_level == 4
def test_s1_break(transformer_skill: SkillTransformer):
    # Gala Alex S1 @ Target break
    # https://dragalialost.wiki/w/Gala_Alex
    skill_data_base = transformer_skill.transform_attacking(101505025)

    # Base

    skill_data = skill_data_base.with_conditions()

    assert skill_data.hit_count == [4, 4, 4, 4]
    assert skill_data.hit_count_at_max == 4
    assert skill_data.total_mod == pytest.approx([
        1.94 * 3 + 5.35,
        2.14 * 3 + 5.90,
        2.35 * 3 + 6.58,
        2.45 * 3 + 6.68,
    ])
    assert skill_data.total_mod_at_max == pytest.approx(2.45 * 3 + 6.68)
    assert skill_data.mods == approx_matrix([
        [1.94] * 3 + [5.35],
        [2.14] * 3 + [5.90],
        [2.35] * 3 + [6.58],
        [2.45] * 3 + [6.68],
    ])
    assert skill_data.mods_at_max == pytest.approx([2.45] * 3 + [6.68])
    assert skill_data.max_level == 4

    # Target BK

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

    assert skill_data.hit_count == [4, 4, 4, 4]
    assert skill_data.hit_count_at_max == 4
    assert skill_data.total_mod == pytest.approx([
        2.910 * 3 + 8.025,
        3.210 * 3 + 8.850,
        3.525 * 3 + 9.870,
        3.675 * 3 + 10.02,
    ])
    assert skill_data.total_mod_at_max == pytest.approx(3.675 * 3 + 10.02)
    assert skill_data.mods == approx_matrix([
        [2.910] * 3 + [8.025],
        [3.210] * 3 + [8.850],
        [3.525] * 3 + [9.870],
        [3.675] * 3 + [10.02],
    ])
    assert skill_data.mods_at_max == pytest.approx([3.675] * 3 + [10.02])
    assert skill_data.max_level == 4
def test_s1(transformer_skill: SkillTransformer):
    # Wedding Aoi S1
    # https://dragalialost.wiki/w/Wedding_Aoi
    skill_data_base = transformer_skill.transform_attacking(103503011)

    # Base data
    skill_data = skill_data_base.with_conditions()

    assert skill_data.hit_count == [5, 5, 5, 5]
    assert skill_data.hit_count_at_max == 5
    assert skill_data.total_mod == pytest.approx([
        2.926 * 4 + 11.682,
        3.08 * 4 + 12.276,
        3.234 * 4 + 12.892,
        3.24 * 4 + 12.9,
    ])
    assert skill_data.total_mod_at_max == pytest.approx(3.24 * 4 + 12.9)
    assert skill_data.mods == approx_matrix([
        [2.926] * 4 + [11.682],
        [3.08] * 4 + [12.276],
        [3.234] * 4 + [12.892],
        [3.24] * 4 + [12.9],
    ])
    assert skill_data.mods_at_max == pytest.approx([3.24] * 4 + [12.9])
    assert skill_data.max_level == 4
Ejemplo n.º 8
0
def test_hp_related_1_2(transformer_skill: SkillTransformer):
    # Veronica S1
    # https://dragalialost.wiki/w/Veronica
    skill_data_base = transformer_skill.transform_attacking(107505011)

    # 1 HP & Poisoned Punisher
    skill_data = skill_data_base.with_conditions(
        ConditionComposite([Condition.TARGET_POISONED, Condition.SELF_HP_1]))

    assert skill_data.hit_count == [4, 4, 4, 4]
    assert skill_data.hit_count_at_max == 4
    assert skill_data.total_mod == pytest.approx([
        6.0525 * 3 + 7.5825,
        6.7275 * 3 + 8.3925,
        7.47 * 3 + 9.3375,
        10.746 * 3 + 12.348,
    ])
    assert skill_data.total_mod_at_max == pytest.approx(10.746 * 3 + 12.348)
    assert skill_data.mods == approx_matrix([
        [6.0525] * 3 + [7.5825],
        [6.7275] * 3 + [8.3925],
        [7.47] * 3 + [9.3375],
        [10.746] * 3 + [12.348],
    ])
    assert skill_data.mods_at_max == pytest.approx([10.746] * 3 + [12.348])
    assert skill_data.max_level == 4
Ejemplo n.º 9
0
def test_hp_related_1_1(transformer_skill: SkillTransformer):
    # Veronica S1
    # https://dragalialost.wiki/w/Veronica
    skill_data_base = transformer_skill.transform_attacking(107505011)

    # 1 HP
    skill_data = skill_data_base.with_conditions(
        ConditionComposite(Condition.SELF_HP_1))

    assert skill_data.hit_count == [4, 4, 4, 4]
    assert skill_data.hit_count_at_max == 4
    assert skill_data.total_mod == pytest.approx([
        6.0525 * 3 + 7.5825,
        6.7275 * 3 + 8.3925,
        7.47 * 3 + 9.3375,
        8.955 * 3 + 10.29,
    ])
    assert skill_data.total_mod_at_max == pytest.approx(8.955 * 3 + 10.29)
    assert skill_data.mods == approx_matrix([
        [6.0525] * 3 + [7.5825],
        [6.7275] * 3 + [8.3925],
        [7.47] * 3 + [9.3375],
        [8.955] * 3 + [10.29],
    ])
    assert skill_data.mods_at_max == pytest.approx([8.955] * 3 + [10.29])
    assert skill_data.max_level == 4
Ejemplo n.º 10
0
def test_has_punisher_3_4(transformer_skill: SkillTransformer):
    # Nefaria S1
    # https://dragalialost.wiki/w/Nefaria
    skill_data_base = transformer_skill.transform_attacking(106505011)

    # Blinded or Poisoned Punisher
    skill_data = skill_data_base.with_conditions(
        ConditionComposite(
            [Condition.TARGET_BLINDED, Condition.TARGET_POISONED]))

    assert skill_data.hit_count == [8, 8, 8, 8]
    assert skill_data.hit_count_at_max == 8
    assert skill_data.total_mod == pytest.approx([
        1.036 * 8,
        1.8421 * 8,
        1.99056 * 8,
        1.99056 * 8,
    ])
    assert skill_data.total_mod_at_max == pytest.approx(1.99056 * 8)
    assert skill_data.mods == approx_matrix([
        [1.036] * 8,
        [1.8421] * 8,
        [1.99056] * 8,
        [1.99056] * 8,
    ])
    assert skill_data.mods_at_max == pytest.approx([1.99056] * 8)
    assert skill_data.max_level == 4
Ejemplo n.º 11
0
def test_has_punisher_1_2(transformer_skill: SkillTransformer):
    # Veronica S1
    # https://dragalialost.wiki/w/Veronica
    skill_data_base = transformer_skill.transform_attacking(107505011)

    # Poisoned Punisher
    skill_data = skill_data_base.with_conditions(
        ConditionComposite(Condition.TARGET_POISONED))

    assert skill_data.hit_count == [4, 4, 4, 4]
    assert skill_data.hit_count_at_max == 4
    assert skill_data.total_mod == pytest.approx([
        2.69 * 3 + 3.37,
        2.99 * 3 + 3.73,
        3.32 * 3 + 4.15,
        7.164 * 3 + 8.232,
    ])
    assert skill_data.total_mod_at_max == pytest.approx(7.164 * 3 + 8.232)
    assert skill_data.mods == approx_matrix([
        [2.69] * 3 + [3.37],
        [2.99] * 3 + [3.73],
        [3.32] * 3 + [4.15],
        [7.164] * 3 + [8.232],
    ])
    assert skill_data.mods_at_max == pytest.approx([7.164] * 3 + [8.232])
    assert skill_data.max_level == 4
Ejemplo n.º 12
0
def test_has_punisher_1_1(transformer_skill: SkillTransformer):
    # Veronica S1
    # https://dragalialost.wiki/w/Veronica
    skill_data_base = transformer_skill.transform_attacking(107505011)

    # Base data
    skill_data = skill_data_base.with_conditions()

    assert skill_data.hit_count == [4, 4, 4, 4]
    assert skill_data.hit_count_at_max == 4
    assert skill_data.total_mod == pytest.approx([
        2.69 * 3 + 3.37,
        2.99 * 3 + 3.73,
        3.32 * 3 + 4.15,
        5.97 * 3 + 6.86,
    ])
    assert skill_data.total_mod_at_max == pytest.approx(5.97 * 3 + 6.86)
    assert skill_data.mods == approx_matrix([
        [2.69] * 3 + [3.37],
        [2.99] * 3 + [3.73],
        [3.32] * 3 + [4.15],
        [5.97] * 3 + [6.86],
    ])
    assert skill_data.mods_at_max == pytest.approx([5.97] * 3 + [6.86])
    assert skill_data.max_level == 4
Ejemplo n.º 13
0
def test_s2_masked_paralyzed(transformer_skill: SkillTransformer):
    # Yukata Curran S2 - Masked
    # https://dragalialost.wiki/w/Yukata_Curran
    skill_data_base = transformer_skill.transform_attacking(103504044)

    level_1_base_expected = 0.864
    level_2_base_expected = 1.08

    hits_expected = 30

    # Base data - (1 hit for each bullets)
    skill_data = skill_data_base.with_conditions(ConditionComposite(Condition.TARGET_PARALYZED))

    assert skill_data.hit_count == [hits_expected, hits_expected]
    assert skill_data.hit_count_at_max == hits_expected
    assert skill_data.total_mod == pytest.approx([
        level_1_base_expected * hits_expected,
        level_2_base_expected * hits_expected
    ])
    assert skill_data.total_mod_at_max == pytest.approx(level_2_base_expected * hits_expected)
    assert skill_data.mods == approx_matrix([
        [level_1_base_expected] * hits_expected,
        [level_2_base_expected] * hits_expected
    ])
    assert skill_data.mods_at_max == pytest.approx([level_2_base_expected] * hits_expected)
    assert skill_data.max_level == 2
Ejemplo n.º 14
0
def test_s2_masked_no_affliction(transformer_skill: SkillTransformer):
    # Yukata Curran S2 - Masked
    # https://dragalialost.wiki/w/Yukata_Curran
    skill_data_base = transformer_skill.transform_attacking(103504044)

    level_1_base_expected = 0.72
    level_2_base_expected = 0.9

    hits_expected = 30

    # Base data - (1 hit for each bullets)
    skill_data = skill_data_base.with_conditions()

    assert skill_data.hit_count == [hits_expected, hits_expected]
    assert skill_data.hit_count_at_max == hits_expected
    assert skill_data.total_mod == pytest.approx([
        level_1_base_expected * hits_expected,
        level_2_base_expected * hits_expected
    ])
    assert skill_data.total_mod_at_max == pytest.approx(level_2_base_expected * hits_expected)
    assert skill_data.mods == approx_matrix([
        [level_1_base_expected] * hits_expected,
        [level_2_base_expected] * hits_expected,
    ])
    assert skill_data.mods_at_max == pytest.approx([level_2_base_expected] * hits_expected)
    assert skill_data.max_level == 2
Ejemplo n.º 15
0
def test_has_punisher_3_1(transformer_skill: SkillTransformer):
    # Nefaria S1
    # https://dragalialost.wiki/w/Nefaria
    skill_data_base = transformer_skill.transform_attacking(106505011)

    # Base data
    skill_data = skill_data_base.with_conditions()

    assert skill_data.hit_count == [8, 8, 8, 8]
    assert skill_data.hit_count_at_max == 8
    assert skill_data.total_mod == pytest.approx([
        1.036 * 8,
        1.09 * 8,
        1.144 * 8,
        1.144 * 8,
    ])
    assert skill_data.total_mod_at_max == pytest.approx(1.144 * 8)
    assert skill_data.mods == approx_matrix([
        [1.036] * 8,
        [1.09] * 8,
        [1.144] * 8,
        [1.144] * 8,
    ])
    assert skill_data.mods_at_max == pytest.approx([1.144] * 8)
    assert skill_data.max_level == 4
Ejemplo n.º 16
0
def test_s2(transformer_skill: SkillTransformer):
    # Original Zena S2
    # https://dragalialost.wiki/w/Zena
    skill_data_base = transformer_skill.transform_attacking(107505042)

    level_1_hit = 3.2
    level_1_bullet = 0.4
    level_2_hit = 4.0
    level_2_bullet = 0.5

    hits_expected = 120

    # Base data
    skill_data = skill_data_base.with_conditions()

    assert skill_data.hit_count == [hits_expected + 1, hits_expected + 1, 1]
    assert skill_data.hit_count_at_max == hits_expected + 1
    assert skill_data.total_mod == pytest.approx([
        level_1_hit + level_1_bullet * hits_expected,
        level_2_hit + level_2_bullet * hits_expected, level_2_hit
    ])
    assert skill_data.total_mod_at_max == pytest.approx(level_2_hit +
                                                        level_2_bullet *
                                                        hits_expected)
    assert skill_data.mods == approx_matrix(
        [[level_1_hit] + [level_1_bullet] * hits_expected,
         [level_2_hit] + [level_2_bullet] * hits_expected, [level_2_hit]])
    assert skill_data.mods_at_max == pytest.approx([level_2_hit] +
                                                   [level_2_bullet] *
                                                   hits_expected)
    assert skill_data.max_level == 2
def test_s1_eden(transformer_skill: SkillTransformer):
    # Gala Laxi S1 @ Eden
    # https://dragalialost.wiki/w/Gala_Laxi
    skill_data_base = transformer_skill.transform_attacking(103501023)

    # Base data
    skill_data = skill_data_base.with_conditions()

    assert skill_data.hit_count == [12, 12, 12, 12]
    assert skill_data.hit_count_at_max == 12
    assert skill_data.total_mod == pytest.approx([
        0.595 * 2 + 0.793 * 4 + 0.992 * 6,
        0.669 * 2 + 0.892 * 4 + 1.116 * 6,
        0.744 * 2 + 0.992 * 4 + 1.240 * 6,
        0.760 * 2 + 1.000 * 4 + 1.260 * 6,
    ])
    assert skill_data.total_mod_at_max == pytest.approx(0.760 * 2 + 1.000 * 4 +
                                                        1.260 * 6)
    assert skill_data.mods == approx_matrix([
        [0.595, 0.992] * 2 + [0.793, 0.992] * 2 + [0.992, 0.793] * 2,
        [0.669, 1.116] * 2 + [0.892, 1.116] * 2 + [1.116, 0.892] * 2,
        [0.744, 1.240] * 2 + [0.992, 1.240] * 2 + [1.240, 0.992] * 2,
        [0.760, 1.260] * 2 + [1.000, 1.260] * 2 + [1.260, 1.000] * 2,
    ])
    assert skill_data.mods_at_max == pytest.approx([0.760, 1.260] * 2 +
                                                   [1.000, 1.260] * 2 +
                                                   [1.260, 1.000] * 2)
    assert skill_data.max_level == 4
Ejemplo n.º 18
0
def test_s2(transformer_skill: SkillTransformer):
    # Mitsuhide
    # https://dragalialost.wiki/w/Mitsuhide
    skill_data_base = transformer_skill.transform_attacking(103504022)

    combo_dmg_bonus = {
        ConditionComposite(Condition.COMBO_GTE_0): 1,
        ConditionComposite(Condition.COMBO_GTE_5): 1.05,
        ConditionComposite(Condition.COMBO_GTE_10): 1.10,
        ConditionComposite(Condition.COMBO_GTE_15): 1.20,
        ConditionComposite(Condition.COMBO_GTE_20): 1.30,
        ConditionComposite(Condition.COMBO_GTE_25): 1.40,
        ConditionComposite(Condition.COMBO_GTE_30): 1.50,
    }

    for condition, dmg_rate in combo_dmg_bonus.items():
        skill_data = skill_data_base.with_conditions(condition)

        assert skill_data.hit_count == [1, 1]
        assert skill_data.hit_count_at_max == 1
        assert skill_data.total_mod == pytest.approx(
            [12.21 * dmg_rate, 13.56 * dmg_rate])
        assert skill_data.total_mod_at_max == pytest.approx(13.56 * dmg_rate)
        assert skill_data.mods == approx_matrix([[12.21 * dmg_rate],
                                                 [13.56 * dmg_rate]])
        assert skill_data.mods_at_max == pytest.approx([13.56 * dmg_rate])
        assert skill_data.max_level == 2
Ejemplo n.º 19
0
def test_s2_6_plus_butterflies(transformer_skill: SkillTransformer):
    # Meene S2 @ 6+ butterflies
    # https://dragalialost.wiki/w/Meene
    skill_data_base = transformer_skill.transform_attacking(106503036)

    addl_hits = {
        ConditionComposite(Condition.BULLETS_ON_MAP_0): 0,
        ConditionComposite(Condition.BULLETS_ON_MAP_1): 1,
        ConditionComposite(Condition.BULLETS_ON_MAP_2): 2,
        ConditionComposite(Condition.BULLETS_ON_MAP_3): 3,
        ConditionComposite(Condition.BULLETS_ON_MAP_4): 4,
        ConditionComposite(Condition.BULLETS_ON_MAP_5): 5,
        ConditionComposite(Condition.BULLETS_ON_MAP_6): 6,
        ConditionComposite(Condition.BULLETS_ON_MAP_7): 7,
        ConditionComposite(Condition.BULLETS_ON_MAP_8): 8,
        ConditionComposite(Condition.BULLETS_ON_MAP_9): 9,
    }

    for cond_comp, bonus_hits in addl_hits.items():
        skill_data = skill_data_base.with_conditions(cond_comp)

        assert skill_data.hit_count == [1 + bonus_hits, 1 + bonus_hits]
        assert skill_data.hit_count_at_max == 1 + bonus_hits
        assert skill_data.total_mod == pytest.approx(
            [9 + 1.5 * bonus_hits, 10 + 1.67 * bonus_hits])
        assert skill_data.total_mod_at_max == pytest.approx(10 +
                                                            1.67 * bonus_hits)
        assert skill_data.mods == approx_matrix([[9.0] + [1.5] * bonus_hits,
                                                 [10.0] + [1.67] * bonus_hits])
        assert skill_data.mods_at_max == pytest.approx([10.0] +
                                                       [1.67] * bonus_hits)
        assert skill_data.max_level == 2
Ejemplo n.º 20
0
def test_bellina_s2(transformer_skill: SkillTransformer):
    # Bellina S2
    # https://dragalialost.wiki/w/Bellina
    skill_data = transformer_skill.transform_attacking(
        103505034).with_conditions()

    assert skill_data.crisis_mods == approx_matrix([[3], [3]])
Ejemplo n.º 21
0
def test_s1_p2(transformer_skill: SkillTransformer):
    # Xander S1 P2
    # https://dragalialost.wiki/w/Xander
    skill_data_base = transformer_skill.transform_attacking(101502013)

    condition_to_dmg_up_rate = {
        (Condition.SELF_BUFF_0, ): 1 + 0,
        (Condition.SELF_BUFF_10, ): 1 + 0.05 * 10,
        (Condition.SELF_BUFF_15, ): 1 + 0.05 * 15,
        (Condition.SELF_BUFF_20, ): 1 + 0.05 * 20,
        (Condition.SELF_BUFF_25, ): 1 + 0.05 * 25,
        (Condition.SELF_BUFF_30, ): 1 + 0.05 * 30,
        (Condition.SELF_BUFF_35, ): 1 + 0.05 * 35,
        (Condition.SELF_BUFF_40, ): 1 + 0.05 * 40,
        (Condition.SELF_BUFF_45, ): 1 + 0.05 * 45,
        (Condition.SELF_BUFF_50, ): 1 + 0.05 * 50,
    }

    for conditions, boost_rate in condition_to_dmg_up_rate.items():
        skill_data = skill_data_base.with_conditions(
            ConditionComposite(conditions))

        assert skill_data.hit_count == [0, 0, 0, 1]
        assert skill_data.hit_count_at_max == 1
        assert skill_data.total_mod == pytest.approx(
            [0, 0, 0, 16.74 * boost_rate])
        assert skill_data.total_mod_at_max == pytest.approx(16.74 * boost_rate)
        assert skill_data.mods == approx_matrix([[], [], [],
                                                 [16.74 * boost_rate]])
        assert skill_data.mods_at_max == pytest.approx([16.74 * boost_rate])
        assert skill_data.max_level == 4
Ejemplo n.º 22
0
def test_veronica_s1(transformer_skill: SkillTransformer):
    # Veronica S1
    # https://dragalialost.wiki/w/Veronica
    skill_data = transformer_skill.transform_attacking(
        107505011).with_conditions()

    assert skill_data.crisis_mods == approx_matrix([[2.25] * 4, [2.25] * 4,
                                                    [2.25] * 4, [1.5] * 4])
Ejemplo n.º 23
0
def test_nadine_s1(transformer_skill: SkillTransformer):
    # Nadine S1
    # https://dragalialost.wiki/w/Nadine
    skill_data = transformer_skill.transform_attacking(105501021).with_conditions()

    assert all(skill_data.dispel_buff)
    assert skill_data.dispel_buff_at_max
    assert skill_data.dispel_timings == approx_matrix([[0.466666669], [0.466666669], [0.466666669]])
def test_s2_break(transformer_skill: SkillTransformer):
    # Gala Alex S2 @ Target break
    # https://dragalialost.wiki/w/Gala_Alex
    skill_data_base = transformer_skill.transform_attacking(101505028)

    # Base

    skill_data = skill_data_base.with_conditions()

    assert skill_data.hit_count == [2, 2, 2]
    assert skill_data.hit_count_at_max == 2
    assert skill_data.total_mod == pytest.approx([
        5.93 * 2,
        6.48 * 2,
        6.58 * 2,
    ])
    assert skill_data.total_mod_at_max == pytest.approx(6.58 * 2)
    assert skill_data.mods == approx_matrix([
        [5.93] * 2,
        [6.48] * 2,
        [6.58] * 2,
    ])
    assert skill_data.mods_at_max == pytest.approx([6.58] * 2)
    assert skill_data.max_level == 3

    # Target BK

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

    assert skill_data.hit_count == [2, 2, 2]
    assert skill_data.hit_count_at_max == 2
    assert skill_data.total_mod == pytest.approx([
        8.895 * 2,
        9.720 * 2,
        9.870 * 2,
    ])
    assert skill_data.total_mod_at_max == pytest.approx(9.870 * 2)
    assert skill_data.mods == approx_matrix([
        [8.895] * 2,
        [9.720] * 2,
        [9.870] * 2,
    ])
    assert skill_data.mods_at_max == pytest.approx([9.870] * 2)
    assert skill_data.max_level == 3
Ejemplo n.º 25
0
def test_unique_dragon_ult(asset_manager: AssetManager,
                           transformer_skill: SkillTransformer):
    # Lathna Unique Dragon Ult
    # https://dragalialost.wiki/w/Nyarlathotep_(Lathna)
    ability_ids = asset_manager.asset_chara_data.get_data_by_id(
        10550502).ability_ids_all_level
    skill_data_base = transformer_skill.transform_attacking(
        299000041, ability_ids=ability_ids)

    skill_data = skill_data_base.with_conditions()

    assert skill_data.hit_count == [2, 2]
    assert skill_data.hit_count_at_max == 2
    assert skill_data.total_mod == pytest.approx([
        2.98 * 2,
        3.31 * 2,
    ])
    assert skill_data.total_mod_at_max == pytest.approx(3.31 * 2)
    assert skill_data.mods == approx_matrix([
        [2.98] * 2,
        [3.31] * 2,
    ])
    assert skill_data.mods_at_max == pytest.approx([3.31] * 2)
    assert skill_data.max_level == 2

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

    assert skill_data.hit_count == [2, 2]
    assert skill_data.hit_count_at_max == 2
    assert skill_data.total_mod == pytest.approx([
        3.28 * 2,
        3.64 * 2,
    ])
    assert skill_data.total_mod_at_max == pytest.approx(3.64 * 2)
    assert skill_data.mods == approx_matrix([
        [3.28] * 2,
        [3.64] * 2,
    ])
    assert skill_data.mods_at_max == pytest.approx([3.64] * 2)
    assert skill_data.max_level == 2
Ejemplo n.º 26
0
def test_max_level_specified(transformer_skill: SkillTransformer):
    # Templar Hope S2
    # https://dragalialost.wiki/w/Templar_Hope
    skill_data = transformer_skill.transform_attacking(101403022, max_lv=2).with_conditions()

    assert skill_data.hit_count == [2, 2]
    assert skill_data.hit_count_at_max == 2
    assert skill_data.total_mod == pytest.approx([22.7, 26.48])
    assert skill_data.total_mod_at_max == pytest.approx(26.48)
    assert skill_data.mods == approx_matrix([[11.35, 11.35], [13.24, 13.24]])
    assert skill_data.mods_at_max == pytest.approx([13.24, 13.24])
    assert skill_data.max_level == 2
Ejemplo n.º 27
0
def test_s2(transformer_skill: SkillTransformer):
    # Halloween Melsa S2
    # https://dragalialost.wiki/w/Halloween_Melsa
    skill_data = transformer_skill.transform_attacking(105503032).with_conditions()

    assert skill_data.hit_count == [3, 3]
    assert skill_data.hit_count_at_max == 3
    assert skill_data.total_mod == pytest.approx([1.1 * 3, 1.4 * 3])
    assert skill_data.total_mod_at_max == pytest.approx(1.4 * 3)
    assert skill_data.mods == approx_matrix([[1.1] * 3, [1.4] * 3])
    assert skill_data.mods_at_max == pytest.approx([1.4] * 3)
    assert skill_data.max_level == 2
Ejemplo n.º 28
0
def test_s2(transformer_skill: SkillTransformer):
    # Lapis S2
    # https://dragalialost.wiki/w/Lapis
    skill_data_base = transformer_skill.transform_attacking(109502012)

    expected_buff_count_conds = [
        Condition.SELF_BUFF_0,
        Condition.SELF_BUFF_1,
        Condition.SELF_BUFF_2,
        Condition.SELF_BUFF_3,
        Condition.SELF_BUFF_4,
        Condition.SELF_BUFF_5,
        Condition.SELF_BUFF_6,
        Condition.SELF_BUFF_7,
        Condition.SELF_BUFF_8,
        Condition.SELF_BUFF_9,
        Condition.SELF_BUFF_10,
        Condition.SELF_BUFF_15,
        Condition.SELF_BUFF_20,
        Condition.SELF_BUFF_25,
        Condition.SELF_BUFF_30,
        Condition.SELF_BUFF_35,
        Condition.SELF_BUFF_40,
        Condition.SELF_BUFF_45,
        Condition.SELF_BUFF_50,
    ]
    expected_addl_conds = [
        Condition.SELF_LAPIS_CARD_0,
        Condition.SELF_LAPIS_CARD_1,
        Condition.SELF_LAPIS_CARD_2,
        Condition.SELF_LAPIS_CARD_3,
    ]
    expected_conds_up_rate = {
        (buff_count_cond, addl_cond):
            min(
                ConditionCategories.self_buff_count.convert(buff_count_cond) * 0.05
                + ConditionCategories.self_lapis_card.convert(addl_cond) * 0.2,
                0.8
            )
        for buff_count_cond, addl_cond in product(expected_buff_count_conds, expected_addl_conds)
    }

    for conditions, boost_rate in expected_conds_up_rate.items():
        skill_data = skill_data_base.with_conditions(ConditionComposite(conditions))

        assert skill_data.hit_count == [2, 2]
        assert skill_data.hit_count_at_max == 2
        assert skill_data.total_mod == pytest.approx([12.06 * (1 + boost_rate) * 2, 15.05 * (1 + boost_rate) * 2])
        assert skill_data.total_mod_at_max == pytest.approx(15.05 * (1 + boost_rate) * 2)
        assert skill_data.mods == approx_matrix([[12.06 * (1 + boost_rate)] * 2, [15.05 * (1 + boost_rate)] * 2])
        assert skill_data.mods_at_max == pytest.approx([15.05 * (1 + boost_rate)] * 2)
        assert skill_data.max_level == 2
Ejemplo n.º 29
0
def test_gala_alex_s1_chained_buffed(transformer_skill: SkillTransformer):
    # Gala Alex S1 (Target Buffed)
    # https://dragalialost.wiki/w/Gala_Alex
    skill_data = transformer_skill.transform_attacking(101505024).with_conditions()

    assert all(skill_data.dispel_buff)
    assert skill_data.dispel_buff_at_max
    assert skill_data.dispel_timings == approx_matrix([
        [0.166666672, 0.366666675, 0.6],
        [0.166666672, 0.366666675, 0.6],
        [0.166666672, 0.366666675, 0.6],
        [0.166666672, 0.366666675, 0.6]
    ])
def test_s1_chained(transformer_skill: SkillTransformer):
    # Gala Alex S1 @ Chained
    # https://dragalialost.wiki/w/Gala_Alex
    skill_data_base = transformer_skill.transform_attacking(101505023)

    # Base

    skill_data = skill_data_base.with_conditions()

    assert skill_data.hit_count == [4, 4, 4, 4]
    assert skill_data.hit_count_at_max == 4
    assert skill_data.total_mod == pytest.approx(
        [1.61 * 3 + 3.85, 1.80 * 3 + 4.31, 2.02 * 3 + 4.85, 2.02 * 3 + 4.85])
    assert skill_data.total_mod_at_max == pytest.approx(2.02 * 3 + 4.85)
    assert skill_data.mods == approx_matrix([[1.61] * 3 + [3.85],
                                             [1.80] * 3 + [4.31],
                                             [2.02] * 3 + [4.85],
                                             [2.02] * 3 + [4.85]])
    assert skill_data.mods_at_max == pytest.approx([2.02] * 3 + [4.85])
    assert skill_data.max_level == 4

    # DEF down

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

    assert skill_data.hit_count == [4, 4, 4, 4]
    assert skill_data.hit_count_at_max == 4
    assert skill_data.total_mod == pytest.approx([
        1.771 * 3 + 4.235, 1.980 * 3 + 4.741, 2.222 * 3 + 5.335,
        2.222 * 3 + 5.335
    ])
    assert skill_data.total_mod_at_max == pytest.approx(2.222 * 3 + 5.335)
    assert skill_data.mods == approx_matrix([[1.771] * 3 + [4.235],
                                             [1.980] * 3 + [4.741],
                                             [2.222] * 3 + [5.335],
                                             [2.222] * 3 + [5.335]])
    assert skill_data.mods_at_max == pytest.approx([2.222] * 3 + [5.335])
    assert skill_data.max_level == 4