diff --git a/spec/System/TestVeiledJewelMods_spec.lua b/spec/System/TestVeiledJewelMods_spec.lua new file mode 100644 index 00000000000..b0acc0394b5 --- /dev/null +++ b/spec/System/TestVeiledJewelMods_spec.lua @@ -0,0 +1,98 @@ +describe("Veiled jewel and vestigial quiver mods", function() + local function parse(line) + -- Parse the line itself instead of reading the stored ModCache result + modLib.parseModCache[line] = nil + local mods, extra = modLib.parseMod(line) + assert.is_nil(extra) + assert.is_not_nil(mods) + return mods + end + + local function findTag(mod, tagType) + for _, tag in ipairs(mod) do + if tag.type == tagType then + return tag + end + end + end + + it("parses poison chance on critical strikes with bows", function() + local mods = parse("Critical Strikes with Bows have a 20% chance to Poison the Enemy") + assert.are.equal(1, #mods) + assert.are.equal("PoisonChance", mods[1].name) + assert.are.equal("BASE", mods[1].type) + assert.are.equal(20, mods[1].value) + assert.are.equal(ModFlag.Bow, mods[1].flags) + assert.are.equal("CriticalStrike", findTag(mods[1], "Condition").var) + end) + + it("parses rage on hit with axes or swords", function() + local mods = parse("Attacks with Axes or Swords grant 1 Rage on Hit") + assert.are.equal(1, #mods) + assert.are.equal("Condition:CanGainRage", mods[1].name) + assert.are.equal("FLAG", mods[1].type) + assert.is_true(mods[1].value) + assert.are.same({ "UsingAxe", "UsingSword" }, findTag(mods[1], "Condition").varList) + end) + + it("parses unarmed attack speed with melee skills", function() + for _, value in ipairs({ 7, 10, 12 }) do + local mods = parse(value .. "% increased Unarmed Attack Speed with Melee Skills") + assert.are.equal(1, #mods) + assert.are.equal("Speed", mods[1].name) + assert.are.equal("INC", mods[1].type) + assert.are.equal(value, mods[1].value) + assert.are.equal(bit.bor(ModFlag.Unarmed, ModFlag.Attack, ModFlag.Melee), mods[1].flags) + end + end) + + it("parses stun duration against intimidated enemies", function() + local mods = parse("Enemies Intimidated by you have 13% increased duration of stuns against them") + assert.are.equal(1, #mods) + assert.are.equal("EnemyStunDuration", mods[1].name) + assert.are.equal("INC", mods[1].type) + assert.are.equal(13, mods[1].value) + local tag = findTag(mods[1], "ActorCondition") + assert.are.equal("enemy", tag.actor) + assert.are.equal("Intimidated", tag.var) + end) + + it("parses increased damage for linked targets", function() + local mods = parse("Your Linked targets deal 16% increased Damage") + assert.are.equal(1, #mods) + assert.are.equal("ExtraLinkEffect", mods[1].name) + assert.are.equal("LIST", mods[1].type) + local linkMod = mods[1].value.mod + assert.are.equal("Damage", linkMod.name) + assert.are.equal("INC", linkMod.type) + assert.are.equal(16, linkMod.value) + assert.is_true(findTag(linkMod, "GlobalEffect").unscalable) + end) + + it("parses both wordings of ignored mana burn", function() + for _, line in ipairs({ + "The first 2 Mana Burn applied to you has no effect", + "The first 2 Mana Burn applied to you have no effect", + }) do + local mods = parse(line) + assert.are.equal(1, #mods) + assert.are.equal("EffectiveManaBurnStacks", mods[1].name) + assert.are.equal("BASE", mods[1].type) + assert.are.equal(-2, mods[1].value) + assert.are.equal("player", findTag(mods[1], "ActorCondition").actor) + end + end) + + it("parses arrows fork", function() + local mods = parse("Arrows Fork") + assert.are.equal(2, #mods) + assert.are.equal("ForkOnce", mods[1].name) + assert.are.equal("FLAG", mods[1].type) + assert.is_true(mods[1].value) + assert.are.equal(KeywordFlag.Arrow, mods[1].keywordFlags) + assert.are.equal("ForkCountMax", mods[2].name) + assert.are.equal("BASE", mods[2].type) + assert.are.equal(1, mods[2].value) + assert.are.equal(KeywordFlag.Arrow, mods[2].keywordFlags) + end) +end) diff --git a/src/Data/ModCache.lua b/src/Data/ModCache.lua index 94ce6007e71..dcb985af7ba 100755 --- a/src/Data/ModCache.lua +++ b/src/Data/ModCache.lua @@ -11521,7 +11521,7 @@ c["7% increased Spell Damage per Power Charge"]={{[1]={[1]={type="Multiplier",va c["7% increased Strength"]={{[1]={flags=0,keywordFlags=0,name="Str",type="INC",value=7}},nil} c["7% increased Stun and Block Recovery"]={{[1]={flags=0,keywordFlags=0,name="StunRecovery",type="INC",value=7}},nil} c["7% increased Trap Throwing Speed"]={{[1]={flags=0,keywordFlags=0,name="TrapThrowingSpeed",type="INC",value=7}},nil} -c["7% increased Unarmed Attack Speed with Melee Skills"]={{[1]={flags=16777221,keywordFlags=0,name="Speed",type="INC",value=7}}," with Melee Skills "} +c["7% increased Unarmed Attack Speed with Melee Skills"]={{[1]={flags=16777473,keywordFlags=0,name="Speed",type="INC",value=7}},nil} c["7% increased maximum Energy Shield"]={{[1]={[1]={type="Global"},flags=0,keywordFlags=0,name="EnergyShield",type="INC",value=7}},nil} c["7% increased maximum Life"]={{[1]={flags=0,keywordFlags=0,name="Life",type="INC",value=7}},nil} c["7% increased maximum Life if Corrupted"]={{[1]={[1]={corruptedCond=true,itemSlot="{SlotName}",type="ItemCondition"},flags=0,keywordFlags=0,name="Life",type="INC",value=7}},nil} @@ -14405,7 +14405,7 @@ c["Armour is increased by 50% of Overcapped Fire Resistance"]={nil,"Armour is in c["Armour is increased by Overcapped Fire Resistance"]={{[1]={flags=0,keywordFlags=0,name="ArmourIncreasedByOvercappedFireRes",type="FLAG",value=true}},nil} c["Arrow Dancing"]={{[1]={flags=0,keywordFlags=0,name="Keystone",type="LIST",value="Arrow Dancing"},[2]={flags=0,keywordFlags=0,name="Condition:HaveArrowDancing",type="FLAG",value=true}},nil} c["Arrows Chain +1 times"]={{[1]={flags=0,keywordFlags=2048,name="ChainCountMax",type="BASE",value=1}},nil} -c["Arrows Fork"]={nil,"Arrows Fork "} +c["Arrows Fork"]={{[1]={flags=0,keywordFlags=2048,name="ForkOnce",type="FLAG",value=true},[2]={flags=0,keywordFlags=2048,name="ForkCountMax",type="BASE",value=1}},nil} c["Arrows Fork Projectiles Fork"]={nil,"Arrows Fork Projectiles Fork "} c["Arrows Pierce 1 additional Target"]={nil,"Arrows Pierce 1 additional Target "} c["Arrows Pierce 2 additional Targets"]={{[1]={flags=0,keywordFlags=2048,name="PierceCount",type="BASE",value=2}},nil} @@ -15686,7 +15686,7 @@ c["Enemies Ignited by you have 15% of Physical Damage they deal converted to Fir c["Enemies Ignited by you have 40% of Physical Damage they deal converted to Fire"]={{[1]={flags=0,keywordFlags=0,name="EnemyModifier",type="LIST",value={mod={[1]={type="Condition",var="Ignited"},flags=0,keywordFlags=0,name="PhysicalDamageConvertToFire",type="BASE",value=40}}}},nil} c["Enemies Ignited by you take Chaos Damage instead of Fire Damage from Ignite"]={{[1]={flags=0,keywordFlags=0,name="IgniteToChaos",type="FLAG",value=true}},nil} c["Enemies Ignited or Chilled by you have -5% to Elemental Resistances"]={{[1]={[1]={actor="enemy",type="ActorCondition",varList={[1]="Ignited",[2]="Chilled"}},flags=0,keywordFlags=0,name="EnemyModifier",type="LIST",value={mod={flags=0,keywordFlags=0,name="ElementalResist",type="BASE",value=-5}}}},nil} -c["Enemies Intimidated by you have 13% increased duration of stuns against them"]={{[1]={flags=0,keywordFlags=0,name="EnemyModifier",type="LIST",value={mod={[1]={type="Condition",var="Intimidated"},flags=0,keywordFlags=0,name="Duration",type="INC",value=13}}}}," of stuns against them "} +c["Enemies Intimidated by you have 13% increased duration of stuns against them"]={{[1]={[1]={actor="enemy",type="ActorCondition",var="Intimidated"},flags=0,keywordFlags=0,name="EnemyStunDuration",type="INC",value=13}},nil} c["Enemies Killed by Zombies' Hits Explode, dealing 20% of their Life as Fire Damage"]={nil,"Zombies' Hits Explode, dealing 20% of their Life as Fire Damage "} c["Enemies Killed by Zombies' Hits Explode, dealing 20% of their Life as Fire Damage Enemies Killed by Zombies' Hits Explode, dealing 50% of their Life as Fire Damage"]={nil,"Zombies' Hits Explode, dealing 20% of their Life as Fire Damage Enemies Killed by Zombies' Hits Explode, dealing 50% of their Life as Fire Damage "} c["Enemies Killed by Zombies' Hits Explode, dealing 50% of their Life as Fire Damage"]={nil,"Zombies' Hits Explode, dealing 50% of their Life as Fire Damage "} diff --git a/src/Modules/ModParser.lua b/src/Modules/ModParser.lua index a7f29d28835..80a4a25ed39 100644 --- a/src/Modules/ModParser.lua +++ b/src/Modules/ModParser.lua @@ -3547,6 +3547,7 @@ local specialModList = { ["modifiers to claw attack speed also apply to unarmed"] = { flag("ClawAttackSpeedAppliesToUnarmed") }, ["modifiers to claw attack speed also apply to unarmed attack speed"] = { flag("ClawAttackSpeedAppliesToUnarmed") }, ["modifiers to claw attack speed also apply to unarmed attack speed with melee skills"] = { flag("ClawAttackSpeedAppliesToUnarmed") }, + ["(%d+)%% increased unarmed attack speed with melee skills"] = function(num) return { mod("Speed", "INC", num, nil, bor(ModFlag.Unarmed, ModFlag.Attack, ModFlag.Melee)) } end, ["can attack as though using a claw while main hand is empty"] = { flag("CanAttackAsClawUnarmed") }, ["modifiers to claw critical strike chance also apply to unarmed"] = { flag("ClawCritChanceAppliesToUnarmed") }, ["modifiers to claw critical strike chance also apply to unarmed attack critical strike chance"] = { flag("ClawCritChanceAppliesToUnarmed") }, @@ -4030,6 +4031,7 @@ local specialModList = { ["triggered spells poison on hit"] = { mod("PoisonChance", "BASE", 100, nil, 0, KeywordFlag.Spell, { type = "SkillType", skillType = SkillType.Triggered } ) }, ["melee critical strikes have (%d+)%% chance to poison the enemy"] = function(num) return { mod("PoisonChance", "BASE", num, nil, ModFlag.Melee, { type = "Condition", var = "CriticalStrike" }) } end, ["critical strikes with daggers have a (%d+)%% chance to poison the enemy"] = function(num) return { mod("PoisonChance", "BASE", num, nil, ModFlag.Dagger, { type = "Condition", var = "CriticalStrike" }) } end, + ["critical strikes with bows have a (%d+)%% chance to poison the enemy"] = function(num) return { mod("PoisonChance", "BASE", num, nil, ModFlag.Bow, { type = "Condition", var = "CriticalStrike" }) } end, ["critical strikes with daggers poison the enemy"] = { mod("PoisonChance", "BASE", 100, nil, ModFlag.Dagger, { type = "Condition", var = "CriticalStrike" }) }, ["poison cursed enemies on hit"] = { mod("PoisonChance", "BASE", 100, { type = "ActorCondition", actor = "enemy", var = "Cursed" }) }, ["all damage can ignite against cursed enemies"] = { @@ -4459,6 +4461,7 @@ local specialModList = { ["with a searching eye jewel socketed, maim enemies for (%d) seconds on hit with attacks"] = { mod("EnemyModifier", "LIST", { mod = flag("Condition:Maimed", nil, ModFlag.Attack) }, { type = "Condition", var = "HaveSearchingEyeJewelIn{SlotName}" }) }, ["with a searching eye jewel socketed, blind enemies for (%d) seconds on hit with attacks"] = { mod("EnemyModifier", "LIST", { mod = flag("Condition:Blinded", nil, ModFlag.Attack) }, { type = "Condition", var = "HaveSearchingEyeJewelIn{SlotName}" }) }, ["enemies maimed by you take (%d+)%% increased damage over time"] = function(num) return { mod("EnemyModifier", "LIST", { mod = mod("DamageTakenOverTime", "INC", num) }, { type = "ActorCondition", actor = "enemy", var = "Maimed" }) } end, + ["enemies intimidated by you have (%d+)%% increased duration of stuns against them"] = function(num) return { mod("EnemyStunDuration", "INC", num, { type = "ActorCondition", actor = "enemy", var = "Intimidated" }) } end, ["(%d+)%% increased defences while you have at least four linked targets"] = function(num) return { mod("Defences", "INC", num, { type = "MultiplierThreshold", var = "LinkedTargets", threshold = 4 }) } end, ["your movement speed is equal to the highest movement speed among linked players"] = { flag("MovementSpeedEqualHighestLinkedPlayers", { type = "MultiplierThreshold", var = "LinkedTargets", threshold = 1 }), }, ["(%d+)%% increased movement speed while you have at least two linked targets"] = function(num) return { mod("MovementSpeed", "INC", num, { type = "MultiplierThreshold", var = "LinkedTargets", threshold = 2 }) } end, @@ -4468,6 +4471,7 @@ local specialModList = { ["curses are inflicted on you instead of linked targets"] = { mod("ExtraLinkEffect", "LIST", { mod = flag("CurseImmune"), }), }, ["elemental ailments are inflicted on you instead of linked targets"] = { mod("ExtraLinkEffect", "LIST", { mod = flag("ElementalAilmentImmune") }) }, ["non%-unique utility flasks you use apply to linked targets"] = { mod("ExtraLinkEffect", "LIST", { mod = mod("ParentNonUniqueFlasksAppliedToYou", "FLAG", true, { type = "GlobalEffect", effectType = "Global", unscalable = true } ), }) }, + ["your linked targets deal (%d+)%% increased damage"] = function(num) return { mod("ExtraLinkEffect", "LIST", { mod = mod("Damage", "INC", num, { type = "GlobalEffect", effectType = "Global", unscalable = true }) }) } end, ["non%-curse auras from your skills only apply to you and linked targets"] = { flag("SelfAurasAffectYouAndLinkedTarget", { type = "SkillType", skillType = SkillType.Aura }, { type = "SkillType", skillType = SkillType.AppliesCurse, neg = true }) }, ["linked targets always count as in range of non%-curse auras from your skills"] = { }, ["gain unholy might on block for (%d) seconds"] = { flag("Condition:UnholyMight", { type = "Condition", var = "BlockedRecently"}), flag("Condition:CanWither", { type = "Condition", var = "BlockedRecently"}), }, @@ -4712,6 +4716,7 @@ local specialModList = { ["right ring slot: projectiles from spells cannot fork"] = { flag("CannotFork", nil, bor(ModFlag.Spell, ModFlag.Projectile), { type = "SlotNumber", num = 2 }) }, ["projectiles from spells cannot pierce"] = { flag("CannotPierce", nil, ModFlag.Spell) }, ["projectiles fork"] = { flag("ForkOnce", nil, ModFlag.Projectile), mod("ForkCountMax", "BASE", 1, nil, ModFlag.Projectile) }, + ["arrows fork"] = { flag("ForkOnce", nil, 0, KeywordFlag.Arrow), mod("ForkCountMax", "BASE", 1, nil, 0, KeywordFlag.Arrow) }, ["projectiles from attacks fork"] = { flag("ForkOnce", nil, ModFlag.Projectile, { type = "SkillType", skillType = SkillType.RangedAttack }), mod("ForkCountMax", "BASE", 1, nil, ModFlag.Projectile, { type = "SkillType", skillType = SkillType.RangedAttack }) }, ["projectiles from attacks fork an additional time"] = { flag("ForkTwice", nil, ModFlag.Projectile, { type = "SkillType", skillType = SkillType.RangedAttack }), mod("ForkCountMax", "BASE", 1, nil, ModFlag.Projectile, { type = "SkillType", skillType = SkillType.RangedAttack }) }, ["projectiles from attacks can fork (%d+) additional times?"] = function(num) return { @@ -5360,7 +5365,7 @@ local specialModList = { ["tinctures have (%d+)%% increased effect while at or above (%d+) stacks of mana burn"] = function(num, _, threshold) return { mod("TinctureEffect", "INC", num, { type = "MultiplierThreshold", varList = {"ManaBurnStacks", "WeepingWoundsStacks"}, threshold = tonumber(threshold) }) } end, ["tinctures applied to you have (%d+)%% reduced mana burn rate"] = function(num) return { mod("TinctureManaBurnRate", "INC", -num, { type = "ActorCondition", actor = "player"}) } end, ["tinctures applied to you have (%d+)%% less mana burn rate"] = function(num) return { mod("TinctureManaBurnRate", "MORE", -num, { type = "ActorCondition", actor = "player"}) } end, - ["the first (%d+) mana burn applied to you have no effect"] = function(num) return { mod("EffectiveManaBurnStacks", "BASE", -num, { type = "ActorCondition", actor = "player"}) } end, + ["the first (%d+) mana burn applied to you ha[vs]e? no effect"] = function(num) return { mod("EffectiveManaBurnStacks", "BASE", -num, { type = "ActorCondition", actor = "player"}) } end, ["tinctures deactivate when you have (%d+) or more mana burn"] = function(num) return { mod("MaxManaBurnStacks", "BASE", num) } end, ["tinctures inflict weeping wounds instead of mana burn"] = { flag("Condition:WeepingWoundsInsteadOfManaBurn"), }, ["tincture effects also apply to ranged weapons"] = { flag("TinctureRangedWeapons"), }, @@ -5648,6 +5653,9 @@ local specialModList = { ["attacks with axes or swords grant (%d+) rage on hit, no more than once every second"] = { flag("Condition:CanGainRage", { type = "Condition", varList = { "UsingAxe", "UsingSword" } }), }, + ["attacks with axes or swords grant (%d+) rage on hit"] = { + flag("Condition:CanGainRage", { type = "Condition", varList = { "UsingAxe", "UsingSword" } }), + }, ["regenerate (%d+) rage per second for every (%d+) life recovery per second from regeneration"] = function(num, _, div) return { mod("RageRegen", "BASE", num, {type = "PercentStat", stat = "LifeRegen", percent = tonumber(num/div*100) }), flag("Condition:CanGainRage"),