Пример #1
0
 void OnEventRemoveBuff(int eventID, stRemoveBuff param)
 {
     if (ClientGlobal.Instance().IsMainPlayer(param.uid))
     {
         for (int i = 0; i < mainRoleBuffList.Count; i++)
         {
             Client.stAddBuff st = (Client.stAddBuff)mainRoleBuffList[i];
             if (st.buffThisID == param.buffThisID)
             {
                 mainRoleBuffList.RemoveAt(i);
                 break;
             }
         }
         stShowBuffInfo info = new stShowBuffInfo();
         info.IsMainRole = true;
         DataManager.Manager <UIPanelManager>().SendMsg(PanelID.MainPanel, UIMsgID.stShowBuff, info);
     }
     else
     {
         for (int i = 0; i < targetBuffList.Count; i++)
         {
             Client.stAddBuff st = (Client.stAddBuff)targetBuffList[i];
             if (st.buffThisID == param.buffThisID && st.uid == param.uid)
             {
                 targetBuffList.RemoveAt(i);
                 break;
             }
         }
         stShowBuffInfo info = new stShowBuffInfo();
         info.IsMainRole = false;
         DataManager.Manager <UIPanelManager>().SendMsg(PanelID.MainPanel, UIMsgID.stShowBuff, info);
     }
 }
Пример #2
0
    void RemoveBuffByClient(Client.stAddBuff st)
    {
        stRemoveBuff sb = new stRemoveBuff();

        sb.uid        = st.uid;
        sb.buffid     = st.buffid;
        sb.buffThisID = st.buffThisID;
        BuffDataBase bdb = GameTableManager.Instance.GetTableItem <BuffDataBase>(st.buffid);

        if (bdb != null)
        {
            if (bdb.forever == 1)
            {
                return;
            }
        }

        OnEventRemoveBuff(0, sb);
    }
Пример #3
0
        void RemoveEntityBuff(uint baseID, uint thisID)
        {
            uint stateID = baseID;

            ChangeCreatureByBuff(m_Master, stateID, false);
            BuffDataBase db = GameTableManager.Instance.GetTableItem <BuffDataBase>(stateID);

            if (db != null)
            {
                if (db.dwShield == 1)
                {//不显示的直接跳过
                    return;
                }
            }
            uint         cancleBuffThisID = thisID;
            BuffDataBase baseBuffData     = GetBuffDataBase(cancleBuffThisID);

            if (baseBuffData == null)
            {
                // Log.Error("getbuffdatabase error buffthisid is " + cancleBuffThisID.ToString());
                return;
            }
            if (baseBuffData.buffRemoveEffect != 0)
            {
                if (!IsHideFx())
                {
                    EffectViewFactory.Instance().CreateEffect(m_Master.GetUID(), baseBuffData.buffRemoveEffect);
                }
            }
            if (baseBuffData.buffBigType == (int)BuffBigType.Control)
            {
                if (m_Master != null)
                {
                    //Log.Error( "buff cancle" );
                    if (!m_Master.IsDead())
                    {
                        Engine.Utility.Log.LogGroup("ZDY", " CreatureState.Normal ");
                        m_Master.ChangeState(CreatureState.Normal, null);
                    }
                    else
                    {
                        Engine.Utility.Log.LogGroup("ZDY", "CreatureState.Dead ****");
                        m_Master.ChangeState(CreatureState.Dead, null);
                    }
                }
            }
            stBuffData buffData;

            if (buffDic.TryGetValue(cancleBuffThisID, out buffData))
            {
                buffData.buffDataDic.Remove(cancleBuffThisID);
            }

            if (buffData.buffDataDic.Count <= 0)
            {
                RemoveBuffEffect(stateID, cancleBuffThisID);
                buffDic.Remove(cancleBuffThisID);


                if (m_Master != null)
                {
                    stRemoveBuff removeBuff = new stRemoveBuff();
                    removeBuff.buffid     = stateID;
                    removeBuff.uid        = m_Master.GetUID();
                    removeBuff.buffThisID = cancleBuffThisID;
                    EventEngine.Instance().DispatchEvent((int)GameEventID.BUFF_DELETETARGETBUFF, removeBuff);
                }
            }
        }