![]() |
Freeciv21
Develop your civilization from humble roots to a global empire
|
#include "city.h"#include "cityturn.h"#include "fcintl.h"#include "rand.h"#include "movement.h"#include "research.h"#include "unittype.h"#include "api_game_find.h"#include "luascript.h"#include "aiiface.h"#include "barbarian.h"#include "citytools.h"#include "console.h"#include "maphand.h"#include "notify.h"#include "plrhand.h"#include "srv_main.h"#include "stdinhand.h"#include "techtools.h"#include "unittools.h"#include "mapgen_utils.h"#include "api_server_edit.h"
Include dependency graph for api_server_edit.cpp:Go to the source code of this file.
Functions | |
| bool | api_edit_unleash_barbarians (lua_State *L, Tile *ptile) |
| Unleash barbarians on a tile, for example from a hut. More... | |
| void | api_edit_place_partisans (lua_State *L, Tile *ptile, Player *pplayer, int count, int sq_radius) |
| Place partisans for a player around a tile (normally around a city). More... | |
| Unit * | api_edit_create_unit (lua_State *L, Player *pplayer, Tile *ptile, Unit_Type *ptype, int veteran_level, City *homecity, int moves_left) |
| Create a new unit. More... | |
| 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) |
| Create a new unit. More... | |
| bool | api_edit_unit_teleport (lua_State *L, Unit *punit, Tile *dest) |
| Teleport unit to destination tile. More... | |
| void | api_edit_unit_turn (lua_State *L, Unit *punit, Direction dir) |
| Change unit orientation. More... | |
| void | api_edit_unit_kill (lua_State *L, Unit *punit, const char *reason, Player *killer) |
| Kill the unit. More... | |
| bool | api_edit_change_terrain (lua_State *L, Tile *ptile, Terrain *pterr) |
| Change terrain on tile. More... | |
| void | api_edit_create_city (lua_State *L, Player *pplayer, Tile *ptile, const char *name) |
| Create a new city. More... | |
| void | api_edit_resize_city (lua_State *L, City *pcity, int size, const char *reason) |
| Resizes a city. More... | |
| Player * | api_edit_create_player (lua_State *L, const char *username, Nation_Type *pnation, const char *ai) |
| Create a new player. More... | |
| void | api_edit_change_gold (lua_State *L, Player *pplayer, int amount) |
| Change pplayer's gold by amount. More... | |
| Tech_Type * | api_edit_give_technology (lua_State *L, Player *pplayer, Tech_Type *ptech, int cost, bool notify, const char *reason) |
| Give pplayer technology ptech. More... | |
| bool | api_edit_trait_mod_set (lua_State *L, Player *pplayer, const char *tname, const int mod) |
| Modify player's trait value. More... | |
| void | api_edit_create_owned_extra (lua_State *L, Tile *ptile, const char *name, Player *pplayer) |
| Create a new owned extra. More... | |
| void | api_edit_create_extra (lua_State *L, Tile *ptile, const char *name) |
| Create a new extra. More... | |
| void | api_edit_create_base (lua_State *L, Tile *ptile, const char *name, Player *pplayer) |
| Create a new base. More... | |
| void | api_edit_create_road (lua_State *L, Tile *ptile, const char *name) |
| Add a new road. More... | |
| void | api_edit_remove_extra (lua_State *L, Tile *ptile, const char *name) |
| Remove extra from tile, if present. More... | |
| void | api_edit_tile_set_label (lua_State *L, Tile *ptile, const char *label) |
| Set tile label text. More... | |
| void | api_edit_climate_change (lua_State *L, enum climate_change_type type, int effect) |
| Global climate change. More... | |
| Player * | api_edit_civil_war (lua_State *L, Player *pplayer, int probability) |
| Provoke a civil war. More... | |
| void | api_edit_player_victory (lua_State *L, Player *pplayer) |
| Make player winner of the scenario. More... | |
| bool | api_edit_unit_move (lua_State *L, Unit *punit, Tile *ptile, int movecost) |
| Move a unit. More... | |
| void | api_edit_unit_moving_disallow (lua_State *L, Unit *punit) |
| Prohibit unit from moving. More... | |
| void | api_edit_unit_moving_allow (lua_State *L, Unit *punit) |
| Allow unit to move. More... | |
| void | api_edit_city_add_history (lua_State *L, City *pcity, int amount) |
| Add history to a city. More... | |
| void | api_edit_player_add_history (lua_State *L, Player *pplayer, int amount) |
| Add history to a player. More... | |
| void api_edit_change_gold | ( | lua_State * | L, |
| Player * | pplayer, | ||
| int | amount | ||
| ) |
Change pplayer's gold by amount.
Definition at line 336 of file api_server_edit.cpp.
Change terrain on tile.
Definition at line 238 of file api_server_edit.cpp.
| void api_edit_city_add_history | ( | lua_State * | L, |
| City * | pcity, | ||
| int | amount | ||
| ) |
Add history to a city.
Definition at line 638 of file api_server_edit.cpp.
Provoke a civil war.
Definition at line 541 of file api_server_edit.cpp.
| void api_edit_climate_change | ( | lua_State * | L, |
| enum climate_change_type | type, | ||
| int | effect | ||
| ) |
Global climate change.
Definition at line 525 of file api_server_edit.cpp.
Create a new base.
Definition at line 471 of file api_server_edit.cpp.
Create a new city.
Definition at line 269 of file api_server_edit.cpp.
| void api_edit_create_extra | ( | lua_State * | L, |
| Tile * | ptile, | ||
| const char * | name | ||
| ) |
Create a new extra.
Definition at line 463 of file api_server_edit.cpp.
| void api_edit_create_owned_extra | ( | lua_State * | L, |
| Tile * | ptile, | ||
| const char * | name, | ||
| Player * | pplayer | ||
| ) |
Create a new owned extra.
Definition at line 440 of file api_server_edit.cpp.
Referenced by api_edit_create_base(), api_edit_create_extra(), and api_edit_create_road().
| Player* api_edit_create_player | ( | lua_State * | L, |
| const char * | username, | ||
| Nation_Type * | pnation, | ||
| const char * | ai | ||
| ) |
Create a new player.
Definition at line 301 of file api_server_edit.cpp.
| void api_edit_create_road | ( | lua_State * | L, |
| Tile * | ptile, | ||
| const char * | name | ||
| ) |
Add a new road.
Definition at line 480 of file api_server_edit.cpp.
| Unit* api_edit_create_unit | ( | lua_State * | L, |
| Player * | pplayer, | ||
| Tile * | ptile, | ||
| Unit_Type * | ptype, | ||
| int | veteran_level, | ||
| City * | homecity, | ||
| int | moves_left | ||
| ) |
Create a new unit.
Definition at line 73 of file api_server_edit.cpp.
| 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 | ||
| ) |
Create a new unit.
Definition at line 84 of file api_server_edit.cpp.
Referenced by api_edit_create_unit().
| Tech_Type* api_edit_give_technology | ( | lua_State * | L, |
| Player * | pplayer, | ||
| Tech_Type * | ptech, | ||
| int | cost, | ||
| bool | notify, | ||
| const char * | reason | ||
| ) |
Give pplayer technology ptech.
Quietly returns nullptr if player already has this tech; otherwise returns the tech granted. Use nullptr for ptech to grant a random tech. sends script signal "tech_researched" with the given reason
Definition at line 350 of file api_server_edit.cpp.
| void api_edit_place_partisans | ( | lua_State * | L, |
| Tile * | ptile, | ||
| Player * | pplayer, | ||
| int | count, | ||
| int | sq_radius | ||
| ) |
Place partisans for a player around a tile (normally around a city).
Definition at line 57 of file api_server_edit.cpp.
| void api_edit_player_add_history | ( | lua_State * | L, |
| Player * | pplayer, | ||
| int | amount | ||
| ) |
Add history to a player.
Definition at line 649 of file api_server_edit.cpp.
| void api_edit_player_victory | ( | lua_State * | L, |
| Player * | pplayer | ||
| ) |
Make player winner of the scenario.
Definition at line 570 of file api_server_edit.cpp.
| void api_edit_remove_extra | ( | lua_State * | L, |
| Tile * | ptile, | ||
| const char * | name | ||
| ) |
Remove extra from tile, if present.
Definition at line 488 of file api_server_edit.cpp.
| void api_edit_resize_city | ( | lua_State * | L, |
| City * | pcity, | ||
| int | size, | ||
| const char * | reason | ||
| ) |
Resizes a city.
Definition at line 287 of file api_server_edit.cpp.
| void api_edit_tile_set_label | ( | lua_State * | L, |
| Tile * | ptile, | ||
| const char * | label | ||
| ) |
Set tile label text.
Definition at line 510 of file api_server_edit.cpp.
| bool api_edit_trait_mod_set | ( | lua_State * | L, |
| Player * | pplayer, | ||
| const char * | tname, | ||
| const int | mod | ||
| ) |
Modify player's trait value.
Definition at line 419 of file api_server_edit.cpp.
Kill the unit.
Definition at line 218 of file api_server_edit.cpp.
Move a unit.
Definition at line 581 of file api_server_edit.cpp.
| void api_edit_unit_moving_allow | ( | lua_State * | L, |
| Unit * | punit | ||
| ) |
Allow unit to move.
Definition at line 625 of file api_server_edit.cpp.
| void api_edit_unit_moving_disallow | ( | lua_State * | L, |
| Unit * | punit | ||
| ) |
Prohibit unit from moving.
Definition at line 612 of file api_server_edit.cpp.
Teleport unit to destination tile.
Definition at line 154 of file api_server_edit.cpp.
Change unit orientation.
Definition at line 201 of file api_server_edit.cpp.
| bool api_edit_unleash_barbarians | ( | lua_State * | L, |
| Tile * | ptile | ||
| ) |
Unleash barbarians on a tile, for example from a hut.
Definition at line 46 of file api_server_edit.cpp.