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
56 /* Obtain a local object */
\r
57 object_copy(q_ptr, o_ptr);
\r
62 /* Reduce and describe inventory */
\r
65 inven_item_increase(item, -1);
\r
66 inven_item_describe(item);
\r
67 inven_item_optimize(item);
\r
70 /* Reduce and describe floor item */
\r
73 floor_item_increase(0 - item, -1);
\r
74 floor_item_describe(0 - item);
\r
75 floor_item_optimize(0 - item);
\r
81 /* Not identified yet */
\r
85 lev = k_info[q_ptr->k_idx].level;
\r
87 /* Analyze the potion */
\r
88 if (q_ptr->tval == TV_POTION)
\r
90 switch (q_ptr->sval)
\r
92 /* 飲みごたえをオリジナルより細かく表現 */
\r
93 case SV_POTION_WATER:
\r
94 msg_print(_("口の中がさっぱりした。", ""));
\r
95 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
\r
99 case SV_POTION_APPLE_JUICE:
\r
100 msg_print(_("甘くてサッパリとしていて、とてもおいしい。", ""));
\r
101 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
\r
105 case SV_POTION_SLIME_MOLD:
\r
106 msg_print(_("なんとも不気味な味だ。", ""));
\r
107 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
\r
111 case SV_POTION_SLOWNESS:
\r
112 if (set_slow(randint1(25) + 15, FALSE)) ident = TRUE;
\r
115 case SV_POTION_SALT_WATER:
\r
116 msg_print(_("うぇ!思わず吐いてしまった。", "The potion makes you vomit!"));
\r
118 if (!(prace_is_(RACE_GOLEM) ||
\r
119 prace_is_(RACE_ZOMBIE) ||
\r
120 prace_is_(RACE_DEMON) ||
\r
121 prace_is_(RACE_ANDROID) ||
\r
122 prace_is_(RACE_SPECTRE) ||
\r
123 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING)))
\r
125 /* Only living creatures get thirsty */
\r
126 (void)set_food(PY_FOOD_STARVE - 1);
\r
129 (void)set_poisoned(0);
\r
130 (void)set_paralyzed(p_ptr->paralyzed + 4);
\r
134 case SV_POTION_POISON:
\r
135 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
\r
137 if (set_poisoned(p_ptr->poisoned + randint0(15) + 10))
\r
144 case SV_POTION_BLINDNESS:
\r
145 if (!p_ptr->resist_blind)
\r
147 if (set_blind(p_ptr->blind + randint0(100) + 100))
\r
154 case SV_POTION_CONFUSION: /* Booze */
\r
155 if (p_ptr->pclass != CLASS_MONK) chg_virtue(V_HARMONY, -1);
\r
156 else if (!p_ptr->resist_conf) p_ptr->special_attack |= ATTACK_SUIKEN;
\r
157 if (!p_ptr->resist_conf)
\r
159 if (set_confused(randint0(20) + 15))
\r
165 if (!p_ptr->resist_chaos)
\r
169 if (set_image(p_ptr->image + randint0(150) + 150))
\r
174 if (one_in_(13) && (p_ptr->pclass != CLASS_MONK))
\r
177 if (one_in_(3)) lose_all_info();
\r
179 (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
\r
181 msg_print(_("知らない場所で目が醒めた。頭痛がする。", "You wake up somewhere with a sore head..."));
\r
182 msg_print(_("何も思い出せない。どうやってここへ来たのかも分からない!", "You can't remember a thing, or how you got here!"));
\r
187 case SV_POTION_SLEEP:
\r
188 if (!p_ptr->free_act)
\r
190 msg_print(_("あなたは眠ってしまった。", "You fall asleep."));
\r
192 if (ironman_nightmare)
\r
194 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
\r
196 /* Have some nightmares */
\r
197 sanity_blast(NULL, FALSE);
\r
199 if (set_paralyzed(p_ptr->paralyzed + randint0(4) + 4))
\r
206 case SV_POTION_LOSE_MEMORIES:
\r
207 if (!p_ptr->hold_exp && (p_ptr->exp > 0))
\r
209 msg_print(_("過去の記憶が薄れていく気がする。", "You feel your memories fade."));
\r
210 chg_virtue(V_KNOWLEDGE, -5);
\r
212 lose_exp(p_ptr->exp / 4);
\r
217 case SV_POTION_RUINATION:
\r
218 msg_print(_("身も心も弱ってきて、精気が抜けていくようだ。", "Your nerves and muscles feel weak and lifeless!"));
\r
219 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), _("破滅の薬", "a potion of Ruination"), -1);
\r
221 (void)dec_stat(A_DEX, 25, TRUE);
\r
222 (void)dec_stat(A_WIS, 25, TRUE);
\r
223 (void)dec_stat(A_CON, 25, TRUE);
\r
224 (void)dec_stat(A_STR, 25, TRUE);
\r
225 (void)dec_stat(A_CHR, 25, TRUE);
\r
226 (void)dec_stat(A_INT, 25, TRUE);
\r
230 case SV_POTION_DEC_STR:
\r
231 if (do_dec_stat(A_STR)) ident = TRUE;
\r
234 case SV_POTION_DEC_INT:
\r
235 if (do_dec_stat(A_INT)) ident = TRUE;
\r
238 case SV_POTION_DEC_WIS:
\r
239 if (do_dec_stat(A_WIS)) ident = TRUE;
\r
242 case SV_POTION_DEC_DEX:
\r
243 if (do_dec_stat(A_DEX)) ident = TRUE;
\r
246 case SV_POTION_DEC_CON:
\r
247 if (do_dec_stat(A_CON)) ident = TRUE;
\r
250 case SV_POTION_DEC_CHR:
\r
251 if (do_dec_stat(A_CHR)) ident = TRUE;
\r
254 case SV_POTION_DETONATIONS:
\r
255 msg_print(_("体の中で激しい爆発が起きた!", "Massive explosions rupture your body!"));
\r
256 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), _("爆発の薬", "a potion of Detonation"), -1);
\r
258 (void)set_stun(p_ptr->stun + 75);
\r
259 (void)set_cut(p_ptr->cut + 5000);
\r
263 case SV_POTION_DEATH:
\r
264 chg_virtue(V_VITALITY, -1);
\r
265 chg_virtue(V_UNLIFE, 5);
\r
266 msg_print(_("死の予感が体中を駆けめぐった。", "A feeling of Death flows through your body."));
\r
267 take_hit(DAMAGE_LOSELIFE, 5000, _("死の薬", "a potion of Death"), -1);
\r
271 case SV_POTION_INFRAVISION:
\r
272 if (set_tim_infra(p_ptr->tim_infra + 100 + randint1(100), FALSE))
\r
278 case SV_POTION_DETECT_INVIS:
\r
279 if (set_tim_invis(p_ptr->tim_invis + 12 + randint1(12), FALSE))
\r
285 case SV_POTION_SLOW_POISON:
\r
286 if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
\r
289 case SV_POTION_CURE_POISON:
\r
290 if (set_poisoned(0)) ident = TRUE;
\r
293 case SV_POTION_BOLDNESS:
\r
294 if (set_afraid(0)) ident = TRUE;
\r
297 case SV_POTION_SPEED:
\r
300 if (set_fast(randint1(25) + 15, FALSE)) ident = TRUE;
\r
304 (void)set_fast(p_ptr->fast + 5, FALSE);
\r
308 case SV_POTION_RESIST_HEAT:
\r
309 if (set_oppose_fire(p_ptr->oppose_fire + randint1(10) + 10, FALSE))
\r
315 case SV_POTION_RESIST_COLD:
\r
316 if (set_oppose_cold(p_ptr->oppose_cold + randint1(10) + 10, FALSE))
\r
322 case SV_POTION_HEROISM:
\r
323 ident = heroism(25);
\r
326 case SV_POTION_BESERK_STRENGTH:
\r
327 ident = berserk(randint1(25) + 25);
\r
330 case SV_POTION_CURE_LIGHT:
\r
331 ident = cure_light_wounds(2, 8);
\r
334 case SV_POTION_CURE_SERIOUS:
\r
335 ident = cure_serious_wounds(4, 8);
\r
338 case SV_POTION_CURE_CRITICAL:
\r
339 ident = cure_critical_wounds(damroll(6, 8));
\r
342 case SV_POTION_HEALING:
\r
343 ident = cure_critical_wounds(300);
\r
346 case SV_POTION_STAR_HEALING:
\r
347 ident = cure_critical_wounds(1200);
\r
350 case SV_POTION_LIFE:
\r
351 ident = life_stream(TRUE, TRUE);
\r
354 case SV_POTION_RESTORE_MANA:
\r
355 ident = restore_mana(TRUE);
\r
358 case SV_POTION_RESTORE_EXP:
\r
359 if (restore_level()) ident = TRUE;
\r
362 case SV_POTION_RES_STR:
\r
363 if (do_res_stat(A_STR)) ident = TRUE;
\r
366 case SV_POTION_RES_INT:
\r
367 if (do_res_stat(A_INT)) ident = TRUE;
\r
370 case SV_POTION_RES_WIS:
\r
371 if (do_res_stat(A_WIS)) ident = TRUE;
\r
374 case SV_POTION_RES_DEX:
\r
375 if (do_res_stat(A_DEX)) ident = TRUE;
\r
378 case SV_POTION_RES_CON:
\r
379 if (do_res_stat(A_CON)) ident = TRUE;
\r
382 case SV_POTION_RES_CHR:
\r
383 if (do_res_stat(A_CHR)) ident = TRUE;
\r
386 case SV_POTION_INC_STR:
\r
387 if (do_inc_stat(A_STR)) ident = TRUE;
\r
390 case SV_POTION_INC_INT:
\r
391 if (do_inc_stat(A_INT)) ident = TRUE;
\r
394 case SV_POTION_INC_WIS:
\r
395 if (do_inc_stat(A_WIS)) ident = TRUE;
\r
398 case SV_POTION_INC_DEX:
\r
399 if (do_inc_stat(A_DEX)) ident = TRUE;
\r
402 case SV_POTION_INC_CON:
\r
403 if (do_inc_stat(A_CON)) ident = TRUE;
\r
406 case SV_POTION_INC_CHR:
\r
407 if (do_inc_stat(A_CHR)) ident = TRUE;
\r
410 case SV_POTION_AUGMENTATION:
\r
411 if (do_inc_stat(A_STR)) ident = TRUE;
\r
412 if (do_inc_stat(A_INT)) ident = TRUE;
\r
413 if (do_inc_stat(A_WIS)) ident = TRUE;
\r
414 if (do_inc_stat(A_DEX)) ident = TRUE;
\r
415 if (do_inc_stat(A_CON)) ident = TRUE;
\r
416 if (do_inc_stat(A_CHR)) ident = TRUE;
\r
419 case SV_POTION_ENLIGHTENMENT:
\r
420 msg_print(_("自分の置かれている状況が脳裏に浮かんできた...", "An image of your surroundings forms in your mind..."));
\r
421 chg_virtue(V_KNOWLEDGE, 1);
\r
422 chg_virtue(V_ENLIGHTEN, 1);
\r
427 case SV_POTION_STAR_ENLIGHTENMENT:
\r
428 msg_print(_("更なる啓蒙を感じた...", "You begin to feel more enlightened..."));
\r
429 chg_virtue(V_KNOWLEDGE, 1);
\r
430 chg_virtue(V_ENLIGHTEN, 2);
\r
433 (void)do_inc_stat(A_INT);
\r
434 (void)do_inc_stat(A_WIS);
\r
435 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
\r
436 (void)detect_doors(DETECT_RAD_DEFAULT);
\r
437 (void)detect_stairs(DETECT_RAD_DEFAULT);
\r
438 (void)detect_treasure(DETECT_RAD_DEFAULT);
\r
439 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
\r
440 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
\r
446 case SV_POTION_SELF_KNOWLEDGE:
\r
447 msg_print(_("自分自身のことが少しは分かった気がする...", "You begin to know yourself a little better..."));
\r
453 case SV_POTION_EXPERIENCE:
\r
454 if (p_ptr->prace == RACE_ANDROID) break;
\r
455 chg_virtue(V_ENLIGHTEN, 1);
\r
456 if (p_ptr->exp < PY_MAX_EXP)
\r
458 s32b ee = (p_ptr->exp / 2) + 10;
\r
459 if (ee > 100000L) ee = 100000L;
\r
460 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
\r
466 case SV_POTION_RESISTANCE:
\r
467 (void)set_oppose_acid(p_ptr->oppose_acid + randint1(20) + 20, FALSE);
\r
468 (void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
\r
469 (void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
\r
470 (void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
\r
471 (void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
\r
475 case SV_POTION_CURING:
\r
476 if (true_healing(50)) ident = TRUE;
\r
479 case SV_POTION_INVULNERABILITY:
\r
480 (void)set_invuln(p_ptr->invuln + randint1(4) + 4, FALSE);
\r
484 case SV_POTION_NEW_LIFE:
\r
485 do_cmd_rerate(FALSE);
\r
487 p_ptr->update |= PU_BONUS;
\r
488 lose_all_mutations();
\r
492 case SV_POTION_NEO_TSUYOSHI:
\r
493 (void)set_image(0);
\r
494 (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
\r
498 case SV_POTION_TSUYOSHI:
\r
499 msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
\r
501 p_ptr->tsuyoshi = 1;
\r
502 (void)set_tsuyoshi(0, TRUE);
\r
503 if (!p_ptr->resist_chaos)
\r
505 (void)set_image(50 + randint1(50));
\r
510 case SV_POTION_POLYMORPH:
\r
511 if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23))
\r
513 lose_all_mutations();
\r
521 if(gain_random_mutation(0)) ident = TRUE;
\r
523 else if (lose_mutation(0)) ident = TRUE;
\r
524 } while(!ident || one_in_(2));
\r
530 if (prace_is_(RACE_SKELETON))
\r
532 msg_print(_("液体の一部はあなたのアゴを素通りして落ちた!", "Some of the fluid falls through your jaws!"));
\r
533 (void)potion_smash_effect(0, p_ptr->y, p_ptr->x, q_ptr->k_idx);
\r
536 /* Combine / Reorder the pack (later) */
\r
537 p_ptr->update |= (PU_COMBINE | PU_REORDER);
\r
539 if (!(object_is_aware(q_ptr)))
\r
541 chg_virtue(V_PATIENCE, -1);
\r
542 chg_virtue(V_CHANCE, 1);
\r
543 chg_virtue(V_KNOWLEDGE, -1);
\r
546 /* The item has been tried */
\r
547 object_tried(q_ptr);
\r
549 /* An identification was made */
\r
550 if (ident && !object_is_aware(q_ptr))
\r
552 object_aware(q_ptr);
\r
553 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
\r
556 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
\r
558 /* Potions can feed the player */
\r
559 switch (p_ptr->mimic_form)
\r
562 switch (p_ptr->prace)
\r
565 (void)set_food(p_ptr->food + (q_ptr->pval / 10));
\r
567 case RACE_SKELETON:
\r
574 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
577 if (q_ptr->tval == TV_FLASK)
\r
579 msg_print(_("オイルを補給した。", "You replenish yourself with the oil."));
\r
580 set_food(p_ptr->food + 5000);
\r
584 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
588 msg_print(_("水分を取り込んだ。", "You are moistened."));
\r
589 set_food(MIN(p_ptr->food + q_ptr->pval + MAX(0, q_ptr->pval * 10) + 2000, PY_FOOD_MAX - 1));
\r
592 (void)set_food(p_ptr->food + q_ptr->pval);
\r
597 case MIMIC_DEMON_LORD:
\r
598 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
600 case MIMIC_VAMPIRE:
\r
601 (void)set_food(p_ptr->food + (q_ptr->pval / 10));
\r
604 (void)set_food(p_ptr->food + q_ptr->pval);
\r
612 * @brief 薬を飲むコマンドのメインルーチン /
\r
613 * Quaff some potion (from the pack or floor)
\r
616 void do_cmd_quaff_potion(void)
\r
621 if (p_ptr->wild_mode)
\r
626 if (p_ptr->inside_arena)
\r
628 msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
\r
633 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
\r
635 set_action(ACTION_NONE);
\r
638 /* Restrict choices to potions */
\r
639 item_tester_hook = item_tester_hook_quaff;
\r
641 q = _("どの薬を飲みますか? ", "Quaff which potion? ");
\r
642 s = _("飲める薬がない。", "You have no potions to quaff.");
\r
644 if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
\r
646 /* Quaff the potion */
\r
647 do_cmd_quaff_potion_aux(item);
\r