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
15 #include "realm-hex.h"
\r
18 * @brief 薬を飲むコマンドのサブルーチン /
\r
19 * Quaff a potion (from the pack or the floor)
\r
20 * @param item 飲む薬オブジェクトの所持品ID
\r
23 void do_cmd_quaff_potion_aux(INVENTORY_IDX item)
\r
32 if (p_ptr->timewalk)
\r
34 if (flush_failure) flush();
\r
35 msg_print(_("瓶から水が流れ出てこない!", "The potion doesn't flow out from a bottle."));
\r
41 if (music_singing_any()) stop_singing();
\r
42 if (hex_spelling_any())
\r
44 if (!hex_spelling(HEX_INHAIL)) stop_hex_spell_all();
\r
47 /* Get the item (in the pack) */
\r
50 o_ptr = &inventory[item];
\r
53 /* Get the item (on the floor) */
\r
56 o_ptr = &o_list[0 - item];
\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
85 /* Not identified yet */
\r
89 lev = k_info[q_ptr->k_idx].level;
\r
91 /* Analyze the potion */
\r
92 if (q_ptr->tval == TV_POTION)
\r
94 switch (q_ptr->sval)
\r
96 /* 飲みごたえをオリジナルより細かく表現 */
\r
97 case SV_POTION_WATER:
\r
98 msg_print(_("口の中がさっぱりした。", ""));
\r
99 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
\r
103 case SV_POTION_APPLE_JUICE:
\r
104 msg_print(_("甘くてサッパリとしていて、とてもおいしい。", ""));
\r
105 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
\r
109 case SV_POTION_SLIME_MOLD:
\r
110 msg_print(_("なんとも不気味な味だ。", ""));
\r
111 msg_print(_("のどの渇きが少しおさまった。", "You feel less thirsty."));
\r
115 case SV_POTION_SLOWNESS:
\r
116 if (set_slow(randint1(25) + 15, FALSE)) ident = TRUE;
\r
119 case SV_POTION_SALT_WATER:
\r
120 msg_print(_("うぇ!思わず吐いてしまった。", "The potion makes you vomit!"));
\r
122 if (!(prace_is_(RACE_GOLEM) ||
\r
123 prace_is_(RACE_ZOMBIE) ||
\r
124 prace_is_(RACE_DEMON) ||
\r
125 prace_is_(RACE_ANDROID) ||
\r
126 prace_is_(RACE_SPECTRE) ||
\r
127 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING)))
\r
129 /* Only living creatures get thirsty */
\r
130 (void)set_food(PY_FOOD_STARVE - 1);
\r
133 (void)set_poisoned(0);
\r
134 (void)set_paralyzed(p_ptr->paralyzed + 4);
\r
138 case SV_POTION_POISON:
\r
139 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
\r
141 if (set_poisoned(p_ptr->poisoned + randint0(15) + 10))
\r
148 case SV_POTION_BLINDNESS:
\r
149 if (!p_ptr->resist_blind)
\r
151 if (set_blind(p_ptr->blind + randint0(100) + 100))
\r
158 case SV_POTION_BOOZE:
\r
159 ident = booze(p_ptr);
\r
162 case SV_POTION_SLEEP:
\r
163 if (!p_ptr->free_act)
\r
165 msg_print(_("あなたは眠ってしまった。", "You fall asleep."));
\r
167 if (ironman_nightmare)
\r
169 msg_print(_("恐ろしい光景が頭に浮かんできた。", "A horrible vision enters your mind."));
\r
171 /* Have some nightmares */
\r
172 sanity_blast(NULL, FALSE);
\r
174 if (set_paralyzed(p_ptr->paralyzed + randint0(4) + 4))
\r
181 case SV_POTION_LOSE_MEMORIES:
\r
182 if (!p_ptr->hold_exp && (p_ptr->exp > 0))
\r
184 msg_print(_("過去の記憶が薄れていく気がする。", "You feel your memories fade."));
\r
185 chg_virtue(V_KNOWLEDGE, -5);
\r
187 lose_exp(p_ptr->exp / 4);
\r
192 case SV_POTION_RUINATION:
\r
193 msg_print(_("身も心も弱ってきて、精気が抜けていくようだ。", "Your nerves and muscles feel weak and lifeless!"));
\r
194 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), _("破滅の薬", "a potion of Ruination"), -1);
\r
196 (void)dec_stat(A_DEX, 25, TRUE);
\r
197 (void)dec_stat(A_WIS, 25, TRUE);
\r
198 (void)dec_stat(A_CON, 25, TRUE);
\r
199 (void)dec_stat(A_STR, 25, TRUE);
\r
200 (void)dec_stat(A_CHR, 25, TRUE);
\r
201 (void)dec_stat(A_INT, 25, TRUE);
\r
205 case SV_POTION_DEC_STR:
\r
206 if (do_dec_stat(A_STR)) ident = TRUE;
\r
209 case SV_POTION_DEC_INT:
\r
210 if (do_dec_stat(A_INT)) ident = TRUE;
\r
213 case SV_POTION_DEC_WIS:
\r
214 if (do_dec_stat(A_WIS)) ident = TRUE;
\r
217 case SV_POTION_DEC_DEX:
\r
218 if (do_dec_stat(A_DEX)) ident = TRUE;
\r
221 case SV_POTION_DEC_CON:
\r
222 if (do_dec_stat(A_CON)) ident = TRUE;
\r
225 case SV_POTION_DEC_CHR:
\r
226 if (do_dec_stat(A_CHR)) ident = TRUE;
\r
229 case SV_POTION_DETONATIONS:
\r
230 ident = detonation(p_ptr);
\r
233 case SV_POTION_DEATH:
\r
234 chg_virtue(V_VITALITY, -1);
\r
235 chg_virtue(V_UNLIFE, 5);
\r
236 msg_print(_("死の予感が体中を駆けめぐった。", "A feeling of Death flows through your body."));
\r
237 take_hit(DAMAGE_LOSELIFE, 5000, _("死の薬", "a potion of Death"), -1);
\r
241 case SV_POTION_INFRAVISION:
\r
242 if (set_tim_infra(p_ptr->tim_infra + 100 + randint1(100), FALSE))
\r
248 case SV_POTION_DETECT_INVIS:
\r
249 if (set_tim_invis(p_ptr->tim_invis + 12 + randint1(12), FALSE))
\r
255 case SV_POTION_SLOW_POISON:
\r
256 if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
\r
259 case SV_POTION_CURE_POISON:
\r
260 if (set_poisoned(0)) ident = TRUE;
\r
263 case SV_POTION_BOLDNESS:
\r
264 if (set_afraid(0)) ident = TRUE;
\r
267 case SV_POTION_SPEED:
\r
270 if (set_fast(randint1(25) + 15, FALSE)) ident = TRUE;
\r
274 (void)set_fast(p_ptr->fast + 5, FALSE);
\r
278 case SV_POTION_RESIST_HEAT:
\r
279 if (set_oppose_fire(p_ptr->oppose_fire + randint1(10) + 10, FALSE))
\r
285 case SV_POTION_RESIST_COLD:
\r
286 if (set_oppose_cold(p_ptr->oppose_cold + randint1(10) + 10, FALSE))
\r
292 case SV_POTION_HEROISM:
\r
293 ident = heroism(25);
\r
296 case SV_POTION_BESERK_STRENGTH:
\r
297 ident = berserk(randint1(25) + 25);
\r
300 case SV_POTION_CURE_LIGHT:
\r
301 ident = cure_light_wounds(2, 8);
\r
304 case SV_POTION_CURE_SERIOUS:
\r
305 ident = cure_serious_wounds(4, 8);
\r
308 case SV_POTION_CURE_CRITICAL:
\r
309 ident = cure_critical_wounds(damroll(6, 8));
\r
312 case SV_POTION_HEALING:
\r
313 ident = cure_critical_wounds(300);
\r
316 case SV_POTION_STAR_HEALING:
\r
317 ident = cure_critical_wounds(1200);
\r
320 case SV_POTION_LIFE:
\r
321 ident = life_stream(TRUE, TRUE);
\r
324 case SV_POTION_RESTORE_MANA:
\r
325 ident = restore_mana(TRUE);
\r
328 case SV_POTION_RESTORE_EXP:
\r
329 if (restore_level()) ident = TRUE;
\r
332 case SV_POTION_RES_STR:
\r
333 if (do_res_stat(A_STR)) ident = TRUE;
\r
336 case SV_POTION_RES_INT:
\r
337 if (do_res_stat(A_INT)) ident = TRUE;
\r
340 case SV_POTION_RES_WIS:
\r
341 if (do_res_stat(A_WIS)) ident = TRUE;
\r
344 case SV_POTION_RES_DEX:
\r
345 if (do_res_stat(A_DEX)) ident = TRUE;
\r
348 case SV_POTION_RES_CON:
\r
349 if (do_res_stat(A_CON)) ident = TRUE;
\r
352 case SV_POTION_RES_CHR:
\r
353 if (do_res_stat(A_CHR)) ident = TRUE;
\r
356 case SV_POTION_INC_STR:
\r
357 if (do_inc_stat(A_STR)) ident = TRUE;
\r
360 case SV_POTION_INC_INT:
\r
361 if (do_inc_stat(A_INT)) ident = TRUE;
\r
364 case SV_POTION_INC_WIS:
\r
365 if (do_inc_stat(A_WIS)) ident = TRUE;
\r
368 case SV_POTION_INC_DEX:
\r
369 if (do_inc_stat(A_DEX)) ident = TRUE;
\r
372 case SV_POTION_INC_CON:
\r
373 if (do_inc_stat(A_CON)) ident = TRUE;
\r
376 case SV_POTION_INC_CHR:
\r
377 if (do_inc_stat(A_CHR)) ident = TRUE;
\r
380 case SV_POTION_AUGMENTATION:
\r
381 if (do_inc_stat(A_STR)) ident = TRUE;
\r
382 if (do_inc_stat(A_INT)) ident = TRUE;
\r
383 if (do_inc_stat(A_WIS)) ident = TRUE;
\r
384 if (do_inc_stat(A_DEX)) ident = TRUE;
\r
385 if (do_inc_stat(A_CON)) ident = TRUE;
\r
386 if (do_inc_stat(A_CHR)) ident = TRUE;
\r
389 case SV_POTION_ENLIGHTENMENT:
\r
390 msg_print(_("自分の置かれている状況が脳裏に浮かんできた...", "An image of your surroundings forms in your mind..."));
\r
391 chg_virtue(V_KNOWLEDGE, 1);
\r
392 chg_virtue(V_ENLIGHTEN, 1);
\r
397 case SV_POTION_STAR_ENLIGHTENMENT:
\r
398 msg_print(_("更なる啓蒙を感じた...", "You begin to feel more enlightened..."));
\r
399 chg_virtue(V_KNOWLEDGE, 1);
\r
400 chg_virtue(V_ENLIGHTEN, 2);
\r
403 (void)do_inc_stat(A_INT);
\r
404 (void)do_inc_stat(A_WIS);
\r
405 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
\r
406 (void)detect_doors(DETECT_RAD_DEFAULT);
\r
407 (void)detect_stairs(DETECT_RAD_DEFAULT);
\r
408 (void)detect_treasure(DETECT_RAD_DEFAULT);
\r
409 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
\r
410 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
\r
416 case SV_POTION_SELF_KNOWLEDGE:
\r
417 msg_print(_("自分自身のことが少しは分かった気がする...", "You begin to know yourself a little better..."));
\r
423 case SV_POTION_EXPERIENCE:
\r
424 if (p_ptr->prace == RACE_ANDROID) break;
\r
425 chg_virtue(V_ENLIGHTEN, 1);
\r
426 if (p_ptr->exp < PY_MAX_EXP)
\r
428 s32b ee = (p_ptr->exp / 2) + 10;
\r
429 if (ee > 100000L) ee = 100000L;
\r
430 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
\r
436 case SV_POTION_RESISTANCE:
\r
437 (void)set_oppose_acid(p_ptr->oppose_acid + randint1(20) + 20, FALSE);
\r
438 (void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
\r
439 (void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
\r
440 (void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
\r
441 (void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
\r
445 case SV_POTION_CURING:
\r
446 if (true_healing(50)) ident = TRUE;
\r
449 case SV_POTION_INVULNERABILITY:
\r
450 (void)set_invuln(p_ptr->invuln + randint1(4) + 4, FALSE);
\r
454 case SV_POTION_NEW_LIFE:
\r
457 p_ptr->update |= PU_BONUS;
\r
458 lose_all_mutations();
\r
462 case SV_POTION_NEO_TSUYOSHI:
\r
463 (void)set_image(0);
\r
464 (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
\r
468 case SV_POTION_TSUYOSHI:
\r
469 msg_print(_("「オクレ兄さん!」", "Brother OKURE!"));
\r
471 p_ptr->tsuyoshi = 1;
\r
472 (void)set_tsuyoshi(0, TRUE);
\r
473 if (!p_ptr->resist_chaos)
\r
475 (void)set_image(50 + randint1(50));
\r
480 case SV_POTION_POLYMORPH:
\r
481 if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23))
\r
483 lose_all_mutations();
\r
491 if(gain_random_mutation(0)) ident = TRUE;
\r
493 else if (lose_mutation(0)) ident = TRUE;
\r
494 } while(!ident || one_in_(2));
\r
500 if (prace_is_(RACE_SKELETON))
\r
502 msg_print(_("液体の一部はあなたのアゴを素通りして落ちた!", "Some of the fluid falls through your jaws!"));
\r
503 (void)potion_smash_effect(0, p_ptr->y, p_ptr->x, q_ptr->k_idx);
\r
505 p_ptr->update |= (PU_COMBINE | PU_REORDER);
\r
507 if (!(object_is_aware(q_ptr)))
\r
509 chg_virtue(V_PATIENCE, -1);
\r
510 chg_virtue(V_CHANCE, 1);
\r
511 chg_virtue(V_KNOWLEDGE, -1);
\r
514 /* The item has been tried */
\r
515 object_tried(q_ptr);
\r
517 /* An identification was made */
\r
518 if (ident && !object_is_aware(q_ptr))
\r
520 object_aware(q_ptr);
\r
521 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
\r
524 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
\r
526 /* Potions can feed the player */
\r
527 switch (p_ptr->mimic_form)
\r
530 switch (p_ptr->prace)
\r
533 (void)set_food(p_ptr->food + (q_ptr->pval / 10));
\r
535 case RACE_SKELETON:
\r
542 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
545 if (q_ptr->tval == TV_FLASK)
\r
547 msg_print(_("オイルを補給した。", "You replenish yourself with the oil."));
\r
548 set_food(p_ptr->food + 5000);
\r
552 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
556 msg_print(_("水分を取り込んだ。", "You are moistened."));
\r
557 set_food(MIN(p_ptr->food + q_ptr->pval + MAX(0, q_ptr->pval * 10) + 2000, PY_FOOD_MAX - 1));
\r
560 (void)set_food(p_ptr->food + q_ptr->pval);
\r
565 case MIMIC_DEMON_LORD:
\r
566 set_food(p_ptr->food + ((q_ptr->pval) / 20));
\r
568 case MIMIC_VAMPIRE:
\r
569 (void)set_food(p_ptr->food + (q_ptr->pval / 10));
\r
572 (void)set_food(p_ptr->food + q_ptr->pval);
\r
580 * @brief 薬を飲むコマンドのメインルーチン /
\r
581 * Quaff some potion (from the pack or floor)
\r
584 void do_cmd_quaff_potion(void)
\r
589 if (p_ptr->wild_mode)
\r
594 if (cmd_limit_arena(p_ptr)) return;
\r
596 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
\r
598 set_action(ACTION_NONE);
\r
601 /* Restrict choices to potions */
\r
602 item_tester_hook = item_tester_hook_quaff;
\r
604 q = _("どの薬を飲みますか? ", "Quaff which potion? ");
\r
605 s = _("飲める薬がない。", "You have no potions to quaff.");
\r
607 if (!choose_object(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
\r
609 /* Quaff the potion */
\r
610 do_cmd_quaff_potion_aux(item);
\r