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

Add special handling to support bound fate #8256

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
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
40 changes: 40 additions & 0 deletions src/Classes/Item.lua
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,7 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
end
end

local handleRemainingModsAs
local lineLower = line:lower()
if lineLower == "this item can be anointed by cassia" then
self.canBeAnointed = true
Expand All @@ -758,6 +759,8 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
self.canHaveShieldCrucibleTree = true
elseif lineLower == "has a two handed sword crucible passive skill tree" then
self.canHaveTwoHandedSwordCrucibleTree = true
elseif lineLower == "every 5 seconds, gain one of the following for 5 seconds:" then
handleRemainingModsAs = "Bound Fate"
end

local modLines
Expand Down Expand Up @@ -806,6 +809,43 @@ function ItemClass:ParseRaw(raw, rarity, highQuality)
modLine.extra = line
t_insert(modLines, modLine)
end

if handleRemainingModsAs then
l = l + 1
while self.rawLines[l] do
local line = self.rawLines[l]
local modLine = { modTags = {} }
local rangedLine = itemLib.applyRange(handleRemainingModsAs..": "..line, 1, 1)
local modList, extra = modLib.parseMod(rangedLine)
if (not modList or extra) and self.rawLines[l+1] then
-- Try to combine it with the next line
local nextLine = self.rawLines[l+1]:gsub("%b{}", ""):gsub(" ?%(%l+%)","")
local combLine = line.." "..nextLine
rangedLine = itemLib.applyRange(combLine, 1, catalystScalar)
modList, extra = modLib.parseMod(rangedLine, true)
if modList and not extra then
line = line.."\n"..nextLine
l = l + 1
else
modList, extra = modLib.parseMod(rangedLine)
end
end
local modLines = self.explicitModLines
modLine.line = line
if modList then
modLine.modList = modList
modLine.extra = extra
modLine.valueScalar = catalystScalar
modLine.range = modLine.range or main.defaultItemAffixQuality
t_insert(modLines, modLine)
else
modLine.modList = { }
modLine.extra = line
t_insert(modLines, modLine)
end
l = l + 1
end
end
end
end
::continue::
Expand Down
9 changes: 7 additions & 2 deletions src/Data/ModCache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7282,6 +7282,12 @@ c["Blink Arrow and Mirror Arrow have 100% increased Cooldown Recovery Rate"]={{[
c["Blood Magic"]={{[1]={flags=0,keywordFlags=0,name="Keystone",type="LIST",value="Blood Magic"}},nil}
c["Bloodsoaked Blade"]={{[1]={flags=0,keywordFlags=0,name="Keystone",type="LIST",value="Bloodsoaked Blade"}},nil}
c["Bone Offering has 11% increased Effect"]={{[1]={[1]={skillId="BoneOffering",type="SkillId"},flags=0,keywordFlags=0,name="BuffEffect",type="INC",value="11"}},nil}
c["Bound Fate: Attacks against you always Hit"]={{[1]={[1]={type="Condition",var="BoundFate"},[2]={type="Condition",var="BoundFate4"},flags=0,keywordFlags=0,name="CannotEvade",type="FLAG",value=true}},nil}
c["Bound Fate: Attacks cannot Hit you"]={{[1]={[1]={type="Condition",var="BoundFate"},[2]={type="Condition",var="BoundFate3"},flags=0,keywordFlags=0,name="AlwaysEvade",type="FLAG",value=true}},nil}
c["Bound Fate: Damage of Hits against you is Lucky"]={nil,"Bound Fate: Damage of Hits is Lucky "}
c["Bound Fate: Hits against you are always Critical Strikes"]={{[1]={[1]={type="Condition",var="BoundFate"},[2]={type="Condition",var="BoundFate2"},flags=0,keywordFlags=0,name="EnemyModifier",type="LIST",value={mod={flags=0,keywordFlags=0,name="AlwaysCrit",type="FLAG",value=true}}},[2]={[1]={type="Condition",var="BoundFate"},[2]={type="Condition",var="BoundFate2"},flags=0,keywordFlags=0,name="EnemyModifier",type="LIST",value={mod={flags=0,keywordFlags=0,name="Condition:AlwaysCrit",type="FLAG",value=true}}}},nil}
c["Bound Fate: Your Damage with Hits is Lucky"]={{[1]={[1]={type="Condition",var="BoundFate"},[2]={type="Condition",var="BoundFate5"},flags=0,keywordFlags=0,name="LuckyHits",type="FLAG",value=true}},nil}
c["Bound Fate: Your Hits are always Critical Strikes"]={{[1]={[1]={type="Condition",var="BoundFate"},[2]={type="Condition",var="BoundFate1"},flags=0,keywordFlags=0,name="CritChance",type="OVERRIDE",value=100}},nil}
c["Bow Attacks fire 2 additional Arrows"]={{[1]={flags=131072,keywordFlags=0,name="ProjectileCount",type="BASE",value=2}},nil}
c["Bow Attacks fire 2 additional Arrows if you haven't Cast Dash recently"]={{[1]={[1]={neg=true,type="Condition",var="CastDashRecently"},flags=131072,keywordFlags=0,name="ProjectileCount",type="BASE",value=2}},nil}
c["Bow Attacks fire an additional Arrow"]={{[1]={flags=131072,keywordFlags=0,name="ProjectileCount",type="BASE",value=1}},nil}
Expand Down Expand Up @@ -7957,8 +7963,7 @@ c["Every 4 seconds, Regenerate Life equal to 1% of Armour and Evasion Rating ove
c["Every 4 seconds, remove Curses and Elemental Ailments from you"]={nil,"Every 4 seconds, remove Curses and Elemental Ailments from you "}
c["Every 4 seconds, remove Curses and Elemental Ailments from you Every 4 seconds, Regenerate 100% of Life over one second"]={nil,"Every 4 seconds, remove Curses and Elemental Ailments from you Every 4 seconds, Regenerate 100% of Life over one second "}
c["Every 4 seconds, remove Curses and Elemental Ailments from you Grants Armour equal to 6% of your Reserved Mana to you and nearby Allies"]={nil,"Every 4 seconds, remove Curses and Elemental Ailments from you Grants Armour equal to 6% of your Reserved Mana to you and nearby Allies "}
c["Every 5 seconds, gain one of the following for 5 seconds:"]={nil,"Every 5 seconds, gain one of the following for 5 seconds: "}
c["Every 5 seconds, gain one of the following for 5 seconds: Your Hits are always Critical Strikes"]={nil,"Every 5 seconds, gain one of the following for 5 seconds: Your Hits are always Critical Strikes "}
c["Every 5 seconds, gain one of the following for 5 seconds:"]={{[1]={flags=0,keywordFlags=0,name="Condition:BoundFate",type="FLAG",value=true}},nil}
c["Every 8 seconds, gain Avatar of Fire for 4 seconds"]={{[1]={flags=0,keywordFlags=0,name="Condition:HaveVulconus",type="FLAG",value=true}},nil}
c["Every Rage also grants 1% increased Armour"]={{[1]={[1]={type="Multiplier",var="RageEffect"},flags=0,keywordFlags=0,name="Armour",type="INC",value=1}},nil}
c["Every Rage also grants 1% increased Attack Speed"]={{[1]={[1]={type="Multiplier",var="RageEffect"},flags=1,keywordFlags=0,name="Speed",type="INC",value=1}},nil}
Expand Down
17 changes: 15 additions & 2 deletions src/Modules/ConfigOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1464,7 +1464,7 @@ Huge sets the radius to 11.
{ var = "conditionHaveArborix", type = "check", label = "Do you have Iron Reflexes?", ifFlag = "Condition:HaveArborix", tooltip = "This option is specific to Arborix.",apply = function(val, modList, enemyModList)
modList:NewMod("Condition:HaveIronReflexes", "FLAG", true, "Config", { type = "Condition", var = "Combat" })
modList:NewMod("Keystone", "LIST", "Iron Reflexes", "Config")
end },
end },
{ var = "conditionHaveAugyre", type = "list", label = "Augyre rotating buff:", ifFlag = "Condition:HaveAugyre", list = {{val="EleOverload",label="Elemental Overload"},{val="ResTechnique",label="Resolute Technique"}}, tooltip = "This option is specific to Augyre.", apply = function(val, modList, enemyModList)
if val == "EleOverload" then
modList:NewMod("Condition:HaveElementalOverload", "FLAG", true, "Config", { type = "Condition", var = "Combat" })
Expand All @@ -1473,7 +1473,20 @@ Huge sets the radius to 11.
modList:NewMod("Condition:HaveResoluteTechnique", "FLAG", true, "Config", { type = "Condition", var = "Combat" })
modList:NewMod("Keystone", "LIST", "Resolute Technique", "Config")
end
end },
end },
{ var = "conditionBoundFate", type = "list", label = "Bound Fate rotating buff:", ifFlag = "Condition:BoundFate", list = {
{val="NONE",label="No Buff"},
{val="BoundFate1",label="Your Hits are always Critical Strikes"},
{val="BoundFate2",label="Hits against you are always Critical Strikes"},
{val="BoundFate3",label="Attacks cannot Hit you"},
{val="BoundFate4",label="Attacks against you always Hit"},
{val="BoundFate5",label="Your Damage with Hits is Lucky"},
{val="BoundFate6",label="Damage of Hits against you is Lucky"}
}, tooltip = "This option is specific to Bound Fate.", apply = function(val, modList, enemyModList)
if val ~= "NONE" then
modList:NewMod("Condition:"..val, "FLAG", true, "Config", { type = "Condition", var = "Effective" })
end
end },
{ var = "conditionHaveVulconus", type = "check", label = "Do you have Avatar Of Fire?", ifFlag = "Condition:HaveVulconus", tooltip = "This option is specific to Vulconus.", apply = function(val, modList, enemyModList)
modList:NewMod("Condition:HaveAvatarOfFire", "FLAG", true, "Config", { type = "Condition", var = "Combat" })
modList:NewMod("Keystone", "LIST", "Avatar of Fire", "Config")
Expand Down
42 changes: 24 additions & 18 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5075,24 +5075,6 @@ local specialModList = {
mod("Mana", "BASE", num, { type = "Multiplier", var = "JourneyTattooMind" }),
mod("Multiplier:JourneyTattooMind", "BASE", 1),
} end,
-- Display-only modifiers
["extra gore"] = { },
["prefixes:"] = { },
["suffixes:"] = { },
["while your passive skill tree connects to a class' starting location, you gain:"] = { },
["socketed lightning spells [hd][ae][va][el] (%d+)%% increased spell damage if triggered"] = { },
["manifeste?d? dancing dervishe?s? disables both weapon slots"] = { },
["manifeste?d? dancing dervishe?s? dies? when rampage ends"] = { },
["survival"] = { },
["you can have two different banners at the same time"] = { },
["can have a second enchantment modifier"] = { },
["can have (%d+) additional enchantment modifiers"] = { },
["this item can be anointed by cassia"] = { },
["has a crucible passive skill tree"] = { },
["has a two handed sword crucible passive skill tree"] = { },
["has a crucible passive skill tree with only support passive skills"] = { },
["crucible passive skill tree is removed if this modifier is removed"] = { },
["all sockets are white"] = { },
["every (%d+) seconds, regenerate (%d+)%% of life over one second"] = function (num, _, percent) return {
mod("LifeRegenPercent", "BASE", tonumber(percent), { type = "Condition", var = "LifeRegenBurstFull" }),
mod("LifeRegenPercent", "BASE", tonumber(percent) / num, { type = "Condition", var = "LifeRegenBurstAvg" }),
Expand All @@ -5115,6 +5097,30 @@ local specialModList = {
["nearby allies have (%d+)%% chance to block attack damage per (%d+) strength you have"] = function(block, _, str) return {
mod("ExtraAura", "LIST", { onlyAllies = true, mod = mod("BlockChance", "BASE", block) }, { type = "PerStat", stat = "Str", div = tonumber(str) }),
} end,
-- Display-only or special modifiers
["extra gore"] = { },
["prefixes:"] = { },
["suffixes:"] = { },
["while your passive skill tree connects to a class' starting location, you gain:"] = { },
["socketed lightning spells [hd][ae][va][el] (%d+)%% increased spell damage if triggered"] = { },
["manifeste?d? dancing dervishe?s? disables both weapon slots"] = { },
["manifeste?d? dancing dervishe?s? dies? when rampage ends"] = { },
["survival"] = { },
["you can have two different banners at the same time"] = { },
["can have a second enchantment modifier"] = { },
["can have (%d+) additional enchantment modifiers"] = { },
["this item can be anointed by cassia"] = { },
["has a crucible passive skill tree"] = { },
["has a two handed sword crucible passive skill tree"] = { },
["has a crucible passive skill tree with only support passive skills"] = { },
["crucible passive skill tree is removed if this modifier is removed"] = { },
["all sockets are white"] = { },
["every 5 seconds, gain one of the following for 5 seconds:"] = { flag("Condition:BoundFate") },
["bound fate: your hits are always critical strikes"] = { mod("CritChance", "OVERRIDE", 100, { type = "Condition", var = "BoundFate" }, { type = "Condition", var = "BoundFate1" }) },
["bound fate: hits against you are always critical strikes"] = { mod("EnemyModifier", "LIST", { mod = flag("AlwaysCrit") }, { type = "Condition", var = "BoundFate" }, { type = "Condition", var = "BoundFate2" }), mod("EnemyModifier", "LIST", { mod = flag("Condition:AlwaysCrit") }, { type = "Condition", var = "BoundFate" }, { type = "Condition", var = "BoundFate2" }) },
["bound fate: attacks cannot hit you"] = { flag("AlwaysEvade", { type = "Condition", var = "BoundFate" }, { type = "Condition", var = "BoundFate3" }) },
["bound fate: attacks against you always hit"] = { flag("CannotEvade", { type = "Condition", var = "BoundFate" }, { type = "Condition", var = "BoundFate4" }) },
["bound fate: your damage with hits is lucky"] = { flag("LuckyHits", { type = "Condition", var = "BoundFate" }, { type = "Condition", var = "BoundFate5" }) },
}
for _, name in pairs(data.keystones) do
specialModList[name:lower()] = { mod("Keystone", "LIST", name) }
Expand Down
Loading