Skip to content
Open
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
11 changes: 6 additions & 5 deletions src/Modules/CalcActiveSkill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -209,15 +209,16 @@ function calcs.copyActiveSkill(env, mode, skill)
end

-- Get weapon flags and info for given weapon
local function getWeaponFlags(env, weaponData, weaponTypes)
local function getWeaponFlags(env, weaponData, weaponTypes, skillTypeDualWieldOnly)
local info = env.data.weaponTypeInfo[weaponData.type]
if not info then
return
end
if weaponTypes then
for _, types in ipairs(weaponTypes) do
if not types[weaponData.type] and
(not weaponData.countsAsAll1H or not (types["Claw"] or types["Dagger"] or types["One Handed Axe"] or types["One Handed Mace"] or types["One Handed Sword"])) then
if weaponData.countsAsDualWielding and ((not skillTypeDualWieldOnly and (not types[weaponData.type] or not types["One Handed "..info.flag])) and (not types["One Handed "..info.flag])) -- Wings of Entropy
or (not weaponData.countsAsDualWielding and not types[weaponData.type] and (not weaponData.countsAsAll1H or not (types["Claw"] or types["Dagger"] or types["One Handed Axe"] or types["One Handed Mace"] or types["One Handed Sword"])))
then
return nil, info
end
end
Expand Down Expand Up @@ -304,7 +305,7 @@ function calcs.buildActiveSkillModList(env, activeSkill)
t_insert(weaponTypes, skillEffect.grantedEffect.weaponTypes)
end
end
local weapon1Flags, weapon1Info = getWeaponFlags(env, activeSkill.actor.weaponData1, weaponTypes)
local weapon1Flags, weapon1Info = getWeaponFlags(env, activeSkill.actor.weaponData1, weaponTypes, skillTypes[SkillType.DualWieldOnly])
if not weapon1Flags and activeSkill.summonSkill then
-- Minion skills seem to ignore weapon types
weapon1Flags, weapon1Info = ModFlag[env.data.weaponTypeInfo["None"].flag], env.data.weaponTypeInfo["None"]
Expand All @@ -325,7 +326,7 @@ function calcs.buildActiveSkillModList(env, activeSkill)
activeSkill.disableReason = "Main Hand weapon is not usable with this skill"
end
if not skillTypes[SkillType.MainHandOnly] and not skillFlags.forceMainHand then
local weapon2Flags, weapon2Info = getWeaponFlags(env, activeSkill.actor.weaponData2, weaponTypes)
local weapon2Flags, weapon2Info = getWeaponFlags(env, activeSkill.actor.weaponData2, weaponTypes, skillTypes[SkillType.DualWieldOnly])
if weapon2Flags then
if skillTypes[SkillType.DualWieldRequiresDifferentTypes] and (activeSkill.actor.weaponData1.type == activeSkill.actor.weaponData2.type) then
-- Skill requires a different compatible off hand weapon to main hand weapon
Expand Down