1 | /* |
1 | /* |
2 | * This file is part of Crossfire TRT, the Multiplayer Online Role Playing Game. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team |
4 | * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Crossfire TRT is free software; you can redistribute it and/or modify it |
8 | * Deliantra is free software: you can redistribute it and/or modify |
9 | * under the terms of the GNU General Public License as published by the Free |
9 | * it under the terms of the GNU General Public License as published by |
10 | * Software Foundation; either version 2 of the License, or (at your option) |
10 | * the Free Software Foundation, either version 3 of the License, or |
11 | * any later version. |
11 | * (at your option) any later version. |
12 | * |
12 | * |
13 | * This program is distributed in the hope that it will be useful, but |
13 | * This program is distributed in the hope that it will be useful, |
14 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16 | * for more details. |
16 | * GNU General Public License for more details. |
17 | * |
17 | * |
18 | * You should have received a copy of the GNU General Public License along |
18 | * You should have received a copy of the GNU General Public License |
19 | * with Crossfire TRT; if not, write to the Free Software Foundation, Inc. 51 |
19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
20 | * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
|
|
21 | * |
20 | * |
22 | * The authors can be reached via e-mail to <crossfire@schmorp.de> |
21 | * The authors can be reached via e-mail to <support@deliantra.net> |
23 | */ |
22 | */ |
|
|
23 | |
|
|
24 | #ifndef LIBPROTO_H_ |
|
|
25 | #define LIBPROTO_H_ |
24 | |
26 | |
25 | /* anim.c */ |
27 | /* anim.c */ |
26 | extern void free_all_anim(); |
28 | extern void free_all_anim(); |
27 | extern void init_anim(); |
29 | extern void init_anim(); |
28 | extern int find_animation(const char *name); |
30 | extern int find_animation(const char *name); |
… | |
… | |
40 | extern void dump_arch(archetype *at); |
42 | extern void dump_arch(archetype *at); |
41 | extern void dump_all_archetypes(); |
43 | extern void dump_all_archetypes(); |
42 | extern void free_all_archs(); |
44 | extern void free_all_archs(); |
43 | extern void check_generators(); |
45 | extern void check_generators(); |
44 | extern bool load_archetype_file(const char *filename); |
46 | extern bool load_archetype_file(const char *filename); |
45 | extern object *arch_to_object(archetype *at); |
|
|
46 | extern object *create_singularity(const char *name); |
47 | extern object *create_singularity(const char *name); |
47 | extern object *get_archetype(const char *name); |
48 | extern object *get_archetype(const char *name); |
48 | extern unsigned long hasharch(const char *str, int tablesize); |
49 | extern unsigned long hasharch(const char *str, int tablesize); |
49 | extern archetype *type_to_archetype(int type); |
50 | extern archetype *type_to_archetype(int type); |
50 | extern object *clone_arch(int type); |
51 | extern object *clone_arch(int type); |
… | |
… | |
146 | extern void change_exp(object *op, sint64 exp, const char *skill_name, int flag); |
147 | extern void change_exp(object *op, sint64 exp, const char *skill_name, int flag); |
147 | extern void apply_death_exp_penalty(object *op); |
148 | extern void apply_death_exp_penalty(object *op); |
148 | extern int did_make_save(const object *op, int level, int bonus); |
149 | extern int did_make_save(const object *op, int level, int bonus); |
149 | /* los.c */ |
150 | /* los.c */ |
150 | extern void init_block(); |
151 | extern void init_block(); |
151 | extern void clear_los(player *pl); |
|
|
152 | extern int has_carried_lights(const object *op); |
152 | extern int has_carried_lights(const object *op); |
153 | extern void update_los(object *op); |
|
|
154 | extern void update_all_map_los(maptile *map); |
153 | extern void update_all_map_los(maptile *map); |
155 | extern void update_all_los(const maptile *map, int x, int y); |
154 | extern void update_all_los(const maptile *map, int x, int y); |
156 | extern void print_los(object *op); |
|
|
157 | extern void make_sure_seen(const object *op); |
155 | extern void make_sure_seen(const object *op); |
158 | extern void make_sure_not_seen(const object *op); |
156 | extern void make_sure_not_seen(const object *op); |
159 | /* map.c */ |
157 | /* map.c */ |
160 | extern const char *create_pathname (const char *name); |
158 | extern const char *create_pathname (const char *name); |
161 | extern int check_path(const char *name, int prepend_dir); |
|
|
162 | extern int blocked_link(object *ob, maptile *m, int sx, int sy); |
159 | extern int blocked_link(object *ob, maptile *m, int sx, int sy); |
163 | extern void fix_container(object *container); |
160 | extern void fix_container(object *container); |
164 | /* object.c */ |
161 | /* object.c */ |
165 | extern signed long sum_weight(object *op); |
|
|
166 | extern object *object_get_env_recursive(object *op); |
|
|
167 | extern char *dump_object(object *op); |
162 | extern char *dump_object(object *op); |
168 | extern void dump_me(object *op, char *outstr); |
163 | extern void dump_me(object *op, char *outstr); |
169 | extern object *get_nearest_part(object *op, const object *pl); |
164 | extern object *get_nearest_part(object *op, const object *pl); |
170 | extern object *find_object(tag_t i); |
165 | extern object *find_object(tag_t i); |
171 | extern object *find_object_name(const char *str); |
166 | extern object *find_object_name(const char *str); |
172 | extern void free_all_object_data(); |
167 | extern void free_all_object_data(); |
173 | extern void update_turn_face(object *op); |
168 | extern void update_turn_face(object *op); |
174 | extern void update_object(object *op, int action); |
169 | extern void update_object(object *op, int action); |
175 | extern void sub_weight(object *op, signed long weight); |
|
|
176 | extern object *merge_ob(object *op, object *top); |
170 | extern object *merge_ob(object *op, object *top); |
177 | extern object *insert_ob_in_map_at(object *op, maptile *m, object *originator, int flag, int x, int y); |
171 | extern object *insert_ob_in_map_at(object *op, maptile *m, object *originator, int flag, int x, int y); |
178 | extern object *insert_ob_in_map(object *op, maptile *m, object *originator, int flag); |
172 | extern object *insert_ob_in_map(object *op, maptile *m, object *originator, int flag); |
179 | extern void replace_insert_ob_in_map(const char *arch_string, object *op); |
173 | extern void replace_insert_ob_in_map(const char *arch_string, object *op); |
180 | extern object *get_split_ob(object *orig_ob, uint32 nr); |
|
|
181 | extern object *decrease_ob_nr(object *op, uint32 i); |
|
|
182 | extern void add_weight(object *op, signed long weight); |
|
|
183 | extern object *insert_ob_in_ob(object *op, object *where); |
174 | extern object *insert_ob_in_ob(object *op, object *where); |
184 | extern int check_move_on(object *op, object *originator); |
175 | extern int check_move_on(object *op, object *originator); |
185 | extern object *present_arch(const archetype *at, maptile *m, int x, int y); |
176 | extern object *present_arch(const archetype *at, maptile *m, int x, int y); |
186 | extern object *present(unsigned char type, maptile *m, int x, int y); |
177 | extern object *present(unsigned char type, maptile *m, int x, int y); |
187 | extern object *present_in_ob(unsigned char type, const object *op); |
178 | extern object *present_in_ob(unsigned char type, const object *op); |
… | |
… | |
196 | extern int distance(const object *ob1, const object *ob2); |
187 | extern int distance(const object *ob1, const object *ob2); |
197 | extern int find_dir_2(int x, int y); |
188 | extern int find_dir_2(int x, int y); |
198 | extern int dirdiff(int dir1, int dir2); |
189 | extern int dirdiff(int dir1, int dir2); |
199 | extern int can_see_monsterP(maptile *m, int x, int y, int dir); |
190 | extern int can_see_monsterP(maptile *m, int x, int y, int dir); |
200 | extern int can_pick(const object *who, const object *item); |
191 | extern int can_pick(const object *who, const object *item); |
201 | extern object *object_create_clone(object *asrc); |
|
|
202 | extern object *find_obj_by_type_subtype(const object *who, int type, int subtype); |
192 | extern object *find_obj_by_type_subtype(const object *who, int type, int subtype); |
203 | extern key_value *get_ob_key_link(const object *ob, const char *key); |
|
|
204 | extern const char *get_ob_key_value(const object *op, const char *const key); |
|
|
205 | extern int set_ob_key_value_s(object *op, const char *canonical_key, const char *value, int add_key); |
|
|
206 | extern int set_ob_key_value(object *op, const char *key, const char *value, int add_key); |
|
|
207 | /* path.c */ |
193 | /* path.c */ |
208 | extern char *path_combine(const char *src, const char *dst); |
194 | extern char *path_combine(const char *src, const char *dst); |
209 | extern void path_normalize(char *path); |
195 | extern void path_normalize(char *path); |
210 | extern char *path_combine_and_normalize(const char *src, const char *dst); |
196 | extern char *path_combine_and_normalize(const char *src, const char *dst); |
211 | /* porting.c */ |
197 | /* porting.c */ |
… | |
… | |
278 | extern void sleep_delta(); |
264 | extern void sleep_delta(); |
279 | extern void get_tod(timeofday_t *tod); |
265 | extern void get_tod(timeofday_t *tod); |
280 | extern void print_tod(object *op); |
266 | extern void print_tod(object *op); |
281 | extern void time_info(object *op); |
267 | extern void time_info(object *op); |
282 | /* treasure.c */ |
268 | /* treasure.c */ |
283 | extern void init_archetype_pointers(); |
|
|
284 | extern bool load_treasure_file(const char *filename); |
269 | extern bool load_treasure_file(const char *filename); |
285 | extern object *generate_treasure(treasurelist *t, int difficulty); |
270 | extern object *generate_treasure(treasurelist *t, int difficulty); |
286 | extern int level_for_item(const object *op, int difficulty); |
271 | extern int level_for_item(const object *op, int difficulty); |
287 | extern int magic_from_difficulty(int difficulty); |
272 | extern int magic_from_difficulty(int difficulty); |
288 | extern void set_abs_magic(object *op, int magic); |
273 | extern void set_abs_magic(object *op, int magic); |
… | |
… | |
306 | extern void free_all_treasures(); |
291 | extern void free_all_treasures(); |
307 | /* utils.c */ |
292 | /* utils.c */ |
308 | extern int random_roll(int min, int max, const object *op, int goodbad); |
293 | extern int random_roll(int min, int max, const object *op, int goodbad); |
309 | extern sint64 random_roll64(sint64 min, sint64 max, const object *op, int goodbad); |
294 | extern sint64 random_roll64(sint64 min, sint64 max, const object *op, int goodbad); |
310 | extern int die_roll(int num, int size, const object *op, int goodbad); |
295 | extern int die_roll(int num, int size, const object *op, int goodbad); |
311 | extern materialtype_t *name_to_material (const shstr &name); |
296 | extern materialtype_t *name_to_material (const shstr_cmp name); |
312 | extern void transmute_materialname(object *op, const object *change); |
297 | extern void transmute_materialname(object *op, const object *change); |
313 | extern void set_materialname(object *op, int difficulty, materialtype_t *nmt); |
298 | extern void set_materialname(object *op, int difficulty, materialtype_t *nmt); |
314 | extern void strip_media_tag(char *message); |
299 | extern void strip_media_tag(char *message); |
315 | extern const char *strrstr(const char *haystack, const char *needle); |
300 | extern const char *strrstr(const char *haystack, const char *needle); |
316 | extern void strip_endline(char *buf); |
301 | extern void strip_endline(char *buf); |
… | |
… | |
318 | extern void make_list_like(char *input); |
303 | extern void make_list_like(char *input); |
319 | /* loader.c */ |
304 | /* loader.c */ |
320 | extern int set_variable(object *op, char *buf); |
305 | extern int set_variable(object *op, char *buf); |
321 | extern void init_vars(); |
306 | extern void init_vars(); |
322 | extern char *get_ob_diff(object *op, object *op2); |
307 | extern char *get_ob_diff(object *op, object *op2); |
|
|
308 | /* map.c */ |
|
|
309 | extern maptile *find_style (const char *dirname, const char *stylename, int difficulty); |
|
|
310 | extern object *pick_random_object (maptile *style); |
|
|
311 | |
|
|
312 | /* former funcpoint.h */ |
|
|
313 | /* |
|
|
314 | * These function-pointers are defined in common/glue.c |
|
|
315 | * The functions used to set and initialise them are also there. |
|
|
316 | * |
|
|
317 | * Massive change. Those functions are just defined, no callback, and they should be implemented. |
|
|
318 | * This means glue.c code & such can go away almost entirely. |
|
|
319 | * Ryo 2005-07-15 |
|
|
320 | */ |
|
|
321 | |
|
|
322 | extern void move_apply(object *, object *, object *); |
|
|
323 | extern void draw_info(int, int, object *, const char *); |
|
|
324 | extern void clean_tmp_files(void); |
|
|
325 | extern void fix_auto_apply(maptile *); |
|
|
326 | extern void init_blocksview_players(void); |
|
|
327 | extern void monster_check_apply(object *, object *); |
|
|
328 | extern void process_active_maps(void); |
|
|
329 | extern void remove_friendly_object(object *); |
|
|
330 | extern void update_buttons(maptile *); |
|
|
331 | extern void move_teleporter(object *); |
|
|
332 | extern void move_firewall(object *); |
|
|
333 | extern void move_creator(object *); |
|
|
334 | extern void move_marker(object *); |
|
|
335 | extern void move_duplicator(object *); |
|
|
336 | extern void trap_adjust(object *, int); |
|
|
337 | extern void esrv_send_item(object *, object *); |
|
|
338 | extern void esrv_del_item(player *, int); |
|
|
339 | extern void esrv_update_item(int, object *, object *); |
|
|
340 | extern void esrv_update_spells(player *); |
|
|
341 | extern void set_darkness_map(maptile *m); |
|
|
342 | extern void dragon_ability_gain(object *, int, int); |
|
|
343 | extern void weather_effect(const char *); |
|
|
344 | extern object * find_skill_by_number(object *, int); |
|
|
345 | |
|
|
346 | #endif |
|
|
347 | |