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(int item)
\r
28 p_ptr->energy_use = 100;
\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
57 /* Get local object */
\r
60 /* Obtain a local object */
\r
61 object_copy(q_ptr, o_ptr);
\r
66 /* Reduce and describe inventory */
\r
69 inven_item_increase(item, -1);
\r
70 inven_item_describe(item);
\r
71 inven_item_optimize(item);
\r
74 /* Reduce and describe floor item */
\r
77 floor_item_increase(0 - item, -1);
\r
78 floor_item_describe(0 - item);
\r
79 floor_item_optimize(0 - item);
\r
86 /* Not identified yet */
\r
90 lev = k_info[q_ptr->k_idx].level;
\r
92 /* Analyze the potion */
\r
93 if (q_ptr->tval == TV_POTION)
\r
95 switch (q_ptr->sval)
\r
97 /* 飲みごたえをオリジナルより細かく表現 */
\r
98 case SV_POTION_WATER:
\r
99 msg_print(_("口の中がさっぱりした。", ""));
\r
100 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
\r
104 case SV_POTION_APPLE_JUICE:
\r
105 msg_print(_("甘くてサッパリとしていて、とてもおいしい。", ""));
\r
106 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
\r
110 case SV_POTION_SLIME_MOLD:
\r
111 msg_print(_("なんとも不気味な味だ。", ""));
\r
112 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
\r
116 case SV_POTION_SLOWNESS:
\r
117 if (set_slow(randint1(25) + 15, FALSE)) ident = TRUE;
\r
120 case SV_POTION_SALT_WATER:
\r
121 msg_print(_("うぇ!思わず吐いてしまった。", "The potion makes you vomit!"));
\r
123 if (!(prace_is_(RACE_GOLEM) ||
\r
124 prace_is_(RACE_ZOMBIE) ||
\r
125 prace_is_(RACE_DEMON) ||
\r
126 prace_is_(RACE_ANDROID) ||
\r
127 prace_is_(RACE_SPECTRE) ||
\r
128 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING)))
\r
130 /* Only living creatures get thirsty */
\r
131 (void)set_food(PY_FOOD_STARVE - 1);
\r
134 (void)set_poisoned(0);
\r
135 (void)set_paralyzed(p_ptr->paralyzed + 4);
\r
139 case SV_POTION_POISON:
\r
140 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
\r
142 if (set_poisoned(p_ptr->poisoned + randint0(15) + 10))
\r
149 case SV_POTION_BLINDNESS:
\r
150 if (!p_ptr->resist_blind)
\r
152 if (set_blind(p_ptr->blind + randint0(100) + 100))
\r
159 case SV_POTION_CONFUSION: /* Booze */
\r
160 if (p_ptr->pclass != CLASS_MONK) chg_virtue(V_HARMONY, -1);
\r
161 else if (!p_ptr->resist_conf) p_ptr->special_attack |= ATTACK_SUIKEN;
\r
162 if (!p_ptr->resist_conf)
\r
164 if (set_confused(randint0(20) + 15))
\r
170 if (!p_ptr->resist_chaos)
\r
174 if (set_image(p_ptr->image + randint0(150) + 150))
\r
179 if (one_in_(13) && (p_ptr->pclass != CLASS_MONK))
\r
182 if (one_in_(3)) lose_all_info();
\r
184 (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
\r
186 msg_print(_("知らない場所で目が醒めた。頭痛がする。", "You wake up somewhere with a sore head..."));
\r
187 msg_print(_("何も思い出せない。どうやってここへ来たのかも分からない!", "You can't remember a thing, or how you got here!"));
\r
192 case SV_POTION_SLEEP:
\r
193 if (!p_ptr->free_act)
\r
195 msg_print(_("あなたは眠ってしまった。", "You fall asleep."));
\r
197 if (ironman_nightmare)
\r
199 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
\r
201 /* Have some nightmares */
\r
202 sanity_blast(NULL, FALSE);
\r
204 if (set_paralyzed(p_ptr->paralyzed + randint0(4) + 4))
\r
211 case SV_POTION_LOSE_MEMORIES:
\r
212 if (!p_ptr->hold_exp && (p_ptr->exp > 0))
\r
214 msg_print(_("過去の記憶が薄れていく気がする。", "You feel your memories fade."));
\r
215 chg_virtue(V_KNOWLEDGE, -5);
\r
217 lose_exp(p_ptr->exp / 4);
\r
222 case SV_POTION_RUINATION:
\r
223 msg_print(_("身も心も弱ってきて、精気が抜けていくようだ。", "Your nerves and muscles feel weak and lifeless!"));
\r
224 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), _("破滅の薬", "a potion of Ruination"), -1);
\r
226 (void)dec_stat(A_DEX, 25, TRUE);
\r
227 (void)dec_stat(A_WIS, 25, TRUE);
\r
228 (void)dec_stat(A_CON, 25, TRUE);
\r
229 (void)dec_stat(A_STR, 25, TRUE);
\r
230 (void)dec_stat(A_CHR, 25, TRUE);
\r
231 (void)dec_stat(A_INT, 25, TRUE);
\r
235 case SV_POTION_DEC_STR:
\r
236 if (do_dec_stat(A_STR)) ident = TRUE;
\r
239 case SV_POTION_DEC_INT:
\r
240 if (do_dec_stat(A_INT)) ident = TRUE;
\r
243 case SV_POTION_DEC_WIS:
\r
244 if (do_dec_stat(A_WIS)) ident = TRUE;
\r
247 case SV_POTION_DEC_DEX:
\r
248 if (do_dec_stat(A_DEX)) ident = TRUE;
\r
251 case SV_POTION_DEC_CON:
\r
252 if (do_dec_stat(A_CON)) ident = TRUE;
\r
255 case SV_POTION_DEC_CHR:
\r
256 if (do_dec_stat(A_CHR)) ident = TRUE;
\r
259 case SV_POTION_DETONATIONS:
\r
260 msg_print(_("体の中で激しい爆発が起きた!", "Massive explosions rupture your body!"));
\r
261 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), _("爆発の薬", "a potion of Detonation"), -1);
\r
263 (void)set_stun(p_ptr->stun + 75);
\r
264 (void)set_cut(p_ptr->cut + 5000);
\r
268 case SV_POTION_DEATH:
\r
269 chg_virtue(V_VITALITY, -1);
\r
270 chg_virtue(V_UNLIFE, 5);
\r
271 msg_print(_("死の予感が体中を駆けめぐった。", "A feeling of Death flows through your body."));
\r
272 take_hit(DAMAGE_LOSELIFE, 5000, _("死の薬", "a potion of Death"), -1);
\r
276 case SV_POTION_INFRAVISION:
\r
277 if (set_tim_infra(p_ptr->tim_infra + 100 + randint1(100), FALSE))
\r
283 case SV_POTION_DETECT_INVIS:
\r
284 if (set_tim_invis(p_ptr->tim_invis + 12 + randint1(12), FALSE))
\r
290 case SV_POTION_SLOW_POISON:
\r
291 if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
\r
294 case SV_POTION_CURE_POISON:
\r
295 if (set_poisoned(0)) ident = TRUE;
\r
298 case SV_POTION_BOLDNESS:
\r
299 if (set_afraid(0)) ident = TRUE;
\r
302 case SV_POTION_SPEED:
\r
305 if (set_fast(randint1(25) + 15, FALSE)) ident = TRUE;
\r
309 (void)set_fast(p_ptr->fast + 5, FALSE);
\r
313 case SV_POTION_RESIST_HEAT:
\r
314 if (set_oppose_fire(p_ptr->oppose_fire + randint1(10) + 10, FALSE))
\r
320 case SV_POTION_RESIST_COLD:
\r
321 if (set_oppose_cold(p_ptr->oppose_cold + randint1(10) + 10, FALSE))
\r
327 case SV_POTION_HEROISM:
\r
328 ident = heroism(25);
\r
331 case SV_POTION_BESERK_STRENGTH:
\r
332 if (set_afraid(0)) ident = TRUE;
\r
333 if (set_shero(p_ptr->shero + randint1(25) + 25, FALSE)) ident = TRUE;
\r
334 if (hp_player(30)) ident = TRUE;
\r
337 case SV_POTION_CURE_LIGHT:
\r
338 ident = cure_light_wound(2, 8);
\r
341 case SV_POTION_CURE_SERIOUS:
\r
342 ident = cure_light_wound(4, 8);
\r
345 case SV_POTION_CURE_CRITICAL:
\r
346 if (hp_player(damroll(6, 8))) ident = TRUE;
\r
347 if (set_blind(0)) ident = TRUE;
\r
348 if (set_confused(0)) ident = TRUE;
\r
349 if (set_poisoned(0)) ident = TRUE;
\r
350 if (set_stun(0)) ident = TRUE;
\r
351 if (set_cut(0)) ident = TRUE;
\r
352 if (set_shero(0,TRUE)) ident = TRUE;
\r
355 case SV_POTION_HEALING:
\r
356 if (hp_player(300)) ident = TRUE;
\r
357 if (set_blind(0)) ident = TRUE;
\r
358 if (set_confused(0)) ident = TRUE;
\r
359 if (set_poisoned(0)) ident = TRUE;
\r
360 if (set_stun(0)) ident = TRUE;
\r
361 if (set_cut(0)) ident = TRUE;
\r
362 if (set_shero(0,TRUE)) ident = TRUE;
\r
365 case SV_POTION_STAR_HEALING:
\r
366 if (hp_player(1200)) ident = TRUE;
\r
367 if (set_blind(0)) ident = TRUE;
\r
368 if (set_confused(0)) ident = TRUE;
\r
369 if (set_poisoned(0)) ident = TRUE;
\r
370 if (set_stun(0)) ident = TRUE;
\r
371 if (set_cut(0)) ident = TRUE;
\r
372 if (set_shero(0,TRUE)) ident = TRUE;
\r
375 case SV_POTION_LIFE:
\r
376 ident = life_stream(TRUE, TRUE);
\r
379 case SV_POTION_RESTORE_MANA:
\r
380 if (p_ptr->pclass == CLASS_MAGIC_EATER)
\r
383 for (i = 0; i < EATER_EXT*2; i++)
\r
385 p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i]*EATER_CHARGE/3;
\r
386 if (p_ptr->magic_num1[i] > p_ptr->magic_num2[i]*EATER_CHARGE) p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*EATER_CHARGE;
\r
388 for (; i < EATER_EXT*3; i++)
\r
390 KIND_OBJECT_IDX k_idx = lookup_kind(TV_ROD, i-EATER_EXT*2);
\r
391 p_ptr->magic_num1[i] -= ((p_ptr->magic_num2[i] < 10) ? EATER_ROD_CHARGE*3 : p_ptr->magic_num2[i]*EATER_ROD_CHARGE/3)*k_info[k_idx].pval;
\r
392 if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
\r
394 msg_print(_("頭がハッキリとした。", "You feel your head clear."));
\r
395 p_ptr->window |= (PW_PLAYER);
\r
398 else if (p_ptr->csp < p_ptr->msp)
\r
400 p_ptr->csp = p_ptr->msp;
\r
401 p_ptr->csp_frac = 0;
\r
402 msg_print(_("頭がハッキリとした。", "You feel your head clear."));
\r
404 p_ptr->redraw |= (PR_MANA);
\r
405 p_ptr->window |= (PW_PLAYER);
\r
406 p_ptr->window |= (PW_SPELL);
\r
409 if (set_shero(0,TRUE)) ident = TRUE;
\r
412 case SV_POTION_RESTORE_EXP:
\r
413 if (restore_level()) ident = TRUE;
\r
416 case SV_POTION_RES_STR:
\r
417 if (do_res_stat(A_STR)) ident = TRUE;
\r
420 case SV_POTION_RES_INT:
\r
421 if (do_res_stat(A_INT)) ident = TRUE;
\r
424 case SV_POTION_RES_WIS:
\r
425 if (do_res_stat(A_WIS)) ident = TRUE;
\r
428 case SV_POTION_RES_DEX:
\r
429 if (do_res_stat(A_DEX)) ident = TRUE;
\r
432 case SV_POTION_RES_CON:
\r
433 if (do_res_stat(A_CON)) ident = TRUE;
\r
436 case SV_POTION_RES_CHR:
\r
437 if (do_res_stat(A_CHR)) ident = TRUE;
\r
440 case SV_POTION_INC_STR:
\r
441 if (do_inc_stat(A_STR)) ident = TRUE;
\r
444 case SV_POTION_INC_INT:
\r
445 if (do_inc_stat(A_INT)) ident = TRUE;
\r
448 case SV_POTION_INC_WIS:
\r
449 if (do_inc_stat(A_WIS)) ident = TRUE;
\r
452 case SV_POTION_INC_DEX:
\r
453 if (do_inc_stat(A_DEX)) ident = TRUE;
\r
456 case SV_POTION_INC_CON:
\r
457 if (do_inc_stat(A_CON)) ident = TRUE;
\r
460 case SV_POTION_INC_CHR:
\r
461 if (do_inc_stat(A_CHR)) ident = TRUE;
\r
464 case SV_POTION_AUGMENTATION:
\r
465 if (do_inc_stat(A_STR)) ident = TRUE;
\r
466 if (do_inc_stat(A_INT)) ident = TRUE;
\r
467 if (do_inc_stat(A_WIS)) ident = TRUE;
\r
468 if (do_inc_stat(A_DEX)) ident = TRUE;
\r
469 if (do_inc_stat(A_CON)) ident = TRUE;
\r
470 if (do_inc_stat(A_CHR)) ident = TRUE;
\r
473 case SV_POTION_ENLIGHTENMENT:
\r
474 msg_print(_("自分の置かれている状況が脳裏に浮かんできた...", "An image of your surroundings forms in your mind..."));
\r
475 chg_virtue(V_KNOWLEDGE, 1);
\r
476 chg_virtue(V_ENLIGHTEN, 1);
\r
481 case SV_POTION_STAR_ENLIGHTENMENT:
\r
482 msg_print(_("更なる啓蒙を感じた...", "You begin to feel more enlightened..."));
\r
483 chg_virtue(V_KNOWLEDGE, 1);
\r
484 chg_virtue(V_ENLIGHTEN, 2);
\r
487 (void)do_inc_stat(A_INT);
\r
488 (void)do_inc_stat(A_WIS);
\r
489 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
\r
490 (void)detect_doors(DETECT_RAD_DEFAULT);
\r
491 (void)detect_stairs(DETECT_RAD_DEFAULT);
\r
492 (void)detect_treasure(DETECT_RAD_DEFAULT);
\r
493 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
\r
494 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
\r
500 case SV_POTION_SELF_KNOWLEDGE:
\r
501 msg_print(_("自分自身のことが少しは分かった気がする...", "You begin to know yourself a little better..."));
\r
507 case SV_POTION_EXPERIENCE:
\r
508 if (p_ptr->prace == RACE_ANDROID) break;
\r
509 chg_virtue(V_ENLIGHTEN, 1);
\r
510 if (p_ptr->exp < PY_MAX_EXP)
\r
512 s32b ee = (p_ptr->exp / 2) + 10;
\r
513 if (ee > 100000L) ee = 100000L;
\r
514 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
\r
520 case SV_POTION_RESISTANCE:
\r
521 (void)set_oppose_acid(p_ptr->oppose_acid + randint1(20) + 20, FALSE);
\r
522 (void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
\r
523 (void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
\r
524 (void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
\r
525 (void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
\r
529 case SV_POTION_CURING:
\r
530 if (hp_player(50)) ident = TRUE;
\r
531 if (set_blind(0)) ident = TRUE;
\r
532 if (set_poisoned(0)) ident = TRUE;
\r
533 if (set_confused(0)) ident = TRUE;
\r
534 if (set_stun(0)) ident = TRUE;
\r
535 if (set_cut(0)) ident = TRUE;
\r
536 if (set_image(0)) ident = TRUE;
\r
539 case SV_POTION_INVULNERABILITY:
\r
540 (void)set_invuln(p_ptr->invuln + randint1(4) + 4, FALSE);
\r
544 case SV_POTION_NEW_LIFE:
\r
545 do_cmd_rerate(FALSE);
\r
547 p_ptr->update |= PU_BONUS;
\r
548 lose_all_mutations();
\r
552 case SV_POTION_NEO_TSUYOSHI:
\r
553 (void)set_image(0);
\r
554 (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
\r
558 case SV_POTION_TSUYOSHI:
\r
559 msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
\r
561 p_ptr->tsuyoshi = 1;
\r
562 (void)set_tsuyoshi(0, TRUE);
\r
563 if (!p_ptr->resist_chaos)
\r
565 (void)set_image(50 + randint1(50));
\r
570 case SV_POTION_POLYMORPH:
\r
571 if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23))
\r
573 lose_all_mutations();
\r
581 if(gain_random_mutation(0)) ident = TRUE;
\r
583 else if (lose_mutation(0)) ident = TRUE;
\r
584 } while(!ident || one_in_(2));
\r
590 if (prace_is_(RACE_SKELETON))
\r
592 msg_print(_("液体の一部はあなたのアゴを素通りして落ちた!", "Some of the fluid falls through your jaws!"));
\r
593 (void)potion_smash_effect(0, p_ptr->y, p_ptr->x, q_ptr->k_idx);
\r
596 /* Combine / Reorder the pack (later) */
\r
597 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
\r
599 if (!(object_is_aware(q_ptr)))
\r
601 chg_virtue(V_PATIENCE, -1);
\r
602 chg_virtue(V_CHANCE, 1);
\r
603 chg_virtue(V_KNOWLEDGE, -1);
\r
606 /* The item has been tried */
\r
607 object_tried(q_ptr);
\r
609 /* An identification was made */
\r
610 if (ident && !object_is_aware(q_ptr))
\r
612 object_aware(q_ptr);
\r
613 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
\r
617 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
\r
619 /* Potions can feed the player */
\r
620 switch (p_ptr->mimic_form)
\r
623 switch (p_ptr->prace)
\r
626 (void)set_food(p_ptr->food + (q_ptr->pval / 10));
\r
628 case RACE_SKELETON:
\r
635 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
638 if (q_ptr->tval == TV_FLASK)
\r
640 msg_print(_("オイルを補給した。", "You replenish yourself with the oil."));
\r
641 set_food(p_ptr->food + 5000);
\r
645 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
649 msg_print(_("水分を取り込んだ。", "You are moistened."));
\r
650 set_food(MIN(p_ptr->food + q_ptr->pval + MAX(0, q_ptr->pval * 10) + 2000, PY_FOOD_MAX - 1));
\r
653 (void)set_food(p_ptr->food + q_ptr->pval);
\r
658 case MIMIC_DEMON_LORD:
\r
659 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
661 case MIMIC_VAMPIRE:
\r
662 (void)set_food(p_ptr->food + (q_ptr->pval / 10));
\r
665 (void)set_food(p_ptr->food + q_ptr->pval);
\r
673 * @brief 薬を飲むコマンドのメインルーチン /
\r
674 * Quaff some potion (from the pack or floor)
\r
677 void do_cmd_quaff_potion(void)
\r
682 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
\r
684 set_action(ACTION_NONE);
\r
687 /* Restrict choices to potions */
\r
688 item_tester_hook = item_tester_hook_quaff;
\r
691 q = _("どの薬を飲みますか? ", "Quaff which potion? ");
\r
692 s = _("飲める薬がない。", "You have no potions to quaff.");
\r
694 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
\r
696 /* Quaff the potion */
\r
697 do_cmd_quaff_potion_aux(item);
\r