… | |
… | |
401 | { |
401 | { |
402 | object *item; |
402 | object *item; |
403 | |
403 | |
404 | if (!tr->item) |
404 | if (!tr->item) |
405 | continue; |
405 | continue; |
|
|
406 | |
406 | item = &tr->item->clone; |
407 | item = &tr->item->clone; |
407 | |
408 | |
408 | /* Basically, see if the matching spell is granted by this god. */ |
409 | /* Basically, see if the matching spell is granted by this god. */ |
409 | |
410 | |
410 | if (tr->item->clone.type == SPELL && tr->item->clone.name == tmp->name) |
411 | if (tr->item->clone.type == SPELL && tr->item->clone.name == tmp->name) |
… | |
… | |
460 | } |
461 | } |
461 | } |
462 | } |
462 | |
463 | |
463 | /* remove any godgiven items from the old god */ |
464 | /* remove any godgiven items from the old god */ |
464 | if (old_god) |
465 | if (old_god) |
465 | { |
|
|
466 | for (tr = old_god->randomitems->items; tr != NULL; tr = tr->next) |
466 | for (tr = old_god->randomitems->items; tr; tr = tr->next) |
467 | { |
|
|
468 | if (tr->item && QUERY_FLAG (&tr->item->clone, FLAG_STARTEQUIP)) |
467 | if (tr->item && QUERY_FLAG (&tr->item->clone, FLAG_STARTEQUIP)) |
469 | follower_remove_similar_item (op, &tr->item->clone); |
468 | follower_remove_similar_item (op, &tr->item->clone); |
470 | } |
|
|
471 | } |
|
|
472 | |
469 | |
473 | if (!op || !new_god) |
470 | if (!op || !new_god) |
474 | return; |
471 | return; |
475 | |
472 | |
476 | if (op->race && new_god->slaying && strstr (op->race, new_god->slaying)) |
473 | if (op->race && new_god->slaying && strstr (op->race, new_god->slaying)) |
477 | { |
474 | { |
478 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "Fool! %s detests your kind!", &new_god->name); |
475 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "Fool! %s detests your kind!", &new_god->name); |
|
|
476 | |
479 | if (random_roll (0, op->level - 1, op, PREFER_LOW) - 5 > 0) |
477 | if (random_roll (0, op->level - 1, op, PREFER_LOW) - 5 > 0) |
480 | { |
478 | { |
481 | object *tmp = get_archetype (LOOSE_MANA); |
479 | object *tmp = get_archetype (LOOSE_MANA); |
482 | |
480 | |
483 | cast_magic_storm (op, tmp, new_god->level + 10); |
481 | cast_magic_storm (op, tmp, new_god->level + 10); |
484 | } |
482 | } |
|
|
483 | |
485 | return; |
484 | return; |
486 | } |
485 | } |
487 | |
486 | |
488 | |
487 | |
489 | /* give the player any special god-characteristic-items. */ |
488 | /* give the player any special god-characteristic-items. */ |
490 | for (tr = new_god->randomitems->items; tr != NULL; tr = tr->next) |
489 | for (tr = new_god->randomitems->items; tr; tr = tr->next) |
491 | { |
490 | { |
492 | if (tr->item && tr->item->clone.invisible && tr->item->clone.type != SPELLBOOK && |
491 | if (tr->item && tr->item->clone.invisible && tr->item->clone.type != SPELLBOOK |
493 | tr->item->clone.type != BOOK && tr->item->clone.type != SPELL) |
492 | && tr->item->clone.type != BOOK && tr->item->clone.type != SPELL) |
494 | god_gives_present (op, new_god, tr); |
493 | god_gives_present (op, new_god, tr); |
495 | } |
494 | } |
496 | |
495 | |
497 | |
496 | |
498 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "You become a follower of %s!", &new_god->name); |
497 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "You become a follower of %s!", &new_god->name); |
… | |
… | |
681 | { |
680 | { |
682 | LOG (llevError, "BUG: determine_holy_arch(): no god or god without " "randomitems\n"); |
681 | LOG (llevError, "BUG: determine_holy_arch(): no god or god without " "randomitems\n"); |
683 | return NULL; |
682 | return NULL; |
684 | } |
683 | } |
685 | |
684 | |
686 | for (tr = god->randomitems->items; tr != NULL; tr = tr->next) |
685 | for (tr = god->randomitems->items; tr; tr = tr->next) |
687 | { |
686 | { |
688 | object *item; |
|
|
689 | |
|
|
690 | if (!tr->item) |
687 | if (!tr->item) |
691 | continue; |
688 | continue; |
692 | |
689 | |
693 | item = &tr->item->clone; |
690 | object *item = &tr->item->clone; |
694 | |
691 | |
695 | if (item->type == BOOK && item->invisible && strcmp (item->name, type) == 0) |
692 | if (item->type == BOOK && item->invisible && strcmp (item->name, type) == 0) |
696 | return item->other_arch; |
693 | return item->other_arch; |
697 | } |
694 | } |
698 | return NULL; |
695 | return NULL; |
… | |
… | |
831 | if (god_examines_priest (op, god) < 0) |
828 | if (god_examines_priest (op, god) < 0) |
832 | return; |
829 | return; |
833 | |
830 | |
834 | new_draw_info (NDI_UNIQUE, 0, op, "You feel a holy presence!"); |
831 | new_draw_info (NDI_UNIQUE, 0, op, "You feel a holy presence!"); |
835 | |
832 | |
836 | for (tr = god->randomitems->items; tr != NULL; tr = tr->next) |
833 | for (tr = god->randomitems->items; tr; tr = tr->next) |
837 | { |
834 | { |
838 | object *item; |
835 | object *item; |
839 | |
836 | |
840 | if (tr->chance <= random_roll (0, 99, op, PREFER_HIGH)) |
837 | if (tr->chance <= random_roll (0, 99, op, PREFER_HIGH)) |
841 | continue; |
838 | continue; |
842 | |
839 | |
843 | /* Treasurelist - generate some treasure for the follower */ |
840 | /* Treasurelist - generate some treasure for the follower */ |
844 | if (tr->name) |
841 | if (tr->name) |
845 | { |
842 | { |
846 | treasurelist *tl = find_treasurelist (tr->name); |
843 | treasurelist *tl = treasurelist::find (tr->name); |
847 | |
844 | |
848 | if (tl == NULL) |
845 | if (tl == NULL) |
849 | continue; |
846 | continue; |
850 | |
847 | |
851 | new_draw_info (NDI_UNIQUE, 0, op, "Something appears before your " "eyes. You catch it before it falls to the ground."); |
848 | new_draw_info (NDI_UNIQUE, 0, op, "Something appears before your " "eyes. You catch it before it falls to the ground."); |