From 069b6a9fab6749e989d8d2a8659e51fb0cf30574 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 3 Jan 2010 21:29:20 +0000 Subject: (svn r18703) -Feature-ish: allow virtually paying a percentage of the leg profit in feeder chains. This to give the user a better chance to get a feeder system without "losses". --- src/economy.cpp | 2 ++ src/lang/english.txt | 1 + src/saveload/saveload.cpp | 2 +- src/settings_gui.cpp | 1 + src/settings_type.h | 1 + src/table/settings.h | 1 + 6 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/economy.cpp b/src/economy.cpp index c75d2cd19..50eb31775 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -1068,6 +1068,8 @@ Money CargoPayment::PayTransfer(const CargoPacket *cp, uint count) cp->DaysInTransit(), this->ct); + profit = profit * _settings_game.economy.feeder_payment_share / 100; + this->visual_profit += profit; // accumulate transfer profits for whole vehicle return profit; // account for the (virtual) profit already made for the cargo packet } diff --git a/src/lang/english.txt b/src/lang/english.txt index c2eaf6488..5d0966f2a 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1242,6 +1242,7 @@ STR_CONFIG_SETTING_COLOURED_NEWS_YEAR :{LTBLUE}Coloure STR_CONFIG_SETTING_STARTING_YEAR :{LTBLUE}Starting year: {ORANGE}{STRING1} STR_CONFIG_SETTING_SMOOTH_ECONOMY :{LTBLUE}Enable smooth economy (more, smaller changes): {ORANGE}{STRING1} STR_CONFIG_SETTING_ALLOW_SHARES :{LTBLUE}Allow buying shares from other companies: {ORANGE}{STRING1} +STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE :{LTBLUE}Percentage of leg profit to pay in feeder systems: {ORANGE}{STRING1}% STR_CONFIG_SETTING_DRAG_SIGNALS_DENSITY :{LTBLUE}When dragging, place signals every: {ORANGE}{STRING1} tile(s) STR_CONFIG_SETTING_SEMAPHORE_BUILD_BEFORE_DATE :{LTBLUE}Automatically build semaphores before: {ORANGE}{STRING1} STR_CONFIG_SETTING_ENABLE_SIGNAL_GUI :{LTBLUE}Enable the signal GUI: {ORANGE}{STRING1} diff --git a/src/saveload/saveload.cpp b/src/saveload/saveload.cpp index c94f43b8c..e7e40c72d 100644 --- a/src/saveload/saveload.cpp +++ b/src/saveload/saveload.cpp @@ -47,7 +47,7 @@ #include "saveload_internal.h" -extern const uint16 SAVEGAME_VERSION = 133; +extern const uint16 SAVEGAME_VERSION = 134; SavegameType _savegame_type; ///< type of savegame we are loading diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 5b70640db..9f35482a4 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1372,6 +1372,7 @@ static SettingEntry _settings_economy[] = { SettingEntry(&_settings_economy_industries_page, STR_CONFIG_SETTING_ECONOMY_INDUSTRIES), SettingEntry("economy.inflation"), SettingEntry("economy.smooth_economy"), + SettingEntry("economy.feeder_payment_share"), }; /** Economy sub-page */ static SettingsPage _settings_economy_page = {_settings_economy, lengthof(_settings_economy)}; diff --git a/src/settings_type.h b/src/settings_type.h index 383b89e7d..5fef70dfa 100644 --- a/src/settings_type.h +++ b/src/settings_type.h @@ -328,6 +328,7 @@ struct EconomySettings { bool bribe; ///< enable bribing the local authority bool smooth_economy; ///< smooth economy bool allow_shares; ///< allow the buying/selling of shares + uint8 feeder_payment_share; ///< percentage of leg payment to virtually pay in feeder systems byte dist_local_authority; ///< distance for town local authority, default 20 bool exclusive_rights; ///< allow buying exclusive rights bool give_money; ///< allow giving other companies money diff --git a/src/table/settings.h b/src/table/settings.h index 232e55355..7b7971c3d 100644 --- a/src/table/settings.h +++ b/src/table/settings.h @@ -434,6 +434,7 @@ const SettingDesc _settings[] = { SDT_CONDNULL( 4, 0, 104), SDT_BOOL(GameSettings, economy.smooth_economy, 0, 0, true, STR_CONFIG_SETTING_SMOOTH_ECONOMY, NULL), SDT_BOOL(GameSettings, economy.allow_shares, 0, 0, false, STR_CONFIG_SETTING_ALLOW_SHARES, NULL), + SDT_CONDVAR(GameSettings, economy.feeder_payment_share, SLE_UINT8,134, SL_MAX_VERSION, 0, 0, 75, 0, 100, 0, STR_CONFIG_SETTING_FEEDER_PAYMENT_SHARE, NULL), SDT_CONDVAR(GameSettings, economy.town_growth_rate, SLE_UINT8, 54, SL_MAX_VERSION, 0, MS, 2, 0, 4, 0, STR_CONFIG_SETTING_TOWN_GROWTH, NULL), SDT_CONDVAR(GameSettings, economy.larger_towns, SLE_UINT8, 54, SL_MAX_VERSION, 0, D0, 4, 0, 255, 1, STR_CONFIG_SETTING_LARGER_TOWNS, NULL), SDT_CONDVAR(GameSettings, economy.initial_city_size, SLE_UINT8, 56, SL_MAX_VERSION, 0, 0, 2, 1, 10, 1, STR_CONFIG_SETTING_CITY_SIZE_MULTIPLIER, NULL), -- cgit v1.2.3-54-g00ecf