1 | /* |
1 | /* |
2 | * static char *rcsid_spell_util_c = |
2 | * static char *rcsid_spell_util_c = |
3 | * "$Id: spell_util.C,v 1.8 2006/08/29 08:01:38 root Exp $"; |
3 | * "$Id: spell_util.C,v 1.9 2006/08/29 11:58:02 elmex Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | |
6 | |
7 | /* |
7 | /* |
8 | CrossFire, A Multiplayer game for X-windows |
8 | CrossFire, A Multiplayer game for X-windows |
… | |
… | |
1110 | /* See if we can cast a spell here. If the caster and op are |
1110 | /* See if we can cast a spell here. If the caster and op are |
1111 | * not alive, then this would mean that the mapmaker put the |
1111 | * not alive, then this would mean that the mapmaker put the |
1112 | * objects on the space - presume that they know what they are |
1112 | * objects on the space - presume that they know what they are |
1113 | * doing. |
1113 | * doing. |
1114 | */ |
1114 | */ |
|
|
1115 | |
|
|
1116 | if ((mflags & P_SAFE) && !QUERY_FLAG(op, FLAG_WIZCAST)) // There is _ABSOLUTELY_ no magic allowed here (except wizards :-)! |
|
|
1117 | { |
|
|
1118 | new_draw_info(NDI_UNIQUE, 0,op, |
|
|
1119 | "This ground is sacred! The gods prevent any magical effects done by you here!."); |
|
|
1120 | return 0; |
|
|
1121 | } |
|
|
1122 | |
1115 | if (spell_ob->type == SPELL |
1123 | if ((spell_ob->type == SPELL) |
1116 | && (mflags & P_SAFE || caster->type != POTION) // elmex: prevent potions from casting on safe maps |
1124 | && (caster->type != POTION) |
1117 | && !QUERY_FLAG(op, FLAG_WIZCAST) |
1125 | && !QUERY_FLAG(op, FLAG_WIZCAST) |
1118 | && (QUERY_FLAG(caster, FLAG_ALIVE) |
1126 | && (QUERY_FLAG(caster, FLAG_ALIVE) |
1119 | || QUERY_FLAG(op, FLAG_ALIVE)) |
1127 | || QUERY_FLAG(op, FLAG_ALIVE)) |
1120 | && (((mflags & P_NO_MAGIC) && spell_ob->stats.sp) |
1128 | && (((mflags & P_NO_MAGIC) && spell_ob->stats.sp) |
1121 | || ((mflags & P_NO_CLERIC) && spell_ob->stats.grace))) |
1129 | || ((mflags & P_NO_CLERIC) && spell_ob->stats.grace))) |
… | |
… | |
1123 | if (op->type!=PLAYER) |
1131 | if (op->type!=PLAYER) |
1124 | return 0; |
1132 | return 0; |
1125 | |
1133 | |
1126 | if ((mflags & P_NO_CLERIC) && spell_ob->stats.grace) |
1134 | if ((mflags & P_NO_CLERIC) && spell_ob->stats.grace) |
1127 | new_draw_info_format(NDI_UNIQUE, 0,op,"This ground is unholy! %s ignores you.",godname); |
1135 | new_draw_info_format(NDI_UNIQUE, 0,op,"This ground is unholy! %s ignores you.",godname); |
1128 | else if (mflags & P_SAFE) |
|
|
1129 | new_draw_info(NDI_UNIQUE, 0,op, |
|
|
1130 | "This ground is sacred! The gods prevent any magical effects done by you here!."); |
|
|
1131 | else |
1136 | else |
1132 | switch(op->contr->shoottype) |
1137 | switch(op->contr->shoottype) |
1133 | { |
1138 | { |
1134 | case range_magic: |
1139 | case range_magic: |
1135 | new_draw_info(NDI_UNIQUE, 0,op,"Something blocks your spellcasting."); |
1140 | new_draw_info(NDI_UNIQUE, 0,op,"Something blocks your spellcasting."); |