X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Fxtra1.c;h=f817f097371b3b08de3cebb81a5cefc473c781d8;hb=eff985f8a95fa47850c25c5e26d58e9844bed883;hp=79d12d9b5d0acd617d86aa6ef74b9ae4799f907b;hpb=eb77497749cd93f3b0a4317409c8ccedfc887324;p=hengband%2Fhengband.git diff --git a/src/xtra1.c b/src/xtra1.c index 79d12d9b5..f817f0973 100644 --- a/src/xtra1.c +++ b/src/xtra1.c @@ -1,23 +1,23 @@ - -/* File: misc.c */ - -/* - * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke - * - * This software may be copied and distributed for educational, research, - * and not for profit purposes provided that this copyright and statement - * are included in all such copies. Other copyrights may also apply. +/*! + * @file xtra1.c + * @brief ãã¬ã¤ã¤ã¼ã®ã¹ãã¼ã¿ã¹å¦ç / status + * @date 2018/09/25 + * @author + * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke\n + * This software may be copied and distributed for educational, research, and\n + * not for profit purposes provided that this copyright and statement are\n + * included in all such copies.\n + * 2014 Deskull rearranged comment for Doxygen. */ -/* Purpose: misc code */ - #include "angband.h" +#include "world.h" - - - -/* - * Converts stat num into a six-char (right justified) string +/*! + * @brief ç¾å¨ã®ä¿®æ£å¾è½åå¤ã3ï½17åã³18/xxxå½¢å¼ã«å¤æãã / Converts stat num into a six-char (right justified) string + * @param val è½åå¤ + * @param out_val åºåå æååãã¤ã³ã¿ + * @return ãªã */ void cnv_stat(int val, char *out_val) { @@ -47,16 +47,19 @@ void cnv_stat(int val, char *out_val) } } - - -/* +/*! + * @brief è½åå¤ç¾å¨å¤ãã3ï½17åã³18/xxxæ§å¼ã«åºã¥ãå æ¸ç®ãè¡ãã * Modify a stat value by a "modifier", return new value - * + * @param value ç¾å¨å¤ + * @param amount å æ¸ç®å¤ + * @return å æ¸ç®å¾ã®å¤ + * @details + *
* Stats go up: 3,4,...,17,18,18/10,18/20,...,18/220 * Or even: 18/13, 18/23, 18/33, ..., 18/220 - * * Stats go down: 18/220, 18/210,..., 18/10, 18, 17, ..., 3 * Or even: 18/13, 18/03, 18, 17, ..., 3 + **/ s16b modify_stat_value(int value, int amount) { @@ -94,15 +97,20 @@ s16b modify_stat_value(int value, int amount) } /* Return new value */ - return (value); + return (s16b)(value); } -/* +/*! + * @brief ç»é¢å·¦ã®è½åå¤è¡¨ç¤ºãè¡ãããã«æå®ä½ç½®ãã13ãã£ã©åã空ç½æ¶å»å¾æå®ã®ã¡ãã»ã¼ã¸ãæããéã§æç»ãã / * Print character info at given row, column in a 13 char field + * @param info 表示æåå + * @param row æç»å + * @param col æç»è¡ + * @return ãªã */ -static void prt_field(cptr info, int row, int col) +static void prt_field(cptr info, TERM_LEN row, TERM_LEN col) { /* Dump 13 spaces to clear */ c_put_str(TERM_WHITE, " ", row, col); @@ -111,45 +119,10 @@ static void prt_field(cptr info, int row, int col) c_put_str(TERM_L_BLUE, info, row, col); } - -/* - * Whether daytime or not - */ -bool is_daytime(void) -{ - s32b len = TURNS_PER_TICK * TOWN_DAWN; - if ((turn % len) < (len / 2)) - return TRUE; - else - return FALSE; -} - -/* - * Extract day, hour, min - */ -void extract_day_hour_min(int *day, int *hour, int *min) -{ - const s32b A_DAY = TURNS_PER_TICK * TOWN_DAWN; - s32b turn_in_today = (turn + A_DAY / 4) % A_DAY; - - switch (p_ptr->start_race) - { - case RACE_VAMPIRE: - case RACE_SKELETON: - case RACE_ZOMBIE: - case RACE_SPECTRE: - *day = (turn - A_DAY * 3 / 4) / A_DAY + 1; - break; - default: - *day = (turn + A_DAY / 4) / A_DAY + 1; - break; - } - *hour = (24 * turn_in_today / A_DAY) % 24; - *min = (1440 * turn_in_today / A_DAY) % 60; -} - -/* +/*! + * @brief ã²ã¼ã æå»ã表示ãã / * Print time + * @return ãªã */ void prt_time(void) { @@ -161,58 +134,41 @@ void prt_time(void) extract_day_hour_min(&day, &hour, &min); /* Dump the info itself */ -#ifdef JP - if (day < 1000) c_put_str(TERM_WHITE, format("%2dÆüÌÜ", day), ROW_DAY, COL_DAY); - else c_put_str(TERM_WHITE, "***ÆüÌÜ", ROW_DAY, COL_DAY); -#else - if (day < 1000) c_put_str(TERM_WHITE, format("Day%3d", day), ROW_DAY, COL_DAY); - else c_put_str(TERM_WHITE, "Day***", ROW_DAY, COL_DAY); -#endif + if (day < 1000) c_put_str(TERM_WHITE, format(_("%2dæ¥ç®", "Day%3d"), day), ROW_DAY, COL_DAY); + else c_put_str(TERM_WHITE, _("***æ¥ç®", "Day***"), ROW_DAY, COL_DAY); c_put_str(TERM_WHITE, format("%2d:%02d", hour, min), ROW_DAY, COL_DAY+7); } - +/*! + * @brief ç¾å¨ã®ãããåãè¿ã / + * @return ãããåã®æåååç §ãã¤ã³ã¿ + */ cptr map_name(void) { if (p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest) && (quest[p_ptr->inside_quest].flags & QUEST_FLAG_PRESET)) -#ifdef JP - return "¥¯¥¨¥¹¥È"; -#else - return "Quest"; -#endif + return _("ã¯ã¨ã¹ã", "Quest"); else if (p_ptr->wild_mode) -#ifdef JP - return "ÃϾå"; -#else - return "Surface"; -#endif + return _("å°ä¸", "Surface"); else if (p_ptr->inside_arena) -#ifdef JP - return "¥¢¥ê¡¼¥Ê"; -#else - return "Arena"; -#endif + return _("ã¢ãªã¼ã", "Arena"); else if (p_ptr->inside_battle) -#ifdef JP - return "Æ®µ»¾ì"; -#else - return "Monster Arena"; -#endif + return _("éæå ´", "Monster Arena"); else if (!dun_level && p_ptr->town_num) return town[p_ptr->town_num].name; else return d_name+d_info[dungeon_type].name; } -/* - * Print dungeon +/*! + * @brief ç¾å¨ã®ãããåãæç»ãã / Print dungeon + * @return ãªã */ static void prt_dungeon(void) { cptr dungeon_name; - int col; + TERM_LEN col; /* Dump 13 spaces to clear */ c_put_str(TERM_WHITE, " ", ROW_DUNGEON, COL_DUNGEON); @@ -228,10 +184,10 @@ static void prt_dungeon(void) } - - -/* - * Print character stat in given row, column +/*! + * @brief ãã¬ã¤ã¤ã¼è½åå¤ãæç»ãã / Print character stat in given row, column + * @param stat æç»ããã¹ãã¼ã¿ã¹ã®ID + * @return ãªã */ static void prt_stat(int stat) { @@ -257,7 +213,7 @@ static void prt_stat(int stat) if (p_ptr->stat_max[stat] == p_ptr->stat_max_max[stat]) { #ifdef JP - /* ÆüËܸì¤Ë¤«¤Ö¤é¤Ê¤¤¤è¤¦¤Ëɽ¼¨°ÌÃÖ¤òÊѹ¹ */ + /* æ¥æ¬èªã«ãã¶ããªãããã«è¡¨ç¤ºä½ç½®ãå¤æ´ */ put_str("!", ROW_STAT + stat, 5); #else put_str("!", ROW_STAT + stat, 3); @@ -268,151 +224,151 @@ static void prt_stat(int stat) /* - * Data structure for status bar + * ç»é¢ä¸é¨ã«è¡¨ç¤ºããç¶æ 表示å®ç¾©ID / Data structure for status bar */ -#define BAR_TSUYOSHI 0 -#define BAR_HALLUCINATION 1 -#define BAR_BLINDNESS 2 -#define BAR_PARALYZE 3 -#define BAR_CONFUSE 4 -#define BAR_POISONED 5 -#define BAR_AFRAID 6 -#define BAR_LEVITATE 7 -#define BAR_REFLECTION 8 -#define BAR_PASSWALL 9 -#define BAR_WRAITH 10 -#define BAR_PROTEVIL 11 -#define BAR_KAWARIMI 12 -#define BAR_MAGICDEFENSE 13 -#define BAR_EXPAND 14 -#define BAR_STONESKIN 15 -#define BAR_MULTISHADOW 16 -#define BAR_REGMAGIC 17 -#define BAR_ULTIMATE 18 -#define BAR_INVULN 19 -#define BAR_IMMACID 20 -#define BAR_RESACID 21 -#define BAR_IMMELEC 22 -#define BAR_RESELEC 23 -#define BAR_IMMFIRE 24 -#define BAR_RESFIRE 25 -#define BAR_IMMCOLD 26 -#define BAR_RESCOLD 27 -#define BAR_RESPOIS 28 -#define BAR_RESNETH 29 -#define BAR_RESTIME 30 -#define BAR_DUSTROBE 31 -#define BAR_SHFIRE 32 -#define BAR_TOUKI 33 -#define BAR_SHHOLY 34 -#define BAR_EYEEYE 35 -#define BAR_BLESSED 36 -#define BAR_HEROISM 37 -#define BAR_BERSERK 38 -#define BAR_ATTKFIRE 39 -#define BAR_ATTKCOLD 40 -#define BAR_ATTKELEC 41 -#define BAR_ATTKACID 42 -#define BAR_ATTKPOIS 43 -#define BAR_ATTKCONF 44 -#define BAR_SENSEUNSEEN 45 -#define BAR_TELEPATHY 46 -#define BAR_REGENERATION 47 -#define BAR_INFRAVISION 48 -#define BAR_STEALTH 49 -#define BAR_SUPERSTEALTH 50 -#define BAR_RECALL 51 -#define BAR_ALTER 52 -#define BAR_SHCOLD 53 -#define BAR_SHELEC 54 -#define BAR_SHSHADOW 55 -#define BAR_MIGHT 56 -#define BAR_BUILD 57 -#define BAR_ANTIMULTI 58 -#define BAR_ANTITELE 59 -#define BAR_ANTIMAGIC 60 -#define BAR_PATIENCE 61 -#define BAR_REVENGE 62 -#define BAR_RUNESWORD 63 -#define BAR_VAMPILIC 64 -#define BAR_CURE 65 -#define BAR_ESP_EVIL 66 +#define BAR_TSUYOSHI 0 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: ãªã¯ã¬å ããç¶æ */ +#define BAR_HALLUCINATION 1 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: å¹»è¦ */ +#define BAR_BLINDNESS 2 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: ç²ç® */ +#define BAR_PARALYZE 3 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: éº»çº */ +#define BAR_CONFUSE 4 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: æ··ä¹± */ +#define BAR_POISONED 5 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: æ¯ */ +#define BAR_AFRAID 6 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: ææ */ +#define BAR_LEVITATE 7 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: æµ®é */ +#define BAR_REFLECTION 8 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: åå° */ +#define BAR_PASSWALL 9 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: å£æã */ +#define BAR_WRAITH 10 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: å¹½ä½å */ +#define BAR_PROTEVIL 11 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: 対éªæªçµç */ +#define BAR_KAWARIMI 12 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: å¤ãã身 */ +#define BAR_MAGICDEFENSE 13 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: éæ³ã®é§ */ +#define BAR_EXPAND 14 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: 横伸㳠*/ +#define BAR_STONESKIN 15 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: ç³èå */ +#define BAR_MULTISHADOW 16 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: å½±å身 */ +#define BAR_REGMAGIC 17 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: éæ³é²å¾¡ */ +#define BAR_ULTIMATE 18 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: 究極ã®èæ§ */ +#define BAR_INVULN 19 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: ç¡æµå */ +#define BAR_IMMACID 20 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: é ¸å ç« */ +#define BAR_RESACID 21 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: é ¸èæ§ */ +#define BAR_IMMELEC 22 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: é»æå ç« */ +#define BAR_RESELEC 23 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: é»æèæ§ */ +#define BAR_IMMFIRE 24 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: ç«çå ç« */ +#define BAR_RESFIRE 25 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: ç«çèæ§ */ +#define BAR_IMMCOLD 26 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: å·æ°å ç« */ +#define BAR_RESCOLD 27 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: å·æ°èæ§ */ +#define BAR_RESPOIS 28 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: æ¯èæ§ */ +#define BAR_RESNETH 29 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: å°çèæ§ */ +#define BAR_RESTIME 30 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: æéé転èæ§ */ +#define BAR_DUSTROBE 31 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: ç ´çãªã¼ã© */ +#define BAR_SHFIRE 32 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: ç«çãªã¼ã© */ +#define BAR_TOUKI 33 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: éæ° */ +#define BAR_SHHOLY 34 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: èãªããªã¼ã© */ +#define BAR_EYEEYE 35 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: ç®ã«ã¯ç®ã */ +#define BAR_BLESSED 36 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: ç¥ç¦ */ +#define BAR_HEROISM 37 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: 士æ°é«æ */ +#define BAR_BERSERK 38 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: çæ¦å£«å */ +#define BAR_ATTKFIRE 39 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: ç¼æ£ã¹ã¬ã¤ */ +#define BAR_ATTKCOLD 40 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: å·åã¹ã¬ã¤ */ +#define BAR_ATTKELEC 41 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: é»æã¹ã¬ã¤ */ +#define BAR_ATTKACID 42 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: 溶解ã¹ã¬ã¤ */ +#define BAR_ATTKPOIS 43 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: æ¯æ®ºã¹ã¬ã¤ */ +#define BAR_ATTKCONF 44 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: æ··ä¹±ææ */ +#define BAR_SENSEUNSEEN 45 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: éæè¦ */ +#define BAR_TELEPATHY 46 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: ãã¬ãã·ã¼ */ +#define BAR_REGENERATION 47 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: æ¥å復 */ +#define BAR_INFRAVISION 48 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: 赤å¤ç·è¦å */ +#define BAR_STEALTH 49 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: é å¯ */ +#define BAR_SUPERSTEALTH 50 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: è¶ é å¯ */ +#define BAR_RECALL 51 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: 帰éå¾ ã¡ */ +#define BAR_ALTER 52 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: ç¾å®å¤å®¹å¾ ã¡ */ +#define BAR_SHCOLD 53 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: å·æ°ãªã¼ã© */ +#define BAR_SHELEC 54 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: é»æãªã¼ã© */ +#define BAR_SHSHADOW 55 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: å½±ã®ãªã¼ã© */ +#define BAR_MIGHT 56 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: è åå¼·å */ +#define BAR_BUILD 57 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: èä½å¼·å */ +#define BAR_ANTIMULTI 58 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: åå¢æ® */ +#define BAR_ANTITELE 59 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: åãã¬ãã¼ã */ +#define BAR_ANTIMAGIC 60 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: åéæ³ */ +#define BAR_PATIENCE 61 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: ææ ¢ */ +#define BAR_REVENGE 62 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: 宣å */ +#define BAR_RUNESWORD 63 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: éå£å */ +#define BAR_VAMPILIC 64 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: å¸è¡ */ +#define BAR_CURE 65 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: å復 */ +#define BAR_ESP_EVIL 66 /*!< ä¸é¨ã¹ãã¼ã¿ã¹è¡¨ç¤º: éªæªæç¥ */ static struct { - byte attr; + TERM_COLOR attr; cptr sstr; cptr lstr; } bar[] #ifdef JP = { - {TERM_YELLOW, "¤Ä", "¤Ä¤è¤·"}, - {TERM_VIOLET, "¸¸", "¸¸³Ð"}, - {TERM_L_DARK, "ÌÕ", "ÌÕÌÜ"}, - {TERM_RED, "áã", "Ëãáã"}, - {TERM_VIOLET, "Íð", "º®Íð"}, - {TERM_GREEN, "ÆÇ", "ÆÇ"}, - {TERM_BLUE, "¶²", "¶²ÉÝ"}, - {TERM_L_BLUE, "Éâ", "ÉâÍ·"}, - {TERM_SLATE, "È¿", "È¿¼Í"}, - {TERM_SLATE, "ÊÉ", "ÊÉÈ´¤±"}, - {TERM_L_DARK, "Í©", "Í©ÂÎ"}, - {TERM_SLATE, "¼Ù", "ËɼÙ"}, - {TERM_VIOLET, "ÊÑ", "ÊѤï¤ê¿È"}, - {TERM_YELLOW, "Ëâ", "ËâË¡³»"}, - {TERM_L_UMBER, "¿", "¿¤Ó"}, - {TERM_WHITE, "ÀÐ", "ÀÐÈ©"}, - {TERM_L_BLUE, "ʬ", "ʬ¿È"}, - {TERM_SLATE, "ËÉ", "ËâË¡Ëɸæ"}, - {TERM_YELLOW, "µæ", "µæ¶Ë"}, - {TERM_YELLOW, "̵", "̵Ũ"}, - {TERM_L_GREEN, "»À", "»ÀÌȱÖ"}, - {TERM_GREEN, "»À", "ÂÑ»À"}, - {TERM_L_BLUE, "ÅÅ", "ÅÅÌȱÖ"}, - {TERM_BLUE, "ÅÅ", "ÂÑÅÅ"}, - {TERM_L_RED, "²Ð", "²ÐÌȱÖ"}, - {TERM_RED, "²Ð", "ÂѲÐ"}, - {TERM_WHITE, "Îä", "ÎäÌȱÖ"}, - {TERM_SLATE, "Îä", "ÂÑÎä"}, - {TERM_GREEN, "ÆÇ", "ÂÑÆÇ"}, - {TERM_L_DARK, "¹ö", "ÂÑÃϹö"}, - {TERM_L_BLUE, "»þ", "ÂÑ»þ´Ö"}, - {TERM_L_DARK, "¶À", "¶À¥ª¡¼¥é"}, - {TERM_L_RED, "¥ª", "²Ð¥ª¡¼¥é"}, - {TERM_WHITE, "Æ®", "Æ®µ¤"}, - {TERM_WHITE, "À»", "À»¥ª¡¼¥é"}, - {TERM_VIOLET, "ÌÜ", "ÌܤˤÏÌÜ"}, - {TERM_WHITE, "½Ë", "½ËÊ¡"}, - {TERM_WHITE, "ͦ", "ͦ"}, - {TERM_RED, "¶¸", "¶¸Íð"}, - {TERM_L_RED, "²Ð", "Ëâ·õ²Ð"}, - {TERM_WHITE, "Îä", "Ëâ·õÎä"}, - {TERM_L_BLUE, "ÅÅ", "Ëâ·õÅÅ"}, - {TERM_SLATE, "»À", "Ëâ·õ»À"}, - {TERM_L_GREEN, "ÆÇ", "Ëâ·õÆÇ"}, - {TERM_RED, "Íð", "º®ÍðÂÇ·â"}, - {TERM_L_BLUE, "»ë", "Æ©ÌÀ»ë"}, - {TERM_ORANGE, "¥Æ", "¥Æ¥ì¥Ñ¥·"}, - {TERM_L_BLUE, "²ó", "²óÉü"}, - {TERM_L_RED, "ÀÖ", "ÀÖ³°"}, - {TERM_UMBER, "±£", "±£Ì©"}, - {TERM_YELLOW, "±£", "Ķ±£Ì©"}, - {TERM_WHITE, "µ¢", "µ¢´Ô"}, - {TERM_WHITE, "¸½", "¸½¼ÂÊÑÍÆ"}, + {TERM_YELLOW, "ã¤", "ã¤ãã"}, + {TERM_VIOLET, "å¹»", "å¹»è¦"}, + {TERM_L_DARK, "ç²", "ç²ç®"}, + {TERM_RED, "çº", "麻çº"}, + {TERM_VIOLET, "ä¹±", "æ··ä¹±"}, + {TERM_GREEN, "æ¯", "æ¯"}, + {TERM_BLUE, "æ", "ææ"}, + {TERM_L_BLUE, "æµ®", "æµ®é"}, + {TERM_SLATE, "å", "åå°"}, + {TERM_SLATE, "å£", "å£æã"}, + {TERM_L_DARK, "å¹½", "å¹½ä½"}, + {TERM_SLATE, "éª", "é²éª"}, + {TERM_VIOLET, "å¤", "å¤ãã身"}, + {TERM_YELLOW, "é", "éæ³é§"}, + {TERM_L_UMBER, "伸", "伸ã³"}, + {TERM_WHITE, "ç³", "ç³è"}, + {TERM_L_BLUE, "å", "å身"}, + {TERM_SLATE, "é²", "éæ³é²å¾¡"}, + {TERM_YELLOW, "究", "究極"}, + {TERM_YELLOW, "ç¡", "ç¡æµ"}, + {TERM_L_GREEN, "é ¸", "é ¸å ç«"}, + {TERM_GREEN, "é ¸", "èé ¸"}, + {TERM_L_BLUE, "é»", "é»å ç«"}, + {TERM_BLUE, "é»", "èé»"}, + {TERM_L_RED, "ç«", "ç«å ç«"}, + {TERM_RED, "ç«", "èç«"}, + {TERM_WHITE, "å·", "å·å ç«"}, + {TERM_SLATE, "å·", "èå·"}, + {TERM_GREEN, "æ¯", "èæ¯"}, + {TERM_L_DARK, "ç", "èå°ç"}, + {TERM_L_BLUE, "æ", "èæé"}, + {TERM_L_DARK, "é¡", "é¡ãªã¼ã©"}, + {TERM_L_RED, "ãª", "ç«ãªã¼ã©"}, + {TERM_WHITE, "é", "éæ°"}, + {TERM_WHITE, "è", "èãªã¼ã©"}, + {TERM_VIOLET, "ç®", "ç®ã«ã¯ç®"}, + {TERM_WHITE, "ç¥", "ç¥ç¦"}, + {TERM_WHITE, "å", "å"}, + {TERM_RED, "ç", "çä¹±"}, + {TERM_L_RED, "ç«", "éå£ç«"}, + {TERM_WHITE, "å·", "éå£å·"}, + {TERM_L_BLUE, "é»", "éå£é»"}, + {TERM_SLATE, "é ¸", "éå£é ¸"}, + {TERM_L_GREEN, "æ¯", "éå£æ¯"}, + {TERM_RED, "ä¹±", "æ··ä¹±ææ"}, + {TERM_L_BLUE, "è¦", "éæè¦"}, + {TERM_ORANGE, "ã", "ãã¬ãã·"}, + {TERM_L_BLUE, "å", "å復"}, + {TERM_L_RED, "赤", "赤å¤"}, + {TERM_UMBER, "é ", "é å¯"}, + {TERM_YELLOW, "é ", "è¶ é å¯"}, + {TERM_WHITE, "帰", "帰é"}, + {TERM_WHITE, "ç¾", "ç¾å®å¤å®¹"}, /* Hex */ - {TERM_WHITE, "¥ª", "ɹ¥ª¡¼¥é"}, - {TERM_BLUE, "¥ª", "ÅÅ¥ª¡¼¥é"}, - {TERM_L_DARK, "¥ª", "±Æ¥ª¡¼¥é"}, - {TERM_YELLOW, "ÏÓ", "ÏÓÎ϶¯²½"}, - {TERM_RED, "Æù", "ÆùÂζ¯²½"}, - {TERM_L_DARK, "¿£", "È¿Áý¿£"}, - {TERM_ORANGE, "¥Æ", "È¿¥Æ¥ì¥Ý"}, - {TERM_RED, "Ëâ", "È¿ËâË¡"}, - {TERM_SLATE, "²æ", "²æËý"}, - {TERM_SLATE, "Àë", "Àë¹ð"}, - {TERM_L_DARK, "·õ", "Ëâ·õ²½"}, - {TERM_RED, "µÛ", "µÛ·ìÂÇ·â"}, - {TERM_WHITE, "²ó", "²óÉü"}, - {TERM_L_DARK, "´¶", "¼Ù°´¶ÃÎ"}, + {TERM_WHITE, "ãª", "æ°·ãªã¼ã©"}, + {TERM_BLUE, "ãª", "é»ãªã¼ã©"}, + {TERM_L_DARK, "ãª", "å½±ãªã¼ã©"}, + {TERM_YELLOW, "è ", "è åå¼·å"}, + {TERM_RED, "è", "èä½å¼·å"}, + {TERM_L_DARK, "æ®", "åå¢æ®"}, + {TERM_ORANGE, "ã", "åãã¬ã"}, + {TERM_RED, "é", "åéæ³"}, + {TERM_SLATE, "æ", "ææ ¢"}, + {TERM_SLATE, "宣", "宣å"}, + {TERM_L_DARK, "å£", "éå£å"}, + {TERM_RED, "å¸", "å¸è¡ææ"}, + {TERM_WHITE, "å", "å復"}, + {TERM_L_DARK, "æ", "éªæªæç¥"}, {0, NULL, NULL} }; #else @@ -489,18 +445,31 @@ static struct { }; #endif +/*! + * @brief 32ãããå¤æ°é åã®æå®ä½ç½®ã®ããããã©ã°ã1ã«ããã + * @param FLG ãã©ã°ä½ç½®(ããã) + * @return ãªã + */ #define ADD_FLG(FLG) (bar_flags[FLG / 32] |= (1L << (FLG % 32))) + +/*! + * @brief 32ãããå¤æ°é åã®æå®ä½ç½®ã®ããããã©ã°ã1ãã©ãããè¿ãã + * @param FLG ãã©ã°ä½ç½®(ããã) + * @return 1ãªãã°0以å¤ãè¿ã + */ #define IS_FLG(FLG) (bar_flags[FLG / 32] & (1L << (FLG % 32))) -/* - * Show status bar +/*! + * @brief ä¸é¨ã«ç¶æ 表示ãè¡ã / Show status bar + * @return ãªã */ static void prt_status(void) { - u32b bar_flags[3]; - int wid, hgt, row_statbar, max_col_statbar; - int i, col = 0, num = 0; + BIT_FLAGS bar_flags[3]; + TERM_LEN wid, hgt, row_statbar, max_col_statbar; + int i; + TERM_LEN col = 0, num = 0; int space = 2; Term_get_size(&wid, &hgt); @@ -664,10 +633,10 @@ static void prt_status(void) hex_spelling(HEX_CURE_SERIOUS) || hex_spelling(HEX_CURE_CRITICAL)) ADD_FLG(BAR_CURE); - if (p_ptr->magic_num2[2]) + if (HEX_REVENGE_TURN(p_ptr)) { - if (p_ptr->magic_num2[1] == 1) ADD_FLG(BAR_PATIENCE); - if (p_ptr->magic_num2[1] == 2) ADD_FLG(BAR_REVENGE); + if (HEX_REVENGE_TYPE(p_ptr) == 1) ADD_FLG(BAR_PATIENCE); + if (HEX_REVENGE_TYPE(p_ptr) == 2) ADD_FLG(BAR_REVENGE); } } @@ -725,47 +694,28 @@ static void prt_status(void) } - -/* - * Prints "title", including "wizard" or "winner" as needed. +/*! + * @brief ãã¬ã¤ã¤ã¼ã®ç§°å·ã表示ãã / Prints "title", including "wizard" or "winner" as needed. + * @return ãªã */ static void prt_title(void) { cptr p = ""; - char str[14]; + GAME_TEXT str[14]; - /* Wizard */ if (p_ptr->wizard) { -#ifdef JP - /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½ ¾Î¹æ */ - p = "[¥¦¥£¥¶¡¼¥É]"; -#else - p = "[=-WIZARD-=]"; -#endif - + p = _("[ã¦ã£ã¶ã¼ã]", "[=-WIZARD-=]"); } - - /* Winner */ else if (p_ptr->total_winner || (p_ptr->lev > PY_MAX_LEVEL)) { if (p_ptr->arena_number > MAX_ARENA_MONS + 2) { -#ifdef JP - /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½ ¾Î¹æ */ - p = "*¿¿¡¦¾¡Íø¼Ô*"; -#else - p = "*TRUEWINNER*"; -#endif + p = _("*çã»åå©è *", "*TRUEWINNER*"); } else { -#ifdef JP - /* ±ÑÆüÀÚ¤êÂؤ¨µ¡Ç½ ¾Î¹æ */ - p = "***¾¡Íø¼Ô***"; -#else - p = "***WINNER***"; -#endif + p = _("***åå©è ***", "***WINNER***"); } } @@ -780,47 +730,32 @@ static void prt_title(void) } -/* - * Prints level +/*! + * @brief ãã¬ã¤ã¤ã¼ã®ã¬ãã«ã表示ãã / Prints level + * @return ãªã */ static void prt_level(void) { char tmp[32]; -#ifdef JP - sprintf(tmp, "%5d", p_ptr->lev); -#else - sprintf(tmp, "%6d", p_ptr->lev); -#endif - + sprintf(tmp, _("%5d", "%6d"), p_ptr->lev); if (p_ptr->lev >= p_ptr->max_plv) { -#ifdef JP - put_str("¥ì¥Ù¥ë ", ROW_LEVEL, 0); + put_str(_("ã¬ãã« ", "LEVEL "), ROW_LEVEL, 0); c_put_str(TERM_L_GREEN, tmp, ROW_LEVEL, COL_LEVEL + 7); -#else - put_str("LEVEL ", ROW_LEVEL, 0); - c_put_str(TERM_L_GREEN, tmp, ROW_LEVEL, COL_LEVEL + 6); -#endif - } else { -#ifdef JP - put_str("x¥ì¥Ù¥ë", ROW_LEVEL, 0); + put_str(_("xã¬ãã«", "Level "), ROW_LEVEL, 0); c_put_str(TERM_YELLOW, tmp, ROW_LEVEL, COL_LEVEL + 7); -#else - put_str("Level ", ROW_LEVEL, 0); - c_put_str(TERM_YELLOW, tmp, ROW_LEVEL, COL_LEVEL + 6); -#endif - } } -/* - * Display the experience +/*! + * @brief ãã¬ã¤ã¤ã¼ã®çµé¨å¤ã表示ãã / Display the experience + * @return ãªã */ static void prt_exp(void) { @@ -828,11 +763,7 @@ static void prt_exp(void) if ((!exp_need)||(p_ptr->prace == RACE_ANDROID)) { -#ifdef JP - (void)sprintf(out_val, "%7ld", (long)p_ptr->exp); -#else - (void)sprintf(out_val, "%8ld", (long)p_ptr->exp); -#endif + (void)sprintf(out_val, "%8ld", (long)p_ptr->exp); } else { @@ -842,69 +773,47 @@ static void prt_exp(void) } else { -#ifdef JP - (void)sprintf(out_val, "%7ld", (long)(player_exp [p_ptr->lev - 1] * p_ptr->expfact / 100L) - p_ptr->exp); -#else (void)sprintf(out_val, "%8ld", (long)(player_exp [p_ptr->lev - 1] * p_ptr->expfact / 100L) - p_ptr->exp); -#endif } } if (p_ptr->exp >= p_ptr->max_exp) { -#ifdef JP - if (p_ptr->prace == RACE_ANDROID) put_str("¶¯²½ ", ROW_EXP, 0); - else put_str("·Ð¸³ ", ROW_EXP, 0); - c_put_str(TERM_L_GREEN, out_val, ROW_EXP, COL_EXP + 5); -#else - if (p_ptr->prace == RACE_ANDROID) put_str("Cst ", ROW_EXP, 0); - else put_str("EXP ", ROW_EXP, 0); + if (p_ptr->prace == RACE_ANDROID) put_str(_("å¼·å ", "Cst "), ROW_EXP, 0); + else put_str(_("çµé¨ ", "EXP "), ROW_EXP, 0); c_put_str(TERM_L_GREEN, out_val, ROW_EXP, COL_EXP + 4); -#endif - } else { -#ifdef JP - put_str("x·Ð¸³", ROW_EXP, 0); - c_put_str(TERM_YELLOW, out_val, ROW_EXP, COL_EXP + 5); -#else - put_str("Exp ", ROW_EXP, 0); + put_str(_("xçµé¨", "Exp "), ROW_EXP, 0); c_put_str(TERM_YELLOW, out_val, ROW_EXP, COL_EXP + 4); -#endif - } } -/* - * Prints current gold +/*! + * @brief ãã¬ã¤ã¤ã¼ã®ææéã表示ãã / Prints current gold + * @return ãªã */ static void prt_gold(void) { char tmp[32]; - -#ifdef JP - put_str("¡ð ", ROW_GOLD, COL_GOLD); -#else - put_str("AU ", ROW_GOLD, COL_GOLD); -#endif - + put_str(_("ï¼ ", "AU "), ROW_GOLD, COL_GOLD); sprintf(tmp, "%9ld", (long)p_ptr->au); c_put_str(TERM_L_GREEN, tmp, ROW_GOLD, COL_GOLD + 3); } - -/* - * Prints current AC +/*! + * @brief ãã¬ã¤ã¤ã¼ã®ACã表示ãã / Prints current AC + * @return ãªã */ static void prt_ac(void) { char tmp[32]; #ifdef JP -/* AC ¤Îɽ¼¨Êý¼°¤òÊѹ¹¤·¤Æ¤¤¤ë */ - put_str(" £Á£Ã( )", ROW_AC, COL_AC); +/* AC ã®è¡¨ç¤ºæ¹å¼ãå¤æ´ãã¦ãã */ + put_str(" AC( )", ROW_AC, COL_AC); sprintf(tmp, "%5d", p_ptr->dis_ac + p_ptr->dis_to_a); c_put_str(TERM_L_GREEN, tmp, ROW_AC, COL_AC + 6); #else @@ -916,22 +825,21 @@ static void prt_ac(void) } -/* - * Prints Cur/Max hit points +/*! + * @brief ãã¬ã¤ã¤ã¼ã®HPã表示ãã / Prints Cur/Max hit points + * @return ãªã */ static void prt_hp(void) { -/* ¥Ò¥Ã¥È¥Ý¥¤¥ó¥È¤Îɽ¼¨ÊýË¡¤òÊѹ¹ */ + /* ããããã¤ã³ãã®è¡¨ç¤ºæ¹æ³ãå¤æ´ */ char tmp[32]; - byte color; + TERM_COLOR color; - /* ¥¿¥¤¥È¥ë */ -/* put_str(" £È£Ð¡¦£Í£Ð", ROW_HPMP, COL_HPMP); */ - + /* ã¿ã¤ãã« */ put_str("HP", ROW_CURHP, COL_CURHP); - /* ¸½ºß¤Î¥Ò¥Ã¥È¥Ý¥¤¥ó¥È */ + /* ç¾å¨ã®ããããã¤ã³ã */ sprintf(tmp, "%4ld", (long int)p_ptr->chp); if (p_ptr->chp >= p_ptr->mhp) @@ -949,10 +857,10 @@ static void prt_hp(void) c_put_str(color, tmp, ROW_CURHP, COL_CURHP+3); - /* ¶èÀÚ¤ê */ + /* åºåã */ put_str( "/", ROW_CURHP, COL_CURHP + 7 ); - /* ºÇÂç¥Ò¥Ã¥È¥Ý¥¤¥ó¥È */ + /* æ大ããããã¤ã³ã */ sprintf(tmp, "%4ld", (long int)p_ptr->mhp); color = TERM_L_GREEN; @@ -960,12 +868,13 @@ static void prt_hp(void) } -/* - * Prints players max/cur spell points +/*! + * @brief ãã¬ã¤ã¤ã¼ã®MPã表示ãã / Prints players max/cur spell points + * @return ãªã */ static void prt_sp(void) { -/* ¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È¤Îɽ¼¨ÊýË¡¤òÊѹ¹¤·¤Æ¤¤¤ë */ +/* ãã¸ãã¯ãã¤ã³ãã®è¡¨ç¤ºæ¹æ³ãå¤æ´ãã¦ãã */ char tmp[32]; byte color; @@ -973,16 +882,10 @@ static void prt_sp(void) /* Do not show mana unless it matters */ if (!mp_ptr->spell_book) return; - /* ¥¿¥¤¥È¥ë */ -/* put_str(" £Í£Ð / ºÇÂç", ROW_MAXSP, COL_MAXSP); */ - -#ifdef JP - put_str("MP", ROW_CURSP, COL_CURSP); -#else - put_str("SP", ROW_CURSP, COL_CURSP); -#endif + /* ã¿ã¤ãã« */ + put_str(_("MP", "SP"), ROW_CURSP, COL_CURSP); - /* ¸½ºß¤Î¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È */ + /* ç¾å¨ã®ãã¸ãã¯ãã¤ã³ã */ sprintf(tmp, "%4ld", (long int)p_ptr->csp); if (p_ptr->csp >= p_ptr->msp) @@ -1000,10 +903,10 @@ static void prt_sp(void) c_put_str(color, tmp, ROW_CURSP, COL_CURSP+3); - /* ¶èÀÚ¤ê */ + /* åºåã */ put_str( "/", ROW_CURSP, COL_CURSP + 7 ); - /* ºÇÂç¥Þ¥¸¥Ã¥¯¥Ý¥¤¥ó¥È */ + /* æ大ãã¸ãã¯ãã¤ã³ã */ sprintf(tmp, "%4ld", (long int)p_ptr->msp); color = TERM_L_GREEN; @@ -1011,14 +914,15 @@ static void prt_sp(void) } -/* - * Prints depth in stat area +/*! + * @brief ç¾å¨ã®ããã¢ã®æ·±ãã表示ãã / Prints depth in stat area + * @return ãªã */ static void prt_depth(void) { char depths[32]; - int wid, hgt, row_depth, col_depth; - byte attr = TERM_WHITE; + TERM_LEN wid, hgt, row_depth, col_depth; + TERM_COLOR attr = TERM_WHITE; Term_get_size(&wid, &hgt); col_depth = wid + COL_DEPTH; @@ -1026,30 +930,16 @@ static void prt_depth(void) if (!dun_level) { -#ifdef JP - strcpy(depths, "ÃϾå"); -#else - strcpy(depths, "Surf."); -#endif + strcpy(depths, _("å°ä¸", "Surf.")); } else if (p_ptr->inside_quest && !dungeon_type) { -#ifdef JP - strcpy(depths, "ÃϾå"); -#else - strcpy(depths, "Quest"); -#endif + strcpy(depths, _("å°ä¸", "Quest")); } else { -#ifdef JP - if (depth_in_feet) (void)sprintf(depths, "%d ft", dun_level * 50); - else (void)sprintf(depths, "%d ³¬", dun_level); -#else - if (depth_in_feet) (void)sprintf(depths, "%d ft", dun_level * 50); - else (void)sprintf(depths, "Lev %d", dun_level); -#endif - + if (depth_in_feet) (void)sprintf(depths, _("%d ft", "%d ft"), (int)dun_level * 50); + else (void)sprintf(depths, _("%d é", "Lev %d"), (int)dun_level); /* Get color of level based on feeling -JSV- */ switch (p_ptr->feeling) @@ -1073,42 +963,30 @@ static void prt_depth(void) } -/* - * Prints status of hunger +/*! + * @brief ãã¬ã¤ã¤ã¼ã®ç©ºè ¹ç¶æ ã表示ãã / Prints status of hunger + * @return ãªã */ static void prt_hunger(void) { + if(p_ptr->wizard && p_ptr->inside_arena) return; + /* Fainting / Starving */ if (p_ptr->food < PY_FOOD_FAINT) { -#ifdef JP - c_put_str(TERM_RED, "¿ê¼å ", ROW_HUNGRY, COL_HUNGRY); -#else - c_put_str(TERM_RED, "Weak ", ROW_HUNGRY, COL_HUNGRY); -#endif - + c_put_str(TERM_RED, _("è¡°å¼± ", "Weak "), ROW_HUNGRY, COL_HUNGRY); } /* Weak */ else if (p_ptr->food < PY_FOOD_WEAK) { -#ifdef JP - c_put_str(TERM_ORANGE, "¿ê¼å ", ROW_HUNGRY, COL_HUNGRY); -#else - c_put_str(TERM_ORANGE, "Weak ", ROW_HUNGRY, COL_HUNGRY); -#endif - + c_put_str(TERM_ORANGE, _("è¡°å¼± ", "Weak "), ROW_HUNGRY, COL_HUNGRY); } /* Hungry */ else if (p_ptr->food < PY_FOOD_ALERT) { -#ifdef JP - c_put_str(TERM_YELLOW, "¶õÊ¢ ", ROW_HUNGRY, COL_HUNGRY); -#else - c_put_str(TERM_YELLOW, "Hungry", ROW_HUNGRY, COL_HUNGRY); -#endif - + c_put_str(TERM_YELLOW, _("ç©ºè ¹ ", "Hungry"), ROW_HUNGRY, COL_HUNGRY); } /* Normal */ @@ -1120,60 +998,40 @@ static void prt_hunger(void) /* Full */ else if (p_ptr->food < PY_FOOD_MAX) { -#ifdef JP - c_put_str(TERM_L_GREEN, "ËþÊ¢ ", ROW_HUNGRY, COL_HUNGRY); -#else - c_put_str(TERM_L_GREEN, "Full ", ROW_HUNGRY, COL_HUNGRY); -#endif - + c_put_str(TERM_L_GREEN, _("æºè ¹ ", "Full "), ROW_HUNGRY, COL_HUNGRY); } /* Gorged */ else { -#ifdef JP - c_put_str(TERM_GREEN, "¿©²á¤®", ROW_HUNGRY, COL_HUNGRY); -#else - c_put_str(TERM_GREEN, "Gorged", ROW_HUNGRY, COL_HUNGRY); -#endif - + c_put_str(TERM_GREEN, _("é£éã", "Gorged"), ROW_HUNGRY, COL_HUNGRY); } } -/* - * Prints Searching, Resting, Paralysis, or 'count' status +/*! + * @brief ãã¬ã¤ã¤ã¼ã®è¡åç¶æ ã表示ãã / Prints Searching, Resting, Paralysis, or 'count' status + * @return ãªã + * @details * Display is always exactly 10 characters wide (see below) - * * This function was a major bottleneck when resting, so a lot of * the text formatting code was optimized in place below. */ static void prt_state(void) { - byte attr = TERM_WHITE; - - char text[5]; + TERM_COLOR attr = TERM_WHITE; + GAME_TEXT text[16]; /* Repeating */ if (command_rep) { if (command_rep > 999) { -#ifdef JP -sprintf(text, "%2d00", command_rep / 100); -#else (void)sprintf(text, "%2d00", command_rep / 100); -#endif - } else { -#ifdef JP -sprintf(text, " %2d", command_rep); -#else (void)sprintf(text, " %2d", command_rep); -#endif - } } @@ -1184,11 +1042,7 @@ sprintf(text, " %2d", command_rep); { case ACTION_SEARCH: { -#ifdef JP - strcpy(text, "õº÷"); -#else - strcpy(text, "Sear"); -#endif + strcpy(text, _("æ¢ç´¢", "Sear")); break; } case ACTION_REST: @@ -1196,12 +1050,7 @@ sprintf(text, " %2d", command_rep); int i; /* Start with "Rest" */ -#ifdef JP - strcpy(text, " "); -#else - strcpy(text, " "); -#endif - + strcpy(text, _(" ", " ")); /* Extensive (timed) rest */ if (resting >= 1000) @@ -1239,13 +1088,13 @@ sprintf(text, " %2d", command_rep); } /* Rest until healed */ - else if (resting == -1) + else if (resting == COMMAND_ARG_REST_FULL_HEALING) { text[0] = text[1] = text[2] = text[3] = '*'; } /* Rest until done */ - else if (resting == -2) + else if (resting == COMMAND_ARG_REST_UNTIL_DONE) { text[0] = text[1] = text[2] = text[3] = '&'; } @@ -1253,21 +1102,13 @@ sprintf(text, " %2d", command_rep); } case ACTION_LEARN: { -#ifdef JP - strcpy(text, "³Ø½¬"); -#else - strcpy(text, "lear"); -#endif + strcpy(text, _("å¦ç¿", "lear")); if (new_mane) attr = TERM_L_RED; break; } case ACTION_FISH: { -#ifdef JP - strcpy(text, "Äà¤ê"); -#else - strcpy(text, "fish"); -#endif + strcpy(text, _("é£ã", "fish")); break; } case ACTION_KAMAE: @@ -1295,29 +1136,17 @@ sprintf(text, " %2d", command_rep); } case ACTION_SING: { -#ifdef JP - strcpy(text, "²Î "); -#else - strcpy(text, "Sing"); -#endif + strcpy(text, _("æ ", "Sing")); break; } case ACTION_HAYAGAKE: { -#ifdef JP - strcpy(text, "®¶î"); -#else - strcpy(text, "Fast"); -#endif + strcpy(text, _("éé§", "Fast")); break; } case ACTION_SPELL: { -#ifdef JP - strcpy(text, "±Ó¾§"); -#else - strcpy(text, "Spel"); -#endif + strcpy(text, _("è© å±", "Spel")); break; } default: @@ -1333,17 +1162,18 @@ sprintf(text, " %2d", command_rep); } -/* - * Prints the speed of a character. -CJS- +/*! + * @brief ãã¬ã¤ã¤ã¼ã®è¡åé度ã表示ãã / Prints the speed of a character. -CJS- + * @return ãªã */ static void prt_speed(void) { int i = p_ptr->pspeed; bool is_fast = IS_FAST(); - byte attr = TERM_WHITE; + TERM_COLOR attr = TERM_WHITE; char buf[32] = ""; - int wid, hgt, row_speed, col_speed; + TERM_LEN wid, hgt, row_speed, col_speed; Term_get_size(&wid, &hgt); col_speed = wid + COL_SPEED; @@ -1366,7 +1196,7 @@ static void prt_speed(void) else if (p_ptr->slow && !is_fast) attr = TERM_VIOLET; else attr = TERM_L_GREEN; #ifdef JP - sprintf(buf, "%s(+%d)", (p_ptr->riding ? "¾èÇÏ" : "²Ã®"), (i - 110)); + sprintf(buf, "%s(+%d)", (p_ptr->riding ? "ä¹é¦¬" : "å é"), (i - 110)); #else sprintf(buf, "Fast(+%d)", (i - 110)); #endif @@ -1387,7 +1217,7 @@ static void prt_speed(void) else if (p_ptr->slow && !is_fast) attr = TERM_VIOLET; else attr = TERM_L_UMBER; #ifdef JP - sprintf(buf, "%s(-%d)", (p_ptr->riding ? "¾èÇÏ" : "¸ºÂ®"), (110 - i)); + sprintf(buf, "%s(-%d)", (p_ptr->riding ? "ä¹é¦¬" : "æ¸é"), (110 - i)); #else sprintf(buf, "Slow(-%d)", (110 - i)); #endif @@ -1395,11 +1225,7 @@ static void prt_speed(void) else if (p_ptr->riding) { attr = TERM_GREEN; -#ifdef JP - strcpy(buf, "¾èÇÏÃæ"); -#else - strcpy(buf, "Riding"); -#endif + strcpy(buf, _("ä¹é¦¬ä¸", "Riding")); } /* Display the speed */ @@ -1407,9 +1233,13 @@ static void prt_speed(void) } +/*! + * @brief ãã¬ã¤ã¤ã¼ã®åªæå¦ç¿å¯è½ç¶æ ã表示ãã + * @return ãªã + */ static void prt_study(void) { - int wid, hgt, row_study, col_study; + TERM_LEN wid, hgt, row_study, col_study; Term_get_size(&wid, &hgt); col_study = wid + COL_STUDY; @@ -1417,12 +1247,7 @@ static void prt_study(void) if (p_ptr->new_spells) { -#ifdef JP - put_str("³Ø½¬", row_study, col_study); -#else - put_str("Stud", row_study, col_study); -#endif - + put_str(_("å¦ç¿", "Stud"), row_study, col_study); } else { @@ -1431,9 +1256,13 @@ static void prt_study(void) } +/*! + * @brief ãã¬ã¤ã¤ã¼ã®ãã®ã¾ãå¯è½ç¶æ ã表示ãã + * @return ãªã + */ static void prt_imitation(void) { - int wid, hgt, row_study, col_study; + TERM_LEN wid, hgt, row_study, col_study; Term_get_size(&wid, &hgt); col_study = wid + COL_STUDY; @@ -1443,14 +1272,10 @@ static void prt_imitation(void) { if (p_ptr->mane_num) { - byte attr; + TERM_COLOR attr; if (new_mane) attr = TERM_L_RED; else attr = TERM_WHITE; -#ifdef JP - c_put_str(attr, "¤Þ¤Í", row_study, col_study); -#else - c_put_str(attr, "Imit", row_study, col_study); -#endif + c_put_str(attr, _("ã¾ã", "Imit"), row_study, col_study); } else { @@ -1459,73 +1284,41 @@ static void prt_imitation(void) } } - +/*! + * @brief ãã¬ã¤ã¤ã¼ã®è² å·ç¶æ ã表示ãã + * @return ãªã + */ static void prt_cut(void) { int c = p_ptr->cut; if (c > 1000) { -#ifdef JP - c_put_str(TERM_L_RED, "Ã×Ì¿½ý ", ROW_CUT, COL_CUT); -#else - c_put_str(TERM_L_RED, "Mortal wound", ROW_CUT, COL_CUT); -#endif - + c_put_str(TERM_L_RED, _("è´å½å· ", "Mortal wound"), ROW_CUT, COL_CUT); } else if (c > 200) { -#ifdef JP - c_put_str(TERM_RED, "¤Ò¤É¤¤¿¼¼ê ", ROW_CUT, COL_CUT); -#else - c_put_str(TERM_RED, "Deep gash ", ROW_CUT, COL_CUT); -#endif - + c_put_str(TERM_RED, _("ã²ã©ãæ·±æ ", "Deep gash "), ROW_CUT, COL_CUT); } else if (c > 100) { -#ifdef JP - c_put_str(TERM_RED, "½Å½ý ", ROW_CUT, COL_CUT); -#else - c_put_str(TERM_RED, "Severe cut ", ROW_CUT, COL_CUT); -#endif - + c_put_str(TERM_RED, _("éå· ", "Severe cut "), ROW_CUT, COL_CUT); } else if (c > 50) { -#ifdef JP - c_put_str(TERM_ORANGE, "ÂçÊѤʽý ", ROW_CUT, COL_CUT); -#else - c_put_str(TERM_ORANGE, "Nasty cut ", ROW_CUT, COL_CUT); -#endif - + c_put_str(TERM_ORANGE, _("大å¤ãªå· ", "Nasty cut "), ROW_CUT, COL_CUT); } else if (c > 25) { -#ifdef JP - c_put_str(TERM_ORANGE, "¤Ò¤É¤¤½ý ", ROW_CUT, COL_CUT); -#else - c_put_str(TERM_ORANGE, "Bad cut ", ROW_CUT, COL_CUT); -#endif - + c_put_str(TERM_ORANGE, _("ã²ã©ãå· ", "Bad cut "), ROW_CUT, COL_CUT); } else if (c > 10) { -#ifdef JP - c_put_str(TERM_YELLOW, "·Ú½ý ", ROW_CUT, COL_CUT); -#else - c_put_str(TERM_YELLOW, "Light cut ", ROW_CUT, COL_CUT); -#endif - + c_put_str(TERM_YELLOW, _("è»½å· ", "Light cut "), ROW_CUT, COL_CUT); } else if (c) { -#ifdef JP - c_put_str(TERM_YELLOW, "¤«¤¹¤ê½ý ", ROW_CUT, COL_CUT); -#else - c_put_str(TERM_YELLOW, "Graze ", ROW_CUT, COL_CUT); -#endif - + c_put_str(TERM_YELLOW, _("ãããå· ", "Graze "), ROW_CUT, COL_CUT); } else { @@ -1534,37 +1327,25 @@ static void prt_cut(void) } - +/*! + * @brief ãã¬ã¤ã¤ã¼ã®æ¦æ§ç¶æ ã表示ãã + * @return ãªã + */ static void prt_stun(void) { int s = p_ptr->stun; if (s > 100) { -#ifdef JP - c_put_str(TERM_RED, "°Õ¼±ÉÔÌÀÎÆ ", ROW_STUN, COL_STUN); -#else - c_put_str(TERM_RED, "Knocked out ", ROW_STUN, COL_STUN); -#endif - + c_put_str(TERM_RED, _("æèä¸æç ", "Knocked out "), ROW_STUN, COL_STUN); } else if (s > 50) { -#ifdef JP - c_put_str(TERM_ORANGE, "¤Ò¤É¤¯Û¯Û° ", ROW_STUN, COL_STUN); -#else - c_put_str(TERM_ORANGE, "Heavy stun ", ROW_STUN, COL_STUN); -#endif - + c_put_str(TERM_ORANGE, _("ã²ã©ãæ¦æ§ ", "Heavy stun "), ROW_STUN, COL_STUN); } else if (s) { -#ifdef JP - c_put_str(TERM_ORANGE, "Û¯Û° ", ROW_STUN, COL_STUN); -#else - c_put_str(TERM_ORANGE, "Stun ", ROW_STUN, COL_STUN); -#endif - + c_put_str(TERM_ORANGE, _("æ¦æ§ ", "Stun "), ROW_STUN, COL_STUN); } else { @@ -1574,7 +1355,12 @@ static void prt_stun(void) -/* +/*! + * @brief ã¢ã³ã¹ã¿ã¼ã®ä½åã²ã¼ã¸ã表示ãã + * @param riding TRUEãªãã°é¨ä¹ä¸ã®ã¢ã³ã¹ã¿ã¼ã®ä½åãFALSEãªãã¿ã¼ã²ããã¢ã³ã¹ã¿ã¼ã®ä½åã表示ããã表示ä½ç½®ã¯åºå®ã + * @return ãªã + * @details + *
* Redraw the "monster health bar" -DRS- * Rather extensive modifications by -BEN- * @@ -1587,6 +1373,7 @@ static void prt_stun(void) * "health-o-meter"). Clear health bar if nothing is being tracked. * Auto-track current target monster when bored. Note that the * health-bar stops tracking any monster that "disappears". + **/ static void health_redraw(bool riding) { @@ -1609,80 +1396,123 @@ static void health_redraw(bool riding) m_ptr = &m_list[health_who]; - /* Not tracking */ - if (!health_who) + if (p_ptr->wizard && p_ptr->inside_battle) { - /* Erase the health bar */ - Term_erase(col, row, 12); - } + row = ROW_INFO - 2; + col = COL_INFO + 2; - /* Tracking an unseen monster */ - else if (!m_ptr->ml) - { - /* Indicate that the monster health is "unknown" */ - Term_putstr(col, row, 12, TERM_WHITE, "[----------]"); - } + Term_putstr(col - 2, row, 12, TERM_WHITE, " / "); + Term_putstr(col - 2, row + 1, 12, TERM_WHITE, " / "); + Term_putstr(col - 2, row + 2, 12, TERM_WHITE, " / "); + Term_putstr(col - 2, row + 3, 12, TERM_WHITE, " / "); - /* Tracking a hallucinatory monster */ - else if (p_ptr->image) - { - /* Indicate that the monster health is "unknown" */ - Term_putstr(col, row, 12, TERM_WHITE, "[----------]"); - } + if(m_list[1].r_idx) + { + Term_putstr(col - 2, row, 2, r_info[m_list[1].r_idx].x_attr, format("%c", r_info[m_list[1].r_idx].x_char)); + Term_putstr(col - 1, row, 5, TERM_WHITE, format("%5d", m_list[1].hp)); + Term_putstr(col + 5, row, 6, TERM_WHITE, format("%5d", m_list[1].max_maxhp)); + } - /* Tracking a dead monster (???) */ - else if (m_ptr->hp < 0) - { - /* Indicate that the monster health is "unknown" */ - Term_putstr(col, row, 12, TERM_WHITE, "[----------]"); - } + if(m_list[2].r_idx) + { + Term_putstr(col - 2, row + 1, 2, r_info[m_list[2].r_idx].x_attr, format("%c", r_info[m_list[2].r_idx].x_char)); + Term_putstr(col - 1, row + 1, 5, TERM_WHITE, format("%5d", m_list[2].hp)); + Term_putstr(col + 5, row + 1, 6, TERM_WHITE, format("%5d", m_list[2].max_maxhp)); + } + + if(m_list[3].r_idx) + { + Term_putstr(col - 2, row + 2, 2, r_info[m_list[3].r_idx].x_attr, format("%c", r_info[m_list[3].r_idx].x_char)); + Term_putstr(col - 1, row + 2, 5, TERM_WHITE, format("%5d", m_list[3].hp)); + Term_putstr(col + 5, row + 2, 6, TERM_WHITE, format("%5d", m_list[3].max_maxhp)); + } - /* Tracking a visible monster */ + if(m_list[4].r_idx) + { + Term_putstr(col - 2, row + 3, 2, r_info[m_list[4].r_idx].x_attr, format("%c", r_info[m_list[4].r_idx].x_char)); + Term_putstr(col - 1, row + 3, 5, TERM_WHITE, format("%5d", m_list[4].hp)); + Term_putstr(col + 5, row + 3, 6, TERM_WHITE, format("%5d", m_list[4].max_maxhp)); + } + } else { - /* Extract the "percent" of health */ - int pct = 100L * m_ptr->hp / m_ptr->maxhp; - int pct2 = 100L * m_ptr->hp / m_ptr->max_maxhp; - - /* Convert percent into "health" */ - int len = (pct2 < 10) ? 1 : (pct2 < 90) ? (pct2 / 10 + 1) : 10; - /* Default to almost dead */ - byte attr = TERM_RED; + /* Not tracking */ + if (!health_who) + { + /* Erase the health bar */ + Term_erase(col, row, 12); + } - /* Invulnerable */ - if (MON_INVULNER(m_ptr)) attr = TERM_WHITE; + /* Tracking an unseen monster */ + else if (!m_ptr->ml) + { + /* Indicate that the monster health is "unknown" */ + Term_putstr(col, row, 12, TERM_WHITE, "[----------]"); + } + + /* Tracking a hallucinatory monster */ + else if (p_ptr->image) + { + /* Indicate that the monster health is "unknown" */ + Term_putstr(col, row, 12, TERM_WHITE, "[----------]"); + } + + /* Tracking a dead monster (???) */ + else if (m_ptr->hp < 0) + { + /* Indicate that the monster health is "unknown" */ + Term_putstr(col, row, 12, TERM_WHITE, "[----------]"); + } + + /* Tracking a visible monster */ + else + { + /* Extract the "percent" of health */ + int pct = m_ptr->maxhp > 0 ? 100L * m_ptr->hp / m_ptr->maxhp : 0; + int pct2 = m_ptr->maxhp > 0 ? 100L * m_ptr->hp / m_ptr->max_maxhp: 0; + + /* Convert percent into "health" */ + int len = (pct2 < 10) ? 1 : (pct2 < 90) ? (pct2 / 10 + 1) : 10; - /* Asleep */ - else if (MON_CSLEEP(m_ptr)) attr = TERM_BLUE; + /* Default to almost dead */ + TERM_COLOR attr = TERM_RED; - /* Afraid */ - else if (MON_MONFEAR(m_ptr)) attr = TERM_VIOLET; + /* Invulnerable */ + if (MON_INVULNER(m_ptr)) attr = TERM_WHITE; - /* Healthy */ - else if (pct >= 100) attr = TERM_L_GREEN; + /* Asleep */ + else if (MON_CSLEEP(m_ptr)) attr = TERM_BLUE; - /* Somewhat Wounded */ - else if (pct >= 60) attr = TERM_YELLOW; + /* Afraid */ + else if (MON_MONFEAR(m_ptr)) attr = TERM_VIOLET; - /* Wounded */ - else if (pct >= 25) attr = TERM_ORANGE; + /* Healthy */ + else if (pct >= 100) attr = TERM_L_GREEN; - /* Badly wounded */ - else if (pct >= 10) attr = TERM_L_RED; + /* Somewhat Wounded */ + else if (pct >= 60) attr = TERM_YELLOW; - /* Default to "unknown" */ - Term_putstr(col, row, 12, TERM_WHITE, "[----------]"); + /* Wounded */ + else if (pct >= 25) attr = TERM_ORANGE; - /* Dump the current "health" (use '*' symbols) */ - Term_putstr(col + 1, row, len, attr, "**********"); + /* Badly wounded */ + else if (pct >= 10) attr = TERM_L_RED; + + /* Default to "unknown" */ + Term_putstr(col, row, 12, TERM_WHITE, "[----------]"); + + /* Dump the current "health" (use '*' symbols) */ + Term_putstr(col + 1, row, len, attr, "**********"); + } } } -/* - * Display basic info (mostly left of map) +/*! + * @brief ãã¬ã¤ã¤ã¼ã®ã¹ãã¼ã¿ã¹ãä¸æ¬è¡¨ç¤ºããï¼å·¦å´é¨åï¼ / Display basic info (mostly left of map) + * @return ãªã */ static void prt_frame_basic(void) { @@ -1732,8 +1562,9 @@ static void prt_frame_basic(void) } -/* - * Display extra info (mostly below map) +/*! + * @brief ãã¬ã¤ã¤ã¼ã®ã¹ãã¼ã¿ã¹ãä¸æ¬è¡¨ç¤ºããï¼ä¸é¨åï¼ / Display extra info (mostly below map) + * @return ãªã */ static void prt_frame_extra(void) { @@ -1759,8 +1590,9 @@ static void prt_frame_extra(void) } -/* - * Hack -- display inventory in sub-windows +/*! + * @brief ãµãã¦ã£ã³ãã¦ã«ææåä¸è¦§ã表示ãã / Hack -- display inventory in sub-windows + * @return ãªã */ static void fix_inven(void) { @@ -1782,8 +1614,6 @@ static void fix_inven(void) /* Display inventory */ display_inven(); - - /* Fresh */ Term_fresh(); /* Restore */ @@ -1792,18 +1622,26 @@ static void fix_inven(void) } -/* - * Print monster info in line +/*! + * @brief ã¢ã³ã¹ã¿ã¼ã®ç¾å¨æ°ãä¸è¡ã§è¡¨ç¾ãã / Print monster info in line + * @param x 表示å + * @param y è¡¨ç¤ºè¡ + * @param m_ptr æãåºã表示ããã¢ã³ã¹ã¿ã¼æ å ±ã®åç §ãã¤ã³ã¿ + * @param n_same ã¢ã³ã¹ã¿ã¼ã®æ°ã®ç¾å¨æ° + * @details + *
* nnn X LV name * nnn : number or unique(U) or wanted unique(W) * X : symbol of monster * LV : monster lv if known * name: name of monster + * @return ãªã + **/ -static void print_monster_line(int x, int y, monster_type* m_ptr, int n_same){ +static void print_monster_line(TERM_LEN x, TERM_LEN y, monster_type* m_ptr, int n_same){ char buf[256]; int i; - int r_idx = m_ptr->ap_r_idx; + MONRACE_IDX r_idx = m_ptr->ap_r_idx; monster_race* r_ptr = &r_info[r_idx]; Term_gotoxy(x, y); @@ -1829,7 +1667,7 @@ static void print_monster_line(int x, int y, monster_type* m_ptr, int n_same){ Term_add_bigch(r_ptr->x_attr, r_ptr->x_char); //LV if (r_ptr->r_tkills && !(m_ptr->mflag2 & MFLAG2_KAGE)){ - sprintf(buf, " %2d", r_ptr->level); + sprintf(buf, " %2d", (int)r_ptr->level); }else{ strcpy(buf, " ??"); } @@ -1841,11 +1679,14 @@ static void print_monster_line(int x, int y, monster_type* m_ptr, int n_same){ //Term_addstr(-1, TERM_WHITE, look_mon_desc(m_ptr, 0)); } - /* - max_lines : ºÇÂ粿¹ÔÉÁ²è¤¹¤ë¤«¡¥ -*/ -void print_monster_list(int x, int y, int max_lines){ - int line = y; +/*! + * @brief ã¢ã³ã¹ã¿ã¼ã®åºç¾ãªã¹ãã表示ãã / Print monster info in line + * @param x 表示å + * @param y è¡¨ç¤ºè¡ + * @param max_lines æ大ä½è¡æç»ããã + */ +void print_monster_list(TERM_LEN x, TERM_LEN y, TERM_LEN max_lines){ + TERM_LEN line = y; monster_type* last_mons = NULL; monster_type* m_ptr = NULL; int n_same = 0; @@ -1859,24 +1700,24 @@ void print_monster_list(int x, int y, int max_lines){ if(!m_ptr->r_idx)continue;//dead? { /* - int r_idx = m_ptr->ap_r_idx; + MONRACE_IDX r_idx = m_ptr->ap_r_idx; monster_race* r_ptr = &r_info[r_idx]; cptr name = (r_name + r_ptr->name); cptr ename = (r_name + r_ptr->name); - //¥ß¥ß¥Ã¥¯Îà¤ä¡Ö¤½¤ì¡×Åù¤Ï¡¢°ìÍ÷¤Ë½Ð¤Æ¤Ï¤¤¤±¤Ê¤¤ + //ãããã¯é¡ãããããçã¯ãä¸è¦§ã«åºã¦ã¯ãããªã if(r_ptr->flags1&RF1_CHAR_CLEAR)continue; if((r_ptr->flags1&RF1_NEVER_MOVE)&&(r_ptr->flags2&RF2_CHAR_MULTI))continue; - //¡Ø¥Ì¥ë¡Ù¤Ï¡¢°ìÍ÷¤Ë½Ð¤Æ¤Ï¤¤¤±¤Ê¤¤ - if((strcmp(name, "À¸¤±¤ëµõ̵¡Ø¥Ì¥ë¡Ù")==0)|| + //ããã«ãã¯ãä¸è¦§ã«åºã¦ã¯ãããªã + if((strcmp(name, "çããèç¡ããã«ã")==0)|| (strcmp(ename, "Null the Living Void")==0))continue; - //"¶â̵¹¤¤Î»ØÎØ"¤Ï¡¢°ìÍ÷¤Ë½Ð¤Æ¤Ï¤¤¤±¤Ê¤¤ - if((strcmp(name, "¶â̵¹¤¤Î»ØÎØ")==0)|| + //"éç¡å¢ã®æ輪"ã¯ãä¸è¦§ã«åºã¦ã¯ãããªã + if((strcmp(name, "éç¡å¢ã®æ輪")==0)|| (strcmp(ename, "Plain Gold Ring")==0))continue; */ } - //¥½¡¼¥ÈºÑ¤ß¤Ê¤Î¤ÇƱ¤¸¥â¥ó¥¹¥¿¡¼¤ÏϢ³¤¹¤ë¡¥¤³¤ì¤òÍøÍѤ·¤ÆƱ¤¸¥â¥ó¥¹¥¿¡¼¤ò¥«¥¦¥ó¥È¡¤¤Þ¤È¤á¤Æɽ¼¨¤¹¤ë¡¥ - if(!last_mons){//ÀèƬ¥â¥ó¥¹¥¿¡¼ + //ã½ã¼ãæ¸ã¿ãªã®ã§åãã¢ã³ã¹ã¿ã¼ã¯é£ç¶ããï¼ãããå©ç¨ãã¦åãã¢ã³ã¹ã¿ã¼ãã«ã¦ã³ãï¼ã¾ã¨ãã¦è¡¨ç¤ºããï¼ + if(!last_mons){//å é ã¢ã³ã¹ã¿ã¼ last_mons = m_ptr; n_same = 1; continue; @@ -1884,13 +1725,13 @@ void print_monster_list(int x, int y, int max_lines){ //same race? if(last_mons->ap_r_idx == m_ptr->ap_r_idx){ n_same++; - continue;//ɽ¼¨½èÍý¤ò¼¡¤Ë²ó¤¹ + continue;//表示å¦çã次ã«åã } //print last mons info print_monster_line(x, line++, last_mons, n_same); n_same = 1; last_mons = m_ptr; - if(line-y-1==max_lines){//»Ä¤ê1¹Ô + if(line-y-1==max_lines){//æ®ã1è¡ break; } } @@ -1901,8 +1742,10 @@ void print_monster_list(int x, int y, int max_lines){ if(last_mons)print_monster_line(x, line++, last_mons, n_same); } } -/* - * Hack -- display monster list in sub-windows + +/*! + * @brief åºç¾ä¸ã¢ã³ã¹ã¿ã¼ã®ãªã¹ãããµãã¦ã£ã³ãã¦ã«è¡¨ç¤ºãã / Hack -- display monster list in sub-windows + * @return ãªã */ static void fix_monster_list(void) { @@ -1926,10 +1769,8 @@ static void fix_monster_list(void) Term_clear(); - target_set_prepare_look();//¥â¥ó¥¹¥¿¡¼°ìÍ÷¤òÀ¸À®¡¤¥½¡¼¥È + target_set_prepare_look();//ã¢ã³ã¹ã¿ã¼ä¸è¦§ãçæï¼ã½ã¼ã print_monster_list(0, 0, h); - - /* Fresh */ Term_fresh(); /* Restore */ @@ -1939,9 +1780,10 @@ static void fix_monster_list(void) - -/* +/*! + * @brief ç¾å¨ã®è£ ååããµãã¦ã£ã³ãã¦ã«è¡¨ç¤ºãã / * Hack -- display equipment in sub-windows + * @return ãªã */ static void fix_equip(void) { @@ -1963,8 +1805,6 @@ static void fix_equip(void) /* Display equipment */ display_equip(); - - /* Fresh */ Term_fresh(); /* Restore */ @@ -1973,8 +1813,10 @@ static void fix_equip(void) } -/* - * Hack -- display equipment in sub-windows +/*! + * @brief ç¾å¨ã®ç¿å¾æ¸éæ³ããµãã¦ã£ã³ãã¦ã«è¡¨ç¤ºãã / + * Hack -- display spells in sub-windows + * @return ãªã */ static void fix_spell(void) { @@ -1996,8 +1838,6 @@ static void fix_spell(void) /* Display spell list */ display_spell_list(); - - /* Fresh */ Term_fresh(); /* Restore */ @@ -2006,8 +1846,10 @@ static void fix_spell(void) } -/* +/*! + * @brief ç¾å¨ã®ãã¬ã¤ã¤ã¼ã¹ãã¼ã¿ã¹ããµãã¦ã£ã³ãã¦ã«è¡¨ç¤ºãã / * Hack -- display character in sub-windows + * @return ãªã */ static void fix_player(void) { @@ -2028,11 +1870,7 @@ static void fix_player(void) Term_activate(angband_term[j]); update_playtime(); - - /* Display player */ display_player(0); - - /* Fresh */ Term_fresh(); /* Restore */ @@ -2040,18 +1878,17 @@ static void fix_player(void) } } - - -/* +/*! + * @brief ã²ã¼ã ã¡ãã»ã¼ã¸å±¥æ´ããµãã¦ã£ã³ãã¦ã«è¡¨ç¤ºãã / * Hack -- display recent messages in sub-windows - * - * XXX XXX XXX Adjust for width and split messages + * Adjust for width and split messages + * @return ãªã */ static void fix_message(void) { int j, i; - int w, h; - int x, y; + TERM_LEN w, h; + TERM_LEN x, y; /* Scan windows */ for (j = 0; j < 8; j++) @@ -2067,7 +1904,6 @@ static void fix_message(void) /* Activate */ Term_activate(angband_term[j]); - /* Get size */ Term_get_size(&w, &h); /* Dump messages */ @@ -2082,8 +1918,6 @@ static void fix_message(void) /* Clear to end of line */ Term_erase(x, y, 255); } - - /* Fresh */ Term_fresh(); /* Restore */ @@ -2092,22 +1926,24 @@ static void fix_message(void) } -/* +/*! + * @brief ç°¡æãããããµãã¦ã£ã³ãã¦ã«è¡¨ç¤ºãã / * Hack -- display overhead view in sub-windows - * + * Adjust for width and split messages + * @return ãªã + * @details * Note that the "player" symbol does NOT appear on the map. */ static void fix_overhead(void) { int j; - int cy, cx; /* Scan windows */ for (j = 0; j < 8; j++) { term *old = Term; - int wid, hgt; + TERM_LEN wid, hgt; /* No window */ if (!angband_term[j]) continue; @@ -2122,10 +1958,8 @@ static void fix_overhead(void) Term_get_size(&wid, &hgt); if (wid > COL_MAP + 2 && hgt > ROW_MAP + 2) { - /* Redraw map */ - display_map(&cy, &cx); - /* Fresh */ + display_map(&cy, &cx); Term_fresh(); } @@ -2135,8 +1969,10 @@ static void fix_overhead(void) } -/* +/*! + * @brief ãã³ã¸ã§ã³ã®å°å½¢ããµãã¦ã£ã³ãã¦ã«è¡¨ç¤ºãã / * Hack -- display dungeon view in sub-windows + * @return ãªã */ static void fix_dungeon(void) { @@ -2158,8 +1994,6 @@ static void fix_dungeon(void) /* Redraw dungeon view */ display_dungeon(); - - /* Fresh */ Term_fresh(); /* Restore */ @@ -2168,8 +2002,10 @@ static void fix_dungeon(void) } -/* - * Hack -- display monster recall in sub-windows +/*! + * @brief ã¢ã³ã¹ã¿ã¼ã®æãåºããµãã¦ã£ã³ãã¦ã«è¡¨ç¤ºãã / + * Hack -- display dungeon view in sub-windows + * @return ãªã */ static void fix_monster(void) { @@ -2191,8 +2027,6 @@ static void fix_monster(void) /* Display monster race info */ if (p_ptr->monster_race_idx) display_roff(p_ptr->monster_race_idx); - - /* Fresh */ Term_fresh(); /* Restore */ @@ -2201,8 +2035,10 @@ static void fix_monster(void) } -/* +/*! + * @brief ãã¼ã¹ã¢ã¤ãã æ å ±ããµãã¦ã£ã³ãã¦ã«è¡¨ç¤ºãã / * Hack -- display object recall in sub-windows + * @return ãªã */ static void fix_object(void) { @@ -2224,8 +2060,6 @@ static void fix_object(void) /* Display monster race info */ if (p_ptr->object_kind_idx) display_koff(p_ptr->object_kind_idx); - - /* Fresh */ Term_fresh(); /* Restore */ @@ -2234,21 +2068,24 @@ static void fix_object(void) } -/* + +/*! + * @brief ãã¬ã¤ã¤ã¼ã®ç¾å¨å¦ç¿å¯è½ãªéæ³æ°ãè¨ç®ããå¢æ¸ã«å¿ãã¦éæ³ã®å¿å´ãåå¦ç¿ãå¦ç½®ããã / * Calculate number of spells player should have, and forget, * or remember, spells until that number is properly reflected. - * + * @return ãªã + * @details * Note that this function induces various "status" messages, * which must be bypasses until the character is created. */ static void calc_spells(void) { - int i, j, k, levels; - int num_allowed; - int num_boukyaku = 0; + int i, j, k, levels; + int num_allowed; + int num_boukyaku = 0; const magic_type *s_ptr; - int which; + REALM_IDX which; int bonus = 0; @@ -2375,13 +2212,10 @@ static void calc_spells(void) which = p_ptr->realm2; } - /* Message */ #ifdef JP - msg_format("%s¤Î%s¤ò˺¤ì¤Æ¤·¤Þ¤Ã¤¿¡£", - do_spell(which, j%32, SPELL_NAME), p ); + msg_format("%sã®%sãå¿ãã¦ãã¾ã£ãã", do_spell(which, j%32, SPELL_NAME), p ); #else - msg_format("You have forgotten the %s of %s.", p, - do_spell(which, j%32, SPELL_NAME)); + msg_format("You have forgotten the %s of %s.", p, do_spell(which, j%32, SPELL_NAME)); #endif @@ -2435,9 +2269,8 @@ static void calc_spells(void) which = p_ptr->realm2; } - /* Message */ #ifdef JP - msg_format("%s¤Î%s¤ò˺¤ì¤Æ¤·¤Þ¤Ã¤¿¡£", + msg_format("%sã®%sãå¿ãã¦ãã¾ã£ãã", do_spell(which, j%32, SPELL_NAME), p ); #else msg_format("You have forgotten the %s of %s.", p, @@ -2511,13 +2344,10 @@ static void calc_spells(void) which = p_ptr->realm2; } - /* Message */ #ifdef JP - msg_format("%s¤Î%s¤ò»×¤¤½Ð¤·¤¿¡£", - do_spell(which, j%32, SPELL_NAME), p ); + msg_format("%sã®%sãæãåºããã", do_spell(which, j%32, SPELL_NAME), p ); #else - msg_format("You have remembered the %s of %s.", - p, do_spell(which, j%32, SPELL_NAME)); + msg_format("You have remembered the %s of %s.", p, do_spell(which, j%32, SPELL_NAME)); #endif @@ -2549,7 +2379,11 @@ static void calc_spells(void) k++; } if (k > 32) k = 32; - if ((p_ptr->new_spells > k) && ((mp_ptr->spell_book == TV_LIFE_BOOK) || (mp_ptr->spell_book == TV_HISSATSU_BOOK))) p_ptr->new_spells = k; + if ((p_ptr->new_spells > k) && + ((mp_ptr->spell_book == TV_LIFE_BOOK) || (mp_ptr->spell_book == TV_HISSATSU_BOOK))) + { + p_ptr->new_spells = (s16b)k; + } } if (p_ptr->new_spells < 0) p_ptr->new_spells = 0; @@ -2560,12 +2394,11 @@ static void calc_spells(void) /* Message if needed */ if (p_ptr->new_spells) { - /* Message */ #ifdef JP if( p_ptr->new_spells < 10 ){ - msg_format("¤¢¤È %d ¤Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p); + msg_format("ã㨠%d ã¤ã®%sãå¦ã¹ãã", p_ptr->new_spells, p); }else{ - msg_format("¤¢¤È %d ¸Ä¤Î%s¤ò³Ø¤Ù¤ë¡£", p_ptr->new_spells, p); + msg_format("ã㨠%d åã®%sãå¦ã¹ãã", p_ptr->new_spells, p); } #else msg_format("You can learn %d more %s%s.", @@ -2586,16 +2419,17 @@ static void calc_spells(void) } } - -/* +/*! + * @brief ãã¬ã¤ã¤ã¼ã®æ大MPãè¨ç®ãã / * Calculate maximum mana. You do not need to know any spells. * Note that mana is lowered by heavy (or inappropriate) armor. - * + * @return ãªã + * @details * This function induces status messages. */ static void calc_mana(void) { - int msp, levels, cur_wgt, max_wgt; + int msp, levels, cur_wgt, max_wgt; object_type *o_ptr; @@ -2651,7 +2485,7 @@ static void calc_mana(void) /* Only mages are affected */ if (mp_ptr->spell_xtra & MAGIC_GLOVE_REDUCE_MANA) { - u32b flgs[TR_FLAG_SIZE]; + BIT_FLAGS flgs[TR_FLAG_SIZE]; /* Assume player is not encumbered by gloves */ p_ptr->cumber_glove = FALSE; @@ -2845,11 +2679,10 @@ static void calc_mana(void) } #ifdef JP - /* ¥ì¥Ù¥ë¥¢¥Ã¥×¤Î»þ¤Ï¾å¾ºÎ̤òɽ¼¨¤¹¤ë */ + /* ã¬ãã«ã¢ããã®æã¯ä¸æéã表示ãã */ if ((level_up == 1) && (msp > p_ptr->msp)) { - msg_format("ºÇÂç¥Þ¥¸¥Ã¥¯¡¦¥Ý¥¤¥ó¥È¤¬ %d Áý²Ã¤·¤¿¡ª", - (msp - p_ptr->msp)); + msg_format("æ大ãã¸ãã¯ã»ãã¤ã³ãã %d å¢å ããï¼", (msp - p_ptr->msp)); } #endif /* Save new mana */ @@ -2858,7 +2691,6 @@ static void calc_mana(void) /* Display mana later */ p_ptr->redraw |= (PR_MANA); - /* Window stuff */ p_ptr->window |= (PW_PLAYER); p_ptr->window |= (PW_SPELL); } @@ -2870,24 +2702,13 @@ static void calc_mana(void) /* Take note when "glove state" changes */ if (p_ptr->old_cumber_glove != p_ptr->cumber_glove) { - /* Message */ if (p_ptr->cumber_glove) { -#ifdef JP - msg_print("¼ê¤¬Ê¤¤ï¤ì¤Æ¼öʸ¤¬¾§¤¨¤Ë¤¯¤¤´¶¤¸¤¬¤¹¤ë¡£"); -#else - msg_print("Your covered hands feel unsuitable for spellcasting."); -#endif - + msg_print(_("æãè¦ããã¦åªæãå±ãã«ããæããããã", "Your covered hands feel unsuitable for spellcasting.")); } else { -#ifdef JP - msg_print("¤³¤Î¼ê¤Î¾õÂ֤ʤ顢¤°¤Ã¤È¼öʸ¤¬¾§¤¨¤ä¤¹¤¤´¶¤¸¤À¡£"); -#else - msg_print("Your hands feel more suitable for spellcasting."); -#endif - + msg_print(_("ãã®æã®ç¶æ ãªãããã£ã¨åªæãå±ããããæãã ã", "Your hands feel more suitable for spellcasting.")); } /* Save it */ @@ -2898,24 +2719,13 @@ static void calc_mana(void) /* Take note when "armor state" changes */ if (p_ptr->old_cumber_armor != p_ptr->cumber_armor) { - /* Message */ if (p_ptr->cumber_armor) { -#ifdef JP - msg_print("ÁõÈ÷¤Î½Å¤µ¤ÇÆ°¤¤¬Æߤ¯¤Ê¤Ã¤Æ¤·¤Þ¤Ã¤Æ¤¤¤ë¡£"); -#else - msg_print("The weight of your equipment encumbers your movement."); -#endif - + msg_print(_("è£ åã®éãã§åããéããªã£ã¦ãã¾ã£ã¦ããã", "The weight of your equipment encumbers your movement.")); } else { -#ifdef JP - msg_print("¤°¤Ã¤È³Ú¤ËÂΤòÆ°¤«¤»¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£"); -#else - msg_print("You feel able to move more freely."); -#endif - + msg_print(_("ãã£ã¨æ¥½ã«ä½ãåãããããã«ãªã£ãã", "You feel able to move more freely.")); } /* Save it */ @@ -2925,9 +2735,12 @@ static void calc_mana(void) -/* +/*! + * @brief ãã¬ã¤ã¤ã¼ã®æ大HPãè¨ç®ãã / * Calculate the players (maximal) hit points * Adjust current hitpoints if necessary + * @return ãªã + * @details */ static void calc_hitpoints(void) { @@ -2988,11 +2801,10 @@ static void calc_hitpoints(void) } #ifdef JP - /* ¥ì¥Ù¥ë¥¢¥Ã¥×¤Î»þ¤Ï¾å¾ºÎ̤òɽ¼¨¤¹¤ë */ + /* ã¬ãã«ã¢ããã®æã¯ä¸æéã表示ãã */ if ((level_up == 1) && (mhp > p_ptr->mhp)) { - msg_format("ºÇÂç¥Ò¥Ã¥È¡¦¥Ý¥¤¥ó¥È¤¬ %d Áý²Ã¤·¤¿¡ª", - (mhp - p_ptr->mhp) ); + msg_format("æ大ãããã»ãã¤ã³ãã %d å¢å ããï¼", (mhp - p_ptr->mhp) ); } #endif /* Save the new max-hitpoints */ @@ -3001,24 +2813,21 @@ static void calc_hitpoints(void) /* Display hitpoints (later) */ p_ptr->redraw |= (PR_HP); - /* Window stuff */ p_ptr->window |= (PW_PLAYER); } } - - -/* - * Extract and set the current "lite radius" - * +/*! + * @brief ãã¬ã¤ã¤ã¼ã®å æºåå¾ãè¨ç®ãã / Extract and set the current "lite radius" + * @return ãªã + * @details * SWD: Experimental modification: multiple light sources have additive effect. - * */ static void calc_torch(void) { - int i; + int i, rad; object_type *o_ptr; - u32b flgs[TR_FLAG_SIZE]; + BIT_FLAGS flgs[TR_FLAG_SIZE]; /* Assume no light */ p_ptr->cur_lite = 0; @@ -3035,20 +2844,26 @@ static void calc_torch(void) /* Need Fuels */ if (o_ptr->name2 != EGO_LITE_DARKNESS) { - if((o_ptr->sval == SV_LITE_TORCH) && !(o_ptr->xtra4 > 0)) break; - if((o_ptr->sval == SV_LITE_LANTERN) && !(o_ptr->xtra4 > 0)) break; + if (o_ptr->tval == TV_LITE) + { + if((o_ptr->sval == SV_LITE_TORCH) && !(o_ptr->xtra4 > 0)) continue; + if((o_ptr->sval == SV_LITE_LANTERN) && !(o_ptr->xtra4 > 0)) continue; + } } /* Extract the flags */ object_flags(o_ptr, flgs); /* calc the lite_radius */ - if (have_flag(flgs, TR_LITE_1)) p_ptr->cur_lite += 1; - if (have_flag(flgs, TR_LITE_2)) p_ptr->cur_lite += 2; - if (have_flag(flgs, TR_LITE_3)) p_ptr->cur_lite += 3; - if (have_flag(flgs, TR_LITE_M1)) p_ptr->cur_lite -= 1; - if (have_flag(flgs, TR_LITE_M2)) p_ptr->cur_lite -= 2; - if (have_flag(flgs, TR_LITE_M3)) p_ptr->cur_lite -= 3; + + rad = 0; + if (have_flag(flgs, TR_LITE_1) && o_ptr->name2 != EGO_LITE_DARKNESS) rad += 1; + if (have_flag(flgs, TR_LITE_2) && o_ptr->name2 != EGO_LITE_DARKNESS) rad += 2; + if (have_flag(flgs, TR_LITE_3) && o_ptr->name2 != EGO_LITE_DARKNESS) rad += 3; + if (have_flag(flgs, TR_LITE_M1)) rad -= 1; + if (have_flag(flgs, TR_LITE_M2)) rad -= 2; + if (have_flag(flgs, TR_LITE_M3)) rad -= 3; + p_ptr->cur_lite += (s16b)rad; } /* max radius is 14 (was 5) without rewriting other code -- */ @@ -3070,7 +2885,6 @@ static void calc_torch(void) /* Notice changes in the "lite radius" */ if (p_ptr->old_lite != p_ptr->cur_lite) { - /* Update stuff */ /* Hack -- PU_MON_LITE for monsters' darkness */ p_ptr->update |= (PU_LITE | PU_MON_LITE | PU_MONSTERS); @@ -3083,28 +2897,38 @@ static void calc_torch(void) } - -/* +/*! + * @brief ãã¬ã¤ã¤ã¼ã®ææééå¶éãè¨ç®ãã / * Computes current weight limit. + * @return å¶ééé(ãã³ã) */ -u32b weight_limit(void) +WEIGHT weight_limit(void) { - u32b i; + WEIGHT i; /* Weight limit based only on strength */ - i = (u32b)adj_str_wgt[p_ptr->stat_ind[A_STR]] * 50; /* Constant was 100 */ + i = (WEIGHT)adj_str_wgt[p_ptr->stat_ind[A_STR]] * 50; /* Constant was 100 */ if (p_ptr->pclass == CLASS_BERSERKER) i = i * 3 / 2; /* Return the result */ return i; } - +/*! + * @brief ãã¬ã¤ã¤ã¼ãç¾å¨å³æ/å·¦æã«æ¦å¨ãæã£ã¦ãããå¤å®ãã / + * @param i å¤å®ããæã®ID(å³æ:0 å·¦æ:1) + * @return æã£ã¦ãããªãã°TRUE + */ bool buki_motteruka(int i) { return ((inventory[i].k_idx && object_is_melee_weapon(&inventory[i])) ? TRUE : FALSE); } +/*! + * @brief å°ææ¦å¨ããã¬ã¤ã¤ã¼ã«ã¨ã£ã¦éããããã©ããã®å¤å® / + * @param o_ptr å¤å®ããå°ææ¦å¨ã®ã¢ã¤ãã æ å ±åç §ãã¤ã³ã¿ + * @return éããããªãã°TRUE + */ bool is_heavy_shoot(object_type *o_ptr) { int hold = adj_str_hold[p_ptr->stat_ind[A_STR]]; @@ -3112,6 +2936,11 @@ bool is_heavy_shoot(object_type *o_ptr) return (hold < o_ptr->weight / 10); } +/*! + * @brief å°ææ¦å¨ã«å¯¾å¿ããç¢/å¼¾è¬ã®ãã¼ã¹ã¢ã¤ãã IDãè¿ã / + * @param o_ptr å¤å®ããå°ææ¦å¨ã®ã¢ã¤ãã æ å ±åç §ãã¤ã³ã¿ + * @return 対å¿ããç¢/å¼¾è¬ã®ãã¼ã¹ã¢ã¤ãã ID + */ int bow_tval_ammo(object_type *o_ptr) { /* Analyze the launcher */ @@ -3135,6 +2964,7 @@ int bow_tval_ammo(object_type *o_ptr) return TV_BOLT; } case SV_CRIMSON: + case SV_HARP: { return TV_NO_AMMO; } @@ -3143,15 +2973,20 @@ int bow_tval_ammo(object_type *o_ptr) return 0; } -/* calcurate the fire rate of target object */ +/*! + * @brief è£ åä¸ã®å°ææ¦å¨ã®å¨ååçãè¿ã / + * calcurate the fire rate of target object + * @param o_ptr è¨ç®ããå°ææ¦å¨ã®ã¢ã¤ãã æ å ±åç §ãã¤ã³ã¿ + * @return å°æåçã®å¤(100ã§1.00å) + */ s16b calc_num_fire(object_type *o_ptr) { int extra_shots = 0; int i; int num = 0; - int tval_ammo = bow_tval_ammo(o_ptr); + OBJECT_TYPE_VALUE tval_ammo = bow_tval_ammo(o_ptr); object_type *q_ptr; - u32b flgs[TR_FLAG_SIZE]; + BIT_FLAGS flgs[TR_FLAG_SIZE]; /* Scan the usable inventory */ for (i = INVEN_RARM; i < INVEN_TOTAL; i++) @@ -3217,14 +3052,17 @@ s16b calc_num_fire(object_type *o_ptr) num += (p_ptr->lev * 4); } } - return num; + return (s16b)num; } -/* +/*! + * @brief ãã¬ã¤ã¤ã¼ã®å ¨ã¹ãã¼ã¿ã¹ãæ´æ°ãã / * Calculate the players current "state", taking into account * not only race/class intrinsics, but also objects being worn * and temporary spell effects. - * + * @return ãªã + * @details + *
* See also calc_mana() and calc_hitpoints(). * * Take note of the new "speed code", in particular, a very strong @@ -3239,6 +3077,7 @@ s16b calc_num_fire(object_type *o_ptr) * are actually added in later, at the appropriate place. * * This function induces various "status" messages. + **/ void calc_bonuses(void) { @@ -3248,7 +3087,7 @@ void calc_bonuses(void) int empty_hands_status = empty_hands(TRUE); int extra_blows[2]; object_type *o_ptr; - u32b flgs[TR_FLAG_SIZE]; + BIT_FLAGS flgs[TR_FLAG_SIZE]; bool omoi = FALSE; bool yoiyami = FALSE; bool down_saving = FALSE; @@ -3258,7 +3097,7 @@ void calc_bonuses(void) bool have_sw = FALSE, have_kabe = FALSE; bool easy_2weapon = FALSE; bool riding_levitation = FALSE; - s16b this_o_idx, next_o_idx = 0; + OBJECT_IDX this_o_idx, next_o_idx = 0; const player_race *tmp_rp_ptr; /* Save the old vision stuff */ @@ -3279,8 +3118,8 @@ void calc_bonuses(void) bool old_mighty_throw = p_ptr->mighty_throw; /* Save the old armor class */ - bool old_dis_ac = p_ptr->dis_ac; - bool old_dis_to_a = p_ptr->dis_to_a; + s16b old_dis_ac = p_ptr->dis_ac; + s16b old_dis_to_a = p_ptr->dis_to_a; /* Clear extra blows/shots */ @@ -3342,7 +3181,7 @@ void calc_bonuses(void) p_ptr->regenerate = FALSE; p_ptr->can_swim = FALSE; p_ptr->levitation = FALSE; - p_ptr->hold_life = FALSE; + p_ptr->hold_exp = FALSE; p_ptr->telepathy = FALSE; p_ptr->esp_animal = FALSE; p_ptr->esp_undead = FALSE; @@ -3604,7 +3443,7 @@ void calc_bonuses(void) switch (p_ptr->mimic_form) { case MIMIC_DEMON: - p_ptr->hold_life = TRUE; + p_ptr->hold_exp = TRUE; p_ptr->resist_chaos = TRUE; p_ptr->resist_neth = TRUE; p_ptr->resist_fire = TRUE; @@ -3617,7 +3456,7 @@ void calc_bonuses(void) p_ptr->align -= 200; break; case MIMIC_DEMON_LORD: - p_ptr->hold_life = TRUE; + p_ptr->hold_exp = TRUE; p_ptr->resist_chaos = TRUE; p_ptr->resist_neth = TRUE; p_ptr->immune_fire = TRUE; @@ -3642,7 +3481,7 @@ void calc_bonuses(void) break; case MIMIC_VAMPIRE: p_ptr->resist_dark = TRUE; - p_ptr->hold_life = TRUE; + p_ptr->hold_exp = TRUE; p_ptr->resist_neth = TRUE; p_ptr->resist_cold = TRUE; p_ptr->resist_pois = TRUE; @@ -3662,7 +3501,7 @@ void calc_bonuses(void) p_ptr->resist_lite = TRUE; break; case RACE_HOBBIT: - p_ptr->hold_life = TRUE; + p_ptr->hold_exp = TRUE; break; case RACE_GNOME: p_ptr->free_act = TRUE; @@ -3762,18 +3601,18 @@ void calc_bonuses(void) p_ptr->free_act = TRUE; p_ptr->see_inv = TRUE; p_ptr->resist_pois = TRUE; - if (p_ptr->lev > 34) p_ptr->hold_life = TRUE; + if (p_ptr->lev > 34) p_ptr->hold_exp = TRUE; break; case RACE_SKELETON: p_ptr->resist_shard = TRUE; - p_ptr->hold_life = TRUE; + p_ptr->hold_exp = TRUE; p_ptr->see_inv = TRUE; p_ptr->resist_pois = TRUE; if (p_ptr->lev > 9) p_ptr->resist_cold = TRUE; break; case RACE_ZOMBIE: p_ptr->resist_neth = TRUE; - p_ptr->hold_life = TRUE; + p_ptr->hold_exp = TRUE; p_ptr->see_inv = TRUE; p_ptr->resist_pois = TRUE; p_ptr->slow_digest = TRUE; @@ -3781,7 +3620,7 @@ void calc_bonuses(void) break; case RACE_VAMPIRE: p_ptr->resist_dark = TRUE; - p_ptr->hold_life = TRUE; + p_ptr->hold_exp = TRUE; p_ptr->resist_neth = TRUE; p_ptr->resist_cold = TRUE; p_ptr->resist_pois = TRUE; @@ -3791,7 +3630,7 @@ void calc_bonuses(void) p_ptr->levitation = TRUE; p_ptr->free_act = TRUE; p_ptr->resist_neth = TRUE; - p_ptr->hold_life = TRUE; + p_ptr->hold_exp = TRUE; p_ptr->see_inv = TRUE; p_ptr->resist_pois = TRUE; p_ptr->slow_digest = TRUE; @@ -3835,7 +3674,7 @@ void calc_bonuses(void) case RACE_DEMON: p_ptr->resist_fire = TRUE; p_ptr->resist_neth = TRUE; - p_ptr->hold_life = TRUE; + p_ptr->hold_exp = TRUE; if (p_ptr->lev > 9) p_ptr->see_inv = TRUE; if (p_ptr->lev > 44) { @@ -3857,7 +3696,7 @@ void calc_bonuses(void) p_ptr->slow_digest = TRUE; p_ptr->free_act = TRUE; p_ptr->resist_pois = TRUE; - p_ptr->hold_life = TRUE; + p_ptr->hold_exp = TRUE; break; default: /* Do nothing */ @@ -3872,7 +3711,7 @@ void calc_bonuses(void) p_ptr->slow_digest = TRUE; p_ptr->regenerate = TRUE; p_ptr->levitation = TRUE; - p_ptr->hold_life = TRUE; + p_ptr->hold_exp = TRUE; p_ptr->telepathy = TRUE; p_ptr->lite = TRUE; p_ptr->sustain_str = TRUE; @@ -3937,7 +3776,7 @@ void calc_bonuses(void) { p_ptr->resist_blind = TRUE; p_ptr->resist_conf = TRUE; - p_ptr->hold_life = TRUE; + p_ptr->hold_exp = TRUE; if (p_ptr->pclass != CLASS_NINJA) p_ptr->lite = TRUE; if ((p_ptr->prace != RACE_KLACKON) && (p_ptr->prace != RACE_SPRITE)) @@ -4195,6 +4034,16 @@ void calc_bonuses(void) if (have_flag(flgs, TR_ADD_H_CURSE)) p_ptr->cursed |= TRC_ADD_H_CURSE; if (have_flag(flgs, TR_DRAIN_HP)) p_ptr->cursed |= TRC_DRAIN_HP; if (have_flag(flgs, TR_DRAIN_MANA)) p_ptr->cursed |= TRC_DRAIN_MANA; + if (have_flag(flgs, TR_CALL_ANIMAL)) p_ptr->cursed |= TRC_CALL_ANIMAL; + if (have_flag(flgs, TR_CALL_DEMON)) p_ptr->cursed |= TRC_CALL_DEMON; + if (have_flag(flgs, TR_CALL_DRAGON)) p_ptr->cursed |= TRC_CALL_DRAGON; + if (have_flag(flgs, TR_CALL_UNDEAD)) p_ptr->cursed |= TRC_CALL_UNDEAD; + if (have_flag(flgs, TR_COWARDICE)) p_ptr->cursed |= TRC_COWARDICE; + if (have_flag(flgs, TR_LOW_MELEE)) p_ptr->cursed |= TRC_LOW_MELEE; + if (have_flag(flgs, TR_LOW_AC)) p_ptr->cursed |= TRC_LOW_AC; + if (have_flag(flgs, TR_LOW_MAGIC)) p_ptr->cursed |= TRC_LOW_MAGIC; + if (have_flag(flgs, TR_FAST_DIGEST)) p_ptr->cursed |= TRC_FAST_DIGEST; + if (have_flag(flgs, TR_SLOW_REGEN)) p_ptr->cursed |= TRC_SLOW_REGEN; if (have_flag(flgs, TR_DEC_MANA)) p_ptr->dec_mana = TRUE; if (have_flag(flgs, TR_BLESSED)) p_ptr->bless_blade = TRUE; if (have_flag(flgs, TR_XTRA_MIGHT)) p_ptr->xtra_might = TRUE; @@ -4217,7 +4066,7 @@ void calc_bonuses(void) if (have_flag(flgs, TR_SEE_INVIS)) p_ptr->see_inv = TRUE; if (have_flag(flgs, TR_LEVITATION)) p_ptr->levitation = TRUE; if (have_flag(flgs, TR_FREE_ACT)) p_ptr->free_act = TRUE; - if (have_flag(flgs, TR_HOLD_LIFE)) p_ptr->hold_life = TRUE; + if (have_flag(flgs, TR_HOLD_EXP)) p_ptr->hold_exp = TRUE; if (have_flag(flgs, TR_WARNING)){ if (!o_ptr->inscription || !(my_strchr(quark_str(o_ptr->inscription),'$'))) p_ptr->warning = TRUE; @@ -4381,25 +4230,25 @@ void calc_bonuses(void) /* To Bow and Natural attack */ /* Apply the bonuses to hit/damage */ - p_ptr->to_h_b += bonus_to_h; - p_ptr->to_h_m += bonus_to_h; - p_ptr->to_d_m += bonus_to_d; + p_ptr->to_h_b += (s16b)bonus_to_h; + p_ptr->to_h_m += (s16b)bonus_to_h; + p_ptr->to_d_m += (s16b)bonus_to_d; /* Apply the mental bonuses tp hit/damage, if known */ - if (object_is_known(o_ptr)) p_ptr->dis_to_h_b += bonus_to_h; + if (object_is_known(o_ptr)) p_ptr->dis_to_h_b += (s16b)bonus_to_h; /* To Melee */ if ((i == INVEN_LEFT || i == INVEN_RIGHT) && !p_ptr->ryoute) { /* Apply the bonuses to hit/damage */ - p_ptr->to_h[i-INVEN_RIGHT] += bonus_to_h; - p_ptr->to_d[i-INVEN_RIGHT] += bonus_to_d; + p_ptr->to_h[i-INVEN_RIGHT] += (s16b)bonus_to_h; + p_ptr->to_d[i-INVEN_RIGHT] += (s16b)bonus_to_d; /* Apply the mental bonuses tp hit/damage, if known */ if (object_is_known(o_ptr)) { - p_ptr->dis_to_h[i-INVEN_RIGHT] += bonus_to_h; - p_ptr->dis_to_d[i-INVEN_RIGHT] += bonus_to_d; + p_ptr->dis_to_h[i-INVEN_RIGHT] += (s16b)bonus_to_h; + p_ptr->dis_to_d[i-INVEN_RIGHT] += (s16b)bonus_to_d; } } else if (p_ptr->migite && p_ptr->hidarite) @@ -4422,14 +4271,14 @@ void calc_bonuses(void) else { /* Apply the bonuses to hit/damage */ - p_ptr->to_h[default_hand] += bonus_to_h; - p_ptr->to_d[default_hand] += bonus_to_d; + p_ptr->to_h[default_hand] += (s16b)bonus_to_h; + p_ptr->to_d[default_hand] += (s16b)bonus_to_d; /* Apply the mental bonuses to hit/damage, if known */ if (object_is_known(o_ptr)) { - p_ptr->dis_to_h[default_hand] += bonus_to_h; - p_ptr->dis_to_d[default_hand] += bonus_to_d; + p_ptr->dis_to_h[default_hand] += (s16b)bonus_to_h; + p_ptr->dis_to_d[default_hand] += (s16b)bonus_to_d; } } } @@ -4522,7 +4371,7 @@ void calc_bonuses(void) /* Hex bonuses */ if (p_ptr->realm1 == REALM_HEX) { - if (hex_spelling_any()) p_ptr->skill_stl -= (1 + p_ptr->magic_num2[0]); + if (hex_spelling_any()) p_ptr->skill_stl -= (1 + CASTING_HEX_NUM(p_ptr)); if (hex_spelling(HEX_DETECT_EVIL)) p_ptr->esp_evil = TRUE; if (hex_spelling(HEX_XTRA_MIGHT)) p_ptr->stat_add[A_STR] += 4; if (hex_spelling(HEX_BUILDING)) @@ -4549,7 +4398,7 @@ void calc_bonuses(void) } for (i = INVEN_RARM; i <= INVEN_FEET; i++) { - int ac = 0; + ARMOUR_CLASS ac = 0; o_ptr = &inventory[i]; if (!o_ptr->k_idx) continue; if (!object_is_armour(o_ptr)) continue; @@ -4557,8 +4406,8 @@ void calc_bonuses(void) ac += 5; if (o_ptr->curse_flags & TRC_HEAVY_CURSE) ac += 7; if (o_ptr->curse_flags & TRC_PERMA_CURSE) ac += 13; - p_ptr->to_a += ac; - p_ptr->dis_to_a += ac; + p_ptr->to_a += (s16b)ac; + p_ptr->dis_to_a += (s16b)ac; } } @@ -4574,12 +4423,11 @@ void calc_bonuses(void) if (p_ptr->stat_top[i] != top) { /* Save the new value */ - p_ptr->stat_top[i] = top; + p_ptr->stat_top[i] = (s16b)top; /* Redisplay the stats later */ p_ptr->redraw |= (PR_STATS); - /* Window stuff */ p_ptr->window |= (PW_PLAYER); } @@ -4600,12 +4448,11 @@ void calc_bonuses(void) if (p_ptr->stat_use[i] != use) { /* Save the new value */ - p_ptr->stat_use[i] = use; + p_ptr->stat_use[i] = (s16b)use; /* Redisplay the stats later */ p_ptr->redraw |= (PR_STATS); - /* Window stuff */ p_ptr->window |= (PW_PLAYER); } @@ -4623,7 +4470,7 @@ void calc_bonuses(void) if (p_ptr->stat_ind[i] != ind) { /* Save the new index */ - p_ptr->stat_ind[i] = ind; + p_ptr->stat_ind[i] = (s16b)ind; /* Change in CON affects Hitpoints */ if (i == A_CON) @@ -4658,7 +4505,6 @@ void calc_bonuses(void) } } - /* Window stuff */ p_ptr->window |= (PW_PLAYER); } } @@ -4915,10 +4761,10 @@ void calc_bonuses(void) } if (inventory[INVEN_RARM].tval == TV_POLEARM) penalty1 += 10; if (inventory[INVEN_LARM].tval == TV_POLEARM) penalty2 += 10; - p_ptr->to_h[0] -= penalty1; - p_ptr->to_h[1] -= penalty2; - p_ptr->dis_to_h[0] -= penalty1; - p_ptr->dis_to_h[1] -= penalty2; + p_ptr->to_h[0] -= (s16b)penalty1; + p_ptr->to_h[1] -= (s16b)penalty2; + p_ptr->dis_to_h[0] -= (s16b)penalty1; + p_ptr->dis_to_h[1] -= (s16b)penalty2; } /* Extract the current weight (in tenth pounds) */ @@ -4933,7 +4779,7 @@ void calc_bonuses(void) { monster_type *riding_m_ptr = &m_list[p_ptr->riding]; monster_race *riding_r_ptr = &r_info[riding_m_ptr->r_idx]; - int speed = riding_m_ptr->mspeed; + SPEED speed = riding_m_ptr->mspeed; if (riding_m_ptr->mspeed > 110) { @@ -4959,7 +4805,7 @@ void calc_bonuses(void) i = 1500 + riding_r_ptr->level * 25; } - /* XXX XXX XXX Apply "encumbrance" from weight */ + /* Apply "encumbrance" from weight */ if (j > i) new_speed -= ((j - i) / (i / 5)); /* Searching slows the player down */ @@ -5010,7 +4856,7 @@ void calc_bonuses(void) /* Compute "extra shots" if needed */ if (o_ptr->k_idx) { - p_ptr->tval_ammo = bow_tval_ammo(o_ptr); + p_ptr->tval_ammo = (byte_hack)bow_tval_ammo(o_ptr); /* Apply special flags */ if (o_ptr->k_idx && !p_ptr->heavy_shoot) @@ -5028,8 +4874,7 @@ void calc_bonuses(void) } } - if (p_ptr->ryoute) - hold *= 2; + if (p_ptr->ryoute) hold *= 2; for(i = 0 ; i < 2 ; i++) { @@ -5043,7 +4888,11 @@ void calc_bonuses(void) p_ptr->icky_wield[i] = FALSE; p_ptr->riding_wield[i] = FALSE; - if (!buki_motteruka(INVEN_RARM+i)) {p_ptr->num_blow[i]=1;continue;} + if (!buki_motteruka(INVEN_RARM+i)) + { + p_ptr->num_blow[i] = 1; + continue; + } /* It is hard to hold a heavy weapon */ if (hold < o_ptr->weight / 10) { @@ -5188,10 +5037,10 @@ void calc_bonuses(void) p_ptr->num_blow[i] = blows_table[str_index][dex_index]; /* Maximal value */ - if (p_ptr->num_blow[i] > num) p_ptr->num_blow[i] = num; + if (p_ptr->num_blow[i] > num) p_ptr->num_blow[i] = (s16b)num; /* Add in the "bonus blows" */ - p_ptr->num_blow[i] += extra_blows[i]; + p_ptr->num_blow[i] += (s16b)extra_blows[i]; if (p_ptr->pclass == CLASS_WARRIOR) p_ptr->num_blow[i] += (p_ptr->lev / 40); @@ -5307,8 +5156,8 @@ void calc_bonuses(void) penalty += 30; if (penalty < 30) penalty = 30; } - p_ptr->to_h[i] -= penalty; - p_ptr->dis_to_h[i] -= penalty; + p_ptr->to_h[i] -= (s16b)penalty; + p_ptr->dis_to_h[i] -= (s16b)penalty; /* Riding weapon */ p_ptr->riding_wield[i] = TRUE; @@ -5347,8 +5196,8 @@ void calc_bonuses(void) if (penalty < 30) penalty = 30; } if (p_ptr->tval_ammo == TV_BOLT) penalty *= 2; - p_ptr->to_h_b -= penalty; - p_ptr->dis_to_h_b -= penalty; + p_ptr->to_h_b -= (s16b)penalty; + p_ptr->dis_to_h_b -= (s16b)penalty; } /* Different calculation for monks with empty hands */ @@ -5364,10 +5213,10 @@ void calc_bonuses(void) if (blow_base > 31) p_ptr->num_blow[0]++; if (blow_base > 44) p_ptr->num_blow[0]++; if (blow_base > 58) p_ptr->num_blow[0]++; - if (p_ptr->magic_num1[0]) + if (P_PTR_KI) { - p_ptr->to_d[0] += (p_ptr->magic_num1[0]/5); - p_ptr->dis_to_d[0] += (p_ptr->magic_num1[0]/5); + p_ptr->to_d[0] += P_PTR_KI / 5; + p_ptr->dis_to_d[0] += P_PTR_KI / 5; } } else @@ -5448,8 +5297,8 @@ void calc_bonuses(void) { if (buki_motteruka(INVEN_RARM+i)) { - int tval = inventory[INVEN_RARM+i].tval - TV_WEAPON_BEGIN; - int sval = inventory[INVEN_RARM+i].sval; + OBJECT_TYPE_VALUE tval = inventory[INVEN_RARM+i].tval - TV_WEAPON_BEGIN; + OBJECT_SUBTYPE_VALUE sval = inventory[INVEN_RARM+i].sval; p_ptr->to_h[i] += (p_ptr->weapon_exp[tval][sval] - WEAPON_EXP_BEGINNER) / 200; p_ptr->dis_to_h[i] += (p_ptr->weapon_exp[tval][sval] - WEAPON_EXP_BEGINNER) / 200; @@ -5506,14 +5355,10 @@ void calc_bonuses(void) /* Redraw armor (if needed) */ if ((p_ptr->dis_ac != old_dis_ac) || (p_ptr->dis_to_a != old_dis_to_a)) { - /* Redraw */ p_ptr->redraw |= (PR_ARMOR); - - /* Window stuff */ p_ptr->window |= (PW_PLAYER); } - if (p_ptr->ryoute && !omoi) { int bonus_to_h=0, bonus_to_d=0; @@ -5645,33 +5490,17 @@ void calc_bonuses(void) /* Take note when "heavy bow" changes */ if (p_ptr->old_heavy_shoot != p_ptr->heavy_shoot) { - /* Message */ if (p_ptr->heavy_shoot) { -#ifdef JP - msg_print("¤³¤ó¤Ê½Å¤¤µÝ¤òÁõÈ÷¤·¤Æ¤¤¤ë¤Î¤ÏÂçÊѤÀ¡£"); -#else - msg_print("You have trouble wielding such a heavy bow."); -#endif - + msg_print(_("ãããªéãå¼ãè£ åãã¦ããã®ã¯å¤§å¤ã ã", "You have trouble wielding such a heavy bow.")); } else if (inventory[INVEN_BOW].k_idx) { -#ifdef JP - msg_print("¤³¤ÎµÝ¤Ê¤éÁõÈ÷¤·¤Æ¤¤¤Æ¤â¿É¤¯¤Ê¤¤¡£"); -#else - msg_print("You have no trouble wielding your bow."); -#endif - + msg_print(_("ãã®å¼ãªãè£ åãã¦ãã¦ãè¾ããªãã", "You have no trouble wielding your bow.")); } else { -#ifdef JP - msg_print("½Å¤¤µÝ¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤ÆÂΤ¬³Ú¤Ë¤Ê¤Ã¤¿¡£"); -#else - msg_print("You feel relieved to put down your heavy bow."); -#endif - + msg_print(_("éãå¼ãè£ åããã¯ããã¦ä½ã楽ã«ãªã£ãã", "You feel relieved to put down your heavy bow.")); } /* Save it */ @@ -5683,42 +5512,21 @@ void calc_bonuses(void) /* Take note when "heavy weapon" changes */ if (p_ptr->old_heavy_wield[i] != p_ptr->heavy_wield[i]) { - /* Message */ if (p_ptr->heavy_wield[i]) { -#ifdef JP - msg_print("¤³¤ó¤Ê½Å¤¤Éð´ï¤òÁõÈ÷¤·¤Æ¤¤¤ë¤Î¤ÏÂçÊѤÀ¡£"); -#else - msg_print("You have trouble wielding such a heavy weapon."); -#endif - + msg_print(_("ãããªéãæ¦å¨ãè£ åãã¦ããã®ã¯å¤§å¤ã ã", "You have trouble wielding such a heavy weapon.")); } else if (buki_motteruka(INVEN_RARM+i)) { -#ifdef JP - msg_print("¤³¤ì¤Ê¤éÁõÈ÷¤·¤Æ¤¤¤Æ¤â¿É¤¯¤Ê¤¤¡£"); -#else - msg_print("You have no trouble wielding your weapon."); -#endif - + msg_print(_("ãããªãè£ åãã¦ãã¦ãè¾ããªãã", "You have no trouble wielding your weapon.")); } else if (p_ptr->heavy_wield[1-i]) { -#ifdef JP - msg_print("¤Þ¤ÀÉð´ï¤¬½Å¤¤¡£"); -#else - msg_print("You have still trouble wielding a heavy weapon."); -#endif - + msg_print(_("ã¾ã æ¦å¨ãéãã", "You have still trouble wielding a heavy weapon.")); } else { -#ifdef JP - msg_print("½Å¤¤Éð´ï¤òÁõÈ÷¤«¤é¤Ï¤º¤·¤ÆÂΤ¬³Ú¤Ë¤Ê¤Ã¤¿¡£"); -#else - msg_print("You feel relieved to put down your heavy weapon."); -#endif - + msg_print(_("éãæ¦å¨ãè£ åããã¯ããã¦ä½ã楽ã«ãªã£ãã", "You feel relieved to put down your heavy weapon.")); } /* Save it */ @@ -5728,33 +5536,17 @@ void calc_bonuses(void) /* Take note when "heavy weapon" changes */ if (p_ptr->old_riding_wield[i] != p_ptr->riding_wield[i]) { - /* Message */ if (p_ptr->riding_wield[i]) { -#ifdef JP - msg_print("¤³¤ÎÉð´ï¤Ï¾èÇÏÃæ¤Ë»È¤¦¤Ë¤Ï¤à¤«¤Ê¤¤¤è¤¦¤À¡£"); -#else - msg_print("This weapon is not suitable for use while riding."); -#endif - + msg_print(_("ãã®æ¦å¨ã¯ä¹é¦¬ä¸ã«ä½¿ãã«ã¯ãããªãããã ã", "This weapon is not suitable for use while riding.")); } else if (!p_ptr->riding) { -#ifdef JP - msg_print("¤³¤ÎÉð´ï¤ÏÅÌÊâ¤Ç»È¤¤¤ä¤¹¤¤¡£"); -#else - msg_print("This weapon was not suitable for use while riding."); -#endif - + msg_print(_("ãã®æ¦å¨ã¯å¾æ©ã§ä½¿ããããã", "This weapon was not suitable for use while riding.")); } else if (buki_motteruka(INVEN_RARM+i)) { -#ifdef JP - msg_print("¤³¤ì¤Ê¤é¾èÇÏÃæ¤Ë¤Ô¤Ã¤¿¤ê¤À¡£"); -#else - msg_print("This weapon is suitable for use while riding."); -#endif - + msg_print(_("ãããªãä¹é¦¬ä¸ã«ã´ã£ããã ã", "This weapon is suitable for use while riding.")); } /* Save it */ p_ptr->old_riding_wield[i] = p_ptr->riding_wield[i]; @@ -5763,36 +5555,21 @@ void calc_bonuses(void) /* Take note when "illegal weapon" changes */ if (p_ptr->old_icky_wield[i] != p_ptr->icky_wield[i]) { - /* Message */ if (p_ptr->icky_wield[i]) { -#ifdef JP - msg_print("º£¤ÎÁõÈ÷¤Ï¤É¤¦¤â¼«Ê¬¤Ë¤Õ¤µ¤ï¤·¤¯¤Ê¤¤µ¤¤¬¤¹¤ë¡£"); -#else - msg_print("You do not feel comfortable with your weapon."); -#endif - if (hack_mind) + msg_print(_("ä»ã®è£ åã¯ã©ããèªåã«ãµãããããªãæ°ãããã", "You do not feel comfortable with your weapon.")); + if (is_loading_now) { chg_virtue(V_FAITH, -1); } } else if (buki_motteruka(INVEN_RARM+i)) { -#ifdef JP - msg_print("º£¤ÎÁõÈ÷¤Ï¼«Ê¬¤Ë¤Õ¤µ¤ï¤·¤¤µ¤¤¬¤¹¤ë¡£"); -#else - msg_print("You feel comfortable with your weapon."); -#endif - + msg_print(_("ä»ã®è£ åã¯èªåã«ãµããããæ°ãããã", "You feel comfortable with your weapon.")); } else { -#ifdef JP - msg_print("ÁõÈ÷¤ò¤Ï¤º¤·¤¿¤é¿ïʬ¤Èµ¤¤¬³Ú¤Ë¤Ê¤Ã¤¿¡£"); -#else - msg_print("You feel more comfortable after removing your weapon."); -#endif - + msg_print(_("è£ åãã¯ããããéåã¨æ°ã楽ã«ãªã£ãã", "You feel more comfortable after removing your weapon.")); } /* Save it */ @@ -5802,11 +5579,10 @@ void calc_bonuses(void) if (p_ptr->riding && (p_ptr->old_riding_ryoute != p_ptr->riding_ryoute)) { - /* Message */ if (p_ptr->riding_ryoute) { #ifdef JP - msg_format("%sÇϤòÁà¤ì¤Ê¤¤¡£", (empty_hands(FALSE) == EMPTY_HAND_NONE) ? "ξ¼ê¤¬¤Õ¤µ¤¬¤Ã¤Æ¤¤¤Æ" : ""); + msg_format("%s馬ãæããªãã", (empty_hands(FALSE) == EMPTY_HAND_NONE) ? "両æããµããã£ã¦ãã¦" : ""); #else msg_print("You are using both hand for fighting, and you can't control a riding pet."); #endif @@ -5814,7 +5590,7 @@ void calc_bonuses(void) else { #ifdef JP - msg_format("%sÇϤòÁà¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£", (empty_hands(FALSE) == EMPTY_HAND_NONE) ? "¼ê¤¬¶õ¤¤¤Æ" : ""); + msg_format("%s馬ãæããããã«ãªã£ãã", (empty_hands(FALSE) == EMPTY_HAND_NONE) ? "æã空ãã¦" : ""); #else msg_print("You began to control riding pet with one hand."); #endif @@ -5827,24 +5603,17 @@ void calc_bonuses(void) { if (heavy_armor()) { -#ifdef JP -msg_print("ÁõÈ÷¤¬½Å¤¯¤Æ¥Ð¥é¥ó¥¹¤ò¼è¤ì¤Ê¤¤¡£"); -#else - msg_print("The weight of your armor disrupts your balance."); -#endif - - if (hack_mind) + msg_print(_("è£ åãéãã¦ãã©ã³ã¹ãåããªãã", "The weight of your armor disrupts your balance.")); + if (is_loading_now) { chg_virtue(V_HARMONY, -1); } } else -#ifdef JP -msg_print("¥Ð¥é¥ó¥¹¤¬¤È¤ì¤ë¤è¤¦¤Ë¤Ê¤Ã¤¿¡£"); -#else - msg_print("You regain your balance."); -#endif - + { + msg_print(_("ãã©ã³ã¹ãã¨ããããã«ãªã£ãã", "You regain your balance.")); + } + monk_notify_aux = monk_armour_aux; } @@ -5857,11 +5626,9 @@ msg_print(" if ((inventory[i].tval == TV_NATURE_BOOK) && (inventory[i].sval == 2)) have_sw = TRUE; if ((inventory[i].tval == TV_CRAFT_BOOK) && (inventory[i].sval == 2)) have_kabe = TRUE; } - for (this_o_idx = cave[py][px].o_idx; this_o_idx; this_o_idx = next_o_idx) - { - object_type *o_ptr; - /* Acquire object */ + for (this_o_idx = cave[p_ptr->y][p_ptr->x].o_idx; this_o_idx; this_o_idx = next_o_idx) + { o_ptr = &o_list[this_o_idx]; /* Acquire next object */ @@ -5903,170 +5670,21 @@ msg_print(" } - -/* - * Handle "p_ptr->notice" - */ -void notice_stuff(void) -{ - /* Notice stuff */ - if (!p_ptr->notice) return; - - - /* Actually do auto-destroy */ - if (p_ptr->notice & (PN_AUTODESTROY)) - { - p_ptr->notice &= ~(PN_AUTODESTROY); - autopick_delayed_alter(); - } - - /* Combine the pack */ - if (p_ptr->notice & (PN_COMBINE)) - { - p_ptr->notice &= ~(PN_COMBINE); - combine_pack(); - } - - /* Reorder the pack */ - if (p_ptr->notice & (PN_REORDER)) - { - p_ptr->notice &= ~(PN_REORDER); - reorder_pack(); - } -} - - -/* - * Handle "p_ptr->update" +/*! + * @brief p_ptr->redraw ã®ãã©ã°ã«å¿ããæ´æ°ãã¾ã¨ãã¦è¡ã / Handle "p_ptr->redraw" + * @return ãªã + * @details æ´æ°å¦çã®å¯¾è±¡ã¯ã²ã¼ã ä¸ã®å ¨æç»å¦ç */ -void update_stuff(void) +static void redraw_stuff(void) { - /* Update stuff */ - if (!p_ptr->update) return; - - - if (p_ptr->update & (PU_BONUS)) - { - p_ptr->update &= ~(PU_BONUS); - calc_bonuses(); - } - - if (p_ptr->update & (PU_TORCH)) - { - p_ptr->update &= ~(PU_TORCH); - calc_torch(); - } - - if (p_ptr->update & (PU_HP)) - { - p_ptr->update &= ~(PU_HP); - calc_hitpoints(); - } - - if (p_ptr->update & (PU_MANA)) - { - p_ptr->update &= ~(PU_MANA); - calc_mana(); - } - - if (p_ptr->update & (PU_SPELLS)) - { - p_ptr->update &= ~(PU_SPELLS); - calc_spells(); - } - - - /* Character is not ready yet, no screen updates */ - if (!character_generated) return; - - - /* Character is in "icky" mode, no screen updates */ - if (character_icky) return; - - - if (p_ptr->update & (PU_UN_LITE)) - { - p_ptr->update &= ~(PU_UN_LITE); - forget_lite(); - } - - if (p_ptr->update & (PU_UN_VIEW)) - { - p_ptr->update &= ~(PU_UN_VIEW); - forget_view(); - } - - if (p_ptr->update & (PU_VIEW)) - { - p_ptr->update &= ~(PU_VIEW); - update_view(); - } - - if (p_ptr->update & (PU_LITE)) - { - p_ptr->update &= ~(PU_LITE); - update_lite(); - } - - - if (p_ptr->update & (PU_FLOW)) - { - p_ptr->update &= ~(PU_FLOW); - update_flow(); - } - - if (p_ptr->update & (PU_DISTANCE)) - { - p_ptr->update &= ~(PU_DISTANCE); - - /* Still need to call update_monsters(FALSE) after update_mon_lite() */ - /* p_ptr->update &= ~(PU_MONSTERS); */ - - update_monsters(TRUE); - } - - if (p_ptr->update & (PU_MON_LITE)) - { - p_ptr->update &= ~(PU_MON_LITE); - update_mon_lite(); - } - - /* - * Mega-Hack -- Delayed visual update - * Only used if update_view(), update_lite() or update_mon_lite() was called - */ - if (p_ptr->update & (PU_DELAY_VIS)) - { - p_ptr->update &= ~(PU_DELAY_VIS); - delayed_visual_update(); - } - - if (p_ptr->update & (PU_MONSTERS)) - { - p_ptr->update &= ~(PU_MONSTERS); - update_monsters(FALSE); - } -} - - -/* - * Handle "p_ptr->redraw" - */ -void redraw_stuff(void) -{ - /* Redraw stuff */ if (!p_ptr->redraw) return; - /* Character is not ready yet, no screen updates */ if (!character_generated) return; - /* Character is in "icky" mode, no screen updates */ if (character_icky) return; - - /* Hack -- clear the screen */ if (p_ptr->redraw & (PR_WIPE)) { @@ -6075,14 +5693,12 @@ void redraw_stuff(void) Term_clear(); } - if (p_ptr->redraw & (PR_MAP)) { p_ptr->redraw &= ~(PR_MAP); prt_map(); } - if (p_ptr->redraw & (PR_BASIC)) { p_ptr->redraw &= ~(PR_BASIC); @@ -6106,7 +5722,6 @@ void redraw_stuff(void) p_ptr->redraw &= ~(PR_MISC); prt_field(rp_ptr->title, ROW_RACE, COL_RACE); /* prt_field(cp_ptr->title, ROW_CLASS, COL_CLASS); */ - } if (p_ptr->redraw & (PR_TITLE)) @@ -6186,7 +5801,6 @@ void redraw_stuff(void) health_redraw(TRUE); } - if (p_ptr->redraw & (PR_EXTRA)) { p_ptr->redraw &= ~(PR_EXTRA); @@ -6241,16 +5855,15 @@ void redraw_stuff(void) } } - -/* - * Handle "p_ptr->window" +/*! + * @brief p_ptr->window ã®ãã©ã°ã«å¿ããæ´æ°ãã¾ã¨ãã¦è¡ã / Handle "p_ptr->window" + * @return ãªã + * @details æ´æ°å¦çã®å¯¾è±¡ã¯ãµãã¦ã£ã³ãã¦å ¨è¬ */ -void window_stuff(void) +static void window_stuff(void) { int j; - - u32b mask = 0L; - + BIT_FLAGS mask = 0L; /* Nothing to do */ if (!p_ptr->window) return; @@ -6268,7 +5881,6 @@ void window_stuff(void) /* Nothing to do */ if (!p_ptr->window) return; - /* Display inventory */ if (p_ptr->window & (PW_INVEN)) { @@ -6341,25 +5953,162 @@ void window_stuff(void) } -/* +/*! + * @brief å ¨æ´æ°å¦çããã§ãã¯ãã¦å¦çãã¦ãã * Handle "p_ptr->update" and "p_ptr->redraw" and "p_ptr->window" + * @return ãªã */ void handle_stuff(void) { - /* Update stuff */ - if (p_ptr->update) update_stuff(); - - /* Redraw stuff */ + if (p_ptr->update) update_creature(p_ptr); if (p_ptr->redraw) redraw_stuff(); + if (p_ptr->window) window_stuff(); +} - /* Window stuff */ +void update_output(void) +{ + if (p_ptr->redraw) redraw_stuff(); if (p_ptr->window) window_stuff(); } +/*! + * @brief p_ptr->update ã®ãã©ã°ã«å¿ããæ´æ°ãã¾ã¨ãã¦è¡ã / Handle "p_ptr->update" + * @return ãªã + * @details æ´æ°å¦çã®å¯¾è±¡ã¯ãã¬ã¤ã¤ã¼ã®è½åä¿®æ£/å æºå¯¿å½/HP/MP/éæ³ã®å¦ç¿ç¶æ ãä»å¤æ°ã®å¤çã®ç¶æ å¤å®ã + */ +void update_creature(player_type *creature_ptr) +{ + if (!creature_ptr->update) return; + + /* Actually do auto-destroy */ + if (creature_ptr->update & (PU_AUTODESTROY)) + { + creature_ptr->update &= ~(PU_AUTODESTROY); + autopick_delayed_alter(); + } + + /* Combine the pack */ + if (creature_ptr->update & (PU_COMBINE)) + { + creature_ptr->update &= ~(PU_COMBINE); + combine_pack(); + } + + /* Reorder the pack */ + if (creature_ptr->update & (PU_REORDER)) + { + creature_ptr->update &= ~(PU_REORDER); + reorder_pack(); + } + + if (creature_ptr->update & (PU_BONUS)) + { + creature_ptr->update &= ~(PU_BONUS); + calc_bonuses(); + } + + if (creature_ptr->update & (PU_TORCH)) + { + creature_ptr->update &= ~(PU_TORCH); + calc_torch(); + } + + if (creature_ptr->update & (PU_HP)) + { + creature_ptr->update &= ~(PU_HP); + calc_hitpoints(); + } + + if (creature_ptr->update & (PU_MANA)) + { + creature_ptr->update &= ~(PU_MANA); + calc_mana(); + } + + if (creature_ptr->update & (PU_SPELLS)) + { + creature_ptr->update &= ~(PU_SPELLS); + calc_spells(); + } + + /* Character is not ready yet, no screen updates */ + if (!character_generated) return; + + /* Character is in "icky" mode, no screen updates */ + if (character_icky) return; + + if (creature_ptr->update & (PU_UN_LITE)) + { + creature_ptr->update &= ~(PU_UN_LITE); + forget_lite(); + } + + if (creature_ptr->update & (PU_UN_VIEW)) + { + creature_ptr->update &= ~(PU_UN_VIEW); + forget_view(); + } + + if (creature_ptr->update & (PU_VIEW)) + { + creature_ptr->update &= ~(PU_VIEW); + update_view(); + } + + if (creature_ptr->update & (PU_LITE)) + { + creature_ptr->update &= ~(PU_LITE); + update_lite(); + } + + + if (creature_ptr->update & (PU_FLOW)) + { + creature_ptr->update &= ~(PU_FLOW); + update_flow(); + } + + if (creature_ptr->update & (PU_DISTANCE)) + { + creature_ptr->update &= ~(PU_DISTANCE); + + /* Still need to call update_monsters(FALSE) after update_mon_lite() */ + /* creature_ptr->update &= ~(PU_MONSTERS); */ -s16b empty_hands(bool riding_control) + update_monsters(TRUE); + } + + if (creature_ptr->update & (PU_MON_LITE)) + { + creature_ptr->update &= ~(PU_MON_LITE); + update_mon_lite(); + } + + /* + * Mega-Hack -- Delayed visual update + * Only used if update_view(), update_lite() or update_mon_lite() was called + */ + if (creature_ptr->update & (PU_DELAY_VIS)) + { + creature_ptr->update &= ~(PU_DELAY_VIS); + delayed_visual_update(); + } + + if (creature_ptr->update & (PU_MONSTERS)) + { + creature_ptr->update &= ~(PU_MONSTERS); + update_monsters(FALSE); + } +} + +/*! + * @brief ãã¬ã¤ã¤ã¼ã®ç¾å¨éãã¦ããæã®ç¶æ ãè¿ã + * @param riding_control ä¹é¦¬ä¸ã«ããçæãå¿ è¦ã¨ãã¦ããç¶æ ãªãã°TRUEãè¿ãã + * @return éãã¦ããæã®ããããã©ã° + */ +BIT_FLAGS16 empty_hands(bool riding_control) { - s16b status = EMPTY_HAND_NONE; + BIT_FLAGS16 status = EMPTY_HAND_NONE; if (!inventory[INVEN_RARM].k_idx) status |= EMPTY_HAND_RARM; if (!inventory[INVEN_LARM].k_idx) status |= EMPTY_HAND_LARM; @@ -6374,9 +6123,13 @@ s16b empty_hands(bool riding_control) } +/*! + * @brief ãã¬ã¤ã¤ã¼ãé²å ·ééå¶éã®ããè·æ¥æã«ããã«ãã£ãåããç¶æ ã«ãããã©ãããè¿ãã + * @return ããã«ãã£ãé©ç¨ããããªãã°TRUEã + */ bool heavy_armor(void) { - u16b monk_arm_wgt = 0; + WEIGHT monk_arm_wgt = 0; if ((p_ptr->pclass != CLASS_MONK) && (p_ptr->pclass != CLASS_FORCETRAINER) && (p_ptr->pclass != CLASS_NINJA)) return FALSE; @@ -6392,12 +6145,15 @@ bool heavy_armor(void) return (monk_arm_wgt > (100 + (p_ptr->lev * 4))); } +/*! + * @brief å®ã²ã¼ã ãã¬ã¤æéãæ´æ°ãã + */ void update_playtime(void) { /* Check if the game has started */ if (start_time != 0) { - u32b tmp = time(NULL); + u32b tmp = (u32b)time(NULL); playtime += (tmp - start_time); start_time = tmp; }