Freeciv-3.1: /fast/freeciv/nightly/S3_1/server/scripting/api_server_edit.h Source File

Freeciv-3.1

Loading...
Searching...
No Matches
api_server_edit.h
Go to the documentation of this file.
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
20struct lua_State;
21
22/* type of climate change */
23 enum climate_change_type {
24 CLIMATE_CHANGE_GLOBAL_WARMING,
25 CLIMATE_CHANGE_NUCLEAR_WINTER
26};
27
28bool api_edit_unleash_barbarians(lua_State *L, Tile *ptile);
29void 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);
38bool api_edit_unit_teleport(lua_State *L, Unit *punit, Tile *dest,
39 Unit *embark_to, bool allow_disembark,
40 bool conquer_city, bool conquer_extra,
41 bool enter_hut, bool frighten_hut);
42bool api_edit_unit_teleport_old(lua_State *L, Unit *punit, Tile *dest);
43
44bool api_edit_perform_action_unit_vs_city(lua_State *L, Unit *punit,
45 Action *paction, City *tgt);
46bool api_edit_perform_action_unit_vs_city_impr(lua_State *L, Unit *punit,
47 Action *paction, City *tgt,
48 Building_Type *sub_tgt);
49bool api_edit_perform_action_unit_vs_city_tech(lua_State *L, Unit *punit,
50 Action *paction, City *tgt,
51 Tech_Type *sub_tgt);
52bool api_edit_perform_action_unit_vs_unit(lua_State *L, Unit *punit,
53 Action *paction, Unit *tgt);
54bool api_edit_perform_action_unit_vs_tile(lua_State *L, Unit *punit,
55 Action *paction, Tile *tgt);
56bool api_edit_perform_action_unit_vs_tile_extra(lua_State *L, Unit *punit,
57 Action *paction, Tile *tgt,
58 const char *sub_tgt);
59bool api_edit_perform_action_unit_vs_self(lua_State *L, Unit *punit,
60 Action *paction);
61
62void api_edit_unit_turn(lua_State *L, Unit *punit, Direction dir);
63
64bool api_edit_unit_upgrade(lua_State *L, Unit *punit, int vet_loss);
65bool api_edit_unit_transform(lua_State *L, Unit *punit, Unit_Type *ptype,
66 int vet_loss);
67
68void api_edit_unit_kill(lua_State *L, Unit *punit, const char *reason,
69 Player *killer);
70
71bool api_edit_change_terrain(lua_State *L, Tile *ptile, Terrain *pterr);
72
73bool api_edit_create_city(lua_State *L, Player *pplayer, Tile *ptile,
74 const char *name);
75void api_edit_remove_city(lua_State *L, City *pcity);
76void api_edit_create_building(lua_State *L, City *pcity, Building_Type *impr);
77void api_edit_remove_building(lua_State *L, City *pcity, Building_Type *impr);
78 Player *api_edit_create_player(lua_State *L, const char *username,
79 Nation_Type *pnation, const char *ai);
80void api_edit_change_gold(lua_State *L, Player *pplayer, int amount);
81 Tech_Type *api_edit_give_technology(lua_State *L, Player *pplayer,
82 Tech_Type *ptech, int cost, bool notify,
83 const char *reason);
84bool api_edit_trait_mod_set(lua_State *L, Player *pplayer,
85 const char *tname, const int mod);
86
87void api_edit_create_owned_extra(lua_State *L, Tile *ptile, const char *name,
88 struct player *pplayer);
89void api_edit_create_extra(lua_State *L, Tile *ptile, const char *name);
90void api_edit_create_base(lua_State *L, Tile *ptile, const char *name,
91 struct player *pplayer);
92void api_edit_create_road(lua_State *L, Tile *ptile, const char *name);
93void api_edit_remove_extra(lua_State *L, Tile *ptile, const char *name);
94
95void api_edit_tile_set_label(lua_State *L, Tile *ptile, const char *label);
96void api_edit_tile_show(lua_State *L, Tile *ptile, Player *pplayer);
97bool api_edit_tile_hide(lua_State *L, Tile *ptile, Player *pplayer);
98
99void api_edit_climate_change(lua_State *L, enum climate_change_type type,
100 int effect);
101 Player *api_edit_civil_war(lua_State *L, Player *pplayer, int probability);
102
103
104void api_edit_player_victory(lua_State *L, Player *pplayer);
105bool api_edit_unit_move(lua_State *L, Unit *punit, Tile *ptile,
106 int movecost,
107 Unit *embark_to, bool allow_disembark,
108 bool conquer_city, bool conquer_extra,
109 bool enter_hut, bool frighten_hut);
110bool api_edit_unit_move_old(lua_State *L, Unit *punit, Tile *ptile,
111 int movecost);
112void api_edit_unit_moving_disallow(lua_State *L, Unit *punit);
113void api_edit_unit_moving_allow(lua_State *L, Unit *punit);
114
115void api_edit_city_add_history(lua_State *L, City *pcity, int amount);
116void api_edit_player_add_history(lua_State *L, Player *pplayer, int amount);
117
118void api_edit_player_give_bulbs(lua_State *L, Player *pplayer, int amount);
119
120#endif /* API_SERVER_EDIT_H */
api_edit_perform_action_unit_vs_tile_extra
bool api_edit_perform_action_unit_vs_tile_extra(lua_State *L, Unit *punit, Action *paction, Tile *tgt, const char *sub_tgt)
Definition api_server_edit.c:496
api_edit_perform_action_unit_vs_tile
bool api_edit_perform_action_unit_vs_tile(lua_State *L, Unit *punit, Action *paction, Tile *tgt)
Definition api_server_edit.c:440
api_edit_climate_change
void api_edit_climate_change(lua_State *L, enum climate_change_type type, int effect)
Definition api_server_edit.c:1056
api_edit_unit_moving_allow
void api_edit_unit_moving_allow(lua_State *L, Unit *punit)
Definition api_server_edit.c:1207
api_edit_remove_city
void api_edit_remove_city(lua_State *L, City *pcity)
Definition api_server_edit.c:701
api_edit_trait_mod_set
bool api_edit_trait_mod_set(lua_State *L, Player *pplayer, const char *tname, const int mod)
Definition api_server_edit.c:902
api_edit_unleash_barbarians
bool api_edit_unleash_barbarians(lua_State *L, Tile *ptile)
Definition api_server_edit.c:102
api_edit_remove_building
void api_edit_remove_building(lua_State *L, City *pcity, Building_Type *impr)
Definition api_server_edit.c:760
api_edit_player_victory
void api_edit_player_victory(lua_State *L, Player *pplayer)
Definition api_server_edit.c:1100
api_edit_create_extra
void api_edit_create_extra(lua_State *L, Tile *ptile, const char *name)
Definition api_server_edit.c:947
api_edit_create_unit
Unit * api_edit_create_unit(lua_State *L, Player *pplayer, Tile *ptile, Unit_Type *ptype, int veteran_level, City *homecity, int moves_left)
Definition api_server_edit.c:129
climate_change_type
climate_change_type
Definition api_server_edit.h:23
CLIMATE_CHANGE_GLOBAL_WARMING
@ CLIMATE_CHANGE_GLOBAL_WARMING
Definition api_server_edit.h:24
CLIMATE_CHANGE_NUCLEAR_WINTER
@ CLIMATE_CHANGE_NUCLEAR_WINTER
Definition api_server_edit.h:25
api_edit_perform_action_unit_vs_unit
bool api_edit_perform_action_unit_vs_unit(lua_State *L, Unit *punit, Action *paction, Unit *tgt)
Definition api_server_edit.c:414
api_edit_player_add_history
void api_edit_player_add_history(lua_State *L, Player *pplayer, int amount)
Definition api_server_edit.c:1231
api_edit_give_technology
Tech_Type * api_edit_give_technology(lua_State *L, Player *pplayer, Tech_Type *ptech, int cost, bool notify, const char *reason)
Definition api_server_edit.c:833
api_edit_perform_action_unit_vs_city_impr
bool api_edit_perform_action_unit_vs_city_impr(lua_State *L, Unit *punit, Action *paction, City *tgt, Building_Type *sub_tgt)
Definition api_server_edit.c:362
api_edit_create_building
void api_edit_create_building(lua_State *L, City *pcity, Building_Type *impr)
Definition api_server_edit.c:712
api_edit_create_unit_full
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)
Definition api_server_edit.c:140
api_edit_player_give_bulbs
void api_edit_player_give_bulbs(lua_State *L, Player *pplayer, int amount)
Definition api_server_edit.c:1242
api_edit_change_terrain
bool api_edit_change_terrain(lua_State *L, Tile *ptile, Terrain *pterr)
Definition api_server_edit.c:651
api_edit_unit_move
bool api_edit_unit_move(lua_State *L, Unit *punit, Tile *ptile, int movecost, Unit *embark_to, bool allow_disembark, bool conquer_city, bool conquer_extra, bool enter_hut, bool frighten_hut)
Definition api_server_edit.c:1111
api_edit_tile_show
void api_edit_tile_show(lua_State *L, Tile *ptile, Player *pplayer)
Definition api_server_edit.c:1010
api_edit_unit_kill
void api_edit_unit_kill(lua_State *L, Unit *punit, const char *reason, Player *killer)
Definition api_server_edit.c:631
api_edit_tile_hide
bool api_edit_tile_hide(lua_State *L, Tile *ptile, Player *pplayer)
Definition api_server_edit.c:1022
api_edit_unit_turn
void api_edit_unit_turn(lua_State *L, Unit *punit, Direction dir)
Definition api_server_edit.c:582
api_edit_place_partisans
void api_edit_place_partisans(lua_State *L, Tile *ptile, Player *pplayer, int count, int sq_radius)
Definition api_server_edit.c:113
api_edit_remove_extra
void api_edit_remove_extra(lua_State *L, Tile *ptile, const char *name)
Definition api_server_edit.c:972
api_edit_create_base
void api_edit_create_base(lua_State *L, Tile *ptile, const char *name, struct player *pplayer)
Definition api_server_edit.c:955
api_edit_tile_set_label
void api_edit_tile_set_label(lua_State *L, Tile *ptile, const char *label)
Definition api_server_edit.c:995
api_edit_create_road
void api_edit_create_road(lua_State *L, Tile *ptile, const char *name)
Definition api_server_edit.c:964
api_edit_unit_move_old
bool api_edit_unit_move_old(lua_State *L, Unit *punit, Tile *ptile, int movecost)
Definition api_server_edit.c:1147
api_edit_perform_action_unit_vs_city
bool api_edit_perform_action_unit_vs_city(lua_State *L, Unit *punit, Action *paction, City *tgt)
Definition api_server_edit.c:338
api_edit_city_add_history
void api_edit_city_add_history(lua_State *L, City *pcity, int amount)
Definition api_server_edit.c:1220
api_edit_create_city
bool api_edit_create_city(lua_State *L, Player *pplayer, Tile *ptile, const char *name)
Definition api_server_edit.c:687
api_edit_unit_teleport
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)
Definition api_server_edit.c:222
api_edit_unit_moving_disallow
void api_edit_unit_moving_disallow(lua_State *L, Unit *punit)
Definition api_server_edit.c:1194
api_edit_unit_teleport_old
bool api_edit_unit_teleport_old(lua_State *L, Unit *punit, Tile *dest)
Definition api_server_edit.c:276
api_edit_unit_upgrade
bool api_edit_unit_upgrade(lua_State *L, Unit *punit, int vet_loss)
Definition api_server_edit.c:600
api_edit_create_owned_extra
void api_edit_create_owned_extra(lua_State *L, Tile *ptile, const char *name, struct player *pplayer)
Definition api_server_edit.c:923
api_edit_perform_action_unit_vs_self
bool api_edit_perform_action_unit_vs_self(lua_State *L, Unit *punit, Action *paction)
Definition api_server_edit.c:558
api_edit_create_player
Player * api_edit_create_player(lua_State *L, const char *username, Nation_Type *pnation, const char *ai)
Definition api_server_edit.c:782
api_edit_unit_transform
bool api_edit_unit_transform(lua_State *L, Unit *punit, Unit_Type *ptype, int vet_loss)
Definition api_server_edit.c:618
api_edit_change_gold
void api_edit_change_gold(lua_State *L, Player *pplayer, int amount)
Definition api_server_edit.c:817
api_edit_civil_war
Player * api_edit_civil_war(lua_State *L, Player *pplayer, int probability)
Definition api_server_edit.c:1071
api_edit_perform_action_unit_vs_city_tech
bool api_edit_perform_action_unit_vs_city_tech(lua_State *L, Unit *punit, Action *paction, City *tgt, Tech_Type *sub_tgt)
Definition api_server_edit.c:388
conquer_city
static void conquer_city(QVariant data1, QVariant data2)
Definition dialogs.cpp:1831
enter_hut
static void enter_hut(QVariant data1, QVariant data2)
Definition dialogs.cpp:2570
frighten_hut
static void frighten_hut(QVariant data1, QVariant data2)
Definition dialogs.cpp:2600
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 * punit
Definition dialogs_g.h:73
cost
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
Definition dialogs_g.h:73
type
GType type
Definition repodlgs.c:1312
name
const char * name
Definition inputfile.c:127
luascript_types.h
Direction
enum direction8 Direction
Definition luascript_types.h:57
action
Definition actions.h:379
advance
Definition tech.h:124
city
Definition city.h:309
effect
Definition effects.h:340
impr_type
Definition improvement.h:68
nation_type
Definition nation.h:97
player
Definition player.h:249
terrain
Definition terrain.h:176
tile
Definition tile.h:49
unit_type
Definition unittype.h:481
unit
Definition unit.h:138
veteran_level
Definition unittype.h:467