… | |
… | |
689 | if (QUERY_FLAG (*target, FLAG_FREED) || QUERY_FLAG (*hitter, FLAG_FREED)) |
689 | if (QUERY_FLAG (*target, FLAG_FREED) || QUERY_FLAG (*hitter, FLAG_FREED)) |
690 | { |
690 | { |
691 | LOG (llevError, "BUG: get_attack_mode(): freed object\n"); |
691 | LOG (llevError, "BUG: get_attack_mode(): freed object\n"); |
692 | return 1; |
692 | return 1; |
693 | } |
693 | } |
|
|
694 | |
694 | if ((*target)->head) |
695 | if ((*target)->head) |
695 | *target = (*target)->head; |
696 | *target = (*target)->head; |
|
|
697 | |
696 | if ((*hitter)->head) |
698 | if ((*hitter)->head) |
697 | *hitter = (*hitter)->head; |
699 | *hitter = (*hitter)->head; |
|
|
700 | |
698 | if ((*hitter)->env != NULL || (*target)->env != NULL) |
701 | if ((*hitter)->env != NULL || (*target)->env != NULL) |
699 | { |
702 | { |
700 | *simple_attack = 1; |
703 | *simple_attack = 1; |
701 | return 0; |
704 | return 0; |
702 | } |
705 | } |
|
|
706 | |
703 | if (QUERY_FLAG (*target, FLAG_REMOVED) |
707 | if (QUERY_FLAG (*target, FLAG_REMOVED) |
704 | || QUERY_FLAG (*hitter, FLAG_REMOVED) || (*hitter)->map == NULL || !on_same_map ((*hitter), (*target))) |
708 | || QUERY_FLAG (*hitter, FLAG_REMOVED) |
|
|
709 | || !(*hitter)->map |
|
|
710 | || !on_same_map (*hitter, *target)) |
705 | { |
711 | { |
706 | LOG (llevError, "BUG: hitter (arch %s, name %s) with no relation to " "target\n", &(*hitter)->arch->archname, &(*hitter)->name); |
712 | LOG (llevError | logBacktrace, "BUG: hitter (%s) with no relation to target (%s)\n", |
|
|
713 | (*hitter)->debug_desc (), (*target)->debug_desc ()); |
707 | return 1; |
714 | return 1; |
708 | } |
715 | } |
|
|
716 | |
709 | *simple_attack = 0; |
717 | *simple_attack = 0; |
710 | return 0; |
718 | return 0; |
711 | } |
719 | } |
712 | |
720 | |
713 | static int |
721 | static int |
… | |
… | |
1958 | return maxdam; |
1966 | return maxdam; |
1959 | } |
1967 | } |
1960 | |
1968 | |
1961 | op->remove (); |
1969 | op->remove (); |
1962 | |
1970 | |
1963 | for (i = 0; i < NROFNEWOBJS (op); i++) |
1971 | for (i = 0; i < op->stats.food; i++) |
1964 | { /* This doesn't handle op->more yet */ |
1972 | { /* This doesn't handle op->more yet */ |
1965 | object *tmp = arch_to_object (op->other_arch); |
1973 | object *tmp = arch_to_object (op->other_arch); |
1966 | int j; |
1974 | int j; |
1967 | |
1975 | |
1968 | tmp->stats.hp = op->stats.hp; |
1976 | tmp->stats.hp = op->stats.hp; |
… | |
… | |
2040 | tmp->stats.Dex = MAX (-(dam / 6 + 1), -10); |
2048 | tmp->stats.Dex = MAX (-(dam / 6 + 1), -10); |
2041 | tmp->stats.Int = MAX (-dam / 7, -10); |
2049 | tmp->stats.Int = MAX (-dam / 7, -10); |
2042 | SET_FLAG (tmp, FLAG_APPLIED); |
2050 | SET_FLAG (tmp, FLAG_APPLIED); |
2043 | op->update_stats (); |
2051 | op->update_stats (); |
2044 | new_draw_info (NDI_UNIQUE, 0, op, "You suddenly feel very ill."); |
2052 | new_draw_info (NDI_UNIQUE, 0, op, "You suddenly feel very ill."); |
|
|
2053 | op->play_sound (tmp->sound); |
2045 | } |
2054 | } |
2046 | |
2055 | |
2047 | if (hitter->type == PLAYER) |
2056 | if (hitter->type == PLAYER) |
2048 | new_draw_info_format (NDI_UNIQUE, 0, hitter, "You poison %s.", &op->name); |
2057 | new_draw_info_format (NDI_UNIQUE, 0, hitter, "You poison %s.", &op->name); |
2049 | else if (hitter->owner != NULL && hitter->owner->type == PLAYER) |
2058 | else if (hitter->owner != NULL && hitter->owner->type == PLAYER) |