Gem backend changes for 3.3
This commit is contained in:
@@ -825,19 +825,17 @@ local function flag(name, ...)
|
||||
return mod(name, "FLAG", true, ...)
|
||||
end
|
||||
|
||||
local gemNameLookup = { }
|
||||
local gemIdLookup = { }
|
||||
for name, grantedEffect in pairs(data["3_0"].skills) do
|
||||
if not grantedEffect.hidden then
|
||||
gemNameLookup[grantedEffect.name:lower()] = grantedEffect.name
|
||||
elseif grantedEffect.fromItem then
|
||||
gemNameLookup[grantedEffect.name:lower()] = grantedEffect.id
|
||||
if not grantedEffect.hidden or grantedEffect.fromItem then
|
||||
gemIdLookup[grantedEffect.name:lower()] = grantedEffect.id
|
||||
end
|
||||
end
|
||||
local function extraSkill(name, level, noSupports)
|
||||
name = name:gsub(" skill","")
|
||||
if gemNameLookup[name] then
|
||||
if gemIdLookup[name] then
|
||||
return {
|
||||
mod("ExtraSkill", "LIST", { name = gemNameLookup[name], level = level, noSupports = noSupports })
|
||||
mod("ExtraSkill", "LIST", { skillId = gemIdLookup[name], level = level, noSupports = noSupports })
|
||||
}
|
||||
end
|
||||
end
|
||||
@@ -1073,7 +1071,7 @@ local specialModList = {
|
||||
["[ct][ar][si][tg]g?e?r?s? (.+) when your skills or minions kill"] = function(_, skill) return extraSkill(skill, 1, true) end,
|
||||
["attack with (.+) when you take a critical strike"] = function( _, skill) return extraSkill(skill, 1, true) end,
|
||||
["triggers? (.+) when you take a critical strike"] = function( _, skill) return extraSkill(skill, 1, true) end,
|
||||
["socketed [%a+]* ?gems a?r?e? ?supported by level (%d+) (.+)"] = function(num, _, support) return { mod("ExtraSupport", "LIST", { name = gemNameLookup[support] or gemNameLookup[support:gsub("^increased ","")] or "Unknown", level = num }, { type = "SocketedIn", slotName = "{SlotName}" }) } end,
|
||||
["socketed [%a+]* ?gems a?r?e? ?supported by level (%d+) (.+)"] = function(num, _, support) return { mod("ExtraSupport", "LIST", { skillId = gemIdLookup[support] or gemIdLookup[support:gsub("^increased ","")] or "Unknown", level = num }, { type = "SocketedIn", slotName = "{SlotName}" }) } end,
|
||||
-- Conversion
|
||||
["increases and reductions to minion damage also affects? you"] = { flag("MinionDamageAppliesToPlayer") },
|
||||
["increases and reductions to spell damage also apply to attacks"] = { flag("SpellDamageAppliesToAttacks") },
|
||||
@@ -1173,7 +1171,7 @@ local specialModList = {
|
||||
mod("EnemyModifier", "LIST", { mod = mod("ElementalResist", "BASE", num, { type = "MultiplierThreshold", var = "Spider's WebStack", threshold = 1 }) }),
|
||||
mod("EnemyModifier", "LIST", { mod = mod("ChaosResist", "BASE", num, { type = "MultiplierThreshold", var = "Spider's WebStack", threshold = 1 }) }),
|
||||
} end,
|
||||
["you are cursed with level (%d+) (%D+)"] = function(num, _, name) return { mod("ExtraCurse", "LIST", { name = gemNameLookup[name], level = num, applyToPlayer = true }) } end,
|
||||
["you are cursed with level (%d+) (%D+)"] = function(num, _, name) return { mod("ExtraCurse", "LIST", { skillId = gemIdLookup[name], level = num, applyToPlayer = true }) } end,
|
||||
["you count as on low life while you are cursed with vulnerability"] = { flag("Condition:LowLife", { type = "Condition", var = "AffectedByVulnerability" }) },
|
||||
-- Traps, Mines and Totems
|
||||
["traps and mines deal (%d+)%-(%d+) additional physical damage"] = function(_, min, max) return { mod("PhysicalMin", "BASE", tonumber(min), nil, 0, bor(KeywordFlag.Trap, KeywordFlag.Mine)), mod("PhysicalMax", "BASE", tonumber(max), nil, 0, bor(KeywordFlag.Trap, KeywordFlag.Mine)) } end,
|
||||
@@ -1320,7 +1318,7 @@ local specialModList = {
|
||||
["creates consecrated ground on use"] = { },
|
||||
["gain unholy might during flask effect"] = { flag("Condition:UnholyMight", { type = "Condition", var = "UsingFlask" }) },
|
||||
["zealot's oath during flask effect"] = { mod("ZealotsOath", "FLAG", true, { type = "Condition", var = "UsingFlask" }) },
|
||||
["grants level (%d+) (.+) curse aura during flask effect"] = function(num, _, skill) return { mod("ExtraCurse", "LIST", { name = gemNameLookup[skill:gsub(" skill","")] or "Unknown", level = num }, { type = "Condition", var = "UsingFlask" }) } end,
|
||||
["grants level (%d+) (.+) curse aura during flask effect"] = function(num, _, skill) return { mod("ExtraCurse", "LIST", { skillId = gemIdLookup[skill:gsub(" skill","")] or "Unknown", level = num }, { type = "Condition", var = "UsingFlask" }) } end,
|
||||
["during flask effect, (%d+)%% reduced damage taken of each element for which your uncapped elemental resistance is lowest"] = function(num) return {
|
||||
mod("LightningDamageTaken", "INC", -num, { type = "StatThreshold", stat = "LightningResistTotal", thresholdStat = "ColdResistTotal", upper = true }, { type = "StatThreshold", stat = "LightningResistTotal", thresholdStat = "FireResistTotal", upper = true }),
|
||||
mod("ColdDamageTaken", "INC", -num, { type = "StatThreshold", stat = "ColdResistTotal", thresholdStat = "LightningResistTotal", upper = true }, { type = "StatThreshold", stat = "ColdResistTotal", thresholdStat = "FireResistTotal", upper = true }),
|
||||
@@ -1502,12 +1500,14 @@ local skillNameList = {
|
||||
[" corpse cremation " ] = { tag = { type = "SkillName", skillName = "Cremation" } }, -- Sigh.
|
||||
}
|
||||
local preSkillNameList = { }
|
||||
for skillName, grantedEffect in pairs(data["3_0"].gems) do
|
||||
for gemId, gemData in pairs(data["3_0"].gems) do
|
||||
local grantedEffect = gemData.grantedEffect
|
||||
if not grantedEffect.hidden and not grantedEffect.support then
|
||||
local skillName = grantedEffect.name
|
||||
skillNameList[" "..skillName:lower().." "] = { tag = { type = "SkillName", skillName = skillName } }
|
||||
preSkillNameList["^"..skillName:lower().." has ?a? "] = { tag = { type = "SkillName", skillName = skillName } }
|
||||
preSkillNameList["^"..skillName:lower().." deals "] = { tag = { type = "SkillName", skillName = skillName } }
|
||||
if grantedEffect.gemTags.totem then
|
||||
if gemData.tags.totem then
|
||||
preSkillNameList["^"..skillName:lower().." totem deals "] = { tag = { type = "SkillName", skillName = skillName } }
|
||||
preSkillNameList["^"..skillName:lower().." totem grants "] = { addToSkill = { type = "SkillName", skillName = skillName }, tag = { type = "GlobalEffect", effectType = "Buff" } }
|
||||
end
|
||||
@@ -1515,14 +1515,14 @@ for skillName, grantedEffect in pairs(data["3_0"].gems) do
|
||||
preSkillNameList["^"..skillName:lower().." grants "] = { addToSkill = { type = "SkillName", skillName = skillName }, tag = { type = "GlobalEffect", effectType = "Buff" } }
|
||||
preSkillNameList["^"..skillName:lower().." grants a?n? ?additional "] = { addToSkill = { type = "SkillName", skillName = skillName }, tag = { type = "GlobalEffect", effectType = "Buff" } }
|
||||
end
|
||||
if grantedEffect.gemTags.aura or grantedEffect.gemTags.herald then
|
||||
if gemData.tags.aura or gemData.tags.herald then
|
||||
skillNameList["while affected by "..skillName:lower()] = { tag = { type = "Condition", var = "AffectedBy"..skillName:gsub(" ","") } }
|
||||
end
|
||||
if grantedEffect.gemTags.chaining then
|
||||
if gemData.tags.chaining then
|
||||
specialModList["^"..skillName:lower().." chains an additional time"] = { mod("ExtraSkillMod", "LIST", { mod = mod("ChainCountMax", "BASE", 1) }, { type = "SkillName", skillName = skillName }) }
|
||||
specialModList["^"..skillName:lower().." chains an additional (%d+) times"] = function(num) return { mod("ExtraSkillMod", "LIST", { mod = mod("ChainCountMax", "BASE", num) }, { type = "SkillName", skillName = skillName }) } end
|
||||
end
|
||||
if grantedEffect.gemTags.bow or grantedEffect.gemTags.projectile then
|
||||
if gemData.tags.bow or gemData.tags.projectile then
|
||||
specialModList["^"..skillName:lower().." fires an additional projectile"] = { mod("ExtraSkillMod", "LIST", { mod = mod("ProjectileCount", "BASE", 1) }, { type = "SkillName", skillName = skillName }) }
|
||||
specialModList["^"..skillName:lower().." fires (%d+) additional projectiles"] = function(num) return { mod("ExtraSkillMod", "LIST", { mod = mod("ProjectileCount", "BASE", num) }, { type = "SkillName", skillName = skillName }) } end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user