X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fspells3.c;h=09539fcbd2008a3e022cbd2bac02eed64dd975ce;hb=9d4b877c27a36774ae5256db6237264298837607;hp=70191d766d41131e247eb43f6b7316c803e8b899;hpb=28526e35fac16022cf2c2d9aa7eb964eb6f03cd3;p=hengband%2Fhengband.git diff --git a/src/spells3.c b/src/spells3.c index 70191d766..09539fcbd 100644 --- a/src/spells3.c +++ b/src/spells3.c @@ -27,7 +27,7 @@ * @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, u32b mode) { monster_type *m_ptr = &m_list[m_idx]; cave_type *c_ptr = &cave[y][x]; @@ -63,11 +63,11 @@ static bool cave_monster_teleportable_bold(int m_idx, int y, int x, u32b mode) * 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, u32b mode) { int oy, ox, d, i, min; int tries = 0; - int ny = 0, nx = 0; + POSITION ny = 0, nx = 0; bool look = TRUE; @@ -178,7 +178,7 @@ bool teleport_away(int m_idx, int dis, u32b mode) * @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, u32b mode) { int ny, nx, oy, ox, d, i, min; int attempts = 500; @@ -348,12 +348,13 @@ bool teleport_player_aux(int dis, u32b 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; @@ -382,7 +383,7 @@ bool teleport_player_aux(int dis, u32b mode) 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; @@ -421,7 +422,7 @@ bool teleport_player_aux(int dis, u32b mode) 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; @@ -445,7 +446,7 @@ bool teleport_player_aux(int dis, u32b mode) #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 */ @@ -465,8 +466,8 @@ void teleport_player(int dis, u32b 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; @@ -475,7 +476,7 @@ void teleport_player(int dis, u32b mode) { 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)) @@ -487,10 +488,10 @@ void teleport_player(int dis, u32b mode) * 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); } } } @@ -504,13 +505,13 @@ void teleport_player(int dis, u32b mode) * @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; @@ -519,7 +520,7 @@ void teleport_player_away(int m_idx, int dis) { 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)) @@ -531,10 +532,10 @@ void teleport_player_away(int m_idx, int dis) * 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); } } } @@ -555,9 +556,10 @@ void teleport_player_away(int m_idx, int dis) * This function allows teleporting into vaults (!) * */ -void teleport_player_to(int ny, int nx, u32b mode) +void teleport_player_to(POSITION ny, POSITION nx, u32b mode) { - int y, x, dis = 0, ctr = 0; + POSITION y, x; + int dis = 0, ctr = 0; if (p_ptr->anti_tele && !(mode & TELEPORT_NONMAGICAL)) { @@ -571,8 +573,8 @@ void teleport_player_to(int ny, int nx, u32b mode) /* 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; } @@ -598,7 +600,7 @@ void teleport_player_to(int ny, int nx, u32b mode) } -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; @@ -608,7 +610,7 @@ void teleport_away_followable(int m_idx) 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; @@ -657,7 +659,7 @@ void teleport_away_followable(int m_idx) * @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]; @@ -712,9 +714,9 @@ void teleport_level(int m_idx) { 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); @@ -831,14 +833,15 @@ void teleport_level(int m_idx) /*! - * @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; + DUNGEON_IDX select_dungeon; int i, num = 0; s16b *dun; @@ -872,7 +875,7 @@ int choose_dungeon(cptr note, int y, int x) 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; } @@ -913,10 +916,10 @@ int choose_dungeon(cptr note, int y, int x) /*! * @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 @@ -944,7 +947,7 @@ bool recall_player(int turns) { 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; @@ -964,7 +967,6 @@ bool recall_player(int turns) /*! * @brief 帰éç¨ã¡ã¤ã³ã«ã¼ãã³ - * @param turn çºåã¾ã§ã®ã¿ã¼ã³æ° * @return 常ã«TRUEãè¿ã */ bool word_of_recall(void) @@ -993,10 +995,11 @@ bool reset_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)) @@ -1155,7 +1158,8 @@ msg_format("%s(%c)ã¯å£åãè·³ãè¿ããï¼",o_name, index_to_label(t) ); */ 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); @@ -1292,7 +1296,7 @@ void phlogiston(void) */ void brand_weapon(int brand_type) { - int item; + OBJECT_IDX item; object_type *o_ptr; cptr q, s; @@ -1597,7 +1601,7 @@ void call_the_(void) 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)) { @@ -1653,7 +1657,7 @@ void call_the_(void) } 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.")); @@ -1674,13 +1678,14 @@ void call_the_(void) */ void fetch(int dir, int wgt, bool require_los) { - int ty, tx, i; + int ty, tx; + DEPTH 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; @@ -1692,7 +1697,7 @@ void fetch(int dir, int wgt, bool require_los) 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; @@ -1722,7 +1727,7 @@ void fetch(int dir, int wgt, bool require_los) 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; @@ -1732,8 +1737,8 @@ void fetch(int dir, int wgt, bool require_los) 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 { @@ -1741,7 +1746,7 @@ void fetch(int dir, int wgt, bool require_los) 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); @@ -1758,15 +1763,15 @@ void fetch(int dir, int wgt, bool require_los) 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; } @@ -1785,7 +1790,7 @@ void alter_reality(void) 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...")); @@ -1810,21 +1815,21 @@ void alter_reality(void) 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; } @@ -1836,26 +1841,26 @@ bool warding_glyph(void) 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; } @@ -1869,28 +1874,28 @@ bool place_mirror(void) 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 èªå·±åæã®è¬ã«ããå ¨ææã¢ã¤ãã éå®å¦ç / + * @brief å ¨ææã¢ã¤ãã éå®å¦ç / * Identify everything being carried. * Done by a potion of "self knowledge". * @return ãªã @@ -2001,7 +2006,7 @@ static int remove_curse_aux(int all) * Remove most curses * @return 解åªã«æåããè£ åæ° */ -bool remove_curse(void) +int remove_curse(void) { return (remove_curse_aux(FALSE)); } @@ -2011,7 +2016,7 @@ bool remove_curse(void) * Remove all curses * @return 解åªã«æåããè£ åæ° */ -bool remove_all_curse(void) +int remove_all_curse(void) { return (remove_curse_aux(TRUE)); } @@ -2024,9 +2029,10 @@ bool remove_all_curse(void) */ 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]; @@ -2293,7 +2299,7 @@ bool enchant(object_type *o_ptr, int n, int eflag) */ bool enchant_spell(int num_hit, int num_dam, int num_ac) { - int item; + OBJECT_IDX item; bool okay = FALSE; object_type *o_ptr; char o_name[MAX_NLEN]; @@ -2369,7 +2375,7 @@ msg_format("%s ã¯æããè¼ããï¼", /*! * @brief ã¢ã¤ãã ã並ã®ä¾¡å¤ã®ã¢ã¤ãã ãã©ããå¤å®ãã / * Check if an object is nameless weapon or armour - * @param å¤å®ããã¢ã¤ãã ã®æ å ±åç §ãã¤ã³ã¿ + * @param o_ptr å¤å®ããã¢ã¤ãã ã®æ å ±åç §ãã¤ã³ã¿ * @return 並ãªãã°TRUEãè¿ã */ static bool item_tester_hook_nameless_weapon_armour(object_type *o_ptr) @@ -2390,7 +2396,7 @@ static bool item_tester_hook_nameless_weapon_armour(object_type *o_ptr) */ bool artifact_scroll(void) { - int item; + OBJECT_IDX item; bool okay = FALSE; object_type *o_ptr; char o_name[MAX_NLEN]; @@ -2506,7 +2512,15 @@ bool artifact_scroll(void) 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(); @@ -2601,7 +2615,7 @@ static bool item_tester_hook_identify_weapon_armour(object_type *o_ptr) */ bool ident_spell(bool only_equip) { - int item; + OBJECT_IDX item; object_type *o_ptr; char o_name[MAX_NLEN]; cptr q, s; @@ -2687,7 +2701,7 @@ bool ident_spell(bool only_equip) */ bool mundane_spell(bool only_equip) { - int item; + OBJECT_IDX item; object_type *o_ptr; cptr q, s; @@ -2715,8 +2729,8 @@ bool mundane_spell(bool only_equip) /* 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; @@ -2771,7 +2785,7 @@ static bool item_tester_hook_identify_fully_weapon_armour(object_type *o_ptr) */ bool identify_fully(bool only_equip) { - int item; + OBJECT_IDX item; object_type *o_ptr; char o_name[MAX_NLEN]; cptr q, s; @@ -2851,8 +2865,11 @@ bool identify_fully(bool only_equip) } -/* +/*! + * @brief éåå å¡«ãå¯è½ãªã¢ã¤ãã ãã©ããå¤å®ãã / * Hook for "get_item()". Determine if something is rechargable. + * @param o_ptr å¤å®ããã¢ã¤ãã ã®æ å ±åç §ãã¤ã³ã¿ + * @return éåå å¡«ãå¯è½ãªãã°TRUEãè¿ã */ bool item_tester_hook_recharge(object_type *o_ptr) { @@ -2870,9 +2887,12 @@ 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) @@ -2889,8 +2909,10 @@ bool item_tester_hook_recharge(object_type *o_ptr) */ 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; @@ -3175,14 +3197,16 @@ bool recharge(int power) } -/* +/*! + * @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; @@ -3357,12 +3381,14 @@ msg_format("%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]; @@ -3429,8 +3455,16 @@ msg_format("%sã¯è¼ããï¼", o_name); } -/* +/*! + * @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 + *
* (1) they are shattered while in the player's inventory, * due to cold (etc) attacks; * (2) they are thrown at a monster, or obstacle; @@ -3446,8 +3480,9 @@ msg_format("%sã¯è¼ããï¼", o_name); * y, x --- coordinates of the potion (or player if * the potion was in her inventory); * o_ptr --- pointer to the potion object. + **/ -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; @@ -3588,11 +3623,12 @@ bool potion_smash_effect(int who, int y, int x, int k_idx) } -/* +/*! + * @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) @@ -3626,9 +3662,6 @@ 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; @@ -3638,6 +3671,9 @@ void display_spell_list(void) 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); @@ -3806,8 +3842,12 @@ void display_spell_list(void) } -/* +/*! + * @brief åªæã®çµé¨å¤ãè¿ã / * Returns experience of a spell + * @param spell åªæID + * @param use_realm éæ³é å + * @return çµé¨å¤ */ s16b experience_of_spell(int spell, int use_realm) { @@ -3819,8 +3859,13 @@ 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) { @@ -3855,9 +3900,13 @@ 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) { @@ -3873,10 +3922,16 @@ int mod_spell_chance_1(int 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) { @@ -3888,8 +3943,12 @@ int mod_spell_chance_2(int 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) { @@ -3992,11 +4051,16 @@ s16b spell_chance(int spell, int use_realm) } - -/* +/*! + * @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) { @@ -4041,10 +4105,19 @@ 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; @@ -4204,13 +4277,12 @@ void print_spells(int target_spell, byte *spells, int num, int y, int x, int use } -/* +/*! + * @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. */ @@ -4265,8 +4337,11 @@ bool hates_acid(object_type *o_ptr) } -/* +/*! + * @brief ã¢ã¤ãã ãé»æã§ç ´æãããã©ãããå¤å®ãã / * Does a given object (usually) hate electricity? + * @param o_ptr ã¢ã¤ãã ã®æ å ±åç §ãã¤ã³ã¿ + * @return ç ´æãããªãã°TRUEãè¿ã */ bool hates_elec(object_type *o_ptr) { @@ -4283,8 +4358,12 @@ 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. */ @@ -4343,8 +4422,11 @@ bool hates_fire(object_type *o_ptr) } -/* +/*! + * @brief ã¢ã¤ãã ãå·æ°ã§ç ´æãããã©ãããå¤å®ãã / * Does a given object (usually) hate cold? + * @param o_ptr ã¢ã¤ãã ã®æ å ±åç §ãã¤ã³ã¿ + * @return ç ´æãããªãã°TRUEãè¿ã */ bool hates_cold(object_type *o_ptr) { @@ -4362,8 +4444,12 @@ bool hates_cold(object_type *o_ptr) } -/* +/*! + * @brief ã¢ã¤ãã ãé ¸ã§ç ´æãããã©ãããå¤å®ãã(ã¡ã¤ã³ã«ã¼ãã³) / * Melt something + * @param o_ptr ã¢ã¤ãã ã®æ å ±åç §ãã¤ã³ã¿ + * @return ç ´æãããªãã°TRUEãè¿ã + * @todo çµ±åãæ¤è¨ */ int set_acid_destroy(object_type *o_ptr) { @@ -4375,8 +4461,12 @@ 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) { @@ -4388,8 +4478,12 @@ 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) { @@ -4401,8 +4495,12 @@ 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) { @@ -4414,8 +4512,13 @@ 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- @@ -4484,7 +4587,7 @@ o_name, index_to_label(i), /* 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 */ @@ -4505,11 +4608,12 @@ o_name, index_to_label(i), } -/* +/*! + * @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) @@ -4572,10 +4676,16 @@ 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; @@ -4616,10 +4726,16 @@ int acid_dam(int dam, cptr kb_str, int monspell, bool aura) } -/* +/*! + * @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; @@ -4659,10 +4775,16 @@ int elec_dam(int dam, cptr kb_str, int monspell, bool aura) } -/* +/*! + * @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; @@ -4702,10 +4824,16 @@ int fire_dam(int dam, cptr kb_str, int monspell, bool aura) } -/* +/*! + * @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; @@ -4743,10 +4871,13 @@ int cold_dam(int dam, cptr kb_str, int monspell, bool aura) 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; @@ -4807,8 +4938,10 @@ msg_format("%sã¯è é£ããªããªã£ãã", o_name); } -/* +/*! + * @brief é²å ·åªç¸å¦ç / * Curse the players armor + * @return å®éã«åªç¸ããããTRUEãè¿ã */ bool curse_armor(void) { @@ -4881,9 +5014,12 @@ msg_format("%sã%sãå ã¿è¾¼ããã¨ãããã%sã¯ãããè·³ãè¿ã 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) { @@ -4949,6 +5085,13 @@ 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 */ @@ -4956,8 +5099,10 @@ bool curse_weapon(bool force, int slot) } -/* +/*! + * @brief ãã«ãã®ã¨ã´åå¦ç(ç«çã¨ã´ã®ã¿) / * Enchant some bolts + * @return 常ã«TRUEãè¿ã */ bool brand_bolts(void) { @@ -5005,16 +5150,21 @@ 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) || @@ -5054,14 +5204,20 @@ static s16b poly_r_idx(int r_idx) 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; @@ -5152,18 +5308,21 @@ bool polymorph_monster(int y, int x) 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); @@ -5182,12 +5341,14 @@ static bool dimension_door_aux(int x, int y) } -/* +/*! + * @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; @@ -5200,12 +5361,14 @@ bool dimension_door(void) } -/* +/*! + * @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; @@ -5217,12 +5380,17 @@ bool mirror_tunnel(void) 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; @@ -5491,7 +5659,14 @@ bool eat_magic(int power) return TRUE; } - +/*! + * @brief åæå¬å(æ´è»)å¦ç + * @param level å¬ååºæºã¬ãã« + * @param y å¬åå Yåº§æ¨ + * @param x å¬åå Xåº§æ¨ + * @param mode å¬åãªãã·ã§ã³ + * @return ã¿ã¼ã³ãæ¶è²»ããå ´åTRUEãè¿ã + */ bool summon_kin_player(int level, int y, int x, u32b mode) { bool pet = (bool)(mode & PM_FORCE_PET); @@ -5600,7 +5775,13 @@ bool summon_kin_player(int level, int y, int x, u32b mode) 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; @@ -5609,8 +5790,8 @@ void massacre(int py, int px) 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 */