Add play-by-mail mode #419
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Bringing back play-by-mail by adding a new game mode that sets the MAIL global variable to 0 on U.S. turns and 1 on Soviet turns. The main strategy is that U.S. missions are launched twice; once after the U.S. turn to determine the outcome, and a second time after the Soviet turn (reusing the mission events from the U.S. turn) to determine Prestige. Before the save file is sent to the Soviet side, Data->Prestige and the U.S. mission counter are restored to their previous states.
At the beginning of the turn, the U.S. player is informed about the Prestige results of the previous turn and about any Prestige Firsts acheived by the Soviet side. The Soviet side sees the U.S. Prestige Firsts during the Soviet mission resolution, i.e., like when playing against the AI.
Turns are played the usual way, with a file saving dialog appearing after ending the turn. As the Data struct contains two new fields for mission resolution, this breaks save game compatibility.
At some points, I have hit some ancient codepaths, like when starting the mail game by calling Prefs(3). While things seem to work, there might be unintended side effects. Therefore, expect bugs.
Resolves #131 and #346.