1 | /* |
1 | /* |
2 | * This file is part of Crossfire TRT, the Roguelike Realtime MORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team |
4 | * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * |
5 | * |
6 | * Crossfire TRT is free software: you can redistribute it and/or modify |
6 | * Deliantra is free software: you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by |
7 | * it under the terms of the GNU General Public License as published by |
8 | * the Free Software Foundation, either version 3 of the License, or |
8 | * the Free Software Foundation, either version 3 of the License, or |
9 | * (at your option) any later version. |
9 | * (at your option) any later version. |
10 | * |
10 | * |
11 | * This program is distributed in the hope that it will be useful, |
11 | * This program is distributed in the hope that it will be useful, |
… | |
… | |
14 | * GNU General Public License for more details. |
14 | * GNU General Public License for more details. |
15 | * |
15 | * |
16 | * You should have received a copy of the GNU General Public License |
16 | * You should have received a copy of the GNU General Public License |
17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
18 | * |
18 | * |
19 | * The authors can be reached via e-mail to <crossfire@schmorp.de> |
19 | * The authors can be reached via e-mail to <support@deliantra.net> |
20 | */ |
20 | */ |
21 | |
21 | |
22 | /* alchemy.c */ |
22 | /* alchemy.c */ |
23 | int need_identify (const object *obj); |
23 | int need_identify (const object *obj); |
24 | int apply_shop_mat (object *shop_mat, object *op); |
24 | int apply_shop_mat (object *shop_mat, object *op); |
25 | const char *cost_string_from_value (sint64 cost, int approx); |
25 | const char *cost_string_from_value (sint64 cost, int approx); |
26 | void pay_player (object *pl, sint64 amount); |
26 | void pay_player (object *pl, sint64 amount); |
27 | sint64 pay_player_arch (object *pl, const char *arch, sint64 amount); |
27 | sint64 pay_player_arch (object *pl, const char *arch, sint64 amount); |
28 | void attempt_do_alchemy (object *caster, object *cauldron); |
28 | void attempt_do_alchemy (object *caster, object *cauldron, object *skill); |
29 | int content_recipe_value (object *op); |
29 | int content_recipe_value (object *op); |
30 | int numb_ob_inside (object *op); |
30 | int numb_ob_inside (object *op); |
31 | object *attempt_recipe (object *caster, object *cauldron, int ability, recipe *rp, int nbatches); |
31 | object *attempt_recipe (object *caster, object *cauldron, int ability, recipe *rp, int nbatches); |
32 | void adjust_product (object *item, int lvl, int yield); |
32 | void adjust_product (object *item, int lvl, int yield); |
33 | object *make_item_from_recipe (object *cauldron, recipe *rp); |
33 | object *make_item_from_recipe (object *cauldron, recipe *rp); |
… | |
… | |
43 | int apply_potion (object *op, object *tmp); |
43 | int apply_potion (object *op, object *tmp); |
44 | int prepare_weapon (object *op, object *improver, object *weapon); |
44 | int prepare_weapon (object *op, object *improver, object *weapon); |
45 | int improve_weapon (object *op, object *improver, object *weapon); |
45 | int improve_weapon (object *op, object *improver, object *weapon); |
46 | int check_improve_weapon (object *op, object *tmp); |
46 | int check_improve_weapon (object *op, object *tmp); |
47 | int improve_armour (object *op, object *improver, object *armour); |
47 | int improve_armour (object *op, object *improver, object *armour); |
48 | int convert_item (object *item, object *converter); |
|
|
49 | int apply_container (object *op, object *sack); |
48 | int apply_container (object *op, object *sack); |
50 | int esrv_apply_container (object *op, object *sack); |
49 | int esrv_apply_container (object *op, object *sack); |
51 | void move_apply (object *trap, object *victim, object *originator); |
50 | void move_apply (object *trap, object *victim, object *originator); |
52 | void do_learn_spell (object *op, object *spell, int special_prayer); |
51 | void do_learn_spell (object *op, object *spell, int special_prayer); |
53 | void do_forget_spell (object *op, const char *spell); |
52 | void do_forget_spell (object *op, const char *spell); |
… | |
… | |
95 | int is_aimed_missile (object *op); |
94 | int is_aimed_missile (object *op); |
96 | |
95 | |
97 | /* build_map.c */ |
96 | /* build_map.c */ |
98 | int can_build_over (struct mapdef *map, object *tmp, short x, short y); |
97 | int can_build_over (struct mapdef *map, object *tmp, short x, short y); |
99 | void remove_marking_runes (struct mapdef *map, short x, short y); |
98 | void remove_marking_runes (struct mapdef *map, short x, short y); |
100 | int find_unused_connected_value (struct mapdef *map); |
|
|
101 | int find_or_create_connection_for_map (object *pl, short x, short y, object *rune); |
|
|
102 | object *get_connection_rune (object *pl, short x, short y); |
99 | object *get_connection_rune (object *pl, short x, short y); |
103 | object *get_msg_book (object *pl, short x, short y); |
100 | object *get_msg_book (object *pl, short x, short y); |
104 | object *get_wall (struct mapdef *map, int x, int y); |
101 | object *get_wall (struct mapdef *map, int x, int y); |
105 | void fix_walls (maptile *map, int x, int y); |
102 | void fix_walls (maptile *map, int x, int y); |
106 | void fix_walls_around (maptile *map, int x, int y); |
103 | void fix_walls_around (maptile *map, int x, int y); |
… | |
… | |
133 | int command_version (object *op, char *params); |
130 | int command_version (object *op, char *params); |
134 | void bug_report (const char *reportstring); |
131 | void bug_report (const char *reportstring); |
135 | int command_statistics (object *pl, char *params); |
132 | int command_statistics (object *pl, char *params); |
136 | int command_fix_me (object *op, char *params); |
133 | int command_fix_me (object *op, char *params); |
137 | int command_players (object *op, char *paramss); |
134 | int command_players (object *op, char *paramss); |
138 | int command_logs (object *op, char *params); |
|
|
139 | int command_bowmode (object *op, char *params); |
135 | int command_bowmode (object *op, char *params); |
140 | int command_showpets (object *op, char *params); |
136 | int command_showpets (object *op, char *params); |
141 | int command_resistances (object *op, char *params); |
137 | int command_resistances (object *op, char *params); |
142 | int command_help (object *op, char *params); |
138 | int command_help (object *op, char *params); |
143 | int onoff_value (const char *line); |
139 | int onoff_value (const char *line); |
… | |
… | |
176 | int sack_can_hold (object *pl, object *sack, object *op, uint32 nrof); |
172 | int sack_can_hold (object *pl, object *sack, object *op, uint32 nrof); |
177 | void pick_up (object *op, object *alt); |
173 | void pick_up (object *op, object *alt); |
178 | int command_take (object *op, char *params); |
174 | int command_take (object *op, char *params); |
179 | void put_object_in_sack (object *op, object *sack, object *tmp, uint32 nrof); |
175 | void put_object_in_sack (object *op, object *sack, object *tmp, uint32 nrof); |
180 | void drop_object (object *op, object *tmp, uint32 nrof); |
176 | void drop_object (object *op, object *tmp, uint32 nrof); |
|
|
177 | void drop_object (object *dropper, object *obj); |
181 | void drop (object *op, object *tmp); |
178 | void drop (object *op, object *tmp); |
182 | int command_dropall (object *op, char *params); |
179 | int command_dropall (object *op, char *params); |
183 | int command_drop (object *op, char *params); |
180 | int command_drop (object *op, char *params); |
184 | int command_examine (object *op, char *params); |
181 | int command_examine (object *op, char *params); |
185 | object *find_marked_object (object *op); |
182 | object *find_marked_object (object *op); |
186 | void examine_monster (object *op, object *tmp); |
183 | void examine_monster (object *op, object *tmp); |
187 | const char *long_desc (object *tmp, object *pl); |
184 | const char *long_desc (object *tmp, object *pl); |
188 | void examine (object *op, object *tmp); |
185 | void examine (object *op, object *tmp); |
189 | void inventory (object *op, object *inv); |
|
|
190 | int command_pickup (object *op, char *params); |
186 | int command_pickup (object *op, char *params); |
191 | void set_pickup_mode (object *op, int i); |
187 | void set_pickup_mode (object *op, int i); |
192 | int command_search_items (object *op, char *params); |
188 | int command_search_items (object *op, char *params); |
193 | int command_rename_item (object *op, char *params); |
189 | int command_rename_item (object *op, char *params); |
194 | |
190 | |
… | |
… | |
197 | void remove_party (partylist *target_party); |
193 | void remove_party (partylist *target_party); |
198 | void obsolete_parties (void); |
194 | void obsolete_parties (void); |
199 | void add_kill_to_party (partylist *party, const char *killer, const char *dead, long exp); |
195 | void add_kill_to_party (partylist *party, const char *killer, const char *dead, long exp); |
200 | int confirm_party_password (object *op); |
196 | int confirm_party_password (object *op); |
201 | void receive_party_password (object *op, char k); |
197 | void receive_party_password (object *op, char k); |
202 | void send_party_message (object *op, char *msg); |
198 | void send_party_message (object *op, const char *msg); |
203 | int command_gsay (object *op, char *params); |
199 | int command_gsay (object *op, char *params); |
204 | int command_party (object *op, char *params); |
200 | int command_party (object *op, char *params); |
205 | |
201 | |
206 | /* c_range.c */ |
202 | /* c_range.c */ |
207 | int command_invoke (object *op, char *params); |
203 | int command_invoke (object *op, char *params); |
… | |
… | |
262 | /* daemon.c */ |
258 | /* daemon.c */ |
263 | FILE *BecomeDaemon (const char *filename); |
259 | FILE *BecomeDaemon (const char *filename); |
264 | |
260 | |
265 | /* disease.c */ |
261 | /* disease.c */ |
266 | int move_disease (object *disease); |
262 | int move_disease (object *disease); |
267 | int remove_symptoms (object *disease); |
|
|
268 | object *find_symptom (object *disease); |
|
|
269 | int check_infection (object *disease); |
|
|
270 | int infect_object (object *victim, object *disease, int force); |
263 | int infect_object (object *victim, object *disease, int force); |
271 | int do_symptoms (object *disease); |
|
|
272 | int grant_immunity (object *disease); |
|
|
273 | int move_symptom (object *symptom); |
264 | int move_symptom (object *symptom); |
274 | int check_physically_infect (object *victim, object *hitter); |
265 | int check_physically_infect (object *victim, object *hitter); |
275 | object *find_disease (object *victim); |
|
|
276 | int cure_disease (object *sufferer, object *caster, object *spell); |
266 | int cure_disease (object *sufferer, object *caster, object *spell); |
277 | int reduce_symptoms (object *sufferer, int reduction); |
|
|
278 | |
267 | |
279 | /* egoitem.c */ |
268 | /* egoitem.c */ |
280 | int create_artifact (object *op, const char *artifactname); |
269 | int create_artifact (object *op, const char *artifactname); |
281 | int apply_power_crystal (object *op, object *crystal); |
270 | int apply_power_crystal (object *op, object *crystal); |
282 | |
271 | |
… | |
… | |
284 | char *spool (char *bp, char *error); |
273 | char *spool (char *bp, char *error); |
285 | void check_score (object *op); |
274 | void check_score (object *op); |
286 | void display_high_score (object *op, int max, const char *match); |
275 | void display_high_score (object *op, int max, const char *match); |
287 | |
276 | |
288 | /* gods.c */ |
277 | /* gods.c */ |
289 | int lookup_god_by_name (const char *name); |
278 | int lookup_god_by_name (shstr_cmp name); |
290 | object *find_god (const char *name); |
279 | object *find_god (shstr_cmp name); |
291 | const char *determine_god (object *op); |
280 | shstr_tmp determine_god (object *op); |
292 | void pray_at_altar (object *pl, object *altar, object *skill); |
281 | void pray_at_altar (object *pl, object *altar, object *skill); |
293 | void become_follower (object *op, object *new_god); |
282 | void become_follower (object *op, object *new_god); |
294 | int worship_forbids_use (object *op, object *exp_obj, uint32 flag, const char *string); |
283 | int worship_forbids_use (object *op, object *exp_obj, uint32 flag, const char *string); |
295 | void stop_using_item (object *op, int type, int number); |
284 | void stop_using_item (object *op, int type, int number); |
296 | void update_priest_flag (object *god, object *exp_ob, uint32 flag); |
285 | void update_priest_flag (object *god, object *exp_ob, uint32 flag); |
297 | archetype *determine_holy_arch (object *god, const char *type); |
286 | archetype *determine_holy_arch (object *god, shstr_cmp type); |
298 | void god_intervention (object *op, object *god, object *skill); |
287 | void god_intervention (object *op, object *god, object *skill); |
299 | int god_examines_priest (object *op, object *god); |
288 | int god_examines_priest (object *op, object *god); |
300 | int god_examines_item (object *god, object *item); |
289 | int god_examines_item (object *god, object *item); |
301 | int get_god (object *priest); |
290 | int get_god (object *priest); |
302 | const char *get_god_for_race (const char *race); |
|
|
303 | int tailor_god_spell (object *spellop, object *caster); |
291 | int tailor_god_spell (object *spellop, object *caster); |
304 | |
292 | |
305 | /* init.c */ |
293 | /* init.c */ |
306 | void set_logfile (char *val); |
294 | void load_settings (void); |
307 | void call_version (void); |
295 | void load_materials (void); |
308 | void showscores (void); |
|
|
309 | void set_debug (void); |
|
|
310 | void unset_debug (void); |
|
|
311 | void set_mondebug (void); |
|
|
312 | void set_dumpmon1 (void); |
|
|
313 | void set_dumpmon2 (void); |
|
|
314 | void set_dumpmon3 (void); |
|
|
315 | void set_dumpmon4 (void); |
|
|
316 | void set_dumpmon5 (void); |
|
|
317 | void set_dumpmon6 (void); |
|
|
318 | void set_dumpmon7 (void); |
|
|
319 | void set_dumpmon8 (void); |
|
|
320 | void set_dumpmon9 (void); |
|
|
321 | void set_dumpmont (char *name); |
|
|
322 | void set_daemon (void); |
|
|
323 | void set_datadir (char *path); |
|
|
324 | void set_confdir (char *path); |
|
|
325 | void set_localdir (char *path); |
|
|
326 | void set_mapdir (char *path); |
|
|
327 | void set_archetypes (char *path); |
|
|
328 | void set_regions (char *path); |
|
|
329 | void set_treasures (char *path); |
|
|
330 | void set_uniquedir (char *path); |
|
|
331 | void set_templatedir (char *path); |
|
|
332 | void set_playerdir (char *path); |
|
|
333 | void set_tmpdir (char *path); |
|
|
334 | void showscoresparm (char *data); |
|
|
335 | void set_csport (char *val); |
|
|
336 | void init (int argc, char **argv); |
296 | void init (int argc, char **argv); |
337 | void usage (void); |
297 | void usage (void); |
338 | void help (void); |
298 | void help (void); |
339 | void init_beforeplay (void); |
299 | void init_beforeplay (void); |
340 | void init_signals (void); |
300 | void init_signals (void); |
… | |
… | |
347 | /* login.c */ |
307 | /* login.c */ |
348 | void delete_character (const char *name); |
308 | void delete_character (const char *name); |
349 | int verify_player (const char *name, char *password); |
309 | int verify_player (const char *name, char *password); |
350 | int check_name (player *me, const char *name); |
310 | int check_name (player *me, const char *name); |
351 | int create_savedir_if_needed (char *savedir); |
311 | int create_savedir_if_needed (char *savedir); |
352 | void destroy_object (object *op); |
|
|
353 | void copy_file (const char *filename, FILE *fpout); |
312 | void copy_file (const char *filename, FILE *fpout); |
354 | |
313 | |
355 | /* main.c */ |
314 | /* main.c */ |
356 | void server_tick (); |
315 | void server_tick (); |
357 | void version (object *op); |
316 | void version (object *op); |
… | |
… | |
433 | void move_golem (object *op); |
392 | void move_golem (object *op); |
434 | void control_golem (object *op, int dir); |
393 | void control_golem (object *op, int dir); |
435 | int summon_golem (object *op, object *caster, int dir, object *spob); |
394 | int summon_golem (object *op, object *caster, int dir, object *spob); |
436 | object *choose_cult_monster (object *pl, object *god, int summon_level); |
395 | object *choose_cult_monster (object *pl, object *god, int summon_level); |
437 | int summon_object (object *op, object *caster, object *spell_ob, int dir, const char *stringarg); |
396 | int summon_object (object *op, object *caster, object *spell_ob, int dir, const char *stringarg); |
438 | object *get_real_owner (object *ob); |
|
|
439 | int should_arena_attack (object *pet, object *owner, object *target); |
397 | int should_arena_attack (object *pet, object *owner, object *target); |
440 | |
398 | |
441 | /* player.c */ |
399 | /* player.c */ |
442 | player *find_player (const char *plname); |
400 | player *find_player (const char *plname); |
443 | player *find_player_partial_name (const char *plname); |
401 | player *find_player_partial_name (const char *plname); |
… | |
… | |
461 | int key_change_class (object *op, char key); |
419 | int key_change_class (object *op, char key); |
462 | int key_confirm_quit (object *op, char key); |
420 | int key_confirm_quit (object *op, char key); |
463 | void flee_player (object *op); |
421 | void flee_player (object *op); |
464 | int check_pick (object *op); |
422 | int check_pick (object *op); |
465 | object *find_arrow (object *op, const char *type); |
423 | object *find_arrow (object *op, const char *type); |
466 | object *find_better_arrow (object *op, object *target, const char *type, int *better); |
424 | object *find_better_arrow (object *op, object *target, shstr_cmp type, int *better); |
467 | object *pick_arrow_target (object *op, const char *type, int dir); |
425 | object *pick_arrow_target (object *op, shstr_cmp type, int dir); |
468 | int fire_bow (object *op, object *part, object *arrow, int dir, int wc_mod, sint16 sx, sint16 sy); |
426 | int fire_bow (object *op, object *part, object *arrow, int dir, int wc_mod, sint16 sx, sint16 sy); |
469 | int player_fire_bow (object *op, int dir); |
427 | int player_fire_bow (object *op, int dir); |
470 | void fire_misc_object (object *op, int dir); |
428 | void fire_misc_object (object *op, int dir); |
471 | bool fire (object *op, int dir); |
429 | bool fire (object *op, int dir); |
472 | object *find_key (object *pl, object *container, object *door); |
430 | object *find_key (object *pl, object *container, object *door); |
473 | bool move_player_attack (object *op, int dir); |
431 | bool move_player_attack (object *op, int dir); |
474 | bool move_player (object *op, int dir); |
432 | bool move_player (object *op, int dir); |
475 | bool handle_newcs_player (object *op); |
433 | bool handle_newcs_player (object *op); |
476 | int save_life (object *op); |
434 | int save_life (object *op); |
477 | char *gravestone_text (object *op); |
435 | const char *gravestone_text (object *op); |
478 | void do_some_living (object *op); |
436 | void do_some_living (object *op); |
479 | void kill_player (object *op); |
437 | void kill_player (object *op); |
480 | void loot_object (object *op); |
438 | void loot_object (object *op); |
481 | void fix_weight (void); |
439 | void fix_weight (void); |
482 | void fix_luck (void); |
440 | void fix_luck (void); |
… | |
… | |
516 | const char *query_cost_string (const object *tmp, object *who, int flag); |
474 | const char *query_cost_string (const object *tmp, object *who, int flag); |
517 | sint64 query_money (const object *op); |
475 | sint64 query_money (const object *op); |
518 | int pay_for_amount (sint64 to_pay, object *pl); |
476 | int pay_for_amount (sint64 to_pay, object *pl); |
519 | int pay_for_item (object *op, object *pl); |
477 | int pay_for_item (object *op, object *pl); |
520 | int can_pay (object *pl); |
478 | int can_pay (object *pl); |
521 | void sell_item (object *op, object *pl); |
479 | bool sell_item (object *op, object *pl); |
522 | double shopkeeper_approval (const maptile *map, const object *player); |
480 | double shopkeeper_approval (const maptile *map, const object *player); |
523 | int describe_shop (const object *op); |
481 | int describe_shop (const object *op); |
524 | void shop_listing (object *sign, object *op); |
482 | void shop_listing (object *sign, object *op); |
525 | bool is_in_shop (object *o); |
483 | bool is_in_shop (object *o); |
526 | bool is_in_shop (maptile *map, int x, int y); |
484 | bool is_in_shop (maptile *map, int x, int y); |
… | |
… | |
615 | void move_aura (object *aura); |
573 | void move_aura (object *aura); |
616 | void move_peacemaker (object *op); |
574 | void move_peacemaker (object *op); |
617 | int write_mark (object *op, object *spell, const char *msg); |
575 | int write_mark (object *op, object *spell, const char *msg); |
618 | |
576 | |
619 | /* spell_util.c */ |
577 | /* spell_util.c */ |
620 | object *find_random_spell_in_ob (object *ob, const char *skill); |
578 | object *find_random_spell_in_ob (object *ob, shstr_cmp skill = shstr_cmp ()); |
621 | void set_spell_skill (object *op, object *caster, object *spob, object *dest); |
579 | void set_spell_skill (object *op, object *caster, object *spob, object *dest); |
622 | void init_spells (void); |
|
|
623 | void dump_spells (void); |
|
|
624 | void spell_effect (object *spob, int x, int y, maptile *map, object *originator); |
580 | void spell_effect (object *spob, int x, int y, maptile *map, object *originator); |
625 | int min_casting_level (object *caster, object *spell); |
581 | int min_casting_level (object *caster, object *spell); |
626 | int caster_level (object *caster, object *spell); |
582 | int casting_level (object *caster, object *spell); |
627 | sint16 SP_level_spellpoint_cost (object *caster, object *spell, int flags); |
583 | sint16 SP_level_spellpoint_cost (object *caster, object *spell, int flags); |
628 | int SP_level_dam_adjust (object *caster, object *spob); |
584 | int SP_level_dam_adjust (object *caster, object *spob); |
629 | int SP_level_duration_adjust (object *caster, object *spob); |
585 | int SP_level_duration_adjust (object *caster, object *spob); |
630 | int SP_level_range_adjust (object *caster, object *spob); |
586 | int SP_level_range_adjust (object *caster, object *spob); |
631 | object *check_spell_known (object *op, const char *name); |
587 | object *check_spell_known (object *op, shstr_cmp name); |
632 | object *lookup_spell_by_name (object *op, const char *spname); |
588 | object *lookup_spell_by_name (object *op, const char *spname); |
633 | int reflwall (maptile *m, int x, int y, object *sp_op); |
589 | int reflwall (maptile *m, int x, int y, object *sp_op); |
634 | int cast_create_obj (object *op, object *caster, object *new_op, int dir); |
590 | int cast_create_obj (object *op, object *caster, object *new_op, int dir); |
635 | int ok_to_put_more (maptile *m, sint16 x, sint16 y, object *op, int immune_stop); |
591 | int ok_to_put_more (maptile *m, sint16 x, sint16 y, object *op, int immune_stop); |
636 | int fire_arch_from_position (object *op, object *caster, sint16 x, sint16 y, int dir, object *spell); |
592 | int fire_arch_from_position (object *op, object *caster, sint16 x, sint16 y, int dir, object *spell); |