version 1.100 | | version 1.101 |
---|
| | |
/* | | /* |
* static char *rcsid_apply_c = | | * static char *rcsid_apply_c = |
* "$Id: apply.c,v 1.100 2004/03/12 19:04:14 ryo_saeba Exp $"; | | * "$Id: apply.c,v 1.101 2004/04/18 07:59:36 mwedel Exp $"; |
*/ | | */ |
/* | | /* |
CrossFire, A Multiplayer game for X-windows | | CrossFire, A Multiplayer game for X-windows |
| | |
} | | } |
| | |
| | |
/* Special prayers are granted by gods and lost when the follower decides | | |
* to pray to a different gods. 'Force' objects keep track of which | | |
* prayers are special. | | |
*/ | | |
| | |
static object *find_special_prayer_mark (object *op, char *spell) | | |
{ | | |
object *tmp; | | |
| | |
for (tmp = op->inv; tmp; tmp = tmp->below) | | |
if (tmp->type == FORCE && tmp->slaying | | |
&& !strcmp (tmp->slaying, "special prayer") | | |
&& !strcmp(tmp->name, spell)) | | |
return tmp; | | |
return 0; | | |
} | | |
| | |
void do_learn_spell (object *op, object *spell, int special_prayer) | | void do_learn_spell (object *op, object *spell, int special_prayer) |
{ | | { |
object *tmp; | | object *tmp; |
| | |
| | |
void do_forget_spell (object *op, char *spell) | | void do_forget_spell (object *op, char *spell) |
{ | | { |
object *tmp, *spob; | | object *spob; |
| | |
if (op->type != PLAYER) { | | if (op->type != PLAYER) { |
LOG (llevError, "BUG: do_forget_spell(): not a player\n"); | | LOG (llevError, "BUG: do_forget_spell(): not a player\n"); |
| | |
| | |
new_draw_info_format (NDI_UNIQUE|NDI_NAVY, 0, op, | | new_draw_info_format (NDI_UNIQUE|NDI_NAVY, 0, op, |
"You lose knowledge of %s.", spell); | | "You lose knowledge of %s.", spell); |
| | |
tmp = find_special_prayer_mark (op, spell); | | |
if (tmp) { | | |
remove_ob (tmp); | | |
free_object (tmp); | | |
} | | |
remove_ob(spob); | | remove_ob(spob); |
free_object(spob); | | free_object(spob); |
} | | } |