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.76 by root, Sun Dec 28 08:09:49 2008 UTC vs.
Revision 1.81 by elmex, Mon Jan 12 00:17:23 2009 UTC

1111 * interesting spell. 1111 * interesting spell.
1112 * 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
1113 * can't be friendly to your god. 1113 * can't be friendly to your god.
1114 */ 1114 */
1115 1115
1116 if (!target || QUERY_FLAG (target, FLAG_REFL_SPELL) 1116 if (!target
1117 || target->flag [FLAG_REFL_SPELL]
1117 || (!god && spell->stats.grace) 1118 || (!god && spell->stats.grace)
1118 || (target->title && god && !strcmp (target->title, god->name)) || (target->race && god && strstr (target->race, god->race))) 1119 || (god && target->title == god->name)
1120 || (god && target->race.contains (god->race)))
1119 { 1121 {
1120 new_draw_info (NDI_UNIQUE, 0, op, "Your request is unheeded."); 1122 new_draw_info (NDI_UNIQUE, 0, op, "Your request is unheeded.");
1121 return 0; 1123 return 0;
1122 } 1124 }
1123 1125
1130 effect->level = casting_level (caster, spell); 1132 effect->level = casting_level (caster, spell);
1131 effect->attacktype = spell->attacktype; 1133 effect->attacktype = spell->attacktype;
1132 if (effect->attacktype & (AT_HOLYWORD | AT_GODPOWER)) 1134 if (effect->attacktype & (AT_HOLYWORD | AT_GODPOWER))
1133 { 1135 {
1134 if (tailor_god_spell (effect, op)) 1136 if (tailor_god_spell (effect, op))
1135 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));
1136 else 1138 else
1137 { 1139 {
1138 new_draw_info (NDI_UNIQUE, 0, op, "Your request is ignored."); 1140 new_draw_info (NDI_UNIQUE, 0, op, "Your request is ignored.");
1139 return 0; 1141 return 0;
1140 } 1142 }
1254 1256
1255 object *tmp = get_archetype (FORCE_NAME); 1257 object *tmp = get_archetype (FORCE_NAME);
1256 tmp->speed = 0.01; 1258 tmp->speed = 0.01;
1257 tmp->stats.food = time; 1259 tmp->stats.food = time;
1258 SET_FLAG (tmp, FLAG_IS_USED_UP); 1260 SET_FLAG (tmp, FLAG_IS_USED_UP);
1259 tmp->glow_radius = min (MAX_LIGHT_RADIUS, radius); 1261 tmp->set_glow_radius (min (MAX_LIGHT_RADIUS, radius));
1260 tmp = insert_ob_in_ob (tmp, op); 1262 tmp = insert_ob_in_ob (tmp, op);
1261 1263
1262 if (tmp->glow_radius > op->glow_radius) 1264 if (tmp->glow_radius > op->glow_radius)
1263 op->glow_radius = tmp->glow_radius; 1265 op->set_glow_radius (tmp->glow_radius);
1264 1266
1265 return 1; 1267 return 1;
1266} 1268}
1267 1269
1268int 1270int
1445 * 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
1446 * won't ever match anything. 1448 * won't ever match anything.
1447 */ 1449 */
1448 if (!spell->race) 1450 if (!spell->race)
1449 race = NULL; 1451 race = NULL;
1450 else if (god && !strcmp (spell->race, "GOD_SLAYING")) 1452 else if (god && spell->race == shstr_GOD_SLAYING)
1451 race = god->slaying; 1453 race = god->slaying;
1452 else if (god && !strcmp (spell->race, "GOD_FRIEND")) 1454 else if (god && spell->race == shstr_GOD_FRIEND)
1453 race = god->race; 1455 race = god->race;
1454 else 1456 else
1455 race = spell->race; 1457 race = spell->race;
1456 1458
1457 unordered_mapwalk (op, -range, -range, range, range) 1459 unordered_mapwalk (op, -range, -range, range, range)
1905 } 1907 }
1906 1908
1907 tmp->stats.food = spell->duration + SP_level_duration_adjust (caster, spell); 1909 tmp->stats.food = spell->duration + SP_level_duration_adjust (caster, spell);
1908 1910
1909 if (tmp->glow_radius) 1911 if (tmp->glow_radius)
1912 tmp->set_glow_radius (
1910 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)));
1911 1914
1912 if (dir) 1915 if (dir)
1913 m->insert (tmp, x, y, op); 1916 m->insert (tmp, x, y, op);
1914 else 1917 else
1915 caster->outer_env ()->insert (tmp); 1918 caster->outer_env ()->insert (tmp);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines