X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fxtra2.c;h=ef0e19455254a6b067b326a803a7fc4945f9496c;hb=15d3e52034e240cc87463ba1426e05106c1d9a5e;hp=eff06b189a01ec795c5a7c8e5a0a4bd8804e0106;hpb=48ec3d6b661a3c6f22511e5562f4cac4fb68743d;p=hengband%2Fhengband.git diff --git a/src/xtra2.c b/src/xtra2.c index eff06b189..ef0e19455 100644 --- a/src/xtra2.c +++ b/src/xtra2.c @@ -49,8 +49,6 @@ void check_experience(void) /* Redraw experience */ p_ptr->redraw |= (PR_EXP); - - /* Handle stuff */ handle_stuff(); @@ -67,10 +65,7 @@ void check_experience(void) /* Redraw some stuff */ p_ptr->redraw |= (PR_LEV | PR_TITLE); - /* Window stuff */ p_ptr->window |= (PW_PLAYER); - - /* Handle stuff */ handle_stuff(); } @@ -111,13 +106,10 @@ void check_experience(void) /* Redraw some stuff */ p_ptr->redraw |= (PR_LEV | PR_TITLE | PR_EXP); - /* Window stuff */ p_ptr->window |= (PW_PLAYER | PW_SPELL | PW_INVEN); /* HPとMPの上昇量を表示 */ level_up = 1; - - /* Handle stuff */ handle_stuff(); level_up = 0; @@ -204,10 +196,7 @@ void check_experience(void) /* Redraw some stuff */ p_ptr->redraw |= (PR_LEV | PR_TITLE); - /* Window stuff */ p_ptr->window |= (PW_PLAYER | PW_SPELL); - - /* Handle stuff */ handle_stuff(); } @@ -223,7 +212,7 @@ void check_experience(void) * @details * Hack -- Return the "automatic coin type" of a monster race * Used to allocate proper treasure when "Creeping coins" die - * XXX XXX XXX Note the use of actual "monster names" + * Note the use of actual "monster names" */ static int get_coin_type(MONRACE_IDX r_idx) { @@ -649,10 +638,7 @@ void check_quest_completion(monster_type *m_ptr) for (i = 0; i < (dun_level / 15)+1; i++) { - /* Get local object */ o_ptr = &forge; - - /* Wipe the object */ object_wipe(o_ptr); /* Make a great object */ @@ -822,7 +808,6 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) if (arena_info[p_ptr->arena_number].tval) { - /* Get local object */ q_ptr = &forge; /* Prepare to make a prize */ @@ -885,8 +870,6 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) if (!one_in_(5)) corpse = TRUE; } } - - /* Get local object */ q_ptr = &forge; /* Prepare to make an object */ @@ -938,7 +921,6 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) /* Bloodletters of Khorne may drop a blade of chaos */ if (drop_chosen_item && (randint1(100) < 15)) { - /* Get local object */ q_ptr = &forge; /* Prepare to make a Blade of Chaos */ @@ -954,10 +936,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) case MON_RAAL: if (drop_chosen_item && (dun_level > 9)) { - /* Get local object */ q_ptr = &forge; - - /* Wipe the object */ object_wipe(q_ptr); /* Activate restriction */ @@ -1060,8 +1039,6 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) case MON_SERPENT: if (!drop_chosen_item) break; - - /* Get local object */ q_ptr = &forge; /* Mega-Hack -- Prepare to make "Grond" */ @@ -1075,8 +1052,6 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) /* Drop it in the dungeon */ (void)drop_near(q_ptr, -1, y, x); - - /* Get local object */ q_ptr = &forge; /* Mega-Hack -- Prepare to make "Chaos" */ @@ -1095,7 +1070,6 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) case MON_B_DEATH_SWORD: if (drop_chosen_item) { - /* Get local object */ q_ptr = &forge; /* Prepare to make a broken sword */ @@ -1111,7 +1085,6 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) if (drop_chosen_item && ((m_ptr->r_idx == MON_A_GOLD) || ((m_ptr->r_idx == MON_A_SILVER) && (r_ptr->r_akills % 5 == 0)))) { - /* Get local object */ q_ptr = &forge; /* Prepare to make a Can of Toys */ @@ -1139,10 +1112,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) case '(': if (dun_level > 0) { - /* Get local object */ q_ptr = &forge; - - /* Wipe the object */ object_wipe(q_ptr); /* Activate restriction */ @@ -1159,10 +1129,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) case '/': if (dun_level > 4) { - /* Get local object */ q_ptr = &forge; - - /* Wipe the object */ object_wipe(q_ptr); /* Activate restriction */ @@ -1179,10 +1146,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) case '[': if (dun_level > 19) { - /* Get local object */ q_ptr = &forge; - - /* Wipe the object */ object_wipe(q_ptr); /* Activate restriction */ @@ -1199,10 +1163,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) case '\\': if (dun_level > 4) { - /* Get local object */ q_ptr = &forge; - - /* Wipe the object */ object_wipe(q_ptr); /* Activate restriction */ @@ -1219,10 +1180,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) case '|': if (m_ptr->r_idx != MON_STORMBRINGER) { - /* Get local object */ q_ptr = &forge; - - /* Wipe the object */ object_wipe(q_ptr); /* Activate restriction */ @@ -1299,7 +1257,6 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) if (k_idx) { - /* Get local object */ q_ptr = &forge; /* Prepare to make a reward */ @@ -1341,10 +1298,7 @@ void monster_death(MONSTER_IDX m_idx, bool drop_item) /* Drop some objects */ for (j = 0; j < number; j++) { - /* Get local object */ q_ptr = &forge; - - /* Wipe the object */ object_wipe(q_ptr); /* Make Gold */ @@ -1562,7 +1516,7 @@ static void get_exp_from_mon(HIT_POINT dam, monster_type *m_ptr) * Made name, sex, and capitalization generic -BEN- * As always, the "ghost" processing is a total hack. * Hack -- we "delay" fear messages by passing around a "fear" flag. - * XXX XXX XXX Consider decreasing monster experience over time, say, + * Consider decreasing monster experience over time, say, * by using "(m_exp * m_lev * (m_lev)) / (p_lev * (m_lev + n_killed))" * instead of simply "(m_exp * m_lev) / (p_lev)", to make the first * monster worth more than subsequent monsters. This would also need @@ -1571,15 +1525,14 @@ static void get_exp_from_mon(HIT_POINT dam, monster_type *m_ptr) */ bool mon_take_hit(MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, cptr note) { - monster_type *m_ptr = &m_list[m_idx]; - monster_race *r_ptr = &r_info[m_ptr->r_idx]; - - monster_type exp_mon; + monster_type *m_ptr = &m_list[m_idx]; + monster_race *r_ptr = &r_info[m_ptr->r_idx]; + monster_type exp_mon; /* Innocent until proven otherwise */ - bool innocent = TRUE, thief = FALSE; - int i; - int expdam; + bool innocent = TRUE, thief = FALSE; + int i; + HIT_POINT expdam; (void)COPY(&exp_mon, m_ptr, monster_type); @@ -1594,7 +1547,6 @@ bool mon_take_hit(MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, cptr note) if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH); if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH); - /* Wake it up */ (void)set_monster_csleep(m_idx, 0); /* Hack - Cancel any special player stealth magics. -LM- */ @@ -1606,15 +1558,14 @@ bool mon_take_hit(MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, cptr note) /* Genocided by chaos patron */ if (!m_idx) return TRUE; - /* Hurt it */ m_ptr->hp -= dam; - m_ptr->dealt_damage += dam; + if(m_ptr->dealt_damage > m_ptr->max_maxhp * 100) m_ptr->dealt_damage = m_ptr->max_maxhp * 100; + if (p_ptr->wizard) { - msg_format( _("合計%d/%dのダメージを与えた。","You do %d (out of %d) damage."), - m_ptr->dealt_damage, m_ptr->maxhp); + msg_format( _("合計%d/%dのダメージを与えた。","You do %d (out of %d) damage."), m_ptr->dealt_damage, m_ptr->maxhp); } /* It is dead now */ @@ -1713,8 +1664,9 @@ bool mon_take_hit(MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, cptr note) /* Dump a message */ if (!get_rnd_line(_("mondeath_j.txt", "mondeath.txt"), m_ptr->r_idx, line_got)) - + { msg_format("%^s %s", m_name, line_got); + } #ifdef WORLD_SCORE if (m_ptr->r_idx == MON_SERPENT) @@ -1762,8 +1714,7 @@ bool mon_take_hit(MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, cptr note) chg_virtue(V_COMPASSION, -1); } - if ((r_ptr->flags3 & RF3_GOOD) && - ((r_ptr->level) / 10 + (3 * dun_level) >= randint1(100))) + if ((r_ptr->flags3 & RF3_GOOD) && ((r_ptr->level) / 10 + (3 * dun_level) >= randint1(100))) chg_virtue(V_UNLIFE, 1); if (r_ptr->d_char == 'A') @@ -1820,8 +1771,7 @@ bool mon_take_hit(MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, cptr note) { if (r_ptr->flags1 & RF1_UNIQUE) chg_virtue(V_JUSTICE, 3); - else if (1+((r_ptr->level) / 10 + (2 * dun_level)) - >= randint1(100)) + else if (1+((r_ptr->level) / 10 + (2 * dun_level)) >= randint1(100)) chg_virtue(V_JUSTICE, 1); } else if (innocent) @@ -1837,11 +1787,7 @@ bool mon_take_hit(MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, cptr note) if ((r_ptr->flags1 & RF1_UNIQUE) && record_destroy_uniq) { char note_buf[160]; -#ifdef JP - sprintf(note_buf, "%s%s", r_name + r_ptr->name, (m_ptr->smart & SM_CLONED) ? "(クローン)" : ""); -#else - sprintf(note_buf, "%s%s", r_name + r_ptr->name, (m_ptr->smart & SM_CLONED) ? "(Clone)" : ""); -#endif + sprintf(note_buf, "%s%s", r_name + r_ptr->name, (m_ptr->smart & SM_CLONED) ? _("(クローン)", "(Clone)") : ""); do_cmd_write_nikki(NIKKI_UNIQUE, 0, note_buf); } @@ -1887,7 +1833,7 @@ bool mon_take_hit(MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, cptr note) if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)) msg_format("せっかくだから%sを倒した。", m_name); else -msg_format("%sを倒した。", m_name); + msg_format("%sを倒した。", m_name); #else msg_format("You have destroyed %s.", m_name); #endif @@ -1901,7 +1847,7 @@ msg_format("%sを倒した。", m_name); if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON)) msg_format("せっかくだから%sを葬り去った。", m_name); else -msg_format("%sを葬り去った。", m_name); + msg_format("%sを葬り去った。", m_name); #else msg_format("You have slain %s.", m_name); #endif @@ -1923,18 +1869,13 @@ msg_format("%sを葬り去った。", m_name); monster_death(m_idx, TRUE); /* Mega hack : replace IKETA to BIKETAL */ - if ((m_ptr->r_idx == MON_IKETA) && - !(p_ptr->inside_arena || p_ptr->inside_battle)) + if ((m_ptr->r_idx == MON_IKETA) && !(p_ptr->inside_arena || p_ptr->inside_battle)) { - int dummy_y = m_ptr->fy; - int dummy_x = m_ptr->fx; + POSITION dummy_y = m_ptr->fy; + POSITION dummy_x = m_ptr->fx; BIT_FLAGS mode = 0L; - if (is_pet(m_ptr)) mode |= PM_FORCE_PET; - - /* Delete the monster */ delete_monster_idx(m_idx); - if (summon_named_creature(0, dummy_y, dummy_x, MON_BIKETAL, mode)) { msg_print(_("「ハァッハッハッハ!!私がバイケタルだ!!」", "Uwa-hahaha! *I* am Biketal!")); @@ -1942,7 +1883,6 @@ msg_format("%sを葬り去った。", m_name); } else { - /* Delete the monster */ delete_monster_idx(m_idx); } @@ -1979,13 +1919,12 @@ msg_format("%sを葬り去った。", m_name); * Run (sometimes) if at 10% or less of max hit points, * or (usually) when hit for half its current hit points */ - if ((randint1(10) >= percentage) || - ((dam >= m_ptr->hp) && (randint0(100) < 80))) + if ((randint1(10) >= percentage) || ((dam >= m_ptr->hp) && (randint0(100) < 80))) { /* Hack -- note fear */ (*fear) = TRUE; - /* XXX XXX XXX Hack -- Add some timed fear */ + /* Hack -- Add some timed fear */ (void)set_monster_monfear(m_idx, (randint1(10) + (((dam >= m_ptr->hp) && (percentage > 7)) ? 20 : ((11 - percentage) * 5)))); @@ -1994,22 +1933,6 @@ msg_format("%sを葬り去った。", m_name); #endif -#if 0 - if (p_ptr->riding && (p_ptr->riding == m_idx) && (dam > 0)) - { - char m_name[80]; - - /* Extract monster name */ - monster_desc(m_name, m_ptr, 0); - - if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2; - if (rakuba((dam > 200) ? 200 : dam, FALSE)) - { - msg_format(_("%^sに振り落とされた!", "%^s has thrown you off!"), m_name); - } - } -#endif - /* Not dead yet */ return (FALSE); } @@ -2040,7 +1963,6 @@ void panel_bounds_center(void) { int wid, hgt; - /* Get size */ get_screen_size(&wid, &hgt); panel_row_max = panel_row_min + hgt - 1; @@ -2070,7 +1992,6 @@ void resize_map(void) verify_panel(); - /* Update stuff */ p_ptr->update |= (PU_TORCH | PU_BONUS | PU_HP | PU_MANA | PU_SPELLS); /* Forget lite/view */ @@ -2087,8 +2008,6 @@ void resize_map(void) /* Hack -- update */ handle_stuff(); - - /* Redraw */ Term_redraw(); /* @@ -2111,16 +2030,11 @@ void redraw_window(void) /* Only if the dungeon exists */ if (!character_dungeon) return; - /* Window stuff */ p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER); - - /* Window stuff */ p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT); /* Hack -- update */ handle_stuff(); - - /* Redraw */ Term_redraw(); } @@ -2139,7 +2053,6 @@ bool change_panel(POSITION dy, POSITION dx) POSITION y, x; TERM_LEN wid, hgt; - /* Get size */ get_screen_size(&wid, &hgt); /* Apply the motion */ @@ -2164,13 +2077,9 @@ bool change_panel(POSITION dy, POSITION dx) /* Recalculate the boundaries */ panel_bounds_center(); - /* Update stuff */ p_ptr->update |= (PU_MONSTERS); - /* Redraw map */ p_ptr->redraw |= (PR_MAP); - - /* Handle stuff */ handle_stuff(); /* Success */ @@ -2196,7 +2105,6 @@ static bool change_panel_xy(POSITION y, POSITION x) POSITION dy = 0, dx = 0; TERM_LEN wid, hgt; - /* Get size */ get_screen_size(&wid, &hgt); if (y < panel_row_min) dy = -1; @@ -2230,7 +2138,6 @@ void verify_panel(void) int max_prow_min; int max_pcol_min; - /* Get size */ get_screen_size(&wid, &hgt); max_prow_min = cur_hgt - hgt; @@ -2307,18 +2214,15 @@ void verify_panel(void) panel_col_min = pcol_min; /* Hack -- optional disturb on "panel change" */ - if (disturb_panel && !center_player) disturb(0, 0); + if (disturb_panel && !center_player) disturb(FALSE, FALSE); /* Recalculate the boundaries */ panel_bounds_center(); - /* Update stuff */ p_ptr->update |= (PU_MONSTERS); - /* Redraw map */ p_ptr->redraw |= (PR_MAP); - /* Window stuff */ p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON); } @@ -2536,7 +2440,7 @@ bool target_able(MONSTER_IDX m_idx) /* Monster must be projectable */ if (!projectable(p_ptr->y, p_ptr->x, m_ptr->fy, m_ptr->fx)) return (FALSE); - /* XXX XXX XXX Hack -- Never target trappers */ + /* Hack -- Never target trappers */ /* if (CLEAR_ATTR && (CLEAR_CHAR)) return (FALSE); */ /* Assume okay */ @@ -2741,7 +2645,7 @@ static POSITION_IDX target_pick(POSITION y1, POSITION x1, POSITION dy, POSITION /* Approximate Double Distance */ v = ((x4 > y4) ? (x4 + x4 + y4) : (y4 + y4 + x4)); - /* XXX XXX XXX Penalize location */ + /* Penalize location */ /* Track best */ if ((b_i >= 0) && (v >= b_v)) continue; @@ -2749,8 +2653,6 @@ static POSITION_IDX target_pick(POSITION y1, POSITION x1, POSITION dy, POSITION /* Track best */ b_i = i; b_v = v; } - - /* Result */ return (b_i); } @@ -2788,8 +2690,6 @@ static bool target_set_accept(POSITION y, POSITION x) 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 */ @@ -2809,7 +2709,6 @@ static bool target_set_accept(POSITION y, POSITION x) if (have_flag(f_info[get_feat_mimic(c_ptr)].flags, FF_NOTICE)) return TRUE; } - /* Nope */ return (FALSE); } @@ -2977,7 +2876,7 @@ bool show_gold_on_floor = FALSE; * recall info and the health bar info to track that monster. * * Eventually, we may allow multiple objects per grid, or objects - * and terrain features in the same grid. XXX XXX XXX + * and terrain features in the same grid. * * This function must handle blindness/hallucination. */ @@ -2991,8 +2890,6 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info) feature_type *f_ptr; char query = '\001'; char out_val[MAX_NLEN+80]; - -#ifdef ALLOW_EASY_FLOOR OBJECT_IDX floor_list[23]; ITEM_NUMBER floor_num = 0; @@ -3007,8 +2904,6 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info) } } -#endif /* ALLOW_EASY_FLOOR */ - /* Hack -- under the player */ if (player_bold(y, x)) { @@ -3163,8 +3058,6 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info) char o_name[MAX_NLEN]; object_type *o_ptr; - - /* Acquire object */ o_ptr = &o_list[this_o_idx]; /* Acquire next object */ @@ -3173,7 +3066,6 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info) /* Obtain an object description */ object_desc(o_name, o_ptr, 0); - /* Describe the object */ #ifdef JP sprintf(out_val, "%s%s%s%s[%s]", s1, o_name, s2, s3, info); #else @@ -3203,8 +3095,6 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info) #endif } - -#ifdef ALLOW_EASY_FLOOR if (floor_num) { int min_width = 0; @@ -3216,19 +3106,14 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info) char o_name[MAX_NLEN]; object_type *o_ptr; - - /* Acquire object */ o_ptr = &o_list[floor_list[0]]; - /* Describe the object */ object_desc(o_name, o_ptr, 0); #ifdef JP - sprintf(out_val, "%s%s%s%s[%s]", - s1, o_name, s2, s3, info); + sprintf(out_val, "%s%s%s%s[%s]", s1, o_name, s2, s3, info); #else - sprintf(out_val, "%s%s%s%s [%s]", - s1, s2, s3, o_name, info); + sprintf(out_val, "%s%s%s%s [%s]", s1, s2, s3, o_name, info); #endif prt(out_val, 0, 0); @@ -3246,11 +3131,9 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info) { /* Display rough information about items */ #ifdef JP - sprintf(out_val, "%s %d個のアイテム%s%s ['x'で一覧, %s]", - s1, (int)floor_num, s2, s3, info); + sprintf(out_val, "%s %d個のアイテム%s%s ['x'で一覧, %s]", s1, (int)floor_num, s2, s3, info); #else - sprintf(out_val, "%s%s%sa pile of %d items [x,%s]", - s1, s2, s3, (int)floor_num, info); + sprintf(out_val, "%s%s%sa pile of %d items [x,%s]", s1, s2, s3, (int)floor_num, info); #endif prt(out_val, 0, 0); @@ -3271,8 +3154,6 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info) { int i; OBJECT_IDX o_idx; - - /* Save screen */ screen_save(); /* Display */ @@ -3282,19 +3163,13 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info) /* Prompt */ #ifdef JP - sprintf(out_val, "%s %d個のアイテム%s%s [Enterで次へ, %s]", - s1, (int)floor_num, s2, s3, info); + sprintf(out_val, "%s %d個のアイテム%s%s [Enterで次へ, %s]", s1, (int)floor_num, s2, s3, info); #else - sprintf(out_val, "%s%s%sa pile of %d items [Enter,%s]", - s1, s2, s3, (int)floor_num, info); + sprintf(out_val, "%s%s%sa pile of %d items [Enter,%s]", s1, s2, s3, (int)floor_num, info); #endif prt(out_val, 0, 0); - - /* Wait */ query = inkey(); - - /* Load screen */ screen_load(); /* Exit unless 'Enter' */ @@ -3326,15 +3201,11 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info) /* NOTREACHED */ } -#endif /* ALLOW_EASY_FLOOR */ - /* 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 */ @@ -3351,7 +3222,6 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info) /* Obtain an object description */ object_desc(o_name, o_ptr, 0); - /* Describe the object */ #ifdef JP sprintf(out_val, "%s%s%s%s[%s]", s1, o_name, s2, s3, info); #else @@ -3529,10 +3399,10 @@ static char target_set_aux(POSITION y, POSITION x, BIT_FLAGS mode, cptr info) * * All locations must be on the current panel. Consider the use of * "panel_bounds()" to allow "off-panel" targets, perhaps by using - * some form of "scrolling" the map around the cursor. XXX XXX XXX + * some form of "scrolling" the map around the cursor. * That is, consider the possibility of "auto-scrolling" the screen * while the cursor moves around. This may require changes in the - * "update_mon()" code to allow "visibility" even if off panel, and + * "update_monster()" code to allow "visibility" even if off panel, and * may require dynamic recalculation of the "temp" grid set. * * Hack -- targeting/observing an "outer border grid" may induce @@ -3579,7 +3449,6 @@ bool target_set(BIT_FLAGS mode) int wid, hgt; - /* Get size */ get_screen_size(&wid, &hgt); /* Cancel target */ @@ -3716,16 +3585,11 @@ bool target_set(BIT_FLAGS mode) /* Recenter the map around the player */ verify_panel(); - /* Update stuff */ p_ptr->update |= (PU_MONSTERS); - /* Redraw map */ p_ptr->redraw |= (PR_MAP); - /* Window stuff */ p_ptr->window |= (PW_OVERHEAD); - - /* Handle stuff */ handle_stuff(); /* Recalculate interesting grids */ @@ -3809,16 +3673,11 @@ bool target_set(BIT_FLAGS mode) panel_col_min = x2; panel_bounds_center(); - /* Update stuff */ p_ptr->update |= (PU_MONSTERS); - /* Redraw map */ p_ptr->redraw |= (PR_MAP); - /* Window stuff */ p_ptr->window |= (PW_OVERHEAD); - - /* Handle stuff */ handle_stuff(); /* Recalculate interesting grids */ @@ -3930,16 +3789,11 @@ bool target_set(BIT_FLAGS mode) /* Recenter the map around the player */ verify_panel(); - /* Update stuff */ p_ptr->update |= (PU_MONSTERS); - /* Redraw map */ p_ptr->redraw |= (PR_MAP); - /* Window stuff */ p_ptr->window |= (PW_OVERHEAD); - - /* Handle stuff */ handle_stuff(); /* Recalculate interesting grids */ @@ -4057,16 +3911,11 @@ bool target_set(BIT_FLAGS mode) /* Recenter the map around the player */ verify_panel(); - /* Update stuff */ p_ptr->update |= (PU_MONSTERS); - /* Redraw map */ p_ptr->redraw |= (PR_MAP); - /* Window stuff */ p_ptr->window |= (PW_OVERHEAD); - - /* Handle stuff */ handle_stuff(); /* Failure to set target */ @@ -4095,7 +3944,6 @@ bool get_aim_dir(DIRECTION *dp) cptr p; COMMAND_CODE code; - /* Initialize */ (*dp) = 0; /* Global direction */ @@ -4104,8 +3952,6 @@ bool get_aim_dir(DIRECTION *dp) /* Hack -- auto-target if requested */ if (use_old_target && target_okay()) dir = 5; -#ifdef ALLOW_REPEAT /* TNB */ - if (repeat_pull(&code)) { /* Confusion? */ @@ -4119,8 +3965,6 @@ bool get_aim_dir(DIRECTION *dp) } *dp = (DIRECTION)code; -#endif /* ALLOW_REPEAT -- TNB */ - /* Ask until satisfied */ while (!dir) { @@ -4208,59 +4052,33 @@ bool get_aim_dir(DIRECTION *dp) /* Save direction */ (*dp) = dir; -#ifdef ALLOW_REPEAT /* TNB */ - /* repeat_push(dir); */ repeat_push((COMMAND_CODE)command_dir); -#endif /* ALLOW_REPEAT -- TNB */ - /* A "valid" direction was entered */ return (TRUE); } - -/* - * Request a "movement" direction (1,2,3,4,6,7,8,9) from the user, - * and place it into "command_dir", unless we already have one. - * - * This function should be used for all "repeatable" commands, such as - * run, walk, open, close, bash, disarm, spike, tunnel, etc, as well - * as all commands which must reference a grid adjacent to the player, - * and which may not reference the grid under the player. Note that, - * for example, it is no longer possible to "disarm" or "open" chests - * in the same grid as the player. - * - * Direction "5" is illegal and will (cleanly) abort the command. - * - * This function tracks and uses the "global direction", and uses - * that as the "desired direction", to which "confusion" is applied. - */ -bool get_rep_dir(DIRECTION *dp, bool under) +bool get_direction(DIRECTION *dp, bool allow_under, bool with_steed) { DIRECTION dir; cptr prompt; COMMAND_CODE code; - /* Initialize */ (*dp) = 0; /* Global direction */ dir = command_dir; -#ifdef ALLOW_REPEAT /* TNB */ - if (repeat_pull(&code)) { dir = (DIRECTION)code; -/* return (TRUE); */ + /* return (TRUE); */ } *dp = (DIRECTION)code; -#endif /* ALLOW_REPEAT -- TNB */ - - if (under) + if (allow_under) { prompt = _("方向 ('.'足元, ESCで中断)? ", "Direction ('.' at feet, Escape to cancel)? "); } @@ -4268,7 +4086,7 @@ bool get_rep_dir(DIRECTION *dp, bool under) { prompt = _("方向 (ESCで中断)? ", "Direction (Escape to cancel)? "); } - + /* Get a direction */ while (!dir) { @@ -4278,7 +4096,7 @@ bool get_rep_dir(DIRECTION *dp, bool under) if (!get_com(prompt, &ch, TRUE)) break; /* Look down */ - if ((under) && ((ch == '5') || (ch == '-') || (ch == '.'))) + if ((allow_under) && ((ch == '5') || (ch == '-') || (ch == '.'))) { dir = 5; } @@ -4287,13 +4105,12 @@ bool get_rep_dir(DIRECTION *dp, bool under) /* Look up the direction */ dir = get_keymap_dir(ch); - /* Oops */ if (!dir) bell(); } } /* Prevent weirdness */ - if ((dir == 5) && (!under)) dir = 0; + if ((dir == 5) && (!allow_under)) dir = 0; /* Aborted */ if (!dir) return (FALSE); @@ -4311,7 +4128,7 @@ bool get_rep_dir(DIRECTION *dp, bool under) dir = ddd[randint0(8)]; } } - else if (p_ptr->riding) + else if (p_ptr->riding && with_steed) { monster_type *m_ptr = &m_list[p_ptr->riding]; monster_race *r_ptr = &r_info[m_ptr->r_idx]; @@ -4365,31 +4182,40 @@ bool get_rep_dir(DIRECTION *dp, bool under) /* Save direction */ (*dp) = dir; -#ifdef ALLOW_REPEAT /* TNB */ - -/* repeat_push(dir); */ + /* repeat_push(dir); */ repeat_push((COMMAND_CODE)command_dir); -#endif /* ALLOW_REPEAT -- TNB */ - /* Success */ return (TRUE); } - -bool get_rep_dir2(DIRECTION *dp) +/* + * @brief 進行方向を指定する(騎乗対象の混乱の影響を受ける) / Request a "movement" direction (1,2,3,4,6,7,8,9) from the user, + * and place it into "command_dir", unless we already have one. + * + * This function should be used for all "repeatable" commands, such as + * run, walk, open, close, bash, disarm, spike, tunnel, etc, as well + * as all commands which must reference a grid adjacent to the player, + * and which may not reference the grid under the player. Note that, + * for example, it is no longer possible to "disarm" or "open" chests + * in the same grid as the player. + * + * Direction "5" is illegal and will (cleanly) abort the command. + * + * This function tracks and uses the "global direction", and uses + * that as the "desired direction", to which "confusion" is applied. + */ +bool get_rep_dir(DIRECTION *dp, bool under) { DIRECTION dir; + cptr prompt; COMMAND_CODE code; - /* Initialize */ (*dp) = 0; /* Global direction */ dir = command_dir; -#ifdef ALLOW_REPEAT /* TNB */ - if (repeat_pull(&code)) { dir = (DIRECTION)code; @@ -4397,25 +4223,39 @@ bool get_rep_dir2(DIRECTION *dp) } *dp = (DIRECTION)code; -#endif /* ALLOW_REPEAT -- TNB */ - + if (under) + { + prompt = _("方向 ('.'足元, ESCで中断)? ", "Direction ('.' at feet, Escape to cancel)? "); + } + else + { + prompt = _("方向 (ESCで中断)? ", "Direction (Escape to cancel)? "); + } + /* Get a direction */ while (!dir) { char ch; /* Get a command (or Cancel) */ - if (!get_com(_("方向 (ESCで中断)? ", "Direction (Escape to cancel)? "), &ch, TRUE)) break; + if (!get_com(prompt, &ch, TRUE)) break; - /* Look up the direction */ - dir = get_keymap_dir(ch); + /* Look down */ + if ((under) && ((ch == '5') || (ch == '-') || (ch == '.'))) + { + dir = 5; + } + else + { + /* Look up the direction */ + dir = get_keymap_dir(ch); - /* Oops */ - if (!dir) bell(); + if (!dir) bell(); + } } /* Prevent weirdness */ - if (dir == 5) dir = 0; + if ((dir == 5) && (!under)) dir = 0; /* Aborted */ if (!dir) return (FALSE); @@ -4433,24 +4273,63 @@ bool get_rep_dir2(DIRECTION *dp) dir = ddd[randint0(8)]; } } + else if (p_ptr->riding) + { + monster_type *m_ptr = &m_list[p_ptr->riding]; + monster_race *r_ptr = &r_info[m_ptr->r_idx]; + + if (MON_CONFUSED(m_ptr)) + { + /* Standard confusion */ + if (randint0(100) < 75) + { + /* Random direction */ + dir = ddd[randint0(8)]; + } + } + else if ((r_ptr->flags1 & RF1_RAND_50) && (r_ptr->flags1 & RF1_RAND_25) && (randint0(100) < 50)) + { + /* Random direction */ + dir = ddd[randint0(8)]; + } + else if ((r_ptr->flags1 & RF1_RAND_50) && (randint0(100) < 25)) + { + /* Random direction */ + dir = ddd[randint0(8)]; + } + } /* Notice confusion */ if (command_dir != dir) { - /* Warn the user */ - msg_print(_("あなたは混乱している。", "You are confused.")); + if (p_ptr->confused) + { + /* Warn the user */ + msg_print(_("あなたは混乱している。", "You are confused.")); + } + else + { + char m_name[80]; + monster_type *m_ptr = &m_list[p_ptr->riding]; + + monster_desc(m_name, m_ptr, 0); + if (MON_CONFUSED(m_ptr)) + { + msg_format(_("%sは混乱している。", "%^s is confusing."), m_name); + } + else + { + msg_format(_("%sは思い通りに動いてくれない。", "You cannot control %s."), m_name); + } + } } /* Save direction */ (*dp) = dir; -#ifdef ALLOW_REPEAT /* TNB */ - /* repeat_push(dir); */ repeat_push((COMMAND_CODE)command_dir); -#endif /* ALLOW_REPEAT -- TNB */ - /* Success */ return (TRUE); } @@ -4578,8 +4457,6 @@ void gain_level_reward(int chosen_reward) msg_format(_("%sの声が響き渡った:", "The voice of %s booms out:"), chaos_patrons[p_ptr->chaos_patron]); msg_print(_("「汝の行いは貴き剣に値せり。」", "'Thy deed hath earned thee a worthy blade.'")); - - /* Get local object */ q_ptr = &forge; dummy = TV_SWORD; switch (randint1(p_ptr->lev)) @@ -5065,7 +4942,6 @@ static bool tgt_pt_accept(POSITION y, POSITION x) if (cave_have_flag_grid(c_ptr, FF_QUEST_EXIT)) return (TRUE); } - /* Nope */ return (FALSE); } @@ -5118,7 +4994,6 @@ bool tgt_pt(POSITION *x_ptr, POSITION *y_ptr) int wid, hgt; - /* Get size */ get_screen_size(&wid, &hgt); x = p_ptr->x; @@ -5186,16 +5061,11 @@ bool tgt_pt(POSITION *x_ptr, POSITION *y_ptr) x = p_ptr->x; verify_panel(); /* Move cursor to player */ - /* Update stuff */ p_ptr->update |= (PU_MONSTERS); - /* Redraw map */ p_ptr->redraw |= (PR_MAP); - /* Window stuff */ p_ptr->window |= (PW_OVERHEAD); - - /* Handle stuff */ handle_stuff(); } else /* move cursor to next stair and change panel */ @@ -5277,16 +5147,11 @@ bool tgt_pt(POSITION *x_ptr, POSITION *y_ptr) /* Recenter the map around the player */ verify_panel(); - /* Update stuff */ p_ptr->update |= (PU_MONSTERS); - /* Redraw map */ p_ptr->redraw |= (PR_MAP); - /* Window stuff */ p_ptr->window |= (PW_OVERHEAD); - - /* Handle stuff */ handle_stuff(); *x_ptr = x; @@ -5301,7 +5166,6 @@ bool get_hack_dir(DIRECTION *dp) cptr p; char command; - /* Initialize */ (*dp) = 0; /* Global direction */