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_BOOZE:
\r
156 ident = booze(p_ptr);
\r
159 case SV_POTION_SLEEP:
\r
160 if (!p_ptr->free_act)
\r
162 msg_print(_("あなたは眠ってしまった。", "You fall asleep."));
\r
164 if (ironman_nightmare)
\r
166 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
\r
168 /* Have some nightmares */
\r
169 sanity_blast(NULL, FALSE);
\r
171 if (set_paralyzed(p_ptr->paralyzed + randint0(4) + 4))
\r
178 case SV_POTION_LOSE_MEMORIES:
\r
179 if (!p_ptr->hold_exp && (p_ptr->exp > 0))
\r
181 msg_print(_("過去の記憶が薄れていく気がする。", "You feel your memories fade."));
\r
182 chg_virtue(V_KNOWLEDGE, -5);
\r
184 lose_exp(p_ptr->exp / 4);
\r
189 case SV_POTION_RUINATION:
\r
190 msg_print(_("身も心も弱ってきて、精気が抜けていくようだ。", "Your nerves and muscles feel weak and lifeless!"));
\r
191 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), _("破滅の薬", "a potion of Ruination"), -1);
\r
193 (void)dec_stat(A_DEX, 25, TRUE);
\r
194 (void)dec_stat(A_WIS, 25, TRUE);
\r
195 (void)dec_stat(A_CON, 25, TRUE);
\r
196 (void)dec_stat(A_STR, 25, TRUE);
\r
197 (void)dec_stat(A_CHR, 25, TRUE);
\r
198 (void)dec_stat(A_INT, 25, TRUE);
\r
202 case SV_POTION_DEC_STR:
\r
203 if (do_dec_stat(A_STR)) ident = TRUE;
\r
206 case SV_POTION_DEC_INT:
\r
207 if (do_dec_stat(A_INT)) ident = TRUE;
\r
210 case SV_POTION_DEC_WIS:
\r
211 if (do_dec_stat(A_WIS)) ident = TRUE;
\r
214 case SV_POTION_DEC_DEX:
\r
215 if (do_dec_stat(A_DEX)) ident = TRUE;
\r
218 case SV_POTION_DEC_CON:
\r
219 if (do_dec_stat(A_CON)) ident = TRUE;
\r
222 case SV_POTION_DEC_CHR:
\r
223 if (do_dec_stat(A_CHR)) ident = TRUE;
\r
226 case SV_POTION_DETONATIONS:
\r
227 ident = detonation(p_ptr);
\r
230 case SV_POTION_DEATH:
\r
231 chg_virtue(V_VITALITY, -1);
\r
232 chg_virtue(V_UNLIFE, 5);
\r
233 msg_print(_("死の予感が体中を駆けめぐった。", "A feeling of Death flows through your body."));
\r
234 take_hit(DAMAGE_LOSELIFE, 5000, _("死の薬", "a potion of Death"), -1);
\r
238 case SV_POTION_INFRAVISION:
\r
239 if (set_tim_infra(p_ptr->tim_infra + 100 + randint1(100), FALSE))
\r
245 case SV_POTION_DETECT_INVIS:
\r
246 if (set_tim_invis(p_ptr->tim_invis + 12 + randint1(12), FALSE))
\r
252 case SV_POTION_SLOW_POISON:
\r
253 if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
\r
256 case SV_POTION_CURE_POISON:
\r
257 if (set_poisoned(0)) ident = TRUE;
\r
260 case SV_POTION_BOLDNESS:
\r
261 if (set_afraid(0)) ident = TRUE;
\r
264 case SV_POTION_SPEED:
\r
267 if (set_fast(randint1(25) + 15, FALSE)) ident = TRUE;
\r
271 (void)set_fast(p_ptr->fast + 5, FALSE);
\r
275 case SV_POTION_RESIST_HEAT:
\r
276 if (set_oppose_fire(p_ptr->oppose_fire + randint1(10) + 10, FALSE))
\r
282 case SV_POTION_RESIST_COLD:
\r
283 if (set_oppose_cold(p_ptr->oppose_cold + randint1(10) + 10, FALSE))
\r
289 case SV_POTION_HEROISM:
\r
290 ident = heroism(25);
\r
293 case SV_POTION_BESERK_STRENGTH:
\r
294 ident = berserk(randint1(25) + 25);
\r
297 case SV_POTION_CURE_LIGHT:
\r
298 ident = cure_light_wounds(2, 8);
\r
301 case SV_POTION_CURE_SERIOUS:
\r
302 ident = cure_serious_wounds(4, 8);
\r
305 case SV_POTION_CURE_CRITICAL:
\r
306 ident = cure_critical_wounds(damroll(6, 8));
\r
309 case SV_POTION_HEALING:
\r
310 ident = cure_critical_wounds(300);
\r
313 case SV_POTION_STAR_HEALING:
\r
314 ident = cure_critical_wounds(1200);
\r
317 case SV_POTION_LIFE:
\r
318 ident = life_stream(TRUE, TRUE);
\r
321 case SV_POTION_RESTORE_MANA:
\r
322 ident = restore_mana(TRUE);
\r
325 case SV_POTION_RESTORE_EXP:
\r
326 if (restore_level()) ident = TRUE;
\r
329 case SV_POTION_RES_STR:
\r
330 if (do_res_stat(A_STR)) ident = TRUE;
\r
333 case SV_POTION_RES_INT:
\r
334 if (do_res_stat(A_INT)) ident = TRUE;
\r
337 case SV_POTION_RES_WIS:
\r
338 if (do_res_stat(A_WIS)) ident = TRUE;
\r
341 case SV_POTION_RES_DEX:
\r
342 if (do_res_stat(A_DEX)) ident = TRUE;
\r
345 case SV_POTION_RES_CON:
\r
346 if (do_res_stat(A_CON)) ident = TRUE;
\r
349 case SV_POTION_RES_CHR:
\r
350 if (do_res_stat(A_CHR)) ident = TRUE;
\r
353 case SV_POTION_INC_STR:
\r
354 if (do_inc_stat(A_STR)) ident = TRUE;
\r
357 case SV_POTION_INC_INT:
\r
358 if (do_inc_stat(A_INT)) ident = TRUE;
\r
361 case SV_POTION_INC_WIS:
\r
362 if (do_inc_stat(A_WIS)) ident = TRUE;
\r
365 case SV_POTION_INC_DEX:
\r
366 if (do_inc_stat(A_DEX)) ident = TRUE;
\r
369 case SV_POTION_INC_CON:
\r
370 if (do_inc_stat(A_CON)) ident = TRUE;
\r
373 case SV_POTION_INC_CHR:
\r
374 if (do_inc_stat(A_CHR)) ident = TRUE;
\r
377 case SV_POTION_AUGMENTATION:
\r
378 if (do_inc_stat(A_STR)) ident = TRUE;
\r
379 if (do_inc_stat(A_INT)) ident = TRUE;
\r
380 if (do_inc_stat(A_WIS)) ident = TRUE;
\r
381 if (do_inc_stat(A_DEX)) ident = TRUE;
\r
382 if (do_inc_stat(A_CON)) ident = TRUE;
\r
383 if (do_inc_stat(A_CHR)) ident = TRUE;
\r
386 case SV_POTION_ENLIGHTENMENT:
\r
387 msg_print(_("自分の置かれている状況が脳裏に浮かんできた...", "An image of your surroundings forms in your mind..."));
\r
388 chg_virtue(V_KNOWLEDGE, 1);
\r
389 chg_virtue(V_ENLIGHTEN, 1);
\r
394 case SV_POTION_STAR_ENLIGHTENMENT:
\r
395 msg_print(_("更なる啓蒙を感じた...", "You begin to feel more enlightened..."));
\r
396 chg_virtue(V_KNOWLEDGE, 1);
\r
397 chg_virtue(V_ENLIGHTEN, 2);
\r
400 (void)do_inc_stat(A_INT);
\r
401 (void)do_inc_stat(A_WIS);
\r
402 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
\r
403 (void)detect_doors(DETECT_RAD_DEFAULT);
\r
404 (void)detect_stairs(DETECT_RAD_DEFAULT);
\r
405 (void)detect_treasure(DETECT_RAD_DEFAULT);
\r
406 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
\r
407 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
\r
413 case SV_POTION_SELF_KNOWLEDGE:
\r
414 msg_print(_("自分自身のことが少しは分かった気がする...", "You begin to know yourself a little better..."));
\r
420 case SV_POTION_EXPERIENCE:
\r
421 if (p_ptr->prace == RACE_ANDROID) break;
\r
422 chg_virtue(V_ENLIGHTEN, 1);
\r
423 if (p_ptr->exp < PY_MAX_EXP)
\r
425 s32b ee = (p_ptr->exp / 2) + 10;
\r
426 if (ee > 100000L) ee = 100000L;
\r
427 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
\r
433 case SV_POTION_RESISTANCE:
\r
434 (void)set_oppose_acid(p_ptr->oppose_acid + randint1(20) + 20, FALSE);
\r
435 (void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
\r
436 (void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
\r
437 (void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
\r
438 (void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
\r
442 case SV_POTION_CURING:
\r
443 if (true_healing(50)) ident = TRUE;
\r
446 case SV_POTION_INVULNERABILITY:
\r
447 (void)set_invuln(p_ptr->invuln + randint1(4) + 4, FALSE);
\r
451 case SV_POTION_NEW_LIFE:
\r
452 do_cmd_rerate(FALSE);
\r
454 p_ptr->update |= PU_BONUS;
\r
455 lose_all_mutations();
\r
459 case SV_POTION_NEO_TSUYOSHI:
\r
460 (void)set_image(0);
\r
461 (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
\r
465 case SV_POTION_TSUYOSHI:
\r
466 msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
\r
468 p_ptr->tsuyoshi = 1;
\r
469 (void)set_tsuyoshi(0, TRUE);
\r
470 if (!p_ptr->resist_chaos)
\r
472 (void)set_image(50 + randint1(50));
\r
477 case SV_POTION_POLYMORPH:
\r
478 if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23))
\r
480 lose_all_mutations();
\r
488 if(gain_random_mutation(0)) ident = TRUE;
\r
490 else if (lose_mutation(0)) ident = TRUE;
\r
491 } while(!ident || one_in_(2));
\r
497 if (prace_is_(RACE_SKELETON))
\r
499 msg_print(_("液体の一部はあなたのアゴを素通りして落ちた!", "Some of the fluid falls through your jaws!"));
\r
500 (void)potion_smash_effect(0, p_ptr->y, p_ptr->x, q_ptr->k_idx);
\r
503 /* Combine / Reorder the pack (later) */
\r
504 p_ptr->update |= (PU_COMBINE | PU_REORDER);
\r
506 if (!(object_is_aware(q_ptr)))
\r
508 chg_virtue(V_PATIENCE, -1);
\r
509 chg_virtue(V_CHANCE, 1);
\r
510 chg_virtue(V_KNOWLEDGE, -1);
\r
513 /* The item has been tried */
\r
514 object_tried(q_ptr);
\r
516 /* An identification was made */
\r
517 if (ident && !object_is_aware(q_ptr))
\r
519 object_aware(q_ptr);
\r
520 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
\r
523 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
\r
525 /* Potions can feed the player */
\r
526 switch (p_ptr->mimic_form)
\r
529 switch (p_ptr->prace)
\r
532 (void)set_food(p_ptr->food + (q_ptr->pval / 10));
\r
534 case RACE_SKELETON:
\r
541 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
544 if (q_ptr->tval == TV_FLASK)
\r
546 msg_print(_("オイルを補給した。", "You replenish yourself with the oil."));
\r
547 set_food(p_ptr->food + 5000);
\r
551 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
555 msg_print(_("水分を取り込んだ。", "You are moistened."));
\r
556 set_food(MIN(p_ptr->food + q_ptr->pval + MAX(0, q_ptr->pval * 10) + 2000, PY_FOOD_MAX - 1));
\r
559 (void)set_food(p_ptr->food + q_ptr->pval);
\r
564 case MIMIC_DEMON_LORD:
\r
565 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
567 case MIMIC_VAMPIRE:
\r
568 (void)set_food(p_ptr->food + (q_ptr->pval / 10));
\r
571 (void)set_food(p_ptr->food + q_ptr->pval);
\r
579 * @brief 薬を飲むコマンドのメインルーチン /
\r
580 * Quaff some potion (from the pack or floor)
\r
583 void do_cmd_quaff_potion(void)
\r
588 if (p_ptr->wild_mode)
\r
593 if (p_ptr->inside_arena)
\r
595 msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
\r
600 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
\r
602 set_action(ACTION_NONE);
\r
605 /* Restrict choices to potions */
\r
606 item_tester_hook = item_tester_hook_quaff;
\r
608 q = _("どの薬を飲みますか? ", "Quaff which potion? ");
\r
609 s = _("飲める薬がない。", "You have no potions to quaff.");
\r
611 if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
\r
613 /* Quaff the potion */
\r
614 do_cmd_quaff_potion_aux(item);
\r