version 1.44 | | version 1.45 |
---|
| | |
| | |
/* | | /* |
* static char *rcs_treasure_c = | | * static char *rcs_treasure_c = |
* "$Id: treasure.c,v 1.44 2004/02/09 05:36:12 mwedel Exp $"; | | * "$Id: treasure.c,v 1.45 2004/02/09 08:04:24 mwedel Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
| | |
void add_abilities(object *op, object *change) { | | void add_abilities(object *op, object *change) { |
int i,j, tmp; | | int i,j, tmp; |
| | |
if (change->face != blank_face) { | | if (change->face != blank_face) { |
#ifdef TREASURE_VERBOSE | | #ifdef TREASURE_VERBOSE |
LOG(llevDebug, "FACE: %d\n", change->face->number); | | LOG(llevDebug, "FACE: %d\n", change->face->number); |
| | |
op->stats.wc += change->stats.wc; | | op->stats.wc += change->stats.wc; |
op->stats.ac += change->stats.ac; | | op->stats.ac += change->stats.ac; |
| | |
if (change->other_arch) op->other_arch = change->other_arch; | | if (change->other_arch) { |
| | /* Basically, for horns & potions, the other_arch field is the spell |
| | * to cast. So convert that to into a spell and put it into |
| | * this object. |
| | */ |
| | if (op->type == HORN || op->type == POTION) { |
| | object *tmp_obj; |
| | /* Remove any spells this object currently has in it */ |
| | while (op->inv) { |
| | tmp_obj = op->inv; |
| | remove_ob(tmp_obj); |
| | free_object(tmp_obj); |
| | } |
| | tmp_obj = arch_to_object(change->other_arch); |
| | insert_ob_in_ob(tmp_obj, op); |
| | } |
| | /* No harm setting this for potions/horns */ |
| | op->other_arch = change->other_arch; |
| | } |
| | |
if (change->stats.hp < 0) | | if (change->stats.hp < 0) |
op->stats.hp = -change->stats.hp; | | op->stats.hp = -change->stats.hp; |