53 int base_move_rate, move_rate;
63 move_rate = base_move_rate;
67 move_rate = (move_rate * hitpoints) / utype->
hp;
79 if (move_rate < min_speed) {
80 move_rate = min_speed;
122 && pterrain->movement_cost > move_cost) {
125 move_cost = pterrain->movement_cost;
135 { .
kind = VUT_ACTION, .value.action = paction },
136 { .kind = VUT_UTYPE, .value.utype = utype },
148 if (max_effect_mc > worst_effect_mc) {
149 worst_effect_mc = max_effect_mc;
152 move_cost += worst_effect_mc;
179 if (ptrans == NULL) {
218 USP_NATIVE_TILE,
FALSE)
230 const struct tile *ptile,
231 const struct tile *pexclude)
233 struct dbv tile_processed;
234 struct tile_list *process_queue = tile_list_new();
243 }
else if (piter != pexclude
248 }
else if (piter != pexclude
250 tile_list_append(process_queue, piter);
256 if (found || 0 == tile_list_size(process_queue)) {
259 ptile = tile_list_front(process_queue);
260 tile_list_pop_front(process_queue);
265 tile_list_destroy(process_queue);
277 const struct tile *ptile)
306 const struct tile *ptile)
317 const struct tile *ptile)
328 const struct terrain *pterrain,
360 const struct tile *src_tile,
361 const struct tile *dst_tile)
416 case RMM_FAST_ALWAYS:
452 const struct tile *ptile)
478 const struct tile *ptile)
529 const struct tile *src_tile,
530 const struct tile *dst_tile,
559 const struct tile *dst_tile,
561 bool enter_transport,
562 bool enter_enemy_city)
567 enter_transport, NULL,
597 enum unit_activity activity,
598 const struct tile *src_tile,
599 const struct tile *dst_tile,
bool igzoc,
600 bool enter_transport,
struct unit *embark_to,
601 bool enter_enemy_city)
609 if (activity != ACTIVITY_IDLE
610 && activity != ACTIVITY_GOTO) {
640 if (embark_to != NULL) {
661 if (enter_enemy_city) {
734 enum unit_activity activity,
735 const struct tile *src_tile,
736 const struct tile *dst_tile,
737 bool enter_transport,
struct unit *embark_to,
738 bool enter_enemy_city)
758 if (embark_to != NULL) {
779 if (enter_enemy_city) {
814 const struct unit *transported)
907 const char *none,
bool align)
930 astr_add(&
str,
"%s%*s", none ? none :
"", pad2,
"");
#define action_by_result_iterate(_paction_, _result_)
#define action_by_result_iterate_end
void astr_clear(struct astring *astr)
void astr_add(struct astring *astr, const char *format,...)
static const char * astr_str(const struct astring *astr) fc__attribute((nonnull(1)))
void dbv_init(struct dbv *pdbv, int bits)
void dbv_set(struct dbv *pdbv, int bit)
bool dbv_isset(const struct dbv *pdbv, int bit)
void dbv_free(struct dbv *pdbv)
#define BV_ISSET(bv, bit)
#define BV_ISSET_ANY(vec)
#define city_owner(_pcity_)
struct unit struct city struct unit struct tile struct extra_type const struct act_prob *act_probs int actor_unit_id struct unit struct unit * punit
int effect_cumulative_max(enum effect_type type, struct universal *unis, size_t n_unis)
int get_unittype_bonus(const struct player *pplayer, const struct tile *ptile, const struct unit_type *punittype, const struct action *paction, enum effect_type effect_type)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
bool is_move_cardinal(const struct civ_map *nmap, const struct tile *start_tile, const struct tile *end_tile)
bool is_tiles_adjacent(const struct tile *tile0, const struct tile *tile1)
bool is_safe_ocean(const struct civ_map *nmap, const struct tile *ptile)
#define cardinal_between_iterate(nmap, tile1, tile2, between)
#define adjc_iterate(nmap, center_tile, itr_tile)
#define ALL_DIRECTIONS_CARDINAL()
#define cardinal_between_iterate_end
const char * move_points_text(int mp, bool reduce)
const char * move_points_text_full(int mp, bool reduce, const char *prefix, const char *none, bool align)
bool can_exist_at_tile(const struct civ_map *nmap, const struct unit_type *utype, const struct tile *ptile)
enum unit_move_result unit_move_to_tile_test(const struct civ_map *nmap, const struct unit *punit, enum unit_activity activity, const struct tile *src_tile, const struct tile *dst_tile, bool igzoc, bool enter_transport, struct unit *embark_to, bool enter_enemy_city)
bool can_unit_exist_at_tile(const struct civ_map *nmap, const struct unit *punit, const struct tile *ptile)
bool is_native_tile(const struct unit_type *punittype, const struct tile *ptile)
bool can_step_taken_wrt_to_zoc(const struct unit_type *punittype, const struct player *unit_owner, const struct tile *src_tile, const struct tile *dst_tile, const struct civ_map *zmap)
int utype_unknown_move_cost(const struct unit_type *utype)
bool unit_can_load(const struct unit *punit)
bool can_unit_transport(const struct unit *transporter, const struct unit *transported)
int unit_move_rate(const struct unit *punit)
bool unit_could_load_at(const struct unit *punit, const struct tile *ptile)
static int move_points_denomlen
bool can_attack_from_non_native(const struct unit_type *utype)
enum unit_move_result unit_teleport_to_tile_test(const struct civ_map *nmap, const struct unit *punit, enum unit_activity activity, const struct tile *src_tile, const struct tile *dst_tile, bool enter_transport, struct unit *embark_to, bool enter_enemy_city)
bool unit_can_defend_here(const struct civ_map *nmap, const struct unit *punit)
bool is_native_move(const struct civ_map *nmap, const struct unit_class *punitclass, const struct tile *src_tile, const struct tile *dst_tile)
bool is_native_to_class(const struct unit_class *punitclass, const struct terrain *pterrain, const bv_extras *extras)
int utype_move_rate(const struct unit_type *utype, const struct tile *ptile, const struct player *pplayer, int veteran_level, int hitpoints)
bool is_city_channel_tile(const struct civ_map *nmap, const struct unit_class *punitclass, const struct tile *ptile, const struct tile *pexclude)
bool can_unit_survive_at_tile(const struct civ_map *nmap, const struct unit *punit, const struct tile *ptile)
bool is_native_near_tile(const struct civ_map *nmap, const struct unit_class *uclass, const struct tile *ptile)
bool unit_can_move_to_tile(const struct civ_map *nmap, const struct unit *punit, const struct tile *dst_tile, bool igzoc, bool enter_transport, bool enter_enemy_city)
bool can_unit_type_transport(const struct unit_type *transporter, const struct unit_class *transported)
void init_move_fragments(void)
bool can_attack_non_native(const struct unit_type *utype)
static bool is_native_tile_to_class(const struct unit_class *punitclass, const struct tile *ptile)
@ MR_DESTINATION_OCCUPIED_BY_NON_ALLIED_UNIT
@ MR_NO_TRANSPORTER_CAPACITY
bool player_can_invade_tile(const struct player *pplayer, const struct tile *ptile)
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
bool pplayers_non_attack(const struct player *pplayer, const struct player *pplayer2)
bool road_has_flag(const struct road_type *proad, enum road_flag_id flag)
struct packet_game_info info
enum barbarian_type barbarian_type
struct player_ai ai_common
enum road_move_mode move_mode
struct extra_type_list * integrators
bv_unit_classes native_to
const struct unit_type * animal
struct unit_class::@85 cache
struct extra_type_list * native_tile_extras
enum unit_activity activity
struct unit * transporter
const struct unit_type * utype
int fc_snprintf(char *str, size_t n, const char *format,...)
#define terrain_type_iterate(_p)
#define terrain_type_iterate_end
#define terrain_has_flag(terr, flag)
bool tile_has_refuel_extra(const struct tile *ptile, const struct unit_class *uclass)
struct city * tile_city(const struct tile *ptile)
#define tile_terrain(_tile)
static const bv_extras * tile_extras(const struct tile *ptile)
#define tile_has_extra(ptile, pextra)
bool unit_type_really_ignores_zoc(const struct unit_type *punittype)
bool is_losing_hp(const struct unit *punit)
struct unit * unit_transport_get(const struct unit *pcargo)
bool could_unit_load(const struct unit *pcargo, const struct unit *ptrans)
bool unit_transported(const struct unit *pcargo)
bool can_unit_unload(const struct unit *pcargo, const struct unit *ptrans)
bool can_unit_alight_or_be_unloaded(const struct civ_map *nmap, const struct unit *pcargo, const struct unit *ptrans)
static bool is_non_attack_unit_tile(const struct tile *ptile, const struct player *pplayer)
static bool is_allied_unit_tile(const struct tile *ptile, const struct player *pplayer)
static bool is_non_allied_unit_tile(const struct tile *ptile, const struct player *pplayer)
static bool is_my_zoc(const struct player *unit_owner, const struct tile *ptile, const struct civ_map *zmap)
#define unit_list_iterate(unitlist, punit)
#define unit_list_iterate_end
const struct unit_type * unit_type_get(const struct unit *punit)
struct unit_class * unit_class_get(const struct unit *punit)
bool utype_can_do_action_result_when_ustate(const struct unit_type *putype, enum action_result result, const enum ustate_prop prop, const bool is_there)
bool utype_can_do_action_result(const struct unit_type *putype, enum action_result result)
const struct veteran_level * utype_veteran_level(const struct unit_type *punittype, int level)
bool utype_can_do_action(const struct unit_type *putype, const action_id act_id)
static bool uclass_has_flag(const struct unit_class *punitclass, enum unit_class_flag_id flag)
#define utype_fuel(ptype)
static bool utype_has_flag(const struct unit_type *punittype, int flag)
#define uclass_index(_c_)