From 7de37e07b640292ba2d9b8c8aae673ad15de2827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20W=C3=A4rmedal?= Date: Fri, 14 Jul 2023 14:00:28 +0200 Subject: [PATCH] Change: make Exclusive Transport Rights more exclusive (#11076) Now, exclusive transport rights can only be bought if no company currently owns them. A successful bribe will void any exclusive transport rights that any *other* company currently has in the town. --- src/lang/english.txt | 4 ++-- src/town_cmd.cpp | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/lang/english.txt b/src/lang/english.txt index 56c5928149..0e654500fb 100644 --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -3539,8 +3539,8 @@ STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_LARGE_ADVERTISING :{PUSH_COLOUR}{Y STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_ROAD_RECONSTRUCTION :{PUSH_COLOUR}{YELLOW}Fund the reconstruction of the urban road network.{}Causes considerable disruption to road traffic for up to 6 months.{}{POP_COLOUR}Cost: {CURRENCY_LONG} STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_STATUE_OF_COMPANY :{PUSH_COLOUR}{YELLOW}Build a statue in honour of your company.{}Provides a permanent boost to station rating in this town.{}{POP_COLOUR}Cost: {CURRENCY_LONG} STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_NEW_BUILDINGS :{PUSH_COLOUR}{YELLOW}Fund the construction of new buildings in the town.{}Provides a temporary boost to town growth in this town.{}{POP_COLOUR}Cost: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{PUSH_COLOUR}{YELLOW}Buy 1 year's exclusive transport rights in town.{}Town authority will not allow passengers and cargo to use your competitors' stations.{}{POP_COLOUR}Cost: {CURRENCY_LONG} -STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{PUSH_COLOUR}{YELLOW}Bribe the local authority to increase your rating, at the risk of a severe penalty if caught.{}{POP_COLOUR}Cost: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_EXCLUSIVE_TRANSPORT :{PUSH_COLOUR}{YELLOW}Buy 1 year's exclusive transport rights in town.{}Town authority will not allow passengers and cargo to use your competitors' stations. A successful bribe from a competitor will cancel this contract.{}{POP_COLOUR}Cost: {CURRENCY_LONG} +STR_LOCAL_AUTHORITY_ACTION_TOOLTIP_BRIBE :{PUSH_COLOUR}{YELLOW}Bribe the local authority to increase your rating and abort a competitor's exclusive transport rights, at the risk of a severe penalty if caught.{}{POP_COLOUR}Cost: {CURRENCY_LONG} # Goal window STR_GOALS_CAPTION :{WHITE}{COMPANY} Goals diff --git a/src/town_cmd.cpp b/src/town_cmd.cpp index ae032937ea..6891504b9c 100644 --- a/src/town_cmd.cpp +++ b/src/town_cmd.cpp @@ -3242,6 +3242,7 @@ static CommandCost TownActionBuyRights(Town *t, DoCommandFlag flags) { /* Check if it's allowed to buy the rights */ if (!_settings_game.economy.exclusive_rights) return CMD_ERROR; + if (t->exclusivity != INVALID_COMPANY) return CMD_ERROR; if (flags & DC_EXEC) { t->exclusive_counter = 12; @@ -3292,6 +3293,10 @@ static CommandCost TownActionBribe(Town *t, DoCommandFlag flags) } } else { ChangeTownRating(t, RATING_BRIBE_UP_STEP, RATING_BRIBE_MAXIMUM, DC_EXEC); + if (t->exclusivity != _current_company && t->exclusivity != INVALID_COMPANY) { + t->exclusivity = INVALID_COMPANY; + t->exclusive_counter = 0; + } } } return CommandCost(); @@ -3334,7 +3339,7 @@ TownActions GetMaskOfTownActions(CompanyID cid, const Town *t) if (cur == TACT_BRIBE && (!_settings_game.economy.bribe || t->ratings[cid] >= RATING_BRIBE_MAXIMUM)) continue; /* Is the company not able to buy exclusive rights ? */ - if (cur == TACT_BUY_RIGHTS && !_settings_game.economy.exclusive_rights) continue; + if (cur == TACT_BUY_RIGHTS && (!_settings_game.economy.exclusive_rights || t->exclusive_counter != 0)) continue; /* Is the company not able to fund buildings ? */ if (cur == TACT_FUND_BUILDINGS && !_settings_game.economy.fund_buildings) continue;