… | |
… | |
242 | object *tmp; |
242 | object *tmp; |
243 | |
243 | |
244 | if (!tr->item) |
244 | if (!tr->item) |
245 | return 0; |
245 | return 0; |
246 | |
246 | |
247 | if (follower_has_similar_item (op, &tr->item->clone)) |
247 | if (follower_has_similar_item (op, tr->item)) |
248 | return 0; |
248 | return 0; |
249 | |
249 | |
250 | tmp = arch_to_object (tr->item); |
250 | tmp = arch_to_object (tr->item); |
251 | new_draw_info_format (NDI_UNIQUE, 0, op, "%s lets %s appear in your hands.", &god->name, query_short_name (tmp)); |
251 | new_draw_info_format (NDI_UNIQUE, 0, op, "%s lets %s appear in your hands.", &god->name, query_short_name (tmp)); |
252 | tmp = insert_ob_in_ob (tmp, op); |
252 | tmp = insert_ob_in_ob (tmp, op); |
… | |
… | |
273 | return; |
273 | return; |
274 | |
274 | |
275 | /* hmm. what happend depends on pl's current god, level, etc */ |
275 | /* hmm. what happend depends on pl's current god, level, etc */ |
276 | if (!pl_god) |
276 | if (!pl_god) |
277 | { /*new convert */ |
277 | { /*new convert */ |
278 | become_follower (pl, &altar->other_arch->clone); |
278 | become_follower (pl, altar->other_arch); |
279 | return; |
279 | return; |
280 | |
280 | |
281 | } |
281 | } |
282 | else if (!strcmp (&pl_god->name, altar->other_arch->clone.name)) |
282 | else if (!strcmp (&pl_god->name, altar->other_arch->object::name)) |
283 | { |
283 | { |
284 | /* pray at your gods altar */ |
284 | /* pray at your gods altar */ |
285 | int bonus = (pl->stats.Wis + skill->level) / 10; |
285 | int bonus = (pl->stats.Wis + skill->level) / 10; |
286 | |
286 | |
287 | /* we can get neg grace up faster */ |
287 | /* we can get neg grace up faster */ |
… | |
… | |
347 | |
347 | |
348 | /* May switch Gods, but its random chance based on our current level |
348 | /* May switch Gods, but its random chance based on our current level |
349 | * note it gets harder to swap gods the higher we get |
349 | * note it gets harder to swap gods the higher we get |
350 | */ |
350 | */ |
351 | if ((angry == 1) && !(random_roll (0, skill->level, pl, PREFER_LOW))) |
351 | if ((angry == 1) && !(random_roll (0, skill->level, pl, PREFER_LOW))) |
352 | become_follower (pl, &altar->other_arch->clone); |
352 | become_follower (pl, altar->other_arch); |
353 | else |
353 | else |
354 | { |
354 | { |
355 | /* toss this player off the altar. He can try again. */ |
355 | /* toss this player off the altar. He can try again. */ |
356 | new_draw_info (NDI_UNIQUE | NDI_NAVY, 0, pl, "A divine force pushes you off the altar."); |
356 | new_draw_info (NDI_UNIQUE | NDI_NAVY, 0, pl, "A divine force pushes you off the altar."); |
357 | pl->contr->fire_on = 0; |
357 | pl->contr->fire_on = 0; |
… | |
… | |
401 | object *item; |
401 | object *item; |
402 | |
402 | |
403 | if (!tr->item) |
403 | if (!tr->item) |
404 | continue; |
404 | continue; |
405 | |
405 | |
406 | item = &tr->item->clone; |
406 | item = tr->item; |
407 | |
407 | |
408 | /* Basically, see if the matching spell is granted by this god. */ |
408 | /* Basically, see if the matching spell is granted by this god. */ |
409 | |
409 | |
410 | if (tr->item->clone.type == SPELL && tr->item->clone.name == tmp->name) |
410 | if (tr->item->type == SPELL && tr->item->object::name == tmp->name) |
411 | { |
411 | { |
412 | remove = 0; |
412 | remove = 0; |
413 | break; |
413 | break; |
414 | } |
414 | } |
415 | } |
415 | } |
… | |
… | |
461 | } |
461 | } |
462 | |
462 | |
463 | /* remove any godgiven items from the old god */ |
463 | /* remove any godgiven items from the old god */ |
464 | if (old_god) |
464 | if (old_god) |
465 | for (tr = old_god->randomitems->items; tr; tr = tr->next) |
465 | for (tr = old_god->randomitems->items; tr; tr = tr->next) |
466 | if (tr->item && QUERY_FLAG (&tr->item->clone, FLAG_STARTEQUIP)) |
466 | if (tr->item && QUERY_FLAG (tr->item, FLAG_STARTEQUIP)) |
467 | follower_remove_similar_item (op, &tr->item->clone); |
467 | follower_remove_similar_item (op, tr->item); |
468 | |
468 | |
469 | if (!op || !new_god) |
469 | if (!op || !new_god) |
470 | return; |
470 | return; |
471 | |
471 | |
472 | if (op->race && new_god->slaying && strstr (op->race, new_god->slaying)) |
472 | if (op->race && new_god->slaying && strstr (op->race, new_god->slaying)) |
… | |
… | |
485 | |
485 | |
486 | |
486 | |
487 | /* give the player any special god-characteristic-items. */ |
487 | /* give the player any special god-characteristic-items. */ |
488 | for (tr = new_god->randomitems->items; tr; tr = tr->next) |
488 | for (tr = new_god->randomitems->items; tr; tr = tr->next) |
489 | { |
489 | { |
490 | if (tr->item && tr->item->clone.invisible && tr->item->clone.type != SPELLBOOK |
490 | if (tr->item && tr->item->invisible && tr->item->type != SPELLBOOK |
491 | && tr->item->clone.type != BOOK && tr->item->clone.type != SPELL) |
491 | && tr->item->type != BOOK && tr->item->type != SPELL) |
492 | god_gives_present (op, new_god, tr); |
492 | god_gives_present (op, new_god, tr); |
493 | } |
493 | } |
494 | |
494 | |
495 | |
495 | |
496 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "You become a follower of %s!", &new_god->name); |
496 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "You become a follower of %s!", &new_god->name); |
… | |
… | |
503 | if (!skop) |
503 | if (!skop) |
504 | { |
504 | { |
505 | /* The arhetype should always be defined - if we crash here because it doesn't, |
505 | /* The arhetype should always be defined - if we crash here because it doesn't, |
506 | * things are really messed up anyways. |
506 | * things are really messed up anyways. |
507 | */ |
507 | */ |
508 | skop = give_skill_by_name (op, get_archetype_by_type_subtype (SKILL, SK_PRAYING)->clone.skill); |
508 | skop = give_skill_by_name (op, get_archetype_by_type_subtype (SKILL, SK_PRAYING)->skill); |
509 | link_player_skills (op); |
509 | link_player_skills (op); |
510 | } |
510 | } |
511 | |
511 | |
512 | sk_applied = QUERY_FLAG (skop, FLAG_APPLIED); /* save skill status */ |
512 | sk_applied = QUERY_FLAG (skop, FLAG_APPLIED); /* save skill status */ |
513 | |
513 | |
… | |
… | |
608 | |
608 | |
609 | int |
609 | int |
610 | worship_forbids_use (object *op, object *exp_obj, uint32 flag, const char *string) |
610 | worship_forbids_use (object *op, object *exp_obj, uint32 flag, const char *string) |
611 | { |
611 | { |
612 | |
612 | |
613 | if (QUERY_FLAG (&op->arch->clone, flag)) |
613 | if (QUERY_FLAG (op->arch, flag)) |
614 | if (QUERY_FLAG (op, flag) != QUERY_FLAG (exp_obj, flag)) |
614 | if (QUERY_FLAG (op, flag) != QUERY_FLAG (exp_obj, flag)) |
615 | { |
615 | { |
616 | update_priest_flag (exp_obj, op, flag); |
616 | update_priest_flag (exp_obj, op, flag); |
617 | if (QUERY_FLAG (op, flag)) |
617 | if (QUERY_FLAG (op, flag)) |
618 | new_draw_info_format (NDI_UNIQUE, 0, op, "You may use %s again.", string); |
618 | new_draw_info_format (NDI_UNIQUE, 0, op, "You may use %s again.", string); |
… | |
… | |
684 | for (tr = god->randomitems->items; tr; tr = tr->next) |
684 | for (tr = god->randomitems->items; tr; tr = tr->next) |
685 | { |
685 | { |
686 | if (!tr->item) |
686 | if (!tr->item) |
687 | continue; |
687 | continue; |
688 | |
688 | |
689 | object *item = &tr->item->clone; |
689 | object *item = tr->item; |
690 | |
690 | |
691 | if (item->type == BOOK && item->invisible && strcmp (item->name, type) == 0) |
691 | if (item->type == BOOK && item->invisible && strcmp (item->name, type) == 0) |
692 | return item->other_arch; |
692 | return item->other_arch; |
693 | } |
693 | } |
694 | return NULL; |
694 | return NULL; |
… | |
… | |
853 | } |
853 | } |
854 | |
854 | |
855 | if (!tr->item) |
855 | if (!tr->item) |
856 | continue; |
856 | continue; |
857 | |
857 | |
858 | item = &tr->item->clone; |
858 | item = tr->item; |
859 | |
859 | |
860 | /* Grace limit */ |
860 | /* Grace limit */ |
861 | if (item->type == BOOK && item->invisible && strcmp (item->name, "grace limit") == 0) |
861 | if (item->type == BOOK && item->invisible && strcmp (item->name, "grace limit") == 0) |
862 | { |
862 | { |
863 | if (op->stats.grace < item->stats.grace || op->stats.grace < op->stats.maxgrace) |
863 | if (op->stats.grace < item->stats.grace || op->stats.grace < op->stats.maxgrace) |
… | |
… | |
1133 | |
1133 | |
1134 | if (race == NULL) |
1134 | if (race == NULL) |
1135 | return NULL; |
1135 | return NULL; |
1136 | while (gl) |
1136 | while (gl) |
1137 | { |
1137 | { |
1138 | if (!strcasecmp (gl->arch->clone.race, race)) |
1138 | if (!strcasecmp (gl->arch->race, race)) |
1139 | { |
1139 | { |
1140 | godname = gl->name; |
1140 | godname = gl->name; |
1141 | break; |
1141 | break; |
1142 | } |
1142 | } |
1143 | gl = gl->next; |
1143 | gl = gl->next; |