Add scripting API control over unit 'stay'
[freeciv.git] / server / scripting / api_server_edit.h
blobf478262d74f9f85d10a705cd2a13b85b978e97a5
1 /*****************************************************************************
2 Freeciv - Copyright (C) 2005 - The Freeciv Project
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2, or (at your option)
6 any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 *****************************************************************************/
14 #ifndef FC__API_SERVER_EDIT_H
15 #define FC__API_SERVER_EDIT_H
17 /* common/scriptcore */
18 #include "luascript_types.h"
20 struct lua_State;
22 /* type of clima change */
23 enum climate_change_type {
24 CLIMATE_CHANGE_GLOBAL_WARMING,
25 CLIMATE_CHANGE_NUCLEAR_WINTER
28 bool api_edit_unleash_barbarians(lua_State *L, Tile *ptile);
29 void api_edit_place_partisans(lua_State *L, Tile *ptile, Player *pplayer,
30 int count, int sq_radius);
31 Unit *api_edit_create_unit(lua_State *L, Player *pplayer, Tile *ptile,
32 Unit_Type *ptype, int veteran_level,
33 City *homecity, int moves_left);
34 Unit *api_edit_create_unit_full(lua_State *L, Player *pplayer, Tile *ptile,
35 Unit_Type *ptype, int veteran_level,
36 City *homecity, int moves_left, int hp_left,
37 Unit *ptransport);
38 bool api_edit_unit_teleport(lua_State *L, Unit *punit, Tile *dest);
40 void api_edit_unit_turn(lua_State *L, Unit *punit, Direction dir);
42 void api_edit_unit_kill(lua_State *L, Unit *punit, const char *reason,
43 Player *killer);
45 bool api_edit_change_terrain(lua_State *L, Tile *ptile, Terrain *pterr);
47 void api_edit_create_city(lua_State *L, Player *pplayer, Tile *ptile,
48 const char *name);
49 Player *api_edit_create_player(lua_State *L, const char *username,
50 Nation_Type *pnation, const char *ai);
51 void api_edit_change_gold(lua_State *L, Player *pplayer, int amount);
52 Tech_Type *api_edit_give_technology(lua_State *L, Player *pplayer,
53 Tech_Type *ptech, int cost, bool notify,
54 const char *reason);
55 bool api_edit_trait_mod_set(lua_State *L, Player *pplayer,
56 const char *tname, const int mod);
58 void api_edit_create_owned_extra(lua_State *L, Tile *ptile, const char *name,
59 struct player *pplayer);
60 void api_edit_create_extra(lua_State *L, Tile *ptile, const char *name);
61 void api_edit_create_base(lua_State *L, Tile *ptile, const char *name,
62 struct player *pplayer);
63 void api_edit_create_road(lua_State *L, Tile *ptile, const char *name);
64 void api_edit_remove_extra(lua_State *L, Tile *ptile, const char *name);
66 void api_edit_tile_set_label(lua_State *L, Tile *ptile, const char *label);
68 void api_edit_climate_change(lua_State *L, enum climate_change_type type,
69 int effect);
70 Player *api_edit_civil_war(lua_State *L, Player *pplayer, int probability);
73 void api_edit_player_victory(lua_State *L, Player *pplayer);
74 bool api_edit_unit_move(lua_State *L, Unit *punit, Tile *ptile,
75 int movecost);
76 void api_edit_unit_moving_disallow(lua_State *L, Unit *punit);
77 void api_edit_unit_moving_allow(lua_State *L, Unit *punit);
79 void api_edit_city_add_history(lua_State *L, City *pcity, int amount);
80 void api_edit_player_add_history(lua_State *L, Player *pplayer, int amount);
82 #endif /* API_SERVER_EDIT_H */