3 * @brief プレイヤーの飲むコマンド実装
\r
10 #include "selfinfo.h"
\r
11 #include "object-hook.h"
\r
12 #include "mutation.h"
\r
15 * @brief 薬を飲むコマンドのサブルーチン /
\r
16 * Quaff a potion (from the pack or the floor)
\r
17 * @param item 飲む薬オブジェクトの所持品ID
\r
20 void do_cmd_quaff_potion_aux(INVENTORY_IDX item)
\r
31 if (flush_failure) flush();
\r
32 msg_print(_("瓶から水が流れ出てこない!", "The potion doesn't flow out from a bottle."));
\r
38 if (music_singing_any()) stop_singing();
\r
39 if (hex_spelling_any())
\r
41 if (!hex_spelling(HEX_INHAIL)) stop_hex_spell_all();
\r
44 /* Get the item (in the pack) */
\r
47 o_ptr = &inventory[item];
\r
50 /* Get the item (on the floor) */
\r
53 o_ptr = &o_list[0 - item];
\r
57 /* Obtain a local object */
\r
58 object_copy(q_ptr, o_ptr);
\r
63 /* Reduce and describe inventory */
\r
66 inven_item_increase(item, -1);
\r
67 inven_item_describe(item);
\r
68 inven_item_optimize(item);
\r
71 /* Reduce and describe floor item */
\r
74 floor_item_increase(0 - item, -1);
\r
75 floor_item_describe(0 - item);
\r
76 floor_item_optimize(0 - item);
\r
82 /* Not identified yet */
\r
86 lev = k_info[q_ptr->k_idx].level;
\r
88 /* Analyze the potion */
\r
89 if (q_ptr->tval == TV_POTION)
\r
91 switch (q_ptr->sval)
\r
93 /* 飲みごたえをオリジナルより細かく表現 */
\r
94 case SV_POTION_WATER:
\r
95 msg_print(_("口の中がさっぱりした。", ""));
\r
96 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
\r
100 case SV_POTION_APPLE_JUICE:
\r
101 msg_print(_("甘くてサッパリとしていて、とてもおいしい。", ""));
\r
102 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
\r
106 case SV_POTION_SLIME_MOLD:
\r
107 msg_print(_("なんとも不気味な味だ。", ""));
\r
108 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
\r
112 case SV_POTION_SLOWNESS:
\r
113 if (set_slow(randint1(25) + 15, FALSE)) ident = TRUE;
\r
116 case SV_POTION_SALT_WATER:
\r
117 msg_print(_("うぇ!思わず吐いてしまった。", "The potion makes you vomit!"));
\r
119 if (!(prace_is_(RACE_GOLEM) ||
\r
120 prace_is_(RACE_ZOMBIE) ||
\r
121 prace_is_(RACE_DEMON) ||
\r
122 prace_is_(RACE_ANDROID) ||
\r
123 prace_is_(RACE_SPECTRE) ||
\r
124 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING)))
\r
126 /* Only living creatures get thirsty */
\r
127 (void)set_food(PY_FOOD_STARVE - 1);
\r
130 (void)set_poisoned(0);
\r
131 (void)set_paralyzed(p_ptr->paralyzed + 4);
\r
135 case SV_POTION_POISON:
\r
136 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
\r
138 if (set_poisoned(p_ptr->poisoned + randint0(15) + 10))
\r
145 case SV_POTION_BLINDNESS:
\r
146 if (!p_ptr->resist_blind)
\r
148 if (set_blind(p_ptr->blind + randint0(100) + 100))
\r
155 case SV_POTION_CONFUSION: /* Booze */
\r
156 if (p_ptr->pclass != CLASS_MONK) chg_virtue(V_HARMONY, -1);
\r
157 else if (!p_ptr->resist_conf) p_ptr->special_attack |= ATTACK_SUIKEN;
\r
158 if (!p_ptr->resist_conf)
\r
160 if (set_confused(randint0(20) + 15))
\r
166 if (!p_ptr->resist_chaos)
\r
170 if (set_image(p_ptr->image + randint0(150) + 150))
\r
175 if (one_in_(13) && (p_ptr->pclass != CLASS_MONK))
\r
178 if (one_in_(3)) lose_all_info();
\r
180 (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
\r
182 msg_print(_("知らない場所で目が醒めた。頭痛がする。", "You wake up somewhere with a sore head..."));
\r
183 msg_print(_("何も思い出せない。どうやってここへ来たのかも分からない!", "You can't remember a thing, or how you got here!"));
\r
188 case SV_POTION_SLEEP:
\r
189 if (!p_ptr->free_act)
\r
191 msg_print(_("あなたは眠ってしまった。", "You fall asleep."));
\r
193 if (ironman_nightmare)
\r
195 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
\r
197 /* Have some nightmares */
\r
198 sanity_blast(NULL, FALSE);
\r
200 if (set_paralyzed(p_ptr->paralyzed + randint0(4) + 4))
\r
207 case SV_POTION_LOSE_MEMORIES:
\r
208 if (!p_ptr->hold_exp && (p_ptr->exp > 0))
\r
210 msg_print(_("過去の記憶が薄れていく気がする。", "You feel your memories fade."));
\r
211 chg_virtue(V_KNOWLEDGE, -5);
\r
213 lose_exp(p_ptr->exp / 4);
\r
218 case SV_POTION_RUINATION:
\r
219 msg_print(_("身も心も弱ってきて、精気が抜けていくようだ。", "Your nerves and muscles feel weak and lifeless!"));
\r
220 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), _("破滅の薬", "a potion of Ruination"), -1);
\r
222 (void)dec_stat(A_DEX, 25, TRUE);
\r
223 (void)dec_stat(A_WIS, 25, TRUE);
\r
224 (void)dec_stat(A_CON, 25, TRUE);
\r
225 (void)dec_stat(A_STR, 25, TRUE);
\r
226 (void)dec_stat(A_CHR, 25, TRUE);
\r
227 (void)dec_stat(A_INT, 25, TRUE);
\r
231 case SV_POTION_DEC_STR:
\r
232 if (do_dec_stat(A_STR)) ident = TRUE;
\r
235 case SV_POTION_DEC_INT:
\r
236 if (do_dec_stat(A_INT)) ident = TRUE;
\r
239 case SV_POTION_DEC_WIS:
\r
240 if (do_dec_stat(A_WIS)) ident = TRUE;
\r
243 case SV_POTION_DEC_DEX:
\r
244 if (do_dec_stat(A_DEX)) ident = TRUE;
\r
247 case SV_POTION_DEC_CON:
\r
248 if (do_dec_stat(A_CON)) ident = TRUE;
\r
251 case SV_POTION_DEC_CHR:
\r
252 if (do_dec_stat(A_CHR)) ident = TRUE;
\r
255 case SV_POTION_DETONATIONS:
\r
256 msg_print(_("体の中で激しい爆発が起きた!", "Massive explosions rupture your body!"));
\r
257 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), _("爆発の薬", "a potion of Detonation"), -1);
\r
259 (void)set_stun(p_ptr->stun + 75);
\r
260 (void)set_cut(p_ptr->cut + 5000);
\r
264 case SV_POTION_DEATH:
\r
265 chg_virtue(V_VITALITY, -1);
\r
266 chg_virtue(V_UNLIFE, 5);
\r
267 msg_print(_("死の予感が体中を駆けめぐった。", "A feeling of Death flows through your body."));
\r
268 take_hit(DAMAGE_LOSELIFE, 5000, _("死の薬", "a potion of Death"), -1);
\r
272 case SV_POTION_INFRAVISION:
\r
273 if (set_tim_infra(p_ptr->tim_infra + 100 + randint1(100), FALSE))
\r
279 case SV_POTION_DETECT_INVIS:
\r
280 if (set_tim_invis(p_ptr->tim_invis + 12 + randint1(12), FALSE))
\r
286 case SV_POTION_SLOW_POISON:
\r
287 if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
\r
290 case SV_POTION_CURE_POISON:
\r
291 if (set_poisoned(0)) ident = TRUE;
\r
294 case SV_POTION_BOLDNESS:
\r
295 if (set_afraid(0)) ident = TRUE;
\r
298 case SV_POTION_SPEED:
\r
301 if (set_fast(randint1(25) + 15, FALSE)) ident = TRUE;
\r
305 (void)set_fast(p_ptr->fast + 5, FALSE);
\r
309 case SV_POTION_RESIST_HEAT:
\r
310 if (set_oppose_fire(p_ptr->oppose_fire + randint1(10) + 10, FALSE))
\r
316 case SV_POTION_RESIST_COLD:
\r
317 if (set_oppose_cold(p_ptr->oppose_cold + randint1(10) + 10, FALSE))
\r
323 case SV_POTION_HEROISM:
\r
324 ident = heroism(25);
\r
327 case SV_POTION_BESERK_STRENGTH:
\r
328 ident = berserk(randint1(25) + 25);
\r
331 case SV_POTION_CURE_LIGHT:
\r
332 ident = cure_light_wounds(2, 8);
\r
335 case SV_POTION_CURE_SERIOUS:
\r
336 ident = cure_serious_wounds(4, 8);
\r
339 case SV_POTION_CURE_CRITICAL:
\r
340 ident = cure_critical_wounds(damroll(6, 8));
\r
343 case SV_POTION_HEALING:
\r
344 ident = cure_critical_wounds(300);
\r
347 case SV_POTION_STAR_HEALING:
\r
348 ident = cure_critical_wounds(1200);
\r
351 case SV_POTION_LIFE:
\r
352 ident = life_stream(TRUE, TRUE);
\r
355 case SV_POTION_RESTORE_MANA:
\r
356 ident = restore_mana(TRUE);
\r
359 case SV_POTION_RESTORE_EXP:
\r
360 if (restore_level()) ident = TRUE;
\r
363 case SV_POTION_RES_STR:
\r
364 if (do_res_stat(A_STR)) ident = TRUE;
\r
367 case SV_POTION_RES_INT:
\r
368 if (do_res_stat(A_INT)) ident = TRUE;
\r
371 case SV_POTION_RES_WIS:
\r
372 if (do_res_stat(A_WIS)) ident = TRUE;
\r
375 case SV_POTION_RES_DEX:
\r
376 if (do_res_stat(A_DEX)) ident = TRUE;
\r
379 case SV_POTION_RES_CON:
\r
380 if (do_res_stat(A_CON)) ident = TRUE;
\r
383 case SV_POTION_RES_CHR:
\r
384 if (do_res_stat(A_CHR)) ident = TRUE;
\r
387 case SV_POTION_INC_STR:
\r
388 if (do_inc_stat(A_STR)) ident = TRUE;
\r
391 case SV_POTION_INC_INT:
\r
392 if (do_inc_stat(A_INT)) ident = TRUE;
\r
395 case SV_POTION_INC_WIS:
\r
396 if (do_inc_stat(A_WIS)) ident = TRUE;
\r
399 case SV_POTION_INC_DEX:
\r
400 if (do_inc_stat(A_DEX)) ident = TRUE;
\r
403 case SV_POTION_INC_CON:
\r
404 if (do_inc_stat(A_CON)) ident = TRUE;
\r
407 case SV_POTION_INC_CHR:
\r
408 if (do_inc_stat(A_CHR)) ident = TRUE;
\r
411 case SV_POTION_AUGMENTATION:
\r
412 if (do_inc_stat(A_STR)) ident = TRUE;
\r
413 if (do_inc_stat(A_INT)) ident = TRUE;
\r
414 if (do_inc_stat(A_WIS)) ident = TRUE;
\r
415 if (do_inc_stat(A_DEX)) ident = TRUE;
\r
416 if (do_inc_stat(A_CON)) ident = TRUE;
\r
417 if (do_inc_stat(A_CHR)) ident = TRUE;
\r
420 case SV_POTION_ENLIGHTENMENT:
\r
421 msg_print(_("自分の置かれている状況が脳裏に浮かんできた...", "An image of your surroundings forms in your mind..."));
\r
422 chg_virtue(V_KNOWLEDGE, 1);
\r
423 chg_virtue(V_ENLIGHTEN, 1);
\r
428 case SV_POTION_STAR_ENLIGHTENMENT:
\r
429 msg_print(_("更なる啓蒙を感じた...", "You begin to feel more enlightened..."));
\r
430 chg_virtue(V_KNOWLEDGE, 1);
\r
431 chg_virtue(V_ENLIGHTEN, 2);
\r
434 (void)do_inc_stat(A_INT);
\r
435 (void)do_inc_stat(A_WIS);
\r
436 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
\r
437 (void)detect_doors(DETECT_RAD_DEFAULT);
\r
438 (void)detect_stairs(DETECT_RAD_DEFAULT);
\r
439 (void)detect_treasure(DETECT_RAD_DEFAULT);
\r
440 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
\r
441 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
\r
447 case SV_POTION_SELF_KNOWLEDGE:
\r
448 msg_print(_("自分自身のことが少しは分かった気がする...", "You begin to know yourself a little better..."));
\r
454 case SV_POTION_EXPERIENCE:
\r
455 if (p_ptr->prace == RACE_ANDROID) break;
\r
456 chg_virtue(V_ENLIGHTEN, 1);
\r
457 if (p_ptr->exp < PY_MAX_EXP)
\r
459 s32b ee = (p_ptr->exp / 2) + 10;
\r
460 if (ee > 100000L) ee = 100000L;
\r
461 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
\r
467 case SV_POTION_RESISTANCE:
\r
468 (void)set_oppose_acid(p_ptr->oppose_acid + randint1(20) + 20, FALSE);
\r
469 (void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
\r
470 (void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
\r
471 (void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
\r
472 (void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
\r
476 case SV_POTION_CURING:
\r
477 if (true_healing(50)) ident = TRUE;
\r
480 case SV_POTION_INVULNERABILITY:
\r
481 (void)set_invuln(p_ptr->invuln + randint1(4) + 4, FALSE);
\r
485 case SV_POTION_NEW_LIFE:
\r
486 do_cmd_rerate(FALSE);
\r
488 p_ptr->update |= PU_BONUS;
\r
489 lose_all_mutations();
\r
493 case SV_POTION_NEO_TSUYOSHI:
\r
494 (void)set_image(0);
\r
495 (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
\r
499 case SV_POTION_TSUYOSHI:
\r
500 msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
\r
502 p_ptr->tsuyoshi = 1;
\r
503 (void)set_tsuyoshi(0, TRUE);
\r
504 if (!p_ptr->resist_chaos)
\r
506 (void)set_image(50 + randint1(50));
\r
511 case SV_POTION_POLYMORPH:
\r
512 if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23))
\r
514 lose_all_mutations();
\r
522 if(gain_random_mutation(0)) ident = TRUE;
\r
524 else if (lose_mutation(0)) ident = TRUE;
\r
525 } while(!ident || one_in_(2));
\r
531 if (prace_is_(RACE_SKELETON))
\r
533 msg_print(_("液体の一部はあなたのアゴを素通りして落ちた!", "Some of the fluid falls through your jaws!"));
\r
534 (void)potion_smash_effect(0, p_ptr->y, p_ptr->x, q_ptr->k_idx);
\r
537 /* Combine / Reorder the pack (later) */
\r
538 p_ptr->update |= (PU_COMBINE | PU_REORDER);
\r
540 if (!(object_is_aware(q_ptr)))
\r
542 chg_virtue(V_PATIENCE, -1);
\r
543 chg_virtue(V_CHANCE, 1);
\r
544 chg_virtue(V_KNOWLEDGE, -1);
\r
547 /* The item has been tried */
\r
548 object_tried(q_ptr);
\r
550 /* An identification was made */
\r
551 if (ident && !object_is_aware(q_ptr))
\r
553 object_aware(q_ptr);
\r
554 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
\r
557 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
\r
559 /* Potions can feed the player */
\r
560 switch (p_ptr->mimic_form)
\r
563 switch (p_ptr->prace)
\r
566 (void)set_food(p_ptr->food + (q_ptr->pval / 10));
\r
568 case RACE_SKELETON:
\r
575 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
578 if (q_ptr->tval == TV_FLASK)
\r
580 msg_print(_("オイルを補給した。", "You replenish yourself with the oil."));
\r
581 set_food(p_ptr->food + 5000);
\r
585 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
589 msg_print(_("水分を取り込んだ。", "You are moistened."));
\r
590 set_food(MIN(p_ptr->food + q_ptr->pval + MAX(0, q_ptr->pval * 10) + 2000, PY_FOOD_MAX - 1));
\r
593 (void)set_food(p_ptr->food + q_ptr->pval);
\r
598 case MIMIC_DEMON_LORD:
\r
599 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
601 case MIMIC_VAMPIRE:
\r
602 (void)set_food(p_ptr->food + (q_ptr->pval / 10));
\r
605 (void)set_food(p_ptr->food + q_ptr->pval);
\r
613 * @brief 薬を飲むコマンドのメインルーチン /
\r
614 * Quaff some potion (from the pack or floor)
\r
617 void do_cmd_quaff_potion(void)
\r
622 if (p_ptr->wild_mode)
\r
627 if (p_ptr->inside_arena)
\r
629 msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
\r
634 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
\r
636 set_action(ACTION_NONE);
\r
639 /* Restrict choices to potions */
\r
640 item_tester_hook = item_tester_hook_quaff;
\r
642 q = _("どの薬を飲みますか? ", "Quaff which potion? ");
\r
643 s = _("飲める薬がない。", "You have no potions to quaff.");
\r
645 if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
\r
647 /* Quaff the potion */
\r
648 do_cmd_quaff_potion_aux(item);
\r