Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve handling of unscalable mods and fix some mods from alternate qualities not applying. #4906

Merged
merged 13 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/Classes/ModStore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@ local ModStoreClass = newClass("ModStore", function(self, parent)
end)

function ModStoreClass:ScaleAddMod(mod, scale)
if scale == 1 then
local unscalable = false
for _, effects in ipairs(mod) do
if effects.unscalable then
unscalable = true
break
end
end
if scale == 1 or unscalable then
self:AddMod(mod)
else
scale = m_max(scale, 0)
Expand Down
4 changes: 4 additions & 0 deletions src/Data/SkillStatMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1662,6 +1662,10 @@ return {
["banner_area_of_effect_+%_per_stage"] = {
mod("AreaOfEffect", "INC", nil, 0, 0, { type = "Multiplier", var = "BannerStage" }, { type = "Condition", var = "BannerPlanted" }),
},
["banner_additional_base_duration_per_stage_ms"] = {
mod("PrimaryDuration", "BASE", nil, 0, 0, { type = "Multiplier", var = "BannerStage" }, { type = "Condition", var = "BannerPlanted" }),
div = 1000,
},
-- Other
["triggered_skill_damage_+%"] = {
mod("TriggeredDamage", "INC", nil, 0, 0, { type = "SkillType", skillType = SkillType.Triggered }),
Expand Down
22 changes: 21 additions & 1 deletion src/Data/Skills/act_dex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,12 @@ skills["ArcticArmour"] = {
["new_arctic_armour_fire_damage_taken_when_hit_+%_final"] = {
mod("FireDamageTakenWhenHit", "MORE", nil, 0, 0, { type = "Condition", var = "Stationary" }, { type = "GlobalEffect", effectType = "Buff" }),
},
["base_immune_to_freeze"] = {
--Display only
},
},
baseMods = {
mod("AvoidFreeze", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true }),
},
baseFlags = {
spell = true,
Expand Down Expand Up @@ -4695,6 +4701,10 @@ skills["Hatred"] = {
["hatred_aura_cold_damage_+%_final"] = {
mod("ColdDamage", "MORE", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
},
["chill_and_freeze_duration_+%"] = {
mod("EnemyChillDuration", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
mod("EnemyFreezeDuration", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
},
["movement_velocity_+%_on_chilled_ground"] = {
mod("MovementSpeed", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }, {type = "Condition", var = "OnChilledGround"})
}
Expand Down Expand Up @@ -6627,11 +6637,21 @@ skills["ColdImpurity"] = {
castTime = 0,
statMap = {
["hits_ignore_my_cold_resistance"] = {
flag("SelfIgnoreColdResistance", { type = "GlobalEffect", effectType = "Debuff" }),
flag("SelfIgnoreColdResistance", { type = "GlobalEffect", effectType = "AuraDebuff" }),
},
["base_maximum_cold_damage_resistance_%"] = {
mod("ColdResistMax", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
},
["base_immune_to_freeze"] = {
--Display only
},
["base_immune_to_chill"] = {
--Display only
},
},
baseMods = {
mod("AvoidFreeze", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
mod("AvoidChill", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
},
baseFlags = {
spell = true,
Expand Down
35 changes: 25 additions & 10 deletions src/Data/Skills/act_int.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1540,6 +1540,9 @@ skills["Clarity"] = {
["damage_+%_on_full_mana"] = {
mod("Damage", "INC", nil, 0, 0, { type = "Condition", var = "FullMana" }, { type = "GlobalEffect", effectType = "Aura" }),
},
["flask_mana_to_recover_+%"] = {
mod("FlaskManaRecovery", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
},
},
baseFlags = {
spell = true,
Expand Down Expand Up @@ -1617,7 +1620,7 @@ skills["VaalClarity"] = {
castTime = 0,
statMap = {
["no_mana_cost"] = {
mod("ManaCost", "MORE", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
mod("ManaCost", "MORE", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true}),
value = -100,
},
},
Expand Down Expand Up @@ -7772,6 +7775,9 @@ skills["Purity"] = {
["reduce_enemy_elemental_resistance_%"] = {
mod("ElementalPenetration", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
},
["immune_to_status_ailments"] = {
--Display only
}
},
baseFlags = {
spell = true,
Expand All @@ -7780,13 +7786,13 @@ skills["Purity"] = {
},
baseMods = {
skill("radius", 40),
mod("AvoidShock", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
mod("AvoidFreeze", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
mod("AvoidChill", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
mod("AvoidIgnite", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
mod("AvoidSap", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
mod("AvoidBrittle", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
mod("AvoidScorch", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
mod("AvoidShock", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
mod("AvoidFreeze", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
mod("AvoidChill", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
mod("AvoidIgnite", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
mod("AvoidSap", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
mod("AvoidBrittle", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
mod("AvoidScorch", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
},
qualityStats = {
Default = {
Expand Down Expand Up @@ -7946,11 +7952,17 @@ skills["LightningImpurity"] = {
castTime = 0,
statMap = {
["hits_ignore_my_lightning_resistance"] = {
flag("SelfIgnoreLightningResistance", { type = "GlobalEffect", effectType = "Debuff" })
flag("SelfIgnoreLightningResistance", { type = "GlobalEffect", effectType = "AuraDebuff" })
},
["base_maximum_lightning_damage_resistance_%"] = {
mod("LightningResistMax", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
},
["base_immune_to_shock"] = {
--Display only
},
},
baseMods = {
mod("AvoidShock", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
},
baseFlags = {
spell = true,
Expand Down Expand Up @@ -11215,14 +11227,17 @@ skills["TempestShield"] = {
["shield_spell_block_%"] = {
mod("SpellBlockChance", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff" }),
},
["skill_display_buff_grants_shock_immunity"] = {
--Display only
}
},
baseFlags = {
spell = true,
duration = true,
chaining = true,
},
baseMods = {
mod("AvoidShock", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Buff" }),
mod("AvoidShock", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true }),
},
qualityStats = {
Default = {
Expand Down
11 changes: 10 additions & 1 deletion src/Data/Skills/act_str.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1972,6 +1972,9 @@ skills["DefianceBanner"] = {
["evasion_and_physical_damage_reduction_rating_+%"] = {
mod("ArmourAndEvasion", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
},
["armour_evasion_banner_critical_strike_chance_+%"] = {
mod("EnemyCritChance", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
},
},
baseFlags = {
spell = true,
Expand Down Expand Up @@ -5382,11 +5385,17 @@ skills["FireImpurity"] = {
castTime = 0,
statMap = {
["hits_ignore_my_fire_resistance"] = {
flag("SelfIgnoreFireResistance", { type = "GlobalEffect", effectType = "Debuff" })
flag("SelfIgnoreFireResistance", { type = "GlobalEffect", effectType = "AuraDebuff" })
},
["base_maximum_fire_damage_resistance_%"] = {
mod("FireResistMax", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
},
["base_immune_to_ignite"] = {
--Display only
},
},
baseMods = {
mod("AvoidIgnite", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
},
baseFlags = {
spell = true,
Expand Down
10 changes: 8 additions & 2 deletions src/Data/Skills/other.lua
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,12 @@ skills["BloodOffering"] = {
mod("Damage", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff" }),
},
["blood_offering_%_of_life_to_lose"] = {
mod("Multiplier:BloodOfferingLifeSacrificed", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable=true }, { type = "PerStat", stat = "LifeUnreserved", actor = "parent" }),
mod("Multiplier:BloodOfferingLifeSacrificed", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true }, { type = "PerStat", stat = "LifeUnreserved", actor = "parent" }),
div = 100,
},
["blood_offering_%_of_lost_life_to_regenerate_as_life_per_second"] = {
mod("LifeRegen", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff" }, { type = "Multiplier", var = "BloodOfferingLifeSacrificed" }),
mod("Multiplier:BloodOfferingBaseRegen", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable=true }, { type = "Multiplier", var = "BloodOfferingLifeSacrificed" }),
mod("Multiplier:BloodOfferingBaseRegen", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true }, { type = "Multiplier", var = "BloodOfferingLifeSacrificed" }),
div = 100,
},
["blood_offering_life_regenerated_+%_final_per_corpse"] = {
Expand Down Expand Up @@ -1335,8 +1335,14 @@ skills["VaalAuraElementalDamageHealing"] = {
area = true,
duration = true,
},
statMap = {
["immune_to_curses"] = {
--Display only
},
},
baseMods = {
skill("radius", 40),
mod("AvoidCurse", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
},
constantStats = {
{ "base_skill_effect_duration", 5000 },
Expand Down
18 changes: 17 additions & 1 deletion src/Export/Skills/act_dex.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ local skills, mod, flag, skill = ...
["new_arctic_armour_fire_damage_taken_when_hit_+%_final"] = {
mod("FireDamageTakenWhenHit", "MORE", nil, 0, 0, { type = "Condition", var = "Stationary" }, { type = "GlobalEffect", effectType = "Buff" }),
},
["base_immune_to_freeze"] = {
--Display only
},
},
#baseMod mod("AvoidFreeze", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true }),
#mods

#skill ArtilleryBallista
Expand Down Expand Up @@ -901,6 +905,10 @@ local skills, mod, flag, skill = ...
["hatred_aura_cold_damage_+%_final"] = {
mod("ColdDamage", "MORE", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
},
["chill_and_freeze_duration_+%"] = {
mod("EnemyChillDuration", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
mod("EnemyFreezeDuration", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
},
["movement_velocity_+%_on_chilled_ground"] = {
mod("MovementSpeed", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }, {type = "Condition", var = "OnChilledGround"})
}
Expand Down Expand Up @@ -1237,12 +1245,20 @@ local skills, mod, flag, skill = ...
#flags spell aura area duration
statMap = {
["hits_ignore_my_cold_resistance"] = {
flag("SelfIgnoreColdResistance", { type = "GlobalEffect", effectType = "Debuff" }),
flag("SelfIgnoreColdResistance", { type = "GlobalEffect", effectType = "AuraDebuff" }),
},
["base_maximum_cold_damage_resistance_%"] = {
mod("ColdResistMax", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
},
["base_immune_to_freeze"] = {
--Display only
},
["base_immune_to_chill"] = {
--Display only
},
},
#baseMod mod("AvoidFreeze", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
#baseMod mod("AvoidChill", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
#mods

#skill RainOfArrows
Expand Down
30 changes: 20 additions & 10 deletions src/Export/Skills/act_int.txt
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,9 @@ local skills, mod, flag, skill = ...
["damage_+%_on_full_mana"] = {
mod("Damage", "INC", nil, 0, 0, { type = "Condition", var = "FullMana" }, { type = "GlobalEffect", effectType = "Aura" }),
},
["flask_mana_to_recover_+%"] = {
mod("FlaskManaRecovery", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
},
},
#baseMod skill("radius", 40)
#mods
Expand All @@ -432,7 +435,7 @@ local skills, mod, flag, skill = ...
#flags spell aura area duration
statMap = {
["no_mana_cost"] = {
mod("ManaCost", "MORE", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
mod("ManaCost", "MORE", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true}),
value = -100,
},
},
Expand Down Expand Up @@ -1620,13 +1623,13 @@ local skills, mod, flag, skill = ...
},
},
#baseMod skill("radius", 40)
#baseMod mod("AvoidShock", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura" })
#baseMod mod("AvoidFreeze", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura" })
#baseMod mod("AvoidChill", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura" })
#baseMod mod("AvoidIgnite", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura" })
#baseMod mod("AvoidSap", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura" })
#baseMod mod("AvoidBrittle", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura" })
#baseMod mod("AvoidScorch", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura" })
#baseMod mod("AvoidShock", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
#baseMod mod("AvoidFreeze", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
#baseMod mod("AvoidChill", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
#baseMod mod("AvoidIgnite", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
#baseMod mod("AvoidSap", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
#baseMod mod("AvoidBrittle", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
#baseMod mod("AvoidScorch", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
#mods

#skill LightningResistAura
Expand All @@ -1652,12 +1655,16 @@ local skills, mod, flag, skill = ...
#flags spell aura area duration
statMap = {
["hits_ignore_my_lightning_resistance"] = {
flag("SelfIgnoreLightningResistance", { type = "GlobalEffect", effectType = "Debuff" })
flag("SelfIgnoreLightningResistance", { type = "GlobalEffect", effectType = "AuraDebuff" })
},
["base_maximum_lightning_damage_resistance_%"] = {
mod("LightningResistMax", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
},
["base_immune_to_shock"] = {
--Display only
},
},
#baseMod mod("AvoidShock", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
#mods

#skill MortarBarrageMine
Expand Down Expand Up @@ -2239,8 +2246,11 @@ local skills, mod, flag, skill = ...
["shield_spell_block_%"] = {
mod("SpellBlockChance", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff" }),
},
["skill_display_buff_grants_shock_immunity"] = {
--Display only
}
},
#baseMod mod("AvoidShock", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Buff" })
#baseMod mod("AvoidShock", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true })
#mods

#skill VoltaxicBurst
Expand Down
9 changes: 8 additions & 1 deletion src/Export/Skills/act_str.txt
Original file line number Diff line number Diff line change
Expand Up @@ -344,6 +344,9 @@ local skills, mod, flag, skill = ...
["evasion_and_physical_damage_reduction_rating_+%"] = {
mod("ArmourAndEvasion", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
},
["armour_evasion_banner_critical_strike_chance_+%"] = {
mod("EnemyCritChance", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
},
},
#baseMod skill("radius", 46)
#baseMod skill("manaReservationPercent", 0, { type = "Condition", var = "BannerPlanted" })
Expand Down Expand Up @@ -953,12 +956,16 @@ local skills, mod, flag, skill = ...
#flags spell aura area duration
statMap = {
["hits_ignore_my_fire_resistance"] = {
flag("SelfIgnoreFireResistance", { type = "GlobalEffect", effectType = "Debuff" })
flag("SelfIgnoreFireResistance", { type = "GlobalEffect", effectType = "AuraDebuff" })
},
["base_maximum_fire_damage_resistance_%"] = {
mod("FireResistMax", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Aura" }),
},
["base_immune_to_ignite"] = {
--Display only
},
},
#baseMod mod("AvoidIgnite", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
#mods

#skill RageVortex
Expand Down
10 changes: 8 additions & 2 deletions src/Export/Skills/other.txt
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ local skills, mod, flag, skill = ...
mod("Damage", "INC", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff" }),
},
["blood_offering_%_of_life_to_lose"] = {
mod("Multiplier:BloodOfferingLifeSacrificed", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable=true }, { type = "PerStat", stat = "LifeUnreserved", actor = "parent" }),
mod("Multiplier:BloodOfferingLifeSacrificed", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true }, { type = "PerStat", stat = "LifeUnreserved", actor = "parent" }),
div = 100,
},
["blood_offering_%_of_lost_life_to_regenerate_as_life_per_second"] = {
mod("LifeRegen", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff" }, { type = "Multiplier", var = "BloodOfferingLifeSacrificed" }),
mod("Multiplier:BloodOfferingBaseRegen", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable=true }, { type = "Multiplier", var = "BloodOfferingLifeSacrificed" }),
mod("Multiplier:BloodOfferingBaseRegen", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true }, { type = "Multiplier", var = "BloodOfferingLifeSacrificed" }),
div = 100,
},
["blood_offering_life_regenerated_+%_final_per_corpse"] = {
Expand Down Expand Up @@ -397,7 +397,13 @@ local skills, mod, flag, skill = ...
#skill VaalAuraElementalDamageHealing
#flags spell aura area duration
fromItem = true,
statMap = {
["immune_to_curses"] = {
--Display Only
},
},
#baseMod skill("radius", 40)
#baseMod mod("AvoidCurse", "BASE", 100, 0, 0, { type = "GlobalEffect", effectType = "Aura", unscalable = true }),
#mods

#skill GoreShockwave
Expand Down
Loading