--- deliantra/server/include/libproto.h 2007/04/19 16:23:47 1.46 +++ deliantra/server/include/libproto.h 2009/01/08 03:03:24 1.69 @@ -1,3 +1,29 @@ +/* + * This file is part of Deliantra, the Roguelike Realtime MMORPG. + * + * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team + * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team + * Copyright (©) 1992,2007 Frank Tore Johansen + * + * Deliantra is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * The authors can be reached via e-mail to + */ + +#ifndef LIBPROTO_H_ +#define LIBPROTO_H_ + /* anim.c */ extern void free_all_anim(); extern void init_anim(); @@ -18,7 +44,6 @@ extern void free_all_archs(); extern void check_generators(); extern bool load_archetype_file(const char *filename); -extern object *arch_to_object(archetype *at); extern object *create_singularity(const char *name); extern object *get_archetype(const char *name); extern unsigned long hasharch(const char *str, int tablesize); @@ -27,18 +52,13 @@ extern object *object_create_arch(archetype *at); /* button.c */ extern void push_button(object *op); -extern void activate_connection (maptile *map, long connection, bool state = true); extern void update_button(object *op); -extern oblinkpt *get_connection_links (maptile *map, long connection); extern void use_trigger(object *op); extern void animate_turning(object *op); extern int check_altar_sacrifice(const object *altar, const object *sacrifice); extern int operate_altar(object *altar, object **sacrifice); extern void trigger_move(object *op, int state); extern int check_trigger(object *op, object *cause); -extern void add_button_link(object *button, maptile *map, int connected); -extern void remove_button_link(object *op); -extern oblinkpt *get_button_links(const object *button); extern int get_button_value(const object *button); extern void do_mood_floor(object *op, object *source = 0); extern object *check_inv_recursive(object *op, const object *trig); @@ -107,9 +127,7 @@ extern void free_objectlink(objectlink *ol); extern void free_objectlinkpt(oblinkpt *obp); /* living.c */ -extern void set_attr_value(living *stats, int attr, sint8 value); extern void change_attr_value(living *stats, int attr, sint8 value); -extern sint8 get_attr_value(const living *stats, int attr); extern void check_stat_bounds(living *stats); extern int change_abil(object *op, object *tmp); extern int allowed_class(const object *op); @@ -126,22 +144,15 @@ extern int did_make_save(const object *op, int level, int bonus); /* los.c */ extern void init_block(); -extern void clear_los(object *op); -extern int has_carried_lights(const object *op); -extern void update_los(object *op); extern void update_all_map_los(maptile *map); extern void update_all_los(const maptile *map, int x, int y); -extern void print_los(object *op); extern void make_sure_seen(const object *op); extern void make_sure_not_seen(const object *op); /* map.c */ extern const char *create_pathname (const char *name); -extern int check_path(const char *name, int prepend_dir); extern int blocked_link(object *ob, maptile *m, int sx, int sy); extern void fix_container(object *container); /* object.c */ -extern signed long sum_weight(object *op); -extern object *object_get_env_recursive(object *op); extern char *dump_object(object *op); extern void dump_me(object *op, char *outstr); extern object *get_nearest_part(object *op, const object *pl); @@ -150,14 +161,10 @@ extern void free_all_object_data(); extern void update_turn_face(object *op); extern void update_object(object *op, int action); -extern void sub_weight(object *op, signed long weight); extern object *merge_ob(object *op, object *top); extern object *insert_ob_in_map_at(object *op, maptile *m, object *originator, int flag, int x, int y); extern object *insert_ob_in_map(object *op, maptile *m, object *originator, int flag); -extern void replace_insert_ob_in_map(const char *arch_string, object *op); -extern object *get_split_ob(object *orig_ob, uint32 nr); -extern object *decrease_ob_nr(object *op, uint32 i); -extern void add_weight(object *op, signed long weight); +extern void replace_insert_ob_in_map(shstr_tmp archname, object *op); extern object *insert_ob_in_ob(object *op, object *where); extern int check_move_on(object *op, object *originator); extern object *present_arch(const archetype *at, maptile *m, int x, int y); @@ -167,7 +174,6 @@ extern object *present_arch_in_ob(const archetype *at, const object *op); extern void flag_inv(object *op, int flag); extern void unflag_inv(object *op, int flag); -extern void set_cheat(object *op); extern int find_free_spot(const object *ob, maptile *m, int x, int y, int start, int stop); extern int find_first_free_spot(const object *ob, maptile *m, int x, int y); extern void get_search_arr(int *search_arr); @@ -177,12 +183,7 @@ extern int dirdiff(int dir1, int dir2); extern int can_see_monsterP(maptile *m, int x, int y, int dir); extern int can_pick(const object *who, const object *item); -extern object *object_create_clone(object *asrc); extern object *find_obj_by_type_subtype(const object *who, int type, int subtype); -extern key_value *get_ob_key_link(const object *ob, const char *key); -extern const char *get_ob_key_value(const object *op, const char *const key); -extern int set_ob_key_value_s(object *op, const char *canonical_key, const char *value, int add_key); -extern int set_ob_key_value(object *op, const char *key, const char *value, int add_key); /* path.c */ extern char *path_combine(const char *src, const char *dst); extern void path_normalize(char *path); @@ -259,7 +260,6 @@ extern void print_tod(object *op); extern void time_info(object *op); /* treasure.c */ -extern void init_archetype_pointers(); extern bool load_treasure_file(const char *filename); extern object *generate_treasure(treasurelist *t, int difficulty); extern int level_for_item(const object *op, int difficulty); @@ -287,7 +287,7 @@ extern int random_roll(int min, int max, const object *op, int goodbad); extern sint64 random_roll64(sint64 min, sint64 max, const object *op, int goodbad); extern int die_roll(int num, int size, const object *op, int goodbad); -extern materialtype_t *name_to_material (const shstr &name); +extern materialtype_t *name_to_material (const shstr_cmp name); extern void transmute_materialname(object *op, const object *change); extern void set_materialname(object *op, int difficulty, materialtype_t *nmt); extern void strip_media_tag(char *message); @@ -299,3 +299,43 @@ extern int set_variable(object *op, char *buf); extern void init_vars(); extern char *get_ob_diff(object *op, object *op2); +/* map.c */ +extern maptile *find_style (const char *dirname, const char *stylename, int difficulty); +extern object *pick_random_object (maptile *style); + +/* former funcpoint.h */ +/* + * These function-pointers are defined in common/glue.c + * The functions used to set and initialise them are also there. + * + * Massive change. Those functions are just defined, no callback, and they should be implemented. + * This means glue.c code & such can go away almost entirely. + * Ryo 2005-07-15 + */ + +extern void move_apply(object *, object *, object *); +extern void draw_info(int, int, object *, const char *); +extern void clean_tmp_files(void); +extern void fix_auto_apply(maptile *); +extern void init_blocksview_players(void); +extern void monster_check_apply(object *, object *); +extern void process_active_maps(void); +extern void remove_friendly_object(object *); +extern void update_buttons(maptile *); +extern void move_teleporter(object *); +extern void move_firewall(object *); +extern void move_creator(object *); +extern void move_marker(object *); +extern void move_duplicator(object *); +extern void trap_adjust(object *, int); +extern void esrv_send_item(object *, object *); +extern void esrv_del_item(player *, int); +extern void esrv_update_item(int, object *, object *); +extern void esrv_update_spells(player *); +extern void set_darkness_map(maptile *m); +extern void dragon_ability_gain(object *, int, int); +extern void weather_effect(const char *); +extern object * find_skill_by_number(object *, int); + +#endif +