Skip to content
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
60 changes: 60 additions & 0 deletions spec/System/TestSkills_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,64 @@ describe("TestSkills", function()
local finalCost = build.calcsTab.mainOutput.ManaCost
assert.are.equals(16, round(finalCost))
end)

it("Test 'every rage also grants you' for minion mods and minion apply to you mods #run", function()
build.itemsTab:CreateDisplayItemFromRaw([[
New Item
Fanatic Greathammer
Quality: 0
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")

build.skillsTab:PasteSocketGroup("Unearth 20/0 1")
build.skillsTab:PasteSocketGroup("Leap Slam 20/0 1\nRage I 1/0 1")
runCallback("OnFrame")

local baseUnearthAttackSpeed = build.calcsTab.mainOutput.Minion.Speed

build.configTab.input.customMods = "Every Rage also grants you 1% increased Minion Attack Speed"
build.configTab.input.multiplierRage = 30
build.configTab:BuildModList()
runCallback("OnFrame")

assert.True(baseUnearthAttackSpeed < build.calcsTab.mainOutput.Minion.Speed)

newBuild()
build.itemsTab:CreateDisplayItemFromRaw([[
Rarity: UNIQUE
Chober Chaber
Leaden Greathammer
Variant: Pre 0.1.1
Variant: Current
Selected Variant: 2
Quality: 20
LevelReq: 33
Implicits: 0
+100 Intelligence Requirement
{variant:1}{range:0.5}(80-120)% increased Physical Damage
{variant:2}{range:0.5}Adds (58-65) to (102-110) Physical Damage
{range:0.5}+(80-100) to maximum Mana
{variant:2}+50 to Spirit
{variant:1}+5% to Critical Hit Chance
Increases and Reductions to Minion Damage also affect you
]])
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")

build.skillsTab:PasteSocketGroup("Leap Slam 20/0 1\nRage I 1/0 1")
runCallback("OnFrame")

build.configTab.input.multiplierRage = 30
build.configTab:BuildModList()
runCallback("OnFrame")

local baseLeapSlamHit = build.calcsTab.mainOutput.AverageDamage

build.configTab.input.customMods = "Every Rage also grants you 1% increased Minion Damage"
build.configTab:BuildModList()
runCallback("OnFrame")

assert.True(baseLeapSlamHit < build.calcsTab.mainOutput.AverageDamage)
end)
end)
2 changes: 2 additions & 0 deletions src/Classes/CalcBreakdownControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,8 @@ function CalcBreakdownClass:AddModSection(sectionData, modList)
else
desc = "Skill type: "..(tag.neg and "Not " or "")..self:FormatModName(SkillTypeName[tag.skillType])
end
elseif tag.type == "BaseFlag" then
desc = "Base flag: "..(tag.neg and "Not " or "")..self:FormatModName(tostring(tag.baseFlag))
elseif tag.type == "SlotNumber" then
desc = "When in slot #"..tag.num
elseif tag.type == "GlobalEffect" then
Expand Down
56 changes: 42 additions & 14 deletions src/Classes/ModStore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ local ModStoreClass = newClass("ModStore", function(self, parent)
self.conditions = { }
end)

local function getActor(self, actorType)
if actorType == "player" then
return self.actor.player or (self.actor.parent and self.actor.parent.player) or (self.actor.enemy and self.actor.enemy.player)
else
return self.actor[actorType]
end
end

function ModStoreClass:ScaleAddMod(mod, scale)
local unscalable = false
for _, effects in ipairs(mod) do
Expand Down Expand Up @@ -315,15 +323,17 @@ function ModStoreClass:EvalMod(mod, cfg, globalLimits)
-- This explicit target is necessary because even though the GetMultiplier method does call self.parent.GetMultiplier, it does so with noMod = true,
-- disabling the summation (3rd part): (not noMod and self:Sum("BASE", cfg, multiplierName[var]) or 0)
if tag.limitActor then
if self.actor[tag.limitActor] then
limitTarget = self.actor[tag.limitActor].modDB
local limitActor = getActor(self, tag.limitActor)
if limitActor then
limitTarget = limitActor.modDB
else
return
end
end
if tag.actor then
if self.actor[tag.actor] then
target = self.actor[tag.actor].modDB
local actor = getActor(self, tag.actor)
if actor then
target = actor.modDB
else
return
end
Expand Down Expand Up @@ -387,15 +397,17 @@ function ModStoreClass:EvalMod(mod, cfg, globalLimits)
local target = self
local thresholdTarget = self
if tag.thresholdActor then
if self.actor[tag.thresholdActor] then
thresholdTarget = self.actor[tag.thresholdActor].modDB
local thresholdActor = getActor(self, tag.thresholdActor)
if thresholdActor then
thresholdTarget = thresholdActor.modDB
else
return
end
end
if tag.actor then
if self.actor[tag.actor] then
target = self.actor[tag.actor].modDB
local actor = getActor(self, tag.actor)
if actor then
target = actor.modDB
else
return
end
Expand All @@ -417,8 +429,9 @@ function ModStoreClass:EvalMod(mod, cfg, globalLimits)
local target = self
-- This functions similar to the above tagTypes in regard to which actor to use, but for PerStat
-- if the actor is 'parent', we don't want to return if we're already using 'parent', just keep using 'self'
if tag.actor and self.actor[tag.actor] then
target = self.actor[tag.actor].modDB
local actor = getActor(self, tag.actor)
if actor then
target = actor.modDB
end
if tag.statList then
base = 0
Expand Down Expand Up @@ -465,8 +478,9 @@ function ModStoreClass:EvalMod(mod, cfg, globalLimits)
local target = self
-- This functions similar to the above tagTypes in regard to which actor to use, but for PercentStat
-- if the actor is 'parent', we don't want to return if we're already using 'parent', just keep using 'self'
if tag.actor and self.actor[tag.actor] then
target = self.actor[tag.actor].modDB
local actor = getActor(self, tag.actor)
if actor then
target = actor.modDB
end
if tag.statList then
base = 0
Expand Down Expand Up @@ -581,7 +595,8 @@ function ModStoreClass:EvalMod(mod, cfg, globalLimits)
local match = false
local target = self
if tag.actor then
target = self.actor[tag.actor] and self.actor[tag.actor].modDB
local actor = getActor(self, tag.actor)
target = actor and actor.modDB
end
if target and (tag.var or tag.varList) then
if tag.varList then
Expand Down Expand Up @@ -782,6 +797,19 @@ function ModStoreClass:EvalMod(mod, cfg, globalLimits)
if not match then
return
end
elseif tag.type == "BaseFlag" then
local match = false
if cfg and cfg.skillGem and cfg.skillGem.grantedEffect and cfg.skillGem.grantedEffect.statSets and cfg.skillGem.grantedEffect.statSets[1] then
match = cfg.skillGem.grantedEffect.statSets[1].baseFlags[tag.baseFlag]
else
match = cfg and cfg.baseFlags and cfg.baseFlags[tag.baseFlag]
end
if tag.neg then
match = not match
end
if not match then
return
end
elseif tag.type == "SlotName" then
if not cfg then
return
Expand Down Expand Up @@ -863,4 +891,4 @@ function ModStoreClass:EvalMod(mod, cfg, globalLimits)
end
end
return value
end
end
7 changes: 3 additions & 4 deletions src/Data/ModCache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4877,9 +4877,8 @@ c["Every Rage also grants 1% increased Fire Damage"]={{[1]={[1]={type="Multiplie
c["Every Rage also grants 1% increased Stun Threshold"]={{[1]={[1]={type="Multiplier",var="RageEffect"},flags=0,keywordFlags=0,name="StunThreshold",type="INC",value=1}},nil}
c["Every Rage also grants 2% increased Spell Damage"]={{[1]={[1]={type="Multiplier",var="RageEffect"},flags=2,keywordFlags=0,name="Damage",type="INC",value=2}},nil}
c["Every Rage also grants 2% increased Stun Threshold"]={{[1]={[1]={type="Multiplier",var="RageEffect"},flags=0,keywordFlags=0,name="StunThreshold",type="INC",value=2}},nil}
c["Every Rage also grants you 1% increased Minion Attack Speed"]={nil,"you 1% increased Minion Attack Speed "}
c["Every Rage also grants you 1% increased Minion Attack Speed Every Rage also grants you 1% increased Minion Damage"]={nil,"you 1% increased Minion Attack Speed Every Rage also grants you 1% increased Minion Damage "}
c["Every Rage also grants you 1% increased Minion Damage"]={nil,"you 1% increased Minion Damage "}
c["Every Rage also grants you 1% increased Minion Attack Speed"]={{[1]={flags=0,keywordFlags=0,name="MinionModifier",type="LIST",value={mod={[1]={actor="player",type="Multiplier",var="RageEffect"},flags=1,keywordFlags=0,name="Speed",type="INC",value=1}}}},nil}
c["Every Rage also grants you 1% increased Minion Damage"]={{[1]={flags=0,keywordFlags=0,name="MinionModifier",type="LIST",value={mod={[1]={actor="player",type="Multiplier",var="RageEffect"},flags=0,keywordFlags=0,name="Damage",type="INC",value=1}}}},nil}
c["Every Third Slam skill that doesn't create Fissures which you use yourself causes 3 additional Aftershocks ahead and to each side of the initial area"]={nil,"Every Third Slam skill that doesn't create Fissures which you use yourself causes 3 additional Aftershocks ahead and to each side of the initial area "}
c["Every second Slam Skill you use yourself is Ancestrally Boosted"]={nil,"Every second Slam Skill you use yourself is Ancestrally Boosted "}
c["Every second, inflicts Critical Weakness on enemies in your Presence for 1 second"]={{[1]={flags=0,keywordFlags=0,name="ApplyCriticalWeakness",type="FLAG",value=true}},nil}
Expand Down Expand Up @@ -6032,7 +6031,7 @@ c["Targets Cursed by you have at least 15% of Life Reserved"]={{[1]={flags=0,key
c["Targets can be affected by +1 of your Poisons at the same time"]={{[1]={flags=0,keywordFlags=0,name="PoisonCanStack",type="FLAG",value=true},[2]={flags=0,keywordFlags=0,name="PoisonStacks",type="BASE",value=1}},nil}
c["Targets can be affected by two of your Chills at the same time"]={{[1]={flags=0,keywordFlags=0,name="ChillCanStack",type="FLAG",value=true},[2]={flags=0,keywordFlags=0,name="ChillStacksMax",type="OVERRIDE",value=2}},nil}
c["Targets can be affected by two of your Shocks at the same time"]={{[1]={flags=0,keywordFlags=0,name="ShockCanStack",type="FLAG",value=true},[2]={flags=0,keywordFlags=0,name="ShockStacksMax",type="OVERRIDE",value=2}},nil}
c["Temporary Minion Skills have +2 to Limit of Minions summoned"]={nil,"Temporary Minion Skills have +2 to Limit of Minions summoned "}
c["Temporary Minion Skills have +2 to Limit of Minions summoned"]={{[1]={[1]={baseFlag="duration",neg=true,type="BaseFlag"},flags=0,keywordFlags=0,name="ActiveMinionLimit",type="BASE",value=2}},nil}
c["The Effect of Chill on you is reversed"]={{[1]={flags=0,keywordFlags=0,name="SelfChillEffectIsReversed",type="FLAG",value=true}},nil}
c["There is no Limit on the number of Banners you can place"]={nil,"There is no Limit on the number of Banners you can place "}
c["This Weapon's Critical Hit Chance is 100%"]={{[1]={flags=0,keywordFlags=0,name="WeaponData",type="LIST",value={key="CritChance",value=100}}},nil}
Expand Down
1 change: 0 additions & 1 deletion src/Data/Skills/act_dex.lua
Original file line number Diff line number Diff line change
Expand Up @@ -897,7 +897,6 @@ skills["SummonBeastPlayer"] = {
minion = true,
summonBeast = true,
duration = true,
permanentMinion = true,
},
baseMods = {
mod("MinionModifier", "LIST", { mod = mod("Damage", "MORE", 25) }), --Server side damage mod added in 0.3,
Expand Down
19 changes: 8 additions & 11 deletions src/Data/Skills/act_int.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16168,7 +16168,6 @@ skills["RagingSpiritsPlayer"] = {
baseFlags = {
spell = true,
minion = true,
permanentMinion = true,
},
constantStats = {
{ "base_number_of_raging_spirits_allowed", 10 },
Expand Down Expand Up @@ -16291,7 +16290,6 @@ skills["RaiseZombiePlayer"] = {
baseFlags = {
spell = true,
minion = true,
permanentMinion = true,
},
constantStats = {
{ "display_minion_monster_type", 1 },
Expand Down Expand Up @@ -17690,7 +17688,7 @@ skills["SummonSkeletalArsonistsPlayer"] = {
baseFlags = {
spell = true,
minion = true,
permanentMinion = true,
duration = true,
},
constantStats = {
{ "display_minion_monster_type", 2 },
Expand Down Expand Up @@ -17810,7 +17808,7 @@ skills["SummonSkeletalBrutesPlayer"] = {
baseFlags = {
spell = true,
minion = true,
permanentMinion = true,
duration = true,
},
constantStats = {
{ "display_minion_monster_type", 2 },
Expand Down Expand Up @@ -17930,7 +17928,7 @@ skills["SummonSkeletalClericsPlayer"] = {
baseFlags = {
spell = true,
minion = true,
permanentMinion = true,
duration = true,
},
constantStats = {
{ "display_minion_monster_type", 2 },
Expand Down Expand Up @@ -18050,7 +18048,7 @@ skills["SummonSkeletalFrostMagesPlayer"] = {
baseFlags = {
spell = true,
minion = true,
permanentMinion = true,
duration = true,
},
constantStats = {
{ "display_minion_monster_type", 2 },
Expand Down Expand Up @@ -18171,7 +18169,7 @@ skills["SummonSkeletalReaversPlayer"] = {
baseFlags = {
spell = true,
minion = true,
permanentMinion = true,
duration = true,
},
constantStats = {
{ "display_minion_monster_type", 2 },
Expand Down Expand Up @@ -18292,7 +18290,7 @@ skills["SummonSkeletalSnipersPlayer"] = {
baseFlags = {
spell = true,
minion = true,
permanentMinion = true,
duration = true,
},
constantStats = {
{ "display_minion_monster_type", 2 },
Expand Down Expand Up @@ -18412,7 +18410,7 @@ skills["SummonSkeletalStormMagesPlayer"] = {
baseFlags = {
spell = true,
minion = true,
permanentMinion = true,
duration = true,
},
constantStats = {
{ "display_minion_monster_type", 2 },
Expand Down Expand Up @@ -18534,7 +18532,7 @@ skills["SummonSkeletalWarriorsPlayer"] = {
baseFlags = {
spell = true,
minion = true,
permanentMinion = true,
duration = true,
},
constantStats = {
{ "display_minion_monster_type", 2 },
Expand Down Expand Up @@ -19713,7 +19711,6 @@ skills["SummonSpectrePlayer"] = {
minion = true,
spectre = true,
duration = true,
permanentMinion = true,
},
baseMods = {
mod("MinionModifier", "LIST", { mod = mod("Damage", "MORE", 25) }), --Server side damage mod added in 0.3,
Expand Down
5 changes: 2 additions & 3 deletions src/Data/Skills/other.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5307,7 +5307,6 @@ skills["ManifestWeaponPlayer"] = {
baseFlags = {
spell = true,
minion = true,
duration = true,
},
constantStats = {
{ "minion_1%_damage_+%_per_X_player_strength", 1 },
Expand Down Expand Up @@ -8022,7 +8021,7 @@ skills["SummonInfernalHoundPlayer"] = {
baseFlags = {
spell = true,
minion = true,
permanentMinion = true,
duration = true,
},
constantStats = {
{ "display_minion_monster_type", 8 },
Expand Down Expand Up @@ -8151,7 +8150,7 @@ skills["SupportingFirePlayer"] = {
},
baseFlags = {
minion = true,
permanentMinion = true,
duration = true,
},
constantStats = {
{ "minion_1%_damage_+%_per_X_player_strength", 1 },
Expand Down
2 changes: 1 addition & 1 deletion src/Export/Skills/act_dex.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ statMap = {
#minionList
#skill SummonBeastPlayer
#set SummonBeastPlayer
#flags spell minion summonBeast duration permanentMinion
#flags spell minion summonBeast duration
#baseMod mod("MinionModifier", "LIST", { mod = mod("Damage", "MORE", 25) }), --Server side damage mod added in 0.3
#mods
#skillEnd
Expand Down
Loading
Loading