3 * @brief プレイヤーの飲むコマンド実装
\r
10 #include "selfinfo.h"
\r
11 #include "object-hook.h"
\r
12 #include "mutation.h"
\r
16 * @brief 薬を飲むコマンドのサブルーチン /
\r
17 * Quaff a potion (from the pack or the floor)
\r
18 * @param item 飲む薬オブジェクトの所持品ID
\r
21 void do_cmd_quaff_potion_aux(INVENTORY_IDX item)
\r
32 if (flush_failure) flush();
\r
33 msg_print(_("瓶から水が流れ出てこない!", "The potion doesn't flow out from a bottle."));
\r
39 if (music_singing_any()) stop_singing();
\r
40 if (hex_spelling_any())
\r
42 if (!hex_spelling(HEX_INHAIL)) stop_hex_spell_all();
\r
45 /* Get the item (in the pack) */
\r
48 o_ptr = &inventory[item];
\r
51 /* Get the item (on the floor) */
\r
54 o_ptr = &o_list[0 - item];
\r
58 /* Obtain a local object */
\r
59 object_copy(q_ptr, o_ptr);
\r
64 /* Reduce and describe inventory */
\r
67 inven_item_increase(item, -1);
\r
68 inven_item_describe(item);
\r
69 inven_item_optimize(item);
\r
72 /* Reduce and describe floor item */
\r
75 floor_item_increase(0 - item, -1);
\r
76 floor_item_describe(0 - item);
\r
77 floor_item_optimize(0 - item);
\r
83 /* Not identified yet */
\r
87 lev = k_info[q_ptr->k_idx].level;
\r
89 /* Analyze the potion */
\r
90 if (q_ptr->tval == TV_POTION)
\r
92 switch (q_ptr->sval)
\r
94 /* 飲みごたえをオリジナルより細かく表現 */
\r
95 case SV_POTION_WATER:
\r
96 msg_print(_("口の中がさっぱりした。", ""));
\r
97 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
\r
101 case SV_POTION_APPLE_JUICE:
\r
102 msg_print(_("甘くてサッパリとしていて、とてもおいしい。", ""));
\r
103 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
\r
107 case SV_POTION_SLIME_MOLD:
\r
108 msg_print(_("なんとも不気味な味だ。", ""));
\r
109 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
\r
113 case SV_POTION_SLOWNESS:
\r
114 if (set_slow(randint1(25) + 15, FALSE)) ident = TRUE;
\r
117 case SV_POTION_SALT_WATER:
\r
118 msg_print(_("うぇ!思わず吐いてしまった。", "The potion makes you vomit!"));
\r
120 if (!(prace_is_(RACE_GOLEM) ||
\r
121 prace_is_(RACE_ZOMBIE) ||
\r
122 prace_is_(RACE_DEMON) ||
\r
123 prace_is_(RACE_ANDROID) ||
\r
124 prace_is_(RACE_SPECTRE) ||
\r
125 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING)))
\r
127 /* Only living creatures get thirsty */
\r
128 (void)set_food(PY_FOOD_STARVE - 1);
\r
131 (void)set_poisoned(0);
\r
132 (void)set_paralyzed(p_ptr->paralyzed + 4);
\r
136 case SV_POTION_POISON:
\r
137 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
\r
139 if (set_poisoned(p_ptr->poisoned + randint0(15) + 10))
\r
146 case SV_POTION_BLINDNESS:
\r
147 if (!p_ptr->resist_blind)
\r
149 if (set_blind(p_ptr->blind + randint0(100) + 100))
\r
156 case SV_POTION_BOOZE:
\r
157 ident = booze(p_ptr);
\r
160 case SV_POTION_SLEEP:
\r
161 if (!p_ptr->free_act)
\r
163 msg_print(_("あなたは眠ってしまった。", "You fall asleep."));
\r
165 if (ironman_nightmare)
\r
167 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
\r
169 /* Have some nightmares */
\r
170 sanity_blast(NULL, FALSE);
\r
172 if (set_paralyzed(p_ptr->paralyzed + randint0(4) + 4))
\r
179 case SV_POTION_LOSE_MEMORIES:
\r
180 if (!p_ptr->hold_exp && (p_ptr->exp > 0))
\r
182 msg_print(_("過去の記憶が薄れていく気がする。", "You feel your memories fade."));
\r
183 chg_virtue(V_KNOWLEDGE, -5);
\r
185 lose_exp(p_ptr->exp / 4);
\r
190 case SV_POTION_RUINATION:
\r
191 msg_print(_("身も心も弱ってきて、精気が抜けていくようだ。", "Your nerves and muscles feel weak and lifeless!"));
\r
192 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), _("破滅の薬", "a potion of Ruination"), -1);
\r
194 (void)dec_stat(A_DEX, 25, TRUE);
\r
195 (void)dec_stat(A_WIS, 25, TRUE);
\r
196 (void)dec_stat(A_CON, 25, TRUE);
\r
197 (void)dec_stat(A_STR, 25, TRUE);
\r
198 (void)dec_stat(A_CHR, 25, TRUE);
\r
199 (void)dec_stat(A_INT, 25, TRUE);
\r
203 case SV_POTION_DEC_STR:
\r
204 if (do_dec_stat(A_STR)) ident = TRUE;
\r
207 case SV_POTION_DEC_INT:
\r
208 if (do_dec_stat(A_INT)) ident = TRUE;
\r
211 case SV_POTION_DEC_WIS:
\r
212 if (do_dec_stat(A_WIS)) ident = TRUE;
\r
215 case SV_POTION_DEC_DEX:
\r
216 if (do_dec_stat(A_DEX)) ident = TRUE;
\r
219 case SV_POTION_DEC_CON:
\r
220 if (do_dec_stat(A_CON)) ident = TRUE;
\r
223 case SV_POTION_DEC_CHR:
\r
224 if (do_dec_stat(A_CHR)) ident = TRUE;
\r
227 case SV_POTION_DETONATIONS:
\r
228 ident = detonation(p_ptr);
\r
231 case SV_POTION_DEATH:
\r
232 chg_virtue(V_VITALITY, -1);
\r
233 chg_virtue(V_UNLIFE, 5);
\r
234 msg_print(_("死の予感が体中を駆けめぐった。", "A feeling of Death flows through your body."));
\r
235 take_hit(DAMAGE_LOSELIFE, 5000, _("死の薬", "a potion of Death"), -1);
\r
239 case SV_POTION_INFRAVISION:
\r
240 if (set_tim_infra(p_ptr->tim_infra + 100 + randint1(100), FALSE))
\r
246 case SV_POTION_DETECT_INVIS:
\r
247 if (set_tim_invis(p_ptr->tim_invis + 12 + randint1(12), FALSE))
\r
253 case SV_POTION_SLOW_POISON:
\r
254 if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
\r
257 case SV_POTION_CURE_POISON:
\r
258 if (set_poisoned(0)) ident = TRUE;
\r
261 case SV_POTION_BOLDNESS:
\r
262 if (set_afraid(0)) ident = TRUE;
\r
265 case SV_POTION_SPEED:
\r
268 if (set_fast(randint1(25) + 15, FALSE)) ident = TRUE;
\r
272 (void)set_fast(p_ptr->fast + 5, FALSE);
\r
276 case SV_POTION_RESIST_HEAT:
\r
277 if (set_oppose_fire(p_ptr->oppose_fire + randint1(10) + 10, FALSE))
\r
283 case SV_POTION_RESIST_COLD:
\r
284 if (set_oppose_cold(p_ptr->oppose_cold + randint1(10) + 10, FALSE))
\r
290 case SV_POTION_HEROISM:
\r
291 ident = heroism(25);
\r
294 case SV_POTION_BESERK_STRENGTH:
\r
295 ident = berserk(randint1(25) + 25);
\r
298 case SV_POTION_CURE_LIGHT:
\r
299 ident = cure_light_wounds(2, 8);
\r
302 case SV_POTION_CURE_SERIOUS:
\r
303 ident = cure_serious_wounds(4, 8);
\r
306 case SV_POTION_CURE_CRITICAL:
\r
307 ident = cure_critical_wounds(damroll(6, 8));
\r
310 case SV_POTION_HEALING:
\r
311 ident = cure_critical_wounds(300);
\r
314 case SV_POTION_STAR_HEALING:
\r
315 ident = cure_critical_wounds(1200);
\r
318 case SV_POTION_LIFE:
\r
319 ident = life_stream(TRUE, TRUE);
\r
322 case SV_POTION_RESTORE_MANA:
\r
323 ident = restore_mana(TRUE);
\r
326 case SV_POTION_RESTORE_EXP:
\r
327 if (restore_level()) ident = TRUE;
\r
330 case SV_POTION_RES_STR:
\r
331 if (do_res_stat(A_STR)) ident = TRUE;
\r
334 case SV_POTION_RES_INT:
\r
335 if (do_res_stat(A_INT)) ident = TRUE;
\r
338 case SV_POTION_RES_WIS:
\r
339 if (do_res_stat(A_WIS)) ident = TRUE;
\r
342 case SV_POTION_RES_DEX:
\r
343 if (do_res_stat(A_DEX)) ident = TRUE;
\r
346 case SV_POTION_RES_CON:
\r
347 if (do_res_stat(A_CON)) ident = TRUE;
\r
350 case SV_POTION_RES_CHR:
\r
351 if (do_res_stat(A_CHR)) ident = TRUE;
\r
354 case SV_POTION_INC_STR:
\r
355 if (do_inc_stat(A_STR)) ident = TRUE;
\r
358 case SV_POTION_INC_INT:
\r
359 if (do_inc_stat(A_INT)) ident = TRUE;
\r
362 case SV_POTION_INC_WIS:
\r
363 if (do_inc_stat(A_WIS)) ident = TRUE;
\r
366 case SV_POTION_INC_DEX:
\r
367 if (do_inc_stat(A_DEX)) ident = TRUE;
\r
370 case SV_POTION_INC_CON:
\r
371 if (do_inc_stat(A_CON)) ident = TRUE;
\r
374 case SV_POTION_INC_CHR:
\r
375 if (do_inc_stat(A_CHR)) ident = TRUE;
\r
378 case SV_POTION_AUGMENTATION:
\r
379 if (do_inc_stat(A_STR)) ident = TRUE;
\r
380 if (do_inc_stat(A_INT)) ident = TRUE;
\r
381 if (do_inc_stat(A_WIS)) ident = TRUE;
\r
382 if (do_inc_stat(A_DEX)) ident = TRUE;
\r
383 if (do_inc_stat(A_CON)) ident = TRUE;
\r
384 if (do_inc_stat(A_CHR)) ident = TRUE;
\r
387 case SV_POTION_ENLIGHTENMENT:
\r
388 msg_print(_("自分の置かれている状況が脳裏に浮かんできた...", "An image of your surroundings forms in your mind..."));
\r
389 chg_virtue(V_KNOWLEDGE, 1);
\r
390 chg_virtue(V_ENLIGHTEN, 1);
\r
395 case SV_POTION_STAR_ENLIGHTENMENT:
\r
396 msg_print(_("更なる啓蒙を感じた...", "You begin to feel more enlightened..."));
\r
397 chg_virtue(V_KNOWLEDGE, 1);
\r
398 chg_virtue(V_ENLIGHTEN, 2);
\r
401 (void)do_inc_stat(A_INT);
\r
402 (void)do_inc_stat(A_WIS);
\r
403 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
\r
404 (void)detect_doors(DETECT_RAD_DEFAULT);
\r
405 (void)detect_stairs(DETECT_RAD_DEFAULT);
\r
406 (void)detect_treasure(DETECT_RAD_DEFAULT);
\r
407 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
\r
408 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
\r
414 case SV_POTION_SELF_KNOWLEDGE:
\r
415 msg_print(_("自分自身のことが少しは分かった気がする...", "You begin to know yourself a little better..."));
\r
421 case SV_POTION_EXPERIENCE:
\r
422 if (p_ptr->prace == RACE_ANDROID) break;
\r
423 chg_virtue(V_ENLIGHTEN, 1);
\r
424 if (p_ptr->exp < PY_MAX_EXP)
\r
426 s32b ee = (p_ptr->exp / 2) + 10;
\r
427 if (ee > 100000L) ee = 100000L;
\r
428 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
\r
434 case SV_POTION_RESISTANCE:
\r
435 (void)set_oppose_acid(p_ptr->oppose_acid + randint1(20) + 20, FALSE);
\r
436 (void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
\r
437 (void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
\r
438 (void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
\r
439 (void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
\r
443 case SV_POTION_CURING:
\r
444 if (true_healing(50)) ident = TRUE;
\r
447 case SV_POTION_INVULNERABILITY:
\r
448 (void)set_invuln(p_ptr->invuln + randint1(4) + 4, FALSE);
\r
452 case SV_POTION_NEW_LIFE:
\r
453 do_cmd_rerate(FALSE);
\r
455 p_ptr->update |= PU_BONUS;
\r
456 lose_all_mutations();
\r
460 case SV_POTION_NEO_TSUYOSHI:
\r
461 (void)set_image(0);
\r
462 (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
\r
466 case SV_POTION_TSUYOSHI:
\r
467 msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
\r
469 p_ptr->tsuyoshi = 1;
\r
470 (void)set_tsuyoshi(0, TRUE);
\r
471 if (!p_ptr->resist_chaos)
\r
473 (void)set_image(50 + randint1(50));
\r
478 case SV_POTION_POLYMORPH:
\r
479 if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23))
\r
481 lose_all_mutations();
\r
489 if(gain_random_mutation(0)) ident = TRUE;
\r
491 else if (lose_mutation(0)) ident = TRUE;
\r
492 } while(!ident || one_in_(2));
\r
498 if (prace_is_(RACE_SKELETON))
\r
500 msg_print(_("液体の一部はあなたのアゴを素通りして落ちた!", "Some of the fluid falls through your jaws!"));
\r
501 (void)potion_smash_effect(0, p_ptr->y, p_ptr->x, q_ptr->k_idx);
\r
503 p_ptr->update |= (PU_COMBINE | PU_REORDER);
\r
505 if (!(object_is_aware(q_ptr)))
\r
507 chg_virtue(V_PATIENCE, -1);
\r
508 chg_virtue(V_CHANCE, 1);
\r
509 chg_virtue(V_KNOWLEDGE, -1);
\r
512 /* The item has been tried */
\r
513 object_tried(q_ptr);
\r
515 /* An identification was made */
\r
516 if (ident && !object_is_aware(q_ptr))
\r
518 object_aware(q_ptr);
\r
519 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
\r
522 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
\r
524 /* Potions can feed the player */
\r
525 switch (p_ptr->mimic_form)
\r
528 switch (p_ptr->prace)
\r
531 (void)set_food(p_ptr->food + (q_ptr->pval / 10));
\r
533 case RACE_SKELETON:
\r
540 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
543 if (q_ptr->tval == TV_FLASK)
\r
545 msg_print(_("オイルを補給した。", "You replenish yourself with the oil."));
\r
546 set_food(p_ptr->food + 5000);
\r
550 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
554 msg_print(_("水分を取り込んだ。", "You are moistened."));
\r
555 set_food(MIN(p_ptr->food + q_ptr->pval + MAX(0, q_ptr->pval * 10) + 2000, PY_FOOD_MAX - 1));
\r
558 (void)set_food(p_ptr->food + q_ptr->pval);
\r
563 case MIMIC_DEMON_LORD:
\r
564 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
566 case MIMIC_VAMPIRE:
\r
567 (void)set_food(p_ptr->food + (q_ptr->pval / 10));
\r
570 (void)set_food(p_ptr->food + q_ptr->pval);
\r
578 * @brief 薬を飲むコマンドのメインルーチン /
\r
579 * Quaff some potion (from the pack or floor)
\r
582 void do_cmd_quaff_potion(void)
\r
587 if (p_ptr->wild_mode)
\r
592 if (p_ptr->inside_arena)
\r
594 msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
\r
599 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
\r
601 set_action(ACTION_NONE);
\r
604 /* Restrict choices to potions */
\r
605 item_tester_hook = item_tester_hook_quaff;
\r
607 q = _("どの薬を飲みますか? ", "Quaff which potion? ");
\r
608 s = _("飲める薬がない。", "You have no potions to quaff.");
\r
610 if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
\r
612 /* Quaff the potion */
\r
613 do_cmd_quaff_potion_aux(item);
\r