Skip to content

Commit 2eccdb2

Browse files
committed
Random Map / Single Map no longer show the 'Game Won' screen
Random now repeats
1 parent 4dc1e32 commit 2eccdb2

5 files changed

Lines changed: 29 additions & 13 deletions

File tree

Source/Fodder.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3832,7 +3832,12 @@ void cFodder::Campaign_Selection() {
38323832

38333833
// Single Map Mode?
38343834
if (CampaignFile == "Single Map" || CampaignFile == "Random Map") {
3835-
3835+
3836+
if (CampaignFile == "Random Map") {
3837+
mStartParams->mSkipRecruit = false;
3838+
mParams->mSkipRecruit = false;
3839+
}
3840+
38363841
mGame_Data.mCampaign.SetSingleMapCampaign();
38373842
mCustom_Mode = eCustomMode_Map;
38383843
return;
@@ -18243,6 +18248,8 @@ void cFodder::About() {
1824318248
}
1824418249

1824518250
void cFodder::CreateRandom(sMapParams pParams) {
18251+
mSurface->clearBuffer();
18252+
1824618253
mGame_Data.mCampaign.CreateCustomCampaign();
1824718254
mGame_Data.mCampaign.setRandom(true);
1824818255
mGame_Data.mCampaign.setName("Random");
@@ -18400,14 +18407,18 @@ bool cFodder::GameOverCheck() {
1840018407
// Demo / Custom Mission restart
1840118408
if (mVersionCurrent->isDemo() && mCustom_Mode != eCustomMode_Set && !mVersionCurrent->isAmigaTheOne())
1840218409
return false;
18403-
18410+
1840418411
// Reached last map in this mission set?
18405-
if (!mGame_Data.Phase_Next()) {
18412+
if (!mGame_Data.Phase_Next() && !mVersionDefault->isRandom() && mCustom_Mode != eCustomMode_Map) {
1840618413

1840718414
mGame_Data.mGameWon = true;
1840818415
WonGame();
1840918416
return true;
1841018417
}
18418+
18419+
if (mVersionDefault->isRandom()) {
18420+
mGame_Data.mMission_Recruitment = -1;
18421+
}
1841118422
}
1841218423
}
1841318424

Source/Parameters.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,10 +265,10 @@ bool sFodderParameters::ProcessCLI(int argc, char *argv[]) {
265265

266266
mDisableSound = result["nosound"].as<bool>();
267267
mPlayground = result["playground"].as<bool>();
268-
269268
mSleepDelta = result["sleep-delta"].as<uint32_t>();
270269

271-
mCheatsEnabled = result["cheats"].as<bool>();
270+
if (result.count("cheats"))
271+
mCheatsEnabled = result["cheats"].as<bool>();
272272

273273
if(result.count("rows"))
274274
mWindowRows = result["rows"].as<std::uint32_t>();

Source/Recruits.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,7 @@ int16 cFodder::Recruit_Show() {
11631163

11641164
}
11651165
else {
1166-
if (mVersionCurrent->mName == "Random Map") {
1166+
if (mVersionDefault->mName == "Random Map") {
11671167
sMapParams Params(mRandom.get());
11681168
CreateRandom(Params);
11691169
mGame_Data.mMission_Recruitment = 0;
@@ -1185,7 +1185,7 @@ int16 cFodder::Recruit_Show() {
11851185
mSound->Music_Play(0);
11861186

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

11901190
// Recruit Screen
11911191
if (Recruit_Loop())

Source/Version.hpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ enum eRelease {
3636
AmigaNotVeryFestive,
3737
AmigaAlienLevels,
3838

39-
Custom
39+
Custom,
40+
eRandom
4041
};
4142

4243
enum eGame {
@@ -117,7 +118,11 @@ struct sVersion {
117118
}
118119

119120
bool isCustom() const {
120-
return mRelease == eRelease::Custom;
121+
return mRelease == eRelease::Custom || isRandom();
122+
}
123+
124+
bool isRandom() const {
125+
return mRelease == eRelease::eRandom;
121126
}
122127

123128
bool isRetail() const {

Source/Versions.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ const sGameVersion KnownGameVersions[] = {
112112
{ "Single Map", eGame::CF2, ePlatform::Amiga, eRelease::Custom, "Custom", { } },
113113
{ "Single Map", eGame::CF2, ePlatform::PC, eRelease::Custom, "Custom", { } },
114114

115-
{ "Random Map", eGame::CF1, ePlatform::Amiga, eRelease::Custom, "Custom", { } },
116-
{ "Random Map", eGame::CF1, ePlatform::PC, eRelease::Custom, "Custom", { } },
117-
{ "Random Map", eGame::CF2, ePlatform::Amiga, eRelease::Custom, "Custom", { } },
118-
{ "Random Map", eGame::CF2, ePlatform::PC, eRelease::Custom, "Custom", { } },
115+
{ "Random Map", eGame::CF1, ePlatform::Amiga, eRelease::eRandom, "Custom", { } },
116+
{ "Random Map", eGame::CF1, ePlatform::PC, eRelease::eRandom, "Custom", { } },
117+
{ "Random Map", eGame::CF2, ePlatform::Amiga, eRelease::eRandom, "Custom", { } },
118+
{ "Random Map", eGame::CF2, ePlatform::PC, eRelease::eRandom, "Custom", { } },
119119

120120
};
121121

0 commit comments

Comments
 (0)