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

Comparing deliantra/server/server/spell_effect.C (file contents):
Revision 1.84 by root, Tue Jul 8 08:33:27 2008 UTC vs.
Revision 1.85 by root, Sun Aug 17 22:46:26 2008 UTC

1172 */ 1172 */
1173int 1173int
1174cast_bless (object *op, object *caster, object *spell_ob, int dir) 1174cast_bless (object *op, object *caster, object *spell_ob, int dir)
1175{ 1175{
1176 int i; 1176 int i;
1177 object *god = find_god (determine_god (op)), *tmp2, *force = NULL, *tmp; 1177 object *god = find_god (determine_god (op)), *force = NULL, *tmp;
1178 1178
1179 /* if dir = 99 op defaults to tmp, eat_special_food() requires this. */ 1179 /* if dir = 99 op defaults to tmp, eat_special_food() requires this. */
1180 if (dir != 0) 1180 if (dir != 0)
1181 { 1181 {
1182 tmp = find_target_for_friendly_spell (op, dir); 1182 tmp = find_target_for_friendly_spell (op, dir);
1183
1184 if (!tmp)
1185 return 0;
1183 } 1186 }
1184 else 1187 else
1185 {
1186 tmp = op; 1188 tmp = op;
1187 }
1188 1189
1189 /* If we've already got a force of this type, don't add a new one. */ 1190 /* If we've already got a force of this type, don't add a new one. */
1190 for (tmp2 = tmp->inv; tmp2 != NULL; tmp2 = tmp2->below) 1191 for (object *tmp2 = tmp->inv; tmp2; tmp2 = tmp2->below)
1191 { 1192 {
1192 if (tmp2->type == FORCE && tmp2->subtype == FORCE_CHANGE_ABILITY) 1193 if (tmp2->type == FORCE && tmp2->subtype == FORCE_CHANGE_ABILITY)
1193 { 1194 {
1194 if (tmp2->name == spell_ob->name) 1195 if (tmp2->name == spell_ob->name)
1195 { 1196 {
1201 new_draw_info_format (NDI_UNIQUE, 0, op, "You can not cast %s while %s is in effect", &spell_ob->name, &tmp2->name_pl); 1202 new_draw_info_format (NDI_UNIQUE, 0, op, "You can not cast %s while %s is in effect", &spell_ob->name, &tmp2->name_pl);
1202 return 0; 1203 return 0;
1203 } 1204 }
1204 } 1205 }
1205 } 1206 }
1207
1206 if (force == NULL) 1208 if (force == NULL)
1207 { 1209 {
1208 force = get_archetype (FORCE_NAME); 1210 force = get_archetype (FORCE_NAME);
1209 force->subtype = FORCE_CHANGE_ABILITY; 1211 force->subtype = FORCE_CHANGE_ABILITY;
1210 if (spell_ob->race) 1212 if (spell_ob->race)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines