Skip to content

Commit

Permalink
Add support for repeat-based modifiers (#5676)
Browse files Browse the repository at this point in the history
* allow for custom mod dps multiplier

* Initial Repeat Improvements

* fix missing txt change

* implement vaal flicker

* fix stack potential with skill dps multiplier

* add display for number of repeats in calc sections
  • Loading branch information
Regisle authored Apr 7, 2023
1 parent 4d499a2 commit 2f93c35
Show file tree
Hide file tree
Showing 13 changed files with 213 additions and 50 deletions.
3 changes: 3 additions & 0 deletions src/Classes/ModStore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,9 @@ function ModStoreClass:EvalMod(mod, cfg)
mult = m_min(mult, limit)
end
end
if tag.invert and mult ~= 0 then
mult = 1 / mult
end
if type(value) == "table" then
value = copyTable(value)
if value.mod then
Expand Down
14 changes: 11 additions & 3 deletions src/Data/Skills/act_dex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4217,9 +4217,6 @@ skills["FlickerStrike"] = {
statDescriptionScope = "skill_stat_descriptions",
castTime = 1,
statMap = {
["flicker_strike_more_attack_speed_+%_final"] = {
mod("Speed", "MORE", nil, ModFlag.Attack),
},
["base_skill_show_average_damage_instead_of_dps"] = {
},
["flicker_strike_buff_movement_speed_+%"] = {
Expand Down Expand Up @@ -4316,11 +4313,22 @@ skills["VaalFlickerStrike"] = {
},
statDescriptionScope = "skill_stat_descriptions",
castTime = 1,
statMap = {
["active_skill_ailment_damage_+%_final"] = {
mod("Damage", "MORE", nil, bit.bor(ModFlag.MeleeHit, ModFlag.Ailment)),
},
["base_skill_show_average_damage_instead_of_dps"] = {
},
},
baseFlags = {
attack = true,
melee = true,
duration = true,
},
baseMods = {
flag("OnlyFinalRepeat"),
flag("FinalRepeatSumsDamage"),
},
qualityStats = {
Default = {
{ "add_frenzy_charge_on_skill_hit_%", 0.25 },
Expand Down
7 changes: 4 additions & 3 deletions src/Data/Skills/other.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1503,14 +1503,15 @@ skills["SupportGreaterSpellEcho"] = {
statDescriptionScope = "gem_stat_descriptions",
fromItem = true,
statMap = {
["support_greater_spell_echo_spell_damage_+%_final_per_repeat"] = {
mod("RepeatPerRepeatDamage", "MORE", nil, 0, 0, { type = "Condition", var = "HaveBladeVortex", neg = true }, { type = "Condition", var = "CastOnFrostbolt", neg = true }, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }),
},
["support_greater_spell_echo_area_of_effect_+%_per_repeat"] = {
mod("AreaOfEffect", "INC", nil, 0, 0, { type = "Condition", var = "CastOnFrostbolt", neg = true }),
mod("RepeatPerRepeatAreaOfEffect", "INC", nil, 0, 0, { type = "Condition", var = "CastOnFrostbolt", neg = true }),
},
},
baseMods = {
flag("Condition:HaveGreaterSpellEcho"),
mod("Damage", "MORE", 30, ModFlag.Spell, 0, { type = "Condition", var = "HaveSpellEcho", neg = true }, { type = "Condition", var = "HaveBladeVortex", neg = true }, { type = "Condition", var = "CastOnFrostbolt", neg = true }),
mod("Damage", "MORE", 45, ModFlag.Spell, 0, { type = "Condition", var = "HaveSpellEcho" }, { type = "Condition", var = "HaveBladeVortex", neg = true }, { type = "Condition", var = "CastOnFrostbolt", neg = true }),
},
constantStats = {
{ "base_spell_repeat_count", 2 },
Expand Down
8 changes: 2 additions & 6 deletions src/Data/Skills/sup_int.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4740,9 +4740,7 @@ skills["SupportMulticast"] = {
mod("Speed", "MORE", nil, ModFlag.Cast),
},
["support_spell_echo_final_repeat_damage_+%_final"] = {
mod("Damage", "MORE", nil, 0, 0, { type = "Condition", var = "CastOnFrostbolt", neg = true }),
--Average out over the casts
div = 3
mod("RepeatFinalDamage", "MORE", nil, 0, 0, { type = "Condition", var = "CastOnFrostbolt", neg = true }, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }),
}
},
baseMods = {
Expand Down Expand Up @@ -4828,13 +4826,11 @@ skills["SupportSpellEchoPlus"] = {
mod("Speed", "MORE", nil, ModFlag.Cast),
},
["spell_echo_plus_chance_double_damage_%_final"] = {
mod("DoubleDamageChance", "BASE", nil, ModFlag.Spell, 0, { type = "Condition", var = "CastOnFrostbolt", neg = true }),
div = 2,
mod("RepeatFinalDoubleDamageChance", "BASE", nil, ModFlag.Spell, 0, { type = "Condition", var = "CastOnFrostbolt", neg = true }, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }),
},
},
baseMods = {
flag("Condition:HaveSpellEcho"),
mod("DoubleDamageChance", "BASE", -3, ModFlag.Spell, 0, { type = "Condition", var = "HaveGreaterSpellEcho" }),
},
qualityStats = {
Default = {
Expand Down
17 changes: 11 additions & 6 deletions src/Data/Skills/sup_str.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3209,10 +3209,12 @@ skills["SupportMultistrike"] = {
statDescriptionScope = "gem_stat_descriptions",
statMap = {
["multistrike_damage_+%_final_on_first_repeat"] = {
mod("Damage", "MORE", nil, nil, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }),
mod("Damage", "MORE", nil, nil, nil, { type = "SkillType", skillType = SkillType.RequiresShield }),
mod("RepeatOneDamage", "MORE", nil, nil, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }),
mod("RepeatOneDamage", "MORE", nil, nil, nil, { type = "SkillType", skillType = SkillType.RequiresShield }, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }),
},
["multistrike_damage_+%_final_on_second_repeat"] = {
mod("RepeatTwoDamage", "MORE", nil, nil, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }),
mod("RepeatTwoDamage", "MORE", nil, nil, nil, { type = "SkillType", skillType = SkillType.RequiresShield }),
},
["support_multiple_attack_damage_+%_final"] = {
mod("Damage", "MORE", nil, ModFlag.Attack),
Expand All @@ -3222,7 +3224,7 @@ skills["SupportMultistrike"] = {
mod("Speed", "MORE", nil, ModFlag.Attack, nil, { type = "SkillType", skillType = SkillType.RequiresShield }),
},
["multistrike_area_of_effect_+%_per_repeat"] = {
mod("AreaOfEffect", "INC", nil)
mod("RepeatPerRepeatAreaOfEffect", "INC", nil)
}
},
baseMods = {
Expand Down Expand Up @@ -3305,13 +3307,16 @@ skills["SupportMultistrikePlus"] = {
statDescriptionScope = "gem_stat_descriptions",
statMap = {
["multistrike_damage_+%_final_on_first_repeat"] = {
mod("RepeatOneDamage", "MORE", nil, nil, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }),
mod("RepeatOneDamage", "MORE", nil, nil, nil, { type = "SkillType", skillType = SkillType.RequiresShield }, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }),
},
["multistrike_damage_+%_final_on_second_repeat"] = {
mod("RepeatTwoDamage", "MORE", nil, nil, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }),
mod("RepeatTwoDamage", "MORE", nil, nil, nil, { type = "SkillType", skillType = SkillType.RequiresShield }),
},
["multistrike_damage_+%_final_on_third_repeat"] = {
mod("Damage", "MORE", nil, nil, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }),
mod("Damage", "MORE", nil, nil, nil, { type = "SkillType", skillType = SkillType.RequiresShield }),
div = 2,
mod("RepeatThreeDamage", "MORE", nil, nil, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }),
mod("RepeatThreeDamage", "MORE", nil, nil, nil, { type = "SkillType", skillType = SkillType.RequiresShield }),
},
["support_multiple_attack_damage_+%_final"] = {
mod("Damage", "MORE", nil, ModFlag.Attack),
Expand Down
12 changes: 9 additions & 3 deletions src/Export/Skills/act_dex.txt
Original file line number Diff line number Diff line change
Expand Up @@ -869,9 +869,6 @@ local skills, mod, flag, skill = ...
#skill FlickerStrike
#flags attack melee duration
statMap = {
["flicker_strike_more_attack_speed_+%_final"] = {
mod("Speed", "MORE", nil, ModFlag.Attack),
},
["base_skill_show_average_damage_instead_of_dps"] = {
},
["flicker_strike_buff_movement_speed_+%"] = {
Expand All @@ -882,6 +879,15 @@ local skills, mod, flag, skill = ...

#skill VaalFlickerStrike
#flags attack melee duration
statMap = {
["active_skill_ailment_damage_+%_final"] = {
mod("Damage", "MORE", nil, bit.bor(ModFlag.MeleeHit, ModFlag.Ailment)),
},
["base_skill_show_average_damage_instead_of_dps"] = {
},
},
#baseMod flag("OnlyFinalRepeat")
#baseMod flag("FinalRepeatSumsDamage")
#mods

#skill Frenzy
Expand Down
7 changes: 4 additions & 3 deletions src/Export/Skills/other.txt
Original file line number Diff line number Diff line change
Expand Up @@ -440,13 +440,14 @@ local skills, mod, flag, skill = ...
#skill SupportGreaterSpellEcho Greater Spell Echo
fromItem = true,
statMap = {
["support_greater_spell_echo_spell_damage_+%_final_per_repeat"] = {
mod("RepeatPerRepeatDamage", "MORE", nil, 0, 0, { type = "Condition", var = "HaveBladeVortex", neg = true }, { type = "Condition", var = "CastOnFrostbolt", neg = true }, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }),
},
["support_greater_spell_echo_area_of_effect_+%_per_repeat"] = {
mod("AreaOfEffect", "INC", nil, 0, 0, { type = "Condition", var = "CastOnFrostbolt", neg = true }),
mod("RepeatPerRepeatAreaOfEffect", "INC", nil, 0, 0, { type = "Condition", var = "CastOnFrostbolt", neg = true }),
},
},
#baseMod flag("Condition:HaveGreaterSpellEcho")
#baseMod mod("Damage", "MORE", 30, ModFlag.Spell, 0, { type = "Condition", var = "HaveSpellEcho", neg = true }, { type = "Condition", var = "HaveBladeVortex", neg = true }, { type = "Condition", var = "CastOnFrostbolt", neg = true })
#baseMod mod("Damage", "MORE", 45, ModFlag.Spell, 0, { type = "Condition", var = "HaveSpellEcho" }, { type = "Condition", var = "HaveBladeVortex", neg = true }, { type = "Condition", var = "CastOnFrostbolt", neg = true })
#mods

#skill IcestormUniqueStaff12
Expand Down
8 changes: 2 additions & 6 deletions src/Export/Skills/sup_int.txt
Original file line number Diff line number Diff line change
Expand Up @@ -633,9 +633,7 @@ local skills, mod, flag, skill = ...
mod("Speed", "MORE", nil, ModFlag.Cast),
},
["support_spell_echo_final_repeat_damage_+%_final"] = {
mod("Damage", "MORE", nil, 0, 0, { type = "Condition", var = "CastOnFrostbolt", neg = true }),
--Average out over the casts
div = 3
mod("RepeatFinalDamage", "MORE", nil, 0, 0, { type = "Condition", var = "CastOnFrostbolt", neg = true }, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }),
}
},
#baseMod flag("Condition:HaveSpellEcho")
Expand All @@ -650,12 +648,10 @@ local skills, mod, flag, skill = ...
mod("Speed", "MORE", nil, ModFlag.Cast),
},
["spell_echo_plus_chance_double_damage_%_final"] = {
mod("DoubleDamageChance", "BASE", nil, ModFlag.Spell, 0, { type = "Condition", var = "CastOnFrostbolt", neg = true }),
div = 2,
mod("RepeatFinalDoubleDamageChance", "BASE", nil, ModFlag.Spell, 0, { type = "Condition", var = "CastOnFrostbolt", neg = true }, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }),
},
},
#baseMod flag("Condition:HaveSpellEcho")
#baseMod mod("DoubleDamageChance", "BASE", -3, ModFlag.Spell, 0, { type = "Condition", var = "HaveGreaterSpellEcho" })
#mods

#skill SupportSummonGhostOnKill
Expand Down
17 changes: 11 additions & 6 deletions src/Export/Skills/sup_str.txt
Original file line number Diff line number Diff line change
Expand Up @@ -369,10 +369,12 @@ local skills, mod, flag, skill = ...
#skill SupportMultistrike
statMap = {
["multistrike_damage_+%_final_on_first_repeat"] = {
mod("Damage", "MORE", nil, nil, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }),
mod("Damage", "MORE", nil, nil, nil, { type = "SkillType", skillType = SkillType.RequiresShield }),
mod("RepeatOneDamage", "MORE", nil, nil, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }),
mod("RepeatOneDamage", "MORE", nil, nil, nil, { type = "SkillType", skillType = SkillType.RequiresShield }, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }),
},
["multistrike_damage_+%_final_on_second_repeat"] = {
mod("RepeatTwoDamage", "MORE", nil, nil, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }),
mod("RepeatTwoDamage", "MORE", nil, nil, nil, { type = "SkillType", skillType = SkillType.RequiresShield }),
},
["support_multiple_attack_damage_+%_final"] = {
mod("Damage", "MORE", nil, ModFlag.Attack),
Expand All @@ -382,7 +384,7 @@ local skills, mod, flag, skill = ...
mod("Speed", "MORE", nil, ModFlag.Attack, nil, { type = "SkillType", skillType = SkillType.RequiresShield }),
},
["multistrike_area_of_effect_+%_per_repeat"] = {
mod("AreaOfEffect", "INC", nil)
mod("RepeatPerRepeatAreaOfEffect", "INC", nil)
}
},
#baseMod flag("SupportedByMultistrike")
Expand All @@ -391,13 +393,16 @@ local skills, mod, flag, skill = ...
#skill SupportMultistrikePlus
statMap = {
["multistrike_damage_+%_final_on_first_repeat"] = {
mod("RepeatOneDamage", "MORE", nil, nil, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }),
mod("RepeatOneDamage", "MORE", nil, nil, nil, { type = "SkillType", skillType = SkillType.RequiresShield }, { type = "Condition", varList = {"averageRepeat", "alwaysFinalRepeat"} }),
},
["multistrike_damage_+%_final_on_second_repeat"] = {
mod("RepeatTwoDamage", "MORE", nil, nil, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }),
mod("RepeatTwoDamage", "MORE", nil, nil, nil, { type = "SkillType", skillType = SkillType.RequiresShield }),
},
["multistrike_damage_+%_final_on_third_repeat"] = {
mod("Damage", "MORE", nil, nil, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }),
mod("Damage", "MORE", nil, nil, nil, { type = "SkillType", skillType = SkillType.RequiresShield }),
div = 2,
mod("RepeatThreeDamage", "MORE", nil, nil, nil, { type = "ModFlagOr", modFlags = bit.bor(ModFlag.WeaponMelee, ModFlag.Unarmed) }),
mod("RepeatThreeDamage", "MORE", nil, nil, nil, { type = "SkillType", skillType = SkillType.RequiresShield }),
},
["support_multiple_attack_damage_+%_final"] = {
mod("Damage", "MORE", nil, ModFlag.Attack),
Expand Down
Loading

0 comments on commit 2f93c35

Please sign in to comment.