… | |
… | |
24 | #include <assert.h> |
24 | #include <assert.h> |
25 | #include <global.h> |
25 | #include <global.h> |
26 | #include <living.h> |
26 | #include <living.h> |
27 | #include <material.h> |
27 | #include <material.h> |
28 | #include <skills.h> |
28 | #include <skills.h> |
29 | |
|
|
30 | #ifndef __CEXTRACT__ |
|
|
31 | # include <sproto.h> |
|
|
32 | #endif |
|
|
33 | |
|
|
34 | #include <sounds.h> |
29 | #include <sounds.h> |
|
|
30 | #include <sproto.h> |
35 | |
31 | |
36 | typedef struct att_msg_str |
32 | typedef struct att_msg_str |
37 | { |
33 | { |
38 | char *msg1; |
34 | char *msg1; |
39 | char *msg2; |
35 | char *msg2; |
… | |
… | |
654 | { |
650 | { |
655 | i = 4; |
651 | i = 4; |
656 | map = hitter->map; |
652 | map = hitter->map; |
657 | if (out_of_map (map, hitter->x, hitter->y)) |
653 | if (out_of_map (map, hitter->x, hitter->y)) |
658 | return; |
654 | return; |
|
|
655 | |
659 | next = GET_MAP_OB (map, hitter->x, hitter->y); |
656 | next = GET_MAP_OB (map, hitter->x, hitter->y); |
660 | if (next) |
657 | if (next) |
661 | while (next) |
658 | while (next) |
662 | { |
659 | { |
663 | if (next->type == SPELL_EFFECT && (next->subtype == SP_EXPLOSION || next->subtype == SP_BULLET || next->subtype == SP_CONE)) |
660 | if (next->type == SPELL_EFFECT && (next->subtype == SP_EXPLOSION || next->subtype == SP_BULLET || next->subtype == SP_CONE)) |
664 | i *= 3; |
661 | i *= 3; |
665 | tmp = next; |
662 | tmp = next; |
666 | next = tmp->above; |
663 | next = tmp->above; |
667 | } |
664 | } |
|
|
665 | |
668 | if (i < 0) |
666 | if (i < 0) |
669 | return; |
667 | return; |
|
|
668 | |
670 | if (rndm (0, i) != 0) |
669 | if (rndm (0, i) != 0) |
671 | return; |
670 | return; |
672 | } |
671 | } |
673 | else if (rndm (0, 5) != 0) |
672 | else if (rndm (0, 5) != 0) |
674 | return; |
673 | return; |
|
|
674 | |
675 | sprintf (buf, "Your %s%s %s.", &hitter->name, buf2, &op->name); |
675 | sprintf (buf, "Your %s%s %s.", &hitter->name, buf2, &op->name); |
676 | play_sound_map (op->map, op->x, op->y, SOUND_PLAYER_HITS4); |
676 | play_sound_map (op->map, op->x, op->y, SOUND_PLAYER_HITS4); |
677 | new_draw_info (NDI_BLACK, 0, hitter->owner, buf); |
677 | new_draw_info (NDI_BLACK, 0, hitter->owner, buf); |
678 | } |
678 | } |
679 | } |
679 | } |
… | |
… | |
2354 | #endif |
2354 | #endif |
2355 | |
2355 | |
2356 | return adjust; |
2356 | return adjust; |
2357 | } |
2357 | } |
2358 | |
2358 | |
2359 | |
|
|
2360 | /* determine if the object is an 'aimed' missile */ |
2359 | /* determine if the object is an 'aimed' missile */ |
2361 | int |
2360 | int |
2362 | is_aimed_missile (object *op) |
2361 | is_aimed_missile (object *op) |
2363 | { |
2362 | { |
2364 | |
2363 | |
… | |
… | |
2370 | if (op->type == ARROW || op->type == THROWN_OBJ) |
2369 | if (op->type == ARROW || op->type == THROWN_OBJ) |
2371 | return 1; |
2370 | return 1; |
2372 | else if (op->type == SPELL_EFFECT && (op->subtype == SP_BULLET || op->subtype == SP_EXPLOSION)) |
2371 | else if (op->type == SPELL_EFFECT && (op->subtype == SP_BULLET || op->subtype == SP_EXPLOSION)) |
2373 | return 1; |
2372 | return 1; |
2374 | } |
2373 | } |
|
|
2374 | |
2375 | return 0; |
2375 | return 0; |
2376 | } |
2376 | } |