3 * @brief プレイヤーの飲むコマンド実装
11 #include "object-hook.h"
14 #include "spells-status.h"
15 #include "player-status.h"
16 #include "realm-hex.h"
17 #include "spells-floor.h"
18 #include "object-broken.h"
21 * @brief 薬を飲むコマンドのサブルーチン /
22 * Quaff a potion (from the pack or the floor)
23 * @param item 飲む薬オブジェクトの所持品ID
26 void do_cmd_quaff_potion_aux(INVENTORY_IDX item)
34 take_turn(p_ptr, 100);
38 if (flush_failure) flush();
39 msg_print(_("瓶から水が流れ出てこない!", "The potion doesn't flow out from a bottle."));
45 if (music_singing_any()) stop_singing(p_ptr);
46 if (hex_spelling_any())
48 if (!hex_spelling(HEX_INHAIL)) stop_hex_spell_all();
51 /* Get the item (in the pack) */
54 o_ptr = &inventory[item];
57 /* Get the item (on the floor) */
60 o_ptr = ¤t_floor_ptr->o_list[0 - item];
64 /* Obtain a local object */
65 object_copy(q_ptr, o_ptr);
70 /* Reduce and describe inventory */
73 inven_item_increase(item, -1);
74 inven_item_describe(item);
75 inven_item_optimize(item);
78 /* Reduce and describe floor item */
81 floor_item_increase(0 - item, -1);
82 floor_item_describe(0 - item);
83 floor_item_optimize(0 - item);
89 /* Not identified yet */
93 lev = k_info[q_ptr->k_idx].level;
95 /* Analyze the potion */
96 if (q_ptr->tval == TV_POTION)
100 /* 飲みごたえをオリジナルより細かく表現 */
101 case SV_POTION_WATER:
102 msg_print(_("口の中がさっぱりした。", ""));
103 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
107 case SV_POTION_APPLE_JUICE:
108 msg_print(_("甘くてサッパリとしていて、とてもおいしい。", ""));
109 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
113 case SV_POTION_SLIME_MOLD:
114 msg_print(_("なんとも不気味な味だ。", ""));
115 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
119 case SV_POTION_SLOWNESS:
120 if (set_slow(randint1(25) + 15, FALSE)) ident = TRUE;
123 case SV_POTION_SALT_WATER:
124 msg_print(_("うぇ!思わず吐いてしまった。", "The potion makes you vomit!"));
126 if (!(prace_is_(RACE_GOLEM) ||
127 prace_is_(RACE_ZOMBIE) ||
128 prace_is_(RACE_DEMON) ||
129 prace_is_(RACE_ANDROID) ||
130 prace_is_(RACE_SPECTRE) ||
131 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING)))
133 /* Only living creatures get thirsty */
134 (void)set_food(PY_FOOD_STARVE - 1);
137 (void)set_poisoned(0);
138 (void)set_paralyzed(p_ptr->paralyzed + 4);
142 case SV_POTION_POISON:
143 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
145 if (set_poisoned(p_ptr->poisoned + randint0(15) + 10))
152 case SV_POTION_BLINDNESS:
153 if (!p_ptr->resist_blind)
155 if (set_blind(p_ptr->blind + randint0(100) + 100))
162 case SV_POTION_BOOZE:
163 ident = booze(p_ptr);
166 case SV_POTION_SLEEP:
167 if (!p_ptr->free_act)
169 msg_print(_("あなたは眠ってしまった。", "You fall asleep."));
171 if (ironman_nightmare)
173 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
175 /* Have some nightmares */
176 sanity_blast(NULL, FALSE);
178 if (set_paralyzed(p_ptr->paralyzed + randint0(4) + 4))
185 case SV_POTION_LOSE_MEMORIES:
186 if (!p_ptr->hold_exp && (p_ptr->exp > 0))
188 msg_print(_("過去の記憶が薄れていく気がする。", "You feel your memories fade."));
189 chg_virtue(V_KNOWLEDGE, -5);
191 lose_exp(p_ptr->exp / 4);
196 case SV_POTION_RUINATION:
197 msg_print(_("身も心も弱ってきて、精気が抜けていくようだ。", "Your nerves and muscles feel weak and lifeless!"));
198 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), _("破滅の薬", "a potion of Ruination"), -1);
200 (void)dec_stat(A_DEX, 25, TRUE);
201 (void)dec_stat(A_WIS, 25, TRUE);
202 (void)dec_stat(A_CON, 25, TRUE);
203 (void)dec_stat(A_STR, 25, TRUE);
204 (void)dec_stat(A_CHR, 25, TRUE);
205 (void)dec_stat(A_INT, 25, TRUE);
209 case SV_POTION_DEC_STR:
210 if (do_dec_stat(A_STR)) ident = TRUE;
213 case SV_POTION_DEC_INT:
214 if (do_dec_stat(A_INT)) ident = TRUE;
217 case SV_POTION_DEC_WIS:
218 if (do_dec_stat(A_WIS)) ident = TRUE;
221 case SV_POTION_DEC_DEX:
222 if (do_dec_stat(A_DEX)) ident = TRUE;
225 case SV_POTION_DEC_CON:
226 if (do_dec_stat(A_CON)) ident = TRUE;
229 case SV_POTION_DEC_CHR:
230 if (do_dec_stat(A_CHR)) ident = TRUE;
233 case SV_POTION_DETONATIONS:
234 ident = detonation(p_ptr);
237 case SV_POTION_DEATH:
238 chg_virtue(V_VITALITY, -1);
239 chg_virtue(V_UNLIFE, 5);
240 msg_print(_("死の予感が体中を駆けめぐった。", "A feeling of Death flows through your body."));
241 take_hit(DAMAGE_LOSELIFE, 5000, _("死の薬", "a potion of Death"), -1);
245 case SV_POTION_INFRAVISION:
246 if (set_tim_infra(p_ptr->tim_infra + 100 + randint1(100), FALSE))
252 case SV_POTION_DETECT_INVIS:
253 if (set_tim_invis(p_ptr->tim_invis + 12 + randint1(12), FALSE))
259 case SV_POTION_SLOW_POISON:
260 if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
263 case SV_POTION_CURE_POISON:
264 if (set_poisoned(0)) ident = TRUE;
267 case SV_POTION_BOLDNESS:
268 if (set_afraid(0)) ident = TRUE;
271 case SV_POTION_SPEED:
274 if (set_fast(randint1(25) + 15, FALSE)) ident = TRUE;
278 (void)set_fast(p_ptr->fast + 5, FALSE);
282 case SV_POTION_RESIST_HEAT:
283 if (set_oppose_fire(p_ptr->oppose_fire + randint1(10) + 10, FALSE))
289 case SV_POTION_RESIST_COLD:
290 if (set_oppose_cold(p_ptr->oppose_cold + randint1(10) + 10, FALSE))
296 case SV_POTION_HEROISM:
300 case SV_POTION_BESERK_STRENGTH:
301 ident = berserk(randint1(25) + 25);
304 case SV_POTION_CURE_LIGHT:
305 ident = cure_light_wounds(2, 8);
308 case SV_POTION_CURE_SERIOUS:
309 ident = cure_serious_wounds(4, 8);
312 case SV_POTION_CURE_CRITICAL:
313 ident = cure_critical_wounds(damroll(6, 8));
316 case SV_POTION_HEALING:
317 ident = cure_critical_wounds(300);
320 case SV_POTION_STAR_HEALING:
321 ident = cure_critical_wounds(1200);
325 ident = life_stream(TRUE, TRUE);
328 case SV_POTION_RESTORE_MANA:
329 ident = restore_mana(TRUE);
332 case SV_POTION_RESTORE_EXP:
333 if (restore_level()) ident = TRUE;
336 case SV_POTION_RES_STR:
337 if (do_res_stat(A_STR)) ident = TRUE;
340 case SV_POTION_RES_INT:
341 if (do_res_stat(A_INT)) ident = TRUE;
344 case SV_POTION_RES_WIS:
345 if (do_res_stat(A_WIS)) ident = TRUE;
348 case SV_POTION_RES_DEX:
349 if (do_res_stat(A_DEX)) ident = TRUE;
352 case SV_POTION_RES_CON:
353 if (do_res_stat(A_CON)) ident = TRUE;
356 case SV_POTION_RES_CHR:
357 if (do_res_stat(A_CHR)) ident = TRUE;
360 case SV_POTION_INC_STR:
361 if (do_inc_stat(A_STR)) ident = TRUE;
364 case SV_POTION_INC_INT:
365 if (do_inc_stat(A_INT)) ident = TRUE;
368 case SV_POTION_INC_WIS:
369 if (do_inc_stat(A_WIS)) ident = TRUE;
372 case SV_POTION_INC_DEX:
373 if (do_inc_stat(A_DEX)) ident = TRUE;
376 case SV_POTION_INC_CON:
377 if (do_inc_stat(A_CON)) ident = TRUE;
380 case SV_POTION_INC_CHR:
381 if (do_inc_stat(A_CHR)) ident = TRUE;
384 case SV_POTION_AUGMENTATION:
385 if (do_inc_stat(A_STR)) ident = TRUE;
386 if (do_inc_stat(A_INT)) ident = TRUE;
387 if (do_inc_stat(A_WIS)) ident = TRUE;
388 if (do_inc_stat(A_DEX)) ident = TRUE;
389 if (do_inc_stat(A_CON)) ident = TRUE;
390 if (do_inc_stat(A_CHR)) ident = TRUE;
393 case SV_POTION_ENLIGHTENMENT:
394 msg_print(_("自分の置かれている状況が脳裏に浮かんできた...", "An image of your surroundings forms in your mind..."));
395 chg_virtue(V_KNOWLEDGE, 1);
396 chg_virtue(V_ENLIGHTEN, 1);
401 case SV_POTION_STAR_ENLIGHTENMENT:
402 msg_print(_("更なる啓蒙を感じた...", "You begin to feel more enlightened..."));
403 chg_virtue(V_KNOWLEDGE, 1);
404 chg_virtue(V_ENLIGHTEN, 2);
407 (void)do_inc_stat(A_INT);
408 (void)do_inc_stat(A_WIS);
409 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
410 (void)detect_doors(DETECT_RAD_DEFAULT);
411 (void)detect_stairs(DETECT_RAD_DEFAULT);
412 (void)detect_treasure(DETECT_RAD_DEFAULT);
413 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
414 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
420 case SV_POTION_SELF_KNOWLEDGE:
421 msg_print(_("自分自身のことが少しは分かった気がする...", "You begin to know yourself a little better..."));
427 case SV_POTION_EXPERIENCE:
428 if (p_ptr->prace == RACE_ANDROID) break;
429 chg_virtue(V_ENLIGHTEN, 1);
430 if (p_ptr->exp < PY_MAX_EXP)
432 EXP ee = (p_ptr->exp / 2) + 10;
433 if (ee > 100000L) ee = 100000L;
434 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
440 case SV_POTION_RESISTANCE:
441 (void)set_oppose_acid(p_ptr->oppose_acid + randint1(20) + 20, FALSE);
442 (void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
443 (void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
444 (void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
445 (void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
449 case SV_POTION_CURING:
450 if (true_healing(50)) ident = TRUE;
453 case SV_POTION_INVULNERABILITY:
454 (void)set_invuln(p_ptr->invuln + randint1(4) + 4, FALSE);
458 case SV_POTION_NEW_LIFE:
459 roll_hitdice(p_ptr, 0L);
461 p_ptr->update |= PU_BONUS;
462 lose_all_mutations();
466 case SV_POTION_NEO_TSUYOSHI:
468 (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
472 case SV_POTION_TSUYOSHI:
473 msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
476 (void)set_tsuyoshi(0, TRUE);
477 if (!p_ptr->resist_chaos)
479 (void)set_image(50 + randint1(50));
484 case SV_POTION_POLYMORPH:
485 if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23))
487 lose_all_mutations();
495 if(gain_mutation(p_ptr, 0)) ident = TRUE;
497 else if (lose_mutation(0)) ident = TRUE;
498 } while(!ident || one_in_(2));
504 if (prace_is_(RACE_SKELETON))
506 msg_print(_("液体の一部はあなたのアゴを素通りして落ちた!", "Some of the fluid falls through your jaws!"));
507 (void)potion_smash_effect(0, p_ptr->y, p_ptr->x, q_ptr->k_idx);
509 p_ptr->update |= (PU_COMBINE | PU_REORDER);
511 if (!(object_is_aware(q_ptr)))
513 chg_virtue(V_PATIENCE, -1);
514 chg_virtue(V_CHANCE, 1);
515 chg_virtue(V_KNOWLEDGE, -1);
518 /* The item has been tried */
521 /* An identification was made */
522 if (ident && !object_is_aware(q_ptr))
525 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
528 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
530 /* Potions can feed the player */
531 switch (p_ptr->mimic_form)
534 switch (p_ptr->prace)
537 (void)set_food(p_ptr->food + (q_ptr->pval / 10));
546 set_food(p_ptr->food + ((q_ptr->pval) / 20));
549 if (q_ptr->tval == TV_FLASK)
551 msg_print(_("オイルを補給した。", "You replenish yourself with the oil."));
552 set_food(p_ptr->food + 5000);
556 set_food(p_ptr->food + ((q_ptr->pval) / 20));
560 msg_print(_("水分を取り込んだ。", "You are moistened."));
561 set_food(MIN(p_ptr->food + q_ptr->pval + MAX(0, q_ptr->pval * 10) + 2000, PY_FOOD_MAX - 1));
564 (void)set_food(p_ptr->food + q_ptr->pval);
569 case MIMIC_DEMON_LORD:
570 set_food(p_ptr->food + ((q_ptr->pval) / 20));
573 (void)set_food(p_ptr->food + (q_ptr->pval / 10));
576 (void)set_food(p_ptr->food + q_ptr->pval);
584 * @brief 薬を飲むコマンドのメインルーチン /
585 * Quaff some potion (from the pack or floor)
588 void do_cmd_quaff_potion(void)
593 if (p_ptr->wild_mode)
598 if (cmd_limit_arena(p_ptr)) return;
600 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
602 set_action(ACTION_NONE);
605 /* Restrict choices to potions */
606 item_tester_hook = item_tester_hook_quaff;
608 q = _("どの薬を飲みますか? ", "Quaff which potion? ");
609 s = _("飲める薬がない。", "You have no potions to quaff.");
611 if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
613 /* Quaff the potion */
614 do_cmd_quaff_potion_aux(item);