/* Disintegration balls explosions are stopped by perma-walls */
if (!in_disintegration_range(by, bx, y, x)) return FALSE;
-
+
/* Permanent walls and artifacts don't get effect */
/* But not protect monsters and other objects */
if (!cave_valid_bold(y, x)) return TRUE;
/* Enforce an arc */
if (distance(by, bx, y, x) != cdis) continue;
+
if (disint_ball)
{
/* Disintegration are stopped only by perma-walls */
}
}
+
/* Find the closest point in the blast */
if (breath)
{
{
effective_dist = dist;
}
-
- /* Target may be the riding player */
+
+
+ /* There is the riding player on this monster */
if (p_ptr->riding && (y == py) && (x == px))
{
- /* A beam or bolt is well aimed */
- if ((flg & (PROJECT_BEAM | PROJECT_REFLECTABLE)) && (y == y2) && (x == x2))
+ /* Aimed on the player */
+ if (flg & PROJECT_PLAYER)
{
- /* Aimed on the player */
- if (flg & PROJECT_PLAYER) continue;
+ if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
+ {
+ /*
+ * A beam or bolt is well aimed
+ * at the PLAYER!
+ * So don't affects the mount.
+ */
+ continue;
+ }
+ else
+ {
+ /*
+ * The spell is not well aimed,
+ * So partly affect the mount too.
+ */
+ effective_dist++;
+ }
+ }
+
+ /*
+ * This grid is the original target.
+ */
+ else if ((y == y2) || (x == x2))
+ {
+ /* Hit the mount with full damage */
+ }
- /* Aimed on the mount */
- /* The monster takes full damage */
+ /*
+ * Otherwise this grid is not the
+ * original target, it means that line
+ * of fire is obstructed by this
+ * monster.
+ */
+ /*
+ * A beam or bolt will hit either
+ * player or mount. Choose randomly.
+ */
+ else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
+ {
+ if (one_in_(2))
+ {
+ /* Hit the mount with full damage */
+ }
+ else
+ {
+ /* Hit the player later */
+ flg &= ~(PROJECT_MONSTER);
+ flg |= PROJECT_PLAYER;
+
+ /* Don't affect the mount */
+ continue;
+ }
}
- /* Otherwise partly affect the mount */
+ /*
+ * The spell is not well aimed, so
+ * partly affect both player and
+ * mount.
+ */
else
{
effective_dist++;
}
}
-
+
/* Affect the monster in the grid */
if (project_m(who, effective_dist, y, x, dam, typ,flg)) notice = TRUE;
}
-
+
+
/* Player affected one monster (without "jumping") */
if (!who && (project_m_n == 1) && !jump)
{
/* Target may be your horse */
if (p_ptr->riding)
{
- /* A beam or bolt is well aimed */
- if ((flg & (PROJECT_BEAM | PROJECT_REFLECTABLE)) && (y == y2) && (x == x2))
+ /* Aimed on the player */
+ if (flg & PROJECT_PLAYER)
{
- /* Aimed on the mount */
- if (flg & PROJECT_MONSTER) continue;
-
- /* Aimed on the player */
- /* The player takes full damage */
+ /* Hit the player with full damage */
}
- /* Otherwise partly affect the player */
+ /*
+ * Hack -- When this grid was not the
+ * original target, a beam or bolt
+ * would hit either player or mount,
+ * and should be choosen randomly.
+ *
+ * But already choosen to hit the
+ * mount at this point.
+ */
+ else if (flg & (PROJECT_BEAM | PROJECT_REFLECTABLE))
+ {
+ /*
+ * A beam or bolt is well aimed
+ * at the mount!
+ * So don't affects the player.
+ */
+ continue;
+ }
else
{
+ /*
+ * The spell is not well aimed,
+ * So partly affect the player too.
+ */
effective_dist++;
}
}
/* Affect the player */
if (project_p(who, who_name, effective_dist, y, x, dam, typ, flg, monspell)) notice = TRUE;
-
- /* Affect done */
- break;
}
}