… | |
… | |
915 | * other places as well!) |
915 | * other places as well!) |
916 | */ |
916 | */ |
917 | if (hitter->destroyed () || hitter->env != NULL) |
917 | if (hitter->destroyed () || hitter->env != NULL) |
918 | { |
918 | { |
919 | if (container) |
919 | if (container) |
920 | container->destroy (true); |
920 | container->destroy (); |
921 | |
921 | |
922 | return 0; |
922 | return 0; |
923 | } |
923 | } |
924 | |
924 | |
925 | /* Missile hit victim */ |
925 | /* Missile hit victim */ |
… | |
… | |
934 | hitter = fix_stopped_arrow (hitter); |
934 | hitter = fix_stopped_arrow (hitter); |
935 | if (!hitter) |
935 | if (!hitter) |
936 | return 0; |
936 | return 0; |
937 | } |
937 | } |
938 | else |
938 | else |
939 | container->destroy (true); |
939 | container->destroy (); |
940 | |
940 | |
941 | /* Try to stick arrow into victim */ |
941 | /* Try to stick arrow into victim */ |
942 | if (!victim->destroyed () && stick_arrow (hitter, victim)) |
942 | if (!victim->destroyed () && stick_arrow (hitter, victim)) |
943 | return 0; |
943 | return 0; |
944 | |
944 | |
… | |
… | |
988 | } |
988 | } |
989 | else if (!GET_ANIM_ID (op)) |
989 | else if (!GET_ANIM_ID (op)) |
990 | { |
990 | { |
991 | /* Object has been called - no animations, so remove it */ |
991 | /* Object has been called - no animations, so remove it */ |
992 | if (op->stats.hp < 0) |
992 | if (op->stats.hp < 0) |
993 | op->destroy (true); |
993 | op->destroy (); |
994 | |
994 | |
995 | return; /* no animations, so nothing more to do */ |
995 | return; /* no animations, so nothing more to do */ |
996 | } |
996 | } |
997 | |
997 | |
998 | perc = NUM_ANIMATIONS (op) - ((int) NUM_ANIMATIONS (op) * op->stats.hp) / op->stats.maxhp; |
998 | perc = NUM_ANIMATIONS (op) - ((int) NUM_ANIMATIONS (op) * op->stats.hp) / op->stats.maxhp; |
… | |
… | |
1007 | |
1007 | |
1008 | if (perc == NUM_ANIMATIONS (op) - 1) |
1008 | if (perc == NUM_ANIMATIONS (op) - 1) |
1009 | { /* Reached the last animation */ |
1009 | { /* Reached the last animation */ |
1010 | if (op->face == blank_face) |
1010 | if (op->face == blank_face) |
1011 | /* If the last face is blank, remove the ob */ |
1011 | /* If the last face is blank, remove the ob */ |
1012 | op->destroy (true); |
1012 | op->destroy (); |
1013 | else |
1013 | else |
1014 | { /* The last face was not blank, leave an image */ |
1014 | { /* The last face was not blank, leave an image */ |
1015 | CLEAR_FLAG (op, FLAG_BLOCKSVIEW); |
1015 | CLEAR_FLAG (op, FLAG_BLOCKSVIEW); |
1016 | update_all_los (op->map, op->x, op->y); |
1016 | update_all_los (op->map, op->x, op->y); |
1017 | op->move_block = 0; |
1017 | op->move_block = 0; |
… | |
… | |
1932 | SET_FLAG (tmp, FLAG_UNAGGRESSIVE); |
1932 | SET_FLAG (tmp, FLAG_UNAGGRESSIVE); |
1933 | |
1933 | |
1934 | j = find_first_free_spot (tmp, op->map, op->x, op->y); |
1934 | j = find_first_free_spot (tmp, op->map, op->x, op->y); |
1935 | |
1935 | |
1936 | if (j == -1) /* No spot to put this monster */ |
1936 | if (j == -1) /* No spot to put this monster */ |
1937 | tmp->destroy (true); |
1937 | tmp->destroy (); |
1938 | else |
1938 | else |
1939 | { |
1939 | { |
1940 | tmp->x = op->x + freearr_x[j], tmp->y = op->y + freearr_y[j]; |
1940 | tmp->x = op->x + freearr_x[j], tmp->y = op->y + freearr_y[j]; |
1941 | insert_ob_in_map (tmp, op->map, NULL, 0); |
1941 | insert_ob_in_map (tmp, op->map, NULL, 0); |
1942 | } |
1942 | } |
1943 | } |
1943 | } |
1944 | |
1944 | |
1945 | op->destroy (true); |
1945 | op->destroy (); |
1946 | } |
1946 | } |
1947 | else if (type & AT_DRAIN && hitter->type == GRIMREAPER && hitter->value++ > 10) |
1947 | else if (type & AT_DRAIN && hitter->type == GRIMREAPER && hitter->value++ > 10) |
1948 | hitter->drop_and_destroy (); |
1948 | hitter->drop_and_destroy (); |
1949 | |
1949 | |
1950 | return maxdam; |
1950 | return maxdam; |