ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/spell_attack.C
(Generate patch)

Comparing deliantra/server/server/spell_attack.C (file contents):
Revision 1.75 by root, Sun Dec 28 08:08:25 2008 UTC vs.
Revision 1.78 by root, Thu Jan 1 15:43:35 2009 UTC

831 for (i = range_min; i <= range_max; i++) 831 for (i = range_min; i <= range_max; i++)
832 { 832 {
833 sint16 x, y, d; 833 sint16 x, y, d;
834 834
835 /* We can't use absdir here, because it never returns 835 /* We can't use absdir here, because it never returns
836 * 0. If this is a rune, we want to hit the person on top 836 * 0. If this is a rune, we want to hit the person on top
837 * of the trap (d==0). If it is not a rune, then we don't want 837 * of the trap (d==0). If it is not a rune, then we don't want
838 * to hit that person. 838 * to hit that person.
839 */ 839 */
840 d = dir + i; 840 d = (dir + i) % 9;
841 while (d < 0)
842 d += 8;
843 while (d > 8)
844 d -= 8;
845 841
846 /* If it's not a rune, we don't want to blast the caster. 842 /* If it's not a rune, we don't want to blast the caster.
847 * In that case, we have to see - if dir is specified, 843 * In that case, we have to see - if dir is specified,
848 * turn this into direction 8. If dir is not specified (all 844 * turn this into direction 8. If dir is not specified (all
849 * direction) skip - otherwise, one line would do more damage 845 * direction) skip - otherwise, one line would do more damage
1115 * interesting spell. 1111 * interesting spell.
1116 * if it is a cleric spell, you need a god, and the creature 1112 * if it is a cleric spell, you need a god, and the creature
1117 * can't be friendly to your god. 1113 * can't be friendly to your god.
1118 */ 1114 */
1119 1115
1120 if (!target || QUERY_FLAG (target, FLAG_REFL_SPELL) 1116 if (!target
1117 || target->flag [FLAG_REFL_SPELL]
1121 || (!god && spell->stats.grace) 1118 || (!god && spell->stats.grace)
1122 || (target->title && god && !strcmp (target->title, god->name)) || (target->race && god && strstr (target->race, god->race))) 1119 || (target->title && god && target->title == god->name)
1120 || (target->race && god && target->race.contains (god->race)))
1123 { 1121 {
1124 new_draw_info (NDI_UNIQUE, 0, op, "Your request is unheeded."); 1122 new_draw_info (NDI_UNIQUE, 0, op, "Your request is unheeded.");
1125 return 0; 1123 return 0;
1126 } 1124 }
1127 1125
1134 effect->level = casting_level (caster, spell); 1132 effect->level = casting_level (caster, spell);
1135 effect->attacktype = spell->attacktype; 1133 effect->attacktype = spell->attacktype;
1136 if (effect->attacktype & (AT_HOLYWORD | AT_GODPOWER)) 1134 if (effect->attacktype & (AT_HOLYWORD | AT_GODPOWER))
1137 { 1135 {
1138 if (tailor_god_spell (effect, op)) 1136 if (tailor_god_spell (effect, op))
1139 new_draw_info_format (NDI_UNIQUE, 0, op, "%s answers your call!", determine_god (op)); 1137 new_draw_info_format (NDI_UNIQUE, 0, op, "%s answers your call!", (const char *)determine_god (op));
1140 else 1138 else
1141 { 1139 {
1142 new_draw_info (NDI_UNIQUE, 0, op, "Your request is ignored."); 1140 new_draw_info (NDI_UNIQUE, 0, op, "Your request is ignored.");
1143 return 0; 1141 return 0;
1144 } 1142 }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines