Gem backend changes for 3.3

This commit is contained in:
Openarl
2018-06-01 22:06:12 +10:00
parent 52c73a788a
commit b323b2c19a
40 changed files with 14308 additions and 8841 deletions

View File

@@ -644,19 +644,17 @@ local function flag(name, ...)
return mod(name, "FLAG", true, ...)
end
local gemNameLookup = { }
for name, grantedEffect in pairs(data["2_6"].skills) do
if not grantedEffect.hidden then
gemNameLookup[grantedEffect.name:lower()] = grantedEffect.name
elseif grantedEffect.fromItem then
gemNameLookup[grantedEffect.name:lower()] = grantedEffect.id
local gemIdLookup = { }
for name, grantedEffect in pairs(data["3_0"].skills) do
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
@@ -845,7 +843,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") },
@@ -990,7 +988,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 }),
@@ -1137,11 +1135,13 @@ local regenTypes = {
-- Build active skill name lookup
local skillNameList = { }
local preSkillNameList = { }
for skillName, grantedEffect in pairs(data["2_6"].gems) do
for gemId, gemData in pairs(data["2_6"].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 } }
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
@@ -1149,7 +1149,7 @@ for skillName, grantedEffect in pairs(data["2_6"].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.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