#include "angband.h"
#include "projection.h"
+#include "monster.h"
#include "monster-status.h"
+#include "monster-spell.h"
#include "artifact.h"
#include "avatar.h"
#include "player-status.h"
#include "shoot.h"
+
/*!
* @brief 矢弾を射撃した際のスレイ倍率をかけた結果を返す /
* Determines the odds of an object breaking when thrown at a monster
* @param m_ptr 目標モンスターの構造体参照ポインタ
* @return スレイ倍率をかけたダメージ量
*/
-static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr)
+static MULTIPLY tot_dam_aux_shot(object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, SPELL_IDX snipe_type)
{
- int mult = 10;
+ MULTIPLY mult = 10;
monster_race *r_ptr = &r_info[m_ptr->r_idx];
}
/* Sniper */
- if (snipe_type) mult = tot_dam_aux_snipe(mult, m_ptr);
+ if (snipe_type) mult = tot_dam_aux_snipe(mult, m_ptr, snipe_type);
/* Return the total damage */
return (tdam * mult / 10);
* Note that Bows of "Extra Shots" give an extra shot.
* </pre>
*/
-void exe_fire(INVENTORY_IDX item, object_type *j_ptr)
+void exe_fire(INVENTORY_IDX item, object_type *j_ptr, SPELL_IDX snipe_type)
{
DIRECTION dir;
int i;
}
else
{
- o_ptr = &o_list[0 - item];
+ o_ptr = ¤t_floor_ptr->o_list[0 - item];
}
/* Sniper - Cannot shot a single arrow twice */
}
- /* Take a (partial) turn */
+ /* Take a (partial) current_world_ptr->game_turn */
p_ptr->energy_use = (p_ptr->energy_use / thits);
is_fired = TRUE;
- /* Sniper - Difficult to shot twice at 1 turn */
+ /* Sniper - Difficult to shot twice at 1 current_world_ptr->game_turn */
if (snipe_type == SP_DOUBLE) p_ptr->concent = (p_ptr->concent + 1) / 2;
/* Sniper - Repeat shooting when double shots */
/* Travel until stopped */
for (cur_dis = 0; cur_dis <= tdis; )
{
- grid_type *c_ptr;
+ grid_type *g_ptr;
/* Hack -- Stop at the target */
if ((y == ty) && (x == tx)) break;
/* Shatter Arrow */
if (snipe_type == SP_KILL_WALL)
{
- c_ptr = &cave[ny][nx];
+ g_ptr = ¤t_floor_ptr->grid_array[ny][nx];
- if (cave_have_flag_grid(c_ptr, FF_HURT_ROCK) && !c_ptr->m_idx)
+ if (cave_have_flag_grid(g_ptr, FF_HURT_ROCK) && !g_ptr->m_idx)
{
- if (c_ptr->info & (CAVE_MARK)) msg_print(_("岩が砕け散った。", "Wall rocks were shattered."));
+ if (g_ptr->info & (CAVE_MARK)) msg_print(_("岩が砕け散った。", "Wall rocks were shattered."));
/* Forget the wall */
- c_ptr->info &= ~(CAVE_MARK);
+ g_ptr->info &= ~(CAVE_MARK);
p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE);
/* Destroy the wall */
}
/* Stopped by walls/doors */
- if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && !cave[ny][nx].m_idx) break;
+ if (!cave_have_flag_bold(ny, nx, FF_PROJECT) && !current_floor_ptr->grid_array[ny][nx].m_idx) break;
/* Advance the distance */
cur_dis++;
/* Sniper */
if (snipe_type == SP_LITE)
{
- cave[ny][nx].info |= (CAVE_GLOW);
+ current_floor_ptr->grid_array[ny][nx].info |= (CAVE_GLOW);
note_spot(ny, nx);
lite_spot(ny, nx);
}
/* Sniper */
if (snipe_type == SP_EVILNESS)
{
- cave[ny][nx].info &= ~(CAVE_GLOW | CAVE_MARK);
+ current_floor_ptr->grid_array[ny][nx].info &= ~(CAVE_GLOW | CAVE_MARK);
note_spot(ny, nx);
lite_spot(ny, nx);
}
y = ny;
/* Monster here, Try to hit it */
- if (cave[y][x].m_idx)
+ if (current_floor_ptr->grid_array[y][x].m_idx)
{
- grid_type *c_mon_ptr = &cave[y][x];
+ grid_type *c_mon_ptr = ¤t_floor_ptr->grid_array[y][x];
- monster_type *m_ptr = &m_list[c_mon_ptr->m_idx];
+ monster_type *m_ptr = ¤t_floor_ptr->m_list[c_mon_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Check the visibility */
if (p_ptr->riding)
{
if ((p_ptr->skill_exp[GINOU_RIDING] < s_info[p_ptr->pclass].s_max[GINOU_RIDING])
- && ((p_ptr->skill_exp[GINOU_RIDING] - (RIDING_EXP_BEGINNER * 2)) / 200 < r_info[m_list[p_ptr->riding].r_idx].level)
+ && ((p_ptr->skill_exp[GINOU_RIDING] - (RIDING_EXP_BEGINNER * 2)) / 200 < r_info[current_floor_ptr->m_list[p_ptr->riding].r_idx].level)
&& one_in_(2))
{
p_ptr->skill_exp[GINOU_RIDING] += 1;
else
{
/* Apply special damage */
- tdam = tot_dam_aux_shot(q_ptr, tdam, m_ptr);
+ tdam = tot_dam_aux_shot(q_ptr, tdam, m_ptr, snipe_type);
tdam = critical_shot(q_ptr->weight, q_ptr->to_h, j_ptr->to_h, tdam);
/* No negative damage */
/* Sniper */
if (snipe_type == SP_HOLYNESS)
{
- cave[ny][nx].info |= (CAVE_GLOW);
+ current_floor_ptr->grid_array[ny][nx].info |= (CAVE_GLOW);
note_spot(ny, nx);
lite_spot(ny, nx);
}
if (!in_bounds2(ny, nx)) break;
/* Stopped by walls/doors */
- if (!player_can_enter(cave[ny][nx].feat, 0)) break;
+ if (!player_can_enter(current_floor_ptr->grid_array[ny][nx].feat, 0)) break;
/* Stopped by monsters */
if (!cave_empty_bold(ny, nx)) break;
- cave[ny][nx].m_idx = m_idx;
- cave[oy][ox].m_idx = 0;
+ current_floor_ptr->grid_array[ny][nx].m_idx = m_idx;
+ current_floor_ptr->grid_array[oy][ox].m_idx = 0;
m_ptr->fx = nx;
m_ptr->fy = ny;
}
/* Chance of breakage (during attacks) */
- j = (hit_body ? breakage_chance(q_ptr) : 0);
+ j = (hit_body ? breakage_chance(q_ptr, snipe_type) : 0);
if (stick_to)
{
- 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];
OBJECT_IDX o_idx = o_pop();
if (!o_idx)
return;
}
- o_ptr = &o_list[o_idx];
+ o_ptr = ¤t_floor_ptr->o_list[o_idx];
object_copy(o_ptr, q_ptr);
/* Forget mark */