3 * @brief プレイヤーの飲むコマンド実装
\r
10 #include "selfinfo.h"
\r
11 #include "object-hook.h"
\r
14 * @brief 薬を飲むコマンドのサブルーチン /
\r
15 * Quaff a potion (from the pack or the floor)
\r
16 * @param item 飲む薬オブジェクトの所持品ID
\r
19 void do_cmd_quaff_potion_aux(INVENTORY_IDX item)
\r
30 if (flush_failure) flush();
\r
31 msg_print(_("瓶から水が流れ出てこない!", "The potion doesn't flow out from a bottle."));
\r
37 if (music_singing_any()) stop_singing();
\r
38 if (hex_spelling_any())
\r
40 if (!hex_spelling(HEX_INHAIL)) stop_hex_spell_all();
\r
43 /* Get the item (in the pack) */
\r
46 o_ptr = &inventory[item];
\r
49 /* Get the item (on the floor) */
\r
52 o_ptr = &o_list[0 - item];
\r
55 /* Get local object */
\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_CONFUSION: /* Booze */
\r
157 if (p_ptr->pclass != CLASS_MONK) chg_virtue(V_HARMONY, -1);
\r
158 else if (!p_ptr->resist_conf) p_ptr->special_attack |= ATTACK_SUIKEN;
\r
159 if (!p_ptr->resist_conf)
\r
161 if (set_confused(randint0(20) + 15))
\r
167 if (!p_ptr->resist_chaos)
\r
171 if (set_image(p_ptr->image + randint0(150) + 150))
\r
176 if (one_in_(13) && (p_ptr->pclass != CLASS_MONK))
\r
179 if (one_in_(3)) lose_all_info();
\r
181 (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
\r
183 msg_print(_("知らない場所で目が醒めた。頭痛がする。", "You wake up somewhere with a sore head..."));
\r
184 msg_print(_("何も思い出せない。どうやってここへ来たのかも分からない!", "You can't remember a thing, or how you got here!"));
\r
189 case SV_POTION_SLEEP:
\r
190 if (!p_ptr->free_act)
\r
192 msg_print(_("あなたは眠ってしまった。", "You fall asleep."));
\r
194 if (ironman_nightmare)
\r
196 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
\r
198 /* Have some nightmares */
\r
199 sanity_blast(NULL, FALSE);
\r
201 if (set_paralyzed(p_ptr->paralyzed + randint0(4) + 4))
\r
208 case SV_POTION_LOSE_MEMORIES:
\r
209 if (!p_ptr->hold_exp && (p_ptr->exp > 0))
\r
211 msg_print(_("過去の記憶が薄れていく気がする。", "You feel your memories fade."));
\r
212 chg_virtue(V_KNOWLEDGE, -5);
\r
214 lose_exp(p_ptr->exp / 4);
\r
219 case SV_POTION_RUINATION:
\r
220 msg_print(_("身も心も弱ってきて、精気が抜けていくようだ。", "Your nerves and muscles feel weak and lifeless!"));
\r
221 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), _("破滅の薬", "a potion of Ruination"), -1);
\r
223 (void)dec_stat(A_DEX, 25, TRUE);
\r
224 (void)dec_stat(A_WIS, 25, TRUE);
\r
225 (void)dec_stat(A_CON, 25, TRUE);
\r
226 (void)dec_stat(A_STR, 25, TRUE);
\r
227 (void)dec_stat(A_CHR, 25, TRUE);
\r
228 (void)dec_stat(A_INT, 25, TRUE);
\r
232 case SV_POTION_DEC_STR:
\r
233 if (do_dec_stat(A_STR)) ident = TRUE;
\r
236 case SV_POTION_DEC_INT:
\r
237 if (do_dec_stat(A_INT)) ident = TRUE;
\r
240 case SV_POTION_DEC_WIS:
\r
241 if (do_dec_stat(A_WIS)) ident = TRUE;
\r
244 case SV_POTION_DEC_DEX:
\r
245 if (do_dec_stat(A_DEX)) ident = TRUE;
\r
248 case SV_POTION_DEC_CON:
\r
249 if (do_dec_stat(A_CON)) ident = TRUE;
\r
252 case SV_POTION_DEC_CHR:
\r
253 if (do_dec_stat(A_CHR)) ident = TRUE;
\r
256 case SV_POTION_DETONATIONS:
\r
257 msg_print(_("体の中で激しい爆発が起きた!", "Massive explosions rupture your body!"));
\r
258 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), _("爆発の薬", "a potion of Detonation"), -1);
\r
260 (void)set_stun(p_ptr->stun + 75);
\r
261 (void)set_cut(p_ptr->cut + 5000);
\r
265 case SV_POTION_DEATH:
\r
266 chg_virtue(V_VITALITY, -1);
\r
267 chg_virtue(V_UNLIFE, 5);
\r
268 msg_print(_("死の予感が体中を駆けめぐった。", "A feeling of Death flows through your body."));
\r
269 take_hit(DAMAGE_LOSELIFE, 5000, _("死の薬", "a potion of Death"), -1);
\r
273 case SV_POTION_INFRAVISION:
\r
274 if (set_tim_infra(p_ptr->tim_infra + 100 + randint1(100), FALSE))
\r
280 case SV_POTION_DETECT_INVIS:
\r
281 if (set_tim_invis(p_ptr->tim_invis + 12 + randint1(12), FALSE))
\r
287 case SV_POTION_SLOW_POISON:
\r
288 if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
\r
291 case SV_POTION_CURE_POISON:
\r
292 if (set_poisoned(0)) ident = TRUE;
\r
295 case SV_POTION_BOLDNESS:
\r
296 if (set_afraid(0)) ident = TRUE;
\r
299 case SV_POTION_SPEED:
\r
302 if (set_fast(randint1(25) + 15, FALSE)) ident = TRUE;
\r
306 (void)set_fast(p_ptr->fast + 5, FALSE);
\r
310 case SV_POTION_RESIST_HEAT:
\r
311 if (set_oppose_fire(p_ptr->oppose_fire + randint1(10) + 10, FALSE))
\r
317 case SV_POTION_RESIST_COLD:
\r
318 if (set_oppose_cold(p_ptr->oppose_cold + randint1(10) + 10, FALSE))
\r
324 case SV_POTION_HEROISM:
\r
325 ident = heroism(25);
\r
328 case SV_POTION_BESERK_STRENGTH:
\r
329 ident = berserk(randint1(25) + 25);
\r
332 case SV_POTION_CURE_LIGHT:
\r
333 ident = cure_light_wounds(2, 8);
\r
336 case SV_POTION_CURE_SERIOUS:
\r
337 ident = cure_serious_wounds(4, 8);
\r
340 case SV_POTION_CURE_CRITICAL:
\r
341 ident = cure_critical_wounds(damroll(6, 8));
\r
344 case SV_POTION_HEALING:
\r
345 ident = cure_critical_wounds(300);
\r
348 case SV_POTION_STAR_HEALING:
\r
349 ident = cure_critical_wounds(1200);
\r
352 case SV_POTION_LIFE:
\r
353 ident = life_stream(TRUE, TRUE);
\r
356 case SV_POTION_RESTORE_MANA:
\r
357 ident = restore_mana(TRUE);
\r
360 case SV_POTION_RESTORE_EXP:
\r
361 if (restore_level()) ident = TRUE;
\r
364 case SV_POTION_RES_STR:
\r
365 if (do_res_stat(A_STR)) ident = TRUE;
\r
368 case SV_POTION_RES_INT:
\r
369 if (do_res_stat(A_INT)) ident = TRUE;
\r
372 case SV_POTION_RES_WIS:
\r
373 if (do_res_stat(A_WIS)) ident = TRUE;
\r
376 case SV_POTION_RES_DEX:
\r
377 if (do_res_stat(A_DEX)) ident = TRUE;
\r
380 case SV_POTION_RES_CON:
\r
381 if (do_res_stat(A_CON)) ident = TRUE;
\r
384 case SV_POTION_RES_CHR:
\r
385 if (do_res_stat(A_CHR)) ident = TRUE;
\r
388 case SV_POTION_INC_STR:
\r
389 if (do_inc_stat(A_STR)) ident = TRUE;
\r
392 case SV_POTION_INC_INT:
\r
393 if (do_inc_stat(A_INT)) ident = TRUE;
\r
396 case SV_POTION_INC_WIS:
\r
397 if (do_inc_stat(A_WIS)) ident = TRUE;
\r
400 case SV_POTION_INC_DEX:
\r
401 if (do_inc_stat(A_DEX)) ident = TRUE;
\r
404 case SV_POTION_INC_CON:
\r
405 if (do_inc_stat(A_CON)) ident = TRUE;
\r
408 case SV_POTION_INC_CHR:
\r
409 if (do_inc_stat(A_CHR)) ident = TRUE;
\r
412 case SV_POTION_AUGMENTATION:
\r
413 if (do_inc_stat(A_STR)) ident = TRUE;
\r
414 if (do_inc_stat(A_INT)) ident = TRUE;
\r
415 if (do_inc_stat(A_WIS)) ident = TRUE;
\r
416 if (do_inc_stat(A_DEX)) ident = TRUE;
\r
417 if (do_inc_stat(A_CON)) ident = TRUE;
\r
418 if (do_inc_stat(A_CHR)) ident = TRUE;
\r
421 case SV_POTION_ENLIGHTENMENT:
\r
422 msg_print(_("自分の置かれている状況が脳裏に浮かんできた...", "An image of your surroundings forms in your mind..."));
\r
423 chg_virtue(V_KNOWLEDGE, 1);
\r
424 chg_virtue(V_ENLIGHTEN, 1);
\r
429 case SV_POTION_STAR_ENLIGHTENMENT:
\r
430 msg_print(_("更なる啓蒙を感じた...", "You begin to feel more enlightened..."));
\r
431 chg_virtue(V_KNOWLEDGE, 1);
\r
432 chg_virtue(V_ENLIGHTEN, 2);
\r
435 (void)do_inc_stat(A_INT);
\r
436 (void)do_inc_stat(A_WIS);
\r
437 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
\r
438 (void)detect_doors(DETECT_RAD_DEFAULT);
\r
439 (void)detect_stairs(DETECT_RAD_DEFAULT);
\r
440 (void)detect_treasure(DETECT_RAD_DEFAULT);
\r
441 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
\r
442 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
\r
448 case SV_POTION_SELF_KNOWLEDGE:
\r
449 msg_print(_("自分自身のことが少しは分かった気がする...", "You begin to know yourself a little better..."));
\r
455 case SV_POTION_EXPERIENCE:
\r
456 if (p_ptr->prace == RACE_ANDROID) break;
\r
457 chg_virtue(V_ENLIGHTEN, 1);
\r
458 if (p_ptr->exp < PY_MAX_EXP)
\r
460 s32b ee = (p_ptr->exp / 2) + 10;
\r
461 if (ee > 100000L) ee = 100000L;
\r
462 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
\r
468 case SV_POTION_RESISTANCE:
\r
469 (void)set_oppose_acid(p_ptr->oppose_acid + randint1(20) + 20, FALSE);
\r
470 (void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
\r
471 (void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
\r
472 (void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
\r
473 (void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
\r
477 case SV_POTION_CURING:
\r
478 if (true_healing(50)) ident = TRUE;
\r
481 case SV_POTION_INVULNERABILITY:
\r
482 (void)set_invuln(p_ptr->invuln + randint1(4) + 4, FALSE);
\r
486 case SV_POTION_NEW_LIFE:
\r
487 do_cmd_rerate(FALSE);
\r
489 p_ptr->update |= PU_BONUS;
\r
490 lose_all_mutations();
\r
494 case SV_POTION_NEO_TSUYOSHI:
\r
495 (void)set_image(0);
\r
496 (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
\r
500 case SV_POTION_TSUYOSHI:
\r
501 msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
\r
503 p_ptr->tsuyoshi = 1;
\r
504 (void)set_tsuyoshi(0, TRUE);
\r
505 if (!p_ptr->resist_chaos)
\r
507 (void)set_image(50 + randint1(50));
\r
512 case SV_POTION_POLYMORPH:
\r
513 if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23))
\r
515 lose_all_mutations();
\r
523 if(gain_random_mutation(0)) ident = TRUE;
\r
525 else if (lose_mutation(0)) ident = TRUE;
\r
526 } while(!ident || one_in_(2));
\r
532 if (prace_is_(RACE_SKELETON))
\r
534 msg_print(_("液体の一部はあなたのアゴを素通りして落ちた!", "Some of the fluid falls through your jaws!"));
\r
535 (void)potion_smash_effect(0, p_ptr->y, p_ptr->x, q_ptr->k_idx);
\r
538 /* Combine / Reorder the pack (later) */
\r
539 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
\r
541 if (!(object_is_aware(q_ptr)))
\r
543 chg_virtue(V_PATIENCE, -1);
\r
544 chg_virtue(V_CHANCE, 1);
\r
545 chg_virtue(V_KNOWLEDGE, -1);
\r
548 /* The item has been tried */
\r
549 object_tried(q_ptr);
\r
551 /* An identification was made */
\r
552 if (ident && !object_is_aware(q_ptr))
\r
554 object_aware(q_ptr);
\r
555 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
\r
559 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
\r
561 /* Potions can feed the player */
\r
562 switch (p_ptr->mimic_form)
\r
565 switch (p_ptr->prace)
\r
568 (void)set_food(p_ptr->food + (q_ptr->pval / 10));
\r
570 case RACE_SKELETON:
\r
577 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
580 if (q_ptr->tval == TV_FLASK)
\r
582 msg_print(_("オイルを補給した。", "You replenish yourself with the oil."));
\r
583 set_food(p_ptr->food + 5000);
\r
587 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
591 msg_print(_("水分を取り込んだ。", "You are moistened."));
\r
592 set_food(MIN(p_ptr->food + q_ptr->pval + MAX(0, q_ptr->pval * 10) + 2000, PY_FOOD_MAX - 1));
\r
595 (void)set_food(p_ptr->food + q_ptr->pval);
\r
600 case MIMIC_DEMON_LORD:
\r
601 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
603 case MIMIC_VAMPIRE:
\r
604 (void)set_food(p_ptr->food + (q_ptr->pval / 10));
\r
607 (void)set_food(p_ptr->food + q_ptr->pval);
\r
615 * @brief 薬を飲むコマンドのメインルーチン /
\r
616 * Quaff some potion (from the pack or floor)
\r
619 void do_cmd_quaff_potion(void)
\r
624 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
\r
626 set_action(ACTION_NONE);
\r
629 /* Restrict choices to potions */
\r
630 item_tester_hook = item_tester_hook_quaff;
\r
633 q = _("どの薬を飲みますか? ", "Quaff which potion? ");
\r
634 s = _("飲める薬がない。", "You have no potions to quaff.");
\r
636 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
\r
638 /* Quaff the potion */
\r
639 do_cmd_quaff_potion_aux(item);
\r