Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add seed hiding controlled by cmd line option #722

Merged
merged 1 commit into from
Dec 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading