… | |
… | |
1443 | betterby = 1 + arrow->magic + arrow->stats.dam; |
1443 | betterby = 1 + arrow->magic + arrow->stats.dam; |
1444 | } |
1444 | } |
1445 | } |
1445 | } |
1446 | } |
1446 | } |
1447 | } |
1447 | } |
|
|
1448 | |
1448 | if (tmp == NULL && arrow == NULL) |
1449 | if (tmp == NULL && arrow == NULL) |
1449 | return find_arrow (op, type); |
1450 | return find_arrow (op, type); |
1450 | |
1451 | |
1451 | *better = betterby; |
1452 | *better = betterby; |
1452 | return tmp; |
1453 | return tmp; |
… | |
… | |
2779 | lost_a_stat = 1; |
2780 | lost_a_stat = 1; |
2780 | } |
2781 | } |
2781 | } |
2782 | } |
2782 | } |
2783 | } |
2783 | } |
2784 | } |
|
|
2785 | |
2784 | /* If no stat lost, tell the player. */ |
2786 | /* If no stat lost, tell the player. */ |
2785 | if (!lost_a_stat) |
2787 | if (!lost_a_stat) |
2786 | { |
2788 | { |
2787 | /* determine_god() seems to not work sometimes... why is this? |
2789 | /* determine_god() seems to not work sometimes... why is this? |
2788 | Should I be using something else? GD */ |
2790 | Should I be using something else? GD */ |
… | |
… | |
2792 | new_draw_info_format (NDI_UNIQUE, 0, op, "For a brief moment you feel the holy presence of %s protecting" " you.", god); |
2794 | new_draw_info_format (NDI_UNIQUE, 0, op, "For a brief moment you feel the holy presence of %s protecting" " you.", god); |
2793 | else |
2795 | else |
2794 | new_draw_info (NDI_UNIQUE, 0, op, "For a brief moment you feel a holy presence protecting you."); |
2796 | new_draw_info (NDI_UNIQUE, 0, op, "For a brief moment you feel a holy presence protecting you."); |
2795 | } |
2797 | } |
2796 | #else |
2798 | #else |
2797 | new_draw_info (NDI_UNIQUE, 0, op, "For a brief moment you" " feel a holy presence protecting you from losing yourself completely."); |
2799 | new_draw_info (NDI_UNIQUE, 0, op, "For a brief moment you feel a holy presence protecting you from losing yourself completely."); |
2798 | #endif |
2800 | #endif |
2799 | |
2801 | |
2800 | /* Put a gravestone up where the character 'almost' died. List the |
2802 | /* Put a gravestone up where the character 'almost' died. List the |
2801 | * exp loss on the stone. |
2803 | * exp loss on the stone. |
2802 | */ |
2804 | */ |
2803 | tmp = arch_to_object (archetype::find ("gravestone")); |
2805 | tmp = arch_to_object (archetype::find ("gravestone")); |
2804 | sprintf (buf, "%s's gravestone", &op->name); |
2806 | tmp->name = format ("%s's gravestone", &op->name); |
2805 | tmp->name = buf; |
2807 | tmp->name_pl = format ("%s's gravestones", &op->name); |
2806 | sprintf (buf, "%s's gravestones", &op->name); |
|
|
2807 | tmp->name_pl = buf; |
|
|
2808 | sprintf (buf, "RIP\nHere rests the hero %s the %s,\n" "who was killed\n" "by %s.\n", &op->name, op->contr->title, op->contr->killer_name ()); |
2808 | tmp->msg = format ("RIP\nHere rests the hero %s the %s,\nwho was killed\nby %s.\n", &op->name, op->contr->title, op->contr->killer_name ()); |
2809 | tmp->msg = buf; |
|
|
2810 | tmp->x = op->x, tmp->y = op->y; |
2809 | tmp->x = op->x, tmp->y = op->y; |
2811 | insert_ob_in_map (tmp, op->map, NULL, 0); |
2810 | insert_ob_in_map (tmp, op->map, NULL, 0); |
2812 | |
2811 | |
2813 | /**************************************/ |
2812 | /**************************************/ |
2814 | /* */ |
2813 | /* */ |
… | |
… | |
2837 | new_draw_info (NDI_UNIQUE, 0, tmp, "Your mind feels clearer"); |
2836 | new_draw_info (NDI_UNIQUE, 0, tmp, "Your mind feels clearer"); |
2838 | } |
2837 | } |
2839 | |
2838 | |
2840 | cure_disease (op, 0, 0); /* remove any disease */ |
2839 | cure_disease (op, 0, 0); /* remove any disease */ |
2841 | |
2840 | |
|
|
2841 | // remove all spell effects that are active |
|
|
2842 | // to avoid long-term effects such as word-of-recall |
|
|
2843 | for (object *item = op->inv; item; ) |
|
|
2844 | { |
|
|
2845 | object *next = item->below; |
|
|
2846 | |
|
|
2847 | if (item->type == SPELL_EFFECT && item->active) |
|
|
2848 | item->destroy (); |
|
|
2849 | |
|
|
2850 | item = next; |
|
|
2851 | } |
|
|
2852 | |
2842 | /*add_exp(op, (op->stats.exp * -0.20)); */ |
2853 | /*add_exp(op, (op->stats.exp * -0.20)); */ |
2843 | apply_death_exp_penalty (op); |
2854 | apply_death_exp_penalty (op); |
|
|
2855 | |
2844 | if (op->stats.food < 100) |
2856 | if (op->stats.food < 100) |
2845 | op->stats.food = 900; |
2857 | op->stats.food = 900; |
|
|
2858 | |
2846 | op->stats.hp = op->stats.maxhp; |
2859 | op->stats.hp = op->stats.maxhp; |
2847 | op->stats.sp = MAX (op->stats.sp, op->stats.maxsp); |
2860 | op->stats.sp = MAX (op->stats.sp, op->stats.maxsp); |
2848 | op->stats.grace = MAX (op->stats.grace, op->stats.maxgrace); |
2861 | op->stats.grace = MAX (op->stats.grace, op->stats.maxgrace); |
2849 | |
2862 | |
2850 | /* |
2863 | /* |