diff options
author | belugas <belugas@openttd.org> | 2007-05-01 17:16:51 +0000 |
---|---|---|
committer | belugas <belugas@openttd.org> | 2007-05-01 17:16:51 +0000 |
commit | 9b7a615887ea3c38113035dee72462441fae4ac3 (patch) | |
tree | bf93bc8357cca9a06087d150d441d6b6b9113a71 /src | |
parent | f25a168c98ff5178f746dcf62f25c073dfbfd043 (diff) | |
download | openttd-9b7a615887ea3c38113035dee72462441fae4ac3.tar.xz |
(svn r9762) -Feature: Two new difficulty settings : Very low number of towns and very low number of industries
Based on FS#289, by pitt2
Diffstat (limited to 'src')
-rw-r--r-- | src/genworld_gui.cpp | 4 | ||||
-rw-r--r-- | src/industry_cmd.cpp | 3 | ||||
-rw-r--r-- | src/lang/english.txt | 1 | ||||
-rw-r--r-- | src/openttd.cpp | 11 | ||||
-rw-r--r-- | src/saveload.cpp | 2 | ||||
-rw-r--r-- | src/settings_gui.cpp | 14 | ||||
-rw-r--r-- | src/town_cmd.cpp | 2 |
7 files changed, 25 insertions, 12 deletions
diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index b78f14ea5..beb6c0b6c 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -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; diff --git a/src/industry_cmd.cpp b/src/industry_cmd.cpp index 17f6d6dc5..79bbbeeb0 100644 --- a/src/industry_cmd.cpp +++ b/src/industry_cmd.cpp @@ -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 diff --git a/src/lang/english.txt b/src/lang/english.txt index 7e0e22ec9..c8fea1eaa 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -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 diff --git a/src/openttd.cpp b/src/openttd.cpp index b5a8b385f..1ba3b5d46 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -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; } diff --git a/src/saveload.cpp b/src/saveload.cpp index fd6f1f979..a53d1150e 100644 --- a/src/saveload.cpp +++ b/src/saveload.cpp @@ -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! diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index cecc0176e..beaa8eff0 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -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) diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index 7b220ab9c..60fcead82 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -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() { |