/* Cancel the arg */
command_arg = 0;
}
-
- /* Take a turn */
p_ptr->energy_use = 100;
/* Search */
* @param trapped TRUEならばトラップが存在する箱のみ、FALSEならば空でない箱全てを対象にする
* @return 箱が存在する場合そのオブジェクトID、存在しない場合0を返す。
*/
-static s16b chest_check(int y, int x, bool trapped)
+static OBJECT_IDX chest_check(POSITION y, POSITION x, bool trapped)
{
cave_type *c_ptr = &cave[y][x];
-
- s16b this_o_idx, next_o_idx = 0;
-
+ OBJECT_IDX this_o_idx, next_o_idx = 0;
/* Scan all objects in the grid */
for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
- /* Acquire object */
o_ptr = &o_list[this_o_idx];
-
- /* Acquire next object */
next_o_idx = o_ptr->next_o_idx;
/* Skip unknown chests XXX XXX */
return (this_o_idx);
}
}
-
- /* No chest */
return (0);
}
* @details
* Assume there is no monster blocking the destination
*/
-static bool do_cmd_open_chest(int y, int x, s16b o_idx)
+static bool do_cmd_open_chest(POSITION y, POSITION x, OBJECT_IDX o_idx)
{
int i, j;
-
bool flag = TRUE;
-
bool more = FALSE;
-
object_type *o_ptr = &o_list[o_idx];
-
- /* Take a turn */
p_ptr->energy_use = 100;
/* Attempt to unlock it */
/* Let the Chest drop items */
chest_death(FALSE, y, x, o_idx);
}
-
- /* Result */
return (more);
}
-
-#if defined(ALLOW_EASY_OPEN) || defined(ALLOW_EASY_DISARM) /* TNB */
-
/*!
* @brief 地形は開くものであって、かつ開かれているかを返す /
* Attempt to open the given chest at the given location
for (d = 0; d < 9; d++)
{
cave_type *c_ptr;
- s16b feat;
+ FEAT_IDX feat;
/* if not searching under player continue */
if ((d == 8) && !under) continue;
static int count_chests(POSITION *y, POSITION *x, bool trapped)
{
int d, count;
- IDX o_idx;
+ OBJECT_IDX o_idx;
object_type *o_ptr;
for (d = 0; d < 9; d++)
{
/* Extract adjacent (legal) location */
- int yy = p_ptr->y + ddy_ddd[d];
- int xx = p_ptr->x + ddx_ddd[d];
+ POSITION yy = p_ptr->y + ddy_ddd[d];
+ POSITION xx = p_ptr->x + ddx_ddd[d];
/* No (visible) chest is there */
if ((o_idx = chest_check(yy, xx, FALSE)) == 0) continue;
return d[dx + 1][dy + 1];
}
-#endif /* defined(ALLOW_EASY_OPEN) || defined(ALLOW_EASY_DISARM) -- TNB */
-
-
/*!
* @brief 「開ける」動作コマンドのサブルーチン /
* Perform the basic "open" command on doors
* Assume there is no monster blocking the destination
* Returns TRUE if repeated commands may continue
*/
-static bool do_cmd_open_aux(int y, int x)
+static bool do_cmd_open_aux(POSITION y, POSITION x)
{
int i, j;
/* Get requested grid */
cave_type *c_ptr = &cave[y][x];
-
feature_type *f_ptr = &f_info[c_ptr->feat];
-
bool more = FALSE;
-
- /* Take a turn */
p_ptr->energy_use = 100;
/* Seeing true feature code (ignore mimic) */
/* Extract the lock power */
j = f_ptr->power;
- /* Extract the difficulty XXX XXX XXX */
+ /* Extract the difficulty */
j = i - (j * 4);
/* Always have a small chance of success */
/* Success */
if (randint0(100) < j)
{
- /* Message */
msg_print(_("鍵をはずした。", "You have picked the lock."));
/* Open the door */
cave_alter_feat(y, x, FF_OPEN);
- /* Sound */
sound(SOUND_OPENDOOR);
/* Experience */
/* Failure */
if (flush_failure) flush();
- /* Message */
msg_print(_("鍵をはずせなかった。", "You failed to pick the lock."));
/* We may keep trying */
/* Open the door */
cave_alter_feat(y, x, FF_OPEN);
- /* Sound */
sound(SOUND_OPENDOOR);
}
-
- /* Result */
return (more);
}
{
POSITION y, x;
DIRECTION dir;
- IDX o_idx;
+ OBJECT_IDX o_idx;
bool more = FALSE;
set_action(ACTION_NONE);
}
-#ifdef ALLOW_EASY_OPEN /* TNB */
-
/* Option: Pick a direction */
if (easy_open)
{
}
}
-#endif /* ALLOW_EASY_OPEN -- TNB */
-
/* Allow repeated command */
if (command_arg)
{
/* Get a "repeated" direction */
if (get_rep_dir(&dir, TRUE))
{
- s16b feat;
+ FEAT_IDX feat;
cave_type *c_ptr;
/* Get requested location */
/* Nothing useful */
if (!have_flag(f_info[feat].flags, FF_OPEN) && !o_idx)
{
- /* Message */
msg_print(_("そこには開けるものが見当たらない。", "You see nothing there to open."));
}
/* Monster in the way */
else if (c_ptr->m_idx && p_ptr->riding != c_ptr->m_idx)
{
- /* Take a turn */
p_ptr->energy_use = 100;
- /* Message */
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
/* Attack */
}
/* Cancel repeat unless we may continue */
- if (!more) disturb(0, 0);
+ if (!more) disturb(FALSE, FALSE);
}
* Assume there is no monster blocking the destination
* Returns TRUE if repeated commands may continue
*/
-static bool do_cmd_close_aux(int y, int x)
+static bool do_cmd_close_aux(POSITION y, POSITION x)
{
/* Get grid and contents */
cave_type *c_ptr = &cave[y][x];
- s16b old_feat = c_ptr->feat;
- bool more = FALSE;
+ FEAT_IDX old_feat = c_ptr->feat;
+ bool more = FALSE;
- /* Take a turn */
p_ptr->energy_use = 100;
/* Seeing true feature code (ignore mimic) */
if ((c_ptr->o_idx || (c_ptr->info & CAVE_OBJECT)) &&
(closed_feat != old_feat) && !have_flag(f_info[closed_feat].flags, FF_DROP))
{
- /* Message */
msg_print(_("何かがつっかえて閉まらない。", "There seems stuck."));
}
else
/* Broken door */
if (old_feat == c_ptr->feat)
{
- /* Message */
msg_print(_("ドアは壊れてしまっている。", "The door appears to be broken."));
}
else
{
- /* Sound */
sound(SOUND_SHUTDOOR);
}
}
}
-
- /* Result */
return (more);
}
set_action(ACTION_NONE);
}
-#ifdef ALLOW_EASY_OPEN /* TNB */
-
/* Option: Pick a direction */
if (easy_open)
{
}
}
-#endif /* ALLOW_EASY_OPEN -- TNB */
-
/* Allow repeated command */
if (command_arg)
{
}
/* Get a "repeated" direction */
- if (get_rep_dir(&dir,FALSE))
+ if (get_rep_dir(&dir, FALSE))
{
cave_type *c_ptr;
- s16b feat;
+ FEAT_IDX feat;
/* Get requested location */
y = p_ptr->y + ddy[dir];
/* Require open/broken door */
if (!have_flag(f_info[feat].flags, FF_CLOSE))
{
- /* Message */
msg_print(_("そこには閉じるものが見当たらない。", "You see nothing there to close."));
}
/* Monster in the way */
else if (c_ptr->m_idx)
{
- /* Take a turn */
p_ptr->energy_use = 100;
- /* Message */
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
/* Attack */
}
/* Cancel repeat unless we may continue */
- if (!more) disturb(0, 0);
+ if (!more) disturb(FALSE, FALSE);
}
* @param x 対象を行うマスのX座標
* @return
*/
-static bool do_cmd_tunnel_test(int y, int x)
+static bool do_cmd_tunnel_test(POSITION y, POSITION x)
{
cave_type *c_ptr = &cave[y][x];
/* Must have knowledge */
if (!(c_ptr->info & CAVE_MARK))
{
- /* Message */
msg_print(_("そこには何も見当たらない。", "You see nothing there."));
- /* Nope */
return (FALSE);
}
/* Must be a wall/door/etc */
if (!cave_have_flag_grid(c_ptr, FF_TUNNEL))
{
- /* Message */
msg_print(_("そこには掘るものが見当たらない。", "You see nothing there to tunnel."));
- /* Nope */
return (FALSE);
}
- /* Okay */
return (TRUE);
}
* Do not use twall anymore
* Returns TRUE if repeated commands may continue
*/
-static bool do_cmd_tunnel_aux(int y, int x)
+static bool do_cmd_tunnel_aux(POSITION y, POSITION x)
{
cave_type *c_ptr;
feature_type *f_ptr, *mimic_f_ptr;
/* Verify legality */
if (!do_cmd_tunnel_test(y, x)) return (FALSE);
- /* Take a turn */
p_ptr->energy_use = 100;
/* Get grid */
name = f_name + mimic_f_ptr->name;
- /* Sound */
sound(SOUND_DIG);
if (have_flag(f_ptr->flags, FF_PERMANENT))
/* Dig */
if (p_ptr->skill_dig > randint0(20 * power))
{
- /* Message */
msg_format(_("%sをくずした。", "You have removed the %s."), name);
/* Remove the feature */
p_ptr->update |= (PU_FLOW);
}
- /* Sound */
if (have_flag(f_ptr->flags, FF_GLASS)) sound(SOUND_GLASS);
/* Remove the feature */
/* Occasional Search XXX XXX */
if (randint0(100) < 25) search();
}
-
- /* Result */
return more;
}
int y, x, dir;
cave_type *c_ptr;
- s16b feat;
+ FEAT_IDX feat;
bool more = FALSE;
/* No tunnelling through doors */
if (have_flag(f_info[feat].flags, FF_DOOR))
{
- /* Message */
msg_print(_("ドアは掘れない。", "You cannot tunnel through doors."));
}
/* A monster is in the way */
else if (c_ptr->m_idx)
{
- /* Take a turn */
p_ptr->energy_use = 100;
- /* Message */
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
/* Attack */
}
/* Cancel repetition unless we can continue */
- if (!more) disturb(0, 0);
+ if (!more) disturb(FALSE, FALSE);
}
-
-#ifdef ALLOW_EASY_OPEN /* TNB */
-
/*!
* @brief 移動処理による簡易な「開く」処理 /
* easy_open_door --
* do_cmd_open_test() and do_cmd_open_aux().
* </pre>
*/
-bool easy_open_door(int y, int x)
+bool easy_open_door(POSITION y, POSITION x)
{
int i, j;
/* Must be a closed door */
if (!is_closed_door(c_ptr->feat))
{
- /* Nope */
return (FALSE);
}
/* Extract the lock power */
j = f_ptr->power;
- /* Extract the difficulty XXX XXX XXX */
+ /* Extract the difficulty */
j = i - (j * 4);
/* Always have a small chance of success */
/* Success */
if (randint0(100) < j)
{
- /* Message */
msg_print(_("鍵をはずした。", "You have picked the lock."));
/* Open the door */
cave_alter_feat(y, x, FF_OPEN);
- /* Sound */
sound(SOUND_OPENDOOR);
/* Experience */
/* Failure */
if (flush_failure) flush();
- /* Message */
msg_print(_("鍵をはずせなかった。", "You failed to pick the lock."));
}
/* Open the door */
cave_alter_feat(y, x, FF_OPEN);
- /* Sound */
sound(SOUND_OPENDOOR);
}
-
- /* Result */
return (TRUE);
}
-#endif /* ALLOW_EASY_OPEN -- TNB */
-
-
/*!
* @brief 箱のトラップを解除するコマンドのメインルーチン /
* Perform the basic "disarm" command
* Returns TRUE if repeated commands may continue
* </pre>
*/
-static bool do_cmd_disarm_chest(int y, int x, s16b o_idx)
+static bool do_cmd_disarm_chest(POSITION y, POSITION x, OBJECT_IDX o_idx)
{
int i, j;
-
bool more = FALSE;
-
object_type *o_ptr = &o_list[o_idx];
-
- /* Take a turn */
p_ptr->energy_use = 100;
/* Get the "disarm" factor */
sound(SOUND_FAIL);
chest_trap(y, x, o_idx);
}
-
- /* Result */
return (more);
}
* Returns TRUE if repeated commands may continue
* </pre>
*/
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
-bool do_cmd_disarm_aux(int y, int x, int dir)
-
-#else /* ALLOW_EASY_DISARM -- TNB */
-
-static bool do_cmd_disarm_aux(int y, int x, int dir)
-#endif /* ALLOW_EASY_DISARM -- TNB */
+bool do_cmd_disarm_aux(POSITION y, POSITION x, DIRECTION dir)
{
/* Get grid and contents */
cave_type *c_ptr = &cave[y][x];
/* Extract trap "power" */
int power = f_ptr->power;
-
bool more = FALSE;
/* Get the "disarm" factor */
int i = p_ptr->skill_dis;
-
int j;
- /* Take a turn */
p_ptr->energy_use = 100;
/* Penalize some conditions */
/* Success */
if (randint0(100) < j)
{
- /* Message */
msg_format(_("%sを解除した。", "You have disarmed the %s."), name);
/* Reward */
/* Remove the trap */
cave_alter_feat(y, x, FF_DISARM);
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
/* Move the player onto the trap */
move_player(dir, easy_disarm, FALSE);
-
-#else /* ALLOW_EASY_DISARM -- TNB */
-
- /* move the player onto the trap grid */
- move_player(dir, FALSE, FALSE);
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
}
/* Failure -- Keep trying */
/* Failure */
if (flush_failure) flush();
- /* Message */
msg_format(_("%sの解除に失敗した。", "You failed to disarm the %s."), name);
/* We may keep trying */
/* Failure -- Set off the trap */
else
{
- /* Message */
msg_format(_("%sを作動させてしまった!", "You set off the %s!"), name);
-
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
/* Move the player onto the trap */
move_player(dir, easy_disarm, FALSE);
-
-#else /* ALLOW_EASY_DISARM -- TNB */
-
- /* Move the player onto the trap */
- move_player(dir, FALSE, FALSE);
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
}
-
- /* Result */
return (more);
}
set_action(ACTION_NONE);
}
-#ifdef ALLOW_EASY_DISARM /* TNB */
/* Option: Pick a direction */
if (easy_disarm)
}
}
-#endif /* ALLOW_EASY_DISARM -- TNB */
/* Allow repeated command */
if (command_arg)
if (get_rep_dir(&dir,TRUE))
{
cave_type *c_ptr;
- s16b feat;
+ FEAT_IDX feat;
/* Get location */
y = p_ptr->y + ddy[dir];
/* Disarm a trap */
if (!is_trap(feat) && !o_idx)
{
- /* Message */
msg_print(_("そこには解除するものが見当たらない。", "You see nothing there to disarm."));
}
/* Monster in the way */
else if (c_ptr->m_idx && p_ptr->riding != c_ptr->m_idx)
{
- /* Message */
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
/* Attack */
}
/* Cancel repeat unless told not to */
- if (!more) disturb(0, 0);
+ if (!more) disturb(FALSE, FALSE);
}
* Returns TRUE if repeated commands may continue
* </pre>
*/
-static bool do_cmd_bash_aux(int y, int x, int dir)
+static bool do_cmd_bash_aux(POSITION y, POSITION x, DIRECTION dir)
{
/* Get grid */
cave_type *c_ptr = &cave[y][x];
cptr name = f_name + f_info[get_feat_mimic(c_ptr)].name;
- /* Take a turn */
p_ptr->energy_use = 100;
- /* Message */
msg_format(_("%sに体当たりをした!", "You smash into the %s!"), name);
- /* Compare bash power to door power XXX XXX XXX */
+ /* Compare bash power to door power */
temp = (bash - (temp * 10));
if (p_ptr->pclass == CLASS_BERSERKER) temp *= 2;
/* Hack -- attempt to bash down the door */
if (randint0(100) < temp)
{
- /* Message */
msg_format(_("%sを壊した!", "The %s crashes open!"), name);
- /* Sound */
sound(have_flag(f_ptr->flags, FF_GLASS) ? SOUND_GLASS : SOUND_OPENDOOR);
/* Break down the door */
else if (randint0(100) < adj_dex_safe[p_ptr->stat_ind[A_DEX]] +
p_ptr->lev)
{
- /* Message */
msg_format(_("この%sは頑丈だ。", "The %s holds firm."), name);
/* Allow repeated bashing */
/* High dexterity yields coolness */
else
{
- /* Message */
msg_print(_("体のバランスをくずしてしまった。", "You are off-balance."));
/* Hack -- Lose balance ala paralysis */
(void)set_paralyzed(p_ptr->paralyzed + 2 + randint0(2));
}
-
- /* Result */
return (more);
}
/* Get a "repeated" direction */
if (get_rep_dir(&dir,FALSE))
{
- s16b feat;
+ FEAT_IDX feat;
/* Bash location */
y = p_ptr->y + ddy[dir];
/* Nothing useful */
if (!have_flag(f_info[feat].flags, FF_BASH))
{
- /* Message */
msg_print(_("そこには体当たりするものが見当たらない。", "You see nothing there to bash."));
}
/* Monster in the way */
else if (c_ptr->m_idx)
{
- /* Take a turn */
p_ptr->energy_use = 100;
- /* Message */
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
/* Attack */
}
/* Unless valid action taken, cancel bash */
- if (!more) disturb(0, 0);
+ if (!more) disturb(FALSE, FALSE);
}
*
* Attack monsters, tunnel through walls, disarm traps, open doors.
*
- * Consider confusion XXX XXX XXX
+ * Consider confusion
*
* This command must always take a turn, to prevent free detection
* of invisible monsters.
/* Get a direction */
if (get_rep_dir(&dir,TRUE))
{
- s16b feat;
+ FEAT_IDX feat;
feature_type *f_ptr;
/* Get location */
feat = get_feat_mimic(c_ptr);
f_ptr = &f_info[feat];
- /* Take a turn */
p_ptr->energy_use = 100;
/* Attack monsters */
more = do_cmd_disarm_aux(y, x, dir);
}
- /* Oops */
else
{
- /* Oops */
msg_print(_("何もない空中を攻撃した。", "You attack the empty air."));
}
}
/* Cancel repetition unless we can continue */
- if (!more) disturb(0, 0);
+ if (!more) disturb(FALSE, FALSE);
}
* @return オブジェクトがある場合TRUEを返す
* @details
* <pre>
- * XXX XXX XXX Let user choose a pile of spikes, perhaps?
+ * Let user choose a pile of spikes, perhaps?
* </pre>
*/
-static bool get_spike(int *ip)
+static bool get_spike(INVENTORY_IDX *ip)
{
- int i;
+ INVENTORY_IDX i;
/* Check every item in the pack */
for (i = 0; i < INVEN_PACK; i++)
}
}
- /* Oops */
return (FALSE);
}
*/
void do_cmd_spike(void)
{
- int dir;
+ DIRECTION dir;
if (p_ptr->special_defense & KATA_MUSOU)
{
/* Get a "repeated" direction */
if (get_rep_dir(&dir,FALSE))
{
- int y, x, item;
+ POSITION y, x;
+ INVENTORY_IDX item;
cave_type *c_ptr;
- s16b feat;
+ FEAT_IDX feat;
/* Get location */
y = p_ptr->y + ddy[dir];
/* Require closed door */
if (!have_flag(f_info[feat].flags, FF_SPIKE))
{
- /* Message */
msg_print(_("そこにはくさびを打てるものが見当たらない。", "You see nothing there to spike."));
}
/* Get a spike */
else if (!get_spike(&item))
{
- /* Message */
msg_print(_("くさびを持っていない!", "You have no spikes!"));
}
/* Is a monster in the way? */
else if (c_ptr->m_idx)
{
- /* Take a turn */
p_ptr->energy_use = 100;
- /* Message */
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
/* Attack */
/* Go for it */
else
{
- /* Take a turn */
p_ptr->energy_use = 100;
/* Successful jamming */
*/
void do_cmd_walk(bool pickup)
{
- int dir;
+ DIRECTION dir;
bool more = FALSE;
/* Get a "repeated" direction */
if (get_rep_dir(&dir, FALSE))
{
- /* Take a turn */
p_ptr->energy_use = 100;
if ((dir != 5) && (p_ptr->special_defense & KATA_MUSOU))
}
/* Cancel repeat unless we may continue */
- if (!more) disturb(0, 0);
+ if (!more) disturb(FALSE, FALSE);
}
*/
void do_cmd_run(void)
{
- int dir;
+ DIRECTION dir;
/* Hack -- no running when confused */
if (p_ptr->confused)
command_arg = 0;
}
- /* Take a turn */
p_ptr->energy_use = 100;
if (pickup) mpe_mode |= MPE_DO_PICKUP;
if (p_ptr->special_defense & NINJA_S_STEALTH) set_superstealth(FALSE);
- /* Take a turn XXX XXX XXX (?) */
+ /* Take a turn (?) */
p_ptr->energy_use = 100;
/* The sin of sloth */
/* Redraw the state */
p_ptr->redraw |= (PR_STATE);
-
- /* Handle stuff */
handle_stuff();
/* Refresh */
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
/* Extract the flags */
object_flags(o_ptr, flgs);
* Note that Bows of "Extra Shots" give an extra shot.
* </pre>
*/
-void do_cmd_fire_aux(int item, object_type *j_ptr)
+void do_cmd_fire_aux(INVENTORY_IDX item, object_type *j_ptr)
{
- int dir;
- int i, y, x, ny, nx, ty, tx, prev_y, prev_x;
+ DIRECTION dir;
+ int i;
+ POSITION y, x, ny, nx, ty, tx, prev_y, prev_x;
int tdam_base, tdis, thits, tmul;
int bonus, chance;
int cur_dis, visible;
/* Sniper - Cannot shot a single arrow twice */
if ((snipe_type == SP_DOUBLE) && (o_ptr->number < 2)) snipe_type = SP_NONE;
- /* Describe the object */
object_desc(o_name, o_ptr, OD_OMIT_PREFIX);
/* Use the proper number of shots */
/* Start at the player */
y = p_ptr->y;
x = p_ptr->x;
-
- /* Get local object */
q_ptr = &forge;
/* Obtain a local object */
floor_item_optimize(0 - item);
}
- /* Sound */
sound(SOUND_SHOOT);
-
- /* Hack -- Handle stuff */
handle_stuff();
/* Save the old location */
{
cave[ny][nx].info |= (CAVE_GLOW);
- /* Notice */
note_spot(ny, nx);
- /* Redraw */
lite_spot(ny, nx);
}
{
cave[ny][nx].info &= ~(CAVE_GLOW | CAVE_MARK);
- /* Notice */
note_spot(ny, nx);
- /* Redraw */
lite_spot(ny, nx);
}
/* Get "the monster" or "it" */
monster_desc(m_name, m_ptr, 0);
- /* Message */
msg_format(_("%sが%sに命中した。", "The %s hits %s."), o_name, m_name);
if (m_ptr->ml)
}
else
{
- /* Apply special damage XXX XXX XXX */
+ /* Apply special damage */
tdam = tot_dam_aux_shot(q_ptr, tdam, m_ptr);
tdam = critical_shot(q_ptr->weight, q_ptr->to_h, j_ptr->to_h, tdam);
{
cave[ny][nx].info |= (CAVE_GLOW);
- /* Notice */
note_spot(ny, nx);
- /* Redraw */
lite_spot(ny, nx);
}
msg_format(_("%sは%sに突き刺さった!", "%^s have stuck into %s!"),o_name, m_name);
}
- /* Message */
message_pain(c_mon_ptr->m_idx, tdam);
/* Anger the monster */
{
char m_name[80];
- /* Sound */
sound(SOUND_FLEE);
/* Get the monster name (or "it") */
monster_desc(m_name, m_ptr, 0);
- /* Message */
msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), m_name);
}
m_ptr->fy = ny;
/* Update the monster (new location) */
- update_mon(c_mon_ptr->m_idx, TRUE);
+ update_monster(c_mon_ptr->m_idx, TRUE);
lite_spot(ny, nx);
lite_spot(oy, ox);
{
MONSTER_IDX m_idx = cave[y][x].m_idx;
monster_type *m_ptr = &m_list[m_idx];
- IDX o_idx = o_pop();
+ OBJECT_IDX o_idx = o_pop();
if (!o_idx)
{
/* Require proper missile */
item_tester_tval = p_ptr->tval_ammo;
- /* Get an item */
q = _("どれを撃ちますか? ", "Fire which item? ");
s = _("発射されるアイテムがありません。", "You have nothing to fire.");
if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR)))
{
DIRECTION dir;
OBJECT_IDX item;
- int i, y, x, ty, tx, prev_y, prev_x;
- int ny[19], nx[19];
+ int i;
+ POSITION y, x, ty, tx, prev_y, prev_x;
+ POSITION ny[19], nx[19];
int chance, tdam, tdis;
int mul, div, dd, ds;
int cur_dis, visible;
int msec = delay_factor * delay_factor * delay_factor;
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
cptr q, s;
bool come_back = FALSE;
bool do_drop = TRUE;
}
else
{
- /* Get an item */
q = _("どのアイテムを投げますか? ", "Throw which item? ");
s = _("投げるアイテムがない。", "You have nothing to throw.");
if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR | USE_EQUIP)))
o_ptr = &o_list[0 - item];
}
-
/* Item is cursed */
if (object_is_cursed(o_ptr) && (item >= INVEN_RARM))
{
- /* Oops */
msg_print(_("ふーむ、どうやら呪われているようだ。", "Hmmm, it seems to be cursed."));
- /* Nope */
return FALSE;
}
msg_print(_("アリーナではアイテムを使えない!", "You're in the arena now. This is hand-to-hand!"));
msg_print(NULL);
- /* Nope */
return FALSE;
}
}
-
- /* Get local object */
q_ptr = &forge;
/* Obtain a local object */
p_ptr->redraw |= (PR_EQUIPPY);
}
- /* Take a turn */
p_ptr->energy_use = 100;
/* Rogue and Ninja gets bonus */
y = p_ptr->y;
x = p_ptr->x;
-
- /* Hack -- Handle stuff */
handle_stuff();
if ((p_ptr->pclass == CLASS_NINJA) && ((q_ptr->tval == TV_SPIKE) || ((have_flag(flgs, TR_THROW)) && (q_ptr->tval == TV_SWORD)))) shuriken = TRUE;
if (cave[y][x].m_idx)
{
cave_type *c_ptr = &cave[y][x];
-
monster_type *m_ptr = &m_list[c_ptr->m_idx];
/* Check the visibility */
/* Get "the monster" or "it" */
monster_desc(m_name, m_ptr, 0);
- /* Message */
msg_format(_("%sが%sに命中した。", "The %s hits %s."), o_name, m_name);
if (m_ptr->ml)
ds = q_ptr->ds;
torch_dice(q_ptr, &dd, &ds); /* throwing a torch */
tdam = damroll(dd, ds);
- /* Apply special damage XXX XXX XXX */
+ /* Apply special damage */
tdam = tot_dam_aux(q_ptr, tdam, m_ptr, 0, TRUE);
tdam = critical_shot(q_ptr->weight, q_ptr->to_h, 0, tdam);
if (q_ptr->to_d > 0)
/* No death */
else
{
- /* Message */
message_pain(c_ptr->m_idx, tdam);
/* Anger the monster */
{
char m_name[80];
- /* Sound */
sound(SOUND_FLEE);
/* Get the monster name (or "it") */
monster_desc(m_name, m_ptr, 0);
- /* Message */
msg_format(_("%^sは恐怖して逃げ出した!", "%^s flees in terror!"), m_name);
}
}
{
if (hit_body || hit_wall || (randint1(100) < j))
{
- /* Message */
msg_format(_("%sは砕け散った!", "The %s shatters!"), o_name);
if (potion_smash_effect(0, y, x, q_ptr->k_idx))
/* Recalculate mana XXX */
p_ptr->update |= (PU_MANA);
- /* Window stuff */
p_ptr->window |= (PW_EQUIP);
}
else
*/
void forget_travel_flow(void)
{
- int x, y;
+ POSITION x, y;
/* Check the entire dungeon */
for (y = 0; y < cur_hgt; y++)
* @param x 該当地点のX座標
* @return コスト値
*/
-static int travel_flow_cost(int y, int x)
+static int travel_flow_cost(POSITION y, POSITION x)
{
feature_type *f_ptr = &f_info[cave[y][x].feat];
int cost = 1;
* @param tx 目標地点のX座標
* @return なし
*/
-static void travel_flow(int ty, int tx)
+static void travel_flow(POSITION ty, POSITION tx)
{
- int x, y, d;
+ POSITION x, y, d;
bool wall = FALSE;
feature_type *f_ptr = &f_info[cave[p_ptr->y][p_ptr->x].feat];