… | |
… | |
780 | * at casting a prayer. |
780 | * at casting a prayer. |
781 | * op is the player. |
781 | * op is the player. |
782 | * failure is basically how much grace they had. |
782 | * failure is basically how much grace they had. |
783 | * power is how much grace the spell would normally take to cast. |
783 | * power is how much grace the spell would normally take to cast. |
784 | */ |
784 | */ |
|
|
785 | |
|
|
786 | #define HINT_GRACE " H<Make sure you always have enough grace points for your prayers.>" |
|
|
787 | |
785 | static void |
788 | static void |
786 | prayer_failure (object *op, int failure, int power) |
789 | prayer_failure (object *op, int failure, int power) |
787 | { |
790 | { |
788 | const char *godname; |
791 | const char *godname; |
789 | object *tmp; |
792 | object *tmp; |
… | |
… | |
791 | if (!strcmp ((godname = determine_god (op)), "none")) |
794 | if (!strcmp ((godname = determine_god (op)), "none")) |
792 | godname = "Your spirit"; |
795 | godname = "Your spirit"; |
793 | |
796 | |
794 | if (failure <= -20 && failure > -40) /* wonder */ |
797 | if (failure <= -20 && failure > -40) /* wonder */ |
795 | { |
798 | { |
796 | new_draw_info_format (NDI_UNIQUE, 0, op, "%s gives a sign to renew your faith.", godname); |
799 | op->failmsgf ("%s gives a sign to renew your faith." HINT_GRACE, godname); |
797 | tmp = get_archetype (SPELL_WONDER); |
800 | tmp = get_archetype (SPELL_WONDER); |
798 | cast_cone (op, op, 0, tmp); |
801 | cast_cone (op, op, 0, tmp); |
799 | tmp->destroy (); |
802 | tmp->destroy (); |
800 | } |
803 | } |
801 | |
804 | |
802 | else if (failure <= -40 && failure > -60) /* confusion */ |
805 | else if (failure <= -40 && failure > -60) /* confusion */ |
803 | { |
806 | { |
804 | new_draw_info (NDI_UNIQUE, 0, op, "Your diety touches your mind!"); |
807 | op->failmsg ("Your diety touches your mind!" HINT_GRACE); |
805 | confuse_player (op, op, 99); |
808 | confuse_player (op, op, 99); |
806 | } |
809 | } |
807 | else if (failure <= -60 && failure > -150) /* paralysis */ |
810 | else if (failure <= -60 && failure > -150) /* paralysis */ |
808 | { |
811 | { |
809 | new_draw_info_format (NDI_UNIQUE, 0, op, "%s requires you to pray NOW.", godname); |
812 | op->failmsgf ("%s requires you to pray NOW. " |
810 | new_draw_info (NDI_UNIQUE, 0, op, "You comply, ignoring all else."); |
813 | "You comply, ignoring all else." HINT_GRACE, |
|
|
814 | godname); |
811 | paralyze_player (op, op, 99); |
815 | paralyze_player (op, op, 99); |
812 | } |
816 | } |
813 | else if (failure <= -150) /* blast the immediate area */ |
817 | else if (failure <= -150) /* blast the immediate area */ |
814 | { |
818 | { |
815 | tmp = get_archetype (GOD_POWER); |
819 | tmp = get_archetype (GOD_POWER); |
816 | new_draw_info_format (NDI_UNIQUE, 0, op, "%s smites you!", godname); |
820 | op->failmsgf ("%s smites you!" HINT_GRACE, godname); |
817 | cast_magic_storm (op, tmp, power); |
821 | cast_magic_storm (op, tmp, power); |
818 | } |
822 | } |
819 | } |
823 | } |
820 | |
824 | |
821 | /* |
825 | /* |
… | |
… | |
835 | if (settings.spell_failure_effects == FALSE) |
839 | if (settings.spell_failure_effects == FALSE) |
836 | return; |
840 | return; |
837 | |
841 | |
838 | if (failure <= -20 && failure > -40) /* wonder */ |
842 | if (failure <= -20 && failure > -40) /* wonder */ |
839 | { |
843 | { |
840 | new_draw_info (NDI_UNIQUE, 0, op, "Your spell causes an unexpected effect."); |
844 | op->failmsg ("Your spell causes an unexpected effect."); |
841 | tmp = get_archetype (SPELL_WONDER); |
845 | tmp = get_archetype (SPELL_WONDER); |
842 | cast_cone (op, op, 0, tmp); |
846 | cast_cone (op, op, 0, tmp); |
843 | tmp->destroy (); |
847 | tmp->destroy (); |
844 | } |
848 | } |
845 | |
849 | |
846 | else if (failure <= -40 && failure > -60) /* confusion */ |
850 | else if (failure <= -40 && failure > -60) /* confusion */ |
847 | { |
851 | { |
848 | new_draw_info (NDI_UNIQUE, 0, op, "Your magic recoils on you, making you confused!"); |
852 | op->failmsg ("Your magic recoils on you, making you confused!"); |
849 | confuse_player (op, op, 99); |
853 | confuse_player (op, op, 99); |
850 | } |
854 | } |
851 | else if (failure <= -60 && failure > -80) /* paralysis */ |
855 | else if (failure <= -60 && failure > -80) /* paralysis */ |
852 | { |
856 | { |
853 | new_draw_info (NDI_UNIQUE, 0, op, "Your magic stuns you!"); |
857 | op->failmsg ("Your magic stuns you!"); |
854 | paralyze_player (op, op, 99); |
858 | paralyze_player (op, op, 99); |
855 | } |
859 | } |
856 | else if (failure <= -80) /* blast the immediate area */ |
860 | else if (failure <= -80) /* blast the immediate area */ |
857 | { |
861 | { |
858 | object *tmp; |
862 | object *tmp; |
859 | |
863 | |
860 | /* Safety check to make sure we don't get any mana storms in scorn */ |
864 | /* Safety check to make sure we don't get any mana storms in scorn */ |
861 | if (get_map_flags (op->map, NULL, op->x, op->y, NULL, NULL) & P_NO_MAGIC) |
865 | if (get_map_flags (op->map, NULL, op->x, op->y, NULL, NULL) & P_NO_MAGIC) |
862 | { |
866 | { |
863 | new_draw_info (NDI_UNIQUE, 0, op, "The magic warps and you are turned inside out!"); |
867 | op->failmsg ("The magic warps and you are turned inside out!"); |
864 | hit_player (op, 9998, op, AT_INTERNAL, 1); |
868 | hit_player (op, 9998, op, AT_INTERNAL, 1); |
865 | |
869 | |
866 | } |
870 | } |
867 | else |
871 | else |
868 | { |
872 | { |
869 | new_draw_info (NDI_UNIQUE, 0, op, "You lose control of the mana! The uncontrolled magic blasts you!"); |
873 | op->failmsg ("You lose control of the mana! The uncontrolled magic blasts you!"); |
870 | tmp = get_archetype (LOOSE_MANA); |
874 | tmp = get_archetype (LOOSE_MANA); |
871 | tmp->level = skill->level; |
875 | tmp->level = skill->level; |
872 | |
876 | |
873 | /* increase the area of destruction a little for more powerful spells */ |
877 | /* increase the area of destruction a little for more powerful spells */ |
874 | tmp->range += isqrt (power); |
878 | tmp->range += isqrt (power); |
… | |
… | |
971 | /* if caster is a spell casting object, this normally shouldn't be |
975 | /* if caster is a spell casting object, this normally shouldn't be |
972 | * an issue, because they don't have any spellpaths set up. |
976 | * an issue, because they don't have any spellpaths set up. |
973 | */ |
977 | */ |
974 | if (caster->path_denied & spell_ob->path_attuned && !caster->flag [FLAG_WIZCAST]) |
978 | if (caster->path_denied & spell_ob->path_attuned && !caster->flag [FLAG_WIZCAST]) |
975 | { |
979 | { |
976 | new_draw_info (NDI_UNIQUE, 0, op, "That spell path is denied to you."); |
980 | op->failmsg ("That spell path is denied to you."); |
977 | return 0; |
981 | return 0; |
978 | } |
982 | } |
979 | |
983 | |
980 | object *skill = 0; |
984 | object *skill = 0; |
981 | |
985 | |