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
10 changes: 7 additions & 3 deletions src/Modules/CalcActiveSkill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,14 @@ local function checkAsThoughWeaponTypes(weaponData, weaponTypes)
end

-- Get weapon flags and info for given weapon
local function getWeaponFlags(env, weaponData, weaponTypes)
local function getWeaponFlags(env, weaponData, weaponTypes, gemTags)
local info = env.data.weaponTypeInfo[weaponData.type]
if not info then
return
end
if weaponData.cannotUseGemTag and gemTags and gemTags[weaponData.cannotUseGemTag] then
return nil, info
end
if weaponTypes then
for _, types in ipairs(weaponTypes) do
if not types[weaponData.type] and
Expand Down Expand Up @@ -379,6 +382,7 @@ function calcs.buildActiveSkillModList(env, activeSkill)
local skillTypes = activeSkill.skillTypes
local activeEffect = activeSkill.activeEffect
local activeGrantedEffect = activeEffect.grantedEffect
local gemTags = activeEffect.gemData and activeEffect.gemData.tags
local activeStatSet, skillFlags
if env.mode == "CALCS" then
activeStatSet = activeEffect.statSetCalcs.statSet
Expand Down Expand Up @@ -461,7 +465,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, gemTags)
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 @@ -483,7 +487,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, gemTags)
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
7 changes: 5 additions & 2 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,9 @@ end
---@return number
local function calcCrossbowReloadTime(weaponData, boltSkill)
local baseReloadTime = weaponData.ReloadTime
if not baseReloadTime then
return
end

local reloadTimeMulti = calcLib.mod(boltSkill.skillModList, boltSkill.skillCfg, "ReloadSpeed", "Speed" )
return baseReloadTime / reloadTimeMulti
Expand Down Expand Up @@ -2861,7 +2864,7 @@ function calcs.offence(env, actor, activeSkill)
output.Speed = m_min(output.Speed, data.misc.ServerTickRate * output.Repeats)
end
-- Crossbows: Adjust attack speed values for Crossbow skills that need to reload
if skillData.reloadTime then
if skillData.reloadTime and skillData.reloadTime > 0 then
output.FiringRate = output.Speed
output.BoltCount = skillData.boltCount
output.EffectiveBoltCount = output.BoltCount
Expand Down Expand Up @@ -2907,7 +2910,7 @@ function calcs.offence(env, actor, activeSkill)
-- Crossbows: adjust breakdown to account for effect of reload time, bolt count, etc.
-- note: if we are ever allowed to dual wield crossbows, this will need to be adjusted
-- TODO: properly reflect effects of "SkillAttackTime" mods in the breakdown. (This is also not currently done in the standard breakdown.Speed calculation)
if output.ReloadTime then
if output.ReloadTime and source.ReloadTime then
globalBreakdown.FiringRate = { }
breakdown.multiChain(globalBreakdown.FiringRate, {
base = { "%.2f ^8(base)", 1 / baseTime },
Expand Down
1 change: 1 addition & 0 deletions src/Modules/ModParser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3416,6 +3416,7 @@ local specialModList = {
} end,
["has (%d+) sockets?"] = function(num) return { mod("SocketCount", "BASE", num) } end,
["no physical damage"] = { mod("WeaponData", "LIST", { key = "PhysicalMin" }), mod("WeaponData", "LIST", { key = "PhysicalMax" }), mod("WeaponData", "LIST", { key = "PhysicalDPS" }) },
["cannot load or fire ammunition"] = { mod("WeaponData", "LIST", { key = "cannotUseGemTag", value = "ammunition" }) },
["has (%d+)%% increased elemental damage"] = function(num) return { mod("LocalElementalDamage", "INC", num) } end,
["all attacks with this weapon are critical hits"] = { mod("WeaponData", "LIST", { key = "CritChance", value = 100 }) },
["this weapon's critical hit chance is (%d+)%%"] = function(num) return { mod("WeaponData", "LIST", { key = "CritChance", value = num }) } end,
Expand Down
Loading