Freeciv-3.1: unit_type Struct Reference

Freeciv-3.1

Loading...
Searching...
No Matches
Data Fields
unit_type Struct Reference

`#include <unittype.h>`

## Data Fields

Unit_type_id | item_number
struct name_translation | name
bool | ruledit_disabled
void * | ruledit_dlg
char | graphic_str [MAX_LEN_NAME]
char | graphic_alt [MAX_LEN_NAME]
char | sound_move [MAX_LEN_NAME]
char | sound_move_alt [MAX_LEN_NAME]
char | sound_fight [MAX_LEN_NAME]
char | sound_fight_alt [MAX_LEN_NAME]
int | build_cost
int | pop_cost
int | attack_strength
int | defense_strength
int | move_rate
int | unknown_move_cost
struct advance * | require_advance
struct requirement_vector | build_reqs
int | vision_radius_sq
int | transport_capacity
int | hp
int | firepower
struct combat_bonus_list * | bonuses
const struct unit_type * | obsoleted_by
const struct unit_type * | converted_to
int | convert_time
int | fuel
bv_unit_type_flags | flags
bv_unit_type_roles | roles
int | happy_cost
int | upkeep [O_LAST]
int | paratroopers_range
struct veteran_system * | veteran
int | bombard_rate
int | city_size
int | city_slots
enum transp_def_type | tp_defense
struct unit_class * | uclass
bv_unit_classes | cargo
bv_unit_classes | targets
bv_unit_classes | embarks
bv_unit_classes | disembarks
enum vision_layer | vlayer
struct strvec * | helptext
struct { |
bool igwall |
bool worker |
} | adv |
struct { |
int max_defense_mp_bonus_pct |
int defense_mp_bonuses_pct [U_LAST] |
int scramble_coeff [U_LAST] |
} | cache |
struct { |
int paratroopers_mr_req |
int paratroopers_mr_sub |
} | rscompat_cache |
void * | ais [FREECIV_AI_MOD_LAST]

## Detailed Description

Definition at line 481 of file unittype.h.

## Field Documentation

## ◆ [struct]

struct { ... } unit_type::adv

Referenced by adv_data_phase_init(), adv_units_ruleset_init(), can_unit_do_autosettlers(), dai_manage_unit(), dai_unit_attack_desirability(), dai_war_desire(), and handle_ruleset_unit().

## ◆ ais

void* unit_type::ais[FREECIV_AI_MOD_LAST]

Definition at line 575 of file unittype.h.

Referenced by utype_ai_data(), and utype_set_ai_data().

## ◆ attack_strength

int unit_type::attack_strength

Definition at line 495 of file unittype.h.

Referenced by action_actor_utype_hard_reqs_ok_full(), base_get_attack_power(), build_cost_balanced(), calculate_want_for_paratrooper(), cr_entry_attack(), create_present_supported_units_widget_list(), dai_barbarian_choose_build(), dai_set_defenders(), dai_unit_attack_desirability(), dai_unit_defense_desirability(), get_tooltip_unit(), handle_ruleset_unit(), help_update_unit_type(), popup_advanced_terrain_dialog(), popup_info_text(), popup_unit_info(), popup_worklist_editor(), redraw_unit_info_label(), edit_utype::refresh(), edit_utype::set_attack_value(), help_widget::set_topic_unit(), help_widget::uclass_max_values(), unit_select_dialog_popup(), and utype_values_string().

## ◆ bombard_rate

int unit_type::bombard_rate

Definition at line 528 of file unittype.h.

Referenced by action_actor_utype_hard_reqs_ok_full(), handle_ruleset_unit(), helptext_unit(), help_widget::uclass_max_values(), and unit_bombard_rate().

## ◆ bonuses

struct combat_bonus_list* unit_type::bonuses

Definition at line 507 of file unittype.h.

Referenced by dai_wants_defender_against(), defense_multiplication(), get_modified_firepower(), handle_ruleset_unit_bonus(), helptext_unit(), save_combat_bonuses(), set_unit_type_caches(), unit_type_free(), and unit_types_init().

## ◆ build_cost

int unit_type::build_cost

Definition at line 492 of file unittype.h.

Referenced by handle_ruleset_unit(), edit_utype::refresh(), edit_utype::set_bcost_value(), help_widget::uclass_max_values(), utype_build_shield_cost(), and utype_build_shield_cost_base().

## ◆ build_reqs

struct requirement_vector unit_type::build_reqs

Definition at line 501 of file unittype.h.

Referenced by can_city_build_unit_direct(), can_player_build_unit_direct(), handle_ruleset_unit(), helptext_unit(), unit_type_free(), unit_types_init(), utype_needs_improvement(), and worklist_item_postpone_req_vec().

## ◆ [struct]

struct { ... } unit_type::cache

Referenced by assess_danger(), dai_unit_defense_desirability(), defense_multiplication(), and set_unit_type_caches().

## ◆ cargo

bv_unit_classes unit_type::cargo

Definition at line 539 of file unittype.h.

Referenced by can_unit_type_transport(), handle_ruleset_unit(), and invasion_funct().

## ◆ city_size

int unit_type::city_size

Definition at line 531 of file unittype.h.

Referenced by city_build(), handle_ruleset_unit(), helptext_unit(), and help_widget::uclass_max_values().

## ◆ city_slots

int unit_type::city_slots

Definition at line 533 of file unittype.h.

Referenced by can_city_build_unit_direct(), city_unit_slots_available(), handle_ruleset_unit(), and is_action_possible().

## ◆ convert_time

int unit_type::convert_time

Definition at line 512 of file unittype.h.

Referenced by action_get_act_time(), handle_ruleset_unit(), helptext_unit(), and help_widget::uclass_max_values().

## ◆ converted_to

const struct unit_type* unit_type::converted_to

Definition at line 511 of file unittype.h.

Referenced by action_actor_utype_hard_reqs_ok_full(), handle_ruleset_unit(), helptext_unit(), unit_can_convert(), and unit_convert().

## ◆ defense_mp_bonuses_pct

int unit_type::defense_mp_bonuses_pct[U_LAST]

Definition at line 563 of file unittype.h.

Referenced by assess_danger(), defense_multiplication(), and set_unit_type_caches().

## ◆ defense_strength

int unit_type::defense_strength

Definition at line 496 of file unittype.h.

Referenced by base_get_defense_power(), build_cost_balanced(), calculate_want_for_paratrooper(), cr_entry_defense(), create_present_supported_units_widget_list(), dai_gothere_bodyguard(), dai_set_defenders(), dai_unit_attack_desirability(), dai_unit_defense_desirability(), get_tooltip_unit(), get_virtual_defense_power(), handle_ruleset_unit(), help_update_unit_type(), helptext_unit(), military_advisor_choose_build(), popup_advanced_terrain_dialog(), popup_info_text(), popup_unit_info(), popup_worklist_editor(), redraw_unit_info_label(), edit_utype::refresh(), edit_utype::set_defense_value(), help_widget::set_topic_unit(), help_widget::uclass_max_values(), unit_select_dialog_popup(), and utype_values_string().

## ◆ disembarks

bv_unit_classes unit_type::disembarks

Definition at line 548 of file unittype.h.

Referenced by handle_ruleset_unit(), helptext_unit(), and utype_can_freely_unload().

## ◆ embarks

bv_unit_classes unit_type::embarks

Definition at line 545 of file unittype.h.

Referenced by handle_ruleset_unit(), helptext_unit(), and utype_can_freely_load().

## ◆ firepower

int unit_type::firepower

Definition at line 506 of file unittype.h.

Referenced by adv_unit_def_rating_basic(), adv_unittype_att_rating(), base_assess_defense_unit(), dai_unit_attack_desirability(), dai_unit_defense_desirability(), get_modified_firepower(), get_tooltip_unit(), handle_ruleset_unit(), help_update_unit_type(), popup_advanced_terrain_dialog(), popup_info_text(), popup_unit_info(), edit_utype::refresh(), edit_utype::set_firepower(), help_widget::set_topic_unit(), help_widget::uclass_max_values(), unit_def_rating(), unit_select_dialog_popup(), and unittype_def_rating_squared().

## ◆ flags

bv_unit_type_flags unit_type::flags

Definition at line 515 of file unittype.h.

Referenced by edit_utype::closeEvent(), edit_utype::edit_utype(), handle_ruleset_unit(), tab_unit::initialize_new_utype(), utype_has_flag(), and utype_upkeep_cost().

## ◆ fuel

int unit_type::fuel

Definition at line 513 of file unittype.h.

Referenced by handle_ruleset_unit(), and help_widget::uclass_max_values().

## ◆ graphic_alt

char unit_type::graphic_alt[MAX_LEN_NAME]

Definition at line 487 of file unittype.h.

Referenced by edit_utype::gfx_tag_alt_given(), handle_ruleset_unit(), edit_utype::refresh(), and tileset_setup_unit_type().

## ◆ graphic_str

char unit_type::graphic_str[MAX_LEN_NAME]

Definition at line 486 of file unittype.h.

Referenced by edit_utype::gfx_tag_given(), handle_ruleset_unit(), edit_utype::refresh(), and tileset_setup_unit_type().

## ◆ happy_cost

int unit_type::happy_cost

Definition at line 518 of file unittype.h.

Referenced by handle_ruleset_unit(), helptext_unit_upkeep_str(), popup_unit_info(), help_widget::set_topic_unit(), help_widget::uclass_max_values(), and utype_happy_cost().

## ◆ helptext

struct strvec* unit_type::helptext

Definition at line 552 of file unittype.h.

Referenced by handle_ruleset_unit(), edit_utype::helptext(), helptext_unit(), production_help(), unit_type_free(), and unit_types_init().

## ◆ hp

int unit_type::hp

Definition at line 505 of file unittype.h.

Referenced by create_present_supported_units_widget_list(), dai_evaluate_tile_for_air_attack(), dai_find_strategic_airbase(), dai_gothere_bodyguard(), dai_manage_hitpoint_recovery(), dai_military_findjob(), dai_rampage_want(), dai_unit_attack_desirability(), dai_unit_defense_desirability(), do_heal_unit(), fill_unit_sprite_array(), find_nearest_airbase(), get_tooltip_unit(), handle_edit_unit(), handle_ruleset_unit(), help_update_unit_type(), unit_hud_selector::hp_filter(), hp_gain_coord(), is_action_possible(), is_losing_hp(), objbind_get_allowed_value_span(), pf_reverse_map_utype_pos(), pft_fill_utype_default_parameter(), popup_advanced_terrain_dialog(), popup_info_text(), popup_unit_info(), redraw_unit_info_label(), edit_utype::refresh(), request_unit_return(), edit_utype::set_hitpoints(), help_widget::set_topic_unit(), transform_unit(), help_widget::uclass_max_values(), unit_bombard_rate(), unit_bribe_cost(), unit_def_rating(), unit_gain_hitpoints(), unit_restore_hitpoints(), unit_select_dialog_popup(), unit_type_is_losing_hp(), unit_virtual_create(), unittype_def_rating_squared(), and utype_move_rate().

## ◆ igwall

bool unit_type::igwall

Definition at line 555 of file unittype.h.

Referenced by adv_data_phase_init(), adv_units_ruleset_init(), and dai_unit_attack_desirability().

## ◆ item_number

Unit_type_id unit_type::item_number

Definition at line 482 of file unittype.h.

Referenced by unit_types_init(), and utype_number().

## ◆ max_defense_mp_bonus_pct

int unit_type::max_defense_mp_bonus_pct

Definition at line 560 of file unittype.h.

Referenced by assess_danger(), dai_unit_defense_desirability(), and set_unit_type_caches().

## ◆ move_rate

int unit_type::move_rate

Definition at line 497 of file unittype.h.

Referenced by calculate_want_for_paratrooper(), units_select::create_pixmap(), create_present_supported_units_widget_list(), dai_choose_diplomat_offensive(), dai_choose_help_wonder(), dai_fill_unit_param(), dai_gothere_bodyguard(), dai_unit_attack_desirability(), dai_unit_defense_desirability(), fill_unit_sprite_array(), find_something_to_kill(), get_activity_rate(), get_tooltip_unit(), handle_ruleset_unit(), help_update_unit_type(), unit_hud_selector::hp_filter(), pft_fill_amphibious_parameter(), pft_fill_utype_default_parameter(), popup_advanced_terrain_dialog(), popup_unit_info(), popup_worklist_editor(), redraw_unit_info_label(), edit_utype::refresh(), edit_utype::set_move_rate(), help_widget::set_topic_unit(), single_invader(), help_widget::uclass_max_values(), unit_activity_astr(), unit_bribe_cost(), unit_select_dialog_popup(), hud_units::update_actions(), utype_move_rate(), and utype_values_string().

## ◆ name

struct name_translation unit_type::name

Definition at line 483 of file unittype.h.

Referenced by handle_ruleset_unit(), tab_unit::initialize_new_utype(), tab_unit::name_given(), tab_unit::update_utype_info(), utype_name_translation(), and utype_rule_name().

## ◆ obsoleted_by

const struct unit_type* unit_type::obsoleted_by

Definition at line 510 of file unittype.h.

Referenced by action_actor_utype_hard_reqs_ok_full(), can_city_build_unit_now(), can_player_build_unit_later(), can_player_build_unit_now(), can_upgrade_unittype(), city_gold_worth(), get_tooltip_unit(), handle_ruleset_unit(), help_update_unit_type(), helptext_unit(), popup_unit_info(), sanity_check_ruleset_data(), help_widget::set_topic_unit(), and unit_upgrades_to().

## ◆ paratroopers_mr_req

int unit_type::paratroopers_mr_req

Definition at line 571 of file unittype.h.

## ◆ paratroopers_mr_sub

int unit_type::paratroopers_mr_sub

Definition at line 572 of file unittype.h.

Referenced by paratroopers_mr_sub_to_effect().

## ◆ paratroopers_range

int unit_type::paratroopers_range

Definition at line 522 of file unittype.h.

Referenced by action_actor_utype_hard_reqs_ok_full(), assess_danger_unit(), calculate_want_for_paratrooper(), expl_act_not_enabl(), find_best_tile_to_paradrop_to(), handle_ruleset_unit(), helptext_unit(), and is_action_possible().

## ◆ pop_cost

int unit_type::pop_cost

Definition at line 493 of file unittype.h.

Referenced by action_actor_utype_hard_reqs_ok_full(), dai_spend_gold(), domestic_advisor_choose_build(), handle_ruleset_unit(), helptext_unit(), popup_unit_info(), help_widget::uclass_max_values(), unit_foodbox_cost(), unit_pop_value(), and utype_pop_value().

## ◆ require_advance

struct advance* unit_type::require_advance

Definition at line 500 of file unittype.h.

Referenced by can_player_build_unit_direct(), dai_choose_diplomat_defensive(), dai_wants_role_unit(), find_best_city_placement(), get_tooltip_unit(), handle_ruleset_unit(), help_update_unit_type(), helptext_building(), popup_unit_info(), edit_utype::refresh(), edit_utype::req_menu(), help_widget::set_topic_unit(), and worklist_change_build_target().

## ◆ roles

bv_unit_type_roles unit_type::roles

Definition at line 516 of file unittype.h.

Referenced by handle_ruleset_unit(), and utype_has_role().

## ◆ [struct]

struct { ... } unit_type::rscompat_cache

Referenced by paratroopers_mr_sub_to_effect().

## ◆ ruledit_disabled

bool unit_type::ruledit_disabled

Definition at line 484 of file unittype.h.

Referenced by tab_unit::add_now(), tab_unit::delete_now(), tab_unit::name_given(), and unit_types_init().

## ◆ ruledit_dlg

void* unit_type::ruledit_dlg

Definition at line 485 of file unittype.h.

Referenced by edit_utype::closeEvent(), tab_unit::delete_now(), tab_unit::edit_now(), and unit_types_init().

## ◆ scramble_coeff

int unit_type::scramble_coeff[U_LAST]

Definition at line 564 of file unittype.h.

Referenced by assess_danger(), defense_multiplication(), and set_unit_type_caches().

## ◆ sound_fight

char unit_type::sound_fight[MAX_LEN_NAME]

Definition at line 490 of file unittype.h.

Referenced by handle_ruleset_unit(), edit_utype::refresh(), and edit_utype::sound_fight_tag_given().

## ◆ sound_fight_alt

char unit_type::sound_fight_alt[MAX_LEN_NAME]

Definition at line 491 of file unittype.h.

Referenced by handle_ruleset_unit(), edit_utype::refresh(), and edit_utype::sound_fight_tag_alt_given().

## ◆ sound_move

char unit_type::sound_move[MAX_LEN_NAME]

Definition at line 488 of file unittype.h.

Referenced by handle_ruleset_unit(), edit_utype::refresh(), and edit_utype::sound_move_tag_given().

## ◆ sound_move_alt

char unit_type::sound_move_alt[MAX_LEN_NAME]

Definition at line 489 of file unittype.h.

Referenced by handle_ruleset_unit(), edit_utype::refresh(), and edit_utype::sound_move_tag_alt_given().

## ◆ targets

bv_unit_classes unit_type::targets

Definition at line 542 of file unittype.h.

Referenced by handle_ruleset_unit(), helptext_unit(), is_unit_reachable_by_unit(), and pf_attack_possible().

## ◆ tp_defense

enum transp_def_type unit_type::tp_defense

Definition at line 535 of file unittype.h.

Referenced by handle_ruleset_unit().

## ◆ transport_capacity

int unit_type::transport_capacity

Definition at line 504 of file unittype.h.

Referenced by action_actor_utype_hard_reqs_ok_full(), can_type_transport_units_cargo(), can_unit_type_transport(), get_transporter_capacity(), handle_ruleset_unit(), and helptext_unit().

## ◆ uclass

struct unit_class* unit_type::uclass

Definition at line 537 of file unittype.h.

Referenced by adv_data_phase_init(), edit_utype::class_menu(), handle_ruleset_unit(), edit_utype::refresh(), help_widget::set_topic_unit(), and help_widget::uclass_max_values().

## ◆ unknown_move_cost

int unit_type::unknown_move_cost

Definition at line 498 of file unittype.h.

Referenced by pf_danger_map_iterate(), pf_fuel_map_iterate(), pf_normal_map_iterate(), pf_pos_hash_cmp(), and pf_pos_hash_val().

## ◆ upkeep

int unit_type::upkeep[O_LAST]

Definition at line 519 of file unittype.h.

Referenced by city_improvement_upkeep(), handle_ruleset_unit(), helptext_unit_upkeep_str(), popup_unit_info(), help_widget::set_topic_unit(), help_widget::uclass_max_values(), and utype_upkeep_cost().

## ◆ veteran

struct veteran_system* unit_type::veteran

Definition at line 525 of file unittype.h.

Referenced by ap_dipl_battle_win(), handle_ruleset_unit(), helptext_unit(), redraw_unit_info_label(), unit_type_free(), unit_types_init(), and utype_veteran_system().

## ◆ vision_radius_sq

int unit_type::vision_radius_sq

Definition at line 503 of file unittype.h.

Referenced by do_paradrop(), explorer_desirable(), get_tooltip_unit(), handle_edit_unit_create(), handle_ruleset_unit(), help_update_unit_type(), popup_unit_info(), help_widget::uclass_max_values(), and unit_vision_range_modifiers().

## ◆ vlayer

enum vision_layer unit_type::vlayer

Definition at line 550 of file unittype.h.

Referenced by get_unit_vision_at(), handle_ruleset_unit(), helptext_unit(), is_hiding_unit(), unit_is_on_layer(), and unit_move().

## ◆ worker

bool unit_type::worker

Definition at line 556 of file unittype.h.

Referenced by auto_settlers_player(), can_unit_do_autosettlers(), dai_manage_unit(), and handle_ruleset_unit().