From 3a2db530977e4499ddb4d21b62a3104eef103e54 Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Fri, 11 Jun 2021 12:27:44 +0200 Subject: [PATCH 3/3] Replace OnDomesticTile with DiplRelTile. See osdn #42516 --- common/fc_types.h | 22 ++++++++++------------ common/metaknowledge.c | 1 - common/reqtext.c | 12 ------------ common/requirements.c | 11 ----------- data/sandbox/game.ruleset | 6 +++--- data/webperimental/game.ruleset | 6 +++--- doc/README.effects | 3 +-- 7 files changed, 17 insertions(+), 44 deletions(-) diff --git a/common/fc_types.h b/common/fc_types.h index 2a5205651d..b058a73a53 100644 --- a/common/fc_types.h +++ b/common/fc_types.h @@ -541,18 +541,16 @@ typedef int Unit_Class_id; #define SPECENUM_VALUE0NAME "Transported" #define SPECENUM_VALUE1 USP_LIVABLE_TILE #define SPECENUM_VALUE1NAME "OnLivableTile" -#define SPECENUM_VALUE2 USP_DOMESTIC_TILE -#define SPECENUM_VALUE2NAME "OnDomesticTile" -#define SPECENUM_VALUE3 USP_TRANSPORTING -#define SPECENUM_VALUE3NAME "Transporting" -#define SPECENUM_VALUE4 USP_HAS_HOME_CITY -#define SPECENUM_VALUE4NAME "HasHomeCity" -#define SPECENUM_VALUE5 USP_NATIVE_TILE -#define SPECENUM_VALUE5NAME "OnNativeTile" -#define SPECENUM_VALUE6 USP_NATIVE_EXTRA -#define SPECENUM_VALUE6NAME "InNativeExtra" -#define SPECENUM_VALUE7 USP_MOVED_THIS_TURN -#define SPECENUM_VALUE7NAME "MovedThisTurn" +#define SPECENUM_VALUE2 USP_TRANSPORTING +#define SPECENUM_VALUE2NAME "Transporting" +#define SPECENUM_VALUE3 USP_HAS_HOME_CITY +#define SPECENUM_VALUE3NAME "HasHomeCity" +#define SPECENUM_VALUE4 USP_NATIVE_TILE +#define SPECENUM_VALUE4NAME "OnNativeTile" +#define SPECENUM_VALUE5 USP_NATIVE_EXTRA +#define SPECENUM_VALUE5NAME "InNativeExtra" +#define SPECENUM_VALUE6 USP_MOVED_THIS_TURN +#define SPECENUM_VALUE6NAME "MovedThisTurn" #define SPECENUM_COUNT USP_COUNT #include "specenum_gen.h" diff --git a/common/metaknowledge.c b/common/metaknowledge.c index 227ac657a6..4796452995 100644 --- a/common/metaknowledge.c +++ b/common/metaknowledge.c @@ -208,7 +208,6 @@ static bool is_req_knowable(const struct player *pow_player, switch (req->source.value.unit_state) { case USP_TRANSPORTED: case USP_LIVABLE_TILE: - case USP_DOMESTIC_TILE: case USP_TRANSPORTING: case USP_NATIVE_TILE: case USP_NATIVE_EXTRA: diff --git a/common/reqtext.c b/common/reqtext.c index 20df071969..da3991e571 100644 --- a/common/reqtext.c +++ b/common/reqtext.c @@ -1546,18 +1546,6 @@ bool req_text_insert(char *buf, size_t bufsz, struct player *pplayer, _("Requires that the unit isn't on livable tile.")); } return TRUE; - case USP_DOMESTIC_TILE: - fc_strlcat(buf, prefix, bufsz); - if (preq->present) { - cat_snprintf(buf, bufsz, - _("Requires that the unit is on a domestic " - "tile.")); - } else { - cat_snprintf(buf, bufsz, - _("Requires that the unit isn't on a domestic " - "tile.")); - } - return TRUE; case USP_TRANSPORTING: fc_strlcat(buf, prefix, bufsz); if (preq->present) { diff --git a/common/requirements.c b/common/requirements.c index 75bafb1e6c..02cda490a9 100644 --- a/common/requirements.c +++ b/common/requirements.c @@ -2649,10 +2649,6 @@ static enum fc_tristate is_unit_state(const struct unit *target_unit, can_unit_exist_at_tile(&(wld.map), target_unit, unit_tile(target_unit))); break; - case USP_DOMESTIC_TILE: - return BOOL_TO_TRISTATE( - tile_owner(unit_tile(target_unit)) == unit_owner(target_unit)); - break; case USP_TRANSPORTING: return BOOL_TO_TRISTATE(0 < get_transporter_occupancy(target_unit)); case USP_HAS_HOME_CITY: @@ -4498,12 +4494,6 @@ const char *universal_name_translation(const struct universal *psource, * "Missile+On livable tile") */ _("On livable tile")); break; - case USP_DOMESTIC_TILE: - cat_snprintf(buf, bufsz, - /* TRANS: unit state. (appears in strings like - * "Missile+On domestic tile") */ - _("On domestic tile")); - break; case USP_TRANSPORTING: /* TRANS: unit state. (appears in strings like "Missile+Transported") */ cat_snprintf(buf, bufsz, _("Transporting")); @@ -5213,7 +5203,6 @@ static enum req_item_found ustate_found(const struct requirement *preq, case USP_NATIVE_TILE: /* USP_NATIVE_TILE isn't a strict subset of USP_LIVABLE_TILE. See * UTYF_COAST_STRICT. */ - case USP_DOMESTIC_TILE: case USP_HAS_HOME_CITY: case USP_NATIVE_EXTRA: case USP_MOVED_THIS_TURN: diff --git a/data/sandbox/game.ruleset b/data/sandbox/game.ruleset index d648d9710c..60807122e0 100644 --- a/data/sandbox/game.ruleset +++ b/data/sandbox/game.ruleset @@ -1486,8 +1486,8 @@ action = "Expel Unit" actor_reqs = { "type", "name", "range", "present" "UnitClassFlag", "BorderPolice", "Local", TRUE - "UnitState", "OnDomesticTile", "Local", TRUE - "DiplRel", "Foreign", "Local", TRUE + "DiplRelTile", "Foreign", "Local", FALSE + "DiplRel", "Foreign", "Local", TRUE "DiplRel", "Team", "Local", FALSE "DiplRel", "Alliance", "Local", FALSE "DiplRel", "War", "Local", FALSE @@ -1496,7 +1496,7 @@ actor_reqs = target_reqs = { "type", "name", "range", "present" "UnitClassFlag", "Expellable", "Local", TRUE - "UnitState", "OnDomesticTile", "Local", FALSE + "DiplRelTile", "Foreign", "Local", TRUE } [actionenabler_nuke] diff --git a/data/webperimental/game.ruleset b/data/webperimental/game.ruleset index 9cdb51aeb2..b2125e2f1d 100644 --- a/data/webperimental/game.ruleset +++ b/data/webperimental/game.ruleset @@ -1184,8 +1184,8 @@ action = "Expel Unit" actor_reqs = { "type", "name", "range", "present" "UnitFlag", "BorderPolice", "Local", TRUE - "UnitState", "OnDomesticTile", "Local", TRUE - "DiplRel", "Foreign", "Local", TRUE + "DiplRelTile", "Foreign", "Local", FALSE + "DiplRel", "Foreign", "Local", TRUE "DiplRel", "Team", "Local", FALSE "DiplRel", "Alliance", "Local", FALSE "DiplRel", "War", "Local", FALSE @@ -1194,7 +1194,7 @@ actor_reqs = target_reqs = { "type", "name", "range", "present" "UnitFlag", "Expellable", "Local", TRUE - "UnitState", "OnDomesticTile", "Local", FALSE + "DiplRelTile", "Foreign", "Local", TRUE } ; The GameLoss unit requirement makes sending units on a suicide mission to diff --git a/doc/README.effects b/doc/README.effects index 2dc3b47068..e832e21b9e 100644 --- a/doc/README.effects +++ b/doc/README.effects @@ -109,7 +109,7 @@ CityStatus is "OwnedByOriginal", "Starved", "Disorder", or "Celebration" DiplRel is a diplomatic relationship. MaxUnitsOnTile is about the number of units present on a tile. UnitState is "Transported", "Transporting", "OnNativeTile", "OnLivableTile", -"InNativeExtra", "OnDomesticTile", "MovedThisTurn" or "HasHomeCity". +"InNativeExtra", "MovedThisTurn" or "HasHomeCity". Activity is "Idle", "Pollution", "Mine", "Irrigate", "Fortified", "Pillage", "Transform", "Fortifying", "Fallout", "Base", "Road", "Convert", "Cultivate", or "Plant". @@ -760,6 +760,5 @@ The UnitState requirement type outside of a transport. "InNativeExtra" is fulfilled if the unit is on a tile with an extra native to it. -"OnDomesticTile" is fulfilled if the unit is on a tile owned by its player. "MovedThisTurn" is fulfilled if the unit has moved this turn. "HasHomeCity" is fulfilled if the unit has a home city. -- 2.30.2