Example #1
0
    //获取指定id的涂鸦在目前所有涂鸦墙中使用的数量
    public int GetBadgeUseCountInAllSlots(uint badgeId, uint bookId)
    {
        int       count = 0;
        BadgeBook book  = GetBadgeBookByBookId(bookId);

        if (book != null)
        {
            foreach (BadgeSlot slot in book.slot_list)
            {
                if (slot.badge_id != 0 && slot.badge_id == badgeId)
                {
                    count++;
                }
            }
        }
        return(count);
    }
    public bool ValidateBadgeSlotEquiped(string arg)
    {
        string[]  tokens = arg.Split(',');
        uint      bookID = uint.Parse(tokens[0]);
        uint      slotID = uint.Parse(tokens[1]);
        BadgeBook books  = MainPlayer.Instance.badgeSystemInfo.GetBadgeBookByBookId(bookID);

        if (books == null)
        {
            Debug.LogError("ValidateBadgeSlotEquiped, error book ID:" + bookID);
        }
        BadgeSlot slot = books.slot_list.Find((s) => s.id == slotID);

        if (slot == null)
        {
            Debug.LogError("ValidateBadgeSlotEquiped, error slot ID:" + bookID + " " + slotID);
        }
        return(slot.status == BadgeSlotStatus.UNLOCK && slot.badge_id != 0);
    }
Example #3
0
    public int GetBookProvideTotalBadgeLevelByBookId(uint bookId)
    {
        BadgeBook           book       = GetBadgeBookByBookId(bookId);
        int                 totalLevel = 0;
        BadgeAttrBaseConfig tempConfig = null;

        if (book != null)
        {
            foreach (BadgeSlot slot in book.slot_list)
            {
                if (slot.badge_id != 0)
                {
                    tempConfig = GameSystem.Instance.BadgeAttrConfigData.GetBaseConfig(slot.badge_id);
                    if (tempConfig != null)
                    {
                        totalLevel += (int)tempConfig.level;
                    }
                }
            }
        }
        return(totalLevel);
    }
Example #4
0
    public BadgeBook CreateBadgeBook()
    {
        BadgeBook book = new BadgeBook();

        return(book);
    }
Example #5
0
 //添加涂鸦页
 public void AddBadgeBooks(BadgeBook data)
 {
     books.Add(data);
 }
Example #6
0
    public bool CreateNewMatch(GameMatch.Config config)
    {
        if (mPlayerManager != null)
        {
            mPlayerManager.RemoveAllPlayers();
        }

        if (mCurMatch != null)
        {
            mCurMatch = null;
        }

        //涂鸦数据
        GameMatch.Config.TeamMember mainRole = config.MainRole;
        if (mainRole != null)
        {
            RoleInfo role = MainPlayer.Instance.GetRole2(uint.Parse(mainRole.id));
            if (role != null && role.badge_book_id != 0)
            {
                BadgeBook book = MainPlayer.Instance.badgeSystemInfo.GetBadgeBookByBookId(role.badge_book_id);
                mainRole.badgeBook = book;
            }
            for (int i = 0; i < config.NPCs.Count; ++i)
            {
                GameMatch.Config.TeamMember teamMate = config.NPCs [i];
                if (teamMate != null)
                {
                    RoleInfo roleTeammate = MainPlayer.Instance.GetRole2(uint.Parse(teamMate.id));
                    if (roleTeammate != null && roleTeammate.badge_book_id != 0)
                    {
                        BadgeBook book = MainPlayer.Instance.badgeSystemInfo.GetBadgeBookByBookId(roleTeammate.badge_book_id);
                        teamMate.badgeBook = book;
                    }
                }
            }
        }

        GameMatch match = null;

        switch (config.type)
        {
        case GameMatch.Type.ePVP_1PLUS:
        case GameMatch.Type.ePVP_3On3:
            match = new GameMatch_PVP(config);
            break;

        case GameMatch.Type.e1On1:
        case GameMatch.Type.eCareer1On1:
            match = new GameMatch_1ON1(config);
            break;

        case GameMatch.Type.ePractise:
            match = new GameMatch_Practise(config);
            break;

        case GameMatch.Type.eReady:
            match = new GameMatch_Ready(config);
            break;

        case GameMatch.Type.eFreePractice:
            match = new GameMatch_FreePractice(config);
            break;

        case GameMatch.Type.ePracticeVs:
            match = new GameMatch_PracticeVs(config);
            break;

        case GameMatch.Type.e3On3:
        case GameMatch.Type.eCareer3On3:
            match = new GameMatch_3ON3(config);
            break;

        case GameMatch.Type.eAsynPVP3On3:
            match = new GameMatch_AsynPVP3ON3(config);
            break;

        case GameMatch.Type.e3AIOn3AI:
            match = new GameMatch_3AION3AI(config);
            break;

        case GameMatch.Type.eReboundStorm:
            match = new GameMatch_ReboundStorm(config);
            break;

        case GameMatch.Type.eBlockStorm:
            match = new GameMatch_BlockStorm(config);
            break;

        case GameMatch.Type.eUltimate21:
            match = new GameMatch_Ultimate21(config);
            break;

        case GameMatch.Type.eMassBall:
            match = new GameMatch_MassBall(config);
            break;

        case GameMatch.Type.eGrabZone:
            match = new GameMatch_GrabZone(config);
            break;

        case GameMatch.Type.eGrabPoint:
            match = new GameMatch_GrabPoint(config);
            break;

        case GameMatch.Type.eBullFight:
            match = new GameMatch_BullFight(config);
            break;

        case GameMatch.Type.ePractice1V1:
            match = new GameMatch_Practice1V1(config);
            break;

        case GameMatch.Type.eQualifyingNewerAI:
            match = new GameMatch_QualifyingNewerAI(config);
            break;

        case GameMatch.Type.eLadderAI:
            match = new GameMatch_LadderAI(config);
            break;
        }
        if (match == null)
        {
            Debug.LogError("Unsupported match type is detected when creating a new match.");
            return(false);
        }

        mCurMatch = match;
        mCurMatch.Build();

        return(true);
    }