Add setting: station rating waiting time tolerance depends on cargo class

pull/59/head
Jonathan G Rennison 6 years ago
parent 7ef881883d
commit d2d8a86814

@ -1180,6 +1180,8 @@ STR_CONFIG_SETTING_CATCHMENT :Allow more real
STR_CONFIG_SETTING_CATCHMENT_HELPTEXT :Have differently sized catchment areas for different types of stations and airports
STR_CONFIG_SETTING_CATCHMENT_INCREASE :Increase station catchment radius: {STRING2}
STR_CONFIG_SETTING_CATCHMENT_INCREASE_HELPTEXT :Increase radius of station catchment areas by this many tiles
STR_CONFIG_SETTING_STATION_RATING_CARGO_CLASS_WAIT_TIME :Station rating tolerance to waiting time depends on cargo class: {STRING2}
STR_CONFIG_SETTING_STATION_RATING_CARGO_CLASS_WAIT_TIME_HELPTEXT:When enabled, the effect of the waiting time since the last cargo pickup on the station rating for that cargo depends on the cargo class. Passengers, mail, armoured cargo, refrigerated cargo and express cargo, are varyingly less tolerant to waiting. Bulk and liquid cargos are more tolerant.
STR_CONFIG_SETTING_EXTRADYNAMITE :Allow removal of more town-owned roads, bridges and tunnels: {STRING2}
STR_CONFIG_SETTING_EXTRADYNAMITE_HELPTEXT :Make it easier to remove town-owned infrastructure and buildings
STR_CONFIG_SETTING_TRAIN_LENGTH :Maximum length of trains: {STRING2}

@ -1830,6 +1830,7 @@ static SettingsContainer &GetSettingsTree()
environment->Add(new SettingEntry("station.modified_catchment"));
environment->Add(new SettingEntry("station.catchment_increase"));
environment->Add(new SettingEntry("station.cargo_class_rating_wait_time"));
}
SettingsPage *ai = main->Add(new SettingsPage(STR_CONFIG_SETTING_AI));

@ -604,6 +604,7 @@ struct StationSettings {
bool never_expire_airports; ///< never expire airports
byte station_spread; ///< amount a station may spread
byte catchment_increase; ///< amount by which station catchment is increased
byte cargo_class_rating_wait_time; ///< station rating tolerance to time since last cargo pickup depends on cargo class
};
/** Default settings for vehicles. */

@ -3500,7 +3500,18 @@ static void UpdateStationRating(Station *st)
int b = ge->last_speed - 85;
if (b >= 0) rating += b >> 2;
byte waittime = ge->time_since_pickup;
uint waittime = ge->time_since_pickup;
if (_settings_game.station.cargo_class_rating_wait_time) {
if (cs->classes & CC_PASSENGERS) {
waittime *= 3;
} else if (cs->classes & CC_REFRIGERATED) {
waittime *= 2;
} else if (cs->classes & (CC_MAIL | CC_ARMOURED | CC_EXPRESS)) {
waittime += (waittime >> 1);
} else if (cs->classes & (CC_BULK | CC_LIQUID)) {
waittime >>= 2;
}
}
if (ge->last_vehicle_type == VEH_SHIP) waittime >>= 2;
(waittime > 21) ||
(rating += 25, waittime > 12) ||

@ -1421,6 +1421,14 @@ proc = StationCatchmentChanged
extver = SlXvFeatureTest(XSLFTO_AND, XSLFI_STATION_CATCHMENT_INC)
patxname = ""station_catchment_inc.station.catchment_increase""
[SDT_BOOL]
base = GameSettings
var = station.cargo_class_rating_wait_time
def = false
str = STR_CONFIG_SETTING_STATION_RATING_CARGO_CLASS_WAIT_TIME
strhelp = STR_CONFIG_SETTING_STATION_RATING_CARGO_CLASS_WAIT_TIME_HELPTEXT
patxname = ""station_rating.station.cargo_class_rating_wait_time""
[SDT_BOOL]
base = GameSettings
var = order.gradual_loading

Loading…
Cancel
Save