130 const struct player *tplayer)
132 if (pplayer == tplayer) {
162 const struct player *other_player,
168 if (context == NULL) {
178 switch (req->
range) {
179 case REQ_RANGE_LOCAL:
180 if (context->
unit == NULL) {
187 case REQ_RANGE_CADJACENT:
188 case REQ_RANGE_ADJACENT:
189 case REQ_RANGE_CONTINENT:
191 case REQ_RANGE_TRADE_ROUTE:
192 case REQ_RANGE_PLAYER:
194 case REQ_RANGE_ALLIANCE:
195 case REQ_RANGE_WORLD:
196 case REQ_RANGE_COUNT:
204 if (context->
unit == NULL) {
211 case USP_TRANSPORTED:
212 case USP_LIVABLE_TILE:
213 case USP_TRANSPORTING:
214 case USP_NATIVE_TILE:
215 case USP_NATIVE_EXTRA:
218 case USP_HAS_HOME_CITY:
219 case USP_MOVED_THIS_TURN:
224 "Invalid unit state property.");
233 if (context->
unit == NULL) {
239 switch (req->
range) {
240 case REQ_RANGE_LOCAL:
243 case REQ_RANGE_CADJACENT:
244 case REQ_RANGE_ADJACENT:
246 case REQ_RANGE_TRADE_ROUTE:
247 case REQ_RANGE_CONTINENT:
248 case REQ_RANGE_PLAYER:
250 case REQ_RANGE_ALLIANCE:
251 case REQ_RANGE_WORLD:
252 case REQ_RANGE_COUNT:
260 FALSE,
"Wrong range");
262 if (context->
unit == NULL) {
280 || req->
source.
kind == VUT_DIPLREL_UNITANY_O) {
281 switch (req->
range) {
282 case REQ_RANGE_LOCAL:
283 if (other_player == NULL
284 || context->
player == NULL) {
290 if (pov_player == context->
player
291 || pov_player == other_player) {
302 case REQ_RANGE_PLAYER:
303 if (context->
player == NULL) {
309 if (pov_player == context->
player) {
322 case REQ_RANGE_ALLIANCE:
325 case REQ_RANGE_WORLD:
328 case REQ_RANGE_CADJACENT:
329 case REQ_RANGE_ADJACENT:
331 case REQ_RANGE_TRADE_ROUTE:
332 case REQ_RANGE_CONTINENT:
333 case REQ_RANGE_COUNT:
341 if (context->
city == NULL) {
355 if (context->
tile == NULL) {
361 switch (req->
range) {
362 case REQ_RANGE_LOCAL:
370 return pcity &&
city_owner(pcity) == pov_player;
371 case REQ_RANGE_CADJACENT:
380 if (pcity &&
city_owner(pcity) == pov_player) {
387 case REQ_RANGE_ADJACENT:
396 if (pcity &&
city_owner(pcity) == pov_player) {
404 case REQ_RANGE_TRADE_ROUTE:
405 case REQ_RANGE_CONTINENT:
406 case REQ_RANGE_PLAYER:
408 case REQ_RANGE_ALLIANCE:
409 case REQ_RANGE_WORLD:
410 case REQ_RANGE_COUNT:
420 if (context->
city == NULL) {
431 switch (req->
range) {
432 case REQ_RANGE_WORLD:
433 case REQ_RANGE_ALLIANCE:
435 case REQ_RANGE_PLAYER:
436 case REQ_RANGE_CONTINENT:
440 case REQ_RANGE_TRADE_ROUTE:
448 case REQ_RANGE_LOCAL:
449 if (context->
city == NULL) {
470 case REQ_RANGE_CADJACENT:
471 case REQ_RANGE_ADJACENT:
472 case REQ_RANGE_COUNT:
480 if (context->
player == NULL
481 && (req->
range == REQ_RANGE_PLAYER
482 || req->
range == REQ_RANGE_TEAM
483 || req->
range == REQ_RANGE_ALLIANCE)) {
494 if (req->
range == REQ_RANGE_PLAYER) {
495 if (context->
player == NULL) {
509 if (req->
range == REQ_RANGE_PLAYER) {
510 if (context->
player == NULL) {
516 return (pov_player == context->
player
522 if (context->
tile == NULL) {
528 switch (req->
range) {
529 case REQ_RANGE_LOCAL:
531 case REQ_RANGE_CADJACENT:
542 case REQ_RANGE_ADJACENT:
553 case REQ_RANGE_CONTINENT:
555 case REQ_RANGE_TRADE_ROUTE:
556 case REQ_RANGE_PLAYER:
558 case REQ_RANGE_ALLIANCE:
559 case REQ_RANGE_WORLD:
560 case REQ_RANGE_COUNT:
573 if (context->
tile == NULL) {
579 switch (req->
range) {
580 case REQ_RANGE_LOCAL:
582 case REQ_RANGE_CADJACENT:
587 case REQ_RANGE_ADJACENT:
597 case REQ_RANGE_TRADE_ROUTE:
602 case REQ_RANGE_CONTINENT:
603 case REQ_RANGE_PLAYER:
604 case REQ_RANGE_ALLIANCE:
606 case REQ_RANGE_WORLD:
607 case REQ_RANGE_COUNT:
638 const struct player *other_player,
664 const struct player *other_player,
665 const struct requirement_vector *
reqs,
673 current =
mke_eval_req(pov_player, context, other_player,
689 const struct player *target_player)
691 return pow_player == target_player
int city_map_radius_sq_get(const struct city *pcity)
#define city_tile(_pcity_)
#define city_owner(_pcity_)
#define city_tile_iterate(_nmap, _radius_sq, _city_tile, _tile)
#define city_tile_iterate_end
struct unit struct city struct unit struct tile * target_tile
struct unit struct city * target_city
bool could_intel_with_player(const struct player *pplayer, const struct player *aplayer)
bool is_improvement_visible(const struct impr_type *pimprove)
#define fc_assert_msg(condition, message,...)
#define fc_assert(condition)
#define fc_assert_ret_val_msg(condition, val, message,...)
#define cardinal_adjc_iterate_end
#define adjc_iterate(nmap, center_tile, itr_tile)
#define cardinal_adjc_iterate(nmap, center_tile, itr_tile)
bool can_player_see_unit(const struct player *pplayer, const struct unit *punit)
bool team_has_embassy(const struct team *pteam, const struct player *tgt_player)
bool player_can_see_city_externals(const struct player *pow_player, const struct city *target_city)
struct player_diplstate * player_diplstate_get(const struct player *plr1, const struct player *plr2)
bool can_player_see_hypotetic_units_at(const struct player *pplayer, const struct tile *ptile)
bool can_player_see_city_internals(const struct player *pplayer, const struct city *pcity)
const struct req_context * req_context_empty(void)
bool is_req_active(const struct req_context *context, const struct player *other_player, const struct requirement *req, const enum req_problem_type prob_type)
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
const struct player * player
bool tile_is_seen(const struct tile *target_tile, const struct player *pow_player)
struct city * tile_city(const struct tile *ptile)
#define trade_partners_iterate_end
#define trade_partners_iterate(c, p)
const struct impr_type * building
enum ustate_prop unit_state