変愚蛮怒のメインリポジトリです
Revision | e1bf5034d824f625c40f54caf0d1307a535c00b9 (tree) |
---|---|
Time | 2020-02-01 20:42:02 |
Author | Hourier <hourier@user...> |
Commiter | Hourier |
[Refactor] #37353 bldg.c において、1行ごとに挟まれていたコメントを削除 / Removed many comments per 1 line in bldg.c
@@ -419,8 +419,6 @@ static void arena_comm(player_type *player_ptr, int cmd) | ||
419 | 419 | |
420 | 420 | player_ptr->exit_bldg = FALSE; |
421 | 421 | reset_tim_flags(player_ptr); |
422 | - | |
423 | - /* Save the surface floor as saved floor */ | |
424 | 422 | prepare_change_floor_mode(player_ptr, CFM_SAVE_FLOORS); |
425 | 423 | |
426 | 424 | player_ptr->current_floor_ptr->inside_arena = TRUE; |
@@ -578,7 +576,6 @@ static void reset_deck(int deck[]) | ||
578 | 576 | deck[i] = i; |
579 | 577 | } |
580 | 578 | |
581 | - /* shuffle cards */ | |
582 | 579 | for (int i = 0; i < 53; i++) { |
583 | 580 | int tmp1 = randint0(53 - i) + i; |
584 | 581 | int tmp2 = deck[i]; |
@@ -651,14 +648,12 @@ static int poker_hand_check_straight(void) | ||
651 | 648 | bool joker_is_used = FALSE; |
652 | 649 | bool straight = FALSE; |
653 | 650 | |
654 | - /* get lowest */ | |
655 | 651 | for (int i = 0; i < 5; i++) |
656 | 652 | { |
657 | 653 | if (NUM_OF(cards[i]) < lowest && !IS_JOKER(cards[i])) |
658 | 654 | lowest = NUM_OF(cards[i]); |
659 | 655 | } |
660 | 656 | |
661 | - /* Check Royal Straight Flush */ | |
662 | 657 | if (poker_hand_check_flush()) |
663 | 658 | { |
664 | 659 | int i; |
@@ -674,7 +669,7 @@ static int poker_hand_check_straight(void) | ||
674 | 669 | } |
675 | 670 | } |
676 | 671 | |
677 | - if (i == 4) return 3; /* Wow! Royal Straight Flush!!! */ | |
672 | + if (i == 4) return 3; | |
678 | 673 | } |
679 | 674 | |
680 | 675 | if (lowest == 9) |
@@ -685,14 +680,12 @@ static int poker_hand_check_straight(void) | ||
685 | 680 | break; |
686 | 681 | } |
687 | 682 | |
688 | - if (i == 3 && have_joker()) return 3; /* Wow! Royal Straight Flush!!! */ | |
683 | + if (i == 3 && have_joker()) return 3; | |
689 | 684 | } |
690 | 685 | } |
691 | 686 | |
692 | 687 | joker_is_used = FALSE; |
693 | 688 | |
694 | - /* Straight Only Check */ | |
695 | - /* (10 - J - Q - K)[JOKER] - A */ | |
696 | 689 | if (lowest == 0) |
697 | 690 | { |
698 | 691 | int i; |
@@ -702,7 +695,7 @@ static int poker_hand_check_straight(void) | ||
702 | 695 | if (have_joker() && !joker_is_used) |
703 | 696 | joker_is_used = TRUE; |
704 | 697 | else |
705 | - break; /* None */ | |
698 | + break; | |
706 | 699 | } |
707 | 700 | } |
708 | 701 |
@@ -867,7 +860,6 @@ static void display_kaeruka(int hoge, int kaeruka[]) | ||
867 | 860 | else col = TERM_WHITE; |
868 | 861 | c_put_str(col, _("決定", "Sure"), 16, 38); |
869 | 862 | |
870 | - /* Hilite current option */ | |
871 | 863 | if (hoge < 5) move_cursor(14, 5 + hoge * 16); |
872 | 864 | else move_cursor(16, 38); |
873 | 865 | } |
@@ -1115,7 +1107,7 @@ static void display_cards(void) | ||
1115 | 1107 | */ |
1116 | 1108 | static int do_poker(void) |
1117 | 1109 | { |
1118 | - int is_put[5]; /* 0:kaenai 1:kaeru */ | |
1110 | + int is_put[5]; | |
1119 | 1111 | |
1120 | 1112 | bool done = FALSE; |
1121 | 1113 | bool decision = TRUE; |
@@ -1245,13 +1237,11 @@ static bool gamble_comm(player_type *player_ptr, int cmd) | ||
1245 | 1237 | |
1246 | 1238 | if (cmd == BACT_GAMBLE_RULES) |
1247 | 1239 | { |
1248 | - /* Peruse the gambling help file */ | |
1249 | 1240 | (void)show_file(player_ptr, TRUE, _("jgambling.txt", "gambling.txt"), NULL, 0, 0); |
1250 | 1241 | screen_load(); |
1251 | 1242 | return TRUE; |
1252 | 1243 | } |
1253 | 1244 | |
1254 | - /* No money */ | |
1255 | 1245 | if (player_ptr->au < 1) |
1256 | 1246 | { |
1257 | 1247 | msg_print(_("おい!おまえ一文なしじゃないか!こっから出ていけ!", |
@@ -1262,13 +1252,9 @@ static bool gamble_comm(player_type *player_ptr, int cmd) | ||
1262 | 1252 | } |
1263 | 1253 | |
1264 | 1254 | clear_bldg(5, 23); |
1265 | - | |
1266 | 1255 | maxbet = player_ptr->lev * 200; |
1267 | - | |
1268 | - /* We can't bet more than we have */ | |
1269 | 1256 | maxbet = MIN(maxbet, player_ptr->au); |
1270 | 1257 | |
1271 | - /* Get the wager */ | |
1272 | 1258 | strcpy(out_val, ""); |
1273 | 1259 | sprintf(tmp_str, _("賭け金 (1-%ld)?", "Your wager (1-%ld) ? "), (long int)maxbet); |
1274 | 1260 |
@@ -1284,12 +1270,9 @@ static bool gamble_comm(player_type *player_ptr, int cmd) | ||
1284 | 1270 | return TRUE; |
1285 | 1271 | } |
1286 | 1272 | |
1287 | - /* Strip spaces */ | |
1288 | 1273 | for (p = out_val; *p == ' '; p++); |
1289 | 1274 | |
1290 | - /* Get the wager */ | |
1291 | 1275 | wager = atol(p); |
1292 | - | |
1293 | 1276 | if (wager > player_ptr->au) |
1294 | 1277 | { |
1295 | 1278 | msg_print(_("おい!金が足りないじゃないか!出ていけ!", "Hey! You don't have the gold - get out of here!")); |
@@ -1680,13 +1663,11 @@ static bool kakutoujou(player_type *player_ptr) | ||
1680 | 1663 | return FALSE; |
1681 | 1664 | } |
1682 | 1665 | |
1683 | - int i; | |
1684 | - | |
1685 | 1666 | clear_bldg(4, 10); |
1686 | 1667 | |
1687 | 1668 | prt(_("モンスター 倍率", |
1688 | 1669 | "Monsters Odds"), 4, 4); |
1689 | - for (i = 0; i < 4; i++) | |
1670 | + for (int i = 0; i < 4; i++) | |
1690 | 1671 | { |
1691 | 1672 | char buf[80]; |
1692 | 1673 | monster_race *r_ptr = &r_info[battle_mon[i]]; |
@@ -1701,7 +1682,7 @@ static bool kakutoujou(player_type *player_ptr) | ||
1701 | 1682 | prt(_("どれに賭けますか:", "Which monster: "), 0, 0); |
1702 | 1683 | while (TRUE) |
1703 | 1684 | { |
1704 | - i = inkey(); | |
1685 | + int i = inkey(); | |
1705 | 1686 | |
1706 | 1687 | if (i == ESCAPE) |
1707 | 1688 | { |
@@ -1720,7 +1701,7 @@ static bool kakutoujou(player_type *player_ptr) | ||
1720 | 1701 | } |
1721 | 1702 | |
1722 | 1703 | clear_bldg(4, 4); |
1723 | - for (i = 0; i < 4; i++) | |
1704 | + for (int i = 0; i < 4; i++) | |
1724 | 1705 | if (i != sel_monster) clear_bldg(i + 5, i + 5); |
1725 | 1706 | |
1726 | 1707 | maxbet = player_ptr->lev * 200; |
@@ -1742,12 +1723,9 @@ static bool kakutoujou(player_type *player_ptr) | ||
1742 | 1723 | return FALSE; |
1743 | 1724 | } |
1744 | 1725 | |
1745 | - /* Strip spaces */ | |
1746 | 1726 | for (p = out_val; *p == ' '; p++); |
1747 | 1727 | |
1748 | - /* Get the wager */ | |
1749 | 1728 | wager = atol(p); |
1750 | - | |
1751 | 1729 | if (wager > player_ptr->au) |
1752 | 1730 | { |
1753 | 1731 | msg_print(_("おい!金が足りないじゃないか!出ていけ!", "Hey! You don't have the gold - get out of here!")); |
@@ -1774,7 +1752,6 @@ static bool kakutoujou(player_type *player_ptr) | ||
1774 | 1752 | player_ptr->au -= wager; |
1775 | 1753 | reset_tim_flags(player_ptr); |
1776 | 1754 | |
1777 | - /* Save the surface floor as saved floor */ | |
1778 | 1755 | prepare_change_floor_mode(player_ptr, CFM_SAVE_FLOORS); |
1779 | 1756 | |
1780 | 1757 | player_ptr->phase_out = TRUE; |
@@ -1911,12 +1888,9 @@ static bool kankin(player_type *player_ptr) | ||
1911 | 1888 | GAME_TEXT o_name[MAX_NLEN]; |
1912 | 1889 | object_type *o_ptr; |
1913 | 1890 | |
1914 | - /* Loop for inventory and right/left arm */ | |
1915 | 1891 | for (INVENTORY_IDX i = 0; i <= INVEN_LARM; i++) |
1916 | 1892 | { |
1917 | 1893 | o_ptr = &player_ptr->inventory_list[i]; |
1918 | - | |
1919 | - /* Living Tsuchinoko worthes $1000000 */ | |
1920 | 1894 | if ((o_ptr->tval == TV_CAPTURE) && (o_ptr->pval == MON_TSUCHINOKO)) |
1921 | 1895 | { |
1922 | 1896 | char buf[MAX_NLEN + 20]; |
@@ -1929,6 +1903,7 @@ static bool kankin(player_type *player_ptr) | ||
1929 | 1903 | player_ptr->redraw |= (PR_GOLD); |
1930 | 1904 | vary_item(player_ptr, i, -o_ptr->number); |
1931 | 1905 | } |
1906 | + | |
1932 | 1907 | change = TRUE; |
1933 | 1908 | } |
1934 | 1909 | } |
@@ -1936,8 +1911,6 @@ static bool kankin(player_type *player_ptr) | ||
1936 | 1911 | for (INVENTORY_IDX i = 0; i < INVEN_PACK; i++) |
1937 | 1912 | { |
1938 | 1913 | o_ptr = &player_ptr->inventory_list[i]; |
1939 | - | |
1940 | - /* Corpse of Tsuchinoko worthes $200000 */ | |
1941 | 1914 | if ((o_ptr->tval == TV_CORPSE) && (o_ptr->sval == SV_CORPSE) && (o_ptr->pval == MON_TSUCHINOKO)) |
1942 | 1915 | { |
1943 | 1916 | char buf[MAX_NLEN + 20]; |
@@ -1950,6 +1923,7 @@ static bool kankin(player_type *player_ptr) | ||
1950 | 1923 | player_ptr->redraw |= (PR_GOLD); |
1951 | 1924 | vary_item(player_ptr, i, -o_ptr->number); |
1952 | 1925 | } |
1926 | + | |
1953 | 1927 | change = TRUE; |
1954 | 1928 | } |
1955 | 1929 | } |
@@ -1957,8 +1931,6 @@ static bool kankin(player_type *player_ptr) | ||
1957 | 1931 | for (INVENTORY_IDX i = 0; i < INVEN_PACK; i++) |
1958 | 1932 | { |
1959 | 1933 | o_ptr = &player_ptr->inventory_list[i]; |
1960 | - | |
1961 | - /* Bones of Tsuchinoko worthes $100000 */ | |
1962 | 1934 | if ((o_ptr->tval == TV_CORPSE) && (o_ptr->sval == SV_SKELETON) && (o_ptr->pval == MON_TSUCHINOKO)) |
1963 | 1935 | { |
1964 | 1936 | char buf[MAX_NLEN + 20]; |
@@ -2010,6 +1982,7 @@ static bool kankin(player_type *player_ptr) | ||
2010 | 1982 | player_ptr->redraw |= (PR_GOLD); |
2011 | 1983 | vary_item(player_ptr, i, -o_ptr->number); |
2012 | 1984 | } |
1985 | + | |
2013 | 1986 | change = TRUE; |
2014 | 1987 | } |
2015 | 1988 | } |
@@ -2030,13 +2003,10 @@ static bool kankin(player_type *player_ptr) | ||
2030 | 2003 | sprintf(buf, _("%sを渡しますか?", "Hand %s over? "), o_name); |
2031 | 2004 | if (!get_check(buf)) continue; |
2032 | 2005 | |
2033 | - /* Hand it first */ | |
2034 | 2006 | vary_item(player_ptr, i, -o_ptr->number); |
2035 | - | |
2036 | 2007 | chg_virtue(player_ptr, V_JUSTICE, 5); |
2037 | 2008 | current_world_ptr->bounty_r_idx[j] += 10000; |
2038 | 2009 | |
2039 | - /* Count number of unique corpses already handed */ | |
2040 | 2010 | for (num = 0, k = 0; k < MAX_BOUNTY; k++) |
2041 | 2011 | { |
2042 | 2012 | if (current_world_ptr->bounty_r_idx[k] >= 10000) num++; |
@@ -2044,7 +2014,6 @@ static bool kankin(player_type *player_ptr) | ||
2044 | 2014 | |
2045 | 2015 | msg_format(_("これで合計 %d ポイント獲得しました。", "You earned %d point%s total."), num, (num > 1 ? "s" : "")); |
2046 | 2016 | |
2047 | - /* Prepare to make a prize */ | |
2048 | 2017 | object_prep(&forge, lookup_kind(prize_list[num - 1].tval, prize_list[num - 1].sval)); |
2049 | 2018 | apply_magic(player_ptr, &forge, player_ptr->current_floor_ptr->object_level, AM_NO_FIXED_ART); |
2050 | 2019 |
@@ -2057,14 +2026,11 @@ static bool kankin(player_type *player_ptr) | ||
2057 | 2026 | * there is at least one empty slot. |
2058 | 2027 | */ |
2059 | 2028 | item_new = inven_carry(player_ptr, &forge); |
2060 | - | |
2061 | 2029 | object_desc(player_ptr, o_name, &forge, 0); |
2062 | 2030 | msg_format(_("%s(%c)を貰った。", "You get %s (%c). "), o_name, index_to_label(item_new)); |
2063 | 2031 | |
2064 | - /* Auto-inscription */ | |
2065 | 2032 | autopick_alter_item(player_ptr, item_new, FALSE); |
2066 | 2033 | handle_stuff(player_ptr); |
2067 | - | |
2068 | 2034 | change = TRUE; |
2069 | 2035 | } |
2070 | 2036 | } |
@@ -2139,7 +2105,6 @@ static bool inn_comm(player_type *customer_ptr, int cmd) | ||
2139 | 2105 | { |
2140 | 2106 | msg_print(_("眠りに就くと恐ろしい光景が心をよぎった。", "Horrible visions flit through your mind as you sleep.")); |
2141 | 2107 | |
2142 | - /* Have some nightmares */ | |
2143 | 2108 | while (TRUE) |
2144 | 2109 | { |
2145 | 2110 | sanity_blast(customer_ptr, NULL, FALSE); |
@@ -2208,26 +2173,19 @@ static void get_questinfo(player_type *player_ptr, IDX questnum, bool do_init) | ||
2208 | 2173 | |
2209 | 2174 | quest_text_line = 0; |
2210 | 2175 | |
2211 | - /* Set the quest number temporary */ | |
2212 | 2176 | floor_type *floor_ptr = player_ptr->current_floor_ptr; |
2213 | 2177 | QUEST_IDX old_quest = floor_ptr->inside_quest; |
2214 | 2178 | floor_ptr->inside_quest = questnum; |
2215 | 2179 | |
2216 | - /* Get the quest text */ | |
2217 | 2180 | init_flags = INIT_SHOW_TEXT; |
2218 | 2181 | if (do_init) init_flags |= INIT_ASSIGN; |
2219 | 2182 | |
2220 | 2183 | process_dungeon_file(player_ptr, "q_info.txt", 0, 0, 0, 0); |
2221 | - | |
2222 | - /* Reset the old quest number */ | |
2223 | 2184 | floor_ptr->inside_quest = old_quest; |
2224 | 2185 | |
2225 | - /* Print the quest info */ | |
2226 | 2186 | GAME_TEXT tmp_str[80]; |
2227 | 2187 | sprintf(tmp_str, _("クエスト情報 (危険度: %d 階相当)", "Quest Information (Danger level: %d)"), (int)quest[questnum].level); |
2228 | - | |
2229 | 2188 | prt(tmp_str, 5, 0); |
2230 | - | |
2231 | 2189 | prt(quest[questnum].name, 7, 0); |
2232 | 2190 | |
2233 | 2191 | for (int i = 0; i < 10; i++) |
@@ -2290,13 +2248,11 @@ static void castle_quest(player_type *player_ptr) | ||
2290 | 2248 | |
2291 | 2249 | if (q_ptr->r_idx == 0) |
2292 | 2250 | { |
2293 | - /* Random monster at least 5 - 10 levels out of deep */ | |
2294 | 2251 | q_ptr->r_idx = get_mon_num(player_ptr, q_ptr->level + 4 + randint1(6)); |
2295 | 2252 | } |
2296 | 2253 | |
2297 | 2254 | monster_race *r_ptr; |
2298 | 2255 | r_ptr = &r_info[q_ptr->r_idx]; |
2299 | - | |
2300 | 2256 | while ((r_ptr->flags1 & RF1_UNIQUE) || (r_ptr->rarity != 1)) |
2301 | 2257 | { |
2302 | 2258 | q_ptr->r_idx = get_mon_num(player_ptr, q_ptr->level) + 4 + randint1(6); |
@@ -2305,7 +2261,6 @@ static void castle_quest(player_type *player_ptr) | ||
2305 | 2261 | |
2306 | 2262 | if (q_ptr->max_num == 0) |
2307 | 2263 | { |
2308 | - /* Random monster number */ | |
2309 | 2264 | if (randint1(10) > 7) |
2310 | 2265 | q_ptr->max_num = 1; |
2311 | 2266 | else |
@@ -2433,7 +2388,6 @@ static void compare_weapon_aux(player_type *owner_ptr, object_type *o_ptr, int c | ||
2433 | 2388 | bool force = FALSE; |
2434 | 2389 | bool dokubari = FALSE; |
2435 | 2390 | |
2436 | - /* Effective dices */ | |
2437 | 2391 | int eff_dd = o_ptr->dd + owner_ptr->to_dd[0]; |
2438 | 2392 | int eff_ds = o_ptr->ds + owner_ptr->to_ds[0]; |
2439 | 2393 |
@@ -2445,21 +2399,12 @@ static void compare_weapon_aux(player_type *owner_ptr, object_type *o_ptr, int c | ||
2445 | 2399 | int vorpal_div = 1; |
2446 | 2400 | int dmg_bonus = o_ptr->to_d + owner_ptr->to_d[0]; |
2447 | 2401 | |
2448 | - | |
2449 | - /* Get the flags of the weapon */ | |
2450 | 2402 | object_flags(o_ptr, flgs); |
2451 | - | |
2452 | 2403 | if ((o_ptr->tval == TV_SWORD) && (o_ptr->sval == SV_POISON_NEEDLE)) dokubari = TRUE; |
2453 | 2404 | |
2454 | - | |
2455 | - /* Show Critical Damage*/ | |
2456 | 2405 | mindam = calc_expect_crit(owner_ptr, o_ptr->weight, o_ptr->to_h, mindice, owner_ptr->to_h[0], dokubari); |
2457 | 2406 | maxdam = calc_expect_crit(owner_ptr, o_ptr->weight, o_ptr->to_h, maxdice, owner_ptr->to_h[0], dokubari); |
2458 | - | |
2459 | 2407 | show_weapon_dmg(r++, col, mindam, maxdam, blow, dmg_bonus, _("会心:", "Critical:"), TERM_L_RED); |
2460 | - | |
2461 | - | |
2462 | - /* Vorpal Hit*/ | |
2463 | 2408 | if ((have_flag(flgs, TR_VORPAL) || hex_spelling(owner_ptr, HEX_RUNESWORD))) |
2464 | 2409 | { |
2465 | 2410 | if ((o_ptr->name1 == ART_VORPAL_BLADE) || (o_ptr->name1 == ART_CHAINSWORD)) |
@@ -2487,7 +2432,6 @@ static void compare_weapon_aux(player_type *owner_ptr, object_type *o_ptr, int c | ||
2487 | 2432 | show_weapon_dmg(r++, col, mindam, maxdam, blow, dmg_bonus, _("理力:", "Force :"), TERM_L_BLUE); |
2488 | 2433 | } |
2489 | 2434 | |
2490 | - /* Print the relevant lines */ | |
2491 | 2435 | if (have_flag(flgs, TR_KILL_ANIMAL)) |
2492 | 2436 | { |
2493 | 2437 | mindam = calc_expect_dice(owner_ptr, mindice, 4, 1, force, o_ptr->weight, o_ptr->to_h, owner_ptr->to_h[0], dokubari, vorpal_mult, vorpal_div); |
@@ -2664,19 +2608,13 @@ static void list_weapon(player_type *player_ptr, object_type *o_ptr, TERM_LEN ro | ||
2664 | 2608 | DICE_SID eff_ds = o_ptr->ds + player_ptr->to_ds[0]; |
2665 | 2609 | HIT_RELIABILITY reli = player_ptr->skill_thn + (player_ptr->to_h[0] + o_ptr->to_h) * BTH_PLUS_ADJ; |
2666 | 2610 | |
2667 | - /* Print the weapon name */ | |
2668 | 2611 | object_desc(player_ptr, o_name, o_ptr, OD_NAME_ONLY); |
2669 | 2612 | c_put_str(TERM_YELLOW, o_name, row, col); |
2670 | - | |
2671 | - /* Print the player's number of blows */ | |
2672 | 2613 | sprintf(tmp_str, _("攻撃回数: %d", "Number of Blows: %d"), player_ptr->num_blow[0]); |
2673 | 2614 | put_str(tmp_str, row + 1, col); |
2674 | 2615 | |
2675 | - /* Print to_hit and to_dam of the weapon */ | |
2676 | 2616 | sprintf(tmp_str, _("命中率: 0 50 100 150 200 (敵のAC)", "To Hit: 0 50 100 150 200 (AC)")); |
2677 | 2617 | put_str(tmp_str, row + 2, col); |
2678 | - | |
2679 | - /* Print the weapons base damage dice */ | |
2680 | 2618 | sprintf(tmp_str, " %2d %2d %2d %2d %2d (%%)", |
2681 | 2619 | (int)hit_chance(player_ptr, reli, 0), |
2682 | 2620 | (int)hit_chance(player_ptr, reli, 50), |
@@ -2686,13 +2624,11 @@ static void list_weapon(player_type *player_ptr, object_type *o_ptr, TERM_LEN ro | ||
2686 | 2624 | put_str(tmp_str, row + 3, col); |
2687 | 2625 | c_put_str(TERM_YELLOW, _("可能なダメージ:", "Possible Damage:"), row + 5, col); |
2688 | 2626 | |
2689 | - /* Damage for one blow (if it hits) */ | |
2690 | 2627 | sprintf(tmp_str, _("攻撃一回につき %d-%d", "One Strike: %d-%d damage"), |
2691 | 2628 | (int)(eff_dd + o_ptr->to_d + player_ptr->to_d[0]), |
2692 | 2629 | (int)(eff_ds * eff_dd + o_ptr->to_d + player_ptr->to_d[0])); |
2693 | 2630 | put_str(tmp_str, row + 6, col + 1); |
2694 | 2631 | |
2695 | - /* Damage for the complete attack (if all blows hit) */ | |
2696 | 2632 | sprintf(tmp_str, _("1ターンにつき %d-%d", "One Attack: %d-%d damage"), |
2697 | 2633 | (int)(player_ptr->num_blow[0] * (eff_dd + o_ptr->to_d + player_ptr->to_d[0])), |
2698 | 2634 | (int)(player_ptr->num_blow[0] * (eff_ds * eff_dd + o_ptr->to_d + player_ptr->to_d[0]))); |
@@ -2723,14 +2659,10 @@ static PRICE compare_weapons(player_type *customer_ptr, PRICE bcost) | ||
2723 | 2659 | |
2724 | 2660 | screen_save(); |
2725 | 2661 | clear_bldg(0, 22); |
2726 | - | |
2727 | - /* Store copy of original wielded weapon */ | |
2728 | 2662 | i_ptr = &customer_ptr->inventory_list[INVEN_RARM]; |
2729 | 2663 | object_copy(&orig_weapon, i_ptr); |
2730 | 2664 | |
2731 | 2665 | item_tester_hook = item_tester_hook_orthodox_melee_weapons; |
2732 | - | |
2733 | - /* Get the first weapon */ | |
2734 | 2666 | concptr q = _("第一の武器は?", "What is your first weapon? "); |
2735 | 2667 | concptr s = _("比べるものがありません。", "You have nothing to compare."); |
2736 | 2668 |
@@ -2748,38 +2680,25 @@ static PRICE compare_weapons(player_type *customer_ptr, PRICE bcost) | ||
2748 | 2680 | while (TRUE) |
2749 | 2681 | { |
2750 | 2682 | clear_bldg(0, 22); |
2751 | - | |
2752 | - /* Only compare melee weapons */ | |
2753 | 2683 | item_tester_hook = item_tester_hook_orthodox_melee_weapons; |
2754 | - | |
2755 | - /* Hack -- prevent "icky" message */ | |
2756 | 2684 | current_world_ptr->character_xtra = TRUE; |
2757 | - | |
2758 | - /* Diaplay selected weapon's infomation */ | |
2759 | 2685 | for (int i = 0; i < n; i++) |
2760 | 2686 | { |
2761 | 2687 | int col = (wid * i + mgn); |
2762 | - | |
2763 | - /* Copy i-th weapon into the weapon slot (if it's not already there) */ | |
2764 | 2688 | if (o_ptr[i] != i_ptr) object_copy(i_ptr, o_ptr[i]); |
2765 | 2689 | |
2766 | 2690 | customer_ptr->update |= PU_BONUS; |
2767 | 2691 | handle_stuff(customer_ptr); |
2768 | 2692 | |
2769 | - /* List the new values */ | |
2770 | 2693 | list_weapon(customer_ptr, o_ptr[i], row, col); |
2771 | 2694 | compare_weapon_aux(customer_ptr, o_ptr[i], col, row + 8); |
2772 | - | |
2773 | - /* Copy back the original weapon into the weapon slot */ | |
2774 | 2695 | object_copy(i_ptr, &orig_weapon); |
2775 | 2696 | } |
2776 | 2697 | |
2777 | - /* Reset the values for the old weapon */ | |
2778 | 2698 | customer_ptr->update |= PU_BONUS; |
2779 | 2699 | handle_stuff(customer_ptr); |
2780 | 2700 | |
2781 | 2701 | current_world_ptr->character_xtra = old_character_xtra; |
2782 | - | |
2783 | 2702 | #ifdef JP |
2784 | 2703 | put_str(format("[ 比較対象: 's'で変更 ($%d) ]", cost), 1, (wid + mgn)); |
2785 | 2704 | put_str("(一番高いダメージが適用されます。複数の倍打効果は足し算されません。)", row + 4, 0); |
@@ -2792,7 +2711,6 @@ static PRICE compare_weapons(player_type *customer_ptr, PRICE bcost) | ||
2792 | 2711 | |
2793 | 2712 | flush(); |
2794 | 2713 | ch = inkey(); |
2795 | - | |
2796 | 2714 | if (ch != 's') break; |
2797 | 2715 | |
2798 | 2716 | if (total + cost > customer_ptr->au) |
@@ -2804,8 +2722,6 @@ static PRICE compare_weapons(player_type *customer_ptr, PRICE bcost) | ||
2804 | 2722 | |
2805 | 2723 | q = _("第二の武器は?", "What is your second weapon? "); |
2806 | 2724 | s = _("比べるものがありません。", "You have nothing to compare."); |
2807 | - | |
2808 | - /* Get the second weapon */ | |
2809 | 2725 | OBJECT_IDX item2; |
2810 | 2726 | o_ptr[1] = choose_object(customer_ptr, &item2, q, s, (USE_EQUIP | USE_INVEN | IGNORE_BOTHHAND_SLOT), 0); |
2811 | 2727 | if (!o_ptr[1]) continue; |
@@ -2814,8 +2730,8 @@ static PRICE compare_weapons(player_type *customer_ptr, PRICE bcost) | ||
2814 | 2730 | cost = bcost / 2; |
2815 | 2731 | n = 2; |
2816 | 2732 | } |
2817 | - screen_load(); | |
2818 | 2733 | |
2734 | + screen_load(); | |
2819 | 2735 | return total; |
2820 | 2736 | } |
2821 | 2737 |
@@ -2859,12 +2775,9 @@ static bool eval_ac(ARMOUR_CLASS iAC) | ||
2859 | 2775 | DEPTH lvl; |
2860 | 2776 | char buf[80 * 20], *t; |
2861 | 2777 | |
2862 | - /* AC lower than zero has no effect */ | |
2863 | 2778 | if (iAC < 0) iAC = 0; |
2864 | 2779 | |
2865 | - /* ダメージ軽減率を計算 */ | |
2866 | 2780 | protection = 100 * MIN(iAC, 150) / 250; |
2867 | - | |
2868 | 2781 | screen_save(); |
2869 | 2782 | clear_bldg(0, 22); |
2870 | 2783 |
@@ -2893,7 +2806,6 @@ static bool eval_ac(ARMOUR_CLASS iAC) | ||
2893 | 2806 | put_str(format("%3d", average), row + 2, col); |
2894 | 2807 | } |
2895 | 2808 | |
2896 | - /* Display note */ | |
2897 | 2809 | roff_to_buf(memo, 70, buf, sizeof(buf)); |
2898 | 2810 | for (t = buf; t[0]; t += strlen(t) + 1) |
2899 | 2811 | put_str(t, (row++) + 4, 4); |
@@ -2975,8 +2887,6 @@ static PRICE repair_broken_weapon_aux(player_type *player_ptr, PRICE bcost) | ||
2975 | 2887 | |
2976 | 2888 | concptr q = _("どの折れた武器を修復しますか?", "Repair which broken weapon? "); |
2977 | 2889 | concptr s = _("修復できる折れた武器がありません。", "You have no broken weapon to repair."); |
2978 | - | |
2979 | - /* Only forge broken weapons */ | |
2980 | 2890 | item_tester_hook = item_tester_hook_broken_weapon; |
2981 | 2891 | |
2982 | 2892 | OBJECT_IDX item; |
@@ -2984,21 +2894,18 @@ static PRICE repair_broken_weapon_aux(player_type *player_ptr, PRICE bcost) | ||
2984 | 2894 | o_ptr = choose_object(player_ptr, &item, q, s, (USE_INVEN | USE_EQUIP), 0); |
2985 | 2895 | if (!o_ptr) return 0; |
2986 | 2896 | |
2987 | - /* It is worthless */ | |
2988 | 2897 | if (!object_is_ego(o_ptr) && !object_is_artifact(o_ptr)) |
2989 | 2898 | { |
2990 | 2899 | msg_format(_("それは直してもしょうがないぜ。", "It is worthless to repair.")); |
2991 | 2900 | return 0; |
2992 | 2901 | } |
2993 | 2902 | |
2994 | - /* They are too many */ | |
2995 | 2903 | if (o_ptr->number > 1) |
2996 | 2904 | { |
2997 | 2905 | msg_format(_("一度に複数を修復することはできません!", "They are too many to repair at once!")); |
2998 | 2906 | return 0; |
2999 | 2907 | } |
3000 | 2908 | |
3001 | - /* Display item name */ | |
3002 | 2909 | char basenm[MAX_NLEN]; |
3003 | 2910 | object_desc(player_ptr, basenm, o_ptr, OD_NAME_ONLY); |
3004 | 2911 | prt(format(_("修復する武器 : %s", "Repairing: %s"), basenm), row + 3, 2); |
@@ -3006,9 +2913,7 @@ static PRICE repair_broken_weapon_aux(player_type *player_ptr, PRICE bcost) | ||
3006 | 2913 | q = _("材料となる武器は?", "Which weapon for material? "); |
3007 | 2914 | s = _("材料となる武器がありません。", "You have no material to repair."); |
3008 | 2915 | |
3009 | - /* Only forge broken weapons */ | |
3010 | 2916 | item_tester_hook = item_tester_hook_orthodox_melee_weapons; |
3011 | - | |
3012 | 2917 | OBJECT_IDX mater; |
3013 | 2918 | object_type *mo_ptr; |
3014 | 2919 | mo_ptr = choose_object(player_ptr, &mater, q, s, (USE_INVEN | USE_EQUIP), 0); |
@@ -3019,16 +2924,11 @@ static PRICE repair_broken_weapon_aux(player_type *player_ptr, PRICE bcost) | ||
3019 | 2924 | return 0; |
3020 | 2925 | } |
3021 | 2926 | |
3022 | - /* Display item name */ | |
3023 | 2927 | object_desc(player_ptr, basenm, mo_ptr, OD_NAME_ONLY); |
3024 | 2928 | prt(format(_("材料とする武器: %s", "Material : %s"), basenm), row + 4, 2); |
3025 | - | |
3026 | - /* Get the value of one of the items (except curses) */ | |
3027 | 2929 | PRICE cost = bcost + object_value_real(o_ptr) * 2; |
3028 | - | |
3029 | 2930 | if (!get_check(format(_("$%dかかりますがよろしいですか? ", "Costs %d gold, okay? "), cost))) return 0; |
3030 | 2931 | |
3031 | - /* Check if the player has enough money */ | |
3032 | 2932 | if (player_ptr->au < cost) |
3033 | 2933 | { |
3034 | 2934 | object_desc(player_ptr, basenm, o_ptr, OD_NAME_ONLY); |
@@ -3038,17 +2938,12 @@ static PRICE repair_broken_weapon_aux(player_type *player_ptr, PRICE bcost) | ||
3038 | 2938 | } |
3039 | 2939 | |
3040 | 2940 | player_ptr->total_weight -= o_ptr->weight; |
3041 | - | |
3042 | 2941 | KIND_OBJECT_IDX k_idx; |
3043 | 2942 | if (o_ptr->sval == SV_BROKEN_DAGGER) |
3044 | 2943 | { |
3045 | - KIND_OBJECT_IDX j; | |
3046 | 2944 | int n = 1; |
3047 | - | |
3048 | - /* Suppress compiler warning */ | |
3049 | 2945 | k_idx = 0; |
3050 | - | |
3051 | - for (j = 1; j < max_k_idx; j++) | |
2946 | + for (KIND_OBJECT_IDX j = 1; j < max_k_idx; j++) | |
3052 | 2947 | { |
3053 | 2948 | object_kind *k_aux_ptr = &k_info[j]; |
3054 | 2949 |
@@ -3065,15 +2960,12 @@ static PRICE repair_broken_weapon_aux(player_type *player_ptr, PRICE bcost) | ||
3065 | 2960 | } |
3066 | 2961 | } |
3067 | 2962 | } |
3068 | - else /* TV_BROKEN_SWORD */ | |
2963 | + else | |
3069 | 2964 | { |
3070 | - /* Repair to a sword or sometimes material's type weapon */ | |
3071 | 2965 | OBJECT_TYPE_VALUE tval = (one_in_(5) ? mo_ptr->tval : TV_SWORD); |
3072 | - | |
3073 | 2966 | while (TRUE) |
3074 | 2967 | { |
3075 | 2968 | object_kind *ck_ptr; |
3076 | - | |
3077 | 2969 | k_idx = lookup_kind(tval, SV_ANY); |
3078 | 2970 | ck_ptr = &k_info[k_idx]; |
3079 | 2971 |
@@ -3100,13 +2992,11 @@ static PRICE repair_broken_weapon_aux(player_type *player_ptr, PRICE bcost) | ||
3100 | 2992 | } |
3101 | 2993 | } |
3102 | 2994 | |
3103 | - /* Calculate dice bonuses */ | |
3104 | 2995 | int dd_bonus = o_ptr->dd - k_info[o_ptr->k_idx].dd; |
3105 | 2996 | int ds_bonus = o_ptr->ds - k_info[o_ptr->k_idx].ds; |
3106 | 2997 | dd_bonus += mo_ptr->dd - k_info[mo_ptr->k_idx].dd; |
3107 | 2998 | ds_bonus += mo_ptr->ds - k_info[mo_ptr->k_idx].ds; |
3108 | 2999 | |
3109 | - /* Change base object */ | |
3110 | 3000 | object_kind *k_ptr; |
3111 | 3001 | k_ptr = &k_info[k_idx]; |
3112 | 3002 | o_ptr->k_idx = k_idx; |
@@ -3116,7 +3006,6 @@ static PRICE repair_broken_weapon_aux(player_type *player_ptr, PRICE bcost) | ||
3116 | 3006 | o_ptr->dd = k_ptr->dd; |
3117 | 3007 | o_ptr->ds = k_ptr->ds; |
3118 | 3008 | |
3119 | - /* Copy base object's ability */ | |
3120 | 3009 | for (int i = 0; i < TR_FLAG_SIZE; i++) o_ptr->art_flags[i] |= k_ptr->flags[i]; |
3121 | 3010 | if (k_ptr->pval) o_ptr->pval = MAX(o_ptr->pval, randint1(k_ptr->pval)); |
3122 | 3011 | if (have_flag(k_ptr->flags, TR_ACTIVATE)) o_ptr->xtra2 = (byte_hack)k_ptr->act_idx; |
@@ -3145,10 +3034,7 @@ static PRICE repair_broken_weapon_aux(player_type *player_ptr, PRICE bcost) | ||
3145 | 3034 | o_ptr->pval = MIN(o_ptr->pval, bmax); |
3146 | 3035 | } |
3147 | 3036 | |
3148 | - /* Add one random ability from material weapon */ | |
3149 | 3037 | give_one_ability_of_object(o_ptr, mo_ptr); |
3150 | - | |
3151 | - /* Add to-dam, to-hit and to-ac from material weapon */ | |
3152 | 3038 | o_ptr->to_d += MAX(0, (mo_ptr->to_d / 3)); |
3153 | 3039 | o_ptr->to_h += MAX(0, (mo_ptr->to_h / 3)); |
3154 | 3040 | o_ptr->to_a += MAX(0, (mo_ptr->to_a)); |
@@ -3157,20 +3043,15 @@ static PRICE repair_broken_weapon_aux(player_type *player_ptr, PRICE bcost) | ||
3157 | 3043 | (object_is_random_artifact(o_ptr) && one_in_(1)) || |
3158 | 3044 | (object_is_ego(o_ptr) && one_in_(7))) |
3159 | 3045 | { |
3160 | - /* Forge it */ | |
3161 | 3046 | if (object_is_ego(o_ptr)) |
3162 | 3047 | { |
3163 | 3048 | add_flag(o_ptr->art_flags, TR_IGNORE_FIRE); |
3164 | 3049 | add_flag(o_ptr->art_flags, TR_IGNORE_ACID); |
3165 | 3050 | } |
3166 | 3051 | |
3167 | - /* Add one random ability from material weapon */ | |
3168 | 3052 | give_one_ability_of_object(o_ptr, mo_ptr); |
3169 | - | |
3170 | - /* Add one random activation */ | |
3171 | 3053 | if (!activation_index(o_ptr)) one_activation(o_ptr); |
3172 | 3054 | |
3173 | - /* Narsil */ | |
3174 | 3055 | if (o_ptr->name1 == ART_NARSIL) |
3175 | 3056 | { |
3176 | 3057 | one_high_resistance(o_ptr); |
@@ -3187,17 +3068,11 @@ static PRICE repair_broken_weapon_aux(player_type *player_ptr, PRICE bcost) | ||
3187 | 3068 | msg_format("Repaired into %s for %d gold.", basenm, cost); |
3188 | 3069 | #endif |
3189 | 3070 | msg_print(NULL); |
3190 | - | |
3191 | - /* Remove BROKEN flag */ | |
3192 | 3071 | o_ptr->ident &= ~(IDENT_BROKEN); |
3193 | - | |
3194 | - /* Add repaired flag */ | |
3195 | 3072 | o_ptr->discount = 99; |
3196 | 3073 | |
3197 | 3074 | player_ptr->total_weight += o_ptr->weight; |
3198 | 3075 | calc_android_exp(player_ptr); |
3199 | - | |
3200 | - /* Decrease material object */ | |
3201 | 3076 | inven_item_increase(player_ptr, mater, -1); |
3202 | 3077 | inven_item_optimize(player_ptr, mater); |
3203 | 3078 |
@@ -3247,7 +3122,6 @@ static bool enchant_item(player_type *player_ptr, PRICE cost, HIT_PROB to_hit, H | ||
3247 | 3122 | o_ptr = choose_object(player_ptr, &item, q, s, (USE_INVEN | USE_EQUIP | IGNORE_BOTHHAND_SLOT), item_tester_tval); |
3248 | 3123 | if (!o_ptr) return FALSE; |
3249 | 3124 | |
3250 | - /* Check if the player has enough money */ | |
3251 | 3125 | char tmp_str[MAX_NLEN]; |
3252 | 3126 | if (player_ptr->au < (cost * o_ptr->number)) |
3253 | 3127 | { |
@@ -3256,7 +3130,6 @@ static bool enchant_item(player_type *player_ptr, PRICE cost, HIT_PROB to_hit, H | ||
3256 | 3130 | return FALSE; |
3257 | 3131 | } |
3258 | 3132 | |
3259 | - /* Enchant to hit */ | |
3260 | 3133 | bool okay = FALSE; |
3261 | 3134 | for (int i = 0; i < to_hit; i++) |
3262 | 3135 | { |
@@ -3267,7 +3140,6 @@ static bool enchant_item(player_type *player_ptr, PRICE cost, HIT_PROB to_hit, H | ||
3267 | 3140 | } |
3268 | 3141 | } |
3269 | 3142 | |
3270 | - /* Enchant to damage */ | |
3271 | 3143 | for (int i = 0; i < to_dam; i++) |
3272 | 3144 | { |
3273 | 3145 | if ((o_ptr->to_d < maxenchant) && enchant(player_ptr, o_ptr, 1, (ENCH_TODAM | ENCH_FORCE))) |
@@ -3277,7 +3149,6 @@ static bool enchant_item(player_type *player_ptr, PRICE cost, HIT_PROB to_hit, H | ||
3277 | 3149 | } |
3278 | 3150 | } |
3279 | 3151 | |
3280 | - /* Enchant to AC */ | |
3281 | 3152 | for (int i = 0; i < to_ac; i++) |
3282 | 3153 | { |
3283 | 3154 | if ((o_ptr->to_a < maxenchant) && enchant(player_ptr, o_ptr, 1, (ENCH_TOAC | ENCH_FORCE))) |
@@ -3287,7 +3158,6 @@ static bool enchant_item(player_type *player_ptr, PRICE cost, HIT_PROB to_hit, H | ||
3287 | 3158 | } |
3288 | 3159 | } |
3289 | 3160 | |
3290 | - /* Failure */ | |
3291 | 3161 | if (!okay) |
3292 | 3162 | { |
3293 | 3163 | if (flush_failure) flush(); |
@@ -3358,29 +3228,23 @@ static void building_recharge(player_type *player_ptr) | ||
3358 | 3228 | object_desc(player_ptr, tmp_str, o_ptr, 0); |
3359 | 3229 | msg_format(_("%s です。", "You have: %s."), tmp_str); |
3360 | 3230 | |
3361 | - /* Auto-inscription */ | |
3362 | 3231 | autopick_alter_item(player_ptr, item, FALSE); |
3363 | - | |
3364 | - /* Update the gold display */ | |
3365 | 3232 | building_prt_gold(player_ptr); |
3366 | 3233 | } |
3367 | 3234 | |
3368 | 3235 | return; |
3369 | 3236 | } |
3370 | 3237 | |
3371 | - /* Extract the object "level" */ | |
3372 | 3238 | DEPTH lev = k_info[o_ptr->k_idx].level; |
3373 | 3239 | PRICE price; |
3374 | 3240 | if (o_ptr->tval == TV_ROD) |
3375 | 3241 | { |
3376 | 3242 | if (o_ptr->timeout > 0) |
3377 | 3243 | { |
3378 | - /* Fully recharge */ | |
3379 | 3244 | price = (lev * 50 * o_ptr->timeout) / k_ptr->pval; |
3380 | 3245 | } |
3381 | 3246 | else |
3382 | 3247 | { |
3383 | - /* No recharge necessary */ | |
3384 | 3248 | price = 0; |
3385 | 3249 | msg_format(_("それは再充填する必要はありません。", "That doesn't need to be recharged.")); |
3386 | 3250 | return; |
@@ -3397,7 +3261,6 @@ static void building_recharge(player_type *player_ptr) | ||
3397 | 3261 | price = MAX(10, price); |
3398 | 3262 | } |
3399 | 3263 | |
3400 | - /* Limit the number of charges for wands and staffs */ | |
3401 | 3264 | if (o_ptr->tval == TV_WAND |
3402 | 3265 | && (o_ptr->pval / o_ptr->number >= k_ptr->pval)) |
3403 | 3266 | { |
@@ -3426,7 +3289,6 @@ static void building_recharge(player_type *player_ptr) | ||
3426 | 3289 | return; |
3427 | 3290 | } |
3428 | 3291 | |
3429 | - /* Check if the player has enough money */ | |
3430 | 3292 | if (player_ptr->au < price) |
3431 | 3293 | { |
3432 | 3294 | object_desc(player_ptr, tmp_str, o_ptr, OD_NAME_ONLY); |
@@ -3449,7 +3311,6 @@ static void building_recharge(player_type *player_ptr) | ||
3449 | 3311 | #endif |
3450 | 3312 | |
3451 | 3313 | { |
3452 | - /* Recharge fully */ | |
3453 | 3314 | o_ptr->timeout = 0; |
3454 | 3315 | } |
3455 | 3316 | else |
@@ -3465,11 +3326,9 @@ static void building_recharge(player_type *player_ptr) | ||
3465 | 3326 | else |
3466 | 3327 | max_charges = o_ptr->number * k_ptr->pval - o_ptr->pval; |
3467 | 3328 | |
3468 | - /* Get the quantity for staves and wands */ | |
3469 | 3329 | charges = (PARAMETER_VALUE)get_quantity(format(_("一回分$%d で何回分充填しますか?", "Add how many charges for %d gold? "), price), |
3470 | 3330 | MIN(player_ptr->au / price, max_charges)); |
3471 | 3331 | |
3472 | - /* Do nothing */ | |
3473 | 3332 | if (charges < 1) return; |
3474 | 3333 | |
3475 | 3334 | price *= charges; |
@@ -3514,13 +3373,9 @@ static void building_recharge_all(player_type *player_ptr) | ||
3514 | 3373 | object_type *o_ptr; |
3515 | 3374 | o_ptr = &player_ptr->inventory_list[i]; |
3516 | 3375 | |
3517 | - /* skip non magic device */ | |
3518 | 3376 | if (o_ptr->tval < TV_STAFF || o_ptr->tval > TV_ROD) continue; |
3519 | - | |
3520 | - /* need identified */ | |
3521 | 3377 | if (!object_is_known(o_ptr)) total_cost += 50; |
3522 | 3378 | |
3523 | - /* Extract the object "level" */ | |
3524 | 3379 | DEPTH lev = k_info[o_ptr->k_idx].level; |
3525 | 3380 | object_kind *k_ptr; |
3526 | 3381 | k_ptr = &k_info[o_ptr->k_idx]; |
@@ -3532,29 +3387,18 @@ static void building_recharge_all(player_type *player_ptr) | ||
3532 | 3387 | break; |
3533 | 3388 | |
3534 | 3389 | case TV_STAFF: |
3535 | - /* Price per charge ( = double the price paid by shopkeepers for the charge) */ | |
3536 | 3390 | price = (k_info[o_ptr->k_idx].cost / 10) * o_ptr->number; |
3537 | - | |
3538 | - /* Pay at least 10 gold per charge */ | |
3539 | 3391 | price = MAX(10, price); |
3540 | - | |
3541 | - /* Fully charge */ | |
3542 | 3392 | price = (k_ptr->pval - o_ptr->pval) * price; |
3543 | 3393 | break; |
3544 | 3394 | |
3545 | 3395 | case TV_WAND: |
3546 | - /* Price per charge ( = double the price paid by shopkeepers for the charge) */ | |
3547 | 3396 | price = (k_info[o_ptr->k_idx].cost / 10); |
3548 | - | |
3549 | - /* Pay at least 10 gold per charge */ | |
3550 | 3397 | price = MAX(10, price); |
3551 | - | |
3552 | - /* Fully charge */ | |
3553 | 3398 | price = (o_ptr->number * k_ptr->pval - o_ptr->pval) * price; |
3554 | 3399 | break; |
3555 | 3400 | } |
3556 | 3401 | |
3557 | - /* if price <= 0 then item have enough charge */ | |
3558 | 3402 | if (price > 0) total_cost += price; |
3559 | 3403 | } |
3560 | 3404 |
@@ -3565,7 +3409,6 @@ static void building_recharge_all(player_type *player_ptr) | ||
3565 | 3409 | return; |
3566 | 3410 | } |
3567 | 3411 | |
3568 | - /* Check if the player has enough money */ | |
3569 | 3412 | if (player_ptr->au < total_cost) |
3570 | 3413 | { |
3571 | 3414 | msg_format(_("すべてのアイテムを再充填するには$%d 必要です!", "You need %d gold to recharge all items!"), total_cost); |
@@ -3582,18 +3425,14 @@ static void building_recharge_all(player_type *player_ptr) | ||
3582 | 3425 | object_kind *k_ptr; |
3583 | 3426 | k_ptr = &k_info[o_ptr->k_idx]; |
3584 | 3427 | |
3585 | - /* skip non magic device */ | |
3586 | 3428 | if (o_ptr->tval < TV_STAFF || o_ptr->tval > TV_ROD) continue; |
3587 | 3429 | |
3588 | 3430 | if (!object_is_known(o_ptr)) |
3589 | 3431 | { |
3590 | 3432 | identify_item(player_ptr, o_ptr); |
3591 | - | |
3592 | - /* Auto-inscription */ | |
3593 | 3433 | autopick_alter_item(player_ptr, i, FALSE); |
3594 | 3434 | } |
3595 | 3435 | |
3596 | - /* Recharge */ | |
3597 | 3436 | switch (o_ptr->tval) |
3598 | 3437 | { |
3599 | 3438 | case TV_ROD: |
@@ -3601,13 +3440,13 @@ static void building_recharge_all(player_type *player_ptr) | ||
3601 | 3440 | break; |
3602 | 3441 | case TV_STAFF: |
3603 | 3442 | if (o_ptr->pval < k_ptr->pval) o_ptr->pval = k_ptr->pval; |
3604 | - /* We no longer think the item is empty */ | |
3443 | + | |
3605 | 3444 | o_ptr->ident &= ~(IDENT_EMPTY); |
3606 | 3445 | break; |
3607 | 3446 | case TV_WAND: |
3608 | 3447 | if (o_ptr->pval < o_ptr->number * k_ptr->pval) |
3609 | 3448 | o_ptr->pval = o_ptr->number * k_ptr->pval; |
3610 | - /* We no longer think the item is empty */ | |
3449 | + | |
3611 | 3450 | o_ptr->ident &= ~(IDENT_EMPTY); |
3612 | 3451 | break; |
3613 | 3452 | } |
@@ -3620,6 +3459,7 @@ static void building_recharge_all(player_type *player_ptr) | ||
3620 | 3459 | player_ptr->au -= total_cost; |
3621 | 3460 | } |
3622 | 3461 | |
3462 | + | |
3623 | 3463 | /*! |
3624 | 3464 | * @brief 施設でモンスターの情報を知るメインルーチン / research_mon -KMW- |
3625 | 3465 | * @param player_ptr プレーヤーへの参照ポインタ |
@@ -3634,19 +3474,15 @@ static bool research_mon(player_type *player_ptr) | ||
3634 | 3474 | u16b why = 0; |
3635 | 3475 | MONSTER_IDX *who; |
3636 | 3476 | |
3637 | - /* XTRA HACK WHATSEARCH */ | |
3638 | 3477 | bool all = FALSE; |
3639 | 3478 | bool uniq = FALSE; |
3640 | 3479 | bool norm = FALSE; |
3641 | 3480 | char temp[80] = ""; |
3642 | 3481 | |
3643 | - /* XTRA HACK REMEMBER_IDX */ | |
3644 | 3482 | static int old_sym = '\0'; |
3645 | 3483 | static IDX old_i = 0; |
3646 | - | |
3647 | 3484 | screen_save(); |
3648 | 3485 | |
3649 | - /* Get a character, or abort */ | |
3650 | 3486 | char sym; |
3651 | 3487 | if (!get_com(_("モンスターの文字を入力して下さい(記号 or ^A全,^Uユ,^N非ユ,^M名前):", |
3652 | 3488 | "Enter character to be identified(^A:All,^U:Uniqs,^N:Non uniqs,^M:Name): "), &sym, FALSE)) |
@@ -3656,7 +3492,6 @@ static bool research_mon(player_type *player_ptr) | ||
3656 | 3492 | return FALSE; |
3657 | 3493 | } |
3658 | 3494 | |
3659 | - /* Find that character info, and describe it */ | |
3660 | 3495 | IDX i; |
3661 | 3496 | for (i = 0; ident_info[i]; ++i) |
3662 | 3497 | { |
@@ -3708,8 +3543,8 @@ static bool research_mon(player_type *player_ptr) | ||
3708 | 3543 | C_MAKE(who, max_r_idx, MONRACE_IDX); |
3709 | 3544 | |
3710 | 3545 | /* Collect matching monsters */ |
3711 | - int n; | |
3712 | - for (n = 0, i = 1; i < max_r_idx; i++) | |
3546 | + int n = 0; | |
3547 | + for (i = 1; i < max_r_idx; i++) | |
3713 | 3548 | { |
3714 | 3549 | monster_race *r_ptr = &r_info[i]; |
3715 | 3550 |
@@ -3762,80 +3597,53 @@ static bool research_mon(player_type *player_ptr) | ||
3762 | 3597 | } |
3763 | 3598 | } |
3764 | 3599 | |
3765 | - /* Nothing to recall */ | |
3766 | - if (!n) | |
3600 | + if (n == 0) | |
3767 | 3601 | { |
3768 | - /* Free the "who" array */ | |
3769 | 3602 | C_KILL(who, max_r_idx, MONRACE_IDX); |
3770 | 3603 | screen_load(); |
3771 | 3604 | |
3772 | 3605 | return FALSE; |
3773 | 3606 | } |
3774 | 3607 | |
3775 | - /* Sort by level */ | |
3776 | 3608 | why = 2; |
3777 | 3609 | char query = 'y'; |
3778 | 3610 | |
3779 | - /* Sort if needed */ | |
3780 | 3611 | if (why) |
3781 | 3612 | { |
3782 | 3613 | ang_sort(who, &why, n, ang_sort_comp_hook, ang_sort_swap_hook); |
3783 | 3614 | } |
3784 | 3615 | |
3785 | - /* Start at the end */ | |
3786 | - /* XTRA HACK REMEMBER_IDX */ | |
3787 | 3616 | if (old_sym == sym && old_i < n) i = old_i; |
3788 | 3617 | else i = n - 1; |
3789 | 3618 | |
3790 | 3619 | notpicked = TRUE; |
3791 | - | |
3792 | - /* Scan the monster memory */ | |
3793 | 3620 | MONRACE_IDX r_idx; |
3794 | 3621 | while (notpicked) |
3795 | 3622 | { |
3796 | 3623 | r_idx = who[i]; |
3797 | - | |
3798 | - /* Hack -- Begin the prompt */ | |
3799 | 3624 | roff_top(r_idx); |
3800 | - | |
3801 | - /* Hack -- Complete the prompt */ | |
3802 | 3625 | Term_addstr(-1, TERM_WHITE, _(" ['r'思い出, ' 'で続行, ESC]", " [(r)ecall, ESC, space to continue]")); |
3803 | - | |
3804 | - /* Interact */ | |
3805 | 3626 | while (TRUE) |
3806 | 3627 | { |
3807 | 3628 | if (recall) |
3808 | 3629 | { |
3809 | - /*** Recall on screen ***/ | |
3810 | - | |
3811 | - /* Get maximal info about this monster */ | |
3812 | 3630 | lore_do_probe(player_ptr, r_idx); |
3813 | - | |
3814 | - /* Save this monster ID */ | |
3815 | 3631 | monster_race_track(player_ptr, r_idx); |
3816 | 3632 | handle_stuff(player_ptr); |
3817 | - | |
3818 | - /* know every thing mode */ | |
3819 | 3633 | screen_roff(player_ptr, r_idx, 0x01); |
3820 | 3634 | notpicked = FALSE; |
3821 | - | |
3822 | - /* XTRA HACK REMEMBER_IDX */ | |
3823 | 3635 | old_sym = sym; |
3824 | 3636 | old_i = i; |
3825 | 3637 | } |
3826 | 3638 | |
3827 | 3639 | query = inkey(); |
3828 | - | |
3829 | - /* Normal commands */ | |
3830 | 3640 | if (query != 'r') break; |
3831 | 3641 | |
3832 | 3642 | recall = !recall; |
3833 | 3643 | } |
3834 | 3644 | |
3835 | - /* Stop scanning */ | |
3836 | 3645 | if (query == ESCAPE) break; |
3837 | 3646 | |
3838 | - /* Move to "prev" monster */ | |
3839 | 3647 | if (query == '-') |
3840 | 3648 | { |
3841 | 3649 | if (++i == n) |
@@ -3886,7 +3694,6 @@ static void bldg_process_command(player_type *player_ptr, building_type *bldg, i | ||
3886 | 3694 | return; |
3887 | 3695 | } |
3888 | 3696 | |
3889 | - /* check gold (HACK - Recharge uses variable costs) */ | |
3890 | 3697 | BACT_IDX bact = bldg->actions[i]; |
3891 | 3698 | if ((bact != BACT_RECHARGE) && |
3892 | 3699 | (((bldg->member_costs[i] > player_ptr->au) && is_owner(player_ptr, bldg)) || |
@@ -3958,22 +3765,22 @@ static void bldg_process_command(player_type *player_ptr, building_type *bldg, i | ||
3958 | 3765 | case BACT_RECHARGE_ALL: |
3959 | 3766 | building_recharge_all(player_ptr); |
3960 | 3767 | break; |
3961 | - case BACT_IDENTS: /* needs work */ | |
3768 | + case BACT_IDENTS: | |
3962 | 3769 | if (!get_check(_("持ち物を全て鑑定してよろしいですか?", "Do you pay for identify all your possession? "))) break; |
3963 | 3770 | identify_pack(player_ptr); |
3964 | 3771 | msg_print(_(" 持ち物全てが鑑定されました。", "Your possessions have been identified.")); |
3965 | 3772 | paid = TRUE; |
3966 | 3773 | break; |
3967 | - case BACT_IDENT_ONE: /* needs work */ | |
3774 | + case BACT_IDENT_ONE: | |
3968 | 3775 | paid = ident_spell(player_ptr, FALSE); |
3969 | 3776 | break; |
3970 | 3777 | case BACT_LEARN: |
3971 | 3778 | do_cmd_study(player_ptr); |
3972 | 3779 | break; |
3973 | - case BACT_HEALING: /* needs work */ | |
3780 | + case BACT_HEALING: | |
3974 | 3781 | paid = cure_critical_wounds(player_ptr, 200); |
3975 | 3782 | break; |
3976 | - case BACT_RESTORE: /* needs work */ | |
3783 | + case BACT_RESTORE: | |
3977 | 3784 | paid = restore_all_status(player_ptr); |
3978 | 3785 | break; |
3979 | 3786 | case BACT_ENCHANT_ARROWS: |
@@ -4091,7 +3898,6 @@ void do_cmd_bldg(player_type *player_ptr) | ||
4091 | 3898 | building_type *bldg; |
4092 | 3899 | bldg = &building[which]; |
4093 | 3900 | |
4094 | - /* Don't re-init the wilderness */ | |
4095 | 3901 | reinit_wilderness = FALSE; |
4096 | 3902 | |
4097 | 3903 | if ((which == 2) && (player_ptr->arena_number < 0)) |
@@ -4107,16 +3913,10 @@ void do_cmd_bldg(player_type *player_ptr) | ||
4107 | 3913 | } |
4108 | 3914 | else |
4109 | 3915 | { |
4110 | - /* Don't save the arena as saved floor */ | |
4111 | 3916 | prepare_change_floor_mode(player_ptr, CFM_SAVE_FLOORS | CFM_NO_RETURN); |
4112 | - | |
4113 | 3917 | player_ptr->current_floor_ptr->inside_arena = FALSE; |
4114 | 3918 | player_ptr->leaving = TRUE; |
4115 | - | |
4116 | - /* Re-enter the arena */ | |
4117 | 3919 | command_new = SPECIAL_KEY_BUILDING; |
4118 | - | |
4119 | - /* No energy needed to re-enter the arena */ | |
4120 | 3920 | free_turn(player_ptr); |
4121 | 3921 | } |
4122 | 3922 |
@@ -4124,18 +3924,11 @@ void do_cmd_bldg(player_type *player_ptr) | ||
4124 | 3924 | } |
4125 | 3925 | else if (player_ptr->phase_out) |
4126 | 3926 | { |
4127 | - /* Don't save the arena as saved floor */ | |
4128 | 3927 | prepare_change_floor_mode(player_ptr, CFM_SAVE_FLOORS | CFM_NO_RETURN); |
4129 | - | |
4130 | 3928 | player_ptr->leaving = TRUE; |
4131 | 3929 | player_ptr->phase_out = FALSE; |
4132 | - | |
4133 | - /* Re-enter the monster arena */ | |
4134 | 3930 | command_new = SPECIAL_KEY_BUILDING; |
4135 | - | |
4136 | - /* No energy needed to re-enter the arena */ | |
4137 | 3931 | free_turn(player_ptr); |
4138 | - | |
4139 | 3932 | return; |
4140 | 3933 | } |
4141 | 3934 | else |
@@ -4146,8 +3939,6 @@ void do_cmd_bldg(player_type *player_ptr) | ||
4146 | 3939 | |
4147 | 3940 | forget_lite(player_ptr->current_floor_ptr); |
4148 | 3941 | forget_view(player_ptr->current_floor_ptr); |
4149 | - | |
4150 | - /* Hack -- Increase "icky" depth */ | |
4151 | 3942 | current_world_ptr->character_icky++; |
4152 | 3943 | |
4153 | 3944 | command_arg = 0; |
@@ -4156,7 +3947,6 @@ void do_cmd_bldg(player_type *player_ptr) | ||
4156 | 3947 | |
4157 | 3948 | show_building(player_ptr, bldg); |
4158 | 3949 | player_ptr->leave_bldg = FALSE; |
4159 | - | |
4160 | 3950 | play_music(TERM_XTRA_MUSIC_BASIC, MUSIC_BASIC_BUILD); |
4161 | 3951 | |
4162 | 3952 | bool validcmd; |
@@ -4197,12 +3987,9 @@ void do_cmd_bldg(player_type *player_ptr) | ||
4197 | 3987 | msg_flag = FALSE; |
4198 | 3988 | msg_erase(); |
4199 | 3989 | |
4200 | - /* Reinit wilderness to activate quests ... */ | |
4201 | 3990 | if (reinit_wilderness) player_ptr->leaving = TRUE; |
4202 | 3991 | |
4203 | - /* Hack -- Decrease "icky" depth */ | |
4204 | 3992 | current_world_ptr->character_icky--; |
4205 | - | |
4206 | 3993 | Term_clear(); |
4207 | 3994 | |
4208 | 3995 | player_ptr->update |= (PU_VIEW | PU_MONSTERS | PU_BONUS | PU_LITE | PU_MON_LITE); |
@@ -4294,7 +4081,6 @@ void determine_bounty_uniques(player_type *player_ptr) | ||
4294 | 4081 | } |
4295 | 4082 | } |
4296 | 4083 | |
4297 | - /* Sort them */ | |
4298 | 4084 | for (int i = 0; i < MAX_BOUNTY - 1; i++) |
4299 | 4085 | { |
4300 | 4086 | for (int j = i; j < MAX_BOUNTY; j++) |