Skip to content

Commit

Permalink
Random Map / Single Map no longer show the 'Game Won' screen
Browse files Browse the repository at this point in the history
Random now repeats
  • Loading branch information
segrax committed Jan 22, 2023
1 parent 4dc1e32 commit 2eccdb2
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 13 deletions.
17 changes: 14 additions & 3 deletions Source/Fodder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3832,7 +3832,12 @@ void cFodder::Campaign_Selection() {

// Single Map Mode?
if (CampaignFile == "Single Map" || CampaignFile == "Random Map") {


if (CampaignFile == "Random Map") {
mStartParams->mSkipRecruit = false;
mParams->mSkipRecruit = false;
}

mGame_Data.mCampaign.SetSingleMapCampaign();
mCustom_Mode = eCustomMode_Map;
return;
Expand Down Expand Up @@ -18243,6 +18248,8 @@ void cFodder::About() {
}

void cFodder::CreateRandom(sMapParams pParams) {
mSurface->clearBuffer();

mGame_Data.mCampaign.CreateCustomCampaign();
mGame_Data.mCampaign.setRandom(true);
mGame_Data.mCampaign.setName("Random");
Expand Down Expand Up @@ -18400,14 +18407,18 @@ bool cFodder::GameOverCheck() {
// Demo / Custom Mission restart
if (mVersionCurrent->isDemo() && mCustom_Mode != eCustomMode_Set && !mVersionCurrent->isAmigaTheOne())
return false;

// Reached last map in this mission set?
if (!mGame_Data.Phase_Next()) {
if (!mGame_Data.Phase_Next() && !mVersionDefault->isRandom() && mCustom_Mode != eCustomMode_Map) {

mGame_Data.mGameWon = true;
WonGame();
return true;
}

if (mVersionDefault->isRandom()) {
mGame_Data.mMission_Recruitment = -1;
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions Source/Parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ bool sFodderParameters::ProcessCLI(int argc, char *argv[]) {

mDisableSound = result["nosound"].as<bool>();
mPlayground = result["playground"].as<bool>();

mSleepDelta = result["sleep-delta"].as<uint32_t>();

mCheatsEnabled = result["cheats"].as<bool>();
if (result.count("cheats"))
mCheatsEnabled = result["cheats"].as<bool>();

if(result.count("rows"))
mWindowRows = result["rows"].as<std::uint32_t>();
Expand Down
4 changes: 2 additions & 2 deletions Source/Recruits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ int16 cFodder::Recruit_Show() {

}
else {
if (mVersionCurrent->mName == "Random Map") {
if (mVersionDefault->mName == "Random Map") {
sMapParams Params(mRandom.get());
CreateRandom(Params);
mGame_Data.mMission_Recruitment = 0;
Expand All @@ -1185,7 +1185,7 @@ int16 cFodder::Recruit_Show() {
mSound->Music_Play(0);

// Retail / Custom set show the Recruitment Hill
if (mVersionCurrent->isRetail() || mVersionCurrent->isPCFormat() || mCustom_Mode == eCustomMode_Set) {
if (mVersionCurrent->isRetail() || mVersionCurrent->isPCFormat() || mVersionCurrent->isRandom() || mCustom_Mode == eCustomMode_Set) {

// Recruit Screen
if (Recruit_Loop())
Expand Down
9 changes: 7 additions & 2 deletions Source/Version.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ enum eRelease {
AmigaNotVeryFestive,
AmigaAlienLevels,

Custom
Custom,
eRandom
};

enum eGame {
Expand Down Expand Up @@ -117,7 +118,11 @@ struct sVersion {
}

bool isCustom() const {
return mRelease == eRelease::Custom;
return mRelease == eRelease::Custom || isRandom();
}

bool isRandom() const {
return mRelease == eRelease::eRandom;
}

bool isRetail() const {
Expand Down
8 changes: 4 additions & 4 deletions Source/Versions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ const sGameVersion KnownGameVersions[] = {
{ "Single Map", eGame::CF2, ePlatform::Amiga, eRelease::Custom, "Custom", { } },
{ "Single Map", eGame::CF2, ePlatform::PC, eRelease::Custom, "Custom", { } },

{ "Random Map", eGame::CF1, ePlatform::Amiga, eRelease::Custom, "Custom", { } },
{ "Random Map", eGame::CF1, ePlatform::PC, eRelease::Custom, "Custom", { } },
{ "Random Map", eGame::CF2, ePlatform::Amiga, eRelease::Custom, "Custom", { } },
{ "Random Map", eGame::CF2, ePlatform::PC, eRelease::Custom, "Custom", { } },
{ "Random Map", eGame::CF1, ePlatform::Amiga, eRelease::eRandom, "Custom", { } },
{ "Random Map", eGame::CF1, ePlatform::PC, eRelease::eRandom, "Custom", { } },
{ "Random Map", eGame::CF2, ePlatform::Amiga, eRelease::eRandom, "Custom", { } },
{ "Random Map", eGame::CF2, ePlatform::PC, eRelease::eRandom, "Custom", { } },

};

Expand Down

0 comments on commit 2eccdb2

Please sign in to comment.