* Note that the chest itself is never destroyed.
* </pre>
*/
-static void chest_trap(int y, int x, s16b o_idx)
+static void chest_trap(POSITION y, POSITION x, KIND_OBJECT_IDX o_idx)
{
int i, trap;
* @param feat 地形ID
* @return 開いた地形である場合TRUEを返す / Return TRUE if the given feature is an open door
*/
-static bool is_open(int feat)
+static bool is_open(IDX feat)
{
return have_flag(f_info[feat].flags, FF_CLOSE) && (feat != feat_state(feat, FF_CLOSE));
}
* @details Return the number of features around (or under) the character.
* Usually look for doors and floor traps.
*/
-static int count_dt(int *y, int *x, bool (*test)(int feat), bool under)
+static int count_dt(POSITION *y, POSITION *x, bool (*test)(IDX feat), bool under)
{
int d, count, xx, yy;
* @details
* If requested, count only trapped chests.
*/
-static int count_chests(int *y, int *x, bool trapped)
+static int count_chests(POSITION *y, POSITION *x, bool trapped)
{
- int d, count, o_idx;
+ int d, count;
+ IDX o_idx;
object_type *o_ptr;
* @param x 方角を確認したX座標
* @return 方向ID
*/
-static int coords_to_dir(int y, int x)
+static DIRECTION coords_to_dir(POSITION y, POSITION x)
{
int d[3][3] = { {7, 4, 1}, {8, 5, 2}, {9, 6, 3} };
int dy, dx;
*/
void do_cmd_open(void)
{
- int y, x, dir;
-
- s16b o_idx;
+ POSITION y, x;
+ DIRECTION dir;
+ IDX o_idx;
bool more = FALSE;
*/
void do_cmd_close(void)
{
- int y, x, dir;
+ POSITION y, x;
+ DIRECTION dir;
bool more = FALSE;
*/
void do_cmd_disarm(void)
{
- int y, x, dir;
-
+ POSITION y, x;
+ DIRECTION dir;
s16b o_idx;
bool more = FALSE;
/* See if only one target */
if (num_traps || num_chests)
{
- bool too_many = (num_traps && num_chests) || (num_traps > 1) ||
- (num_chests > 1);
+ bool too_many = (num_traps && num_chests) || (num_traps > 1) || (num_chests > 1);
if (!too_many) command_dir = coords_to_dir(y, x);
}
}
}
/* Get a "repeated" direction */
- if (get_rep_dir(&dir,FALSE))
+ if (get_rep_dir(&dir, FALSE))
{
/* Take a turn */
p_ptr->energy_use = 100;
/* Rest some */
else
{
- command_arg = atoi(out_val);
+ command_arg = (COMMAND_ARG)atoi(out_val);
if (command_arg <= 0) return;
}
}
/* Monster here, Try to hit it */
if (cave[y][x].m_idx)
{
- int armour;
- cave_type *c_ptr = &cave[y][x];
+ cave_type *c_mon_ptr = &cave[y][x];
- monster_type *m_ptr = &m_list[c_ptr->m_idx];
+ monster_type *m_ptr = &m_list[c_mon_ptr->m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Check the visibility */
int now_exp = p_ptr->weapon_exp[0][j_ptr->sval];
if (now_exp < s_info[p_ptr->pclass].w_max[0][j_ptr->sval])
{
- int amount = 0;
+ SUB_EXP amount = 0;
if (now_exp < WEAPON_EXP_BEGINNER) amount = 80;
else if (now_exp < WEAPON_EXP_SKILLED) amount = 25;
else if ((now_exp < WEAPON_EXP_EXPERT) && (p_ptr->lev > 19)) amount = 10;
if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx);
/* Hack -- Track this monster */
- health_track(c_ptr->m_idx);
+ health_track(c_mon_ptr->m_idx);
}
}
tdam = mon_damage_mod(m_ptr, tdam, FALSE);
}
- /* Complex message */
- if (p_ptr->wizard || cheat_xtra)
- {
- msg_format(_("%d/%d のダメージを与えた。", "You do %d (out of %d) damage."), tdam, m_ptr->hp);
- }
+ msg_format_wizard(CHEAT_MONSTER,
+ _("%dのダメージを与えた。(残りHP %d/%d(%d))", "You do %d damage. (left HP %d/%d(%d))"),
+ tdam, m_ptr->hp - tdam, m_ptr->maxhp, m_ptr->max_maxhp);
/* Sniper */
if (snipe_type == SP_EXPLODE)
}
/* Hit the monster, check for death */
- if (mon_take_hit(c_ptr->m_idx, tdam, &fear, extract_note_dies(real_r_ptr(m_ptr))))
+ if (mon_take_hit(c_mon_ptr->m_idx, tdam, &fear, extract_note_dies(real_r_ptr(m_ptr))))
{
/* Dead monster */
}
}
/* Message */
- message_pain(c_ptr->m_idx, tdam);
+ message_pain(c_mon_ptr->m_idx, tdam);
/* Anger the monster */
if (tdam > 0) anger_monster(m_ptr);
if (snipe_type == SP_RUSH)
{
int n = randint1(5) + 3;
- int m_idx = c_ptr->m_idx;
+ MONSTER_IDX m_idx = c_mon_ptr->m_idx;
for ( ; cur_dis <= tdis; )
{
- int ox = nx;
- int oy = ny;
+ POSITION ox = nx;
+ POSITION oy = ny;
if (!n) break;
m_ptr->fy = ny;
/* Update the monster (new location) */
- update_mon(c_ptr->m_idx, TRUE);
+ update_mon(c_mon_ptr->m_idx, TRUE);
lite_spot(ny, nx);
lite_spot(oy, ox);
if (stick_to)
{
- int m_idx = cave[y][x].m_idx;
+ MONSTER_IDX m_idx = cave[y][x].m_idx;
monster_type *m_ptr = &m_list[m_idx];
- int o_idx = o_pop();
+ IDX o_idx = o_pop();
if (!o_idx)
{
*/
void do_cmd_fire(void)
{
- int item;
+ OBJECT_IDX item;
object_type *j_ptr;
cptr q, s;
return;
}
+ if (j_ptr->sval == SV_HARP)
+ {
+ msg_print(_("この武器で射撃はできない。", "It's not for firing."));
+ flush();
+ return;
+ }
+
if (p_ptr->special_defense & KATA_MUSOU)
{
* the item to be destroyed? Should it do any damage at all?
* </pre>
*/
-bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken)
+bool do_cmd_throw_aux(int mult, bool boomerang, OBJECT_IDX shuriken)
{
- int dir, item;
+ DIRECTION dir;
+ OBJECT_IDX item;
int i, j, y, x, ty, tx, prev_y, prev_x;
int ny[19], nx[19];
int chance, tdam, tdis;
/* Modify the damage */
tdam = mon_damage_mod(m_ptr, tdam, FALSE);
- /* Complex message */
- if (p_ptr->wizard)
- {
- msg_format(_("%d/%dのダメージを与えた。", "You do %d (out of %d) damage."), tdam, m_ptr->hp);
- }
+ msg_format_wizard(CHEAT_MONSTER, _("%dのダメージを与えた。(残りHP %d/%d(%d))", "You do %d damage. (left HP %d/%d(%d))"),
+ tdam, m_ptr->hp - tdam, m_ptr->maxhp, m_ptr->max_maxhp);
/* Hit the monster, check for death */
if (mon_take_hit(c_ptr->m_idx, tdam, &fear, extract_note_dies(real_r_ptr(m_ptr))))
static int flow_head = 0;
static int flow_tail = 0;
-static s16b temp2_x[MAX_SHORT];
-static s16b temp2_y[MAX_SHORT];
+static POSITION temp2_x[MAX_SHORT];
+static POSITION temp2_y[MAX_SHORT];
/*!
* @brief トラベル処理の記憶配列を初期化する Hack: forget the "flow" information
* @param wall プレイヤーが壁の中にいるならばTRUE
* @return なし
*/
-static void travel_flow_aux(int y, int x, int n, bool wall)
+static void travel_flow_aux(POSITION y, POSITION x, int n, bool wall)
{
cave_type *c_ptr = &cave[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
*/
void do_cmd_travel(void)
{
- int x, y, i;
+ POSITION x, y;
+ int i;
int dx, dy, sx, sy;
feature_type *f_ptr;