Skip to content

Commit

Permalink
Fix added cooldown and added cast time not working correctly (#6728)
Browse files Browse the repository at this point in the history
* FIX: addedCooldown and addedCastTime

* FIX: regen mod cache

---------

Co-authored-by: LocalIdentity <[email protected]>
  • Loading branch information
Paliak and LocalIdentity authored Jan 23, 2024
1 parent 741d176 commit 8807b61
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 212 deletions.
2 changes: 1 addition & 1 deletion src/Data/ModCache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10603,7 +10603,7 @@ c["Socketed Projectile Spells deal 150% more Damage with Hits"]={{[1]={[1]={slot
c["Socketed Projectile Spells fire 4 additional Projectiles"]={{[1]={[1]={slotName="{SlotName}",type="SocketedIn"},flags=0,keywordFlags=0,name="ExtraSkillMod",type="LIST",value={mod={[1]={skillType=3,type="SkillType"},[2]={skillType=2,type="SkillType"},flags=0,keywordFlags=0,name="ProjectileCount",type="BASE",value=4}}}},nil}
c["Socketed Projectile Spells fire Projectiles in a circle"]={nil,"Projectiles in a circle "}
c["Socketed Projectile Spells fire Projectiles in a circle Socketed Projectile Spells have 80% less Skill Effect Duration"]={nil,"Projectiles in a circle Socketed Projectile Spells have 80% less Skill Effect Duration "}
c["Socketed Projectile Spells have +4 seconds to Cooldown"]={{[1]={[1]={slotName="{SlotName}",type="SocketedIn"},[2]={skillType=3,type="SkillType"},[3]={skillType=2,type="SkillType"},flags=0,keywordFlags=0,name="ExtraSkillMod",type="LIST",value={mod={flags=0,keywordFlags=0,name="SkillData",type="LIST",value={key="cooldown",value=0}}}},[2]={[1]={slotName="{SlotName}",type="SocketedIn"},[2]={skillType=3,type="SkillType"},[3]={skillType=2,type="SkillType"},flags=0,keywordFlags=0,name="CooldownRecovery",type="BASE",value=4}},nil}
c["Socketed Projectile Spells have +4 seconds to Cooldown"]={{[1]={[1]={slotName="{SlotName}",type="SocketedIn"},[2]={skillType=3,type="SkillType"},[3]={skillType=2,type="SkillType"},flags=0,keywordFlags=0,name="CooldownRecovery",type="BASE",value=4}},nil}
c["Socketed Projectile Spells have 80% less Skill Effect Duration"]={{[1]={[1]={slotName="{SlotName}",type="SocketedIn"},flags=0,keywordFlags=0,name="ExtraSkillMod",type="LIST",value={mod={[1]={skillType=3,type="SkillType"},[2]={skillType=2,type="SkillType"},flags=0,keywordFlags=0,name="Duration",type="MORE",value=-80}}}},nil}
c["Socketed Red Gems get 10% Physical Damage as Extra Fire Damage"]={{[1]={[1]={keyword="strength",slotName="{SlotName}",type="SocketedIn"},flags=0,keywordFlags=0,name="ExtraSkillMod",type="LIST",value={mod={flags=0,keywordFlags=0,name="PhysicalDamageGainAsFire",type="BASE",value=10}}}},nil}
c["Socketed Skill Gems get a 80% Cost & Reservation Multiplier"]={{[1]={[1]={slotName="{SlotName}",type="SocketedIn"},flags=0,keywordFlags=0,name="ExtraSkillMod",type="LIST",value={mod={flags=0,keywordFlags=0,name="SupportManaMultiplier",type="MORE",value=-20}}}},nil}
Expand Down
4 changes: 2 additions & 2 deletions src/Data/Skills/sup_str.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2134,14 +2134,14 @@ skills["AvengingFlame"] = {
baseTypeName = "Avenging Flame",
color = 1,
description = "Launches a fiery projectile high into the air, to drop on a target and deal area damage where it lands.",
skillTypes = { [SkillType.Spell] = true, [SkillType.Damage] = true, [SkillType.Area] = true, [SkillType.AreaSpell] = true, [SkillType.Fire] = true, [SkillType.ProjectileNumber] = true, [SkillType.ProjectileSpeed] = true, [SkillType.Triggerable] = true, [SkillType.SkillGrantedBySupport] = true, [SkillType.Triggered] = true, [SkillType.InbuiltTrigger] = true, [SkillType.SummonsTotem] = true, },
skillTypes = { [SkillType.Spell] = true, [SkillType.Damage] = true, [SkillType.Area] = true, [SkillType.AreaSpell] = true, [SkillType.Fire] = true, [SkillType.ProjectileNumber] = true, [SkillType.ProjectileSpeed] = true, [SkillType.Triggerable] = true, [SkillType.SkillGrantedBySupport] = true, [SkillType.Triggered] = true, [SkillType.InbuiltTrigger] = true, [SkillType.SummonsTotem] = true, [SkillType.Projectile] = true, },
statDescriptionScope = "debuff_skill_stat_descriptions",
castTime = 1,
preDamageFunc = function(activeSkill, output)
local uuid = activeSkill.skillData.triggerSourceUUID
local cache = uuid and GlobalCache.cachedData["CACHE"][uuid]
local totemLife = cache and cache.Env.player.output.TotemLife or 0

local add = totemLife * activeSkill.skillData.lifeDealtAsFire / 100
activeSkill.skillData.FireMax = (activeSkill.skillData.FireMax or 0) + add
activeSkill.skillData.FireMin = (activeSkill.skillData.FireMin or 0) + add
Expand Down
4 changes: 2 additions & 2 deletions src/Export/Skills/sup_str.txt
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,13 @@ local skills, mod, flag, skill = ...
},
#mods

#addSkillTypes SummonsTotem
#addSkillTypes SummonsTotem Projectile
#skill AvengingFlame
preDamageFunc = function(activeSkill, output)
local uuid = activeSkill.skillData.triggerSourceUUID
local cache = uuid and GlobalCache.cachedData["CACHE"][uuid]
local totemLife = cache and cache.Env.player.output.TotemLife or 0

local add = totemLife * activeSkill.skillData.lifeDealtAsFire / 100
activeSkill.skillData.FireMax = (activeSkill.skillData.FireMax or 0) + add
activeSkill.skillData.FireMin = (activeSkill.skillData.FireMin or 0) + add
Expand Down
11 changes: 6 additions & 5 deletions src/Modules/CalcOffence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,16 @@ end

function calcSkillCooldown(skillModList, skillCfg, skillData)
local cooldownOverride = skillModList:Override(skillCfg, "CooldownRecovery")
local cooldown = cooldownOverride or (skillData.cooldown + skillModList:Sum("BASE", skillCfg, "CooldownRecovery")) / m_max(0, calcLib.mod(skillModList, skillCfg, "CooldownRecovery"))
local addedCooldown = skillModList:Sum("BASE", skillCfg, "CooldownRecovery")
local cooldown = cooldownOverride or ((skillData.cooldown or 0) + addedCooldown) / m_max(0, calcLib.mod(skillModList, skillCfg, "CooldownRecovery"))
-- If a skill can store extra uses and has a cooldown, it doesn't round the cooldown value to server ticks
local rounded = false
if (skillData.storedUses and skillData.storedUses > 1) or (skillData.VaalStoredUses and skillData.VaalStoredUses > 1) or skillModList:Sum("BASE", skillCfg, "AdditionalCooldownUses") > 0 then
return cooldown, rounded
else
cooldown = m_ceil(cooldown * data.misc.ServerTickRate) / data.misc.ServerTickRate
rounded = true
return cooldown, rounded
return cooldown, rounded, addedCooldown
end
end

Expand Down Expand Up @@ -1128,12 +1129,12 @@ function calcs.offence(env, actor, activeSkill)
local incAreaBreakpoint, moreAreaBreakpoint, redAreaBreakpoint, lessAreaBreakpoint = calcRadiusBreakpoints(data.misc.TrapTriggerRadiusBase, incArea, moreArea)
breakdown.TrapTriggerRadius = breakdown.area(data.misc.TrapTriggerRadiusBase, areaMod, output.TrapTriggerRadius, incAreaBreakpoint, moreAreaBreakpoint, redAreaBreakpoint, lessAreaBreakpoint)
end
elseif skillData.cooldown then
local cooldown, rounded = calcSkillCooldown(skillModList, skillCfg, skillData)
elseif skillData.cooldown or skillModList:Sum("BASE", skillCfg, "CooldownRecovery") ~= 0 then
local cooldown, rounded, addedCooldown = calcSkillCooldown(skillModList, skillCfg, skillData)
output.Cooldown = cooldown
if breakdown then
breakdown.Cooldown = {
s_format("%.2fs ^8(base)", skillData.cooldown + skillModList:Sum("BASE", skillCfg, "CooldownRecovery")),
s_format("%.2fs ^8(base)", skillData.cooldown or 0 + addedCooldown),
s_format("/ %.2f ^8(increased/reduced cooldown recovery)", 1 + skillModList:Sum("INC", skillCfg, "CooldownRecovery") / 100),
}
if rounded then
Expand Down
Loading

0 comments on commit 8807b61

Please sign in to comment.