Freeciv-3.3
|
#include "deprecations.h"
#include "achievements.h"
#include "actions.h"
#include "calendar.h"
#include "citizens.h"
#include "culture.h"
#include "featured_text.h"
#include "game.h"
#include "government.h"
#include "improvement.h"
#include "map.h"
#include "movement.h"
#include "nation.h"
#include "research.h"
#include "tech.h"
#include "terrain.h"
#include "tile.h"
#include "unitlist.h"
#include "unittype.h"
#include "luascript.h"
#include "api_game_methods.h"
Go to the source code of this file.
Return TRUE iff pplayer can research ptech now (but does not know it). In client, considers known information only.
Definition at line 590 of file api_game_methods.c.
Referenced by tolua_game_Player_can_research00().
const char * api_methods_achievement_name_translation | ( | lua_State * | L, |
Achievement * | pach | ||
) |
Return translated name for Achievement
Definition at line 1056 of file api_game_methods.c.
Referenced by tolua_game_Achievement_name_translation00().
const char * api_methods_achievement_rule_name | ( | lua_State * | L, |
Achievement * | pach | ||
) |
Return rule name for Achievement
Definition at line 1044 of file api_game_methods.c.
Referenced by tolua_game_Achievement_rule_name00().
Return translated name for Action
Definition at line 1079 of file api_game_methods.c.
Referenced by tolua_game_Action_name_translation00().
Return rule name for Action
Definition at line 1068 of file api_game_methods.c.
Referenced by tolua_game_Action_rule_name00().
Return target kind for Action
Definition at line 1090 of file api_game_methods.c.
Referenced by tolua_game_Action_target_kind00().
bool api_methods_building_type_is_great_wonder | ( | lua_State * | L, |
Building_Type * | pbuilding | ||
) |
Return TRUE if pbuilding is a great wonder.
Definition at line 151 of file api_game_methods.c.
Referenced by tolua_game_Building_Type_is_great_wonder00().
bool api_methods_building_type_is_improvement | ( | lua_State * | L, |
Building_Type * | pbuilding | ||
) |
Return TRUE if pbuilding is a building.
Definition at line 175 of file api_game_methods.c.
Referenced by tolua_game_Building_Type_is_improvement00().
bool api_methods_building_type_is_small_wonder | ( | lua_State * | L, |
Building_Type * | pbuilding | ||
) |
Return TRUE if pbuilding is a small wonder.
Definition at line 163 of file api_game_methods.c.
Referenced by tolua_game_Building_Type_is_small_wonder00().
bool api_methods_building_type_is_wonder | ( | lua_State * | L, |
Building_Type * | pbuilding | ||
) |
Return TRUE if pbuilding is a wonder.
Definition at line 139 of file api_game_methods.c.
Referenced by tolua_game_Building_Type_is_wonder00().
const char * api_methods_building_type_name_translation | ( | lua_State * | L, |
Building_Type * | pbuilding | ||
) |
Return translated name for Building_Type
Definition at line 200 of file api_game_methods.c.
Referenced by tolua_game_Building_Type_name_translation00().
const char * api_methods_building_type_rule_name | ( | lua_State * | L, |
Building_Type * | pbuilding | ||
) |
Return rule name for Building_Type
Definition at line 187 of file api_game_methods.c.
Referenced by tolua_game_Building_Type_rule_name00().
How much culture city has?
Definition at line 301 of file api_game_methods.c.
Referenced by tolua_game_City_culture00().
bool api_methods_city_has_building | ( | lua_State * | L, |
City * | pcity, | ||
Building_Type * | building | ||
) |
Return TRUE iff city has building
Definition at line 212 of file api_game_methods.c.
Referenced by tolua_game_City_has_building00().
How much city inspires partisans for a player.
Definition at line 258 of file api_game_methods.c.
Referenced by tolua_game_City_inspire_partisans00().
Return featured text link of the city.
Definition at line 1670 of file api_game_methods.c.
Referenced by tolua_game_City_link_text00().
City * api_methods_city_list_link_data | ( | lua_State * | L, |
City_List_Link * | cl_link | ||
) |
Return City for list link
Definition at line 1604 of file api_game_methods.c.
Referenced by tolua_game_City_List_Link_data00().
City_List_Link * api_methods_city_list_next_link | ( | lua_State * | L, |
City_List_Link * | cl_link | ||
) |
Return next list link or NULL when link is the last link
Definition at line 1615 of file api_game_methods.c.
Referenced by tolua_game_City_List_Link_next00().
Return the square raduis of the city map.
Definition at line 225 of file api_game_methods.c.
Referenced by tolua_game_City_map_sq_radius00().
Return number of citizens of the given nationality in a city
Definition at line 410 of file api_game_methods.c.
Referenced by tolua_game_City_nationality_citizens00().
Return the size of the city.
Definition at line 236 of file api_game_methods.c.
Referenced by tolua_game_City_properties_size00().
Return the tile of the city.
Definition at line 247 of file api_game_methods.c.
Referenced by tolua_game_City_properties_tile00().
Return featured text link of the city tile.
Definition at line 1648 of file api_game_methods.c.
Referenced by tolua_game_City_tile_link_text00().
Obtain city's counter value
Definition at line 332 of file api_game_methods.c.
Referenced by tolua_game_Counter_get00().
Returns translation name of the counter.
Definition at line 322 of file api_game_methods.c.
Referenced by tolua_game_Counter_name_translation00().
Returns rule name of the counter.
Definition at line 312 of file api_game_methods.c.
Referenced by tolua_game_Counter_rule_name00().
Return translated name for Disaster
Definition at line 1032 of file api_game_methods.c.
Referenced by tolua_game_Disaster_name_translation00().
Return rule name for Disaster
Definition at line 1021 of file api_game_methods.c.
Referenced by tolua_game_Disaster_rule_name00().
Is tile occupied by enemies
Definition at line 1291 of file api_game_methods.c.
Referenced by tolua_game_Tile_is_enemy00().
Return name of the current ruleset.
Definition at line 115 of file api_game_methods.c.
Referenced by tolua_game_game_ruleset_name00().
Return name of the current ruleset.
Definition at line 107 of file api_game_methods.c.
Referenced by tolua_game_game_rulesetdir00().
Return the current turn.
Definition at line 50 of file api_game_methods.c.
Referenced by tolua_game_game_current_turn00().
Return the current turn, as if real turns started from 0.
Definition at line 90 of file api_game_methods.c.
Referenced by tolua_game_game_turn00().
Return the current year.
Definition at line 60 of file api_game_methods.c.
Referenced by tolua_game_game_current_year00().
Return the current year fragment.
Definition at line 70 of file api_game_methods.c.
Referenced by tolua_game_game_current_fragment00().
Return textual representation of the current calendar time.
Definition at line 80 of file api_game_methods.c.
Referenced by tolua_game_game_current_year_text00().
Return diplomatic state between the players.
Definition at line 806 of file api_game_methods.c.
Referenced by tolua_game_Player_diplstate00().
const char * api_methods_government_name_translation | ( | lua_State * | L, |
Government * | pgovernment | ||
) |
Return translated name for Government
Definition at line 434 of file api_game_methods.c.
Referenced by tolua_game_Government_name_translation00().
const char * api_methods_government_rule_name | ( | lua_State * | L, |
Government * | pgovernment | ||
) |
Return rule name for Government
Definition at line 422 of file api_game_methods.c.
Referenced by tolua_game_Government_rule_name00().
Return TRUE if city is capital
Definition at line 388 of file api_game_methods.c.
Referenced by tolua_game_City_is_capital00().
Return TRUE iff city is celebrating
Definition at line 366 of file api_game_methods.c.
Referenced by tolua_game_City_is_celebrating00().
Return TRUE iff city happy
Definition at line 342 of file api_game_methods.c.
Referenced by tolua_game_City_is_happy00().
Return TRUE iff city is unhappy
Definition at line 354 of file api_game_methods.c.
Referenced by tolua_game_City_is_unhappy00().
Return TRUE iff city is government center
Definition at line 377 of file api_game_methods.c.
Referenced by tolua_game_City_is_gov_center00().
Return TRUE if city is primary capital
Definition at line 399 of file api_game_methods.c.
Referenced by tolua_game_City_is_primary_capital00().
const char * api_methods_nation_type_name_translation | ( | lua_State * | L, |
Nation_Type * | pnation | ||
) |
Return translated adjective for Nation_Type
Definition at line 458 of file api_game_methods.c.
Referenced by tolua_game_Nation_Type_name_translation00().
const char * api_methods_nation_type_plural_translation | ( | lua_State * | L, |
Nation_Type * | pnation | ||
) |
Return translated plural noun for Nation_Type
Definition at line 470 of file api_game_methods.c.
Referenced by tolua_game_Nation_Type_plural_translation00().
const char * api_methods_nation_type_rule_name | ( | lua_State * | L, |
Nation_Type * | pnation | ||
) |
Return rule name for Nation_Type
Definition at line 446 of file api_game_methods.c.
Referenced by tolua_game_Nation_Type_rule_name00().
Number of bulbs on the research stock of pplayer In clients, unknown value is initialized with 0 but can be different if an embassy has been lost during the session (see OSDN#45076)
Definition at line 672 of file api_game_methods.c.
Referenced by tolua_game_Player_properties_bulbs00().
bool api_methods_player_can_build_impr_direct | ( | lua_State * | L, |
Player * | pplayer, | ||
Building_Type * | itype | ||
) |
Certain tests if pplayer generally can build itype buildings.
Definition at line 782 of file api_game_methods.c.
Referenced by tolua_game_Player_can_build_direct00().
bool api_methods_player_can_build_unit_direct | ( | lua_State * | L, |
Player * | pplayer, | ||
Unit_Type * | utype | ||
) |
Certain tests if pplayer generally can build utype units, maybe after building a required improvement. Does not consider obsoletion.
Definition at line 769 of file api_game_methods.c.
Referenced by tolua_game_Player_can_build_direct01().
Return a unit type the player potentially can upgrade utype to, or nil if the player can't upgrade it
Definition at line 755 of file api_game_methods.c.
Referenced by tolua_game_Player_can_upgrade00().
Return gui type string of the controlling connection.
Definition at line 482 of file api_game_methods.c.
Referenced by tolua_game_Player_controlling_gui00().
How much culture player has?
Definition at line 723 of file api_game_methods.c.
Referenced by tolua_game_Player_culture00().
Number of future techs known to pplayer In clients, unknown value is initialized with 0 but can be different if an embassy has been lost during the session (see OSDN#45076)
Definition at line 708 of file api_game_methods.c.
Referenced by tolua_game_Player_num_future_techs00().
Return gold for Player
Definition at line 553 of file api_game_methods.c.
Referenced by tolua_game_Player_gold00().
Does player have flag set?
Definition at line 734 of file api_game_methods.c.
Referenced by tolua_game_Player_has_flag00().
bool api_methods_player_has_wonder | ( | lua_State * | L, |
Player * | pplayer, | ||
Building_Type * | building | ||
) |
Return TRUE iff player has wonder
Definition at line 507 of file api_game_methods.c.
Referenced by tolua_game_Player_has_wonder00().
Return amount of infrapoints Player has
Definition at line 564 of file api_game_methods.c.
Referenced by tolua_game_Player_infrapoints00().
Return TRUE if Player knows advance ptech.
Definition at line 575 of file api_game_methods.c.
Referenced by tolua_game_Player_knows_tech00().
Return the number of cities pplayer has.
Definition at line 531 of file api_game_methods.c.
Referenced by tolua_game_Player_num_cities00().
Return the number of units pplayer has.
Definition at line 542 of file api_game_methods.c.
Referenced by tolua_game_Player_num_units00().
Return player number
Definition at line 520 of file api_game_methods.c.
Referenced by tolua_game_Player_properties_id00().
Find player's primary capital, if known
Definition at line 795 of file api_game_methods.c.
Referenced by tolua_game_Player_primary_capital00().
Total cost of pplayer's current research target. In clients, unknown value is initialized with 0 but can be different if an embassy has been lost during the session (see OSDN#45076)
Definition at line 689 of file api_game_methods.c.
Referenced by tolua_game_Player_researching_cost00().
lua_Object api_methods_player_researching | ( | lua_State * | L, |
Player * | pplayer | ||
) |
Returns current research target for a player. If the player researches a future tech, returns a string with its translated name. If the target is unset or unknown, returns nil. In clients, an unknown value usually is nil but may be different if an embassy has been lost during the session (see OSDN#45076)
Definition at line 638 of file api_game_methods.c.
Referenced by tolua_game_Player_researching00().
Return TRUE if players share research.
Definition at line 883 of file api_game_methods.c.
Referenced by tolua_game_Player_shares_research00().
Return current ptech research (or losing) cost for pplayer pplayer is optional, simplified calculation occurs without it that does not take into account "Tech_Cost_Factor" effect. In client, calculates a value summing only known leakage sources that may be different from the actual one given by :researching_cost() method. For techs not currently researchable, often can't calculate an actual value even on server (bases on current potential leakage sources, and, for "CivI|II" style, current pplayer's number of known techs or, if pplayer is absent, minimal number of techs to get to ptech).
Definition at line 614 of file api_game_methods.c.
Referenced by tolua_game_Player_tech_cost00().
lua_Object api_methods_private_list_players | ( | lua_State * | L | ) |
Return Lua list of all players FIXME: safe function, no reason to hide
Definition at line 924 of file api_game_methods.c.
Referenced by tolua_game_methods_private_list_players00().
City_List_Link * api_methods_private_player_city_list_head | ( | lua_State * | L, |
Player * | pplayer | ||
) |
Return list head for city list for Player
Definition at line 952 of file api_game_methods.c.
Referenced by tolua_game_methods_private_Player_city_list_head00().
Unit_List_Link * api_methods_private_player_unit_list_head | ( | lua_State * | L, |
Player * | pplayer | ||
) |
Return list head for unit list for Player
Definition at line 941 of file api_game_methods.c.
Referenced by tolua_game_methods_private_Player_unit_list_head00().
Return tile for nth iteration index (for internal use)
Definition at line 1377 of file api_game_methods.c.
Referenced by tolua_game_methods_private_Tile_tile_for_outward_index00().
int api_methods_private_tile_next_outward_index | ( | lua_State * | L, |
Tile * | pstart, | ||
int | tindex, | ||
int | max_dist | ||
) |
Return nth tile iteration index (for internal use) Will return the next index, or an index < 0 when done
Definition at line 1337 of file api_game_methods.c.
Referenced by tolua_game_methods_private_Tile_next_outward_index00().
Unit_List_Link * api_methods_private_tile_unit_list_head | ( | lua_State * | L, |
Tile * | ptile | ||
) |
Return list head for unit list for Tile
Definition at line 1324 of file api_game_methods.c.
Referenced by tolua_game_methods_private_Tile_unit_list_head00().
Unit_List_Link * api_methods_private_unit_cargo_list_head | ( | lua_State * | L, |
Unit * | punit | ||
) |
Return list head for cargo list for Unit
Definition at line 1489 of file api_game_methods.c.
Referenced by tolua_game_methods_private_Unit_cargo_list_head00().
Return name of the research group player belongs to.
Definition at line 907 of file api_game_methods.c.
Referenced by tolua_game_Player_research_name_translation00().
Return name of the research group player belongs to.
Definition at line 896 of file api_game_methods.c.
Referenced by tolua_game_Player_research_rule_name00().
Return name of the current tech cost style
Definition at line 123 of file api_game_methods.c.
Referenced by tolua_game_game_tech_cost_style00().
Return name of the current tech leakage style
Definition at line 131 of file api_game_methods.c.
Referenced by tolua_game_game_tech_leakage_style00().
Return translated name for Tech_Type
Definition at line 975 of file api_game_methods.c.
Referenced by tolua_game_Tech_Type_name_translation00().
Return rule name for Tech_Type
Definition at line 964 of file api_game_methods.c.
Referenced by tolua_game_Tech_Type_rule_name00().
Return name of the terrain's class
Definition at line 1010 of file api_game_methods.c.
Referenced by tolua_game_Terrain_class_name00().
Return translated name for Terrain
Definition at line 998 of file api_game_methods.c.
Referenced by tolua_game_Terrain_name_translation00().
Return rule name for Terrain
Definition at line 987 of file api_game_methods.c.
Referenced by tolua_game_Terrain_rule_name00().
Return City on ptile, else NULL
Definition at line 1150 of file api_game_methods.c.
Referenced by tolua_game_Tile_city00().
bool api_methods_tile_city_exists_within_max_city_map | ( | lua_State * | L, |
Tile * | ptile, | ||
bool | may_be_on_center | ||
) |
Return TRUE if there is a city inside the maximum city radius from ptile.
Definition at line 1161 of file api_game_methods.c.
Referenced by tolua_game_Tile_city_exists_within_max_city_map00().
Return the extra owner for the specified extra on ptile or NULL if the extra isn't there. If no name is specified the owner of the first owned extra at the tile is returned.
Definition at line 1258 of file api_game_methods.c.
Referenced by tolua_game_Tile_extra_owner00().
Return TRUE if there is a base with rule name name on ptile. If no name is specified return true if there is any base on ptile.
Definition at line 1202 of file api_game_methods.c.
Referenced by tolua_game_Tile_has_base00().
Return TRUE if there is a extra with rule name name on ptile. If no name is specified return true if there is a extra on ptile.
Definition at line 1175 of file api_game_methods.c.
Referenced by tolua_game_Tile_has_extra00().
Return TRUE if there is a road with rule name name on ptile. If no name is specified return true if there is any road on ptile.
Definition at line 1229 of file api_game_methods.c.
Referenced by tolua_game_Tile_has_road00().
Whether player knows the tile
Definition at line 1442 of file api_game_methods.c.
Referenced by tolua_game_Tile_known00().
Return featured text link of the tile.
Definition at line 1626 of file api_game_methods.c.
Referenced by tolua_game_Tile_link_text00().
Return the map x coordinate of the tile.
Definition at line 1128 of file api_game_methods.c.
Referenced by tolua_game_Tile_properties_x00().
Return the map y coordinate of the tile.
Definition at line 1139 of file api_game_methods.c.
Referenced by tolua_game_Tile_properties_y00().
Return the native x coordinate of the tile.
Definition at line 1106 of file api_game_methods.c.
Referenced by tolua_game_Tile_properties_nat_x00().
Return the native y coordinate of the tile.
Definition at line 1117 of file api_game_methods.c.
Referenced by tolua_game_Tile_properties_nat_y00().
Return number of units on tile
Definition at line 1313 of file api_game_methods.c.
Referenced by tolua_game_Tile_num_units00().
Whether player currently sees the tile
Definition at line 1454 of file api_game_methods.c.
Referenced by tolua_game_Tile_seen00().
Return squared distance between tiles 1 and 2
Definition at line 1402 of file api_game_methods.c.
Referenced by tolua_game_Tile_sq_distance00().
Return if a unit can upgrade considering where it is now. If is_free is FALSE, considers local city and the owner's treasury.
Definition at line 824 of file api_game_methods.c.
Referenced by tolua_game_Unit_can_upgrade00().
Can punit found a city on its tile?
FIXME: Unlike name suggests, this is currently used for finding cities from huts and the like, and is not suitable for checking if specified unit could act to build a city.
Definition at line 1418 of file api_game_methods.c.
Referenced by tolua_game_Unit_is_on_possible_city_tile00().
Return featured text link of the unit.
Definition at line 1659 of file api_game_methods.c.
Referenced by tolua_game_Unit_link_text00().
Unit * api_methods_unit_list_link_data | ( | lua_State * | L, |
Unit_List_Link * | ul_link | ||
) |
Return Unit for list link
Definition at line 1582 of file api_game_methods.c.
Referenced by tolua_game_Unit_List_Link_data00().
Unit_List_Link * api_methods_unit_list_next_link | ( | lua_State * | L, |
Unit_List_Link * | ul_link | ||
) |
Return next list link or NULL when link is the last link
Definition at line 1593 of file api_game_methods.c.
Referenced by tolua_game_Unit_List_Link_next00().
Get unit orientation
Definition at line 1466 of file api_game_methods.c.
Referenced by tolua_game_Unit_facing00().
Whether player currently sees the unit
Definition at line 871 of file api_game_methods.c.
Referenced by tolua_game_Unit_seen00().
Return the tile of the unit.
Definition at line 1431 of file api_game_methods.c.
Referenced by tolua_game_Unit_properties_tile00().
Return featured text link of the unit tile.
Definition at line 1637 of file api_game_methods.c.
Referenced by tolua_game_Unit_tile_link_text00().
Return a name of the problem unit may have being transformed to ptype where it is now, or nil if no problem seems to exist.
Definition at line 834 of file api_game_methods.c.
Referenced by tolua_game_Unit_transform_problem00().
Return Unit that transports punit, if any.
Definition at line 1478 of file api_game_methods.c.
Referenced by tolua_game_Unit_transporter00().
bool api_methods_unit_type_can_exist_at_tile | ( | lua_State * | L, |
Unit_Type * | punit_type, | ||
Tile * | ptile | ||
) |
Return TRUE iff the unit type can exist on the tile.
Definition at line 1543 of file api_game_methods.c.
Referenced by tolua_game_Unit_Type_can_exist_at_tile00().
Return TRUE if punit_type has flag.
Definition at line 1501 of file api_game_methods.c.
Referenced by tolua_game_Unit_Type_has_flag00().
Return TRUE if punit_type has role.
Definition at line 1522 of file api_game_methods.c.
Referenced by tolua_game_Unit_Type_has_role00().
Return translated name for Unit_Type
Definition at line 1569 of file api_game_methods.c.
Referenced by tolua_game_Unit_Type_name_translation00().
Return rule name for Unit_Type
Definition at line 1557 of file api_game_methods.c.
Referenced by tolua_game_Unit_Type_rule_name00().