From ba5ed29e92aef1332d9118e0d49ba7e43099c9c9 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 8 Jul 2023 22:18:04 +0300 Subject: [PATCH 14/14] Unify "Traderoute" to "Trade Route" The only things not changed: - Ruleset format (i.e. requirement and effect names) - Savegame format - File names See osdn #45913 Signed-off-by: Marko Lindqvist --- ai/default/daicity.c | 42 ++++++++-------- ai/default/daidomestic.c | 6 +-- ai/default/daieffects.c | 2 +- client/citydlg_common.c | 2 +- client/control.c | 4 +- client/gui-qt/menu.cpp | 12 ++--- client/gui-qt/menu.h | 4 +- client/gui-qt/shortcuts.cpp | 2 +- client/helpdata.c | 8 +-- client/packhand.c | 7 +-- common/aicore/caravan.c | 2 +- common/aicore/cm.c | 6 +-- common/city.c | 2 +- common/effects.h | 3 +- common/metaknowledge.c | 20 ++++---- common/metaknowledge.h | 2 +- common/networking/packets.def | 8 +-- common/reqtext.c | 70 +++++++++++++-------------- common/requirements.c | 64 ++++++++++++------------ common/requirements.h | 3 +- common/traderoutes.c | 20 ++++---- common/traderoutes.h | 14 +++--- data/alien/README.alien | 2 +- data/alien/game.ruleset | 8 +-- data/civ1/game.ruleset | 14 +++--- data/civ2/game.ruleset | 10 ++-- data/civ2civ3/game.ruleset | 8 +-- data/classic/game.ruleset | 8 +-- data/experimental/README.experimental | 2 +- data/experimental/game.ruleset | 8 +-- data/granularity/game.ruleset | 6 +-- data/multiplayer/game.ruleset | 6 +-- data/ruledit/comments-3.1.txt | 6 +-- data/sandbox/game.ruleset | 8 +-- data/stub/game.ruleset | 6 +-- data/webperimental/game.ruleset | 8 +-- doc/README.effects | 6 +-- server/citytools.c | 56 ++++++++++----------- server/citytools.h | 12 ++--- server/cityturn.c | 6 +-- server/diplomats.c | 12 ++--- server/rssanity.c | 2 +- server/ruleset.c | 10 ++-- server/settings.c | 2 +- server/unithand.c | 4 +- tools/ruleutil/rulesave.c | 4 +- 46 files changed, 260 insertions(+), 257 deletions(-) diff --git a/ai/default/daicity.c b/ai/default/daicity.c index 287d9f3a12..f9fcd2c70e 100644 --- a/ai/default/daicity.c +++ b/ai/default/daicity.c @@ -86,28 +86,28 @@ /* Iterate over cities within a certain range around a given city * (city_here) that exist within a given city list. */ -#define city_range_iterate(city_here, list, range, city) \ -{ \ - city_list_iterate(list, city) { \ - if (range == REQ_RANGE_PLAYER \ - || range == REQ_RANGE_TEAM \ +#define city_range_iterate(city_here, list, range, city) \ +{ \ + city_list_iterate(list, city) { \ + if (range == REQ_RANGE_PLAYER \ + || range == REQ_RANGE_TEAM \ || range == REQ_RANGE_ALLIANCE \ - || (range == REQ_RANGE_TRADEROUTE \ + || (range == REQ_RANGE_TRADE_ROUTE \ && (city == city_here \ || have_cities_trade_route(city, city_here))) \ - || ((range == REQ_RANGE_CITY || range == REQ_RANGE_LOCAL) \ - && city == city_here) \ - || (range == REQ_RANGE_CONTINENT \ - && tile_continent(city->tile) == \ - tile_continent(city_here->tile))) { - -#define city_range_iterate_end \ - } \ - } city_list_iterate_end; \ + || ((range == REQ_RANGE_CITY || range == REQ_RANGE_LOCAL) \ + && city == city_here) \ + || (range == REQ_RANGE_CONTINENT \ + && tile_continent(city->tile) == \ + tile_continent(city_here->tile))) { + +#define city_range_iterate_end \ + } \ + } city_list_iterate_end; \ } -#define CITY_EMERGENCY(pcity) \ - (pcity->surplus[O_SHIELD] < 0 || city_unhappy(pcity) \ +#define CITY_EMERGENCY(pcity) \ + (pcity->surplus[O_SHIELD] < 0 || city_unhappy(pcity) \ || pcity->food_stock + pcity->surplus[O_FOOD] < 0) static void dai_city_sell_noncritical(struct city *pcity, bool redundant_only); @@ -279,7 +279,7 @@ static void dai_city_choose_build(struct ai_type *ait, struct player *pplayer, if (city_data->choice.want == 0) { /* Fallbacks do happen with techlevel 0, which is now default. -- Per */ CITY_LOG(LOG_WANT, pcity, "Falling back - didn't want to build soldiers," - " workers, caravans, settlers, or buildings!"); + " workers, caravans, settlers, or buildings!"); city_data->choice.want = 1; if (best_role_unit(pcity, action_id_get_role(ACTION_TRADE_ROUTE))) { city_data->choice.value.utype @@ -323,8 +323,8 @@ static void dai_city_choose_build(struct ai_type *ait, struct player *pplayer, #endif /* ADV_CHOICE_TRACK */ CITY_LOG(LOG_DEBUG, pcity, "wants %s with desire " ADV_WANT_PRINTF ".", - dai_choice_rule_name(&city_data->choice), - city_data->choice.want); + dai_choice_rule_name(&city_data->choice), + city_data->choice.want); switch (city_data->choice.type) { case CT_CIVILIAN: @@ -1649,7 +1649,7 @@ static void adjust_improvement_wants_by_effects(struct ai_type *ait, } /* All the trade partners and the city being considered. */ - cities[REQ_RANGE_TRADEROUTE] = city_num_trade_routes(pcity)+1; + cities[REQ_RANGE_TRADE_ROUTE] = city_num_trade_routes(pcity) + 1; cities[REQ_RANGE_CITY] = cities[REQ_RANGE_LOCAL] = 1; diff --git a/ai/default/daidomestic.c b/ai/default/daidomestic.c index 75c674936d..23d5a48617 100644 --- a/ai/default/daidomestic.c +++ b/ai/default/daidomestic.c @@ -256,7 +256,7 @@ static void dai_choose_trade_route(struct ai_type *ait, struct city *pcity, /* Look for proper destination city for trade. */ if (trade_route_type_trade_pct(TRT_NATIONAL) > 0 || trade_route_type_trade_pct(TRT_NATIONAL_IC) > 0) { - /* National traderoutes have value */ + /* National trade routes have value */ city_list_iterate(pplayer->cities, acity) { if (can_cities_trade(pcity, acity)) { if (tile_continent(acity->tile) != continent) { @@ -281,7 +281,7 @@ static void dai_choose_trade_route(struct ai_type *ait, struct city *pcity, } /* FIXME: This check should consider more about relative - * income from different traderoute types. This works just + * income from different trade route types. This works just * with more typical ruleset setups. */ if (prefer_different_cont && !dest_city_nat_different_cont) { if (trade_route_type_trade_pct(TRT_IN_IC) > @@ -331,7 +331,7 @@ static void dai_choose_trade_route(struct ai_type *ait, struct city *pcity, } trade_routes = city_num_trade_routes(pcity); - /* Count also caravans enroute to establish traderoutes */ + /* Count also caravans enroute to establish trade routes */ caravan_units = 0; unit_list_iterate(pcity->units_supported, punit) { if (unit_can_do_action(punit, ACTION_TRADE_ROUTE)) { diff --git a/ai/default/daieffects.c b/ai/default/daieffects.c index 4439e36932..46f093dc66 100644 --- a/ai/default/daieffects.c +++ b/ai/default/daieffects.c @@ -639,7 +639,7 @@ adv_want dai_effect_value(struct player *pplayer, v += trait; } break; - case EFT_TRADEROUTE_PCT: + case EFT_TRADE_ROUTE_PCT: { int trade = 0; diff --git a/client/citydlg_common.c b/client/citydlg_common.c index 87ad70f5ee..1321b6245a 100644 --- a/client/citydlg_common.c +++ b/client/citydlg_common.c @@ -762,7 +762,7 @@ void get_city_dialog_output_text(const struct city *pcity, /* TRANS: Trade partner unknown to client */ const char *name = trade_city ? city_name_get(trade_city) : _("(unknown)"); int value = proute->value - * (100 + get_city_bonus(pcity, EFT_TRADEROUTE_PCT)) / 100; + * (100 + get_city_bonus(pcity, EFT_TRADE_ROUTE_PCT)) / 100; switch (proute->dir) { case RDIR_BIDIRECTIONAL: diff --git a/client/control.c b/client/control.c index 4ed4bc2d50..be14b1fb9d 100644 --- a/client/control.c +++ b/client/control.c @@ -2103,7 +2103,7 @@ void request_unit_unload(struct unit *pcargo) } /**********************************************************************//** - Send request to do caravan action - establishing traderoute or + Send request to do caravan action - establishing trade route or helping in wonder building - to server. **************************************************************************/ void request_unit_caravan_action(struct unit *punit, action_id action) @@ -3292,7 +3292,7 @@ void key_unit_patrol(void) } /**********************************************************************//** - Handle user 'establish traderoute' input + Handle user 'establish trade route' input **************************************************************************/ void key_unit_trade_route(void) { diff --git a/client/gui-qt/menu.cpp b/client/gui-qt/menu.cpp index be702a868d..106e7829fa 100644 --- a/client/gui-qt/menu.cpp +++ b/client/gui-qt/menu.cpp @@ -1144,12 +1144,12 @@ void mr_menu::setup_menus() act->setCheckable(true); act->setChecked(gui_options.draw_city_buycost); connect(act, &QAction::triggered, this, &mr_menu::slot_city_buycost); - act = menu->addAction(_("City Traderoutes")); + act = menu->addAction(_("City Trade Routes")); act->setCheckable(true); act->setChecked(gui_options.draw_city_trade_routes); act->setShortcut(QKeySequence(shortcut_to_string( fc_shortcuts::sc()->get_shortcut(SC_TRADE_ROUTES)))); - connect(act, &QAction::triggered, this, &mr_menu::slot_city_traderoutes); + connect(act, &QAction::triggered, this, &mr_menu::slot_city_trade_routes); act = menu->addAction(_("Unit Stack Size")); act->setCheckable(true); act->setChecked(gui_options.draw_unit_stack_size); @@ -1389,7 +1389,7 @@ void mr_menu::setup_menus() act = menu->addAction(QString(action_id_name_translation(ACTION_TRADE_ROUTE)) .replace("&", "&&")); act->setShortcut(QKeySequence(tr("r"))); - menu_list.insert(ORDER_TRADEROUTE, act); + menu_list.insert(ORDER_TRADE_ROUTE, act); connect(act, &QAction::triggered, this, &mr_menu::slot_build_road); multiplayer_menu = this->addMenu(_("Multiplayer")); @@ -2493,7 +2493,7 @@ void mr_menu::menus_sensitive() } break; - case ORDER_TRADEROUTE: + case ORDER_TRADE_ROUTE: i.value()->setText( QString(action_id_name_translation(ACTION_TRADE_ROUTE)) .replace("&", "&&")); @@ -3332,9 +3332,9 @@ void mr_menu::slot_city_production() } /**********************************************************************//** - Action "SHOW CITY TRADEROUTES" + Action "SHOW CITY TRADE ROUTES" **************************************************************************/ -void mr_menu::slot_city_traderoutes() +void mr_menu::slot_city_trade_routes() { key_city_trade_routes_toggle(); } diff --git a/client/gui-qt/menu.h b/client/gui-qt/menu.h index 3917c26d8d..c08ea5be54 100644 --- a/client/gui-qt/menu.h +++ b/client/gui-qt/menu.h @@ -69,7 +69,7 @@ enum munit { AIRLIFT, BUILD_WONDER, AUTOTRADEROUTE, - ORDER_TRADEROUTE, + ORDER_TRADE_ROUTE, ORDER_DIPLOMAT_DLG, UPGRADE, NOT_4_OBS, @@ -366,7 +366,7 @@ private slots: void slot_city_growth(); void slot_city_production(); void slot_city_buycost(); - void slot_city_traderoutes(); + void slot_city_trade_routes(); void slot_stack_size(); void slot_city_names(); void zoom_in(); diff --git a/client/gui-qt/shortcuts.cpp b/client/gui-qt/shortcuts.cpp index 5830b37f42..2185448523 100644 --- a/client/gui-qt/shortcuts.cpp +++ b/client/gui-qt/shortcuts.cpp @@ -94,7 +94,7 @@ fc_shortcut default_shortcuts[] = { {SC_SHOW_UNITS, Qt::Key_Space, Qt::AllButtons, Qt::ControlModifier, _("Units selection (for tile under mouse position)") }, {SC_TRADE_ROUTES, Qt::Key_D, Qt::AllButtons, Qt::ControlModifier, - _("City Traderoutes") }, + _("City Trade Routes") }, {SC_CITY_PROD, Qt::Key_P, Qt::AllButtons, Qt::ControlModifier, _("City Production Levels") }, {SC_CITY_NAMES, Qt::Key_N, Qt::AllButtons, Qt::ControlModifier, diff --git a/client/helpdata.c b/client/helpdata.c index 0251051b25..26ae36d00e 100644 --- a/client/helpdata.c +++ b/client/helpdata.c @@ -1443,7 +1443,7 @@ char *helptext_building(char *buf, size_t bufsz, struct player *pplayer, "action \'%s\'.\n"), action_id_name_translation(act)); break; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: /* At least one action enabler needed the building in its target * requirements. */ cat_snprintf(buf, bufsz, @@ -1578,7 +1578,7 @@ char *helptext_building(char *buf, size_t bufsz, struct player *pplayer, "its city.\n"), action_id_name_translation(act)); break; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: cat_snprintf(buf, bufsz, /* TRANS: Incite City */ _("* Makes it impossible to do the action \'%s\' to " @@ -4074,10 +4074,10 @@ void helptext_goods(char *buf, size_t bufsz, struct player *pplayer, if (pgood->onetime_pct == 0) { cat_snprintf(buf, bufsz, - _("There's no bonuses paid when traderoute is established.\n\n")); + _("There's no bonuses paid when trade route gets established.\n\n")); } else if (pgood->onetime_pct != 100) { cat_snprintf(buf, bufsz, - _("When traderoute is established, %d%% of the normal bonus is paid.\n"), + _("When trade route gets established, %d%% of the normal bonus is paid.\n"), pgood->onetime_pct); } cat_snprintf(buf, bufsz, _("Sending city enjoys %d%% income from the route.\n"), diff --git a/client/packhand.c b/client/packhand.c index 5770d0e364..55e41130c8 100644 --- a/client/packhand.c +++ b/client/packhand.c @@ -732,7 +732,7 @@ void handle_city_info(const struct packet_city_info *packet) name_changed = (0 != strncmp(packet->name, pcity->name, MAX_LEN_CITYNAME)); - while (trade_route_list_size(pcity->routes) > packet->traderoute_count) { + while (trade_route_list_size(pcity->routes) > packet->trade_route_count) { struct trade_route *proute = trade_route_list_get(pcity->routes, -1); trade_route_list_remove(pcity->routes, proute); @@ -1119,9 +1119,10 @@ static void city_packet_common(struct city *pcity, struct tile *pcenter, } /************************************************************************//** - A traderoute-info packet contains information about one end of a traderoute + A trade route-info packet contains information about one end + of a trade route ****************************************************************************/ -void handle_traderoute_info(const struct packet_traderoute_info *packet) +void handle_trade_route_info(const struct packet_trade_route_info *packet) { struct city *pcity = game_city_by_number(packet->city); struct trade_route *proute; diff --git a/common/aicore/caravan.c b/common/aicore/caravan.c index da6c7e3815..cf79ba0573 100644 --- a/common/aicore/caravan.c +++ b/common/aicore/caravan.c @@ -348,7 +348,7 @@ static double trade_benefit(const struct player *caravan_owner, return 0; } if (max_trade_routes(src) <= 0 || max_trade_routes(dest) <= 0) { - /* Can't create new traderoutes even by replacing old ones if + /* Can't create new trade routes even by replacing old ones if * there's no slots at all. */ return 0; } diff --git a/common/aicore/cm.c b/common/aicore/cm.c index 7263868c2f..06011fd96e 100644 --- a/common/aicore/cm.c +++ b/common/aicore/cm.c @@ -1621,9 +1621,9 @@ static void compute_max_stats_heuristic(const struct cm_state *state, } - /* we found the basic production, however, bonus, taxes, - free production, tithes, traderoutes are missing - we add free production, and have the city.c code do the rest */ + /* We found the basic production, however, bonus, taxes, + * free production, tithes, trade routes are missing. + * We add free production, and have the city.c code do the rest */ struct city *pcity = state->pcity; struct tile *pcenter = city_tile(pcity); diff --git a/common/city.c b/common/city.c index 49c32ecef9..00ccb81e40 100644 --- a/common/city.c +++ b/common/city.c @@ -2858,7 +2858,7 @@ inline void set_city_production(struct city *pcity) trade_base_between_cities(pcity, game_city_by_number(proute->partner)); proute->value = trade_from_route(pcity, proute, value); pcity->prod[O_TRADE] += proute->value - * (100 + get_city_bonus(pcity, EFT_TRADEROUTE_PCT)) / 100; + * (100 + get_city_bonus(pcity, EFT_TRADE_ROUTE_PCT)) / 100; } else { proute->value = 0; } diff --git a/common/effects.h b/common/effects.h index 85e91703d6..3f4172a722 100644 --- a/common/effects.h +++ b/common/effects.h @@ -144,7 +144,8 @@ extern "C" { /* Interacts with UTYF_BADWALLATTACKER */ #define SPECENUM_VALUE48 EFT_DEFEND_BONUS #define SPECENUM_VALUE48NAME "Defend_Bonus" -#define SPECENUM_VALUE49 EFT_TRADEROUTE_PCT +#define SPECENUM_VALUE49 EFT_TRADE_ROUTE_PCT +/* FIXME: -> "Trade_Route_Pct" */ #define SPECENUM_VALUE49NAME "Traderoute_Pct" #define SPECENUM_VALUE50 EFT_GAIN_AI_LOVE #define SPECENUM_VALUE50NAME "Gain_AI_Love" diff --git a/common/metaknowledge.c b/common/metaknowledge.c index 5cd296c408..9474fab0e8 100644 --- a/common/metaknowledge.c +++ b/common/metaknowledge.c @@ -96,8 +96,8 @@ static bool is_tile_seen_city(const struct player *pow_player, Returns TRUE iff all the tiles of a city and all the tiles of its trade partners are seen by pow_player. **************************************************************************/ -static bool is_tile_seen_traderoute(const struct player *pow_player, - const struct city *target_city) +static bool is_tile_seen_trade_route(const struct player *pow_player, + const struct city *target_city) { /* Don't know who the trade routes will go to. */ if (!can_player_see_city_internals(pow_player, target_city)) { @@ -186,7 +186,7 @@ static bool is_req_knowable(const struct player *pov_player, case REQ_RANGE_ADJACENT: case REQ_RANGE_CONTINENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: case REQ_RANGE_ALLIANCE: @@ -241,7 +241,7 @@ static bool is_req_knowable(const struct player *pov_player, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -326,7 +326,7 @@ static bool is_req_knowable(const struct player *pov_player, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_COUNT: /* Invalid range */ @@ -399,7 +399,7 @@ static bool is_req_knowable(const struct player *pov_player, /* Unknown */ return FALSE; case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -435,7 +435,7 @@ static bool is_req_knowable(const struct player *pov_player, /* Only wonders (great or small) can be required in those ranges. * Wonders are always visible. */ return TRUE; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: /* Could be known for trade routes to cities owned by pov_player as * long as the requirement is present. Not present requirements would * require knowledge that no trade routes to another foreign city @@ -550,7 +550,7 @@ static bool is_req_knowable(const struct player *pov_player, return TRUE; case REQ_RANGE_CONTINENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: case REQ_RANGE_ALLIANCE: @@ -592,11 +592,11 @@ static bool is_req_knowable(const struct player *pov_player, * tile. Is returning TRUE in those cases worth the added complexity * and the extra work for the computer? */ return is_tile_seen_city(pov_player, context->city); - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: /* TODO: The answer is known when the universal is located on a seen * tile. Is returning TRUE in those cases worth the added complexity * and the extra work for the computer? */ - return is_tile_seen_traderoute(pov_player, context->city); + return is_tile_seen_trade_route(pov_player, context->city); case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_ALLIANCE: diff --git a/common/metaknowledge.h b/common/metaknowledge.h index 14ebeb2b21..97e7e6e103 100644 --- a/common/metaknowledge.h +++ b/common/metaknowledge.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 1996-2013 - Freeciv Development Team This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by diff --git a/common/networking/packets.def b/common/networking/packets.def index 446ab18c47..ebf9844bb7 100644 --- a/common/networking/packets.def +++ b/common/networking/packets.def @@ -244,7 +244,7 @@ type FTM = uint8(enum free_tech_method) type GLS = uint8(enum gameloss_style) type UTYF = uint8(enum unit_type_flag_id) type CBONUS_TYPE = uint8(enum combat_bonus_type) -type TRI = uint8(enum traderoute_illegal_cancelling) +type TRI = uint8(enum trade_route_illegal_cancelling) type RDIR = uint8(enum route_direction) type MOVE_MODE = uint8(enum road_move_mode) type ACTION_AUTO_CAUSE = uint8(enum action_auto_perf_cause) @@ -259,7 +259,7 @@ type HAPPYBORDERSTYPE = uint8(enum happyborders_type) type TECH_COST_STYLE = uint8(enum tech_cost_style) type TECH_LEAKAGE_STYLE = uint8(enum tech_leakage_style) type GOLD_UPKEEP_STYLE = uint8(enum gold_upkeep_style) -type TR_BONUS_TYPE = uint8(enum traderoute_bonus_type) +type TR_BONUS_TYPE = uint8(enum trade_route_bonus_type) type GOODS_SELECTION = uint8(enum goods_selection_method) type EUS = uint8(enum extra_unit_seen_type) type VLAYER = uint8(enum vision_layer) @@ -736,7 +736,7 @@ PACKET_CITY_INFO = 31; sc, lsend, is-game-info, force, cancel(PACKET_CITY_SHORT_ SINT16 food_stock; UINT16 shield_stock; - UINT8 traderoute_count; + UINT8 trade_route_count; UINT16 pollution; UINT16 illness_trade; @@ -797,7 +797,7 @@ PACKET_CITY_SHORT_INFO = 32; sc, lsend, is-game-info, cancel(PACKET_CITY_INFO), ESTRING name[MAX_LEN_CITYNAME]; end -PACKET_TRADEROUTE_INFO = 249; sc, lsend, handle-via-packet +PACKET_TRADE_ROUTE_INFO = 249; sc, lsend, handle-via-packet CITY city; UINT8 index; CITY partner; diff --git a/common/reqtext.c b/common/reqtext.c index 1607ee5d52..86146c51d2 100644 --- a/common/reqtext.c +++ b/common/reqtext.c @@ -128,7 +128,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_COUNT: /* Not supported. */ @@ -206,7 +206,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_COUNT: /* Not supported. */ @@ -281,7 +281,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_COUNT: /* Not supported. */ @@ -672,9 +672,9 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, } return TRUE; } - /* surviving or non-wonder continent-ranged requirements not supported */ + /* Surviving or non-wonder continent-ranged requirements not supported */ break; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: fc_strlcat(buf, prefix, bufsz); if (preq->present) { if (can_improvement_go_obsolete(preq->source.value.building)) { @@ -823,7 +823,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, extra_name_translation(preq->source.value.extra)); } return TRUE; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: fc_strlcat(buf, prefix, bufsz); if (preq->present) { cat_snprintf(buf, bufsz, @@ -863,7 +863,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_LOCAL: case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -929,7 +929,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, terrain_name_translation(preq->source.value.terrain)); } return TRUE; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: fc_strlcat(buf, prefix, bufsz); if (preq->present) { cat_snprintf(buf, bufsz, @@ -1033,7 +1033,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_COUNT: /* Not supported. */ @@ -1103,7 +1103,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_COUNT: /* Not supported. */ @@ -1133,7 +1133,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case VUT_NATIONALITY: switch (preq->range) { - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: fc_strlcat(buf, prefix, bufsz); if (preq->present) { cat_snprintf(buf, bufsz, @@ -1259,7 +1259,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_COUNT: /* Not supported. */ @@ -1334,7 +1334,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_WORLD: case REQ_RANGE_COUNT: @@ -1362,7 +1362,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -1447,7 +1447,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_WORLD: case REQ_RANGE_COUNT: @@ -1475,7 +1475,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -1504,7 +1504,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -1544,7 +1544,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -1573,7 +1573,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -1617,7 +1617,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -1719,7 +1719,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -1750,7 +1750,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -1785,7 +1785,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -1877,7 +1877,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case VUT_MINSIZE: switch (preq->range) { - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: fc_strlcat(buf, prefix, bufsz); if (preq->present) { cat_snprintf(buf, bufsz, @@ -1947,7 +1947,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, preq->source.value.minculture); } return TRUE; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: fc_strlcat(buf, prefix, bufsz); if (preq->present) { cat_snprintf(buf, bufsz, @@ -2072,7 +2072,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, preq->source.value.minforeignpct); } return TRUE; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: fc_strlcat(buf, prefix, bufsz); if (preq->present) { cat_snprintf(buf, bufsz, @@ -2160,7 +2160,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, } return TRUE; case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -2262,7 +2262,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, (preq->source.value.terrainclass)); } return TRUE; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: fc_strlcat(buf, prefix, bufsz); if (preq->present) { cat_snprintf(buf, bufsz, @@ -2358,7 +2358,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, terrain_flag_id_translated_name(preq->source.value.terrainflag)); } return TRUE; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: fc_strlcat(buf, prefix, bufsz); if (preq->present) { cat_snprintf(buf, bufsz, @@ -2452,7 +2452,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, road_flag_id_translated_name(preq->source.value.roadflag)); } return TRUE; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: fc_strlcat(buf, prefix, bufsz); if (preq->present) { cat_snprintf(buf, bufsz, @@ -2546,7 +2546,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, extra_flag_id_translated_name(preq->source.value.extraflag)); } return TRUE; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: fc_strlcat(buf, prefix, bufsz); if (preq->present) { cat_snprintf(buf, bufsz, @@ -2688,7 +2688,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_TEAM: case REQ_RANGE_ALLIANCE: @@ -2717,7 +2717,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -2790,7 +2790,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, } return TRUE; case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -2830,7 +2830,7 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, city_property); } return TRUE; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: fc_strlcat(buf, prefix, bufsz); if (preq->present) { /* TRANS: city property ("owned by original", etc) */ diff --git a/common/requirements.c b/common/requirements.c index cde2ef2902..6fae9d4bab 100644 --- a/common/requirements.c +++ b/common/requirements.c @@ -1031,7 +1031,7 @@ struct requirement req_from_str(const char *type, const char *range, && req.range != REQ_RANGE_CADJACENT && req.range != REQ_RANGE_ADJACENT && req.range != REQ_RANGE_CITY - && req.range != REQ_RANGE_TRADEROUTE); + && req.range != REQ_RANGE_TRADE_ROUTE); break; case VUT_ADVANCE: case VUT_TECHFLAG: @@ -1049,14 +1049,14 @@ struct requirement req_from_str(const char *type, const char *range, case VUT_NATIONALITY: case VUT_CITYSTATUS: invalid = (req.range != REQ_RANGE_CITY - && req.range != REQ_RANGE_TRADEROUTE); + && req.range != REQ_RANGE_TRADE_ROUTE); break; case VUT_GOOD: invalid = (req.range != REQ_RANGE_CITY); break; case VUT_MINCULTURE: invalid = (req.range != REQ_RANGE_CITY - && req.range != REQ_RANGE_TRADEROUTE + && req.range != REQ_RANGE_TRADE_ROUTE && req.range != REQ_RANGE_PLAYER && req.range != REQ_RANGE_TEAM && req.range != REQ_RANGE_ALLIANCE @@ -1131,7 +1131,7 @@ struct requirement req_from_str(const char *type, const char *range, invalid = (req.range != REQ_RANGE_WORLD); break; case VUT_AGE: - /* FIXME: could support TRADEROUTE, TEAM, etc */ + /* FIXME: could support TRADE_ROUTE, TEAM, etc */ invalid = (req.range != REQ_RANGE_LOCAL && req.range != REQ_RANGE_CITY && req.range != REQ_RANGE_PLAYER); @@ -1398,8 +1398,8 @@ static bool present_implies_not_present(const struct requirement *req1, if (present->range != absent->range) { /* Larger ranges are not always strict supersets of smaller ranges. - * Example: Traderoute > CAdjacent but something may be in CAdjacent - * but not in Traderoute. */ + * Example: Trade Route > CAdjacent but something may be in CAdjacent + * but not in Trade Route. */ return FALSE; } @@ -1563,7 +1563,7 @@ static inline bool are_tiles_in_range(const struct tile *tile1, case REQ_RANGE_CADJACENT: return map_distance(tile1, tile2) <= 1; case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_LOCAL: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: @@ -1594,7 +1594,7 @@ static inline bool players_in_same_range(const struct player *pplayer1, case REQ_RANGE_PLAYER: return pplayer1 == pplayer2; case REQ_RANGE_CONTINENT: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CITY: case REQ_RANGE_ADJACENT: case REQ_RANGE_CADJACENT: @@ -1774,7 +1774,7 @@ is_building_req_active(const struct req_context *context, return BOOL_TO_TRISTATE(player_has_ever_built(context->player, building)); case REQ_RANGE_CONTINENT: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CITY: case REQ_RANGE_LOCAL: case REQ_RANGE_CADJACENT: @@ -1823,7 +1823,7 @@ is_building_req_active(const struct req_context *context, } else { return TRI_MAYBE; } - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: if (context->city) { if (num_city_buildings(context->city, building) > 0) { return TRI_YES; @@ -1947,7 +1947,7 @@ is_tech_req_active(const struct req_context *context, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_COUNT: break; @@ -2009,7 +2009,7 @@ is_techflag_req_active(const struct req_context *context, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_COUNT: break; @@ -2044,7 +2044,7 @@ is_minculture_req_active(const struct req_context *context, return TRI_MAYBE; } return BOOL_TO_TRISTATE(city_culture(context->city) >= minculture); - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: if (!context->city) { return TRI_MAYBE; } @@ -2118,7 +2118,7 @@ is_minforeignpct_req_active(const struct req_context *context, foreign_pct = citizens_nation_foreign(context->city) * 100 / city_size_get(context->city); return BOOL_TO_TRISTATE(foreign_pct >= min_foreign_pct); - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: if (!context->city) { return TRI_MAYBE; } @@ -2213,7 +2213,7 @@ is_maxunitsontile_req_active(const struct req_context *context, } adjc_iterate_end; return TRI_NO; case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -2279,7 +2279,7 @@ is_extra_req_active(const struct req_context *context, return TRI_NO; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: if (!context->city) { return TRI_MAYBE; } @@ -2345,7 +2345,7 @@ is_good_req_active(const struct req_context *context, req->source.value.good)); case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -2466,7 +2466,7 @@ is_terrain_req_active(const struct req_context *context, } city_tile_iterate_end; } return TRI_NO; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: if (!context->city) { return TRI_MAYBE; } @@ -2566,7 +2566,7 @@ is_terrainclass_req_active(const struct req_context *context, } city_tile_iterate_end; return TRI_NO; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: if (!context->city) { return TRI_MAYBE; } @@ -2672,7 +2672,7 @@ is_terrainflag_req_active(const struct req_context *context, } city_tile_iterate_end; return TRI_NO; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: if (!context->city) { return TRI_MAYBE; } @@ -2768,7 +2768,7 @@ is_roadflag_req_active(const struct req_context *context, } city_tile_iterate_end; return TRI_NO; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: if (!context->city) { return TRI_MAYBE; } @@ -2858,7 +2858,7 @@ is_extraflag_req_active(const struct req_context *context, } city_tile_iterate_end; return TRI_NO; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: if (!context->city) { return TRI_MAYBE; } @@ -2928,7 +2928,7 @@ is_terrainalter_req_active(const struct req_context *context, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: /* XXX Could in principle support ADJACENT. */ case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -3092,7 +3092,7 @@ is_nation_req_active(const struct req_context *context, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_COUNT: break; @@ -3147,7 +3147,7 @@ is_nationgroup_req_active(const struct req_context *context, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_COUNT: break; @@ -3190,7 +3190,7 @@ is_nationality_req_active(const struct req_context *context, } citizens_iterate_end; return TRI_NO; - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: if (context->city == NULL) { return TRI_MAYBE; } @@ -3267,7 +3267,7 @@ static enum fc_tristate is_diplrel_in_range(const struct player *target_player, case REQ_RANGE_CADJACENT: case REQ_RANGE_ADJACENT: case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_COUNT: break; @@ -3808,7 +3808,7 @@ is_citytile_req_active(const struct req_context *context, return TRI_NO; case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -3847,7 +3847,7 @@ is_citytile_req_active(const struct req_context *context, return TRI_NO; case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -3886,7 +3886,7 @@ is_citytile_req_active(const struct req_context *context, return TRI_NO; case REQ_RANGE_CITY: - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: case REQ_RANGE_CONTINENT: case REQ_RANGE_PLAYER: case REQ_RANGE_TEAM: @@ -3939,7 +3939,7 @@ is_citystatus_req_active(const struct req_context *context, return TRI_MAYBE; } return BOOL_TO_TRISTATE(city_owner(context->city) == context->city->original); - case REQ_RANGE_TRADEROUTE: + case REQ_RANGE_TRADE_ROUTE: { enum fc_tristate ret; @@ -3998,7 +3998,7 @@ is_minsize_req_active(const struct req_context *context, if (context->city == NULL) { return TRI_MAYBE; } else { - if (req->range == REQ_RANGE_TRADEROUTE) { + if (req->range == REQ_RANGE_TRADE_ROUTE) { enum fc_tristate ret; if (city_size_get(context->city) >= req->source.value.minsize) { diff --git a/common/requirements.h b/common/requirements.h index aa313097b9..2d9498617b 100644 --- a/common/requirements.h +++ b/common/requirements.h @@ -43,7 +43,8 @@ extern "C" { #define SPECENUM_VALUE2NAME "Adjacent" #define SPECENUM_VALUE3 REQ_RANGE_CITY #define SPECENUM_VALUE3NAME "City" -#define SPECENUM_VALUE4 REQ_RANGE_TRADEROUTE +#define SPECENUM_VALUE4 REQ_RANGE_TRADE_ROUTE +/* FIXME: -> "Trade Route" */ #define SPECENUM_VALUE4NAME "Traderoute" #define SPECENUM_VALUE5 REQ_RANGE_CONTINENT #define SPECENUM_VALUE5NAME "Continent" diff --git a/common/traderoutes.c b/common/traderoutes.c index 0e37b5073d..6e2e71e006 100644 --- a/common/traderoutes.c +++ b/common/traderoutes.c @@ -34,7 +34,7 @@ const char *trade_route_type_names[] = { "Enemy", "EnemyIC", "Team", "TeamIC" }; -const char *traderoute_cancelling_type_names[] = { +const char *trade_route_cancelling_type_names[] = { "Active", "Inactive", "Cancel" }; @@ -53,7 +53,7 @@ unsigned max_trade_routes(const struct city *pcity) } /*********************************************************************//** - What is type of the traderoute between two cities. + What is type of the trade route between two cities. *************************************************************************/ enum trade_route_type cities_trade_route_type(const struct city *pcity1, const struct city *pcity2) @@ -169,24 +169,24 @@ enum trade_route_type trade_route_type_by_name(const char *name) } /*********************************************************************//** - Return human readable name of traderoute cancelling type + Return human readable name of trade route cancelling type *************************************************************************/ -const char *traderoute_cancelling_type_name(enum traderoute_illegal_cancelling type) +const char *trade_route_cancelling_type_name(enum trade_route_illegal_cancelling type) { fc_assert_ret_val(type >= TRI_ACTIVE && type < TRI_LAST, NULL); - return traderoute_cancelling_type_names[type]; + return trade_route_cancelling_type_names[type]; } /*********************************************************************//** - Get traderoute cancelling type by name. + Get trade route cancelling type by name. *************************************************************************/ -enum traderoute_illegal_cancelling traderoute_cancelling_type_by_name(const char *name) +enum trade_route_illegal_cancelling trade_route_cancelling_type_by_name(const char *name) { - enum traderoute_illegal_cancelling type; + enum trade_route_illegal_cancelling type; for (type = TRI_ACTIVE; type < TRI_LAST; type++) { - if (!fc_strcasecmp(traderoute_cancelling_type_names[type], name)) { + if (!fc_strcasecmp(trade_route_cancelling_type_names[type], name)) { return type; } } @@ -714,7 +714,7 @@ bool city_receives_goods(const struct city *pcity, } /*********************************************************************//** - Return goods type for the new traderoute between given cities. + Return goods type for the new trade route between given cities. *************************************************************************/ struct goods_type *goods_from_city_to_unit(struct city *src, struct unit *punit) { diff --git a/common/traderoutes.h b/common/traderoutes.h index 8d2757e783..0feb3f4db6 100644 --- a/common/traderoutes.h +++ b/common/traderoutes.h @@ -23,9 +23,9 @@ extern "C" { struct city; struct city_list; -/* What to do with previously established traderoutes that are now illegal. +/* What to do with previously established trade routes that are now illegal. * Used in the network protocol. */ -enum traderoute_illegal_cancelling +enum trade_route_illegal_cancelling { TRI_ACTIVE = 0, /* Keep them active */ TRI_INACTIVE = 1, /* They are inactive */ @@ -49,7 +49,7 @@ enum trade_route_type { }; /* Values used in the network protocol. */ -#define SPECENUM_NAME traderoute_bonus_type +#define SPECENUM_NAME trade_route_bonus_type #define SPECENUM_VALUE0 TBONUS_NONE #define SPECENUM_VALUE0NAME "None" #define SPECENUM_VALUE1 TBONUS_GOLD @@ -74,8 +74,8 @@ enum trade_route_type { struct trade_route_settings { int trade_pct; - enum traderoute_illegal_cancelling cancelling; - enum traderoute_bonus_type bonus_type; + enum trade_route_illegal_cancelling cancelling; + enum trade_route_bonus_type bonus_type; }; struct goods_type; @@ -105,8 +105,8 @@ void trade_route_types_init(void); const char *trade_route_type_name(enum trade_route_type type); enum trade_route_type trade_route_type_by_name(const char *name); -const char *traderoute_cancelling_type_name(enum traderoute_illegal_cancelling type); -enum traderoute_illegal_cancelling traderoute_cancelling_type_by_name(const char *name); +const char *trade_route_cancelling_type_name(enum trade_route_illegal_cancelling type); +enum trade_route_illegal_cancelling trade_route_cancelling_type_by_name(const char *name); struct trade_route_settings * trade_route_settings_by_type(enum trade_route_type type); diff --git a/data/alien/README.alien b/data/alien/README.alien index 1016480a7d..cefba0ebdb 100644 --- a/data/alien/README.alien +++ b/data/alien/README.alien @@ -38,7 +38,7 @@ This list is incomplete - Techs cannot be stolen from Lunatics or Madmen -- Intercontinental traderoutes give same trade than routes +- Intercontinental trade routes give same trade than routes within one continent. International routes give three times as much trade as national ones diff --git a/data/alien/game.ruleset b/data/alien/game.ruleset index 0cfbfaff3f..d89acbf75d 100644 --- a/data/alien/game.ruleset +++ b/data/alien/game.ruleset @@ -705,7 +705,7 @@ target_reqs = "MaxUnitsOnTile", "1", "Local", TRUE } -[actionenabler_traderoute] +[actionenabler_trade_route] action = "Establish Trade Route" actor_reqs = { "type", "name", "range", "present" @@ -1470,14 +1470,14 @@ effects = "ReducePopulation" ; For each of the trade route types: ; "pct" - Trade income %. If this is 0, trade route cannot be ; established at all -; "cancelling" - What to do to previously established traderoutes when they +; "cancelling" - What to do to previously established trade routes when they ; turn illegal ; "Active" - Keep them active (although they will only ; provide nonzero income if illegal due to ; trademindist rather than pct==0) ; "Inactive" - Keep them inactive ; "Cancel" - Cancel them altogether -; "bonus" - One-time bonuses granted when traderoute established +; "bonus" - One-time bonuses granted when trade route established ; "None" - No one-time bonus ; "Gold" - Bonus to gold ; "Science" - Bonus to research @@ -1524,7 +1524,7 @@ goods_selection = "Arrival" ; This value is applied to both ends of bidirectional routes. ; to_pct = Income for the receiving end of the trade route. Default is 100% ; This value is not used at all in case of bidirectional routes. -; onetime_pct = Onetime bonuses when traderoute is established. Default is 100% +; onetime_pct = Onetime bonuses when trade route gets established. Default is 100% ; flags ; - "Bidirectional" = Trade route carrying the goods does not have "from" and "to" ; ends, but both ends are considered the same. diff --git a/data/civ1/game.ruleset b/data/civ1/game.ruleset index 7cedb77790..4086ed9095 100644 --- a/data/civ1/game.ruleset +++ b/data/civ1/game.ruleset @@ -687,7 +687,7 @@ target_reqs = "MaxUnitsOnTile", "1", "Local", TRUE } -[actionenabler_traderoute] +[actionenabler_trade_route] action = "Establish Trade Route" actor_reqs = { "type", "name", "range", "present" @@ -1282,7 +1282,7 @@ effects = "ReducePopulation" ; For each of the trade route types: ; "pct" - Trade income %. If this is 0, trade route cannot be ; established at all -; "cancelling" - What to do to previously established traderoutes when they +; "cancelling" - What to do to previously established trade routes when they ; turn illegal ; "Active" - Keep them active (although they will only ; provide nonzero income if illegal due to @@ -1290,11 +1290,11 @@ effects = "ReducePopulation" ; "Inactive" - Keep them inactive ; "Cancel" - Cancel them altogether ; -; If you have established a traderoute with enemy city nearby, conquer it and -; thus get traderoute between your cities with less than trademindist distance, -; civ1 removes the traderoute completely. +; If you have established a trade route with enemy city nearby, conquer it and +; thus get trade route between your cities with less than trademindist distance, +; civ1 removes the trade route completely. ; -; "bonus" - One-time bonuses granted when traderoute established +; "bonus" - One-time bonuses granted when trade route established ; "None" - No one-time bonus ; "Gold" - Bonus to gold ; "Science" - Bonus to research @@ -1341,7 +1341,7 @@ goods_selection = "Arrival" ; This value is applied to both ends of bidirectional routes. ; to_pct = Income for the receiving end of the trade route. Default is 100% ; This value is not used at all in case of bidirectional routes. -; onetime_pct = Onetime bonuses when traderoute is established. Default is 100% +; onetime_pct = Onetime bonuses when trade route gets established. Default is 100% ; flags ; - "Bidirectional" = Trade route carrying the goods does not have "from" and "to" ; ends, but both ends are considered the same. diff --git a/data/civ2/game.ruleset b/data/civ2/game.ruleset index c43a898bcc..0d6a950a0b 100644 --- a/data/civ2/game.ruleset +++ b/data/civ2/game.ruleset @@ -859,7 +859,7 @@ target_reqs = "MaxUnitsOnTile", "1", "Local", TRUE } -[actionenabler_traderoute] +[actionenabler_trade_route] action = "Establish Trade Route" actor_reqs = { "type", "name", "range", "present" @@ -1525,7 +1525,7 @@ negative_label = _("BC") ; For each of the trade route types: ; "pct" - Trade income %. If this is 0, trade route cannot be ; established at all -; "cancelling" - What to do to previously established traderoutes when they +; "cancelling" - What to do to previously established trade routes when they ; turn illegal ; "Active" - Keep them active (although they will only ; provide nonzero income if illegal due to @@ -1534,10 +1534,10 @@ negative_label = _("BC") ; "Cancel" - Cancel them altogether ; ; TODO: What`s correct "cancelling" behavior for civ2? If you have established -; traderoute with enemy city nearby and conquer it -> what happens to traderoute +; trade route with enemy city nearby and conquer it -> what happens to trade route ; between your cities with less than trademindist distance? ; -; "bonus" - One-time bonuses granted when traderoute established +; "bonus" - One-time bonuses granted when trade route established ; "None" - No one-time bonus ; "Gold" - Bonus to gold ; "Science" - Bonus to research @@ -1586,7 +1586,7 @@ goods_selection = "Arrival" ; This value is applied to both ends of bidirectional routes. ; to_pct = Income for the receiving end of the trade route. Default is 100% ; This value is not used at all in case of bidirectional routes. -; onetime_pct = Onetime bonuses when traderoute is established. Default is 100% +; onetime_pct = Onetime bonuses when trade route gets established. Default is 100% ; flags ; - "Bidirectional" = Trade route carrying the goods does not have "from" and "to" ; ends, but both ends are considered the same. diff --git a/data/civ2civ3/game.ruleset b/data/civ2civ3/game.ruleset index eabde2d758..ef723574dd 100644 --- a/data/civ2civ3/game.ruleset +++ b/data/civ2civ3/game.ruleset @@ -984,7 +984,7 @@ target_reqs = "CityTile", "Center", "Local", FALSE } -[actionenabler_traderoute] +[actionenabler_trade_route] action = "Establish Trade Route" actor_reqs = { "type", "name", "range", "present" @@ -2010,14 +2010,14 @@ cons_msg = _("Your nation has achieved 10000 culture points!") ; For each of the trade route types: ; "pct" - Trade income %. If this is 0, trade route cannot be ; established at all -; "cancelling" - What to do to previously established traderoutes when they +; "cancelling" - What to do to previously established trade routes when they ; turn illegal ; "Active" - Keep them active (although they will only ; provide nonzero income if illegal due to ; trademindist rather than pct==0) ; "Inactive" - Keep them inactive ; "Cancel" - Cancel them altogether -; "bonus" - One-time bonuses granted when traderoute established +; "bonus" - One-time bonuses granted when trade route established ; "None" - No one-time bonus ; "Gold" - Bonus to gold ; "Science" - Bonus to research @@ -2064,7 +2064,7 @@ goods_selection = "Leaving" ; This value is applied to both ends of bidirectional routes. ; to_pct = Income for the receiving end of the trade route. Default is 100% ; This value is not used at all in case of bidirectional routes. -; onetime_pct = Onetime bonuses when traderoute is established. Default is 100% +; onetime_pct = Onetime bonuses when trade route gets established. Default is 100% ; flags ; - "Bidirectional" = Trade route carrying the goods does not have "from" and "to" ; ends, but both ends are considered the same. diff --git a/data/classic/game.ruleset b/data/classic/game.ruleset index 5c4ee0161b..cc4b895074 100644 --- a/data/classic/game.ruleset +++ b/data/classic/game.ruleset @@ -946,7 +946,7 @@ target_reqs = "MaxUnitsOnTile", "1", "Local", TRUE } -[actionenabler_traderoute] +[actionenabler_trade_route] action = "Establish Trade Route" actor_reqs = { "type", "name", "range", "present" @@ -1796,14 +1796,14 @@ effects = "ReducePopulation", "Fallout" ; For each of the trade route types: ; "pct" - Trade income %. If this is 0, trade route cannot be ; established at all -; "cancelling" - What to do to previously established traderoutes when they +; "cancelling" - What to do to previously established trade routes when they ; turn illegal ; "Active" - Keep them active (although they will only ; provide nonzero income if illegal due to ; trademindist rather than pct==0) ; "Inactive" - Keep them inactive ; "Cancel" - Cancel them altogether -; "bonus" - One-time bonuses granted when traderoute established +; "bonus" - One-time bonuses granted when trade route established ; "None" - No one-time bonus ; "Gold" - Bonus to gold ; "Science" - Bonus to research @@ -1850,7 +1850,7 @@ goods_selection = "Arrival" ; This value is applied to both ends of bidirectional routes. ; to_pct = Income for the receiving end of the trade route. Default is 100% ; This value is not used at all in case of bidirectional routes. -; onetime_pct = Onetime bonuses when traderoute is established. Default is 100% +; onetime_pct = Onetime bonuses when trade route gets established. Default is 100% ; flags ; - "Bidirectional" = Trade route carrying the goods does not have "from" and "to" ; ends, but both ends are considered the same. diff --git a/data/experimental/README.experimental b/data/experimental/README.experimental index d43d218fc2..4b040550a5 100644 --- a/data/experimental/README.experimental +++ b/data/experimental/README.experimental @@ -45,7 +45,7 @@ this file. and forest, unless roads are built; nor can they ride maglevs (they ride the railroad instead). Freight does not obsolete Caravan so player does not lose ability - to build units to establish traderoutes to remote cities. + to build units to establish trade routes to remote cities. - Triremes can move on rivers (but later ships cannot). diff --git a/data/experimental/game.ruleset b/data/experimental/game.ruleset index 140ec80d4b..9a2cb07c74 100644 --- a/data/experimental/game.ruleset +++ b/data/experimental/game.ruleset @@ -965,7 +965,7 @@ target_reqs = "MinHitPoints", "2", "Local", TRUE } -[actionenabler_traderoute] +[actionenabler_trade_route] action = "Establish Trade Route" actor_reqs = { "type", "name", "range", "present" @@ -1883,14 +1883,14 @@ cons_msg = _("You sighted your first foreign shore!") ; For each of the trade route types: ; "pct" - Trade income %. If this is 0, trade route cannot be ; established at all -; "cancelling" - What to do to previously established traderoutes when they +; "cancelling" - What to do to previously established trade routes when they ; turn illegal ; "Active" - Keep them active (although they will only ; provide nonzero income if illegal due to ; trademindist rather than pct==0) ; "Inactive" - Keep them inactive ; "Cancel" - Cancel them altogether -; "bonus" - One-time bonuses granted when traderoute established +; "bonus" - One-time bonuses granted when trade route established ; "None" - No one-time bonus ; "Gold" - Bonus to gold ; "Science" - Bonus to research @@ -1937,7 +1937,7 @@ goods_selection = "Leaving" ; This value is applied to both ends of bidirectional routes. ; to_pct = Income for the receiving end of the trade route. Default is 100% ; This value is not used at all in case of bidirectional routes. -; onetime_pct = Onetime bonuses when traderoute is established. Default is 100% +; onetime_pct = Onetime bonuses when trade route gets established. Default is 100% ; flags ; - "Bidirectional" = Trade route carrying the goods does not have "from" and "to" ; ends, but both ends are considered the same. diff --git a/data/granularity/game.ruleset b/data/granularity/game.ruleset index b1a71e74a2..3adbefa471 100644 --- a/data/granularity/game.ruleset +++ b/data/granularity/game.ruleset @@ -772,14 +772,14 @@ negative_label = _("BCE") ; For each of the trade route types: ; "pct" - Trade income %. If this is 0, trade route cannot be ; established at all -; "cancelling" - What to do to previously established traderoutes when they +; "cancelling" - What to do to previously established trade routes when they ; turn illegal ; "Active" - Keep them active (although they will only ; provide nonzero income if illegal due to ; trademindist rather than pct==0) ; "Inactive" - Keep them inactive ; "Cancel" - Cancel them altogether -; "bonus" - One-time bonuses granted when traderoute established +; "bonus" - One-time bonuses granted when trade route established ; "None" - No one-time bonus ; "Gold" - Bonus to gold ; "Science" - Bonus to research @@ -826,7 +826,7 @@ goods_selection = "Leaving" ; This value is applied to both ends of bidirectional routes. ; to_pct = Income for the receiving end of the trade route. Default is 100% ; This value is not used at all in case of bidirectional routes. -; onetime_pct = Onetime bonuses when traderoute is established. Default is 100% +; onetime_pct = Onetime bonuses when trade route gets established. Default is 100% ; flags ; - "Bidirectional" = Trade route carrying the goods does not have "from" and "to" ; ends, but both ends are considered the same. diff --git a/data/multiplayer/game.ruleset b/data/multiplayer/game.ruleset index 09b7dc2723..6b563088ed 100644 --- a/data/multiplayer/game.ruleset +++ b/data/multiplayer/game.ruleset @@ -1756,14 +1756,14 @@ negative_label = _("BCE") ; For each of the trade route types: ; "pct" - Trade income %. If this is 0, trade route cannot be ; established at all -; "cancelling" - What to do to previously established traderoutes when they +; "cancelling" - What to do to previously established trade routes when they ; turn illegal ; "Active" - Keep them active (although they will only ; provide nonzero income if illegal due to ; trademindist rather than pct==0) ; "Inactive" - Keep them inactive ; "Cancel" - Cancel them altogether -; "bonus" - One-time bonuses granted when traderoute established +; "bonus" - One-time bonuses granted when trade route established ; "None" - No one-time bonus ; "Gold" - Bonus to gold ; "Science" - Bonus to research @@ -1810,7 +1810,7 @@ goods_selection = "Arrival" ; This value is applied to both ends of bidirectional routes. ; to_pct = Income for the receiving end of the trade route. Default is 100% ; This value is not used at all in case of bidirectional routes. -; onetime_pct = Onetime bonuses when traderoute is established. Default is 100% +; onetime_pct = Onetime bonuses when trade route gets established. Default is 100% ; flags ; - "Bidirectional" = Trade route carrying the goods does not have "from" and "to" ; ends, but both ends are considered the same. diff --git a/data/ruledit/comments-3.1.txt b/data/ruledit/comments-3.1.txt index 90cc5244a1..f6bfe673b9 100644 --- a/data/ruledit/comments-3.1.txt +++ b/data/ruledit/comments-3.1.txt @@ -1058,14 +1058,14 @@ trade_settings = "\ ; For each of the trade route types:\n\ ; \"pct\" - Trade income %. If this is 0, trade route cannot be\n\ ; established at all\n\ -; \"cancelling\" - What to do to previously established traderoutes when they\n\ +; \"cancelling\" - What to do to previously established trade routes when they\n\ ; turn illegal\n\ ; \"Active\" - Keep them active (although they will only\n\ ; provide nonzero income if illegal due to\n\ ; trademindist rather than pct==0)\n\ ; \"Inactive\" - Keep them inactive\n\ ; \"Cancel\" - Cancel them altogether\n\ -; \"bonus\" - One-time bonuses granted when traderoute established\n\ +; \"bonus\" - One-time bonuses granted when trade route established\n\ ; \"None\" - No one-time bonus\n\ ; \"Gold\" - Bonus to gold\n\ ; \"Science\" - Bonus to research\n\ @@ -1092,7 +1092,7 @@ goods = "\ ; This value is applied to both ends of bidirectional routes.\n\ ; to_pct = Income for the receiving end of the trade route. Default is 100\%\n\ ; This value is not used at all in case of bidirectional routes.\n\ -; onetime_pct = Onetime bonuses when traderoute is established. Default is 100\%\n\ +; onetime_pct = Onetime bonuses when trade route gets established. Default is 100\%\n\ ; flags\n\ ; - \"Bidirectional\" = Trade route carrying the goods does not have \"from\" and \"to\"\n\ ; ends, but both ends are considered the same.\n\ diff --git a/data/sandbox/game.ruleset b/data/sandbox/game.ruleset index 74f8bf0f66..0e9346f8ae 100644 --- a/data/sandbox/game.ruleset +++ b/data/sandbox/game.ruleset @@ -1299,7 +1299,7 @@ target_reqs = "CityTile", "Center", "Local", FALSE } -[actionenabler_traderoute] +[actionenabler_trade_route] action = "Establish Trade Route" actor_reqs = { "type", "name", "range", "present" @@ -3225,14 +3225,14 @@ cons_msg = _("Your nation has achieved 10000 culture points!") ; For each of the trade route types: ; "pct" - Trade income %. If this is 0, trade route cannot be ; established at all -; "cancelling" - What to do to previously established traderoutes when they +; "cancelling" - What to do to previously established trade routes when they ; turn illegal ; "Active" - Keep them active (although they will only ; provide nonzero income if illegal due to ; trademindist rather than pct==0) ; "Inactive" - Keep them inactive ; "Cancel" - Cancel them altogether -; "bonus" - One-time bonuses granted when traderoute established +; "bonus" - One-time bonuses granted when trade route established ; "None" - No one-time bonus ; "Gold" - Bonus to gold ; "Science" - Bonus to research @@ -3279,7 +3279,7 @@ goods_selection = "Leaving" ; This value is applied to both ends of bidirectional routes. ; to_pct = Income for the receiving end of the trade route. Default is 100% ; This value is not used at all in case of bidirectional routes. -; onetime_pct = Onetime bonuses when traderoute is established. Default is 100% +; onetime_pct = Onetime bonuses when trade route gets established. Default is 100% ; flags ; - "Bidirectional" = Trade route carrying the goods does not have "from" and "to" ; ends, but both ends are considered the same. diff --git a/data/stub/game.ruleset b/data/stub/game.ruleset index 384dccde79..780e4b8eaa 100644 --- a/data/stub/game.ruleset +++ b/data/stub/game.ruleset @@ -633,14 +633,14 @@ negative_label = _("BCE") ; For each of the trade route types: ; "pct" - Trade income %. If this is 0, trade route cannot be ; established at all -; "cancelling" - What to do to previously established traderoutes when they +; "cancelling" - What to do to previously established trade routes when they ; turn illegal ; "Active" - Keep them active (although they will only ; provide nonzero income if illegal due to ; trademindist rather than pct==0) ; "Inactive" - Keep them inactive ; "Cancel" - Cancel them altogether -; "bonus" - One-time bonuses granted when traderoute established +; "bonus" - One-time bonuses granted when trade route established ; "None" - No one-time bonus ; "Gold" - Bonus to gold ; "Science" - Bonus to research @@ -687,7 +687,7 @@ goods_selection = "Leaving" ; This value is applied to both ends of bidirectional routes. ; to_pct = Income for the receiving end of the trade route. Default is 100% ; This value is not used at all in case of bidirectional routes. -; onetime_pct = Onetime bonuses when traderoute is established. Default is 100% +; onetime_pct = Onetime bonuses when trade route gets established. Default is 100% ; flags ; - "Bidirectional" = Trade route carrying the goods does not have "from" and "to" ; ends, but both ends are considered the same. diff --git a/data/webperimental/game.ruleset b/data/webperimental/game.ruleset index bb70a0fb30..3f743af5ff 100644 --- a/data/webperimental/game.ruleset +++ b/data/webperimental/game.ruleset @@ -1098,7 +1098,7 @@ target_reqs = "CityTile", "Center", "Local", FALSE } -[actionenabler_traderoute] +[actionenabler_trade_route] action = "Establish Trade Route" actor_reqs = { "type", "name", "range", "present" @@ -2049,14 +2049,14 @@ effects = "ReducePopulation", "Fallout" ; For each of the trade route types: ; "pct" - Trade income %. If this is 0, trade route cannot be ; established at all -; "cancelling" - What to do to previously established traderoutes when they +; "cancelling" - What to do to previously established trade routes when they ; turn illegal ; "Active" - Keep them active (although they will only ; provide nonzero income if illegal due to ; trademindist rather than pct==0) ; "Inactive" - Keep them inactive ; "Cancel" - Cancel them altogether -; "bonus" - One-time bonuses granted when traderoute established +; "bonus" - One-time bonuses granted when trade route established ; "None" - No one-time bonus ; "Gold" - Bonus to gold ; "Science" - Bonus to research @@ -2103,7 +2103,7 @@ goods_selection = "Leaving" ; This value is applied to both ends of bidirectional routes. ; to_pct = Income for the receiving end of the trade route. Default is 100% ; This value is not used at all in case of bidirectional routes. -; onetime_pct = Onetime bonuses when traderoute is established. Default is 100% +; onetime_pct = Onetime bonuses when trade route gets established. Default is 100% ; flags ; - "Bidirectional" = Trade route carrying the goods does not have "from" and "to" ; ends, but both ends are considered the same. diff --git a/doc/README.effects b/doc/README.effects index 9ebbc7f4ec..22fd633364 100644 --- a/doc/README.effects +++ b/doc/README.effects @@ -588,9 +588,9 @@ Trade_Revenue_Bonus The amount value is taken from the caravan's home city. Traderoute_Pct - Percentage bonus for trade from traderoutes. This bonus applies after - the value of the traderoute is already calculated. It affects one end - of the traderoute only. + Percentage bonus for trade from trade routes. This bonus applies after + the value of the trade route is already calculated. It affects one end + of the trade route only. Unhappy_Factor Multiply unhappy unit upkeep by amount. diff --git a/server/citytools.c b/server/citytools.c index d95d794699..6a469f12bd 100644 --- a/server/citytools.c +++ b/server/citytools.c @@ -980,7 +980,7 @@ static void reestablish_city_trade_routes(struct city *pcity) free(proute); free(back); - /* Now announce the traderoute removal */ + /* Now announce the trade route removal */ announce_trade_route_removal(pcity, partner, FALSE); } @@ -2201,7 +2201,7 @@ void broadcast_city_info(struct city *pcity) struct packet_web_city_info_addition web_packet; struct packet_city_short_info sc_pack; struct player *powner = city_owner(pcity); - struct traderoute_packet_list *routes; + struct trade_route_packet_list *routes; /* Send to everyone who can see the city. */ @@ -2214,7 +2214,7 @@ void broadcast_city_info(struct city *pcity) return; } - routes = traderoute_packet_list_new(); + routes = trade_route_packet_list_new(); package_city(pcity, &packet, &nat_packet, &rally_packet, &web_packet, routes, FALSE); @@ -2227,9 +2227,9 @@ void broadcast_city_info(struct city *pcity) lsend_packet_city_nationalities(pplayer->connections, &nat_packet, FALSE); lsend_packet_city_rally_point(pplayer->connections, &rally_packet, FALSE); web_lsend_packet(city_info_addition, pplayer->connections, &web_packet, FALSE); - traderoute_packet_list_iterate(routes, route_packet) { - lsend_packet_traderoute_info(pplayer->connections, route_packet); - } traderoute_packet_list_iterate_end; + trade_route_packet_list_iterate(routes, route_packet) { + lsend_packet_trade_route_info(pplayer->connections, route_packet); + } trade_route_packet_list_iterate_end; } else if (player_can_see_city_externals(pplayer, pcity)) { reality_check_city(pplayer, pcity->tile); update_dumb_city(pplayer, pcity); @@ -2250,10 +2250,10 @@ void broadcast_city_info(struct city *pcity) } } conn_list_iterate_end; - traderoute_packet_list_iterate(routes, route_packet) { + trade_route_packet_list_iterate(routes, route_packet) { FC_FREE(route_packet); - } traderoute_packet_list_iterate_end; - traderoute_packet_list_destroy(routes); + } trade_route_packet_list_iterate_end; + trade_route_packet_list_destroy(routes); } /************************************************************************//** @@ -2361,7 +2361,7 @@ void send_city_info_at_tile(struct player *pviewer, struct conn_list *dest, struct packet_web_city_info_addition web_packet; struct packet_city_short_info sc_pack; struct player *powner = NULL; - struct traderoute_packet_list *routes = NULL; + struct trade_route_packet_list *routes = NULL; if (!pcity) { pcity = tile_city(ptile); @@ -2382,7 +2382,7 @@ void send_city_info_at_tile(struct player *pviewer, struct conn_list *dest, /* Wait that city has been rearranged, if it's currently * not in sane state. */ - routes = traderoute_packet_list_new(); + routes = trade_route_packet_list_new(); /* Send all info to the owner */ update_dumb_city(powner, pcity); @@ -2393,18 +2393,18 @@ void send_city_info_at_tile(struct player *pviewer, struct conn_list *dest, lsend_packet_city_nationalities(dest, &nat_packet, FALSE); lsend_packet_city_rally_point(dest, &rally_packet, FALSE); web_lsend_packet(city_info_addition, dest, &web_packet, FALSE); - traderoute_packet_list_iterate(routes, route_packet) { - lsend_packet_traderoute_info(dest, route_packet); - } traderoute_packet_list_iterate_end; + trade_route_packet_list_iterate(routes, route_packet) { + lsend_packet_trade_route_info(dest, route_packet); + } trade_route_packet_list_iterate_end; if (dest == powner->connections) { /* HACK: send also a copy to global observers. */ packet.original = city_original_owner(pcity, NULL); conn_list_iterate(game.est_connections, pconn) { if (conn_is_global_observer(pconn)) { send_packet_city_info(pconn, &packet, FALSE); - traderoute_packet_list_iterate(routes, route_packet) { - send_packet_traderoute_info(pconn, route_packet); - } traderoute_packet_list_iterate_end; + trade_route_packet_list_iterate(routes, route_packet) { + send_packet_trade_route_info(pconn, route_packet); + } trade_route_packet_list_iterate_end; } } conn_list_iterate_end; } @@ -2413,7 +2413,7 @@ void send_city_info_at_tile(struct player *pviewer, struct conn_list *dest, /* send info to non-owner */ if (!pviewer) { /* observer */ if (pcity) { - routes = traderoute_packet_list_new(); + routes = trade_route_packet_list_new(); /* Should be dumb_city info? */ package_city(pcity, &packet, &nat_packet, &rally_packet, @@ -2422,9 +2422,9 @@ void send_city_info_at_tile(struct player *pviewer, struct conn_list *dest, lsend_packet_city_nationalities(dest, &nat_packet, FALSE); lsend_packet_city_rally_point(dest, &rally_packet, FALSE); web_lsend_packet(city_info_addition, dest, &web_packet, FALSE); - traderoute_packet_list_iterate(routes, route_packet) { - lsend_packet_traderoute_info(dest, route_packet); - } traderoute_packet_list_iterate_end; + trade_route_packet_list_iterate(routes, route_packet) { + lsend_packet_trade_route_info(dest, route_packet); + } trade_route_packet_list_iterate_end; } } else { if (map_is_known_and_seen(ptile, pviewer, V_MAIN)) { @@ -2444,10 +2444,10 @@ void send_city_info_at_tile(struct player *pviewer, struct conn_list *dest, } if (routes != NULL) { - traderoute_packet_list_iterate(routes, route_packet) { + trade_route_packet_list_iterate(routes, route_packet) { FC_FREE(route_packet); - } traderoute_packet_list_iterate_end; - traderoute_packet_list_destroy(routes); + } trade_route_packet_list_iterate_end; + trade_route_packet_list_destroy(routes); } } @@ -2460,7 +2460,7 @@ void package_city(struct city *pcity, struct packet_city_info *packet, struct packet_city_nationalities *nat_packet, struct packet_city_rally_point *rally_packet, struct packet_web_city_info_addition *web_packet, - struct traderoute_packet_list *routes, + struct trade_route_packet_list *routes, bool dipl_invest) { int i; @@ -2560,7 +2560,7 @@ void package_city(struct city *pcity, struct packet_city_info *packet, i = 0; trade_routes_iterate(pcity, proute) { - struct packet_traderoute_info *tri_packet = fc_malloc(sizeof(struct packet_traderoute_info)); + struct packet_trade_route_info *tri_packet = fc_malloc(sizeof(struct packet_trade_route_info)); tri_packet->city = pcity->id; tri_packet->index = i; @@ -2569,12 +2569,12 @@ void package_city(struct city *pcity, struct packet_city_info *packet, tri_packet->direction = proute->dir; tri_packet->goods = goods_number(proute->goods); - traderoute_packet_list_append(routes, tri_packet); + trade_route_packet_list_append(routes, tri_packet); i++; } trade_routes_iterate_end; - packet->traderoute_count = i; + packet->trade_route_count = i; output_type_iterate(o) { packet->surplus[o] = pcity->surplus[o]; diff --git a/server/citytools.h b/server/citytools.h index 6d9ae0f8d1..350c303fe7 100644 --- a/server/citytools.h +++ b/server/citytools.h @@ -20,12 +20,12 @@ #define LOG_BUILD_TARGET LOG_DEBUG -#define SPECLIST_TAG traderoute_packet -#define SPECLIST_TYPE struct packet_traderoute_info +#define SPECLIST_TAG trade_route_packet +#define SPECLIST_TYPE struct packet_trade_route_info #include "speclist.h" -#define traderoute_packet_list_iterate(ptrlist, ptr) \ - TYPED_LIST_ITERATE(struct packet_traderoute_info, ptrlist, ptr) -#define traderoute_packet_list_iterate_end LIST_ITERATE_END +#define trade_route_packet_list_iterate(ptrlist, ptr) \ + TYPED_LIST_ITERATE(struct packet_trade_route_info, ptrlist, ptr) +#define trade_route_packet_list_iterate_end LIST_ITERATE_END int build_points_left(struct city *pcity); @@ -55,7 +55,7 @@ void package_city(struct city *pcity, struct packet_city_info *packet, struct packet_city_nationalities *nat_packet, struct packet_city_rally_point *rally_packet, struct packet_web_city_info_addition *web_packet, - struct traderoute_packet_list *routes, + struct trade_route_packet_list *routes, bool dipl_invest); void reality_check_city(struct player *pplayer, struct tile *ptile); diff --git a/server/cityturn.c b/server/cityturn.c index 8a90d466fd..198da94452 100644 --- a/server/cityturn.c +++ b/server/cityturn.c @@ -616,7 +616,7 @@ void update_city_activities(struct player *pplayer) citizens_convert(pcity); - /* Cancel traderoutes that cannot exist any more */ + /* Cancel trade routes that cannot exist any more */ trade_routes_iterate_safe(pcity, proute) { struct city *tcity = game_city_by_number(proute->partner); @@ -1397,7 +1397,7 @@ static bool worklist_item_postpone_req_vec(struct universal *target, } break; case VUT_NATION: - if (preq->range < REQ_RANGE_TRADEROUTE + if (preq->range < REQ_RANGE_TRADE_ROUTE || preq->range == REQ_RANGE_PLAYER) { /* At higher ranges, new players with their nations may arrive */ purge = TRUE; @@ -1427,7 +1427,7 @@ static bool worklist_item_postpone_req_vec(struct universal *target, } break; case VUT_NATIONGROUP: - if (preq->range < REQ_RANGE_TRADEROUTE + if (preq->range < REQ_RANGE_TRADE_ROUTE || preq->range == REQ_RANGE_PLAYER) { /* At higher ranges, new players with their nations may arrive */ purge = TRUE; diff --git a/server/diplomats.c b/server/diplomats.c index 6c03dd8940..f119ca7a21 100644 --- a/server/diplomats.c +++ b/server/diplomats.c @@ -332,7 +332,7 @@ bool diplomat_investigate(struct player *pplayer, struct unit *pdiplomat, struct packet_city_nationalities nat_packet; struct packet_city_rally_point rally_packet; struct packet_web_city_info_addition web_packet; - struct traderoute_packet_list *routes; + struct trade_route_packet_list *routes; const struct unit_type *act_utype; /* Fetch target city's player. Sanity checks. */ @@ -383,7 +383,7 @@ bool diplomat_investigate(struct player *pplayer, struct unit *pdiplomat, } unit_list_iterate_end; /* Send city info to investigator's player. As this is a special case we bypass send_city_info. */ - routes = traderoute_packet_list_new(); + routes = trade_route_packet_list_new(); package_city(pcity, &city_packet, &nat_packet, &rally_packet, &web_packet, routes, TRUE); /* We need to force to send the packet to ensure the client will receive @@ -393,11 +393,11 @@ bool diplomat_investigate(struct player *pplayer, struct unit *pdiplomat, lsend_packet_city_nationalities(pplayer->connections, &nat_packet, TRUE); lsend_packet_city_rally_point(pplayer->connections, &rally_packet, TRUE); web_lsend_packet(city_info_addition, pplayer->connections, &web_packet, TRUE); - traderoute_packet_list_iterate(routes, route_packet) { - lsend_packet_traderoute_info(pplayer->connections, route_packet); + trade_route_packet_list_iterate(routes, route_packet) { + lsend_packet_trade_route_info(pplayer->connections, route_packet); FC_FREE(route_packet); - } traderoute_packet_list_iterate_end; - traderoute_packet_list_destroy(routes); + } trade_route_packet_list_iterate_end; + trade_route_packet_list_destroy(routes); /* This may cause a diplomatic incident */ action_consequence_success(paction, pplayer, act_utype, cplayer, diff --git a/server/rssanity.c b/server/rssanity.c index b867a98a20..a4cb9fb093 100644 --- a/server/rssanity.c +++ b/server/rssanity.c @@ -167,7 +167,7 @@ static bool sanity_check_req_individual(rs_conversion_logger logger, "%s (only great wonders supported)", list_for, improvement_name_translation(pimprove)); return FALSE; - } else if (preq->range > REQ_RANGE_TRADEROUTE && !is_wonder(pimprove)) { + } else if (preq->range > REQ_RANGE_TRADE_ROUTE && !is_wonder(pimprove)) { ruleset_error(logger, LOG_ERROR, "%s: %s-ranged requirement not supported for " "%s (only wonders supported)", list_for, diff --git a/server/ruleset.c b/server/ruleset.c index 99ac05ff98..6da394d230 100644 --- a/server/ruleset.c +++ b/server/ruleset.c @@ -7847,21 +7847,21 @@ static bool load_ruleset_game(struct section_file *file, bool act, "trade.settings%d.pct", i); cancelling = secfile_lookup_str_default(file, "Active", "trade.settings%d.cancelling", i); - set->cancelling = traderoute_cancelling_type_by_name(cancelling); + set->cancelling = trade_route_cancelling_type_by_name(cancelling); if (set->cancelling == TRI_LAST) { ruleset_error(NULL, LOG_ERROR, - "\"%s\" unknown traderoute cancelling type \"%s\".", + "\"%s\" unknown trade route cancelling type \"%s\".", filename, cancelling); ok = FALSE; } bonus = secfile_lookup_str_default(file, "None", "trade.settings%d.bonus", i); - set->bonus_type = traderoute_bonus_type_by_name(bonus, fc_strcasecmp); + set->bonus_type = trade_route_bonus_type_by_name(bonus, fc_strcasecmp); - if (!traderoute_bonus_type_is_valid(set->bonus_type)) { + if (!trade_route_bonus_type_is_valid(set->bonus_type)) { ruleset_error(NULL, LOG_ERROR, - "\"%s\" unknown traderoute bonus type \"%s\".", + "\"%s\" unknown trade route bonus type \"%s\".", filename, bonus); ok = FALSE; } diff --git a/server/settings.c b/server/settings.c index a49c85d552..de6f3bdb4f 100644 --- a/server/settings.c +++ b/server/settings.c @@ -2214,7 +2214,7 @@ static struct setting settings[] = { GEN_ENUM("trade_revenue_style", game.info.trade_revenue_style, SSET_RULES, SSET_ECONOMICS, SSET_RARE, ALLOW_NONE, ALLOW_BASIC, N_("Trade revenue style"), - N_("The formula for the trade a city receives from a traderoute. " + N_("The formula for the trade a city receives from a trade route. " "CLASSIC revenues are given by the sum of the two city sizes " "plus the distance between them, with multipliers for overseas " "and international routes. " diff --git a/server/unithand.c b/server/unithand.c index d47bd5df33..2a00fb71c9 100644 --- a/server/unithand.c +++ b/server/unithand.c @@ -5481,7 +5481,7 @@ static bool unit_do_help_build(struct player *pplayer, } /**********************************************************************//** - Handle request to establish traderoute. If pcity_dest is NULL, assumes + Handle request to establish trade route. If pcity_dest is NULL, assumes that unit is inside target city. Returns TRUE iff action could be done, FALSE if it couldn't. Even if @@ -5503,7 +5503,7 @@ static bool do_unit_establish_trade(struct player *pplayer, struct city *pcity_homecity; struct trade_route_list *routes_out_of_dest; struct trade_route_list *routes_out_of_home; - enum traderoute_bonus_type bonus_type; + enum trade_route_bonus_type bonus_type; struct goods_type *goods; const char *goods_str; const struct unit_type *act_utype; diff --git a/tools/ruleutil/rulesave.c b/tools/ruleutil/rulesave.c index 1d72d2b9bb..d41de8f530 100644 --- a/tools/ruleutil/rulesave.c +++ b/tools/ruleutil/rulesave.c @@ -1536,7 +1536,7 @@ static bool save_game_ruleset(const char *filename, const char *name) set_count = 0; for (trt = 0; trt < TRT_LAST; trt++) { struct trade_route_settings *set = trade_route_settings_by_type(trt); - const char *cancelling = traderoute_cancelling_type_name(set->cancelling); + const char *cancelling = trade_route_cancelling_type_name(set->cancelling); if (set->trade_pct != 100 || strcmp(cancelling, "Active")) { char path[256]; @@ -1550,7 +1550,7 @@ static bool save_game_ruleset(const char *filename, const char *name) "%s.pct", path); secfile_insert_str(sfile, cancelling, "%s.cancelling", path); - secfile_insert_str(sfile, traderoute_bonus_type_name(set->bonus_type), + secfile_insert_str(sfile, trade_route_bonus_type_name(set->bonus_type), "%s.bonus", path); } } -- 2.40.1