3 * @brief プレイヤーの飲むコマンド実装
\r
10 #include "selfinfo.h"
\r
11 #include "object-hook.h"
\r
12 #include "mutation.h"
\r
14 #include "spells-status.h"
\r
17 * @brief 薬を飲むコマンドのサブルーチン /
\r
18 * Quaff a potion (from the pack or the floor)
\r
19 * @param item 飲む薬オブジェクトの所持品ID
\r
22 void do_cmd_quaff_potion_aux(INVENTORY_IDX item)
\r
33 if (flush_failure) flush();
\r
34 msg_print(_("瓶から水が流れ出てこない!", "The potion doesn't flow out from a bottle."));
\r
40 if (music_singing_any()) stop_singing();
\r
41 if (hex_spelling_any())
\r
43 if (!hex_spelling(HEX_INHAIL)) stop_hex_spell_all();
\r
46 /* Get the item (in the pack) */
\r
49 o_ptr = &inventory[item];
\r
52 /* Get the item (on the floor) */
\r
55 o_ptr = &o_list[0 - item];
\r
59 /* Obtain a local object */
\r
60 object_copy(q_ptr, o_ptr);
\r
65 /* Reduce and describe inventory */
\r
68 inven_item_increase(item, -1);
\r
69 inven_item_describe(item);
\r
70 inven_item_optimize(item);
\r
73 /* Reduce and describe floor item */
\r
76 floor_item_increase(0 - item, -1);
\r
77 floor_item_describe(0 - item);
\r
78 floor_item_optimize(0 - item);
\r
84 /* Not identified yet */
\r
88 lev = k_info[q_ptr->k_idx].level;
\r
90 /* Analyze the potion */
\r
91 if (q_ptr->tval == TV_POTION)
\r
93 switch (q_ptr->sval)
\r
95 /* 飲みごたえをオリジナルより細かく表現 */
\r
96 case SV_POTION_WATER:
\r
97 msg_print(_("口の中がさっぱりした。", ""));
\r
98 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
\r
102 case SV_POTION_APPLE_JUICE:
\r
103 msg_print(_("甘くてサッパリとしていて、とてもおいしい。", ""));
\r
104 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
\r
108 case SV_POTION_SLIME_MOLD:
\r
109 msg_print(_("なんとも不気味な味だ。", ""));
\r
110 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
\r
114 case SV_POTION_SLOWNESS:
\r
115 if (set_slow(randint1(25) + 15, FALSE)) ident = TRUE;
\r
118 case SV_POTION_SALT_WATER:
\r
119 msg_print(_("うぇ!思わず吐いてしまった。", "The potion makes you vomit!"));
\r
121 if (!(prace_is_(RACE_GOLEM) ||
\r
122 prace_is_(RACE_ZOMBIE) ||
\r
123 prace_is_(RACE_DEMON) ||
\r
124 prace_is_(RACE_ANDROID) ||
\r
125 prace_is_(RACE_SPECTRE) ||
\r
126 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING)))
\r
128 /* Only living creatures get thirsty */
\r
129 (void)set_food(PY_FOOD_STARVE - 1);
\r
132 (void)set_poisoned(0);
\r
133 (void)set_paralyzed(p_ptr->paralyzed + 4);
\r
137 case SV_POTION_POISON:
\r
138 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
\r
140 if (set_poisoned(p_ptr->poisoned + randint0(15) + 10))
\r
147 case SV_POTION_BLINDNESS:
\r
148 if (!p_ptr->resist_blind)
\r
150 if (set_blind(p_ptr->blind + randint0(100) + 100))
\r
157 case SV_POTION_BOOZE:
\r
158 ident = booze(p_ptr);
\r
161 case SV_POTION_SLEEP:
\r
162 if (!p_ptr->free_act)
\r
164 msg_print(_("あなたは眠ってしまった。", "You fall asleep."));
\r
166 if (ironman_nightmare)
\r
168 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
\r
170 /* Have some nightmares */
\r
171 sanity_blast(NULL, FALSE);
\r
173 if (set_paralyzed(p_ptr->paralyzed + randint0(4) + 4))
\r
180 case SV_POTION_LOSE_MEMORIES:
\r
181 if (!p_ptr->hold_exp && (p_ptr->exp > 0))
\r
183 msg_print(_("過去の記憶が薄れていく気がする。", "You feel your memories fade."));
\r
184 chg_virtue(V_KNOWLEDGE, -5);
\r
186 lose_exp(p_ptr->exp / 4);
\r
191 case SV_POTION_RUINATION:
\r
192 msg_print(_("身も心も弱ってきて、精気が抜けていくようだ。", "Your nerves and muscles feel weak and lifeless!"));
\r
193 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), _("破滅の薬", "a potion of Ruination"), -1);
\r
195 (void)dec_stat(A_DEX, 25, TRUE);
\r
196 (void)dec_stat(A_WIS, 25, TRUE);
\r
197 (void)dec_stat(A_CON, 25, TRUE);
\r
198 (void)dec_stat(A_STR, 25, TRUE);
\r
199 (void)dec_stat(A_CHR, 25, TRUE);
\r
200 (void)dec_stat(A_INT, 25, TRUE);
\r
204 case SV_POTION_DEC_STR:
\r
205 if (do_dec_stat(A_STR)) ident = TRUE;
\r
208 case SV_POTION_DEC_INT:
\r
209 if (do_dec_stat(A_INT)) ident = TRUE;
\r
212 case SV_POTION_DEC_WIS:
\r
213 if (do_dec_stat(A_WIS)) ident = TRUE;
\r
216 case SV_POTION_DEC_DEX:
\r
217 if (do_dec_stat(A_DEX)) ident = TRUE;
\r
220 case SV_POTION_DEC_CON:
\r
221 if (do_dec_stat(A_CON)) ident = TRUE;
\r
224 case SV_POTION_DEC_CHR:
\r
225 if (do_dec_stat(A_CHR)) ident = TRUE;
\r
228 case SV_POTION_DETONATIONS:
\r
229 ident = detonation(p_ptr);
\r
232 case SV_POTION_DEATH:
\r
233 chg_virtue(V_VITALITY, -1);
\r
234 chg_virtue(V_UNLIFE, 5);
\r
235 msg_print(_("死の予感が体中を駆けめぐった。", "A feeling of Death flows through your body."));
\r
236 take_hit(DAMAGE_LOSELIFE, 5000, _("死の薬", "a potion of Death"), -1);
\r
240 case SV_POTION_INFRAVISION:
\r
241 if (set_tim_infra(p_ptr->tim_infra + 100 + randint1(100), FALSE))
\r
247 case SV_POTION_DETECT_INVIS:
\r
248 if (set_tim_invis(p_ptr->tim_invis + 12 + randint1(12), FALSE))
\r
254 case SV_POTION_SLOW_POISON:
\r
255 if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
\r
258 case SV_POTION_CURE_POISON:
\r
259 if (set_poisoned(0)) ident = TRUE;
\r
262 case SV_POTION_BOLDNESS:
\r
263 if (set_afraid(0)) ident = TRUE;
\r
266 case SV_POTION_SPEED:
\r
269 if (set_fast(randint1(25) + 15, FALSE)) ident = TRUE;
\r
273 (void)set_fast(p_ptr->fast + 5, FALSE);
\r
277 case SV_POTION_RESIST_HEAT:
\r
278 if (set_oppose_fire(p_ptr->oppose_fire + randint1(10) + 10, FALSE))
\r
284 case SV_POTION_RESIST_COLD:
\r
285 if (set_oppose_cold(p_ptr->oppose_cold + randint1(10) + 10, FALSE))
\r
291 case SV_POTION_HEROISM:
\r
292 ident = heroism(25);
\r
295 case SV_POTION_BESERK_STRENGTH:
\r
296 ident = berserk(randint1(25) + 25);
\r
299 case SV_POTION_CURE_LIGHT:
\r
300 ident = cure_light_wounds(2, 8);
\r
303 case SV_POTION_CURE_SERIOUS:
\r
304 ident = cure_serious_wounds(4, 8);
\r
307 case SV_POTION_CURE_CRITICAL:
\r
308 ident = cure_critical_wounds(damroll(6, 8));
\r
311 case SV_POTION_HEALING:
\r
312 ident = cure_critical_wounds(300);
\r
315 case SV_POTION_STAR_HEALING:
\r
316 ident = cure_critical_wounds(1200);
\r
319 case SV_POTION_LIFE:
\r
320 ident = life_stream(TRUE, TRUE);
\r
323 case SV_POTION_RESTORE_MANA:
\r
324 ident = restore_mana(TRUE);
\r
327 case SV_POTION_RESTORE_EXP:
\r
328 if (restore_level()) ident = TRUE;
\r
331 case SV_POTION_RES_STR:
\r
332 if (do_res_stat(A_STR)) ident = TRUE;
\r
335 case SV_POTION_RES_INT:
\r
336 if (do_res_stat(A_INT)) ident = TRUE;
\r
339 case SV_POTION_RES_WIS:
\r
340 if (do_res_stat(A_WIS)) ident = TRUE;
\r
343 case SV_POTION_RES_DEX:
\r
344 if (do_res_stat(A_DEX)) ident = TRUE;
\r
347 case SV_POTION_RES_CON:
\r
348 if (do_res_stat(A_CON)) ident = TRUE;
\r
351 case SV_POTION_RES_CHR:
\r
352 if (do_res_stat(A_CHR)) ident = TRUE;
\r
355 case SV_POTION_INC_STR:
\r
356 if (do_inc_stat(A_STR)) ident = TRUE;
\r
359 case SV_POTION_INC_INT:
\r
360 if (do_inc_stat(A_INT)) ident = TRUE;
\r
363 case SV_POTION_INC_WIS:
\r
364 if (do_inc_stat(A_WIS)) ident = TRUE;
\r
367 case SV_POTION_INC_DEX:
\r
368 if (do_inc_stat(A_DEX)) ident = TRUE;
\r
371 case SV_POTION_INC_CON:
\r
372 if (do_inc_stat(A_CON)) ident = TRUE;
\r
375 case SV_POTION_INC_CHR:
\r
376 if (do_inc_stat(A_CHR)) ident = TRUE;
\r
379 case SV_POTION_AUGMENTATION:
\r
380 if (do_inc_stat(A_STR)) ident = TRUE;
\r
381 if (do_inc_stat(A_INT)) ident = TRUE;
\r
382 if (do_inc_stat(A_WIS)) ident = TRUE;
\r
383 if (do_inc_stat(A_DEX)) ident = TRUE;
\r
384 if (do_inc_stat(A_CON)) ident = TRUE;
\r
385 if (do_inc_stat(A_CHR)) ident = TRUE;
\r
388 case SV_POTION_ENLIGHTENMENT:
\r
389 msg_print(_("自分の置かれている状況が脳裏に浮かんできた...", "An image of your surroundings forms in your mind..."));
\r
390 chg_virtue(V_KNOWLEDGE, 1);
\r
391 chg_virtue(V_ENLIGHTEN, 1);
\r
396 case SV_POTION_STAR_ENLIGHTENMENT:
\r
397 msg_print(_("更なる啓蒙を感じた...", "You begin to feel more enlightened..."));
\r
398 chg_virtue(V_KNOWLEDGE, 1);
\r
399 chg_virtue(V_ENLIGHTEN, 2);
\r
402 (void)do_inc_stat(A_INT);
\r
403 (void)do_inc_stat(A_WIS);
\r
404 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
\r
405 (void)detect_doors(DETECT_RAD_DEFAULT);
\r
406 (void)detect_stairs(DETECT_RAD_DEFAULT);
\r
407 (void)detect_treasure(DETECT_RAD_DEFAULT);
\r
408 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
\r
409 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
\r
415 case SV_POTION_SELF_KNOWLEDGE:
\r
416 msg_print(_("自分自身のことが少しは分かった気がする...", "You begin to know yourself a little better..."));
\r
422 case SV_POTION_EXPERIENCE:
\r
423 if (p_ptr->prace == RACE_ANDROID) break;
\r
424 chg_virtue(V_ENLIGHTEN, 1);
\r
425 if (p_ptr->exp < PY_MAX_EXP)
\r
427 s32b ee = (p_ptr->exp / 2) + 10;
\r
428 if (ee > 100000L) ee = 100000L;
\r
429 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
\r
435 case SV_POTION_RESISTANCE:
\r
436 (void)set_oppose_acid(p_ptr->oppose_acid + randint1(20) + 20, FALSE);
\r
437 (void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
\r
438 (void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
\r
439 (void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
\r
440 (void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
\r
444 case SV_POTION_CURING:
\r
445 if (true_healing(50)) ident = TRUE;
\r
448 case SV_POTION_INVULNERABILITY:
\r
449 (void)set_invuln(p_ptr->invuln + randint1(4) + 4, FALSE);
\r
453 case SV_POTION_NEW_LIFE:
\r
454 do_cmd_rerate(FALSE);
\r
456 p_ptr->update |= PU_BONUS;
\r
457 lose_all_mutations();
\r
461 case SV_POTION_NEO_TSUYOSHI:
\r
462 (void)set_image(0);
\r
463 (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
\r
467 case SV_POTION_TSUYOSHI:
\r
468 msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
\r
470 p_ptr->tsuyoshi = 1;
\r
471 (void)set_tsuyoshi(0, TRUE);
\r
472 if (!p_ptr->resist_chaos)
\r
474 (void)set_image(50 + randint1(50));
\r
479 case SV_POTION_POLYMORPH:
\r
480 if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23))
\r
482 lose_all_mutations();
\r
490 if(gain_random_mutation(0)) ident = TRUE;
\r
492 else if (lose_mutation(0)) ident = TRUE;
\r
493 } while(!ident || one_in_(2));
\r
499 if (prace_is_(RACE_SKELETON))
\r
501 msg_print(_("液体の一部はあなたのアゴを素通りして落ちた!", "Some of the fluid falls through your jaws!"));
\r
502 (void)potion_smash_effect(0, p_ptr->y, p_ptr->x, q_ptr->k_idx);
\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