Skip to content

Commit

Permalink
Merge pull request #533 from Pedro-Beirao/track_reality
Browse files Browse the repository at this point in the history
Add -track_reality and reset tracking in casual play
  • Loading branch information
Pedro-Beirao authored Nov 18, 2024
2 parents 151de93 + bbc32a1 commit 5ed9e91
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
18 changes: 17 additions & 1 deletion prboom2/src/dsda.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
// command-line toggles
int dsda_track_pacifist;
int dsda_track_100k;
int dsda_track_reality;

int dsda_last_leveltime;
int dsda_last_gamemap;
Expand Down Expand Up @@ -152,6 +153,7 @@ void dsda_ReadCommandLine(void) {

dsda_track_pacifist = dsda_Flag(dsda_arg_track_pacifist);
dsda_track_100k = dsda_Flag(dsda_arg_track_100k);
dsda_track_reality = dsda_Flag(dsda_arg_track_reality);
dsda_analysis = dsda_Flag(dsda_arg_analysis);
dsda_time_keys = dsda_SimpleIntArg(dsda_arg_time_keys);
dsda_time_use = dsda_SimpleIntArg(dsda_arg_time_use);
Expand Down Expand Up @@ -208,6 +210,17 @@ void dsda_DisplayNotifications(void) {
dsda_100k_note_shown = true;
dsda_DisplayNotification("100K achieved!");
}

if (!dsda_reality && !dsda_almost_reality_note_shown) {
if (!dsda_almost_reality && !dsda_almost_reality_note_shown) {
dsda_almost_reality_note_shown = true;
dsda_DisplayNotification("Not reality / almost reality!");
}
else if (!dsda_reality_note_shown) {
dsda_reality_note_shown = true;
dsda_DisplayNotification("Almost reality!");
}
}
}

void dsda_DecomposeILTime(dsda_level_time_t* level_time) {
Expand Down Expand Up @@ -537,14 +550,17 @@ static void dsda_ResetTracking(void) {
dsda_ResetAnalysis();

dsda_pacifist_note_shown = false;
dsda_reality_note_shown = false;
dsda_almost_reality_note_shown = false;
}

void dsda_WatchDeferredInitNew(int skill, int episode, int map) {
dsda_ResetTracking();

if (!demorecording) return;

++dsda_session_attempts;

dsda_ResetTracking();
dsda_QueueQuickstart();

dsda_ResetRevealMap();
Expand Down
2 changes: 2 additions & 0 deletions prboom2/src/dsda/analysis.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ int dsda_kills_on_map = 0;
dboolean dsda_100k_on_map = false;
dboolean dsda_100k_note_shown = false;
dboolean dsda_pacifist_note_shown = false;
dboolean dsda_reality_note_shown = false;
dboolean dsda_almost_reality_note_shown = false;

void dsda_ResetAnalysis(void) {
dsda_pacifist = true;
Expand Down
2 changes: 2 additions & 0 deletions prboom2/src/dsda/analysis.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ extern int dsda_kills_on_map;
extern dboolean dsda_100k_on_map;
extern dboolean dsda_100k_note_shown;
extern dboolean dsda_pacifist_note_shown;
extern dboolean dsda_reality_note_shown;
extern dboolean dsda_almost_reality_note_shown;

void dsda_ResetAnalysis(void);
void dsda_WriteAnalysis(void);
Expand Down
5 changes: 5 additions & 0 deletions prboom2/src/dsda/args.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ static arg_config_t arg_config[dsda_arg_count] = {
"tracks when 100% kills is reached",
arg_null,
},
[dsda_arg_track_reality] = {
"-track_reality", NULL, NULL,
"tracks reality and almost reality categories restrictions",
arg_null,
},
[dsda_arg_time_keys] = {
"-time_keys", NULL, "105",
"announces the time when keys are picked up",
Expand Down
1 change: 1 addition & 0 deletions prboom2/src/dsda/args.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ typedef enum {
dsda_arg_skiptic,
dsda_arg_track_pacifist,
dsda_arg_track_100k,
dsda_arg_track_reality,
dsda_arg_time_keys,
dsda_arg_time_use,
dsda_arg_time_secrets,
Expand Down

0 comments on commit 5ed9e91

Please sign in to comment.