Ejemplo n.º 1
0
    public void ColoringBombTrigger(Grid bombGrid,Grid triggerGrid)
    {
        if (bombGrid == null || triggerGrid == null)
        {
            return;
        }

        CellColor targetColor;

        List<Grid> mostColorList;
        if (bombGrid.isMatchColor(triggerGrid))
        {
            mostColorList = FindMostOtherColor(triggerGrid);
        }else
        {
            mostColorList  = FindColorGrids(triggerGrid);
        }

        TintGrids(bombGrid,mostColorList);
        bombGrid.DestroyCell(Constants.CELL_ELIM_TIME,true,null);
        // List<Grid>
    }
Ejemplo n.º 2
0
    void ElimGridListAndGenBomb(List<Grid> lst,Grid g,BombType genBomb = BombType.None)
    {
        if (lst.Count == 0)
        {
            return;
        }

        if (genBomb == BombType.None) {
            g.DestroyCell (Constants.CELL_ELIM_TIME,true,g);
            for (int i = 0; i < lst.Count; ++i) {
                Grid curGrid = lst [i];
                curGrid. DestroyCell(Constants.CELL_ELIM_TIME,true,g);

            }

        } else {
            if (g.bombType != BombType.None)
            {
                BombManager.instance.triggerBomb(g,g);
            }

            if (!g.Cell) {
                return;
            }
            g.Cell.cellType = CellType.Bomb;
            g.Cell.cellBombType = genBomb;

            if (g.bombType == BombType.Color)
            {
                g.Cell.cellColor = CellColor.All;

            }

            g.Cell.highZorder();
            g.Cell.updateCell (Constants.FORM_TIME);
            for (int i = 0; i < lst.Count; ++i) {
                Grid curGrid = lst [i];
                curGrid. MoveToAndElim(g,Constants.FORM_TIME,g);

            }
        }
    }
Ejemplo n.º 3
0
    void ColorBombTrigger(Grid bombGrid,Grid triggerGrid)
    {
        if (bombGrid == null || triggerGrid == null)
        {
            return;
        }

        UpdateBorder();
        for (int curRow = _activeMinRow ; curRow < _activeMaxRow; ++curRow)
        {
            for (int curCol = _activeMinCol; curCol < _activeMaxCol; ++curCol)
            {
                var curGrid = GridsManager.instance[curRow,curCol];
                if (curGrid && curGrid != triggerGrid && curGrid.isBombable() && curGrid.isMatchColor(triggerGrid))
                {
                    curGrid.DestroyCell(Constants.CELL_ELIM_TIME,true,triggerGrid);
                    CreateBombEff(bombGrid,curGrid);
                }
            }

        }

        triggerGrid.DestroyCell(Constants.CELL_ELIM_TIME,true,triggerGrid);
        bombGrid.DestroyCell(Constants.CELL_ELIM_TIME,true,triggerGrid);
    }