X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Frealm-hissatsu.c;h=e4534ea9c745c6548b1907400222ebab23844f2b;hb=3b87c7250e7a560a11398daa278da2018efaeff8;hp=869d61bdc3f51104783ee52c213afa374d31d56b;hpb=5ea5eeb6855a970c60a14bdbeda93bdfdb1121c6;p=hengband%2Fhengband.git diff --git a/src/realm-hissatsu.c b/src/realm-hissatsu.c index 869d61bdc..e4534ea9c 100644 --- a/src/realm-hissatsu.c +++ b/src/realm-hissatsu.c @@ -4,6 +4,8 @@ #include "monsterrace-hook.h" #include "projection.h" #include "artifact.h" +#include "player-status.h" +#include "feature.h" /*! * @brief 剣術の各処理を行う @@ -56,21 +58,21 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) y = p_ptr->y + ddy_cdd[cdir]; x = p_ptr->x + ddx_cdd[cdir]; - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) py_attack(y, x, 0); else msg_print(_("攻撃は空を切った。", "You attack the empty air.")); y = p_ptr->y + ddy_cdd[(cdir + 7) % 8]; x = p_ptr->x + ddx_cdd[(cdir + 7) % 8]; - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) py_attack(y, x, 0); else msg_print(_("攻撃は空を切った。", "You attack the empty air.")); y = p_ptr->y + ddy_cdd[(cdir + 1) % 8]; x = p_ptr->x + ddx_cdd[(cdir + 1) % 8]; - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) py_attack(y, x, 0); else msg_print(_("攻撃は空を切った。", "You attack the empty air.")); @@ -102,7 +104,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) py_attack(y, x, HISSATSU_FIRE); else { @@ -136,7 +138,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) py_attack(y, x, HISSATSU_MINEUCHI); else { @@ -184,7 +186,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - if (!cave[y][x].m_idx) + if (!current_floor_ptr->grid_array[y][x].m_idx) { msg_print(_("その方向にはモンスターはいません。", "There is no monster.")); return NULL; @@ -192,17 +194,15 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) py_attack(y, x, 0); - if (!player_can_enter(cave[y][x].feat, 0) || is_trap(cave[y][x].feat)) + if (!player_can_enter(current_floor_ptr->grid_array[y][x].feat, 0) || is_trap(current_floor_ptr->grid_array[y][x].feat)) break; y += ddy[dir]; x += ddx[dir]; - if (player_can_enter(cave[y][x].feat, 0) && !is_trap(cave[y][x].feat) && !cave[y][x].m_idx) + if (player_can_enter(current_floor_ptr->grid_array[y][x].feat, 0) && !is_trap(current_floor_ptr->grid_array[y][x].feat) && !current_floor_ptr->grid_array[y][x].m_idx) { msg_print(NULL); - - /* Move the player */ (void)move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP); } } @@ -222,7 +222,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) py_attack(y, x, HISSATSU_POISON); else { @@ -247,7 +247,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) py_attack(y, x, HISSATSU_ZANMA); else { @@ -271,24 +271,24 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) py_attack(y, x, 0); else { msg_print(_("その方向にはモンスターはいません。", "There is no monster.")); return NULL; } - if (d_info[dungeon_type].flags1 & DF1_NO_MELEE) + if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MELEE) { return ""; } - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) { int i; POSITION ty = y, tx = x; POSITION oy = y, ox = x; - MONSTER_IDX m_idx = cave[y][x].m_idx; - monster_type *m_ptr = &m_list[m_idx]; + MONSTER_IDX m_idx = current_floor_ptr->grid_array[y][x].m_idx; + monster_type *m_ptr = ¤t_floor_ptr->m_list[m_idx]; GAME_TEXT m_name[MAX_NLEN]; monster_desc(m_name, m_ptr, 0); @@ -307,8 +307,8 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) if ((ty != oy) || (tx != ox)) { msg_format(_("%sを吹き飛ばした!", "You blow %s away!"), m_name); - cave[oy][ox].m_idx = 0; - cave[ty][tx].m_idx = m_idx; + current_floor_ptr->grid_array[oy][ox].m_idx = 0; + current_floor_ptr->grid_array[ty][tx].m_idx = m_idx; m_ptr->fy = ty; m_ptr->fx = tx; @@ -355,7 +355,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) py_attack(y, x, HISSATSU_HAGAN); if (!cave_have_flag_bold(y, x, FF_HURT_ROCK)) break; @@ -383,7 +383,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) py_attack(y, x, HISSATSU_COLD); else { @@ -408,7 +408,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) py_attack(y, x, HISSATSU_KYUSHO); else { @@ -433,7 +433,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) py_attack(y, x, HISSATSU_MAJIN); else { @@ -458,7 +458,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) py_attack(y, x, HISSATSU_SUTEMI); else { @@ -484,7 +484,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) py_attack(y, x, HISSATSU_ELEC); else { @@ -513,7 +513,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) { POSITION y = 0, x = 0; - cave_type *c_ptr; + grid_type *g_ptr; monster_type *m_ptr; if (p_ptr->cut < 300) @@ -525,13 +525,11 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) { y = p_ptr->y + ddy_ddd[dir]; x = p_ptr->x + ddx_ddd[dir]; - c_ptr = &cave[y][x]; - - /* Get the monster */ - m_ptr = &m_list[c_ptr->m_idx]; + g_ptr = ¤t_floor_ptr->grid_array[y][x]; + m_ptr = ¤t_floor_ptr->m_list[g_ptr->m_idx]; /* Hack -- attack monsters */ - if (c_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT))) + if (g_ptr->m_idx && (m_ptr->ml || cave_have_flag_bold(y, x, FF_PROJECT))) { if (!monster_living(m_ptr->r_idx)) { @@ -560,7 +558,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) py_attack(y, x, HISSATSU_QUAKE); else earthquake(p_ptr->y, p_ptr->x, 10); @@ -582,7 +580,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) { int damage; - if (!buki_motteruka(INVEN_RARM + i)) break; + if (!has_melee_weapon(INVEN_RARM + i)) break; o_ptr = &inventory[INVEN_RARM + i]; basedam = (o_ptr->dd * (o_ptr->ds + 1)) * 50; damage = o_ptr->to_d * 100; @@ -637,14 +635,14 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) POSITION y, x; POSITION ny, nx; MONSTER_IDX m_idx; - cave_type *c_ptr; + grid_type *g_ptr; monster_type *m_ptr; y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - c_ptr = &cave[y][x]; + g_ptr = ¤t_floor_ptr->grid_array[y][x]; - if (c_ptr->m_idx) + if (g_ptr->m_idx) py_attack(y, x, HISSATSU_3DAN); else { @@ -652,18 +650,18 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) return NULL; } - if (d_info[dungeon_type].flags1 & DF1_NO_MELEE) + if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MELEE) { return ""; } /* Monster is dead? */ - if (!c_ptr->m_idx) break; + if (!g_ptr->m_idx) break; ny = y + ddy[dir]; nx = x + ddx[dir]; - m_idx = c_ptr->m_idx; - m_ptr = &m_list[m_idx]; + m_idx = g_ptr->m_idx; + m_ptr = ¤t_floor_ptr->m_list[m_idx]; /* Monster cannot move back? */ if (!monster_can_enter(ny, nx, &r_info[m_ptr->r_idx], 0)) @@ -673,8 +671,8 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) continue; } - c_ptr->m_idx = 0; - cave[ny][nx].m_idx = m_idx; + g_ptr->m_idx = 0; + current_floor_ptr->grid_array[ny][nx].m_idx = m_idx; m_ptr->fy = ny; m_ptr->fx = nx; @@ -687,9 +685,8 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) lite_spot(ny, nx); /* Player can move forward? */ - if (player_can_enter(c_ptr->feat, 0)) + if (player_can_enter(g_ptr->feat, 0)) { - /* Move the player */ if (!move_player_effect(y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP)) break; } else @@ -718,7 +715,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) py_attack(y, x, HISSATSU_DRAIN); else { @@ -819,10 +816,10 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) { py_attack(y, x, 0); - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) { handle_stuff(); py_attack(y, x, 0); @@ -853,7 +850,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - if (d_info[dungeon_type].flags1 & DF1_NO_MELEE) + if (d_info[p_ptr->dungeon_idx].flags1 & DF1_NO_MELEE) { msg_print(_("なぜか攻撃することができない。", "Something prevent you from attacking.")); return ""; @@ -862,7 +859,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) for (i = 0; i < 2; i++) { int damage; - if (!buki_motteruka(INVEN_RARM + i)) break; + if (!has_melee_weapon(INVEN_RARM + i)) break; o_ptr = &inventory[INVEN_RARM + i]; basedam = (o_ptr->dd * (o_ptr->ds + 1)) * 50; damage = o_ptr->to_d * 100; @@ -903,7 +900,7 @@ concptr do_hissatsu_spell(SPELL_IDX spell, BIT_FLAGS mode) y = p_ptr->y + ddy[dir]; x = p_ptr->x + ddx[dir]; - if (cave[y][x].m_idx) + if (current_floor_ptr->grid_array[y][x].m_idx) py_attack(y, x, HISSATSU_UNDEAD); else {