… | |
… | |
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) % 9; |
840 | d = dir ? absdir (dir + i) : 0; |
841 | |
841 | |
842 | /* 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. |
843 | * In that case, we have to see - if dir is specified, |
843 | * In that case, we have to see - if dir is specified, |
844 | * turn this into direction 8. If dir is not specified (all |
844 | * turn this into direction 8. If dir is not specified (all |
845 | * direction) skip - otherwise, one line would do more damage |
845 | * direction) skip - otherwise, one line would do more damage |
… | |
… | |
1114 | */ |
1114 | */ |
1115 | |
1115 | |
1116 | if (!target |
1116 | if (!target |
1117 | || target->flag [FLAG_REFL_SPELL] |
1117 | || target->flag [FLAG_REFL_SPELL] |
1118 | || (!god && spell->stats.grace) |
1118 | || (!god && spell->stats.grace) |
1119 | || (target->title && god && target->title == god->name) |
1119 | || (god && target->title == god->name) |
1120 | || (target->race && god && strstr (target->race, god->race))) |
1120 | || (god && target->race.contains (god->race))) |
1121 | { |
1121 | { |
1122 | new_draw_info (NDI_UNIQUE, 0, op, "Your request is unheeded."); |
1122 | new_draw_info (NDI_UNIQUE, 0, op, "Your request is unheeded."); |
1123 | return 0; |
1123 | return 0; |
1124 | } |
1124 | } |
1125 | |
1125 | |
… | |
… | |
1256 | |
1256 | |
1257 | object *tmp = get_archetype (FORCE_NAME); |
1257 | object *tmp = get_archetype (FORCE_NAME); |
1258 | tmp->speed = 0.01; |
1258 | tmp->speed = 0.01; |
1259 | tmp->stats.food = time; |
1259 | tmp->stats.food = time; |
1260 | SET_FLAG (tmp, FLAG_IS_USED_UP); |
1260 | SET_FLAG (tmp, FLAG_IS_USED_UP); |
1261 | tmp->glow_radius = min (MAX_LIGHT_RADIUS, radius); |
1261 | tmp->set_glow_radius (min (MAX_LIGHT_RADIUS, radius)); |
1262 | tmp = insert_ob_in_ob (tmp, op); |
1262 | tmp = insert_ob_in_ob (tmp, op); |
1263 | |
1263 | |
1264 | if (tmp->glow_radius > op->glow_radius) |
1264 | if (tmp->glow_radius > op->glow_radius) |
1265 | op->glow_radius = tmp->glow_radius; |
1265 | op->set_glow_radius (tmp->glow_radius); |
1266 | |
1266 | |
1267 | return 1; |
1267 | return 1; |
1268 | } |
1268 | } |
1269 | |
1269 | |
1270 | int |
1270 | int |
… | |
… | |
1447 | * so even if the player doesn't worship a god, if race=GOD_.., it |
1447 | * so even if the player doesn't worship a god, if race=GOD_.., it |
1448 | * won't ever match anything. |
1448 | * won't ever match anything. |
1449 | */ |
1449 | */ |
1450 | if (!spell->race) |
1450 | if (!spell->race) |
1451 | race = NULL; |
1451 | race = NULL; |
1452 | else if (god && !strcmp (spell->race, "GOD_SLAYING")) |
1452 | else if (god && spell->race == shstr_GOD_SLAYING) |
1453 | race = god->slaying; |
1453 | race = god->slaying; |
1454 | else if (god && !strcmp (spell->race, "GOD_FRIEND")) |
1454 | else if (god && spell->race == shstr_GOD_FRIEND) |
1455 | race = god->race; |
1455 | race = god->race; |
1456 | else |
1456 | else |
1457 | race = spell->race; |
1457 | race = spell->race; |
1458 | |
1458 | |
1459 | unordered_mapwalk (op, -range, -range, range, range) |
1459 | unordered_mapwalk (op, -range, -range, range, range) |
… | |
… | |
1907 | } |
1907 | } |
1908 | |
1908 | |
1909 | tmp->stats.food = spell->duration + SP_level_duration_adjust (caster, spell); |
1909 | tmp->stats.food = spell->duration + SP_level_duration_adjust (caster, spell); |
1910 | |
1910 | |
1911 | if (tmp->glow_radius) |
1911 | if (tmp->glow_radius) |
|
|
1912 | tmp->set_glow_radius ( |
1912 | tmp->glow_radius = min (MAX_LIGHT_RADIUS, spell->range + SP_level_range_adjust (caster, spell)); |
1913 | min (MAX_LIGHT_RADIUS, spell->range + SP_level_range_adjust (caster, spell))); |
1913 | |
1914 | |
1914 | if (dir) |
1915 | if (dir) |
1915 | m->insert (tmp, x, y, op); |
1916 | m->insert (tmp, x, y, op); |
1916 | else |
1917 | else |
1917 | caster->outer_env ()->insert (tmp); |
1918 | caster->outer_env ()->insert (tmp); |