Retocando habitaciones

This commit is contained in:
2022-11-08 20:27:55 +01:00
parent db56185be2
commit 9605aa61c8
15 changed files with 76 additions and 57 deletions

View File

@@ -506,28 +506,28 @@ void Game::setScoreBoardColor()
const bool isBrightBlack = colorAreEqual(colorBorder, stringToColor(options->palette, "bright_black"));
// Si el color del borde es negro o negro brillante cambia el texto del marcador a blanco
board.color = isBlack || isBrightBlack? stringToColor(options->palette, "white") : colorBorder;
board.color = isBlack || isBrightBlack ? stringToColor(options->palette, "white") : colorBorder;
}
// Comprueba si ha finalizado el juego
bool Game::checkEndGame()
{
const bool a = room->getName() == "THE JAIL"; // Estar en la habitación que toca
const bool b = board.items >= int(totalItems * 0.9f); // Con mas del 90% de los items recogidos
const bool c = player->getRect().x <= 128; // Y en la ubicación que toca (En la puerta)
const bool isOnTheRoom = room->getName() == "THE JAIL"; // Estar en la habitación que toca
const bool haveTheItems = board.items >= int(totalItems * 0.9f); // Con mas del 90% de los items recogidos
const bool isOnTheDoor = player->getRect().x <= 128; // Y en la ubicación que toca (En la puerta)
if (b)
if (haveTheItems)
{
board.jailEnabled = true;
}
if (a && b && c)
if (isOnTheRoom && haveTheItems && isOnTheDoor)
{
section.name = SECTION_PROG_ENDING;
return true;
}
if (options->cheat.jailEnabled && a && c)
if (options->cheat.jailEnabled && isOnTheRoom && isOnTheDoor)
{
section.name = SECTION_PROG_ENDING;
return true;