version 1.157 | | version 1.158 |
---|
| | |
/* | | /* |
* static char *rcsid_player_c = | | * static char *rcsid_player_c = |
* "$Id: player.c,v 1.157 2005/02/20 20:43:16 akirschbaum Exp $"; | | * "$Id: player.c,v 1.158 2005/03/13 15:13:12 ryo_saeba Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
if (tmp->type == BOOK || tmp->type == SCROLL) | | if (tmp->type == BOOK || tmp->type == SCROLL) |
{ pick_up(op, tmp); if(0)fprintf(stderr,"READABLES\n"); continue; } | | { pick_up(op, tmp); if(0)fprintf(stderr,"READABLES\n"); continue; } |
| | |
| | /* wands/staves/rods/horns */ |
| | if (op->contr->mode & PU_MAGIC_DEVICE) |
| | if (tmp->type == WAND || tmp->type == ROD || tmp->type == HORN) |
| | { pick_up(op, tmp); if(0)fprintf(stderr,"MAGIC_DEVICE\n"); continue; } |
| | |
/* pick up all magical items */ | | /* pick up all magical items */ |
if(op->contr->mode & PU_MAGICAL) | | if(op->contr->mode & PU_MAGICAL) |
| | |
gen_sp = gen_sp * 10 / (op->contr->gen_sp_armour < 10? 10 : op->contr->gen_sp_armour); | | gen_sp = gen_sp * 10 / (op->contr->gen_sp_armour < 10? 10 : op->contr->gen_sp_armour); |
if(op->stats.sp<op->stats.maxsp) { | | if(op->stats.sp<op->stats.maxsp) { |
op->stats.sp++; | | op->stats.sp++; |
| | /* dms do not consume food */ |
| | if (!QUERY_FLAG(op,FLAG_WIZ)) { |
op->stats.food--; | | op->stats.food--; |
if(op->contr->digestion<0) | | if(op->contr->digestion<0) |
op->stats.food+=op->contr->digestion; | | op->stats.food+=op->contr->digestion; |
| | |
random_roll(0, op->contr->digestion, op, PREFER_HIGH)) | | random_roll(0, op->contr->digestion, op, PREFER_HIGH)) |
op->stats.food=last_food; | | op->stats.food=last_food; |
} | | } |
| | } |
if (max_sp>1) { | | if (max_sp>1) { |
over_sp = (gen_sp+10)/rate_sp; | | over_sp = (gen_sp+10)/rate_sp; |
if (over_sp > 0) { | | if (over_sp > 0) { |
| | |
if(--op->last_heal<0) { | | if(--op->last_heal<0) { |
if(op->stats.hp<op->stats.maxhp) { | | if(op->stats.hp<op->stats.maxhp) { |
op->stats.hp++; | | op->stats.hp++; |
| | /* dms do not consume food */ |
| | if (!QUERY_FLAG(op,FLAG_WIZ)) { |
op->stats.food--; | | op->stats.food--; |
if(op->contr->digestion<0) | | if(op->contr->digestion<0) |
op->stats.food+=op->contr->digestion; | | op->stats.food+=op->contr->digestion; |
| | |
random_roll(0, op->contr->digestion, op, PREFER_HIGH)) | | random_roll(0, op->contr->digestion, op, PREFER_HIGH)) |
op->stats.food=last_food; | | op->stats.food=last_food; |
} | | } |
| | } |
if(max_hp>1) { | | if(max_hp>1) { |
over_hp = (gen_hp<20 ? 30 : gen_hp+10)/rate_hp; | | over_hp = (gen_hp<20 ? 30 : gen_hp+10)/rate_hp; |
if (over_hp > 0) { | | if (over_hp > 0) { |
| | |
op->last_eat=25*(1+bonus)/(op->contr->gen_hp+penalty+1); | | op->last_eat=25*(1+bonus)/(op->contr->gen_hp+penalty+1); |
else | | else |
op->last_eat=25*(1+bonus)/(penalty +1); | | op->last_eat=25*(1+bonus)/(penalty +1); |
op->stats.food--; | | /* dms do not consume food */ |
| | if (!QUERY_FLAG(op,FLAG_WIZ)) op->stats.food--; |
} | | } |
} | | } |
| | |