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
18 changes: 15 additions & 3 deletions src/Modules/CalcActiveSkill.lua
Original file line number Diff line number Diff line change
Expand Up @@ -786,10 +786,16 @@ function calcs.buildActiveSkillModList(env, activeSkill)
local minion = { }
activeSkill.minion = minion
skillFlags.haveMinion = true
minion.parent = env.player
minion.enemy = env.enemy
minion.type = minionType
minion.minionData = env.data.minions[minionType]
minion.hostile = minion.minionData and minion.minionData.hostile or false
if minion.hostile then
minion.parent = env.enemy
minion.enemy = env.player
else
minion.parent = env.player
minion.enemy = env.enemy
end
minion.level = activeSkill.skillData.minionLevelIsEnemyLevel and env.enemyLevel or
activeSkill.skillData.minionLevelIsTriggeredSkillLevel and activeEffect.srcInstance.supportEffect and activeEffect.srcInstance.supportEffect.activeSkillLevel and data.minionLevelTable[activeEffect.srcInstance.supportEffect.activeSkillLevel] or
activeSkill.skillData.minionLevelIsPlayerLevel and (m_min(env.build and env.build.characterLevel or activeSkill.skillData.minionLevel or activeEffect.grantedEffectLevel.levelRequirement, activeSkill.skillData.minionLevelIsPlayerLevel)) or
Expand All @@ -799,8 +805,14 @@ function calcs.buildActiveSkillModList(env, activeSkill)
minion.itemList = { }
minion.uses = activeGrantedEffect.minionUses
minion.lifeTable = env.data.monsterAllyLifeTable
if minion.minionData.hostile then
minion.lifeTable = env.data.monsterLifeTable
else
minion.lifeTable = env.data.monsterAllyLifeTable
end
local attackTime = minion.minionData.attackTime
local damage = (isSpectre and env.data.monsterDamageTable[minion.level] or env.data.monsterAllyDamageTable[minion.level]) * minion.minionData.damage
local damageTable = (isSpectre or minion.minionData.hostile) and env.data.monsterDamageTable or env.data.monsterAllyDamageTable
local damage = damageTable[minion.level] * minion.minionData.damage
if not minion.minionData.baseDamageIgnoresAttackSpeed then -- minions with this flag do not factor attack time into their base damage
damage = damage * attackTime
end
Expand Down
34 changes: 24 additions & 10 deletions src/Modules/CalcPerform.lua
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,11 @@ function calcs.perform(env, skipEHP)
env.minion.output = output.Minion
env.minion.modDB.multipliers["Level"] = env.minion.level
calcs.initModDB(env, env.minion.modDB)
env.minion.modDB:NewMod("Life", "BASE", m_floor(env.minion.lifeTable[env.minion.level] * env.minion.minionData.life), "Base")
local baseLife = env.minion.lifeTable[env.minion.level] * env.minion.minionData.life
if env.minion.hostile then
baseLife = baseLife * (env.data.mapLevelLifeMult[env.enemyLevel] or 1)
end
env.minion.modDB:NewMod("Life", "BASE", m_floor(baseLife), "Base")
if env.minion.minionData.energyShield then
env.minion.modDB:NewMod("LifeConvertToEnergyShield", "BASE", env.minion.minionData.energyShield * 100, "Base")
end
Expand Down Expand Up @@ -1491,14 +1495,24 @@ function calcs.perform(env, skipEHP)
-- Calculate attributes
doActorAttribsConditions(env, env.player)
if env.minion then
for _, value in ipairs(env.player.mainSkill.skillModList:List(env.player.mainSkill.skillCfg, "MinionModifier")) do
if not value.type or env.minion.type == value.type then
env.minion.modDB:AddMod(value.mod)
if env.minion.hostile then
for _, value in ipairs(env.modDB:Tabulate(nil, nil, "EnemyModifier")) do
local mod = value.value and value.value.mod
if mod then
local copy = copyTable(mod, true)
env.minion.modDB:AddMod(modLib.setSource(copy, mod.source or value.mod.source))
end
end
end
for _, name in ipairs(env.minion.modDB:List(nil, "Keystone")) do
if env.spec.tree.keystoneMap[name] then
env.minion.modDB:AddList(env.spec.tree.keystoneMap[name].modList)
else
for _, value in ipairs(env.player.mainSkill.skillModList:List(env.player.mainSkill.skillCfg, "MinionModifier")) do
if not value.type or env.minion.type == value.type then
env.minion.modDB:AddMod(value.mod)
end
end
for _, name in ipairs(env.minion.modDB:List(nil, "Keystone")) do
if env.spec.tree.keystoneMap[name] then
env.minion.modDB:AddList(env.spec.tree.keystoneMap[name].modList)
end
end
end
doActorAttribsConditions(env, env.minion)
Expand Down Expand Up @@ -1754,7 +1768,7 @@ function calcs.perform(env, skipEHP)
buffs[buff.name].notBuff = true
end
end
if env.minion and (buff.applyMinions or buff.applyAllies or skillModList:Flag(nil, "BuffAppliesToAllies") and not env.minion.modDB:Flag(nil, "HiddenMonster")) then
if env.minion and not env.minion.hostile and (buff.applyMinions or buff.applyAllies or skillModList:Flag(nil, "BuffAppliesToAllies") and not env.minion.modDB:Flag(nil, "HiddenMonster")) then
activeSkill.minionBuffSkill = true
env.minion.modDB.conditions["AffectedBy"..buff.name:gsub(" ","")] = true
local srcList = new("ModList")
Expand Down Expand Up @@ -1896,7 +1910,7 @@ function calcs.perform(env, skipEHP)
end
end
if not (modDB:Flag(nil, "SelfAurasCannotAffectAllies") or modDB:Flag(nil, "SelfAurasOnlyAffectYou") or modDB:Flag(nil, "SelfAuraSkillsCannotAffectAllies")) then
if env.minion and not env.minion.modDB:Flag(nil, "HiddenMonster") then
if env.minion and (not env.minion.hostile or modDB:Flag(nil, "AurasAffectEnemies")) and not env.minion.modDB:Flag(nil, "HiddenMonster") then
local inc = skillModList:Sum("INC", skillCfg, "AuraEffect", "BuffEffect") + env.minion.modDB:Sum("INC", skillCfg, "BuffEffectOnSelf", "AuraEffectOnSelf")
local more = skillModList:More(skillCfg, "AuraEffect", "BuffEffect") * env.minion.modDB:More(skillCfg, "BuffEffectOnSelf", "AuraEffectOnSelf") * calcLib.mod(skillModList, skillCfg, "Magnitude")
local mult = (1 + inc / 100) * more
Expand Down
Loading