26 const struct tile *target_tile)
51 const struct tile *target_tile)
75 const struct city *target_city)
101 const struct city *target_city)
131 const struct player *tplayer)
133 if (pplayer == tplayer) {
160 const struct player *pow_player,
const struct player *target_player,
161 const struct player *other_player,
const struct city *target_city,
162 const struct tile *target_tile,
const struct unit *target_unit,
171 switch (req->
range) {
172 case REQ_RANGE_LOCAL:
173 if (target_unit ==
nullptr) {
180 case REQ_RANGE_CADJACENT:
181 case REQ_RANGE_ADJACENT:
182 case REQ_RANGE_CONTINENT:
184 case REQ_RANGE_TRADEROUTE:
185 case REQ_RANGE_PLAYER:
187 case REQ_RANGE_ALLIANCE:
188 case REQ_RANGE_WORLD:
189 case REQ_RANGE_COUNT:
198 if (target_unit ==
nullptr) {
205 case USP_TRANSPORTED:
206 case USP_LIVABLE_TILE:
207 case USP_DOMESTIC_TILE:
208 case USP_TRANSPORTING:
209 case USP_NATIVE_TILE:
210 case USP_NATIVE_EXTRA:
213 case USP_HAS_HOME_CITY:
214 case USP_MOVED_THIS_TURN:
219 "Invalid unit state property.");
229 if (target_unit ==
nullptr) {
235 switch (req->
range) {
236 case REQ_RANGE_LOCAL:
239 case REQ_RANGE_CADJACENT:
240 case REQ_RANGE_ADJACENT:
242 case REQ_RANGE_TRADEROUTE:
243 case REQ_RANGE_CONTINENT:
244 case REQ_RANGE_PLAYER:
246 case REQ_RANGE_ALLIANCE:
247 case REQ_RANGE_WORLD:
248 case REQ_RANGE_COUNT:
258 if (target_unit ==
nullptr) {
276 switch (req->
range) {
277 case REQ_RANGE_LOCAL:
278 if (other_player ==
nullptr || target_player ==
nullptr) {
284 if (pow_player == other_player) {
295 case REQ_RANGE_PLAYER:
296 if (target_player ==
nullptr) {
302 if (pow_player == target_player) {
315 case REQ_RANGE_ALLIANCE:
318 case REQ_RANGE_WORLD:
321 case REQ_RANGE_CADJACENT:
322 case REQ_RANGE_ADJACENT:
324 case REQ_RANGE_TRADEROUTE:
325 case REQ_RANGE_CONTINENT:
326 case REQ_RANGE_COUNT:
334 if (target_city ==
nullptr) {
348 if (target_tile ==
nullptr) {
354 switch (req->
range) {
355 case REQ_RANGE_LOCAL:
363 return pcity &&
city_owner(pcity) == pow_player;
364 case REQ_RANGE_CADJACENT:
374 if (pcity &&
city_owner(pcity) == pow_player) {
382 case REQ_RANGE_ADJACENT:
392 if (pcity &&
city_owner(pcity) == pow_player) {
401 case REQ_RANGE_TRADEROUTE:
402 case REQ_RANGE_CONTINENT:
403 case REQ_RANGE_PLAYER:
405 case REQ_RANGE_ALLIANCE:
406 case REQ_RANGE_WORLD:
407 case REQ_RANGE_COUNT:
428 switch (req->
range) {
429 case REQ_RANGE_WORLD:
430 case REQ_RANGE_ALLIANCE:
432 case REQ_RANGE_PLAYER:
433 case REQ_RANGE_CONTINENT:
437 case REQ_RANGE_TRADEROUTE:
445 case REQ_RANGE_LOCAL:
467 case REQ_RANGE_CADJACENT:
468 case REQ_RANGE_ADJACENT:
469 case REQ_RANGE_COUNT:
478 && (req->
range == REQ_RANGE_PLAYER || req->
range == REQ_RANGE_TEAM
479 || req->
range == REQ_RANGE_ALLIANCE)) {
490 if (req->
range == REQ_RANGE_PLAYER) {
491 if (!target_player) {
502 if (req->
range == REQ_RANGE_PLAYER) {
503 if (!target_player) {
509 return (pow_player == target_player
515 if (target_tile ==
nullptr) {
521 switch (req->
range) {
522 case REQ_RANGE_LOCAL:
524 case REQ_RANGE_CADJACENT:
537 case REQ_RANGE_ADJACENT:
550 case REQ_RANGE_CONTINENT:
552 case REQ_RANGE_TRADEROUTE:
553 case REQ_RANGE_PLAYER:
555 case REQ_RANGE_ALLIANCE:
556 case REQ_RANGE_WORLD:
557 case REQ_RANGE_COUNT:
569 if (target_tile ==
nullptr) {
575 switch (req->
range) {
576 case REQ_RANGE_LOCAL:
578 case REQ_RANGE_CADJACENT:
583 case REQ_RANGE_ADJACENT:
593 case REQ_RANGE_TRADEROUTE:
598 case REQ_RANGE_CONTINENT:
599 case REQ_RANGE_PLAYER:
600 case REQ_RANGE_ALLIANCE:
602 case REQ_RANGE_WORLD:
603 case REQ_RANGE_COUNT:
630 const struct player *pow_player,
const struct player *target_player,
631 const struct player *other_player,
const struct city *target_city,
632 const struct impr_type *target_building,
const struct tile *target_tile,
633 const struct unit *target_unit,
const struct output_type *target_output,
639 if (!
is_req_knowable(pow_player, target_player, other_player, target_city,
640 target_tile, target_unit, req, prob_type)) {
647 target_unittype =
nullptr;
651 target_building, target_tile, target_unit,
652 target_unittype, target_output, target_specialist,
653 nullptr, req, prob_type)) {
666 const struct player *pow_player,
const struct player *target_player,
667 const struct player *other_player,
const struct city *target_city,
668 const struct impr_type *target_building,
const struct tile *target_tile,
669 const struct unit *target_unit,
const struct output_type *target_output,
671 const struct requirement_vector *
reqs,
681 mke_eval_req(pow_player, target_player, other_player, target_city,
682 target_building, target_tile, target_unit,
683 target_output, target_specialist, preq, prob_type);
699 const struct player *target_player)
701 return pow_player == target_player
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.
int city_map_radius_sq_get(const struct city *pcity)
Returns the current squared radius of the city.
#define city_tile_iterate(_radius_sq, _city_tile, _tile)
#define city_tile_iterate_end
bool could_intel_with_player(const struct player *pplayer, const struct player *aplayer)
Returns TRUE iff pplayer can get intelligence about aplayer.
bool is_improvement_visible(const struct impr_type *pimprove)
Return TRUE if the improvement should be visible to others without spying.
#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)
Checks if a unit can be seen by pplayer at its current location.
bool player_can_see_city_externals(const struct player *pow_player, const struct city *target_city)
Returns TRUE iff pow_player can see externally visible features of target_city.
bool can_player_see_hypotetic_units_at(const struct player *pplayer, const struct tile *ptile)
Check if pplayer could see all units on ptile if it had units.
bool can_player_see_city_internals(const struct player *pplayer, const struct city *pcity)
Return TRUE iff the player can see the city's internals.
bool player_has_embassy(const struct player *pplayer, const struct player *pplayer2)
Check if pplayer has an embassy with pplayer2.
struct player_diplstate * player_diplstate_get(const struct player *plr1, const struct player *plr2)
Returns diplomatic state type between two players.
bool is_req_active(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, const struct requirement *req, const enum req_problem_type prob_type, const enum vision_layer vision_layer, const enum national_intelligence nintel)
Checks the requirement to see if it is active on the given target.
#define requirement_vector_iterate_end
#define requirement_vector_iterate(req_vec, preq)
bool tile_is_seen(const struct tile *target_tile, const struct player *pow_player)
Returns TRUE iff the target_tile is seen by pow_player.
struct city * tile_city(const struct tile *ptile)
Return the city on this tile (or nullptr), checking for city center.
#define trade_partners_iterate_end
#define trade_partners_iterate(c, p)
const struct impr_type * building
enum unit_activity activity
enum ustate_prop unit_state
const struct unit_type * unit_type_get(const struct unit *punit)
Return the unit type for this unit.