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.
7 
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 *****************************************************************************/
13 
14 #ifndef FC__API_SERVER_EDIT_H
15 #define FC__API_SERVER_EDIT_H
16 
17 /* common/scriptcore */
18 #include "luascript_types.h"
19 
20 struct lua_State;
21 
22 /* type of clima change */
23 enum climate_change_type {
24   CLIMATE_CHANGE_GLOBAL_WARMING,
25   CLIMATE_CHANGE_NUCLEAR_WINTER
26 };
27 
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);
39 
40 void api_edit_unit_turn(lua_State *L, Unit *punit, Direction dir);
41 
42 void api_edit_unit_kill(lua_State *L, Unit *punit, const char *reason,
43                         Player *killer);
44 
45 void api_edit_create_city(lua_State *L, Player *pplayer, Tile *ptile,
46                           const char *name);
47 Player *api_edit_create_player(lua_State *L, const char *username,
48                                Nation_Type *pnation, const char *ai);
49 void api_edit_change_gold(lua_State *L, Player *pplayer, int amount);
50 Tech_Type *api_edit_give_technology(lua_State *L, Player *pplayer,
51                                     Tech_Type *ptech, int cost, bool notify,
52                                     const char *reason);
53 bool api_edit_trait_mod_set(lua_State *L, Player *pplayer,
54                             const char *tname, const int mod);
55 
56 void api_edit_create_extra(lua_State *L, Tile *ptile, const char *name);
57 void api_edit_create_base(lua_State *L, Tile *ptile, const char *name,
58                           struct player *pplayer);
59 void api_edit_create_road(lua_State *L, Tile *ptile, const char *name);
60 void api_edit_remove_extra(lua_State *L, Tile *ptile, const char *name);
61 
62 void api_edit_tile_set_label(lua_State *L, Tile *ptile, const char *label);
63 
64 void api_edit_climate_change(lua_State *L, enum climate_change_type type,
65                              int effect);
66 Player *api_edit_civil_war(lua_State *L, Player *pplayer, int probability);
67 
68 
69 void api_edit_player_victory(lua_State *L, Player *pplayer);
70 bool api_edit_unit_move(lua_State *L, Unit *punit, Tile *ptile,
71                         int movecost);
72 
73 void api_edit_city_add_history(lua_State *L, City *pcity, int amount);
74 void api_edit_player_add_history(lua_State *L, Player *pplayer, int amount);
75 
76 #endif /* API_SERVER_EDIT_H */
77