• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revision2a87b25ca516131e03ca5355a0962b648b0e8ca0 (tree)
Time2019-07-08 22:57:47
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #37353 mention_use() を整理.

Change Summary

Incremental Difference

--- a/src/player-inventory.c
+++ b/src/player-inventory.c
@@ -72,6 +72,49 @@ static INVENTORY_IDX label_to_inven(int c)
7272 return (i);
7373 }
7474
75+
76+/*!
77+ * @brief 所持/装備オブジェクトIDの部位表現を返す /
78+ * Return a string mentioning how a given item is carried
79+ * @param i 部位表現を求めるプレイヤーの所持/装備オブジェクトID
80+ * @return 部位表現の文字列ポインタ
81+ */
82+static concptr mention_use(int i)
83+{
84+ concptr p;
85+
86+ /* Examine the location */
87+ switch (i)
88+ {
89+#ifdef JP
90+ case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "運搬中" : ((p_ptr->ryoute && p_ptr->migite) ? " 両手" : (left_hander ? " 左手" : " 右手")); break;
91+#else
92+ case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "Just lifting" : (p_ptr->migite ? "Wielding" : "On arm"); break;
93+#endif
94+
95+#ifdef JP
96+ case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "運搬中" : ((p_ptr->ryoute && p_ptr->hidarite) ? " 両手" : (left_hander ? " 右手" : " 左手")); break;
97+#else
98+ case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "Just lifting" : (p_ptr->hidarite ? "Wielding" : "On arm"); break;
99+#endif
100+
101+ case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < p_ptr->inventory_list[i].weight / 10) ? _("運搬中", "Just holding") : _("射撃用", "Shooting"); break;
102+ case INVEN_RIGHT: p = (left_hander ? _("左手指", "On left hand") : _("右手指", "On right hand")); break;
103+ case INVEN_LEFT: p = (left_hander ? _("右手指", "On right hand") : _("左手指", "On left hand")); break;
104+ case INVEN_NECK: p = _(" 首", "Around neck"); break;
105+ case INVEN_LITE: p = _(" 光源", "Light source"); break;
106+ case INVEN_BODY: p = _(" 体", "On body"); break;
107+ case INVEN_OUTER: p = _("体の上", "About body"); break;
108+ case INVEN_HEAD: p = _(" 頭", "On head"); break;
109+ case INVEN_HANDS: p = _(" 手", "On hands"); break;
110+ case INVEN_FEET: p = _(" 足", "On feet"); break;
111+ default: p = _("ザック", "In pack"); break;
112+ }
113+
114+ /* Return the result */
115+ return p;
116+}
117+
75118 /*!
76119 * @brief 装備アイテム一覧を表示する /
77120 * Choice window "shadow" of the "show_equip()" function
@@ -3423,48 +3466,6 @@ COMMAND_CODE show_equip(int target_item, BIT_FLAGS mode, OBJECT_TYPE_VALUE tval)
34233466 return target_item_label;
34243467 }
34253468
3426-/*!
3427- * @brief 所持/装備オブジェクトIDの部位表現を返す /
3428- * Return a string mentioning how a given item is carried
3429- * @param i 部位表現を求めるプレイヤーの所持/装備オブジェクトID
3430- * @return 部位表現の文字列ポインタ
3431- */
3432-concptr mention_use(int i)
3433-{
3434- concptr p;
3435-
3436- /* Examine the location */
3437- switch (i)
3438- {
3439-#ifdef JP
3440- case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "運搬中" : ((p_ptr->ryoute && p_ptr->migite) ? " 両手" : (left_hander ? " 左手" : " 右手")); break;
3441-#else
3442- case INVEN_RARM: p = p_ptr->heavy_wield[0] ? "Just lifting" : (p_ptr->migite ? "Wielding" : "On arm"); break;
3443-#endif
3444-
3445-#ifdef JP
3446- case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "運搬中" : ((p_ptr->ryoute && p_ptr->hidarite) ? " 両手" : (left_hander ? " 右手" : " 左手")); break;
3447-#else
3448- case INVEN_LARM: p = p_ptr->heavy_wield[1] ? "Just lifting" : (p_ptr->hidarite ? "Wielding" : "On arm"); break;
3449-#endif
3450-
3451- case INVEN_BOW: p = (adj_str_hold[p_ptr->stat_ind[A_STR]] < p_ptr->inventory_list[i].weight / 10) ? _("運搬中", "Just holding") : _("射撃用", "Shooting"); break;
3452- case INVEN_RIGHT: p = (left_hander ? _("左手指", "On left hand") : _("右手指", "On right hand")); break;
3453- case INVEN_LEFT: p = (left_hander ? _("右手指", "On right hand") : _("左手指", "On left hand")); break;
3454- case INVEN_NECK: p = _(" 首", "Around neck"); break;
3455- case INVEN_LITE: p = _(" 光源", "Light source"); break;
3456- case INVEN_BODY: p = _(" 体", "On body"); break;
3457- case INVEN_OUTER: p = _("体の上", "About body"); break;
3458- case INVEN_HEAD: p = _(" 頭", "On head"); break;
3459- case INVEN_HANDS: p = _(" 手", "On hands"); break;
3460- case INVEN_FEET: p = _(" 足", "On feet"); break;
3461- default: p = _("ザック", "In pack"); break;
3462- }
3463-
3464- /* Return the result */
3465- return p;
3466-}
3467-
34683469
34693470 /*!
34703471 * @brief 所持/装備オブジェクトIDの現在の扱い方の状態表現を返す /
--- a/src/player-inventory.h
+++ b/src/player-inventory.h
@@ -4,5 +4,4 @@ extern bool select_ring_slot;
44
55 extern bool is_ring_slot(int i);
66 extern bool get_item_okay(OBJECT_IDX i);
7-extern concptr mention_use(int i);
87 extern concptr describe_use(int i);
\ No newline at end of file
Show on old repository browser