Exemplo n.º 1
0
        public void CheckEXBuffs()
        {
            if (m_EquipmentDirty)
            {
                m_EquipmentDirty = false;

                if (null == mSkEntity)
                {
                    return;
                }

                if (null != m_EXBuffs)
                {
                    for (int i = 0; i < m_EXBuffs.Count; ++i)
                    {
                        mSkEntity.CancelBuffById(m_EXBuffs[i]);
                    }
                }

                m_EXBuffs.Clear();
                m_SuitSetMatchDatas.Clear();

                EquipSetData.GetSuitSetEffect(_ItemList, ref m_EXBuffs);
                SuitSetData.GetSuitSetEffect(_ItemList, ref m_EXBuffs, ref m_SuitSetMatchDatas);

                for (int i = 0; i < m_EXBuffs.Count; ++i)
                {
                    SkEntity.MountBuff(mSkEntity, m_EXBuffs[i], null, null);
                }

                if (null != onSuitSetChange)
                {
                    onSuitSetChange(m_SuitSetMatchDatas);
                }
            }
        }
Exemplo n.º 2
0
    public static void HarmAdd(List <int> tmp)
    {
        if (tmp.Count != 3)
        {
            return;
        }
        List <PeEntity> currentDst;
        int             dst = 0;

        switch (tmp[1])
        {
        case 1:
            currentDst = new List <PeEntity>(EntityMgr.Instance.All);
            currentDst = currentDst.FindAll(delegate(PeEntity e)
            {
                if (e == null)
                {
                    return(false);
                }
                if (e.proto == EEntityProto.Monster && e.entityProto.protoId == tmp[2])
                {
                    return(true);
                }
                return(false);
            });
            dst = tmp[2];
            break;

        case 2:
            currentDst = new List <PeEntity>();
            PeEntity fixEntity = SceneEntityCreatorArchiver.Instance.GetEntityByFixedSpId(tmp[2]);
            if (fixEntity != null)
            {
                currentDst.Add(SceneEntityCreatorArchiver.Instance.GetEntityByFixedSpId(tmp[2]));
            }
            dst = tmp[2] + fixMonsBase;
            break;

        case 3:
            if (tmp[2] == mainPlayer)
            {
                currentDst = new List <PeEntity>();
                currentDst.Add(PeCreature.Instance.mainPlayer);
            }
            else if (tmp[2] == allNpcs)
            {
                currentDst = new List <PeEntity>(EntityMgr.Instance.All);
                currentDst = currentDst.FindAll(delegate(PeEntity e)
                {
                    if (e == null)
                    {
                        return(false);
                    }
                    if (e.proto == EEntityProto.Npc || e.proto == EEntityProto.RandomNpc)
                    {
                        return(true);
                    }
                    return(false);
                });
                currentDst.Add(PeCreature.Instance.mainPlayer);
            }
            else
            {
                currentDst = new List <PeEntity>();
                currentDst.Add(EntityMgr.Instance.Get(tmp[2]));
            }
            break;

        default:
            currentDst = new List <PeEntity>();
            break;
        }
        if (tmp[0] == 1)
        {
            foreach (PeEntity item in currentDst)
            {
                SkEntity skEntity = item.aliveEntity;
                if (skEntity != null)
                {
                    SkEntity.MountBuff(skEntity, 30200102, new List <int>(), new List <float>());
                }
            }
            if (!entityHarmRecord.Contains(dst) && dst != 0)
            {
                if (entityHarmRecord.Count == 0)
                {
                    MonsterEntityCreator.commonCreateEvent += SetHarm;
                }
                entityHarmRecord.Add(dst);
            }
        }
        else if (tmp[0] == 0)
        {
            foreach (PeEntity item in currentDst)
            {
                SkEntity skEntity = item.aliveEntity;
                if (skEntity != null)
                {
                    skEntity.CancelBuffById(30200102);
                }
            }
            if (entityHarmRecord.Contains(dst) && dst != 0)
            {
                entityHarmRecord.Remove(dst);
                if (entityHarmRecord.Count == 0)
                {
                    MonsterEntityCreator.commonCreateEvent -= SetHarm;
                }
            }
        }
    }