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.69 by root, Thu Dec 4 01:07:35 2008 UTC vs.
Revision 1.71 by root, Mon Dec 22 21:51:11 2008 UTC

1008 int mflags; 1008 int mflags;
1009 sint16 dx = op->x + freearr_x[dir], dy = op->y + freearr_y[dir]; 1009 sint16 dx = op->x + freearr_x[dir], dy = op->y + freearr_y[dir];
1010 maptile *m; 1010 maptile *m;
1011 1011
1012 mflags = get_map_flags (op->map, &m, dx, dy, &dx, &dy); 1012 mflags = get_map_flags (op->map, &m, dx, dy, &dx, &dy);
1013
1014 // when creating a bomb below ourself it should always work, even
1015 // when movement is blocked (somehow we got here, somehow we are here,
1016 // so we should also be able to make a bomb here). (originally added
1017 // to fix create bomb traps in doors, which cast with dir=0).
1018 if (dir)
1019 {
1013 if ((mflags & P_OUT_OF_MAP) || (GET_MAP_MOVE_BLOCK (m, dx, dy) & MOVE_WALK)) 1020 if ((mflags & P_OUT_OF_MAP) || (GET_MAP_MOVE_BLOCK (m, dx, dy) & MOVE_WALK))
1014 { 1021 {
1015 new_draw_info (NDI_UNIQUE, 0, op, "There is something in the way."); 1022 new_draw_info (NDI_UNIQUE, 0, op, "There is something in the way.");
1016 return 0; 1023 return 0;
1024 }
1017 } 1025 }
1018 1026
1019 tmp = arch_to_object (spell->other_arch); 1027 tmp = arch_to_object (spell->other_arch);
1020 1028
1021 /* level dependencies for bomb */ 1029 /* level dependencies for bomb */
1610 } /* for y */ 1618 } /* for y */
1611 1619
1612 return 1; 1620 return 1;
1613} 1621}
1614 1622
1615
1616/* Move_ball_spell: This handles ball type spells that just sort of wander 1623/* Move_ball_spell: This handles ball type spells that just sort of wander
1617 * about. was called move_ball_lightning, but since more than the ball 1624 * about. was called move_ball_lightning, but since more than the ball
1618 * lightning spell used it, that seemed misnamed. 1625 * lightning spell used it, that seemed misnamed.
1619 * op is the spell effect. 1626 * op is the spell effect.
1620 * note that duration is handled by process_object() in time.c 1627 * note that duration is handled by process_object() in time.c
1645 for (i = 1; i < 9; i++) 1652 for (i = 1; i < 9; i++)
1646 { 1653 {
1647 /* i bit 0: alters sign of offset 1654 /* i bit 0: alters sign of offset
1648 * other bits (i / 2): absolute value of offset 1655 * other bits (i / 2): absolute value of offset
1649 */ 1656 */
1650
1651 int offset = ((i ^ j) & 1) ? (i / 2) : -(i / 2); 1657 int offset = ((i ^ j) & 1) ? (i / 2) : -(i / 2);
1652 int tmpdir = absdir (op->direction + offset); 1658 int tmpdir = absdir (op->direction + offset);
1653 1659
1654 nx = op->x + freearr_x[tmpdir]; 1660 nx = op->x + freearr_x[tmpdir];
1655 ny = op->y + freearr_y[tmpdir]; 1661 ny = op->y + freearr_y[tmpdir];
1657 { 1663 {
1658 dir = tmpdir; 1664 dir = tmpdir;
1659 break; 1665 break;
1660 } 1666 }
1661 } 1667 }
1668
1662 if (dir == 0) 1669 if (dir == 0)
1663 { 1670 {
1664 nx = op->x; 1671 nx = op->x;
1665 ny = op->y; 1672 ny = op->y;
1666 m = op->map; 1673 m = op->map;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines