… | |
… | |
904 | * again below */ |
904 | * again below */ |
905 | } |
905 | } |
906 | } |
906 | } |
907 | |
907 | |
908 | /* materialtype modifications. Note we allow this on artifacts. */ |
908 | /* materialtype modifications. Note we allow this on artifacts. */ |
909 | set_materialname (op, difficulty, NULL); |
909 | select_material (op, difficulty); |
910 | |
910 | |
911 | if (flags & GT_MINIMAL) |
911 | if (flags & GT_MINIMAL) |
912 | { |
912 | { |
913 | if (op->type == POTION) |
913 | if (op->type == POTION) |
914 | /* Handle healing and magic power potions */ |
914 | /* Handle healing and magic power potions */ |
… | |
… | |
1097 | * 10 time multiplier). This way, the value are a bit more reasonable. |
1097 | * 10 time multiplier). This way, the value are a bit more reasonable. |
1098 | */ |
1098 | */ |
1099 | op->value = op->value * op->inv->value * (op->level + 50) / (op->inv->level + 50); |
1099 | op->value = op->value * op->inv->value * (op->level + 50) / (op->inv->level + 50); |
1100 | /* maxhp is used to denote how many 'charges' the rod holds before */ |
1100 | /* maxhp is used to denote how many 'charges' the rod holds before */ |
1101 | if (op->stats.maxhp) |
1101 | if (op->stats.maxhp) |
1102 | op->stats.maxhp *= MAX (op->inv->stats.sp, op->inv->stats.grace); |
1102 | op->stats.maxhp *= max (op->inv->stats.sp, op->inv->stats.grace); |
1103 | else |
1103 | else |
1104 | op->stats.maxhp = 2 * MAX (op->inv->stats.sp, op->inv->stats.grace); |
1104 | op->stats.maxhp = 2 * max (op->inv->stats.sp, op->inv->stats.grace); |
1105 | |
1105 | |
1106 | op->stats.hp = op->stats.maxhp; |
1106 | op->stats.hp = op->stats.maxhp; |
1107 | break; |
1107 | break; |
1108 | |
1108 | |
1109 | case SCROLL: |
1109 | case SCROLL: |
… | |
… | |
1465 | op->value *= change->value; |
1465 | op->value *= change->value; |
1466 | |
1466 | |
1467 | if (change->materials) |
1467 | if (change->materials) |
1468 | op->materials = change->materials; |
1468 | op->materials = change->materials; |
1469 | |
1469 | |
1470 | if (change->materialname) |
1470 | if (change->material != MATERIAL_NULL) |
1471 | op->materialname = change->materialname; |
1471 | op->material = change->material; |
1472 | |
1472 | |
1473 | if (change->slaying) |
1473 | if (change->slaying) |
1474 | op->slaying = change->slaying; |
1474 | op->slaying = change->slaying; |
1475 | |
1475 | |
1476 | if (change->race) |
1476 | if (change->race) |
… | |
… | |
1688 | at->item->destroy (); |
1688 | at->item->destroy (); |
1689 | |
1689 | |
1690 | sfree (at); |
1690 | sfree (at); |
1691 | } |
1691 | } |
1692 | |
1692 | |
1693 | static void |
|
|
1694 | free_artifactlist (artifactlist *al) |
|
|
1695 | { |
|
|
1696 | artifactlist *nextal; |
|
|
1697 | |
|
|
1698 | for (al = first_artifactlist; al; al = nextal) |
|
|
1699 | { |
|
|
1700 | nextal = al->next; |
|
|
1701 | |
|
|
1702 | if (al->items) |
|
|
1703 | free_artifact (al->items); |
|
|
1704 | |
|
|
1705 | sfree (al); |
|
|
1706 | } |
|
|
1707 | } |
|
|
1708 | |
|
|