Crossfire Server, Trunk  1.75.0
libproto.h
Go to the documentation of this file.
1 #include "bufferreader.h"
2 /* anim.cpp */
3 extern Animations *find_animation(const char *name);
4 extern Animations *try_find_animation(const char *name);
5 extern void animate_object(object *op, int dir);
6 extern void apply_anim_suffix(object *who, const char *suffix);
7 extern void dump_animations(void);
8 extern void animation_load_block(FILE *file, const char *full_path, const char *animation_name);
9 /* arch.cpp */
14 object *create_archetype_by_object_name(const char *name);
15 void dump_arch(archetype *at, StringBuffer *sb);
16 void dump_all_archetypes(void);
17 void free_arch(archetype *at);
19 object *arch_to_object(archetype *at);
20 object *create_singularity(const char *name);
21 object *create_archetype(const char *name);
22 archetype *try_find_archetype(const char *name);
23 archetype *find_archetype(const char *name);
24 object *object_create_arch(archetype *at);
26 void first_arch_pass(FILE *fp, const char *filename);
27 /* arch_types_valid.cpp */
28 extern int is_type_valid(uint8_t type);
29 /* artifact.cpp */
31 extern artifact *get_empty_artifact(void);
32 extern void free_all_artifacts(void);
33 extern void generate_artifact(object *op, int difficulty);
34 extern void artifact_compute_chance_for_item(const object *op, const artifact *art, int *numerator, int *denominator);
35 extern void give_artifact_abilities(object *op, const object *artifact);
36 extern int legal_artifact_combination(const object *op, const artifact *art);
37 extern void add_abilities(object *op, const object *change);
39 extern const artifact *find_artifact(const object *op, const char *name);
40 extern void dump_artifacts(void);
41 extern uint16_t artifact_get_face(const artifact *art);
42 /* button.cpp */
43 extern void trigger_connected(objectlink *ol, object *cause, const int state);
44 extern void push_button(object *op);
45 extern void update_button(object *op);
46 extern void update_buttons(mapstruct *m);
47 extern void use_trigger(object *op);
48 extern void animate_turning(object *op);
49 extern int check_altar_sacrifice(const object *altar, const object *sacrifice, int remove_others, int *toremove);
50 extern int operate_altar(object *altar, object **sacrifice);
51 extern int check_trigger(object *op, object *cause);
52 extern void add_button_link(object *button, mapstruct *map, int connected);
53 extern void remove_button_link(object *op);
54 extern int get_button_value(const object *button);
55 extern object *check_inv_recursive(object *op, const object *trig);
56 extern void check_inv(object *op, object *trig);
57 /* dialog.cpp */
58 extern void free_dialog_information(object *op);
59 extern int get_dialog_message(object *op, const char *text, struct_dialog_message **message, struct_dialog_reply **reply);
60 /* exp.cpp */
61 extern int64_t new_exp(const object *ob);
62 extern int has_ability(const object *ob);
63 extern void init_experience(void);
64 extern void dump_experience(void);
65 extern void free_experience(void);
66 /* friend.cpp */
67 extern void add_friendly_object(object *op);
68 extern void remove_friendly_object(object *op);
69 extern void dump_friendly_objects(void);
70 extern void clean_friendly_list(void);
71 extern int is_friendly(const object *op);
72 extern objectlink *get_friends_of(const object *owner);
73 extern void clear_friendly_list(void);
74 extern object *get_next_friend(object *current);
75 /* glue.cpp */
76 extern void fatal(enum fatal_error err) __attribute__ ((noreturn));
77 /* holy.cpp */
78 extern void init_gods(void);
79 extern const object *get_rand_god(void);
80 extern int describe_god(const object *god, int what, StringBuffer *buf, size_t maxlen);
81 extern void free_all_god(void);
82 extern void dump_gods(void);
83 extern const object *find_god(const char *name);
84 extern const char *get_god_for_race(const char *race);
85 /* info.cpp */
86 extern void dump_abilities(void);
87 extern void print_monsters(void);
88 /* image.cpp */
89 extern int find_smooth(const Face *face, const Face **smoothed);
90 extern int is_valid_faceset(int fsn);
91 extern int get_face_fallback(int faceset, uint16_t imageno);
92 extern size_t get_faces_count(void);
93 extern const Face *get_face_by_id(uint16_t id);
94 extern int load_face_file(FILE *file, const char *full_path);
95 extern int load_png_file(FILE *file, const char *full_path);
96 extern void load_image_info(FILE *file, const char *filename);
97 extern const Face *find_face(const char *name);
98 extern const Face *try_find_face(const char *name, const Face *error);
99 extern uint8_t find_color(const char *name);
100 extern const char *get_colorname(uint8_t index);
101 extern void dump_faces(void);
102 /* init.cpp */
103 extern void init_library(void);
104 extern void init_globals(void);
105 extern void free_globals(void);
106 extern void init_objects(void);
107 extern void write_todclock(void);
108 extern void init_attackmess(BufferReader *reader, const char *filename);
109 /* item.cpp */
110 extern int get_power_from_ench(int ench);
111 extern int calc_item_power(const object *op);
112 extern const typedata *get_typedata(int itemtype);
113 extern const typedata *get_typedata_by_name(const char *name);
114 extern StringBuffer *describe_resistance(const object *op, int newline, int use_media_tags, StringBuffer *buf);
115 extern void query_weight(const object *op, char *buf, size_t size);
116 extern void get_levelnumber(int i, char *buf, size_t size);
117 extern void query_short_name(const object *op, char *buf, size_t size);
118 extern void query_name(const object *op, char *buf, size_t size);
119 extern void query_base_name(const object *op, int plural, char *buf, size_t size);
120 extern StringBuffer *describe_monster(const object *op, int use_media_tags, StringBuffer *buf);
121 extern StringBuffer *describe_item(const object *op, const object *owner, int use_media_tags, StringBuffer *buf);
122 extern int is_magical(const object *op);
123 extern int is_identifiable_type(const object *op);
124 extern int is_identified(const object *op);
125 extern void object_give_identified_properties(object *op);
126 extern object *identify(object *op);
127 /* languages.cpp */
128 extern const char *i18n(const object *who, const char *code);
129 extern language_t i18n_find_language_by_code(const char *code);
130 extern language_t i18n_get_language_by_code(const char *code);
131 extern sstring i18n_get_language_code(language_t language);
132 extern void i18n_list_languages(object *who);
133 extern void i18n_init(void);
134 extern void i18n_free(void);
135 /* links.cpp */
136 extern objectlink *get_objectlink(void);
137 extern oblinkpt *get_objectlinkpt(void);
138 extern void free_objectlink(objectlink *ol);
139 extern void free_objectlinkpt(oblinkpt *obp);
140 /* living.cpp */
141 extern void set_attr_value(living *stats, int attr, int8_t value);
142 extern void change_attr_value(living *stats, int attr, int8_t value);
143 extern int8_t get_attr_value(const living *stats, int attr);
144 extern void check_stat_bounds(living *stats, int8_t min_stat, int8_t max_stat);
145 extern int change_abil(object *op, object *tmp);
146 extern void drain_stat(object *op);
147 extern void drain_specific_stat(object *op, int deplete_stats);
148 extern int remove_depletion(object *op, int level);
149 extern void change_luck(object *op, int value);
150 extern void remove_statbonus(object *op);
151 extern void add_statbonus(object *op);
152 extern void fix_object(object *op);
153 extern int allowed_class(const object *op);
154 extern void set_dragon_name(object *pl, const object *abil, const object *skin);
155 extern object *give_skill_by_name(object *op, const char *skill_name);
156 extern void player_lvl_adj(object *who, object *op);
157 extern int64_t level_exp(int level, double expmul);
158 extern int exp_level(int64_t exp);
159 extern void calc_perm_exp(object *op);
160 extern int64_t check_exp_loss(const object *op, int64_t exp);
161 extern int64_t check_exp_adjust(const object *op, int64_t exp);
162 extern void change_exp(object *op, int64_t exp, const char *skill_name, int flag);
163 extern void apply_death_exp_penalty(object *op);
164 extern int did_make_save(const object *op, int level, int bonus);
165 extern void share_exp(object *op, int64_t exp, const char *skill, int flag);
166 extern int get_cha_bonus(int stat);
167 extern int get_dex_bonus(int stat);
168 extern int get_thaco_bonus(int stat);
169 extern uint32_t get_weight_limit(int stat);
170 extern int get_learn_spell(int stat);
171 extern int get_cleric_chance(int stat);
172 extern int get_turn_bonus(int stat);
173 extern int get_dam_bonus(int stat);
174 extern float get_speed_bonus(int stat);
175 extern int get_fear_bonus(int stat);
176 extern void init_stats();
177 extern void dump_stat_bonuses();
178 /* logger.cpp */
179 extern void LOG(LogLevel logLevel, const char *format, ...) PRINTF_ARGS(2, 3);
180 /* los.cpp */
181 extern void init_block(void);
182 extern void clear_los(player *pl);
183 extern int has_carried_lights(const object *op);
184 extern void update_los(object *op);
185 extern void update_all_map_los(mapstruct *map);
186 extern void update_all_los(const mapstruct *map, int x, int y);
187 extern void print_los(object *op);
188 extern void make_sure_seen(const object *op);
189 extern void make_sure_not_seen(const object *op);
190 /* map.cpp */
191 extern mapstruct *has_been_loaded(const char *name);
192 extern char *create_pathname(const char *name, char *buf, size_t size);
193 extern void create_overlay_pathname(const char *name, char *buf, size_t size);
194 extern void create_template_pathname(const char *name, char *buf, size_t size);
195 extern int check_path(const char *name, int prepend_dir);
196 extern void dump_map(const mapstruct *m);
197 extern void dump_all_maps(void);
198 extern int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny);
199 extern int blocked_link(object *ob, mapstruct *m, int16_t sx, int16_t sy);
200 extern int ob_blocked(const object *ob, mapstruct *m, int16_t x, int16_t y);
201 extern mapstruct *get_linked_map(void);
202 extern mapstruct *get_empty_map(int sizex, int sizey);
203 extern mapstruct *mapfile_load(const char *map, int flags);
204 extern int save_map(mapstruct *m, int flag);
205 extern void clean_object(object *op);
206 extern void free_map(mapstruct *m);
207 extern void delete_map(mapstruct *m);
208 extern mapstruct *ready_map_name(const char *name, int flags);
209 extern int calculate_difficulty(mapstruct *m);
210 extern void clean_tmp_map(mapstruct *m);
211 extern void free_all_maps(void);
212 extern int change_map_light(mapstruct *m, int change);
213 extern void update_position(mapstruct *m, int x, int y);
214 extern void set_map_reset_time(mapstruct *map);
215 extern int out_of_map(mapstruct *m, int x, int y);
216 extern mapstruct *get_map_from_coord(mapstruct *m, int16_t *x, int16_t *y);
217 extern int get_rangevector(object *op1, const object *op2, rv_vector *retval, int flags);
218 extern int get_rangevector_from_mapcoord(const mapstruct *m, int x, int y, const object *op2, rv_vector *retval);
219 extern int on_same_map(const object *op1, const object *op2);
220 extern object *map_find_by_flag(mapstruct *map, int x, int y, int flag);
221 extern void map_remove_unique_files(const mapstruct *map);
222 extern const char *map_get_path(const object *item);
223 /* ob_methods.cpp */
224 extern method_ret ob_apply(object *op, object *applier, int aflags);
225 extern method_ret ob_process(object *op);
226 extern char *ob_describe(const object *op, const object *observer, int use_media_tags, char *buf, size_t size);
227 extern method_ret ob_move_on(object *op, object *victim, object *originator);
228 extern method_ret ob_trigger(object *op, object *cause, int state);
229 /* ob_types.cpp */
230 extern void init_ob_method_struct(ob_methods *methods, ob_methods *fallback);
231 extern void init_ob_types(ob_methods *base_type);
232 extern void register_apply(int ob_type, apply_func method);
233 extern void register_process(int ob_type, process_func method);
234 extern void register_describe(int ob_type, describe_func method);
235 extern void register_move_on(int ob_type, move_on_func method);
236 extern void register_trigger(int ob_type, trigger_func method);
237 /* object.cpp */
238 extern int object_can_merge(object *ob1, object *ob2);
239 extern signed long object_sum_weight(object *op);
240 extern object *object_get_env_recursive(object *op);
241 extern object *object_get_player_container(object *op);
242 extern void object_dump(const object *op, StringBuffer *sb);
243 extern void object_dump_all(void);
244 extern object *object_find_by_tag_global(tag_t i);
245 extern object *object_find_by_name_global(const char *str);
246 extern void object_free_all_data(void);
247 extern object *object_get_owner(object *op);
248 extern void object_clear_owner(object *op);
249 extern void object_set_owner(object *op, object *owner);
250 extern void object_copy_owner(object *op, object *clone);
251 extern void object_set_enemy(object *op, object *enemy);
252 extern void object_reset(object *op);
253 extern void object_free_key_values(object *op);
254 extern void object_clear(object *op);
255 extern void object_copy_no_speed(const object *src_ob, object *dest_ob);
256 extern void object_copy(const object *src_ob, object *dest_ob);
257 extern void object_copy_with_inv(const object *src_ob, object *dest_ob, bool update_speed);
258 extern object *object_new(void);
259 extern void object_update_turn_face(object *op);
260 extern void object_update_speed(object *op);
261 extern void object_remove_from_active_list(object *op);
262 extern void object_update(object *op, int action);
263 extern void object_free_drop_inventory(object *ob);
264 extern void object_free_inventory(object *ob);
265 extern void object_free(object *ob, int flags);
266 extern int object_count_free(void);
267 extern int object_count_used(void);
268 extern int object_count_active(void);
269 extern void object_sub_weight(object *op, signed long weight);
270 extern void object_remove(object *op);
271 extern object *object_merge(object *op, object *top);
272 extern object *object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y);
273 extern void object_merge_spell(object *op, int16_t x, int16_t y);
274 extern object *object_insert_in_map(object *op, mapstruct *m, object *originator, int flag);
275 extern void object_replace_insert_in_map(const char *arch_string, object *op);
276 extern object *object_split(object *orig_ob, uint32_t nr, char *err, size_t size);
277 extern object *object_decrease_nrof(object *op, uint32_t i);
278 extern void object_add_weight(object *op, signed long weight);
279 extern object *object_insert_in_ob(object *op, object *where);
280 extern int object_check_move_on(object *op, object *originator);
281 extern object *map_find_by_archetype(mapstruct *m, int x, int y, const archetype *at);
282 extern object *map_find_by_type(mapstruct *m, int x, int y, uint8_t type);
283 extern object *object_present_in_ob(uint8_t type, const object *op);
284 extern object *object_present_in_ob_by_name(int type, const char *str, const object *op);
285 extern object *arch_present_in_ob(const archetype *at, const object *op);
286 extern void object_set_flag_inv(object *op, int flag);
287 extern void object_unset_flag_inv(object *op, int flag);
288 extern void object_set_cheat(object *op);
289 extern int object_find_multi_free_spot_around(const object *ob, const object *gen, int16_t *hx, int16_t *hy);
290 extern int object_find_multi_free_spot_within_radius(const object *ob, const object *gen, int *hx, int *hy);
291 extern int object_find_free_spot(const object *ob, mapstruct *m, int x, int y, int start, int stop);
292 extern int object_find_first_free_spot(const object *ob, mapstruct *m, int x, int y);
293 extern void get_search_arr(int *search_arr);
294 extern int object_distance(const object *ob1, const object *ob2);
295 extern int find_dir_2(int x, int y);
296 extern int absdir(int d);
297 extern int dirdiff(int dir1, int dir2);
298 extern int can_see_monsterP(mapstruct *m, int x, int y, int dir);
299 extern int object_can_pick(const object *who, const object *item);
300 extern object *object_create_clone(object *asrc);
301 extern object *object_find_by_name(const object *who, const char *name);
302 extern object *object_find_by_type(const object *who, int type);
303 extern object *object_find_by_type_without_flags(const object *who, int type, int *flags, int num_flags);
304 extern object *object_find_by_type2(const object *who, int type1, int type2);
305 extern object *object_find_by_tag(const object *who, tag_t tag);
306 extern object *object_find_by_type_applied(const object *who, int type);
307 extern object *object_find_by_type_and_name(const object *who, int type, const char *name);
308 extern object *object_find_by_type_and_race(const object *who, int type, const char *race);
309 extern object *object_find_by_type_and_slaying(const object *who, int type, const char *slaying);
310 extern object *object_find_by_type_and_skill(const object *who, int type, const char *skill);
311 extern object *object_find_by_flag(const object *who, int flag);
312 extern object *object_find_by_flag_applied(const object *who, int flag);
313 extern object *object_find_by_arch_name(const object *who, const char *name);
314 extern object *object_find_by_type_and_arch_name(const object *who, int type, const char *name);
315 extern object *object_find_by_type_subtype(const object *who, int type, int subtype);
316 extern key_value *object_get_key_value(const object *ob, const char *key);
317 extern const char *object_get_value(const object *op, const char *const key);
318 extern bool object_value_set(const object *op, const char *const key);
319 extern bool object_value_set_shared(const object *op, sstring key);
320 extern int object_set_value(object *op, const char *key, const char *value, int add_key);
321 extern int object_matches_string(object *pl, object *op, const char *name);
322 extern void object_fix_multipart(object *tmp);
323 extern void object_get_multi_size(const object *ob, int *sx, int *sy, int *hx, int *hy);
324 extern void object_insert_to_free_spot_or_free(object *op, mapstruct *map, int x, int y, int start, int stop, object *originator);
325 extern void object_set_msg(object *op, const char *msg);
326 extern void get_ob_diff(StringBuffer *sb, const object *op, const object *op2);
327 extern int save_object(FILE *fp, object *op, int flag);
328 extern void save_object_in_sb(StringBuffer *sb, object *op, const int flag);
329 extern void object_handle_death_animation(object *op);
330 extern int object_matches_pickup_mode(const object *item, int mode);
331 /* path.cpp */
332 extern char *path_combine(const char *src, const char *dst, char *path, size_t size);
333 extern void path_normalize(char *path);
334 extern char *path_combine_and_normalize(const char *src, const char *dst, char *path, size_t size);
335 /* porting.cpp */
336 extern FILE *tempnam_secure(const char *dir, const char *pfx, char **filename);
337 extern void remove_directory(const char *path);
338 extern int ihypot(int a, int b);
339 extern int isqrt(int n);
340 extern void make_path_to_file(const char *filename);
341 /* player.cpp */
342 extern void clear_player(player *pl);
343 extern void free_player(player *pl);
344 extern int atnr_is_dragon_enabled(int attacknr);
345 extern int is_dragon_pl(const object *op);
346 extern client_spell *get_client_spell_state(player *pl, object *spell);
347 extern int is_wraith_pl(object *op);
348 extern int is_old_wraith_pl(object *op);
349 extern void player_set_dragon_title(struct player *pl, int level, const char *attack, int skin_resist);
350 extern void player_get_title(const struct player *pl, char *buf, size_t bufsize);
351 extern int player_has_own_title(const struct player *pl);
352 extern const char *player_get_own_title(const struct player *pl);
353 extern void player_set_own_title(struct player *pl, const char *title);
354 extern void link_player_skills(object *op);
355 /* re-cmp.cpp */
356 extern const char *re_cmp(const char *str, const char *regexp);
357 /* readable.cpp */
358 extern int nstrtok(const char *buf1, const char *buf2);
359 extern char *strtoktolin(const char *buf1, const char *buf2, char *retbuf, size_t size);
360 extern int book_overflow(const char *buf1, const char *buf2, size_t booksize);
361 extern void init_readable(void);
362 extern object *get_random_mon(int level);
363 extern void tailor_readable_ob(object *book, int msg_type);
364 extern void free_all_readable(void);
365 extern void write_book_archive(void);
366 extern const readable_message_type *get_readable_message_type(object *readable);
367 extern const GeneralMessage *get_message_from_identifier(const char *identifier);
370 extern const Face *get_message_face(const GeneralMessage *message);
371 extern void init_msgfile(FILE *file, const char *filename);
372 /* recipe.cpp */
373 extern recipelist *get_formulalist(int i);
374 extern void init_formulae(BufferReader *reader, const char *filename);
375 extern void dump_alchemy(void);
376 extern archetype *find_treasure_by_name(const treasure *t, const char *name, int depth);
377 extern void dump_alchemy_costs(void);
378 extern int strtoint(const char *buf);
379 extern const artifact *locate_recipe_artifact(const recipe *rp, size_t idx);
380 extern recipe *get_random_recipe(recipelist *rpl);
381 extern void free_all_recipes(void);
382 extern recipe *find_recipe_for_tool(const char *tool, recipe *from);
383 extern bool check_formulae(void);
384 extern const Face *recipe_get_face(const recipe *rp);
385 extern bool check_recipes();
386 extern const char *recipe_get_difficulty_string(int difficulty);
387 /* region.cpp */
388 extern region *get_region_by_name(const char *region_name);
390 extern const char *get_name_of_region_for_map(const mapstruct *m);
391 extern region *get_region_from_string(const char *name);
392 extern int region_is_child_of_region(const region *child, const region *r);
393 extern const char *get_region_longname(const region *r);
394 extern const char *get_region_msg(const region *r);
395 extern object *get_jail_exit(object *op);
396 extern void init_regions(BufferReader *reader, const char *filename);
397 extern region *get_region_struct(void);
398 /* stringbuffer.cpp */
399 extern StringBuffer *stringbuffer_new(void);
400 extern void stringbuffer_delete(StringBuffer *sb);
401 extern char *stringbuffer_finish(StringBuffer *sb);
403 extern void stringbuffer_append_string(StringBuffer *sb, const char *str);
404 extern void stringbuffer_append_printf(StringBuffer *sb, const char *format, ...);
405 extern void stringbuffer_append_stringbuffer(StringBuffer *sb, const StringBuffer *sb2);
406 extern void stringbuffer_append_multiline_block(StringBuffer *sb, const char *start, const char *content, const char *end);
407 extern size_t stringbuffer_length(StringBuffer *sb);
408 /* time.cpp */
409 extern const char *get_periodofday(const int index);
410 extern const char *get_month_name(const int index);
411 extern const char *get_weekday(const int index);
412 extern const char *get_season_name(const int index);
413 extern void reset_sleep(void);
414 extern long usec_elapsed(struct timespec first, struct timespec second);
415 extern void tick_game_time(void);
416 extern long get_sleep_remaining(void);
417 extern void jump_time(void);
418 extern void set_tick_duration(long t);
419 extern void get_tod(timeofday_t *tod);
420 extern void time_info(object *op);
421 extern long seconds(void);
422 extern const char *time_format_time(const timeofday_t *tod, char *buf, size_t bufsize);
423 extern long timespec_diff(struct timespec *end, struct timespec *start);
424 extern unsigned int tick_length(float seconds);
425 extern float ticks_to_seconds(int ticks);
426 /* treasure.cpp */
427 extern void init_archetype_pointers(void);
428 extern void load_treasures(void);
429 extern treasurelist *find_treasurelist(const char *name);
430 extern void create_treasure(treasurelist *t, object *op, int flag, int difficulty, int tries);
431 extern object *generate_treasure(treasurelist *t, int difficulty);
432 extern void set_abs_magic(object *op, int magic);
433 extern void fix_generated_item(object *op, object *creator, int difficulty, int max_magic, int flags);
434 extern void dump_monster_treasure(const char *name);
435 extern treasure *get_empty_treasure();
436 extern void treasure_free(treasure *t);
437 extern treasure *treasure_insert(treasurelist *list, int position);
438 extern void treasure_remove_item(treasurelist *list, int position);
439 /* utils.cpp */
440 extern int random_roll(int min, int max, const object *op, int goodbad);
441 extern int64_t random_roll64(int64_t min, int64_t max, const object *op, int goodbad);
442 extern int die_roll(int num, int size, const object *op, int goodbad);
443 extern int rndm(int min, int max);
444 extern void decay_objects(mapstruct *m);
445 extern materialtype_t *name_to_material(const char *name);
446 extern void transmute_materialname(object *op, const object *change);
447 extern void set_materialname(object *op);
448 extern void strip_endline(char *buf);
449 extern void replace(const char *src, const char *key, const char *replacement, char *result, size_t resultsize);
450 extern void make_list_like(char *input);
451 extern int get_random_dir(void);
452 extern int get_randomized_dir(int dir);
453 extern int adjust_dir(int dir, int destination_dir);
454 extern void replace_unprintable_chars(char *buf);
455 extern size_t split_string(char *str, char *array[], size_t array_size, char sep);
456 extern StringBuffer *describe_spellpath_attenuation(const char *attenuation, int value, StringBuffer *buf);
457 extern StringBuffer *describe_attacktype(const char *attack, int value, StringBuffer *buf);
458 extern void free_charlinks(linked_char *lc);
459 /* loader.cpp */
460 extern void yyrestart(FILE *input_file);
461 extern void yypop_buffer_state(void);
462 extern int yyget_lineno(void);
463 extern FILE *yyget_in(void);
464 extern FILE *yyget_out(void);
465 extern char *yyget_text(void);
466 extern void yyset_lineno(int line_number);
467 extern void yyset_in(FILE *in_str);
468 extern void yyset_out(FILE *out_str);
469 extern int yyget_debug(void);
470 extern void yyset_debug(int bdebug);
471 extern int yylex_destroy(void);
472 extern void yyfree(void *ptr);
473 extern int load_object(FILE *fp, object *op, int bufstate, int map_flags, bool artifact_init);
474 extern int load_object_from_reader(BufferReader *reader, object *op, int map_flags, bool arch_init, bool artifact_init);
475 extern int set_variable(object *op, const char *buf);
476 extern void free_loader(void);
object_find_multi_free_spot_within_radius
int object_find_multi_free_spot_within_radius(const object *ob, const object *gen, int *hx, int *hy)
Sets hx and hy to the coords to insert a possibly multi-tile ob at, within radius of generator,...
Definition: object.cpp:3412
Face
New face structure - this enforces the notion that data is face by face only - you can not change the...
Definition: face.h:14
clear_friendly_list
void clear_friendly_list(void)
Totally clear the friendly list.
Definition: friend.cpp:134
path_normalize
void path_normalize(char *path)
Cleans specified path.
Definition: path.cpp:85
check_recipes
bool check_recipes()
Ensure that all recipes have a valid artifact, and that archetypes are correct.
Definition: recipe.cpp:147
share_exp
void share_exp(object *op, int64_t exp, const char *skill, int flag)
Gives experience to a player/monster, sharing it with party if applicable.
Definition: living.cpp:2323
object_remove_from_active_list
void object_remove_from_active_list(object *op)
This function removes object 'op' from the list of active objects.
Definition: object.cpp:1392
yyset_out
void yyset_out(FILE *out_str)
Definition: loader.cpp:38756
object_split
object * object_split(object *orig_ob, uint32_t nr, char *err, size_t size)
object_split(ob,nr) splits up ob into two parts.
Definition: object.cpp:2637
get_formulalist
recipelist * get_formulalist(int i)
Gets a formula list by ingredients count.
Definition: recipe.cpp:98
get_dex_bonus
int get_dex_bonus(int stat)
Definition: living.cpp:2365
object_unset_flag_inv
void object_unset_flag_inv(object *op, int flag)
Desactivate recursively a flag on an object inventory.
Definition: object.cpp:3256
get_periodofday
const char * get_periodofday(const int index)
give access to weekday names
Definition: time.cpp:106
object_add_weight
void object_add_weight(object *op, signed long weight)
object_add_weight(object, weight) adds the specified weight to an object, and also updates how much t...
Definition: object.cpp:2833
clear_los
void clear_los(player *pl)
Clears/initialises the los-array associated to the player controlling the object.
Definition: los.cpp:270
get_empty_map
mapstruct * get_empty_map(int sizex, int sizey)
Creates and returns a map of the specific size.
Definition: map.cpp:854
object_find_first_free_spot
int object_find_first_free_spot(const object *ob, mapstruct *m, int x, int y)
object_find_first_free_spot(archetype, mapstruct, x, y) works like object_find_free_spot(),...
Definition: object.cpp:3599
ob_process
method_ret ob_process(object *op)
Processes an object, giving it the opportunity to move or react.
Definition: ob_methods.cpp:67
object_find_by_flag_applied
object * object_find_by_flag_applied(const object *who, int flag)
Find applied object in inventory by flag.
Definition: object.cpp:4229
query_short_name
void query_short_name(const object *op, char *buf, size_t size)
query_short_name(object) is similar to query_name(), but doesn't contain any information about object...
Definition: item.cpp:513
GeneralMessage
One general message, from the lib/messages file.
Definition: book.h:44
dirdiff
int dirdiff(int dir1, int dir2)
Computes a direction difference.
Definition: object.cpp:3732
tick_length
unsigned int tick_length(float seconds)
Calculate the number of ticks that correspond to real time.
Definition: time.cpp:382
stringbuffer_new
StringBuffer * stringbuffer_new(void)
Definition: stringbuffer.cpp:57
object_set_value
int object_set_value(object *op, const char *key, const char *value, int add_key)
Updates the key in op to value.
Definition: object.cpp:4499
object_value_set_shared
bool object_value_set_shared(const object *op, sstring key)
Determine if an extra value is set to a non empty or 0 value.
Definition: object.cpp:4390
replace
void replace(const char *src, const char *key, const char *replacement, char *result, size_t resultsize)
Replace in string src all occurrences of key by replacement.
Definition: utils.cpp:327
register_describe
void register_describe(int ob_type, describe_func method)
Registers the describe method for the given type.
Definition: ob_types.cpp:80
try_find_face
const Face * try_find_face(const char *name, const Face *error)
Definition: assets.cpp:285
fix_object
void fix_object(object *op)
Updates all abilities given by applied objects in the inventory of the given object.
Definition: living.cpp:1132
tailor_readable_ob
void tailor_readable_ob(object *book, int msg_type)
The main routine.
Definition: readable.cpp:1892
yyfree
void yyfree(void *ptr)
Definition: loader.cpp:38872
object_can_pick
int object_can_pick(const object *who, const object *item)
Finds out if an object can be picked up.
Definition: object.cpp:3867
free_player
void free_player(player *pl)
Frees player structure, including pointed object (through object_free_drop_inventory()).
Definition: player.cpp:68
player_get_own_title
const char * player_get_own_title(const struct player *pl)
Returns the player's own title.
Definition: player.cpp:260
player_has_own_title
int player_has_own_title(const struct player *pl)
Returns whether the player has a custom title.
Definition: player.cpp:247
free_objectlinkpt
void free_objectlinkpt(oblinkpt *obp)
Recursively frees all linked list of objectlink pointers.
Definition: links.cpp:79
language_t
void * language_t
Strings that should be manipulated through add_string() and free_string().
Definition: global.h:69
tempnam_secure
FILE * tempnam_secure(const char *dir, const char *pfx, char **filename)
A replacement for the tempnam_local() function since that one is not very secure.
Definition: porting.cpp:71
client_spell
This stores, for a spell a player knows, the last sp/gr/dam information sent to client.
Definition: player.h:87
get_region_longname
const char * get_region_longname(const region *r)
Gets the longname of a region.
Definition: region.cpp:209
write_todclock
void write_todclock(void)
Write out the current time to the file so time does not reset every time the server reboots.
Definition: init.cpp:517
transmute_materialname
void transmute_materialname(object *op, const object *change)
When doing transmutation of objects, we have to recheck the resistances, as some that did not apply p...
Definition: utils.cpp:263
player
One player.
Definition: player.h:105
calculate_difficulty
int calculate_difficulty(mapstruct *m)
This routine is supposed to find out the difficulty of the map.
Definition: map.cpp:1908
trigger_func
method_ret(* trigger_func)(object *, object *, int)
Definition: ob_methods.h:34
create_template_pathname
void create_template_pathname(const char *name, char *buf, size_t size)
same as create_pathname(), but for the template maps.
Definition: map.cpp:145
get_dialog_message
int get_dialog_message(object *op, const char *text, struct_dialog_message **message, struct_dialog_reply **reply)
Tries to find a message matching the said text.
Definition: dialog.cpp:233
init_msgfile
void init_msgfile(FILE *file, const char *filename)
find_face
const Face * find_face(const char *name)
Definition: assets.cpp:281
free_experience
void free_experience(void)
Frees experience-related memory.
Definition: exp.cpp:263
blocked_link
int blocked_link(object *ob, mapstruct *m, int16_t sx, int16_t sy)
Returns true if the given coordinate is blocked except by the object passed is not blocking.
Definition: map.cpp:356
query_base_name
void query_base_name(const object *op, int plural, char *buf, size_t size)
Query a short name for the item.
Definition: item.cpp:689
seconds
long seconds(void)
Return wall clock time in seconds.
Definition: time.cpp:348
init_attackmess
void init_attackmess(BufferReader *reader, const char *filename)
Initializes the attack messages.
Definition: init.cpp:570
object_find_by_type_applied
object * object_find_by_type_applied(const object *who, int type)
Find applied object in inventory.
Definition: object.cpp:4083
i18n
const char * i18n(const object *who, const char *code)
Translate a message in the appropriate language.
Definition: languages.cpp:42
dump_arch
void dump_arch(archetype *at, StringBuffer *sb)
Dumps an archetype to buffer.
Definition: arch.cpp:139
object_find_by_type
object * object_find_by_type(const object *who, int type)
Find object in inventory.
Definition: object.cpp:3980
animate_turning
void animate_turning(object *op)
Animates one step of object.
Definition: button.cpp:270
get_face_by_id
const Face * get_face_by_id(uint16_t id)
Get a face from its unique identifier.
Definition: assets.cpp:314
ready_map_name
mapstruct * ready_map_name(const char *name, int flags)
Makes sure the given map is loaded and swapped in.
Definition: map.cpp:1780
path_combine
char * path_combine(const char *src, const char *dst, char *path, size_t size)
Combines 2 paths, which can be relative.
Definition: path.cpp:51
dump_experience
void dump_experience(void)
Dump the experience table, then calls exit() - useful in terms of debugging to make sure the format o...
Definition: exp.cpp:251
describe_attacktype
StringBuffer * describe_attacktype(const char *attack, int value, StringBuffer *buf)
Describe the specified attack type.
Definition: utils.cpp:538
is_type_valid
int is_type_valid(uint8_t type)
Checks if the specified type is a valid one for a Crossfire object.
Definition: arch_types_valid.cpp:17
nstrtok
int nstrtok(const char *buf1, const char *buf2)
Simple routine to return the number of list items in buf1 as separated by the value of buf2.
Definition: readable.cpp:642
object_count_free
int object_count_free(void)
Objects statistics.
Definition: object.cpp:1751
get_faces_count
size_t get_faces_count(void)
Definition: assets.cpp:292
arch_present_in_ob
object * arch_present_in_ob(const archetype *at, const object *op)
Searches for any objects with a matching archetype in the inventory of the given object.
Definition: object.cpp:3222
init_regions
void init_regions(BufferReader *reader, const char *filename)
Reads/parses the region file, and copies into a linked list of region structs.
Definition: region.cpp:310
object_can_merge
int object_can_merge(object *ob1, object *ob2)
Examines the 2 objects given to it, and returns true if they can be merged together,...
Definition: object.cpp:433
make_sure_seen
void make_sure_seen(const object *op)
The object is supposed to be visible through walls, thus check if any players are nearby,...
Definition: los.cpp:695
player_get_title
void player_get_title(const struct player *pl, char *buf, size_t bufsize)
find_god
const object * find_god(const char *name)
Returns a god's object from its name.
Definition: holy.cpp:317
object_replace_insert_in_map
void object_replace_insert_in_map(const char *arch_string, object *op)
This function inserts an object of a specified archetype in the map, but if it finds objects of its o...
Definition: object.cpp:2597
get_speed_bonus
float get_speed_bonus(int stat)
Definition: living.cpp:2393
i18n_get_language_by_code
language_t i18n_get_language_by_code(const char *code)
Find the identifier of a language from its code.
Definition: languages.cpp:74
object_update_speed
void object_update_speed(object *op)
Updates the speed of an object.
Definition: object.cpp:1349
PRINTF_ARGS
#define PRINTF_ARGS(x, y)
Used for printf-like functions, mostly LOG and draw_ext_info_format.
Definition: global.h:46
out_of_map
int out_of_map(mapstruct *m, int x, int y)
Return 1 if coordinates X and Y are out of the map M, taking into account tiling.
Definition: map.cpp:2306
object_matches_string
int object_matches_string(object *pl, object *op, const char *name)
This is a subset of the parse_id command.
Definition: object.cpp:4574
object_dump_all
void object_dump_all(void)
Dumps all objects to console.
Definition: object.cpp:704
query_weight
void query_weight(const object *op, char *buf, size_t size)
Formats the item's weight.
Definition: item.cpp:415
describe_spellpath_attenuation
StringBuffer * describe_spellpath_attenuation(const char *attenuation, int value, StringBuffer *buf)
Describe the specified path attenuation.
Definition: utils.cpp:507
init_library
void init_library(void)
It is vital that init_library() is called by any functions using this library.
Definition: init.cpp:322
find_treasurelist
treasurelist * find_treasurelist(const char *name)
Search for the given treasurelist by name.
Definition: assets.cpp:248
key_value
Each object (this also means archetypes!) could have a few of these "dangling" from it; this could al...
Definition: object.h:42
is_identified
int is_identified(const object *op)
Return true if the item is identified, either because it is of a type that doesn't ever need identifi...
Definition: item.cpp:1353
get_randomized_dir
int get_randomized_dir(int dir)
Returns a random direction (1..8) similar to a given direction.
Definition: utils.cpp:412
set_tick_duration
void set_tick_duration(long t)
Sets the tick duration.
Definition: time.cpp:209
timeofday_t
Represents the ingame time.
Definition: tod.h:38
recipe_get_difficulty_string
const char * recipe_get_difficulty_string(int difficulty)
A method to produce a difficulty adjective to describe alchemy projects.
Definition: recipe.cpp:962
treasure_free
void treasure_free(treasure *t)
Frees a treasure, including its yes, no and next items.
Definition: treasure.cpp:1401
clear_player
void clear_player(player *pl)
Clears data in player structure.
Definition: player.cpp:33
level_exp
int64_t level_exp(int level, double expmul)
Returns how much experience is needed for a player to become the given level.
Definition: living.cpp:1885
process_func
method_ret(* process_func)(object *)
Definition: ob_methods.h:31
remove_depletion
int remove_depletion(object *op, int level)
Remove depletion from op, if present, and warn player of such restorations.
Definition: living.cpp:755
check_inv_recursive
object * check_inv_recursive(object *op, const object *trig)
Checks object and its inventory for specific item.
Definition: button.cpp:782
drain_specific_stat
void drain_specific_stat(object *op, int deplete_stats)
Drain a specified stat from op.
Definition: living.cpp:728
load_object_from_reader
int load_object_from_reader(BufferReader *reader, object *op, int map_flags, bool arch_init, bool artifact_init)
Load an object from the specified reader, stopping when the object is complete.
Definition: loader.cpp:38996
get_rangevector_from_mapcoord
int get_rangevector_from_mapcoord(const mapstruct *m, int x, int y, const object *op2, rv_vector *retval)
This is basically the same as get_rangevector() above, but instead of the first parameter being an ob...
Definition: map.cpp:2573
yyget_out
FILE * yyget_out(void)
Get the output stream.
Definition: loader.cpp:38713
apply_death_exp_penalty
void apply_death_exp_penalty(object *op)
Applies a death penalty experience, the size of this is defined by the settings death_penalty_percent...
Definition: living.cpp:2244
get_button_value
int get_button_value(const object *button)
Returns the first value linked to this button.
Definition: button.cpp:749
get_search_arr
void get_search_arr(int *search_arr)
New function to make monster searching more efficient, and effective! This basically returns a random...
Definition: object.cpp:3642
calc_item_power
int calc_item_power(const object *op)
This takes an object 'op' and figures out what its item_power rating should be.
Definition: item.cpp:235
flags
static const flag_definition flags[]
Flag mapping.
Definition: gridarta-types-convert.cpp:101
find_archetype_by_object_type_name
archetype * find_archetype_by_object_type_name(int type, const char *name)
This function retrieves an archetype by type and name that appears during the game.
Definition: arch.cpp:64
fix_generated_item
void fix_generated_item(object *op, object *creator, int difficulty, int max_magic, int flags)
fix_generated_item(): This is called after an item is generated, in order to set it up right.
Definition: treasure.cpp:903
object_find_by_flag
object * object_find_by_flag(const object *who, int flag)
Find object in inventory by flag.
Definition: object.cpp:4206
make_list_like
void make_list_like(char *input)
Taking a string as an argument, mutate it into a string that looks like a list.
Definition: utils.cpp:368
object_update
void object_update(object *op, int action)
object_update() updates the array which represents the map.
Definition: object.cpp:1434
check_inv
void check_inv(object *op, object *trig)
Function to search the inventory, of a player and then based on a set of conditions,...
Definition: button.cpp:825
create_treasure
void create_treasure(treasurelist *t, object *op, int flag, int difficulty, int tries)
This calls the appropriate treasure creation function.
Definition: treasure.cpp:263
get_random_mon
object * get_random_mon(int level)
Returns a random monster selected from linked list of all monsters in the current game.
Definition: readable.cpp:1269
treasure_remove_item
void treasure_remove_item(treasurelist *list, int position)
Remove the treasure at the specified position from the list.
Definition: treasure.cpp:1445
object_free_all_data
void object_free_all_data(void)
Destroys all allocated objects.
Definition: object.cpp:767
describe_resistance
StringBuffer * describe_resistance(const object *op, int newline, int use_media_tags, StringBuffer *buf)
Generates the visible naming for resistances.
Definition: item.cpp:372
free_all_maps
void free_all_maps(void)
Frees all allocated maps.
Definition: map.cpp:1974
get_archetype_by_type_subtype
archetype * get_archetype_by_type_subtype(int type, int subtype)
Retrieves an archetype by type and subtype.
Definition: arch.cpp:97
usec_elapsed
long usec_elapsed(struct timespec first, struct timespec second)
Return the number of microseconds between two timespec structures.
Definition: cfanim.cpp:1149
oblinkpt
Used to link together several object links.
Definition: object.h:469
object_give_identified_properties
void object_give_identified_properties(object *op)
Ensure op has all its "identified" properties set.
Definition: item.cpp:1361
add_statbonus
void add_statbonus(object *op)
Adds stat-bonuses given by the class which the player has chosen.
Definition: living.cpp:868
set_materialname
void set_materialname(object *op)
Set the material name and type for an item, if not set.
Definition: utils.cpp:297
adjust_dir
int adjust_dir(int dir, int destination_dir)
Adjusts a given direction by +/-1 towards a destination direction.
Definition: utils.cpp:426
object_check_move_on
int object_check_move_on(object *op, object *originator)
Checks if any objects has a move_type that matches objects that effect this object on this space.
Definition: object.cpp:3012
yyset_in
void yyset_in(FILE *in_str)
Set the input stream.
Definition: loader.cpp:38751
load_object
int load_object(FILE *fp, object *op, int bufstate, int map_flags, bool artifact_init)
Loads an object from the given file-pointer.
Definition: loader.cpp:38944
init_objects
void init_objects(void)
Sets up and initialises the linked list of free and used objects.
Definition: object.cpp:327
get_client_spell_state
client_spell * get_client_spell_state(player *pl, object *spell)
Gets the (client-side) spell state for specified spell.
Definition: player.cpp:144
booksize
size_t booksize
Definition: readable.cpp:1564
find_artifact
const artifact * find_artifact(const object *op, const char *name)
Searches and returns a specific artifact compatible with an object, NULL if not found.
Definition: artifact.cpp:589
is_wraith_pl
int is_wraith_pl(object *op)
Tests if a player is a wraith.
Definition: player.cpp:173
init_block
void void init_block(void)
initialises the array used by the LOS routines.
Definition: los.cpp:106
free_all_recipes
void free_all_recipes(void)
Frees all memory allocated to recipes and recipes lists.
Definition: recipe.cpp:811
free_objectlink
void free_objectlink(objectlink *ol)
Recursively frees all objectlinks.
Definition: links.cpp:67
decay_objects
void decay_objects(mapstruct *m)
Decay and destroy persihable items in a map.
Definition: utils.cpp:175
generate_artifact
void generate_artifact(object *op, int difficulty)
Decides randomly which artifact the object should be turned into.
Definition: artifact.cpp:177
make_path_to_file
void make_path_to_file(const char *filename)
Checks if any directories in the given path doesn't exist, and creates if necessary.
Definition: porting.cpp:164
object_get_value
const char * object_get_value(const object *op, const char *const key)
Get an extra value by key.
Definition: object.cpp:4346
create_overlay_pathname
void create_overlay_pathname(const char *name, char *buf, size_t size)
Same as create_pathname(), but for the overlay maps.
Definition: map.cpp:125
stringbuffer_finish_shared
sstring stringbuffer_finish_shared(StringBuffer *sb)
Definition: stringbuffer.cpp:85
get_rand_god
const object * get_rand_god(void)
Returns a random god.
Definition: holy.cpp:73
buf
StringBuffer * buf
Definition: readable.cpp:1565
free_charlinks
void free_charlinks(linked_char *lc)
Frees a link structure and its next items.
Definition: utils.cpp:616
update_all_los
void update_all_los(const mapstruct *map, int x, int y)
This function makes sure that update_los() will be called for all players on the given map within the...
Definition: los.cpp:595
free_globals
void free_globals(void)
Cleans all memory allocated for global variables.
Definition: init.cpp:438
yyset_lineno
void yyset_lineno(int line_number)
Set the current line number.
Definition: loader.cpp:38739
clean_tmp_map
void clean_tmp_map(mapstruct *m)
Removse the temporary file used by the map.
Definition: map.cpp:1965
object_free_drop_inventory
void object_free_drop_inventory(object *ob)
Frees everything allocated by an object, removes it from the list of used objects,...
Definition: object.cpp:1560
object_find_by_type2
object * object_find_by_type2(const object *who, int type1, int type2)
Find object in inventory.
Definition: object.cpp:4037
free_loader
void free_loader(void)
Frees all memory allocated by the loader.
Definition: loader.cpp:39074
get_colorname
const char * get_colorname(uint8_t index)
Definition: image.cpp:86
get_typedata_by_name
const typedata * get_typedata_by_name(const char *name)
Definition: item.cpp:343
name
Plugin animator file specs[Config] name
Definition: animfiles.txt:4
linked_char
Definition: global.h:98
ob_trigger
method_ret ob_trigger(object *op, object *cause, int state)
An object is triggered by another one.
Definition: ob_methods.cpp:133
exp_level
int exp_level(int64_t exp)
Returns the level for a given exp.
Definition: living.cpp:1897
get_weight_limit
uint32_t get_weight_limit(int stat)
Definition: living.cpp:2373
get_rangevector
int get_rangevector(object *op1, const object *op2, rv_vector *retval, int flags)
From map.c This is used by get_player to determine where the other creature is.
Definition: map.cpp:2505
re_cmp
const char * re_cmp(const char *str, const char *regexp)
re-cmp - get regular expression match.
Definition: re-cmp.cpp:68
get_message_body
sstring get_message_body(const GeneralMessage *message)
Get a message's body.
Definition: readable.cpp:2077
get_name_of_region_for_map
const char * get_name_of_region_for_map(const mapstruct *m)
Gets the name of a region for a map.
Definition: region.cpp:89
find_color
uint8_t find_color(const char *name)
Finds a color by name.
Definition: image.cpp:75
yyset_debug
void yyset_debug(int bdebug)
Definition: loader.cpp:38766
update_all_map_los
void update_all_map_los(mapstruct *map)
update all_map_los is like update_all_los() below, but updates everyone on the map,...
Definition: los.cpp:567
set_dragon_name
void set_dragon_name(object *pl, const object *abil, const object *skin)
Set the new dragon name after gaining levels or changing ability focus (later this can be extended to...
Definition: living.cpp:1688
typedata
Link an object type with skill needed to identify, and general name.
Definition: define.h:89
has_been_loaded
mapstruct * has_been_loaded(const char *name)
Checks whether map has been loaded.
Definition: map.cpp:79
m
static event_registration m
Definition: citylife.cpp:422
new_exp
int64_t new_exp(const object *ob)
Alternative way to calculate experience based on the ability of a monster.
Definition: exp.cpp:100
describe_god
int describe_god(const object *god, int what, StringBuffer *buf, size_t maxlen)
Describe a god.
Definition: holy.cpp:109
find_smooth
int find_smooth(const Face *face, const Face **smoothed)
Find the smooth face for a given face.
Definition: image.cpp:102
is_valid_faceset
int is_valid_faceset(int fsn)
Checks specified faceset is valid.
Definition: image.cpp:117
can_see_monsterP
int can_see_monsterP(mapstruct *m, int x, int y, int dir)
Recursive routine to see if we can find a path to a certain point.
Definition: object.cpp:3822
load_png_file
int load_png_file(FILE *file, const char *full_path)
change_exp
void change_exp(object *op, int64_t exp, const char *skill_name, int flag)
Changes experience to a player/monster.
Definition: living.cpp:2179
object_get_multi_size
void object_get_multi_size(const object *ob, int *sx, int *sy, int *hx, int *hy)
Computes the size of a multitile object.
Definition: object.cpp:4744
check_formulae
bool check_formulae(void)
Check if formula don't have the same index.
Definition: recipe.cpp:292
create_singularity
object * create_singularity(const char *name)
Creates a dummy object.
Definition: arch.cpp:253
object_count_active
int object_count_active(void)
Objects statistics.
Definition: object.cpp:1783
update_los
void update_los(object *op)
Recalculates the array which specifies what is visible for the given player-object.
Definition: los.cpp:509
find_animation
Animations * find_animation(const char *name)
Definition: assets.cpp:273
allowed_class
int allowed_class(const object *op)
Returns true if the given player is a legal class.
Definition: living.cpp:1661
yyget_debug
int yyget_debug(void)
Definition: loader.cpp:38761
absdir
int absdir(int d)
Computes an absolute direction.
Definition: object.cpp:3714
init_gods
void init_gods(void)
This takes a look at all of the archetypes to find the objects which correspond to the GODS (type GOD...
Definition: holy.cpp:59
recipelist
List of recipes with a certain number of ingredients.
Definition: recipe.h:37
add_button_link
void add_button_link(object *button, mapstruct *map, int connected)
Links specified object in the map.
Definition: button.cpp:656
get_empty_artifactlist
artifactlist * get_empty_artifactlist(void)
Allocate and return the pointer to an empty artifactlist structure.
Definition: artifact.cpp:37
object_clear_owner
void object_clear_owner(object *op)
Clears the owner of specified object.
Definition: object.cpp:823
check_stat_bounds
void check_stat_bounds(living *stats, int8_t min_stat, int8_t max_stat)
Ensures that all stats (str/dex/con/wis/cha/int) are within the passed in range of min_stat and max_s...
Definition: living.cpp:354
get_empty_artifact
artifact * get_empty_artifact(void)
Allocate and return the pointer to an empty artifact structure.
Definition: artifact.cpp:55
describe_func
void(* describe_func)(const object *, const object *, int use_media_tags, char *buf, size_t size)
Definition: ob_methods.h:32
update_buttons
void update_buttons(mapstruct *m)
Updates every button on the map (by calling update_button() for them).
Definition: button.cpp:227
dump_stat_bonuses
void dump_stat_bonuses()
Definition: living.cpp:2651
object_remove
void object_remove(object *op)
This function removes the object op from the linked list of objects which it is currently tied to.
Definition: object.cpp:1833
register_trigger
void register_trigger(int ob_type, trigger_func method)
Registers the trigger method for the given type.
Definition: ob_types.cpp:98
object_find_by_tag_global
object * object_find_by_tag_global(tag_t i)
Returns the object which has the count-variable equal to the argument.
Definition: object.cpp:727
die_roll
int die_roll(int num, int size, const object *op, int goodbad)
Roll a number of dice (2d3, 4d6).
Definition: utils.cpp:122
object_count_used
int object_count_used(void)
Object statistics.
Definition: object.cpp:1767
region_is_child_of_region
int region_is_child_of_region(const region *child, const region *r)
Checks if a region is a child of another.
Definition: region.cpp:182
treasurelist
treasurelist represents one logical group of items to be generated together.
Definition: treasure.h:85
object_find_by_name
object * object_find_by_name(const object *who, const char *name)
Finds an object in inventory name.
Definition: object.cpp:3956
get_message_from_identifier
const GeneralMessage * get_message_from_identifier(const char *identifier)
Find the message from its identifier.
Definition: assets.cpp:323
object_get_player_container
object * object_get_player_container(object *op)
Finds the player carrying an object.
Definition: object.cpp:607
object_merge_spell
void object_merge_spell(object *op, int16_t x, int16_t y)
This sees if there are any objects on the space that can merge with op.
Definition: object.cpp:2129
get_region_msg
const char * get_region_msg(const region *r)
Gets a message for a region.
Definition: region.cpp:230
treasure_insert
treasure * treasure_insert(treasurelist *list, int position)
Insert a new treasure in the treasure list, at a specific position in the children list.
Definition: treasure.cpp:1422
artifact_get_face
uint16_t artifact_get_face(const artifact *art)
Get a suitable face number for representing an artifact.
Definition: artifact.cpp:638
arch_to_object
object * arch_to_object(archetype *at)
Creates and returns a new object which is a copy of the given archetype.
Definition: arch.cpp:227
load_face_file
int load_face_file(FILE *file, const char *full_path)
yypop_buffer_state
void yypop_buffer_state(void)
Removes and deletes the top of the stack, if present.
Definition: loader.cpp:38483
ob_methods
This struct stores function pointers for actions that can be done to objects.
Definition: ob_methods.h:43
dump_alchemy
void dump_alchemy(void)
Dumps alchemy recipes to output.
Definition: recipe.cpp:350
legal_artifact_combination
int legal_artifact_combination(const object *op, const artifact *art)
Checks if op can be combined with art.
Definition: artifact.cpp:252
get_next_friend
object * get_next_friend(object *current)
Get the next object on the friendly list.
Definition: friend.cpp:143
get_objectlinkpt
oblinkpt * get_objectlinkpt(void)
Allocates a new oblinkpt structure, initialises it, and returns a pointer to it.
Definition: links.cpp:51
give_artifact_abilities
void give_artifact_abilities(object *op, const object *artifact)
Fixes the given object, giving it the abilities and titles it should have due to the second artifact-...
Definition: artifact.cpp:230
get_face_fallback
int get_face_fallback(int faceset, uint16_t imageno)
This returns the set we will actually use when sending a face.
Definition: image.cpp:133
print_monsters
void print_monsters(void)
As dump_abilities(), but with an alternative way of output.
Definition: info.cpp:87
dump_artifacts
void dump_artifacts(void)
For debugging purposes.
Definition: artifact.cpp:614
ob_describe
char * ob_describe(const object *op, const object *observer, int use_media_tags, char *buf, size_t size)
Returns the description of an object, as seen by the given observer.
Definition: ob_methods.cpp:91
dump_animations
void dump_animations(void)
Dump all animations to stderr, for debugging purposes.
Definition: anim.cpp:180
struct_dialog_reply
One reply a NPC can expect.
Definition: dialog.h:16
object_insert_in_map
object * object_insert_in_map(object *op, mapstruct *m, object *originator, int flag)
This function inserts the object in the two-way linked list which represents what is on a map.
Definition: object.cpp:2361
free_map
void free_map(mapstruct *m)
Frees everything allocated by the given mapstructure.
Definition: map.cpp:1662
get_learn_spell
int get_learn_spell(int stat)
Definition: living.cpp:2377
init_ob_types
void init_ob_types(ob_methods *base_type)
Initializes the object system.
Definition: ob_types.cpp:49
get_random_recipe
recipe * get_random_recipe(recipelist *rpl)
Gets a random recipe from a list, based on chance.
Definition: recipe.cpp:787
create_pathname
char * create_pathname(const char *name, char *buf, size_t size)
Get the full path to a map file.
Definition: map.cpp:104
free_all_readable
void free_all_readable(void)
Free all readable-related information.
Definition: readable.cpp:1974
message
TIPS on SURVIVING Crossfire is populated with a wealth of different monsters These monsters can have varying immunities and attack types In some of them can be quite a bit smarter than others It will be important for new players to learn the abilities of different monsters and learn just how much it will take to kill them This section discusses how monsters can interact with players Most monsters in the game are out to mindlessly kill and destroy the players These monsters will help boost a player s after he kills them When fighting a large amount of monsters in a single attempt to find a narrower hallway so that you are not being attacked from all sides Charging into a room full of Beholders for instance would not be open the door and fight them one at a time For there are several maps designed for them Find these areas and clear them out All throughout these a player can find signs and books which they can read by stepping onto them and hitting A to apply the book sign These messages will help the player to learn the system One more always keep an eye on your food If your food drops to your character will soon so BE CAREFUL ! NPCs Non Player Character are special monsters which have intelligence Players may be able to interact with these monsters to help solve puzzles and find items of interest To speak with a monster you suspect to be a simply move to an adjacent square to them and push the double ie Enter your message
Definition: survival-guide.txt:34
is_identifiable_type
int is_identifiable_type(const object *op)
Return true if this item's type is one that cares about whether or not it's been identified – e....
Definition: item.cpp:1329
stringbuffer_length
size_t stringbuffer_length(StringBuffer *sb)
Definition: stringbuffer.cpp:218
t
in that case they will be relative to whatever the PWD of the crossfire server process is You probably shouldn t
Definition: server-directories.txt:28
get_month_name
const char * get_month_name(const int index)
give access to month names
Definition: time.cpp:113
change_luck
void change_luck(object *op, int value)
Alter the object's luck.
Definition: living.cpp:796
get_archetype_by_skill_name
archetype * get_archetype_by_skill_name(const char *skill, int type)
Retrieves an archetype by skill name and type.
Definition: arch.cpp:78
object_insert_in_ob
object * object_insert_in_ob(object *op, object *where)
This function inserts the object op in the linked list inside the object environment.
Definition: object.cpp:2857
spell
with a maximum of six This is not so if you are wearing plate you receive no benefit Armour is additive with all the supplementry forms of which means that it lasts until the next semi permanent spell effect is cast upon the character spell
Definition: tome-of-magic.txt:44
init_stats
void init_stats()
This loads statistic bonus/penalties from the stat_bonus file.
Definition: living.cpp:2520
get_attr_value
int8_t get_attr_value(const living *stats, int attr)
Gets the value of a stat.
Definition: living.cpp:313
strtoint
int strtoint(const char *buf)
Convert buf into an integer equal to the coadded sum of the (lowercase) character.
Definition: recipe.cpp:709
object_distance
int object_distance(const object *ob1, const object *ob2)
Return the square of the distance between the two given objects.
Definition: object.cpp:3661
find_archetype_by_object_name
archetype * find_archetype_by_object_name(const char *name)
This function retrieves an archetype given the name that appears during the game (for example,...
Definition: arch.cpp:51
i18n_find_language_by_code
language_t i18n_find_language_by_code(const char *code)
Attempt to find the identifier of a language from its code.
Definition: languages.cpp:60
title
Information on one title.
Definition: readable.cpp:108
artifactlist
This represents all archetypes for one particular object type.
Definition: artifact.h:24
time_format_time
const char * time_format_time(const timeofday_t *tod, char *buf, size_t bufsize)
Formats a timestamp in Crossfire time.
Definition: time.cpp:369
add_abilities
void add_abilities(object *op, const object *change)
Apply artifact properties to an object.
Definition: artifact.cpp:320
bufferreader.h
apply_anim_suffix
void apply_anim_suffix(object *who, const char *suffix)
Applies a compound animation to an object.
Definition: anim.cpp:150
object_copy_with_inv
void object_copy_with_inv(const object *src_ob, object *dest_ob, bool update_speed)
Copy an object with an inventory, duplicate the inv too.
Definition: object.cpp:1208
object_free_inventory
void object_free_inventory(object *ob)
Frees the inventory of an object, without any callback.
Definition: object.cpp:1568
object_find_by_arch_name
object * object_find_by_arch_name(const object *who, const char *name)
Find object in inventory by archetype name.
Definition: object.cpp:4252
tag_t
uint32_t tag_t
Object tag, unique during the whole game.
Definition: object.h:14
animation_load_block
void animation_load_block(FILE *file, const char *full_path, const char *animation_name)
face_sets::size
char * size
Human-readable set size.
Definition: image.h:22
archetype
The archetype structure is a set of rules on how to generate and manipulate objects which point to ar...
Definition: object.h:483
save_object
int save_object(FILE *fp, object *op, int flag)
Dumps all variables in an object to a file.
Definition: object.cpp:5397
is_old_wraith_pl
int is_old_wraith_pl(object *op)
Checks if player is a wraith without the 'wraith feed' skill.
Definition: player.cpp:185
yylex_destroy
int yylex_destroy(void)
Definition: loader.cpp:38804
init_globals
void init_globals(void)
Initialises all global variables.
Definition: init.cpp:394
fatal
void fatal(enum fatal_error err) __attribute__((noreturn))
fatal() is meant to be called whenever a fatal signal is intercepted.
Definition: utils.cpp:590
timespec_diff
long timespec_diff(struct timespec *end, struct timespec *start)
Return the difference between two timespec's in microseconds.
Definition: time.cpp:166
locate_recipe_artifact
const artifact * locate_recipe_artifact(const recipe *rp, size_t idx)
Finds an artifact for a recipe.
Definition: recipe.cpp:730
dump_map
void dump_map(const mapstruct *m)
Prints out debug-information about a map.
Definition: map.cpp:245
get_archetype_struct
archetype * get_archetype_struct(void)
Allocates, initialises and returns the pointer to an archetype structure.
Definition: arch.cpp:193
object_set_flag_inv
void object_set_flag_inv(object *op, int flag)
Activate recursively a flag on an object's inventory.
Definition: object.cpp:3239
object_find_by_type_and_arch_name
object * object_find_by_type_and_arch_name(const object *who, int type, const char *name)
Find object in inventory by type and archetype name.
Definition: object.cpp:4277
object_new
object * object_new(void)
Grabs an object from the list of unused objects, makes sure it is initialised, and returns it.
Definition: object.cpp:1273
stringbuffer_finish
char * stringbuffer_finish(StringBuffer *sb)
Definition: stringbuffer.cpp:76
weight
TIPS on SURVIVING Crossfire is populated with a wealth of different monsters These monsters can have varying immunities and attack types In some of them can be quite a bit smarter than others It will be important for new players to learn the abilities of different monsters and learn just how much it will take to kill them This section discusses how monsters can interact with players Most monsters in the game are out to mindlessly kill and destroy the players These monsters will help boost a player s after he kills them When fighting a large amount of monsters in a single attempt to find a narrower hallway so that you are not being attacked from all sides Charging into a room full of Beholders for instance would not be open the door and fight them one at a time For there are several maps designed for them Find these areas and clear them out All throughout these a player can find signs and books which they can read by stepping onto them and hitting A to apply the book sign These messages will help the player to learn the system One more always keep an eye on your food If your food drops to your character will soon so BE CAREFUL ! NPCs Non Player Character are special monsters which have intelligence Players may be able to interact with these monsters to help solve puzzles and find items of interest To speak with a monster you suspect to be a simply move to an adjacent square to them and push the double ie Enter your and press< Return > You can also use say if you feel like typing a little extra Other NPCs may not speak to but display intelligence with their movement Some monsters can be and may attack the nearest of your enemies Others can be in that they follow you around and help you in your quest to kill enemies and find treasure SPECIAL ITEMS There are many special items which can be found in of these the most important may be the signs all a player must do is apply the handle In the case of the player must move items over the button to hold it down Some of the larger buttons may need very large items to be moved onto before they can be activated Gates and locked but be for you could fall down into a pit full of ghosts or dragons and not be able to get back out Break away sometimes it may be worth a player s time to test the walls of a map for secret doors Fire such as missile weapons and spells you will notice them going up in smoke ! So be careful not to destroy valuable items Spellbooks sometimes a player can learn the other times they cannot There are many different types of books and scrolls out there Improve item have lower weight
Definition: survival-guide.txt:100
yyget_lineno
int yyget_lineno(void)
Get the current line number.
Definition: loader.cpp:38696
object_reset
void object_reset(object *op)
Totally resets the specified object, without freeing associated memory.
Definition: object.cpp:934
get_linked_map
mapstruct * get_linked_map(void)
Allocates, initialises, and returns a pointer to a mapstruct, linked through first_map.
Definition: map.cpp:788
face_sets::fallback
struct face_sets * fallback
Faceset to use when an image is not found in this faceset.
Definition: image.h:21
living
Various statistics of objects.
Definition: living.h:35
object_insert_to_free_spot_or_free
void object_insert_to_free_spot_or_free(object *op, mapstruct *map, int x, int y, int start, int stop, object *originator)
Inserts an object into its map.
Definition: object.cpp:4791
get_levelnumber
void get_levelnumber(int i, char *buf, size_t size)
object_get_key_value
key_value * object_get_key_value(const object *ob, const char *key)
Search for a field by key.
Definition: object.cpp:4321
load_treasures
void load_treasures(void)
random_roll64
int64_t random_roll64(int64_t min, int64_t max, const object *op, int goodbad)
This is a 64 bit version of random_roll() above.
Definition: utils.cpp:77
get_tod
void get_tod(timeofday_t *tod)
Computes the ingame time of the day.
Definition: time.cpp:219
get_map_flags
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
This rolls up wall, blocks_magic, blocks_view, etc, all into one function that just returns a P_.
Definition: map.cpp:300
get_power_from_ench
int get_power_from_ench(int ench)
Definition: item.cpp:212
update_position
void update_position(mapstruct *m, int x, int y)
This function updates various attributes about a specific space on the map (what it looks like,...
Definition: map.cpp:2130
write_book_archive
void write_book_archive(void)
Write out the updated book archive to bookarch file.
Definition: readable.cpp:2005
change_attr_value
void change_attr_value(living *stats, int attr, int8_t value)
Like set_attr_value(), but instead the value (which can be negative) is added to the specified stat.
Definition: living.cpp:264
get_message_face
const Face * get_message_face(const GeneralMessage *message)
Get a message's face.
Definition: readable.cpp:2086
describe_item
StringBuffer * describe_item(const object *op, const object *owner, int use_media_tags, StringBuffer *buf)
Describes an item, in all its details.
Definition: item.cpp:951
ticks_to_seconds
float ticks_to_seconds(int ticks)
Definition: time.cpp:386
d
How to Install a Crossfire Server on you must install a python script engine on your computer Python is the default script engine of Crossfire You can find the python engine you have only to install them The VisualC Crossfire settings are for d
Definition: INSTALL_WIN32.txt:13
move_on_func
method_ret(* move_on_func)(object *, object *, object *)
Definition: ob_methods.h:33
map_remove_unique_files
void map_remove_unique_files(const mapstruct *map)
Remove files containing the map's unique items.
Definition: map.cpp:2651
dump_gods
void dump_gods(void)
Prints all gods to stderr.
Definition: holy.cpp:367
path
pluglist shows those as well as a short text describing each the list will simply appear empty The keyword for the Python plugin is Python plugout< keyword > Unloads a given identified by its _keyword_ So if you want to unload the Python you need to do plugout Python plugin< libname > Loads a given whose _filename_ is libname So in the case of you d have to do a plugin cfpython so Note that all filenames are relative to the default plugin path(SHARE/plugins). Console messages. ----------------- When Crossfire starts
object_find_by_type_and_race
object * object_find_by_type_and_race(const object *who, int type, const char *race)
Find object in inventory by type and race.
Definition: object.cpp:4133
animate_object
void animate_object(object *op, int dir)
Updates the face-variable of an object.
Definition: anim.cpp:44
init_experience
void init_experience(void)
This loads the experience table from the exp_table file.
Definition: exp.cpp:167
remove_directory
void remove_directory(const char *path)
This function removes everything in the directory, and the directory itself.
Definition: porting.cpp:117
strtoktolin
char * strtoktolin(const char *buf1, const char *buf2, char *retbuf, size_t size)
Takes a string in buf1 and separates it into a list of strings delimited by buf2.
Definition: readable.cpp:684
dump_all_archetypes
void dump_all_archetypes(void)
Dumps all archetypes to debug-level output.
Definition: arch.cpp:148
get_thaco_bonus
int get_thaco_bonus(int stat)
Definition: living.cpp:2369
yyrestart
void yyrestart(FILE *input_file)
Immediately switch to a different input stream.
Definition: loader.cpp:38287
StringBuffer
A buffer that will be expanded as content is added to it.
Definition: stringbuffer.cpp:25
map_get_path
const char * map_get_path(const object *item)
Return the map path on which the specified item is.
Definition: map.cpp:2676
stringbuffer_delete
void stringbuffer_delete(StringBuffer *sb)
Definition: stringbuffer.cpp:71
mapfile_load
mapstruct * mapfile_load(const char *map, int flags)
Opens the file "filename" and reads information about the map from the given file,...
Definition: map.cpp:1228
recipe
One alchemy recipe.
Definition: recipe.h:10
dump_monster_treasure
void dump_monster_treasure(const char *name)
For debugging purposes.
Definition: treasure.cpp:1244
object_handle_death_animation
void object_handle_death_animation(object *op)
Definition: object.cpp:5410
object_insert_in_map_at
object * object_insert_in_map_at(object *op, mapstruct *m, object *originator, int flag, int x, int y)
Same as object_insert_in_map() except it handle separate coordinates and do a clean job preparing mul...
Definition: object.cpp:2100
dump_alchemy_costs
void dump_alchemy_costs(void)
Dumps to output all costs of recipes.
Definition: recipe.cpp:588
method_ret
char method_ret
Define some standard return values for callbacks which don't need to return any other results.
Definition: ob_methods.h:14
get_friends_of
objectlink * get_friends_of(const object *owner)
Get a list of friendly objects for the specified owner.
Definition: friend.cpp:117
region
This is a game region.
Definition: map.h:274
object_get_owner
object * object_get_owner(object *op)
Returns the object which this object marks as being the owner.
Definition: object.cpp:804
first_arch_pass
void first_arch_pass(FILE *fp, const char *filename)
set_variable
int set_variable(object *op, const char *buf)
This takes a buffer, scans it for variables, and sets those variables as appropriate in op.
Definition: loader.cpp:39047
get_next_archetype
archetype * get_next_archetype(archetype *current)
Definition: assets.cpp:261
object_present_in_ob_by_name
object * object_present_in_ob_by_name(int type, const char *str, const object *op)
Searches for any objects with a matching type & name variable in the inventory of the given object.
Definition: object.cpp:3203
set_abs_magic
void set_abs_magic(object *op, int magic)
Sets magical bonus in an object, and recalculates the effect on the armour variable,...
Definition: treasure.cpp:618
check_exp_adjust
int64_t check_exp_adjust(const object *op, int64_t exp)
Returns the maximum experience the object can gain or lose.
Definition: living.cpp:2102
object_value_set
bool object_value_set(const object *op, const char *const key)
Determine if an extra value is set.
Definition: object.cpp:4376
struct_dialog_message
One message a NPC can react to.
Definition: dialog.h:26
base_type
static ob_methods base_type
Definition: ob_methods.cpp:27
object_set_enemy
void object_set_enemy(object *op, object *enemy)
Sets the enemy of an object.
Definition: object.cpp:915
replace_unprintable_chars
void replace_unprintable_chars(char *buf)
Replaces any unprintable character in the given buffer with a space.
Definition: utils.cpp:447
object_find_by_type_subtype
object * object_find_by_type_subtype(const object *who, int type, int subtype)
Find object in inventory.
Definition: object.cpp:4301
calc_perm_exp
void calc_perm_exp(object *op)
Ensure that the permanent experience requirements in an exp object are met.
Definition: living.cpp:1914
is_magical
int is_magical(const object *op)
Checks whether object is magical.
Definition: item.cpp:1232
object_create_arch
object * object_create_arch(archetype *at)
Create a full object using the given archetype.
Definition: arch.cpp:296
get_random_dir
int get_random_dir(void)
Returns a random direction (1..8).
Definition: utils.cpp:400
did_make_save
int did_make_save(const object *op, int level, int bonus)
This function takes an object (monster/player, op), and determines if it makes a basic save throw by ...
Definition: living.cpp:2293
object_clear
void object_clear(object *op)
Frees everything allocated by an object, and also clears all variables and flags to default settings.
Definition: object.cpp:983
push_button
void push_button(object *op)
Push the specified object.
Definition: button.cpp:149
get_weekday
const char * get_weekday(const int index)
give access to weekday names
Definition: time.cpp:120
i18n_init
void i18n_init(void)
Initializes the i18n subsystem.
Definition: languages.cpp:131
get_sleep_remaining
long get_sleep_remaining(void)
Definition: time.cpp:189
ob_apply
method_ret ob_apply(object *op, object *applier, int aflags)
Apply an object by running an event hook or an object method.
Definition: ob_methods.cpp:44
give_skill_by_name
object * give_skill_by_name(object *op, const char *skill_name)
Given the skill name skill_name, we find the skill archetype/object, set appropriate values,...
Definition: living.cpp:1788
mapstruct
This is a game-map.
Definition: map.h:315
trigger_connected
void trigger_connected(objectlink *ol, object *cause, const int state)
Trigger every object in an objectlink.
Definition: button.cpp:41
object_get_env_recursive
object * object_get_env_recursive(object *op)
Utility function.
Definition: object.cpp:590
map_find_by_archetype
object * map_find_by_archetype(mapstruct *m, int x, int y, const archetype *at)
Searches for any objects with a matching archetype at the given map and coordinates.
Definition: object.cpp:3118
atnr_is_dragon_enabled
int atnr_is_dragon_enabled(int attacknr)
Determine if the attacktype represented by the specified attack-number is enabled for dragon players.
Definition: player.cpp:103
object_free_key_values
void object_free_key_values(object *op)
Zero the key_values on op, decrementing the shared-string refcounts and freeing the links.
Definition: object.cpp:954
sstring
const typedef char * sstring
Definition: sstring.h:2
get_god_for_race
const char * get_god_for_race(const char *race)
Returns a string that is the name of the god that should be natively worshipped by a creature of who ...
Definition: holy.cpp:90
get_fear_bonus
int get_fear_bonus(int stat)
Definition: living.cpp:2397
get_ob_diff
void get_ob_diff(StringBuffer *sb, const object *op, const object *op2)
Returns a pointer to a static string which contains all variables which are different in the two give...
Definition: object.cpp:4986
get_region_by_map
region * get_region_by_map(mapstruct *m)
Gets a region from a map.
Definition: region.cpp:71
Animations
This represents one animation.
Definition: face.h:25
LOG
void LOG(LogLevel logLevel, const char *format,...) PRINTF_ARGS(2
register_move_on
void register_move_on(int ob_type, move_on_func method)
Registers the move_on method for the given type.
Definition: ob_types.cpp:89
is_dragon_pl
int is_dragon_pl(const object *op)
Checks if player is a dragon.
Definition: player.cpp:122
object_update_turn_face
void object_update_turn_face(object *op)
If an object with the IS_TURNABLE() flag needs to be turned due to the closest player being on the ot...
Definition: object.cpp:1332
change_abil
int change_abil(object *op, object *tmp)
Permanently alters an object's stats/flags based on another object.
Definition: living.cpp:394
recipe_get_face
const Face * recipe_get_face(const recipe *rp)
Return the best face associated with a recipe.
Definition: recipe.cpp:920
on_same_map
int on_same_map(const object *op1, const object *op2)
Checks whether 2 objects are on the same map or not.
Definition: map.cpp:2611
remove_friendly_object
void remove_friendly_object(object *op)
Removes the specified object from the linked list of friendly objects.
Definition: friend.cpp:52
rv_vector
This is used by get_rangevector to determine where the other creature is.
Definition: map.h:370
artifact_compute_chance_for_item
void artifact_compute_chance_for_item(const object *op, const artifact *art, int *numerator, int *denominator)
Compute the chance for a specified item to become the specified artifact.
Definition: artifact.cpp:133
get_typedata
const typedata * get_typedata(int itemtype)
Definition: item.cpp:323
clean_object
void clean_object(object *op)
Remove and free all objects in the inventory of the given object.
Definition: map.cpp:1599
yyget_text
char * yyget_text(void)
Get the current token.
Definition: loader.cpp:38730
object_present_in_ob
object * object_present_in_ob(uint8_t type, const object *op)
Searches for any objects with a matching type variable in the inventory of the given object.
Definition: object.cpp:3168
yyget_in
FILE * yyget_in(void)
Get the input stream.
Definition: loader.cpp:38705
object_find_by_type_without_flags
object * object_find_by_type_without_flags(const object *who, int type, int *flags, int num_flags)
Find an object in inventory that does not have any of the provided flags set.
Definition: object.cpp:4004
reset_sleep
void reset_sleep(void)
Initialise all variables used in the timing routines.
Definition: time.cpp:134
operate_altar
int operate_altar(object *altar, object **sacrifice)
Checks if sacrifice was accepted and removes sacrificed objects.
Definition: button.cpp:463
register_process
void register_process(int ob_type, process_func method)
Registers the process method for the given type.
Definition: ob_types.cpp:71
text
**Media tags please refer to the protocol file in doc Developers protocol Quick for your pleasure an example[/b][i] This is an old full of dirt and partially destroyed[hand] My dear as you two years i had to leave quickly Words have come to me of powerful magic scrolls discovered in an old temple by my uncle I have moved to study them I not forgot your knowledge in ancient languages I need your help for[print][b] Some parts of document are to damaged to be readable[/b][arcane] Arghis[color=Red] k h[color=dark slate blue] ark[color=#004000] fido[/color][hand] please come as fast as possible my friend[print][b] The bottom of letter seems deliberatly shredded What is but not limited book signs rules Media tags are made of with inside them the name of tag and optional parameters for the tag Unlike html or there is no notion of opening and closing tag A client not able to understand a tag is supposed to ignore it when server is communicating with and old client that does not understand a a specific extended text
Definition: media-tags.txt:35
get_region_by_name
region * get_region_by_name(const char *region_name)
Gets a region by name.
Definition: region.cpp:45
player_set_dragon_title
void player_set_dragon_title(struct player *pl, int level, const char *attack, int skin_resist)
Updates the title of a dragon player to reflect the current level, attack type, and resistances.
Definition: player.cpp:202
object_sub_weight
void object_sub_weight(object *op, signed long weight)
Recursively (outwards) subtracts a number from the weight of an object (and what is carried by it's e...
Definition: object.cpp:1807
check_trigger
int check_trigger(object *op, object *cause)
Definition: button.cpp:518
player_set_own_title
void player_set_own_title(struct player *pl, const char *title)
Sets the custom title.
Definition: player.cpp:272
object_find_by_type_and_skill
object * object_find_by_type_and_skill(const object *who, int type, const char *skill)
Find object in inventory by type and skill.
Definition: object.cpp:4183
i18n_list_languages
void i18n_list_languages(object *who)
List all languages for who.
Definition: languages.cpp:96
get_objectlink
objectlink * get_objectlink(void)
Allocates a new objectlink structure, initialises it, and returns a pointer to it.
Definition: links.cpp:33
check_exp_loss
int64_t check_exp_loss(const object *op, int64_t exp)
This function checks to make sure that object 'op' can lose 'exp' experience.
Definition: living.cpp:2077
stats
Player Stats effect how well a character can survie and interact inside the crossfire world This section discusses the various stats
Definition: stats.txt:2
init_ob_method_struct
void init_ob_method_struct(ob_methods *methods, ob_methods *fallback)
Initializes a ob_methods struct.
Definition: ob_types.cpp:32
level
int level
Definition: readable.cpp:1563
object_copy
void object_copy(const object *src_ob, object *dest_ob)
Copy object first frees everything allocated by the second object, and then copies the contents of th...
Definition: object.cpp:1192
i18n_get_language_code
sstring i18n_get_language_code(language_t language)
Return the code of a specified language.
Definition: languages.cpp:86
readable_message_type
Struct to store the message_type and message_subtype for signs and books used by the player.
Definition: book.h:36
identify
object * identify(object *op)
Identifies an item.
Definition: item.cpp:1426
set_attr_value
void set_attr_value(living *stats, int attr, int8_t value)
Sets Str/Dex/con/Wis/Cha/Int/Pow in stats to value, depending on what attr is (STR to POW).
Definition: living.cpp:218
random_roll
int random_roll(int min, int max, const object *op, int goodbad)
Roll a random number between min and max.
Definition: utils.cpp:42
dump_friendly_objects
void dump_friendly_objects(void)
Dumps all friendly objects.
Definition: friend.cpp:70
ihypot
int ihypot(int a, int b)
Rough estimate of hypot(a, b).
Definition: utils.cpp:570
get_cleric_chance
int get_cleric_chance(int stat)
Definition: living.cpp:2381
generate_treasure
object * generate_treasure(treasurelist *t, int difficulty)
Generate a treasure from a list generating a single item.
Definition: treasure.cpp:295
stringbuffer_append_string
void stringbuffer_append_string(StringBuffer *sb, const char *str)
Definition: stringbuffer.cpp:95
stringbuffer_append_stringbuffer
void stringbuffer_append_stringbuffer(StringBuffer *sb, const StringBuffer *sb2)
Definition: stringbuffer.cpp:165
i18n_free
void i18n_free(void)
Clears all i18n-related data.
Definition: languages.cpp:210
book_overflow
int book_overflow(const char *buf1, const char *buf2, size_t booksize)
Checks if buf1 and buf2 can be combined.
Definition: readable.cpp:719
object_find_by_type_and_slaying
object * object_find_by_type_and_slaying(const object *who, int type, const char *slaying)
Find object in inventory by type and slaying.
Definition: object.cpp:4158
delete_map
void delete_map(mapstruct *m)
Frees the map, including the mapstruct.
Definition: map.cpp:1708
object_matches_pickup_mode
int object_matches_pickup_mode(const object *item, int mode)
Checks if an item matches a specific pickup mode.
Definition: c_object.cpp:656
map_find_by_type
object * map_find_by_type(mapstruct *m, int x, int y, uint8_t type)
Searches for any objects with a matching type variable at the given map and coordinates.
Definition: object.cpp:3145
object_set_msg
void object_set_msg(object *op, const char *msg)
Set the message field of an object.
Definition: object.cpp:4811
register_apply
void register_apply(int ob_type, apply_func method)
Registers the apply method for the given type.
Definition: ob_types.cpp:62
free_all_artifacts
void free_all_artifacts(void)
Free all artifact-related information.
Definition: artifact.cpp:117
skill
skill
Definition: arch-handbook.txt:585
get_message_title
sstring get_message_title(const GeneralMessage *message)
Get a message's title.
Definition: readable.cpp:2068
path_combine_and_normalize
char * path_combine_and_normalize(const char *src, const char *dst, char *path, size_t size)
Combines the 2 paths.
Definition: path.cpp:172
object_copy_no_speed
void object_copy_no_speed(const object *src_ob, object *dest_ob)
Copy object first frees everything allocated by the second object, and then copies the contents of th...
Definition: object.cpp:1061
object_find_by_type_and_name
object * object_find_by_type_and_name(const object *who, int type, const char *name)
Find object in inventory by type and name.
Definition: object.cpp:4108
object_set_cheat
void object_set_cheat(object *op)
object_set_cheat(object) sets the cheat flag (WAS_WIZ) in the object and in all it's inventory (recur...
Definition: object.cpp:3274
dump_all_maps
void dump_all_maps(void)
Prints out debug-information about all maps.
Definition: map.cpp:268
a
Magical Runes Runes are magical inscriptions on the dungeon which cast a spell or detonate when something steps on them Flying objects don t detonate runes Beware ! Runes are invisible most of the time They are only visible occasionally ! There are several runes which are there are some special runes which may only be called with the invoke and people may apply it to read it Maybe useful for mazes ! This rune will not nor is it ordinarily invisible Partial Visibility of they ll be visible only part of the time They have a(your level/2) chance of being visible in any given round
get_cha_bonus
int get_cha_bonus(int stat)
Definition: living.cpp:2361
object_sum_weight
signed long object_sum_weight(object *op)
object_sum_weight() is a recursive function which calculates the weight an object is carrying.
Definition: object.cpp:568
fatal_error
fatal_error
Fatal variables; used as arguments to fatal().
Definition: define.h:47
find_recipe_for_tool
recipe * find_recipe_for_tool(const char *tool, recipe *from)
Find a recipe for a specified tool.
Definition: recipe.cpp:894
find_treasure_by_name
archetype * find_treasure_by_name(const treasure *t, const char *name, int depth)
Find a treasure with a matching name.
Definition: recipe.cpp:422
object_decrease_nrof
object * object_decrease_nrof(object *op, uint32_t i)
Decreases a specified number from the amount of an object.
Definition: object.cpp:2676
object_fix_multipart
void object_fix_multipart(object *tmp)
Ensures specified object has its more parts correctly inserted in map.
Definition: object.cpp:4685
tick_game_time
void tick_game_time(void)
Definition: time.cpp:184
object_set_owner
void object_set_owner(object *op, object *owner)
Sets the owner and sets the skill and exp pointers to owner's current skill and experience objects.
Definition: object.cpp:840
object_find_by_tag
object * object_find_by_tag(const object *who, tag_t tag)
Find object in inventory.
Definition: object.cpp:4060
create_archetype_by_object_name
object * create_archetype_by_object_name(const char *name)
Creates an object given the name that appears during the game (for example, "writing pen" instead of ...
Definition: arch.cpp:114
object_find_multi_free_spot_around
int object_find_multi_free_spot_around(const object *ob, const object *gen, int16_t *hx, int16_t *hy)
Sets hx and hy to the coords to insert a possibly multi-tile ob at, around gen.
Definition: object.cpp:3296
has_ability
int has_ability(const object *ob)
Checks whether object has innate abilities (spell/spellbook in inventory).
Definition: exp.cpp:153
get_jail_exit
object * get_jail_exit(object *op)
Returns an object which is an exit through which the player represented by op should be sent in order...
Definition: region.cpp:252
dump_faces
void dump_faces(void)
Dump all faces to stderr, for debugging purposes.
Definition: image.cpp:159
code
Crossfire Architecture the general intention is to enhance the enjoyability and playability of CF In this code
Definition: arch-handbook.txt:14
map_find_by_flag
object * map_find_by_flag(mapstruct *map, int x, int y, int flag)
Finds an object in a map tile by flag number.
Definition: map.cpp:2634
ob_blocked
int ob_blocked(const object *ob, mapstruct *m, int16_t x, int16_t y)
Returns true if the given object can't fit in the given spot.
Definition: map.cpp:491
init_readable
void init_readable(void)
Initialize linked lists utilized by message functions in tailor_readable_ob()
Definition: readable.cpp:904
check_altar_sacrifice
int check_altar_sacrifice(const object *altar, const object *sacrifice, int remove_others, int *toremove)
Checks whether the altar has enough to sacrifice.
Definition: button.cpp:347
check_path
int check_path(const char *name, int prepend_dir)
This function checks if a file with the given path exists.
Definition: map.cpp:201
object_copy_owner
void object_copy_owner(object *op, object *clone)
Set the owner to clone's current owner and set the skill and experience objects to clone's objects (t...
Definition: object.cpp:893
find_archetype
archetype * find_archetype(const char *name)
Definition: assets.cpp:265
ob_move_on
method_ret ob_move_on(object *op, object *victim, object *originator)
Makes an object move on top of another one.
Definition: ob_methods.cpp:111
load_image_info
void load_image_info(FILE *file, const char *filename)
add_friendly_object
void add_friendly_object(object *op)
Add a new friendly object to the list of friendly objects.
Definition: friend.cpp:32
materialtype_t
One material type.
Definition: material.h:32
has_carried_lights
int has_carried_lights(const object *op)
Checks if op has a light source.
Definition: los.cpp:346
destination_dir
const char * destination_dir
Root destination dir.
Definition: gridarta-types-convert.cpp:32
set_map_reset_time
void set_map_reset_time(mapstruct *map)
Updates the map's timeout.
Definition: map.cpp:2245
get_season_name
const char * get_season_name(const int index)
give access to season names
Definition: time.cpp:127
treasure
treasure is one element in a linked list, which together consist of a complete treasure-list.
Definition: treasure.h:63
list
How to Install a Crossfire Server on you must install a python script engine on your computer Python is the default script engine of Crossfire You can find the python engine you have only to install them The VisualC Crossfire settings are for but you habe then to change the pathes in the VC settings Go in Settings C and Settings Link and change the optional include and libs path to the new python installation path o except the maps ! You must download a map package and install them the share folder Its must look like doubleclick on crossfire32 dsw There are projects in your libcross lib and plugin_python You need to compile all Easiest way is to select the plugin_python ReleaseLog as active this will compile all others too Then in Visual C press< F7 > to compile If you don t have an appropriate compiler you can try to get the the VC copies the crossfire32 exe in the crossfire folder and the plugin_python dll in the crossfire share plugins folder we will remove it when we get time for it o Last showing lots of weird write to the Crossfire mailing list
Definition: INSTALL_WIN32.txt:50
object_dump
void object_dump(const object *op, StringBuffer *sb)
Dumps an object.
Definition: object.cpp:645
LogLevel
LogLevel
Log levels for the LOG() function.
Definition: logger.h:10
artifact
This is one artifact, ie one special item.
Definition: artifact.h:14
object_create_clone
object * object_create_clone(object *asrc)
Create clone from object to another.
Definition: object.cpp:3909
describe_monster
StringBuffer * describe_monster(const object *op, int use_media_tags, StringBuffer *buf)
Describes a monster.
Definition: item.cpp:777
strip_endline
void strip_endline(char *buf)
Removes endline from buffer (modified in place).
Definition: utils.cpp:314
stringbuffer_append_printf
void stringbuffer_append_printf(StringBuffer *sb, const char *format,...)
Definition: stringbuffer.cpp:138
create_archetype
object * create_archetype(const char *name)
Finds which archetype matches the given name, and returns a new object containing a copy of the arche...
Definition: arch.cpp:276
dump_abilities
void dump_abilities(void)
Dump to standard out the abilities of all monsters.
Definition: info.cpp:52
bonus
Player Stats effect how well a character can survie and interact inside the crossfire world This section discusses the various what they and how they effect the player s actions Also in this section are the stat modifiers that specific classes professions bring Player and sps the current and maximum the Current and Maximum The Current Sp can go somewhat negative When Sp is negative not all spells can be and a more negative Sp makes spell casting less likey to succeed can affect Damage and how the characters as well as how often the character can attack this affects the prices when buying and selling items if this drops the player will start losing hit points wd Cleric or Dwarf sm Elf wd Fireborn ft Human ra Mage C Monk se Ninja hi Priest C Quetzalcoatl mw Swashbuckler si Thief st Viking ba Warrior or Wizard C Wraith C Class Prof Str Dex Con Wis Cha Int Pow Net Skills Enclosed are codes used for the skills above The ones in and fighting should all be pretty self explanatory For the other a brief description is for a more detailed look at the skills doc file Skill remove use magic items phys no fire cold Fireborns are supposed to be fire spirits They re closely in tune with magic and are powerful and learn magic easily Being fire they are immune to fire and and vulnerable to cold They are vulnerable to ghosthit and drain because being mostly non anything which strikes directly at the spirit hits them harder race attacktype restrictions immunities prot vuln Quetzalcoatl physical no armour fire cold Quetzalcoatl s are now born knowing the spell of burning but because of their negative wisdom bonus
Definition: stats.txt:176
save_map
int save_map(mapstruct *m, int flag)
Saves a map to file.
Definition: map.cpp:1407
get_turn_bonus
int get_turn_bonus(int stat)
Definition: living.cpp:2385
try_find_archetype
archetype * try_find_archetype(const char *name)
Definition: assets.cpp:269
try_find_animation
Animations * try_find_animation(const char *name)
Definition: assets.cpp:277
free_dialog_information
void free_dialog_information(object *op)
Frees obj::dialog_information.
Definition: dialog.cpp:34
get_map_from_coord
mapstruct * get_map_from_coord(mapstruct *m, int16_t *x, int16_t *y)
This is basically the same as out_of_map above(), but instead we return NULL if no map is valid (coor...
Definition: map.cpp:2334
get_empty_treasure
treasure * get_empty_treasure()
Allocate and return the pointer to an empty treasure structure.
Definition: treasure.cpp:1380
name_to_material
materialtype_t * name_to_material(const char *name)
Convert materialname to materialtype_t.
Definition: utils.cpp:248
get_dam_bonus
int get_dam_bonus(int stat)
Definition: living.cpp:2389
remove_statbonus
void remove_statbonus(object *op)
Subtracts stat-bonuses given by the class which the player has chosen.
Definition: living.cpp:845
object_merge
object * object_merge(object *op, object *top)
This function goes through all objects below and including top, and merges op to the first matching o...
Definition: object.cpp:2051
init_archetype_pointers
void init_archetype_pointers(void)
Initialize global archtype pointers:
Definition: treasure.cpp:62
BufferReader
Definition: bufferreader.cpp:21
use_trigger
void use_trigger(object *op)
Toggles the state of specified button.
Definition: button.cpp:254
get_region_from_string
region * get_region_from_string(const char *name)
Tries to find a region that 'name' corresponds to.
Definition: region.cpp:116
time_info
void time_info(object *op)
Players wants to know the time.
Definition: time.cpp:298
stringbuffer_append_multiline_block
void stringbuffer_append_multiline_block(StringBuffer *sb, const char *start, const char *content, const char *end)
Definition: stringbuffer.cpp:196
clean_friendly_list
void clean_friendly_list(void)
It traverses the friendly list removing objects that should not be here (ie, do not have friendly fla...
Definition: friend.cpp:80
print_los
void print_los(object *op)
Debug-routine which dumps the array which specifies the visible area of a player.
Definition: los.cpp:665
init_formulae
void init_formulae(BufferReader *reader, const char *filename)
Builds up the lists of formula from the file in the libdir.
Definition: recipe.cpp:166
link_player_skills
void link_player_skills(object *op)
This function goes through the player inventory and sets up the last_skills[] array in the player obj...
Definition: player.cpp:287
get_readable_message_type
const readable_message_type * get_readable_message_type(object *readable)
Get the readable type for an object (hopefully book).
Definition: readable.cpp:2055
find_dir_2
int find_dir_2(int x, int y)
Computes a direction which you should travel to move of x and y.
Definition: object.cpp:3677
rndm
int rndm(int min, int max)
Returns a number between min and max.
Definition: utils.cpp:162
object_find_by_name_global
object * object_find_by_name_global(const char *str)
Finds an object by name.
Definition: object.cpp:747
remove_button_link
void remove_button_link(object *op)
Remove the object from the linked lists of buttons in the map.
Definition: button.cpp:693
change_map_light
int change_map_light(mapstruct *m, int change)
Used to change map light level (darkness) up or down.
Definition: map.cpp:2006
free_arch
void free_arch(archetype *at)
Frees archetype.
Definition: arch.cpp:167
get_region_struct
region * get_region_struct(void)
Allocates and zeros a region struct, this isn't free()'d anywhere, so might be a memory leak,...
Definition: region.cpp:293
object_find_free_spot
int object_find_free_spot(const object *ob, mapstruct *m, int x, int y, int start, int stop)
object_find_free_spot(object, map, x, y, start, stop) will search for a spot at the given map and coo...
Definition: object.cpp:3559
drain_stat
void drain_stat(object *op)
Drains a random stat from op.
Definition: living.cpp:716
make_sure_not_seen
void make_sure_not_seen(const object *op)
The object which is supposed to be visible through walls has just been removed from the map,...
Definition: los.cpp:718
query_name
void query_name(const object *op, char *buf, size_t size)
Describes an item.
Definition: item.cpp:588
is_valid_types_gen.type
list type
Definition: is_valid_types_gen.py:25
save_object_in_sb
void save_object_in_sb(StringBuffer *sb, object *op, const int flag)
Store a string representation of op in sb.
Definition: object.cpp:5311
isqrt
int isqrt(int n)
Compute the square root.
Definition: utils.cpp:562
player_lvl_adj
void player_lvl_adj(object *who, object *op)
For the new exp system.
Definition: living.cpp:1830
free_all_god
void free_all_god(void)
Frees all god information.
Definition: holy.cpp:327
split_string
size_t split_string(char *str, char *array[], size_t array_size, char sep)
Splits a string delimited by passed in sep value into characters into an array of strings.
Definition: utils.cpp:473
face
in that case they will be relative to whatever the PWD of the crossfire server process is You probably shouldn though Notes on Specific and settings file datadir Usually usr share crossfire Contains data that the server does not need to modify while such as the etc A default install will pack the and treasurelist definitions into a single or trs file and the graphics into a face(metadata) and .tar(bitmaps) file
find_artifactlist
artifactlist * find_artifactlist(int type)
Finds the artifact list for a certain item type.
Definition: artifact.cpp:574
jump_time
void jump_time(void)
Definition: time.cpp:198
is_friendly
int is_friendly(const object *op)
Checks if the given object is already in the friendly list or not.
Definition: friend.cpp:108
update_button
void update_button(object *op)
Updates everything connected with the button op.
Definition: button.cpp:162
apply_func
method_ret(* apply_func)(object *, object *, int)
Typedefs for ob_methods.
Definition: ob_methods.h:30
object_free
void object_free(object *ob, int flags)
Frees everything allocated by an object, removes it from the list of used objects,...
Definition: object.cpp:1592