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 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * |
5 | * |
6 | * Deliantra is free software: you can redistribute it and/or modify |
6 | * Deliantra is free software: you can redistribute it and/or modify it under |
7 | * it under the terms of the GNU General Public License as published by |
7 | * the terms of the Affero GNU General Public License as published by the |
8 | * the Free Software Foundation, either version 3 of the License, or |
8 | * Free Software Foundation, either version 3 of the License, or (at your |
9 | * (at your option) any later version. |
9 | * 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, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
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 Affero GNU General Public License |
17 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
17 | * and the GNU General Public License along with this program. If not, see |
|
|
18 | * <http://www.gnu.org/licenses/>. |
18 | * |
19 | * |
19 | * The authors can be reached via e-mail to <support@deliantra.net> |
20 | * The authors can be reached via e-mail to <support@deliantra.net> |
20 | */ |
21 | */ |
21 | |
22 | |
22 | /* alchemy.c */ |
23 | /* alchemy.c */ |
23 | int need_identify (const object *obj); |
24 | int need_identify (const object *obj); |
24 | int apply_shop_mat (object *shop_mat, object *op); |
25 | int apply_shop_mat (object *shop_mat, object *op); |
25 | const char *cost_string_from_value (sint64 cost, int approx); |
26 | const char *cost_string_from_value (sint64 cost, int approx); |
26 | void pay_player (object *pl, sint64 amount); |
27 | void pay_player (object *pl, sint64 amount); |
27 | sint64 pay_player_arch (object *pl, const char *arch, sint64 amount); |
28 | sint64 pay_player_arch (object *pl, const char *arch, sint64 amount); |
28 | void attempt_do_alchemy (object *caster, object *cauldron); |
29 | void attempt_do_alchemy (object *caster, object *cauldron, object *skill); |
29 | int content_recipe_value (object *op); |
30 | int content_recipe_value (object *op); |
30 | int numb_ob_inside (object *op); |
31 | int numb_ob_inside (object *op); |
31 | object *attempt_recipe (object *caster, object *cauldron, int ability, recipe *rp, int nbatches); |
32 | object *attempt_recipe (object *caster, object *cauldron, int ability, recipe *rp, int nbatches); |
32 | void adjust_product (object *item, int lvl, int yield); |
33 | void adjust_product (object *item, int lvl, int yield); |
33 | object *make_item_from_recipe (object *cauldron, recipe *rp); |
34 | object *make_item_from_recipe (object *cauldron, recipe *rp); |
… | |
… | |
67 | void apply_lighter (object *who, object *lighter); |
68 | void apply_lighter (object *who, object *lighter); |
68 | void scroll_failure (object *op, int failure, int power); |
69 | void scroll_failure (object *op, int failure, int power); |
69 | void apply_changes_to_player (object *pl, object *change); |
70 | void apply_changes_to_player (object *pl, object *change); |
70 | void apply_item_transformer (object *pl, object *transformer); |
71 | void apply_item_transformer (object *pl, object *transformer); |
71 | extern void handle_apply_yield (object *op); |
72 | extern void handle_apply_yield (object *op); |
|
|
73 | void apply_lamp (object *op, bool switch_on); |
|
|
74 | void get_animation_from_arch (object *op, arch_ptr a); |
|
|
75 | extern int convert_item (object *item, object *converter); |
72 | |
76 | |
73 | /* attack.c */ |
77 | /* attack.c */ |
74 | void cancellation (object *op); |
78 | void cancellation (object *op); |
75 | int did_make_save_item (object *op, int type, object *originator); |
79 | int did_make_save_item (object *op, int type, object *originator); |
76 | void save_throw_object (object *op, int type, object *originator); |
80 | void save_throw_object (object *op, int type, object *originator); |
… | |
… | |
92 | void deathstrike_player (object *op, object *hitter, int *dam); |
96 | void deathstrike_player (object *op, object *hitter, int *dam); |
93 | int adj_attackroll (object *hitter, object *target); |
97 | int adj_attackroll (object *hitter, object *target); |
94 | int is_aimed_missile (object *op); |
98 | int is_aimed_missile (object *op); |
95 | |
99 | |
96 | /* build_map.c */ |
100 | /* build_map.c */ |
97 | int can_build_over (struct mapdef *map, object *tmp, short x, short y); |
|
|
98 | void remove_marking_runes (struct mapdef *map, short x, short y); |
|
|
99 | int find_unused_connected_value (struct mapdef *map); |
|
|
100 | int find_or_create_connection_for_map (object *pl, short x, short y, object *rune); |
|
|
101 | object *get_connection_rune (object *pl, short x, short y); |
|
|
102 | object *get_msg_book (object *pl, short x, short y); |
|
|
103 | object *get_wall (struct mapdef *map, int x, int y); |
|
|
104 | void fix_walls (maptile *map, int x, int y); |
|
|
105 | void fix_walls_around (maptile *map, int x, int y); |
|
|
106 | void apply_builder_floor (object *pl, object *material, short x, short y); |
|
|
107 | void apply_builder_wall (object *pl, object *material, short x, short y); |
|
|
108 | void apply_builder_item (object *pl, object *item, short x, short y); |
|
|
109 | void apply_builder_remove (object *pl, int dir); |
|
|
110 | void apply_map_builder (object *pl, int dir); |
101 | void apply_map_builder (object *pl, int dir); |
111 | int adjust_sign_msg (object *pl, short x, short y, object *tmp); |
|
|
112 | |
102 | |
113 | /* c_misc.c */ |
103 | /* c_misc.c */ |
114 | int command_motd (object *op, char *params); |
104 | int command_motd (object *op, char *params); |
115 | int command_bug (object *op, char *params); |
105 | int command_bug (object *op, char *params); |
116 | void malloc_info (object *op); |
106 | void malloc_info (object *op); |
… | |
… | |
174 | int sack_can_hold (object *pl, object *sack, object *op, uint32 nrof); |
164 | int sack_can_hold (object *pl, object *sack, object *op, uint32 nrof); |
175 | void pick_up (object *op, object *alt); |
165 | void pick_up (object *op, object *alt); |
176 | int command_take (object *op, char *params); |
166 | int command_take (object *op, char *params); |
177 | void put_object_in_sack (object *op, object *sack, object *tmp, uint32 nrof); |
167 | void put_object_in_sack (object *op, object *sack, object *tmp, uint32 nrof); |
178 | void drop_object (object *op, object *tmp, uint32 nrof); |
168 | void drop_object (object *op, object *tmp, uint32 nrof); |
|
|
169 | void drop_object (object *dropper, object *obj); |
179 | void drop (object *op, object *tmp); |
170 | void drop (object *op, object *tmp); |
180 | int command_dropall (object *op, char *params); |
171 | int command_dropall (object *op, char *params); |
181 | int command_drop (object *op, char *params); |
172 | int command_drop (object *op, char *params); |
182 | int command_examine (object *op, char *params); |
173 | int command_examine (object *op, char *params); |
183 | object *find_marked_object (object *op); |
174 | object *find_marked_object (object *op); |
… | |
… | |
259 | /* daemon.c */ |
250 | /* daemon.c */ |
260 | FILE *BecomeDaemon (const char *filename); |
251 | FILE *BecomeDaemon (const char *filename); |
261 | |
252 | |
262 | /* disease.c */ |
253 | /* disease.c */ |
263 | int move_disease (object *disease); |
254 | int move_disease (object *disease); |
264 | int remove_symptoms (object *disease); |
|
|
265 | object *find_symptom (object *disease); |
|
|
266 | int check_infection (object *disease); |
|
|
267 | int infect_object (object *victim, object *disease, int force); |
255 | int infect_object (object *victim, object *disease, int force); |
268 | int do_symptoms (object *disease); |
|
|
269 | int grant_immunity (object *disease); |
|
|
270 | int move_symptom (object *symptom); |
256 | int move_symptom (object *symptom); |
271 | int check_physically_infect (object *victim, object *hitter); |
257 | int check_physically_infect (object *victim, object *hitter); |
272 | object *find_disease (object *victim); |
|
|
273 | int cure_disease (object *sufferer, object *caster, object *spell); |
258 | int cure_disease (object *sufferer, object *caster, object *spell); |
274 | int reduce_symptoms (object *sufferer, int reduction); |
|
|
275 | |
259 | |
276 | /* egoitem.c */ |
260 | /* egoitem.c */ |
277 | int create_artifact (object *op, const char *artifactname); |
261 | int create_artifact (object *op, const char *artifactname); |
278 | int apply_power_crystal (object *op, object *crystal); |
262 | int apply_power_crystal (object *op, object *crystal); |
279 | |
263 | |
… | |
… | |
281 | char *spool (char *bp, char *error); |
265 | char *spool (char *bp, char *error); |
282 | void check_score (object *op); |
266 | void check_score (object *op); |
283 | void display_high_score (object *op, int max, const char *match); |
267 | void display_high_score (object *op, int max, const char *match); |
284 | |
268 | |
285 | /* gods.c */ |
269 | /* gods.c */ |
286 | int lookup_god_by_name (const char *name); |
270 | int lookup_god_by_name (shstr_cmp name); |
287 | object *find_god (const char *name); |
271 | object *find_god (shstr_cmp name); |
288 | const char *determine_god (object *op); |
272 | shstr_tmp determine_god (object *op); |
289 | void pray_at_altar (object *pl, object *altar, object *skill); |
273 | void pray_at_altar (object *pl, object *altar, object *skill); |
290 | void become_follower (object *op, object *new_god); |
274 | void become_follower (object *op, object *new_god); |
291 | int worship_forbids_use (object *op, object *exp_obj, uint32 flag, const char *string); |
275 | int worship_forbids_use (object *op, object *exp_obj, uint32 flag, const char *string); |
292 | void stop_using_item (object *op, int type, int number); |
276 | void stop_using_item (object *op, int type, int number); |
293 | void update_priest_flag (object *god, object *exp_ob, uint32 flag); |
277 | void update_priest_flag (object *god, object *exp_ob, uint32 flag); |
294 | archetype *determine_holy_arch (object *god, const char *type); |
278 | archetype *determine_holy_arch (object *god, shstr_cmp type); |
295 | void god_intervention (object *op, object *god, object *skill); |
279 | void god_intervention (object *op, object *god, object *skill); |
296 | int god_examines_priest (object *op, object *god); |
280 | int god_examines_priest (object *op, object *god); |
297 | int god_examines_item (object *god, object *item); |
281 | int god_examines_item (object *god, object *item); |
298 | int get_god (object *priest); |
282 | int get_god (object *priest); |
299 | const char *get_god_for_race (const char *race); |
|
|
300 | int tailor_god_spell (object *spellop, object *caster); |
283 | int tailor_god_spell (object *spellop, object *caster); |
301 | |
284 | |
302 | /* init.c */ |
285 | /* init.c */ |
303 | void load_settings (void); |
286 | void load_settings (void); |
304 | void load_materials (void); |
287 | void load_materials (void); |
… | |
… | |
400 | object *fix_summon_pet (archetype *at, object *op, int dir, int is_golem); |
383 | object *fix_summon_pet (archetype *at, object *op, int dir, int is_golem); |
401 | void move_golem (object *op); |
384 | void move_golem (object *op); |
402 | void control_golem (object *op, int dir); |
385 | void control_golem (object *op, int dir); |
403 | int summon_golem (object *op, object *caster, int dir, object *spob); |
386 | int summon_golem (object *op, object *caster, int dir, object *spob); |
404 | object *choose_cult_monster (object *pl, object *god, int summon_level); |
387 | object *choose_cult_monster (object *pl, object *god, int summon_level); |
405 | int summon_object (object *op, object *caster, object *spell_ob, int dir, const char *stringarg); |
388 | int summon_object (object *op, object *caster, object *spell_ob, int dir, const char *spellparam); |
406 | object *get_real_owner (object *ob); |
|
|
407 | int should_arena_attack (object *pet, object *owner, object *target); |
389 | int should_arena_attack (object *pet, object *owner, object *target); |
408 | |
390 | |
409 | /* player.c */ |
391 | /* player.c */ |
410 | player *find_player (const char *plname); |
392 | player *find_player (const char *plname); |
411 | player *find_player_partial_name (const char *plname); |
393 | player *find_player_partial_name (const char *plname); |
412 | void display_motd (const object *op); |
|
|
413 | void send_rules (const object *op); |
|
|
414 | void send_news (const object *op); |
|
|
415 | int playername_ok (const char *cp); |
394 | int playername_ok (const char *cp); |
416 | archetype *get_player_archetype (archetype *at); |
395 | archetype *get_player_archetype (archetype *at); |
417 | object *get_nearest_player (object *mon); |
396 | object *get_nearest_player (object *mon); |
418 | int path_to_player (object *mon, object *pl, unsigned mindiff); |
397 | int path_to_player (object *mon, object *pl, unsigned mindiff); |
419 | void give_initial_items (object *pl, treasurelist *items); |
398 | void give_initial_items (object *pl, treasurelist *items); |
… | |
… | |
429 | int key_change_class (object *op, char key); |
408 | int key_change_class (object *op, char key); |
430 | int key_confirm_quit (object *op, char key); |
409 | int key_confirm_quit (object *op, char key); |
431 | void flee_player (object *op); |
410 | void flee_player (object *op); |
432 | int check_pick (object *op); |
411 | int check_pick (object *op); |
433 | object *find_arrow (object *op, const char *type); |
412 | object *find_arrow (object *op, const char *type); |
434 | object *find_better_arrow (object *op, object *target, const char *type, int *better); |
413 | object *find_better_arrow (object *op, object *target, shstr_cmp type, int *better); |
435 | object *pick_arrow_target (object *op, const char *type, int dir); |
414 | object *pick_arrow_target (object *op, shstr_cmp type, int dir); |
436 | int fire_bow (object *op, object *part, object *arrow, int dir, int wc_mod, sint16 sx, sint16 sy); |
415 | int fire_bow (object *op, object *part, object *arrow, int dir, int wc_mod, sint16 sx, sint16 sy); |
437 | int player_fire_bow (object *op, int dir); |
416 | int player_fire_bow (object *op, int dir); |
438 | void fire_misc_object (object *op, int dir); |
417 | void fire_misc_object (object *op, int dir); |
439 | bool fire (object *op, int dir); |
418 | bool fire (object *op, int dir); |
440 | object *find_key (object *pl, object *container, object *door); |
419 | object *find_key (object *pl, object *container, object *door); |
… | |
… | |
553 | void polymorph_living (object *op); |
532 | void polymorph_living (object *op); |
554 | void polymorph_melt (object *who, object *op); |
533 | void polymorph_melt (object *who, object *op); |
555 | void polymorph_item (object *who, object *op); |
534 | void polymorph_item (object *who, object *op); |
556 | void polymorph (object *op, object *who); |
535 | void polymorph (object *op, object *who); |
557 | int cast_polymorph (object *op, object *caster, object *spell_ob, int dir); |
536 | int cast_polymorph (object *op, object *caster, object *spell_ob, int dir); |
558 | int cast_create_missile (object *op, object *caster, object *spell, int dir, const char *stringarg); |
537 | int cast_create_missile (object *op, object *caster, object *spell, int dir, const char *spellparam); |
559 | int cast_create_food (object *op, object *caster, object *spell_ob, int dir, const char *stringarg); |
538 | int cast_create_food (object *op, object *caster, object *spell_ob, int dir, const char *spellparam); |
560 | int probe (object *op, object *caster, object *spell_ob, int dir); |
539 | int probe (object *op, object *caster, object *spell_ob, int dir); |
561 | int makes_invisible_to (object *pl, object *mon); |
540 | int makes_invisible_to (object *pl, object *mon); |
562 | int cast_invisible (object *op, object *caster, object *spell_ob); |
541 | int cast_invisible (object *op, object *caster, object *spell_ob); |
563 | int cast_earth_to_dust (object *op, object *caster, object *spell_ob); |
542 | int cast_earth_to_dust (object *op, object *caster, object *spell_ob); |
564 | void execute_word_of_recall (object *op); |
543 | void execute_word_of_recall (object *op); |
565 | int cast_word_of_recall (object *op, object *caster, object *spell_ob); |
544 | int cast_word_of_recall (object *op, object *caster, object *spell_ob); |
566 | int cast_wonder (object *op, object *caster, int dir, object *spell_ob); |
545 | int cast_wonder (object *op, object *caster, int dir, object *spell_ob); |
567 | int perceive_self (object *op); |
546 | int perceive_self (object *op); |
568 | int magic_wall (object *op, object *caster, int dir, object *spell_ob); |
547 | int magic_wall (object *op, object *caster, int dir, object *spell_ob); |
569 | int dimension_door (object *op, object *caster, object *spob, int dir); |
548 | int dimension_door (object *op, object *caster, object *spob, int dir, const char *spellparam); |
570 | int cast_heal (object *op, object *caster, object *spell, int dir); |
549 | int cast_heal (object *op, object *caster, object *spell, int dir); |
|
|
550 | int change_ability_duration (object *spell, object *caster); |
571 | int cast_change_ability (object *op, object *caster, object *spell_ob, int dir, int silent); |
551 | int cast_change_ability (object *op, object *caster, object *spell_ob, int dir, int silent); |
572 | int cast_bless (object *op, object *caster, object *spell_ob, int dir); |
552 | int cast_bless (object *op, object *caster, object *spell_ob, int dir); |
573 | int alchemy (object *op, object *caster, object *spell_ob); |
553 | int alchemy (object *op, object *caster, object *spell_ob); |
574 | int remove_curse (object *op, object *caster, object *spell); |
554 | int remove_curse (object *op, object *caster, object *spell); |
575 | int cast_identify (object *op, object *caster, object *spell); |
555 | int cast_identify (object *op, object *caster, object *spell); |
… | |
… | |
583 | void move_aura (object *aura); |
563 | void move_aura (object *aura); |
584 | void move_peacemaker (object *op); |
564 | void move_peacemaker (object *op); |
585 | int write_mark (object *op, object *spell, const char *msg); |
565 | int write_mark (object *op, object *spell, const char *msg); |
586 | |
566 | |
587 | /* spell_util.c */ |
567 | /* spell_util.c */ |
588 | object *find_random_spell_in_ob (object *ob, const char *skill); |
568 | object *find_random_spell_in_ob (object *ob, shstr_cmp skill = shstr_cmp ()); |
589 | void set_spell_skill (object *op, object *caster, object *spob, object *dest); |
569 | void set_spell_skill (object *op, object *caster, object *spob, object *dest); |
590 | void spell_effect (object *spob, int x, int y, maptile *map, object *originator); |
570 | void spell_effect (object *spob, int x, int y, maptile *map, object *originator); |
591 | int min_casting_level (object *caster, object *spell); |
571 | int min_casting_level (object *caster, object *spell); |
592 | int caster_level (object *caster, object *spell); |
572 | int casting_level (object *caster, object *spell); |
593 | sint16 SP_level_spellpoint_cost (object *caster, object *spell, int flags); |
573 | sint16 SP_level_spellpoint_cost (object *caster, object *spell, int flags); |
594 | int SP_level_dam_adjust (object *caster, object *spob); |
574 | int SP_level_dam_adjust (object *caster, object *spob); |
595 | int SP_level_duration_adjust (object *caster, object *spob); |
575 | int SP_level_duration_adjust (object *caster, object *spob); |
596 | int SP_level_range_adjust (object *caster, object *spob); |
576 | int SP_level_range_adjust (object *caster, object *spob); |
597 | object *check_spell_known (object *op, const char *name); |
577 | object *check_spell_known (object *op, shstr_cmp name); |
598 | object *lookup_spell_by_name (object *op, const char *spname); |
578 | object *lookup_spell_by_name (object *op, const char *spname); |
599 | int reflwall (maptile *m, int x, int y, object *sp_op); |
579 | int reflwall (maptile *m, int x, int y, object *sp_op); |
600 | int cast_create_obj (object *op, object *caster, object *new_op, int dir); |
580 | int cast_create_obj (object *op, object *caster, object *new_op, int dir); |
601 | int ok_to_put_more (maptile *m, sint16 x, sint16 y, object *op, int immune_stop); |
581 | int ok_to_put_more (maptile *m, sint16 x, sint16 y, object *op, int immune_stop); |
602 | int fire_arch_from_position (object *op, object *caster, sint16 x, sint16 y, int dir, object *spell); |
582 | int fire_arch_from_position (object *op, object *caster, sint16 x, sint16 y, int dir, object *spell); |
… | |
… | |
607 | void put_a_monster (object *op, const char *monstername); |
587 | void put_a_monster (object *op, const char *monstername); |
608 | int summon_hostile_monsters (object *op, int n, const char *monstername); |
588 | int summon_hostile_monsters (object *op, int n, const char *monstername); |
609 | void shuffle_attack (object *op, int change_face); |
589 | void shuffle_attack (object *op, int change_face); |
610 | void prayer_failure (object *op, int failure, int power); |
590 | void prayer_failure (object *op, int failure, int power); |
611 | void spell_failure (object *op, int failure, int power, object *skill); |
591 | void spell_failure (object *op, int failure, int power, object *skill); |
612 | int cast_party_spell (object *op, object *caster, int dir, object *spell_ob, char *stringarg); |
592 | int cast_party_spell (object *op, object *caster, int dir, object *spell_ob, char *spellparam); |
613 | int cast_spell (object *op, object *caster, int dir, object *spell_ob, char *stringarg); |
593 | int cast_spell (object *op, object *caster, int dir, object *spell_ob, char *spellparam); |
614 | void move_spell_effect (object *op); |
594 | void move_spell_effect (object *op); |
615 | void check_spell_effect (object *op); |
595 | void check_spell_effect (object *op); |
616 | void apply_spell_effect (object *spell, object *victim); |
596 | void apply_spell_effect (object *spell, object *victim); |
|
|
597 | void create_exploding_ball_at (object *victim, int level); |
617 | |
598 | |
618 | /* swamp.c */ |
599 | /* swamp.c */ |
619 | void walk_on_deep_swamp (object *op, object *victim); |
600 | void walk_on_deep_swamp (object *op, object *victim); |
620 | void move_deep_swamp (object *op); |
601 | void move_deep_swamp (object *op); |
621 | |
602 | |