… | |
… | |
457 | new_draw_info (NDI_UNIQUE, 0, op, "Something is in the way."); |
457 | new_draw_info (NDI_UNIQUE, 0, op, "Something is in the way."); |
458 | new_draw_info (NDI_UNIQUE, 0, op, "You cast it at your feet."); |
458 | new_draw_info (NDI_UNIQUE, 0, op, "You cast it at your feet."); |
459 | dir = 0; |
459 | dir = 0; |
460 | } |
460 | } |
461 | |
461 | |
|
|
462 | SET_FLAG (new_op, FLAG_IDENTIFIED); |
462 | op->map->insert (new_op, |
463 | op->map->insert (new_op, |
463 | op->x + freearr_x[dir], op->y + freearr_y[dir], |
464 | op->x + freearr_x[dir], op->y + freearr_y[dir], |
464 | op, |
465 | op, |
465 | dir ? 0 : INS_BELOW_ORIGINATOR); |
466 | dir ? 0 : INS_BELOW_ORIGINATOR); |
466 | |
467 | |
… | |
… | |
994 | if (!spell_ob->other_arch) |
995 | if (!spell_ob->other_arch) |
995 | { |
996 | { |
996 | LOG (llevError, "cast_party_spell: empty other arch\n"); |
997 | LOG (llevError, "cast_party_spell: empty other arch\n"); |
997 | return 0; |
998 | return 0; |
998 | } |
999 | } |
|
|
1000 | |
999 | spell = arch_to_object (spell_ob->other_arch); |
1001 | spell = arch_to_object (spell_ob->other_arch); |
1000 | |
1002 | |
1001 | /* Always cast spell on caster */ |
1003 | /* Always cast spell on caster */ |
1002 | success = cast_spell (op, caster, dir, spell, stringarg); |
1004 | success = cast_spell (op, caster, dir, spell, stringarg); |
1003 | |
1005 | |
1004 | if (caster->contr->party == NULL) |
1006 | if (caster->contr->party == NULL) |
1005 | { |
1007 | { |
1006 | spell->remove (); |
1008 | spell->remove (); |
1007 | return success; |
1009 | return success; |
1008 | } |
1010 | } |
|
|
1011 | |
1009 | for_all_players (pl) |
1012 | for_all_players (pl) |
1010 | if ((pl->ob->contr->party == caster->contr->party) && (on_same_map (pl->ob, caster))) |
1013 | if ((pl->ob->contr->party == caster->contr->party) && (on_same_map (pl->ob, caster))) |
1011 | { |
|
|
1012 | cast_spell (pl->ob, caster, pl->ob->facing, spell, stringarg); |
1014 | cast_spell (pl->ob, caster, pl->ob->facing, spell, stringarg); |
1013 | } |
1015 | |
1014 | spell->remove (); |
1016 | spell->remove (); |
1015 | return success; |
1017 | return success; |
1016 | } |
1018 | } |
1017 | |
1019 | |
1018 | /* This is where the main dispatch when someone casts a spell. |
1020 | /* This is where the main dispatch when someone casts a spell. |
… | |
… | |
1134 | |
1136 | |
1135 | /* player/monster is trying to cast the spell. might fumble it */ |
1137 | /* player/monster is trying to cast the spell. might fumble it */ |
1136 | if (spell_ob->stats.grace && random_roll (0, 99, op, PREFER_HIGH) < |
1138 | if (spell_ob->stats.grace && random_roll (0, 99, op, PREFER_HIGH) < |
1137 | (spell_ob->level / (float) MAX (1, op->level) * cleric_chance[op->stats.Wis])) |
1139 | (spell_ob->level / (float) MAX (1, op->level) * cleric_chance[op->stats.Wis])) |
1138 | { |
1140 | { |
1139 | play_sound_player_only (op->contr, SOUND_FUMBLE_SPELL, 0, 0); |
1141 | op->contr->play_sound (sound_find ("fumble_spell")); |
1140 | new_draw_info (NDI_UNIQUE, 0, op, "You fumble the prayer."); |
1142 | new_draw_info (NDI_UNIQUE, 0, op, "You fumble the prayer."); |
1141 | |
1143 | |
1142 | op->stats.grace -= random_roll (1, SP_level_spellpoint_cost (caster, spell_ob, SPELL_GRACE), op, PREFER_LOW); |
1144 | op->stats.grace -= random_roll (1, SP_level_spellpoint_cost (caster, spell_ob, SPELL_GRACE), op, PREFER_LOW); |
1143 | return 0; |
1145 | return 0; |
1144 | } |
1146 | } |
… | |
… | |
1243 | } |
1245 | } |
1244 | |
1246 | |
1245 | if (INVOKE_OBJECT (CAST_SPELL, spell_ob, ARG_OBJECT (op), ARG_OBJECT (caster), ARG_INT (dir), ARG_STRING (stringarg))) |
1247 | if (INVOKE_OBJECT (CAST_SPELL, spell_ob, ARG_OBJECT (op), ARG_OBJECT (caster), ARG_INT (dir), ARG_STRING (stringarg))) |
1246 | return RESULT_INT (0); |
1248 | return RESULT_INT (0); |
1247 | |
1249 | |
|
|
1250 | op->play_sound (spell_ob->sound); |
|
|
1251 | |
1248 | switch (spell_ob->subtype) |
1252 | switch (spell_ob->subtype) |
1249 | { |
1253 | { |
1250 | /* The order of case statements is same as the order they show up |
1254 | /* The order of case statements is same as the order they show up |
1251 | * in in spells.h. |
1255 | * in in spells.h. |
1252 | */ |
1256 | */ |