* Note that most brands and slays are x3, except Slay Animal (x2),\n
* Slay Evil (x2), and Kill dragon (x5).\n
*/
-s16b tot_dam_aux(object_type *o_ptr, int tdam, monster_type *m_ptr, BIT_FLAGS mode, bool thrown)
+HIT_POINT tot_dam_aux(object_type *o_ptr, HIT_POINT tdam, monster_type *m_ptr, BIT_FLAGS mode, bool thrown)
{
MULTIPLY mult = 10;
{
OBJECT_IDX this_o_idx, next_o_idx = 0;
cave_type *c_ptr;
-
- /* Access the grid */
c_ptr = &cave[y][x];
/* Invisible trap */
/* Pick a trap */
disclose_grid(y, x);
- /* Message */
msg_print(_("トラップを発見した。", "You have found a trap."));
- /* Disturb */
- disturb(0, 1);
+ disturb(FALSE, TRUE);
}
/* Secret door */
if (is_hidden_door(c_ptr))
{
- /* Message */
msg_print(_("隠しドアを発見した。", "You have found a secret door."));
/* Disclose */
disclose_grid(y, x);
- /* Disturb */
- disturb(0, 0);
+ disturb(FALSE, FALSE);
}
/* 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 */
/* Identify once */
if (!object_is_known(o_ptr))
{
- /* Message */
msg_print(_("箱に仕掛けられたトラップを発見した!", "You have discovered a trap on the chest!"));
/* Know the trap */
object_known(o_ptr);
/* Notice it */
- disturb(0, 0);
+ disturb(FALSE, FALSE);
}
}
}
o_ptr = &o_list[o_idx];
#ifdef JP
- /* Describe the object */
object_desc(old_name, o_ptr, OD_NAME_ONLY);
object_desc_kosuu(kazu_str, o_ptr);
hirottakazu = o_ptr->number;
/* Get the object again */
o_ptr = &inventory[slot];
- /* Delete the object */
delete_object_idx(o_idx);
if (p_ptr->pseikaku == SEIKAKU_MUNCHKIN)
if (o_ptr->marked & OM_AUTODESTROY) return;
}
- /* Describe the object */
object_desc(o_name, o_ptr, 0);
- /* Message */
#ifdef JP
if ((o_ptr->name1 == ART_CRIMSON) && (p_ptr->pseikaku == SEIKAKU_COMBAT))
{
{
cave_type *c_ptr = &cave[p_ptr->y][p_ptr->x];
- s16b this_o_idx, next_o_idx = 0;
+ OBJECT_IDX this_o_idx, next_o_idx = 0;
char o_name[MAX_NLEN];
/* Recenter the map around the player */
verify_panel();
- /* Update stuff */
p_ptr->update |= (PU_MONSTERS);
- /* Redraw map */
p_ptr->redraw |= (PR_MAP);
- /* Window stuff */
p_ptr->window |= (PW_OVERHEAD);
-
- /* Handle stuff */
handle_stuff();
/* Automatically pickup/destroy/inscribe items */
autopick_pickup_items(c_ptr);
-
-#ifdef ALLOW_EASY_FLOOR
-
if (easy_floor)
{
py_pickup_floor(pickup);
return;
}
-#endif /* ALLOW_EASY_FLOOR */
-
/* Scan the pile of objects */
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];
#ifdef ALLOW_EASY_SENSE /* TNB */
#endif /* ALLOW_EASY_SENSE -- TNB */
- /* Describe the object */
object_desc(o_name, o_ptr, 0);
/* Acquire next object */
next_o_idx = o_ptr->next_o_idx;
/* Hack -- disturb */
- disturb(0, 0);
+ disturb(FALSE, FALSE);
/* Pick up gold */
if (o_ptr->tval == TV_GOLD)
/* Delete the gold */
delete_object_idx(this_o_idx);
- /* Message */
msg_format(_(" $%ld の価値がある%sを見つけた。", "You collect %ld gold pieces worth of %s."),
(long)value, o_name);
/* Redraw gold */
p_ptr->redraw |= (PR_GOLD);
- /* Window stuff */
p_ptr->window |= (PW_PLAYER);
}
/* Clear the flag. */
o_ptr->marked &= ~OM_NOMSG;
}
- /* Describe the object */
else if (!pickup)
{
msg_format(_("%sがある。", "You see %s."), o_name);
* @param mpe_mode 移動オプションフラグ
* @return プレイヤーが死亡やフロア離脱を行わず、実際に移動が可能ならばTRUEを返す。
*/
-bool move_player_effect(POSITION ny, POSITION nx, u32b mpe_mode)
+bool move_player_effect(POSITION ny, POSITION nx, BIT_FLAGS mpe_mode)
{
cave_type *c_ptr = &cave[ny][nx];
feature_type *f_ptr = &f_info[c_ptr->feat];
monster_type *om_ptr = &m_list[om_idx];
om_ptr->fy = ny;
om_ptr->fx = nx;
- update_mon(om_idx, TRUE);
+ update_monster(om_idx, TRUE);
}
if (nm_idx > 0) /* Monster on new spot */
monster_type *nm_ptr = &m_list[nm_idx];
nm_ptr->fy = oy;
nm_ptr->fx = ox;
- update_mon(nm_idx, TRUE);
+ update_monster(nm_idx, TRUE);
}
}
/* Mega-Hack -- Forget the view */
p_ptr->update |= (PU_UN_VIEW);
- /* Redraw map */
p_ptr->redraw |= (PR_MAP);
}
- /* Update stuff */
p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_DISTANCE);
- /* Window stuff */
p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
/* Remove "unsafe" flag */
/* For get everything when requested hehe I'm *NASTY* */
if (dun_level && (d_info[dungeon_type].flags1 & DF1_FORGET)) wiz_dark();
-
- /* Handle stuff */
if (mpe_mode & MPE_HANDLE_STUFF) handle_stuff();
if (p_ptr->pclass == CLASS_NINJA)
/* Handle "store doors" */
if (have_flag(f_ptr->flags, FF_STORE))
{
- /* Disturb */
- disturb(0, 1);
+ disturb(FALSE, TRUE);
p_ptr->energy_use = 0;
/* Hack -- Enter store */
/* Handle "building doors" -KMW- */
else if (have_flag(f_ptr->flags, FF_BLDG))
{
- /* Disturb */
- disturb(0, 1);
+ disturb(FALSE, TRUE);
p_ptr->energy_use = 0;
/* Hack -- Enter building */
/* Handle quest areas -KMW- */
else if (have_flag(f_ptr->flags, FF_QUEST_ENTER))
{
- /* Disturb */
- disturb(0, 1);
+ disturb(FALSE, TRUE);
p_ptr->energy_use = 0;
/* Hack -- Enter quest level */
/* Set off a trap */
else if (have_flag(f_ptr->flags, FF_HIT_TRAP) && !(mpe_mode & MPE_STAYING))
{
- /* Disturb */
- disturb(0, 1);
+ disturb(FALSE, TRUE);
/* Hidden trap */
if (c_ptr->mimic || have_flag(f_ptr->flags, FF_SECRET))
{
- /* Message */
msg_print(_("トラップだ!", "You found a trap!"));
/* Pick a trap */
msg_print(_("* 注意:この先はトラップの感知範囲外です! *", "*Leaving trap detect region!*"));
}
- if (disturb_trap_detect) disturb(0, 1);
+ if (disturb_trap_detect) disturb(FALSE, TRUE);
}
}
* @param feat 地形ID
* @return トラップが自動的に無効ならばTRUEを返す
*/
-bool trap_can_be_ignored(int feat)
+bool trap_can_be_ignored(FEAT_IDX feat)
{
feature_type *f_ptr = &f_info[feat];
msg_print(_("動けない!", "Can't move!"));
p_ptr->energy_use = 0;
oktomove = FALSE;
- disturb(0, 1);
+ disturb(FALSE, TRUE);
}
else if (MON_MONFEAR(riding_m_ptr))
{
char steed_name[80];
-
- /* Acquire the monster name */
monster_desc(steed_name, riding_m_ptr, 0);
-
- /* Dump a message */
msg_format(_("%sが恐怖していて制御できない。", "%^s is too scared to control."), steed_name);
oktomove = FALSE;
- disturb(0, 1);
+ disturb(FALSE, TRUE);
}
else if (p_ptr->riding_ryoute)
{
oktomove = FALSE;
- disturb(0, 1);
+ disturb(FALSE, TRUE);
}
else if (have_flag(f_ptr->flags, FF_CAN_FLY) && (riding_r_ptr->flags7 & RF7_CAN_FLY))
{
msg_format(_("%sの上に行けない。", "Can't swim."), f_name + f_info[get_feat_mimic(c_ptr)].name);
p_ptr->energy_use = 0;
oktomove = FALSE;
- disturb(0, 1);
+ disturb(FALSE, TRUE);
}
else if (!have_flag(f_ptr->flags, FF_WATER) && (riding_r_ptr->flags7 & RF7_AQUATIC))
{
msg_format(_("%sから上がれない。", "Can't land."), f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name);
p_ptr->energy_use = 0;
oktomove = FALSE;
- disturb(0, 1);
+ disturb(FALSE, TRUE);
}
else if (have_flag(f_ptr->flags, FF_LAVA) && !(riding_r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK))
{
msg_format(_("%sの上に行けない。", "Too hot to go through."), f_name + f_info[get_feat_mimic(c_ptr)].name);
p_ptr->energy_use = 0;
oktomove = FALSE;
- disturb(0, 1);
+ disturb(FALSE, TRUE);
}
if (oktomove && MON_STUNNED(riding_m_ptr) && one_in_(2))
monster_desc(steed_name, riding_m_ptr, 0);
msg_format(_("%sが朦朧としていてうまく動けない!", "You cannot control stunned %s!"), steed_name);
oktomove = FALSE;
- disturb(0, 1);
+ disturb(FALSE, TRUE);
}
}
if ((p_ptr->pclass != CLASS_RANGER) && !p_ptr->levitation && (!p_ptr->riding || !(riding_r_ptr->flags8 & RF8_WILD_WOOD))) p_ptr->energy_use *= 2;
}
-#ifdef ALLOW_EASY_DISARM /* TNB */
/* Disarm a visible trap */
else if ((do_pickup != easy_disarm) && have_flag(f_ptr->flags, FF_DISARM) && !c_ptr->mimic)
}
}
-#endif /* ALLOW_EASY_DISARM -- TNB */
/* Player can not walk through "walls" unless in wraith form...*/
else if (!p_can_enter && !p_can_kill_walls)
{
/* Feature code (applying "mimic" field) */
- s16b feat = get_feat_mimic(c_ptr);
+ FEAT_IDX feat = get_feat_mimic(c_ptr);
feature_type *mimic_f_ptr = &f_info[feat];
cptr name = f_name + mimic_f_ptr->name;
/* Wall (or secret door) */
else
{
-#ifdef ALLOW_EASY_OPEN
/* Closed doors */
if (easy_open && is_closed_door(feat) && easy_open_door(y, x)) return;
-#endif /* ALLOW_EASY_OPEN */
#ifdef JP
msg_format("%sが行く手をはばんでいる。", name);
}
}
- /* Disturb the player */
- disturb(0, 1);
+ disturb(FALSE, TRUE);
if (!boundary_floor(c_ptr, f_ptr, mimic_f_ptr)) sound(SOUND_HITWALL);
}
}
/* To avoid a loop with running */
- disturb(0, 1);
+ disturb(FALSE, TRUE);
oktomove = FALSE;
}
/* sound(SOUND_WALK); */
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
if (do_pickup != always_pickup) mpe_mode |= MPE_DO_PICKUP;
-
-#else /* ALLOW_EASY_DISARM -- TNB */
-
- if (do_pickup) mpe_mode |= MPE_DO_PICKUP;
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
-
if (break_trap) mpe_mode |= MPE_BREAK_TRAP;
/* Move the player */
}
-
-
-
-
/*
* Hack -- allow quick "cycling" through the legal directions
*/
-static byte cycle[] =
-{ 1, 2, 3, 6, 9, 8, 7, 4, 1, 2, 3, 6, 9, 8, 7, 4, 1 };
+static byte cycle[] = { 1, 2, 3, 6, 9, 8, 7, 4, 1, 2, 3, 6, 9, 8, 7, 4, 1 };
/*
* Hack -- map each direction into the "middle" of the "cycle[]" array
*/
-static byte chome[] =
-{ 0, 8, 9, 10, 7, 0, 11, 6, 5, 4 };
+static byte chome[] = { 0, 8, 9, 10, 7, 0, 11, 6, 5, 4 };
/*
* The direction we are running
static bool find_breakright;
static bool find_breakleft;
-
-
/*!
* @brief ダッシュ処理の導入 /
* Initialize the running algorithm for a new direction.
*/
static void run_init(DIRECTION dir)
{
- int row, col, deepleft, deepright;
- int i, shortleft, shortright;
-
+ int row, col, deepleft, deepright;
+ int i, shortleft, shortright;
/* Save the direction */
find_current = dir;
*/
static bool run_test(void)
{
- int prev_dir, new_dir, check_dir = 0;
- int row, col;
- int i, max, inv;
- int option = 0, option2 = 0;
- cave_type *c_ptr;
- s16b feat;
+ DIRECTION prev_dir, new_dir, check_dir = 0;
+ int row, col;
+ int i, max, inv;
+ int option = 0, option2 = 0;
+ cave_type *c_ptr;
+ FEAT_IDX feat;
feature_type *f_ptr;
/* Where we came from */
/* Look at every newly adjacent square. */
for (i = -max; i <= max; i++)
{
- s16b this_o_idx, next_o_idx = 0;
+ OBJECT_IDX this_o_idx, next_o_idx = 0;
/* New direction */
new_dir = cycle[chome[prev_dir] + i];
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 */
{
sound(SOUND_HITWALL);
- /* Message */
msg_print(_("その方向には走れません。", "You cannot run in that direction."));
- /* Disturb */
- disturb(0, 0);
+ disturb(FALSE, FALSE);
- /* Done */
return;
}
- /* Initialize */
run_init(dir);
}
/* Update run */
if (run_test())
{
- /* Disturb */
- disturb(0, 0);
+ disturb(FALSE, FALSE);
- /* Done */
return;
}
}
p_ptr->energy_use = 100;
/* Move the player, using the "pickup" flag */
-#ifdef ALLOW_EASY_DISARM /* TNB */
-
move_player(find_current, FALSE, FALSE);
-#else /* ALLOW_EASY_DISARM -- TNB */
-
- move_player(find_current, always_pickup, FALSE);
-
-#endif /* ALLOW_EASY_DISARM -- TNB */
-
if (player_bold(p_ptr->run_py, p_ptr->run_px))
{
p_ptr->run_py = 0;
p_ptr->run_px = 0;
- disturb(0, 0);
+ disturb(FALSE, FALSE);
}
}
* @brief トラベル機能の判定処理 /
* Test for traveling
* @param prev_dir 前回移動を行った元の方角ID
- * @return なし
+ * @return 次の方向
*/
-static int travel_test(int prev_dir)
+static DIRECTION travel_test(DIRECTION prev_dir)
{
- int new_dir = 0;
+ DIRECTION new_dir = 0;
int i, max;
const cave_type *c_ptr;
int cost;
DIRECTION dir = cycle[chome[prev_dir] + i];
/* New location */
- int row = p_ptr->y + ddy[dir];
- int col = p_ptr->x + ddx[dir];
+ POSITION row = p_ptr->y + ddy[dir];
+ POSITION col = p_ptr->x + ddx[dir];
/* Access grid */
c_ptr = &cave[row][col];
/* Get travel direction */
travel.dir = travel_test(travel.dir);
- /* disturb */
if (!travel.dir)
{
if (travel.run == 255)
msg_print(_("道筋が見つかりません!", "No route is found!"));
travel.y = travel.x = 0;
}
- disturb(0, 1);
+ disturb(FALSE, TRUE);
return;
}