00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef ADIKT_LEVTHINGS_H
00022 #define ADIKT_LEVTHINGS_H
00023
00024 struct LEVEL;
00025 struct IPOINT_2D;
00026
00027 #include "globals.h"
00028
00029 typedef void (*cr_tng_func)(struct LEVEL *lvl, const int tx, const int ty,
00030 const unsigned char *surr_slb,const unsigned char *surr_own,const struct UPOINT_2D corner_pos);
00031
00032 DLLIMPORT short things_verify(struct LEVEL *lvl, char *err_msg,struct IPOINT_2D *errpt);
00033
00034 DLLIMPORT char *get_search_tngtype_name(unsigned short idx);
00035 DLLIMPORT is_thing_subtype get_search_tngtype_func(unsigned short idx);
00036 DLLIMPORT char *get_search_objtype_name(unsigned short idx);
00037 DLLIMPORT unsigned short get_search_objtype_count(void);
00038 DLLIMPORT unsigned char *find_next_object_on_map(struct LEVEL *lvl, int *tx, int *ty, unsigned short srch_idx);
00039 DLLIMPORT short subtl_in_effectgen_range(struct LEVEL *lvl,unsigned int sx,unsigned int sy);
00040
00041 DLLIMPORT long get_nearest_thing_idx(struct LEVEL *lvl,
00042 const unsigned int ssx,const unsigned int ssy,
00043 unsigned int *sx,unsigned int *sy,unsigned int *num);
00044 DLLIMPORT long get_nearest_object_idx(struct LEVEL *lvl,
00045 const unsigned int ssx,const unsigned int ssy,
00046 unsigned int *sx,unsigned int *sy,unsigned int *z);
00047
00048 DLLIMPORT unsigned char *create_door(struct LEVEL *lvl, unsigned int sx, unsigned int sy, unsigned char stype_idx);
00049 DLLIMPORT unsigned char *create_effectgen(const struct LEVEL *lvl,unsigned int sx, unsigned int sy, unsigned char stype_idx);
00050 DLLIMPORT unsigned char *create_creature(const struct LEVEL *lvl,unsigned int sx, unsigned int sy, unsigned char stype_idx);
00051 DLLIMPORT unsigned char *create_trap(const struct LEVEL *lvl,unsigned int sx, unsigned int sy, unsigned char stype_idx);
00052 DLLIMPORT unsigned char *create_item_adv(const struct LEVEL *lvl, unsigned int sx, unsigned int sy, unsigned char stype_idx);
00053
00054
00055 DLLIMPORT unsigned char *create_torch(const struct LEVEL *lvl, unsigned int sx, unsigned int sy, unsigned char stype_idx);
00056 DLLIMPORT unsigned char *create_doorkey(const struct LEVEL *lvl, unsigned int sx, unsigned int sy, unsigned char stype_idx);
00057
00058 DLLIMPORT short set_door_lock(struct LEVEL *lvl, unsigned char *thing, unsigned char nlock);
00059 DLLIMPORT unsigned char get_door_lock(const unsigned char *thing);
00060 DLLIMPORT unsigned char compute_door_orientation(const struct LEVEL *lvl, unsigned char *thing);
00061 DLLIMPORT unsigned short compute_torch_sensitile(const struct LEVEL *lvl, unsigned char *thing);
00062 DLLIMPORT unsigned short compute_effectgen_sensitile(const struct LEVEL *lvl, unsigned char *thing);
00063 DLLIMPORT unsigned short compute_item_sensitile(const struct LEVEL *lvl, unsigned char *thing);
00064 DLLIMPORT unsigned short get_free_indexedthing_number(const struct LEVEL *lvl);
00065 DLLIMPORT short owned_things_count(int *count,struct LEVEL *lvl,
00066 unsigned char type_idx,unsigned char stype_idx);
00067 DLLIMPORT unsigned char *find_lit_thing_on_square_radius1(struct LEVEL *lvl, int tx, int ty);
00068 DLLIMPORT unsigned char *find_thing_on_tile(struct LEVEL *lvl, int tx, int ty, is_thing_subtype check_func);
00069 DLLIMPORT unsigned char *find_next_thing_on_map(struct LEVEL *lvl, int *tx, int *ty, is_thing_subtype check_func);
00070 DLLIMPORT unsigned char *find_next_actnpt_on_map(struct LEVEL *lvl, int *tx, int *ty);
00071 DLLIMPORT unsigned char *find_next_stlight_on_map(struct LEVEL *lvl, int *tx, int *ty);
00072
00073 DLLIMPORT unsigned short get_free_herogate_number(const struct LEVEL *lvl);
00074 DLLIMPORT unsigned short get_free_herogate_number_next(const struct LEVEL *lvl,const unsigned short start);
00075 DLLIMPORT unsigned short get_free_herogate_number_prev(const struct LEVEL *lvl,const unsigned short start);
00076 DLLIMPORT short create_herogate_number_used_arr(const struct LEVEL *lvl,unsigned char **used,unsigned int *used_size);
00077
00078
00079 DLLIMPORT void update_obj_for_square(struct LEVEL *lvl, int tx_first, int tx_last,
00080 int ty_first, int ty_last);
00081 DLLIMPORT void update_obj_for_square_radius1(struct LEVEL *lvl, int tx, int ty);
00082 DLLIMPORT void update_obj_for_whole_map(struct LEVEL *lvl);
00083 DLLIMPORT void update_clmaffective_obj_for_slab(struct LEVEL *lvl, int tx, int ty);
00084 DLLIMPORT void remove_misplaced_objs_on_slab(struct LEVEL *lvl, int tx, int ty);
00085 DLLIMPORT void update_room_things_on_slab(struct LEVEL *lvl, int tx, int ty);
00086 DLLIMPORT void update_door_things_on_slab(struct LEVEL *lvl, int tx, int ty);
00087 DLLIMPORT void update_torch_things_near_slab(struct LEVEL *lvl, int tx, int ty);
00088
00089
00090 DLLIMPORT void update_obj_subpos_and_height_for_whole_map(struct LEVEL *lvl);
00091 DLLIMPORT void update_obj_subpos_and_height_for_square_radius1(struct LEVEL *lvl, int tx, int ty);
00092 DLLIMPORT void update_obj_subpos_and_height_for_square(struct LEVEL *lvl, int tx_first, int tx_last,
00093 int ty_first, int ty_last);
00094 DLLIMPORT short update_things_subpos_and_height_for_slab(struct LEVEL *lvl, int tx, int ty);
00095 DLLIMPORT short update_thing_subpos_and_height(unsigned short *clm_height,unsigned char *thing);
00096 DLLIMPORT void remove_automade_obj_for_whole_map(struct LEVEL *lvl);
00097 DLLIMPORT void remove_automade_obj_for_slab(struct LEVEL *lvl, int tx, int ty);
00098
00099
00100 DLLIMPORT void create_things_slb_room(cr_tng_func cr_floor,cr_tng_func cr_edge,
00101 cr_tng_func cr_corner,cr_tng_func cr_inside,cr_tng_func cr_nearinsd,
00102 struct LEVEL *lvl, int tx, int ty);
00103 DLLIMPORT void create_things_slb_room_simple(cr_tng_func cr_any,
00104 struct LEVEL *lvl, int tx, int ty);
00105 DLLIMPORT void delete_room_things(struct LEVEL *lvl, const int tx, const int ty,
00106 const unsigned char *surr_slb,const unsigned char *surr_own,
00107 const struct UPOINT_2D corner_pos);
00108 DLLIMPORT void delete_room_things_subtl(struct LEVEL *lvl, int sx, int sy);
00109 unsigned char *update_thing_slb_room_one_central_item(struct LEVEL *lvl, int tx, int ty,
00110 unsigned char itm_stype_idx,short allow_create);
00111 unsigned char *update_thing_slb_room_one_item_subtl(struct LEVEL *lvl, int sx, int sy,
00112 unsigned char itm_stype_idx, short torch_mode);
00113 void update_things_slb_portal_inside(struct LEVEL *lvl, const int tx, const int ty,
00114 const unsigned char *surr_slb,const unsigned char *surr_own,
00115 const struct UPOINT_2D corner_pos);
00116 void update_things_slb_treasure_corner(struct LEVEL *lvl, const int tx, const int ty,
00117 const unsigned char *surr_slb,const unsigned char *surr_own,
00118 const struct UPOINT_2D corner_pos);
00119 void update_things_slb_training_inside(struct LEVEL *lvl, const int tx, const int ty,
00120 const unsigned char *surr_slb,const unsigned char *surr_own,
00121 const struct UPOINT_2D corner_pos);
00122 void update_things_slb_scavenger_inside(struct LEVEL *lvl, const int tx, const int ty,
00123 const unsigned char *surr_slb,const unsigned char *surr_own,
00124 const struct UPOINT_2D corner_pos);
00125 void update_things_slb_graveyard_floor(struct LEVEL *lvl, const int tx, const int ty,
00126 const unsigned char *surr_slb,const unsigned char *surr_own,
00127 const struct UPOINT_2D corner_pos);
00128 void update_things_slb_graveyard_corner(struct LEVEL *lvl, const int tx, const int ty,
00129 const unsigned char *surr_slb,const unsigned char *surr_own,
00130 const struct UPOINT_2D corner_pos);
00131 void update_things_slb_workshop_inside(struct LEVEL *lvl, const int tx, const int ty,
00132 const unsigned char *surr_slb,const unsigned char *surr_own,
00133 const struct UPOINT_2D corner_pos);
00134 void update_things_slb_torture_inside(struct LEVEL *lvl, const int tx, const int ty,
00135 const unsigned char *surr_slb,const unsigned char *surr_own,
00136 const struct UPOINT_2D corner_pos);
00137 void update_things_slb_torture_edge(struct LEVEL *lvl, const int tx, const int ty,
00138 const unsigned char *surr_slb,const unsigned char *surr_own,
00139 const struct UPOINT_2D corner_pos);
00140 void update_things_slb_training_corner(struct LEVEL *lvl, const int tx, const int ty,
00141 const unsigned char *surr_slb,const unsigned char *surr_own,
00142 const struct UPOINT_2D corner_pos);
00143 void update_things_slb_scavenger_corner(struct LEVEL *lvl, const int tx, const int ty,
00144 const unsigned char *surr_slb,const unsigned char *surr_own,
00145 const struct UPOINT_2D corner_pos);
00146 void update_things_slb_hatchery_corner(struct LEVEL *lvl, const int tx, const int ty,
00147 const unsigned char *surr_slb,const unsigned char *surr_own,
00148 const struct UPOINT_2D corner_pos);
00149 void update_things_slb_barracks_corner(struct LEVEL *lvl, const int tx, const int ty,
00150 const unsigned char *surr_slb,const unsigned char *surr_own,
00151 const struct UPOINT_2D corner_pos);
00152 void update_things_slb_temple_corner(struct LEVEL *lvl, const int tx, const int ty,
00153 const unsigned char *surr_slb,const unsigned char *surr_own,
00154 const struct UPOINT_2D corner_pos);
00155 void update_things_slb_workshop_corner(struct LEVEL *lvl, const int tx, const int ty,
00156 const unsigned char *surr_slb,const unsigned char *surr_own,
00157 const struct UPOINT_2D corner_pos);
00158 void update_things_slb_dungheart_corner(struct LEVEL *lvl, const int tx, const int ty,
00159 const unsigned char *surr_slb,const unsigned char *surr_own,
00160 const struct UPOINT_2D corner_pos);
00161 void update_things_slb_dungheart_inside(struct LEVEL *lvl, const int tx, const int ty,
00162 const unsigned char *surr_slb,const unsigned char *surr_own,
00163 const struct UPOINT_2D corner_pos);
00164 void update_things_slb_guardpost_floor(struct LEVEL *lvl, const int tx, const int ty,
00165 const unsigned char *surr_slb,const unsigned char *surr_own,
00166 const struct UPOINT_2D corner_pos);
00167 void update_things_slb_prison(struct LEVEL *lvl, const int tx, const int ty,
00168 const unsigned char *surr_slb,const unsigned char *surr_own,
00169 const struct UPOINT_2D corner_pos);
00170
00171 DLLIMPORT void remove_noncrucial_room_things(struct LEVEL *lvl, int tx, int ty);
00172
00173
00174 #endif // ADIKT_LEVTHINGS_H