Feature #1373 ยป 0047-Add-CityStatus-value-CapitalConnected.patch
common/accessarea.h | ||
---|---|---|
extern "C" {
|
||
#endif /* __cplusplus */
|
||
struct access_area {
|
||
const struct player *plr;
|
||
struct city_list *cities;
|
||
bool capital;
|
||
};
|
||
/* get 'struct access_area_list' and related functions: */
|
||
#define SPECLIST_TAG aarea
|
||
#define SPECLIST_TYPE struct access_area
|
common/fc_types.h | ||
---|---|---|
#define SPECENUM_VALUE1NAME "Founded"
|
||
#include "specenum_gen.h"
|
||
struct access_area {
|
||
const struct player *plr;
|
||
struct city_list *cities;
|
||
bool capital;
|
||
};
|
||
#ifdef __cplusplus
|
||
}
|
||
#endif /* __cplusplus */
|
common/reqtext.c | ||
---|---|---|
case CITYS_TRANSFERRED:
|
||
city_property = _("transferred");
|
||
break;
|
||
case CITYS_CAPITALCONNECTED:
|
||
city_property = _("capitalconnected");
|
||
break;
|
||
case CITYS_LAST:
|
||
fc_assert(preq->source.value.citystatus != CITYS_LAST);
|
||
break;
|
common/requirements.c | ||
---|---|---|
return TRI_MAYBE;
|
||
case CITYS_CAPITALCONNECTED:
|
||
if (!is_server()) {
|
||
/* Client has no idea. */
|
||
return TRI_MAYBE;
|
||
}
|
||
switch (req->range) {
|
||
case REQ_RANGE_CITY:
|
||
return BOOL_TO_TRISTATE(context->city->server.aarea != nullptr
|
||
&& context->city->server.aarea->capital);
|
||
case REQ_RANGE_TRADE_ROUTE:
|
||
{
|
||
enum fc_tristate ret;
|
||
if (context->city->server.aarea != nullptr
|
||
&& context->city->server.aarea->capital) {
|
||
return TRI_YES;
|
||
}
|
||
ret = TRI_NO;
|
||
trade_partners_iterate(context->city, trade_partner) {
|
||
if (trade_partner == nullptr) {
|
||
ret = TRI_MAYBE;
|
||
} else if (trade_partner->server.aarea != nullptr
|
||
&& trade_partner->server.aarea->capital) {
|
||
return TRI_YES;
|
||
}
|
||
} trade_partners_iterate_end;
|
||
return ret;
|
||
}
|
||
case REQ_RANGE_LOCAL:
|
||
case REQ_RANGE_TILE:
|
||
case REQ_RANGE_CADJACENT:
|
||
case REQ_RANGE_ADJACENT:
|
||
case REQ_RANGE_CONTINENT:
|
||
case REQ_RANGE_PLAYER:
|
||
case REQ_RANGE_TEAM:
|
||
case REQ_RANGE_ALLIANCE:
|
||
case REQ_RANGE_WORLD:
|
||
case REQ_RANGE_COUNT:
|
||
break;
|
||
}
|
||
fc_assert_msg(FALSE, "Invalid range %d for citystatus CapitalConnected.",
|
||
req->range);
|
||
return TRI_MAYBE;
|
||
case CITYS_LAST:
|
||
break;
|
||
}
|
||
... | ... | |
/* TRANS: CityStatus value - city has changed hands */
|
||
fc_strlcat(buf, _("Transferred"), bufsz);
|
||
break;
|
||
case CITYS_CAPITALCONNECTED:
|
||
fc_strlcat(buf, _("CapitalConnected"), bufsz);
|
||
break;
|
||
case CITYS_LAST:
|
||
fc_assert(psource->value.citystatus != CITYS_LAST);
|
||
fc_strlcat(buf, "error", bufsz);
|
doc/README.effects | ||
---|---|---|
the target tile in the given range (including the tile itself). At "Continent"
|
||
range this is just the full continent/ocean size.
|
||
CityStatus is "OwnedByOriginal", "Transferred", "Starved",
|
||
"Disorder", or "Celebration"
|
||
"Disorder", "Celebration", or "CapitalConnected"
|
||
The difference between "OwnedByOriginal" and "Transferred" is that
|
||
former is fulfilled also for liberated cities.
|
||
DiplRel is a diplomatic relationship.
|
gen_headers/enums/fc_types_enums.def | ||
---|---|---|
DISORDER "Disorder"
|
||
CELEBRATION "Celebration"
|
||
TRANSFERRED "Transferred"
|
||
CAPITALCONNECTED "CapitalConnected"
|
||
end
|