* @param mode オプション
* @return テレポート先として妥当ならばtrue
*/
-static bool cave_monster_teleportable_bold(int m_idx, int y, int x, u32b mode)
+static bool cave_monster_teleportable_bold(MONSTER_IDX m_idx, int y, int x, BIT_FLAGS mode)
{
monster_type *m_ptr = &m_list[m_idx];
cave_type *c_ptr = &cave[y][x];
* Attempt to move the monster at least "dis/2" grids away.
* But allow variation to prevent infinite loops.
*/
-bool teleport_away(int m_idx, int dis, u32b mode)
+bool teleport_away(MONSTER_IDX m_idx, int dis, BIT_FLAGS mode)
{
int oy, ox, d, i, min;
int tries = 0;
- int ny = 0, nx = 0;
+ POSITION ny = 0, nx = 0;
bool look = TRUE;
* @param mode オプション
* @return なし
*/
-void teleport_monster_to(int m_idx, int ty, int tx, int power, u32b mode)
+void teleport_monster_to(MONSTER_IDX m_idx, POSITION ty, POSITION tx, int power, BIT_FLAGS mode)
{
int ny, nx, oy, ox, d, i, min;
int attempts = 500;
* @param mode オプション
* @return テレポート先として妥当ならばtrue
*/
-bool cave_player_teleportable_bold(int y, int x, u32b mode)
+bool cave_player_teleportable_bold(int y, int x, BIT_FLAGS mode)
{
cave_type *c_ptr = &cave[y][x];
feature_type *f_ptr = &f_info[c_ptr->feat];
* </pre>
*/
-bool teleport_player_aux(int dis, u32b mode)
+bool teleport_player_aux(int dis, BIT_FLAGS mode)
{
int candidates_at[MAX_TELEPORT_DISTANCE + 1];
int total_candidates, cur_candidates;
- int y = 0, x = 0, min, pick, i;
+ POSITION y = 0, x = 0;
+ int min, pick, i;
- int left = MAX(1, px - dis);
- int right = MIN(cur_wid - 2, px + dis);
- int top = MAX(1, py - dis);
- int bottom = MIN(cur_hgt - 2, py + dis);
+ int left = MAX(1, p_ptr->x - dis);
+ int right = MIN(cur_wid - 2, p_ptr->x + dis);
+ int top = MAX(1, p_ptr->y - dis);
+ int bottom = MIN(cur_hgt - 2, p_ptr->y + dis);
if (p_ptr->wild_mode) return FALSE;
if (!cave_player_teleportable_bold(y, x, mode)) continue;
/* Calculate distance */
- d = distance(py, px, y, x);
+ d = distance(p_ptr->y, p_ptr->x, y, x);
/* Skip too far locations */
if (d > dis) continue;
if (!cave_player_teleportable_bold(y, x, mode)) continue;
/* Calculate distance */
- d = distance(py, px, y, x);
+ d = distance(p_ptr->y, p_ptr->x, y, x);
/* Skip too far locations */
if (d > dis) continue;
#ifdef JP
if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
- msg_format("『こっちだぁ、%s』", player_name);
+ msg_format("『こっちだぁ、%s』", p_ptr->name);
#endif
/* Move the player */
* @param mode オプション
* @return なし
*/
-void teleport_player(int dis, u32b mode)
+void teleport_player(int dis, BIT_FLAGS mode)
{
int yy, xx;
/* Save the old location */
- int oy = py;
- int ox = px;
+ int oy = p_ptr->y;
+ int ox = p_ptr->x;
if (!teleport_player_aux(dis, mode)) return;
{
for (yy = -1; yy < 2; yy++)
{
- int tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
+ MONSTER_IDX tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
/* A monster except your mount may follow */
if (tmp_m_idx && (p_ptr->riding != tmp_m_idx))
* The latter limitation is to avoid
* totally unkillable suckers...
*/
- if ((r_ptr->flags6 & RF6_TPORT) &&
+ if ((r_ptr->a_ability_flags2 & RF6_TPORT) &&
!(r_ptr->flagsr & RFR_RES_TELE))
{
- if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, py, px, r_ptr->level, 0L);
+ if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, p_ptr->y, p_ptr->x, r_ptr->level, 0L);
}
}
}
* @param dis テレポート距離
* @return なし
*/
-void teleport_player_away(int m_idx, int dis)
+void teleport_player_away(MONSTER_IDX m_idx, int dis)
{
int yy, xx;
/* Save the old location */
- int oy = py;
- int ox = px;
+ int oy = p_ptr->y;
+ int ox = p_ptr->x;
if (!teleport_player_aux(dis, TELEPORT_PASSIVE)) return;
{
for (yy = -1; yy < 2; yy++)
{
- int tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
+ IDX tmp_m_idx = cave[oy+yy][ox+xx].m_idx;
/* A monster except your mount or caster may follow */
if (tmp_m_idx && (p_ptr->riding != tmp_m_idx) && (m_idx != tmp_m_idx))
* The latter limitation is to avoid
* totally unkillable suckers...
*/
- if ((r_ptr->flags6 & RF6_TPORT) &&
+ if ((r_ptr->a_ability_flags2 & RF6_TPORT) &&
!(r_ptr->flagsr & RFR_RES_TELE))
{
- if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, py, px, r_ptr->level, 0L);
+ if (!MON_CSLEEP(m_ptr)) teleport_monster_to(tmp_m_idx, p_ptr->y, p_ptr->x, r_ptr->level, 0L);
}
}
}
* This function allows teleporting into vaults (!)
* </pre>
*/
-void teleport_player_to(int ny, int nx, u32b mode)
+void teleport_player_to(POSITION ny, POSITION nx, BIT_FLAGS mode)
{
- int y, x, dis = 0, ctr = 0;
+ POSITION y, x;
+ int dis = 0, ctr = 0;
if (p_ptr->anti_tele && !(mode & TELEPORT_NONMAGICAL))
{
/* Pick a nearby legal location */
while (1)
{
- y = rand_spread(ny, dis);
- x = rand_spread(nx, dis);
+ y = (POSITION)rand_spread(ny, dis);
+ x = (POSITION)rand_spread(nx, dis);
if (in_bounds(y, x)) break;
}
}
-void teleport_away_followable(int m_idx)
+void teleport_away_followable(MONSTER_IDX m_idx)
{
monster_type *m_ptr = &m_list[m_idx];
int oldfy = m_ptr->fy;
teleport_away(m_idx, MAX_SIGHT * 2 + 5, 0L);
- if (old_ml && (old_cdis <= MAX_SIGHT) && !world_monster && !p_ptr->inside_battle && los(py, px, oldfy, oldfx))
+ if (old_ml && (old_cdis <= MAX_SIGHT) && !world_monster && !p_ptr->inside_battle && los(p_ptr->y, p_ptr->x, oldfy, oldfx))
{
bool follow = FALSE;
* @param m_idx テレポートの対象となるモンスターID(0ならばプレイヤー) / If m_idx <= 0, target is player.
* @return なし
*/
-void teleport_level(int m_idx)
+void teleport_level(MONSTER_IDX m_idx)
{
bool go_up;
char m_name[160];
{
if (!dun_level)
{
- dungeon_type = p_ptr->recall_dungeon;
- p_ptr->oldpy = py;
- p_ptr->oldpx = px;
+ dungeon_type = ironman_downward ? DUNGEON_ANGBAND : p_ptr->recall_dungeon;
+ p_ptr->oldpy = p_ptr->y;
+ p_ptr->oldpx = p_ptr->x;
}
if (record_stair) do_cmd_write_nikki(NIKKI_TELE_LEV, 1, NULL);
/*!
- * @brief プレイヤー及びモンスターをレベルテレポートさせる /
- * Teleport the player one level up or down (random when legal)
- * @param m_idx テレポートの対象となるモンスターID(0ならばプレイヤー) / If m_idx <= 0, target is player.
- * @return なし
+ * @brief これまでに入ったダンジョンの一覧を表示し、選択させる。
+ * @param note ダンジョンに施す処理記述
+ * @param y コンソールY座標
+ * @param x コンソールX座標
+ * @return 選択されたダンジョンID
*/
-int choose_dungeon(cptr note, int y, int x)
+DUNGEON_IDX choose_dungeon(cptr note, POSITION y, POSITION x)
{
- int select_dungeon;
- int i, num = 0;
- s16b *dun;
+ DUNGEON_IDX select_dungeon;
+ DUNGEON_IDX i;
+ int num = 0;
+ DUNGEON_IDX *dun;
/* Hack -- No need to choose dungeon in some case */
if (lite_town || vanilla_town || ironman_downward)
else if (max_dlv[i] == d_info[i].maxdepth) seiha = TRUE;
sprintf(buf,_(" %c) %c%-12s : 最大 %d 階", " %c) %c%-16s : Max level %d"),
- 'a'+num, seiha ? '!' : ' ', d_name + d_info[i].name, max_dlv[i]);
+ 'a'+num, seiha ? '!' : ' ', d_name + d_info[i].name, (int)max_dlv[i]);
prt(buf, y + num, x);
dun[num++] = i;
}
/*!
* @brief プレイヤーの帰還発動及び中止処理 /
* Recall the player to town or dungeon
- * @param turn 発動までのターン数
+ * @param turns 発動までのターン数
* @return 常にTRUEを返す
*/
-bool recall_player(int turns)
+bool recall_player(TIME_EFFECT turns)
{
/*
* TODO: Recall the player to the last
{
if (!dun_level)
{
- int select_dungeon;
+ DUNGEON_IDX select_dungeon;
select_dungeon = choose_dungeon(_("に帰還", "recall"), 2, 14);
if (!select_dungeon) return FALSE;
p_ptr->recall_dungeon = select_dungeon;
/*!
* @brief 帰還用メインルーチン
- * @param turn 発動までのターン数
* @return 常にTRUEを返す
*/
bool word_of_recall(void)
if (!select_dungeon) return FALSE;
/* Prompt */
- sprintf(ppp, _("何階にセットしますか (%d-%d):", "Reset to which level (%d-%d): "), d_info[select_dungeon].mindepth, max_dlv[select_dungeon]);
+ sprintf(ppp, _("何階にセットしますか (%d-%d):", "Reset to which level (%d-%d): "),
+ (int)d_info[select_dungeon].mindepth, (int)max_dlv[select_dungeon]);
/* Default */
- sprintf(tmp_val, "%d", MAX(dun_level, 1));
+ sprintf(tmp_val, "%d", (int)MAX(dun_level, 1));
/* Ask for a level */
if (get_string(ppp, tmp_val, 10))
* @return 劣化処理に関するメッセージが発せられた場合はTRUEを返す /
* Return "TRUE" if the player notices anything
*/
-bool apply_disenchant(int mode)
+bool apply_disenchant(BIT_FLAGS mode)
{
int t = 0;
object_type *o_ptr;
*/
void mutate_player(void)
{
- int max1, cur1, max2, cur2, ii, jj, i;
+ BASE_STATUS max1, cur1, max2, cur2;
+ int ii, jj, i;
/* Pick a pair of stats */
ii = randint0(6);
*/
void phlogiston(void)
{
- int max_flog = 0;
+ GAME_TURN max_flog = 0;
object_type * o_ptr = &inventory[INVEN_LITE];
/* It's a lamp */
}
/* Refuel */
- o_ptr->xtra4 += (max_flog / 2);
+ o_ptr->xtra4 += (XTRA16)(max_flog / 2);
/* Message */
msg_print(_("照明用アイテムに燃素を補充した。", "You add phlogiston to your light item."));
/* Comment */
if (o_ptr->xtra4 >= max_flog)
{
- o_ptr->xtra4 = max_flog;
+ o_ptr->xtra4 = (XTRA16)max_flog;
msg_print(_("照明用アイテムは満タンになった。", "Your light item is full."));
}
*/
void brand_weapon(int brand_type)
{
- int item;
+ OBJECT_IDX item;
object_type *o_ptr;
cptr q, s;
act = _("は鋭さを増した!", "becomes very sharp!");
o_ptr->name2 = EGO_SHARPNESS;
- o_ptr->pval = m_bonus(5, dun_level) + 1;
+ o_ptr->pval = (PARAMETER_VALUE)m_bonus(5, dun_level) + 1;
if ((o_ptr->sval == SV_HAYABUSA) && (o_ptr->pval > 2))
o_ptr->pval = 2;
{
act = _("は破壊力を増した!", "seems very powerful.");
o_ptr->name2 = EGO_EARTHQUAKES;
- o_ptr->pval = m_bonus(3, dun_level);
+ o_ptr->pval = (PARAMETER_VALUE)m_bonus(3, dun_level);
}
break;
case 16:
for (i = 0; i < 9; i++)
{
- c_ptr = &cave[py + ddy_ddd[i]][px + ddx_ddd[i]];
+ c_ptr = &cave[p_ptr->y + ddy_ddd[i]][p_ptr->x + ddx_ddd[i]];
if (!cave_have_flag_grid(c_ptr, FF_PROJECT))
{
}
else
{
- if (destroy_area(py, px, 15 + p_ptr->lev + randint0(11), FALSE))
+ if (destroy_area(p_ptr->y, p_ptr->x, 15 + p_ptr->lev + randint0(11), FALSE))
msg_print(_("ダンジョンが崩壊した...", "The dungeon collapses..."));
else
msg_print(_("ダンジョンは大きく揺れた。", "The dungeon trembles."));
* @param require_los 射線の通りを要求するならばTRUE
* @return なし
*/
-void fetch(int dir, int wgt, bool require_los)
+void fetch(DIRECTION dir, WEIGHT wgt, bool require_los)
{
- int ty, tx, i;
- cave_type *c_ptr;
- object_type *o_ptr;
- char o_name[MAX_NLEN];
+ POSITION ty, tx;
+ OBJECT_IDX i;
+ cave_type *c_ptr;
+ object_type *o_ptr;
+ char o_name[MAX_NLEN];
/* Check to see if an object is already there */
- if (cave[py][px].o_idx)
+ if (cave[p_ptr->y][p_ptr->x].o_idx)
{
msg_print(_("自分の足の下にある物は取れません。", "You can't fetch when you're already standing on something."));
return;
tx = target_col;
ty = target_row;
- if (distance(py, px, ty, tx) > MAX_RANGE)
+ if (distance(p_ptr->y, p_ptr->x, ty, tx) > MAX_RANGE)
{
msg_print(_("そんなに遠くにある物は取れません!", "You can't fetch something that far away!"));
return;
msg_print(_("そこはあなたの視界に入っていません。", "You have no direct line of sight to that location."));
return;
}
- else if (!projectable(py, px, ty, tx))
+ else if (!projectable(p_ptr->y, p_ptr->x, ty, tx))
{
msg_print(_("そこは壁の向こうです。", "You have no direct line of sight to that location."));
return;
else
{
/* Use a direction */
- ty = py; /* Where to drop the item */
- tx = px;
+ ty = p_ptr->y; /* Where to drop the item */
+ tx = p_ptr->x;
do
{
tx += ddx[dir];
c_ptr = &cave[ty][tx];
- if ((distance(py, px, ty, tx) > MAX_RANGE) ||
+ if ((distance(p_ptr->y, p_ptr->x, ty, tx) > MAX_RANGE) ||
!cave_have_flag_bold(ty, tx, FF_PROJECT)) return;
}
while (!c_ptr->o_idx);
i = c_ptr->o_idx;
c_ptr->o_idx = o_ptr->next_o_idx;
- cave[py][px].o_idx = i; /* 'move' it */
+ cave[p_ptr->y][p_ptr->x].o_idx = i; /* 'move' it */
+
o_ptr->next_o_idx = 0;
- o_ptr->iy = (byte)py;
- o_ptr->ix = (byte)px;
+ o_ptr->iy = (byte)p_ptr->y;
+ o_ptr->ix = (byte)p_ptr->x;
object_desc(o_name, o_ptr, OD_NAME_ONLY);
msg_format(_("%^sがあなたの足元に飛んできた。", "%^s flies through the air to your feet."), o_name);
- note_spot(py, px);
+ note_spot(p_ptr->y, p_ptr->x);
p_ptr->redraw |= PR_MAP;
}
if (!p_ptr->alter_reality)
{
- int turns = randint0(21) + 15;
+ TIME_EFFECT turns = randint0(21) + 15;
p_ptr->alter_reality = turns;
msg_print(_("回りの景色が変わり始めた...", "The view around you begins to change..."));
bool warding_glyph(void)
{
/* XXX XXX XXX */
- if (!cave_clean_bold(py, px))
+ if (!cave_clean_bold(p_ptr->y, p_ptr->x))
{
msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
return FALSE;
}
/* Create a glyph */
- cave[py][px].info |= CAVE_OBJECT;
- cave[py][px].mimic = feat_glyph;
+ cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+ cave[p_ptr->y][p_ptr->x].mimic = feat_glyph;
/* Notice */
- note_spot(py, px);
+ note_spot(p_ptr->y, p_ptr->x);
/* Redraw */
- lite_spot(py, px);
+ lite_spot(p_ptr->y, p_ptr->x);
return TRUE;
}
bool place_mirror(void)
{
/* XXX XXX XXX */
- if (!cave_clean_bold(py, px))
+ if (!cave_clean_bold(p_ptr->y, p_ptr->x))
{
msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
return FALSE;
}
/* Create a mirror */
- cave[py][px].info |= CAVE_OBJECT;
- cave[py][px].mimic = feat_mirror;
+ cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+ cave[p_ptr->y][p_ptr->x].mimic = feat_mirror;
/* Turn on the light */
- cave[py][px].info |= CAVE_GLOW;
+ cave[p_ptr->y][p_ptr->x].info |= CAVE_GLOW;
/* Notice */
- note_spot(py, px);
+ note_spot(p_ptr->y, p_ptr->x);
/* Redraw */
- lite_spot(py, px);
+ lite_spot(p_ptr->y, p_ptr->x);
- update_local_illumination(py, px);
+ update_local_illumination(p_ptr->y, p_ptr->x);
return TRUE;
}
bool explosive_rune(void)
{
/* XXX XXX XXX */
- if (!cave_clean_bold(py, px))
+ if (!cave_clean_bold(p_ptr->y, p_ptr->x))
{
msg_print(_("床上のアイテムが呪文を跳ね返した。", "The object resists the spell."));
return FALSE;
}
/* Create a glyph */
- cave[py][px].info |= CAVE_OBJECT;
- cave[py][px].mimic = feat_explosive_rune;
+ cave[p_ptr->y][p_ptr->x].info |= CAVE_OBJECT;
+ cave[p_ptr->y][p_ptr->x].mimic = feat_explosive_rune;
/* Notice */
- note_spot(py, px);
+ note_spot(p_ptr->y, p_ptr->x);
/* Redraw */
- lite_spot(py, px);
+ lite_spot(p_ptr->y, p_ptr->x);
return TRUE;
}
-/*
+/*!
+ * @brief 全所持アイテム鑑定処理 /
* Identify everything being carried.
* Done by a potion of "self knowledge".
+ * @return なし
*/
void identify_pack(void)
{
}
-/*
+/*!
+ * @brief 装備強化処理の失敗率定数(千分率) /
* Used by the "enchant" function (chance of failure)
* (modified for Zangband, we need better stuff there...) -- TY
+ * @return なし
*/
static int enchant_table[16] =
{
};
-/*
+/*!
+ * @brief 装備の解呪処理 /
* Removes curses from items in inventory
- *
+ * @param all 軽い呪いまでの解除ならば0
+ * @return 解呪されたアイテムの数
+ * @details
+ * <pre>
* Note that Items which are "Perma-Cursed" (The One Ring,
* The Crown of Morgoth) can NEVER be uncursed.
*
* Note that if "all" is FALSE, then Items which are
* "Heavy-Cursed" (Mormegil, Calris, and Weapons of Morgul)
* will not be uncursed.
+ * </pre>
*/
static int remove_curse_aux(int all)
{
}
-/*
+/*!
+ * @brief 装備の軽い呪い解呪処理 /
* Remove most curses
+ * @return 解呪に成功した装備数
*/
-bool remove_curse(void)
+int remove_curse(void)
{
return (remove_curse_aux(FALSE));
}
-/*
+/*!
+ * @brief 装備の重い呪い解呪処理 /
* Remove all curses
+ * @return 解呪に成功した装備数
*/
-bool remove_all_curse(void)
+int remove_all_curse(void)
{
return (remove_curse_aux(TRUE));
}
-/*
+/*!
+ * @brief アイテムの価値に応じた錬金術処理 /
* Turns an object into gold, gain some of its value in a shop
+ * @return 処理が実際に行われたらTRUEを返す
*/
bool alchemy(void)
{
- int item, amt = 1;
- int old_number;
- long price;
+ OBJECT_IDX item;
+ int amt = 1;
+ ITEM_NUMBER old_number;
+ PRICE price;
bool force = FALSE;
object_type *o_ptr;
char o_name[MAX_NLEN];
}
-/*
+/*!
+ * @brief 呪いの打ち破り処理 /
* Break the curse of an item
+ * @param o_ptr 呪い装備情報の参照ポインタ
+ * @return なし
*/
static void break_curse(object_type *o_ptr)
{
}
-/*
+/*!
+ * @brief 装備修正強化処理 /
* Enchants a plus onto an item. -RAK-
- *
+ * @param o_ptr 強化するアイテムの参照ポインタ
+ * @param n 強化基本量
+ * @param eflag 強化オプション(命中/ダメージ/AC)
+ * @return 強化に成功した場合TRUEを返す
+ * @details
+ * <pre>
* Revamped! Now takes item pointer, number of times to try enchanting,
* and a flag of what to try enchanting. Artifacts resist enchantment
* some of the time, and successful enchantment to at least +0 might
*
* Note that this function can now be used on "piles" of items, and
* the larger the pile, the lower the chance of success.
+ * </pre>
*/
bool enchant(object_type *o_ptr, int n, int eflag)
{
}
-
-/*
+/*!
+ * @brief 装備修正強化処理のメインルーチン /
* Enchant an item (in the inventory or on the floor)
+ * @param num_hit 命中修正量
+ * @param num_dam ダメージ修正量
+ * @param num_ac AC修正量
+ * @return 強化に成功した場合TRUEを返す
+ * @details
* Note that "num_ac" requires armour, else weapon
* Returns TRUE if attempted, FALSE if cancelled
*/
-bool enchant_spell(int num_hit, int num_dam, int num_ac)
+bool enchant_spell(HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac)
{
- int item;
+ OBJECT_IDX item;
bool okay = FALSE;
object_type *o_ptr;
char o_name[MAX_NLEN];
}
-/*
+/*!
+ * @brief アイテムが並の価値のアイテムかどうか判定する /
* Check if an object is nameless weapon or armour
+ * @param o_ptr 判定するアイテムの情報参照ポインタ
+ * @return 並ならばTRUEを返す
*/
static bool item_tester_hook_nameless_weapon_armour(object_type *o_ptr)
{
return TRUE;
}
-
+/*!
+ * @brief アーティファクト生成の巻物処理 /
+ * @return 生成が実際に試みられたらTRUEを返す
+ */
bool artifact_scroll(void)
{
- int item;
+ OBJECT_IDX item;
bool okay = FALSE;
object_type *o_ptr;
char o_name[MAX_NLEN];
if (one_in_(3)) chg_virtue(V_ENCHANT, -1);
}
else
+ {
+ if (record_rand_art)
+ {
+ /* Description */
+ object_desc(o_name, o_ptr, OD_NAME_ONLY);
+ do_cmd_write_nikki(NIKKI_ART_SCROLL, 0, o_name);
+ }
chg_virtue(V_ENCHANT, 1);
+ }
calc_android_exp();
}
-/*
+/*!
+ * @brief アイテム鑑定処理 /
* Identify an object
+ * @param o_ptr 鑑定されるアイテムの情報参照ポインタ
+ * @return 実際に鑑定できたらTRUEを返す
*/
bool identify_item(object_type *o_ptr)
{
return old_known;
}
-
+/*!
+ * @brief アイテムが鑑定済みかを判定する /
+ * @param o_ptr 判定するアイテムの情報参照ポインタ
+ * @return 実際に鑑定済みならばTRUEを返す
+ */
static bool item_tester_hook_identify(object_type *o_ptr)
{
return (bool)!object_is_known(o_ptr);
}
+/*!
+ * @brief アイテムが鑑定済みの武器防具かを判定する /
+ * @param o_ptr 判定するアイテムの情報参照ポインタ
+ * @return 実際に鑑定済みならばTRUEを返す
+ */
static bool item_tester_hook_identify_weapon_armour(object_type *o_ptr)
{
if (object_is_known(o_ptr))
return object_is_weapon_armour_ammo(o_ptr);
}
-/*
+/*!
+ * @brief アイテム鑑定のメインルーチン処理 /
* Identify an object in the inventory (or on the floor)
+ * @param only_equip 装備品のみを対象とするならばTRUEを返す
+ * @return 実際に鑑定を行ったならばTRUEを返す
+ * @details
* This routine does *not* automatically combine objects.
* Returns TRUE if something was identified, else FALSE.
*/
bool ident_spell(bool only_equip)
{
- int item;
+ OBJECT_IDX item;
object_type *o_ptr;
char o_name[MAX_NLEN];
cptr q, s;
}
-/*
+/*!
+ * @brief アイテム凡庸化のメインルーチン処理 /
+ * Identify an object in the inventory (or on the floor)
+ * @param only_equip 装備品のみを対象とするならばTRUEを返す
+ * @return 実際に凡庸化をを行ったならばTRUEを返す
+ * @details
+ * <pre>
* Mundanify an object in the inventory (or on the floor)
* This routine does *not* automatically combine objects.
* Returns TRUE if something was mundanified, else FALSE.
+ * </pre>
*/
bool mundane_spell(bool only_equip)
{
- int item;
+ OBJECT_IDX item;
object_type *o_ptr;
cptr q, s;
/* Oops */
msg_print(_("まばゆい閃光が走った!", "There is a bright flash of light!"));
{
- byte iy = o_ptr->iy; /* Y-position on map, or zero */
- byte ix = o_ptr->ix; /* X-position on map, or zero */
+ POSITION iy = o_ptr->iy; /* Y-position on map, or zero */
+ POSITION ix = o_ptr->ix; /* X-position on map, or zero */
s16b next_o_idx = o_ptr->next_o_idx; /* Next object in stack (if any) */
byte marked = o_ptr->marked; /* Object is marked */
s16b weight = o_ptr->number * o_ptr->weight;
return TRUE;
}
-
-
+/*!
+ * @brief アイテムが*鑑定*済みかを判定する /
+ * @param o_ptr 判定するアイテムの情報参照ポインタ
+ * @return 実際に鑑定済みならばTRUEを返す
+ */
static bool item_tester_hook_identify_fully(object_type *o_ptr)
{
return (bool)(!object_is_known(o_ptr) || !(o_ptr->ident & IDENT_MENTAL));
}
+/*!
+ * @brief アイテムが*鑑定*済みの武器防具かを判定する /
+ * @param o_ptr 判定するアイテムの情報参照ポインタ
+ * @return 実際に鑑定済みならばTRUEを返す
+ */
static bool item_tester_hook_identify_fully_weapon_armour(object_type *o_ptr)
{
if (!item_tester_hook_identify_fully(o_ptr))
return object_is_weapon_armour_ammo(o_ptr);
}
-/*
+/*!
+ * @brief アイテム*鑑定*のメインルーチン処理 /
+ * Identify an object in the inventory (or on the floor)
+ * @param only_equip 装備品のみを対象とするならばTRUEを返す
+ * @return 実際に鑑定を行ったならばTRUEを返す
+ * @details
* Fully "identify" an object in the inventory -BEN-
* This routine returns TRUE if an item was identified.
*/
bool identify_fully(bool only_equip)
{
- int item;
+ OBJECT_IDX item;
object_type *o_ptr;
char o_name[MAX_NLEN];
cptr q, s;
}
-
-
-/*
+/*!
+ * @brief 魔力充填が可能なアイテムかどうか判定する /
* Hook for "get_item()". Determine if something is rechargable.
+ * @param o_ptr 判定するアイテムの情報参照ポインタ
+ * @return 魔力充填が可能ならばTRUEを返す
*/
bool item_tester_hook_recharge(object_type *o_ptr)
{
}
-/*
+/*!
+ * @brief 魔力充填処理 /
* Recharge a wand/staff/rod from the pack or on the floor.
* This function has been rewritten in Oangband and ZAngband.
+ * @param power 充填パワー
+ * @return ターン消費を要する処理まで進んだらTRUEを返す
*
* Sorcery/Arcane -- Recharge --> recharge(plev * 4)
* Chaos -- Arcane Binding --> recharge(90)
*/
bool recharge(int power)
{
- int item, lev;
- int recharge_strength, recharge_amount;
+ OBJECT_IDX item;
+ int lev;
+ int recharge_strength;
+ TIME_EFFECT recharge_amount;
object_type *o_ptr;
object_kind *k_ptr;
*/
if ((o_ptr->tval == TV_STAFF) && (o_ptr->number > 1))
{
- recharge_amount /= o_ptr->number;
+ recharge_amount /= (TIME_EFFECT)o_ptr->number;
if (recharge_amount < 1) recharge_amount = 1;
}
}
-/*
+/*!
+ * @brief 武器の祝福処理 /
* Bless a weapon
+ * @return ターン消費を要する処理を行ったならばTRUEを返す
*/
bool bless_weapon(void)
{
- int item;
+ OBJECT_IDX item;
object_type *o_ptr;
- u32b flgs[TR_FLAG_SIZE];
+ BIT_FLAGS flgs[TR_FLAG_SIZE];
char o_name[MAX_NLEN];
cptr q, s;
}
-/*
+/*!
+ * @brief 盾磨き処理 /
* pulish shield
+ * @return ターン消費を要する処理を行ったならばTRUEを返す
*/
bool pulish_shield(void)
{
- int item;
+ OBJECT_IDX item;
object_type *o_ptr;
u32b flgs[TR_FLAG_SIZE];
char o_name[MAX_NLEN];
}
-/*
+/*!
+ * @brief 薬の破損効果処理 /
* Potions "smash open" and cause an area effect when
+ * @param who 薬破損の主体ID(プレイヤー所持アイテムが壊れた場合0、床上のアイテムの場合モンスターID)
+ * @param y 破壊時のY座標
+ * @param x 破壊時のX座標
+ * @param k_idx 破損した薬のアイテムID
+ * @return 薬を浴びたモンスターが起こるならばTRUEを返す
+ * @details
+ * <pre>
* (1) they are shattered while in the player's inventory,
* due to cold (etc) attacks;
* (2) they are thrown at a monster, or obstacle;
* y, x --- coordinates of the potion (or player if
* the potion was in her inventory);
* o_ptr --- pointer to the potion object.
+ * </pre>
*/
-bool potion_smash_effect(int who, int y, int x, int k_idx)
+bool potion_smash_effect(MONSTER_IDX who, POSITION y, POSITION x, KIND_OBJECT_IDX k_idx)
{
int radius = 2;
int dt = 0;
}
-/*
+/*!
+ * @brief プレイヤーの全既知呪文を表示する /
* Hack -- Display all known spells in a window
- *
+ * return なし
+ * @details
* XXX XXX XXX Need to analyze size of the window.
- *
* XXX XXX XXX Need more color coding.
*/
void display_spell_list(void)
(p_ptr->pclass == CLASS_MIRROR_MASTER) ||
(p_ptr->pclass == CLASS_FORCETRAINER))
{
- int i;
- int y = 1;
- int x = 1;
int minfail = 0;
int plev = p_ptr->lev;
int chance = 0;
int use_mind;
bool use_hp = FALSE;
+ y = 1;
+ x = 1;
+
/* Display a list of spells */
prt("", y, x);
put_str(_("名前", "Name"), y, x + 5);
}
-/*
+/*!
+ * @brief 呪文の経験値を返す /
* Returns experience of a spell
+ * @param spell 呪文ID
+ * @param use_realm 魔法領域
+ * @return 経験値
*/
s16b experience_of_spell(int spell, int use_realm)
{
}
-/*
+/*!
+ * @brief 呪文の消費MPを返す /
* Modify mana consumption rate using spell exp and p_ptr->dec_mana
+ * @param need_mana 基本消費MP
+ * @param spell 呪文ID
+ * @param realm 魔法領域
+ * @return 消費MP
*/
int mod_need_mana(int need_mana, int spell, int realm)
{
}
-/*
+/*!
+ * @brief 呪文の失敗率修正処理1(呪い、消費魔力減少、呪文簡易化) /
* Modify spell fail rate
* Using p_ptr->to_m_chance, p_ptr->dec_mana, p_ptr->easy_spell and p_ptr->heavy_spell
+ * @param chance 修正前失敗率
+ * @return 失敗率(%)
+ * @todo 統合を検討
*/
-int mod_spell_chance_1(int chance)
+PERCENTAGE mod_spell_chance_1(PERCENTAGE chance)
{
chance += p_ptr->to_m_chance;
}
-/*
+/*!
+ * @brief 呪文の失敗率修正処理2(消費魔力減少、呪い、負値修正) /
+ * Modify spell fail rate
+ * Using p_ptr->to_m_chance, p_ptr->dec_mana, p_ptr->easy_spell and p_ptr->heavy_spell
+ * @param chance 修正前失敗率
+ * @return 失敗率(%)
* Modify spell fail rate (as "suffix" process)
* Using p_ptr->dec_mana, p_ptr->easy_spell and p_ptr->heavy_spell
* Note: variable "chance" cannot be negative.
+ * @todo 統合を検討
*/
-int mod_spell_chance_2(int chance)
+PERCENTAGE mod_spell_chance_2(PERCENTAGE chance)
{
if (p_ptr->dec_mana) chance--;
}
-/*
+/*!
+ * @brief 呪文の失敗率計算メインルーチン /
* Returns spell chance of failure for spell -RAK-
+ * @param spell 呪文ID
+ * @param use_realm 魔法領域ID
+ * @return 失敗率(%)
*/
-s16b spell_chance(int spell, int use_realm)
+PERCENTAGE spell_chance(SPELL_IDX spell, REALM_IDX use_realm)
{
- int chance, minfail;
+ PERCENTAGE chance, minfail;
const magic_type *s_ptr;
- int need_mana;
- int penalty = (mp_ptr->spell_stat == A_WIS) ? 10 : 4;
+ MANA_POINT need_mana;
+ PERCENTAGE penalty = (mp_ptr->spell_stat == A_WIS) ? 10 : 4;
/* Paranoia -- must be literate */
}
-
-/*
+/*!
+ * @brief 魔法が利用可能かどうかを返す /
* Determine if a spell is "okay" for the player to cast or study
* The spell must be legible, not forgotten, and also, to cast,
* it must be known, and to study, it must not be known.
+ * @param spell 呪文ID
+ * @param learned 使用可能な判定ならばTRUE、学習可能かどうかの判定ならばFALSE
+ * @param study_pray 祈りの学習判定目的ならばTRUE
+ * @param use_realm 魔法領域ID
+ * @return 失敗率(%)
*/
bool spell_okay(int spell, bool learned, bool study_pray, int use_realm)
{
}
-/*
+
+/*!
+ * @brief 呪文情報の表示処理 /
* Print a list of spells (for browsing or casting or viewing)
+ * @param target_spell 呪文ID
+ * @param spells 表示するスペルID配列の参照ポインタ
+ * @param num 表示するスペルの数(spellsの要素数)
+ * @param y 表示メッセージ左上Y座標
+ * @param x 表示メッセージ左上X座標
+ * @param use_realm 魔法領域ID
+ * @return なし
*/
-void print_spells(int target_spell, byte *spells, int num, int y, int x, int use_realm)
+void print_spells(SPELL_IDX target_spell, SPELL_IDX *spells, int num, TERM_POSITION y, TERM_POSITION x, REALM_IDX use_realm)
{
int i, spell, exp_level, increment = 64;
const magic_type *s_ptr;
}
-/*
+/*!
+ * @brief アイテムが酸で破損するかどうかを判定する
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
* Note that amulets, rods, and high-level spell books are immune
* to "inventory damage" of any kind. Also sling ammo and shovels.
- */
-
-
-/*
* Does a given class of objects (usually) hate acid?
* Note that acid can either melt or corrode something.
*/
}
-/*
+/*!
+ * @brief アイテムが電撃で破損するかどうかを判定する /
* Does a given object (usually) hate electricity?
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
*/
bool hates_elec(object_type *o_ptr)
{
}
-/*
+/*!
+ * @brief アイテムが火炎で破損するかどうかを判定する /
* Does a given object (usually) hate fire?
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
+ * @details
* Hafted/Polearm weapons have wooden shafts.
* Arrows/Bows are mostly wooden.
*/
}
-/*
+/*!
+ * @brief アイテムが冷気で破損するかどうかを判定する /
* Does a given object (usually) hate cold?
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
*/
bool hates_cold(object_type *o_ptr)
{
}
-/*
+/*!
+ * @brief アイテムが酸で破損するかどうかを判定する(メインルーチン) /
* Melt something
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
+ * @todo 統合を検討
*/
int set_acid_destroy(object_type *o_ptr)
{
}
-/*
+/*!
+ * @brief アイテムが電撃で破損するかどうかを判定する(メインルーチン) /
* Electrical damage
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
+ * @todo 統合を検討
*/
int set_elec_destroy(object_type *o_ptr)
{
}
-/*
+/*!
+ * @brief アイテムが火炎で破損するかどうかを判定する(メインルーチン) /
* Burn something
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
+ * @todo 統合を検討
*/
int set_fire_destroy(object_type *o_ptr)
{
}
-/*
+/*!
+ * @brief アイテムが冷気で破損するかどうかを判定する(メインルーチン) /
* Freeze things
+ * @param o_ptr アイテムの情報参照ポインタ
+ * @return 破損するならばTRUEを返す
+ * @todo 統合を検討
*/
int set_cold_destroy(object_type *o_ptr)
{
}
-/*
+/*!
+ * @brief アイテムが指定確率で破損するかどうかを判定する /
* Destroys a type of item on a given percent chance
+ * @param typ 破損判定関数ポインタ
+ * @param perc 基本確率
+ * @return 破損したアイテムの数
+ * @details
* Note that missiles are no longer necessarily all destroyed
* Destruction taken from "melee.c" code for "stealing".
* New-style wands and rods handled correctly. -LM-
/* Potions smash open */
if (object_is_potion(o_ptr))
{
- (void)potion_smash_effect(0, py, px, o_ptr->k_idx);
+ (void)potion_smash_effect(0, p_ptr->y, p_ptr->x, o_ptr->k_idx);
}
/* Reduce the charges of rods/wands */
}
-/*
+/*!
+ * @brief 酸攻撃による装備のAC劣化処理 /
* Acid has hit the player, attempt to affect some armor.
- *
+ * @return ACが実際に劣化したらTRUEを返す
+ * @details
* Note that the "base armor" of an object never changes.
- *
* If any armor is damaged (or resists), the player takes less damage.
*/
static int minus_ac(void)
}
-/*
+/*!
+ * @brief 酸属性によるプレイヤー損害処理 /
* Hurt the player with Acid
+ * @param dam 基本ダメージ量
+ * @param kb_str ダメージ原因記述
+ * @param monspell 原因となったモンスター特殊攻撃ID
+ * @param aura オーラよるダメージが原因ならばTRUE
+ * @return 修正HPダメージ量
*/
-int acid_dam(int dam, cptr kb_str, int monspell, bool aura)
+int acid_dam(HIT_POINT dam, cptr kb_str, int monspell, bool aura)
{
int get_damage;
int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
}
-/*
+/*!
+ * @brief 電撃属性によるプレイヤー損害処理 /
* Hurt the player with electricity
+ * @param dam 基本ダメージ量
+ * @param kb_str ダメージ原因記述
+ * @param monspell 原因となったモンスター特殊攻撃ID
+ * @param aura オーラよるダメージが原因ならばTRUE
+ * @return 修正HPダメージ量
*/
-int elec_dam(int dam, cptr kb_str, int monspell, bool aura)
+int elec_dam(HIT_POINT dam, cptr kb_str, int monspell, bool aura)
{
int get_damage;
int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
}
-/*
+/*!
+ * @brief 火炎属性によるプレイヤー損害処理 /
* Hurt the player with Fire
+ * @param dam 基本ダメージ量
+ * @param kb_str ダメージ原因記述
+ * @param monspell 原因となったモンスター特殊攻撃ID
+ * @param aura オーラよるダメージが原因ならばTRUE
+ * @return 修正HPダメージ量
*/
-int fire_dam(int dam, cptr kb_str, int monspell, bool aura)
+int fire_dam(HIT_POINT dam, cptr kb_str, int monspell, bool aura)
{
int get_damage;
int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
}
-/*
+/*!
+ * @brief 冷気属性によるプレイヤー損害処理 /
* Hurt the player with Cold
+ * @param dam 基本ダメージ量
+ * @param kb_str ダメージ原因記述
+ * @param monspell 原因となったモンスター特殊攻撃ID
+ * @param aura オーラよるダメージが原因ならばTRUE
+ * @return 修正HPダメージ量
*/
-int cold_dam(int dam, cptr kb_str, int monspell, bool aura)
+int cold_dam(HIT_POINT dam, cptr kb_str, int monspell, bool aura)
{
int get_damage;
int inv = (dam < 30) ? 1 : (dam < 60) ? 2 : 3;
return get_damage;
}
-
+/*!
+ * @brief 防具の錆止め防止処理
+ * @return ターン消費を要する処理を行ったならばTRUEを返す
+ */
bool rustproof(void)
{
- int item;
+ OBJECT_IDX item;
object_type *o_ptr;
char o_name[MAX_NLEN];
cptr q, s;
}
-/*
+/*!
+ * @brief 防具呪縛処理 /
* Curse the players armor
+ * @return 実際に呪縛されたらTRUEを返す
*/
bool curse_armor(void)
{
return (TRUE);
}
-
-/*
+/*!
+ * @brief 武器呪縛処理 /
* Curse the players weapon
+ * @param force 無条件に呪縛を行うならばTRUE
+ * @param o_ptr 呪縛する武器のアイテム情報参照ポインタ
+ * @return 実際に呪縛されたらTRUEを返す
*/
bool curse_weapon_object(bool force, object_type *o_ptr)
{
return (TRUE);
}
+/*!
+ * @brief 武器呪縛処理のメインルーチン /
+ * Curse the players weapon
+ * @param force 無条件に呪縛を行うならばTRUE
+ * @param slot 呪縛する武器の装備スロット
+ * @return 実際に呪縛されたらTRUEを返す
+ */
bool curse_weapon(bool force, int slot)
{
/* Curse the weapon */
}
-/*
+/*!
+ * @brief ボルトのエゴ化処理(火炎エゴのみ) /
* Enchant some bolts
+ * @return 常にTRUEを返す
*/
bool brand_bolts(void)
{
}
-/*
+/*!
+ * @brief 変身処理向けにモンスターの近隣レベル帯モンスターを返す /
* Helper function -- return a "nearby" race for polymorphing
- *
+ * @param r_idx 基準となるモンスター種族ID
+ * @return 変更先のモンスター種族ID
+ * @details
* Note that this function is one of the more "dangerous" ones...
*/
-static s16b poly_r_idx(int r_idx)
+static IDX poly_r_idx(MONRACE_IDX r_idx)
{
monster_race *r_ptr = &r_info[r_idx];
- int i, r, lev1, lev2;
+ int i;
+ MONRACE_IDX r;
+ DEPTH lev1, lev2;
/* Hack -- Uniques/Questors never polymorph */
if ((r_ptr->flags1 & RF1_UNIQUE) ||
return (r_idx);
}
-
-bool polymorph_monster(int y, int x)
+/*!
+ * @brief 指定座標にいるモンスターを変身させる /
+ * Helper function -- return a "nearby" race for polymorphing
+ * @param y 指定のY座標
+ * @param x 指定のX座標
+ * @return 実際に変身したらTRUEを返す
+ */
+bool polymorph_monster(POSITION y, POSITION x)
{
cave_type *c_ptr = &cave[y][x];
monster_type *m_ptr = &m_list[c_ptr->m_idx];
bool polymorphed = FALSE;
- int new_r_idx;
- int old_r_idx = m_ptr->r_idx;
+ MONRACE_IDX new_r_idx;
+ MONRACE_IDX old_r_idx = m_ptr->r_idx;
bool targeted = (target_who == c_ptr->m_idx) ? TRUE : FALSE;
bool health_tracked = (p_ptr->health_who == c_ptr->m_idx) ? TRUE : FALSE;
monster_type back_m;
/* Handle polymorph */
if (new_r_idx != old_r_idx)
{
- u32b mode = 0L;
+ BIT_FLAGS mode = 0L;
bool preserve_hold_objects = back_m.hold_o_idx ? TRUE : FALSE;
s16b this_o_idx, next_o_idx = 0;
return polymorphed;
}
-
-/*
+/*!
+ * @brief 次元の扉処理 /
* Dimension Door
+ * @param x テレポート先のX座標
+ * @param y テレポート先のY座標
+ * @return 目標に指定通りテレポートできたならばTRUEを返す
*/
-static bool dimension_door_aux(int x, int y)
+static bool dimension_door_aux(DEPTH x, DEPTH y)
{
- int plev = p_ptr->lev;
+ PLAYER_LEVEL plev = p_ptr->lev;
p_ptr->energy_need += (s16b)((s32b)(60 - plev) * ENERGY_NEED() / 100L);
if (!cave_player_teleportable_bold(y, x, 0L) ||
- (distance(y, x, py, px) > plev / 2 + 10) ||
+ (distance(y, x, p_ptr->y, p_ptr->x) > plev / 2 + 10) ||
(!randint0(plev / 10 + 10)))
{
p_ptr->energy_need += (s16b)((s32b)(60 - plev) * ENERGY_NEED() / 100L);
}
-/*
+/*!
+ * @brief 次元の扉処理のメインルーチン /
* Dimension Door
+ * @return ターンを消費した場合TRUEを返す
*/
bool dimension_door(void)
{
- int x = 0, y = 0;
+ DEPTH x = 0, y = 0;
/* Rerutn FALSE if cancelled */
if (!tgt_pt(&x, &y)) return FALSE;
}
-/*
+/*!
+ * @brief 鏡抜け処理のメインルーチン /
* Mirror Master's Dimension Door
+ * @return ターンを消費した場合TRUEを返す
*/
bool mirror_tunnel(void)
{
- int x = 0, y = 0;
+ POSITION x = 0, y = 0;
/* Rerutn FALSE if cancelled */
if (!tgt_pt(&x, &y)) return FALSE;
return TRUE;
}
-
+/*!
+ * @brief 魔力食い処理
+ * @param power 基本効力
+ * @return ターンを消費した場合TRUEを返す
+ */
bool eat_magic(int power)
{
object_type * o_ptr;
object_kind *k_ptr;
- int lev, item;
+ int lev;
+ OBJECT_IDX item;
int recharge_strength = 0;
bool fail = FALSE;
return TRUE;
}
-
-bool summon_kin_player(int level, int y, int x, u32b mode)
+/*!
+ * @brief 同族召喚(援軍)処理
+ * @param level 召喚基準レベル
+ * @param y 召喚先Y座標
+ * @param x 召喚先X座標
+ * @param mode 召喚オプション
+ * @return ターンを消費した場合TRUEを返す
+ */
+bool summon_kin_player(int level, int y, int x, BIT_FLAGS mode)
{
bool pet = (bool)(mode & PM_FORCE_PET);
if (!pet) mode |= PM_NO_PET;
return summon_specific((pet ? -1 : 0), y, x, level, SUMMON_KIN, mode);
}
-void massacre(int py, int px)
+/*!
+ * @brief 皆殺し(全方向攻撃)処理
+ * @param py プレイヤーY座標
+ * @param px プレイヤーX座標
+ * @return なし
+ */
+void massacre(void)
{
int x, y;
cave_type *c_ptr;
for (dir = 0; dir < 8; dir++)
{
- y = py + ddy_ddd[dir];
- x = px + ddx_ddd[dir];
+ y = p_ptr->y + ddy_ddd[dir];
+ x = p_ptr->x + ddx_ddd[dir];
c_ptr = &cave[y][x];
/* Get the monster */