OSDN Git Service
(root)
/
hengband
/
hengband.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[Refactor] #37353 ゲームバランス定数を gamevalue.h へ整理。 / Move constant value in game to gameva...
[hengband/hengband.git]
/
src
/
mspells2.c
diff --git
a/src/mspells2.c
b/src/mspells2.c
index
e094c63
..
07b2d5a
100644
(file)
--- a/
src/mspells2.c
+++ b/
src/mspells2.c
@@
-73,28
+73,28
@@
static bool direct_beam(int y1, int x1, int y2, int x2, monster_type *m_ptr)
* @param is_friend TRUEならば、プレイヤーを巻き込む時にブレスの判定をFALSEにする。
* @return ブレスを直接当てられるならばTRUEを返す
*/
* @param is_friend TRUEならば、プレイヤーを巻き込む時にブレスの判定をFALSEにする。
* @return ブレスを直接当てられるならばTRUEを返す
*/
-static bool breath_direct(
int y1, int x1, int y2, int x2, int
rad, int typ, bool is_friend)
+static bool breath_direct(
POSITION y1, POSITION x1, POSITION y2, POSITION x2, POSITION
rad, int typ, bool is_friend)
{
/* Must be the same as projectable() */
int i;
/* Initial grid */
{
/* Must be the same as projectable() */
int i;
/* Initial grid */
-
int
y = y1;
-
int
x = x1;
+
POSITION
y = y1;
+
POSITION
x = x1;
int grid_n = 0;
u16b grid_g[512];
int grids = 0;
int grid_n = 0;
u16b grid_g[512];
int grids = 0;
-
byte
gx[1024], gy[1024];
-
byte
gm[32];
-
int
gm_rad = rad;
+
POSITION
gx[1024], gy[1024];
+
POSITION
gm[32];
+
POSITION
gm_rad = rad;
bool hit2 = FALSE;
bool hityou = FALSE;
bool hit2 = FALSE;
bool hityou = FALSE;
-
int
flg;
+
BIT_FLAGS
flg;
switch (typ)
{
switch (typ)
{
@@
-147,17
+147,17
@@
static bool breath_direct(int y1, int x1, int y2, int x2, int rad, int typ, bool
if (flg & PROJECT_DISI)
{
if (in_disintegration_range(y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
if (flg & PROJECT_DISI)
{
if (in_disintegration_range(y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
- if (in_disintegration_range(y1, x1, p
y, px) && (distance(y1, x1, py, p
x) <= rad)) hityou = TRUE;
+ if (in_disintegration_range(y1, x1, p
_ptr->y, p_ptr->x) && (distance(y1, x1, p_ptr->y, p_ptr->
x) <= rad)) hityou = TRUE;
}
else if (flg & PROJECT_LOS)
{
if (los(y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
}
else if (flg & PROJECT_LOS)
{
if (los(y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
- if (los(y1, x1, p
y, px) && (distance(y1, x1, py, p
x) <= rad)) hityou = TRUE;
+ if (los(y1, x1, p
_ptr->y, p_ptr->x) && (distance(y1, x1, p_ptr->y, p_ptr->
x) <= rad)) hityou = TRUE;
}
else
{
if (projectable(y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
}
else
{
if (projectable(y1, x1, y2, x2) && (distance(y1, x1, y2, x2) <= rad)) hit2 = TRUE;
- if (projectable(y1, x1, p
y, px) && (distance(y1, x1, py, p
x) <= rad)) hityou = TRUE;
+ if (projectable(y1, x1, p
_ptr->y, p_ptr->x) && (distance(y1, x1, p_ptr->y, p_ptr->
x) <= rad)) hityou = TRUE;
}
}
else
}
}
else
@@
-191,7
+191,7
@@
static bool breath_direct(int y1, int x1, int y2, int x2, int rad, int typ, bool
* @param flg 判定のフラグ配列
* @return なし
*/
* @param flg 判定のフラグ配列
* @return なし
*/
-void get_project_point(int sy, int sx, int *ty, int *tx,
int
flg)
+void get_project_point(int sy, int sx, int *ty, int *tx,
BIT_FLAGS
flg)
{
u16b path_g[128];
int path_n, i;
{
u16b path_g[128];
int path_n, i;
@@
-222,7
+222,7
@@
void get_project_point(int sy, int sx, int *ty, int *tx, int flg)
* @param t_idx 目標のモンスターID
* @return 魔力消去を使うべきならばTRUEを変えす。
*/
* @param t_idx 目標のモンスターID
* @return 魔力消去を使うべきならばTRUEを変えす。
*/
-static bool dispel_check_monster(
int m_idx, int
t_idx)
+static bool dispel_check_monster(
MONSTER_IDX m_idx, IDX
t_idx)
{
monster_type *t_ptr = &m_list[t_idx];
{
monster_type *t_ptr = &m_list[t_idx];
@@
-253,15
+253,15
@@
static bool dispel_check_monster(int m_idx, int t_idx)
* @details
* The player is only disturbed if able to be affected by the spell.
*/
* @details
* The player is only disturbed if able to be affected by the spell.
*/
-bool monst_spell_monst(
int
m_idx)
+bool monst_spell_monst(
MONSTER_IDX
m_idx)
{
{
- int y = 0, x = 0;
- int i, k, t_idx = 0;
- int thrown_spell, count = 0;
- int dam = 0;
+ POSITION y = 0, x = 0;
+ int i, k;
+ MONSTER_IDX t_idx = 0;
+ int thrown_spell;
+ HIT_POINT dam = 0;
int start;
int plus = 1;
int start;
int plus = 1;
- int rad = 0; //For elemental balls
byte spell[96], num = 0;
byte spell[96], num = 0;
@@
-276,32
+276,26
@@
bool monst_spell_monst(int m_idx)
monster_type *t_ptr = NULL;
monster_race *r_ptr = &r_info[m_ptr->r_idx];
monster_type *t_ptr = NULL;
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- monster_race *tr_ptr = NULL;
u32b f4, f5, f6;
bool see_m = is_seen(m_ptr);
bool maneable = player_has_los_bold(m_ptr->fy, m_ptr->fx);
u32b f4, f5, f6;
bool see_m = is_seen(m_ptr);
bool maneable = player_has_los_bold(m_ptr->fy, m_ptr->fx);
- bool see_t;
- bool see_either;
bool pet = is_pet(m_ptr);
bool in_no_magic_dungeon = (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && dun_level
&& (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest));
bool can_use_lite_area = FALSE;
bool pet = is_pet(m_ptr);
bool in_no_magic_dungeon = (d_info[dungeon_type].flags1 & DF1_NO_MAGIC) && dun_level
&& (!p_ptr->inside_quest || is_fixed_quest_idx(p_ptr->inside_quest));
bool can_use_lite_area = FALSE;
-
bool can_remember;
bool can_remember;
- bool resists_tele = FALSE;
-
/* Cannot cast spells when confused */
if (MON_CONFUSED(m_ptr)) return (FALSE);
/* Extract the racial spell flags */
f4 = r_ptr->flags4;
/* Cannot cast spells when confused */
if (MON_CONFUSED(m_ptr)) return (FALSE);
/* Extract the racial spell flags */
f4 = r_ptr->flags4;
- f5 = r_ptr->
flags5
;
- f6 = r_ptr->
flags6
;
+ f5 = r_ptr->
a_ability_flags1
;
+ f6 = r_ptr->
a_ability_flags2
;
/* Target is given for pet? */
if (pet_t_m_idx && pet)
/* Target is given for pet? */
if (pet_t_m_idx && pet)
@@
-357,7
+351,7
@@
bool monst_spell_monst(int m_idx)
/* Scan thru all monsters */
for (i = start; ((i < start + m_max) && (i > start - m_max)); i += plus)
{
/* Scan thru all monsters */
for (i = start; ((i < start + m_max) && (i > start - m_max)); i += plus)
{
-
int
dummy = (i % m_max);
+
MONSTER_IDX
dummy = (i % m_max);
if (!dummy) continue;
t_idx = dummy;
if (!dummy) continue;
t_idx = dummy;
@@
-385,7
+379,6
@@
bool monst_spell_monst(int m_idx)
/* OK -- we've got a target */
y = t_ptr->fy;
x = t_ptr->fx;
/* OK -- we've got a target */
y = t_ptr->fy;
x = t_ptr->fx;
- tr_ptr = &r_info[t_ptr->r_idx];
/* Forget old counter attack target */
reset_target(m_ptr);
/* Forget old counter attack target */
reset_target(m_ptr);
@@
-486,9
+479,9
@@
bool monst_spell_monst(int m_idx)
get_project_point(m_ptr->fy, m_ptr->fx, &real_y, &real_x, 0L);
get_project_point(m_ptr->fy, m_ptr->fx, &real_y, &real_x, 0L);
- if (projectable(real_y, real_x, p
y, p
x))
+ if (projectable(real_y, real_x, p
_ptr->y, p_ptr->
x))
{
{
- int dist = distance(real_y, real_x, p
y, p
x);
+ int dist = distance(real_y, real_x, p
_ptr->y, p_ptr->
x);
if (dist <= 2)
{
if (dist <= 2)
{
@@
-505,7
+498,7
@@
bool monst_spell_monst(int m_idx)
}
else if (f5 & RF5_BA_LITE)
{
}
else if (f5 & RF5_BA_LITE)
{
- if ((distance(real_y, real_x, p
y, px) <= 4) && los(real_y, real_x, py, p
x))
+ if ((distance(real_y, real_x, p
_ptr->y, p_ptr->x) <= 4) && los(real_y, real_x, p_ptr->y, p_ptr->
x))
f5 &= ~(RF5_BA_LITE);
}
}
f5 &= ~(RF5_BA_LITE);
}
}
@@
-516,7
+509,7
@@
bool monst_spell_monst(int m_idx)
int real_x = x;
get_project_point(m_ptr->fy, m_ptr->fx, &real_y, &real_x, PROJECT_STOP);
int real_x = x;
get_project_point(m_ptr->fy, m_ptr->fx, &real_y, &real_x, PROJECT_STOP);
- if (projectable(real_y, real_x, p
y, px) && (distance(real_y, real_x, py, p
x) <= 2))
+ if (projectable(real_y, real_x, p
_ptr->y, p_ptr->x) && (distance(real_y, real_x, p_ptr->y, p_ptr->
x) <= 2))
f4 &= ~(RF4_ROCKET);
}
f4 &= ~(RF4_ROCKET);
}
@@
-687,9
+680,6
@@
bool monst_spell_monst(int m_idx)
/* Choose a spell to cast */
thrown_spell = spell[randint0(num)];
/* Choose a spell to cast */
thrown_spell = spell[randint0(num)];
- see_t = is_seen(t_ptr);
- see_either = (see_m || see_t);
-
if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(1, 1);
/* Check for spell failure (inate attacks never fail) */
if (p_ptr->riding && (m_idx == p_ptr->riding)) disturb(1, 1);
/* Check for spell failure (inate attacks never fail) */