… | |
… | |
1497 | /* If there is nothing living on this space, no need to go further */ |
1497 | /* If there is nothing living on this space, no need to go further */ |
1498 | if (!(mflags & P_IS_ALIVE)) |
1498 | if (!(mflags & P_IS_ALIVE)) |
1499 | continue; |
1499 | continue; |
1500 | |
1500 | |
1501 | // players can only affect spaces that they can actually see |
1501 | // players can only affect spaces that they can actually see |
|
|
1502 | if (caster |
1502 | if (caster && caster->contr |
1503 | && caster->contr |
1503 | && caster->contr->visibility_at (m, nx, ny) < 70) |
1504 | && caster->contr->darkness_at (m, nx, ny) == LOS_BLOCKED) |
1504 | continue; |
1505 | continue; |
1505 | |
1506 | |
1506 | for (tmp = GET_MAP_TOP (m, nx, ny); tmp; tmp = tmp->below) |
1507 | for (tmp = GET_MAP_TOP (m, nx, ny); tmp; tmp = tmp->below) |
1507 | if (QUERY_FLAG (tmp, FLAG_MONSTER)) |
1508 | if (QUERY_FLAG (tmp, FLAG_MONSTER)) |
1508 | break; |
1509 | break; |
… | |
… | |
1618 | } /* for y */ |
1619 | } /* for y */ |
1619 | |
1620 | |
1620 | return 1; |
1621 | return 1; |
1621 | } |
1622 | } |
1622 | |
1623 | |
1623 | |
|
|
1624 | /* Move_ball_spell: This handles ball type spells that just sort of wander |
1624 | /* 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 |
1625 | * about. was called move_ball_lightning, but since more than the ball |
1626 | * lightning spell used it, that seemed misnamed. |
1626 | * lightning spell used it, that seemed misnamed. |
1627 | * op is the spell effect. |
1627 | * op is the spell effect. |
1628 | * note that duration is handled by process_object() in time.c |
1628 | * note that duration is handled by process_object() in time.c |
… | |
… | |
1653 | for (i = 1; i < 9; i++) |
1653 | for (i = 1; i < 9; i++) |
1654 | { |
1654 | { |
1655 | /* i bit 0: alters sign of offset |
1655 | /* i bit 0: alters sign of offset |
1656 | * other bits (i / 2): absolute value of offset |
1656 | * other bits (i / 2): absolute value of offset |
1657 | */ |
1657 | */ |
1658 | |
|
|
1659 | int offset = ((i ^ j) & 1) ? (i / 2) : -(i / 2); |
1658 | int offset = ((i ^ j) & 1) ? (i / 2) : -(i / 2); |
1660 | int tmpdir = absdir (op->direction + offset); |
1659 | int tmpdir = absdir (op->direction + offset); |
1661 | |
1660 | |
1662 | nx = op->x + freearr_x[tmpdir]; |
1661 | nx = op->x + freearr_x[tmpdir]; |
1663 | ny = op->y + freearr_y[tmpdir]; |
1662 | ny = op->y + freearr_y[tmpdir]; |
… | |
… | |
1665 | { |
1664 | { |
1666 | dir = tmpdir; |
1665 | dir = tmpdir; |
1667 | break; |
1666 | break; |
1668 | } |
1667 | } |
1669 | } |
1668 | } |
|
|
1669 | |
1670 | if (dir == 0) |
1670 | if (dir == 0) |
1671 | { |
1671 | { |
1672 | nx = op->x; |
1672 | nx = op->x; |
1673 | ny = op->y; |
1673 | ny = op->y; |
1674 | m = op->map; |
1674 | m = op->map; |