… | |
… | |
248 | * by another object. |
248 | * by another object. |
249 | */ |
249 | */ |
250 | //TODO: flag such as objects... as such (no drop, anybody?) |
250 | //TODO: flag such as objects... as such (no drop, anybody?) |
251 | if (op->type == SPELL) |
251 | if (op->type == SPELL) |
252 | { |
252 | { |
253 | op->destroy (); |
253 | op->destroy (true); |
254 | return; |
254 | return; |
255 | } |
255 | } |
256 | |
256 | |
257 | op->expand_tail (); |
257 | op->expand_tail (); |
258 | |
258 | |
259 | if (!creator->is_on_map () || op->blocked (creator->map, creator->x, creator->y)) |
259 | if (!creator->is_on_map () || op->blocked (creator->map, creator->x, creator->y)) |
260 | op->destroy (); |
260 | op->destroy (true); |
261 | else |
261 | else |
262 | { |
262 | { |
263 | SET_FLAG (op, FLAG_OBJ_ORIGINAL); |
263 | SET_FLAG (op, FLAG_OBJ_ORIGINAL); |
264 | op->insert_at (creator, creator, INS_NO_MERGE | INS_NO_WALK_ON); |
264 | op->insert_at (creator, creator, INS_NO_MERGE | INS_NO_WALK_ON); |
265 | } |
265 | } |
… | |
… | |
440 | tmp->remove (); |
440 | tmp->remove (); |
441 | |
441 | |
442 | if (ob->inv) |
442 | if (ob->inv) |
443 | LOG (llevError, "In generate treasure, created multiple objects.\n"); |
443 | LOG (llevError, "In generate treasure, created multiple objects.\n"); |
444 | |
444 | |
445 | ob->destroy (); |
445 | ob->destroy (true); |
|
|
446 | |
446 | return tmp; |
447 | return tmp; |
447 | } |
448 | } |
448 | |
449 | |
449 | /* |
450 | /* |
450 | * This is a new way of calculating the chance for an item to have |
451 | * This is a new way of calculating the chance for an item to have |
… | |
… | |
965 | case AMULET: |
966 | case AMULET: |
966 | if (IS_ARCH (op->arch, amulet)) |
967 | if (IS_ARCH (op->arch, amulet)) |
967 | op->value *= 5; /* Since it's not just decoration */ |
968 | op->value *= 5; /* Since it's not just decoration */ |
968 | |
969 | |
969 | case RING: |
970 | case RING: |
970 | if (!op->arch) // wtf? schmorp |
|
|
971 | { |
|
|
972 | op->destroy (); |
|
|
973 | op = 0; |
|
|
974 | break; |
|
|
975 | } |
|
|
976 | |
|
|
977 | if (!IS_ARCH (op->arch, ring) && !IS_ARCH (op->arch, amulet)) /* It's a special artifact! */ |
971 | if (!IS_ARCH (op->arch, ring) && !IS_ARCH (op->arch, amulet)) /* It's a special artifact! */ |
978 | break; |
972 | break; |
979 | |
973 | |
980 | if (!(flags & GT_ONLY_GOOD) && !(rndm (3))) |
974 | if (!(flags & GT_ONLY_GOOD) && !(rndm (3))) |
981 | SET_FLAG (op, FLAG_CURSED); |
975 | SET_FLAG (op, FLAG_CURSED); |
… | |
… | |
1353 | * to cast. So convert that to into a spell and put it into |
1347 | * to cast. So convert that to into a spell and put it into |
1354 | * this object. |
1348 | * this object. |
1355 | */ |
1349 | */ |
1356 | if (op->type == HORN || op->type == POTION) |
1350 | if (op->type == HORN || op->type == POTION) |
1357 | { |
1351 | { |
1358 | object *tmp_obj; |
|
|
1359 | |
|
|
1360 | /* Remove any spells this object currently has in it */ |
1352 | /* Remove any spells this object currently has in it */ |
1361 | while (op->inv) |
|
|
1362 | op->inv->destroy (); |
1353 | op->destroy_inv (); |
1363 | |
1354 | |
1364 | tmp_obj = arch_to_object (change->other_arch); |
1355 | object *tmp = arch_to_object (change->other_arch); |
1365 | insert_ob_in_ob (tmp_obj, op); |
1356 | insert_ob_in_ob (tmp, op); |
1366 | } |
1357 | } |
1367 | /* No harm setting this for potions/horns */ |
1358 | /* No harm setting this for potions/horns */ |
1368 | op->other_arch = change->other_arch; |
1359 | op->other_arch = change->other_arch; |
1369 | } |
1360 | } |
1370 | |
1361 | |
… | |
… | |
1686 | free_artifact (artifact *at) |
1677 | free_artifact (artifact *at) |
1687 | { |
1678 | { |
1688 | if (at->next) free_artifact (at->next); |
1679 | if (at->next) free_artifact (at->next); |
1689 | if (at->allowed) free_charlinks (at->allowed); |
1680 | if (at->allowed) free_charlinks (at->allowed); |
1690 | |
1681 | |
1691 | at->item->destroy (1); |
1682 | at->item->destroy (true); |
1692 | |
1683 | |
1693 | sfree (at); |
1684 | sfree (at); |
1694 | } |
1685 | } |
1695 | |
1686 | |
1696 | void |
1687 | void |