… | |
… | |
366 | attachable::do_destroy (); |
366 | attachable::do_destroy (); |
367 | |
367 | |
368 | if (ob) |
368 | if (ob) |
369 | { |
369 | { |
370 | ob->destroy_inv (false); |
370 | ob->destroy_inv (false); |
371 | ob->destroy (); |
371 | ob->destroy (true); |
372 | } |
372 | } |
373 | |
373 | |
374 | ob = observe = 0; |
374 | ob = observe = 0; |
375 | } |
375 | } |
376 | |
376 | |
… | |
… | |
668 | || op->type == CLOAK || op->type == HELMET |
668 | || op->type == CLOAK || op->type == HELMET |
669 | || op->type == SHIELD || op->type == GLOVES |
669 | || op->type == SHIELD || op->type == GLOVES |
670 | || op->type == BRACERS || op->type == GIRDLE)) |
670 | || op->type == BRACERS || op->type == GIRDLE)) |
671 | || (!QUERY_FLAG (pl, FLAG_USE_WEAPON) && op->type == WEAPON)) |
671 | || (!QUERY_FLAG (pl, FLAG_USE_WEAPON) && op->type == WEAPON)) |
672 | { |
672 | { |
673 | op->destroy (); |
673 | op->destroy (true); |
674 | continue; |
674 | continue; |
675 | } |
675 | } |
676 | } |
676 | } |
677 | |
677 | |
678 | /* This really needs to be better - we should really give |
678 | /* This really needs to be better - we should really give |
… | |
… | |
689 | if (tmp->type == op->type && tmp->name == op->name) |
689 | if (tmp->type == op->type && tmp->name == op->name) |
690 | break; |
690 | break; |
691 | |
691 | |
692 | if (tmp) |
692 | if (tmp) |
693 | { |
693 | { |
694 | op->destroy (); |
694 | op->destroy (true); |
695 | LOG (llevError, "give_initial_items: Removing duplicate object %s\n", &tmp->name); |
695 | LOG (llevError, "give_initial_items: Removing duplicate object %s\n", &tmp->name); |
696 | continue; |
696 | continue; |
697 | } |
697 | } |
698 | |
698 | |
699 | if (op->nrof > 1) |
699 | if (op->nrof > 1) |
… | |
… | |
714 | CLEAR_FLAG (op, FLAG_DAMNED); |
714 | CLEAR_FLAG (op, FLAG_DAMNED); |
715 | } |
715 | } |
716 | |
716 | |
717 | if (op->type == SPELL) |
717 | if (op->type == SPELL) |
718 | { |
718 | { |
719 | op->destroy (); |
719 | op->destroy (true); |
720 | continue; |
720 | continue; |
721 | } |
721 | } |
722 | else if (op->type == SKILL) |
722 | else if (op->type == SKILL) |
723 | { |
723 | { |
724 | SET_FLAG (op, FLAG_CAN_USE_SKILL); |
724 | SET_FLAG (op, FLAG_CAN_USE_SKILL); |
… | |
… | |
1578 | } |
1578 | } |
1579 | |
1579 | |
1580 | /* this should not happen, but sometimes does */ |
1580 | /* this should not happen, but sometimes does */ |
1581 | if (arrow->nrof == 0) |
1581 | if (arrow->nrof == 0) |
1582 | { |
1582 | { |
|
|
1583 | LOG (llevError | logBacktrace, "arrow (%s) has nrof 0\n", arrow->debug_desc ()); |
1583 | arrow->destroy (); |
1584 | arrow->destroy (true); |
1584 | return 0; |
1585 | return 0; |
1585 | } |
1586 | } |
1586 | |
1587 | |
1587 | left = arrow; /* these are arrows left to the player */ |
1588 | left = arrow; /* these are arrows left to the player */ |
1588 | arrow = arrow->split (); |
1589 | arrow = arrow->split (); |
… | |
… | |
2252 | if (QUERY_FLAG (tmp, FLAG_APPLIED) && QUERY_FLAG (tmp, FLAG_LIFESAVE)) |
2253 | if (QUERY_FLAG (tmp, FLAG_APPLIED) && QUERY_FLAG (tmp, FLAG_LIFESAVE)) |
2253 | { |
2254 | { |
2254 | op->play_sound (sound_find ("ob_evaporate")); |
2255 | op->play_sound (sound_find ("ob_evaporate")); |
2255 | new_draw_info_format (NDI_UNIQUE, 0, op, "Your %s vibrates violently, then evaporates.", query_name (tmp)); |
2256 | new_draw_info_format (NDI_UNIQUE, 0, op, "Your %s vibrates violently, then evaporates.", query_name (tmp)); |
2256 | |
2257 | |
2257 | tmp->destroy (); |
2258 | tmp->destroy (true); |
2258 | CLEAR_FLAG (op, FLAG_LIFESAVE); |
2259 | CLEAR_FLAG (op, FLAG_LIFESAVE); |
2259 | |
2260 | |
2260 | if (op->stats.hp < 0) |
2261 | if (op->stats.hp < 0) |
2261 | op->stats.hp = op->stats.maxhp; |
2262 | op->stats.hp = op->stats.maxhp; |
2262 | |
2263 | |
… | |
… | |
2568 | op->stats.food = 0; |
2569 | op->stats.food = 0; |
2569 | |
2570 | |
2570 | if (op->stats.hp < 0) |
2571 | if (op->stats.hp < 0) |
2571 | { |
2572 | { |
2572 | op->contr->killer = archetype::get ("killer_starvation"); |
2573 | op->contr->killer = archetype::get ("killer_starvation"); |
2573 | op->contr->killer->destroy (); |
2574 | op->contr->killer->destroy (true); |
2574 | } |
2575 | } |
2575 | } |
2576 | } |
2576 | |
2577 | |
2577 | /* killer should be set here already */ |
2578 | /* killer should be set here already */ |
2578 | if (op->stats.hp < 0 && !QUERY_FLAG (op, FLAG_WIZ)) |
2579 | if (op->stats.hp < 0 && !QUERY_FLAG (op, FLAG_WIZ)) |
… | |
… | |
2609 | |
2610 | |
2610 | /* restore player */ |
2611 | /* restore player */ |
2611 | at = archetype::find ("poisoning"); |
2612 | at = archetype::find ("poisoning"); |
2612 | if (object *tmp = present_arch_in_ob (at, op)) |
2613 | if (object *tmp = present_arch_in_ob (at, op)) |
2613 | { |
2614 | { |
2614 | tmp->destroy (); |
2615 | tmp->destroy (true); |
2615 | new_draw_info (NDI_UNIQUE, 0, op, "Your body feels cleansed"); |
2616 | new_draw_info (NDI_UNIQUE, 0, op, "Your body feels cleansed"); |
2616 | } |
2617 | } |
2617 | |
2618 | |
2618 | at = archetype::find ("confusion"); |
2619 | at = archetype::find ("confusion"); |
2619 | if (object *tmp = present_arch_in_ob (at, op)) |
2620 | if (object *tmp = present_arch_in_ob (at, op)) |
2620 | { |
2621 | { |
2621 | tmp->destroy (); |
2622 | tmp->destroy (true); |
2622 | new_draw_info (NDI_UNIQUE, 0, tmp, "Your mind feels clearer"); |
2623 | new_draw_info (NDI_UNIQUE, 0, tmp, "Your mind feels clearer"); |
2623 | } |
2624 | } |
2624 | |
2625 | |
2625 | cure_disease (op, 0, 0); /* remove any disease */ |
2626 | cure_disease (op, 0, 0); /* remove any disease */ |
2626 | op->stats.hp = op->stats.maxhp; |
2627 | op->stats.hp = op->stats.maxhp; |
… | |
… | |
2811 | at = archetype::find ("poisoning"); |
2812 | at = archetype::find ("poisoning"); |
2812 | tmp = present_arch_in_ob (at, op); |
2813 | tmp = present_arch_in_ob (at, op); |
2813 | |
2814 | |
2814 | if (tmp) |
2815 | if (tmp) |
2815 | { |
2816 | { |
2816 | tmp->destroy (); |
2817 | tmp->destroy (true); |
2817 | new_draw_info (NDI_UNIQUE, 0, op, "Your body feels cleansed"); |
2818 | new_draw_info (NDI_UNIQUE, 0, op, "Your body feels cleansed"); |
2818 | } |
2819 | } |
2819 | |
2820 | |
2820 | at = archetype::find ("confusion"); |
2821 | at = archetype::find ("confusion"); |
2821 | tmp = present_arch_in_ob (at, op); |
2822 | tmp = present_arch_in_ob (at, op); |
2822 | if (tmp) |
2823 | if (tmp) |
2823 | { |
2824 | { |
2824 | tmp->destroy (); |
2825 | tmp->destroy (true); |
2825 | new_draw_info (NDI_UNIQUE, 0, tmp, "Your mind feels clearer"); |
2826 | new_draw_info (NDI_UNIQUE, 0, tmp, "Your mind feels clearer"); |
2826 | } |
2827 | } |
2827 | |
2828 | |
2828 | cure_disease (op, 0, 0); /* remove any disease */ |
2829 | cure_disease (op, 0, 0); /* remove any disease */ |
2829 | |
2830 | |
… | |
… | |
2832 | for (object *item = op->inv; item; ) |
2833 | for (object *item = op->inv; item; ) |
2833 | { |
2834 | { |
2834 | object *next = item->below; |
2835 | object *next = item->below; |
2835 | |
2836 | |
2836 | if (item->type == SPELL_EFFECT && item->active) |
2837 | if (item->type == SPELL_EFFECT && item->active) |
2837 | item->destroy (); |
2838 | item->destroy (true); |
2838 | |
2839 | |
2839 | item = next; |
2840 | item = next; |
2840 | } |
2841 | } |
2841 | |
2842 | |
2842 | /*add_exp(op, (op->stats.exp * -0.20)); */ |
2843 | /*add_exp(op, (op->stats.exp * -0.20)); */ |
… | |
… | |
2923 | { |
2924 | { |
2924 | tmp->decrease (rndm (1, tmp->nrof - 1)); |
2925 | tmp->decrease (rndm (1, tmp->nrof - 1)); |
2925 | insert_ob_in_map (tmp, op->map, NULL, 0); |
2926 | insert_ob_in_map (tmp, op->map, NULL, 0); |
2926 | } |
2927 | } |
2927 | else |
2928 | else |
2928 | tmp->destroy (); |
2929 | tmp->destroy (true); |
2929 | } |
2930 | } |
2930 | else |
2931 | else |
2931 | insert_ob_in_map (tmp, op->map, NULL, 0); |
2932 | insert_ob_in_map (tmp, op->map, NULL, 0); |
2932 | } |
2933 | } |
2933 | } |
2934 | } |
… | |
… | |
2994 | if (op->type == PLAYER) |
2995 | if (op->type == PLAYER) |
2995 | new_draw_info_format (NDI_UNIQUE, 0, op, "You cast %s.", &spob->name); |
2996 | new_draw_info_format (NDI_UNIQUE, 0, op, "You cast %s.", &spob->name); |
2996 | |
2997 | |
2997 | cast_spell (op, throw_ob, dir, spob, NULL); |
2998 | cast_spell (op, throw_ob, dir, spob, NULL); |
2998 | |
2999 | |
2999 | throw_ob->destroy (); |
3000 | throw_ob->destroy (true); |
3000 | } |
3001 | } |
3001 | |
3002 | |
3002 | void |
3003 | void |
3003 | make_visible (object *op) |
3004 | make_visible (object *op) |
3004 | { |
3005 | { |