(svn r9762) -Feature: Two new difficulty settings : Very low number of towns and very low number of industries

Based on FS#289, by pitt2
This commit is contained in:
belugas 2007-05-01 17:16:51 +00:00
parent f25a168c98
commit 9b7a615887
7 changed files with 25 additions and 12 deletions

View File

@ -213,8 +213,8 @@ static void GenerateLandscapeWndProc(Window *w, WindowEvent *e)
static const StringID tree_placer[] = {STR_CONFIG_PATCHES_TREE_PLACER_NONE, STR_CONFIG_PATCHES_TREE_PLACER_ORIGINAL, STR_CONFIG_PATCHES_TREE_PLACER_IMPROVED, INVALID_STRING_ID};
static const StringID rotation[] = {STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION_COUNTER_CLOCKWISE, STR_CONFIG_PATCHES_HEIGHTMAP_ROTATION_CLOCKWISE, INVALID_STRING_ID};
static const StringID landscape[] = {STR_CONFIG_PATCHES_LAND_GENERATOR_ORIGINAL, STR_CONFIG_PATCHES_LAND_GENERATOR_TERRA_GENESIS, INVALID_STRING_ID};
static const StringID num_towns[] = {STR_6816_LOW, STR_6817_NORMAL, STR_6818_HIGH, INVALID_STRING_ID};
static const StringID num_inds[] = {STR_26816_NONE, STR_6816_LOW, STR_6817_NORMAL, STR_6818_HIGH, INVALID_STRING_ID};
static const StringID num_towns[] = {STR_NUM_VERY_LOW, STR_6816_LOW, STR_6817_NORMAL, STR_6818_HIGH, INVALID_STRING_ID};
static const StringID num_inds[] = {STR_26816_NONE, STR_NUM_VERY_LOW, STR_6816_LOW, STR_6817_NORMAL, STR_6818_HIGH, INVALID_STRING_ID};
/* Data used for the generate seed edit box */
static querystr_d _genseed_query;

View File

@ -1541,9 +1541,10 @@ Industry *CreateNewIndustry(TileIndex tile, IndustryType type)
return CreateNewIndustryHelper(tile, type, DC_EXEC, indspec, it);
}
static const byte _numof_industry_table[4][12] = {
static const byte _numof_industry_table[5][12] = {
/* difficulty settings for number of industries */
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, //none
{0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}, //very low
{0, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5}, //low
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, //normal
{0, 2, 3, 4, 6, 7, 8, 9, 10, 10, 10}, //high

View File

@ -2038,6 +2038,7 @@ STR_16816_CITY_APPROVAL :{LTBLUE}City co
############ range for difficulty settings ends
STR_26816_NONE :None
STR_NUM_VERY_LOW :Very low
STR_6816_LOW :Low
STR_6817_NORMAL :Normal
STR_6818_HIGH :High

View File

@ -1938,6 +1938,17 @@ bool AfterLoadGame()
}
}
if (CheckSavegameVersion(58)) {
/* patch difficulty number_industries other then zero get bumped to +1
* since a new option (very low at position1) has been added */
if (_opt.diff.number_industries > 0) {
_opt.diff.number_industries++;
}
/* Same goes for number of towns, although no test is needed, just an increment */
_opt.diff.number_towns++;
}
return true;
}

View File

@ -29,7 +29,7 @@
#include <setjmp.h>
#include <list>
extern const uint16 SAVEGAME_VERSION = 57;
extern const uint16 SAVEGAME_VERSION = 58;
uint16 _sl_version; ///< the major savegame version identifier
byte _sl_minor_version; ///< the minor savegame version, DO NOT USE!

View File

@ -309,8 +309,8 @@ struct GameSettingData {
static const GameSettingData _game_setting_info[] = {
{ 0, 7, 1, STR_NULL},
{ 0, 3, 1, STR_6830_IMMEDIATE},
{ 0, 2, 1, STR_6816_LOW},
{ 0, 3, 1, STR_26816_NONE},
{ 0, 3, 1, STR_NUM_VERY_LOW},
{ 0, 4, 1, STR_26816_NONE},
{100, 500, 50, STR_NULL},
{ 2, 4, 1, STR_NULL},
{ 0, 2, 1, STR_6820_LOW},
@ -330,8 +330,8 @@ static const GameSettingData _game_setting_info[] = {
/*
* A: competitors
* B: start time in months / 3
* C: town count (2 = high, 0 = low)
* D: industry count (3 = high, 0 = none)
* C: town count (2 = high, 0 = very low)
* D: industry count (4 = high, 0 = none)
* E: inital loan / 1000 (in GBP)
* F: interest rate
* G: running costs (0 = low, 2 = high)
@ -349,9 +349,9 @@ static const GameSettingData _game_setting_info[] = {
*/
static const int16 _default_game_diff[3][GAME_DIFFICULTY_NUM] = { /*
A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R*/
{2, 2, 1, 3, 300, 2, 0, 2, 0, 1, 2, 0, 1, 0, 0, 0, 0, 0}, ///< easy
{4, 1, 1, 2, 150, 3, 1, 3, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1}, ///< medium
{7, 0, 2, 2, 100, 4, 1, 3, 2, 2, 0, 2, 3, 2, 1, 1, 1, 2}, ///< hard
{2, 2, 1, 4, 300, 2, 0, 2, 0, 1, 2, 0, 1, 0, 0, 0, 0, 0}, ///< easy
{4, 1, 1, 3, 150, 3, 1, 3, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1}, ///< medium
{7, 0, 0, 2, 100, 4, 1, 3, 2, 2, 0, 2, 3, 2, 1, 1, 1, 2}, ///< hard
};
void SetDifficultyLevel(int mode, GameOptions *gm_opt)

View File

@ -1251,7 +1251,7 @@ Town *CreateRandomTown(uint attempts, TownSizeMode mode, uint size)
return NULL;
}
static const byte _num_initial_towns[3] = {11, 23, 46};
static const byte _num_initial_towns[4] = {5, 11, 23, 46};
bool GenerateTowns()
{