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.1 by elmex, Sun Aug 13 17:16:04 2006 UTC vs.
Revision 1.5 by root, Sat Aug 26 23:36:34 2006 UTC

1/* 1/*
2 * static char *rcsid_spell_attack_c = 2 * static char *rcsid_spell_attack_c =
3 * "$Id: spell_attack.C,v 1.1 2006/08/13 17:16:04 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.
413 if (get_map_flags (op->map, NULL, op->x, op->y, NULL, NULL) & P_SAFE)
414 {
415 remove_ob (op);
416 free_object (op);
417 return;
418 }
419
411 if (op->attacktype) { 420 if (op->attacktype) {
412 hit_map (op, 0, op->attacktype, 1); 421 hit_map (op, 0, op->attacktype, 1);
413 if (was_destroyed (op, op_tag)) 422 if (was_destroyed (op, op_tag))
414 return; 423 return;
415 } 424 }
903 archetype *at; 912 archetype *at;
904 913
905 if(op->state!=NUM_ANIMATIONS(op)-1) 914 if(op->state!=NUM_ANIMATIONS(op)-1)
906 return; 915 return;
907 916
917
908 env = object_get_env_recursive(op); 918 env = object_get_env_recursive(op);
909 919
910 if (op->env) { 920 if (op->env) {
911 if (env->map == NULL) 921 if (env->map == NULL)
912 return; 922 return;
918 op->x = env->x; 928 op->x = env->x;
919 op->y = env->y; 929 op->y = env->y;
920 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)
921 return; 931 return;
922 } 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 }
923 943
924 /* This copies a lot of the code from the fire bullet, 944 /* This copies a lot of the code from the fire bullet,
925 * but using the cast_bullet isn't really feasible, 945 * but using the cast_bullet isn't really feasible,
926 * so just set up the appropriate values. 946 * so just set up the appropriate values.
927 */ 947 */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines