Skip to content

Commit cd2e087

Browse files
committed
Add seed hiding controlled by cmd line option
1 parent 4eaad4c commit cd2e087

File tree

4 files changed

+16
-1
lines changed

4 files changed

+16
-1
lines changed

src/brogue/IO.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -4411,7 +4411,12 @@ void printSeed() {
44114411
} else if (rogue.wizard) {
44124412
strcpy(mode,"wizard mode; ");
44134413
}
4414-
snprintf(buf, COLS, "Dungeon seed #%llu; turn #%lu; %sversion %s", (unsigned long long)rogue.seed, rogue.playerTurnNumber, mode, gameConst->versionString);
4414+
if (rogue.hideSeed) {
4415+
snprintf(buf, COLS, "Dungeon seed HIDDEN; turn #%lu; %sversion %s", rogue.playerTurnNumber, mode, gameConst->versionString);
4416+
}
4417+
else {
4418+
snprintf(buf, COLS, "Dungeon seed #%llu; turn #%lu; %sversion %s", (unsigned long long)rogue.seed, rogue.playerTurnNumber, mode, gameConst->versionString);
4419+
}
44154420
message(buf, 0);
44164421
}
44174422

src/brogue/Rogue.h

+1
Original file line numberDiff line numberDiff line change
@@ -2452,6 +2452,7 @@ typedef struct playerCharacter {
24522452
boolean alreadyFell; // so the player can fall only one depth per turn
24532453
boolean eligibleToUseStairs; // so the player uses stairs only when he steps onto them
24542454
boolean trueColorMode; // whether lighting effects are disabled
2455+
boolean hideSeed; // whether seed is hidden when pressing SEED_KEY
24552456
boolean displayStealthRangeMode; // whether your stealth range is displayed
24562457
boolean quit; // to skip the typical end-game theatrics when the player quits
24572458
uint64_t seed; // the master seed for generating the entire dungeon

src/brogue/RogueMain.c

+3
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,15 @@ void initializeRogue(uint64_t seed) {
187187
item *theItem;
188188
boolean playingback, playbackFF, playbackPaused, wizard, easy, displayStealthRangeMode;
189189
boolean trueColorMode;
190+
boolean hideSeed;
190191
short oldRNG;
191192
char currentGamePath[BROGUE_FILENAME_MAX];
192193

193194
playingback = rogue.playbackMode; // the only animals that need to go on the ark
194195
playbackPaused = rogue.playbackPaused;
195196
playbackFF = rogue.playbackFastForward;
196197
wizard = rogue.wizard;
198+
hideSeed = rogue.hideSeed;
197199
easy = rogue.easyMode;
198200
displayStealthRangeMode = rogue.displayStealthRangeMode;
199201
trueColorMode = rogue.trueColorMode;
@@ -209,6 +211,7 @@ void initializeRogue(uint64_t seed) {
209211
rogue.playbackPaused = playbackPaused;
210212
rogue.playbackFastForward = playbackFF;
211213
rogue.wizard = wizard;
214+
rogue.hideSeed = hideSeed;
212215
rogue.easyMode = easy;
213216
rogue.displayStealthRangeMode = displayStealthRangeMode;
214217
rogue.trueColorMode = trueColorMode;

src/platform/main.c

+6
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ static void printCommandlineHelp() {
4343
"--stealth -S display stealth range\n"
4444
"--no-effects -E disable color effects\n"
4545
"--wizard -W run in wizard mode, invincible with powerful items\n"
46+
"--hide-seed disable seed display in game\n"
4647
"[--csv] --print-seed-catalog [START NUM LEVELS]\n"
4748
" (optional csv format)\n"
4849
" prints a catalog of the first LEVELS levels of NUM\n"
@@ -309,6 +310,11 @@ int main(int argc, char *argv[])
309310
continue;
310311
}
311312

313+
if (strcmp(argv[i], "--hide-seed") == 0) {
314+
rogue.hideSeed = true;
315+
continue;
316+
}
317+
312318
if (strcmp(argv[i], "--data-dir") == 0) {
313319
if (i + 1 < argc) {
314320
strcpy(dataDirectory, argv[++i]);

0 commit comments

Comments
 (0)