Skip to content

Commit 15987b0

Browse files
author
LocalIdentity
committed
Add support for Companionship Support
Uses the minion count code to see if more than one minion type exists and if it does then the support no longer grants it's affect to the minion Was unsure if we wanted to also then limit the max count for that minion in the sidebar too but I don't think it really matters
1 parent 7e38600 commit 15987b0

4 files changed

Lines changed: 45 additions & 0 deletions

File tree

src/Data/Skills/sup_dex.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1417,6 +1417,14 @@ skills["SupportCompanionship"] = {
14171417
addSkillTypes = { },
14181418
excludeSkillTypes = { SkillType.MinionsAreUndamagable, SkillType.Triggered, },
14191419
statDescriptionScope = "gem_stat_descriptions",
1420+
statMap = {
1421+
["support_companionship_minion_maximum_life_+%_final_if_at_most_one_minion"] = {
1422+
mod("MinionModifier", "LIST", { mod = mod("Life", "MORE", nil) }, 0, 0, { type = "Condition", var = "OnlyMinion" }),
1423+
},
1424+
["damage_removed_from_minions_before_life_or_es_%_if_only_one_minion"] = {
1425+
mod("takenFromMinionBeforeYou", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true }),
1426+
},
1427+
},
14201428
qualityStats = {
14211429
{ "minion_maximum_life_+%", 1 },
14221430
},

src/Export/Skills/sup_dex.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,14 @@ local skills, mod, flag, skill = ...
179179
#mods
180180

181181
#skill SupportCompanionship
182+
statMap = {
183+
["support_companionship_minion_maximum_life_+%_final_if_at_most_one_minion"] = {
184+
mod("MinionModifier", "LIST", { mod = mod("Life", "MORE", nil) }, 0, 0, { type = "Condition", var = "OnlyMinion" }),
185+
},
186+
["damage_removed_from_minions_before_life_or_es_%_if_only_one_minion"] = {
187+
mod("takenFromMinionBeforeYou", "BASE", nil, 0, 0, { type = "GlobalEffect", effectType = "Buff", unscalable = true }),
188+
},
189+
},
182190
#mods
183191

184192
#skill SupportCriticalStrikeAffliction

src/Modules/CalcDefence.lua

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,9 @@ function calcs.reducePoolsByDamage(poolTable, damageTable, actor)
175175
if output.FrostShieldLife then
176176
alliesTakenBeforeYou["frostShield"] = { remaining = output.FrostShieldLife, percent = output.FrostShieldDamageMitigation / 100 }
177177
end
178+
if output.TotalMinionLife then
179+
alliesTakenBeforeYou["minion"] = { remaining = output.TotalMinionLife, percent = output.MinionAllyDamageMitigation / 100 }
180+
end
178181
if output.TotalSpectreLife then
179182
alliesTakenBeforeYou["spectres"] = { remaining = output.TotalSpectreLife, percent = output.SpectreAllyDamageMitigation / 100 }
180183
end
@@ -418,6 +421,9 @@ local function incomingDamageBreakdown(breakdownTable, poolsRemaining, output)
418421
if output.FrostShieldLife and output.FrostShieldLife > 0 then
419422
t_insert(breakdownTable, s_format("\t%d "..colorCodes.GEM.."Frost Shield Life ^7(%d remaining)", output.FrostShieldLife - poolsRemaining.AlliesTakenBeforeYou["frostShield"].remaining, poolsRemaining.AlliesTakenBeforeYou["frostShield"].remaining))
420423
end
424+
if output.TotalMinionLife and output.TotalMinionLife > 0 then
425+
t_insert(breakdownTable, s_format("\t%d "..colorCodes.GEM.."Total Minion Life ^7(%d remaining)", output.TotalMinionLife - poolsRemaining.AlliesTakenBeforeYou["minion"].remaining, poolsRemaining.AlliesTakenBeforeYou["minion"].remaining))
426+
end
421427
if output.TotalSpectreLife and output.TotalSpectreLife > 0 then
422428
t_insert(breakdownTable, s_format("\t%d "..colorCodes.GEM.."Total Spectre Life ^7(%d remaining)", output.TotalSpectreLife - poolsRemaining.AlliesTakenBeforeYou["spectres"].remaining, poolsRemaining.AlliesTakenBeforeYou["spectres"].remaining))
423429
end
@@ -2445,6 +2451,12 @@ function calcs.buildDefenceEstimations(env, actor)
24452451
}
24462452
end
24472453

2454+
-- from Minion
2455+
output["MinionAllyDamageMitigation"] = modDB:Sum("BASE", nil, "takenFromMinionBeforeYou")
2456+
if output["MinionAllyDamageMitigation"] ~= 0 then
2457+
output["TotalMinionLife"] = modDB:Sum("BASE", nil, "Multiplier:MinionLife")
2458+
end
2459+
24482460
-- from spectres
24492461
output["SpectreAllyDamageMitigation"] = modDB:Sum("BASE", nil, "takenFromSpectresBeforeYou")
24502462
if output["SpectreAllyDamageMitigation"] ~= 0 then
@@ -2562,6 +2574,9 @@ function calcs.buildDefenceEstimations(env, actor)
25622574
if output.FrostShieldLife then
25632575
alliesTakenBeforeYou["frostShield"] = { remaining = output.FrostShieldLife, percent = output.FrostShieldDamageMitigation / 100 }
25642576
end
2577+
if output.TotalMinionLife then
2578+
alliesTakenBeforeYou["minion"] = { remaining = output.TotalMinionLife, percent = output.MinionAllyDamageMitigation / 100 }
2579+
end
25652580
if output.TotalSpectreLife then
25662581
alliesTakenBeforeYou["spectres"] = { remaining = output.TotalSpectreLife, percent = output.SpectreAllyDamageMitigation / 100 }
25672582
end
@@ -3123,6 +3138,11 @@ function calcs.buildDefenceEstimations(env, actor)
31233138
local poolProtected = output["FrostShieldLife"] / (output["FrostShieldDamageMitigation"] / 100) * (1 - output["FrostShieldDamageMitigation"] / 100)
31243139
output[damageType.."TotalHitPool"] = m_max(output[damageType.."TotalHitPool"] - poolProtected, 0) + m_min(output[damageType.."TotalHitPool"], poolProtected) / (1 - output["FrostShieldDamageMitigation"] / 100)
31253140
end
3141+
-- minions
3142+
if output["TotalMinionLife"] and output["TotalMinionLife"] > 0 then
3143+
local poolProtected = output["TotalMinionLife"] / (output["MinionAllyDamageMitigation"] / 100) * (1 - output["MinionAllyDamageMitigation"] / 100)
3144+
output[damageType.."TotalHitPool"] = m_max(output[damageType.."TotalHitPool"] - poolProtected, 0) + m_min(output[damageType.."TotalHitPool"], poolProtected) / (1 - output["MinionAllyDamageMitigation"] / 100)
3145+
end
31263146
-- spectres
31273147
if output["TotalSpectreLife"] and output["TotalSpectreLife"] > 0 then
31283148
local poolProtected = output["TotalSpectreLife"] / (output["SpectreAllyDamageMitigation"] / 100) * (1 - output["SpectreAllyDamageMitigation"] / 100)
@@ -3764,6 +3784,10 @@ function calcs.buildDefenceEstimations(env, actor)
37643784
resourcesLostSum = resourcesLostSum + resourcesLost.frostShield
37653785
t_insert(breakdownTable, s_format("\t%d "..colorCodes.GEM.."Frost Shield Life", resourcesLost.frostShield))
37663786
end
3787+
if resourcesLost.minion then
3788+
resourcesLostSum = resourcesLostSum + resourcesLost.minion
3789+
t_insert(breakdownTable, s_format("\t%d "..colorCodes.GEM.."Total Minion Life", resourcesLost.minion))
3790+
end
37673791
if resourcesLost.spectres then
37683792
resourcesLostSum = resourcesLostSum + resourcesLost.spectres
37693793
t_insert(breakdownTable, s_format("\t%d "..colorCodes.GEM.."Total Spectre Life", resourcesLost.spectres))

src/Modules/CalcPerform.lua

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,6 +1338,7 @@ function calcs.perform(env, skipEHP)
13381338
env.player.modDB:NewMod("Multiplier:NonVaalSummonedMinion", "BASE", output[activeSkill.minion.minionData.limit], "Config", { type = "Condition", var = "Combat" })
13391339
end
13401340
minionCount[activeSkill.minion.minionData.limit] = true
1341+
t_insert(minionCount, activeSkill.minion.minionData.limit)
13411342
end
13421343
end
13431344
if activeSkill.skillTypes[SkillType.CreatesMinion] and not activeSkill.skillTypes[SkillType.MinionsAreUndamagable] then
@@ -1370,6 +1371,10 @@ function calcs.perform(env, skipEHP)
13701371
end
13711372
end
13721373

1374+
if #minionCount == 1 then
1375+
modDB.conditions["OnlyMinion"] = true
1376+
end
1377+
13731378
-- Special Rarity / Quantity Calc for Bisco's
13741379
local lootQuantityNormalEnemies = modDB:Sum("INC", nil, "LootQuantityNormalEnemies")
13751380
output.LootQuantityNormalEnemies = (lootQuantityNormalEnemies > 0) and lootQuantityNormalEnemies + modDB:Sum("INC", nil, "LootQuantity") or 0

0 commit comments

Comments
 (0)