53 struct tile *pdefender_tile);
59 const struct action *paction,
60 struct unit *pdiplomat,
struct unit *pvictim,
61 struct tile *ptile,
struct player **defender_owner);
63 const struct city *pcity,
64 const struct action *paction);
66 struct unit *pdiplomat,
bool city_related,
67 struct tile *ptile,
const char *vlink,
68 const struct action *paction);
85 struct city *pcity,
const struct action *paction)
107 nullptr, ctile,
nullptr)) {
118 _(
"Your %s poisoned the water supply of %s."),
121 _(
"%s is suspected of poisoning the water supply of %s."),
124 if (
game.
info.poison_empties_food_stock) {
135 _(
"Your %s destroyed %s by poisoning its water supply."),
138 _(
"%s is suspected of destroying %s by poisoning its"
168 struct city *tgt_city,
const struct action *paction)
170 struct player *tgt_player;
171 struct tile *tgt_tile;
173 const char *tgt_city_link;
191 log_debug(
"spread plague: unit: %d", act_unit->
id);
195 nullptr, tgt_tile,
nullptr)) {
207 _(
"Your %s was caught attempting to do %s!"),
211 tgt_player, tgt_tile, E_ENEMY_DIPLOMAT_FAILED,
ftc_server,
213 _(
"You caught %s %s attempting to do %s in %s!"),
222 wipe_unit(act_unit, ULR_CAUGHT, tgt_player);
238 act_player, tgt_tile, E_UNIT_ACTION_ACTOR_SUCCESS,
ftc_server,
240 _(
"Your %s did %s to %s."),
unit_link(act_unit),
242 notify_player(tgt_player, tgt_tile, E_UNIT_ACTION_TARGET_HOSTILE,
245 _(
"%s done to %s, %s suspected."),
272 struct city *pcity,
const struct action *paction)
275 struct packet_unit_short_info unit_packet {
277 struct packet_city_info city_packet {
279 struct traderoute_packet_list *routes;
291 if (cplayer == pplayer) {
311 lsend_packet_unit_short_info(pplayer->
connections, &unit_packet,
true);
320 lsend_packet_unit_short_info(pplayer->
connections, &unit_packet,
true);
325 routes = traderoute_packet_list_new();
329 lsend_packet_city_info(pplayer->
connections, &city_packet,
true);
332 lsend_packet_traderoute_info(pplayer->
connections, route_packet);
334 route_packet =
nullptr;
337 traderoute_packet_list_destroy(routes);
362 struct city *pcity,
const struct action *paction,
365 struct packet_city_sabotage_list packet;
398 packet.actor_id = pdiplomat->
id;
399 packet.city_id = pcity->
id;
400 packet.act_id = paction->
id;
401 packet.disturb_player = disturb_player;
402 send_packet_city_sabotage_list(pc, &packet);
419 struct city *pcity,
const struct action *paction)
433 if (cplayer == pplayer) {
446 _(
"You have established an embassy in %s."),
449 ftc_server,
_(
"The %s have established an embassy in %s."),
478 struct unit *pvictim,
const struct action *paction)
492 log_debug(
"sabotage-unit: unit: %d", pdiplomat->
id);
506 if (pvictim->
hp < 2) {
513 _(
"Your %s's successful sabotage killed the %s %s."),
519 _(
"Your %s was killed by %s sabotage!"), victim_link,
529 _(
"Your %s succeeded in sabotaging the %s %s."),
535 _(
"Your %s was sabotaged by the %s!"), victim_link,
562 struct unit *pvictim,
const struct action *paction)
566 struct tile *victim_tile;
568 int diplomat_id = pdiplomat->
id;
582 if (uplayer == pplayer) {
591 false,
"bribe-unit: already got unique unit");
602 _(
"You don't have enough gold to bribe the %s %s."),
604 log_debug(
"bribe-unit: not enough gold");
613 pvictim, pvictim->
tile,
nullptr)) {
631 _(
"Your %s succeeded in bribing the %s."),
638 _(
"Your %s was bribed by the %s."), victim_link,
646 || 1 < unit_list_size(
unit_tile(pvictim)->units));
676 ACTION_TRANSPORT_EMBARK, ACT_REQ_RULES)))
682 pdiplomat, victim_tile,
686 ACTION_TRANSPORT_DISEMBARK1,
693 pdiplomat, victim_tile,
697 ACTION_TRANSPORT_DISEMBARK2,
726 struct tile *tgt_tile,
const struct action *paction)
729 struct player *tgt_player =
nullptr;
735 act_unit_id = act_unit->
id;
739 tgt_tile, &tgt_player);
774 times = pcity->
steal - bonus;
807 const struct action *paction)
809 struct research *presearch, *cresearch;
827 if (cplayer == pplayer) {
858 }
else if (technology !=
A_UNSET) {
866 game.
info.tech_steal_allow_holes)) {
875 nullptr, pcity->
tile,
nullptr)) {
887 if (times > 0 && expected_kills) {
890 log_debug(
"steal-tech: difficulty: impossible");
899 log_debug(
"steal-tech: difficulty: %d", count);
912 if (times > 0 && expected_kills) {
916 _(
"%s was expecting your attempt to steal technology "
917 "again. Your %s was caught and executed."),
922 _(
"The %s %s failed to steal technology again from %s. "
923 "We were prepared for the attempt."),
930 _(
"Your %s was caught in the attempt of"
931 " stealing technology from %s."),
936 _(
"The %s %s failed to steal technology from %s."),
944 wipe_unit(pdiplomat, ULR_CAUGHT, cplayer);
948 tech_stolen =
steal_a_tech(pplayer, cplayer, technology);
950 if (tech_stolen ==
A_NONE) {
986 struct player *inc_player,
int revolt_gold)
988 if (
game.
server.incite_gold_loss_chance <= 0) {
995 _(
"Your %d gold prepared to incite the revolt was lost!"),
1004 _(
"Your security service captured %d gold prepared "
1005 "to incite your town!"),
1037 struct city *pcity,
const struct action *paction)
1054 if (cplayer == pplayer) {
1070 _(
"You don't have enough gold to subvert %s."), clink);
1077 nullptr, pcity->
tile,
nullptr)) {
1087 _(
"Your %s was caught in the attempt"
1088 " of inciting a revolt!"),
1091 _(
"You caught %s %s attempting"
1092 " to incite a revolt in %s!"),
1101 wipe_unit(pdiplomat, ULR_CAUGHT, cplayer);
1119 _(
"Revolt incited in %s, you now rule the city!"), clink);
1121 _(
"%s has revolted, %s influence suspected."), clink,
1172 const struct action *paction)
1191 nullptr, pcity->
tile,
nullptr)) {
1201 _(
"Your %s was caught in the attempt"
1202 " of industrial sabotage!"),
1206 _(
"You caught %s %s attempting sabotage in %s!"),
1214 wipe_unit(pdiplomat, ULR_CAUGHT, cplayer);
1224 if (pimprove->sabotage > 0) {
1230 log_debug(
"sabotage: count of improvements: %d", count);
1243 _(
"Your %s could not find anything to sabotage in %s."),
1247 log_debug(
"sabotage: random: nothing to do");
1250 if (count == 0 ||
fc_rand(2) == 1) {
1252 log_debug(
"sabotage: random: targeted production");
1259 if (pimprove->sabotage > 0) {
1270 if (
nullptr != ptarget) {
1271 log_debug(
"sabotage: random: targeted improvement: %d (%s)",
1275 qCritical(
"sabotage: random: targeted improvement error!");
1278 }
else if (improvement < 0) {
1281 log_debug(
"sabotage: specified target production");
1284 if (pimprove ==
nullptr) {
1285 qCritical(
"sabotage: requested for invalid improvement %d",
1297 log_debug(
"sabotage: specified target improvement: %d (%s)",
1305 log_debug(
"sabotage: disallowed target improvement: %d (%s)",
1312 _(
"Your %s could not find the %s to sabotage in %s."),
1317 log_debug(
"sabotage: target improvement not found: %d (%s)",
1324 if (
nullptr == ptarget) {
1336 _(
"Your %s succeeded in destroying"
1337 " the production of %s in %s."),
1341 _(
"The production of %s was destroyed in %s,"
1342 " %s are suspected."),
1344 log_debug(
"sabotage: sabotaged production");
1346 int vulnerability = ptarget->
sabotage;
1355 vulnerability -= (vulnerability
1358 if (
fc_rand(100) >= vulnerability) {
1362 _(
"Your %s was caught in the attempt of sabotage!"),
1366 _(
"You caught %s %s attempting"
1367 " to sabotage the %s in %s!"),
1375 wipe_unit(pdiplomat, ULR_CAUGHT, cplayer);
1376 log_debug(
"sabotage: caught in capital or on city walls");
1389 log_debug(
"sabotage: sabotaged improvement: %d (%s)",
1425 struct city *tgt_city,
const struct action *paction)
1427 struct player *tgt_player;
1428 struct tile *tgt_tile;
1430 const char *tgt_city_link;
1449 if (tgt_player == act_player) {
1466 nullptr, tgt_tile,
nullptr)) {
1476 _(
"Your %s was caught attempting to steal gold!"),
1480 _(
"You caught %s %s attempting"
1481 " to steal your gold in %s!"),
1490 wipe_unit(act_unit, ULR_CAUGHT, tgt_player);
1505 gold_take =
fc_rand(gold_take) + 1;
1507 log_debug(
"steal gold: will take %d gold", gold_take);
1515 - (gold_take *
get_unit_bonus(act_unit, EFT_THIEFS_SHARE_PM)) / 1000;
1517 log_debug(
"steal gold: will give %d gold", gold_give);
1525 PL_(
"Your %s stole %d gold from %s.",
1526 "Your %s stole %d gold from %s.", gold_give),
1527 unit_link(act_unit), gold_give, tgt_city_link);
1530 PL_(
"%d gold stolen from %s, %s suspected.",
1531 "%d gold stolen from %s, %s suspected.", gold_take),
1532 gold_take, tgt_city_link,
1560 struct city *tgt_city,
const struct action *paction)
1562 struct player *tgt_player;
1563 struct tile *tgt_tile;
1565 int normal_tile_prob;
1567 const char *tgt_city_link;
1583 if (tgt_player == act_player) {
1591 log_debug(
"steal some maps: unit: %d", act_unit->
id);
1595 nullptr, tgt_tile,
nullptr)) {
1599 log_debug(
"steal some maps: infiltrated");
1605 _(
"Your %s was caught in an attempt of"
1606 " stealing parts of the %s world map!"),
1610 _(
"You caught %s %s attempting to steal"
1611 " parts of your world map in %s!"),
1620 wipe_unit(act_unit, ULR_CAUGHT, tgt_player);
1625 log_debug(
"steal some maps: succeeded");
1628 normal_tile_prob = 100
1630 nullptr, act_player, tgt_player,
1642 nullptr, paction, EFT_MAPS_STOLEN_PCT);
1648 game.
info.steal_maps_reveals_all_cities);
1652 _(
"Your %s stole parts of the %s world map in %s."),
1656 _(
"The %s are suspected of stealing"
1657 " parts of your world map in %s."),
1681 struct city *tgt_city,
const struct action *paction)
1683 struct player *tgt_player;
1684 struct tile *tgt_tile;
1686 const char *tgt_city_link;
1704 log_debug(
"suitcase nuke: unit: %d", act_unit->
id);
1708 nullptr, tgt_tile,
nullptr)) {
1712 log_debug(
"suitcase nuke: infiltrated");
1718 _(
"Your %s was caught in an attempt of"
1719 " hiding a nuke in %s!"),
1722 _(
"You caught %s %s attempting to hide a nuke in %s!"),
1731 wipe_unit(act_unit, ULR_CAUGHT, tgt_player);
1740 _(
"Your %s hid a nuke in %s."),
unit_link(act_unit),
1743 _(
"The %s are suspected of hiding a nuke in %s."),
1791 struct unit *pdefender,
1792 struct tile *pdefender_tile)
1830 nullptr,
tile_owner(pdefender_tile),
nullptr,
1831 tile_city(pdefender_tile),
nullptr, pdefender_tile,
nullptr,
1832 nullptr,
nullptr,
nullptr,
nullptr, EFT_SPY_RESISTANT)
1835 return static_cast<int>(
fc_rand(100)) < chance;
1856 const struct action *paction,
1857 struct unit *pdiplomat,
struct unit *pvictim,
1858 struct tile *ptile,
struct player **defender_owner)
1874 if (defender_owner !=
nullptr) {
1876 *defender_owner = uplayer;
1888 _(
"An enemy %s has been eliminated by your %s."),
1889 link_unit, link_diplomat);
1892 if (uplayer == cplayer || cplayer ==
nullptr) {
1895 _(
"Your %s has been eliminated defending %s"
1897 link_unit, link_city, link_diplomat);
1902 _(
"A %s %s has been eliminated defending %s "
1905 link_city, link_diplomat);
1909 _(
"Your %s has been eliminated defending %s %s "
1912 link_city, link_diplomat);
1915 if (uplayer == cplayer || cplayer ==
nullptr) {
1918 _(
"Your %s has been eliminated defending "
1920 link_unit, link_diplomat);
1924 _(
"A %s %s has been eliminated defending "
1930 _(
"Your %s has been eliminated defending "
1932 link_unit, link_diplomat);
1943 wipe_unit(punit, ULR_ELIMINATED, pplayer);
1948 const char *victim_link;
1955 _(
"Your %s was eliminated by a defending %s."),
1956 link_diplomat, link_unit);
1959 if (uplayer == cplayer || cplayer ==
nullptr) {
1961 _(
"Eliminated a %s %s while infiltrating %s."),
1966 _(
"A %s %s eliminated a %s %s while infiltrating "
1972 _(
"Your %s eliminated a %s %s while infiltrating "
1975 link_diplomat, link_city);
1978 if (uplayer == cplayer || cplayer ==
nullptr) {
1980 uplayer, ptile, E_ENEMY_DIPLOMAT_FAILED,
ftc_server,
1981 _(
"Eliminated a %s %s while infiltrating our troops."),
1985 cplayer, ptile, E_ENEMY_DIPLOMAT_FAILED,
ftc_server,
1986 _(
"A %s %s eliminated a %s %s while infiltrating our "
1991 uplayer, ptile, E_ENEMY_DIPLOMAT_FAILED,
ftc_server,
1993 _(
"Your %s eliminated a %s %s while infiltrating our "
2005 victim_link =
nullptr;
2032 wipe_unit(pdiplomat, ULR_ELIMINATED, uplayer);
2051 const struct city *pcity,
2052 const struct action *paction)
2079 struct unit *pdiplomat,
bool city_related,
2080 struct tile *ptile,
const char *vlink,
2081 const struct action *paction)
2084 struct city *spyhome;
2102 false,
false,
true,
false,
nullptr);
2107 ||
fc_rand(100) < escapechance)) {
2110 _(
"Your %s has successfully completed"
2111 " the mission and returned unharmed to %s."),
2120 qCritical(
"Bug in diplomat_escape: Spy can't teleport.");
2128 _(
"Your %s was captured after completing"
2129 " the mission in %s."),
2133 _(
"Your %s was captured after completing"
2142 wipe_unit(pdiplomat, ULR_CAUGHT,
nullptr);
bool is_action_enabled_unit_on_unit(const action_id wanted_action, const struct unit *actor_unit, const struct unit *target_unit)
Returns TRUE if actor_unit can do wanted_action to target_unit as far as action enablers are concerne...
const QString action_name_translation(const struct action *action)
Get the action name used when displaying the action in the UI.
bool is_action_enabled_unit_on_tile(const action_id wanted_action, const struct unit *actor_unit, const struct tile *target_tile, const struct extra_type *target_extra)
Returns TRUE if actor_unit can do wanted_action to the target_tile as far as action enablers are conc...
enum action_target_kind action_get_target_kind(const struct action *paction)
Get the target kind of an action.
bool action_has_result(const struct action *paction, enum action_result result)
Returns TRUE iff performing the specified action has the specified result.
bool BV_ISSET(const BV &bv, int bit)
bool city_has_building(const struct city *pcity, const struct impr_type *pimprove)
Return TRUE iff the city has this building in it.
struct player * city_owner(const struct city *pcity)
Return the owner of the city.
struct tile * city_tile(const struct city *pcity)
Return the tile location of the city.
const char * city_name_get(const struct city *pcity)
Return the name of the city.
citizens city_size_get(const struct city *pcity)
Get the city size.
#define city_built_iterate(_pcity, _p)
#define city_built_iterate_end
void nullify_prechange_production(struct city *pcity)
Initialize all variables containing information about production before it was changed.
bool city_empty_food_stock(struct city *pcity)
Returns TRUE iff the city's food stock was emptied.
int city_incite_cost(struct player *pplayer, struct city *pcity)
Returns the cost to incite a city.
bool city_reduce_size(struct city *pcity, citizens pop_loss, struct player *destroyer, const char *reason)
Reduce the city size.
bool city_refresh(struct city *pcity)
Updates unit upkeeps and city internal cached data.
struct unit * get_diplomatic_defender(const struct unit *act_unit, const struct unit *pvictim, const struct tile *tgt_tile)
Returns the defender of the tile in a diplomatic battle or nullptr if no diplomatic defender could be...
void establish_embassy(struct player *pplayer, struct player *aplayer)
Create an embassy.
static void diplomat_escape_full(struct player *pplayer, struct unit *pdiplomat, bool city_related, struct tile *ptile, const char *vlink, const struct action *paction)
This determines if a diplomat/spy survives and escapes.
bool spy_steal_some_maps(struct player *act_player, struct unit *act_unit, struct city *tgt_city, const struct action *paction)
Steal part of another player's map.
int diplomats_unignored_tech_stealings(struct unit *pdiplomat, struct city *pcity)
Returns the amount of tech thefts from a city not ignored by the EFT_STEALINGS_IGNORE effect.
bool spy_sabotage_unit(struct player *pplayer, struct unit *pdiplomat, struct unit *pvictim, const struct action *paction)
Sabotage an enemy unit.
static bool diplomat_may_lose_gold(struct player *dec_player, struct player *inc_player, int revolt_gold)
Gold for inciting might get lost.
bool diplomat_embassy(struct player *pplayer, struct unit *pdiplomat, struct city *pcity, const struct action *paction)
Establish an embassy.
static bool diplomat_success_vs_defender(struct unit *patt, struct unit *pdef, struct tile *pdefender_tile)
This determines if a diplomat/spy succeeds against some defender, who is also a diplomat or spy.
static bool diplomat_infiltrate_tile(struct player *pplayer, struct player *cplayer, const struct action *paction, struct unit *pdiplomat, struct unit *pvictim, struct tile *ptile, struct player **defender_owner)
This determines if a diplomat/spy succeeds in infiltrating a tile.
bool diplomat_get_tech(struct player *pplayer, struct unit *pdiplomat, struct city *pcity, Tech_type_id technology, const struct action *paction)
Try to steal a technology from an enemy city.
bool diplomat_sabotage(struct player *pplayer, struct unit *pdiplomat, struct city *pcity, Impr_type_id improvement, const struct action *paction)
Sabotage enemy city's improvement or production.
bool diplomat_incite(struct player *pplayer, struct unit *pdiplomat, struct city *pcity, const struct action *paction)
Incite a city to disaffect.
static void diplomat_escape(struct player *pplayer, struct unit *pdiplomat, const struct city *pcity, const struct action *paction)
This determines if a diplomat/spy survives and escapes.
bool spy_steal_gold(struct player *act_player, struct unit *act_unit, struct city *tgt_city, const struct action *paction)
Steal gold from another player.
bool spy_spread_plague(struct player *act_player, struct unit *act_unit, struct city *tgt_city, const struct action *paction)
Spread a plague to the target city.
bool spy_nuke_city(struct player *act_player, struct unit *act_unit, struct city *tgt_city, const struct action *paction)
Hide a suitcase nuke in a city and detonate it.
bool diplomat_investigate(struct player *pplayer, struct unit *pdiplomat, struct city *pcity, const struct action *paction)
Investigate a city.
static void diplomat_charge_movement(struct unit *pdiplomat, struct tile *ptile)
This subtracts the destination movement cost from a diplomat/spy.
void spy_send_sabotage_list(struct connection *pc, struct unit *pdiplomat, struct city *pcity, const struct action *paction, bool disturb_player)
Get list of improvements from city (for purposes of sabotage).
bool diplomat_bribe(struct player *pplayer, struct unit *pdiplomat, struct unit *pvictim, const struct action *paction)
Bribe an enemy unit.
bool spy_attack(struct player *act_player, struct unit *act_unit, struct tile *tgt_tile, const struct action *paction)
Diplomatic battle.
bool spy_poison(struct player *pplayer, struct unit *pdiplomat, struct city *pcity, const struct action *paction)
Poison a city's water supply.
int count_diplomats_on_tile(struct tile *ptile)
Return number of diplomats on this square.
int get_target_bonus_effects(struct effect_list *plist, const struct player *target_player, const struct player *other_player, const struct city *target_city, const struct impr_type *target_building, const struct tile *target_tile, const struct unit *target_unit, const struct unit_type *target_unittype, const struct output_type *target_output, const struct specialist *target_specialist, const struct action *target_action, enum effect_type effect_type, enum vision_layer vision_layer, enum national_intelligence nintel)
Returns the effect bonus of a given type for any target.
int get_unit_bonus(const struct unit *punit, enum effect_type effect_type)
Returns the effect bonus at a unit.
int get_city_bonus(const struct city *pcity, enum effect_type effect_type, enum vision_layer vlayer)
Returns the effect bonus at a city.
#define PL_(String1, String2, n)
const char * tile_link(const struct tile *ptile)
Get a text link to a tile.
const char * unit_tile_link(const struct unit *punit)
Get a text link to a unit tile (make a clickable link to a tile with the unit type name as text).
const struct ft_color ftc_server
const char * city_link(const struct city *pcity)
Get a text link to a city.
const char * unit_link(const struct unit *punit)
Get a text link to an unit.
const char * improvement_rule_name(const struct impr_type *pimprove)
Return the (untranslated) rule name of the improvement.
struct impr_type * improvement_by_number(const Impr_type_id id)
Returns the improvement type for the given index/ID.
Impr_type_id improvement_number(const struct impr_type *pimprove)
Return the improvement index.
Impr_type_id improvement_index(const struct impr_type *pimprove)
Return the improvement index.
const char * improvement_name_translation(const struct impr_type *pimprove)
Return the (translated) name of the given improvement.
#define improvement_iterate_end
#define improvement_iterate(_p)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define log_debug(message,...)
#define fc_assert_ret_val_msg(condition, val, message,...)
static int map_move_cost_unit(const struct civ_map *nmap, struct unit *punit, const struct tile *ptile)
void give_distorted_map(struct player *pfrom, struct player *pto, int prob, bool reveal_cities)
Transfer (random parts of) player pfrom's world map to pto.
struct vision_site * map_get_player_city(const struct tile *ptile, const struct player *pplayer)
Returns city located at given tile from player map.
bool can_unit_exist_at_tile(const struct civ_map *nmap, const struct unit *punit, const struct tile *ptile)
Return TRUE iff the unit can "exist" at this location.
const char * nation_plural_for_player(const struct player *pplayer)
Return the (translated) plural noun of the given nation of a player.
const char * nation_adjective_for_player(const struct player *pplayer)
Return the (translated) adjective for the given nation of a player.
void notify_player(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
Similar to notify_conn_packet (see also), but takes player as "destination".
@ UNIT_INFO_CITY_SUPPORTED
struct unit * player_unit_by_number(const struct player *pplayer, int unit_id)
If the specified player owns the unit with the specified id, return pointer to the unit struct.
const char * player_name(const struct player *pplayer)
Return the leader name of the player.
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
Returns true iff players are allied.
static bool is_barbarian(const struct player *pplayer)
void send_player_all_c(struct player *src, struct conn_list *dest)
Send all information about a player (player_info and all player_diplstates) to the given connections.
void send_player_info_c(struct player *src, struct conn_list *dest)
Send information about player slot 'src', or all valid (i.e.
const char * universal_name_translation(const struct universal *psource, char *buf, size_t bufsz)
Make user-friendly text for the source.
struct research * research_get(const struct player *pplayer)
Returns the research structure associated with the player.
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
Returns state of the tech for current research.
bool research_invention_gettable(const struct research *presearch, const Tech_type_id tech, bool allow_holes)
Returns TRUE iff the given tech can be given to the players sharing the research immediately.
void script_server_signal_emit(const char *signal_name,...)
Invoke all the callback functions attached to a given signal.
struct action::@10::@11 is_unit
struct universal production
struct unit_list * units_supported
struct civ_game::@28::@32 server
struct conn_list * est_connections
struct packet_game_info info
struct conn_list * connections
struct player_economic economic
#define sz_strlcpy(dest, src)
struct advance * valid_advance_by_number(const Tech_type_id id)
Returns pointer when the advance "exists" in this game, returns nullptr otherwise.
struct city * tile_city(const struct tile *ptile)
Return the city on this tile (or nullptr), checking for city center.
#define tile_owner(_tile)
bool unit_is_alive(int id)
Check if unit with given id is still alive.
int unit_bribe_cost(struct unit *punit, struct player *briber)
Calculate how expensive it is to bribe the unit.
bool unit_transported(const struct unit *pcargo)
Returns TRUE iff the unit is transported.
bool unit_move_handling(struct unit *punit, struct tile *pdesttile, bool igzoc, bool move_do_not_act)
Will try to move to/attack the tile dest_x,dest_y.
bool unit_perform_action(struct player *pplayer, const int actor_id, const int target_id, const int sub_tgt_id_incoming, const char *name, const action_id action_type, const enum action_requester requester)
Execute a request to perform an action and let the caller know if it was performed or not.
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const struct unit_type * unit_type_get(const struct unit *punit)
Return the unit type for this unit.
bool utype_player_already_has_this_unique(const struct player *pplayer, const struct unit_type *putype)
Returns TRUE iff the unit type is unique and the player already has one.
bool unit_has_type_flag(const struct unit *punit, enum unit_type_flag_id flag)
Return whether the unit has the given flag.
bool utype_is_consumed_by_action(const struct action *paction, const struct unit_type *utype)
Returns TRUE iff performing the specified action will consume an actor unit of the specified type.
const char * unit_name_translation(const struct unit *punit)
Return the (translated) name of the unit.
const struct veteran_level * utype_veteran_level(const struct unit_type *punittype, int level)
Return veteran level properties of given unit in given veterancy level.