-/*!\r
+/*!\r
* @file cmd-eat.c\r
- * @brief \83v\83\8c\83C\83\84\81[\82Ì\90H\82×\82é\83R\83}\83\93\83h\8eÀ\91\95\r
+ * @brief プレイヤーの食べるコマンド実装\r
* @date 2018/09/07\r
* @details\r
- * cmd6.c\82æ\82è\95ª\97£\81B\r
+ * cmd6.cより分離。\r
*/\r
\r
\r
#include "angband.h"\r
+#include "object-hook.h"\r
+#include "avatar.h"\r
\r
/*!\r
- * @brief \90H\97¿\82ð\90H\82×\82é\83R\83}\83\93\83h\82Ì\83T\83u\83\8b\81[\83`\83\93\r
- * @param item \90H\82×\82é\83I\83u\83W\83F\83N\83g\82Ì\8f\8a\8e\9d\95iID\r
- * @return \82È\82µ\r
+ * @brief 食料を食べるコマンドのサブルーチン\r
+ * @param item 食べるオブジェクトの所持品ID\r
+ * @return なし\r
*/\r
-void do_cmd_eat_food_aux(int item)\r
+void do_cmd_eat_food_aux(INVENTORY_IDX item)\r
{\r
int ident, lev;\r
object_type *o_ptr;\r
o_ptr = &o_list[0 - item];\r
}\r
\r
- /* Sound */\r
sound(SOUND_EAT);\r
\r
- /* Take a turn */\r
p_ptr->energy_use = 100;\r
\r
/* Identity not known yet */\r
\r
case SV_FOOD_WEAKNESS:\r
{\r
- take_hit(DAMAGE_NOESCAPE, damroll(6, 6), _("\93Å\93ü\82è\90H\97¿", "poisonous food"), -1);\r
+ take_hit(DAMAGE_NOESCAPE, damroll(6, 6), _("毒入り食料", "poisonous food"), -1);\r
(void)do_dec_stat(A_STR);\r
ident = TRUE;\r
break;\r
\r
case SV_FOOD_SICKNESS:\r
{\r
- take_hit(DAMAGE_NOESCAPE, damroll(6, 6), _("\93Å\93ü\82è\90H\97¿", "poisonous food"), -1);\r
+ take_hit(DAMAGE_NOESCAPE, damroll(6, 6), _("毒入り食料", "poisonous food"), -1);\r
(void)do_dec_stat(A_CON);\r
ident = TRUE;\r
break;\r
\r
case SV_FOOD_STUPIDITY:\r
{\r
- take_hit(DAMAGE_NOESCAPE, damroll(8, 8), _("\93Å\93ü\82è\90H\97¿", "poisonous food"), -1);\r
+ take_hit(DAMAGE_NOESCAPE, damroll(8, 8), _("毒入り食料", "poisonous food"), -1);\r
(void)do_dec_stat(A_INT);\r
ident = TRUE;\r
break;\r
\r
case SV_FOOD_NAIVETY:\r
{\r
- take_hit(DAMAGE_NOESCAPE, damroll(8, 8), _("\93Å\93ü\82è\90H\97¿", "poisonous food"), -1);\r
+ take_hit(DAMAGE_NOESCAPE, damroll(8, 8), _("毒入り食料", "poisonous food"), -1);\r
(void)do_dec_stat(A_WIS);\r
ident = TRUE;\r
break;\r
\r
case SV_FOOD_UNHEALTH:\r
{\r
- take_hit(DAMAGE_NOESCAPE, damroll(10, 10), _("\93Å\93ü\82è\90H\97¿", "poisonous food"), -1);\r
+ take_hit(DAMAGE_NOESCAPE, damroll(10, 10), _("毒入り食料", "poisonous food"), -1);\r
(void)do_dec_stat(A_CON);\r
ident = TRUE;\r
break;\r
\r
case SV_FOOD_DISEASE:\r
{\r
- take_hit(DAMAGE_NOESCAPE, damroll(10, 10), _("\93Å\93ü\82è\90H\97¿", "poisonous food"), -1);\r
+ take_hit(DAMAGE_NOESCAPE, damroll(10, 10), _("毒入り食料", "poisonous food"), -1);\r
(void)do_dec_stat(A_STR);\r
ident = TRUE;\r
break;\r
\r
case SV_FOOD_CURE_SERIOUS:\r
{\r
- if (hp_player(damroll(4, 8))) ident = TRUE;\r
+ ident = cure_serious_wounds(4, 8);\r
break;\r
}\r
\r
\r
case SV_FOOD_RESTORING:\r
{\r
- if (do_res_stat(A_STR)) ident = TRUE;\r
- if (do_res_stat(A_INT)) ident = TRUE;\r
- if (do_res_stat(A_WIS)) ident = TRUE;\r
- if (do_res_stat(A_DEX)) ident = TRUE;\r
- if (do_res_stat(A_CON)) ident = TRUE;\r
- if (do_res_stat(A_CHR)) ident = TRUE;\r
+ ident = restore_all_status();\r
break;\r
}\r
\r
\r
#ifdef JP\r
- /* \82»\82ê\82¼\82ê\82Ì\90H\82×\95¨\82Ì\8a´\91z\82ð\83I\83\8a\83W\83i\83\8b\82æ\82è\8d×\82©\82\95\\8c» */\r
+ /* それぞれの食べ物の感想をオリジナルより細かく表現 */\r
case SV_FOOD_BISCUIT:\r
{\r
- msg_print("\8aÃ\82\82Ä\83T\83N\83T\83N\82µ\82Ä\82Æ\82Ä\82à\82¨\82¢\82µ\82¢\81B");\r
+ msg_print("甘くてサクサクしてとてもおいしい。");\r
ident = TRUE;\r
break;\r
}\r
\r
case SV_FOOD_JERKY:\r
{\r
- msg_print("\8e\95\82²\82½\82¦\82ª\82 \82Á\82Ä\82¨\82¢\82µ\82¢\81B");\r
+ msg_print("歯ごたえがあっておいしい。");\r
ident = TRUE;\r
break;\r
}\r
\r
case SV_FOOD_SLIME_MOLD:\r
{\r
- msg_print("\82±\82ê\82Í\82È\82ñ\82Æ\82à\8c`\97e\82µ\82ª\82½\82¢\96¡\82¾\81B");\r
+ msg_print("これはなんとも形容しがたい味だ。");\r
ident = TRUE;\r
break;\r
}\r
\r
case SV_FOOD_RATION:\r
{\r
- msg_print("\82±\82ê\82Í\82¨\82¢\82µ\82¢\81B");\r
+ msg_print("これはおいしい。");\r
ident = TRUE;\r
break;\r
}\r
\r
case SV_FOOD_WAYBREAD:\r
{\r
- msg_print(_("\82±\82ê\82Í\82Ð\82¶\82å\82¤\82É\94ü\96¡\82¾\81B", "That tastes good."));\r
+ msg_print(_("これはひじょうに美味だ。", "That tastes good."));\r
(void)set_poisoned(0);\r
(void)hp_player(damroll(4, 8));\r
ident = TRUE;\r
#ifdef JP\r
case SV_FOOD_PINT_OF_ALE:\r
{\r
- msg_print("\82Ì\82Ç\82²\82µ\91u\82â\82©\82¾\81B");\r
+ msg_print("のどごし爽やかだ。");\r
ident = TRUE;\r
break;\r
}\r
}\r
\r
/* Combine / Reorder the pack (later) */\r
- p_ptr->notice |= (PN_COMBINE | PN_REORDER);\r
+ p_ptr->update |= (PU_COMBINE | PU_REORDER);\r
\r
if (!(object_is_aware(o_ptr)))\r
{\r
gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);\r
}\r
\r
- /* Window stuff */\r
p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);\r
\r
\r
{\r
/* Reduced nutritional benefit */\r
(void)set_food(p_ptr->food + (o_ptr->pval / 10));\r
- msg_print(_("\82 \82È\82½\82Ì\82æ\82¤\82È\8eÒ\82É\82Æ\82Á\82Ä\90H\97Æ\82È\82Ç\8bÍ\82©\82È\89h\97{\82É\82µ\82©\82È\82ç\82È\82¢\81B",\r
+ msg_print(_("あなたのような者にとって食糧など僅かな栄養にしかならない。",\r
"Mere victuals hold scant sustenance for a being such as yourself."));\r
\r
if (p_ptr->food < PY_FOOD_ALERT) /* Hungry */\r
- msg_print(_("\82 \82È\82½\82Ì\8bQ\82¦\82Í\90V\91N\82È\8c\8c\82É\82æ\82Á\82Ä\82Ì\82Ý\96\9e\82½\82³\82ê\82é\81I",\r
+ msg_print(_("あなたの飢えは新鮮な血によってのみ満たされる!",\r
"Your hunger can only be satisfied with fresh blood!"));\r
}\r
else if ((prace_is_(RACE_SKELETON) ||\r
prace_is_(RACE_SPECTRE)) &&\r
(o_ptr->tval == TV_STAFF || o_ptr->tval == TV_WAND))\r
{\r
- cptr staff;\r
+ concptr staff;\r
\r
if (o_ptr->tval == TV_STAFF &&\r
(item < 0) && (o_ptr->number > 1))\r
{\r
- msg_print(_("\82Ü\82¸\82Í\8fñ\82ð\8fE\82í\82È\82¯\82ê\82Î\81B", "You must first pick up the staffs."));\r
+ msg_print(_("まずは杖を拾わなければ。", "You must first pick up the staffs."));\r
return;\r
}\r
- staff = (o_ptr->tval == TV_STAFF) ? _("\8fñ", "staff") : _("\96\82\96@\96_", "wand");\r
+ staff = (o_ptr->tval == TV_STAFF) ? _("杖", "staff") : _("魔法棒", "wand");\r
\r
/* "Eat" charges */\r
if (o_ptr->pval == 0)\r
{\r
- msg_format(_("\82±\82Ì%s\82É\82Í\82à\82¤\96\82\97Í\82ª\8ec\82Á\82Ä\82¢\82È\82¢\81B", "The %s has no charges left."), staff);\r
+ msg_format(_("この%sにはもう魔力が残っていない。", "The %s has no charges left."), staff);\r
o_ptr->ident |= (IDENT_EMPTY);\r
\r
/* Combine / Reorder the pack (later) */\r
- p_ptr->notice |= (PN_COMBINE | PN_REORDER);\r
+ p_ptr->update |= (PU_COMBINE | PU_REORDER);\r
p_ptr->window |= (PW_INVEN);\r
\r
return;\r
}\r
- msg_format(_("\82 \82È\82½\82Í%s\82Ì\96\82\97Í\82ð\83G\83l\83\8b\83M\81[\8c¹\82Æ\82µ\82Ä\8bz\8eû\82µ\82½\81B", "You absorb mana of the %s as your energy."), staff);\r
+ msg_format(_("あなたは%sの魔力をエネルギー源として吸収した。", "You absorb mana of the %s as your energy."), staff);\r
\r
/* Use a single charge */\r
o_ptr->pval--;\r
{\r
object_type forge;\r
object_type *q_ptr;\r
-\r
- /* Get local object */\r
q_ptr = &forge;\r
\r
/* Obtain a local object */\r
p_ptr->total_weight -= q_ptr->weight;\r
item = inven_carry(q_ptr);\r
\r
- /* Message */\r
- msg_format(_("\8fñ\82ð\82Ü\82Æ\82ß\82È\82¨\82µ\82½\81B", "You unstack your staff."));\r
+ msg_format(_("杖をまとめなおした。", "You unstack your staff."));\r
}\r
\r
/* Describe charges in the pack */\r
floor_item_charges(0 - item);\r
}\r
\r
- /* Window stuff */\r
p_ptr->window |= (PW_INVEN | PW_EQUIP);\r
\r
/* Don't eat a staff/wand itself */\r
my_strchr("pht", r_info[o_ptr->pval].d_char)))\r
{\r
/* Drain vitality of humanoids */\r
- char o_name[MAX_NLEN];\r
+ GAME_TEXT o_name[MAX_NLEN];\r
object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));\r
- msg_format(_("%s\82Í\94R\82¦\8fã\82è\8aD\82É\82È\82Á\82½\81B\90¸\97Í\82ð\8bz\8eû\82µ\82½\8bC\82ª\82·\82é\81B", "%^s is burnt to ashes. You absorb its vitality!"), o_name);\r
+ msg_format(_("%sは燃え上り灰になった。精力を吸収した気がする。", "%^s is burnt to ashes. You absorb its vitality!"), o_name);\r
(void)set_food(PY_FOOD_MAX - 1);\r
}\r
else if (prace_is_(RACE_SKELETON))\r
if (o_ptr->tval == TV_SKELETON ||\r
(o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))\r
{\r
- msg_print(_("\82 \82È\82½\82Í\8d\9c\82Å\8e©\95ª\82Ì\91Ì\82ð\95â\82Á\82½\81B", "Your body absorbs the bone."));\r
+ msg_print(_("あなたは骨で自分の体を補った。", "Your body absorbs the bone."));\r
set_food(p_ptr->food + 5000);\r
}\r
else\r
object_type forge;\r
object_type *q_ptr = &forge;\r
\r
- msg_print(_("\90H\82×\95¨\82ª\83A\83S\82ð\91f\92Ê\82è\82µ\82Ä\97\8e\82¿\82½\81I", "The food falls through your jaws!"));\r
-\r
- /* Create the item */\r
+ msg_print(_("食べ物がアゴを素通りして落ちた!", "The food falls through your jaws!"));\r
object_prep(q_ptr, lookup_kind(o_ptr->tval, o_ptr->sval));\r
\r
/* Drop the object from heaven */\r
}\r
else\r
{\r
- msg_print(_("\90H\82×\95¨\82ª\83A\83S\82ð\91f\92Ê\82è\82µ\82Ä\97\8e\82¿\81A\8fÁ\82¦\82½\81I", "The food falls through your jaws and vanishes!"));\r
+ msg_print(_("食べ物がアゴを素通りして落ち、消えた!", "The food falls through your jaws and vanishes!"));\r
}\r
}\r
else if (prace_is_(RACE_GOLEM) ||\r
prace_is_(RACE_SPECTRE) ||\r
(mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))\r
{\r
- msg_print(_("\90¶\8eÒ\82Ì\90H\95¨\82Í\82 \82È\82½\82É\82Æ\82Á\82Ä\82Ù\82Æ\82ñ\82Ç\89h\97{\82É\82È\82ç\82È\82¢\81B", "The food of mortals is poor sustenance for you."));\r
+ msg_print(_("生者の食物はあなたにとってほとんど栄養にならない。", "The food of mortals is poor sustenance for you."));\r
set_food(p_ptr->food + ((o_ptr->pval) / 20));\r
}\r
else if (o_ptr->tval == TV_FOOD && o_ptr->sval == SV_FOOD_WAYBREAD)\r
\r
\r
/*!\r
- * @brief \83I\83u\83W\83F\83N\83g\82ð\83v\83\8c\83C\83\84\81[\82ª\90H\82×\82é\82±\82Æ\82ª\82Å\82«\82é\82©\82ð\94»\92è\82·\82é /\r
- * Hook to determine if an object is eatable\r
- * @param o_ptr \94»\92è\82µ\82½\82¢\83I\83u\83W\83F\83N\83g\82Ì\8d\\91¢\91Ì\8eQ\8fÆ\83|\83C\83\93\83^\r
- * @return \90H\82×\82é\82±\82Æ\82ª\89Â\94\\82È\82ç\82ÎTRUE\82ð\95Ô\82·\r
- */\r
-static bool item_tester_hook_eatable(object_type *o_ptr)\r
-{\r
- if (o_ptr->tval == TV_FOOD) return TRUE;\r
-\r
-#if 0\r
- if (prace_is_(RACE_SKELETON))\r
- {\r
- if (o_ptr->tval == TV_SKELETON ||\r
- (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))\r
- return TRUE;\r
- }\r
- else\r
-#endif\r
-\r
- if (prace_is_(RACE_SKELETON) ||\r
- prace_is_(RACE_GOLEM) ||\r
- prace_is_(RACE_ZOMBIE) ||\r
- prace_is_(RACE_SPECTRE))\r
- {\r
- if (o_ptr->tval == TV_STAFF || o_ptr->tval == TV_WAND)\r
- return TRUE;\r
- }\r
- else if (prace_is_(RACE_DEMON) ||\r
- (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON))\r
- {\r
- if (o_ptr->tval == TV_CORPSE &&\r
- o_ptr->sval == SV_CORPSE &&\r
- my_strchr("pht", r_info[o_ptr->pval].d_char))\r
- return TRUE;\r
- }\r
-\r
- /* Assume not */\r
- return (FALSE);\r
-}\r
-\r
-\r
-/*!\r
- * @brief \90H\97¿\82ð\90H\82×\82é\83R\83}\83\93\83h\82Ì\83\81\83C\83\93\83\8b\81[\83`\83\93 /\r
+ * @brief 食料を食べるコマンドのメインルーチン /\r
* Eat some food (from the pack or floor)\r
- * @return \82È\82µ\r
+ * @return なし\r
*/\r
void do_cmd_eat_food(void)\r
{\r
OBJECT_IDX item;\r
- cptr q, s;\r
-\r
+ concptr q, s;\r
\r
if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))\r
{\r
/* Restrict choices to food */\r
item_tester_hook = item_tester_hook_eatable;\r
\r
- /* Get an item */\r
- q = _("\82Ç\82ê\82ð\90H\82×\82Ü\82·\82©? ", "Eat which item? ");\r
- s = _("\90H\82×\95¨\82ª\82È\82¢\81B", "You have nothing to eat.");\r
+ q = _("どれを食べますか? ", "Eat which item? ");\r
+ s = _("食べ物がない。", "You have nothing to eat.");\r
\r
- if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;\r
+ if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR))) return;\r
\r
/* Eat the object */\r
do_cmd_eat_food_aux(item);\r