3 /* Purpose: Object commands */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
17 * This file includes code for eating food, drinking potions,
18 * reading scrolls, aiming wands, using staffs, zapping rods,
19 * and activating artifacts.
21 * In all cases, if the player becomes "aware" of the item's use
22 * by testing it, mark it as "aware" and reward some experience
23 * based on the object's level, always rounding up. If the player
24 * remains "unaware", mark that object "kind" as "tried".
26 * This code now correctly handles the unstacking of wands, staffs,
27 * and rods. Note the overly paranoid warning about potential pack
28 * overflow, which allows the player to use and drop a stacked item.
30 * In all "unstacking" scenarios, the "used" object is "carried" as if
31 * the player had just picked it up. In particular, this means that if
32 * the use of an item induces pack overflow, that item will be dropped.
34 * For simplicity, these routines induce a full "pack reorganization"
35 * which not only combines similar items, but also reorganizes various
36 * items to obey the current "sorting" method. This may require about
37 * 400 item comparisons, but only occasionally.
39 * There may be a BIG problem with any "effect" that can cause "changes"
40 * to the inventory. For example, a "scroll of recharging" can cause
41 * a wand/staff to "disappear", moving the inventory up. Luckily, the
42 * scrolls all appear BEFORE the staffs/wands, so this is not a problem.
43 * But, for example, a "staff of recharging" could cause MAJOR problems.
44 * In such a case, it will be best to either (1) "postpone" the effect
45 * until the end of the function, or (2) "change" the effect, say, into
46 * giving a staff "negative" charges, or "turning a staff into a stick".
47 * It seems as though a "rod of recharging" might in fact cause problems.
48 * The basic problem is that the act of recharging (and destroying) an
49 * item causes the inducer of that action to "move", causing "o_ptr" to
50 * no longer point at the correct item, with horrifying results.
52 * Note that food/potions/scrolls no longer use bit-flags for effects,
53 * but instead use the "sval" (which is also used to sort the objects).
57 static void do_cmd_eat_food_aux(int item)
62 /* Get the item (in the pack) */
65 o_ptr = &inventory[item];
68 /* Get the item (on the floor) */
71 o_ptr = &o_list[0 - item];
80 /* Identity not known yet */
84 lev = get_object_level(o_ptr);
86 if (o_ptr->tval == TV_FOOD)
88 /* Analyze the food */
93 if (!(p_ptr->resist_pois || p_ptr->oppose_pois))
95 if (set_poisoned(p_ptr->poisoned + randint0(10) + 10))
103 case SV_FOOD_BLINDNESS:
105 if (!p_ptr->resist_blind)
107 if (set_blind(p_ptr->blind + randint0(200) + 200))
115 case SV_FOOD_PARANOIA:
117 if (!p_ptr->resist_fear)
119 if (set_afraid(p_ptr->afraid + randint0(10) + 10))
127 case SV_FOOD_CONFUSION:
129 if (!p_ptr->resist_conf)
131 if (set_confused(p_ptr->confused + randint0(10) + 10))
139 case SV_FOOD_HALLUCINATION:
141 if (!p_ptr->resist_chaos)
143 if (set_image(p_ptr->image + randint0(250) + 250))
151 case SV_FOOD_PARALYSIS:
153 if (!p_ptr->free_act)
155 if (set_paralyzed(p_ptr->paralyzed + randint0(10) + 10))
163 case SV_FOOD_WEAKNESS:
166 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "ÆÇÆþ¤ê¿©ÎÁ", -1);
168 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "poisonous food", -1);
171 (void)do_dec_stat(A_STR);
176 case SV_FOOD_SICKNESS:
179 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "ÆÇÆþ¤ê¿©ÎÁ", -1);
181 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "poisonous food", -1);
184 (void)do_dec_stat(A_CON);
189 case SV_FOOD_STUPIDITY:
192 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "ÆÇÆþ¤ê¿©ÎÁ", -1);
194 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "poisonous food", -1);
197 (void)do_dec_stat(A_INT);
202 case SV_FOOD_NAIVETY:
205 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "ÆÇÆþ¤ê¿©ÎÁ", -1);
207 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "poisonous food", -1);
210 (void)do_dec_stat(A_WIS);
215 case SV_FOOD_UNHEALTH:
218 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "ÆÇÆþ¤ê¿©ÎÁ", -1);
220 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "poisonous food", -1);
223 (void)do_dec_stat(A_CON);
228 case SV_FOOD_DISEASE:
231 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "ÆÇÆþ¤ê¿©ÎÁ", -1);
233 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "poisonous food", -1);
236 (void)do_dec_stat(A_STR);
241 case SV_FOOD_CURE_POISON:
243 if (set_poisoned(0)) ident = TRUE;
247 case SV_FOOD_CURE_BLINDNESS:
249 if (set_blind(0)) ident = TRUE;
253 case SV_FOOD_CURE_PARANOIA:
255 if (set_afraid(0)) ident = TRUE;
259 case SV_FOOD_CURE_CONFUSION:
261 if (set_confused(0)) ident = TRUE;
265 case SV_FOOD_CURE_SERIOUS:
267 if (hp_player(damroll(4, 8))) ident = TRUE;
271 case SV_FOOD_RESTORE_STR:
273 if (do_res_stat(A_STR)) ident = TRUE;
277 case SV_FOOD_RESTORE_CON:
279 if (do_res_stat(A_CON)) ident = TRUE;
283 case SV_FOOD_RESTORING:
285 if (do_res_stat(A_STR)) ident = TRUE;
286 if (do_res_stat(A_INT)) ident = TRUE;
287 if (do_res_stat(A_WIS)) ident = TRUE;
288 if (do_res_stat(A_DEX)) ident = TRUE;
289 if (do_res_stat(A_CON)) ident = TRUE;
290 if (do_res_stat(A_CHR)) ident = TRUE;
296 /* ¤½¤ì¤¾¤ì¤Î¿©¤Ùʪ¤Î´¶ÁÛ¤ò¥ª¥ê¥¸¥Ê¥ë¤è¤êºÙ¤«¤¯É½¸½ */
297 case SV_FOOD_BISCUIT:
299 msg_print("´Å¤¯¤Æ¥µ¥¯¥µ¥¯¤·¤Æ¤È¤Æ¤â¤ª¤¤¤·¤¤¡£");
306 msg_print("»õ¤´¤¿¤¨¤¬¤¢¤Ã¤Æ¤ª¤¤¤·¤¤¡£");
311 case SV_FOOD_SLIME_MOLD:
313 msg_print("¤³¤ì¤Ï¤Ê¤ó¤È¤â·ÁÍƤ·¤¬¤¿¤¤Ì£¤À¡£");
320 msg_print("¤³¤ì¤Ï¤ª¤¤¤·¤¤¡£");
326 case SV_FOOD_BISCUIT:
328 case SV_FOOD_SLIME_MOLD:
330 msg_print("That tastes good.");
337 case SV_FOOD_WAYBREAD:
340 msg_print("¤³¤ì¤Ï¤Ò¤¸¤ç¤¦¤ËÈþÌ£¤À¡£");
342 msg_print("That tastes good.");
345 (void)set_poisoned(0);
346 (void)hp_player(damroll(4, 8));
352 case SV_FOOD_PINT_OF_ALE:
354 msg_print("¤Î¤É¤´¤·Á֤䤫¤À¡£");
359 case SV_FOOD_PINT_OF_WINE:
361 msg_print("That tastes good.");
366 case SV_FOOD_PINT_OF_ALE:
367 case SV_FOOD_PINT_OF_WINE:
369 msg_print("That tastes good.");
378 /* Combine / Reorder the pack (later) */
379 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
381 if (!(object_aware_p(o_ptr)))
383 chg_virtue(V_KNOWLEDGE, -1);
384 chg_virtue(V_PATIENCE, -1);
385 chg_virtue(V_CHANCE, 1);
388 /* We have tried it */
389 if (o_ptr->tval == TV_FOOD) object_tried(o_ptr);
391 /* The player is now aware of the object */
392 if (ident && !object_aware_p(o_ptr))
395 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
399 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
402 /* Food can feed the player */
403 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
405 /* Reduced nutritional benefit */
406 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
408 msg_print("¤¢¤Ê¤¿¤Î¤è¤¦¤Ê¼Ô¤Ë¤È¤Ã¤Æ¿©ÎȤʤɶϤ«¤Ê±ÉÍܤˤ·¤«¤Ê¤é¤Ê¤¤¡£");
410 msg_print("Mere victuals hold scant sustenance for a being such as yourself.");
413 if (p_ptr->food < PY_FOOD_ALERT) /* Hungry */
415 msg_print("¤¢¤Ê¤¿¤Îµ²¤¨¤Ï¿·Á¯¤Ê·ì¤Ë¤è¤Ã¤Æ¤Î¤ßËþ¤¿¤µ¤ì¤ë¡ª");
417 msg_print("Your hunger can only be satisfied with fresh blood!");
421 else if ((prace_is_(RACE_SKELETON) ||
422 prace_is_(RACE_GOLEM) ||
423 prace_is_(RACE_ZOMBIE) ||
424 prace_is_(RACE_SPECTRE)) &&
425 (o_ptr->tval == TV_STAFF || o_ptr->tval == TV_WAND))
429 if (o_ptr->tval == TV_STAFF &&
430 (item < 0) && (o_ptr->number > 1))
433 msg_print("¤Þ¤º¤Ï¾ó¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
435 msg_print("You must first pick up the staffs.");
441 staff = (o_ptr->tval == TV_STAFF) ? "¾ó" : "ËâË¡ËÀ";
443 staff = (o_ptr->tval == TV_STAFF) ? "staff" : "wand";
447 if (o_ptr->pval == 0)
450 msg_format("¤³¤Î%s¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£", staff);
452 msg_format("The %s has no charges left.", staff);
455 o_ptr->ident |= (IDENT_EMPTY);
457 /* Combine / Reorder the pack (later) */
458 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
459 p_ptr->window |= (PW_INVEN);
465 msg_format("¤¢¤Ê¤¿¤Ï%s¤ÎËâÎϤò¥¨¥Í¥ë¥®¡¼¸»¤È¤·¤ÆµÛ¼ý¤·¤¿¡£", staff);
467 msg_format("You absorb mana of the %s as your energy.", staff);
470 /* Use a single charge */
474 set_food(p_ptr->food + 5000);
476 /* XXX Hack -- unstack if necessary */
477 if (o_ptr->tval == TV_STAFF &&
478 (item >= 0) && (o_ptr->number > 1))
483 /* Get local object */
486 /* Obtain a local object */
487 object_copy(q_ptr, o_ptr);
489 /* Modify quantity */
492 /* Restore the charges */
495 /* Unstack the used item */
497 p_ptr->total_weight -= q_ptr->weight;
498 item = inven_carry(q_ptr);
502 msg_format("¾ó¤ò¤Þ¤È¤á¤Ê¤ª¤·¤¿¡£");
504 msg_print("You unstack your staff.");
508 /* Describe charges in the pack */
511 inven_item_charges(item);
514 /* Describe charges on the floor */
517 floor_item_charges(0 - item);
520 /* Don't eat a staff/wand itself */
523 else if ((prace_is_(RACE_DEMON) ||
524 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON)) &&
525 (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_CORPSE &&
526 strchr("pht", r_info[o_ptr->pval].d_char)))
528 /* Drain vitality of humanoids */
529 char o_name[MAX_NLEN];
531 object_desc(o_name, o_ptr, FALSE, 0);
534 msg_format("%s¤Ïdz¤¨¾å¤ê³¥¤Ë¤Ê¤Ã¤¿¡£ÀºÎϤòµÛ¼ý¤·¤¿µ¤¤¬¤¹¤ë¡£", o_name);
536 msg_format("%^s is burnt to ashes. You absorb its vitality!", o_name);
538 (void)set_food(PY_FOOD_MAX - 1);
540 else if (prace_is_(RACE_SKELETON))
543 if (o_ptr->tval == TV_SKELETON ||
544 (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))
547 msg_print("¤¢¤Ê¤¿¤Ï¹ü¤Ç¼«Ê¬¤ÎÂΤòÊä¤Ã¤¿¡£");
549 msg_print("Your body absorbs the bone.");
551 set_food(p_ptr->food + 5000);
556 if (!((o_ptr->sval == SV_FOOD_WAYBREAD) ||
557 (o_ptr->sval < SV_FOOD_BISCUIT)))
560 object_type *q_ptr = &forge;
563 msg_print("¿©¤Ùʪ¤¬¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¤¿¡ª");
565 msg_print("The food falls through your jaws!");
569 /* Create the item */
570 object_prep(q_ptr, lookup_kind(o_ptr->tval, o_ptr->sval));
572 /* Drop the object from heaven */
573 (void)drop_near(q_ptr, -1, py, px);
578 msg_print("¿©¤Ùʪ¤¬¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¡¢¾Ã¤¨¤¿¡ª");
580 msg_print("The food falls through your jaws and vanishes!");
585 else if (prace_is_(RACE_GOLEM) ||
586 prace_is_(RACE_ZOMBIE) ||
587 prace_is_(RACE_ENT) ||
588 prace_is_(RACE_DEMON) ||
589 prace_is_(RACE_ANDROID) ||
590 prace_is_(RACE_SPECTRE) ||
591 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
594 msg_print("À¸¼Ô¤Î¿©Êª¤Ï¤¢¤Ê¤¿¤Ë¤È¤Ã¤Æ¤Û¤È¤ó¤É±ÉÍܤˤʤé¤Ê¤¤¡£");
596 msg_print("The food of mortals is poor sustenance for you.");
599 set_food(p_ptr->food + ((o_ptr->pval) / 20));
603 (void)set_food(p_ptr->food + o_ptr->pval);
606 /* Destroy a food in the pack */
609 inven_item_increase(item, -1);
610 inven_item_describe(item);
611 inven_item_optimize(item);
614 /* Destroy a food on the floor */
617 floor_item_increase(0 - item, -1);
618 floor_item_describe(0 - item);
619 floor_item_optimize(0 - item);
625 * Hook to determine if an object is eatable
627 static bool item_tester_hook_eatable(object_type *o_ptr)
629 if (o_ptr->tval==TV_FOOD) return TRUE;
632 if (prace_is_(RACE_SKELETON))
634 if (o_ptr->tval == TV_SKELETON ||
635 (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))
641 if (prace_is_(RACE_SKELETON) ||
642 prace_is_(RACE_GOLEM) ||
643 prace_is_(RACE_ZOMBIE) ||
644 prace_is_(RACE_SPECTRE))
646 if (o_ptr->tval == TV_STAFF || o_ptr->tval == TV_WAND)
649 else if (prace_is_(RACE_DEMON) ||
650 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON))
652 if (o_ptr->tval == TV_CORPSE &&
653 o_ptr->sval == SV_CORPSE &&
654 strchr("pht", r_info[o_ptr->pval].d_char))
664 * Eat some food (from the pack or floor)
666 void do_cmd_eat_food(void)
672 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
674 set_action(ACTION_NONE);
677 /* Restrict choices to food */
678 item_tester_hook = item_tester_hook_eatable;
682 q = "¤É¤ì¤ò¿©¤Ù¤Þ¤¹¤«? ";
683 s = "¿©¤Ùʪ¤¬¤Ê¤¤¡£";
685 q = "Eat which item? ";
686 s = "You have nothing to eat.";
689 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
692 do_cmd_eat_food_aux(item);
697 * Quaff a potion (from the pack or the floor)
699 static void do_cmd_quaff_potion_aux(int item)
712 if (flush_failure) flush();
714 msg_print("ÉÓ¤«¤é¿å¤¬Î®¤ì½Ð¤Æ¤³¤Ê¤¤¡ª");
716 msg_print("The potion doesn't flow out from a bottle.");
723 if((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0])
728 /* Get the item (in the pack) */
731 o_ptr = &inventory[item];
734 /* Get the item (on the floor) */
737 o_ptr = &o_list[0 - item];
740 /* Get local object */
743 /* Obtain a local object */
744 object_copy(q_ptr, o_ptr);
749 /* Reduce and describe inventory */
752 inven_item_increase(item, -1);
753 inven_item_describe(item);
754 inven_item_optimize(item);
757 /* Reduce and describe floor item */
760 floor_item_increase(0 - item, -1);
761 floor_item_describe(0 - item);
762 floor_item_optimize(0 - item);
769 /* Not identified yet */
773 lev = get_object_level(q_ptr);
775 /* Analyze the potion */
776 if (q_ptr->tval == TV_POTION)
781 /* °û¤ß¤´¤¿¤¨¤ò¥ª¥ê¥¸¥Ê¥ë¤è¤êºÙ¤«¤¯É½¸½ */
782 case SV_POTION_WATER:
783 msg_print("¸ý¤ÎÃ椬¤µ¤Ã¤Ñ¤ê¤·¤¿¡£");
784 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
788 case SV_POTION_APPLE_JUICE:
789 msg_print("´Å¤¯¤Æ¥µ¥Ã¥Ñ¥ê¤È¤·¤Æ¤¤¤Æ¡¢¤È¤Æ¤â¤ª¤¤¤·¤¤¡£");
790 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
794 case SV_POTION_SLIME_MOLD:
795 msg_print("¤Ê¤ó¤È¤âÉÔµ¤Ì£¤ÊÌ£¤À¡£");
796 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
801 case SV_POTION_WATER:
802 case SV_POTION_APPLE_JUICE:
803 case SV_POTION_SLIME_MOLD:
804 msg_print("You feel less thirsty.");
809 case SV_POTION_SLOWNESS:
810 if (set_slow(randint1(25) + 15, FALSE)) ident = TRUE;
813 case SV_POTION_SALT_WATER:
815 msg_print("¤¦¤§¡ª»×¤ï¤ºÅǤ¤¤Æ¤·¤Þ¤Ã¤¿¡£");
817 msg_print("The potion makes you vomit!");
820 (void)set_food(PY_FOOD_STARVE - 1);
821 (void)set_poisoned(0);
822 (void)set_paralyzed(p_ptr->paralyzed + 4);
826 case SV_POTION_POISON:
827 if (!(p_ptr->resist_pois || p_ptr->oppose_pois))
829 if (set_poisoned(p_ptr->poisoned + randint0(15) + 10))
836 case SV_POTION_BLINDNESS:
837 if (!p_ptr->resist_blind)
839 if (set_blind(p_ptr->blind + randint0(100) + 100))
846 case SV_POTION_CONFUSION: /* Booze */
847 if (p_ptr->pclass != CLASS_MONK) chg_virtue(V_HARMONY, -1);
848 else if (!p_ptr->resist_conf) p_ptr->special_attack |= ATTACK_SUIKEN;
849 if (!p_ptr->resist_conf)
851 if (set_confused(randint0(20) + 15))
857 if (!p_ptr->resist_chaos)
861 if (set_image(p_ptr->image + randint0(150) + 150))
866 if (one_in_(13) && (p_ptr->pclass != CLASS_MONK))
869 if (one_in_(3)) lose_all_info();
871 teleport_player(100);
874 msg_print("ÃΤé¤Ê¤¤¾ì½ê¤ÇÌܤ¬Àä᤿¡£Æ¬Äˤ¬¤¹¤ë¡£");
875 msg_print("²¿¤â»×¤¤½Ð¤»¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ØÍ褿¤Î¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
877 msg_print("You wake up somewhere with a sore head...");
878 msg_print("You can't remember a thing, or how you got here!");
885 case SV_POTION_SLEEP:
886 if (!p_ptr->free_act)
889 msg_print("¤¢¤Ê¤¿¤Ï̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
891 msg_print("You fall asleep.");
895 if (ironman_nightmare)
898 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
900 msg_print("A horrible vision enters your mind.");
904 /* Pick a nightmare */
905 get_mon_num_prep(get_nightmare, NULL);
907 /* Have some nightmares */
908 have_nightmare(get_mon_num(MAX_DEPTH));
910 /* Remove the monster restriction */
911 get_mon_num_prep(NULL, NULL);
913 if (set_paralyzed(p_ptr->paralyzed + randint0(4) + 4))
920 case SV_POTION_LOSE_MEMORIES:
921 if (!p_ptr->hold_life && (p_ptr->exp > 0))
924 msg_print("²áµî¤Îµ²±¤¬Çö¤ì¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
926 msg_print("You feel your memories fade.");
928 chg_virtue(V_KNOWLEDGE, -5);
930 lose_exp(p_ptr->exp / 4);
935 case SV_POTION_RUINATION:
937 msg_print("¿È¤â¿´¤â¼å¤Ã¤Æ¤¤Æ¡¢Àºµ¤¤¬È´¤±¤Æ¤¤¤¯¤è¤¦¤À¡£");
938 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), "ÇËÌǤÎÌô", -1);
940 msg_print("Your nerves and muscles feel weak and lifeless!");
941 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), "a potion of Ruination", -1);
944 (void)dec_stat(A_DEX, 25, TRUE);
945 (void)dec_stat(A_WIS, 25, TRUE);
946 (void)dec_stat(A_CON, 25, TRUE);
947 (void)dec_stat(A_STR, 25, TRUE);
948 (void)dec_stat(A_CHR, 25, TRUE);
949 (void)dec_stat(A_INT, 25, TRUE);
953 case SV_POTION_DEC_STR:
954 if (do_dec_stat(A_STR)) ident = TRUE;
957 case SV_POTION_DEC_INT:
958 if (do_dec_stat(A_INT)) ident = TRUE;
961 case SV_POTION_DEC_WIS:
962 if (do_dec_stat(A_WIS)) ident = TRUE;
965 case SV_POTION_DEC_DEX:
966 if (do_dec_stat(A_DEX)) ident = TRUE;
969 case SV_POTION_DEC_CON:
970 if (do_dec_stat(A_CON)) ident = TRUE;
973 case SV_POTION_DEC_CHR:
974 if (do_dec_stat(A_CHR)) ident = TRUE;
977 case SV_POTION_DETONATIONS:
979 msg_print("ÂΤÎÃæ¤Ç·ã¤·¤¤Çúȯ¤¬µ¯¤¤¿¡ª");
980 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), "Çúȯ¤ÎÌô", -1);
982 msg_print("Massive explosions rupture your body!");
983 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), "a potion of Detonation", -1);
986 (void)set_stun(p_ptr->stun + 75);
987 (void)set_cut(p_ptr->cut + 5000);
991 case SV_POTION_DEATH:
992 chg_virtue(V_VITALITY, -1);
993 chg_virtue(V_UNLIFE, 5);
995 msg_print("»à¤Îͽ´¶¤¬ÂÎÃæ¤ò¶î¤±¤á¤°¤Ã¤¿¡£");
996 take_hit(DAMAGE_LOSELIFE, 5000, "»à¤ÎÌô", -1);
998 msg_print("A feeling of Death flows through your body.");
999 take_hit(DAMAGE_LOSELIFE, 5000, "a potion of Death", -1);
1005 case SV_POTION_INFRAVISION:
1006 if (set_tim_infra(p_ptr->tim_infra + 100 + randint1(100), FALSE))
1012 case SV_POTION_DETECT_INVIS:
1013 if (set_tim_invis(p_ptr->tim_invis + 12 + randint1(12), FALSE))
1019 case SV_POTION_SLOW_POISON:
1020 if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
1023 case SV_POTION_CURE_POISON:
1024 if (set_poisoned(0)) ident = TRUE;
1027 case SV_POTION_BOLDNESS:
1028 if (set_afraid(0)) ident = TRUE;
1031 case SV_POTION_SPEED:
1034 if (set_fast(randint1(25) + 15, FALSE)) ident = TRUE;
1038 (void)set_fast(p_ptr->fast + 5, FALSE);
1042 case SV_POTION_RESIST_HEAT:
1043 if (set_oppose_fire(p_ptr->oppose_fire + randint1(10) + 10, FALSE))
1049 case SV_POTION_RESIST_COLD:
1050 if (set_oppose_cold(p_ptr->oppose_cold + randint1(10) + 10, FALSE))
1056 case SV_POTION_HEROISM:
1057 if (set_afraid(0)) ident = TRUE;
1058 if (set_hero(p_ptr->hero + randint1(25) + 25, FALSE)) ident = TRUE;
1059 if (hp_player(10)) ident = TRUE;
1062 case SV_POTION_BESERK_STRENGTH:
1063 if (set_afraid(0)) ident = TRUE;
1064 if (set_shero(p_ptr->shero + randint1(25) + 25, FALSE)) ident = TRUE;
1065 if (hp_player(30)) ident = TRUE;
1068 case SV_POTION_CURE_LIGHT:
1069 if (hp_player(damroll(2, 8))) ident = TRUE;
1070 if (set_blind(0)) ident = TRUE;
1071 if (set_cut(p_ptr->cut - 10)) ident = TRUE;
1072 if (set_shero(0,TRUE)) ident = TRUE;
1075 case SV_POTION_CURE_SERIOUS:
1076 if (hp_player(damroll(4, 8))) ident = TRUE;
1077 if (set_blind(0)) ident = TRUE;
1078 if (set_confused(0)) ident = TRUE;
1079 if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;
1080 if (set_shero(0,TRUE)) ident = TRUE;
1083 case SV_POTION_CURE_CRITICAL:
1084 if (hp_player(damroll(6, 8))) ident = TRUE;
1085 if (set_blind(0)) ident = TRUE;
1086 if (set_confused(0)) ident = TRUE;
1087 if (set_poisoned(0)) ident = TRUE;
1088 if (set_stun(0)) ident = TRUE;
1089 if (set_cut(0)) ident = TRUE;
1090 if (set_shero(0,TRUE)) ident = TRUE;
1093 case SV_POTION_HEALING:
1094 if (hp_player(300)) ident = TRUE;
1095 if (set_blind(0)) ident = TRUE;
1096 if (set_confused(0)) ident = TRUE;
1097 if (set_poisoned(0)) ident = TRUE;
1098 if (set_stun(0)) ident = TRUE;
1099 if (set_cut(0)) ident = TRUE;
1100 if (set_shero(0,TRUE)) ident = TRUE;
1103 case SV_POTION_STAR_HEALING:
1104 if (hp_player(1200)) ident = TRUE;
1105 if (set_blind(0)) ident = TRUE;
1106 if (set_confused(0)) ident = TRUE;
1107 if (set_poisoned(0)) ident = TRUE;
1108 if (set_stun(0)) ident = TRUE;
1109 if (set_cut(0)) ident = TRUE;
1110 if (set_shero(0,TRUE)) ident = TRUE;
1113 case SV_POTION_LIFE:
1114 chg_virtue(V_VITALITY, 1);
1115 chg_virtue(V_UNLIFE, -5);
1117 msg_print("ÂÎÃæ¤ËÀ¸Ì¿ÎϤ¬Ëþ¤Á¤¢¤Õ¤ì¤Æ¤¤¿¡ª");
1119 msg_print("You feel life flow through your body!");
1123 (void)set_poisoned(0);
1125 (void)set_confused(0);
1129 (void)do_res_stat(A_STR);
1130 (void)do_res_stat(A_CON);
1131 (void)do_res_stat(A_DEX);
1132 (void)do_res_stat(A_WIS);
1133 (void)do_res_stat(A_INT);
1134 (void)do_res_stat(A_CHR);
1135 (void)set_shero(0,TRUE);
1141 case SV_POTION_RESTORE_MANA:
1142 if (p_ptr->pclass == CLASS_MAGIC_EATER)
1145 for (i = 0; i < EATER_EXT*2; i++)
1147 p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i]*EATER_CHARGE/3;
1148 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;
1150 for (; i < EATER_EXT*3; i++)
1152 int k_idx = lookup_kind(TV_ROD, i-EATER_EXT*2);
1153 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;
1154 if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
1157 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
1159 msg_print("Your feel your head clear.");
1161 p_ptr->window |= (PW_PLAYER);
1164 else if (p_ptr->csp < p_ptr->msp)
1166 p_ptr->csp = p_ptr->msp;
1167 p_ptr->csp_frac = 0;
1169 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
1171 msg_print("Your feel your head clear.");
1174 p_ptr->redraw |= (PR_MANA);
1175 p_ptr->window |= (PW_PLAYER);
1176 p_ptr->window |= (PW_SPELL);
1179 if (set_shero(0,TRUE)) ident = TRUE;
1182 case SV_POTION_RESTORE_EXP:
1183 if (restore_level()) ident = TRUE;
1186 case SV_POTION_RES_STR:
1187 if (do_res_stat(A_STR)) ident = TRUE;
1190 case SV_POTION_RES_INT:
1191 if (do_res_stat(A_INT)) ident = TRUE;
1194 case SV_POTION_RES_WIS:
1195 if (do_res_stat(A_WIS)) ident = TRUE;
1198 case SV_POTION_RES_DEX:
1199 if (do_res_stat(A_DEX)) ident = TRUE;
1202 case SV_POTION_RES_CON:
1203 if (do_res_stat(A_CON)) ident = TRUE;
1206 case SV_POTION_RES_CHR:
1207 if (do_res_stat(A_CHR)) ident = TRUE;
1210 case SV_POTION_INC_STR:
1211 if (do_inc_stat(A_STR)) ident = TRUE;
1214 case SV_POTION_INC_INT:
1215 if (do_inc_stat(A_INT)) ident = TRUE;
1218 case SV_POTION_INC_WIS:
1219 if (do_inc_stat(A_WIS)) ident = TRUE;
1222 case SV_POTION_INC_DEX:
1223 if (do_inc_stat(A_DEX)) ident = TRUE;
1226 case SV_POTION_INC_CON:
1227 if (do_inc_stat(A_CON)) ident = TRUE;
1230 case SV_POTION_INC_CHR:
1231 if (do_inc_stat(A_CHR)) ident = TRUE;
1234 case SV_POTION_AUGMENTATION:
1235 if (do_inc_stat(A_STR)) ident = TRUE;
1236 if (do_inc_stat(A_INT)) ident = TRUE;
1237 if (do_inc_stat(A_WIS)) ident = TRUE;
1238 if (do_inc_stat(A_DEX)) ident = TRUE;
1239 if (do_inc_stat(A_CON)) ident = TRUE;
1240 if (do_inc_stat(A_CHR)) ident = TRUE;
1243 case SV_POTION_ENLIGHTENMENT:
1245 msg_print("¼«Ê¬¤ÎÃÖ¤«¤ì¤Æ¤¤¤ë¾õ¶·¤¬Ç¾Î¢¤ËÉ⤫¤ó¤Ç¤¤¿...");
1247 msg_print("An image of your surroundings forms in your mind...");
1250 chg_virtue(V_KNOWLEDGE, 1);
1251 chg_virtue(V_ENLIGHTEN, 1);
1252 wiz_lite(FALSE, FALSE);
1256 case SV_POTION_STAR_ENLIGHTENMENT:
1258 msg_print("¹¹¤Ê¤ë·¼Ìؤò´¶¤¸¤¿...");
1260 msg_print("You begin to feel more enlightened...");
1263 chg_virtue(V_KNOWLEDGE, 1);
1264 chg_virtue(V_ENLIGHTEN, 2);
1266 wiz_lite(TRUE, FALSE);
1267 (void)do_inc_stat(A_INT);
1268 (void)do_inc_stat(A_WIS);
1269 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1270 (void)detect_doors(DETECT_RAD_DEFAULT);
1271 (void)detect_stairs(DETECT_RAD_DEFAULT);
1272 (void)detect_treasure(DETECT_RAD_DEFAULT);
1273 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
1274 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
1280 case SV_POTION_SELF_KNOWLEDGE:
1282 msg_print("¼«Ê¬¼«¿È¤Î¤³¤È¤¬¾¯¤·¤Ïʬ¤«¤Ã¤¿µ¤¤¬¤¹¤ë...");
1284 msg_print("You begin to know yourself a little better...");
1292 case SV_POTION_EXPERIENCE:
1293 if (p_ptr->prace == RACE_ANDROID) break;
1294 chg_virtue(V_ENLIGHTEN, 1);
1295 if (p_ptr->exp < PY_MAX_EXP)
1297 s32b ee = (p_ptr->exp / 2) + 10;
1298 if (ee > 100000L) ee = 100000L;
1300 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1302 msg_print("You feel more experienced.");
1310 case SV_POTION_RESISTANCE:
1311 (void)set_oppose_acid(p_ptr->oppose_acid + randint1(20) + 20, FALSE);
1312 (void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
1313 (void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
1314 (void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
1315 (void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
1319 case SV_POTION_CURING:
1320 if (hp_player(50)) ident = TRUE;
1321 if (set_blind(0)) ident = TRUE;
1322 if (set_poisoned(0)) ident = TRUE;
1323 if (set_confused(0)) ident = TRUE;
1324 if (set_stun(0)) ident = TRUE;
1325 if (set_cut(0)) ident = TRUE;
1326 if (set_image(0)) ident = TRUE;
1329 case SV_POTION_INVULNERABILITY:
1330 (void)set_invuln(p_ptr->invuln + randint1(4) + 4, FALSE);
1334 case SV_POTION_NEW_LIFE:
1335 do_cmd_rerate(FALSE);
1337 p_ptr->update |= PU_BONUS;
1338 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
1340 chg_virtue(V_CHANCE, -5);
1342 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
1344 msg_print("You are cured of all mutations.");
1347 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
1348 p_ptr->update |= PU_BONUS;
1350 mutant_regenerate_mod = calc_mutant_regenerate_mod();
1355 case SV_POTION_NEO_TSUYOSHI:
1357 (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
1361 case SV_POTION_TSUYOSHI:
1363 msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
1365 msg_print("Brother OKURE!");
1368 p_ptr->tsuyoshi = 1;
1369 (void)set_tsuyoshi(0, TRUE);
1370 if (!p_ptr->resist_chaos)
1372 (void)set_image(50 + randint1(50));
1377 case SV_POTION_POLYMORPH:
1378 if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23))
1380 chg_virtue(V_CHANCE, -5);
1382 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
1384 msg_print("You are cured of all mutations.");
1387 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
1388 p_ptr->update |= PU_BONUS;
1397 if(gain_random_mutation(0)) ident = TRUE;
1399 else if (lose_mutation(0)) ident = TRUE;
1400 } while(!ident || one_in_(2));
1406 if (prace_is_(RACE_SKELETON))
1409 msg_print("±ÕÂΤΰìÉô¤Ï¤¢¤Ê¤¿¤Î¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¤¿¡ª");
1411 msg_print("Some of the fluid falls through your jaws!");
1414 (void)potion_smash_effect(0, py, px, q_ptr->k_idx);
1417 /* Combine / Reorder the pack (later) */
1418 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1420 if (!(object_aware_p(o_ptr)))
1422 chg_virtue(V_PATIENCE, -1);
1423 chg_virtue(V_CHANCE, 1);
1424 chg_virtue(V_KNOWLEDGE, -1);
1427 /* The item has been tried */
1428 object_tried(q_ptr);
1430 /* An identification was made */
1431 if (ident && !object_aware_p(q_ptr))
1433 object_aware(q_ptr);
1434 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
1438 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
1440 /* Potions can feed the player */
1441 switch (p_ptr->mimic_form)
1444 switch (p_ptr->prace)
1447 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
1456 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1459 if (o_ptr->tval == TV_FLASK)
1462 msg_print("¥ª¥¤¥ë¤òÊäµë¤·¤¿¡£");
1464 msg_print("You replenish yourself with the oil.");
1466 set_food(p_ptr->food + 5000);
1470 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1475 msg_print("¿åʬ¤ò¼è¤ê¹þ¤ó¤À¡£");
1477 msg_print("You are moistened.");
1479 set_food(MIN(p_ptr->food + o_ptr->pval + MAX(0, o_ptr->pval * 10) + 2000, PY_FOOD_MAX - 1));
1482 (void)set_food(p_ptr->food + o_ptr->pval);
1487 case MIMIC_DEMON_LORD:
1488 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1491 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
1494 (void)set_food(p_ptr->food + o_ptr->pval);
1501 * Hook to determine if an object can be quaffed
1503 static bool item_tester_hook_quaff(object_type *o_ptr)
1505 if (o_ptr->tval == TV_POTION) return TRUE;
1507 if (prace_is_(RACE_ANDROID))
1509 if (o_ptr->tval == TV_FLASK && o_ptr->sval == SV_FLASK_OIL)
1518 * Quaff some potion (from the pack or floor)
1520 void do_cmd_quaff_potion(void)
1525 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
1527 set_action(ACTION_NONE);
1530 /* Restrict choices to potions */
1531 item_tester_hook = item_tester_hook_quaff;
1535 q = "¤É¤ÎÌô¤ò°û¤ß¤Þ¤¹¤«? ";
1536 s = "°û¤á¤ëÌô¤¬¤Ê¤¤¡£";
1538 q = "Quaff which potion? ";
1539 s = "You have no potions to quaff.";
1542 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1544 /* Quaff the potion */
1545 do_cmd_quaff_potion_aux(item);
1550 * Read a scroll (from the pack or floor).
1552 * Certain scrolls can be "aborted" without losing the scroll. These
1553 * include scrolls with no effects but recharge or identify, which are
1554 * cancelled before use. XXX Reading them still takes a turn, though.
1556 static void do_cmd_read_scroll_aux(int item, bool known)
1558 int k, used_up, ident, lev;
1563 /* Get the item (in the pack) */
1566 o_ptr = &inventory[item];
1569 /* Get the item (on the floor) */
1572 o_ptr = &o_list[0 - item];
1581 if (flush_failure) flush();
1583 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
1585 msg_print("Nothing happen.");
1592 if (p_ptr->pclass == CLASS_BERSERKER)
1595 msg_print("´¬Êª¤Ê¤ó¤ÆÆɤá¤Ê¤¤¡£");
1597 msg_print("You cannot read.");
1602 if((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0])
1607 /* Not identified yet */
1611 lev = get_object_level(o_ptr);
1613 /* Assume the scroll will get used up */
1616 if (o_ptr->tval == TV_SCROLL)
1618 /* Analyze the scroll */
1619 switch (o_ptr->sval)
1621 case SV_SCROLL_DARKNESS:
1623 if (!(p_ptr->resist_blind) && !(p_ptr->resist_dark))
1625 (void)set_blind(p_ptr->blind + 3 + randint1(5));
1627 if (unlite_area(10, 3)) ident = TRUE;
1631 case SV_SCROLL_AGGRAVATE_MONSTER:
1634 msg_print("¥«¥ó¹â¤¯¤¦¤Ê¤ëÍͤʲ»¤¬ÊÕ¤ê¤òʤ¤Ã¤¿¡£");
1636 msg_print("There is a high pitched humming noise.");
1639 aggravate_monsters(0);
1644 case SV_SCROLL_CURSE_ARMOR:
1646 if (curse_armor()) ident = TRUE;
1650 case SV_SCROLL_CURSE_WEAPON:
1652 if (curse_weapon(FALSE, INVEN_RARM)) ident = TRUE;
1656 case SV_SCROLL_SUMMON_MONSTER:
1658 for (k = 0; k < randint1(3); k++)
1660 if (summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
1668 case SV_SCROLL_SUMMON_UNDEAD:
1670 for (k = 0; k < randint1(3); k++)
1672 if (summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
1680 case SV_SCROLL_SUMMON_PET:
1682 if (summon_specific(-1, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_FORCE_PET)))
1689 case SV_SCROLL_SUMMON_KIN:
1691 if (summon_kin_player(p_ptr->lev, py, px, (PM_FORCE_PET | PM_ALLOW_GROUP)))
1698 case SV_SCROLL_TRAP_CREATION:
1700 if (trap_creation(py, px)) ident = TRUE;
1704 case SV_SCROLL_PHASE_DOOR:
1706 teleport_player(10);
1711 case SV_SCROLL_TELEPORT:
1713 teleport_player(100);
1718 case SV_SCROLL_TELEPORT_LEVEL:
1720 (void)teleport_player_level();
1725 case SV_SCROLL_WORD_OF_RECALL:
1727 if (!word_of_recall()) used_up = FALSE;
1732 case SV_SCROLL_IDENTIFY:
1734 if (!ident_spell(FALSE)) used_up = FALSE;
1739 case SV_SCROLL_STAR_IDENTIFY:
1741 if (!identify_fully(FALSE)) used_up = FALSE;
1746 case SV_SCROLL_REMOVE_CURSE:
1751 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1753 msg_print("You feel as if someone is watching over you.");
1761 case SV_SCROLL_STAR_REMOVE_CURSE:
1763 if (remove_all_curse())
1766 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1768 msg_print("You feel as if someone is watching over you.");
1775 case SV_SCROLL_ENCHANT_ARMOR:
1778 if (!enchant_spell(0, 0, 1)) used_up = FALSE;
1782 case SV_SCROLL_ENCHANT_WEAPON_TO_HIT:
1784 if (!enchant_spell(1, 0, 0)) used_up = FALSE;
1789 case SV_SCROLL_ENCHANT_WEAPON_TO_DAM:
1791 if (!enchant_spell(0, 1, 0)) used_up = FALSE;
1796 case SV_SCROLL_STAR_ENCHANT_ARMOR:
1798 if (!enchant_spell(0, 0, randint1(3) + 2)) used_up = FALSE;
1803 case SV_SCROLL_STAR_ENCHANT_WEAPON:
1805 if (!enchant_spell(randint1(3), randint1(3), 0)) used_up = FALSE;
1810 case SV_SCROLL_RECHARGING:
1812 if (!recharge(130)) used_up = FALSE;
1817 case SV_SCROLL_MUNDANITY:
1820 if (!mundane_spell(FALSE)) used_up = FALSE;
1824 case SV_SCROLL_LIGHT:
1826 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
1830 case SV_SCROLL_MAPPING:
1832 map_area(DETECT_RAD_MAP);
1837 case SV_SCROLL_DETECT_GOLD:
1839 if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
1840 if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
1844 case SV_SCROLL_DETECT_ITEM:
1846 if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
1850 case SV_SCROLL_DETECT_TRAP:
1852 if (detect_traps(DETECT_RAD_DEFAULT, known)) ident = TRUE;
1856 case SV_SCROLL_DETECT_DOOR:
1858 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
1859 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
1863 case SV_SCROLL_DETECT_INVIS:
1865 if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
1869 case SV_SCROLL_SATISFY_HUNGER:
1871 if (set_food(PY_FOOD_MAX - 1)) ident = TRUE;
1875 case SV_SCROLL_BLESSING:
1877 if (set_blessed(p_ptr->blessed + randint1(12) + 6, FALSE)) ident = TRUE;
1881 case SV_SCROLL_HOLY_CHANT:
1883 if (set_blessed(p_ptr->blessed + randint1(24) + 12, FALSE)) ident = TRUE;
1887 case SV_SCROLL_HOLY_PRAYER:
1889 if (set_blessed(p_ptr->blessed + randint1(48) + 24, FALSE)) ident = TRUE;
1893 case SV_SCROLL_MONSTER_CONFUSION:
1895 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1898 msg_print("¼ê¤¬µ±¤»Ï¤á¤¿¡£");
1900 msg_print("Your hands begin to glow.");
1903 p_ptr->special_attack |= ATTACK_CONFUSE;
1904 p_ptr->redraw |= (PR_STATUS);
1910 case SV_SCROLL_PROTECTION_FROM_EVIL:
1913 if (set_protevil(p_ptr->protevil + randint1(25) + k, FALSE)) ident = TRUE;
1917 case SV_SCROLL_RUNE_OF_PROTECTION:
1924 case SV_SCROLL_TRAP_DOOR_DESTRUCTION:
1926 if (destroy_doors_touch()) ident = TRUE;
1930 case SV_SCROLL_STAR_DESTRUCTION:
1932 if (destroy_area(py, px, 13+randint0(5), TRUE))
1936 msg_print("¥À¥ó¥¸¥ç¥ó¤¬Íɤ줿...");
1938 msg_print("The dungeon trembles...");
1945 case SV_SCROLL_DISPEL_UNDEAD:
1947 if (dispel_undead(80)) ident = TRUE;
1951 case SV_SCROLL_SPELL:
1953 if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_IMITATOR) || (p_ptr->pclass == CLASS_MINDCRAFTER) || (p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_ARCHER) || (p_ptr->pclass == CLASS_MAGIC_EATER) || (p_ptr->pclass == CLASS_RED_MAGE) || (p_ptr->pclass == CLASS_SAMURAI) || (p_ptr->pclass == CLASS_BLUE_MAGE) || (p_ptr->pclass == CLASS_CAVALRY) || (p_ptr->pclass == CLASS_BERSERKER) || (p_ptr->pclass == CLASS_SMITH) || (p_ptr->pclass == CLASS_MIRROR_MASTER) || (p_ptr->pclass == CLASS_NINJA)) break;
1954 p_ptr->add_spells++;
1955 p_ptr->update |= (PU_SPELLS);
1960 case SV_SCROLL_GENOCIDE:
1962 (void)symbol_genocide(300, TRUE);
1967 case SV_SCROLL_MASS_GENOCIDE:
1969 (void)mass_genocide(300, TRUE);
1974 case SV_SCROLL_ACQUIREMENT:
1976 acquirement(py, px, 1, TRUE, FALSE);
1981 case SV_SCROLL_STAR_ACQUIREMENT:
1983 acquirement(py, px, randint1(2) + 1, TRUE, FALSE);
1988 /* New Hengband scrolls */
1989 case SV_SCROLL_FIRE:
1991 fire_ball(GF_FIRE, 0, 666, 4);
1992 /* Note: "Double" damage since it is centered on the player ... */
1993 if (!(p_ptr->oppose_fire || p_ptr->resist_fire || p_ptr->immune_fire))
1995 take_hit(DAMAGE_NOESCAPE, 50+randint1(50), "±ê¤Î´¬Êª", -1);
1997 take_hit(DAMAGE_NOESCAPE, 50 + randint1(50), "a Scroll of Fire", -1);
2007 fire_ball(GF_ICE, 0, 777, 4);
2008 if (!(p_ptr->oppose_cold || p_ptr->resist_cold || p_ptr->immune_cold))
2010 take_hit(DAMAGE_NOESCAPE, 100+randint1(100), "ɹ¤Î´¬Êª", -1);
2012 take_hit(DAMAGE_NOESCAPE, 100 + randint1(100), "a Scroll of Ice", -1);
2019 case SV_SCROLL_CHAOS:
2021 fire_ball(GF_CHAOS, 0, 1000, 4);
2022 if (!p_ptr->resist_chaos)
2024 take_hit(DAMAGE_NOESCAPE, 111+randint1(111), "¥í¥°¥ë¥¹¤Î´¬Êª", -1);
2026 take_hit(DAMAGE_NOESCAPE, 111 + randint1(111), "a Scroll of Logrus", -1);
2033 case SV_SCROLL_RUMOR:
2037 switch (randint1(20))
2041 err = get_rnd_line("chainswd_j.txt", 0, Rumor);
2043 err = get_rnd_line("chainswd.txt", 0, Rumor);
2049 err = get_rnd_line("error_j.txt", 0, Rumor);
2051 err = get_rnd_line("error.txt", 0, Rumor);
2059 err = get_rnd_line("death_j.txt", 0, Rumor);
2061 err = get_rnd_line("death.txt", 0, Rumor);
2067 err = get_rnd_line_jonly("rumors_j.txt", 0, Rumor, 10);
2069 err = get_rnd_line("rumors.txt", 0, Rumor);
2075 /* An error occured */
2077 if (err) strcpy(Rumor, "±³¤Î±½¤â¤¢¤ë¡£");
2079 if (err) strcpy(Rumor, "Some rumors are wrong.");
2084 msg_print("´¬Êª¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤¬½ñ¤«¤ì¤Æ¤¤¤ë:");
2086 msg_print("There is message on the scroll. It says:");
2090 msg_format("%s", Rumor);
2093 msg_print("´¬Êª¤Ï±ì¤òΩ¤Æ¤Æ¾Ã¤¨µî¤Ã¤¿¡ª");
2095 msg_print("The scroll disappears in a puff of smoke!");
2102 case SV_SCROLL_ARTIFACT:
2105 if (!artifact_scroll()) used_up = FALSE;
2109 case SV_SCROLL_RESET_RECALL:
2112 if (!reset_recall()) used_up = FALSE;
2117 else if (o_ptr->name1 == ART_GHB)
2120 msg_print("»ä¤Ï¶ìÏ«¤·¤Æ¡Ø¥°¥ì¡¼¥¿¡¼¡¦¥Ø¥ë=¥Ó¡¼¥¹¥È¡Ù¤òÅݤ·¤¿¡£");
2121 msg_print("¤·¤«¤·¼ê¤ËÆþ¤Ã¤¿¤Î¤Ï¤³¤Î¤¤¿¤Ê¤¤£Ô¥·¥ã¥Ä¤À¤±¤À¤Ã¤¿¡£");
2123 msg_print("I had a very hard time to kill the Greater hell-beast, ");
2124 msg_print("but all I got was this lousy t-shirt!");
2128 else if (o_ptr->name1 == ART_POWER)
2131 msg_print("¡Ö°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤òÅý¤Ù¡¢");
2133 msg_print("°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤ò¸«¤Ä¤±¡¢");
2135 msg_print("°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤òÊá¤é¤¨¤Æ");
2137 msg_print("°Å°Ç¤ÎÃæ¤Ë·Ò¤®¤È¤á¤ë¡£¡×");
2139 msg_print("'One Ring to rule them all, ");
2141 msg_print("One Ring to find them, ");
2143 msg_print("One Ring to bring them all ");
2145 msg_print("and in the darkness bind them.'");
2149 else if (o_ptr->tval==TV_PARCHEMENT)
2152 char o_name[MAX_NLEN];
2158 q=format("book-%d_jp.txt",o_ptr->sval);
2160 /* Display object description */
2161 object_desc(o_name, o_ptr, TRUE, 0);
2163 /* Build the filename */
2164 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, q);
2166 /* Peruse the help file */
2167 (void)show_file(TRUE, buf, o_name, 0, 0);
2176 /* Combine / Reorder the pack (later) */
2177 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2179 if (!(object_aware_p(o_ptr)))
2181 chg_virtue(V_PATIENCE, -1);
2182 chg_virtue(V_CHANCE, 1);
2183 chg_virtue(V_KNOWLEDGE, -1);
2186 /* The item was tried */
2187 object_tried(o_ptr);
2189 /* An identification was made */
2190 if (ident && !object_aware_p(o_ptr))
2192 object_aware(o_ptr);
2193 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
2197 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
2200 /* Hack -- allow certain scrolls to be "preserved" */
2206 sound(SOUND_SCROLL);
2208 /* Destroy a scroll in the pack */
2211 inven_item_increase(item, -1);
2212 inven_item_describe(item);
2213 inven_item_optimize(item);
2216 /* Destroy a scroll on the floor */
2219 floor_item_increase(0 - item, -1);
2220 floor_item_describe(0 - item);
2221 floor_item_optimize(0 - item);
2227 * Hook to determine if an object is readable
2229 static bool item_tester_hook_readable(object_type *o_ptr)
2231 if ((o_ptr->tval==TV_SCROLL) || (o_ptr->tval==TV_PARCHEMENT) || (o_ptr->name1 == ART_GHB) || (o_ptr->name1 == ART_POWER)) return (TRUE);
2238 void do_cmd_read_scroll(void)
2244 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
2246 set_action(ACTION_NONE);
2249 /* Check some conditions */
2253 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡£");
2255 msg_print("You can't see anything.");
2263 msg_print("ÌÀ¤«¤ê¤¬¤Ê¤¤¤Î¤Ç¡¢°Å¤¯¤ÆÆɤá¤Ê¤¤¡£");
2265 msg_print("You have no light to read by.");
2270 if (p_ptr->confused)
2273 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡£");
2275 msg_print("You are too confused!");
2282 /* Restrict choices to scrolls */
2283 item_tester_hook = item_tester_hook_readable;
2287 q = "¤É¤Î´¬Êª¤òÆɤߤޤ¹¤«? ";
2288 s = "Æɤá¤ë´¬Êª¤¬¤Ê¤¤¡£";
2290 q = "Read which scroll? ";
2291 s = "You have no scrolls to read.";
2294 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
2296 /* Get the item (in the pack) */
2299 o_ptr = &inventory[item];
2302 /* Get the item (on the floor) */
2305 o_ptr = &o_list[0 - item];
2308 /* Read the scroll */
2309 do_cmd_read_scroll_aux(item, object_aware_p(o_ptr));
2313 static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
2318 /* Analyze the staff */
2321 case SV_STAFF_DARKNESS:
2323 if (!(p_ptr->resist_blind) && !(p_ptr->resist_dark))
2325 if (set_blind(p_ptr->blind + 3 + randint1(5))) ident = TRUE;
2327 if (unlite_area(10, 3)) ident = TRUE;
2331 case SV_STAFF_SLOWNESS:
2333 if (set_slow(p_ptr->slow + randint1(30) + 15, FALSE)) ident = TRUE;
2337 case SV_STAFF_HASTE_MONSTERS:
2339 if (speed_monsters()) ident = TRUE;
2343 case SV_STAFF_SUMMONING:
2345 for (k = 0; k < randint1(4); k++)
2347 if (summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
2355 case SV_STAFF_TELEPORTATION:
2357 teleport_player(100);
2362 case SV_STAFF_IDENTIFY:
2364 if (!ident_spell(FALSE)) *use_charge = FALSE;
2369 case SV_STAFF_REMOVE_CURSE:
2376 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2378 msg_print("You feel as if someone is watching over you.");
2381 else if (!p_ptr->blind)
2384 msg_print("¾ó¤Ï°ì½Ö¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
2386 msg_print("The staff glows blue for a moment...");
2395 case SV_STAFF_STARLITE:
2397 int num = damroll(5, 3);
2401 if (!p_ptr->blind && !magic)
2404 msg_print("¾ó¤ÎÀ褬ÌÀ¤ë¤¯µ±¤¤¤¿...");
2406 msg_print("The end of the staff glows brightly...");
2410 for (k = 0; k < num; k++)
2416 scatter(&y, &x, py, px, 4, 0);
2418 if (!cave_floor_bold(y, x)) continue;
2420 if ((y != py) || (x != px)) break;
2423 project(0, 0, y, x, damroll(6 + p_ptr->lev / 8, 10), GF_LITE_WEAK,
2424 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL), -1);
2432 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
2436 case SV_STAFF_MAPPING:
2438 map_area(DETECT_RAD_MAP);
2443 case SV_STAFF_DETECT_GOLD:
2445 if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
2446 if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
2450 case SV_STAFF_DETECT_ITEM:
2452 if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
2456 case SV_STAFF_DETECT_TRAP:
2458 if (detect_traps(DETECT_RAD_DEFAULT, known)) ident = TRUE;
2462 case SV_STAFF_DETECT_DOOR:
2464 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
2465 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
2469 case SV_STAFF_DETECT_INVIS:
2471 if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
2475 case SV_STAFF_DETECT_EVIL:
2477 if (detect_monsters_evil(DETECT_RAD_DEFAULT)) ident = TRUE;
2481 case SV_STAFF_CURE_LIGHT:
2483 if (hp_player(damroll(2, 8))) ident = TRUE;
2484 if (set_shero(0,TRUE)) ident = TRUE;
2488 case SV_STAFF_CURING:
2490 if (set_blind(0)) ident = TRUE;
2491 if (set_poisoned(0)) ident = TRUE;
2492 if (set_confused(0)) ident = TRUE;
2493 if (set_stun(0)) ident = TRUE;
2494 if (set_cut(0)) ident = TRUE;
2495 if (set_image(0)) ident = TRUE;
2496 if (set_shero(0,TRUE)) ident = TRUE;
2500 case SV_STAFF_HEALING:
2502 if (hp_player(300)) ident = TRUE;
2503 if (set_stun(0)) ident = TRUE;
2504 if (set_cut(0)) ident = TRUE;
2505 if (set_shero(0,TRUE)) ident = TRUE;
2509 case SV_STAFF_THE_MAGI:
2511 if (do_res_stat(A_INT)) ident = TRUE;
2512 if (p_ptr->csp < p_ptr->msp)
2514 p_ptr->csp = p_ptr->msp;
2515 p_ptr->csp_frac = 0;
2518 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
2520 msg_print("Your feel your head clear.");
2523 p_ptr->redraw |= (PR_MANA);
2524 p_ptr->window |= (PW_PLAYER);
2525 p_ptr->window |= (PW_SPELL);
2527 if (set_shero(0,TRUE)) ident = TRUE;
2531 case SV_STAFF_SLEEP_MONSTERS:
2533 if (sleep_monsters()) ident = TRUE;
2537 case SV_STAFF_SLOW_MONSTERS:
2539 if (slow_monsters()) ident = TRUE;
2543 case SV_STAFF_SPEED:
2545 if (set_fast(randint1(30) + 15, FALSE)) ident = TRUE;
2549 case SV_STAFF_PROBING:
2556 case SV_STAFF_DISPEL_EVIL:
2558 if (dispel_evil(80)) ident = TRUE;
2562 case SV_STAFF_POWER:
2564 if (dispel_monsters(150)) ident = TRUE;
2568 case SV_STAFF_HOLINESS:
2570 if (dispel_evil(150)) ident = TRUE;
2572 if (set_protevil((magic ? 0 : p_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
2573 if (set_poisoned(0)) ident = TRUE;
2574 if (set_afraid(0)) ident = TRUE;
2575 if (hp_player(50)) ident = TRUE;
2576 if (set_stun(0)) ident = TRUE;
2577 if (set_cut(0)) ident = TRUE;
2581 case SV_STAFF_GENOCIDE:
2583 (void)symbol_genocide((magic ? p_ptr->lev + 50 : 200), TRUE);
2588 case SV_STAFF_EARTHQUAKES:
2590 if (earthquake(py, px, 10))
2594 msg_print("¥À¥ó¥¸¥ç¥ó¤¬Íɤ줿¡£");
2596 msg_print("The dungeon trembles.");
2603 case SV_STAFF_DESTRUCTION:
2605 if (destroy_area(py, px, 13+randint0(5), TRUE))
2611 case SV_STAFF_ANIMATE_DEAD:
2613 if (animate_dead(0, py, px))
2619 case SV_STAFF_MSTORM:
2622 msg_print("¶¯ÎϤÊËâÎϤ¬Å¨¤ò°ú¤Îö¤¤¤¿¡ª");
2624 msg_print("Mighty magics rend your enemies!");
2626 project(0, 5, py, px,
2627 (randint1(200) + 300) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
2628 if ((p_ptr->pclass != CLASS_MAGE) && (p_ptr->pclass != CLASS_HIGH_MAGE) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_MAGIC_EATER) && (p_ptr->pclass != CLASS_BLUE_MAGE))
2631 (void)take_hit(DAMAGE_NOESCAPE, 50, "¥³¥ó¥È¥í¡¼¥ë¤·Æñ¤¤¶¯ÎϤÊËâÎϤβòÊü", -1);
2633 (void)take_hit(DAMAGE_NOESCAPE, 50, "unleashing magics too mighty to control", -1);
2641 case SV_STAFF_NOTHING:
2644 msg_print("²¿¤âµ¯¤é¤Ê¤«¤Ã¤¿¡£");
2646 msg_print("Nothing happen.");
2648 if (prace_is_(RACE_SKELETON) || prace_is_(RACE_GOLEM) ||
2649 prace_is_(RACE_ZOMBIE) || prace_is_(RACE_SPECTRE))
2651 msg_print("¤â¤Ã¤¿¤¤¤Ê¤¤»ö¤ò¤·¤¿¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£¿©¤Ùʪ¤ÏÂçÀڤˤ·¤Ê¤¯¤Æ¤Ï¡£");
2653 msg_print("What a waste. It's your food!");
2662 * Use a staff. -RAK-
2664 * One charge of one staff disappears.
2666 * Hack -- staffs of identify can be "cancelled".
2668 static void do_cmd_use_staff_aux(int item)
2670 int ident, chance, lev;
2674 /* Hack -- let staffs of identify get aborted */
2675 bool use_charge = TRUE;
2678 /* Get the item (in the pack) */
2681 o_ptr = &inventory[item];
2684 /* Get the item (on the floor) */
2687 o_ptr = &o_list[0 - item];
2691 /* Mega-Hack -- refuse to use a pile from the ground */
2692 if ((item < 0) && (o_ptr->number > 1))
2695 msg_print("¤Þ¤º¤Ï¾ó¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
2697 msg_print("You must first pick up the staffs.");
2707 /* Extract the item level */
2708 lev = get_object_level(o_ptr);
2709 if (lev > 50) lev = 50 + (lev - 50)/2;
2711 /* Base chance of success */
2712 chance = p_ptr->skill_dev;
2714 /* Confusion hurts skill */
2715 if (p_ptr->confused) chance = chance / 2;
2717 /* Hight level objects are harder */
2718 chance = chance - lev;
2720 /* Give everyone a (slight) chance */
2721 if ((chance < USE_DEVICE) && one_in_(USE_DEVICE - chance + 1))
2723 chance = USE_DEVICE;
2728 if (flush_failure) flush();
2730 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
2732 msg_print("Nothing happen. Maybe this staff is freezing too.");
2739 /* Roll for usage */
2740 if ((chance < USE_DEVICE) || (randint1(chance) < USE_DEVICE) || (p_ptr->pclass == CLASS_BERSERKER))
2742 if (flush_failure) flush();
2744 msg_print("¾ó¤ò¤¦¤Þ¤¯»È¤¨¤Ê¤«¤Ã¤¿¡£");
2746 msg_print("You failed to use the staff properly.");
2753 /* Notice empty staffs */
2754 if (o_ptr->pval <= 0)
2756 if (flush_failure) flush();
2758 msg_print("¤³¤Î¾ó¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£");
2760 msg_print("The staff has no charges left.");
2763 o_ptr->ident |= (IDENT_EMPTY);
2765 /* Combine / Reorder the pack (later) */
2766 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2767 p_ptr->window |= (PW_INVEN);
2776 ident = staff_effect(o_ptr->sval, &use_charge, FALSE, object_aware_p(o_ptr));
2778 if (!(object_aware_p(o_ptr)))
2780 chg_virtue(V_PATIENCE, -1);
2781 chg_virtue(V_CHANCE, 1);
2782 chg_virtue(V_KNOWLEDGE, -1);
2785 /* Combine / Reorder the pack (later) */
2786 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2788 /* Tried the item */
2789 object_tried(o_ptr);
2791 /* An identification was made */
2792 if (ident && !object_aware_p(o_ptr))
2794 object_aware(o_ptr);
2795 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
2799 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
2802 /* Hack -- some uses are "free" */
2803 if (!use_charge) return;
2806 /* Use a single charge */
2809 /* XXX Hack -- unstack if necessary */
2810 if ((item >= 0) && (o_ptr->number > 1))
2815 /* Get local object */
2818 /* Obtain a local object */
2819 object_copy(q_ptr, o_ptr);
2821 /* Modify quantity */
2824 /* Restore the charges */
2827 /* Unstack the used item */
2829 p_ptr->total_weight -= q_ptr->weight;
2830 item = inven_carry(q_ptr);
2834 msg_print("¾ó¤ò¤Þ¤È¤á¤Ê¤ª¤·¤¿¡£");
2836 msg_print("You unstack your staff.");
2841 /* Describe charges in the pack */
2844 inven_item_charges(item);
2847 /* Describe charges on the floor */
2850 floor_item_charges(0 - item);
2855 void do_cmd_use_staff(void)
2860 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
2862 set_action(ACTION_NONE);
2865 /* Restrict choices to wands */
2866 item_tester_tval = TV_STAFF;
2870 q = "¤É¤Î¾ó¤ò»È¤¤¤Þ¤¹¤«? ";
2871 s = "»È¤¨¤ë¾ó¤¬¤Ê¤¤¡£";
2873 q = "Use which staff? ";
2874 s = "You have no staff to use.";
2877 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
2879 do_cmd_use_staff_aux(item);
2883 static int wand_effect(int sval, int dir, bool magic)
2887 /* XXX Hack -- Wand of wonder can do anything before it */
2888 if (sval == SV_WAND_WONDER)
2890 int vir = virtue_number(V_CHANCE);
2891 sval = randint0(SV_WAND_WONDER);
2895 if (p_ptr->virtues[vir - 1] > 0)
2897 while (randint1(300) < p_ptr->virtues[vir - 1]) sval++;
2898 if (sval > SV_WAND_COLD_BALL) sval = randint0(4) + SV_WAND_ACID_BALL;
2902 while (randint1(300) < (0-p_ptr->virtues[vir - 1])) sval--;
2903 if (sval < SV_WAND_HEAL_MONSTER) sval = randint0(3) + SV_WAND_HEAL_MONSTER;
2906 if (sval < SV_WAND_TELEPORT_AWAY)
2907 chg_virtue(V_CHANCE, 1);
2910 /* Analyze the wand */
2913 case SV_WAND_HEAL_MONSTER:
2915 if (heal_monster(dir, damroll(10, 10))) ident = TRUE;
2919 case SV_WAND_HASTE_MONSTER:
2921 if (speed_monster(dir)) ident = TRUE;
2925 case SV_WAND_CLONE_MONSTER:
2927 if (clone_monster(dir)) ident = TRUE;
2931 case SV_WAND_TELEPORT_AWAY:
2933 if (teleport_monster(dir)) ident = TRUE;
2937 case SV_WAND_DISARMING:
2939 if (disarm_trap(dir)) ident = TRUE;
2943 case SV_WAND_TRAP_DOOR_DEST:
2945 if (destroy_door(dir)) ident = TRUE;
2949 case SV_WAND_STONE_TO_MUD:
2951 if (wall_to_mud(dir)) ident = TRUE;
2958 msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
2960 msg_print("A line of blue shimmering light appears.");
2963 (void)lite_line(dir);
2968 case SV_WAND_SLEEP_MONSTER:
2970 if (sleep_monster(dir)) ident = TRUE;
2974 case SV_WAND_SLOW_MONSTER:
2976 if (slow_monster(dir)) ident = TRUE;
2980 case SV_WAND_CONFUSE_MONSTER:
2982 if (confuse_monster(dir, p_ptr->lev)) ident = TRUE;
2986 case SV_WAND_FEAR_MONSTER:
2988 if (fear_monster(dir, p_ptr->lev)) ident = TRUE;
2992 case SV_WAND_DRAIN_LIFE:
2994 if (drain_life(dir, 80 + p_ptr->lev)) ident = TRUE;
2998 case SV_WAND_POLYMORPH:
3000 if (poly_monster(dir)) ident = TRUE;
3004 case SV_WAND_STINKING_CLOUD:
3006 fire_ball(GF_POIS, dir, 12 + p_ptr->lev / 4, 2);
3011 case SV_WAND_MAGIC_MISSILE:
3013 fire_bolt_or_beam(20, GF_MISSILE, dir, damroll(2 + p_ptr->lev / 10, 6));
3018 case SV_WAND_ACID_BOLT:
3020 fire_bolt_or_beam(20, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
3025 case SV_WAND_CHARM_MONSTER:
3027 if (charm_monster(dir, MAX(20, p_ptr->lev)))
3032 case SV_WAND_FIRE_BOLT:
3034 fire_bolt_or_beam(20, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
3039 case SV_WAND_COLD_BOLT:
3041 fire_bolt_or_beam(20, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
3046 case SV_WAND_ACID_BALL:
3048 fire_ball(GF_ACID, dir, 60 + 3 * p_ptr->lev / 4, 2);
3053 case SV_WAND_ELEC_BALL:
3055 fire_ball(GF_ELEC, dir, 40 + 3 * p_ptr->lev / 4, 2);
3060 case SV_WAND_FIRE_BALL:
3062 fire_ball(GF_FIRE, dir, 70 + 3 * p_ptr->lev / 4, 2);
3067 case SV_WAND_COLD_BALL:
3069 fire_ball(GF_COLD, dir, 50 + 3 * p_ptr->lev / 4, 2);
3074 case SV_WAND_WONDER:
3077 msg_print("¤ª¤Ã¤È¡¢Ææ¤ÎËâË¡ËÀ¤ò»ÏÆ°¤µ¤»¤¿¡£");
3079 msg_print("Oops. Wand of wonder activated.");
3085 case SV_WAND_DRAGON_FIRE:
3087 fire_ball(GF_FIRE, dir, 200, -3);
3092 case SV_WAND_DRAGON_COLD:
3094 fire_ball(GF_COLD, dir, 180, -3);
3099 case SV_WAND_DRAGON_BREATH:
3101 switch (randint1(5))
3105 fire_ball(GF_ACID, dir, 240, -3);
3111 fire_ball(GF_ELEC, dir, 210, -3);
3117 fire_ball(GF_FIRE, dir, 240, -3);
3123 fire_ball(GF_COLD, dir, 210, -3);
3129 fire_ball(GF_POIS, dir, 180, -3);
3138 case SV_WAND_DISINTEGRATE:
3140 fire_ball(GF_DISINTEGRATE, dir, 200 + randint1(p_ptr->lev * 2), 2);
3145 case SV_WAND_ROCKETS:
3148 msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡ª");
3150 msg_print("You launch a rocket!");
3153 fire_rocket(GF_ROCKET, dir, 250 + p_ptr->lev * 3, 2);
3158 case SV_WAND_STRIKING:
3160 fire_bolt(GF_METEOR, dir, damroll(15 + p_ptr->lev / 3, 13));
3165 case SV_WAND_GENOCIDE:
3167 fire_ball_hide(GF_GENOCIDE, dir, magic ? p_ptr->lev + 50 : 250, 0);
3177 * Aim a wand (from the pack or floor).
3179 * Use a single charge from a single item.
3180 * Handle "unstacking" in a logical manner.
3182 * For simplicity, you cannot use a stack of items from the
3183 * ground. This would require too much nasty code.
3185 * There are no wands which can "destroy" themselves, in the inventory
3186 * or on the ground, so we can ignore this possibility. Note that this
3187 * required giving "wand of wonder" the ability to ignore destruction
3188 * by electric balls.
3190 * All wands can be "cancelled" at the "Direction?" prompt for free.
3192 * Note that the basic "bolt" wands do slightly less damage than the
3193 * basic "bolt" rods, but the basic "ball" wands do the same damage
3194 * as the basic "ball" rods.
3196 static void do_cmd_aim_wand_aux(int item)
3198 int lev, ident, chance, dir;
3200 bool old_target_pet = target_pet;
3202 /* Get the item (in the pack) */
3205 o_ptr = &inventory[item];
3208 /* Get the item (on the floor) */
3211 o_ptr = &o_list[0 - item];
3214 /* Mega-Hack -- refuse to aim a pile from the ground */
3215 if ((item < 0) && (o_ptr->number > 1))
3218 msg_print("¤Þ¤º¤ÏËâË¡ËÀ¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
3220 msg_print("You must first pick up the wands.");
3227 /* Allow direction to be cancelled for free */
3228 if (object_aware_p(o_ptr) && (o_ptr->sval == SV_WAND_HEAL_MONSTER
3229 || o_ptr->sval == SV_WAND_HASTE_MONSTER))
3231 if (!get_aim_dir(&dir))
3233 target_pet = old_target_pet;
3236 target_pet = old_target_pet;
3242 lev = get_object_level(o_ptr);
3243 if (lev > 50) lev = 50 + (lev - 50)/2;
3245 /* Base chance of success */
3246 chance = p_ptr->skill_dev;
3248 /* Confusion hurts skill */
3249 if (p_ptr->confused) chance = chance / 2;
3251 /* Hight level objects are harder */
3252 chance = chance - lev;
3254 /* Give everyone a (slight) chance */
3255 if ((chance < USE_DEVICE) && one_in_(USE_DEVICE - chance + 1))
3257 chance = USE_DEVICE;
3262 if (flush_failure) flush();
3264 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3266 msg_print("Nothing happen. Maybe this wand is freezing too.");
3273 /* Roll for usage */
3274 if ((chance < USE_DEVICE) || (randint1(chance) < USE_DEVICE) || (p_ptr->pclass == CLASS_BERSERKER))
3276 if (flush_failure) flush();
3278 msg_print("ËâË¡ËÀ¤ò¤¦¤Þ¤¯»È¤¨¤Ê¤«¤Ã¤¿¡£");
3280 msg_print("You failed to use the wand properly.");
3287 /* The wand is already empty! */
3288 if (o_ptr->pval <= 0)
3290 if (flush_failure) flush();
3292 msg_print("¤³¤ÎËâË¡ËÀ¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£");
3294 msg_print("The wand has no charges left.");
3297 o_ptr->ident |= (IDENT_EMPTY);
3299 /* Combine / Reorder the pack (later) */
3300 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3301 p_ptr->window |= (PW_INVEN);
3309 ident = wand_effect(o_ptr->sval, dir, FALSE);
3311 /* Combine / Reorder the pack (later) */
3312 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3314 if (!(object_aware_p(o_ptr)))
3316 chg_virtue(V_PATIENCE, -1);
3317 chg_virtue(V_CHANCE, 1);
3318 chg_virtue(V_KNOWLEDGE, -1);
3321 /* Mark it as tried */
3322 object_tried(o_ptr);
3324 /* Apply identification */
3325 if (ident && !object_aware_p(o_ptr))
3327 object_aware(o_ptr);
3328 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
3332 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3335 /* Use a single charge */
3338 /* Describe the charges in the pack */
3341 inven_item_charges(item);
3344 /* Describe the charges on the floor */
3347 floor_item_charges(0 - item);
3352 void do_cmd_aim_wand(void)
3357 /* Restrict choices to wands */
3358 item_tester_tval = TV_WAND;
3360 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
3362 set_action(ACTION_NONE);
3367 q = "¤É¤ÎËâË¡ËÀ¤ÇÁÀ¤¤¤Þ¤¹¤«? ";
3368 s = "»È¤¨¤ëËâË¡ËÀ¤¬¤Ê¤¤¡£";
3370 q = "Aim which wand? ";
3371 s = "You have no wand to aim.";
3374 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
3377 do_cmd_aim_wand_aux(item);
3381 static int rod_effect(int sval, int dir, bool *use_charge, bool magic)
3385 /* Analyze the rod */
3388 case SV_ROD_DETECT_TRAP:
3390 if (detect_traps(DETECT_RAD_DEFAULT, (bool)(dir ? FALSE : TRUE))) ident = TRUE;
3394 case SV_ROD_DETECT_DOOR:
3396 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
3397 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
3401 case SV_ROD_IDENTIFY:
3403 if (!ident_spell(FALSE)) *use_charge = FALSE;
3410 if (!word_of_recall()) *use_charge = FALSE;
3415 case SV_ROD_ILLUMINATION:
3417 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
3421 case SV_ROD_MAPPING:
3423 map_area(DETECT_RAD_MAP);
3428 case SV_ROD_DETECTION:
3430 detect_all(DETECT_RAD_DEFAULT);
3435 case SV_ROD_PROBING:
3444 if (set_blind(0)) ident = TRUE;
3445 if (set_poisoned(0)) ident = TRUE;
3446 if (set_confused(0)) ident = TRUE;
3447 if (set_stun(0)) ident = TRUE;
3448 if (set_cut(0)) ident = TRUE;
3449 if (set_image(0)) ident = TRUE;
3450 if (set_shero(0,TRUE)) ident = TRUE;
3454 case SV_ROD_HEALING:
3456 if (hp_player(500)) ident = TRUE;
3457 if (set_stun(0)) ident = TRUE;
3458 if (set_cut(0)) ident = TRUE;
3459 if (set_shero(0,TRUE)) ident = TRUE;
3463 case SV_ROD_RESTORATION:
3465 if (restore_level()) ident = TRUE;
3466 if (do_res_stat(A_STR)) ident = TRUE;
3467 if (do_res_stat(A_INT)) ident = TRUE;
3468 if (do_res_stat(A_WIS)) ident = TRUE;
3469 if (do_res_stat(A_DEX)) ident = TRUE;
3470 if (do_res_stat(A_CON)) ident = TRUE;
3471 if (do_res_stat(A_CHR)) ident = TRUE;
3477 if (set_fast(randint1(30) + 15, FALSE)) ident = TRUE;
3481 case SV_ROD_PESTICIDE:
3483 if (dispel_monsters(4)) ident = TRUE;
3487 case SV_ROD_TELEPORT_AWAY:
3489 if (teleport_monster(dir)) ident = TRUE;
3493 case SV_ROD_DISARMING:
3495 if (disarm_trap(dir)) ident = TRUE;
3502 msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3504 msg_print("A line of blue shimmering light appears.");
3507 (void)lite_line(dir);
3512 case SV_ROD_SLEEP_MONSTER:
3514 if (sleep_monster(dir)) ident = TRUE;
3518 case SV_ROD_SLOW_MONSTER:
3520 if (slow_monster(dir)) ident = TRUE;
3524 case SV_ROD_DRAIN_LIFE:
3526 if (drain_life(dir, 70 + 3 * p_ptr->lev / 2)) ident = TRUE;
3530 case SV_ROD_POLYMORPH:
3532 if (poly_monster(dir)) ident = TRUE;
3536 case SV_ROD_ACID_BOLT:
3538 fire_bolt_or_beam(10, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
3543 case SV_ROD_ELEC_BOLT:
3545 fire_bolt_or_beam(10, GF_ELEC, dir, damroll(4 + p_ptr->lev / 9, 8));
3550 case SV_ROD_FIRE_BOLT:
3552 fire_bolt_or_beam(10, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
3557 case SV_ROD_COLD_BOLT:
3559 fire_bolt_or_beam(10, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
3564 case SV_ROD_ACID_BALL:
3566 fire_ball(GF_ACID, dir, 60 + p_ptr->lev, 2);
3571 case SV_ROD_ELEC_BALL:
3573 fire_ball(GF_ELEC, dir, 40 + p_ptr->lev, 2);
3578 case SV_ROD_FIRE_BALL:
3580 fire_ball(GF_FIRE, dir, 70 + p_ptr->lev, 2);
3585 case SV_ROD_COLD_BALL:
3587 fire_ball(GF_COLD, dir, 50 + p_ptr->lev, 2);
3599 case SV_ROD_STONE_TO_MUD:
3601 if (wall_to_mud(dir)) ident = TRUE;
3605 case SV_ROD_AGGRAVATE:
3607 aggravate_monsters(0);
3616 * Activate (zap) a Rod
3618 * Unstack fully charged rods as needed.
3620 * Hack -- rods of perception/genocide can be "cancelled"
3621 * All rods can be cancelled at the "Direction?" prompt
3623 * pvals are defined for each rod in k_info. -LM-
3625 static void do_cmd_zap_rod_aux(int item)
3627 int ident, chance, lev, fail;
3632 /* Hack -- let perception get aborted */
3633 bool use_charge = TRUE;
3637 /* Get the item (in the pack) */
3640 o_ptr = &inventory[item];
3643 /* Get the item (on the floor) */
3646 o_ptr = &o_list[0 - item];
3650 /* Mega-Hack -- refuse to zap a pile from the ground */
3651 if ((item < 0) && (o_ptr->number > 1))
3654 msg_print("¤Þ¤º¤Ï¥í¥Ã¥É¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
3656 msg_print("You must first pick up the rods.");
3663 /* Get a direction (unless KNOWN not to need it) */
3664 if (((o_ptr->sval >= SV_ROD_MIN_DIRECTION) && (o_ptr->sval != SV_ROD_HAVOC) && (o_ptr->sval != SV_ROD_AGGRAVATE) && (o_ptr->sval != SV_ROD_PESTICIDE)) ||
3665 !object_aware_p(o_ptr))
3667 /* Get a direction, allow cancel */
3668 if (!get_aim_dir(&dir)) return;
3675 /* Extract the item level */
3676 lev = get_object_level(o_ptr);
3678 /* Base chance of success */
3679 chance = p_ptr->skill_dev;
3681 /* Confusion hurts skill */
3682 if (p_ptr->confused) chance = chance / 2;
3685 if (chance > fail) fail -= (chance - fail)*2;
3686 else chance -= (fail - chance)*2;
3687 if (fail < USE_DEVICE) fail = USE_DEVICE;
3688 if (chance < USE_DEVICE) chance = USE_DEVICE;
3692 if (flush_failure) flush();
3694 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3696 msg_print("Nothing happen. Maybe this rod is freezing too.");
3703 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
3704 else if (chance > fail)
3706 if (randint0(chance*2) < fail) success = FALSE;
3707 else success = TRUE;
3711 if (randint0(fail*2) < chance) success = TRUE;
3712 else success = FALSE;
3715 /* Roll for usage */
3718 if (flush_failure) flush();
3720 msg_print("¤¦¤Þ¤¯¥í¥Ã¥É¤ò»È¤¨¤Ê¤«¤Ã¤¿¡£");
3722 msg_print("You failed to use the rod properly.");
3729 k_ptr = &k_info[o_ptr->k_idx];
3731 /* A single rod is still charging */
3732 if ((o_ptr->number == 1) && (o_ptr->timeout))
3734 if (flush_failure) flush();
3736 msg_print("¤³¤Î¥í¥Ã¥É¤Ï¤Þ¤ÀËâÎϤò½¼Å¶¤·¤Æ¤¤¤ëºÇÃæ¤À¡£");
3738 msg_print("The rod is still charging.");
3743 /* A stack of rods lacks enough energy. */
3744 else if ((o_ptr->number > 1) && (o_ptr->timeout > k_ptr->pval * (o_ptr->number - 1)))
3746 if (flush_failure) flush();
3748 msg_print("¤½¤Î¥í¥Ã¥É¤Ï¤Þ¤À½¼Å¶Ãæ¤Ç¤¹¡£");
3750 msg_print("The rods are all still charging.");
3759 ident = rod_effect(o_ptr->sval, dir, &use_charge, FALSE);
3761 /* Increase the timeout by the rod kind's pval. -LM- */
3762 if (use_charge) o_ptr->timeout += k_ptr->pval;
3764 /* Combine / Reorder the pack (later) */
3765 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3767 if (!(object_aware_p(o_ptr)))
3769 chg_virtue(V_PATIENCE, -1);
3770 chg_virtue(V_CHANCE, 1);
3771 chg_virtue(V_KNOWLEDGE, -1);
3774 /* Tried the object */
3775 object_tried(o_ptr);
3777 /* Successfully determined the object function */
3778 if (ident && !object_aware_p(o_ptr))
3780 object_aware(o_ptr);
3781 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
3785 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3789 void do_cmd_zap_rod(void)
3794 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
3796 set_action(ACTION_NONE);
3799 /* Restrict choices to rods */
3800 item_tester_tval = TV_ROD;
3804 q = "¤É¤Î¥í¥Ã¥É¤ò¿¶¤ê¤Þ¤¹¤«? ";
3805 s = "»È¤¨¤ë¥í¥Ã¥É¤¬¤Ê¤¤¡£";
3807 q = "Zap which rod? ";
3808 s = "You have no rod to zap.";
3811 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
3814 do_cmd_zap_rod_aux(item);
3819 * Hook to determine if an object is activatable
3821 static bool item_tester_hook_activate(object_type *o_ptr)
3823 u32b flgs[TR_FLAG_SIZE];
3826 if (!object_known_p(o_ptr)) return (FALSE);
3828 /* Extract the flags */
3829 object_flags(o_ptr, flgs);
3831 /* Check activation flag */
3832 if (have_flag(flgs, TR_ACTIVATE)) return (TRUE);
3840 * Hack -- activate the ring of power
3842 void ring_of_power(int dir)
3844 /* Pick a random effect */
3845 switch (randint1(10))
3852 msg_print("¤¢¤Ê¤¿¤Ï°À¤Î¥ª¡¼¥é¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡£");
3854 msg_print("You are surrounded by a malignant aura.");
3859 /* Decrease all stats (permanently) */
3860 (void)dec_stat(A_STR, 50, TRUE);
3861 (void)dec_stat(A_INT, 50, TRUE);
3862 (void)dec_stat(A_WIS, 50, TRUE);
3863 (void)dec_stat(A_DEX, 50, TRUE);
3864 (void)dec_stat(A_CON, 50, TRUE);
3865 (void)dec_stat(A_CHR, 50, TRUE);
3867 /* Lose some experience (permanently) */
3868 p_ptr->exp -= (p_ptr->exp / 4);
3869 p_ptr->max_exp -= (p_ptr->exp / 4);
3879 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥª¡¼¥é¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡£");
3881 msg_print("You are surrounded by a powerful aura.");
3885 /* Dispel monsters */
3886 dispel_monsters(1000);
3896 fire_ball(GF_MANA, dir, 600, 3);
3907 fire_bolt(GF_MANA, dir, 500);
3915 static bool ang_sort_comp_pet(vptr u, vptr v, int a, int b)
3917 u16b *who = (u16b*)(u);
3922 monster_type *m_ptr1 = &m_list[w1];
3923 monster_type *m_ptr2 = &m_list[w2];
3924 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
3925 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
3927 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
3928 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
3930 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
3931 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
3933 if (r_ptr1->level > r_ptr2->level) return TRUE;
3934 if (r_ptr2->level > r_ptr1->level) return FALSE;
3936 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
3937 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
3943 * Activate a wielded object. Wielded objects never stack.
3944 * And even if they did, activatable objects never stack.
3946 * Currently, only (some) artifacts, and Dragon Scale Mail, can be activated.
3947 * But one could, for example, easily make an activatable "Ring of Plasma".
3949 * Note that it always takes a turn to activate an artifact, even if
3950 * the user hits "escape" at the "direction" prompt.
3952 static void do_cmd_activate_aux(int item)
3954 int k, dir, lev, chance, fail;
3959 /* Get the item (in the pack) */
3962 o_ptr = &inventory[item];
3965 /* Get the item (on the floor) */
3968 o_ptr = &o_list[0 - item];
3974 /* Extract the item level */
3975 lev = get_object_level(o_ptr);
3977 /* Hack -- use artifact level instead */
3978 if (artifact_p(o_ptr)) lev = a_info[o_ptr->name1].level;
3979 else if (o_ptr->art_name)
3981 switch (o_ptr->xtra2)
3989 case ACT_CURE_POISON:
4009 case ACT_RESIST_ALL:
4010 case ACT_DETECT_ALL:
4023 case ACT_BANISH_EVIL:
4031 case ACT_CHARM_ANIMAL:
4032 case ACT_SUMMON_ANIMAL:
4035 case ACT_XTRA_SPEED:
4036 case ACT_DETECT_XTRA:
4044 case ACT_CHARM_UNDEAD:
4045 case ACT_CHARM_OTHER:
4046 case ACT_SUMMON_PHANTOM:
4047 case ACT_SUMMON_ELEMENTAL:
4048 case ACT_RUNE_EXPLO:
4052 case ACT_CHARM_ANIMALS:
4053 case ACT_CHARM_OTHERS:
4060 case ACT_CALL_CHAOS:
4065 case ACT_SUMMON_UNDEAD:
4066 case ACT_SUMMON_DEMON:
4077 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
4079 /* Base chance of success */
4080 chance = p_ptr->skill_dev;
4082 /* Confusion hurts skill */
4083 if (p_ptr->confused) chance = chance / 2;
4086 if (chance > fail) fail -= (chance - fail)*2;
4087 else chance -= (fail - chance)*2;
4088 if (fail < USE_DEVICE) fail = USE_DEVICE;
4089 if (chance < USE_DEVICE) chance = USE_DEVICE;
4093 if (flush_failure) flush();
4095 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
4097 msg_print("It shows no reaction.");
4104 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
4105 else if (chance > fail)
4107 if (randint0(chance*2) < fail) success = FALSE;
4108 else success = TRUE;
4112 if (randint0(fail*2) < chance) success = TRUE;
4113 else success = FALSE;
4116 /* Roll for usage */
4119 if (flush_failure) flush();
4121 msg_print("¤¦¤Þ¤¯»ÏÆ°¤µ¤»¤ë¤³¤È¤¬¤Ç¤¤Ê¤«¤Ã¤¿¡£");
4123 msg_print("You failed to activate it properly.");
4130 /* Check the recharge */
4134 msg_print("¤½¤ì¤ÏÈù¤«¤Ë²»¤òΩ¤Æ¡¢µ±¤¡¢¾Ã¤¨¤¿...");
4136 msg_print("It whines, glows and fades...");
4143 /* Activate the artifact */
4145 msg_print("»ÏÆ°¤µ¤»¤¿...");
4147 msg_print("You activate it...");
4155 if (o_ptr->art_name && o_ptr->xtra2)
4157 (void)activate_random_artifact(o_ptr);
4160 p_ptr->window |= (PW_INVEN | PW_EQUIP);
4167 else if (o_ptr->name1)
4170 switch (o_ptr->name1)
4175 msg_print("ààÎÜÉÓ¤«¤éÀ¡¤ó¤À¸÷¤¬¤¢¤Õ¤ì½Ð¤¿...");
4177 msg_print("The phial wells with clear light...");
4180 lite_area(damroll(2, 15), 3);
4181 o_ptr->timeout = randint0(10) + 10;
4188 msg_print("À±¤¬âÁ¤·¤¯µ±¤¤¤¿...");
4190 msg_print("The star shines brightly...");
4193 map_area(DETECT_RAD_MAP);
4194 lite_area(damroll(2, 15), 3);
4195 o_ptr->timeout = randint0(50) + 50;
4202 msg_print("¤½¤ÎÊõÀФÏÀÖ¤¯ÌÀ¤ë¤¯¸÷¤Ã¤¿¡ª");
4204 msg_print("The Jewel flashes bright red!");
4207 chg_virtue(V_KNOWLEDGE, 1);
4208 chg_virtue(V_ENLIGHTEN, 1);
4209 wiz_lite(FALSE, FALSE);
4211 msg_print("¤½¤ÎÊõÀФϤ¢¤Ê¤¿¤ÎÂÎÎϤòÃ¥¤Ã¤¿...");
4212 take_hit(DAMAGE_LOSELIFE, damroll(3,8), "¿³È½¤ÎÊõÀÐ", -1);
4214 msg_print("The Jewel drains your vitality...");
4215 take_hit(DAMAGE_LOSELIFE, damroll(3, 8), "the Jewel of Judgement", -1);
4218 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
4219 (void)detect_doors(DETECT_RAD_DEFAULT);
4220 (void)detect_stairs(DETECT_RAD_DEFAULT);
4223 if (get_check("µ¢´Ô¤ÎÎϤò»È¤¤¤Þ¤¹¤«¡©"))
4225 if (get_check("Activate recall? "))
4229 (void)word_of_recall();
4232 o_ptr->timeout = randint0(20) + 20;
4239 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
4241 msg_print("The amulet lets out a shrill wail...");
4245 (void)set_protevil(randint1(25) + k, FALSE);
4246 o_ptr->timeout = randint0(225) + 225;
4253 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
4255 msg_print("The amulet floods the area with goodness...");
4258 dispel_evil(p_ptr->lev * 5);
4259 o_ptr->timeout = randint0(200) + 200;
4266 msg_print("¶À¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
4268 msg_print("The mirror floods the area with goodness...");
4271 dispel_evil(p_ptr->lev * 5);
4272 o_ptr->timeout = randint0(200) + 200;
4279 msg_print("¤¢¤Ê¤¿¤Ï¥Õ¥é¥¥¢¤ËŨ¤òÄù¤á»¦¤¹¤è¤¦Ì¿¤¸¤¿¡£");
4281 msg_print("You order Frakir to strangle your opponent.");
4284 if (!get_aim_dir(&dir)) return;
4285 if (drain_life(dir, 100))
4286 o_ptr->timeout = randint0(100) + 100;
4293 msg_print("»ØÎؤÏÌÀ¤ë¤¯µ±¤¤¤¿...");
4295 msg_print("The ring glows brightly...");
4298 (void)set_fast(randint1(75) + 75, FALSE);
4299 o_ptr->timeout = randint0(150) + 150;
4306 msg_print("»ØÎؤϿ¼¹È¤Ëµ±¤¤¤¿...");
4308 msg_print("The ring glows deep red...");
4311 if (!get_aim_dir(&dir)) return;
4312 fire_ball(GF_FIRE, dir, 300, 3);
4313 o_ptr->timeout = randint0(225) + 225;
4320 msg_print("»ØÎؤÏÇò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4322 msg_print("The ring glows bright white...");
4325 if (!get_aim_dir(&dir)) return;
4326 fire_ball(GF_COLD, dir, 400, 3);
4327 o_ptr->timeout = randint0(325) + 325;
4335 msg_format("%s¤Ï¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...", o_ptr->name1 == ART_VILYA ? "»ØÎØ" : "¥½¡¼¥É");
4337 msg_format("The %s glows deep blue...", o_ptr->name1 == ART_VILYA ? "ring" : "sword");
4340 if (!get_aim_dir(&dir)) return;
4341 fire_ball(GF_ELEC, dir, 500, 3);
4342 o_ptr->timeout = randint0(425) + 425;
4350 msg_print("»ØÎؤϼ¿¹õ¤Ëµ±¤¤¤¿...");
4352 msg_print("The ring glows intensely black...");
4355 if (!get_aim_dir(&dir)) return;
4357 o_ptr->timeout = randint0(450) + 450;
4363 int num = damroll(5, 3);
4368 msg_print("³»¤¬°ðºÊ¤Çʤ¤ï¤ì¤¿...");
4370 msg_print("Your armor is surrounded by lightning...");
4374 for (k = 0; k < num; k++)
4380 scatter(&y, &x, py, px, 4, 0);
4382 if (!cave_floor_bold(y, x)) continue;
4384 if ((y != py) || (x != px)) break;
4387 project(0, 3, y, x, 150, GF_ELEC,
4388 (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
4391 o_ptr->timeout = 1000;
4395 case ART_BLADETURNER:
4397 if (!get_aim_dir(&dir)) return;
4399 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
4401 msg_print("You breathe the elements.");
4404 fire_ball(GF_MISSILE, dir, 300, 4);
4406 msg_print("³»¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...");
4408 msg_print("Your armor glows many colours...");
4411 (void)set_afraid(0);
4412 (void)set_hero(randint1(50) + 50, FALSE);
4413 (void)hp_player(10);
4414 (void)set_blessed(randint1(50) + 50, FALSE);
4415 (void)set_oppose_acid(randint1(50) + 50, FALSE);
4416 (void)set_oppose_elec(randint1(50) + 50, FALSE);
4417 (void)set_oppose_fire(randint1(50) + 50, FALSE);
4418 (void)set_oppose_cold(randint1(50) + 50, FALSE);
4419 (void)set_oppose_pois(randint1(50) + 50, FALSE);
4420 o_ptr->timeout = 400;
4424 case ART_SOULKEEPER:
4427 msg_print("³»¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4428 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬¤è¤¤...");
4430 msg_print("Your armor glows a bright white...");
4431 msg_print("You feel much better...");
4434 (void)hp_player(1000);
4436 o_ptr->timeout = 888;
4443 msg_print("Å·¹ñ¤Î²Î¤¬Ê¹¤³¤¨¤ë...");
4445 msg_print("A heavenly choir sings...");
4448 (void)set_poisoned(0);
4451 (void)set_confused(0);
4453 (void)set_hero(randint1(25) + 25, FALSE);
4454 (void)hp_player(777);
4455 o_ptr->timeout = 300;
4462 msg_print("³»¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4464 msg_print("Your armor glows deep blue...");
4467 (void)symbol_genocide(200, TRUE);
4468 o_ptr->timeout = 500;
4475 msg_print("³»¤¬ÀÖ¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4477 msg_print("Your armor glows bright red...");
4480 destroy_doors_touch();
4481 o_ptr->timeout = 10;
4489 turn_monsters(40 + p_ptr->lev);
4490 o_ptr->timeout = 3 * (p_ptr->lev + 10);
4495 case ART_HOLHENNETH:
4498 msg_print("¥Ø¥ë¥á¥Ã¥È¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4499 msg_print("¿´¤Ë¥¤¥á¡¼¥¸¤¬É⤫¤ó¤Ç¤¤¿...");
4501 msg_print("Your helm glows bright white...");
4502 msg_print("An image forms in your mind...");
4505 detect_all(DETECT_RAD_DEFAULT);
4506 o_ptr->timeout = randint0(55) + 55;
4513 msg_print("²¦´§¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4514 msg_print("ÂÎÆâ¤ËÃȤ«¤¤¸ÝÆ°¤¬´¶¤¸¤é¤ì¤ë...");
4516 msg_print("Your crown glows deep blue...");
4517 msg_print("You feel a warm tingling inside...");
4520 (void)hp_player(700);
4522 o_ptr->timeout = 250;
4530 msg_format("%s¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...", o_ptr->name1 == ART_COLLUIN ? "¥¯¥í¡¼¥¯" : "³»");
4532 msg_format("Your %s glows many colours...", o_ptr->name1 == ART_COLLUIN ? "cloak" : "armor");
4535 (void)set_oppose_acid(randint1(20) + 20, FALSE);
4536 (void)set_oppose_elec(randint1(20) + 20, FALSE);
4537 (void)set_oppose_fire(randint1(20) + 20, FALSE);
4538 (void)set_oppose_cold(randint1(20) + 20, FALSE);
4539 (void)set_oppose_pois(randint1(20) + 20, FALSE);
4540 o_ptr->timeout = 111;
4544 case ART_HOLCOLLETH:
4547 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4549 msg_print("Your cloak glows deep blue...");
4552 sleep_monsters_touch();
4553 o_ptr->timeout = 55;
4560 msg_print("¥¯¥í¡¼¥¯¤¬²«¿§¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4562 msg_print("Your cloak glows bright yellow...");
4566 o_ptr->timeout = 70;
4573 msg_print("¥¯¥í¡¼¥¯¤¬ÊÕ¤ê¤Î¶õ´Ö¤ò¤æ¤¬¤Þ¤»¤¿...");
4575 msg_print("Your cloak twists space around you...");
4578 teleport_player(100);
4579 o_ptr->timeout = 45;
4586 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4588 msg_print("Your cloak glows a deep red...");
4592 o_ptr->timeout = 450;
4596 case ART_CAMMITHRIM:
4599 msg_print("¥°¥í¡¼¥Ö¤¬âÁ¤·¤¤¤¯¤é¤¤¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4601 msg_print("Your gloves glow extremely brightly...");
4604 if (!get_aim_dir(&dir)) return;
4605 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
4613 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4615 msg_print("Your gauntlets are covered in fire...");
4618 if (!get_aim_dir(&dir)) return;
4619 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4620 o_ptr->timeout = randint0(8) + 8;
4624 case ART_PAURNIMMEN:
4627 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4629 msg_print("Your gauntlets are covered in frost...");
4632 if (!get_aim_dir(&dir)) return;
4633 fire_bolt(GF_COLD, dir, damroll(6, 8));
4634 o_ptr->timeout = randint0(7) + 7;
4641 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4643 msg_print("Your gauntlets are covered in sparks...");
4646 if (!get_aim_dir(&dir)) return;
4647 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4648 o_ptr->timeout = randint0(5) + 5;
4655 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬»À¤Ëʤ¤ï¤ì¤¿...");
4657 msg_print("Your gauntlets are covered in acid...");
4660 if (!get_aim_dir(&dir)) return;
4661 fire_bolt(GF_ACID, dir, damroll(5, 8));
4662 o_ptr->timeout = randint0(6) + 6;
4669 msg_print("¥»¥¹¥¿¥¹¤ËËâË¡¤Î¥È¥²¤¬¸½¤ì¤¿...");
4671 msg_print("Your cesti grows magical spikes...");
4674 if (!get_aim_dir(&dir)) return;
4675 fire_bolt(GF_ARROW, dir, 150);
4676 o_ptr->timeout = randint0(90) + 90;
4683 msg_print("¥Ö¡¼¥Ä¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4685 msg_print("Your boots glow bright green...");
4688 (void)set_fast(randint1(20) + 20, FALSE);
4689 o_ptr->timeout = 200;
4696 msg_print("¥Ö¡¼¥Ä¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4698 msg_print("Your boots glow deep blue...");
4701 (void)set_afraid(0);
4702 (void)set_poisoned(0);
4710 msg_print("¥À¥¬¡¼¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4712 msg_print("Your dagger is covered in fire...");
4715 if (!get_aim_dir(&dir)) return;
4716 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4717 o_ptr->timeout = randint0(8) + 8;
4724 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4726 msg_print("Your dagger is covered in frost...");
4729 if (!get_aim_dir(&dir)) return;
4730 fire_bolt(GF_COLD, dir, damroll(6, 8));
4731 o_ptr->timeout = randint0(7) + 7;
4738 msg_print("¥À¥¬¡¼¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4740 msg_print("Your dagger is covered in sparks...");
4743 if (!get_aim_dir(&dir)) return;
4744 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4745 o_ptr->timeout = randint0(5) + 5;
4752 msg_print("¥À¥¬¡¼¤¬¿¼¤¤Îп§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4754 msg_print("Your dagger throbs deep green...");
4757 if (!get_aim_dir(&dir)) return;
4758 fire_ball(GF_POIS, dir, 12, 3);
4759 o_ptr->timeout = randint0(4) + 4;
4766 msg_print("Ì·¤¬¿¼¤¤ÀÄ¿§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4768 msg_print("Your dagger throbs deep blue...");
4771 if (!get_aim_dir(&dir)) return;
4772 fire_ball(GF_WATER, dir, 200, 3);
4773 o_ptr->timeout = 250;
4780 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4782 msg_print("Your dagger is covered in frost...");
4785 if (!get_aim_dir(&dir)) return;
4786 fire_ball(GF_COLD, dir, 48, 2);
4787 o_ptr->timeout = randint0(5) + 5;
4792 case ART_WEREWINDLE:
4794 switch (randint1(13))
4796 case 1: case 2: case 3: case 4: case 5:
4797 teleport_player(10);
4799 case 6: case 7: case 8: case 9: case 10:
4800 teleport_player(222);
4803 (void)stair_creation();
4807 if (get_check("¤³¤Î³¬¤òµî¤ê¤Þ¤¹¤«¡©"))
4809 if (get_check("Leave this level? "))
4813 if (autosave_l) do_cmd_save_game(TRUE);
4816 p_ptr->leaving = TRUE;
4819 o_ptr->timeout = 35;
4825 teleport_player(222);
4826 o_ptr->timeout = 25;
4833 msg_print("¥½¡¼¥É¤¬ÀĤ¯·ã¤·¤¯µ±¤¤¤¿...");
4835 msg_print("Your sword glows an intense blue...");
4838 if (!get_aim_dir(&dir)) return;
4839 fire_ball(GF_COLD, dir, 100, 2);
4840 o_ptr->timeout = 200;
4847 msg_print("¶Ç¤Î»ÕÃĤò¾¤´¤·¤¿¡£");
4849 msg_print("You summon the Legion of the Dawn.");
4852 (void)summon_specific(-1, py, px, dun_level, SUMMON_DAWN, (PM_ALLOW_GROUP | PM_FORCE_PET));
4853 o_ptr->timeout = 500 + randint1(500);
4860 msg_print("¥½¡¼¥É¤¬ÀÖ¤¯·ã¤·¤¯µ±¤¤¤¿...");
4862 msg_print("Your sword glows an intense red...");
4865 if (!get_aim_dir(&dir)) return;
4866 fire_ball(GF_FIRE, dir, 72, 2);
4867 o_ptr->timeout = 400;
4874 msg_print("¥¢¥Ã¥¯¥¹¤Î¿Ï¤¬¹õ¤¯µ±¤¤¤¿...");
4876 msg_print("Your axe blade glows black...");
4879 if (!get_aim_dir(&dir)) return;
4880 drain_life(dir, 120);
4881 o_ptr->timeout = 400;
4888 msg_print("¤¢¤Ê¤¿¤ÎÁä¤ÏÅŵ¤¤Ç¥¹¥Ñ¡¼¥¯¤·¤Æ¤¤¤ë...");
4890 msg_print("Your spear crackles with electricity...");
4893 if (!get_aim_dir(&dir)) return;
4894 fire_ball(GF_ELEC, dir, 100, 3);
4895 o_ptr->timeout = 200;
4902 msg_print("¥¹¥Ô¥¢¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4904 msg_print("Your spear glows a bright white...");
4907 if (!get_aim_dir(&dir)) return;
4908 fire_ball(GF_COLD, dir, 100, 3);
4909 o_ptr->timeout = 200;
4916 msg_print("¥¹¥Ô¥¢¤¬¸ÝÆ°¤·¤¿...");
4918 msg_print("Your spear pulsates...");
4921 if (!get_aim_dir(&dir)) return;
4930 msg_print("¤Ä¤ë¤Ï¤·¤¬¸ÝÆ°¤·¤¿...");
4932 msg_print("Your mattock pulsates...");
4935 if (!get_aim_dir(&dir)) return;
4944 msg_print("¥¢¥Ã¥¯¥¹¤«¤é¤Ò¤É¤¯±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
4946 msg_print("Your axe lets out a long, shrill note...");
4949 (void)mass_genocide(200, TRUE);
4950 o_ptr->timeout = 1000;
4957 msg_print("¥Ð¥È¥ë¡¦¥¢¥Ã¥¯¥¹¤¬¿¼»ç¤Î¸÷¤òÊü¼Í¤·¤¿...");
4959 msg_print("Your battle axe radiates deep purple...");
4962 hp_player(damroll(4, 8));
4963 (void)set_cut((p_ptr->cut / 2) - 50);
4964 o_ptr->timeout = randint0(3) + 3;
4971 msg_print("¥È¥é¥¤¥Ç¥ó¥È¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4973 msg_print("Your trident glows deep red...");
4976 if (!get_aim_dir(&dir)) return;
4977 teleport_monster(dir);
4978 o_ptr->timeout = 150;
4985 msg_print("Âç³ù¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
4987 msg_print("Your scythe glows soft white...");
4989 if (!word_of_recall()) return;
4990 o_ptr->timeout = 200;
4997 msg_print("¸û¶Ì¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
4999 msg_print("Your scythe glows soft white...");
5001 if (!word_of_recall()) return;
5002 o_ptr->timeout = 200;
5009 msg_print("¥Õ¥ì¥¤¥ë¤¬ÍÍ¡¹¤Ê¿§¤Î²Ð²Ö¤òȯ¤·¤¿...");
5011 msg_print("Your flail glows in scintillating colours...");
5014 if (!get_aim_dir(&dir)) return;
5015 confuse_monster(dir, 20);
5016 o_ptr->timeout = 15;
5023 msg_print("¥â¡¼¥Ë¥ó¥°¥¹¥¿¡¼¤«¤é±ê¤¬¿á¤½Ð¤·¤¿...");
5025 msg_print("Your morning star rages in fire...");
5028 if (!get_aim_dir(&dir)) return;
5029 fire_ball(GF_FIRE, dir, 72, 3);
5030 o_ptr->timeout = 100;
5037 msg_print("¥à¥Á¤¬¿¼¤¤ÀÖ¿§¤Ëµ±¤¤¤¿...");
5039 msg_print("Your whip glows deep red...");
5042 if (!get_aim_dir(&dir)) return;
5043 fire_ball(GF_FIRE, dir, 120, 3);
5044 o_ptr->timeout = 15;
5051 msg_print("¥á¥¤¥¹¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
5053 msg_print("Your mace glows bright green...");
5056 (void)set_fast(randint1(20) + 20, FALSE);
5057 o_ptr->timeout = randint0(100) + 100;
5064 msg_print("¥¯¥©¡¼¥¿¡¼¥¹¥¿¥Ã¥Õ¤¬²«¿§¤¯µ±¤¤¤¿...");
5066 msg_print("Your quarterstaff glows yellow...");
5069 if (!ident_spell(FALSE)) return;
5070 o_ptr->timeout = 10;
5077 msg_print("¾ó¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
5079 msg_print("Your quarterstaff glows brightly...");
5082 detect_all(DETECT_RAD_DEFAULT);
5084 identify_fully(FALSE);
5085 o_ptr->timeout = 1000;
5092 msg_print("¥Ï¥ó¥Þ¡¼¤¬Çò¤¯µ±¤¤¤¿...");
5094 msg_print("Your hammer glows white...");
5097 if (!get_aim_dir(&dir)) return;
5098 drain_life(dir, 90);
5099 o_ptr->timeout = 70;
5106 msg_print("¥¯¥í¥¹¥Ü¥¦¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
5108 msg_print("Your crossbow glows deep red...");
5111 (void)brand_bolts();
5112 o_ptr->timeout = 999;
5119 int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
5122 msg_print("¤»¤Ã¤«¤¯¤À¤«¤é¡Ø¥¯¥ê¥à¥¾¥ó¡Ù¤ò¤Ö¤Ã¤Ñ¤Ê¤¹¤¼¡ª");
5124 msg_print("I'll fire CRIMSON! SEKKAKUDAKARA!");
5127 if (!get_aim_dir(&dir)) return;
5129 /* Use the given direction */
5130 tx = px + 99 * ddx[dir];
5131 ty = py + 99 * ddy[dir];
5133 /* Hack -- Use an actual "target" */
5134 if ((dir == 5) && target_okay())
5140 if (p_ptr->pclass == CLASS_ARCHER)
5142 /* Extra shot at level 10 */
5143 if (p_ptr->lev >= 10) num++;
5145 /* Extra shot at level 30 */
5146 if (p_ptr->lev >= 30) num++;
5148 /* Extra shot at level 45 */
5149 if (p_ptr->lev >= 45) num++;
5152 for (i = 0; i < num; i++)
5153 project(0, p_ptr->lev/20+1, ty, tx, p_ptr->lev*p_ptr->lev*6/50, GF_ROCKET, flg, -1);
5154 o_ptr->timeout = 15;
5159 monster_type *m_ptr;
5160 monster_race *r_ptr;
5164 msg_print("´ñ̯¤Ê¾ì½ê¤¬Æ¬¤ÎÃæ¤ËÉ⤫¤ó¤À¡¥¡¥¡¥");
5166 msg_print("Some strange places show up in your mind. And you see ...");
5169 /* Process the monsters (backwards) */
5170 for (i = m_max - 1; i >= 1; i--)
5172 /* Access the monster */
5175 /* Ignore "dead" monsters */
5176 if (!m_ptr->r_idx) continue;
5178 r_ptr = &r_info[m_ptr->r_idx];
5180 if(r_ptr->flags1 & RF1_UNIQUE)
5183 msg_format("%s¡¥ ",r_name + r_ptr->name);
5185 msg_format("%s. ",r_name + r_ptr->name);
5189 o_ptr->timeout = 200;
5193 case ART_STONE_LORE:
5196 msg_print("ÀФ¬±£¤µ¤ì¤¿ÈëÌ©¤ò¼Ì¤·½Ð¤·¤¿¡¥¡¥¡¥");
5198 msg_print("The stone reveals hidden mysteries...");
5200 if (!ident_spell(FALSE)) return;
5202 if (mp_ptr->spell_book)
5204 /* Sufficient mana */
5205 if (20 <= p_ptr->csp)
5211 /* Over-exert the player */
5214 int oops = 20 - p_ptr->csp;
5218 p_ptr->csp_frac = 0;
5222 msg_print("ÀФòÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
5224 msg_print("You are too weak to control the stone!");
5227 /* Hack -- Bypass free action */
5228 (void)set_paralyzed(p_ptr->paralyzed +
5229 randint1(5 * oops + 1));
5232 (void)set_confused(p_ptr->confused +
5233 randint1(5 * oops + 1));
5237 p_ptr->redraw |= (PR_MANA);
5241 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "´í¸±¤ÊÈëÌ©", -1);
5243 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "perilous secrets", -1);
5247 if (one_in_(5)) (void)set_confused(p_ptr->confused +
5250 /* Exercise a little care... */
5253 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "´í¸±¤ÊÈëÌ©", -1);
5255 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "perilous secrets", -1);
5263 msg_print("You wind a mighty blast; your enemies tremble!");
5264 (void)turn_monsters((3 * p_ptr->lev / 2) + 10);
5265 o_ptr->timeout = randint0(40) + 40;
5271 msg_print("¤¢¤Ê¤¿¤Ï³²Ãî¤ò°ìÁݤ·¤¿¡£");
5273 msg_print("You exterminate small life.");
5275 (void)dispel_monsters(4);
5276 o_ptr->timeout = randint0(55) + 55;
5283 msg_print("Æߤ¤²»¤¬ÊÕ¤ê¤òÊñ¤ß¤³¤ó¤À¡£");
5285 msg_print("A shrill wailing sound surrounds you.");
5287 (void)set_protevil(randint1(25) + p_ptr->lev, FALSE);
5288 o_ptr->timeout = randint0(200) + 200;
5296 msg_print("¥í¡¼¥Ö¤¬½ã¿è¤ÊËâÎϤǿ̤¨¤¿¡£");
5298 msg_print("The robe pulsates with raw mana...");
5300 if (!get_aim_dir(&dir)) return;
5301 fire_bolt(GF_MANA, dir, 120);
5302 o_ptr->timeout = randint0(120) + 120;
5307 (void)set_fast(randint1(50) + 50, FALSE);
5310 set_hero(randint1(50) + 50, FALSE);
5311 o_ptr->timeout = randint0(200) + 100;
5317 msg_print("¥·¡¼¥ë¥É¤¬âÁ¤·¤¤¸÷¤Çµ±¤¤¤¿¡¥¡¥¡¥");
5319 msg_print("Your shield gleams with blinding light...");
5321 fire_ball(GF_LITE, 0, 300, 6);
5322 confuse_monsters(3 * p_ptr->lev / 2);
5323 o_ptr->timeout = 250;
5329 msg_print("¥«¡¼¥É¤¬Çò¤¯µ±¤¤¤¿¡¥¡¥¡¥");
5331 msg_print("Your card gleams with blinding light...");
5333 if (!recharge(1000)) return;
5334 o_ptr->timeout = 200;
5340 if (get_check("ËÜÅö¤Ë»È¤¤¤Þ¤¹¤«¡©"))
5342 if (get_check("Are you sure?!"))
5346 msg_print("¼Àµ¤¬¿Ì¤¨¤¿¡¥¡¥¡¥");
5348 msg_print("The Muramasa pulsates...");
5354 msg_print("¼Àµ¤Ï²õ¤ì¤¿¡ª");
5356 msg_print("The Muramasa is destroyed!");
5358 curse_weapon(TRUE, item);
5366 msg_print("ÀФ¬ÀÄÇò¤¯¸÷¤Ã¤¿¡¥¡¥¡¥");
5368 msg_print("Your stone glows pale...");
5371 if (!get_aim_dir(&dir)) return;
5372 fire_ball(GF_MANA, dir, 400, 4);
5373 o_ptr->timeout = randint0(250) + 250;
5380 if (!get_rep_dir2(&dir)) return;
5384 if (!(cave[y][x].feat == FEAT_DEEP_WATER) && !(cave[y][x].feat == FEAT_SHAL_WATER))
5387 msg_print("¤½¤³¤ÏΦÃϤÀ¡£");
5389 msg_print("There is no fishing place.");
5393 else if (cave[y][x].m_idx)
5396 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
5398 msg_format("%s¤¬¼ÙËâ¤À¡ª", m_name);
5400 msg_format("%^s is stand in your way.", m_name);
5405 set_action(ACTION_FISH);
5406 p_ptr->redraw |= (PR_STATE);
5411 if (!get_aim_dir(&dir)) return;
5413 msg_print("¥à¥Á¤ò¿¤Ð¤·¤¿¡£");
5415 msg_print("You stretched your wip.");
5418 fetch(dir, 500, TRUE);
5419 o_ptr->timeout = randint0(25) + 25;
5424 u32b mode = PM_ALLOW_GROUP;
5425 bool pet = !one_in_(5);
5426 if (pet) mode |= PM_FORCE_PET;
5427 else mode |= PM_NO_PET;
5429 if (summon_specific((pet ? -1 : 0), py, px, ((p_ptr->lev * 3) / 2), SUMMON_HOUND, mode))
5434 msg_print("¥Ï¥¦¥ó¥É¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5436 msg_print("A group of hounds appear as your servant.");
5441 msg_print("¥Ï¥¦¥ó¥É¤Ï¤¢¤Ê¤¿¤Ë²ç¤ò¸þ¤±¤Æ¤¤¤ë¡ª");
5443 msg_print("A group of hounds appear as your enemy!");
5448 o_ptr->timeout = 300 + randint1(150);
5455 msg_print("¥¹¥Ô¥¢¤ÏâÁ¤·¤¯µ±¤¤¤¿...");
5457 msg_print("Your spear grows brightly...");
5460 if (!get_aim_dir(&dir)) return;
5461 fire_ball(GF_LITE, dir, 200, 3);
5462 o_ptr->timeout = randint0(200) + 200;
5469 monster_type *m_ptr;
5474 if (summon_named_creature(0, py, px, MON_SUKE, PM_FORCE_PET))
5477 msg_print("¡Ø½õ¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5479 msg_print("Suke-san apperars.");
5480 kakusan = "Suke-san";
5484 if (summon_named_creature(0, py, px, MON_KAKU, PM_FORCE_PET))
5487 msg_print("¡Ø³Ê¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5489 msg_print("Kaku-san appears.");
5490 kakusan = "Kaku-san";
5496 for (i = m_max - 1; i > 0; i--)
5499 if (!m_ptr->r_idx) continue;
5500 if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
5501 if (!los(m_ptr->fy, m_ptr->fx, py, px)) continue;
5510 msg_print("¡Ö¼Ô¤É¤â¡¢¤Ò¤«¤¨¤ª¤í¤¦¡ª¡ª¡ª¤³¤Î¤ªÊý¤ò¤É¤Ê¤¿¤È¤³¤³¤í¤¨¤ë¡£¡×");
5512 msg_format("%^s says 'WHO do you think this person is! Bow your head, down your knees!'", kakusan);
5517 confuse_monsters(120);
5519 stasis_monsters(120);
5525 msg_print("¤·¤«¤·¡¢²¿¤âµ¯¤¤Ê¤«¤Ã¤¿¡£");
5527 msg_print("Nothing happen.");
5530 o_ptr->timeout = randint0(150) + 150;
5537 msg_print("Çï»ÒÌÚ¤òÂǤä¿¡£");
5539 msg_print("You beat Your wooden clappers.");
5541 aggravate_monsters(0);
5548 set_hero(randint1(25)+25, FALSE);
5550 o_ptr->timeout = randint0(30) + 30;
5556 (void)set_poisoned(0);
5557 (void)set_confused(0);
5563 o_ptr->timeout = 100;
5569 if (!get_aim_dir(&dir)) return;
5570 (void)charm_animal(dir, p_ptr->lev);
5572 o_ptr->timeout = 200;
5579 msg_print("¥½¡¼¥É¤¬Ã¸¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
5581 msg_print("Your sword glows a pale blue...");
5583 if (!get_aim_dir(&dir)) return;
5584 fire_bolt(GF_COLD, dir, damroll(12, 8));
5585 o_ptr->timeout = 50;
5592 msg_print("³ù¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
5594 msg_print("Your scythe glows brightly!");
5596 for (i = 0; i < TR_FLAG_SIZE; i++)
5597 o_ptr->art_flags[i] = a_info[ART_BLOOD].flags[i];
5599 dummy = randint1(2)+randint1(2);
5600 for (i = 0; i < dummy; i++)
5602 int flag = randint0(19);
5603 if (flag == 18) add_flag(o_ptr->art_flags, TR_SLAY_HUMAN);
5604 else add_flag(o_ptr->art_flags, TR_CHAOTIC + flag);
5606 dummy = randint1(2);
5607 for (i = 0; i < dummy; i++)
5608 one_resistance(o_ptr);
5610 for (i = 0; i < dummy; i++)
5612 int tmp = randint0(11);
5613 if (tmp < 6) add_flag(o_ptr->art_flags, TR_STR + tmp);
5614 else add_flag(o_ptr->art_flags, TR_STEALTH + tmp - 6);
5616 o_ptr->timeout = 3333;
5617 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
5618 p_ptr->update |= (PU_BONUS | PU_HP);
5624 msg_print("Î϶¯¤¯»Í¸Ô¤òƧ¤ó¤À¡£");
5626 msg_print("You stamp. (as if you are in a ring.)");
5628 (void)set_hero(randint1(20) + 20, FALSE);
5629 dispel_evil(p_ptr->lev * 3);
5630 o_ptr->timeout = 100 + randint1(100);
5636 msg_print("¥¯¥í¡¼¥¯¤¬Çò¤¯µ±¤¤¤¿...");
5638 msg_print("Your cloak grows white.");
5640 (void)set_oppose_cold(randint1(20) + 20, FALSE);
5641 o_ptr->timeout = 40 + randint1(40);
5647 msg_print("¥à¥Á¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
5649 msg_print("The whip lets out a shrill wail...");
5653 (void)set_protevil(randint1(25) + k, FALSE);
5654 o_ptr->timeout = randint0(225) + 225;
5659 u32b mode = PM_ALLOW_GROUP;
5660 bool pet = !one_in_(5);
5661 if (pet) mode |= PM_FORCE_PET;
5663 if (summon_named_creature(0, py, px, MON_JIZOTAKO, mode))
5667 msg_print("Âý¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5669 msg_print("A group of octopuses appear as your servant.");
5674 msg_print("Âý¤Ï¤¢¤Ê¤¿¤òâˤó¤Ç¤¤¤ë¡ª");
5676 msg_print("A group of octopuses appear as your enemy!");
5681 o_ptr->timeout = 300 + randint1(150);
5688 msg_print("Å´µå¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
5690 msg_print("The iron ball floods the area with goodness...");
5693 dispel_evil(p_ptr->lev * 5);
5694 o_ptr->timeout = randint0(100) + 100;
5701 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤¬¿¼¤¤°Ç¤Ëʤ¤ï¤ì¤¿...");
5703 msg_print("Your amulet is coverd in pitch-darkness...");
5705 if (!get_aim_dir(&dir)) return;
5706 fire_ball(GF_DARK, dir, 250, 4);
5707 o_ptr->timeout = randint0(150) + 150;
5713 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5719 if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3))
5721 switch (o_ptr->xtra3-1)
5723 case ESSENCE_TMP_RES_ACID:
5724 (void)set_oppose_acid(randint1(20) + 20, FALSE);
5725 o_ptr->timeout = randint0(50) + 50;
5728 case ESSENCE_TMP_RES_ELEC:
5729 (void)set_oppose_elec(randint1(20) + 20, FALSE);
5730 o_ptr->timeout = randint0(50) + 50;
5733 case ESSENCE_TMP_RES_FIRE:
5734 (void)set_oppose_fire(randint1(20) + 20, FALSE);
5735 o_ptr->timeout = randint0(50) + 50;
5738 case ESSENCE_TMP_RES_COLD:
5739 (void)set_oppose_cold(randint1(20) + 20, FALSE);
5740 o_ptr->timeout = randint0(50) + 50;
5744 earthquake(py, px, 5);
5745 o_ptr->timeout = 100 + randint1(100);
5748 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5756 if (o_ptr->name2 == EGO_TRUMP)
5758 teleport_player(100);
5759 o_ptr->timeout = 50 + randint1(50);
5762 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5769 if (o_ptr->name2 == EGO_LITE_ILLUMINATION)
5771 if (!o_ptr->xtra4 && ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
5774 msg_print("dzÎÁ¤¬¤Ê¤¤¡£");
5776 msg_print("It has no fuel.");
5781 lite_area(damroll(2, 15), 3);
5782 o_ptr->timeout = randint0(10) + 10;
5785 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5791 if (o_ptr->name2 == EGO_EARTHQUAKES)
5793 earthquake(py, px, 5);
5794 o_ptr->timeout = 100 + randint1(100);
5797 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5804 if (o_ptr->name2 == EGO_JUMP)
5806 teleport_player(10);
5807 o_ptr->timeout = 10 + randint1(10);
5810 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5817 /* Hack -- Dragon Scale Mail can be activated as well */
5818 if (o_ptr->tval == TV_DRAG_ARMOR)
5820 /* Get a direction for breathing (or abort) */
5821 if (!get_aim_dir(&dir)) return;
5823 /* Branch on the sub-type */
5824 switch (o_ptr->sval)
5826 case SV_DRAGON_BLUE:
5829 msg_print("¤¢¤Ê¤¿¤Ï°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5831 msg_print("You breathe lightning.");
5834 fire_ball(GF_ELEC, dir, 100, -2);
5835 o_ptr->timeout = randint0(150) + 150;
5839 case SV_DRAGON_WHITE:
5842 msg_print("¤¢¤Ê¤¿¤ÏÎ䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5844 msg_print("You breathe frost.");
5847 fire_ball(GF_COLD, dir, 110, -2);
5848 o_ptr->timeout = randint0(150) + 150;
5852 case SV_DRAGON_BLACK:
5855 msg_print("¤¢¤Ê¤¿¤Ï»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5857 msg_print("You breathe acid.");
5860 fire_ball(GF_ACID, dir, 130, -2);
5861 o_ptr->timeout = randint0(150) + 150;
5865 case SV_DRAGON_GREEN:
5868 msg_print("¤¢¤Ê¤¿¤ÏÆÇ¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5870 msg_print("You breathe poison gas.");
5873 fire_ball(GF_POIS, dir, 150, -2);
5874 o_ptr->timeout = randint0(180) + 180;
5881 msg_print("¤¢¤Ê¤¿¤Ï²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5883 msg_print("You breathe fire.");
5886 fire_ball(GF_FIRE, dir, 200, -2);
5887 o_ptr->timeout = randint0(200) + 200;
5891 case SV_DRAGON_MULTIHUED:
5893 chance = randint0(5);
5895 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5896 ((chance == 1) ? "°ðºÊ" :
5897 ((chance == 2) ? "Î䵤" :
5898 ((chance == 3) ? "»À" :
5899 ((chance == 4) ? "ÆÇ¥¬¥¹" : "²Ð±ê")))));
5901 msg_format("You breathe %s.",
5902 ((chance == 1) ? "lightning" :
5903 ((chance == 2) ? "frost" :
5904 ((chance == 3) ? "acid" :
5905 ((chance == 4) ? "poison gas" : "fire")))));
5908 fire_ball(((chance == 1) ? GF_ELEC :
5909 ((chance == 2) ? GF_COLD :
5910 ((chance == 3) ? GF_ACID :
5911 ((chance == 4) ? GF_POIS : GF_FIRE)))),
5913 o_ptr->timeout = randint0(200) + 200;
5917 case SV_DRAGON_BRONZE:
5920 msg_print("¤¢¤Ê¤¿¤Ïº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5922 msg_print("You breathe confusion.");
5925 fire_ball(GF_CONFUSION, dir, 120, -2);
5926 o_ptr->timeout = randint0(180) + 180;
5930 case SV_DRAGON_GOLD:
5933 msg_print("¤¢¤Ê¤¿¤Ï¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5935 msg_print("You breathe sound.");
5938 fire_ball(GF_SOUND, dir, 130, -2);
5939 o_ptr->timeout = randint0(180) + 180;
5943 case SV_DRAGON_CHAOS:
5945 chance = randint0(2);
5947 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5948 ((chance == 1 ? "¥«¥ª¥¹" : "Îô²½")));
5950 msg_format("You breathe %s.",
5951 ((chance == 1 ? "chaos" : "disenchantment")));
5954 fire_ball((chance == 1 ? GF_CHAOS : GF_DISENCHANT),
5956 o_ptr->timeout = randint0(200) + 200;
5962 chance = randint0(2);
5964 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5965 ((chance == 1 ? "¹ì²»" : "ÇËÊÒ")));
5967 msg_format("You breathe %s.",
5968 ((chance == 1 ? "sound" : "shards")));
5971 fire_ball((chance == 1 ? GF_SOUND : GF_SHARDS),
5973 o_ptr->timeout = randint0(200) + 200;
5977 case SV_DRAGON_BALANCE:
5979 chance = randint0(4);
5981 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿",
5982 ((chance == 1) ? "¥«¥ª¥¹" :
5983 ((chance == 2) ? "Îô²½" :
5984 ((chance == 3) ? "¹ì²»" : "ÇËÊÒ"))));
5986 msg_format("You breathe %s.",
5987 ((chance == 1) ? "chaos" :
5988 ((chance == 2) ? "disenchantment" :
5989 ((chance == 3) ? "sound" : "shards"))));
5992 fire_ball(((chance == 1) ? GF_CHAOS :
5993 ((chance == 2) ? GF_DISENCHANT :
5994 ((chance == 3) ? GF_SOUND : GF_SHARDS))),
5996 o_ptr->timeout = randint0(200) + 200;
6000 case SV_DRAGON_SHINING:
6002 chance = randint0(2);
6004 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
6005 ((chance == 0 ? "Á®¸÷" : "°Å¹õ")));
6007 msg_format("You breathe %s.",
6008 ((chance == 0 ? "light" : "darkness")));
6011 fire_ball((chance == 0 ? GF_LITE : GF_DARK), dir, 200, -2);
6012 o_ptr->timeout = randint0(200) + 200;
6016 case SV_DRAGON_POWER:
6019 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6021 msg_print("You breathe the elements.");
6024 fire_ball(GF_MISSILE, dir, 300, -3);
6025 o_ptr->timeout = randint0(200) + 200;
6031 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6037 else if (o_ptr->tval == TV_RING)
6041 bool success = TRUE;
6043 switch (o_ptr->name2)
6046 (void)set_afraid(0);
6047 (void)set_hero(randint1(25) + 25, FALSE);
6048 (void)hp_player(10);
6049 o_ptr->timeout = randint1(100)+100;
6051 case EGO_RING_MAGIC_MIS:
6052 if (!get_aim_dir(&dir)) return;
6053 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
6056 case EGO_RING_FIRE_BOLT:
6057 if (!get_aim_dir(&dir)) return;
6058 fire_bolt(GF_FIRE, dir, damroll(9, 8));
6059 o_ptr->timeout = randint0(8) + 8;
6061 case EGO_RING_COLD_BOLT:
6062 if (!get_aim_dir(&dir)) return;
6063 fire_bolt(GF_COLD, dir, damroll(6, 8));
6064 o_ptr->timeout = randint0(7) + 7;
6066 case EGO_RING_ELEC_BOLT:
6067 if (!get_aim_dir(&dir)) return;
6068 fire_bolt(GF_ELEC, dir, damroll(4, 8));
6069 o_ptr->timeout = randint0(5) + 5;
6071 case EGO_RING_ACID_BOLT:
6072 if (!get_aim_dir(&dir)) return;
6073 fire_bolt(GF_FIRE, dir, damroll(5, 8));
6074 o_ptr->timeout = randint0(6) + 6;
6076 case EGO_RING_MANA_BOLT:
6077 if (!get_aim_dir(&dir)) return;
6078 fire_bolt(GF_MANA, dir, 120);
6079 o_ptr->timeout = randint0(120)+120;
6081 case EGO_RING_FIRE_BALL:
6082 if (!get_aim_dir(&dir)) return;
6083 fire_ball(GF_FIRE, dir, 100, 2);
6084 o_ptr->timeout = randint0(80) + 80;
6086 case EGO_RING_COLD_BALL:
6087 if (!get_aim_dir(&dir)) return;
6088 fire_ball(GF_COLD, dir, 100, 2);
6089 o_ptr->timeout = randint0(80) + 80;
6091 case EGO_RING_ELEC_BALL:
6092 if (!get_aim_dir(&dir)) return;
6093 fire_ball(GF_ELEC, dir, 100, 2);
6094 o_ptr->timeout = randint0(80) + 80;
6096 case EGO_RING_ACID_BALL:
6097 if (!get_aim_dir(&dir)) return;
6098 fire_ball(GF_ACID, dir, 100, 2);
6099 o_ptr->timeout = randint0(80) + 80;
6101 case EGO_RING_MANA_BALL:
6102 if (!get_aim_dir(&dir)) return;
6103 fire_ball(GF_MANA, dir, 250, 2);
6104 o_ptr->timeout = 300;
6106 case EGO_RING_DRAGON_F:
6107 if (!get_aim_dir(&dir)) return;
6108 fire_ball(GF_FIRE, dir, 200, -2);
6109 if (o_ptr->sval == SV_RING_FLAMES)
6111 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6112 o_ptr->timeout = 200;
6114 else o_ptr->timeout = 250;
6116 case EGO_RING_DRAGON_C:
6117 if (!get_aim_dir(&dir)) return;
6118 fire_ball(GF_COLD, dir, 200, -2);
6119 if (o_ptr->sval == SV_RING_ICE)
6121 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6122 o_ptr->timeout = 200;
6124 else o_ptr->timeout = 250;
6126 case EGO_RING_M_DETECT:
6127 (void)detect_monsters_invis(255);
6128 (void)detect_monsters_normal(255);
6129 o_ptr->timeout = 150;
6131 case EGO_RING_D_SPEED:
6132 (void)set_fast(randint1(30) + 15, FALSE);
6133 o_ptr->timeout = 100;
6135 case EGO_RING_BERSERKER:
6136 (void)set_shero(randint1(25) + 25, FALSE);
6137 o_ptr->timeout = randint0(75)+75;
6139 case EGO_RING_TELE_AWAY:
6140 if (!get_aim_dir(&dir)) return;
6141 teleport_monster(dir);
6142 o_ptr->timeout = 150;
6146 int v = randint1(25)+25;
6147 (void)set_afraid(0);
6148 (void)set_hero(v, FALSE);
6149 (void)hp_player(10);
6150 (void)set_blessed(v, FALSE);
6151 (void)set_oppose_acid(v, FALSE);
6152 (void)set_oppose_elec(v, FALSE);
6153 (void)set_oppose_fire(v, FALSE);
6154 (void)set_oppose_cold(v, FALSE);
6155 (void)set_oppose_pois(v, FALSE);
6156 (void)set_ultimate_res(v, FALSE);
6157 o_ptr->timeout = 777;
6164 if (success) return;
6167 /* Get a direction for breathing (or abort) */
6168 if (!get_aim_dir(&dir)) return;
6170 switch (o_ptr->sval)
6174 fire_ball(GF_ACID, dir, 100, 2);
6175 (void)set_oppose_acid(randint1(20) + 20, FALSE);
6176 o_ptr->timeout = randint0(50) + 50;
6182 fire_ball(GF_COLD, dir, 100, 2);
6183 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6184 o_ptr->timeout = randint0(50) + 50;
6188 case SV_RING_FLAMES:
6190 fire_ball(GF_FIRE, dir, 100, 2);
6191 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6192 o_ptr->timeout = randint0(50) + 50;
6198 fire_ball(GF_ELEC, dir, 100, 2);
6199 (void)set_oppose_elec(randint1(20) + 20, FALSE);
6200 o_ptr->timeout = randint0(50) + 50;
6206 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6212 else if (o_ptr->tval == TV_AMULET)
6216 switch (o_ptr->name2)
6219 if (!ident_spell(FALSE)) return;
6220 o_ptr->timeout = 10;
6223 if (!get_aim_dir(&dir)) return;
6224 charm_monster(dir, MAX(20, p_ptr->lev));
6225 o_ptr->timeout = 200;
6228 teleport_player(10);
6229 o_ptr->timeout = randint0(10) + 10;
6231 case EGO_AMU_TELEPORT:
6232 teleport_player(100);
6233 o_ptr->timeout = randint0(50) + 50;
6235 case EGO_AMU_D_DOOR:
6236 (void)dimension_door();
6237 o_ptr->timeout = 200;
6239 case EGO_AMU_RES_FIRE_:
6240 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6241 o_ptr->timeout = randint0(50) + 50;
6243 case EGO_AMU_RES_COLD_:
6244 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6245 o_ptr->timeout = randint0(50) + 50;
6247 case EGO_AMU_RES_ELEC_:
6248 (void)set_oppose_elec(randint1(20) + 20, FALSE);
6249 o_ptr->timeout = randint0(50) + 50;
6251 case EGO_AMU_RES_ACID_:
6252 (void)set_oppose_acid(randint1(20) + 20, FALSE);
6253 o_ptr->timeout = randint0(50) + 50;
6255 case EGO_AMU_DETECTION:
6256 detect_all(DETECT_RAD_DEFAULT);
6257 o_ptr->timeout = randint0(55)+55;
6264 else if (o_ptr->tval == TV_WHISTLE)
6267 if (cursed_p(o_ptr))
6270 msg_print("¥«¥ó¹â¤¤²»¤¬¶Á¤ÅϤä¿¡£");
6272 msg_print("You produce a shrill whistling sound.");
6274 aggravate_monsters(0);
6284 /* Allocate the "who" array */
6285 C_MAKE(who, max_m_idx, u16b);
6287 /* Process the monsters (backwards) */
6288 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6290 if (is_pet(&m_list[pet_ctr]) && (p_ptr->riding != pet_ctr))
6291 who[max_pet++] = pet_ctr;
6294 /* Select the sort method */
6295 ang_sort_comp = ang_sort_comp_pet;
6296 ang_sort_swap = ang_sort_swap_hook;
6298 ang_sort(who, &dummy_why, max_pet);
6300 /* Process the monsters (backwards) */
6301 for (i = 0; i < max_pet; i++)
6304 teleport_to_player(pet_ctr, 100);
6307 /* Free the "who" array */
6308 C_KILL(who, max_m_idx, u16b);
6310 o_ptr->timeout = 100+randint1(100);
6313 else if (o_ptr->tval == TV_CAPTURE)
6317 bool old_target_pet = target_pet;
6319 if (!get_aim_dir(&dir))
6321 target_pet = old_target_pet;
6324 target_pet = old_target_pet;
6326 if(fire_ball(GF_CAPTURE, dir, 0, 0))
6328 o_ptr->pval = cap_mon;
6329 o_ptr->xtra3 = cap_mspeed;
6330 o_ptr->xtra4 = cap_hp;
6331 o_ptr->xtra5 = cap_maxhp;
6338 if (o_ptr->inscription)
6339 strcpy(buf, quark_str(o_ptr->inscription));
6341 for (s = buf;*s && (*s != '#'); s++)
6344 if (iskanji(*s)) s++;
6354 t = quark_str(cap_nickname);
6367 o_ptr->inscription = quark_add(buf);
6373 bool success = FALSE;
6374 if (!get_rep_dir2(&dir)) return;
6375 if (cave_floor_bold(py+ddy[dir],px+ddx[dir]))
6377 if (place_monster_aux(0, py + ddy[dir], px + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
6379 if (o_ptr->xtra3) m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
6380 if (o_ptr->xtra5) m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
6381 if (o_ptr->xtra4) m_list[hack_m_idx_ii].hp = o_ptr->xtra4;
6382 m_list[hack_m_idx_ii].maxhp = m_list[hack_m_idx_ii].max_maxhp;
6383 if (o_ptr->inscription)
6391 t = quark_str(o_ptr->inscription);
6392 for (t = quark_str(o_ptr->inscription);*t && (*t != '#'); t++)
6395 if (iskanji(*t)) t++;
6420 if (quote && *(s-1) =='\'')
6424 m_list[hack_m_idx_ii].nickname = quark_add(buf);
6425 t = quark_str(o_ptr->inscription);
6427 while(*t && (*t != '#'))
6434 o_ptr->inscription = quark_add(buf);
6446 msg_print("¤ª¤Ã¤È¡¢²òÊü¤Ë¼ºÇÔ¤·¤¿¡£");
6448 msg_print("Oops. You failed to release your pet.");
6456 msg_print("¤ª¤Ã¤È¡¢¤³¤Î¥¢¥¤¥Æ¥à¤Ï»ÏÆ°¤Ç¤¤Ê¤¤¡£");
6458 msg_print("Oops. That object cannot be activated.");
6464 void do_cmd_activate(void)
6470 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6472 set_action(ACTION_NONE);
6475 item_tester_no_ryoute = TRUE;
6476 /* Prepare the hook */
6477 item_tester_hook = item_tester_hook_activate;
6481 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò»ÏÆ°¤µ¤»¤Þ¤¹¤«? ";
6482 s = "»ÏÆ°¤Ç¤¤ë¥¢¥¤¥Æ¥à¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£";
6484 q = "Activate which item? ";
6485 s = "You have nothing to activate.";
6488 if (!get_item(&item, q, s, (USE_EQUIP))) return;
6490 /* Activate the item */
6491 do_cmd_activate_aux(item);
6496 * Hook to determine if an object is useable
6498 static bool item_tester_hook_use(object_type *o_ptr)
6500 u32b flgs[TR_FLAG_SIZE];
6503 if (o_ptr->tval == p_ptr->tval_ammo)
6506 /* Useable object */
6507 switch (o_ptr->tval)
6525 if (!object_known_p(o_ptr)) return (FALSE);
6527 /* HACK - only items from the equipment can be activated */
6528 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
6530 if (&inventory[i] == o_ptr)
6532 /* Extract the flags */
6533 object_flags(o_ptr, flgs);
6535 /* Check activation flag */
6536 if (have_flag(flgs, TR_ACTIVATE)) return (TRUE);
6549 * XXX - Add actions for other item types
6551 void do_cmd_use(void)
6557 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6559 set_action(ACTION_NONE);
6562 item_tester_no_ryoute = TRUE;
6563 /* Prepare the hook */
6564 item_tester_hook = item_tester_hook_use;
6568 q = "¤É¤ì¤ò»È¤¤¤Þ¤¹¤«¡©";
6569 s = "»È¤¨¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤»¤ó¡£";
6571 q = "Use which item? ";
6572 s = "You have nothing to use.";
6575 if (!get_item(&item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR))) return;
6577 /* Get the item (in the pack) */
6580 o_ptr = &inventory[item];
6582 /* Get the item (on the floor) */
6585 o_ptr = &o_list[0 - item];
6588 switch (o_ptr->tval)
6600 do_cmd_eat_food_aux(item);
6607 do_cmd_aim_wand_aux(item);
6614 do_cmd_use_staff_aux(item);
6621 do_cmd_zap_rod_aux(item);
6625 /* Quaff a potion */
6628 do_cmd_quaff_potion_aux(item);
6635 /* Check some conditions */
6639 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡£");
6641 msg_print("You can't see anything.");
6649 msg_print("ÌÀ¤«¤ê¤¬¤Ê¤¤¤Î¤Ç¡¢°Å¤¯¤ÆÆɤá¤Ê¤¤¡£");
6651 msg_print("You have no light to read by.");
6656 if (p_ptr->confused)
6659 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
6661 msg_print("You are too confused!");
6667 do_cmd_read_scroll_aux(item, TRUE);
6676 do_cmd_fire_aux(item, &inventory[INVEN_BOW]);
6680 /* Activate an artifact */
6683 do_cmd_activate_aux(item);
6689 static bool select_magic_eater(bool only_browse)
6693 bool flag, redraw, request_list;
6695 int ask = TRUE, i = 0;
6698 int menu_line = (use_menu ? 1 : 0);
6702 if (repeat_pull(&sn))
6704 /* Verify the spell */
6705 if (sn >= EATER_EXT*2 && !(p_ptr->magic_num1[sn] > k_info[lookup_kind(TV_ROD, sn-EATER_EXT*2)].pval * (p_ptr->magic_num2[sn] - 1) * EATER_ROD_CHARGE))
6707 else if (sn < EATER_EXT*2 && !(p_ptr->magic_num1[sn] < EATER_CHARGE))
6711 #endif /* ALLOW_REPEAT */
6713 for (i = 0; i < 108; i++)
6715 if (p_ptr->magic_num2[i]) break;
6720 msg_print("ËâË¡¤ò³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6722 msg_print("You don't have any magic!");
6734 prt(format(" %s ¾ó", (menu_line == 1) ? "¡Õ" : " "), 2, 14);
6735 prt(format(" %s ËâË¡ËÀ", (menu_line == 2) ? "¡Õ" : " "), 3, 14);
6736 prt(format(" %s ¥í¥Ã¥É", (menu_line == 3) ? "¡Õ" : " "), 4, 14);
6737 prt("¤É¤Î¼ïÎà¤ÎËâË¡¤ò»È¤¤¤Þ¤¹¤«¡©", 0, 0);
6739 prt(format(" %s staff", (menu_line == 1) ? "> " : " "), 2, 14);
6740 prt(format(" %s wand", (menu_line == 2) ? "> " : " "), 3, 14);
6741 prt(format(" %s rod", (menu_line == 3) ? "> " : " "), 4, 14);
6742 prt("Which type of magic do you usu?", 0, 0);
6765 ext = (menu_line-1)*EATER_EXT;
6766 if (menu_line == 1) tval = TV_STAFF;
6767 else if (menu_line == 2) tval = TV_WAND;
6771 if (menu_line > 3) menu_line -= 3;
6780 if (!get_com("[A] ¾ó, [B] ËâË¡ËÀ, [C] ¥í¥Ã¥É:", &choice, TRUE))
6782 if (!get_com("[A] staff, [B] wand, [C] rod:", &choice, TRUE))
6787 if (choice == 'A' || choice == 'a')
6793 if (choice == 'B' || choice == 'b')
6799 if (choice == 'C' || choice == 'c')
6807 for (i = ext; i < ext + EATER_EXT; i++)
6809 if (p_ptr->magic_num2[i])
6811 if (use_menu) menu_line = i-ext+1;
6815 if (i == ext+EATER_EXT)
6818 msg_print("¤½¤Î¼ïÎà¤ÎËâË¡¤Ï³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6820 msg_print("You don't have that type of magic!");
6825 /* Nothing chosen yet */
6831 /* Build a prompt */
6833 (void) strnfmt(out_val, 78, "('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎËâÎϤò»È¤¤¤Þ¤¹¤«¡©");
6835 (void)strnfmt(out_val, 78, "(*=List, ESC=exit) Use which power? ");
6838 /* Save the screen */
6841 request_list = always_show_list;
6843 /* Get a spell from the user */
6847 if (request_list || use_menu)
6858 for (y = 1; y < 20; y++)
6863 /* Print header(s) */
6865 prt(format(" %s ¼ºÎ¨ %s ¼ºÎ¨", (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô"), (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô")), y++, x);
6867 prt(format(" %s Fail %s Fail", (tval == TV_ROD ? " Stat " : " Charges"), (tval == TV_ROD ? " Stat " : " Charges")), y++, x);
6871 for (ctr = 0; ctr < EATER_EXT; ctr++)
6873 if (!p_ptr->magic_num2[ctr+ext]) continue;
6875 k_idx = lookup_kind(tval, ctr);
6879 if (ctr == (menu_line-1))
6881 strcpy(dummy, "¡Õ");
6883 strcpy(dummy, "> ");
6885 else strcpy(dummy, " ");
6888 /* letter/number for power selection */
6895 letter = '0' + ctr - 26;
6896 sprintf(dummy, "%c)",letter);
6898 x1 = ((ctr < EATER_EXT/2) ? x : x + 40);
6899 y1 = ((ctr < EATER_EXT/2) ? y + ctr : y + ctr - EATER_EXT/2);
6900 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
6901 chance = level * 4 / 5 + 20;
6902 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
6904 if (p_ptr->lev > level)
6906 chance -= 3 * (p_ptr->lev - level);
6908 chance += p_ptr->to_m_chance;
6909 if (p_ptr->heavy_spell) chance += 20;
6910 if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
6911 else if (p_ptr->easy_spell) chance-=3;
6912 else if (p_ptr->dec_mana) chance-=2;
6913 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
6914 /* Stunning makes spells harder */
6915 if (p_ptr->stun > 50) chance += 25;
6916 else if (p_ptr->stun) chance += 15;
6918 if (chance > 95) chance = 95;
6920 if(p_ptr->dec_mana) chance--;
6921 if (p_ptr->heavy_spell) chance += 5;
6929 strcat(dummy, format(
6931 " %-22.22s ½¼Å¶:%2d/%2d%3d%%",
6933 " %-22.22s (%2d/%2d) %3d%%",
6935 k_name + k_info[k_idx].name,
6936 p_ptr->magic_num1[ctr+ext] ?
6937 (p_ptr->magic_num1[ctr+ext] - 1) / (EATER_ROD_CHARGE * k_info[k_idx].pval) +1 : 0,
6938 p_ptr->magic_num2[ctr+ext], chance));
6939 if (p_ptr->magic_num1[ctr+ext] > k_info[k_idx].pval * (p_ptr->magic_num2[ctr+ext]-1) * EATER_ROD_CHARGE) col = TERM_RED;
6943 strcat(dummy, format(" %-22.22s %2d/%2d %3d%%", k_name + k_info[k_idx].name, (s16b)(p_ptr->magic_num1[ctr+ext]/EATER_CHARGE), p_ptr->magic_num2[ctr+ext], chance));
6944 if (p_ptr->magic_num1[ctr+ext] < EATER_CHARGE) col = TERM_RED;
6949 c_prt(col, dummy, y1, x1);
6953 if(!get_com(out_val, &choice, FALSE)) break;
6955 if (use_menu && choice != ' ')
6972 menu_line += EATER_EXT - 1;
6973 if (menu_line > EATER_EXT) menu_line -= EATER_EXT;
6974 } while(!p_ptr->magic_num2[menu_line+ext-1]);
6985 if (menu_line > EATER_EXT) menu_line -= EATER_EXT;
6986 } while(!p_ptr->magic_num2[menu_line+ext-1]);
6997 bool reverse = FALSE;
6998 if ((choice == '4') || (choice == 'h') || (choice == 'H')) reverse = TRUE;
6999 if (menu_line > EATER_EXT/2)
7001 menu_line -= EATER_EXT/2;
7004 else menu_line+=EATER_EXT/2;
7005 while(!p_ptr->magic_num2[menu_line+ext-1])
7010 if (menu_line < 2) reverse = FALSE;
7015 if (menu_line > EATER_EXT-1) reverse = TRUE;
7032 /* Request redraw */
7033 if (use_menu && ask) continue;
7035 /* Request redraw */
7036 if (!use_menu && ((choice == ' ') || (choice == '*') || (choice == '?')))
7042 request_list = FALSE;
7044 /* Restore the screen */
7049 request_list = TRUE;
7057 if (isalpha(choice))
7060 ask = (isupper(choice));
7063 if (ask) choice = tolower(choice);
7065 /* Extract request */
7066 i = (islower(choice) ? A2I(choice) : -1);
7070 ask = FALSE; /* Can't uppercase digits */
7072 i = choice - '0' + 26;
7076 /* Totally Illegal */
7077 if ((i < 0) || (i > EATER_EXT) || !p_ptr->magic_num2[i+ext])
7092 (void) strnfmt(tmp_val, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", k_name + k_info[lookup_kind(tval ,i)].name);
7094 (void) strnfmt(tmp_val, 78, "Use %s?", k_name + k_info[lookup_kind(tval ,i)].name);
7097 /* Belay that order */
7098 if (!get_check(tmp_val)) continue;
7102 if (p_ptr->magic_num1[ext+i] > k_info[lookup_kind(tval, i)].pval * (p_ptr->magic_num2[ext+i] - 1) * EATER_ROD_CHARGE)
7105 msg_print("¤½¤ÎËâË¡¤Ï¤Þ¤À½¼Å¶¤·¤Æ¤¤¤ëºÇÃæ¤À¡£");
7107 msg_print("The magic are still charging.");
7110 if (use_menu) ask = TRUE;
7116 if (p_ptr->magic_num1[ext+i] < EATER_CHARGE)
7119 msg_print("¤½¤ÎËâË¡¤Ï»ÈÍѲó¿ô¤¬ÀÚ¤ì¤Æ¤¤¤ë¡£");
7121 msg_print("The magic has no charges left.");
7124 if (use_menu) ask = TRUE;
7136 /* Clear lines, position cursor (really should use strlen here) */
7137 Term_erase(7, 23, 255);
7138 Term_erase(7, 22, 255);
7139 Term_erase(7, 21, 255);
7140 Term_erase(7, 20, 255);
7142 roff_to_buf(k_text + k_info[lookup_kind(tval, i)].text, 62, temp);
7143 for (j = 0, line = 21; temp[j]; j += 1 + strlen(&temp[j]))
7145 prt(&temp[j], line, 10);
7150 prt("²¿¤«¥¡¼¤ò²¡¤·¤Æ²¼¤µ¤¤¡£",0,0);
7152 prt("Hit any key.",0,0);
7162 /* Restore the screen */
7165 if (!flag) return -1;
7169 #endif /* ALLOW_REPEAT */
7175 * Use eaten rod, wand or staff
7177 void do_cmd_magic_eater(bool only_browse)
7179 int item, chance, level, k_idx, tval, sval;
7180 bool use_charge = TRUE;
7182 /* Not when confused */
7183 if (!only_browse && p_ptr->confused)
7186 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
7188 msg_print("You are too confused!");
7194 item = select_magic_eater(only_browse);
7200 if (item >= EATER_EXT*2) {tval = TV_ROD;sval = item - EATER_EXT*2;}
7201 else if (item >= EATER_EXT) {tval = TV_WAND;sval = item - EATER_EXT;}
7202 else {tval = TV_STAFF;sval = item;}
7203 k_idx = lookup_kind(tval, sval);
7205 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
7206 chance = level * 4 / 5 + 20;
7207 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
7209 if (p_ptr->lev > level)
7211 chance -= 3 * (p_ptr->lev - level);
7213 chance += p_ptr->to_m_chance;
7214 if (p_ptr->heavy_spell) chance += 20;
7215 if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
7216 else if (p_ptr->easy_spell) chance-=3;
7217 else if (p_ptr->dec_mana) chance-=2;
7218 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
7219 /* Stunning makes spells harder */
7220 if (p_ptr->stun > 50) chance += 25;
7221 else if (p_ptr->stun) chance += 15;
7223 if (chance > 95) chance = 95;
7225 if(p_ptr->dec_mana) chance--;
7226 if (p_ptr->heavy_spell) chance += 5;
7228 if (randint0(100) < chance)
7230 if (flush_failure) flush();
7233 msg_print("¼öʸ¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª");
7235 msg_format("You failed to get the magic off!");
7239 if (randint1(100) >= chance)
7240 chg_virtue(V_CHANCE,-1);
7251 if ((sval >= SV_ROD_MIN_DIRECTION) && (sval != SV_ROD_HAVOC) && (sval != SV_ROD_AGGRAVATE) && (sval != SV_ROD_PESTICIDE))
7252 if (!get_aim_dir(&dir)) return;
7253 rod_effect(sval, dir, &use_charge, TRUE);
7254 if (!use_charge) return;
7256 else if (tval == TV_WAND)
7258 if (!get_aim_dir(&dir)) return;
7259 wand_effect(sval, dir, TRUE);
7263 staff_effect(sval, &use_charge, TRUE, TRUE);
7264 if (!use_charge) return;
7266 if (randint1(100) < chance)
7267 chg_virtue(V_CHANCE,1);
7270 if (tval == TV_ROD) p_ptr->magic_num1[item] += k_info[k_idx].pval * EATER_ROD_CHARGE;
7271 else p_ptr->magic_num1[item] -= EATER_CHARGE;