ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/player.C
(Generate patch)

Comparing deliantra/server/server/player.C (file contents):
Revision 1.220 by root, Sun Dec 28 16:35:32 2008 UTC vs.
Revision 1.221 by root, Wed Dec 31 17:35:38 2008 UTC

2540 object *tmp; 2540 object *tmp;
2541 2541
2542 if (save_life (op)) 2542 if (save_life (op))
2543 return; 2543 return;
2544 2544
2545 /* restore player */
2546 at = archetype::find ("poisoning");
2547 if (object *tmp = present_arch_in_ob (at, op))
2548 {
2549 tmp->destroy ();
2550 new_draw_info (NDI_UNIQUE, 0, op, "Your body feels cleansed");
2551 }
2552
2553 at = archetype::find ("confusion");
2554 if (object *tmp = present_arch_in_ob (at, op))
2555 {
2556 tmp->destroy ();
2557 new_draw_info (NDI_UNIQUE, 0, tmp, "Your mind feels clearer");
2558 }
2559
2560 cure_disease (op, 0, 0); /* remove any disease */
2561
2562 max_it (op->stats.hp , op->stats.maxhp);
2563 max_it (op->stats.sp , op->stats.maxsp);
2564 max_it (op->stats.grace, op->stats.maxgrace);
2565
2566 if (op->stats.food <= 0)
2567 op->stats.food = 999;
2568
2569 // remove all spell effects that are active
2570 // to avoid long-term effects such as word-of-recall
2571 for (object *item = op->inv; item; )
2572 {
2573 object *next = item->below;
2574
2575 if (item->type == SPELL_EFFECT && item->active)
2576 item->destroy ();
2577
2578 item = next;
2579 }
2580
2545 /* If player dies on BATTLEGROUND, no stat/exp loss! For Combat-Arenas 2581 /* If player dies on BATTLEGROUND, no stat/exp loss! For Combat-Arenas
2546 * in cities ONLY!!! It is very important that this doesn't get abused. 2582 * in cities ONLY!!! It is very important that this doesn't get abused.
2547 * Look at op_on_battleground() for more info --AndreasV 2583 * Look at op_on_battleground() for more info --AndreasV
2548 */ 2584 */
2549 if (op_on_battleground (op, &x, &y)) 2585 if (op_on_battleground (op, &x, &y))
2550 { 2586 {
2551 new_draw_info (NDI_UNIQUE | NDI_NAVY, 0, op, "You have been defeated in combat!"); 2587 new_draw_info (NDI_UNIQUE | NDI_NAVY, 0, op, "You have been defeated in combat!");
2552 new_draw_info (NDI_UNIQUE | NDI_NAVY, 0, op, "Local medics have saved your life..."); 2588 new_draw_info (NDI_UNIQUE | NDI_NAVY, 0, op, "Local medics have saved your life...");
2553
2554 /* restore player */
2555 at = archetype::find ("poisoning");
2556 if (object *tmp = present_arch_in_ob (at, op))
2557 {
2558 tmp->destroy ();
2559 new_draw_info (NDI_UNIQUE, 0, op, "Your body feels cleansed");
2560 }
2561
2562 at = archetype::find ("confusion");
2563 if (object *tmp = present_arch_in_ob (at, op))
2564 {
2565 tmp->destroy ();
2566 new_draw_info (NDI_UNIQUE, 0, tmp, "Your mind feels clearer");
2567 }
2568
2569 cure_disease (op, 0, 0); /* remove any disease */
2570 op->stats.hp = op->stats.maxhp;
2571 if (op->stats.food <= 0)
2572 op->stats.food = 999;
2573 2589
2574 /* create a bodypart-trophy to make the winner happy */ 2590 /* create a bodypart-trophy to make the winner happy */
2575 if (object *tmp = arch_to_object (archetype::find ("finger"))) 2591 if (object *tmp = arch_to_object (archetype::find ("finger")))
2576 { 2592 {
2577 tmp->name = format ("%s's finger" , &op->name); 2593 tmp->name = format ("%s's finger" , &op->name);
2694 } 2710 }
2695 } 2711 }
2696 2712
2697 if (lose_this_stat) 2713 if (lose_this_stat)
2698 { 2714 {
2699 this_stat = get_attr_value (&(dep->stats), i); 2715 this_stat = get_attr_value (&dep->stats, i);
2700 /* We could try to do something clever like find another 2716 /* We could try to do something clever like find another
2701 * stat to reduce if this fails. But chances are, if 2717 * stat to reduce if this fails. But chances are, if
2702 * stats have been depleted to -50, all are pretty low 2718 * stats have been depleted to -50, all are pretty low
2703 * and should be roughly the same, so it shouldn't make a 2719 * and should be roughly the same, so it shouldn't make a
2704 * difference. 2720 * difference.
2718 /* If no stat lost, tell the player. */ 2734 /* If no stat lost, tell the player. */
2719 if (!lost_a_stat) 2735 if (!lost_a_stat)
2720 { 2736 {
2721 /* determine_god() seems to not work sometimes... why is this? 2737 /* determine_god() seems to not work sometimes... why is this?
2722 Should I be using something else? GD */ 2738 Should I be using something else? GD */
2723 const char *god = determine_god (op); 2739 shstr_tmp god = determine_god (op);
2724 2740
2725 if (god && (strcmp (god, "none"))) 2741 if (god != shstr_none)
2726 new_draw_info_format (NDI_UNIQUE, 0, op, "For a brief moment you feel the holy presence of %s protecting" " you.", god); 2742 new_draw_info_format (NDI_UNIQUE, 0, op, "For a brief moment you feel the holy presence of %s protecting" " you.", &god);
2727 else 2743 else
2728 new_draw_info (NDI_UNIQUE, 0, op, "For a brief moment you feel a holy presence protecting you."); 2744 new_draw_info (NDI_UNIQUE, 0, op, "For a brief moment you feel a holy presence protecting you.");
2729 } 2745 }
2730#else 2746#else
2731 new_draw_info (NDI_UNIQUE, 0, op, "For a brief moment you feel a holy presence protecting you from losing yourself completely."); 2747 new_draw_info (NDI_UNIQUE, 0, op, "For a brief moment you feel a holy presence protecting you from losing yourself completely.");
2743 insert_ob_in_map (tmp, op->map, NULL, 0); 2759 insert_ob_in_map (tmp, op->map, NULL, 0);
2744 2760
2745 /**************************************/ 2761 /**************************************/
2746 /* */ 2762 /* */
2747 /* Subtract the experience points, */ 2763 /* Subtract the experience points, */
2748 /* if we died cause of food, give us */
2749 /* food, and reset HP's... */
2750 /* */ 2764 /* */
2751 /**************************************/ 2765 /**************************************/
2752 2766
2753 /* remove any poisoning and confusion the character may be suffering. */
2754 /* restore player */
2755 at = archetype::find ("poisoning");
2756 tmp = present_arch_in_ob (at, op);
2757
2758 if (tmp)
2759 {
2760 tmp->destroy ();
2761 new_draw_info (NDI_UNIQUE, 0, op, "Your body feels cleansed");
2762 }
2763
2764 at = archetype::find ("confusion");
2765 tmp = present_arch_in_ob (at, op);
2766 if (tmp)
2767 {
2768 tmp->destroy ();
2769 new_draw_info (NDI_UNIQUE, 0, tmp, "Your mind feels clearer");
2770 }
2771
2772 cure_disease (op, 0, 0); /* remove any disease */
2773
2774 // remove all spell effects that are active
2775 // to avoid long-term effects such as word-of-recall
2776 for (object *item = op->inv; item; )
2777 {
2778 object *next = item->below;
2779
2780 if (item->type == SPELL_EFFECT && item->active)
2781 item->destroy ();
2782
2783 item = next;
2784 }
2785
2786 /*add_exp(op, (op->stats.exp * -0.20)); */ 2767 /*add_exp(op, (op->stats.exp * -0.20)); */
2787 apply_death_exp_penalty (op); 2768 apply_death_exp_penalty (op);
2788
2789 if (op->stats.food < 100)
2790 op->stats.food = 900;
2791
2792 op->stats.hp = op->stats.maxhp;
2793 op->stats.sp = MAX (op->stats.sp, op->stats.maxsp);
2794 op->stats.grace = MAX (op->stats.grace, op->stats.maxgrace);
2795 2769
2796 /* 2770 /*
2797 * Check to see if the player has any unpaid items. If so, remove them 2771 * Check to see if the player has any unpaid items. If so, remove them
2798 * and put them back in the map. 2772 * and put them back in the map.
2799 */ 2773 */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines