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.17 by root, Tue Dec 12 21:39:57 2006 UTC vs.
Revision 1.18 by root, Wed Dec 13 00:42:04 2006 UTC

140 140
141 if (OB_TYPE_MOVE_BLOCK (tmp, GET_MAP_MOVE_BLOCK (m, sx, sy))) 141 if (OB_TYPE_MOVE_BLOCK (tmp, GET_MAP_MOVE_BLOCK (m, sx, sy)))
142 return; 142 return;
143 143
144 /* OK, we made a fork */ 144 /* OK, we made a fork */
145 new_bolt = object::create (); 145 new_bolt = tmp->clone ();
146 tmp->copy_to (new_bolt);
147 146
148 /* reduce chances of subsequent forking */ 147 /* reduce chances of subsequent forking */
149 new_bolt->stats.Dex -= 10; 148 new_bolt->stats.Dex -= 10;
150 tmp->stats.Dex -= 10; /* less forks from main bolt too */ 149 tmp->stats.Dex -= 10; /* less forks from main bolt too */
151 new_bolt->stats.Con += 25 * new_dir; /* adjust the left bias */ 150 new_bolt->stats.Con += 25 * new_dir; /* adjust the left bias */
249 update_turn_face (op); /* A bolt *must* be IS_TURNABLE */ 248 update_turn_face (op); /* A bolt *must* be IS_TURNABLE */
250 return; 249 return;
251 } 250 }
252 else 251 else
253 { /* Create a copy of this object and put it ahead */ 252 { /* Create a copy of this object and put it ahead */
254 tmp = object::create (); 253 tmp = op->clone ();
255 op->copy_to (tmp); 254
256 tmp->speed_left = -0.1; 255 tmp->speed_left = -0.1;
257 tmp->x += DIRX (tmp), tmp->y += DIRY (tmp); 256 tmp->x += DIRX (tmp), tmp->y += DIRY (tmp);
258 tmp = insert_ob_in_map (tmp, op->map, op, 0); 257 tmp = insert_ob_in_map (tmp, op->map, op, 0);
259 /* To make up for the decrease at the top of the function */ 258 /* To make up for the decrease at the top of the function */
260 tmp->duration++; 259 tmp->duration++;
383 /* ok_to_put_more already does things like checks for walls, 382 /* ok_to_put_more already does things like checks for walls,
384 * out of map, etc. 383 * out of map, etc.
385 */ 384 */
386 if (ok_to_put_more (op->map, dx, dy, op, op->attacktype)) 385 if (ok_to_put_more (op->map, dx, dy, op, op->attacktype))
387 { 386 {
388 tmp = object::create (); 387 tmp = op->clone ();
389 op->copy_to (tmp);
390 tmp->state = 0; 388 tmp->state = 0;
391 tmp->speed_left = -0.21; 389 tmp->speed_left = -0.21;
392 tmp->range--; 390 tmp->range--;
393 tmp->value = 0; 391 tmp->value = 0;
394 tmp->x = dx; 392 tmp->x = dx;
805 { 803 {
806 sint16 x = op->x + freearr_x[absdir (op->stats.sp + i)], y = op->y + freearr_y[absdir (op->stats.sp + i)]; 804 sint16 x = op->x + freearr_x[absdir (op->stats.sp + i)], y = op->y + freearr_y[absdir (op->stats.sp + i)];
807 805
808 if (ok_to_put_more (op->map, x, y, op, op->attacktype)) 806 if (ok_to_put_more (op->map, x, y, op, op->attacktype))
809 { 807 {
810 object *tmp = object::create (); 808 object *tmp = op->clone ();
811 809
812 op->copy_to (tmp);
813 tmp->x = x; 810 tmp->x = x;
814 tmp->y = y; 811 tmp->y = y;
815 812
816 tmp->duration = op->duration + 1; 813 tmp->duration = op->duration + 1;
817 814

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines