Fixed triggered buffs stacking.

Contributed by Sahar.
This commit is contained in:
MobiusDevelopment 2019-11-22 16:59:54 +00:00
parent 2eca7d1f99
commit 88a3b5b381
2 changed files with 66 additions and 60 deletions

View File

@ -1218,49 +1218,52 @@ public class EffectList
// Verify stacked skills. // Verify stacked skills.
else else
{ {
if (_stackedEffects.containsKey(skill.getAbnormalType())) synchronized (this)
{ {
BuffInfo stackedInfo = _stackedEffects.get(skill.getAbnormalType()); if (_stackedEffects.containsKey(skill.getAbnormalType()))
// Skills are only replaced if the incoming buff has greater or equal abnormal level.
if ((stackedInfo != null) && (skill.getAbnormalLvl() >= stackedInfo.getSkill().getAbnormalLvl()))
{ {
// If it is an herb, set as not in use the lesser buff. BuffInfo stackedInfo = _stackedEffects.get(skill.getAbnormalType());
// Effect will be present in the effect list. // Skills are only replaced if the incoming buff has greater or equal abnormal level.
// Effects stats are removed and onActionTime() is not called. if ((stackedInfo != null) && (skill.getAbnormalLvl() >= stackedInfo.getSkill().getAbnormalLvl()))
// But finish task continues to run, and ticks as well.
if (skill.isAbnormalInstant())
{ {
if (stackedInfo.getSkill().isAbnormalInstant()) // If it is an herb, set as not in use the lesser buff.
// Effect will be present in the effect list.
// Effects stats are removed and onActionTime() is not called.
// But finish task continues to run, and ticks as well.
if (skill.isAbnormalInstant())
{ {
stopSkillEffects(false, skill.getAbnormalType()); if (stackedInfo.getSkill().isAbnormalInstant())
stackedInfo = _stackedEffects.get(skill.getAbnormalType()); {
stopSkillEffects(false, skill.getAbnormalType());
stackedInfo = _stackedEffects.get(skill.getAbnormalType());
}
if (stackedInfo != null)
{
stackedInfo.setInUse(false);
// Remove stats
stackedInfo.removeStats();
_hiddenBuffs.incrementAndGet();
}
} }
// Remove buff that will stack with the abnormal type.
if (stackedInfo != null) else
{ {
stackedInfo.setInUse(false); if (stackedInfo.getSkill().isAbnormalInstant())
// Remove stats {
stackedInfo.removeStats(); stopSkillEffects(false, skill.getAbnormalType());
_hiddenBuffs.incrementAndGet(); }
stopSkillEffects(false, skill.getAbnormalType());
} }
} }
// Remove buff that will stack with the abnormal type. // If the new buff is a lesser buff, then don't add it.
else else
{ {
if (stackedInfo.getSkill().isAbnormalInstant()) return;
{
stopSkillEffects(false, skill.getAbnormalType());
}
stopSkillEffects(false, skill.getAbnormalType());
} }
} }
// If the new buff is a lesser buff, then don't add it. _stackedEffects.put(skill.getAbnormalType(), info);
else
{
return;
}
} }
_stackedEffects.put(skill.getAbnormalType(), info);
} }
// Select the map that holds the effects related to this skill. // Select the map that holds the effects related to this skill.

View File

@ -1219,49 +1219,52 @@ public class EffectList
// Verify stacked skills. // Verify stacked skills.
else else
{ {
if (_stackedEffects.containsKey(skill.getAbnormalType())) synchronized (this)
{ {
BuffInfo stackedInfo = _stackedEffects.get(skill.getAbnormalType()); if (_stackedEffects.containsKey(skill.getAbnormalType()))
// Skills are only replaced if the incoming buff has greater or equal abnormal level.
if ((stackedInfo != null) && (skill.getAbnormalLvl() >= stackedInfo.getSkill().getAbnormalLvl()))
{ {
// If it is an herb, set as not in use the lesser buff. BuffInfo stackedInfo = _stackedEffects.get(skill.getAbnormalType());
// Effect will be present in the effect list. // Skills are only replaced if the incoming buff has greater or equal abnormal level.
// Effects stats are removed and onActionTime() is not called. if ((stackedInfo != null) && (skill.getAbnormalLvl() >= stackedInfo.getSkill().getAbnormalLvl()))
// But finish task continues to run, and ticks as well.
if (skill.isAbnormalInstant())
{ {
if (stackedInfo.getSkill().isAbnormalInstant()) // If it is an herb, set as not in use the lesser buff.
// Effect will be present in the effect list.
// Effects stats are removed and onActionTime() is not called.
// But finish task continues to run, and ticks as well.
if (skill.isAbnormalInstant())
{ {
stopSkillEffects(false, skill.getAbnormalType()); if (stackedInfo.getSkill().isAbnormalInstant())
stackedInfo = _stackedEffects.get(skill.getAbnormalType()); {
stopSkillEffects(false, skill.getAbnormalType());
stackedInfo = _stackedEffects.get(skill.getAbnormalType());
}
if (stackedInfo != null)
{
stackedInfo.setInUse(false);
// Remove stats
stackedInfo.removeStats();
_hiddenBuffs.incrementAndGet();
}
} }
// Remove buff that will stack with the abnormal type.
if (stackedInfo != null) else
{ {
stackedInfo.setInUse(false); if (stackedInfo.getSkill().isAbnormalInstant())
// Remove stats {
stackedInfo.removeStats(); stopSkillEffects(false, skill.getAbnormalType());
_hiddenBuffs.incrementAndGet(); }
stopSkillEffects(false, skill.getAbnormalType());
} }
} }
// Remove buff that will stack with the abnormal type. // If the new buff is a lesser buff, then don't add it.
else else
{ {
if (stackedInfo.getSkill().isAbnormalInstant()) return;
{
stopSkillEffects(false, skill.getAbnormalType());
}
stopSkillEffects(false, skill.getAbnormalType());
} }
} }
// If the new buff is a lesser buff, then don't add it. _stackedEffects.put(skill.getAbnormalType(), info);
else
{
return;
}
} }
_stackedEffects.put(skill.getAbnormalType(), info);
} }
// Select the map that holds the effects related to this skill. // Select the map that holds the effects related to this skill.