Skip to content
Merged
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
2 changes: 2 additions & 0 deletions docs/modSyntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Often a mod will only apply under certain conditions, apply multiple times based
* var: mod to multiply by
* limit: The maximum number the mod can go up to
* limitTotal: boolean that changes the behavior of limit to apply after multiplication. Defaults to false.
* globalLimit: The maximum global number the mod can go up to, even with multiple sources. Useful for mods that say "up to a maximum of ..."
* globalLimitKey: string identifier for the global limit. Mods with identical keys cannot go over the globalLimit.
* MultiplierThreshold: Similar to a condition that only applies when the variable is above a specified threshold
* var: name of the mod
* threshold: number to reach before the mod applies
Expand Down
14 changes: 12 additions & 2 deletions src/Classes/ModDB.lua
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,28 @@ end
function ModDBClass:MoreInternal(context, cfg, flags, keywordFlags, source, ...)
local result = 1
local modPrecision = nil
local globalLimits = { }
for i = 1, select('#', ...) do
local modList = self.mods[select(i, ...)]
local modResult = 1 --The more multipliers for each mod are computed to the nearest percent then applied.
if modList then
for i = 1, #modList do
local mod = modList[i]
if mod.type == "MORE" and band(flags, mod.flags) == mod.flags and MatchKeywordFlags(keywordFlags, mod.keywordFlags) and (not source or mod.source:match("[^:]+") == source) then
local value
if mod[1] then
modResult = modResult * (1 + (context:EvalMod(mod, cfg) or 0) / 100)
value = context:EvalMod(mod, cfg) or 0
if mod[1].globalLimit and mod[1].globalLimitKey then
globalLimits[mod[1].globalLimitKey] = globalLimits[mod[1].globalLimitKey] or 0
if globalLimits[mod[1].globalLimitKey] + value > mod[1].globalLimit then
value = mod[1].globalLimit - globalLimits[mod[1].globalLimitKey]
end
globalLimits[mod[1].globalLimitKey] = globalLimits[mod[1].globalLimitKey] + value
end
else
modResult = modResult * (1 + mod.value / 100)
value = mod.value or 0
end
modResult = modResult * (1 + value / 100)
if modPrecision then
modPrecision = m_max(modPrecision, (data.highPrecisionMods[mod.name] and data.highPrecisionMods[mod.name][mod.type]) or modPrecision)
else
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/ModStore.lua
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ function ModStoreClass:GetCondition(var, cfg, noMod)
end

function ModStoreClass:GetMultiplier(var, cfg, noMod)
return (self.multipliers[var] or 0) + (self.parent and self.parent:GetMultiplier(var, cfg, true) or 0) + (not noMod and self:Sum("BASE", cfg, multiplierName[var]) or 0)
return (not noMod and self:Override(cfg, multiplierName[var])) or (self.multipliers[var] or 0) + (self.parent and self.parent:GetMultiplier(var, cfg, true) or 0) + (not noMod and self:Sum("BASE", cfg, multiplierName[var]) or 0)
end

function ModStoreClass:GetStat(stat, cfg)
Expand Down
45 changes: 35 additions & 10 deletions src/Data/ModCache.lua

Large diffs are not rendered by default.

68 changes: 66 additions & 2 deletions src/Data/Uniques/Special/New.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,70 @@
--

data.uniques.new = {

-- New
}

[[
Starcaller
Abyssal Axe
League: Mercenaries of Trarthus
Requires Level 55, 128 Str, 60 Dex
Trigger Level 20 Starfall on Melee Critical Strike
+17 to all Attributes
168% increased Physical Damage
22% increased Critical Strike Chance
20% increased Area of Effect
Gain 46% of Weapon Physical Damage as Extra Damage of a Random Element
]],[[
Wine of the Prophet
Gold Flask
League: Mercenaries of Trarthus
Requires Level 27
+60 to Maximum Charges
89% increased Charges per Use
Grants a random Divination buff for 20 seconds when used
]],[[
Scornflux
Satin Slippers
League: Mercenaries of Trarthus
Requires Level 54, 69 Int
+10 to Intelligence
+66 to Maximum Mana
+12% to all Elemental Resistances
Gain Arcane Surge when you use a Movement Skill
Increase to Cast Speed from Arcane Surge also applies to Movement Speed
]],[[
Prospero's Protection
Iron Ring
League: Mercenaries of Trarthus
Requires Level 32
Implicits: 1
Adds 1 to 4 Physical Damage to Attacks
5% chance to Block Attack Damage
+18 to Strength
+53 to Maximum Life
Armour from equipped shield is doubled
Gain no armour from equipped body armour
]],[[
Howlcrack
Ezomyte Burgonet
League: Mercenaries of Trarthus
Requires Level 60, 138 Str
+33 to Strength
121% increased Armour
Non-instant Warcries you use yourself have no Cooldown
Warcries have an additional Life Cost equal to 15% of your Maximum Life
Warcry Skills have 16% increased Area of Effect
]],[[
Enmity's Embrace
Vermillion Ring
League: Mercenaries of Trarthus
Requires Level 80
Implicits: 1
6% increased Maximum Life
+49 to Strength
14% increased Fire Damage
55% reduced Fire Resistance
Take 449 Fire Damage when you use a Skill
Damage penetrates Fire Resistance equal to your overcapped Fire Resistance
]]
}
68 changes: 12 additions & 56 deletions src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -480,42 +480,20 @@ function calcs.defence(env, actor)
for _, slot in pairs({"Helmet","Gloves","Boots","Body Armour","Weapon 2","Weapon 3"}) do
local armourData = actor.itemList[slot] and actor.itemList[slot].armourData
if armourData then
wardBase = armourData.Ward or 0
wardBase = not modDB:Flag(nil, "GainNoWardFrom" .. slot) and armourData.Ward or 0
if wardBase > 0 then
if slot == "Body Armour" and modDB:Flag(nil, "DoubleBodyArmourDefence") then
wardBase = wardBase * 2
end
output["WardOn"..slot] = wardBase
end
energyShieldBase = armourData.EnergyShield or 0
energyShieldBase = not modDB:Flag(nil, "GainNoEnergyShieldFrom" .. slot) and armourData.EnergyShield or 0
if energyShieldBase > 0 then
if slot == "Body Armour" and modDB:Flag(nil, "DoubleBodyArmourDefence") then
energyShieldBase = energyShieldBase * 2
end
output["EnergyShieldOn"..slot] = energyShieldBase
end
armourBase = armourData.Armour or 0
armourBase = not modDB:Flag(nil, "GainNoArmourFrom" .. slot) and armourData.Armour or 0
if armourBase > 0 then
if slot == "Body Armour" then
if modDB:Flag(nil, "DoubleBodyArmourDefence") then
armourBase = armourBase * 2
end
if modDB:Flag(nil, "Unbreakable") then
armourBase = armourBase * 2
end
end
output["ArmourOn"..slot] = armourBase
end
evasionBase = armourData.Evasion or 0
evasionBase = not modDB:Flag(nil, "GainNoEvasionFrom" .. slot) and armourData.Evasion or 0
if evasionBase > 0 then
if slot == "Body Armour" then
if modDB:Flag(nil, "DoubleBodyArmourDefence") then
evasionBase = evasionBase * 2
end
if modDB:Flag(nil, "Unbreakable") and modDB:Flag(nil, "IronReflexes") then
evasionBase = evasionBase * 2
end
end
output["EvasionOn"..slot] = evasionBase
end
end
Expand Down Expand Up @@ -819,11 +797,8 @@ function calcs.defence(env, actor)
local armourData = actor.itemList[slot] and actor.itemList[slot].armourData
if armourData then
slotCfg.slotName = slot
wardBase = armourData.Ward or 0
wardBase = not modDB:Flag(nil, "GainNoWardFrom" .. slot) and armourData.Ward or 0
if wardBase > 0 then
if slot == "Body Armour" and modDB:Flag(nil, "DoubleBodyArmourDefence") then
wardBase = wardBase * 2
end
if modDB:Flag(nil, "EnergyShieldToWard") then
local inc = modDB:Sum("INC", slotCfg, "Ward", "Defences", "EnergyShield")
local more = modDB:More(slotCfg, "Ward", "Defences")
Expand All @@ -847,11 +822,8 @@ function calcs.defence(env, actor)
end
end
end
energyShieldBase = armourData.EnergyShield or 0
energyShieldBase = not modDB:Flag(nil, "GainNoEnergyShieldFrom" .. slot) and armourData.EnergyShield or 0
if energyShieldBase > 0 then
if slot == "Body Armour" and modDB:Flag(nil, "DoubleBodyArmourDefence") then
energyShieldBase = energyShieldBase * 2
end
if modDB:Flag(nil, "EnergyShieldToWard") then
local more = modDB:More(slotCfg, "EnergyShield", "Defences")
energyShield = energyShield + energyShieldBase * more
Expand All @@ -873,37 +845,21 @@ function calcs.defence(env, actor)
end
end
end
armourBase = armourData.Armour or 0
armourBase = not modDB:Flag(nil, "GainNoArmourFrom" .. slot) and armourData.Armour or 0
if armourBase > 0 then
if slot == "Body Armour" then
if modDB:Flag(nil, "DoubleBodyArmourDefence") then
armourBase = armourBase * 2
end
if modDB:Flag(nil, "Unbreakable") then
armourBase = armourBase * 2
end
if modDB:Flag(nil, "ConvertBodyArmourArmourEvasionToWard") then
armourBase = armourBase * (1 - ((m_min(modDB:Sum("BASE", nil, "BodyArmourArmourEvasionToWardPercent"), 100) or 0) / 100))
end
if slot == "Body Armour" and modDB:Flag(nil, "ConvertBodyArmourArmourEvasionToWard")then
armourBase = armourBase * (1 - ((m_min(modDB:Sum("BASE", nil, "BodyArmourArmourEvasionToWardPercent"), 100) or 0) / 100))
end
armour = armour + armourBase * calcLib.mod(modDB, slotCfg, "Armour", "ArmourAndEvasion", "Defences", slot.."ESAndArmour")
gearArmour = gearArmour + armourBase
if breakdown then
breakdown.slot(slot, nil, slotCfg, armourBase, nil, "Armour", "ArmourAndEvasion", "Defences", slot.."ESAndArmour")
end
end
evasionBase = armourData.Evasion or 0
evasionBase = not modDB:Flag(nil, "GainNoEvasionFrom" .. slot) and armourData.Evasion or 0
if evasionBase > 0 then
if slot == "Body Armour" then
if modDB:Flag(nil, "DoubleBodyArmourDefence") then
evasionBase = evasionBase * 2
end
if modDB:Flag(nil, "Unbreakable") and ironReflexes then
evasionBase = evasionBase * 2
end
if modDB:Flag(nil, "ConvertBodyArmourArmourEvasionToWard") then
evasionBase = evasionBase * (1 - ((m_min(modDB:Sum("BASE", nil, "BodyArmourArmourEvasionToWardPercent"), 100) or 0) / 100))
end
if slot == "Body Armour" and modDB:Flag(nil, "ConvertBodyArmourArmourEvasionToWard")then
evasionBase = evasionBase * (1 - ((m_min(modDB:Sum("BASE", nil, "BodyArmourArmourEvasionToWardPercent"), 100) or 0) / 100))
end
gearEvasion = gearEvasion + evasionBase
if breakdown then
Expand Down
23 changes: 21 additions & 2 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,13 @@ function calcs.offence(env, actor, activeSkill)
skillModList:NewMod("CritChance", "INC", output.SpellSuppressionChance, mod.source)
break
end

end
if skillModList:Flag(nil, "FirePenIncreasedByUncappedFireRes") then
for i, value in ipairs(modDB:Tabulate("FLAG", nil, "FirePenIncreasedByUncappedFireRes")) do
local mod = value.mod
skillModList:NewMod("FirePenetration", "BASE", output.FireResistOverCap, mod.source)
break
end
end
if skillModList:Flag(nil, "LightRadiusAppliesToAccuracy") then
-- Light Radius conversion from Corona Solaris
Expand Down Expand Up @@ -5471,8 +5477,21 @@ function calcs.offence(env, actor, activeSkill)
return dmgBreakdown, totalDmgTaken
end
end,
["Enmity's Embrace"] = function(activeSkill, output, breakdown)
local dmgType, dmgVal
for _, value in ipairs(activeSkill.skillModList:List(nil, "EnmitysEmbraceSelfDamage")) do -- Combines dmg taken from both rings accounting for catalysts
dmgVal = (dmgVal or 0) + value.baseDamage
dmgType = string.gsub(" "..value.damageType, "%W%l", string.upper):sub(2) -- This assumes both rings deal the same damage type
end
if dmgType and dmgVal then
local dmgBreakdown, totalDmgTaken = calcs.applyDmgTakenConversion(activeSkill, output, breakdown, dmgType, dmgVal)
t_insert(dmgBreakdown, 1, s_format("Enmity's Embrace base damage: %d", dmgVal))
t_insert(dmgBreakdown, 2, s_format(""))
t_insert(dmgBreakdown, s_format("Total Enmity's Embrace damage taken per cast/attack: %.2f ", totalDmgTaken))
return dmgBreakdown, totalDmgTaken
end
end
}

for _, sourceFunc in pairs(nameToHandler) do
local selfHitBreakdown, dmgTaken = sourceFunc(activeSkill, output, breakdown)
if dmgTaken then
Expand Down
6 changes: 5 additions & 1 deletion src/Modules/CalcPerform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,11 @@ local function doActorMisc(env, actor)
modDB.conditions["AffectedByArcaneSurge"] = true
local effect = 1 + modDB:Sum("INC", nil, "ArcaneSurgeEffect", "BuffEffectOnSelf") / 100
modDB:NewMod("ManaRegen", "INC", (modDB:Max(nil, "ArcaneSurgeManaRegen") or 30) * effect, "Arcane Surge")
modDB:NewMod("Speed", "INC", (modDB:Max(nil, "ArcaneSurgeCastSpeed") or 20) * effect, "Arcane Surge", ModFlag.Cast)
local arcaneSurgeCastSpeed = (modDB:Max(nil, "ArcaneSurgeCastSpeed") or 20) * effect
modDB:NewMod("Speed", "INC", arcaneSurgeCastSpeed, "Arcane Surge", ModFlag.Cast)
if modDB:Flag(nil, "ArcaneSurgeCastSpeedToMovementSpeed") then
modDB:NewMod("MovementSpeed", "INC", arcaneSurgeCastSpeed, "Arcane Surge")
end
local arcaneSurgeDamage = modDB:Max(nil, "ArcaneSurgeDamage") or 0
if arcaneSurgeDamage ~= 0 then modDB:NewMod("Damage", "MORE", arcaneSurgeDamage * effect, "Arcane Surge", ModFlag.Spell) end
end
Expand Down
Loading
Loading