version 1.121 | | version 1.122 |
---|
| | |
/* | | /* |
* static char *rcsid_player_c = | | * static char *rcsid_player_c = |
* "$Id: player.c,v 1.121 2003/02/10 06:52:13 mwedel Exp $"; | | * "$Id: player.c,v 1.122 2003/02/14 05:50:37 garbled Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
return 1; | | return 1; |
} | | } |
| | |
void auto_heal(object *op) { | | |
object *tmp; | | |
| | |
if (op->stats.hp < 0) { | | |
LOG(llevDebug, "Healing player is dead.\n"); | | |
return; | | |
} /* 35 -> 32 */ | | |
if (cast_spell(op, op, 0, SP_HEAL, 0, spellNormal,NULL)) | | |
return; | | |
else if (cast_spell(op, op, 0, SP_MAJOR_HEAL, 0, spellNormal,NULL)) | | |
return; | | |
else if (cast_spell(op, op, 0, SP_MED_HEAL, 0, spellNormal,NULL)) | | |
return; | | |
else if (cast_spell(op, op, 0, SP_MINOR_HEAL, 0, spellNormal,NULL)) | | |
return; | | |
else | | |
/* a potion in the main inventory? */ | | |
for (tmp=op->inv; tmp; tmp = tmp->below) | | |
if (tmp->type == POTION && (tmp->stats.sp == SP_HEAL || | | |
tmp->stats.sp == SP_MAJOR_HEAL || | | |
tmp->stats.sp == SP_MED_HEAL || | | |
tmp->stats.sp == SP_MINOR_HEAL)) { | | |
apply_potion(op, tmp); | | |
break; | | |
} | | |
/* I give up, sorry buddy, you die. */ | | |
return; | | |
} | | |
| | |
void flee_player(object *op) { | | void flee_player(object *op) { |
int dir,diff; | | int dir,diff; |
if(op->stats.hp < 0) { | | if(op->stats.hp < 0) { |