… | |
… | |
462 | |
462 | |
463 | /* failed, create a fresh object. Note no nrof>1 because that would |
463 | /* failed, create a fresh object. Note no nrof>1 because that would |
464 | * allow players to create massive amounts of artifacts easily */ |
464 | * allow players to create massive amounts of artifacts easily */ |
465 | if (create_item && (!item || item->nrof > 1)) |
465 | if (create_item && (!item || item->nrof > 1)) |
466 | { |
466 | { |
467 | *rp_arch_index = RANDOM () % rp->arch_names; |
467 | *rp_arch_index = rndm (rp->arch_names); |
468 | item = get_archetype (rp->arch_name[*rp_arch_index]); |
468 | item = get_archetype (rp->arch_name[*rp_arch_index]); |
469 | } |
469 | } |
470 | |
470 | |
471 | #ifdef ALCHEMY_DEBUG |
471 | #ifdef ALCHEMY_DEBUG |
472 | LOG (llevDebug, "recipe calls for%stransmution.\n", rp->transmute ? " " : " no "); |
472 | LOG (llevDebug, "recipe calls for%stransmution.\n", rp->transmute ? " " : " no "); |
… | |
… | |
615 | { /* MAJOR FIRE */ |
615 | { /* MAJOR FIRE */ |
616 | object *fb = get_archetype (SP_MED_FIREBALL); |
616 | object *fb = get_archetype (SP_MED_FIREBALL); |
617 | |
617 | |
618 | remove_contents (cauldron->inv, NULL); |
618 | remove_contents (cauldron->inv, NULL); |
619 | fire_arch_from_position (cauldron, cauldron, cauldron->x, cauldron->y, 0, fb); |
619 | fire_arch_from_position (cauldron, cauldron, cauldron->x, cauldron->y, 0, fb); |
620 | fb->destroy (true); |
620 | fb->destroy (); |
621 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s erupts in flame!", &cauldron->name); |
621 | new_draw_info_format (NDI_UNIQUE, 0, op, "The %s erupts in flame!", &cauldron->name); |
622 | } |
622 | } |
623 | else if (level < 100) |
623 | else if (level < 100) |
624 | { /* WHAMMY the CAULDRON */ |
624 | { /* WHAMMY the CAULDRON */ |
625 | if (!QUERY_FLAG (cauldron, FLAG_CURSED)) |
625 | if (!QUERY_FLAG (cauldron, FLAG_CURSED)) |
… | |
… | |
666 | * in this one, we allow *any* valid alchemy artifact |
666 | * in this one, we allow *any* valid alchemy artifact |
667 | * to be made (rather than only those on the given |
667 | * to be made (rather than only those on the given |
668 | * formulalist) */ |
668 | * formulalist) */ |
669 | if (!rp) |
669 | if (!rp) |
670 | rp = get_random_recipe ((recipelist *) NULL); |
670 | rp = get_random_recipe ((recipelist *) NULL); |
|
|
671 | |
671 | if (rp && (tmp = get_archetype (rp->arch_name[RANDOM () % rp->arch_names]))) |
672 | if (rp && (tmp = get_archetype (rp->arch_name [rndm (rp->arch_names)]))) |
672 | { |
673 | { |
673 | generate_artifact (tmp, random_roll (1, op->level / 2 + 1, op, PREFER_HIGH) + 1); |
674 | generate_artifact (tmp, random_roll (1, op->level / 2 + 1, op, PREFER_HIGH) + 1); |
674 | if ((tmp = insert_ob_in_ob (tmp, cauldron))) |
675 | if ((tmp = insert_ob_in_ob (tmp, cauldron))) |
675 | { |
676 | { |
676 | remove_contents (cauldron->inv, tmp); |
677 | remove_contents (cauldron->inv, tmp); |
… | |
… | |
712 | } |
713 | } |
713 | |
714 | |
714 | if (tmp->inv) |
715 | if (tmp->inv) |
715 | remove_contents (tmp->inv, NULL); |
716 | remove_contents (tmp->inv, NULL); |
716 | |
717 | |
717 | tmp->destroy (true); |
718 | tmp->destroy (); |
718 | tmp = next; |
719 | tmp = next; |
719 | } |
720 | } |
720 | } |
721 | } |
721 | |
722 | |
722 | /** |
723 | /** |