version 1.97 | | version 1.98 |
---|
| | |
/* | | /* |
* static char *rcsid_player_c = | | * static char *rcsid_player_c = |
* "$Id: player.c,v 1.97 2002/10/03 07:07:43 mwedel Exp $"; | | * "$Id: player.c,v 1.98 2002/11/12 22:34:26 garbled Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
x=op->x;y=op->y;map=op->map; | | x=op->x;y=op->y;map=op->map; |
| | |
| | |
#ifdef NOT_PERMADEATH | | if (settings.not_permadeth == TRUE) { |
/* NOT_PERMADEATH code. This basically brings the character back to life | | /* NOT_PERMADEATH code. This basically brings the character back to |
* if they are dead - it takes some exp and a random stat. See the config.h | | * life if they are dead - it takes some exp and a random stat. |
* file for a little more in depth detail about this. | | * See the config.h file for a little more in depth detail about this. |
*/ | | */ |
| | |
/* Basically two ways to go - remove a stat permanently, or just | | /* Basically two ways to go - remove a stat permanently, or just |
| | |
| | |
if (settings.balanced_stat_loss) { | | if (settings.balanced_stat_loss) { |
/* If stat loss is permanent, lose one stat only. */ | | /* If stat loss is permanent, lose one stat only. */ |
/* Lower level chars don't lose as many stats because they suffer more | | /* Lower level chars don't lose as many stats because they suffer |
if they do. */ | | more if they do. */ |
/* Higher level characters can afford things such as potions of | | /* Higher level characters can afford things such as potions of |
restoration, or better, stat potions. So we slug them that little | | restoration, or better, stat potions. So we slug them that |
bit harder. */ | | little bit harder. */ |
/* GD */ | | /* GD */ |
if (settings.stat_loss_on_death) | | if (settings.stat_loss_on_death) |
num_stats_lose = 1; | | num_stats_lose = 1; |
| | |
/* There is a maximum depletion total per level. */ | | /* There is a maximum depletion total per level. */ |
if (this_stat < -1 - op->level/BALSL_MAX_LOSS_RATIO) { | | if (this_stat < -1 - op->level/BALSL_MAX_LOSS_RATIO) { |
lose_this_stat = 0; | | lose_this_stat = 0; |
/* Take loss chance vs keep chance to see if we retain the stat. */ | | /* Take loss chance vs keep chance to see if we |
| | retain the stat. */ |
} else { | | } else { |
if (random_roll(0, loss_chance + keep_chance-1, op, PREFER_LOW) < keep_chance) | | if (random_roll(0, loss_chance + keep_chance-1, |
| | op, PREFER_LOW) < keep_chance) |
lose_this_stat = 0; | | lose_this_stat = 0; |
/* LOG(llevDebug, "Determining stat loss. Stat: %d Keep: %d Lose: %d Result: %s.\n", | | /* LOG(llevDebug, "Determining stat loss. Stat: %d Keep: %d Lose: %d Result: %s.\n", |
this_stat, keep_chance, loss_chance, | | this_stat, keep_chance, loss_chance, |
| | |
Should I be using something else? GD */ | | Should I be using something else? GD */ |
char *god = determine_god(op); | | char *god = determine_god(op); |
if (god && (strcmp(god, "none"))) | | if (god && (strcmp(god, "none"))) |
new_draw_info_format(NDI_UNIQUE, 0, op, "For a brief moment you feel the holy presence of %s protecting you.", god); | | new_draw_info_format(NDI_UNIQUE, 0, op, "For a brief " |
| | "moment you feel the holy presence of %s protecting" |
| | " you.", god); |
else | | else |
new_draw_info(NDI_UNIQUE, 0, op, "For a brief moment you feel a holy presence protecting you."); | | new_draw_info(NDI_UNIQUE, 0, op, "For a brief moment you" |
| | " feel a holy presence protecting you."); |
} | | } |
| | |
/* Put a gravestone up where the character 'almost' died. List the | | /* Put a gravestone up where the character 'almost' died. List the |
| | |
op->contr->braced=0; | | op->contr->braced=0; |
save_player(op,1); | | save_player(op,1); |
return; | | return; |
#endif | | } /* NOT_PERMADETH */ |
| | |
/* If NOT_PERMADETH is set, then the rest of this is not reachable. This | | /* If NOT_PERMADETH is set, then the rest of this is not reachable. This |
* should probably be embedded in an else statement. | | * should probably be embedded in an else statement. |
| | |
op->direction=0; | | op->direction=0; |
if(!QUERY_FLAG(op,FLAG_WAS_WIZ)&&op->stats.exp) { | | if(!QUERY_FLAG(op,FLAG_WAS_WIZ)&&op->stats.exp) { |
delete_character(op->name,0); | | delete_character(op->name,0); |
#ifndef NOT_PERMADEATH | | if (settings.not_permadeth == FALSE) { |
#ifdef RESURRECTION | | #ifdef RESURRECTION |
/* save playerfile sans equipment when player dies | | /* save playerfile sans equipment when player dies |
** then save it as player.pl.dead so that future resurrection | | ** then save it as player.pl.dead so that future resurrection |
| | |
/* please see resurrection.c: peterm */ | | /* please see resurrection.c: peterm */ |
dead_player(op); | | dead_player(op); |
#endif | | #endif |
#endif | | } |
} | | } |
play_again(op); | | play_again(op); |
#ifdef NOT_PERMADEATH | | |
| | if (settings.not_permadeth == TRUE) { /* this is unreachable */ |
tmp=arch_to_object(find_archetype("gravestone")); | | tmp=arch_to_object(find_archetype("gravestone")); |
sprintf(buf,"%s's gravestone",op->name); | | sprintf(buf,"%s's gravestone",op->name); |
FREE_AND_COPY(tmp->name, buf); | | FREE_AND_COPY(tmp->name, buf); |
FREE_AND_COPY(tmp->name_pl, buf); | | FREE_AND_COPY(tmp->name_pl, buf); |
| | |
sprintf(buf,"RIP\nHere rests the hero %s the %s,\nwho was killed by %s.\n", | | sprintf(buf,"RIP\nHere rests the hero %s the %s,\n" |
op->name, op->contr->title, op->contr->killer); | | "who was killed by %s.\n", op->name, op->contr->title, |
| | op->contr->killer); |
if (tmp->msg) | | if (tmp->msg) |
free_string (tmp->msg); | | free_string (tmp->msg); |
tmp->msg = add_string(buf); | | tmp->msg = add_string(buf); |
tmp->x=x,tmp->y=y; | | tmp->x=x,tmp->y=y; |
insert_ob_in_map (tmp, map, NULL,0); | | insert_ob_in_map (tmp, map, NULL,0); |
#else | | } else { |
/* peterm: added to create a corpse at deathsite. */ | | /* peterm: added to create a corpse at deathsite. */ |
tmp=arch_to_object(find_archetype("corpse_pl")); | | tmp=arch_to_object(find_archetype("corpse_pl")); |
sprintf(buf,"%s", op->name); | | sprintf(buf,"%s", op->name); |
| | |
tmp->msg = add_string (gravestone_text(op)); | | tmp->msg = add_string (gravestone_text(op)); |
SET_FLAG (tmp, FLAG_UNIQUE); | | SET_FLAG (tmp, FLAG_UNIQUE); |
insert_ob_in_map (tmp, map, NULL,0); | | insert_ob_in_map (tmp, map, NULL,0); |
#endif | | } |
} | | } |
| | |
| | |