Ejemplo n.º 1
0
    public FightCoverItem CreateCoverItem(CoverInfo coverInfo)
    {
        if (coverInfo.IsNull())
        {
            return(null);
        }

        GameObject item = list.NewItem();

        item.name = coverInfo.posX + "_" + coverInfo.posY;

        FightCoverItem itemCtr = item.AddComponent <FightCoverItem>();

        itemCtr.type      = type;
        itemCtr.coverInfo = coverInfo;
        itemCtr.icon      = coverInfo.config.icon;
        itemCtr.rate      = coverInfo.rate;
        itemCtr.UpdateTip();
        PosMgr.SetFightCellPos(item.transform, coverInfo.posX, coverInfo.posY);

        if (coverInfo.show_type == CoverShowType.hide)
        {
            itemCtr.gameObject.transform.localScale = new Vector3(0, 1, 1);
        }

        return(itemCtr);
    }
Ejemplo n.º 2
0
    public void RefreshCell()
    {
        safeCount++;
        if (safeCount > 1000)
        {
            safeCount = 0;
            ConfirmInfo confirmInfo = new ConfirmInfo(LanguageUtil.GetTxt(11602), LanguageUtil.GetTxt(11601), ExitFight, null, false);
            ConfirmModel.Instance.AddConfirm(confirmInfo);
            return;
        }

        CellModel.Instance.anims = new List <List <CellAnimInfo> > ();

        List <CellInfo> allElments = new List <CellInfo> ();

        for (int i = 0; i < BattleModel.Instance.crtBattle.ShowHeight(); i++)
        {
            List <CellInfo> xCells = CellModel.Instance.allCells[i];
            for (int j = 0; j < xCells.Count; j++)
            {
                CellInfo cellInfo = xCells[j];
                if (cellInfo.isBlank == false && cellInfo.isMonsterHold == false && cellInfo.config.cell_type == (int)CellType.five)
                {
                    CoverInfo coverInfo = CoverModel.Instance.GetCoverByPos(cellInfo.posY, cellInfo.posX);
                    if (coverInfo.IsNull())
                    {
                        allElments.Add(cellInfo);
                    }
                }
            }
        }

        int switchTimes = 0;

        while (allElments.Count > 1)
        {
            int      randomA = UnityEngine.Random.Range(0, allElments.Count);
            CellInfo cellA   = allElments[randomA];
            allElments.RemoveAt(randomA);

            int      randomB = UnityEngine.Random.Range(0, allElments.Count);
            CellInfo cellB   = allElments[randomB];
            allElments.RemoveAt(randomB);

            switchTimes++;
            CellModel.Instance.SwitchPos(cellA, cellB);
            cellA.SwitchPos(cellB);
        }

        if (FuncCheckDead.IsDead())
        {
            RefreshCell();
        }
        else
        {
            safeCount = 0;
        }
    }
Ejemplo n.º 3
0
    public List <CoverInfo> Timing()
    {
        List <CoverInfo> timerCovers = new List <CoverInfo>();

        for (int i = 0; i < allCovers.Count; i++)
        {
            List <CoverInfo> xCovers = allCovers[i];
            for (int j = 0; j < xCovers.Count; j++)
            {
                CoverInfo coverInfo = xCovers[j];

                if (coverInfo.IsNull())
                {
                    coverInfo.timer = -1;
                }
                else if (coverInfo.timer > 0)
                {
                    coverInfo.timer--;
                    timerCovers.Add(coverInfo);

                    if (coverInfo.timer == 0)
                    {
                        List <CoverInfo> covers = CoverModel.Instance.GetNeighbors(coverInfo);
                        for (int n = 0; n < covers.Count; n++)
                        {
                            CoverInfo cover = covers[n];

                            if (cover != null)
                            {
                                if (cover.timer == -1)
                                {
                                    CellInfo cellInfo = CellModel.Instance.GetCellByPos(cover.posX, cover.posY);
                                    if (cellInfo.isBlank == false && cellInfo.config.id == 10001)
                                    {
                                    }
                                    else
                                    {
                                        cover.SetConfig(coverInfo.config.GetSpecialValue(0));
                                    }
                                }
                            }
                        }
                        coverInfo.SetConfig(0);
                    }
                }
            }
        }
        return(timerCovers);
    }
Ejemplo n.º 4
0
    private void Refresh(int waitmillisecond = 0, List <CellInfo> cells = null, FightStadus fightStadus = FightStadus.prop_refresh)
    {
        bool hasRefresh = false;

        rootAction = new OrderAction();
        ParallelAction scale1 = new ParallelAction();
        ParallelAction movos  = new ParallelAction();
        ParallelAction scale2 = new ParallelAction();

        if (cells == null)
        {
            for (int i = 0; i < CellModel.Instance.allCells.Count; i++)
            {
                List <CellInfo> xCells = CellModel.Instance.allCells[i];
                for (int j = 0; j < xCells.Count; j++)
                {
                    CellInfo  cellInfo  = xCells[j];
                    CoverInfo coverInfo = CoverModel.Instance.GetCoverByPos(cellInfo.posY, cellInfo.posX);
                    if (cellInfo.isBlank == false && cellInfo.config.cell_type == (int)CellType.five && coverInfo.IsNull())
                    {
                        hasRefresh = true;

                        FightCellItem item = GetItemByRunId(cellInfo.runId);

                        if (fightStadus == FightStadus.changer)
                        {
                            item.transform.localRotation = Quaternion.identity;
                            scale1.AddNode(new RoatateActor((RectTransform)item.transform, new Vector3(0, 0, 180), 0.2f));
                        }
                        else
                        {
                            scale1.AddNode(new ScaleActor((RectTransform)item.transform, new Vector3(0, 0, 0), 0.3f));
                        }

                        if (fightStadus == FightStadus.changer)
                        {
                            scale2.AddNode(new RoatateActor((RectTransform)item.transform, new Vector3(0, 0, 360), 0.2f));
                        }
                        else
                        {
                            Vector2 toPos = PosUtil.GetFightCellPos(cellInfo.posX, cellInfo.posY);
                            movos.AddNode(new MoveActor((RectTransform)item.transform, new Vector3(toPos.x, toPos.y, 0), 0, 0.1f));

                            scale2.AddNode(new ScaleActor((RectTransform)item.transform, new Vector3(1, 1, 1), 0.3f));
                        }
                    }
                }
            }
        }
        else
        {
            for (int j = 0; j < cells.Count; j++)
            {
                CellInfo cellInfo = cells[j];
                if (cellInfo.isBlank == false && cellInfo.config.cell_type == (int)CellType.five)
                {
                    hasRefresh = true;

                    FightCellItem item = GetItemByRunId(cellInfo.runId);

                    if (fightStadus == FightStadus.changer)
                    {
                        item.transform.localRotation = Quaternion.identity;
                        scale1.AddNode(new RoatateActor((RectTransform)item.transform, new Vector3(0, 0, 180), 0.2f));
                    }
                    else
                    {
                        scale1.AddNode(new ScaleActor((RectTransform)item.transform, new Vector3(0, 0, 0), 0.3f));
                    }


                    if (fightStadus == FightStadus.changer)
                    {
                        scale2.AddNode(new RoatateActor((RectTransform)item.transform, new Vector3(0, 0, 360), 0.2f));
                    }
                    else
                    {
                        Vector2 toPos = PosUtil.GetFightCellPos(cellInfo.posX, cellInfo.posY);
                        movos.AddNode(new MoveActor((RectTransform)item.transform, new Vector3(toPos.x, toPos.y, 0), 0, 0.1f));

                        scale2.AddNode(new ScaleActor((RectTransform)item.transform, new Vector3(1, 1, 1), 0.3f));
                    }
                }
            }
        }

        if (waitmillisecond > 0)
        {
            rootAction.AddNode(new WaitActor(waitmillisecond));
        }

        if (hasRefresh)
        {
            rootAction.AddNode(new PlaySoundActor("Refresh"));
        }

        rootAction.AddNode(scale1);
        rootAction.AddNode(movos);
        rootAction.AddNode(scale2);

        ExecuteAction(fightStadus);
    }
Ejemplo n.º 5
0
    private void UnlockMonster(bool isJet = false)
    {
        List <int> unLockIds = MonsterModel.Instance.UnLock(isJet);

        MonsterModel.Instance.BackUpUnLockMonster(unLockIds);
        rootAction = new OrderAction();
        for (int j = 0; j < unLockIds.Count; j++)
        {
            int monsterRunId             = unLockIds[j];
            FightMonsterItem monsterItem = monsterLayer.GetItemByRunId(monsterRunId);
            rootAction.AddNode(new SetLayerActor(monsterItem.transform, effectLayer.transform));

            CellInfo monsterCell = new CellInfo();
            monsterCell.posX = monsterItem.monsterInfo.posX;
            monsterCell.posY = monsterItem.monsterInfo.posY;
            if (isJet)
            {
                if (monsterItem.monsterInfo.IsNull())
                {
                    CellDirType dirType = WallModel.Instance.GetGapWallDir(monsterCell);
                    int         zrotate = PosUtil.GetRotateByDir(dirType);
                    rootAction.AddNode(new RoatateActor((RectTransform)monsterItem.transform, new Vector3(0, 0, zrotate), 0.25f));
                }
                else
                {
                    rootAction.AddNode(new ScaleActor((RectTransform)monsterItem.transform, new Vector3(1.15f, 1.15f, 1f), 0.2f));
                }
            }

            List <CellInfo> releaseList = MonsterModel.Instance.ReleaseList(monsterRunId);
            if (releaseList.Count > 0)
            {
                ParallelAction paralle = new ParallelAction();
                for (int i = 0; i < releaseList.Count; i++)
                {
                    CellInfo      cellInfo = releaseList[i];
                    FightCellItem item     = GetItemByRunId(cellInfo.runId);
                    if (item == null)
                    {
                        GameObject itemObj = CreateCellItem(cellInfo);
                        item = itemObj.GetComponent <FightCellItem>();
                    }
                    OrderAction order = new OrderAction();
                    order.AddNode(new PlaySoundActor("Refresh"));

                    order.AddNode(new ShowEffectLineActor(effectLayer, cellInfo, monsterCell, monsterItem.monsterInfo.releaseId));

                    order.AddNode(new ScaleActor((RectTransform)item.transform, new Vector3(0, 0, 0), 0.1f));

                    order.AddNode(new ChangeCellActor(item, cellInfo, monsterItem.monsterInfo.releaseId));

                    paralle.AddNode(order);
                }
                rootAction.AddNode(paralle);
            }
            if (monsterItem.monsterInfo.IsNull())
            {
                rootAction.AddNode(new ScaleActor((RectTransform)monsterItem.transform, new Vector3(1.25f, 1.25f, 0), 0.15f));
                if (j == 0)
                {
                    rootAction.AddNode(new ScaleActor((RectTransform)monsterItem.transform, new Vector3(0, 0, 0), 0.25f));
                }
                else
                {
                    rootAction.AddNode(new ScaleActor((RectTransform)monsterItem.transform, new Vector3(0, 0, 0), 0.15f));
                }
            }
            else
            {
                rootAction.AddNode(new ScaleActor((RectTransform)monsterItem.transform, new Vector3(1, 1, 1), 0.05f));

                CoverInfo coverInfo = CoverModel.Instance.GetCoverByPos(monsterItem.monsterInfo.posY, monsterItem.monsterInfo.posX);

                FightCoverItem coverItem = coverLayer.GetItemByRunId(coverInfo.runId);

                rootAction.AddNode(new ChangeCoverActor(coverLayer, coverItem, coverInfo));
                rootAction.AddNode(new ProgressMonsterActor(monsterItem, monsterItem.monsterInfo.progress));
                rootAction.AddNode(new SetLayerActor(monsterItem.transform, monsterLayer.transform));
            }
        }
        if (isJet)
        {
            ExecuteAction(FightStadus.jet_monster);
        }
        else
        {
            ParallelAction paralleTimer = new ParallelAction();

            List <CellInfo> timerCells = CellModel.Instance.Timing();
            for (int i = 0; i < timerCells.Count; i++)
            {
                CellInfo      cellInfo = timerCells[i];
                FightCellItem item     = GetItemByRunId(cellInfo.runId);
                if (item != null)
                {
                    OrderAction order = new OrderAction();
                    order.AddNode(new PlaySoundActor("Refresh"));
                    order.AddNode(new ChangeCellActor(item, cellInfo));
                    if (cellInfo.isBlank)
                    {
                        order.AddNode(new ScaleActor((RectTransform)item.transform, new Vector3(0, 0, 0), 0.2f));
                        order.AddNode(new DestroyActor(item.gameObject));
                    }
                    paralleTimer.AddNode(order);
                }
            }

            List <CoverInfo> timerCovers = CoverModel.Instance.Timing();
            for (int i = 0; i < timerCovers.Count; i++)
            {
                CoverInfo      coverInfo = timerCovers[i];
                FightCoverItem item      = coverLayer.GetItemByRunId(coverInfo.runId);

                OrderAction order = new OrderAction();
                order.AddNode(new PlaySoundActor("Refresh"));
                order.AddNode(new ChangeCoverActor(coverLayer, item, coverInfo));

                if (coverInfo.IsNull())
                {
                    order.AddNode(new ScaleActor((RectTransform)item.transform, new Vector3(0, 0, 0), 0.2f));
                    order.AddNode(new DestroyActor(item.gameObject));

                    List <CoverInfo> covers = CoverModel.Instance.GetNeighbors(coverInfo);
                    for (int n = 0; n < covers.Count; n++)
                    {
                        CoverInfo cover = covers[n];
                        if (cover != null)
                        {
                            item = coverLayer.GetItemByRunId(cover.runId);
                            order.AddNode(new ChangeCoverActor(coverLayer, item, cover));
                            if (cover.config != null)
                            {
                                coverFlowInterrupt = true;
                            }
                        }
                    }
                }
                paralleTimer.AddNode(order);
            }

            rootAction.AddNode(paralleTimer);

            if (coverFlowInterrupt)
            {
                rootAction.AddNode(new FuncActor(coverLayer.ShowList));                //todo 爆后流动导致多出蜘蛛网
            }

            ExecuteAction(FightStadus.unlock_monster);
        }
    }
Ejemplo n.º 6
0
    public void Flow()
    {
        anims = new List <List <CoverAnimInfo> >();
        List <CoverAnimInfo> stepAnim = new List <CoverAnimInfo>();

        anims.Add(stepAnim);

        List <CoverInfo> allFlowCover = new List <CoverInfo>();
        int i;

        for (i = 0; i < allCovers.Count; i++)
        {
            for (int j = 0; j < allCovers[i].Count; j++)
            {
                CoverInfo coverInfo = allCovers[i][j];

                if (coverInfo.IsNull() == false && coverInfo.config.move)
                {
                    allFlowCover.Add(coverInfo);
                }
            }
        }

        for (i = 0; i < allFlowCover.Count; i++)
        {
            CoverInfo coverInfo = allFlowCover[i];

            List <CoverInfo> neighborNulls = new List <CoverInfo>();

            List <CoverInfo> neighbors = GetNeighbors(coverInfo);
            for (int j = 0; j < neighbors.Count; j++)
            {
                CoverInfo neighbor = neighbors[j];
                if (neighbor != null && neighbor.IsNull())
                {
                    CellInfo neighborCell = CellModel.Instance.GetCellByPos(neighbor.posX, neighbor.posY);
                    if (neighborCell.isBlank)
                    {
                        MonsterInfo monsterInfo = MonsterModel.Instance.GetMonsterByPos(neighbor.posX, neighbor.posY);
                        if (monsterInfo.IsNull())
                        {
                            neighborNulls.Add(neighbor);
                        }
                    }
                    else
                    {
                        if (neighborCell.config.cell_type != (int)CellType.terrain)
                        {
                            neighborNulls.Add(neighbor);
                        }
                    }
                }
            }

            int nullCount = neighborNulls.Count;
            if (nullCount > 0)
            {
                CoverInfo selectNeighbor = neighborNulls[Random.Range(0, nullCount)];

                SwitchPos(coverInfo, selectNeighbor);
                coverInfo.SwitchPos(selectNeighbor);

                AddAnim(coverInfo, CellAnimType.move);
            }
        }
    }
Ejemplo n.º 7
0
    public int RollCount()
    {
        int leftHeight = allCovers.Count;

        int viewCount = BattleModel.Instance.crtBattle.ShowHeight();

        if (leftHeight > viewCount)
        {
            int firstHeight = -1;

            for (int i = 0; i < allCovers.Count; i++)
            {
                if (firstHeight >= 0)
                {
                    break;
                }
                for (int j = 0; j < allCovers[i].Count; j++)
                {
                    CoverInfo coverInfo = allCovers[i][j];
                    if (coverInfo.IsNull() == false && coverInfo.config.life == 1 && coverInfo.config.line == false)
                    {
                        firstHeight = i;
                        break;
                    }

                    CellInfo cellInfo = CellModel.Instance.GetCellByPos(j, i);
                    if (cellInfo.isBlank == false && cellInfo.config.id == 10014)
                    {
                        firstHeight = i;
                        break;
                    }
                }
            }

            if (firstHeight == -1)
            {
                firstHeight = allCovers.Count;
            }

            if (firstHeight > BattleModel.Instance.crtBattle.ShowWidth() / 2)
            {
                int hideHeight = leftHeight - viewCount;

                if (hideHeight > 4)
                {
                    return(4);
                }
                else
                {
                    return(hideHeight);
                }
            }
            else
            {
                return(0);
            }
        }
        else
        {
            return(0);
        }
    }
Ejemplo n.º 8
0
    //消除
    public static void Eliminate(bool exercise = false)
    {
        FloorModel.Instance.anims   = new List <List <FloorAnimInfo> >();
        CellModel.Instance.anims    = new List <List <CellAnimInfo> >();
        WallModel.Instance.anims    = new List <List <WallAnimInfo> >();
        CoverModel.Instance.anims   = new List <List <CoverAnimInfo> >();
        MonsterModel.Instance.anims = new List <List <MonsterAnimInfo> >();

        CollectModel.Instance.tempCollect = new CollectInfo();
        int i;

        for (i = 0; i < CellModel.Instance.lineCells.Count; i++)
        {
            CellInfo cellInfo = CellModel.Instance.lineCells[i];

            List <FloorAnimInfo> floorAnims = new List <FloorAnimInfo>();
            FloorModel.Instance.anims.Add(floorAnims);

            List <CellAnimInfo> stepMoves = new List <CellAnimInfo>();
            CellModel.Instance.anims.Add(stepMoves);

            List <WallAnimInfo> stepWallMoves = new List <WallAnimInfo>();
            WallModel.Instance.anims.Add(stepWallMoves);

            List <CoverAnimInfo> coverAnims = new List <CoverAnimInfo>();
            CoverModel.Instance.anims.Add(coverAnims);

            List <MonsterAnimInfo> monsterAnims = new List <MonsterAnimInfo>();
            MonsterModel.Instance.anims.Add(monsterAnims);

            //解除盖子
            if (CoverModel.Instance.AbsorbLine(cellInfo.posX, cellInfo.posY))
            {
                CoverInfo clearCover = CoverModel.Instance.GetCoverByPos(cellInfo.posY, cellInfo.posX);
                if (exercise)
                {
                    CollectModel.Instance.tempCollect.AddCount(clearCover.config.id, 1);
                }
                clearCover = CoverModel.Instance.ClearCover(clearCover);
                CoverModel.Instance.AddAnim(clearCover, CellAnimType.clear);
            }
            else
            {
                //消除连线
                if (cellInfo.bombMark == false && cellInfo.isBlank == false)
                {
                    cellInfo.isBlank = true;

                    if (exercise)
                    {
                        CollectModel.Instance.tempCollect.AddCount(cellInfo.configId, 1);
                        CollectModel.Instance.scoreLen++;
                    }
                    else
                    {
                        MonsterModel.Instance.UpdateBan(cellInfo);
                    }
                    CellModel.Instance.AddAnim(cellInfo, CellAnimType.clear);
                }

                //消除地板
                FloorInfo floorInfo = FloorModel.Instance.GetFloorByPos(cellInfo.posY, cellInfo.posX);
                if (!floorInfo.IsNull())
                {
                    if (exercise)
                    {
                        CollectModel.Instance.tempCollect.AddCount(floorInfo.config.id, 1);
                    }

                    floorInfo = FloorModel.Instance.ClearFloor(floorInfo);
                    FloorModel.Instance.AddAnim(floorInfo);
                }

                //击毁
                List <CellInfo> neighbors = CellModel.Instance.GetNeighbors(cellInfo);
                for (int j = 0; j < neighbors.Count; j++)
                {
                    CellInfo neighbor = neighbors[j];

                    if (neighbor != null)
                    {
                        WallInfo wall = WallModel.Instance.GetWall(cellInfo, neighbor);
                        if (wall.IsNull())
                        {
                            CoverInfo wreckCover    = CoverModel.Instance.GetCoverByPos(neighbor.posY, neighbor.posX);
                            bool      coverCanWreck = CoverModel.Instance.CanWreck(wreckCover);

                            if (coverCanWreck)
                            {                            //击毁盖子
                                if (exercise)
                                {
                                    CollectModel.Instance.tempCollect.AddCount(wreckCover.config.id, 1);
                                }
                                CoverModel.Instance.Wreck(wreckCover);
                                if (wreckCover.IsNull())
                                {
                                    CoverModel.Instance.AddAnim(wreckCover, CellAnimType.clear);
                                }
                                else
                                {
                                    CoverModel.Instance.AddAnim(wreckCover, CellAnimType.wreck);
                                }
                            }
                            else
                            {                               //击毁邻居
                                if (neighbor.CanWreck())
                                {
                                    if (exercise)
                                    {
                                        CollectModel.Instance.tempCollect.AddCount(neighbor.configId, 1);
                                        if (neighbor.config.id == 10014)
                                        {
                                            CollectModel.Instance.scoreLen += 10;
                                        }
                                    }
                                    else
                                    {
                                        InvadeModel.Instance.InvadeBlocked(neighbor);
                                    }

                                    neighbor.Wreck();
                                    CellModel.Instance.AddAnim(neighbor, CellAnimType.wreck);
                                }
                                //击毁怪物
                                MonsterInfo monster = MonsterModel.Instance.GetMonsterByPos(neighbor.posY, neighbor.posX);
                                if (monster != null && monster.CanWreck())
                                {
                                    if (exercise)
                                    {
                                        CollectModel.Instance.tempCollect.AddCount(monster.config.id, 1);
                                    }
                                    monster.Wreck(false);
                                    MonsterModel.Instance.AddAnim(monster, CellAnimType.wreck);
                                }
                            }
                        }
                    }
                }

                //击毁墙体
                List <WallInfo> neighborWalls = WallModel.Instance.GetNeighborWalls(cellInfo);
                for (int j = 0; j < neighborWalls.Count; j++)
                {
                    WallInfo neighborWall = neighborWalls[j];
                    if (neighborWall != null && neighborWall.CanWreck())
                    {
                        neighborWall.Wreck();
                        if (exercise == false)
                        {
                            WallModel.Instance.AddAnim(neighborWall, CellAnimType.wreck);
                        }
                    }
                }
            }

            //炸弹
            List <CellInfo> bombCells = SkillModel.Instance.GetBombCells(cellInfo);
            for (int j = 0; j < bombCells.Count; j++)
            {
                CellInfo bombCell = bombCells[j];
                if (bombCell != null)
                {
                    bombCell.bombMark = false;

                    //炸毁盖子
                    if (CoverModel.Instance.AbsorbLine(bombCell.posX, bombCell.posY))
                    {
                        CoverInfo clearCover = CoverModel.Instance.GetCoverByPos(bombCell.posY, bombCell.posX);
                        if (exercise)
                        {
                            CollectModel.Instance.tempCollect.AddCount(clearCover.config.id, 1);
                        }
                        clearCover = CoverModel.Instance.ClearCover(clearCover);
                        CoverModel.Instance.AddAnim(clearCover, CellAnimType.clear);
                        CellModel.Instance.AddAnim(bombCell, CellAnimType.nullbomb);
                    }
                    else
                    {
                        if (!MonsterModel.Instance.StopSkill(bombCell.posX, bombCell.posY))
                        {
                            if (bombCell.CanBomb())
                            {
                                //炸毁格子
                                if (exercise)
                                {
                                    CollectModel.Instance.tempCollect.AddCount(bombCell.configId, 1);
                                    if (bombCell.config.cell_type == (int)CellType.terrain)
                                    {
                                        List <int> hides = bombCell.config.GetHides();
                                        for (int h = 0; h < hides.Count; h++)
                                        {
                                            CollectModel.Instance.tempCollect.AddCount(hides[h], 1);
                                            if (hides[h] == 10014)
                                            {
                                                CollectModel.Instance.scoreLen += 10;
                                            }
                                        }
                                    }
                                    if (bombCell.config.cell_type == (int)CellType.five)
                                    {
                                        CollectModel.Instance.scoreLen++;
                                    }
                                }
                                bombCell.Bomb();
                                CellModel.Instance.AddAnim(bombCell, CellAnimType.bomb);
                            }
                            else
                            {
                                CellModel.Instance.AddAnim(bombCell, CellAnimType.nullbomb);
                            }

                            //炸毁地板
                            FloorInfo floorInfo = FloorModel.Instance.GetFloorByPos(bombCell.posY, bombCell.posX);
                            if (!floorInfo.IsNull())
                            {
                                if (exercise)
                                {
                                    CollectModel.Instance.tempCollect.AddCount(floorInfo.config.id, 1);
                                }
                                floorInfo = FloorModel.Instance.ClearFloor(floorInfo);
                                FloorModel.Instance.AddAnim(floorInfo);
                            }
                        }
                        else
                        {
                            MonsterInfo monster = MonsterModel.Instance.GetMonsterByPos(bombCell.posY, bombCell.posX);
                            if (monster != null && monster.CanWreck())//炸毁怪物
                            {
                                if (exercise)
                                {
                                    CollectModel.Instance.tempCollect.AddCount(monster.config.id, 1);
                                }
                                monster.Wreck(true);
                                MonsterModel.Instance.AddAnim(monster, CellAnimType.wreck);
                            }
                            CellModel.Instance.AddAnim(bombCell, CellAnimType.nullbomb);
                        }
                    }

                    //炸毁墙体
                    List <WallInfo> bomNeighborWalls = WallModel.Instance.GetNeighborWalls(bombCell);
                    for (int n = 0; n < bomNeighborWalls.Count; n++)
                    {
                        WallInfo neighborWall = bomNeighborWalls[n];
                        if (neighborWall != null && neighborWall.CanWreck())
                        {
                            neighborWall.Wreck();
                            WallModel.Instance.AddAnim(neighborWall, CellAnimType.wreck);
                        }
                    }
                }
            }
        }

        CellModel.Instance.lineCells = new List <CellInfo>();
        for (i = 0; i < CellModel.Instance.allCells.Count; i++)
        {
            List <CellInfo> xCells = CellModel.Instance.allCells[i];
            for (int j = 0; j < xCells.Count; j++)
            {
                CellInfo cellInfo = xCells[j];
                if (cellInfo.isBlank)
                {
                    CellModel.Instance.lineCells.Add(cellInfo);
                }
            }
        }
    }