1 | /* |
1 | /* |
2 | * static char *rcsid_spell_attack_c = |
2 | * static char *rcsid_spell_attack_c = |
3 | * "$Id: spell_attack.C,v 1.2 2006/08/15 15:00:20 elmex Exp $"; |
3 | * "$Id: spell_attack.C,v 1.5 2006/08/26 23:36:34 root 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 |
… | |
… | |
137 | if (OB_TYPE_MOVE_BLOCK(tmp, GET_MAP_MOVE_BLOCK(m, sx, sy))) |
137 | if (OB_TYPE_MOVE_BLOCK(tmp, GET_MAP_MOVE_BLOCK(m, sx, sy))) |
138 | return; |
138 | return; |
139 | |
139 | |
140 | /* OK, we made a fork */ |
140 | /* OK, we made a fork */ |
141 | new_bolt = get_object(); |
141 | new_bolt = get_object(); |
142 | |
|
|
143 | copy_object(tmp,new_bolt); |
142 | copy_object(tmp,new_bolt); |
144 | |
143 | |
145 | /* reduce chances of subsequent forking */ |
144 | /* reduce chances of subsequent forking */ |
146 | new_bolt->stats.Dex -= 10; |
145 | new_bolt->stats.Dex -= 10; |
147 | tmp->stats.Dex -= 10; /* less forks from main bolt too */ |
146 | tmp->stats.Dex -= 10; /* less forks from main bolt too */ |
… | |
… | |
406 | remove_ob (op); |
405 | remove_ob (op); |
407 | free_object (op); |
406 | free_object (op); |
408 | return; |
407 | return; |
409 | } |
408 | } |
410 | |
409 | |
|
|
410 | // elmex Tue Aug 15 17:46:51 CEST 2006: Prevent explosions of any kind on safe maps |
|
|
411 | // NOTE: If this breaks something important: remove this. I can't think of anything |
|
|
412 | // bad at the moment that might happen from this. |
411 | if (get_map_flags (op->map, NULL, op->x, op->y, NULL, NULL) & P_SAFE_MAP) |
413 | if (get_map_flags (op->map, NULL, op->x, op->y, NULL, NULL) & P_SAFE) |
412 | { |
414 | { |
413 | remove_ob (op); |
415 | remove_ob (op); |
414 | free_object (op); |
416 | free_object (op); |
415 | return; |
417 | return; |
416 | } |
418 | } |
… | |
… | |
910 | archetype *at; |
912 | archetype *at; |
911 | |
913 | |
912 | if(op->state!=NUM_ANIMATIONS(op)-1) |
914 | if(op->state!=NUM_ANIMATIONS(op)-1) |
913 | return; |
915 | return; |
914 | |
916 | |
|
|
917 | |
915 | env = object_get_env_recursive(op); |
918 | env = object_get_env_recursive(op); |
916 | |
919 | |
917 | if (op->env) { |
920 | if (op->env) { |
918 | if (env->map == NULL) |
921 | if (env->map == NULL) |
919 | return; |
922 | return; |
… | |
… | |
925 | op->x = env->x; |
928 | op->x = env->x; |
926 | op->y = env->y; |
929 | op->y = env->y; |
927 | if ((op = insert_ob_in_map (op, env->map, op,0)) == NULL) |
930 | if ((op = insert_ob_in_map (op, env->map, op,0)) == NULL) |
928 | return; |
931 | return; |
929 | } |
932 | } |
|
|
933 | |
|
|
934 | // elmex Tue Aug 15 17:46:51 CEST 2006: Prevent bomb from exploding |
|
|
935 | // on a safe map. I don't like this special casing, but it seems to be neccessary |
|
|
936 | // as bombs can be carried. |
|
|
937 | if (get_map_flags (op->map, NULL, op->x, op->y, NULL, NULL) & P_SAFE) |
|
|
938 | { |
|
|
939 | remove_ob (op); |
|
|
940 | free_object (op); |
|
|
941 | return; |
|
|
942 | } |
930 | |
943 | |
931 | /* This copies a lot of the code from the fire bullet, |
944 | /* This copies a lot of the code from the fire bullet, |
932 | * but using the cast_bullet isn't really feasible, |
945 | * but using the cast_bullet isn't really feasible, |
933 | * so just set up the appropriate values. |
946 | * so just set up the appropriate values. |
934 | */ |
947 | */ |