… | |
… | |
475 | god_gives_present (op, new_god, tr); |
475 | god_gives_present (op, new_god, tr); |
476 | } |
476 | } |
477 | |
477 | |
478 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "You become a follower of %s!", &new_god->name); |
478 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "You become a follower of %s!", &new_god->name); |
479 | |
479 | |
480 | for (skop = op->inv; skop != NULL; skop = skop->below) |
480 | for (skop = op->inv; skop; skop = skop->below) |
481 | if (skop->type == SKILL && skop->subtype == SK_PRAYING) |
481 | if (skop->type == SKILL && skop->subtype == SK_PRAYING) |
482 | break; |
482 | break; |
483 | |
483 | |
484 | /* Player has no skill - give them the skill */ |
484 | /* Player has no skill - give them the skill */ |
485 | if (!skop) |
485 | if (!skop) |
486 | { |
486 | { |
487 | /* The arhetype should always be defined - if we crash here because it doesn't, |
487 | /* The archetype should always be defined - if we crash here because it doesn't, |
488 | * things are really messed up anyways. |
488 | * things are really messed up anyways. |
489 | */ |
489 | */ |
490 | skop = give_skill_by_name (op, get_archetype_by_type_subtype (SKILL, SK_PRAYING)->skill); |
490 | skop = give_skill_by_name (op, get_archetype_by_type_subtype (SKILL, SK_PRAYING)->skill); |
491 | link_player_skills (op); |
491 | link_player_skills (op); |
492 | } |
492 | } |
… | |
… | |
1020 | { |
1020 | { |
1021 | int reaction = 1; |
1021 | int reaction = 1; |
1022 | object *item = NULL, *skop; |
1022 | object *item = NULL, *skop; |
1023 | |
1023 | |
1024 | for (item = op->inv; item; item = item->below) |
1024 | for (item = op->inv; item; item = item->below) |
1025 | { |
|
|
1026 | if (QUERY_FLAG (item, FLAG_APPLIED)) |
1025 | if (QUERY_FLAG (item, FLAG_APPLIED)) |
1027 | { |
|
|
1028 | reaction += god_examines_item (god, item) * (item->magic ? abs (item->magic) : 1); |
1026 | reaction += god_examines_item (god, item) * (item->magic ? abs (item->magic) : 1); |
1029 | } |
|
|
1030 | } |
|
|
1031 | |
1027 | |
1032 | /* well, well. Looks like we screwed up. Time for god's revenge */ |
1028 | /* well, well. Looks like we screwed up. Time for god's revenge */ |
1033 | if (reaction < 0) |
1029 | if (reaction < 0) |
1034 | { |
1030 | { |
1035 | int loss = 10000000; |
1031 | int loss = 10000000; |
1036 | int angry = abs (reaction); |
1032 | int angry = abs (reaction); |
1037 | |
1033 | |
1038 | for (skop = op->inv; skop != NULL; skop = skop->below) |
1034 | for (skop = op->inv; skop; skop = skop->below) |
1039 | if (skop->type == SKILL && skop->subtype == SK_PRAYING) |
1035 | if (skop->type == SKILL && skop->subtype == SK_PRAYING) |
1040 | break; |
1036 | break; |
1041 | |
1037 | |
1042 | if (skop) |
1038 | if (skop) |
1043 | loss = (int) (0.05 * (float) skop->stats.exp); |
1039 | loss = 0.05f * skop->stats.exp; |
|
|
1040 | |
1044 | change_exp (op, -random_roll (0, loss * angry - 1, op, PREFER_LOW), skop ? &skop->skill : "none", SK_SUBTRACT_SKILL_EXP); |
1041 | change_exp (op, -random_roll (0, loss * angry - 1, op, PREFER_LOW), skop ? &skop->skill : "none", SK_SUBTRACT_SKILL_EXP); |
|
|
1042 | |
1045 | if (random_roll (0, angry, op, PREFER_LOW)) |
1043 | if (random_roll (0, angry, op, PREFER_LOW)) |
1046 | { |
1044 | { |
1047 | object *tmp = get_archetype (LOOSE_MANA); |
1045 | object *tmp = get_archetype (LOOSE_MANA); |
1048 | |
1046 | |
1049 | cast_magic_storm (op, tmp, op->level + (angry * 3)); |
1047 | cast_magic_storm (op, tmp, op->level + (angry * 3)); |
1050 | } |
1048 | } |
|
|
1049 | |
1051 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "%s becomes angry and punishes you!", &god->name); |
1050 | new_draw_info_format (NDI_UNIQUE | NDI_NAVY, 0, op, "%s becomes angry and punishes you!", &god->name); |
1052 | } |
1051 | } |
|
|
1052 | |
1053 | return reaction; |
1053 | return reaction; |
1054 | } |
1054 | } |
1055 | |
1055 | |
1056 | /** |
1056 | /** |
1057 | * God checks item the player is using. |
1057 | * God checks item the player is using. |