Skip to content

Commit 16656fc

Browse files
cupkaxLocalIdentity
andauthored
Add support for Atziri's Communion support gem (#2303)
* Add support for Atziri's Communion support gem Supports Persistent Skills by reserving Life instead of Spirit. * Simplify calc and add test * Fix ModCache test * Fix alphabetical order --------- Co-authored-by: LocalIdentity <localidentity2@gmail.com>
1 parent 1bc1685 commit 16656fc

7 files changed

Lines changed: 95 additions & 13 deletions

File tree

spec/System/TestSkills_spec.lua

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,23 @@ describe("TestSkills", function()
129129
assert.True(build.calcsTab.mainOutput.SpiritReservedPercent > oneCurseReservation)
130130
end)
131131

132+
it("applies life reservation efficiency to Atziri's Communion Blasphemy reservation", function()
133+
build.skillsTab:PasteSocketGroup("Blasphemy 20/0 1\nDespair 20/0 1\nAtziri's Communion 1/0 1\n")
134+
runCallback("OnFrame")
135+
136+
assert.are.equals(0, build.calcsTab.mainOutput.SpiritReserved)
137+
assert.are.equals(0, build.calcsTab.mainOutput.SpiritReservedPercent)
138+
assert.are.equals(26, build.calcsTab.mainOutput.LifeReserved)
139+
assert.are.equals(40, build.calcsTab.mainOutput.LifeReservedPercent)
140+
141+
build.configTab.input.customMods = "100% increased Life Reservation Efficiency"
142+
build.configTab:BuildModList()
143+
runCallback("OnFrame")
144+
145+
assert.are.equals(13, build.calcsTab.mainOutput.LifeReserved)
146+
assert.are.equals(20, build.calcsTab.mainOutput.LifeReservedPercent)
147+
end)
148+
132149
it("rounds Blasphemy curse magnitudes to the nearest integer", function()
133150
build.configTab.input.customMods = "79% increased Curse Magnitudes"
134151
build.configTab.input.enemyIsBoss = "None"

src/Data/Gems.lua

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17432,6 +17432,25 @@ return {
1743217432
Tier = 0,
1743317433
naturalMaxLevel = 1,
1743417434
},
17435+
["Metadata/Items/Gems/SkillGemAtzirisCommunionSupport"] = {
17436+
name = "Atziri's Communion",
17437+
gameId = "Metadata/Items/Gem/SupportGemAtzirisCommunion",
17438+
variantId = "AtzirisCommunionSupport",
17439+
grantedEffectId = "SupportAtzirisCommunionPlayer",
17440+
tags = {
17441+
support = true,
17442+
lineage = true,
17443+
persistent = true,
17444+
},
17445+
gemType = "Support",
17446+
gemFamily = "Atziri's Communion",
17447+
tagString = "Lineage, Persistent",
17448+
reqStr = 0,
17449+
reqDex = 0,
17450+
reqInt = 100,
17451+
Tier = 0,
17452+
naturalMaxLevel = 1,
17453+
},
1743517454
["Metadata/Items/Gems/SkillGemAtzirisImpatienceSupport"] = {
1743617455
name = "Atziri's Impatience",
1743717456
gameId = "Metadata/Items/Gem/SupportGemAtzirisImpatience",

src/Data/ModCache.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,6 @@ c["100% increased Thorns damage if you've consumed an Endurance Charge Recently"
13871387
c["100% increased amount of Life Leeched"]={{[1]={flags=0,keywordFlags=0,name="MaxLifeLeechRate",type="INC",value=100}},nil}
13881388
c["100% increased chance to Shock"]={{[1]={flags=0,keywordFlags=0,name="EnemyShockChance",type="INC",value=100}},nil}
13891389
c["100% increased effect of Socketed Augment Items"]={{[1]={flags=0,keywordFlags=0,name="SocketedAugmentItemEffect",type="INC",value=100}},nil}
1390-
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 "}
13911390
c["100% increased effect of Socketed Soul Cores"]={{[1]={flags=0,keywordFlags=0,name="SocketedSoulCoreEffect",type="INC",value=100}},nil}
13921391
c["100% increased maximum Divinity"]={{}," maximum Divinity "}
13931392
c["100% increased maximum Divinity 20% reduced maximum Divinity per Corrupted Item Equipped"]={{}," maximum Divinity 20% reduced maximum Divinity per Corrupted Item Equipped "}
@@ -3448,6 +3447,7 @@ c["75% increased Physical Damage"]={{[1]={flags=0,keywordFlags=0,name="PhysicalD
34483447
c["75% increased Spirit"]={{[1]={flags=0,keywordFlags=0,name="Spirit",type="INC",value=75}},nil}
34493448
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}
34503449
c["75% increased chance to Shock"]={{[1]={flags=0,keywordFlags=0,name="EnemyShockChance",type="INC",value=75}},nil}
3450+
c["75% increased effect of Socketed Augment Items"]={{[1]={flags=0,keywordFlags=0,name="SocketedAugmentItemEffect",type="INC",value=75}},nil}
34513451
c["75% of Damage Converted to Fire Damage"]={{[1]={flags=0,keywordFlags=0,name="DamageConvertToFire",type="BASE",value=75}},nil}
34523452
c["75% reduced Amount Recovered"]={{[1]={flags=0,keywordFlags=0,name="FlaskRecovery",type="INC",value=-75}},nil}
34533453
c["75% reduced Charges per use"]={{[1]={flags=0,keywordFlags=0,name="FlaskChargesUsed",type="INC",value=-75}},nil}

src/Data/SkillStatMap.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,10 @@ return {
179179
["base_skill_reserve_life_instead_of_mana"] = {
180180
flag("BloodMagicReserved"),
181181
},
182+
["skill_reserves_X_life_permyriad_per_spirit_instead_of_spirit"] = {
183+
mod("LifeReservePercentPerSpirit", "BASE", nil),
184+
div = 100,
185+
},
182186
["base_skill_cost_life_instead_of_mana"] = {
183187
flag("CostLifeInsteadOfMana"),
184188
},

src/Data/Skills/sup_int.lua

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -694,6 +694,38 @@ skills["SupportAtzirisAllurePlayer"] = {
694694
},
695695
}
696696
}
697+
skills["SupportAtzirisCommunionPlayer"] = {
698+
name = "Atziri's Communion",
699+
description = "Supports Persistent Skills, making them Reserve Life instead of Spirit. Cannot Support Skills which create Minions.",
700+
color = 3,
701+
support = true,
702+
requireSkillTypes = { SkillType.Persistent, },
703+
addSkillTypes = { },
704+
excludeSkillTypes = { SkillType.CreatesMinion, },
705+
gemFamily = { "AtziriCommunionLineage",},
706+
isLineage = true,
707+
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.", },
708+
levels = {
709+
[1] = { levelRequirement = 0, },
710+
},
711+
statSets = {
712+
[1] = {
713+
label = "Atziri's Communion",
714+
incrementalEffectiveness = 0.054999999701977,
715+
statDescriptionScope = "gem_stat_descriptions",
716+
baseFlags = {
717+
},
718+
constantStats = {
719+
{ "skill_reserves_X_life_permyriad_per_spirit_instead_of_spirit", 66 },
720+
},
721+
stats = {
722+
},
723+
levels = {
724+
[1] = { actorLevel = 1, },
725+
},
726+
},
727+
}
728+
}
697729
skills["SupportBhatairsVengeancePlayer"] = {
698730
name = "Bhatair's Vengeance",
699731
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. ",

src/Export/Skills/sup_int.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ statMap = {
117117
#mods
118118
#skillEnd
119119

120+
#skill SupportAtzirisCommunionPlayer
121+
#set SupportAtzirisCommunionPlayer
122+
#mods
123+
#skillEnd
124+
120125
#skill SupportBhatairsVengeancePlayer
121126
#set SupportBhatairsVengeancePlayer
122127
#mods

src/Modules/CalcDefence.lua

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,16 @@ function calcs.doActorLifeManaSpiritReservation(actor)
225225
pool.Life.baseFlat = skillModList:Sum("BASE", skillCfg, "LifeCostBase") + (activeSkill.activeEffect.grantedEffectLevel.cost.Life or 0)
226226
end
227227
pool.Life.basePercent = activeSkill.skillData.lifeReservationPercent or activeSkill.activeEffect.grantedEffectLevel.lifeReservationPercent or 0
228+
if activeSkill.skillTypes[SkillType.IsBlasphemy] and activeSkill.activeEffect.srcInstance.supportEffect and activeSkill.activeEffect.srcInstance.supportEffect.isSupporting then
229+
-- Sadly no better way to get key/val table element count in lua.
230+
local instances = 0
231+
for _ in pairs(activeSkill.activeEffect.srcInstance.supportEffect.isSupporting) do
232+
instances = instances + 1
233+
end
234+
for name, values in pairs(pool) do
235+
values.baseFlat = values.baseFlat + (activeSkill.skillData["blasphemyReservationFlat" .. name] or 0) * instances
236+
end
237+
end
228238
if skillModList:Flag(skillCfg, "BloodMagicReserved") then
229239
pool.Life.baseFlat = pool.Life.baseFlat + pool.Mana.baseFlat
230240
pool.Mana.baseFlat = 0
@@ -235,6 +245,13 @@ function calcs.doActorLifeManaSpiritReservation(actor)
235245
activeSkill.skillData["LifeReservationPercentForced"] = activeSkill.skillData["ManaReservationPercentForced"]
236246
activeSkill.skillData["ManaReservationPercentForced"] = nil
237247
end
248+
local spiritToLifeReservation = skillModList:Sum("BASE", skillCfg, "LifeReservePercentPerSpirit")
249+
if spiritToLifeReservation > 0 then
250+
pool.Life.basePercent = pool.Life.basePercent + pool.Spirit.baseFlat * spiritToLifeReservation
251+
pool.Spirit.baseFlat = 0
252+
pool.Life.basePercent = pool.Life.basePercent + pool.Spirit.basePercent * spiritToLifeReservation
253+
pool.Spirit.basePercent = 0
254+
end
238255
for name, values in pairs(pool) do
239256
values.more = skillModList:More(skillCfg, name.."Reserved", "Reserved")
240257
values.inc = skillModList:Sum("INC", skillCfg, name.."Reserved", "Reserved")
@@ -269,18 +286,6 @@ function calcs.doActorLifeManaSpiritReservation(actor)
269286
values.count = activeSkillCount
270287
local minionFreeSpiritCount = skillModList:Sum("BASE", skillCfg, "MinionFreeSpiritCount")
271288
values.reservedFlat = values.reservedFlat * m_max(activeSkillCount - minionFreeSpiritCount, 0)
272-
end
273-
if activeSkill.skillTypes[SkillType.IsBlasphemy] and activeSkill.activeEffect.srcInstance.supportEffect and activeSkill.activeEffect.srcInstance.supportEffect.isSupporting and activeSkill.skillData["blasphemyReservationFlat" .. name] then
274-
-- Sadly no better way to get key/val table element count in lua.
275-
local instances = 0
276-
for _ in pairs(activeSkill.activeEffect.srcInstance.supportEffect.isSupporting) do
277-
instances = instances + 1
278-
end
279-
280-
-- Extra reservation of blasphemy needs to be separated from the reservation caused by curses
281-
local blasphemyFlat = activeSkill.skillData["blasphemyReservationFlat" .. name]
282-
local blasphemyEffectiveFlat = m_max(round(blasphemyFlat * mult * (100 + values.inc) / 100 * values.more / (1 + values.efficiency / 100) / values.efficiencyMore, 0), 0)
283-
values.reservedFlat = values.reservedFlat + blasphemyEffectiveFlat * instances
284289
end
285290
-- Blood Sacrament increases reservation per stage channelled
286291
if activeSkill.skillCfg.skillName == "Blood Sacrament" and activeSkill.activeStageCount then

0 commit comments

Comments
 (0)