… | |
… | |
1618 | } /* for y */ |
1618 | } /* for y */ |
1619 | |
1619 | |
1620 | return 1; |
1620 | return 1; |
1621 | } |
1621 | } |
1622 | |
1622 | |
1623 | |
|
|
1624 | /* 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 |
1625 | * 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 |
1626 | * lightning spell used it, that seemed misnamed. |
1625 | * lightning spell used it, that seemed misnamed. |
1627 | * op is the spell effect. |
1626 | * op is the spell effect. |
1628 | * note that duration is handled by process_object() in time.c |
1627 | * note that duration is handled by process_object() in time.c |
… | |
… | |
1653 | for (i = 1; i < 9; i++) |
1652 | for (i = 1; i < 9; i++) |
1654 | { |
1653 | { |
1655 | /* i bit 0: alters sign of offset |
1654 | /* i bit 0: alters sign of offset |
1656 | * other bits (i / 2): absolute value of offset |
1655 | * other bits (i / 2): absolute value of offset |
1657 | */ |
1656 | */ |
1658 | |
|
|
1659 | int offset = ((i ^ j) & 1) ? (i / 2) : -(i / 2); |
1657 | int offset = ((i ^ j) & 1) ? (i / 2) : -(i / 2); |
1660 | int tmpdir = absdir (op->direction + offset); |
1658 | int tmpdir = absdir (op->direction + offset); |
1661 | |
1659 | |
1662 | nx = op->x + freearr_x[tmpdir]; |
1660 | nx = op->x + freearr_x[tmpdir]; |
1663 | ny = op->y + freearr_y[tmpdir]; |
1661 | ny = op->y + freearr_y[tmpdir]; |
… | |
… | |
1665 | { |
1663 | { |
1666 | dir = tmpdir; |
1664 | dir = tmpdir; |
1667 | break; |
1665 | break; |
1668 | } |
1666 | } |
1669 | } |
1667 | } |
|
|
1668 | |
1670 | if (dir == 0) |
1669 | if (dir == 0) |
1671 | { |
1670 | { |
1672 | nx = op->x; |
1671 | nx = op->x; |
1673 | ny = op->y; |
1672 | ny = op->y; |
1674 | m = op->map; |
1673 | m = op->map; |