public static MonsterBuff CreateMonsterBuff(EMonsterBuffType p_type, Single p_castersMagicFactor, Int32 p_level) { MonsterBuff monsterBuff = CreateMonsterBuff(p_type, p_castersMagicFactor); monsterBuff.Level = p_level; monsterBuff.ResetDuration(); return(monsterBuff); }
public void RemoveBuff(MonsterBuff p_buff) { if (m_buffList.Remove(p_buff)) { LegacyLogic.Instance.EventManager.InvokeEvent(p_buff, EEventType.MONSTER_BUFF_REMOVED, new MonsterBuffUpdateEventArgs(m_owner)); if (p_buff is MonsterBuffHourOfJustice) { m_owner.MagicPowerModifier = 1f; m_owner.AttackValueModifier = 1f; m_owner.SpellHandler.UpdateMagicPower(); } } }
public void RemoveFlaggedBuffs() { for (Int32 i = m_buffsToRemove.Count - 1; i >= 0; i--) { MonsterBuff monsterBuff = m_buffsToRemove[i]; if (monsterBuff.DelayedDamage != null) { m_owner.ApplyDamages(monsterBuff.DelayedDamage, monsterBuff.Causer); LegacyLogic.Instance.EventManager.InvokeEvent(m_owner, EEventType.MONSTER_BUFF_PERFORM, new BuffPerformedEventArgs(monsterBuff, monsterBuff.DelayedDamage)); } RemoveBuff(monsterBuff); m_buffsToRemove.RemoveAt(i); } m_buffsToRemove.Clear(); }
public void AddBuff(MonsterBuff p_buff) { Boolean flag = true; if (m_owner.AbilityHandler.CanAddBuff(p_buff)) { if (HasBuff(p_buff)) { for (Int32 i = m_buffList.Count - 1; i >= 0; i--) { if (m_buffList[i].Type == p_buff.Type) { if (m_buffList[i].Stackable) { m_buffList[i].Stack(p_buff, m_owner); flag = false; LegacyLogic.Instance.EventManager.InvokeEvent(m_buffList[i], EEventType.MONSTER_BUFF_CHANGED, new MonsterBuffUpdateEventArgs(m_owner)); } else { flag = false; m_buffList[i].ResetDuration(); LegacyLogic.Instance.EventManager.InvokeEvent(m_buffList[i], EEventType.MONSTER_BUFF_CHANGED, new MonsterBuffUpdateEventArgs(m_owner)); } } } } if (!flag) { return; } m_buffList.Add(p_buff); p_buff.DoImmediateEffect(m_owner); LegacyLogic.Instance.EventManager.InvokeEvent(p_buff, EEventType.MONSTER_BUFF_ADDED, new MonsterBuffUpdateEventArgs(m_owner)); } else { LegacyLogic.Instance.EventManager.InvokeEvent(p_buff, EEventType.MONSTER_BUFF_CANNOT_BE_APPLIED, new MonsterBuffUpdateEventArgs(m_owner)); } }
public void FlagForRemoval(MonsterBuff p_buff) { m_buffsToRemove.Add(p_buff); }
public Boolean HasBuff(MonsterBuff p_buff) { return(m_buffList.Contains(p_buff)); }