X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fcmd2.c;h=cd434a8a014a554e9b92cefeb1b1c1ca5358b00f;hb=f5d7e7a38b4256114811b63e44dd04509f011dbd;hp=4df7daf80dd82fbcec7d02ee3a71b928463a93e8;hpb=57203347efd776d1633d945f2c35269135c94c9f;p=hengband%2Fhengband.git diff --git a/src/cmd2.c b/src/cmd2.c index 4df7daf80..cd434a8a0 100644 --- a/src/cmd2.c +++ b/src/cmd2.c @@ -11,7 +11,11 @@ */ #include "angband.h" - +#include "chest.h" +#include "floor.h" +#include "melee.h" +#include "object-hook.h" +#include "projection.h" /*! * @brief ããã¢è±åºæã«åºæ»ããä¸å¯è½ã ã£ãå ´åã«è¦åãå ããå¦ç @@ -31,13 +35,8 @@ bool confirm_leave_level(bool down_stair) ((q_ptr->status != QUEST_STATUS_STAGE_COMPLETED) || (down_stair && (quest[QUEST_TOWER1].status != QUEST_STATUS_COMPLETED)))))) { -#ifdef JP - msg_print("ãã®éãä¸åº¦å»ãã¨äºåº¦ã¨æ»ã£ã¦æ¥ããã¾ããã"); - if (get_check("æ¬å½ã«ãã®éãå»ãã¾ããï¼")) return TRUE; -#else - msg_print("You can't come back here once you leave this floor."); - if (get_check("Really leave this floor? ")) return TRUE; -#endif + msg_print(_("ãã®éãä¸åº¦å»ãã¨äºåº¦ã¨æ»ã£ã¦æ¥ããã¾ããã", "You can't come back here once you leave this floor.")); + if (get_check(_("æ¬å½ã«ãã®éãå»ãã¾ããï¼", "Really leave this floor? "))) return TRUE; } else { @@ -80,14 +79,10 @@ void do_cmd_go_up(void) /* Success */ -#ifdef JP if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)) - msg_print("ãªãã ãã®é段ã¯ï¼"); + msg_print(_("ãªãã ãã®é段ã¯ï¼", "What's this STAIRWAY!")); else - msg_print("ä¸ã®éã«ç»ã£ãã"); -#else - msg_print("You enter the up staircase."); -#endif + msg_print(_("ä¸ã®éã«ç»ã£ãã", "You enter the up staircase.")); leave_quest_check(); @@ -187,7 +182,7 @@ void do_cmd_go_up(void) /* Success */ if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)) - msg_print(_("ãªãã ãã®é段ã¯ï¼", "")); + msg_print(_("ãªãã ãã®é段ã¯ï¼", "What's this STAIRWAY!")); else if (up_num == dun_level) msg_print(_("å°ä¸ã«æ»ã£ãã", "You go back to the surface.")); else @@ -237,14 +232,10 @@ void do_cmd_go_down(void) /* Confirm Leaving */ if(!confirm_leave_level(TRUE)) return; -#ifdef JP if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)) - msg_print("ãªãã ãã®é段ã¯ï¼"); + msg_print(_("ãªãã ãã®é段ã¯ï¼", "What's this STAIRWAY!")); else - msg_print("ä¸ã®éã«éããã"); -#else - msg_print("You enter the down staircase."); -#endif + msg_print(_("ä¸ã®éã«éããã", "You enter the down staircase.")); leave_quest_check(); leave_tower_check(); @@ -347,7 +338,7 @@ void do_cmd_go_down(void) else { if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)) - msg_print(_("ãªãã ãã®é段ã¯ï¼", "")); + msg_print(_("ãªãã ãã®é段ã¯ï¼", "What's this STAIRWAY!")); else msg_print(_("é段ãä¸ãã¦æ°ããªãè¿·å®®ã¸ã¨è¶³ãè¸ã¿å ¥ããã", "You enter a maze of down staircases.")); } @@ -389,15 +380,11 @@ void do_cmd_search(void) { /* Set repeat count */ command_rep = command_arg - 1; - - /* Redraw the state */ p_ptr->redraw |= (PR_STATE); /* Cancel the arg */ command_arg = 0; } - - /* Take a turn */ p_ptr->energy_use = 100; /* Search */ @@ -412,22 +399,17 @@ void do_cmd_search(void) * @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 */ @@ -441,354 +423,9 @@ static s16b chest_check(int y, int x, bool trapped) return (this_o_idx); } } - - /* No chest */ return (0); } - -/*! - * @brief ç®±ããã¢ã¤ãã ãå¼ãåºã / - * Allocates objects upon opening a chest -BEN- - * @param scatter TRUEãªãã°ãã©ããã«ããã¢ã¤ãã ã®æ¡æ£å¦ç - * @param y ç®±ã®åå¨ãããã¹ã®Yåº§æ¨ - * @param x ç®±ã®åå¨ãããã¹ã®Xåº§æ¨ - * @param o_idx ç®±ã®ãªãã¸ã§ã¯ãID - * @return ãªã - * @details - *
- * Disperse treasures from the given chest, centered at (x,y). - * - * Small chests often contain "gold", while Large chests always contain - * items. Wooden chests contain 2 items, Iron chests contain 4 items, - * and Steel chests contain 6 items. The "value" of the items in a - * chest is based on the "power" of the chest, which is in turn based - * on the level on which the chest is generated. - *- */ -static void chest_death(bool scatter, int y, int x, s16b o_idx) -{ - int number; - - bool small; - u32b mode = AM_GOOD; - - object_type forge; - object_type *q_ptr; - - object_type *o_ptr = &o_list[o_idx]; - - - /* Small chests often hold "gold" */ - small = (o_ptr->sval < SV_CHEST_MIN_LARGE); - - /* Determine how much to drop (see above) */ - number = (o_ptr->sval % SV_CHEST_MIN_LARGE) * 2; - - if (o_ptr->sval == SV_CHEST_KANDUME) - { - number = 5; - small = FALSE; - mode |= AM_GREAT; - object_level = o_ptr->xtra3; - } - else - { - /* Determine the "value" of the items */ - object_level = ABS(o_ptr->pval) + 10; - } - - /* Zero pval means empty chest */ - if (!o_ptr->pval) number = 0; - - /* Opening a chest */ - opening_chest = TRUE; - - /* Drop some objects (non-chests) */ - for (; number > 0; --number) - { - /* Get local object */ - q_ptr = &forge; - - /* Wipe the object */ - object_wipe(q_ptr); - - /* Small chests often drop gold */ - if (small && (randint0(100) < 25)) - { - /* Make some gold */ - if (!make_gold(q_ptr)) continue; - } - - /* Otherwise drop an item */ - else - { - /* Make a good object */ - if (!make_object(q_ptr, mode)) continue; - } - - /* If chest scatters its contents, pick any floor square. */ - if (scatter) - { - int i; - for (i = 0; i < 200; i++) - { - /* Pick a totally random spot. */ - y = randint0(MAX_HGT); - x = randint0(MAX_WID); - - /* Must be an empty floor. */ - if (!cave_empty_bold(y, x)) continue; - - /* Place the object there. */ - drop_near(q_ptr, -1, y, x); - - /* Done. */ - break; - } - } - /* Normally, drop object near the chest. */ - else drop_near(q_ptr, -1, y, x); - } - - /* Reset the object level */ - object_level = base_level; - - /* No longer opening a chest */ - opening_chest = FALSE; - - /* Empty */ - o_ptr->pval = 0; - - /* Known */ - object_known(o_ptr); -} - - -/*! - * @brief ç®±ã®ãã©ããå¦ç / - * Chests have traps too. - * @param y ç®±ã®åå¨ãããã¹ã®Yåº§æ¨ - * @param x ç®±ã®åå¨ãããã¹ã®Xåº§æ¨ - * @param o_idx ç®±ã®ãªãã¸ã§ã¯ãID - * @return ãªã - * @details - *
- * Exploding chest destroys contents (and traps). - * Note that the chest itself is never destroyed. - *- */ -static void chest_trap(int y, int x, s16b o_idx) -{ - int i, trap; - - object_type *o_ptr = &o_list[o_idx]; - - int mon_level = o_ptr->xtra3; - - /* Ignore disarmed chests */ - if (o_ptr->pval <= 0) return; - - /* Obtain the traps */ - trap = chest_traps[o_ptr->pval]; - - /* Lose strength */ - if (trap & (CHEST_LOSE_STR)) - { -#ifdef JP - msg_print("ä»æãããã¦ããå°ããªéã«åºããã¦ãã¾ã£ãï¼"); - take_hit(DAMAGE_NOESCAPE, damroll(1, 4), "æ¯é", -1); -#else - msg_print("A small needle has pricked you!"); - take_hit(DAMAGE_NOESCAPE, damroll(1, 4), "a poison needle", -1); -#endif - - (void)do_dec_stat(A_STR); - } - - /* Lose constitution */ - if (trap & (CHEST_LOSE_CON)) - { -#ifdef JP - msg_print("ä»æãããã¦ããå°ããªéã«åºããã¦ãã¾ã£ãï¼"); - take_hit(DAMAGE_NOESCAPE, damroll(1, 4), "æ¯é", -1); -#else - msg_print("A small needle has pricked you!"); - take_hit(DAMAGE_NOESCAPE, damroll(1, 4), "a poison needle", -1); -#endif - - (void)do_dec_stat(A_CON); - } - - /* Poison */ - if (trap & (CHEST_POISON)) - { - msg_print(_("çªå¦å¹ãåºããç·è²ã®ã¬ã¹ã«å ã¿è¾¼ã¾ããï¼", "A puff of green gas surrounds you!")); - if (!(p_ptr->resist_pois || IS_OPPOSE_POIS())) - { - (void)set_poisoned(p_ptr->poisoned + 10 + randint1(20)); - } - } - - /* Paralyze */ - if (trap & (CHEST_PARALYZE)) - { - msg_print(_("çªå¦å¹ãåºããé»è²ãã¬ã¹ã«å ã¿è¾¼ã¾ããï¼", "A puff of yellow gas surrounds you!")); - if (!p_ptr->free_act) - { - (void)set_paralyzed(p_ptr->paralyzed + 10 + randint1(20)); - } - } - - /* Summon monsters */ - if (trap & (CHEST_SUMMON)) - { - int num = 2 + randint1(3); - msg_print(_("çªå¦å¹ãåºããç ã«å ã¿è¾¼ã¾ããï¼", "You are enveloped in a cloud of smoke!")); - for (i = 0; i < num; i++) - { - if (randint1(100)
- * XXX XXX XXX Let user choose a pile of spikes, perhaps? + * Let user choose a pile of spikes, perhaps? **/ -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++) @@ -2398,7 +1881,6 @@ static bool get_spike(int *ip) } } - /* Oops */ return (FALSE); } @@ -2414,7 +1896,9 @@ static bool get_spike(int *ip) */ void do_cmd_spike(void) { - int dir; + DIRECTION dir; + + if (p_ptr->wild_mode) return; if (p_ptr->special_defense & KATA_MUSOU) { @@ -2422,17 +1906,15 @@ void do_cmd_spike(void) } /* Get a "repeated" direction */ - if (get_rep_dir(&dir,FALSE)) + 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]; x = p_ptr->x + ddx[dir]; - - /* Get grid and contents */ c_ptr = &cave[y][x]; /* Feature code (applying "mimic" field) */ @@ -2441,24 +1923,20 @@ void do_cmd_spike(void) /* 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 */ @@ -2468,7 +1946,6 @@ void do_cmd_spike(void) /* Go for it */ else { - /* Take a turn */ p_ptr->energy_use = 100; /* Successful jamming */ @@ -2493,7 +1970,7 @@ void do_cmd_spike(void) */ void do_cmd_walk(bool pickup) { - int dir; + DIRECTION dir; bool more = FALSE; @@ -2503,8 +1980,6 @@ void do_cmd_walk(bool pickup) { /* Set repeat count */ command_rep = command_arg - 1; - - /* Redraw the state */ p_ptr->redraw |= (PR_STATE); /* Cancel the arg */ @@ -2512,9 +1987,8 @@ void do_cmd_walk(bool pickup) } /* Get a "repeated" direction */ - if (get_rep_dir(&dir,FALSE)) + if (get_rep_dir(&dir, FALSE)) { - /* Take a turn */ p_ptr->energy_use = 100; if ((dir != 5) && (p_ptr->special_defense & KATA_MUSOU)) @@ -2558,7 +2032,7 @@ void do_cmd_walk(bool pickup) } /* Cancel repeat unless we may continue */ - if (!more) disturb(0, 0); + if (!more) disturb(FALSE, FALSE); } @@ -2569,7 +2043,7 @@ void do_cmd_walk(bool pickup) */ void do_cmd_run(void) { - int dir; + DIRECTION dir; /* Hack -- no running when confused */ if (p_ptr->confused) @@ -2611,15 +2085,12 @@ void do_cmd_stay(bool pickup) { /* Set repeat count */ command_rep = command_arg - 1; - - /* Redraw the state */ p_ptr->redraw |= (PR_STATE); /* Cancel the arg */ command_arg = 0; } - /* Take a turn */ p_ptr->energy_use = 100; if (pickup) mpe_mode |= MPE_DO_PICKUP; @@ -2637,7 +2108,7 @@ void do_cmd_rest(void) set_action(ACTION_NONE); - if ((p_ptr->pclass == CLASS_BARD) && (p_ptr->magic_num1[0] || p_ptr->magic_num1[1])) + if ((p_ptr->pclass == CLASS_BARD) && (SINGING_SONG_EFFECT(p_ptr) || INTERUPTING_SONG_EFFECT(p_ptr))) { stop_singing(); } @@ -2648,7 +2119,7 @@ void do_cmd_rest(void) /* Prompt for time if needed */ if (command_arg <= 0) { - cptr p = _("ä¼æ© (0-9999, '*' 㧠HP/MPå ¨å¿«, '&' ã§å¿ è¦ãªã ã): ", + concptr p = _("ä¼æ© (0-9999, '*' 㧠HP/MPå ¨å¿«, '&' ã§å¿ è¦ãªã ã): ", "Rest (0-9999, '*' for HP/SP, '&' as needed): "); @@ -2663,19 +2134,19 @@ void do_cmd_rest(void) /* Rest until done */ if (out_val[0] == '&') { - command_arg = (-2); + command_arg = COMMAND_ARG_REST_UNTIL_DONE; } /* Rest a lot */ else if (out_val[0] == '*') { - command_arg = (-1); + command_arg = COMMAND_ARG_REST_FULL_HEALING; } /* Rest some */ else { - command_arg = atoi(out_val); + command_arg = (COMMAND_ARG)atoi(out_val); if (command_arg <= 0) return; } } @@ -2686,12 +2157,11 @@ void do_cmd_rest(void) 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 */ - if (command_arg > 100) - chg_virtue(V_DILIGENCE, -1); + if (command_arg > 100) chg_virtue(V_DILIGENCE, -1); /* Why are you sleeping when there's no need? WAKE UP!*/ if ((p_ptr->chp == p_ptr->mhp) && @@ -2707,17 +2177,12 @@ void do_cmd_rest(void) /* Save the rest code */ resting = command_arg; p_ptr->action = ACTION_REST; - - /* Recalculate bonuses */ p_ptr->update |= (PU_BONUS); + update_creature(p_ptr); - /* Redraw the state */ p_ptr->redraw |= (PR_STATE); + update_output(); - /* Handle stuff */ - handle_stuff(); - - /* Refresh */ Term_fresh(); } @@ -2730,9 +2195,9 @@ void do_cmd_rest(void) * @details * Note that artifacts never break, see the "drop_near()" function. */ -static int breakage_chance(object_type *o_ptr) +static PERCENTAGE breakage_chance(object_type *o_ptr) { - int archer_bonus = (p_ptr->pclass == CLASS_ARCHER ? (p_ptr->lev-1)/7 + 4: 0); + PERCENTAGE archer_bonus = (p_ptr->pclass == CLASS_ARCHER ? (PERCENTAGE)(p_ptr->lev-1)/7 + 4: 0); /* Examine the snipe type */ if (snipe_type) @@ -2794,9 +2259,7 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr) monster_race *r_ptr = &r_info[m_ptr->r_idx]; - u32b flgs[TR_FLAG_SIZE]; - - /* Extract the flags */ + BIT_FLAGS flgs[TR_FLAG_SIZE]; object_flags(o_ptr, flgs); /* Some "weapons" and "ammo" do extra damage */ @@ -2806,153 +2269,115 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr) case TV_ARROW: case TV_BOLT: { - /* Slay Animal */ - if ((have_flag(flgs, TR_SLAY_ANIMAL)) && - (r_ptr->flags3 & RF3_ANIMAL)) + if ((have_flag(flgs, TR_SLAY_ANIMAL)) && (r_ptr->flags3 & RF3_ANIMAL)) { if (is_original_ap_and_seen(m_ptr)) { r_ptr->r_flags3 |= RF3_ANIMAL; } - if (mult < 17) mult = 17; } - /* Kill Animal */ - if ((have_flag(flgs, TR_KILL_ANIMAL)) && - (r_ptr->flags3 & RF3_ANIMAL)) + if ((have_flag(flgs, TR_KILL_ANIMAL)) && (r_ptr->flags3 & RF3_ANIMAL)) { if (is_original_ap_and_seen(m_ptr)) { r_ptr->r_flags3 |= RF3_ANIMAL; } - if (mult < 27) mult = 27; } - /* Slay Evil */ - if ((have_flag(flgs, TR_SLAY_EVIL)) && - (r_ptr->flags3 & RF3_EVIL)) + if ((have_flag(flgs, TR_SLAY_EVIL)) && (r_ptr->flags3 & RF3_EVIL)) { if (is_original_ap_and_seen(m_ptr)) { r_ptr->r_flags3 |= RF3_EVIL; } - if (mult < 15) mult = 15; } - /* Kill Evil */ - if ((have_flag(flgs, TR_KILL_EVIL)) && - (r_ptr->flags3 & RF3_EVIL)) + if ((have_flag(flgs, TR_KILL_EVIL)) && (r_ptr->flags3 & RF3_EVIL)) { if (is_original_ap_and_seen(m_ptr)) { r_ptr->r_flags3 |= RF3_EVIL; } - if (mult < 25) mult = 25; } - /* Slay Human */ - if ((have_flag(flgs, TR_SLAY_HUMAN)) && - (r_ptr->flags2 & RF2_HUMAN)) + if ((have_flag(flgs, TR_SLAY_HUMAN)) && (r_ptr->flags2 & RF2_HUMAN)) { if (is_original_ap_and_seen(m_ptr)) { r_ptr->r_flags2 |= RF2_HUMAN; } - if (mult < 17) mult = 17; } - /* Kill Human */ - if ((have_flag(flgs, TR_KILL_HUMAN)) && - (r_ptr->flags2 & RF2_HUMAN)) + if ((have_flag(flgs, TR_KILL_HUMAN)) && (r_ptr->flags2 & RF2_HUMAN)) { if (is_original_ap_and_seen(m_ptr)) { r_ptr->r_flags2 |= RF2_HUMAN; } - if (mult < 27) mult = 27; } - /* Slay Undead */ - if ((have_flag(flgs, TR_SLAY_UNDEAD)) && - (r_ptr->flags3 & RF3_UNDEAD)) + if ((have_flag(flgs, TR_SLAY_UNDEAD)) && (r_ptr->flags3 & RF3_UNDEAD)) { if (is_original_ap_and_seen(m_ptr)) { r_ptr->r_flags3 |= RF3_UNDEAD; } - if (mult < 20) mult = 20; } - /* Kill Undead */ - if ((have_flag(flgs, TR_KILL_UNDEAD)) && - (r_ptr->flags3 & RF3_UNDEAD)) + if ((have_flag(flgs, TR_KILL_UNDEAD)) && (r_ptr->flags3 & RF3_UNDEAD)) { if (is_original_ap_and_seen(m_ptr)) { r_ptr->r_flags3 |= RF3_UNDEAD; } - if (mult < 30) mult = 30; } - /* Slay Demon */ - if ((have_flag(flgs, TR_SLAY_DEMON)) && - (r_ptr->flags3 & RF3_DEMON)) + if ((have_flag(flgs, TR_SLAY_DEMON)) && (r_ptr->flags3 & RF3_DEMON)) { if (is_original_ap_and_seen(m_ptr)) { r_ptr->r_flags3 |= RF3_DEMON; } - if (mult < 20) mult = 20; } - /* Kill Demon */ - if ((have_flag(flgs, TR_KILL_DEMON)) && - (r_ptr->flags3 & RF3_DEMON)) + if ((have_flag(flgs, TR_KILL_DEMON)) && (r_ptr->flags3 & RF3_DEMON)) { if (is_original_ap_and_seen(m_ptr)) { r_ptr->r_flags3 |= RF3_DEMON; } - if (mult < 30) mult = 30; } - /* Slay Orc */ - if ((have_flag(flgs, TR_SLAY_ORC)) && - (r_ptr->flags3 & RF3_ORC)) + if ((have_flag(flgs, TR_SLAY_ORC)) && (r_ptr->flags3 & RF3_ORC)) { if (is_original_ap_and_seen(m_ptr)) { r_ptr->r_flags3 |= RF3_ORC; } - if (mult < 20) mult = 20; } - /* Kill Orc */ - if ((have_flag(flgs, TR_KILL_ORC)) && - (r_ptr->flags3 & RF3_ORC)) + if ((have_flag(flgs, TR_KILL_ORC)) && (r_ptr->flags3 & RF3_ORC)) { if (is_original_ap_and_seen(m_ptr)) { r_ptr->r_flags3 |= RF3_ORC; } - if (mult < 30) mult = 30; } - /* Slay Troll */ - if ((have_flag(flgs, TR_SLAY_TROLL)) && - (r_ptr->flags3 & RF3_TROLL)) + if ((have_flag(flgs, TR_SLAY_TROLL)) && (r_ptr->flags3 & RF3_TROLL)) { if (is_original_ap_and_seen(m_ptr)) { @@ -2962,72 +2387,54 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr) if (mult < 20) mult = 20; } - /* Kill Troll */ - if ((have_flag(flgs, TR_KILL_TROLL)) && - (r_ptr->flags3 & RF3_TROLL)) + if ((have_flag(flgs, TR_KILL_TROLL)) && (r_ptr->flags3 & RF3_TROLL)) { if (is_original_ap_and_seen(m_ptr)) { r_ptr->r_flags3 |= RF3_TROLL; } - if (mult < 30) mult = 30; } - /* Slay Giant */ - if ((have_flag(flgs, TR_SLAY_GIANT)) && - (r_ptr->flags3 & RF3_GIANT)) + if ((have_flag(flgs, TR_SLAY_GIANT)) && (r_ptr->flags3 & RF3_GIANT)) { if (is_original_ap_and_seen(m_ptr)) { r_ptr->r_flags3 |= RF3_GIANT; } - if (mult < 20) mult = 20; } - /* Kill Giant */ - if ((have_flag(flgs, TR_KILL_GIANT)) && - (r_ptr->flags3 & RF3_GIANT)) + if ((have_flag(flgs, TR_KILL_GIANT)) && (r_ptr->flags3 & RF3_GIANT)) { if (is_original_ap_and_seen(m_ptr)) { r_ptr->r_flags3 |= RF3_GIANT; } - if (mult < 30) mult = 30; } - /* Slay Dragon */ - if ((have_flag(flgs, TR_SLAY_DRAGON)) && - (r_ptr->flags3 & RF3_DRAGON)) + if ((have_flag(flgs, TR_SLAY_DRAGON)) && (r_ptr->flags3 & RF3_DRAGON)) { if (is_original_ap_and_seen(m_ptr)) { r_ptr->r_flags3 |= RF3_DRAGON; } - if (mult < 20) mult = 20; } - /* Execute Dragon */ - if ((have_flag(flgs, TR_KILL_DRAGON)) && - (r_ptr->flags3 & RF3_DRAGON)) + if ((have_flag(flgs, TR_KILL_DRAGON)) && (r_ptr->flags3 & RF3_DRAGON)) { if (is_original_ap_and_seen(m_ptr)) { r_ptr->r_flags3 |= RF3_DRAGON; } - if (mult < 30) mult = 30; - - if ((o_ptr->name1 == ART_BARD_ARROW) && - (m_ptr->r_idx == MON_SMAUG) && + if ((o_ptr->name1 == ART_BARD_ARROW) && (m_ptr->r_idx == MON_SMAUG) && (inventory[INVEN_BOW].name1 == ART_BARD)) mult *= 5; } - /* Brand (Acid) */ if (have_flag(flgs, TR_BRAND_ACID)) { /* Notice immunity */ @@ -3038,15 +2445,12 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr) r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_ACID_MASK); } } - - /* Otherwise, take the damage */ else { if (mult < 17) mult = 17; } } - /* Brand (Elec) */ if (have_flag(flgs, TR_BRAND_ELEC)) { /* Notice immunity */ @@ -3057,15 +2461,12 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr) r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK); } } - - /* Otherwise, take the damage */ else { if (mult < 17) mult = 17; } } - /* Brand (Fire) */ if (have_flag(flgs, TR_BRAND_FIRE)) { /* Notice immunity */ @@ -3076,7 +2477,6 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr) r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK); } } - /* Otherwise, take the damage */ else { @@ -3092,7 +2492,6 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr) } } - /* Brand (Cold) */ if (have_flag(flgs, TR_BRAND_COLD)) { /* Notice immunity */ @@ -3118,7 +2517,6 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr) } } - /* Brand (Poison) */ if (have_flag(flgs, TR_BRAND_POIS)) { /* Notice immunity */ @@ -3129,7 +2527,6 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr) r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_IM_POIS_MASK); } } - /* Otherwise, take the damage */ else { @@ -3189,13 +2586,15 @@ static s16b tot_dam_aux_shot(object_type *o_ptr, int tdam, monster_type *m_ptr) * Note that Bows of "Extra Shots" give an extra shot. * */ -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, j, 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; + PERCENTAGE j; object_type forge; object_type *q_ptr; @@ -3204,7 +2603,7 @@ void do_cmd_fire_aux(int item, object_type *j_ptr) bool hit_body = FALSE; - char o_name[MAX_NLEN]; + GAME_TEXT o_name[MAX_NLEN]; u16b path_g[512]; /* For calcuration of path length */ @@ -3226,7 +2625,6 @@ void do_cmd_fire_aux(int item, object_type *j_ptr) /* 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 */ @@ -3322,8 +2720,6 @@ void do_cmd_fire_aux(int item, object_type *j_ptr) /* Start at the player */ y = p_ptr->y; x = p_ptr->x; - - /* Get local object */ q_ptr = &forge; /* Obtain a local object */ @@ -3347,10 +2743,7 @@ void do_cmd_fire_aux(int item, object_type *j_ptr) floor_item_optimize(0 - item); } - /* Sound */ sound(SOUND_SHOOT); - - /* Hack -- Handle stuff */ handle_stuff(); /* Save the old location */ @@ -3383,7 +2776,6 @@ void do_cmd_fire_aux(int item, object_type *j_ptr) if (c_ptr->info & (CAVE_MARK)) msg_print(_("岩ãç ãæ£ã£ãã", "Wall rocks were shattered.")); /* Forget the wall */ c_ptr->info &= ~(CAVE_MARK); - p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE); /* Destroy the wall */ @@ -3404,11 +2796,7 @@ void do_cmd_fire_aux(int item, object_type *j_ptr) if (snipe_type == SP_LITE) { cave[ny][nx].info |= (CAVE_GLOW); - - /* Notice */ note_spot(ny, nx); - - /* Redraw */ lite_spot(ny, nx); } @@ -3445,11 +2833,7 @@ void do_cmd_fire_aux(int item, object_type *j_ptr) if (snipe_type == SP_EVILNESS) { cave[ny][nx].info &= ~(CAVE_GLOW | CAVE_MARK); - - /* Notice */ note_spot(ny, nx); - - /* Redraw */ lite_spot(ny, nx); } @@ -3461,7 +2845,6 @@ void do_cmd_fire_aux(int item, object_type *j_ptr) x = nx; y = ny; - /* Monster here, Try to hit it */ if (cave[y][x].m_idx) { @@ -3527,20 +2910,16 @@ void do_cmd_fire_aux(int item, object_type *j_ptr) /* Handle visible monster */ else { - char m_name[80]; + GAME_TEXT m_name[MAX_NLEN]; /* 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) { - /* Hack -- Track this monster race */ if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx); - - /* Hack -- Track this monster */ health_track(c_mon_ptr->m_idx); } } @@ -3550,7 +2929,7 @@ void do_cmd_fire_aux(int item, object_type *j_ptr) if ((randint1(randint1(r_ptr->level / (3 + p_ptr->concent)) + (8 - p_ptr->concent)) == 1) && !(r_ptr->flags1 & RF1_UNIQUE) && !(r_ptr->flags7 & RF7_UNIQUE2)) { - char m_name[80]; + GAME_TEXT m_name[MAX_NLEN]; /* Get "the monster" or "it" */ monster_desc(m_name, m_ptr, 0); @@ -3562,7 +2941,7 @@ void do_cmd_fire_aux(int item, object_type *j_ptr) } 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); @@ -3591,16 +2970,12 @@ void do_cmd_fire_aux(int item, object_type *j_ptr) if (snipe_type == SP_HOLYNESS) { cave[ny][nx].info |= (CAVE_GLOW); - - /* Notice */ note_spot(ny, nx); - - /* Redraw */ lite_spot(ny, nx); } /* Hit the monster, check for death */ - if (mon_take_hit(c_mon_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_idx(m_ptr)))) { /* Dead monster */ } @@ -3612,7 +2987,7 @@ void do_cmd_fire_aux(int item, object_type *j_ptr) if (object_is_fixed_artifact(q_ptr) && (p_ptr->pclass != CLASS_SNIPER || p_ptr->concent == 0)) { - char m_name[80]; + GAME_TEXT m_name[MAX_NLEN]; monster_desc(m_name, m_ptr, 0); @@ -3620,24 +2995,16 @@ void do_cmd_fire_aux(int item, object_type *j_ptr) 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 */ if (tdam > 0) anger_monster(m_ptr); - /* Take note */ if (fear && m_ptr->ml) { - char m_name[80]; - - /* Sound */ + GAME_TEXT m_name[MAX_NLEN]; 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); } @@ -3647,7 +3014,7 @@ void do_cmd_fire_aux(int item, object_type *j_ptr) if (snipe_type == SP_RUSH) { int n = randint1(5) + 3; - IDX m_idx = c_mon_ptr->m_idx; + MONSTER_IDX m_idx = c_mon_ptr->m_idx; for ( ; cur_dis <= tdis; ) { @@ -3674,8 +3041,7 @@ void do_cmd_fire_aux(int item, object_type *j_ptr) m_ptr->fx = nx; 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); @@ -3710,9 +3076,9 @@ void do_cmd_fire_aux(int item, object_type *j_ptr) if (stick_to) { - IDX m_idx = cave[y][x].m_idx; + 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) { @@ -3766,9 +3132,11 @@ void do_cmd_fire_aux(int item, object_type *j_ptr) */ void do_cmd_fire(void) { - int item; - object_type *j_ptr; - cptr q, s; + OBJECT_IDX item; + object_type *j_ptr, *ammo_ptr; + concptr q, s; + + if(p_ptr->wild_mode) return; is_fired = FALSE; /* not fired yet */ @@ -3806,10 +3174,12 @@ void do_cmd_fire(void) /* 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))) + + + ammo_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR)); + if (!ammo_ptr) { flush(); return; @@ -3833,22 +3203,9 @@ void do_cmd_fire(void) } } -/*! - * @brief ãªãã¸ã§ã¯ããæå°å¯è½ãªæ¦å¨ãã©ãããè¿ãã - * @param o_ptr å¤å®ãããªãã¸ã§ã¯ãã®æ§é ä½åç §ãã¤ã³ã¿ - * @return æå°å¯è½ãªæ¦å¨ãªãã°TRUE - */ -static bool item_tester_hook_boomerang(object_type *o_ptr) -{ - if ((o_ptr->tval==TV_DIGGING) || (o_ptr->tval == TV_SWORD) || (o_ptr->tval == TV_POLEARM) || (o_ptr->tval == TV_HAFTED)) return (TRUE); - - /* Assume not */ - return (FALSE); -} - /*! - * @brief æå°å¦çã®ãµãã«ã¼ãã³ / + * @brief æå°å¦çã¡ã¤ã³ã«ã¼ãã³ / * Throw an object from the pack or floor. * @param mult å¨åã®åç * @param boomerang ãã¼ã¡ã©ã³å¦çãªãã°TRUE @@ -3863,18 +3220,20 @@ static bool item_tester_hook_boomerang(object_type *o_ptr) * the item to be destroyed? Should it do any damage at all? * */ -bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) +bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken) { - int dir, item; - int i, j, y, x, ty, tx, prev_y, prev_x; - int ny[19], nx[19]; + DIRECTION dir; + OBJECT_IDX item; + 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; + PERCENTAGE j; object_type forge; object_type *q_ptr; - object_type *o_ptr; bool hit_body = FALSE; @@ -3882,15 +3241,16 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) bool equiped_item = FALSE; bool return_when_thrown = FALSE; - char o_name[MAX_NLEN]; + GAME_TEXT o_name[MAX_NLEN]; int msec = delay_factor * delay_factor * delay_factor; - u32b flgs[TR_FLAG_SIZE]; - cptr q, s; + BIT_FLAGS flgs[TR_FLAG_SIZE]; + concptr q, s; bool come_back = FALSE; bool do_drop = TRUE; + if (p_ptr->wild_mode) return FALSE; if (p_ptr->special_defense & KATA_MUSOU) { @@ -3900,6 +3260,7 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) if (shuriken >= 0) { item = shuriken; + o_ptr = &inventory[item]; } else if (boomerang) { @@ -3908,45 +3269,41 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) item_tester_hook = item_tester_hook_boomerang; q = _("ã©ã®æ¦å¨ãæãã¾ãã? ", "Throw which item? "); s = _("æããæ¦å¨ããªãã", "You have nothing to throw."); - if (!get_item(&item, q, s, (USE_EQUIP))) + o_ptr = choose_object(&item, q, s, (USE_EQUIP)); + if (!o_ptr) { flush(); return FALSE; } } - else if (buki_motteruka(INVEN_LARM)) item = INVEN_LARM; - else item = INVEN_RARM; + else if (buki_motteruka(INVEN_LARM)) + { + item = INVEN_LARM; + o_ptr = &inventory[item]; + } + else + { + item = INVEN_RARM; + o_ptr = &inventory[item]; + } } 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 = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR | USE_EQUIP)); + if (!o_ptr) { flush(); return FALSE; } } - /* Access the item (if in the pack) */ - if (item >= 0) - { - o_ptr = &inventory[item]; - } - else - { - 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; } @@ -3957,12 +3314,10 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) 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 */ @@ -3978,7 +3333,6 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) /* Single object */ q_ptr->number = 1; - /* Description */ object_desc(o_name, q_ptr, OD_OMIT_PREFIX); if (p_ptr->mighty_throw) mult += 3; @@ -3999,8 +3353,8 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) if (shuriken >= 0) { - ty = randint0(101)-50+p_ptr->y; - tx = randint0(101)-50+p_ptr->x; + ty = randint0(101) - 50 + p_ptr->y; + tx = randint0(101) - 50 + p_ptr->x; } else { @@ -4048,7 +3402,6 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) p_ptr->redraw |= (PR_EQUIPPY); } - /* Take a turn */ p_ptr->energy_use = 100; /* Rogue and Ninja gets bonus */ @@ -4059,8 +3412,6 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) 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; @@ -4098,8 +3449,8 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) /* The player can see the (on screen) missile */ if (panel_contains(ny[cur_dis], nx[cur_dis]) && player_can_see_bold(ny[cur_dis], nx[cur_dis])) { - char c = object_char(q_ptr); - byte a = object_attr(q_ptr); + SYMBOL_CODE c = object_char(q_ptr); + TERM_COLOR a = object_attr(q_ptr); /* Draw, Hilite, Fresh, Pause, Erase */ print_rel(c, a, ny[cur_dis], nx[cur_dis]); @@ -4132,7 +3483,6 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) 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 */ @@ -4156,20 +3506,13 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) /* Handle visible monster */ else { - char m_name[80]; - - /* Get "the monster" or "it" */ + GAME_TEXT m_name[MAX_NLEN]; monster_desc(m_name, m_ptr, 0); - - /* Message */ msg_format(_("%sã%sã«å½ä¸ããã", "The %s hits %s."), o_name, m_name); if (m_ptr->ml) { - /* Hack -- Track this monster race */ if (!p_ptr->image) monster_race_track(m_ptr->ap_r_idx); - - /* Hack -- Track this monster */ health_track(c_ptr->m_idx); } } @@ -4179,7 +3522,7 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) 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) @@ -4216,7 +3559,7 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) 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)))) + if (mon_take_hit(c_ptr->m_idx, tdam, &fear, extract_note_dies(real_r_idx(m_ptr)))) { /* Dead monster */ } @@ -4224,25 +3567,17 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) /* No death */ else { - /* Message */ message_pain(c_ptr->m_idx, tdam); /* Anger the monster */ if ((tdam > 0) && !object_is_potion(q_ptr)) anger_monster(m_ptr); - /* Take note */ if (fear && m_ptr->ml) { - char m_name[80]; - - /* Sound */ sound(SOUND_FLEE); - - /* Get the monster name (or "it") */ + GAME_TEXT m_name[MAX_NLEN]; monster_desc(m_name, m_ptr, 0); - - /* Message */ msg_format(_("%^sã¯ææãã¦éãåºããï¼", "%^s flees in terror!"), m_name); } } @@ -4264,8 +3599,7 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) { j = 100; - if (!(summon_named_creature(0, y, x, q_ptr->pval, - !(object_is_cursed(q_ptr)) ? PM_FORCE_PET : 0L))) + if (!(summon_named_creature(0, y, x, q_ptr->pval, !(object_is_cursed(q_ptr)) ? PM_FORCE_PET : 0L))) msg_print(_("人形ã¯æ»ãæ²ããç ãæ£ã£ã¦ãã¾ã£ãï¼", "The Figurine writhes and then shatters.")); else if (object_is_cursed(q_ptr)) msg_print(_("ããã¯ãã¾ãè¯ããªãæ°ãããã", "You have a bad feeling about this.")); @@ -4278,7 +3612,6 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) { 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)) @@ -4290,7 +3623,7 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) is_friendly(&m_list[cave[y][x].m_idx]) && !MON_INVULNER(m_ptr)) { - char m_name[80]; + GAME_TEXT m_name[MAX_NLEN]; monster_desc(m_name, &m_list[cave[y][x].m_idx], 0); msg_format(_("%sã¯æã£ãï¼", "%^s gets angry!"), m_name); set_hostile(&m_list[cave[y][x].m_idx]); @@ -4373,22 +3706,13 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) /* Wear the new stuff */ object_copy(o_ptr, q_ptr); - /* Increase the weight */ p_ptr->total_weight += q_ptr->weight; /* Increment the equip counter by hand */ equip_cnt++; - /* Recalculate bonuses */ - p_ptr->update |= (PU_BONUS); - /* Recalculate torch */ - p_ptr->update |= (PU_TORCH); - - /* Recalculate mana XXX */ - p_ptr->update |= (PU_MANA); - - /* Window stuff */ + p_ptr->update |= (PU_BONUS | PU_TORCH | PU_MANA); p_ptr->window |= (PW_EQUIP); } else @@ -4403,17 +3727,14 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) calc_android_exp(); } - /* Drop (or break) near that location */ if (do_drop) { if (cave_have_flag_bold(y, x, FF_PROJECT)) { - /* Drop (or break) near that location */ (void)drop_near(q_ptr, j, y, x); } else { - /* Drop (or break) near that location */ (void)drop_near(q_ptr, j, prev_y, prev_x); } } @@ -4422,17 +3743,6 @@ bool do_cmd_throw_aux(int mult, bool boomerang, int shuriken) } -/*! - * @brief æå°å¦çã®ã¡ã¤ã³ã«ã¼ãã³ / - * Throw an object from the pack or floor. - * @return ãªã - */ -void do_cmd_throw(void) -{ - do_cmd_throw_aux(1, FALSE, -1); -} - - #ifdef TRAVEL /* * Hack: travel command @@ -4450,18 +3760,16 @@ static POSITION temp2_y[MAX_SHORT]; */ void forget_travel_flow(void) { - int x, y; - - /* Check the entire dungeon */ + POSITION x, y; + /* Check the entire dungeon / Forget the old data */ for (y = 0; y < cur_hgt; y++) { for (x = 0; x < cur_wid; x++) { - /* Forget the old data */ + travel.cost[y][x] = MAX_SHORT; } } - travel.y = travel.x = 0; } @@ -4471,7 +3779,7 @@ void forget_travel_flow(void) * @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; @@ -4571,9 +3879,9 @@ static void travel_flow_aux(POSITION y, POSITION x, int n, bool wall) * @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]; @@ -4619,7 +3927,7 @@ void do_cmd_travel(void) { POSITION x, y; int i; - int dx, dy, sx, sy; + POSITION dx, dy, sx, sy; feature_type *f_ptr; if (travel.x != 0 && travel.y != 0 &&