Skip to content

Commit 265a2b4

Browse files
LocalIdentityLocalIdentity
andauthored
Add support for the Penance Mark minion to be treated as an enemy (#9302)
The Penance Mark minion is classified as an ally of the enemy that you curse It uses monster life scaling and also benefits from monster map life mods It doesn't use any minion scaling mods then and should only be affected by modifiers to enemies Co-authored-by: LocalIdentity <[email protected]>
1 parent d22114b commit 265a2b4

File tree

4 files changed

+47
-14
lines changed

4 files changed

+47
-14
lines changed

src/Data/Minions.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1724,6 +1724,7 @@ minions["LivingLightningMinion"] = {
17241724

17251725
minions["PenanceMarkPhantasm"] = {
17261726
name = "Shackled Phantasm",
1727+
hostile = true,
17271728
monsterTags = { "caster", "fire_affinity", "ghost", "ghost_armour", "ghost_blood", "is_unarmed", "medium_movement", "slashing_weapon", "undead", },
17281729
life = 1.3,
17291730
fireResist = 40,

src/Data/Skills/other.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2405,6 +2405,7 @@ skills["PenanceMark"] = {
24052405
},
24062406
baseMods = {
24072407
skill("debuff", true),
2408+
skill("minionLevelIsEnemyLevel", true),
24082409
},
24092410
constantStats = {
24102411
{ "base_skill_effect_duration", 3000 },

src/Modules/CalcActiveSkill.lua

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -662,20 +662,31 @@ function calcs.buildActiveSkillModList(env, activeSkill)
662662
local minion = { }
663663
activeSkill.minion = minion
664664
skillFlags.haveMinion = true
665-
minion.parent = env.player
666-
minion.enemy = env.enemy
667665
minion.type = minionType
668666
minion.minionData = env.data.minions[minionType]
667+
minion.hostile = minion.minionData and minion.minionData.hostile or false
668+
if minion.hostile then
669+
minion.parent = env.enemy
670+
minion.enemy = env.player
671+
else
672+
minion.parent = env.player
673+
minion.enemy = env.enemy
674+
end
669675
minion.level = activeSkill.skillData.minionLevelIsEnemyLevel and env.enemyLevel or
670676
activeSkill.skillData.minionLevelIsPlayerLevel and (m_min(env.build and env.build.characterLevel or activeSkill.skillData.minionLevel or activeEffect.grantedEffectLevel.levelRequirement, activeSkill.skillData.minionLevelIsPlayerLevel)) or
671677
minionSupportLevel[minion.type] or activeSkill.skillData.minionLevel or activeEffect.grantedEffectLevel.levelRequirement
672678
-- fix minion level between 1 and 100
673679
minion.level = m_min(m_max(minion.level,1),100)
674680
minion.itemList = { }
675681
minion.uses = activeGrantedEffect.minionUses
676-
minion.lifeTable = (minion.minionData.lifeScaling == "AltLife1" and env.data.monsterLifeTable2) or (minion.minionData.lifeScaling == "AltLife2" and env.data.monsterLifeTable3) or (isSpectre and env.data.monsterLifeTable) or env.data.monsterAllyLifeTable
682+
if minion.minionData.hostile then
683+
minion.lifeTable = env.data.monsterLifeTable
684+
else
685+
minion.lifeTable = (minion.minionData.lifeScaling == "AltLife1" and env.data.monsterLifeTable2) or (minion.minionData.lifeScaling == "AltLife2" and env.data.monsterLifeTable3) or (isSpectre and env.data.monsterLifeTable) or env.data.monsterAllyLifeTable
686+
end
677687
local attackTime = minion.minionData.attackTime
678-
local damage = (isSpectre and env.data.monsterDamageTable[minion.level] or env.data.monsterAllyDamageTable[minion.level]) * minion.minionData.damage
688+
local damageTable = (isSpectre or minion.minionData.hostile) and env.data.monsterDamageTable or env.data.monsterAllyDamageTable
689+
local damage = damageTable[minion.level] * minion.minionData.damage
679690
if not minion.minionData.baseDamageIgnoresAttackSpeed then -- minions with this flag do not factor attack time into their base damage
680691
damage = damage * attackTime
681692
end

src/Modules/CalcPerform.lua

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,9 +1088,18 @@ function calcs.perform(env, skipEHP)
10881088
env.minion.output = output.Minion
10891089
env.minion.modDB.multipliers["Level"] = env.minion.level
10901090
calcs.initModDB(env, env.minion.modDB)
1091-
env.minion.modDB:NewMod("Life", "BASE", m_floor(env.minion.lifeTable[env.minion.level] * env.minion.minionData.life), "Base")
1091+
local baseLife = env.minion.lifeTable[env.minion.level] * env.minion.minionData.life
1092+
if env.minion.hostile then
1093+
baseLife = baseLife * (env.data.mapLevelLifeMult[env.enemyLevel] or 1)
1094+
end
1095+
env.minion.modDB:NewMod("Life", "BASE", m_floor(baseLife), "Base")
10921096
if env.minion.minionData.energyShield then
1093-
env.minion.modDB:NewMod("EnergyShield", "BASE", m_floor(env.data.monsterAllyLifeTable[env.minion.level] * env.minion.minionData.life * env.minion.minionData.energyShield), "Base")
1097+
local esTable = env.minion.hostile and env.minion.lifeTable or env.data.monsterAllyLifeTable
1098+
local baseES = esTable[env.minion.level] * env.minion.minionData.life * env.minion.minionData.energyShield
1099+
if env.minion.hostile then
1100+
baseES = baseES * (env.data.mapLevelLifeMult[env.enemyLevel] or 1)
1101+
end
1102+
env.minion.modDB:NewMod("EnergyShield", "BASE", m_floor(baseES), "Base")
10941103
end
10951104
--Armour formula is math.floor((10 + 2 * level) * 1.067 ^ level)
10961105
env.minion.modDB:NewMod("Armour", "BASE", round(env.data.monsterArmourTable[env.minion.level] * (env.minion.minionData.armour or 1)), "Base")
@@ -1713,14 +1722,25 @@ function calcs.perform(env, skipEHP)
17131722
doActorAttribsConditions(env, env.player)
17141723
doActorLifeMana(env.player)
17151724
if env.minion then
1716-
for _, value in ipairs(env.player.mainSkill.skillModList:List(env.player.mainSkill.skillCfg, "MinionModifier")) do
1717-
if not value.type or env.minion.type == value.type then
1718-
env.minion.modDB:AddMod(value.mod)
1725+
if env.minion.hostile then
1726+
for _, value in ipairs(env.modDB:Tabulate(nil, nil, "EnemyModifier")) do
1727+
local mod = value.value and value.value.mod
1728+
if mod then
1729+
local copy = copyTable(mod, true)
1730+
env.minion.modDB:AddMod(modLib.setSource(copy, mod.source or value.mod.source))
1731+
end
17191732
end
17201733
end
1721-
for _, name in ipairs(env.minion.modDB:List(nil, "Keystone")) do
1722-
if env.spec.tree.keystoneMap[name] then
1723-
env.minion.modDB:AddList(env.spec.tree.keystoneMap[name].modList)
1734+
if not env.minion.hostile then
1735+
for _, value in ipairs(env.player.mainSkill.skillModList:List(env.player.mainSkill.skillCfg, "MinionModifier")) do
1736+
if not value.type or env.minion.type == value.type then
1737+
env.minion.modDB:AddMod(value.mod)
1738+
end
1739+
end
1740+
for _, name in ipairs(env.minion.modDB:List(nil, "Keystone")) do
1741+
if env.spec.tree.keystoneMap[name] then
1742+
env.minion.modDB:AddList(env.spec.tree.keystoneMap[name].modList)
1743+
end
17241744
end
17251745
end
17261746
doActorAttribsConditions(env, env.minion)
@@ -2057,7 +2077,7 @@ function calcs.perform(env, skipEHP)
20572077
buffs[buff.name].notBuff = true
20582078
end
20592079
end
2060-
if env.minion and (buff.applyMinions or buff.applyAllies or skillModList:Flag(nil, "BuffAppliesToAllies")) then
2080+
if env.minion and not env.minion.hostile and (buff.applyMinions or buff.applyAllies or skillModList:Flag(nil, "BuffAppliesToAllies")) then
20612081
activeSkill.minionBuffSkill = true
20622082
env.minion.modDB.conditions["AffectedBy"..buff.name:gsub(" ","")] = true
20632083
local srcList = new("ModList")
@@ -2202,7 +2222,7 @@ function calcs.perform(env, skipEHP)
22022222
end
22032223
end
22042224
if not (modDB:Flag(nil, "SelfAurasCannotAffectAllies") or modDB:Flag(nil, "SelfAurasOnlyAffectYou") or modDB:Flag(nil, "SelfAuraSkillsCannotAffectAllies") ) then
2205-
if env.minion then
2225+
if env.minion and (not env.minion.hostile or modDB:Flag(nil, "AurasAffectEnemies")) then
22062226
local inc = skillModList:Sum("INC", skillCfg, "AuraEffect", "BuffEffect") + env.minion.modDB:Sum("INC", skillCfg, "BuffEffectOnSelf", "AuraEffectOnSelf")
22072227
local more = skillModList:More(skillCfg, "AuraEffect", "BuffEffect") * env.minion.modDB:More(skillCfg, "BuffEffectOnSelf", "AuraEffectOnSelf")
22082228
local mult = (1 + inc / 100) * more

0 commit comments

Comments
 (0)