Skip to content

Commit

Permalink
Initial spellblade support
Browse files Browse the repository at this point in the history
  • Loading branch information
Lilylicious committed Aug 15, 2023
1 parent 02729e4 commit c4a6dd6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
23 changes: 20 additions & 3 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -515,13 +515,30 @@ function calcs.offence(env, actor, activeSkill)

-- account for Battlemage
-- Note: we check conditions of Main Hand weapon using actor.itemList as actor.weaponData1 is populated with unarmed values when no weapon slotted.
if skillModList:Flag(nil, "WeaponDamageAppliesToSpells") and actor.itemList["Weapon 1"] and actor.itemList["Weapon 1"].weaponData and actor.itemList["Weapon 1"].weaponData[1] then
-- the multiplier below exist for future possible extension of Battlemage modifiers
local multiplier = (skillModList:Max(skillCfg, "ImprovedWeaponDamageAppliesToSpells") or 100) / 100
if skillModList:Flag(nil, "Battlemage") and actor.itemList["Weapon 1"] and actor.itemList["Weapon 1"].weaponData and actor.itemList["Weapon 1"].weaponData[1] then

local multiplier = (skillModList:Max(skillCfg, "MainHandWeaponDamageAppliesToSpells") or 100) / 100
for _, damageType in ipairs(dmgTypeList) do
skillModList:NewMod(damageType.."Min", "BASE", (actor.weaponData1[damageType.."Min"] or 0) * multiplier, "Battlemage", ModFlag.Spell)
skillModList:NewMod(damageType.."Max", "BASE", (actor.weaponData1[damageType.."Max"] or 0) * multiplier, "Battlemage", ModFlag.Spell)
end
end
local weapon1info = env.data.weaponTypeInfo[actor.weaponData1.type]
local weapon2info = env.data.weaponTypeInfo[actor.weaponData2.type]
-- account for Spellblade
-- Note: we check conditions of Main Hand weapon using actor.itemList as actor.weaponData1 is populated with unarmed values when no weapon slotted.
if skillModList:Flag(nil, "Spellblade") and actor.itemList["Weapon 1"] and actor.itemList["Weapon 1"].weaponData and actor.itemList["Weapon 1"].weaponData[1] and weapon1info.melee and weapon1info.oneHand then
local multiplier = (skillModList:Max(skillCfg, "OneHandWeaponDamageAppliesToSpells") or 100) / 100 * (weapon2info and 0.6 or 1)
for _, damageType in ipairs(dmgTypeList) do
skillModList:NewMod(damageType.."Min", "BASE", (actor.weaponData1[damageType.."Min"] or 0) * multiplier, "Spellblade", ModFlag.Spell)
skillModList:NewMod(damageType.."Max", "BASE", (actor.weaponData1[damageType.."Max"] or 0) * multiplier, "Spellblade", ModFlag.Spell)
end
if weapon2info then
for _, damageType in ipairs(dmgTypeList) do
skillModList:NewMod(damageType.."Min", "BASE", (actor.weaponData2[damageType.."Min"] or 0) * multiplier, "Spellblade", ModFlag.Spell)
skillModList:NewMod(damageType.."Max", "BASE", (actor.weaponData2[damageType.."Max"] or 0) * multiplier, "Spellblade", ModFlag.Spell)
end
end
end
if skillModList:Flag(nil, "MinionDamageAppliesToPlayer") or skillModList:Flag(skillCfg, "MinionDamageAppliesToPlayer") then
-- Minion Damage conversion from Spiritual Aid and The Scourge
Expand Down
3 changes: 2 additions & 1 deletion src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4348,7 +4348,8 @@ local specialModList = {
} end,
["allocates (.+) if you have the matching modifiers? on forbidden (.+)"] = function(_, ascendancy, side) return { mod("GrantedAscendancyNode", "LIST", { side = side, name = ascendancy }) } end,
["allocates (.+)"] = function(_, passive) return { mod("GrantedPassive", "LIST", passive) } end,
["battlemage"] = { flag("WeaponDamageAppliesToSpells"), mod("ImprovedWeaponDamageAppliesToSpells", "MAX", 100) },
["battlemage"] = { flag("Battlemage"), mod("MainHandWeaponDamageAppliesToSpells", "MAX", 100) },
["added spell damage equal to (%d+)%% of damage of equipped one handed melee weapons"] = function(num) return { flag("Spellblade"), mod("OneHandWeaponDamageAppliesToSpells", "MAX", num) } end,
["transfiguration of body"] = { flag("TransfigurationOfBody") },
["transfiguration of mind"] = { flag("TransfigurationOfMind") },
["transfiguration of soul"] = { flag("TransfigurationOfSoul") },
Expand Down

0 comments on commit c4a6dd6

Please sign in to comment.