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
17 changes: 17 additions & 0 deletions spec/System/TestSkills_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,23 @@ describe("TestSkills", function()
assert.True(build.calcsTab.mainOutput.SpiritReservedPercent > oneCurseReservation)
end)

it("applies life reservation efficiency to Atziri's Communion Blasphemy reservation", function()
build.skillsTab:PasteSocketGroup("Blasphemy 20/0 1\nDespair 20/0 1\nAtziri's Communion 1/0 1\n")
runCallback("OnFrame")

assert.are.equals(0, build.calcsTab.mainOutput.SpiritReserved)
assert.are.equals(0, build.calcsTab.mainOutput.SpiritReservedPercent)
assert.are.equals(26, build.calcsTab.mainOutput.LifeReserved)
assert.are.equals(40, build.calcsTab.mainOutput.LifeReservedPercent)

build.configTab.input.customMods = "100% increased Life Reservation Efficiency"
build.configTab:BuildModList()
runCallback("OnFrame")

assert.are.equals(13, build.calcsTab.mainOutput.LifeReserved)
assert.are.equals(20, build.calcsTab.mainOutput.LifeReservedPercent)
end)

it("rounds Blasphemy curse magnitudes to the nearest integer", function()
build.configTab.input.customMods = "79% increased Curse Magnitudes"
build.configTab.input.enemyIsBoss = "None"
Expand Down
19 changes: 19 additions & 0 deletions src/Data/Gems.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17432,6 +17432,25 @@ return {
Tier = 0,
naturalMaxLevel = 1,
},
["Metadata/Items/Gems/SkillGemAtzirisCommunionSupport"] = {
name = "Atziri's Communion",
gameId = "Metadata/Items/Gem/SupportGemAtzirisCommunion",
variantId = "AtzirisCommunionSupport",
grantedEffectId = "SupportAtzirisCommunionPlayer",
tags = {
support = true,
lineage = true,
persistent = true,
},
gemType = "Support",
gemFamily = "Atziri's Communion",
tagString = "Lineage, Persistent",
reqStr = 0,
reqDex = 0,
reqInt = 100,
Tier = 0,
naturalMaxLevel = 1,
},
["Metadata/Items/Gems/SkillGemAtzirisImpatienceSupport"] = {
name = "Atziri's Impatience",
gameId = "Metadata/Items/Gem/SupportGemAtzirisImpatience",
Expand Down
2 changes: 1 addition & 1 deletion src/Data/ModCache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1387,7 +1387,6 @@ c["100% increased Thorns damage if you've consumed an Endurance Charge Recently"
c["100% increased amount of Life Leeched"]={{[1]={flags=0,keywordFlags=0,name="MaxLifeLeechRate",type="INC",value=100}},nil}
c["100% increased chance to Shock"]={{[1]={flags=0,keywordFlags=0,name="EnemyShockChance",type="INC",value=100}},nil}
c["100% increased effect of Socketed Augment Items"]={{[1]={flags=0,keywordFlags=0,name="SocketedAugmentItemEffect",type="INC",value=100}},nil}
c["100% increased effect of Socketed Augment Items This item gains bonuses from Socketed Items as though it was a Body Armour"]={{[1]={flags=0,keywordFlags=0,name="SocketedAugmentItemEffect",type="INC",value=100}}," This item gains bonuses from Socketed Items as though it was a Body Armour "}
c["100% increased effect of Socketed Soul Cores"]={{[1]={flags=0,keywordFlags=0,name="SocketedSoulCoreEffect",type="INC",value=100}},nil}
c["100% increased maximum Divinity"]={{}," maximum Divinity "}
c["100% increased maximum Divinity 20% reduced maximum Divinity per Corrupted Item Equipped"]={{}," maximum Divinity 20% reduced maximum Divinity per Corrupted Item Equipped "}
Expand Down Expand Up @@ -3448,6 +3447,7 @@ c["75% increased Physical Damage"]={{[1]={flags=0,keywordFlags=0,name="PhysicalD
c["75% increased Spirit"]={{[1]={flags=0,keywordFlags=0,name="Spirit",type="INC",value=75}},nil}
c["75% increased Thorns damage if you've Blocked Recently"]={{[1]={[1]={type="Condition",var="BlockedRecently"},flags=32,keywordFlags=0,name="Damage",type="INC",value=75}},nil}
c["75% increased chance to Shock"]={{[1]={flags=0,keywordFlags=0,name="EnemyShockChance",type="INC",value=75}},nil}
c["75% increased effect of Socketed Augment Items"]={{[1]={flags=0,keywordFlags=0,name="SocketedAugmentItemEffect",type="INC",value=75}},nil}
c["75% of Damage Converted to Fire Damage"]={{[1]={flags=0,keywordFlags=0,name="DamageConvertToFire",type="BASE",value=75}},nil}
c["75% reduced Amount Recovered"]={{[1]={flags=0,keywordFlags=0,name="FlaskRecovery",type="INC",value=-75}},nil}
c["75% reduced Charges per use"]={{[1]={flags=0,keywordFlags=0,name="FlaskChargesUsed",type="INC",value=-75}},nil}
Expand Down
4 changes: 4 additions & 0 deletions src/Data/SkillStatMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,10 @@ return {
["base_skill_reserve_life_instead_of_mana"] = {
flag("BloodMagicReserved"),
},
["skill_reserves_X_life_permyriad_per_spirit_instead_of_spirit"] = {
mod("LifeReservePercentPerSpirit", "BASE", nil),
div = 100,
},
["base_skill_cost_life_instead_of_mana"] = {
flag("CostLifeInsteadOfMana"),
},
Expand Down
32 changes: 32 additions & 0 deletions src/Data/Skills/sup_int.lua
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,38 @@ skills["SupportAtzirisAllurePlayer"] = {
},
}
}
skills["SupportAtzirisCommunionPlayer"] = {
name = "Atziri's Communion",
description = "Supports Persistent Skills, making them Reserve Life instead of Spirit. Cannot Support Skills which create Minions.",
color = 3,
support = true,
requireSkillTypes = { SkillType.Persistent, },
addSkillTypes = { },
excludeSkillTypes = { SkillType.CreatesMinion, },
gemFamily = { "AtziriCommunionLineage",},
isLineage = true,
flavourText = {"The Red Communion was meant to transcend the limits", "of the soul, to transfigure the flesh, to bestow immortality.", "It accomplished all of these things... most horribly.", },
levels = {
[1] = { levelRequirement = 0, },
},
statSets = {
[1] = {
label = "Atziri's Communion",
incrementalEffectiveness = 0.054999999701977,
statDescriptionScope = "gem_stat_descriptions",
baseFlags = {
},
constantStats = {
{ "skill_reserves_X_life_permyriad_per_spirit_instead_of_spirit", 66 },
},
stats = {
},
levels = {
[1] = { actorLevel = 1, },
},
},
}
}
skills["SupportBhatairsVengeancePlayer"] = {
name = "Bhatair's Vengeance",
description = "Supports Attacks and Warcries you use yourself. Freezing an enemy with Supported Skills infuses you and your allies with Cold damage for a short time. ",
Expand Down
5 changes: 5 additions & 0 deletions src/Export/Skills/sup_int.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ statMap = {
#mods
#skillEnd

#skill SupportAtzirisCommunionPlayer
#set SupportAtzirisCommunionPlayer
#mods
#skillEnd

#skill SupportBhatairsVengeancePlayer
#set SupportBhatairsVengeancePlayer
#mods
Expand Down
29 changes: 17 additions & 12 deletions src/Modules/CalcDefence.lua
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,16 @@ function calcs.doActorLifeManaSpiritReservation(actor)
pool.Life.baseFlat = skillModList:Sum("BASE", skillCfg, "LifeCostBase") + (activeSkill.activeEffect.grantedEffectLevel.cost.Life or 0)
end
pool.Life.basePercent = activeSkill.skillData.lifeReservationPercent or activeSkill.activeEffect.grantedEffectLevel.lifeReservationPercent or 0
if activeSkill.skillTypes[SkillType.IsBlasphemy] and activeSkill.activeEffect.srcInstance.supportEffect and activeSkill.activeEffect.srcInstance.supportEffect.isSupporting then
-- Sadly no better way to get key/val table element count in lua.
local instances = 0
for _ in pairs(activeSkill.activeEffect.srcInstance.supportEffect.isSupporting) do
instances = instances + 1
end
for name, values in pairs(pool) do
values.baseFlat = values.baseFlat + (activeSkill.skillData["blasphemyReservationFlat" .. name] or 0) * instances
end
end
if skillModList:Flag(skillCfg, "BloodMagicReserved") then
pool.Life.baseFlat = pool.Life.baseFlat + pool.Mana.baseFlat
pool.Mana.baseFlat = 0
Expand All @@ -235,6 +245,13 @@ function calcs.doActorLifeManaSpiritReservation(actor)
activeSkill.skillData["LifeReservationPercentForced"] = activeSkill.skillData["ManaReservationPercentForced"]
activeSkill.skillData["ManaReservationPercentForced"] = nil
end
local spiritToLifeReservation = skillModList:Sum("BASE", skillCfg, "LifeReservePercentPerSpirit")
if spiritToLifeReservation > 0 then
pool.Life.basePercent = pool.Life.basePercent + pool.Spirit.baseFlat * spiritToLifeReservation
pool.Spirit.baseFlat = 0
pool.Life.basePercent = pool.Life.basePercent + pool.Spirit.basePercent * spiritToLifeReservation
pool.Spirit.basePercent = 0
end
for name, values in pairs(pool) do
values.more = skillModList:More(skillCfg, name.."Reserved", "Reserved")
values.inc = skillModList:Sum("INC", skillCfg, name.."Reserved", "Reserved")
Expand Down Expand Up @@ -269,18 +286,6 @@ function calcs.doActorLifeManaSpiritReservation(actor)
values.count = activeSkillCount
local minionFreeSpiritCount = skillModList:Sum("BASE", skillCfg, "MinionFreeSpiritCount")
values.reservedFlat = values.reservedFlat * m_max(activeSkillCount - minionFreeSpiritCount, 0)
end
if activeSkill.skillTypes[SkillType.IsBlasphemy] and activeSkill.activeEffect.srcInstance.supportEffect and activeSkill.activeEffect.srcInstance.supportEffect.isSupporting and activeSkill.skillData["blasphemyReservationFlat" .. name] then
-- Sadly no better way to get key/val table element count in lua.
local instances = 0
for _ in pairs(activeSkill.activeEffect.srcInstance.supportEffect.isSupporting) do
instances = instances + 1
end

-- Extra reservation of blasphemy needs to be separated from the reservation caused by curses
local blasphemyFlat = activeSkill.skillData["blasphemyReservationFlat" .. name]
local blasphemyEffectiveFlat = m_max(round(blasphemyFlat * mult * (100 + values.inc) / 100 * values.more / (1 + values.efficiency / 100) / values.efficiencyMore, 0), 0)
values.reservedFlat = values.reservedFlat + blasphemyEffectiveFlat * instances
end
-- Blood Sacrament increases reservation per stage channelled
if activeSkill.skillCfg.skillName == "Blood Sacrament" and activeSkill.activeStageCount then
Expand Down
Loading