Skip to content

Commit

Permalink
Add seed hiding controlled by cmd line option
Browse files Browse the repository at this point in the history
  • Loading branch information
flend committed Nov 9, 2024
1 parent 4eaad4c commit cd2e087
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/brogue/IO.c
Original file line number Diff line number Diff line change
Expand Up @@ -4411,7 +4411,12 @@ void printSeed() {
} else if (rogue.wizard) {
strcpy(mode,"wizard mode; ");
}
snprintf(buf, COLS, "Dungeon seed #%llu; turn #%lu; %sversion %s", (unsigned long long)rogue.seed, rogue.playerTurnNumber, mode, gameConst->versionString);
if (rogue.hideSeed) {
snprintf(buf, COLS, "Dungeon seed HIDDEN; turn #%lu; %sversion %s", rogue.playerTurnNumber, mode, gameConst->versionString);
}
else {
snprintf(buf, COLS, "Dungeon seed #%llu; turn #%lu; %sversion %s", (unsigned long long)rogue.seed, rogue.playerTurnNumber, mode, gameConst->versionString);
}
message(buf, 0);
}

Expand Down
1 change: 1 addition & 0 deletions src/brogue/Rogue.h
Original file line number Diff line number Diff line change
Expand Up @@ -2452,6 +2452,7 @@ typedef struct playerCharacter {
boolean alreadyFell; // so the player can fall only one depth per turn
boolean eligibleToUseStairs; // so the player uses stairs only when he steps onto them
boolean trueColorMode; // whether lighting effects are disabled
boolean hideSeed; // whether seed is hidden when pressing SEED_KEY
boolean displayStealthRangeMode; // whether your stealth range is displayed
boolean quit; // to skip the typical end-game theatrics when the player quits
uint64_t seed; // the master seed for generating the entire dungeon
Expand Down
3 changes: 3 additions & 0 deletions src/brogue/RogueMain.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,15 @@ void initializeRogue(uint64_t seed) {
item *theItem;
boolean playingback, playbackFF, playbackPaused, wizard, easy, displayStealthRangeMode;
boolean trueColorMode;
boolean hideSeed;
short oldRNG;
char currentGamePath[BROGUE_FILENAME_MAX];

playingback = rogue.playbackMode; // the only animals that need to go on the ark
playbackPaused = rogue.playbackPaused;
playbackFF = rogue.playbackFastForward;
wizard = rogue.wizard;
hideSeed = rogue.hideSeed;
easy = rogue.easyMode;
displayStealthRangeMode = rogue.displayStealthRangeMode;
trueColorMode = rogue.trueColorMode;
Expand All @@ -209,6 +211,7 @@ void initializeRogue(uint64_t seed) {
rogue.playbackPaused = playbackPaused;
rogue.playbackFastForward = playbackFF;
rogue.wizard = wizard;
rogue.hideSeed = hideSeed;
rogue.easyMode = easy;
rogue.displayStealthRangeMode = displayStealthRangeMode;
rogue.trueColorMode = trueColorMode;
Expand Down
6 changes: 6 additions & 0 deletions src/platform/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ static void printCommandlineHelp() {
"--stealth -S display stealth range\n"
"--no-effects -E disable color effects\n"
"--wizard -W run in wizard mode, invincible with powerful items\n"
"--hide-seed disable seed display in game\n"
"[--csv] --print-seed-catalog [START NUM LEVELS]\n"
" (optional csv format)\n"
" prints a catalog of the first LEVELS levels of NUM\n"
Expand Down Expand Up @@ -309,6 +310,11 @@ int main(int argc, char *argv[])
continue;
}

if (strcmp(argv[i], "--hide-seed") == 0) {
rogue.hideSeed = true;
continue;
}

if (strcmp(argv[i], "--data-dir") == 0) {
if (i + 1 < argc) {
strcpy(dataDirectory, argv[++i]);
Expand Down

0 comments on commit cd2e087

Please sign in to comment.