1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * |
5 | * |
6 | * Deliantra is free software: you can redistribute it and/or modify it under |
6 | * Deliantra is free software: you can redistribute it and/or modify it under |
7 | * the terms of the Affero GNU General Public License as published by the |
7 | * the terms of the Affero GNU General Public License as published by the |
8 | * Free Software Foundation, either version 3 of the License, or (at your |
8 | * Free Software Foundation, either version 3 of the License, or (at your |
9 | * option) any later version. |
9 | * option) any later version. |
… | |
… | |
37 | void move_apply (object *trap, object *victim, object *originator); |
37 | void move_apply (object *trap, object *victim, object *originator); |
38 | void do_learn_spell (object *op, object *spell, int special_prayer); |
38 | void do_learn_spell (object *op, object *spell, int special_prayer); |
39 | void do_forget_spell (object *op, const char *spell); |
39 | void do_forget_spell (object *op, const char *spell); |
40 | void apply_scroll (object *op, object *tmp, int dir); |
40 | void apply_scroll (object *op, object *tmp, int dir); |
41 | void apply_poison (object *op, object *tmp); |
41 | void apply_poison (object *op, object *tmp); |
42 | int manual_apply (object *op, object *tmp, int aflag); |
|
|
43 | int player_apply (object *pl, object *op, int aflag, int quiet); |
42 | bool player_apply (object *pl, object *op, int aflag); |
44 | void player_apply_below (object *pl); |
43 | void player_apply_below (object *pl); |
45 | int can_apply_object (object *who, object *op); |
44 | int can_apply_object (object *who, object *op); |
46 | int apply_special (object *who, object *op, int aflags); |
45 | int apply_special (object *who, object *op, int aflags); |
47 | int auto_apply (object *op); |
46 | int auto_apply (object *op); |
48 | void fix_auto_apply (maptile *m); |
47 | void fix_auto_apply (maptile *m); |
… | |
… | |
54 | int convert_item (object *item, object *converter); |
53 | int convert_item (object *item, object *converter); |
55 | |
54 | |
56 | /* attack.c */ |
55 | /* attack.c */ |
57 | void cancellation (object *op); |
56 | void cancellation (object *op); |
58 | void save_throw_object (object *op, int type, object *originator); |
57 | void save_throw_object (object *op, int type, object *originator); |
59 | int hit_map (object *op, int dir, int type, int full_hit); |
58 | int hit_map (object *op, int dir, uint32_t type, int full_hit); |
60 | int attack_ob (object *op, object *hitter); |
59 | int attack_ob (object *op, object *hitter); |
61 | object *hit_with_arrow (object *op, object *victim); |
60 | object *hit_with_arrow (object *op, object *victim); |
62 | int hit_player_attacktype (object *op, object *hitter, int dam, uint32 attacknum, int magic); |
61 | int hit_player_attacktype (object *op, object *hitter, int dam, uint32_t attacknum, int magic); |
63 | int kill_object (object *op, int dam, object *hitter, int type); |
62 | int kill_object (object *op, int dam, object *hitter, int type); |
64 | int friendly_fire (object *op, object *hitter); |
63 | int friendly_fire (object *op, object *hitter); |
65 | int hit_player (object *op, int dam, object *hitter, int type, int full_hit); |
64 | int hit_player (object *op, int dam, object *hitter, uint32_t type, int full_hit); |
66 | void confuse_player (object *op, object *hitter, int dam); |
65 | void confuse_player (object *op, object *hitter, int dam); |
67 | void blind_player (object *op, object *hitter, int dam); |
66 | void blind_player (object *op, object *hitter, int dam); |
68 | void paralyze_player (object *op, object *hitter, int dam); |
67 | void paralyze_player (object *op, object *hitter, int dam); |
69 | |
68 | |
70 | /* build_map.c */ |
69 | /* build_map.c */ |
… | |
… | |
114 | int command_south (object *op, char *params); |
113 | int command_south (object *op, char *params); |
115 | int command_southeast (object *op, char *params); |
114 | int command_southeast (object *op, char *params); |
116 | int command_southwest (object *op, char *params); |
115 | int command_southwest (object *op, char *params); |
117 | int command_west (object *op, char *params); |
116 | int command_west (object *op, char *params); |
118 | int command_stay (object *op, char *params); |
117 | int command_stay (object *op, char *params); |
|
|
118 | int command_run (object *op, char *params); |
|
|
119 | int command_run_stop (object *op, char *params); |
|
|
120 | int command_fire (object *op, char *params); |
|
|
121 | int command_fire_stop (object *op, char *params); |
119 | |
122 | |
120 | /* c_new.c */ |
123 | /* c_new.c */ |
121 | void execute_newserver_command (object *pl, char *command); |
124 | void execute_newserver_command (object *pl, char *command); |
122 | |
125 | |
123 | /* c_object.c */ |
126 | /* c_object.c */ |
… | |
… | |
145 | void examine (object *op, object *tmp); |
148 | void examine (object *op, object *tmp); |
146 | int command_pickup (object *op, char *params); |
149 | int command_pickup (object *op, char *params); |
147 | void set_pickup_mode (object *op, int i); |
150 | void set_pickup_mode (object *op, int i); |
148 | int command_search_items (object *op, char *params); |
151 | int command_search_items (object *op, char *params); |
149 | int command_rename_item (object *op, char *params); |
152 | int command_rename_item (object *op, char *params); |
|
|
153 | int command_unlock (object *op, char *params); |
|
|
154 | int command_lock (object *op, char *params); |
|
|
155 | int command_mark (object *op, char *params); |
150 | |
156 | |
151 | /* c_party.c */ |
157 | /* c_party.c */ |
152 | partylist *get_firstparty (void); |
158 | partylist *get_firstparty (); |
153 | void obsolete_parties (void); |
159 | void obsolete_parties (); |
154 | void add_kill_to_party (partylist *party, const char *killer, const char *dead, long exp); |
160 | void add_kill_to_party (partylist *party, const char *killer, const char *dead, long exp); |
155 | void receive_party_password (object *op, char k); |
161 | void receive_party_password (object *op, char k); |
156 | int command_gsay (object *op, char *params); |
162 | int command_gsay (object *op, char *params); |
157 | int command_party (object *op, char *params); |
163 | int command_party (object *op, char *params); |
158 | |
164 | |
… | |
… | |
199 | int command_stack_clear (object *op, char *params); |
205 | int command_stack_clear (object *op, char *params); |
200 | int command_diff (object *op, char *params); |
206 | int command_diff (object *op, char *params); |
201 | int command_insert_into (object *op, char *params); |
207 | int command_insert_into (object *op, char *params); |
202 | |
208 | |
203 | /* commands.c */ |
209 | /* commands.c */ |
204 | void init_commands (void); |
210 | void init_commands (); |
205 | CommFunc find_oldsocket_command (char *cmd); |
211 | CommFunc find_oldsocket_command (char *cmd); |
206 | CommFunc find_oldsocket_command2 (char *cmd); |
212 | CommFunc find_oldsocket_command2 (char *cmd); |
207 | |
213 | |
208 | /* daemon.c */ |
214 | /* daemon.c */ |
209 | FILE *BecomeDaemon (const char *filename); |
215 | FILE *BecomeDaemon (const char *filename); |
… | |
… | |
228 | void become_follower (object *op, object *new_god); |
234 | void become_follower (object *op, object *new_god); |
229 | archetype *determine_holy_arch (object *god, shstr_cmp type); |
235 | archetype *determine_holy_arch (object *god, shstr_cmp type); |
230 | int tailor_god_spell (object *spellop, object *caster); |
236 | int tailor_god_spell (object *spellop, object *caster); |
231 | |
237 | |
232 | /* init.c */ |
238 | /* init.c */ |
233 | void load_settings (void); |
239 | void load_settings (); |
234 | void init (int argc, char **argv); |
240 | void init (int argc, char **argv); |
235 | void usage (void); |
241 | void usage (); |
236 | void help (void); |
242 | void help (); |
237 | void init_beforeplay (void); |
243 | void init_beforeplay (); |
238 | void init_signals (void); |
244 | void init_signals (); |
239 | racelink *find_racelink (const char *name); |
245 | racelink *find_racelink (const char *name); |
240 | |
246 | |
241 | /* login.c */ |
247 | /* login.c */ |
242 | void delete_character (const char *name); |
248 | void delete_character (const char *name); |
243 | int verify_player (const char *name, char *password); |
249 | int verify_player (const char *name, char *password); |
… | |
… | |
253 | void enter_player_savebed (object *op); |
259 | void enter_player_savebed (object *op); |
254 | void leave_map (object *op); |
260 | void leave_map (object *op); |
255 | char *clean_path (const char *file); |
261 | char *clean_path (const char *file); |
256 | char *unclean_path (const char *src); |
262 | char *unclean_path (const char *src); |
257 | void enter_exit (object *op, object *exit_ob); |
263 | void enter_exit (object *op, object *exit_ob); |
258 | void clean_tmp_files (void); |
264 | void clean_tmp_files (); |
259 | void leave (player *pl,int draw_exit); |
265 | void leave (player *pl,int draw_exit); |
260 | int main (int argc, char **argv); |
266 | int main (int argc, char **argv); |
261 | |
267 | |
262 | /* monster.c */ |
268 | /* monster.c */ |
263 | object *check_enemy (object *npc, rv_vector *rv); |
269 | object *check_enemy (object *npc, rv_vector *rv); |
… | |
… | |
274 | int can_detect_enemy (object *op, object *enemy, rv_vector *rv); |
280 | int can_detect_enemy (object *op, object *enemy, rv_vector *rv); |
275 | int stand_in_light (object *op); |
281 | int stand_in_light (object *op); |
276 | int can_see_enemy (object *op, object *enemy); |
282 | int can_see_enemy (object *op, object *enemy); |
277 | |
283 | |
278 | /* move.c */ |
284 | /* move.c */ |
279 | int move_object (object *op, int dir); |
|
|
280 | int move_ob (object *op, int dir, object *originator); |
|
|
281 | int transfer_ob (object *op, int x, int y, int randomly, object *originator); |
285 | int transfer_ob (object *op, int x, int y, int randomly, object *originator); |
282 | int teleport (object *teleporter, uint8 tele_type, object *user); |
286 | int teleport (object *teleporter, uint8 tele_type, object *user); |
283 | void recursive_roll (object *op, int dir, object *pusher); |
287 | void recursive_roll (object *op, int dir, object *pusher); |
284 | int push_ob (object *who, int dir, object *pusher); |
288 | int push_ob (object *who, int dir, object *pusher); |
285 | |
289 | |
… | |
… | |
313 | int key_roll_stat (object *op, char key); |
317 | int key_roll_stat (object *op, char key); |
314 | int key_change_class (object *op, char key); |
318 | int key_change_class (object *op, char key); |
315 | int key_confirm_quit (object *op, char key); |
319 | int key_confirm_quit (object *op, char key); |
316 | int check_pick (object *op); |
320 | int check_pick (object *op); |
317 | int fire_bow (object *op, object *part, object *arrow, int dir, int wc_mod, sint16 sx, sint16 sy); |
321 | int fire_bow (object *op, object *part, object *arrow, int dir, int wc_mod, sint16 sx, sint16 sy); |
318 | bool fire (object *op, int dir); |
322 | bool fire (object *who, int dir); |
319 | object *find_key (object *pl, object *container, object *door); |
323 | object *find_key (object *pl, object *container, object *door); |
320 | bool move_player_attack (object *op, int dir); |
324 | bool move_player_attack (object *op, int dir); |
321 | bool move_player (object *op, int dir); |
325 | bool move_player (object *op, int dir); |
322 | bool handle_newcs_player (object *op); |
326 | bool handle_newcs_player (object *op); |
323 | void do_some_living (object *op); |
327 | void do_some_living (object *op); |
324 | void kill_player (object *op); |
328 | void kill_player (object *op); |
325 | void fix_weight (void); |
329 | void fix_weight (); |
326 | void fix_luck (void); |
330 | void fix_luck (); |
327 | void cast_dust (object *op, object *throw_ob, int dir); |
331 | void cast_dust (object *op, object *throw_ob, int dir); |
328 | void make_visible (object *op); |
332 | void make_visible (object *op); |
329 | int is_true_undead (object *op); |
333 | int is_true_undead (object *op); |
330 | int hideability (object *ob); |
334 | int hideability (object *ob); |
331 | void do_hidden_move (object *op); |
335 | void do_hidden_move (object *op); |
332 | int stand_near_hostile (object *who); |
336 | int stand_near_hostile (object *who); |
333 | int player_can_view (object *pl, object *op); |
337 | int player_can_view (object *pl, object *op); |
334 | int op_on_battleground (object *op, int *x, int *y); |
338 | int op_on_battleground (object *op, int *x, int *y); |
335 | void dragon_ability_gain (object *who, int atnr, int level); |
339 | void dragon_ability_gain (object *who, int atnr, int level); |
336 | void player_unready_range_ob (player *pl, object *ob); |
|
|
337 | |
340 | |
338 | /* resurrection.c */ |
341 | /* resurrection.c */ |
339 | int cast_raise_dead_spell (object *op, object *caster, object *spell, int dir, const char *arg); |
342 | int cast_raise_dead_spell (object *op, object *caster, object *spell, int dir, const char *arg); |
340 | |
343 | |
341 | /* rune.c */ |
344 | /* rune.c */ |
… | |
… | |
348 | int trap_disarm (object *disarmer, object *trap, int risk, object *skill); |
351 | int trap_disarm (object *disarmer, object *trap, int risk, object *skill); |
349 | void trap_adjust (object *trap, int difficulty); |
352 | void trap_adjust (object *trap, int difficulty); |
350 | |
353 | |
351 | /* shop.c */ |
354 | /* shop.c */ |
352 | int get_payment (object *pl); |
355 | int get_payment (object *pl); |
353 | sint64 query_cost (const object *tmp, object *who, int flag); |
|
|
354 | const char *query_cost_string (const object *tmp, object *who, int flag); |
|
|
355 | sint64 query_money (const object *op); |
356 | sint64 query_money (const object *op); |
356 | int pay_for_amount (sint64 to_pay, object *pl); |
357 | int pay_for_amount (sint64 to_pay, object *pl); |
357 | int pay_for_item (object *op, object *pl); |
358 | int pay_for_item (object *op, object *pl); |
358 | int can_pay (object *pl); |
359 | int can_pay (object *pl); |
359 | bool sell_item (object *op, object *pl); |
360 | bool sell_item (object *op, object *pl); |
360 | double shopkeeper_approval (const maptile *map, const object *player); |
361 | double shopkeeper_approval (const maptile *map, const object *player); |
361 | int describe_shop (const object *op); |
362 | int describe_shop (const object *op); |
362 | void shop_listing (object *sign, object *op); |
363 | void shop_listing (object *sign, object *op); |
363 | bool is_in_shop (object *o); |
|
|
364 | bool is_in_shop (maptile *map, int x, int y); |
364 | bool is_in_shop (maptile *map, int x, int y); |
365 | |
365 | |
366 | /* skills.c */ |
366 | /* skills.c */ |
367 | int steal (object *op, int dir, object *skill); |
367 | int steal (object *op, int dir, object *skill); |
368 | int pick_lock (object *pl, int dir, object *skill); |
368 | int pick_lock (object *pl, int dir, object *skill); |
… | |
… | |
375 | int remove_trap (object *op, int dir, object *skill); |
375 | int remove_trap (object *op, int dir, object *skill); |
376 | int pray (object *pl, object *skill); |
376 | int pray (object *pl, object *skill); |
377 | void meditate (object *pl, object *skill); |
377 | void meditate (object *pl, object *skill); |
378 | int write_on_item (object *pl, const char *params, object *skill); |
378 | int write_on_item (object *pl, const char *params, object *skill); |
379 | int skill_throw (object *op, object *part, int dir, const char *params, object *skill); |
379 | int skill_throw (object *op, object *part, int dir, const char *params, object *skill); |
|
|
380 | bool skill_mining (object *who, object *tool, object *skill, int dir, const char *string); |
|
|
381 | bool skill_fishing (object *who, object *tool, object *skill, int dir, const char *string); |
380 | |
382 | |
381 | /* skill_util.c */ |
383 | /* skill_util.c */ |
382 | void init_skills (void); |
384 | void init_skills (); |
383 | void link_player_skills (object *op); |
385 | void link_player_skills (object *op); |
384 | int do_skill (object *op, object *part, object *skill, int dir, const char *string); |
386 | int do_skill (object *op, object *part, object *skill, int dir, const char *string); |
385 | int calc_skill_exp (object *who, object *op, object *skill); |
387 | int calc_skill_exp (object *who, object *op, object *skill); |
386 | int learn_skill (object *pl, object *scroll); |
388 | int learn_skill (object *pl, object *scroll); |
387 | void show_skills (object *op, const char *search); |
389 | void show_skills (object *op, const char *search); |
… | |
… | |
429 | int cast_wonder (object *op, object *caster, int dir, object *spell_ob); |
431 | int cast_wonder (object *op, object *caster, int dir, object *spell_ob); |
430 | int perceive_self (object *op); |
432 | int perceive_self (object *op); |
431 | int magic_wall (object *op, object *caster, int dir, object *spell_ob); |
433 | int magic_wall (object *op, object *caster, int dir, object *spell_ob); |
432 | int dimension_door (object *op, object *caster, object *spob, int dir, const char *spellparam); |
434 | int dimension_door (object *op, object *caster, object *spob, int dir, const char *spellparam); |
433 | int cast_heal (object *op, object *caster, object *spell, int dir); |
435 | int cast_heal (object *op, object *caster, object *spell, int dir); |
434 | int change_ability_duration (object *spell, object *caster); |
|
|
435 | int cast_change_ability (object *op, object *caster, object *spell_ob, int dir, int silent); |
436 | int cast_change_ability (object *op, object *caster, object *spell_ob, int dir, int silent); |
436 | int cast_bless (object *op, object *caster, object *spell_ob, int dir); |
437 | int cast_bless (object *op, object *caster, object *spell_ob, int dir); |
437 | int alchemy (object *op, object *caster, object *spell_ob); |
438 | int alchemy (object *op, object *caster, object *spell_ob); |
438 | int remove_curse (object *op, object *caster, object *spell); |
439 | int remove_curse (object *op, object *caster, object *spell); |
439 | int cast_identify (object *op, object *caster, object *spell); |
440 | int cast_identify (object *op, object *caster, object *spell); |
… | |
… | |
450 | |
451 | |
451 | /* spell_util.c */ |
452 | /* spell_util.c */ |
452 | object *find_random_spell_in_ob (object *ob, shstr_cmp skill = shstr_cmp ()); |
453 | object *find_random_spell_in_ob (object *ob, shstr_cmp skill = shstr_cmp ()); |
453 | void set_spell_skill (object *op, object *caster, object *spob, object *dest); |
454 | void set_spell_skill (object *op, object *caster, object *spob, object *dest); |
454 | void spell_effect (object *spob, int x, int y, maptile *map, object *originator); |
455 | void spell_effect (object *spob, int x, int y, maptile *map, object *originator); |
455 | int min_casting_level (object *caster, object *spell); |
|
|
456 | int casting_level (object *caster, object *spell); |
|
|
457 | sint16 SP_level_spellpoint_cost (object *caster, object *spell, int flags); |
|
|
458 | int SP_level_dam_adjust (object *caster, object *spob); |
|
|
459 | int SP_level_duration_adjust (object *caster, object *spob); |
|
|
460 | int SP_level_range_adjust (object *caster, object *spob); |
|
|
461 | object *check_spell_known (object *op, shstr_cmp name); |
456 | object *check_spell_known (object *op, shstr_cmp name); |
462 | object *lookup_spell_by_name (object *op, const char *spname); |
457 | object *lookup_spell_by_name (object *op, const char *spname); |
463 | int reflwall (maptile *m, int x, int y, object *sp_op); |
458 | int reflwall (maptile *m, int x, int y, object *sp_op); |
464 | int cast_create_obj (object *op, object *caster, object *new_op, int dir); |
459 | int cast_create_obj (object *op, object *caster, object *new_op, int dir); |
465 | int ok_to_put_more (maptile *m, sint16 x, sint16 y, object *op, int immune_stop); |
460 | int ok_to_put_more (maptile *m, sint16 x, sint16 y, object *op, int immune_stop); |
… | |
… | |
479 | /* swamp.c */ |
474 | /* swamp.c */ |
480 | void walk_on_deep_swamp (object *op, object *victim); |
475 | void walk_on_deep_swamp (object *op, object *victim); |
481 | void move_deep_swamp (object *op); |
476 | void move_deep_swamp (object *op); |
482 | |
477 | |
483 | /* swap.c */ |
478 | /* swap.c */ |
484 | void read_map_log (void); |
479 | void read_map_log (); |
485 | void swap_map (maptile *map); |
480 | void swap_map (maptile *map); |
486 | void check_active_maps (void); |
481 | void check_active_maps (); |
487 | maptile *map_least_timeout (char *except_level); |
482 | maptile *map_least_timeout (char *except_level); |
488 | void swap_below_max (char *except_level); |
483 | void swap_below_max (char *except_level); |
489 | int players_on_map (maptile *m, int show_all); |
484 | int players_on_map (maptile *m, int show_all); |
490 | void flush_old_maps (void); |
485 | void flush_old_maps (); |
491 | |
486 | |
492 | /* time.c */ |
487 | /* time.c */ |
493 | void remove_door (object *op); |
488 | void remove_door (object *op); |
494 | void remove_door2 (object *op); |
489 | void remove_door2 (object *op); |
495 | void animate_trigger (object *op); |
490 | void animate_trigger (object *op); |
… | |
… | |
503 | void move_creator (object *creator); |
498 | void move_creator (object *creator); |
504 | void move_marker (object *op); |
499 | void move_marker (object *op); |
505 | void process_object (object *op); |
500 | void process_object (object *op); |
506 | |
501 | |
507 | /* weather.c */ |
502 | /* weather.c */ |
508 | void adjust_daylight (void); |
503 | void adjust_daylight (); |