Exemplo n.º 1
0
        private void RemoveBuffByIndex(Int32 p_index)
        {
            PartyBuff            partyBuff = m_buffs[p_index];
            BuffRemovedEventArgs item      = new BuffRemovedEventArgs(LegacyLogic.Instance.WorldManager.Party, partyBuff);

            m_logEntries.Add(item);
            m_buffs.RemoveAt(p_index);
            LegacyLogic.Instance.EventManager.InvokeEvent(partyBuff, EEventType.PARTY_BUFF_REMOVED, EventArgs.Empty);
        }
Exemplo n.º 2
0
        public void Load(SaveGameData p_data)
        {
            m_buffs.Clear();
            Int32 num = p_data.Get <Int32>("Count", 0);

            for (Int32 i = 0; i < num; i++)
            {
                SaveGameData saveGameData = p_data.Get <SaveGameData>("Buff" + i, null);
                if (saveGameData != null)
                {
                    PartyBuff partyBuff = new PartyBuff();
                    partyBuff.Load(saveGameData);
                    m_buffs.Add(partyBuff);
                }
            }
        }
Exemplo n.º 3
0
        public void AddBuff(EPartyBuffs p_buffId, Single p_valueFactor)
        {
            if (HasBuff(p_buffId))
            {
                PartyBuff buff = GetBuff(p_buffId);
                buff.ResetDuration(p_valueFactor);
                if (m_buffsToRemove.Contains(buff))
                {
                    m_buffsToRemove.Remove(buff);
                }
                return;
            }
            PartyBuff partyBuff = new PartyBuff();

            partyBuff.Init(p_buffId, p_valueFactor);
            m_buffs.Add(partyBuff);
            LegacyLogic.Instance.EventManager.InvokeEvent(partyBuff, EEventType.PARTY_BUFF_ADDED, EventArgs.Empty);
            if (p_buffId != EPartyBuffs.DANGER_SENSE && p_buffId != EPartyBuffs.TORCHLIGHT && p_buffId != EPartyBuffs.LIGHT_ORB && p_buffId != EPartyBuffs.DARK_VISION && p_buffId != EPartyBuffs.CLAIRVOYANCE)
            {
                LegacyLogic.Instance.CharacterBarkHandler.RandomPartyMemberBark(EBarks.PARTY_BUFF);
            }
        }
Exemplo n.º 4
0
        public Boolean HasActiveBuff(EPartyBuffs p_buffId)
        {
            if (m_buffs.Count == 0)
            {
                return(false);
            }
            PartyBuff buff = GetBuff(p_buffId);

            if (buff == null)
            {
                return(false);
            }
            for (Int32 i = m_buffsToRemove.Count - 1; i >= 0; i--)
            {
                if (m_buffsToRemove[i].StaticData.StaticID == (Int32)p_buffId)
                {
                    return(false);
                }
            }
            m_buffsToRemove.Add(buff);
            return(true);
        }
Exemplo n.º 5
0
 public void RequestBuffCancel(PartyBuff p_buff)
 {
     LegacyLogic.Instance.EventManager.InvokeEvent(p_buff, EEventType.PARTY_REQUEST_BUFF_CANCEL, EventArgs.Empty);
 }