Esempio n. 1
0
    protected void S2C_BuffUpdate(Pt _info)
    {
        pt_scene_chg_buff_c008 pt = _info as pt_scene_chg_buff_c008;

        if (pt != null)
        {
            BuffInfo bf = new BuffInfo(pt);
            switch ((ObjectType)pt.obj_sort)
            {
            case ObjectType.Player:
                if (pt.oid == GameCenter.mainPlayerMng.MainPlayerInfo.ServerInstanceID)
                {
                    GameCenter.mainPlayerMng.MainPlayerInfo.Update(bf, bf.BuffTypeID, (int)pt.oid);
                }
                else
                {
                    OtherPlayerInfo info = GameCenter.sceneMng.GetOPCInfo((int)pt.oid);
                    if (info != null)
                    {
                        info.Update(bf, bf.BuffTypeID, (int)pt.oid);
                    }
                }
                break;

            case ObjectType.MOB:
                MonsterInfo mob = GameCenter.sceneMng.GetMobInfo((int)pt.oid);
                if (mob != null)
                {
                    mob.Update(bf, bf.BuffTypeID, (int)pt.oid);
                }
                break;

            case ObjectType.Entourage:
                MercenaryInfo ent = null;
                if (GameCenter.mercenaryMng.curMercernaryInfo != null && (int)pt.oid == GameCenter.mercenaryMng.curMercernaryInfo.ServerInstanceID)
                {
                    ent = GameCenter.mercenaryMng.curMercernaryInfo;
                }
                else
                {
                    ent = GameCenter.sceneMng.GetEntourageInfo((int)pt.oid);
                }
                if (ent != null)
                {
                    ent.Update(bf, bf.BuffTypeID, (int)pt.oid);
                }
                break;

            default:
                break;
            }
        }
    }
Esempio n. 2
0
    protected void S2C_BuffDelete(Pt _info)
    {
        pt_scene_remove_buff_c009 pt = _info as pt_scene_remove_buff_c009;

        if (pt != null)
        {
            switch ((ObjectType)pt.obj_sort)
            {
            case ObjectType.Player:
                if (pt.oid == GameCenter.mainPlayerMng.MainPlayerInfo.ServerInstanceID)
                {
                    GameCenter.mainPlayerMng.MainPlayerInfo.Update(null, (int)pt.buff_type, (int)pt.oid);
                }
                else
                {
                    OtherPlayerInfo info = GameCenter.sceneMng.GetOPCInfo((int)pt.oid) as OtherPlayerInfo;
                    if (info != null)
                    {
                        info.Update(null, (int)pt.buff_type, (int)pt.oid);
                    }
                }
                break;

            case ObjectType.MOB:
                MonsterInfo mob = GameCenter.sceneMng.GetMobInfo((int)pt.oid) as MonsterInfo;
                if (mob != null)
                {
                    mob.Update(null, (int)pt.buff_type, (int)pt.oid);
                }
                break;

            case ObjectType.Entourage:
                MercenaryInfo ent = null;
                if (GameCenter.mercenaryMng.curMercernaryInfo != null && (int)pt.oid == GameCenter.mercenaryMng.curMercernaryInfo.ServerInstanceID)
                {
                    ent = GameCenter.mercenaryMng.curMercernaryInfo;
                }
                else
                {
                    ent = GameCenter.sceneMng.GetEntourageInfo((int)pt.oid);
                }
                if (ent != null)
                {
                    ent.Update(null, (int)pt.buff_type, (int)pt.oid);
                }
                break;

            default:
                break;
            }
        }
    }