![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include "fcintl.h"#include "rand.h"#include "base.h"#include "game.h"#include "map.h"#include "research.h"#include "road.h"#include "extras.h"
Include dependency graph for extras.cpp:Go to the source code of this file.
Functions | |
| void | extras_init () |
| Initialize extras structures. More... | |
| void | extras_free () |
| Free the memory associated with extras. More... | |
| int | extra_count () |
| Return the number of extra_types. More... | |
| int | extra_number (const struct extra_type *pextra) |
| Return the extra id. More... | |
| struct extra_type * | extra_by_number (int id) |
| Return extras type of given id. More... | |
| const char * | extra_name_translation (const struct extra_type *pextra) |
| Return the (translated) name of the extra type. More... | |
| const char * | extra_rule_name (const struct extra_type *pextra) |
| Return the (untranslated) rule name of the extra type. More... | |
| struct extra_type * | extra_type_by_rule_name (const char *name) |
| Returns extra type matching rule name or nullptr if there is no extra type with such name. More... | |
| struct extra_type * | extra_type_by_translated_name (const char *name) |
| Returns extra type matching the translated name, or nullptr if there is no extra type with that name. More... | |
| struct extra_type_list * | extra_type_list_by_cause (enum extra_cause cause) |
| Returns extra type for given cause. More... | |
| struct extra_type_list * | extra_type_list_of_unit_hiders () |
| Returns extra types that hide units. More... | |
| struct extra_type * | rand_extra_for_tile (struct tile *ptile, enum extra_cause cause, bool generated) |
| Return random extra type for given cause that is native to the tile. More... | |
| void | extra_to_caused_by_list (struct extra_type *pextra, enum extra_cause cause) |
| Add extra type to list of extra caused by given cause. More... | |
| struct extra_type_list * | extra_type_list_by_rmcause (enum extra_rmcause rmcause) |
| Returns extra type for given rmcause. More... | |
| void | extra_to_removed_by_list (struct extra_type *pextra, enum extra_rmcause rmcause) |
| Add extra type to list of extra removed by given cause. More... | |
| bool | is_extra_removed_by (const struct extra_type *pextra, enum extra_rmcause rmcause) |
| Is given cause one of the removal causes for the given extra? More... | |
| bool | is_extra_card_near (const struct tile *ptile, const struct extra_type *pextra) |
| Is there extra of the given type cardinally near tile? (Does not check ptile itself.) More... | |
| bool | is_extra_near_tile (const struct tile *ptile, const struct extra_type *pextra) |
| Is there extra of the given type near tile? (Does not check ptile itself.) More... | |
| bool | extra_can_be_built (const struct extra_type *pextra, const struct tile *ptile) |
| Tells if extra can build to tile if all other requirements are met. More... | |
| bool | can_build_extra_base (const struct extra_type *pextra, const struct player *pplayer, const struct tile *ptile) |
| Tells if player can build extra to tile with suitable unit. More... | |
| bool | player_can_build_extra (const struct extra_type *pextra, const struct player *pplayer, const struct tile *ptile) |
| Tells if player can build extra to tile with suitable unit. More... | |
| bool | player_can_place_extra (const struct extra_type *pextra, const struct player *pplayer, const struct tile *ptile) |
| Tells if player can place extra on tile. More... | |
| bool | can_build_extra (const struct extra_type *pextra, const struct unit *punit, const struct tile *ptile) |
| Tells if unit can build extra on tile. More... | |
| static bool | can_extra_be_removed (const struct extra_type *pextra, const struct tile *ptile) |
| Is it possible at all to remove this extra now. More... | |
| bool | player_can_remove_extra (const struct extra_type *pextra, const struct player *pplayer, const struct tile *ptile) |
| Tells if player can remove extra from tile with suitable unit. More... | |
| bool | can_remove_extra (const struct extra_type *pextra, const struct unit *punit, const struct tile *ptile) |
| Tells if unit can remove extra from tile. More... | |
| bool | is_native_tile_to_extra (const struct extra_type *pextra, const struct tile *ptile) |
| Is tile native to extra? More... | |
| bool | extra_conflicting_on_tile (const struct extra_type *pextra, const struct tile *ptile) |
| Returns TRUE iff an extra that conflicts with pextra exists at ptile. More... | |
| bool | hut_on_tile (const struct tile *ptile) |
| Returns TRUE iff an extra on the tile is a hut (removed by entering). More... | |
| bool | unit_can_enter_hut (const struct unit *punit, const struct tile *ptile) |
| Returns TRUE iff the unit can enter any hut on the tile. More... | |
| bool | unit_can_displace_hut (const struct unit *punit, const struct tile *ptile) |
| Returns TRUE iff the unit can enter or frighten any hut on the tile. More... | |
| struct extra_type * | next_extra_for_tile (const struct tile *ptile, enum extra_cause cause, const struct player *pplayer, const struct unit *punit) |
| Returns next extra by cause that unit or player can build to tile. More... | |
| struct extra_type * | prev_extra_in_tile (const struct tile *ptile, enum extra_rmcause rmcause, const struct player *pplayer, const struct unit *punit) |
| Returns prev extra by cause that unit or player can remove from tile. More... | |
| bool | is_native_extra_to_uclass (const struct extra_type *pextra, const struct unit_class *pclass) |
| Is extra native to unit class? More... | |
| bool | is_native_extra_to_utype (const struct extra_type *pextra, const struct unit_type *punittype) |
| Is extra native to unit type? More... | |
| bool | extra_has_flag (const struct extra_type *pextra, enum extra_flag_id flag) |
| Check if extra has given flag. More... | |
| bool | is_extra_flag_card_near (const struct tile *ptile, enum extra_flag_id flag) |
| Returns TRUE iff any cardinally adjacent tile contains an extra with the given flag (does not check ptile itself). More... | |
| bool | is_extra_flag_near_tile (const struct tile *ptile, enum extra_flag_id flag) |
| Returns TRUE iff any adjacent tile contains an extra with the given flag (does not check ptile itself). More... | |
| void | user_extra_flags_init () |
| Initialize user extra flags. More... | |
| void | extra_flags_free () |
| Frees the memory associated with all extra flags. More... | |
| void | set_user_extra_flag_name (enum extra_flag_id id, const char *name, const char *helptxt) |
| Sets user defined name for extra flag. More... | |
| const char * | extra_flag_id_name_cb (enum extra_flag_id flag) |
| Extra flag name callback, called from specenum code. More... | |
| const char * | extra_flag_helptxt (enum extra_flag_id id) |
| Return the (untranslated) help text of the user extra flag. More... | |
| bool | can_extras_coexist (const struct extra_type *pextra1, const struct extra_type *pextra2) |
| Can two extras coexist in same tile? More... | |
| bool | extra_causes_env_upset (struct extra_type *pextra, enum environment_upset_type upset) |
| Does the extra count toward environment upset? More... | |
| bool | is_extra_caused_by_worker_action (const struct extra_type *pextra) |
| Is the extra caused by some kind of worker action? More... | |
| bool | is_extra_removed_by_worker_action (const struct extra_type *pextra) |
| Is the extra removed by some kind of worker action? More... | |
| bool | is_extra_caused_by_action (const struct extra_type *pextra, const struct action *paction) |
| Is the extra caused by specific worker action? More... | |
| bool | is_extra_removed_by_action (const struct extra_type *pextra, const struct action *paction) |
| Is the extra removed by specific worker action? More... | |
| enum extra_cause | activity_to_extra_cause (enum unit_activity act) |
| What extra cause activity is considered to be? More... | |
| enum extra_rmcause | activity_to_extra_rmcause (enum unit_activity act) |
| What extra rmcause activity is considered to be? More... | |
| struct player * | extra_owner (const struct tile *ptile) |
| Who owns extras on tile. More... | |
| bool | can_extra_appear (const struct extra_type *pextra, const struct tile *ptile) |
| Are all the requirements for extra to appear on tile fulfilled. More... | |
| bool | can_extra_disappear (const struct extra_type *pextra, const struct tile *ptile) |
| Are all the requirements for extra to disappear from tile fulfilled. More... | |
| bool | player_knows_extra_exist (const struct player *pplayer, const struct extra_type *pextra, const struct tile *ptile) |
| Extra is not hidden from the user. More... | |
Variables | |
| static struct extra_type | extras [MAX_EXTRA_TYPES] |
| static struct user_flag | user_extra_flags [MAX_NUM_USER_EXTRA_FLAGS] |
| static struct extra_type_list * | caused_by [EC_LAST] |
| static struct extra_type_list * | removed_by [ERM_COUNT] |
| static struct extra_type_list * | unit_hidden |
| enum extra_cause activity_to_extra_cause | ( | enum unit_activity | act | ) |
What extra cause activity is considered to be?
Definition at line 963 of file extras.cpp.
Referenced by help_widget::add_extras_of_act_for_terrain(), is_extra_caused_by_action(), settler_evaluate_improvements(), tai_city_worker_task_select(), tai_tile_worker_task_select(), texai_city_worker_task_select(), and texai_tile_worker_task_select().
| enum extra_rmcause activity_to_extra_rmcause | ( | enum unit_activity | act | ) |
What extra rmcause activity is considered to be?
Definition at line 963 of file extras.cpp.
Referenced by activity_to_extra_cause(), settler_evaluate_improvements(), tai_city_worker_task_select(), tai_tile_worker_task_select(), texai_city_worker_task_select(), and texai_tile_worker_task_select().
| bool can_build_extra | ( | const struct extra_type * | pextra, |
| const struct unit * | punit, | ||
| const struct tile * | ptile | ||
| ) |
Tells if unit can build extra on tile.
Definition at line 475 of file extras.cpp.
Referenced by can_unit_do_connect(), and next_extra_for_tile().
| bool can_build_extra_base | ( | const struct extra_type * | pextra, |
| const struct player * | pplayer, | ||
| const struct tile * | ptile | ||
| ) |
Tells if player can build extra to tile with suitable unit.
Definition at line 371 of file extras.cpp.
Referenced by can_build_base(), can_build_extra(), can_build_road(), player_can_build_extra(), and player_can_build_road().
| bool can_extra_appear | ( | const struct extra_type * | pextra, |
| const struct tile * | ptile | ||
| ) |
Are all the requirements for extra to appear on tile fulfilled.
Definition at line 1021 of file extras.cpp.
Referenced by end_turn().
|
static |
Is it possible at all to remove this extra now.
Definition at line 492 of file extras.cpp.
Referenced by can_extra_disappear(), can_remove_extra(), and player_can_remove_extra().
| bool can_extra_disappear | ( | const struct extra_type * | pextra, |
| const struct tile * | ptile | ||
| ) |
Are all the requirements for extra to disappear from tile fulfilled.
Definition at line 1036 of file extras.cpp.
Referenced by end_turn().
| bool can_extras_coexist | ( | const struct extra_type * | pextra1, |
| const struct extra_type * | pextra2 | ||
| ) |
Can two extras coexist in same tile?
Definition at line 902 of file extras.cpp.
Referenced by adv_calc_extra(), can_unit_do_activity_targeted_at(), create_extra(), extra_conflicting_on_tile(), save_terrain_ruleset(), and tile_extra_apply().
| bool can_remove_extra | ( | const struct extra_type * | pextra, |
| const struct unit * | punit, | ||
| const struct tile * | ptile | ||
| ) |
Tells if unit can remove extra from tile.
Does not examine action requirements if an action is required for it.
Definition at line 543 of file extras.cpp.
Referenced by prev_extra_in_tile().
| struct extra_type* extra_by_number | ( | int | id | ) |
Return extras type of given id.
Definition at line 154 of file extras.cpp.
Referenced by tab_extras::add_now(), base(), editor_tool_get_value_name(), execute_orders(), handle_edit_tile_extra(), handle_ruleset_extra(), handle_ruleset_resource(), handle_ruleset_terrain(), handle_tile_info(), handle_unit_actions(), handle_unit_change_activity(), handle_unit_get_actions(), handle_worker_task(), irrigate(), load_terrain_names(), mine(), pillage_something(), road(), sg_extras_get(), sg_load_map_owner(), unit_order_list_is_sane(), unit_perform_action(), universal_value_initial(), unpackage_short_unit(), unpackage_unit(), and choice_dialog::update_dialog().
| bool extra_can_be_built | ( | const struct extra_type * | pextra, |
| const struct tile * | ptile | ||
| ) |
Tells if extra can build to tile if all other requirements are met.
Definition at line 352 of file extras.cpp.
Referenced by can_build_extra_base().
| bool extra_causes_env_upset | ( | struct extra_type * | pextra, |
| enum environment_upset_type | upset | ||
| ) |
Does the extra count toward environment upset?
Definition at line 915 of file extras.cpp.
Referenced by update_environmental_upset().
| bool extra_conflicting_on_tile | ( | const struct extra_type * | pextra, |
| const struct tile * | ptile | ||
| ) |
Returns TRUE iff an extra that conflicts with pextra exists at ptile.
Definition at line 607 of file extras.cpp.
Referenced by can_extra_appear().
| int extra_count | ( | ) |
Return the number of extra_types.
Definition at line 127 of file extras.cpp.
Referenced by fill_tile_edit_packet().
| const char* extra_flag_helptxt | ( | enum extra_flag_id | id | ) |
Return the (untranslated) help text of the user extra flag.
Definition at line 892 of file extras.cpp.
Referenced by helptext_extra(), save_terrain_ruleset(), and send_ruleset_extras().
| const char* extra_flag_id_name_cb | ( | enum extra_flag_id | flag | ) |
Extra flag name callback, called from specenum code.
Definition at line 880 of file extras.cpp.
Referenced by save_terrain_ruleset().
| void extra_flags_free | ( | ) |
Frees the memory associated with all extra flags.
Definition at line 847 of file extras.cpp.
Referenced by game_ruleset_free().
| bool extra_has_flag | ( | const struct extra_type * | pextra, |
| enum extra_flag_id | flag | ||
| ) |
Check if extra has given flag.
Definition at line 779 of file extras.cpp.
Referenced by can_extra_be_removed(), extra_causes_env_upset(), freeciv::layer_base_flags::fill_sprite_array(), handle_ruleset_extra(), helptext_extra(), is_extra_flag_card_near(), is_extra_flag_near_tile(), load_ruleset_terrain(), sanity_check_ruleset_data(), save_terrain_ruleset(), set_unit_class_caches(), settler_evaluate_improvements(), tile_change_terrain(), tile_has_extra_flag(), tile_has_refuel_extra(), and upgrade_city_extras().
| const char* extra_name_translation | ( | const struct extra_type * | pextra | ) |
Return the (translated) name of the extra type.
You don't have to free the return pointer.
Definition at line 165 of file extras.cpp.
Referenced by help_widget::add_extras_of_act_for_terrain(), boot_help_texts(), concat_tile_activity_text(), go_act_menu::create(), editor_tool_get_value_name(), end_turn(), extra_type_by_translated_name(), get_infrastructure_text(), helptext_extra(), helptext_unit(), insert_generated_text(), manual_command(), mr_menu::menus_sensitive(), popup_info_text(), popup_pillage_dialog(), req_text_insert(), sanity_check_ruleset_data(), help_widget::set_topic_terrain(), tile_get_info_text(), tile_info_pollution(), transfer_city(), unit_activity_astr(), universal_name_translation(), mr_menu::update_bases_menu(), mr_menu::update_roads_menu(), upgrade_all_city_extras(), and worklist_item_postpone_req_vec().
| int extra_number | ( | const struct extra_type * | pextra | ) |
Return the extra id.
Definition at line 132 of file extras.cpp.
Referenced by action_auto_perf_unit_do(), action_sub_target_id_for_action(), go_act_menu::create(), fill_tile_edit_packet(), handle_edit_tile(), package_and_send_worker_tasks(), popup_action_selection(), send_ruleset_extras(), send_ruleset_terrain(), send_tile_info(), sg_load_player_unit(), sg_load_player_vision(), sg_save_map_owner(), tile_virtual_new(), universal_number(), and update_player_tile_knowledge().
Who owns extras on tile.
Definition at line 1013 of file extras.cpp.
Referenced by create_extra(), destroy_extra(), do_nuke_tile(), enter_war(), freeciv::layer_base_flags::fill_sprite_array(), handle_tile_info(), is_border_source(), kill_player(), map_change_seen(), remove_player_from_maps(), send_tile_info(), sg_load_player_units(), sg_save_map_owner(), tile_claim_bases(), unit_move(), and update_player_tile_knowledge().
| const char* extra_rule_name | ( | const struct extra_type * | pextra | ) |
Return the (untranslated) rule name of the extra type.
You don't have to free the return pointer.
Definition at line 174 of file extras.cpp.
Referenced by auto_settler_setup_work(), autoadjust_ruleset_data(), tab_extras::delete_now(), tab_extras::edit_effects(), tab_extras::edit_reqs(), extra_type_by_rule_name(), is_tech_needed(), is_universal_needed(), load_ruleset_terrain(), tab_extras::name_given(), tab_extras::refresh(), sanity_check_ruleset_data(), save_terrain_ruleset(), sg_load_players(), sg_save_player_cities(), sg_save_savefile(), tileset_setup_extra(), unit_enter_hut(), unit_order_list_is_sane(), universal_kind_values(), universal_rule_name(), and tab_extras::update_extra_info().
| void extra_to_caused_by_list | ( | struct extra_type * | pextra, |
| enum extra_cause | cause | ||
| ) |
Add extra type to list of extra caused by given cause.
Definition at line 274 of file extras.cpp.
Referenced by handle_ruleset_extra(), and load_ruleset_terrain().
| void extra_to_removed_by_list | ( | struct extra_type * | pextra, |
| enum extra_rmcause | rmcause | ||
| ) |
Add extra type to list of extra removed by given cause.
Definition at line 296 of file extras.cpp.
Referenced by handle_ruleset_extra(), load_ruleset_terrain(), and rscompat_extra_adjust_3_1().
| struct extra_type* extra_type_by_rule_name | ( | const char * | name | ) |
Returns extra type matching rule name or nullptr if there is no extra type with such name.
Definition at line 183 of file extras.cpp.
Referenced by api_edit_create_owned_extra(), api_edit_remove_extra(), api_methods_tile_has_base(), api_methods_tile_has_extra(), api_methods_tile_has_road(), tab_extras::initialize_new_extra(), load_ruleset_terrain(), load_terrain_names(), lookup_resource(), tab_extras::select_extra(), sg_load_player_cities(), sg_load_savefile(), sg_special_set(), and universal_by_number().
| struct extra_type* extra_type_by_translated_name | ( | const char * | name | ) |
Returns extra type matching the translated name, or nullptr if there is no extra type with that name.
Definition at line 208 of file extras.cpp.
Referenced by help_dialog::make_tree(), and help_widget::set_topic_extra().
| struct extra_type_list* extra_type_list_by_cause | ( | enum extra_cause | cause | ) |
Returns extra type for given cause.
Definition at line 224 of file extras.cpp.
Referenced by base_by_number(), handle_ruleset_extra(), load_ruleset_terrain(), mr_menu::menus_sensitive(), rand_extra_for_tile(), road_by_number(), mr_menu::slot_conn_irrigation(), and special_extra_get().
| struct extra_type_list* extra_type_list_by_rmcause | ( | enum extra_rmcause | rmcause | ) |
Returns extra type for given rmcause.
Definition at line 286 of file extras.cpp.
| struct extra_type_list* extra_type_list_of_unit_hiders | ( | ) |
Returns extra types that hide units.
Definition at line 234 of file extras.cpp.
Referenced by can_player_see_unit_at(), handle_ruleset_extra(), load_ruleset_terrain(), and player_can_trust_tile_has_no_units().
| void extras_free | ( | ) |
Free the memory associated with extras.
Definition at line 71 of file extras.cpp.
Referenced by game_ruleset_free().
| void extras_init | ( | ) |
Initialize extras structures.
Definition at line 36 of file extras.cpp.
Referenced by game_ruleset_init().
| bool hut_on_tile | ( | const struct tile * | ptile | ) |
Returns TRUE iff an extra on the tile is a hut (removed by entering).
The effect of entering is handled by unit_enter_hut() in unittools.c
Definition at line 626 of file extras.cpp.
Referenced by adv_data_phase_init(), dai_unit_move(), explorer_desirable(), and is_valid_start_pos().
| bool is_extra_card_near | ( | const struct tile * | ptile, |
| const struct extra_type * | pextra | ||
| ) |
Is there extra of the given type cardinally near tile? (Does not check ptile itself.)
Definition at line 317 of file extras.cpp.
| bool is_extra_caused_by_action | ( | const struct extra_type * | pextra, |
| const struct action * | paction | ||
| ) |
Is the extra caused by specific worker action?
Definition at line 953 of file extras.cpp.
Referenced by settler_evaluate_improvements(), tai_tile_worker_task_select(), and texai_tile_worker_task_select().
| bool is_extra_caused_by_worker_action | ( | const struct extra_type * | pextra | ) |
Is the extra caused by some kind of worker action?
Definition at line 931 of file extras.cpp.
Referenced by helptext_extra(), initialize_infrastructure_cache(), and load_ruleset_terrain().
| bool is_extra_flag_card_near | ( | const struct tile * | ptile, |
| enum extra_flag_id | flag | ||
| ) |
Returns TRUE iff any cardinally adjacent tile contains an extra with the given flag (does not check ptile itself).
Definition at line 788 of file extras.cpp.
| bool is_extra_flag_near_tile | ( | const struct tile * | ptile, |
| enum extra_flag_id | flag | ||
| ) |
Returns TRUE iff any adjacent tile contains an extra with the given flag (does not check ptile itself).
Definition at line 812 of file extras.cpp.
| bool is_extra_near_tile | ( | const struct tile * | ptile, |
| const struct extra_type * | pextra | ||
| ) |
Is there extra of the given type near tile? (Does not check ptile itself.)
Definition at line 335 of file extras.cpp.
| bool is_extra_removed_by | ( | const struct extra_type * | pextra, |
| enum extra_rmcause | rmcause | ||
| ) |
Is given cause one of the removal causes for the given extra?
Definition at line 307 of file extras.cpp.
Referenced by action_removes_extra(), activity_to_extra_cause(), can_extra_disappear(), get_preferred_pillage(), get_tile_infrastructure_set(), handle_ruleset_extra(), helptext_extra(), is_extra_drawing_enabled(), save_terrain_ruleset(), and send_ruleset_extras().
| bool is_extra_removed_by_action | ( | const struct extra_type * | pextra, |
| const struct action * | paction | ||
| ) |
Is the extra removed by specific worker action?
Definition at line 963 of file extras.cpp.
Referenced by settler_evaluate_improvements(), tai_tile_worker_task_select(), and texai_tile_worker_task_select().
| bool is_extra_removed_by_worker_action | ( | const struct extra_type * | pextra | ) |
Is the extra removed by some kind of worker action?
Definition at line 942 of file extras.cpp.
Referenced by initialize_infrastructure_cache().
| bool is_native_extra_to_uclass | ( | const struct extra_type * | pextra, |
| const struct unit_class * | pclass | ||
| ) |
Is extra native to unit class?
Definition at line 761 of file extras.cpp.
Referenced by helptext_extra(), is_native_extra_to_utype(), set_unit_class_caches(), tile_extras_class_defense_bonus(), tile_has_claimable_base(), and tile_move_cost_ptrs().
| bool is_native_extra_to_utype | ( | const struct extra_type * | pextra, |
| const struct unit_type * | punittype | ||
| ) |
Is extra native to unit type?
Definition at line 770 of file extras.cpp.
Referenced by base_has_flag_for_utype(), can_player_see_unit_at(), create_extra(), destroy_extra(), tile_has_native_base(), and tile_has_refuel_extra().
| bool is_native_tile_to_extra | ( | const struct extra_type * | pextra, |
| const struct tile * | ptile | ||
| ) |
Is tile native to extra?
Definition at line 559 of file extras.cpp.
Referenced by add_recursive_extras(), can_extra_appear(), create_city(), rand_extra_for_tile(), remove_city(), and tile_change_terrain().
| struct extra_type* next_extra_for_tile | ( | const struct tile * | ptile, |
| enum extra_cause | cause, | ||
| const struct player * | pplayer, | ||
| const struct unit * | punit | ||
| ) |
Returns next extra by cause that unit or player can build to tile.
Definition at line 687 of file extras.cpp.
Referenced by can_unit_do_activity(), get_tile_value(), key_unit_extra(), next_extra(), settler_evaluate_improvements(), sg_load_player_unit(), mr_menu::slot_build_road(), tai_city_worker_task_select(), tai_tile_worker_task_select(), texai_city_worker_task_select(), and texai_tile_worker_task_select().
| bool player_can_build_extra | ( | const struct extra_type * | pextra, |
| const struct player * | pplayer, | ||
| const struct tile * | ptile | ||
| ) |
Tells if player can build extra to tile with suitable unit.
Definition at line 414 of file extras.cpp.
Referenced by adv_calc_extra(), can_extra_be_removed(), impr_provides_buildable_extras(), next_extra_for_tile(), player_can_place_extra(), and upgrade_city_extras().
| bool player_can_place_extra | ( | const struct extra_type * | pextra, |
| const struct player * | pplayer, | ||
| const struct tile * | ptile | ||
| ) |
Tells if player can place extra on tile.
Definition at line 430 of file extras.cpp.
| bool player_can_remove_extra | ( | const struct extra_type * | pextra, |
| const struct player * | pplayer, | ||
| const struct tile * | ptile | ||
| ) |
Tells if player can remove extra from tile with suitable unit.
Definition at line 525 of file extras.cpp.
Referenced by adv_calc_rmextra(), do_nuke_tile(), and prev_extra_in_tile().
| bool player_knows_extra_exist | ( | const struct player * | pplayer, |
| const struct extra_type * | pextra, | ||
| const struct tile * | ptile | ||
| ) |
Extra is not hidden from the user.
Definition at line 1051 of file extras.cpp.
Referenced by update_player_tile_knowledge().
| struct extra_type* prev_extra_in_tile | ( | const struct tile * | ptile, |
| enum extra_rmcause | rmcause, | ||
| const struct player * | pplayer, | ||
| const struct unit * | punit | ||
| ) |
Returns prev extra by cause that unit or player can remove from tile.
Definition at line 732 of file extras.cpp.
Referenced by key_unit_clean(), settler_evaluate_improvements(), sg_load_player_unit(), mr_menu::slot_clean_pollution(), tai_city_worker_task_select(), tai_tile_worker_task_select(), texai_city_worker_task_select(), texai_tile_worker_task_select(), and unit_activity_complete().
| struct extra_type* rand_extra_for_tile | ( | struct tile * | ptile, |
| enum extra_cause | cause, | ||
| bool | generated | ||
| ) |
Return random extra type for given cause that is native to the tile.
Definition at line 242 of file extras.cpp.
Referenced by do_nuke_tile(), fair_map_make_huts(), make_huts(), and place_pollution().
| void set_user_extra_flag_name | ( | enum extra_flag_id | id, |
| const char * | name, | ||
| const char * | helptxt | ||
| ) |
Sets user defined name for extra flag.
Definition at line 859 of file extras.cpp.
Referenced by handle_ruleset_extra_flag(), and load_terrain_names().
Returns TRUE iff the unit can enter or frighten any hut on the tile.
For the unit, tests only its class and its owner.
Definition at line 665 of file extras.cpp.
Referenced by explorer_desirable().
Returns TRUE iff the unit can enter any hut on the tile.
For the unit, tests only its class and its owner.
Definition at line 643 of file extras.cpp.
Referenced by dai_rampage_want().
| void user_extra_flags_init | ( | ) |
Initialize user extra flags.
Definition at line 835 of file extras.cpp.
Referenced by game_ruleset_init().
|
static |
Definition at line 29 of file extras.cpp.
Referenced by extra_to_caused_by_list(), extra_type_list_by_cause(), extras_free(), and extras_init().
|
static |
Definition at line 1 of file extras.cpp.
Referenced by extra_by_number(), extras_free(), and extras_init().
|
static |
Definition at line 30 of file extras.cpp.
Referenced by extra_to_removed_by_list(), extra_type_list_by_rmcause(), extras_free(), and extras_init().
|
static |
Definition at line 31 of file extras.cpp.
Referenced by extra_type_list_of_unit_hiders(), extras_free(), and extras_init().
|
static |
Definition at line 1 of file extras.cpp.
Referenced by extra_flag_helptxt(), extra_flag_id_name_cb(), extra_flags_free(), set_user_extra_flag_name(), and user_extra_flags_init().