61 const char *deprecated_since)
65 "Deprecated: Lua call %s aka %s filling out the remaining"
66 " parameters based on the old rules is deprecated"
68 call, aka, deprecated_since);
89 vet_loss =
MAX(vet_loss, vl);
114 int count,
int sq_radius)
121 "no partisans in ruleset");
131 City *homecity,
int moves_left)
134 homecity, moves_left, -1, NULL);
143 City *homecity,
int moves_left,
150#ifndef FREECIV_NDEBUG
182 "create_unit_full: player already has unique unit");
210#ifndef FREECIV_NDEBUG
223 Unit *embark_to,
bool allow_disembark,
234 "Can't both enter and frighten a hut at the same time",
251 embark_to, embark_to != NULL,
282 "Unit:teleport(dest)",
"3.1");
352 paction->
id, ACT_REQ_RULES);
378 paction->
id, ACT_REQ_RULES);
404 paction->
id, ACT_REQ_RULES);
430 paction->
id, ACT_REQ_RULES);
443 bool enabled =
FALSE;
486 paction->
id, ACT_REQ_RULES);
501 bool enabled =
FALSE;
548 paction->
id, ACT_REQ_RULES);
574 paction->
id, ACT_REQ_RULES);
589 if (direction8_is_valid(dir)) {
594 log_error(
"Illegal direction %d for unit from lua script", dir);
636 enum unit_loss_reason loss_reason;
642 loss_reason = unit_loss_reason_by_name(reason,
fc_strcasecmp);
645 "Invalid unit loss reason");
663 if (old_terrain == pterr
721 "It is a special item, not a city building");
724 bool need_game_info =
FALSE;
725 bool need_plr_info =
FALSE;
727 struct city *oldcity;
731 need_plr_info =
TRUE;
733 if (old_owner && old_owner != pplayer) {
735 need_game_info =
TRUE;
749 if (need_game_info) {
787 struct player *pplayer = NULL;
809 if (strlen(buf) > 0) {
860 }
else if (
cost == -2) {
862 }
else if (
cost == -3) {
874 if (notify && result != NULL) {
881 Q_(
"?fromscript:You acquire %s."), adv_name);
885 Q_(
"?fromscript:The %s acquire %s and share this "
886 "advance with you."),
891 Q_(
"?fromscript:The %s acquire %s."),
892 research_name, adv_name);
905 const char *tname,
const int mod)
939 if (pextra != NULL) {
1039 if (pcity != NULL) {
1064 2,
"invalid climate change type");
1078 3,
"must be a percentage", NULL);
1084 if (probability == 0) {
1091 if (
fc_rand(100) >= probability) {
1115 Unit *embark_to,
bool disembark,
1125 "Can't both enter and frighten a hut at the same time",
1141 embark_to, embark_to != NULL,
1155 "Unit:move(moveto, movecost)",
"3.1");
1175 != ANIMAL_BARBARIAN)
1177 UCF_CAN_OCCUPY_CITY)
1201 if (
punit != NULL) {
1214 if (
punit != NULL) {
enum action_actor_kind action_get_actor_kind(const struct action *paction)
bool is_action_enabled_unit_on_tile(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct tile *target_tile, const struct extra_type *target_extra)
bool is_action_enabled_unit_on_units(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct tile *target_tile)
bool is_action_enabled_unit_on_city(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct city *target_city)
bool is_action_enabled_unit_on_unit(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct unit *target_unit)
enum action_target_kind action_get_target_kind(const struct action *paction)
bool is_action_enabled_unit_on_self(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit)
bool is_action_enabled_unit_on_extras(const struct civ_map *nmap, const action_id wanted_action, const struct unit *actor_unit, const struct tile *target_tile, const struct extra_type *target_extra)
#define action_has_result(_act_, _res_)
const char * default_ai_type_name(void)
static bool ur_transform_unit(struct unit *punit, const struct unit_type *to_unit, int vet_loss)
bool api_edit_perform_action_unit_vs_tile_extra(lua_State *L, Unit *punit, Action *paction, Tile *tgt, const char *sub_tgt)
bool api_edit_perform_action_unit_vs_tile(lua_State *L, Unit *punit, Action *paction, Tile *tgt)
void api_edit_climate_change(lua_State *L, enum climate_change_type type, int effect)
void api_edit_unit_moving_allow(lua_State *L, Unit *punit)
static void deprecated_semantic_warning(const char *call, const char *aka, const char *deprecated_since)
void api_edit_remove_city(lua_State *L, City *pcity)
bool api_edit_trait_mod_set(lua_State *L, Player *pplayer, const char *tname, const int mod)
bool api_edit_unleash_barbarians(lua_State *L, Tile *ptile)
void api_edit_remove_building(lua_State *L, City *pcity, Building_Type *impr)
void api_edit_player_victory(lua_State *L, Player *pplayer)
void api_edit_create_extra(lua_State *L, Tile *ptile, const char *name)
Unit * api_edit_create_unit(lua_State *L, Player *pplayer, Tile *ptile, Unit_Type *ptype, int veteran_level, City *homecity, int moves_left)
bool api_edit_perform_action_unit_vs_unit(lua_State *L, Unit *punit, Action *paction, Unit *tgt)
void api_edit_player_add_history(lua_State *L, Player *pplayer, int amount)
Tech_Type * api_edit_give_technology(lua_State *L, Player *pplayer, Tech_Type *ptech, int cost, bool notify, const char *reason)
bool api_edit_perform_action_unit_vs_city_impr(lua_State *L, Unit *punit, Action *paction, City *tgt, Building_Type *sub_tgt)
void api_edit_create_building(lua_State *L, City *pcity, Building_Type *impr)
Unit * api_edit_create_unit_full(lua_State *L, Player *pplayer, Tile *ptile, Unit_Type *ptype, int veteran_level, City *homecity, int moves_left, int hp_left, Unit *ptransport)
void api_edit_player_give_bulbs(lua_State *L, Player *pplayer, int amount)
bool api_edit_change_terrain(lua_State *L, Tile *ptile, Terrain *pterr)
void api_edit_create_owned_extra(lua_State *L, Tile *ptile, const char *name, Player *pplayer)
void api_edit_tile_show(lua_State *L, Tile *ptile, Player *pplayer)
void api_edit_unit_kill(lua_State *L, Unit *punit, const char *reason, Player *killer)
bool api_edit_tile_hide(lua_State *L, Tile *ptile, Player *pplayer)
void api_edit_unit_turn(lua_State *L, Unit *punit, Direction dir)
void api_edit_place_partisans(lua_State *L, Tile *ptile, Player *pplayer, int count, int sq_radius)
void api_edit_remove_extra(lua_State *L, Tile *ptile, const char *name)
void api_edit_tile_set_label(lua_State *L, Tile *ptile, const char *label)
void api_edit_create_road(lua_State *L, Tile *ptile, const char *name)
bool api_edit_unit_move_old(lua_State *L, Unit *punit, Tile *ptile, int movecost)
bool api_edit_perform_action_unit_vs_city(lua_State *L, Unit *punit, Action *paction, City *tgt)
void api_edit_city_add_history(lua_State *L, City *pcity, int amount)
bool api_edit_create_city(lua_State *L, Player *pplayer, Tile *ptile, const char *name)
bool api_edit_unit_teleport(lua_State *L, Unit *punit, Tile *dest, Unit *embark_to, bool allow_disembark, bool conquer_city, bool conquer_extra, bool enter_hut, bool frighten_hut)
void api_edit_unit_moving_disallow(lua_State *L, Unit *punit)
bool api_edit_unit_teleport_old(lua_State *L, Unit *punit, Tile *dest)
bool api_edit_unit_upgrade(lua_State *L, Unit *punit, int vet_loss)
bool api_edit_unit_move(lua_State *L, Unit *punit, Tile *ptile, int movecost, Unit *embark_to, bool disembark, bool conquer_city, bool conquer_extra, bool enter_hut, bool frighten_hut)
bool api_edit_perform_action_unit_vs_self(lua_State *L, Unit *punit, Action *paction)
Player * api_edit_create_player(lua_State *L, const char *username, Nation_Type *pnation, const char *ai)
bool api_edit_unit_transform(lua_State *L, Unit *punit, Unit_Type *ptype, int vet_loss)
void api_edit_change_gold(lua_State *L, Player *pplayer, int amount)
Player * api_edit_civil_war(lua_State *L, Player *pplayer, int probability)
bool api_edit_perform_action_unit_vs_city_tech(lua_State *L, Unit *punit, Action *paction, City *tgt, Tech_Type *sub_tgt)
void api_edit_create_base(lua_State *L, Tile *ptile, const char *name, Player *pplayer)
@ CLIMATE_CHANGE_GLOBAL_WARMING
@ CLIMATE_CHANGE_NUCLEAR_WINTER
bool unleash_barbarians(struct tile *ptile)
void dbv_clr(struct dbv *pdbv, int bit)
bool city_has_building(const struct city *pcity, const struct impr_type *pimprove)
void city_remove_improvement(struct city *pcity, const struct impr_type *pimprove)
#define city_owner(_pcity_)
void auto_arrange_workers(struct city *pcity)
bool city_refresh(struct city *pcity)
bool are_deprecation_warnings_enabled(void)
#define log_deprecation_always(message,...)
static void conquer_city(QVariant data1, QVariant data2)
static void enter_hut(QVariant data1, QVariant data2)
static void frighten_hut(QVariant data1, QVariant data2)
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
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 int cost
#define IDENTITY_NUMBER_ZERO
const struct ft_color ftc_server
void send_game_info(struct conn_list *dest)
bool is_special_improvement(const struct impr_type *pimprove)
bool is_wonder(const struct impr_type *pimprove)
bool is_great_wonder(const struct impr_type *pimprove)
#define fc_assert(condition)
#define fc_assert_ret_val(condition, val)
#define fc_assert_action(condition, action)
#define log_error(message,...)
void luascript_log(struct fc_lua *fcl, enum log_level level, const char *format,...)
struct fc_lua * luascript_get_fcl(lua_State *L)
#define LUASCRIPT_CHECK_STATE(L,...)
#define LUASCRIPT_CHECK_SELF(L, value,...)
#define LUASCRIPT_CHECK_ARG_NIL(L, value, narg, type,...)
#define LUASCRIPT_CHECK_ARG(L, check, narg, msg,...)
#define LUASCRIPT_CHECK(L, check, msg,...)
enum direction8 Direction
bool same_pos(const struct tile *tile1, const struct tile *tile2)
void assign_continent_numbers(void)
bool really_gives_vision(struct player *me, struct player *them)
void send_tile_info(struct conn_list *dest, struct tile *ptile, bool send_unknown)
void send_all_known_tiles(struct conn_list *dest)
bool need_to_reassign_continents(const struct terrain *oldter, const struct terrain *newter)
void climate_change(bool warming, int effect)
void create_extra(struct tile *ptile, struct extra_type *pextra, struct player *pplayer)
void map_show_tile(struct player *src_player, struct tile *ptile)
void tile_change_side_effects(struct tile *ptile, bool refresh_city)
bool map_is_known_and_seen(const struct tile *ptile, const struct player *pplayer, enum vision_layer vlayer)
void fix_tile_on_terrain_change(struct tile *ptile, struct terrain *oldter, bool extend_rivers)
void update_tile_knowledge(struct tile *ptile)
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)
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)
const char * nation_plural_for_player(const struct player *pplayer)
void notify_research(const struct research *presearch, const struct player *exclude, enum event_type event, const struct ft_color color, const char *format,...)
void notify_player(const struct player *pplayer, const struct tile *ptile, enum event_type event, const struct ft_color color, const char *format,...)
void notify_research_embassies(const struct research *presearch, const struct player *exclude, enum event_type event, const struct ft_color color, const char *format,...)
bool pplayers_at_war(const struct player *pplayer, const struct player *pplayer2)
bool pplayers_allied(const struct player *pplayer, const struct player *pplayer2)
void player_status_add(struct player *plr, enum player_status pstatus)
bool civil_war_triggered(struct player *pplayer)
void send_player_info_c(struct player *src, struct conn_list *dest)
struct player * civil_war(struct player *pplayer)
bool civil_war_possible(struct player *pplayer, bool conquering_city, bool honour_server_option)
const char * research_advance_name_translation(const struct research *presearch, Tech_type_id tech)
struct research * research_get(const struct player *pplayer)
enum tech_state research_invention_state(const struct research *presearch, Tech_type_id tech)
int research_pretty_name(const struct research *presearch, char *buf, size_t buf_len)
bool game_was_started(void)
enum server_states server_state(void)
enum rfc_status create_command_newcomer(const char *name, const char *ai, bool check, struct nation_type *pnation, struct player **newplayer, char *buf, size_t buflen)
enum rfc_status create_command_pregame(const char *name, const char *ai, bool check, struct player **newplayer, char *buf, size_t buflen)
struct civ_game::@30::@34 server
struct player_ai ai_common
struct conn_list * connections
struct player_economic economic
int fc_strcasecmp(const char *str0, const char *str1)
struct advance * advance_by_number(const Tech_type_id atype)
bool is_future_tech(Tech_type_id tech)
Tech_type_id advance_number(const struct advance *padvance)
#define terrain_has_flag(terr, flag)
bool tile_has_claimable_base(const struct tile *ptile, const struct unit_type *punittype)
void tile_change_terrain(struct tile *ptile, struct terrain *pterrain)
bool tile_extra_rm_apply(struct tile *ptile, struct extra_type *tgt)
bool tile_set_label(struct tile *ptile, const char *label)
struct city * tile_city(const struct tile *ptile)
#define tile_terrain(_tile)
#define tile_has_extra(ptile, pextra)
#define trade_partners_iterate_end
#define trade_partners_iterate(c, p)
enum unit_upgrade_result unit_transform_result(const struct civ_map *nmap, const struct unit *punit, const struct unit_type *to_unittype)
bool unit_can_do_action_result(const struct unit *punit, enum action_result result)
void unit_virtual_destroy(struct unit *punit)
bool unit_transported(const struct unit *pcargo)
bool could_unit_be_in_transport(const struct unit *pcargo, const struct unit *ptrans)
static bool is_non_allied_unit_tile(const struct tile *ptile, const struct player *pplayer)
bool unit_perform_action(struct player *pplayer, const int actor_id, const int target_id, const int sub_tgt_id_incoming, const char *name, const action_id action_type, const enum action_requester requester)
const struct unit_type * unit_type_get(const struct unit *punit)
struct unit_type * unit_type_array_first(void)
int num_role_units(int role)
bool utype_player_already_has_this_unique(const struct player *pplayer, const struct unit_type *putype)
const struct unit_type * can_upgrade_unittype(const struct player *pplayer, const struct unit_type *punittype)
int utype_veteran_levels(const struct unit_type *punittype)
const char * utype_rule_name(const struct unit_type *punittype)
struct unit_class * unit_class_get(const struct unit *punit)
bool unit_has_type_flag(const struct unit *punit, enum unit_type_flag_id flag)
const struct unit_type * unit_type_array_last(void)
static bool uclass_has_flag(const struct unit_class *punitclass, enum unit_class_flag_id flag)