Exemplo n.º 1
0
    public void PutBomb(Player player, Bomb bomb, Vector2 position)
    {
        if (player.bombs == 0)
        {
            levelManager.GetUIController().ShowTimedMessage("You don't have any bombs\nleft to use!");
            return;
        }
        GameCell cell = levelManager.GetBoard().GetGameCell(position);

        if (cell != null && cell.block == null && cell.bomb == null && !cell.isThereAMonster())
        {
            if (bomb is BombWithTimer)
            {
                DoPutBombWithTimer(player, (BombWithTimer)bomb, cell);
            }
            else
            {
                DoPutBomb(player, bomb, cell);
            }
        }
        else
        {
            levelManager.GetUIController().ShowTimedMessage("You can't place a bomb here!");
        }
    }