<ClCompile Include="..\..\src\patron.c" />\r
<ClCompile Include="..\..\src\player-damage.c" />\r
<ClCompile Include="..\..\src\player-status.c" />\r
- <ClCompile Include="..\..\src\projection.c" />\r
<ClCompile Include="..\..\src\quest.c" />\r
<ClCompile Include="..\..\src\realm-craft.c" />\r
<ClCompile Include="..\..\src\realm-crusade.c" />\r
<ClInclude Include="..\..\src\spells-status.h" />\r
<ClInclude Include="..\..\src\spells-summon.h" />\r
<ClInclude Include="..\..\src\floor-streams.h" />\r
- <ClInclude Include="..\..\src\projection.h" />\r
<ClInclude Include="..\..\src\spells-world.h" />\r
<ClInclude Include="..\..\src\spells.h" />\r
<ClInclude Include="..\..\src\store.h" />\r
<ClCompile Include="..\..\src\chuukei.c" />
<ClCompile Include="..\..\src\geometry.c" />
<ClCompile Include="..\..\src\history.c" />
- <ClCompile Include="..\..\src\projection.c" />
<ClCompile Include="..\..\src\quest.c" />
<ClCompile Include="..\..\src\realm-craft.c" />
<ClCompile Include="..\..\src\realm-crusade.c" />
<ClInclude Include="..\..\src\selfinfo.h" />
<ClInclude Include="..\..\src\shoot.h" />
<ClInclude Include="..\..\src\sort.h" />
- <ClInclude Include="..\..\src\projection.h" />
<ClInclude Include="..\..\src\store.h" />
<ClInclude Include="..\..\src\term.h" />
<ClInclude Include="..\..\src\trap.h" />
#include "object-hook.h"
#include "spells-summon.h"
#include "sort.h"
-#include "projection.h"
#include "artifact.h"
#include "avatar.h"
#include "spells-status.h"
#include "angband.h"
-#include "projection.h"
#include "spells-summon.h"
#include "avatar.h"
#include "player-status.h"
#include "floor.h"
#include "melee.h"
#include "object-hook.h"
-#include "projection.h"
#include "spells-summon.h"
#include "spells-status.h"
#include "monster-status.h"
extern void remove_mirror(POSITION y, POSITION x);
extern void mmove2(POSITION *y, POSITION *x, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
-extern bool projectable(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
extern void scatter(POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode);
extern void health_track(MONSTER_IDX m_idx);
extern void monster_race_track(MONRACE_IDX r_idx);
return d[dx + 1][dy + 1];
}
+
+/*!
+ * @brief 始点から終点への直線経路を返す /
+ * Determine the path taken by a projection.
+ * @param gp 経路座標リストを返す参照ポインタ
+ * @param range 距離
+ * @param y1 始点Y座標
+ * @param x1 始点X座標
+ * @param y2 終点Y座標
+ * @param x2 終点X座標
+ * @param flg フラグID
+ * @return リストの長さ
+ * @details
+ * <pre>
+ * The projection will always start from the grid (y1,x1), and will travel
+ * towards the grid (y2,x2), touching one grid per unit of distance along
+ * the major axis, and stopping when it enters the destination grid or a
+ * wall grid, or has travelled the maximum legal distance of "range".
+ *
+ * Note that "distance" in this function (as in the "update_view()" code)
+ * is defined as "MAX(dy,dx) + MIN(dy,dx)/2", which means that the player
+ * actually has an "octagon of projection" not a "circle of projection".
+ *
+ * The path grids are saved into the grid array pointed to by "gp", and
+ * there should be room for at least "range" grids in "gp". Note that
+ * due to the way in which distance is calculated, this function normally
+ * uses fewer than "range" grids for the projection path, so the result
+ * of this function should never be compared directly to "range". Note
+ * that the initial grid (y1,x1) is never saved into the grid array, not
+ * even if the initial grid is also the final grid.
+ *
+ * The "flg" flags can be used to modify the behavior of this function.
+ *
+ * In particular, the "PROJECT_STOP" and "PROJECT_THRU" flags have the same
+ * semantics as they do for the "project" function, namely, that the path
+ * will stop as soon as it hits a monster, or that the path will continue
+ * through the destination grid, respectively.
+ *
+ * The "PROJECT_JUMP" flag, which for the "project()" function means to
+ * start at a special grid (which makes no sense in this function), means
+ * that the path should be "angled" slightly if needed to avoid any wall
+ * grids, allowing the player to "target" any grid which is in "view".
+ * This flag is non-trivial and has not yet been implemented, but could
+ * perhaps make use of the "vinfo" array (above).
+ *
+ * This function returns the number of grids (if any) in the path. This
+ * function will return zero if and only if (y1,x1) and (y2,x2) are equal.
+ *
+ * This algorithm is similar to, but slightly different from, the one used
+ * by "update_view_los()", and very different from the one used by "los()".
+ * </pre>
+ */
+sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg)
+{
+ POSITION y, x;
+
+ int n = 0;
+ int k = 0;
+
+ /* Absolute */
+ POSITION ay, ax;
+
+ /* Offsets */
+ POSITION sy, sx;
+
+ /* Fractions */
+ int frac;
+
+ /* Scale factors */
+ int full, half;
+
+ /* Slope */
+ int m;
+
+ /* No path necessary (or allowed) */
+ if ((x1 == x2) && (y1 == y2)) return (0);
+
+
+ /* Analyze "dy" */
+ if (y2 < y1)
+ {
+ ay = (y1 - y2);
+ sy = -1;
+ }
+ else
+ {
+ ay = (y2 - y1);
+ sy = 1;
+ }
+
+ /* Analyze "dx" */
+ if (x2 < x1)
+ {
+ ax = (x1 - x2);
+ sx = -1;
+ }
+ else
+ {
+ ax = (x2 - x1);
+ sx = 1;
+ }
+
+
+ /* Number of "units" in one "half" grid */
+ half = (ay * ax);
+
+ /* Number of "units" in one "full" grid */
+ full = half << 1;
+
+ /* Vertical */
+ if (ay > ax)
+ {
+ /* Let m = ((dx/dy) * full) = (dx * dx * 2) */
+ m = ax * ax * 2;
+
+ /* Start */
+ y = y1 + sy;
+ x = x1;
+
+ frac = m;
+
+ if (frac > half)
+ {
+ /* Advance (X) part 2 */
+ x += sx;
+
+ /* Advance (X) part 3 */
+ frac -= full;
+
+ /* Track distance */
+ k++;
+ }
+
+ /* Create the projection path */
+ while (1)
+ {
+ /* Save grid */
+ gp[n++] = GRID(y, x);
+
+ /* Hack -- Check maximum range */
+ if ((n + (k >> 1)) >= range) break;
+
+ /* Sometimes stop at destination grid */
+ if (!(flg & (PROJECT_THRU)))
+ {
+ if ((x == x2) && (y == y2)) break;
+ }
+
+ if (flg & (PROJECT_DISI))
+ {
+ if ((n > 0) && cave_stop_disintegration(y, x)) break;
+ }
+ else if (flg & (PROJECT_LOS))
+ {
+ if ((n > 0) && !cave_los_bold(y, x)) break;
+ }
+ else if (!(flg & (PROJECT_PATH)))
+ {
+ /* Always stop at non-initial wall grids */
+ if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
+ }
+
+ /* Sometimes stop at non-initial monsters/players */
+ if (flg & (PROJECT_STOP))
+ {
+ if ((n > 0) &&
+ (player_bold(y, x) || current_floor_ptr->grid_array[y][x].m_idx != 0))
+ break;
+ }
+
+ if (!in_bounds(y, x)) break;
+
+ /* Slant */
+ if (m)
+ {
+ /* Advance (X) part 1 */
+ frac += m;
+
+ /* Horizontal change */
+ if (frac > half)
+ {
+ /* Advance (X) part 2 */
+ x += sx;
+
+ /* Advance (X) part 3 */
+ frac -= full;
+
+ /* Track distance */
+ k++;
+ }
+ }
+
+ /* Advance (Y) */
+ y += sy;
+ }
+ }
+
+ /* Horizontal */
+ else if (ax > ay)
+ {
+ /* Let m = ((dy/dx) * full) = (dy * dy * 2) */
+ m = ay * ay * 2;
+
+ /* Start */
+ y = y1;
+ x = x1 + sx;
+
+ frac = m;
+
+ /* Vertical change */
+ if (frac > half)
+ {
+ /* Advance (Y) part 2 */
+ y += sy;
+
+ /* Advance (Y) part 3 */
+ frac -= full;
+
+ /* Track distance */
+ k++;
+ }
+
+ /* Create the projection path */
+ while (1)
+ {
+ /* Save grid */
+ gp[n++] = GRID(y, x);
+
+ /* Hack -- Check maximum range */
+ if ((n + (k >> 1)) >= range) break;
+
+ /* Sometimes stop at destination grid */
+ if (!(flg & (PROJECT_THRU)))
+ {
+ if ((x == x2) && (y == y2)) break;
+ }
+
+ if (flg & (PROJECT_DISI))
+ {
+ if ((n > 0) && cave_stop_disintegration(y, x)) break;
+ }
+ else if (flg & (PROJECT_LOS))
+ {
+ if ((n > 0) && !cave_los_bold(y, x)) break;
+ }
+ else if (!(flg & (PROJECT_PATH)))
+ {
+ /* Always stop at non-initial wall grids */
+ if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
+ }
+
+ /* Sometimes stop at non-initial monsters/players */
+ if (flg & (PROJECT_STOP))
+ {
+ if ((n > 0) &&
+ (player_bold(y, x) || current_floor_ptr->grid_array[y][x].m_idx != 0))
+ break;
+ }
+
+ if (!in_bounds(y, x)) break;
+
+ /* Slant */
+ if (m)
+ {
+ /* Advance (Y) part 1 */
+ frac += m;
+
+ /* Vertical change */
+ if (frac > half)
+ {
+ /* Advance (Y) part 2 */
+ y += sy;
+
+ /* Advance (Y) part 3 */
+ frac -= full;
+
+ /* Track distance */
+ k++;
+ }
+ }
+
+ /* Advance (X) */
+ x += sx;
+ }
+ }
+
+ /* Diagonal */
+ else
+ {
+ /* Start */
+ y = y1 + sy;
+ x = x1 + sx;
+
+ /* Create the projection path */
+ while (1)
+ {
+ /* Save grid */
+ gp[n++] = GRID(y, x);
+
+ /* Hack -- Check maximum range */
+ if ((n + (n >> 1)) >= range) break;
+
+ /* Sometimes stop at destination grid */
+ if (!(flg & (PROJECT_THRU)))
+ {
+ if ((x == x2) && (y == y2)) break;
+ }
+
+ if (flg & (PROJECT_DISI))
+ {
+ if ((n > 0) && cave_stop_disintegration(y, x)) break;
+ }
+ else if (flg & (PROJECT_LOS))
+ {
+ if ((n > 0) && !cave_los_bold(y, x)) break;
+ }
+ else if (!(flg & (PROJECT_PATH)))
+ {
+ /* Always stop at non-initial wall grids */
+ if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
+ }
+
+ /* Sometimes stop at non-initial monsters/players */
+ if (flg & (PROJECT_STOP))
+ {
+ if ((n > 0) &&
+ (player_bold(y, x) || current_floor_ptr->grid_array[y][x].m_idx != 0))
+ break;
+ }
+
+ if (!in_bounds(y, x)) break;
+
+ /* Advance (Y) */
+ y += sy;
+
+ /* Advance (X) */
+ x += sx;
+ }
+ }
+
+ /* Length */
+ return (n);
+}
+
+/*
+ * Determine if a bolt spell cast from (y1,x1) to (y2,x2) will arrive
+ * at the final destination, assuming no monster gets in the way.
+ *
+ * This is slightly (but significantly) different from "los(y1,x1,y2,x2)".
+ */
+bool projectable(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
+{
+ POSITION y, x;
+
+ int grid_n = 0;
+ u16b grid_g[512];
+
+ /* Check the projection path */
+ grid_n = project_path(grid_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, 0);
+
+ /* Identical grid */
+ if (!grid_n) return TRUE;
+
+ /* Final grid */
+ y = GRID_Y(grid_g[grid_n - 1]);
+ x = GRID_X(grid_g[grid_n - 1]);
+
+ /* May not end in an unrequested grid */
+ if ((y != y2) || (x != x2)) return (FALSE);
+
+ /* Assume okay */
+ return (TRUE);
+}
#pragma once
-DIRECTION coords_to_dir(POSITION y, POSITION x);
+extern DIRECTION coords_to_dir(POSITION y, POSITION x);
+
+/*
+ * project()関数に用いられる、遠隔攻撃特性ビットフラグ / Bit flags for the "project()" function
+ */
+#define PROJECT_JUMP 0x0001 /*!< 遠隔攻撃特性: 発動者からの軌跡を持たず、指定地点に直接発生する(予め置いたトラップ、上空からの発生などのイメージ) / Jump directly to the target location (this is a hack) */
+#define PROJECT_BEAM 0x0002 /*!< 遠隔攻撃特性: ビーム範囲を持つ。 / Work as a beam weapon (affect every grid passed through) */
+#define PROJECT_THRU 0x0004 /*!< 遠隔攻撃特性: 目標地点に到達しても射程と遮蔽の限り引き延ばす。 / Continue "through" the target (used for "bolts"/"beams") */
+#define PROJECT_STOP 0x0008 /*!< 遠隔攻撃特性: 道中にプレイヤーかモンスターがいた時点で到達地点を更新して停止する(壁や森はPROJECT_DISIがない限り最初から貫通しない) */
+#define PROJECT_GRID 0x0010 /*!< 遠隔攻撃特性: 射程内の地形に影響を及ぼす / Affect each grid in the "blast area" in some way */
+#define PROJECT_ITEM 0x0020 /*!< 遠隔攻撃特性: 射程内のアイテムに影響を及ぼす / Affect each object in the "blast area" in some way */
+#define PROJECT_KILL 0x0040 /*!< 遠隔攻撃特性: 射程内のモンスターに影響を及ぼす / Affect each monster in the "blast area" in some way */
+#define PROJECT_HIDE 0x0080 /*!< 遠隔攻撃特性: / Hack -- disable "visual" feedback from projection */
+#define PROJECT_DISI 0x0100 /*!< 遠隔攻撃特性: / Disintegrate non-permanent features */
+#define PROJECT_PLAYER 0x0200 /*!< 遠隔攻撃特性: / Main target is player (used for riding player) */
+#define PROJECT_AIMED 0x0400 /*!< 遠隔攻撃特性: / Target is only player or monster, so don't affect another. Depend on PROJECT_PLAYER. (used for minimum (rad == 0) balls on riding player) */
+#define PROJECT_REFLECTABLE 0x0800 /*!< 遠隔攻撃特性: 反射可能(ボルト系魔法に利用) / Refrectable spell attacks (used for "bolts") */
+#define PROJECT_NO_HANGEKI 0x1000 /*!< 遠隔攻撃特性: / Avoid counter attacks of monsters */
+#define PROJECT_PATH 0x2000 /*!< 遠隔攻撃特性: / Only used for printing project path */
+#define PROJECT_FAST 0x4000 /*!< 遠隔攻撃特性: / Hide "visual" of flying bolts until blast */
+#define PROJECT_LOS 0x8000 /*!< 遠隔攻撃特性: / */
+extern sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg);
+
+extern bool projectable(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
//!< 対象グリッドの一覧をまとめる構造体
typedef struct
#include "angband.h"
#include "world.h"
-#include "projection.h"
#include "object-hook.h"
#include "generate.h"
#include "grid.h"
/*
- * Determine if a bolt spell cast from (y1,x1) to (y2,x2) will arrive
- * at the final destination, assuming no monster gets in the way.
- *
- * This is slightly (but significantly) different from "los(y1,x1,y2,x2)".
- */
-bool projectable(POSITION y1, POSITION x1, POSITION y2, POSITION x2)
-{
- POSITION y, x;
-
- int grid_n = 0;
- u16b grid_g[512];
-
- /* Check the projection path */
- grid_n = project_path(grid_g, (project_length ? project_length : MAX_RANGE), y1, x1, y2, x2, 0);
-
- /* Identical grid */
- if (!grid_n) return TRUE;
-
- /* Final grid */
- y = GRID_Y(grid_g[grid_n - 1]);
- x = GRID_X(grid_g[grid_n - 1]);
-
- /* May not end in an unrequested grid */
- if ((y != y2) || (x != x2)) return (FALSE);
-
- /* Assume okay */
- return (TRUE);
-}
-
-
-/*
* Standard "find me a location" function
*
* Obtains a legal location within the given distance of the initial
#include "player-damage.h"
#include "monsterrace-hook.h"
#include "melee.h"
-#include "projection.h"
#include "monster.h"
#include "monster-status.h"
#include "monster-spell.h"
#include "angband.h"
#include "melee.h"
-#include "projection.h"
#include "spells-summon.h"
#include "avatar.h"
#include "player-status.h"
#include "cmd-pet.h"
#include "monsterrace-hook.h"
#include "melee.h"
-#include "projection.h"
#include "spells-summon.h"
#include "quest.h"
#include "avatar.h"
#include "cmd-pet.h"
#include "monsterrace-hook.h"
#include "objectkind-hook.h"
-#include "projection.h"
#include "monster.h"
#include "monster-spell.h"
#include "spells-summon.h"
#include "cmd-pet.h"
#include "monsterrace-hook.h"
#include "monster-status.h"
-#include "projection.h"
#include "monster.h"
#include "spells-summon.h"
#include "quest.h"
#include "angband.h"
#include "object-curse.h"
-#include "projection.h"
#include "quest.h"
#include "realm-hex.h"
#include "player-move.h"
*/
#include "angband.h"
-#include "projection.h"
#include "quest.h"
#include "realm-hex.h"
#include "player-move.h"
#include "angband.h"
#include "spells-summon.h"
-#include "projection.h"
#include "avatar.h"
#include "spells-status.h"
#include "cmd-spell.h"
#include "angband.h"
-#include "projection.h"
#include "spells-summon.h"
#include "artifact.h"
#include "player-status.h"
#include "angband.h"
-#include "projection.h"
/*!
* @brief 薬の破損効果処理 /
#include "melee.h"
#include "grid.h"
#include "trap.h"
-#include "projection.h"
#include "quest.h"
#include "artifact.h"
#include "player-move.h"
+++ /dev/null
-#include "angband.h"
-#include "projection.h"
-
-/*!
- * @brief 始点から終点への経路を返す /
- * Determine the path taken by a projection.
- * @param gp 経路座標リストを返す参照ポインタ
- * @param range 距離
- * @param y1 始点Y座標
- * @param x1 始点X座標
- * @param y2 終点Y座標
- * @param x2 終点X座標
- * @param flg フラグID
- * @return リストの長さ
- * @details
- * <pre>
- * The projection will always start from the grid (y1,x1), and will travel
- * towards the grid (y2,x2), touching one grid per unit of distance along
- * the major axis, and stopping when it enters the destination grid or a
- * wall grid, or has travelled the maximum legal distance of "range".
- *
- * Note that "distance" in this function (as in the "update_view()" code)
- * is defined as "MAX(dy,dx) + MIN(dy,dx)/2", which means that the player
- * actually has an "octagon of projection" not a "circle of projection".
- *
- * The path grids are saved into the grid array pointed to by "gp", and
- * there should be room for at least "range" grids in "gp". Note that
- * due to the way in which distance is calculated, this function normally
- * uses fewer than "range" grids for the projection path, so the result
- * of this function should never be compared directly to "range". Note
- * that the initial grid (y1,x1) is never saved into the grid array, not
- * even if the initial grid is also the final grid.
- *
- * The "flg" flags can be used to modify the behavior of this function.
- *
- * In particular, the "PROJECT_STOP" and "PROJECT_THRU" flags have the same
- * semantics as they do for the "project" function, namely, that the path
- * will stop as soon as it hits a monster, or that the path will continue
- * through the destination grid, respectively.
- *
- * The "PROJECT_JUMP" flag, which for the "project()" function means to
- * start at a special grid (which makes no sense in this function), means
- * that the path should be "angled" slightly if needed to avoid any wall
- * grids, allowing the player to "target" any grid which is in "view".
- * This flag is non-trivial and has not yet been implemented, but could
- * perhaps make use of the "vinfo" array (above).
- *
- * This function returns the number of grids (if any) in the path. This
- * function will return zero if and only if (y1,x1) and (y2,x2) are equal.
- *
- * This algorithm is similar to, but slightly different from, the one used
- * by "update_view_los()", and very different from the one used by "los()".
- * </pre>
- */
-sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg)
-{
- POSITION y, x;
-
- int n = 0;
- int k = 0;
-
- /* Absolute */
- POSITION ay, ax;
-
- /* Offsets */
- POSITION sy, sx;
-
- /* Fractions */
- int frac;
-
- /* Scale factors */
- int full, half;
-
- /* Slope */
- int m;
-
- /* No path necessary (or allowed) */
- if ((x1 == x2) && (y1 == y2)) return (0);
-
-
- /* Analyze "dy" */
- if (y2 < y1)
- {
- ay = (y1 - y2);
- sy = -1;
- }
- else
- {
- ay = (y2 - y1);
- sy = 1;
- }
-
- /* Analyze "dx" */
- if (x2 < x1)
- {
- ax = (x1 - x2);
- sx = -1;
- }
- else
- {
- ax = (x2 - x1);
- sx = 1;
- }
-
-
- /* Number of "units" in one "half" grid */
- half = (ay * ax);
-
- /* Number of "units" in one "full" grid */
- full = half << 1;
-
- /* Vertical */
- if (ay > ax)
- {
- /* Let m = ((dx/dy) * full) = (dx * dx * 2) */
- m = ax * ax * 2;
-
- /* Start */
- y = y1 + sy;
- x = x1;
-
- frac = m;
-
- if (frac > half)
- {
- /* Advance (X) part 2 */
- x += sx;
-
- /* Advance (X) part 3 */
- frac -= full;
-
- /* Track distance */
- k++;
- }
-
- /* Create the projection path */
- while (1)
- {
- /* Save grid */
- gp[n++] = GRID(y, x);
-
- /* Hack -- Check maximum range */
- if ((n + (k >> 1)) >= range) break;
-
- /* Sometimes stop at destination grid */
- if (!(flg & (PROJECT_THRU)))
- {
- if ((x == x2) && (y == y2)) break;
- }
-
- if (flg & (PROJECT_DISI))
- {
- if ((n > 0) && cave_stop_disintegration(y, x)) break;
- }
- else if (flg & (PROJECT_LOS))
- {
- if ((n > 0) && !cave_los_bold(y, x)) break;
- }
- else if (!(flg & (PROJECT_PATH)))
- {
- /* Always stop at non-initial wall grids */
- if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
- }
-
- /* Sometimes stop at non-initial monsters/players */
- if (flg & (PROJECT_STOP))
- {
- if ((n > 0) &&
- (player_bold(y, x) || current_floor_ptr->grid_array[y][x].m_idx != 0))
- break;
- }
-
- if (!in_bounds(y, x)) break;
-
- /* Slant */
- if (m)
- {
- /* Advance (X) part 1 */
- frac += m;
-
- /* Horizontal change */
- if (frac > half)
- {
- /* Advance (X) part 2 */
- x += sx;
-
- /* Advance (X) part 3 */
- frac -= full;
-
- /* Track distance */
- k++;
- }
- }
-
- /* Advance (Y) */
- y += sy;
- }
- }
-
- /* Horizontal */
- else if (ax > ay)
- {
- /* Let m = ((dy/dx) * full) = (dy * dy * 2) */
- m = ay * ay * 2;
-
- /* Start */
- y = y1;
- x = x1 + sx;
-
- frac = m;
-
- /* Vertical change */
- if (frac > half)
- {
- /* Advance (Y) part 2 */
- y += sy;
-
- /* Advance (Y) part 3 */
- frac -= full;
-
- /* Track distance */
- k++;
- }
-
- /* Create the projection path */
- while (1)
- {
- /* Save grid */
- gp[n++] = GRID(y, x);
-
- /* Hack -- Check maximum range */
- if ((n + (k >> 1)) >= range) break;
-
- /* Sometimes stop at destination grid */
- if (!(flg & (PROJECT_THRU)))
- {
- if ((x == x2) && (y == y2)) break;
- }
-
- if (flg & (PROJECT_DISI))
- {
- if ((n > 0) && cave_stop_disintegration(y, x)) break;
- }
- else if (flg & (PROJECT_LOS))
- {
- if ((n > 0) && !cave_los_bold(y, x)) break;
- }
- else if (!(flg & (PROJECT_PATH)))
- {
- /* Always stop at non-initial wall grids */
- if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
- }
-
- /* Sometimes stop at non-initial monsters/players */
- if (flg & (PROJECT_STOP))
- {
- if ((n > 0) &&
- (player_bold(y, x) || current_floor_ptr->grid_array[y][x].m_idx != 0))
- break;
- }
-
- if (!in_bounds(y, x)) break;
-
- /* Slant */
- if (m)
- {
- /* Advance (Y) part 1 */
- frac += m;
-
- /* Vertical change */
- if (frac > half)
- {
- /* Advance (Y) part 2 */
- y += sy;
-
- /* Advance (Y) part 3 */
- frac -= full;
-
- /* Track distance */
- k++;
- }
- }
-
- /* Advance (X) */
- x += sx;
- }
- }
-
- /* Diagonal */
- else
- {
- /* Start */
- y = y1 + sy;
- x = x1 + sx;
-
- /* Create the projection path */
- while (1)
- {
- /* Save grid */
- gp[n++] = GRID(y, x);
-
- /* Hack -- Check maximum range */
- if ((n + (n >> 1)) >= range) break;
-
- /* Sometimes stop at destination grid */
- if (!(flg & (PROJECT_THRU)))
- {
- if ((x == x2) && (y == y2)) break;
- }
-
- if (flg & (PROJECT_DISI))
- {
- if ((n > 0) && cave_stop_disintegration(y, x)) break;
- }
- else if (flg & (PROJECT_LOS))
- {
- if ((n > 0) && !cave_los_bold(y, x)) break;
- }
- else if (!(flg & (PROJECT_PATH)))
- {
- /* Always stop at non-initial wall grids */
- if ((n > 0) && !cave_have_flag_bold(y, x, FF_PROJECT)) break;
- }
-
- /* Sometimes stop at non-initial monsters/players */
- if (flg & (PROJECT_STOP))
- {
- if ((n > 0) &&
- (player_bold(y, x) || current_floor_ptr->grid_array[y][x].m_idx != 0))
- break;
- }
-
- if (!in_bounds(y, x)) break;
-
- /* Advance (Y) */
- y += sy;
-
- /* Advance (X) */
- x += sx;
- }
- }
-
- /* Length */
- return (n);
-}
-
+++ /dev/null
-/*
- * project()関数に用いられる、遠隔攻撃特性ビットフラグ / Bit flags for the "project()" function
- */
-#define PROJECT_JUMP 0x0001 /*!< 遠隔攻撃特性: 発動者からの軌跡を持たず、指定地点に直接発生する(予め置いたトラップ、上空からの発生などのイメージ) / Jump directly to the target location (this is a hack) */
-#define PROJECT_BEAM 0x0002 /*!< 遠隔攻撃特性: ビーム範囲を持つ。 / Work as a beam weapon (affect every grid passed through) */
-#define PROJECT_THRU 0x0004 /*!< 遠隔攻撃特性: 目標地点に到達しても射程と遮蔽の限り引き延ばす。 / Continue "through" the target (used for "bolts"/"beams") */
-#define PROJECT_STOP 0x0008 /*!< 遠隔攻撃特性: 道中にプレイヤーかモンスターがいた時点で到達地点を更新して停止する(壁や森はPROJECT_DISIがない限り最初から貫通しない) */
-#define PROJECT_GRID 0x0010 /*!< 遠隔攻撃特性: 射程内の地形に影響を及ぼす / Affect each grid in the "blast area" in some way */
-#define PROJECT_ITEM 0x0020 /*!< 遠隔攻撃特性: 射程内のアイテムに影響を及ぼす / Affect each object in the "blast area" in some way */
-#define PROJECT_KILL 0x0040 /*!< 遠隔攻撃特性: 射程内のモンスターに影響を及ぼす / Affect each monster in the "blast area" in some way */
-#define PROJECT_HIDE 0x0080 /*!< 遠隔攻撃特性: / Hack -- disable "visual" feedback from projection */
-#define PROJECT_DISI 0x0100 /*!< 遠隔攻撃特性: / Disintegrate non-permanent features */
-#define PROJECT_PLAYER 0x0200 /*!< 遠隔攻撃特性: / Main target is player (used for riding player) */
-#define PROJECT_AIMED 0x0400 /*!< 遠隔攻撃特性: / Target is only player or monster, so don't affect another. Depend on PROJECT_PLAYER. (used for minimum (rad == 0) balls on riding player) */
-#define PROJECT_REFLECTABLE 0x0800 /*!< 遠隔攻撃特性: 反射可能(ボルト系魔法に利用) / Refrectable spell attacks (used for "bolts") */
-#define PROJECT_NO_HANGEKI 0x1000 /*!< 遠隔攻撃特性: / Avoid counter attacks of monsters */
-#define PROJECT_PATH 0x2000 /*!< 遠隔攻撃特性: / Only used for printing project path */
-#define PROJECT_FAST 0x4000 /*!< 遠隔攻撃特性: / Hide "visual" of flying bolts until blast */
-#define PROJECT_LOS 0x8000 /*!< 遠隔攻撃特性: / */
-
-extern sint project_path(u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg);
#include "angband.h"
#include "cmd-spell.h"
-#include "projection.h"
#include "avatar.h"
#include "spells-floor.h"
#include "cmd-spell.h"
#include "spells-summon.h"
#include "spells-status.h"
-#include "projection.h"
/*!
* @brief カオス領域魔法の各処理を行う
#include "angband.h"
#include "cmd-spell.h"
#include "selfinfo.h"
-#include "projection.h"
#include "spells-object.h"
#include "spells-summon.h"
#include "spells-status.h"
#include "angband.h"
#include "cmd-spell.h"
#include "spells-summon.h"
-#include "projection.h"
#include "spells-status.h"
#include "cmd-spell.h"
#include "spells-summon.h"
#include "spells-status.h"
-#include "projection.h"
/*!
* @brief 悪魔領域魔法の各処理を行う
#include "angband.h"
#include "cmd-spell.h"
-#include "projection.h"
#include "spells-summon.h"
#include "spells-status.h"
#include "avatar.h"
#include "cmd-quaff.h"
#include "object-hook.h"
#include "object-curse.h"
-#include "projection.h"
#include "spells-status.h"
#include "player-status.h"
#include "cmd-spell.h"
#include "melee.h"
#include "monsterrace-hook.h"
-#include "projection.h"
#include "artifact.h"
#include "monster.h"
#include "player-status.h"
#include "angband.h"
#include "cmd-spell.h"
-#include "projection.h"
#include "spells-status.h"
#include "spells-floor.h"
#include "angband.h"
#include "cmd-spell.h"
-#include "projection.h"
#include "spells-summon.h"
#include "spells-status.h"
#include "spells-object.h"
#include "angband.h"
#include "cmd-spell.h"
#include "spells-status.h"
-#include "projection.h"
#include "spells-floor.h"
/*!
#include "angband.h"
#include "cmd-spell.h"
#include "selfinfo.h"
-#include "projection.h"
#include "avatar.h"
#include "spells-status.h"
#include "spells-floor.h"
#include "angband.h"
#include "cmd-spell.h"
-#include "projection.h"
#include "spells-summon.h"
#include "mutation.h"
#include "spells-status.h"
#include "angband.h"
-#include "projection.h"
#include "monster.h"
#include "monster-status.h"
#include "monster-spell.h"
#include "monster.h"
#include "monsterrace-hook.h"
#include "mutation.h"
-#include "projection.h"
#include "rooms.h"
#include "avatar.h"
#include "player-status.h"
#include "spells-status.h"
-#include "projection.h"
#include "spells.h"
#include "monster.h"
#include "melee.h"
#include "world.h"
-#include "projection.h"
#include "mutation.h"
#include "rooms.h"
#include "artifact.h"
#include "monsterrace-hook.h"
#include "melee.h"
#include "world.h"
-#include "projection.h"
#include "spells-summon.h"
#include "mutation.h"
#include "quest.h"
#include "object-hook.h"
#include "melee.h"
#include "player-status.h"
-#include "projection.h"
#include "spells-summon.h"
#include "quest.h"
#include "artifact.h"
#include "trap.h"
#include "player-damage.h"
#include "player-move.h"
-#include "projection.h"
#include "spells-summon.h"
#include "quest.h"
#include "artifact.h"
#include "monsterrace-hook.h"
#include "objectkind-hook.h"
#include "sort.h"
-#include "projection.h"
#include "spells-summon.h"
#include "floor-events.h"
#include "player-move.h"