4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: Object commands */
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 || IS_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));
601 else if (o_ptr->tval == TV_FOOD && o_ptr->sval == SV_FOOD_WAYBREAD)
603 /* Waybread is always fully satisfying. */
604 set_food(MAX(p_ptr->food, PY_FOOD_MAX - 1));
608 /* Food can feed the player */
609 (void)set_food(p_ptr->food + o_ptr->pval);
612 /* Destroy a food in the pack */
615 inven_item_increase(item, -1);
616 inven_item_describe(item);
617 inven_item_optimize(item);
620 /* Destroy a food on the floor */
623 floor_item_increase(0 - item, -1);
624 floor_item_describe(0 - item);
625 floor_item_optimize(0 - item);
631 * Hook to determine if an object is eatable
633 static bool item_tester_hook_eatable(object_type *o_ptr)
635 if (o_ptr->tval==TV_FOOD) return TRUE;
638 if (prace_is_(RACE_SKELETON))
640 if (o_ptr->tval == TV_SKELETON ||
641 (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))
647 if (prace_is_(RACE_SKELETON) ||
648 prace_is_(RACE_GOLEM) ||
649 prace_is_(RACE_ZOMBIE) ||
650 prace_is_(RACE_SPECTRE))
652 if (o_ptr->tval == TV_STAFF || o_ptr->tval == TV_WAND)
655 else if (prace_is_(RACE_DEMON) ||
656 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON))
658 if (o_ptr->tval == TV_CORPSE &&
659 o_ptr->sval == SV_CORPSE &&
660 strchr("pht", r_info[o_ptr->pval].d_char))
670 * Eat some food (from the pack or floor)
672 void do_cmd_eat_food(void)
678 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
680 set_action(ACTION_NONE);
683 /* Restrict choices to food */
684 item_tester_hook = item_tester_hook_eatable;
688 q = "¤É¤ì¤ò¿©¤Ù¤Þ¤¹¤«? ";
689 s = "¿©¤Ùʪ¤¬¤Ê¤¤¡£";
691 q = "Eat which item? ";
692 s = "You have nothing to eat.";
695 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
698 do_cmd_eat_food_aux(item);
703 * Quaff a potion (from the pack or the floor)
705 static void do_cmd_quaff_potion_aux(int item)
718 if (flush_failure) flush();
720 msg_print("ÉÓ¤«¤é¿å¤¬Î®¤ì½Ð¤Æ¤³¤Ê¤¤¡ª");
722 msg_print("The potion doesn't flow out from a bottle.");
729 if((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0])
734 /* Get the item (in the pack) */
737 o_ptr = &inventory[item];
740 /* Get the item (on the floor) */
743 o_ptr = &o_list[0 - item];
746 /* Get local object */
749 /* Obtain a local object */
750 object_copy(q_ptr, o_ptr);
755 /* Reduce and describe inventory */
758 inven_item_increase(item, -1);
759 inven_item_describe(item);
760 inven_item_optimize(item);
763 /* Reduce and describe floor item */
766 floor_item_increase(0 - item, -1);
767 floor_item_describe(0 - item);
768 floor_item_optimize(0 - item);
775 /* Not identified yet */
779 lev = get_object_level(q_ptr);
781 /* Analyze the potion */
782 if (q_ptr->tval == TV_POTION)
787 /* °û¤ß¤´¤¿¤¨¤ò¥ª¥ê¥¸¥Ê¥ë¤è¤êºÙ¤«¤¯É½¸½ */
788 case SV_POTION_WATER:
789 msg_print("¸ý¤ÎÃ椬¤µ¤Ã¤Ñ¤ê¤·¤¿¡£");
790 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
794 case SV_POTION_APPLE_JUICE:
795 msg_print("´Å¤¯¤Æ¥µ¥Ã¥Ñ¥ê¤È¤·¤Æ¤¤¤Æ¡¢¤È¤Æ¤â¤ª¤¤¤·¤¤¡£");
796 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
800 case SV_POTION_SLIME_MOLD:
801 msg_print("¤Ê¤ó¤È¤âÉÔµ¤Ì£¤ÊÌ£¤À¡£");
802 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
807 case SV_POTION_WATER:
808 case SV_POTION_APPLE_JUICE:
809 case SV_POTION_SLIME_MOLD:
810 msg_print("You feel less thirsty.");
815 case SV_POTION_SLOWNESS:
816 if (set_slow(randint1(25) + 15, FALSE)) ident = TRUE;
819 case SV_POTION_SALT_WATER:
821 msg_print("¤¦¤§¡ª»×¤ï¤ºÅǤ¤¤Æ¤·¤Þ¤Ã¤¿¡£");
823 msg_print("The potion makes you vomit!");
826 if (!(prace_is_(RACE_GOLEM) ||
827 prace_is_(RACE_ZOMBIE) ||
828 prace_is_(RACE_DEMON) ||
829 prace_is_(RACE_ANDROID) ||
830 prace_is_(RACE_SPECTRE) ||
831 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING)))
833 /* Only living creatures get thirsty */
834 (void)set_food(PY_FOOD_STARVE - 1);
837 (void)set_poisoned(0);
838 (void)set_paralyzed(p_ptr->paralyzed + 4);
842 case SV_POTION_POISON:
843 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
845 if (set_poisoned(p_ptr->poisoned + randint0(15) + 10))
852 case SV_POTION_BLINDNESS:
853 if (!p_ptr->resist_blind)
855 if (set_blind(p_ptr->blind + randint0(100) + 100))
862 case SV_POTION_CONFUSION: /* Booze */
863 if (p_ptr->pclass != CLASS_MONK) chg_virtue(V_HARMONY, -1);
864 else if (!p_ptr->resist_conf) p_ptr->special_attack |= ATTACK_SUIKEN;
865 if (!p_ptr->resist_conf)
867 if (set_confused(randint0(20) + 15))
873 if (!p_ptr->resist_chaos)
877 if (set_image(p_ptr->image + randint0(150) + 150))
882 if (one_in_(13) && (p_ptr->pclass != CLASS_MONK))
885 if (one_in_(3)) lose_all_info();
887 teleport_player(100);
890 msg_print("ÃΤé¤Ê¤¤¾ì½ê¤ÇÌܤ¬Àä᤿¡£Æ¬Äˤ¬¤¹¤ë¡£");
891 msg_print("²¿¤â»×¤¤½Ð¤»¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ØÍ褿¤Î¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
893 msg_print("You wake up somewhere with a sore head...");
894 msg_print("You can't remember a thing, or how you got here!");
901 case SV_POTION_SLEEP:
902 if (!p_ptr->free_act)
905 msg_print("¤¢¤Ê¤¿¤Ï̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
907 msg_print("You fall asleep.");
911 if (ironman_nightmare)
914 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
916 msg_print("A horrible vision enters your mind.");
920 /* Pick a nightmare */
921 get_mon_num_prep(get_nightmare, NULL);
923 /* Have some nightmares */
924 have_nightmare(get_mon_num(MAX_DEPTH));
926 /* Remove the monster restriction */
927 get_mon_num_prep(NULL, NULL);
929 if (set_paralyzed(p_ptr->paralyzed + randint0(4) + 4))
936 case SV_POTION_LOSE_MEMORIES:
937 if (!p_ptr->hold_life && (p_ptr->exp > 0))
940 msg_print("²áµî¤Îµ²±¤¬Çö¤ì¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
942 msg_print("You feel your memories fade.");
944 chg_virtue(V_KNOWLEDGE, -5);
946 lose_exp(p_ptr->exp / 4);
951 case SV_POTION_RUINATION:
953 msg_print("¿È¤â¿´¤â¼å¤Ã¤Æ¤¤Æ¡¢Àºµ¤¤¬È´¤±¤Æ¤¤¤¯¤è¤¦¤À¡£");
954 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), "ÇËÌǤÎÌô", -1);
956 msg_print("Your nerves and muscles feel weak and lifeless!");
957 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), "a potion of Ruination", -1);
960 (void)dec_stat(A_DEX, 25, TRUE);
961 (void)dec_stat(A_WIS, 25, TRUE);
962 (void)dec_stat(A_CON, 25, TRUE);
963 (void)dec_stat(A_STR, 25, TRUE);
964 (void)dec_stat(A_CHR, 25, TRUE);
965 (void)dec_stat(A_INT, 25, TRUE);
969 case SV_POTION_DEC_STR:
970 if (do_dec_stat(A_STR)) ident = TRUE;
973 case SV_POTION_DEC_INT:
974 if (do_dec_stat(A_INT)) ident = TRUE;
977 case SV_POTION_DEC_WIS:
978 if (do_dec_stat(A_WIS)) ident = TRUE;
981 case SV_POTION_DEC_DEX:
982 if (do_dec_stat(A_DEX)) ident = TRUE;
985 case SV_POTION_DEC_CON:
986 if (do_dec_stat(A_CON)) ident = TRUE;
989 case SV_POTION_DEC_CHR:
990 if (do_dec_stat(A_CHR)) ident = TRUE;
993 case SV_POTION_DETONATIONS:
995 msg_print("ÂΤÎÃæ¤Ç·ã¤·¤¤Çúȯ¤¬µ¯¤¤¿¡ª");
996 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), "Çúȯ¤ÎÌô", -1);
998 msg_print("Massive explosions rupture your body!");
999 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), "a potion of Detonation", -1);
1002 (void)set_stun(p_ptr->stun + 75);
1003 (void)set_cut(p_ptr->cut + 5000);
1007 case SV_POTION_DEATH:
1008 chg_virtue(V_VITALITY, -1);
1009 chg_virtue(V_UNLIFE, 5);
1011 msg_print("»à¤Îͽ´¶¤¬ÂÎÃæ¤ò¶î¤±¤á¤°¤Ã¤¿¡£");
1012 take_hit(DAMAGE_LOSELIFE, 5000, "»à¤ÎÌô", -1);
1014 msg_print("A feeling of Death flows through your body.");
1015 take_hit(DAMAGE_LOSELIFE, 5000, "a potion of Death", -1);
1021 case SV_POTION_INFRAVISION:
1022 if (set_tim_infra(p_ptr->tim_infra + 100 + randint1(100), FALSE))
1028 case SV_POTION_DETECT_INVIS:
1029 if (set_tim_invis(p_ptr->tim_invis + 12 + randint1(12), FALSE))
1035 case SV_POTION_SLOW_POISON:
1036 if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
1039 case SV_POTION_CURE_POISON:
1040 if (set_poisoned(0)) ident = TRUE;
1043 case SV_POTION_BOLDNESS:
1044 if (set_afraid(0)) ident = TRUE;
1047 case SV_POTION_SPEED:
1050 if (set_fast(randint1(25) + 15, FALSE)) ident = TRUE;
1054 (void)set_fast(p_ptr->fast + 5, FALSE);
1058 case SV_POTION_RESIST_HEAT:
1059 if (set_oppose_fire(p_ptr->oppose_fire + randint1(10) + 10, FALSE))
1065 case SV_POTION_RESIST_COLD:
1066 if (set_oppose_cold(p_ptr->oppose_cold + randint1(10) + 10, FALSE))
1072 case SV_POTION_HEROISM:
1073 if (set_afraid(0)) ident = TRUE;
1074 if (set_hero(p_ptr->hero + randint1(25) + 25, FALSE)) ident = TRUE;
1075 if (hp_player(10)) ident = TRUE;
1078 case SV_POTION_BESERK_STRENGTH:
1079 if (set_afraid(0)) ident = TRUE;
1080 if (set_shero(p_ptr->shero + randint1(25) + 25, FALSE)) ident = TRUE;
1081 if (hp_player(30)) ident = TRUE;
1084 case SV_POTION_CURE_LIGHT:
1085 if (hp_player(damroll(2, 8))) ident = TRUE;
1086 if (set_blind(0)) ident = TRUE;
1087 if (set_cut(p_ptr->cut - 10)) ident = TRUE;
1088 if (set_shero(0,TRUE)) ident = TRUE;
1091 case SV_POTION_CURE_SERIOUS:
1092 if (hp_player(damroll(4, 8))) ident = TRUE;
1093 if (set_blind(0)) ident = TRUE;
1094 if (set_confused(0)) ident = TRUE;
1095 if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;
1096 if (set_shero(0,TRUE)) ident = TRUE;
1099 case SV_POTION_CURE_CRITICAL:
1100 if (hp_player(damroll(6, 8))) ident = TRUE;
1101 if (set_blind(0)) ident = TRUE;
1102 if (set_confused(0)) ident = TRUE;
1103 if (set_poisoned(0)) ident = TRUE;
1104 if (set_stun(0)) ident = TRUE;
1105 if (set_cut(0)) ident = TRUE;
1106 if (set_shero(0,TRUE)) ident = TRUE;
1109 case SV_POTION_HEALING:
1110 if (hp_player(300)) ident = TRUE;
1111 if (set_blind(0)) ident = TRUE;
1112 if (set_confused(0)) ident = TRUE;
1113 if (set_poisoned(0)) ident = TRUE;
1114 if (set_stun(0)) ident = TRUE;
1115 if (set_cut(0)) ident = TRUE;
1116 if (set_shero(0,TRUE)) ident = TRUE;
1119 case SV_POTION_STAR_HEALING:
1120 if (hp_player(1200)) ident = TRUE;
1121 if (set_blind(0)) ident = TRUE;
1122 if (set_confused(0)) ident = TRUE;
1123 if (set_poisoned(0)) ident = TRUE;
1124 if (set_stun(0)) ident = TRUE;
1125 if (set_cut(0)) ident = TRUE;
1126 if (set_shero(0,TRUE)) ident = TRUE;
1129 case SV_POTION_LIFE:
1130 chg_virtue(V_VITALITY, 1);
1131 chg_virtue(V_UNLIFE, -5);
1133 msg_print("ÂÎÃæ¤ËÀ¸Ì¿ÎϤ¬Ëþ¤Á¤¢¤Õ¤ì¤Æ¤¤¿¡ª");
1135 msg_print("You feel life flow through your body!");
1139 (void)set_poisoned(0);
1141 (void)set_confused(0);
1145 (void)do_res_stat(A_STR);
1146 (void)do_res_stat(A_CON);
1147 (void)do_res_stat(A_DEX);
1148 (void)do_res_stat(A_WIS);
1149 (void)do_res_stat(A_INT);
1150 (void)do_res_stat(A_CHR);
1151 (void)set_shero(0,TRUE);
1157 case SV_POTION_RESTORE_MANA:
1158 if (p_ptr->pclass == CLASS_MAGIC_EATER)
1161 for (i = 0; i < EATER_EXT*2; i++)
1163 p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i]*EATER_CHARGE/3;
1164 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;
1166 for (; i < EATER_EXT*3; i++)
1168 int k_idx = lookup_kind(TV_ROD, i-EATER_EXT*2);
1169 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;
1170 if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
1173 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
1175 msg_print("Your feel your head clear.");
1177 p_ptr->window |= (PW_PLAYER);
1180 else if (p_ptr->csp < p_ptr->msp)
1182 p_ptr->csp = p_ptr->msp;
1183 p_ptr->csp_frac = 0;
1185 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
1187 msg_print("Your feel your head clear.");
1190 p_ptr->redraw |= (PR_MANA);
1191 p_ptr->window |= (PW_PLAYER);
1192 p_ptr->window |= (PW_SPELL);
1195 if (set_shero(0,TRUE)) ident = TRUE;
1198 case SV_POTION_RESTORE_EXP:
1199 if (restore_level()) ident = TRUE;
1202 case SV_POTION_RES_STR:
1203 if (do_res_stat(A_STR)) ident = TRUE;
1206 case SV_POTION_RES_INT:
1207 if (do_res_stat(A_INT)) ident = TRUE;
1210 case SV_POTION_RES_WIS:
1211 if (do_res_stat(A_WIS)) ident = TRUE;
1214 case SV_POTION_RES_DEX:
1215 if (do_res_stat(A_DEX)) ident = TRUE;
1218 case SV_POTION_RES_CON:
1219 if (do_res_stat(A_CON)) ident = TRUE;
1222 case SV_POTION_RES_CHR:
1223 if (do_res_stat(A_CHR)) ident = TRUE;
1226 case SV_POTION_INC_STR:
1227 if (do_inc_stat(A_STR)) ident = TRUE;
1230 case SV_POTION_INC_INT:
1231 if (do_inc_stat(A_INT)) ident = TRUE;
1234 case SV_POTION_INC_WIS:
1235 if (do_inc_stat(A_WIS)) ident = TRUE;
1238 case SV_POTION_INC_DEX:
1239 if (do_inc_stat(A_DEX)) ident = TRUE;
1242 case SV_POTION_INC_CON:
1243 if (do_inc_stat(A_CON)) ident = TRUE;
1246 case SV_POTION_INC_CHR:
1247 if (do_inc_stat(A_CHR)) ident = TRUE;
1250 case SV_POTION_AUGMENTATION:
1251 if (do_inc_stat(A_STR)) ident = TRUE;
1252 if (do_inc_stat(A_INT)) ident = TRUE;
1253 if (do_inc_stat(A_WIS)) ident = TRUE;
1254 if (do_inc_stat(A_DEX)) ident = TRUE;
1255 if (do_inc_stat(A_CON)) ident = TRUE;
1256 if (do_inc_stat(A_CHR)) ident = TRUE;
1259 case SV_POTION_ENLIGHTENMENT:
1261 msg_print("¼«Ê¬¤ÎÃÖ¤«¤ì¤Æ¤¤¤ë¾õ¶·¤¬Ç¾Î¢¤ËÉ⤫¤ó¤Ç¤¤¿...");
1263 msg_print("An image of your surroundings forms in your mind...");
1266 chg_virtue(V_KNOWLEDGE, 1);
1267 chg_virtue(V_ENLIGHTEN, 1);
1272 case SV_POTION_STAR_ENLIGHTENMENT:
1274 msg_print("¹¹¤Ê¤ë·¼Ìؤò´¶¤¸¤¿...");
1276 msg_print("You begin to feel more enlightened...");
1279 chg_virtue(V_KNOWLEDGE, 1);
1280 chg_virtue(V_ENLIGHTEN, 2);
1283 (void)do_inc_stat(A_INT);
1284 (void)do_inc_stat(A_WIS);
1285 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1286 (void)detect_doors(DETECT_RAD_DEFAULT);
1287 (void)detect_stairs(DETECT_RAD_DEFAULT);
1288 (void)detect_treasure(DETECT_RAD_DEFAULT);
1289 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
1290 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
1296 case SV_POTION_SELF_KNOWLEDGE:
1298 msg_print("¼«Ê¬¼«¿È¤Î¤³¤È¤¬¾¯¤·¤Ïʬ¤«¤Ã¤¿µ¤¤¬¤¹¤ë...");
1300 msg_print("You begin to know yourself a little better...");
1308 case SV_POTION_EXPERIENCE:
1309 if (p_ptr->prace == RACE_ANDROID) break;
1310 chg_virtue(V_ENLIGHTEN, 1);
1311 if (p_ptr->exp < PY_MAX_EXP)
1313 s32b ee = (p_ptr->exp / 2) + 10;
1314 if (ee > 100000L) ee = 100000L;
1316 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1318 msg_print("You feel more experienced.");
1326 case SV_POTION_RESISTANCE:
1327 (void)set_oppose_acid(p_ptr->oppose_acid + randint1(20) + 20, FALSE);
1328 (void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
1329 (void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
1330 (void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
1331 (void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
1335 case SV_POTION_CURING:
1336 if (hp_player(50)) ident = TRUE;
1337 if (set_blind(0)) ident = TRUE;
1338 if (set_poisoned(0)) ident = TRUE;
1339 if (set_confused(0)) ident = TRUE;
1340 if (set_stun(0)) ident = TRUE;
1341 if (set_cut(0)) ident = TRUE;
1342 if (set_image(0)) ident = TRUE;
1345 case SV_POTION_INVULNERABILITY:
1346 (void)set_invuln(p_ptr->invuln + randint1(4) + 4, FALSE);
1350 case SV_POTION_NEW_LIFE:
1351 do_cmd_rerate(FALSE);
1353 p_ptr->update |= PU_BONUS;
1354 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
1356 chg_virtue(V_CHANCE, -5);
1358 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
1360 msg_print("You are cured of all mutations.");
1363 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
1364 p_ptr->update |= PU_BONUS;
1366 mutant_regenerate_mod = calc_mutant_regenerate_mod();
1371 case SV_POTION_NEO_TSUYOSHI:
1373 (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
1377 case SV_POTION_TSUYOSHI:
1379 msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
1381 msg_print("Brother OKURE!");
1384 p_ptr->tsuyoshi = 1;
1385 (void)set_tsuyoshi(0, TRUE);
1386 if (!p_ptr->resist_chaos)
1388 (void)set_image(50 + randint1(50));
1393 case SV_POTION_POLYMORPH:
1394 if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23))
1396 chg_virtue(V_CHANCE, -5);
1398 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
1400 msg_print("You are cured of all mutations.");
1403 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
1404 p_ptr->update |= PU_BONUS;
1413 if(gain_random_mutation(0)) ident = TRUE;
1415 else if (lose_mutation(0)) ident = TRUE;
1416 } while(!ident || one_in_(2));
1422 if (prace_is_(RACE_SKELETON))
1425 msg_print("±ÕÂΤΰìÉô¤Ï¤¢¤Ê¤¿¤Î¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¤¿¡ª");
1427 msg_print("Some of the fluid falls through your jaws!");
1430 (void)potion_smash_effect(0, py, px, q_ptr->k_idx);
1433 /* Combine / Reorder the pack (later) */
1434 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1436 if (!(object_aware_p(o_ptr)))
1438 chg_virtue(V_PATIENCE, -1);
1439 chg_virtue(V_CHANCE, 1);
1440 chg_virtue(V_KNOWLEDGE, -1);
1443 /* The item has been tried */
1444 object_tried(q_ptr);
1446 /* An identification was made */
1447 if (ident && !object_aware_p(q_ptr))
1449 object_aware(q_ptr);
1450 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
1454 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
1456 /* Potions can feed the player */
1457 switch (p_ptr->mimic_form)
1460 switch (p_ptr->prace)
1463 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
1472 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1475 if (o_ptr->tval == TV_FLASK)
1478 msg_print("¥ª¥¤¥ë¤òÊäµë¤·¤¿¡£");
1480 msg_print("You replenish yourself with the oil.");
1482 set_food(p_ptr->food + 5000);
1486 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1491 msg_print("¿åʬ¤ò¼è¤ê¹þ¤ó¤À¡£");
1493 msg_print("You are moistened.");
1495 set_food(MIN(p_ptr->food + o_ptr->pval + MAX(0, o_ptr->pval * 10) + 2000, PY_FOOD_MAX - 1));
1498 (void)set_food(p_ptr->food + o_ptr->pval);
1503 case MIMIC_DEMON_LORD:
1504 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1507 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
1510 (void)set_food(p_ptr->food + o_ptr->pval);
1517 * Hook to determine if an object can be quaffed
1519 static bool item_tester_hook_quaff(object_type *o_ptr)
1521 if (o_ptr->tval == TV_POTION) return TRUE;
1523 if (prace_is_(RACE_ANDROID))
1525 if (o_ptr->tval == TV_FLASK && o_ptr->sval == SV_FLASK_OIL)
1534 * Quaff some potion (from the pack or floor)
1536 void do_cmd_quaff_potion(void)
1541 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
1543 set_action(ACTION_NONE);
1546 /* Restrict choices to potions */
1547 item_tester_hook = item_tester_hook_quaff;
1551 q = "¤É¤ÎÌô¤ò°û¤ß¤Þ¤¹¤«? ";
1552 s = "°û¤á¤ëÌô¤¬¤Ê¤¤¡£";
1554 q = "Quaff which potion? ";
1555 s = "You have no potions to quaff.";
1558 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1560 /* Quaff the potion */
1561 do_cmd_quaff_potion_aux(item);
1566 * Read a scroll (from the pack or floor).
1568 * Certain scrolls can be "aborted" without losing the scroll. These
1569 * include scrolls with no effects but recharge or identify, which are
1570 * cancelled before use. XXX Reading them still takes a turn, though.
1572 static void do_cmd_read_scroll_aux(int item, bool known)
1574 int k, used_up, ident, lev;
1579 /* Get the item (in the pack) */
1582 o_ptr = &inventory[item];
1585 /* Get the item (on the floor) */
1588 o_ptr = &o_list[0 - item];
1597 if (flush_failure) flush();
1599 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
1601 msg_print("Nothing happen.");
1608 if (p_ptr->pclass == CLASS_BERSERKER)
1611 msg_print("´¬Êª¤Ê¤ó¤ÆÆɤá¤Ê¤¤¡£");
1613 msg_print("You cannot read.");
1618 if((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0])
1623 /* Not identified yet */
1627 lev = get_object_level(o_ptr);
1629 /* Assume the scroll will get used up */
1632 if (o_ptr->tval == TV_SCROLL)
1634 /* Analyze the scroll */
1635 switch (o_ptr->sval)
1637 case SV_SCROLL_DARKNESS:
1639 if (!(p_ptr->resist_blind) && !(p_ptr->resist_dark))
1641 (void)set_blind(p_ptr->blind + 3 + randint1(5));
1643 if (unlite_area(10, 3)) ident = TRUE;
1647 case SV_SCROLL_AGGRAVATE_MONSTER:
1650 msg_print("¥«¥ó¹â¤¯¤¦¤Ê¤ëÍͤʲ»¤¬ÊÕ¤ê¤òʤ¤Ã¤¿¡£");
1652 msg_print("There is a high pitched humming noise.");
1655 aggravate_monsters(0);
1660 case SV_SCROLL_CURSE_ARMOR:
1662 if (curse_armor()) ident = TRUE;
1666 case SV_SCROLL_CURSE_WEAPON:
1668 if (curse_weapon(FALSE, INVEN_RARM)) ident = TRUE;
1672 case SV_SCROLL_SUMMON_MONSTER:
1674 for (k = 0; k < randint1(3); k++)
1676 if (summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
1684 case SV_SCROLL_SUMMON_UNDEAD:
1686 for (k = 0; k < randint1(3); k++)
1688 if (summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
1696 case SV_SCROLL_SUMMON_PET:
1698 if (summon_specific(-1, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_FORCE_PET)))
1705 case SV_SCROLL_SUMMON_KIN:
1707 if (summon_kin_player(p_ptr->lev, py, px, (PM_FORCE_PET | PM_ALLOW_GROUP)))
1714 case SV_SCROLL_TRAP_CREATION:
1716 if (trap_creation(py, px)) ident = TRUE;
1720 case SV_SCROLL_PHASE_DOOR:
1722 teleport_player(10);
1727 case SV_SCROLL_TELEPORT:
1729 teleport_player(100);
1734 case SV_SCROLL_TELEPORT_LEVEL:
1736 (void)teleport_level(0);
1741 case SV_SCROLL_WORD_OF_RECALL:
1743 if (!word_of_recall()) used_up = FALSE;
1748 case SV_SCROLL_IDENTIFY:
1750 if (!ident_spell(FALSE)) used_up = FALSE;
1755 case SV_SCROLL_STAR_IDENTIFY:
1757 if (!identify_fully(FALSE)) used_up = FALSE;
1762 case SV_SCROLL_REMOVE_CURSE:
1767 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1769 msg_print("You feel as if someone is watching over you.");
1777 case SV_SCROLL_STAR_REMOVE_CURSE:
1779 if (remove_all_curse())
1782 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1784 msg_print("You feel as if someone is watching over you.");
1791 case SV_SCROLL_ENCHANT_ARMOR:
1794 if (!enchant_spell(0, 0, 1)) used_up = FALSE;
1798 case SV_SCROLL_ENCHANT_WEAPON_TO_HIT:
1800 if (!enchant_spell(1, 0, 0)) used_up = FALSE;
1805 case SV_SCROLL_ENCHANT_WEAPON_TO_DAM:
1807 if (!enchant_spell(0, 1, 0)) used_up = FALSE;
1812 case SV_SCROLL_STAR_ENCHANT_ARMOR:
1814 if (!enchant_spell(0, 0, randint1(3) + 2)) used_up = FALSE;
1819 case SV_SCROLL_STAR_ENCHANT_WEAPON:
1821 if (!enchant_spell(randint1(3), randint1(3), 0)) used_up = FALSE;
1826 case SV_SCROLL_RECHARGING:
1828 if (!recharge(130)) used_up = FALSE;
1833 case SV_SCROLL_MUNDANITY:
1836 if (!mundane_spell(FALSE)) used_up = FALSE;
1840 case SV_SCROLL_LIGHT:
1842 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
1846 case SV_SCROLL_MAPPING:
1848 map_area(DETECT_RAD_MAP);
1853 case SV_SCROLL_DETECT_GOLD:
1855 if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
1856 if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
1860 case SV_SCROLL_DETECT_ITEM:
1862 if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
1866 case SV_SCROLL_DETECT_TRAP:
1868 if (detect_traps(DETECT_RAD_DEFAULT, known)) ident = TRUE;
1872 case SV_SCROLL_DETECT_DOOR:
1874 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
1875 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
1879 case SV_SCROLL_DETECT_INVIS:
1881 if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
1885 case SV_SCROLL_SATISFY_HUNGER:
1887 if (set_food(PY_FOOD_MAX - 1)) ident = TRUE;
1891 case SV_SCROLL_BLESSING:
1893 if (set_blessed(p_ptr->blessed + randint1(12) + 6, FALSE)) ident = TRUE;
1897 case SV_SCROLL_HOLY_CHANT:
1899 if (set_blessed(p_ptr->blessed + randint1(24) + 12, FALSE)) ident = TRUE;
1903 case SV_SCROLL_HOLY_PRAYER:
1905 if (set_blessed(p_ptr->blessed + randint1(48) + 24, FALSE)) ident = TRUE;
1909 case SV_SCROLL_MONSTER_CONFUSION:
1911 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1914 msg_print("¼ê¤¬µ±¤»Ï¤á¤¿¡£");
1916 msg_print("Your hands begin to glow.");
1919 p_ptr->special_attack |= ATTACK_CONFUSE;
1920 p_ptr->redraw |= (PR_STATUS);
1926 case SV_SCROLL_PROTECTION_FROM_EVIL:
1929 if (set_protevil(p_ptr->protevil + randint1(25) + k, FALSE)) ident = TRUE;
1933 case SV_SCROLL_RUNE_OF_PROTECTION:
1940 case SV_SCROLL_TRAP_DOOR_DESTRUCTION:
1942 if (destroy_doors_touch()) ident = TRUE;
1946 case SV_SCROLL_STAR_DESTRUCTION:
1948 if (destroy_area(py, px, 13 + randint0(5), FALSE))
1952 msg_print("¥À¥ó¥¸¥ç¥ó¤¬Íɤ줿...");
1954 msg_print("The dungeon trembles...");
1961 case SV_SCROLL_DISPEL_UNDEAD:
1963 if (dispel_undead(80)) ident = TRUE;
1967 case SV_SCROLL_SPELL:
1969 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;
1970 p_ptr->add_spells++;
1971 p_ptr->update |= (PU_SPELLS);
1976 case SV_SCROLL_GENOCIDE:
1978 (void)symbol_genocide(300, TRUE);
1983 case SV_SCROLL_MASS_GENOCIDE:
1985 (void)mass_genocide(300, TRUE);
1990 case SV_SCROLL_ACQUIREMENT:
1992 acquirement(py, px, 1, TRUE, FALSE);
1997 case SV_SCROLL_STAR_ACQUIREMENT:
1999 acquirement(py, px, randint1(2) + 1, TRUE, FALSE);
2004 /* New Hengband scrolls */
2005 case SV_SCROLL_FIRE:
2007 fire_ball(GF_FIRE, 0, 666, 4);
2008 /* Note: "Double" damage since it is centered on the player ... */
2009 if (!(IS_OPPOSE_FIRE() || p_ptr->resist_fire || p_ptr->immune_fire))
2011 take_hit(DAMAGE_NOESCAPE, 50+randint1(50), "±ê¤Î´¬Êª", -1);
2013 take_hit(DAMAGE_NOESCAPE, 50 + randint1(50), "a Scroll of Fire", -1);
2023 fire_ball(GF_ICE, 0, 777, 4);
2024 if (!(IS_OPPOSE_COLD() || p_ptr->resist_cold || p_ptr->immune_cold))
2026 take_hit(DAMAGE_NOESCAPE, 100+randint1(100), "ɹ¤Î´¬Êª", -1);
2028 take_hit(DAMAGE_NOESCAPE, 100 + randint1(100), "a Scroll of Ice", -1);
2035 case SV_SCROLL_CHAOS:
2037 fire_ball(GF_CHAOS, 0, 1000, 4);
2038 if (!p_ptr->resist_chaos)
2040 take_hit(DAMAGE_NOESCAPE, 111+randint1(111), "¥í¥°¥ë¥¹¤Î´¬Êª", -1);
2042 take_hit(DAMAGE_NOESCAPE, 111 + randint1(111), "a Scroll of Logrus", -1);
2049 case SV_SCROLL_RUMOR:
2053 switch (randint1(20))
2057 err = get_rnd_line("chainswd_j.txt", 0, Rumor);
2059 err = get_rnd_line("chainswd.txt", 0, Rumor);
2065 err = get_rnd_line("error_j.txt", 0, Rumor);
2067 err = get_rnd_line("error.txt", 0, Rumor);
2075 err = get_rnd_line("death_j.txt", 0, Rumor);
2077 err = get_rnd_line("death.txt", 0, Rumor);
2083 err = get_rnd_line_jonly("rumors_j.txt", 0, Rumor, 10);
2085 err = get_rnd_line("rumors.txt", 0, Rumor);
2091 /* An error occured */
2093 if (err) strcpy(Rumor, "±³¤Î±½¤â¤¢¤ë¡£");
2095 if (err) strcpy(Rumor, "Some rumors are wrong.");
2100 msg_print("´¬Êª¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤¬½ñ¤«¤ì¤Æ¤¤¤ë:");
2102 msg_print("There is message on the scroll. It says:");
2106 msg_format("%s", Rumor);
2109 msg_print("´¬Êª¤Ï±ì¤òΩ¤Æ¤Æ¾Ã¤¨µî¤Ã¤¿¡ª");
2111 msg_print("The scroll disappears in a puff of smoke!");
2118 case SV_SCROLL_ARTIFACT:
2121 if (!artifact_scroll()) used_up = FALSE;
2125 case SV_SCROLL_RESET_RECALL:
2128 if (!reset_recall()) used_up = FALSE;
2133 else if (o_ptr->name1 == ART_GHB)
2136 msg_print("»ä¤Ï¶ìÏ«¤·¤Æ¡Ø¥°¥ì¡¼¥¿¡¼¡¦¥Ø¥ë=¥Ó¡¼¥¹¥È¡Ù¤òÅݤ·¤¿¡£");
2137 msg_print("¤·¤«¤·¼ê¤ËÆþ¤Ã¤¿¤Î¤Ï¤³¤Î¤¤¿¤Ê¤¤£Ô¥·¥ã¥Ä¤À¤±¤À¤Ã¤¿¡£");
2139 msg_print("I had a very hard time to kill the Greater hell-beast, ");
2140 msg_print("but all I got was this lousy t-shirt!");
2144 else if (o_ptr->name1 == ART_POWER)
2147 msg_print("¡Ö°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤òÅý¤Ù¡¢");
2149 msg_print("°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤ò¸«¤Ä¤±¡¢");
2151 msg_print("°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤òÊá¤é¤¨¤Æ");
2153 msg_print("°Å°Ç¤ÎÃæ¤Ë·Ò¤®¤È¤á¤ë¡£¡×");
2155 msg_print("'One Ring to rule them all, ");
2157 msg_print("One Ring to find them, ");
2159 msg_print("One Ring to bring them all ");
2161 msg_print("and in the darkness bind them.'");
2165 else if (o_ptr->tval==TV_PARCHEMENT)
2168 char o_name[MAX_NLEN];
2174 q=format("book-%d_jp.txt",o_ptr->sval);
2176 /* Display object description */
2177 object_desc(o_name, o_ptr, TRUE, 0);
2179 /* Build the filename */
2180 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, q);
2182 /* Peruse the help file */
2183 (void)show_file(TRUE, buf, o_name, 0, 0);
2192 /* Combine / Reorder the pack (later) */
2193 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2195 if (!(object_aware_p(o_ptr)))
2197 chg_virtue(V_PATIENCE, -1);
2198 chg_virtue(V_CHANCE, 1);
2199 chg_virtue(V_KNOWLEDGE, -1);
2202 /* The item was tried */
2203 object_tried(o_ptr);
2205 /* An identification was made */
2206 if (ident && !object_aware_p(o_ptr))
2208 object_aware(o_ptr);
2209 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
2213 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
2216 /* Hack -- allow certain scrolls to be "preserved" */
2222 sound(SOUND_SCROLL);
2224 /* Destroy a scroll in the pack */
2227 inven_item_increase(item, -1);
2228 inven_item_describe(item);
2229 inven_item_optimize(item);
2232 /* Destroy a scroll on the floor */
2235 floor_item_increase(0 - item, -1);
2236 floor_item_describe(0 - item);
2237 floor_item_optimize(0 - item);
2243 * Hook to determine if an object is readable
2245 static bool item_tester_hook_readable(object_type *o_ptr)
2247 if ((o_ptr->tval==TV_SCROLL) || (o_ptr->tval==TV_PARCHEMENT) || (o_ptr->name1 == ART_GHB) || (o_ptr->name1 == ART_POWER)) return (TRUE);
2254 void do_cmd_read_scroll(void)
2260 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
2262 set_action(ACTION_NONE);
2265 /* Check some conditions */
2269 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡£");
2271 msg_print("You can't see anything.");
2279 msg_print("ÌÀ¤«¤ê¤¬¤Ê¤¤¤Î¤Ç¡¢°Å¤¯¤ÆÆɤá¤Ê¤¤¡£");
2281 msg_print("You have no light to read by.");
2286 if (p_ptr->confused)
2289 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡£");
2291 msg_print("You are too confused!");
2298 /* Restrict choices to scrolls */
2299 item_tester_hook = item_tester_hook_readable;
2303 q = "¤É¤Î´¬Êª¤òÆɤߤޤ¹¤«? ";
2304 s = "Æɤá¤ë´¬Êª¤¬¤Ê¤¤¡£";
2306 q = "Read which scroll? ";
2307 s = "You have no scrolls to read.";
2310 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
2312 /* Get the item (in the pack) */
2315 o_ptr = &inventory[item];
2318 /* Get the item (on the floor) */
2321 o_ptr = &o_list[0 - item];
2324 /* Read the scroll */
2325 do_cmd_read_scroll_aux(item, object_aware_p(o_ptr));
2329 static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
2334 /* Analyze the staff */
2337 case SV_STAFF_DARKNESS:
2339 if (!(p_ptr->resist_blind) && !(p_ptr->resist_dark))
2341 if (set_blind(p_ptr->blind + 3 + randint1(5))) ident = TRUE;
2343 if (unlite_area(10, 3)) ident = TRUE;
2347 case SV_STAFF_SLOWNESS:
2349 if (set_slow(p_ptr->slow + randint1(30) + 15, FALSE)) ident = TRUE;
2353 case SV_STAFF_HASTE_MONSTERS:
2355 if (speed_monsters()) ident = TRUE;
2359 case SV_STAFF_SUMMONING:
2361 for (k = 0; k < randint1(4); k++)
2363 if (summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
2371 case SV_STAFF_TELEPORTATION:
2373 teleport_player(100);
2378 case SV_STAFF_IDENTIFY:
2380 if (!ident_spell(FALSE)) *use_charge = FALSE;
2385 case SV_STAFF_REMOVE_CURSE:
2392 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2394 msg_print("You feel as if someone is watching over you.");
2397 else if (!p_ptr->blind)
2400 msg_print("¾ó¤Ï°ì½Ö¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
2402 msg_print("The staff glows blue for a moment...");
2411 case SV_STAFF_STARLITE:
2413 int num = damroll(5, 3);
2417 if (!p_ptr->blind && !magic)
2420 msg_print("¾ó¤ÎÀ褬ÌÀ¤ë¤¯µ±¤¤¤¿...");
2422 msg_print("The end of the staff glows brightly...");
2426 for (k = 0; k < num; k++)
2432 scatter(&y, &x, py, px, 4, 0);
2434 if (!cave_floor_bold(y, x)) continue;
2436 if (!player_bold(y, x)) break;
2439 project(0, 0, y, x, damroll(6 + p_ptr->lev / 8, 10), GF_LITE_WEAK,
2440 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL), -1);
2448 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
2452 case SV_STAFF_MAPPING:
2454 map_area(DETECT_RAD_MAP);
2459 case SV_STAFF_DETECT_GOLD:
2461 if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
2462 if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
2466 case SV_STAFF_DETECT_ITEM:
2468 if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
2472 case SV_STAFF_DETECT_TRAP:
2474 if (detect_traps(DETECT_RAD_DEFAULT, known)) ident = TRUE;
2478 case SV_STAFF_DETECT_DOOR:
2480 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
2481 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
2485 case SV_STAFF_DETECT_INVIS:
2487 if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
2491 case SV_STAFF_DETECT_EVIL:
2493 if (detect_monsters_evil(DETECT_RAD_DEFAULT)) ident = TRUE;
2497 case SV_STAFF_CURE_LIGHT:
2499 if (hp_player(damroll(2, 8))) ident = TRUE;
2500 if (set_shero(0,TRUE)) ident = TRUE;
2504 case SV_STAFF_CURING:
2506 if (set_blind(0)) ident = TRUE;
2507 if (set_poisoned(0)) ident = TRUE;
2508 if (set_confused(0)) ident = TRUE;
2509 if (set_stun(0)) ident = TRUE;
2510 if (set_cut(0)) ident = TRUE;
2511 if (set_image(0)) ident = TRUE;
2512 if (set_shero(0,TRUE)) ident = TRUE;
2516 case SV_STAFF_HEALING:
2518 if (hp_player(300)) ident = TRUE;
2519 if (set_stun(0)) ident = TRUE;
2520 if (set_cut(0)) ident = TRUE;
2521 if (set_shero(0,TRUE)) ident = TRUE;
2525 case SV_STAFF_THE_MAGI:
2527 if (do_res_stat(A_INT)) ident = TRUE;
2528 if (p_ptr->csp < p_ptr->msp)
2530 p_ptr->csp = p_ptr->msp;
2531 p_ptr->csp_frac = 0;
2534 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
2536 msg_print("Your feel your head clear.");
2539 p_ptr->redraw |= (PR_MANA);
2540 p_ptr->window |= (PW_PLAYER);
2541 p_ptr->window |= (PW_SPELL);
2543 if (set_shero(0,TRUE)) ident = TRUE;
2547 case SV_STAFF_SLEEP_MONSTERS:
2549 if (sleep_monsters()) ident = TRUE;
2553 case SV_STAFF_SLOW_MONSTERS:
2555 if (slow_monsters()) ident = TRUE;
2559 case SV_STAFF_SPEED:
2561 if (set_fast(randint1(30) + 15, FALSE)) ident = TRUE;
2565 case SV_STAFF_PROBING:
2572 case SV_STAFF_DISPEL_EVIL:
2574 if (dispel_evil(80)) ident = TRUE;
2578 case SV_STAFF_POWER:
2580 if (dispel_monsters(150)) ident = TRUE;
2584 case SV_STAFF_HOLINESS:
2586 if (dispel_evil(150)) ident = TRUE;
2588 if (set_protevil((magic ? 0 : p_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
2589 if (set_poisoned(0)) ident = TRUE;
2590 if (set_afraid(0)) ident = TRUE;
2591 if (hp_player(50)) ident = TRUE;
2592 if (set_stun(0)) ident = TRUE;
2593 if (set_cut(0)) ident = TRUE;
2597 case SV_STAFF_GENOCIDE:
2599 (void)symbol_genocide((magic ? p_ptr->lev + 50 : 200), TRUE);
2604 case SV_STAFF_EARTHQUAKES:
2606 if (earthquake(py, px, 10))
2610 msg_print("¥À¥ó¥¸¥ç¥ó¤¬Íɤ줿¡£");
2612 msg_print("The dungeon trembles.");
2619 case SV_STAFF_DESTRUCTION:
2621 if (destroy_area(py, px, 13 + randint0(5), FALSE))
2627 case SV_STAFF_ANIMATE_DEAD:
2629 if (animate_dead(0, py, px))
2635 case SV_STAFF_MSTORM:
2638 msg_print("¶¯ÎϤÊËâÎϤ¬Å¨¤ò°ú¤Îö¤¤¤¿¡ª");
2640 msg_print("Mighty magics rend your enemies!");
2642 project(0, 5, py, px,
2643 (randint1(200) + 300) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
2644 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))
2647 (void)take_hit(DAMAGE_NOESCAPE, 50, "¥³¥ó¥È¥í¡¼¥ë¤·Æñ¤¤¶¯ÎϤÊËâÎϤβòÊü", -1);
2649 (void)take_hit(DAMAGE_NOESCAPE, 50, "unleashing magics too mighty to control", -1);
2657 case SV_STAFF_NOTHING:
2660 msg_print("²¿¤âµ¯¤é¤Ê¤«¤Ã¤¿¡£");
2662 msg_print("Nothing happen.");
2664 if (prace_is_(RACE_SKELETON) || prace_is_(RACE_GOLEM) ||
2665 prace_is_(RACE_ZOMBIE) || prace_is_(RACE_SPECTRE))
2667 msg_print("¤â¤Ã¤¿¤¤¤Ê¤¤»ö¤ò¤·¤¿¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£¿©¤Ùʪ¤ÏÂçÀڤˤ·¤Ê¤¯¤Æ¤Ï¡£");
2669 msg_print("What a waste. It's your food!");
2678 * Use a staff. -RAK-
2680 * One charge of one staff disappears.
2682 * Hack -- staffs of identify can be "cancelled".
2684 static void do_cmd_use_staff_aux(int item)
2686 int ident, chance, lev;
2690 /* Hack -- let staffs of identify get aborted */
2691 bool use_charge = TRUE;
2694 /* Get the item (in the pack) */
2697 o_ptr = &inventory[item];
2700 /* Get the item (on the floor) */
2703 o_ptr = &o_list[0 - item];
2707 /* Mega-Hack -- refuse to use a pile from the ground */
2708 if ((item < 0) && (o_ptr->number > 1))
2711 msg_print("¤Þ¤º¤Ï¾ó¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
2713 msg_print("You must first pick up the staffs.");
2723 /* Extract the item level */
2724 lev = get_object_level(o_ptr);
2725 if (lev > 50) lev = 50 + (lev - 50)/2;
2727 /* Base chance of success */
2728 chance = p_ptr->skill_dev;
2730 /* Confusion hurts skill */
2731 if (p_ptr->confused) chance = chance / 2;
2733 /* Hight level objects are harder */
2734 chance = chance - lev;
2736 /* Give everyone a (slight) chance */
2737 if ((chance < USE_DEVICE) && one_in_(USE_DEVICE - chance + 1))
2739 chance = USE_DEVICE;
2744 if (flush_failure) flush();
2746 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
2748 msg_print("Nothing happen. Maybe this staff is freezing too.");
2755 /* Roll for usage */
2756 if ((chance < USE_DEVICE) || (randint1(chance) < USE_DEVICE) || (p_ptr->pclass == CLASS_BERSERKER))
2758 if (flush_failure) flush();
2760 msg_print("¾ó¤ò¤¦¤Þ¤¯»È¤¨¤Ê¤«¤Ã¤¿¡£");
2762 msg_print("You failed to use the staff properly.");
2769 /* Notice empty staffs */
2770 if (o_ptr->pval <= 0)
2772 if (flush_failure) flush();
2774 msg_print("¤³¤Î¾ó¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£");
2776 msg_print("The staff has no charges left.");
2779 o_ptr->ident |= (IDENT_EMPTY);
2781 /* Combine / Reorder the pack (later) */
2782 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2783 p_ptr->window |= (PW_INVEN);
2792 ident = staff_effect(o_ptr->sval, &use_charge, FALSE, object_aware_p(o_ptr));
2794 if (!(object_aware_p(o_ptr)))
2796 chg_virtue(V_PATIENCE, -1);
2797 chg_virtue(V_CHANCE, 1);
2798 chg_virtue(V_KNOWLEDGE, -1);
2801 /* Combine / Reorder the pack (later) */
2802 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2804 /* Tried the item */
2805 object_tried(o_ptr);
2807 /* An identification was made */
2808 if (ident && !object_aware_p(o_ptr))
2810 object_aware(o_ptr);
2811 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
2815 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
2818 /* Hack -- some uses are "free" */
2819 if (!use_charge) return;
2822 /* Use a single charge */
2825 /* XXX Hack -- unstack if necessary */
2826 if ((item >= 0) && (o_ptr->number > 1))
2831 /* Get local object */
2834 /* Obtain a local object */
2835 object_copy(q_ptr, o_ptr);
2837 /* Modify quantity */
2840 /* Restore the charges */
2843 /* Unstack the used item */
2845 p_ptr->total_weight -= q_ptr->weight;
2846 item = inven_carry(q_ptr);
2850 msg_print("¾ó¤ò¤Þ¤È¤á¤Ê¤ª¤·¤¿¡£");
2852 msg_print("You unstack your staff.");
2857 /* Describe charges in the pack */
2860 inven_item_charges(item);
2863 /* Describe charges on the floor */
2866 floor_item_charges(0 - item);
2871 void do_cmd_use_staff(void)
2876 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
2878 set_action(ACTION_NONE);
2881 /* Restrict choices to wands */
2882 item_tester_tval = TV_STAFF;
2886 q = "¤É¤Î¾ó¤ò»È¤¤¤Þ¤¹¤«? ";
2887 s = "»È¤¨¤ë¾ó¤¬¤Ê¤¤¡£";
2889 q = "Use which staff? ";
2890 s = "You have no staff to use.";
2893 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
2895 do_cmd_use_staff_aux(item);
2899 static int wand_effect(int sval, int dir, bool magic)
2903 /* XXX Hack -- Wand of wonder can do anything before it */
2904 if (sval == SV_WAND_WONDER)
2906 int vir = virtue_number(V_CHANCE);
2907 sval = randint0(SV_WAND_WONDER);
2911 if (p_ptr->virtues[vir - 1] > 0)
2913 while (randint1(300) < p_ptr->virtues[vir - 1]) sval++;
2914 if (sval > SV_WAND_COLD_BALL) sval = randint0(4) + SV_WAND_ACID_BALL;
2918 while (randint1(300) < (0-p_ptr->virtues[vir - 1])) sval--;
2919 if (sval < SV_WAND_HEAL_MONSTER) sval = randint0(3) + SV_WAND_HEAL_MONSTER;
2922 if (sval < SV_WAND_TELEPORT_AWAY)
2923 chg_virtue(V_CHANCE, 1);
2926 /* Analyze the wand */
2929 case SV_WAND_HEAL_MONSTER:
2931 if (heal_monster(dir, damroll(10, 10))) ident = TRUE;
2935 case SV_WAND_HASTE_MONSTER:
2937 if (speed_monster(dir)) ident = TRUE;
2941 case SV_WAND_CLONE_MONSTER:
2943 if (clone_monster(dir)) ident = TRUE;
2947 case SV_WAND_TELEPORT_AWAY:
2949 if (teleport_monster(dir)) ident = TRUE;
2953 case SV_WAND_DISARMING:
2955 if (disarm_trap(dir)) ident = TRUE;
2959 case SV_WAND_TRAP_DOOR_DEST:
2961 if (destroy_door(dir)) ident = TRUE;
2965 case SV_WAND_STONE_TO_MUD:
2967 if (wall_to_mud(dir)) ident = TRUE;
2974 msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
2976 msg_print("A line of blue shimmering light appears.");
2979 (void)lite_line(dir);
2984 case SV_WAND_SLEEP_MONSTER:
2986 if (sleep_monster(dir)) ident = TRUE;
2990 case SV_WAND_SLOW_MONSTER:
2992 if (slow_monster(dir)) ident = TRUE;
2996 case SV_WAND_CONFUSE_MONSTER:
2998 if (confuse_monster(dir, p_ptr->lev)) ident = TRUE;
3002 case SV_WAND_FEAR_MONSTER:
3004 if (fear_monster(dir, p_ptr->lev)) ident = TRUE;
3008 case SV_WAND_DRAIN_LIFE:
3010 if (drain_life(dir, 80 + p_ptr->lev)) ident = TRUE;
3014 case SV_WAND_POLYMORPH:
3016 if (poly_monster(dir)) ident = TRUE;
3020 case SV_WAND_STINKING_CLOUD:
3022 fire_ball(GF_POIS, dir, 12 + p_ptr->lev / 4, 2);
3027 case SV_WAND_MAGIC_MISSILE:
3029 fire_bolt_or_beam(20, GF_MISSILE, dir, damroll(2 + p_ptr->lev / 10, 6));
3034 case SV_WAND_ACID_BOLT:
3036 fire_bolt_or_beam(20, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
3041 case SV_WAND_CHARM_MONSTER:
3043 if (charm_monster(dir, MAX(20, p_ptr->lev)))
3048 case SV_WAND_FIRE_BOLT:
3050 fire_bolt_or_beam(20, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
3055 case SV_WAND_COLD_BOLT:
3057 fire_bolt_or_beam(20, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
3062 case SV_WAND_ACID_BALL:
3064 fire_ball(GF_ACID, dir, 60 + 3 * p_ptr->lev / 4, 2);
3069 case SV_WAND_ELEC_BALL:
3071 fire_ball(GF_ELEC, dir, 40 + 3 * p_ptr->lev / 4, 2);
3076 case SV_WAND_FIRE_BALL:
3078 fire_ball(GF_FIRE, dir, 70 + 3 * p_ptr->lev / 4, 2);
3083 case SV_WAND_COLD_BALL:
3085 fire_ball(GF_COLD, dir, 50 + 3 * p_ptr->lev / 4, 2);
3090 case SV_WAND_WONDER:
3093 msg_print("¤ª¤Ã¤È¡¢Ææ¤ÎËâË¡ËÀ¤ò»ÏÆ°¤µ¤»¤¿¡£");
3095 msg_print("Oops. Wand of wonder activated.");
3101 case SV_WAND_DRAGON_FIRE:
3103 fire_ball(GF_FIRE, dir, 200, -3);
3108 case SV_WAND_DRAGON_COLD:
3110 fire_ball(GF_COLD, dir, 180, -3);
3115 case SV_WAND_DRAGON_BREATH:
3117 switch (randint1(5))
3121 fire_ball(GF_ACID, dir, 240, -3);
3127 fire_ball(GF_ELEC, dir, 210, -3);
3133 fire_ball(GF_FIRE, dir, 240, -3);
3139 fire_ball(GF_COLD, dir, 210, -3);
3145 fire_ball(GF_POIS, dir, 180, -3);
3154 case SV_WAND_DISINTEGRATE:
3156 fire_ball(GF_DISINTEGRATE, dir, 200 + randint1(p_ptr->lev * 2), 2);
3161 case SV_WAND_ROCKETS:
3164 msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡ª");
3166 msg_print("You launch a rocket!");
3169 fire_rocket(GF_ROCKET, dir, 250 + p_ptr->lev * 3, 2);
3174 case SV_WAND_STRIKING:
3176 fire_bolt(GF_METEOR, dir, damroll(15 + p_ptr->lev / 3, 13));
3181 case SV_WAND_GENOCIDE:
3183 fire_ball_hide(GF_GENOCIDE, dir, magic ? p_ptr->lev + 50 : 250, 0);
3193 * Aim a wand (from the pack or floor).
3195 * Use a single charge from a single item.
3196 * Handle "unstacking" in a logical manner.
3198 * For simplicity, you cannot use a stack of items from the
3199 * ground. This would require too much nasty code.
3201 * There are no wands which can "destroy" themselves, in the inventory
3202 * or on the ground, so we can ignore this possibility. Note that this
3203 * required giving "wand of wonder" the ability to ignore destruction
3204 * by electric balls.
3206 * All wands can be "cancelled" at the "Direction?" prompt for free.
3208 * Note that the basic "bolt" wands do slightly less damage than the
3209 * basic "bolt" rods, but the basic "ball" wands do the same damage
3210 * as the basic "ball" rods.
3212 static void do_cmd_aim_wand_aux(int item)
3214 int lev, ident, chance, dir;
3216 bool old_target_pet = target_pet;
3218 /* Get the item (in the pack) */
3221 o_ptr = &inventory[item];
3224 /* Get the item (on the floor) */
3227 o_ptr = &o_list[0 - item];
3230 /* Mega-Hack -- refuse to aim a pile from the ground */
3231 if ((item < 0) && (o_ptr->number > 1))
3234 msg_print("¤Þ¤º¤ÏËâË¡ËÀ¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
3236 msg_print("You must first pick up the wands.");
3243 /* Allow direction to be cancelled for free */
3244 if (object_aware_p(o_ptr) && (o_ptr->sval == SV_WAND_HEAL_MONSTER
3245 || o_ptr->sval == SV_WAND_HASTE_MONSTER))
3247 if (!get_aim_dir(&dir))
3249 target_pet = old_target_pet;
3252 target_pet = old_target_pet;
3258 lev = get_object_level(o_ptr);
3259 if (lev > 50) lev = 50 + (lev - 50)/2;
3261 /* Base chance of success */
3262 chance = p_ptr->skill_dev;
3264 /* Confusion hurts skill */
3265 if (p_ptr->confused) chance = chance / 2;
3267 /* Hight level objects are harder */
3268 chance = chance - lev;
3270 /* Give everyone a (slight) chance */
3271 if ((chance < USE_DEVICE) && one_in_(USE_DEVICE - chance + 1))
3273 chance = USE_DEVICE;
3278 if (flush_failure) flush();
3280 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3282 msg_print("Nothing happen. Maybe this wand is freezing too.");
3289 /* Roll for usage */
3290 if ((chance < USE_DEVICE) || (randint1(chance) < USE_DEVICE) || (p_ptr->pclass == CLASS_BERSERKER))
3292 if (flush_failure) flush();
3294 msg_print("ËâË¡ËÀ¤ò¤¦¤Þ¤¯»È¤¨¤Ê¤«¤Ã¤¿¡£");
3296 msg_print("You failed to use the wand properly.");
3303 /* The wand is already empty! */
3304 if (o_ptr->pval <= 0)
3306 if (flush_failure) flush();
3308 msg_print("¤³¤ÎËâË¡ËÀ¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£");
3310 msg_print("The wand has no charges left.");
3313 o_ptr->ident |= (IDENT_EMPTY);
3315 /* Combine / Reorder the pack (later) */
3316 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3317 p_ptr->window |= (PW_INVEN);
3325 ident = wand_effect(o_ptr->sval, dir, FALSE);
3327 /* Combine / Reorder the pack (later) */
3328 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3330 if (!(object_aware_p(o_ptr)))
3332 chg_virtue(V_PATIENCE, -1);
3333 chg_virtue(V_CHANCE, 1);
3334 chg_virtue(V_KNOWLEDGE, -1);
3337 /* Mark it as tried */
3338 object_tried(o_ptr);
3340 /* Apply identification */
3341 if (ident && !object_aware_p(o_ptr))
3343 object_aware(o_ptr);
3344 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
3348 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3351 /* Use a single charge */
3354 /* Describe the charges in the pack */
3357 inven_item_charges(item);
3360 /* Describe the charges on the floor */
3363 floor_item_charges(0 - item);
3368 void do_cmd_aim_wand(void)
3373 /* Restrict choices to wands */
3374 item_tester_tval = TV_WAND;
3376 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
3378 set_action(ACTION_NONE);
3383 q = "¤É¤ÎËâË¡ËÀ¤ÇÁÀ¤¤¤Þ¤¹¤«? ";
3384 s = "»È¤¨¤ëËâË¡ËÀ¤¬¤Ê¤¤¡£";
3386 q = "Aim which wand? ";
3387 s = "You have no wand to aim.";
3390 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
3393 do_cmd_aim_wand_aux(item);
3397 static int rod_effect(int sval, int dir, bool *use_charge, bool magic)
3404 /* Analyze the rod */
3407 case SV_ROD_DETECT_TRAP:
3409 if (detect_traps(DETECT_RAD_DEFAULT, (bool)(dir ? FALSE : TRUE))) ident = TRUE;
3413 case SV_ROD_DETECT_DOOR:
3415 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
3416 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
3420 case SV_ROD_IDENTIFY:
3422 if (!ident_spell(FALSE)) *use_charge = FALSE;
3429 if (!word_of_recall()) *use_charge = FALSE;
3434 case SV_ROD_ILLUMINATION:
3436 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
3440 case SV_ROD_MAPPING:
3442 map_area(DETECT_RAD_MAP);
3447 case SV_ROD_DETECTION:
3449 detect_all(DETECT_RAD_DEFAULT);
3454 case SV_ROD_PROBING:
3463 if (set_blind(0)) ident = TRUE;
3464 if (set_poisoned(0)) ident = TRUE;
3465 if (set_confused(0)) ident = TRUE;
3466 if (set_stun(0)) ident = TRUE;
3467 if (set_cut(0)) ident = TRUE;
3468 if (set_image(0)) ident = TRUE;
3469 if (set_shero(0,TRUE)) ident = TRUE;
3473 case SV_ROD_HEALING:
3475 if (hp_player(500)) ident = TRUE;
3476 if (set_stun(0)) ident = TRUE;
3477 if (set_cut(0)) ident = TRUE;
3478 if (set_shero(0,TRUE)) ident = TRUE;
3482 case SV_ROD_RESTORATION:
3484 if (restore_level()) ident = TRUE;
3485 if (do_res_stat(A_STR)) ident = TRUE;
3486 if (do_res_stat(A_INT)) ident = TRUE;
3487 if (do_res_stat(A_WIS)) ident = TRUE;
3488 if (do_res_stat(A_DEX)) ident = TRUE;
3489 if (do_res_stat(A_CON)) ident = TRUE;
3490 if (do_res_stat(A_CHR)) ident = TRUE;
3496 if (set_fast(randint1(30) + 15, FALSE)) ident = TRUE;
3500 case SV_ROD_PESTICIDE:
3502 if (dispel_monsters(4)) ident = TRUE;
3506 case SV_ROD_TELEPORT_AWAY:
3508 if (teleport_monster(dir)) ident = TRUE;
3512 case SV_ROD_DISARMING:
3514 if (disarm_trap(dir)) ident = TRUE;
3521 msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3523 msg_print("A line of blue shimmering light appears.");
3526 (void)lite_line(dir);
3531 case SV_ROD_SLEEP_MONSTER:
3533 if (sleep_monster(dir)) ident = TRUE;
3537 case SV_ROD_SLOW_MONSTER:
3539 if (slow_monster(dir)) ident = TRUE;
3543 case SV_ROD_DRAIN_LIFE:
3545 if (drain_life(dir, 70 + 3 * p_ptr->lev / 2)) ident = TRUE;
3549 case SV_ROD_POLYMORPH:
3551 if (poly_monster(dir)) ident = TRUE;
3555 case SV_ROD_ACID_BOLT:
3557 fire_bolt_or_beam(10, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
3562 case SV_ROD_ELEC_BOLT:
3564 fire_bolt_or_beam(10, GF_ELEC, dir, damroll(4 + p_ptr->lev / 9, 8));
3569 case SV_ROD_FIRE_BOLT:
3571 fire_bolt_or_beam(10, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
3576 case SV_ROD_COLD_BOLT:
3578 fire_bolt_or_beam(10, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
3583 case SV_ROD_ACID_BALL:
3585 fire_ball(GF_ACID, dir, 60 + p_ptr->lev, 2);
3590 case SV_ROD_ELEC_BALL:
3592 fire_ball(GF_ELEC, dir, 40 + p_ptr->lev, 2);
3597 case SV_ROD_FIRE_BALL:
3599 fire_ball(GF_FIRE, dir, 70 + p_ptr->lev, 2);
3604 case SV_ROD_COLD_BALL:
3606 fire_ball(GF_COLD, dir, 50 + p_ptr->lev, 2);
3618 case SV_ROD_STONE_TO_MUD:
3620 if (wall_to_mud(dir)) ident = TRUE;
3624 case SV_ROD_AGGRAVATE:
3626 aggravate_monsters(0);
3635 * Activate (zap) a Rod
3637 * Unstack fully charged rods as needed.
3639 * Hack -- rods of perception/genocide can be "cancelled"
3640 * All rods can be cancelled at the "Direction?" prompt
3642 * pvals are defined for each rod in k_info. -LM-
3644 static void do_cmd_zap_rod_aux(int item)
3646 int ident, chance, lev, fail;
3651 /* Hack -- let perception get aborted */
3652 bool use_charge = TRUE;
3656 /* Get the item (in the pack) */
3659 o_ptr = &inventory[item];
3662 /* Get the item (on the floor) */
3665 o_ptr = &o_list[0 - item];
3669 /* Mega-Hack -- refuse to zap a pile from the ground */
3670 if ((item < 0) && (o_ptr->number > 1))
3673 msg_print("¤Þ¤º¤Ï¥í¥Ã¥É¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
3675 msg_print("You must first pick up the rods.");
3682 /* Get a direction (unless KNOWN not to need it) */
3683 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)) ||
3684 !object_aware_p(o_ptr))
3686 /* Get a direction, allow cancel */
3687 if (!get_aim_dir(&dir)) return;
3694 /* Extract the item level */
3695 lev = get_object_level(o_ptr);
3697 /* Base chance of success */
3698 chance = p_ptr->skill_dev;
3700 /* Confusion hurts skill */
3701 if (p_ptr->confused) chance = chance / 2;
3704 if (chance > fail) fail -= (chance - fail)*2;
3705 else chance -= (fail - chance)*2;
3706 if (fail < USE_DEVICE) fail = USE_DEVICE;
3707 if (chance < USE_DEVICE) chance = USE_DEVICE;
3711 if (flush_failure) flush();
3713 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3715 msg_print("Nothing happen. Maybe this rod is freezing too.");
3722 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
3723 else if (chance > fail)
3725 if (randint0(chance*2) < fail) success = FALSE;
3726 else success = TRUE;
3730 if (randint0(fail*2) < chance) success = TRUE;
3731 else success = FALSE;
3734 /* Roll for usage */
3737 if (flush_failure) flush();
3739 msg_print("¤¦¤Þ¤¯¥í¥Ã¥É¤ò»È¤¨¤Ê¤«¤Ã¤¿¡£");
3741 msg_print("You failed to use the rod properly.");
3748 k_ptr = &k_info[o_ptr->k_idx];
3750 /* A single rod is still charging */
3751 if ((o_ptr->number == 1) && (o_ptr->timeout))
3753 if (flush_failure) flush();
3755 msg_print("¤³¤Î¥í¥Ã¥É¤Ï¤Þ¤ÀËâÎϤò½¼Å¶¤·¤Æ¤¤¤ëºÇÃæ¤À¡£");
3757 msg_print("The rod is still charging.");
3762 /* A stack of rods lacks enough energy. */
3763 else if ((o_ptr->number > 1) && (o_ptr->timeout > k_ptr->pval * (o_ptr->number - 1)))
3765 if (flush_failure) flush();
3767 msg_print("¤½¤Î¥í¥Ã¥É¤Ï¤Þ¤À½¼Å¶Ãæ¤Ç¤¹¡£");
3769 msg_print("The rods are all still charging.");
3778 ident = rod_effect(o_ptr->sval, dir, &use_charge, FALSE);
3780 /* Increase the timeout by the rod kind's pval. -LM- */
3781 if (use_charge) o_ptr->timeout += k_ptr->pval;
3783 /* Combine / Reorder the pack (later) */
3784 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3786 if (!(object_aware_p(o_ptr)))
3788 chg_virtue(V_PATIENCE, -1);
3789 chg_virtue(V_CHANCE, 1);
3790 chg_virtue(V_KNOWLEDGE, -1);
3793 /* Tried the object */
3794 object_tried(o_ptr);
3796 /* Successfully determined the object function */
3797 if (ident && !object_aware_p(o_ptr))
3799 object_aware(o_ptr);
3800 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
3804 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3808 void do_cmd_zap_rod(void)
3813 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
3815 set_action(ACTION_NONE);
3818 /* Restrict choices to rods */
3819 item_tester_tval = TV_ROD;
3823 q = "¤É¤Î¥í¥Ã¥É¤ò¿¶¤ê¤Þ¤¹¤«? ";
3824 s = "»È¤¨¤ë¥í¥Ã¥É¤¬¤Ê¤¤¡£";
3826 q = "Zap which rod? ";
3827 s = "You have no rod to zap.";
3830 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
3833 do_cmd_zap_rod_aux(item);
3838 * Hook to determine if an object is activatable
3840 static bool item_tester_hook_activate(object_type *o_ptr)
3842 u32b flgs[TR_FLAG_SIZE];
3845 if (!object_known_p(o_ptr)) return (FALSE);
3847 /* Extract the flags */
3848 object_flags(o_ptr, flgs);
3850 /* Check activation flag */
3851 if (have_flag(flgs, TR_ACTIVATE)) return (TRUE);
3859 * Hack -- activate the ring of power
3861 void ring_of_power(int dir)
3863 /* Pick a random effect */
3864 switch (randint1(10))
3871 msg_print("¤¢¤Ê¤¿¤Ï°À¤Î¥ª¡¼¥é¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡£");
3873 msg_print("You are surrounded by a malignant aura.");
3878 /* Decrease all stats (permanently) */
3879 (void)dec_stat(A_STR, 50, TRUE);
3880 (void)dec_stat(A_INT, 50, TRUE);
3881 (void)dec_stat(A_WIS, 50, TRUE);
3882 (void)dec_stat(A_DEX, 50, TRUE);
3883 (void)dec_stat(A_CON, 50, TRUE);
3884 (void)dec_stat(A_CHR, 50, TRUE);
3886 /* Lose some experience (permanently) */
3887 p_ptr->exp -= (p_ptr->exp / 4);
3888 p_ptr->max_exp -= (p_ptr->exp / 4);
3898 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥª¡¼¥é¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡£");
3900 msg_print("You are surrounded by a powerful aura.");
3904 /* Dispel monsters */
3905 dispel_monsters(1000);
3915 fire_ball(GF_MANA, dir, 600, 3);
3926 fire_bolt(GF_MANA, dir, 500);
3934 static bool ang_sort_comp_pet(vptr u, vptr v, int a, int b)
3936 u16b *who = (u16b*)(u);
3941 monster_type *m_ptr1 = &m_list[w1];
3942 monster_type *m_ptr2 = &m_list[w2];
3943 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
3944 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
3949 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
3950 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
3952 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
3953 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
3955 if (r_ptr1->level > r_ptr2->level) return TRUE;
3956 if (r_ptr2->level > r_ptr1->level) return FALSE;
3958 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
3959 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
3965 * Activate a wielded object. Wielded objects never stack.
3966 * And even if they did, activatable objects never stack.
3968 * Currently, only (some) artifacts, and Dragon Scale Mail, can be activated.
3969 * But one could, for example, easily make an activatable "Ring of Plasma".
3971 * Note that it always takes a turn to activate an artifact, even if
3972 * the user hits "escape" at the "direction" prompt.
3974 static void do_cmd_activate_aux(int item)
3976 int k, dir, lev, chance, fail;
3981 /* Get the item (in the pack) */
3984 o_ptr = &inventory[item];
3987 /* Get the item (on the floor) */
3990 o_ptr = &o_list[0 - item];
3996 /* Extract the item level */
3997 lev = get_object_level(o_ptr);
3999 /* Hack -- use artifact level instead */
4000 if (artifact_p(o_ptr)) lev = a_info[o_ptr->name1].level;
4001 else if (o_ptr->art_name)
4003 switch (o_ptr->xtra2)
4011 case ACT_CURE_POISON:
4031 case ACT_RESIST_ALL:
4032 case ACT_DETECT_ALL:
4045 case ACT_BANISH_EVIL:
4053 case ACT_CHARM_ANIMAL:
4054 case ACT_SUMMON_ANIMAL:
4057 case ACT_XTRA_SPEED:
4058 case ACT_DETECT_XTRA:
4066 case ACT_CHARM_UNDEAD:
4067 case ACT_CHARM_OTHER:
4068 case ACT_SUMMON_PHANTOM:
4069 case ACT_SUMMON_ELEMENTAL:
4070 case ACT_RUNE_EXPLO:
4074 case ACT_CHARM_ANIMALS:
4075 case ACT_CHARM_OTHERS:
4082 case ACT_CALL_CHAOS:
4087 case ACT_SUMMON_UNDEAD:
4088 case ACT_SUMMON_DEMON:
4099 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
4101 /* Base chance of success */
4102 chance = p_ptr->skill_dev;
4104 /* Confusion hurts skill */
4105 if (p_ptr->confused) chance = chance / 2;
4108 if (chance > fail) fail -= (chance - fail)*2;
4109 else chance -= (fail - chance)*2;
4110 if (fail < USE_DEVICE) fail = USE_DEVICE;
4111 if (chance < USE_DEVICE) chance = USE_DEVICE;
4115 if (flush_failure) flush();
4117 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
4119 msg_print("It shows no reaction.");
4126 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
4127 else if (chance > fail)
4129 if (randint0(chance*2) < fail) success = FALSE;
4130 else success = TRUE;
4134 if (randint0(fail*2) < chance) success = TRUE;
4135 else success = FALSE;
4138 /* Roll for usage */
4141 if (flush_failure) flush();
4143 msg_print("¤¦¤Þ¤¯»ÏÆ°¤µ¤»¤ë¤³¤È¤¬¤Ç¤¤Ê¤«¤Ã¤¿¡£");
4145 msg_print("You failed to activate it properly.");
4152 /* Check the recharge */
4156 msg_print("¤½¤ì¤ÏÈù¤«¤Ë²»¤òΩ¤Æ¡¢µ±¤¡¢¾Ã¤¨¤¿...");
4158 msg_print("It whines, glows and fades...");
4165 /* Activate the artifact */
4167 msg_print("»ÏÆ°¤µ¤»¤¿...");
4169 msg_print("You activate it...");
4177 if (o_ptr->art_name && o_ptr->xtra2)
4179 (void)activate_random_artifact(o_ptr);
4182 p_ptr->window |= (PW_INVEN | PW_EQUIP);
4189 else if (o_ptr->name1)
4192 switch (o_ptr->name1)
4197 msg_print("ààÎÜÉÓ¤«¤éÀ¡¤ó¤À¸÷¤¬¤¢¤Õ¤ì½Ð¤¿...");
4199 msg_print("The phial wells with clear light...");
4202 lite_area(damroll(2, 15), 3);
4203 o_ptr->timeout = randint0(10) + 10;
4210 msg_print("À±¤¬âÁ¤·¤¯µ±¤¤¤¿...");
4212 msg_print("The star shines brightly...");
4215 map_area(DETECT_RAD_MAP);
4216 lite_area(damroll(2, 15), 3);
4217 o_ptr->timeout = randint0(50) + 50;
4224 msg_print("¤½¤ÎÊõÀФÏÀÖ¤¯ÌÀ¤ë¤¯¸÷¤Ã¤¿¡ª");
4226 msg_print("The Jewel flashes bright red!");
4229 chg_virtue(V_KNOWLEDGE, 1);
4230 chg_virtue(V_ENLIGHTEN, 1);
4233 msg_print("¤½¤ÎÊõÀФϤ¢¤Ê¤¿¤ÎÂÎÎϤòÃ¥¤Ã¤¿...");
4234 take_hit(DAMAGE_LOSELIFE, damroll(3,8), "¿³È½¤ÎÊõÀÐ", -1);
4236 msg_print("The Jewel drains your vitality...");
4237 take_hit(DAMAGE_LOSELIFE, damroll(3, 8), "the Jewel of Judgement", -1);
4240 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
4241 (void)detect_doors(DETECT_RAD_DEFAULT);
4242 (void)detect_stairs(DETECT_RAD_DEFAULT);
4245 if (get_check("µ¢´Ô¤ÎÎϤò»È¤¤¤Þ¤¹¤«¡©"))
4247 if (get_check("Activate recall? "))
4251 (void)word_of_recall();
4254 o_ptr->timeout = randint0(20) + 20;
4261 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
4263 msg_print("The amulet lets out a shrill wail...");
4267 (void)set_protevil(randint1(25) + k, FALSE);
4268 o_ptr->timeout = randint0(225) + 225;
4275 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
4277 msg_print("The amulet floods the area with goodness...");
4280 dispel_evil(p_ptr->lev * 5);
4281 o_ptr->timeout = randint0(200) + 200;
4288 msg_print("¶À¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
4290 msg_print("The mirror floods the area with goodness...");
4293 dispel_evil(p_ptr->lev * 5);
4294 o_ptr->timeout = randint0(200) + 200;
4301 msg_print("¤¢¤Ê¤¿¤Ï¥Õ¥é¥¥¢¤ËŨ¤òÄù¤á»¦¤¹¤è¤¦Ì¿¤¸¤¿¡£");
4303 msg_print("You order Frakir to strangle your opponent.");
4306 if (!get_aim_dir(&dir)) return;
4307 if (drain_life(dir, 100))
4308 o_ptr->timeout = randint0(100) + 100;
4315 msg_print("»ØÎؤÏÌÀ¤ë¤¯µ±¤¤¤¿...");
4317 msg_print("The ring glows brightly...");
4320 (void)set_fast(randint1(75) + 75, FALSE);
4321 o_ptr->timeout = randint0(150) + 150;
4328 msg_print("»ØÎؤϿ¼¹È¤Ëµ±¤¤¤¿...");
4330 msg_print("The ring glows deep red...");
4333 if (!get_aim_dir(&dir)) return;
4334 fire_ball(GF_FIRE, dir, 300, 3);
4335 o_ptr->timeout = randint0(225) + 225;
4342 msg_print("»ØÎؤÏÇò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4344 msg_print("The ring glows bright white...");
4347 if (!get_aim_dir(&dir)) return;
4348 fire_ball(GF_COLD, dir, 400, 3);
4349 o_ptr->timeout = randint0(325) + 325;
4357 msg_format("%s¤Ï¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...", o_ptr->name1 == ART_VILYA ? "»ØÎØ" : "¥½¡¼¥É");
4359 msg_format("The %s glows deep blue...", o_ptr->name1 == ART_VILYA ? "ring" : "sword");
4362 if (!get_aim_dir(&dir)) return;
4363 fire_ball(GF_ELEC, dir, 500, 3);
4364 o_ptr->timeout = randint0(425) + 425;
4372 msg_print("»ØÎؤϼ¿¹õ¤Ëµ±¤¤¤¿...");
4374 msg_print("The ring glows intensely black...");
4377 if (!get_aim_dir(&dir)) return;
4379 o_ptr->timeout = randint0(450) + 450;
4385 int num = damroll(5, 3);
4390 msg_print("³»¤¬°ðºÊ¤Çʤ¤ï¤ì¤¿...");
4392 msg_print("Your armor is surrounded by lightning...");
4396 for (k = 0; k < num; k++)
4402 scatter(&y, &x, py, px, 4, 0);
4404 if (!cave_floor_bold(y, x)) continue;
4406 if (!player_bold(y, x)) break;
4409 project(0, 3, y, x, 150, GF_ELEC,
4410 (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
4413 o_ptr->timeout = 1000;
4417 case ART_BLADETURNER:
4419 if (!get_aim_dir(&dir)) return;
4421 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
4423 msg_print("You breathe the elements.");
4426 fire_ball(GF_MISSILE, dir, 300, 4);
4428 msg_print("³»¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...");
4430 msg_print("Your armor glows many colours...");
4433 (void)set_afraid(0);
4434 (void)set_hero(randint1(50) + 50, FALSE);
4435 (void)hp_player(10);
4436 (void)set_blessed(randint1(50) + 50, FALSE);
4437 (void)set_oppose_acid(randint1(50) + 50, FALSE);
4438 (void)set_oppose_elec(randint1(50) + 50, FALSE);
4439 (void)set_oppose_fire(randint1(50) + 50, FALSE);
4440 (void)set_oppose_cold(randint1(50) + 50, FALSE);
4441 (void)set_oppose_pois(randint1(50) + 50, FALSE);
4442 o_ptr->timeout = 400;
4446 case ART_SOULKEEPER:
4449 msg_print("³»¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4450 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬¤è¤¤...");
4452 msg_print("Your armor glows a bright white...");
4453 msg_print("You feel much better...");
4456 (void)hp_player(1000);
4458 o_ptr->timeout = 888;
4465 msg_print("Å·¹ñ¤Î²Î¤¬Ê¹¤³¤¨¤ë...");
4467 msg_print("A heavenly choir sings...");
4470 (void)set_poisoned(0);
4473 (void)set_confused(0);
4475 (void)set_hero(randint1(25) + 25, FALSE);
4476 (void)hp_player(777);
4477 o_ptr->timeout = 300;
4484 msg_print("³»¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4486 msg_print("Your armor glows deep blue...");
4489 (void)symbol_genocide(200, TRUE);
4490 o_ptr->timeout = 500;
4497 msg_print("³»¤¬ÀÖ¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4499 msg_print("Your armor glows bright red...");
4502 destroy_doors_touch();
4503 o_ptr->timeout = 10;
4511 turn_monsters(40 + p_ptr->lev);
4512 o_ptr->timeout = 3 * (p_ptr->lev + 10);
4517 case ART_HOLHENNETH:
4520 msg_print("¥Ø¥ë¥á¥Ã¥È¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4521 msg_print("¿´¤Ë¥¤¥á¡¼¥¸¤¬É⤫¤ó¤Ç¤¤¿...");
4523 msg_print("Your helm glows bright white...");
4524 msg_print("An image forms in your mind...");
4527 detect_all(DETECT_RAD_DEFAULT);
4528 o_ptr->timeout = randint0(55) + 55;
4535 msg_print("²¦´§¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4536 msg_print("ÂÎÆâ¤ËÃȤ«¤¤¸ÝÆ°¤¬´¶¤¸¤é¤ì¤ë...");
4538 msg_print("Your crown glows deep blue...");
4539 msg_print("You feel a warm tingling inside...");
4542 (void)hp_player(700);
4544 o_ptr->timeout = 250;
4552 msg_format("%s¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...", o_ptr->name1 == ART_COLLUIN ? "¥¯¥í¡¼¥¯" : "³»");
4554 msg_format("Your %s glows many colours...", o_ptr->name1 == ART_COLLUIN ? "cloak" : "armor");
4557 (void)set_oppose_acid(randint1(20) + 20, FALSE);
4558 (void)set_oppose_elec(randint1(20) + 20, FALSE);
4559 (void)set_oppose_fire(randint1(20) + 20, FALSE);
4560 (void)set_oppose_cold(randint1(20) + 20, FALSE);
4561 (void)set_oppose_pois(randint1(20) + 20, FALSE);
4562 o_ptr->timeout = 111;
4566 case ART_HOLCOLLETH:
4569 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4571 msg_print("Your cloak glows deep blue...");
4574 sleep_monsters_touch();
4575 o_ptr->timeout = 55;
4582 msg_print("¥¯¥í¡¼¥¯¤¬²«¿§¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4584 msg_print("Your cloak glows bright yellow...");
4588 o_ptr->timeout = 70;
4595 msg_print("¥¯¥í¡¼¥¯¤¬ÊÕ¤ê¤Î¶õ´Ö¤ò¤æ¤¬¤Þ¤»¤¿...");
4597 msg_print("Your cloak twists space around you...");
4600 teleport_player(100);
4601 o_ptr->timeout = 45;
4608 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4610 msg_print("Your cloak glows a deep red...");
4614 o_ptr->timeout = 450;
4618 case ART_CAMMITHRIM:
4621 msg_print("¥°¥í¡¼¥Ö¤¬âÁ¤·¤¤¤¯¤é¤¤¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4623 msg_print("Your gloves glow extremely brightly...");
4626 if (!get_aim_dir(&dir)) return;
4627 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
4635 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4637 msg_print("Your gauntlets are covered in fire...");
4640 if (!get_aim_dir(&dir)) return;
4641 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4642 o_ptr->timeout = randint0(8) + 8;
4646 case ART_PAURNIMMEN:
4649 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4651 msg_print("Your gauntlets are covered in frost...");
4654 if (!get_aim_dir(&dir)) return;
4655 fire_bolt(GF_COLD, dir, damroll(6, 8));
4656 o_ptr->timeout = randint0(7) + 7;
4663 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4665 msg_print("Your gauntlets are covered in sparks...");
4668 if (!get_aim_dir(&dir)) return;
4669 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4670 o_ptr->timeout = randint0(5) + 5;
4677 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬»À¤Ëʤ¤ï¤ì¤¿...");
4679 msg_print("Your gauntlets are covered in acid...");
4682 if (!get_aim_dir(&dir)) return;
4683 fire_bolt(GF_ACID, dir, damroll(5, 8));
4684 o_ptr->timeout = randint0(6) + 6;
4691 msg_print("¥»¥¹¥¿¥¹¤ËËâË¡¤Î¥È¥²¤¬¸½¤ì¤¿...");
4693 msg_print("Your cesti grows magical spikes...");
4696 if (!get_aim_dir(&dir)) return;
4697 fire_bolt(GF_ARROW, dir, 150);
4698 o_ptr->timeout = randint0(90) + 90;
4705 msg_print("¥Ö¡¼¥Ä¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4707 msg_print("Your boots glow bright green...");
4710 (void)set_fast(randint1(20) + 20, FALSE);
4711 o_ptr->timeout = 200;
4718 msg_print("¥Ö¡¼¥Ä¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4720 msg_print("Your boots glow deep blue...");
4723 (void)set_afraid(0);
4724 (void)set_poisoned(0);
4732 msg_print("¥À¥¬¡¼¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4734 msg_print("Your dagger is covered in fire...");
4737 if (!get_aim_dir(&dir)) return;
4738 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4739 o_ptr->timeout = randint0(8) + 8;
4746 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4748 msg_print("Your dagger is covered in frost...");
4751 if (!get_aim_dir(&dir)) return;
4752 fire_bolt(GF_COLD, dir, damroll(6, 8));
4753 o_ptr->timeout = randint0(7) + 7;
4760 msg_print("¥À¥¬¡¼¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4762 msg_print("Your dagger is covered in sparks...");
4765 if (!get_aim_dir(&dir)) return;
4766 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4767 o_ptr->timeout = randint0(5) + 5;
4774 msg_print("¥À¥¬¡¼¤¬¿¼¤¤Îп§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4776 msg_print("Your dagger throbs deep green...");
4779 if (!get_aim_dir(&dir)) return;
4780 fire_ball(GF_POIS, dir, 12, 3);
4781 o_ptr->timeout = randint0(4) + 4;
4788 msg_print("Ì·¤¬¿¼¤¤ÀÄ¿§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4790 msg_print("Your dagger throbs deep blue...");
4793 if (!get_aim_dir(&dir)) return;
4794 fire_ball(GF_WATER, dir, 200, 3);
4795 o_ptr->timeout = 250;
4802 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4804 msg_print("Your dagger is covered in frost...");
4807 if (!get_aim_dir(&dir)) return;
4808 fire_ball(GF_COLD, dir, 48, 2);
4809 o_ptr->timeout = randint0(5) + 5;
4814 case ART_WEREWINDLE:
4816 switch (randint1(13))
4818 case 1: case 2: case 3: case 4: case 5:
4819 teleport_player(10);
4821 case 6: case 7: case 8: case 9: case 10:
4822 teleport_player(222);
4825 (void)stair_creation();
4829 if (get_check("¤³¤Î³¬¤òµî¤ê¤Þ¤¹¤«¡©"))
4831 if (get_check("Leave this level? "))
4835 if (autosave_l) do_cmd_save_game(TRUE);
4838 p_ptr->leaving = TRUE;
4841 o_ptr->timeout = 35;
4847 teleport_player(222);
4848 o_ptr->timeout = 25;
4855 msg_print("¥½¡¼¥É¤¬ÀĤ¯·ã¤·¤¯µ±¤¤¤¿...");
4857 msg_print("Your sword glows an intense blue...");
4860 if (!get_aim_dir(&dir)) return;
4861 fire_ball(GF_COLD, dir, 100, 2);
4862 o_ptr->timeout = 200;
4869 msg_print("¶Ç¤Î»ÕÃĤò¾¤´¤·¤¿¡£");
4871 msg_print("You summon the Legion of the Dawn.");
4874 (void)summon_specific(-1, py, px, dun_level, SUMMON_DAWN, (PM_ALLOW_GROUP | PM_FORCE_PET));
4875 o_ptr->timeout = 500 + randint1(500);
4882 msg_print("¥½¡¼¥É¤¬ÀÖ¤¯·ã¤·¤¯µ±¤¤¤¿...");
4884 msg_print("Your sword glows an intense red...");
4887 if (!get_aim_dir(&dir)) return;
4888 fire_ball(GF_FIRE, dir, 72, 2);
4889 o_ptr->timeout = 400;
4896 msg_print("¥¢¥Ã¥¯¥¹¤Î¿Ï¤¬¹õ¤¯µ±¤¤¤¿...");
4898 msg_print("Your axe blade glows black...");
4901 if (!get_aim_dir(&dir)) return;
4902 drain_life(dir, 120);
4903 o_ptr->timeout = 400;
4910 msg_print("¤¢¤Ê¤¿¤ÎÁä¤ÏÅŵ¤¤Ç¥¹¥Ñ¡¼¥¯¤·¤Æ¤¤¤ë...");
4912 msg_print("Your spear crackles with electricity...");
4915 if (!get_aim_dir(&dir)) return;
4916 fire_ball(GF_ELEC, dir, 100, 3);
4917 o_ptr->timeout = 200;
4924 msg_print("¥¹¥Ô¥¢¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4926 msg_print("Your spear glows a bright white...");
4929 if (!get_aim_dir(&dir)) return;
4930 fire_ball(GF_COLD, dir, 100, 3);
4931 o_ptr->timeout = 200;
4938 msg_print("¥¹¥Ô¥¢¤¬¸ÝÆ°¤·¤¿...");
4940 msg_print("Your spear pulsates...");
4943 if (!get_aim_dir(&dir)) return;
4952 msg_print("¤Ä¤ë¤Ï¤·¤¬¸ÝÆ°¤·¤¿...");
4954 msg_print("Your mattock pulsates...");
4957 if (!get_aim_dir(&dir)) return;
4966 msg_print("¥¢¥Ã¥¯¥¹¤«¤é¤Ò¤É¤¯±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
4968 msg_print("Your axe lets out a long, shrill note...");
4971 (void)mass_genocide(200, TRUE);
4972 o_ptr->timeout = 1000;
4979 msg_print("¥Ð¥È¥ë¡¦¥¢¥Ã¥¯¥¹¤¬¿¼»ç¤Î¸÷¤òÊü¼Í¤·¤¿...");
4981 msg_print("Your battle axe radiates deep purple...");
4984 hp_player(damroll(4, 8));
4985 (void)set_cut((p_ptr->cut / 2) - 50);
4986 o_ptr->timeout = randint0(3) + 3;
4993 msg_print("¥È¥é¥¤¥Ç¥ó¥È¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4995 msg_print("Your trident glows deep red...");
4998 if (!get_aim_dir(&dir)) return;
4999 teleport_monster(dir);
5000 o_ptr->timeout = 150;
5007 msg_print("Âç³ù¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
5009 msg_print("Your scythe glows soft white...");
5011 if (!word_of_recall()) return;
5012 o_ptr->timeout = 200;
5019 msg_print("¸û¶Ì¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
5021 msg_print("Your scythe glows soft white...");
5023 if (!word_of_recall()) return;
5024 o_ptr->timeout = 200;
5031 msg_print("¥Õ¥ì¥¤¥ë¤¬ÍÍ¡¹¤Ê¿§¤Î²Ð²Ö¤òȯ¤·¤¿...");
5033 msg_print("Your flail glows in scintillating colours...");
5036 if (!get_aim_dir(&dir)) return;
5037 confuse_monster(dir, 20);
5038 o_ptr->timeout = 15;
5045 msg_print("¥â¡¼¥Ë¥ó¥°¥¹¥¿¡¼¤«¤é±ê¤¬¿á¤½Ð¤·¤¿...");
5047 msg_print("Your morning star rages in fire...");
5050 if (!get_aim_dir(&dir)) return;
5051 fire_ball(GF_FIRE, dir, 72, 3);
5052 o_ptr->timeout = 100;
5059 msg_print("¥à¥Á¤¬¿¼¤¤ÀÖ¿§¤Ëµ±¤¤¤¿...");
5061 msg_print("Your whip glows deep red...");
5064 if (!get_aim_dir(&dir)) return;
5065 fire_ball(GF_FIRE, dir, 120, 3);
5066 o_ptr->timeout = 15;
5073 msg_print("¥á¥¤¥¹¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
5075 msg_print("Your mace glows bright green...");
5078 (void)set_fast(randint1(20) + 20, FALSE);
5079 o_ptr->timeout = randint0(100) + 100;
5086 msg_print("¥¯¥©¡¼¥¿¡¼¥¹¥¿¥Ã¥Õ¤¬²«¿§¤¯µ±¤¤¤¿...");
5088 msg_print("Your quarterstaff glows yellow...");
5091 if (!ident_spell(FALSE)) return;
5092 o_ptr->timeout = 10;
5099 msg_print("¾ó¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
5101 msg_print("Your quarterstaff glows brightly...");
5104 detect_all(DETECT_RAD_DEFAULT);
5106 identify_fully(FALSE);
5107 o_ptr->timeout = 1000;
5114 msg_print("¥Ï¥ó¥Þ¡¼¤¬Çò¤¯µ±¤¤¤¿...");
5116 msg_print("Your hammer glows white...");
5119 if (!get_aim_dir(&dir)) return;
5120 drain_life(dir, 90);
5121 o_ptr->timeout = 70;
5128 msg_print("¥¯¥í¥¹¥Ü¥¦¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
5130 msg_print("Your crossbow glows deep red...");
5133 (void)brand_bolts();
5134 o_ptr->timeout = 999;
5141 int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
5144 msg_print("¤»¤Ã¤«¤¯¤À¤«¤é¡Ø¥¯¥ê¥à¥¾¥ó¡Ù¤ò¤Ö¤Ã¤Ñ¤Ê¤¹¤¼¡ª");
5146 msg_print("I'll fire CRIMSON! SEKKAKUDAKARA!");
5149 if (!get_aim_dir(&dir)) return;
5151 /* Use the given direction */
5152 tx = px + 99 * ddx[dir];
5153 ty = py + 99 * ddy[dir];
5155 /* Hack -- Use an actual "target" */
5156 if ((dir == 5) && target_okay())
5162 if (p_ptr->pclass == CLASS_ARCHER)
5164 /* Extra shot at level 10 */
5165 if (p_ptr->lev >= 10) num++;
5167 /* Extra shot at level 30 */
5168 if (p_ptr->lev >= 30) num++;
5170 /* Extra shot at level 45 */
5171 if (p_ptr->lev >= 45) num++;
5174 for (i = 0; i < num; i++)
5175 project(0, p_ptr->lev/20+1, ty, tx, p_ptr->lev*p_ptr->lev*6/50, GF_ROCKET, flg, -1);
5176 o_ptr->timeout = 15;
5181 monster_type *m_ptr;
5182 monster_race *r_ptr;
5186 msg_print("´ñ̯¤Ê¾ì½ê¤¬Æ¬¤ÎÃæ¤ËÉ⤫¤ó¤À¡¥¡¥¡¥");
5188 msg_print("Some strange places show up in your mind. And you see ...");
5191 /* Process the monsters (backwards) */
5192 for (i = m_max - 1; i >= 1; i--)
5194 /* Access the monster */
5197 /* Ignore "dead" monsters */
5198 if (!m_ptr->r_idx) continue;
5200 r_ptr = &r_info[m_ptr->r_idx];
5202 if(r_ptr->flags1 & RF1_UNIQUE)
5205 msg_format("%s¡¥ ",r_name + r_ptr->name);
5207 msg_format("%s. ",r_name + r_ptr->name);
5211 o_ptr->timeout = 200;
5215 case ART_STONE_LORE:
5218 msg_print("ÀФ¬±£¤µ¤ì¤¿ÈëÌ©¤ò¼Ì¤·½Ð¤·¤¿¡¥¡¥¡¥");
5220 msg_print("The stone reveals hidden mysteries...");
5222 if (!ident_spell(FALSE)) return;
5224 if (mp_ptr->spell_book)
5226 /* Sufficient mana */
5227 if (20 <= p_ptr->csp)
5233 /* Over-exert the player */
5236 int oops = 20 - p_ptr->csp;
5240 p_ptr->csp_frac = 0;
5244 msg_print("ÀФòÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
5246 msg_print("You are too weak to control the stone!");
5249 /* Hack -- Bypass free action */
5250 (void)set_paralyzed(p_ptr->paralyzed +
5251 randint1(5 * oops + 1));
5254 (void)set_confused(p_ptr->confused +
5255 randint1(5 * oops + 1));
5259 p_ptr->redraw |= (PR_MANA);
5263 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "´í¸±¤ÊÈëÌ©", -1);
5265 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "perilous secrets", -1);
5269 if (one_in_(5)) (void)set_confused(p_ptr->confused +
5272 /* Exercise a little care... */
5275 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "´í¸±¤ÊÈëÌ©", -1);
5277 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "perilous secrets", -1);
5285 msg_print("You wind a mighty blast; your enemies tremble!");
5286 (void)turn_monsters((3 * p_ptr->lev / 2) + 10);
5287 o_ptr->timeout = randint0(40) + 40;
5293 msg_print("¤¢¤Ê¤¿¤Ï³²Ãî¤ò°ìÁݤ·¤¿¡£");
5295 msg_print("You exterminate small life.");
5297 (void)dispel_monsters(4);
5298 o_ptr->timeout = randint0(55) + 55;
5305 msg_print("Æߤ¤²»¤¬ÊÕ¤ê¤òÊñ¤ß¤³¤ó¤À¡£");
5307 msg_print("A shrill wailing sound surrounds you.");
5309 (void)set_protevil(randint1(25) + p_ptr->lev, FALSE);
5310 o_ptr->timeout = randint0(200) + 200;
5318 msg_print("¥í¡¼¥Ö¤¬½ã¿è¤ÊËâÎϤǿ̤¨¤¿¡£");
5320 msg_print("The robe pulsates with raw mana...");
5322 if (!get_aim_dir(&dir)) return;
5323 fire_bolt(GF_MANA, dir, 120);
5324 o_ptr->timeout = randint0(120) + 120;
5329 (void)set_fast(randint1(50) + 50, FALSE);
5332 set_hero(randint1(50) + 50, FALSE);
5333 o_ptr->timeout = randint0(200) + 100;
5339 msg_print("¥·¡¼¥ë¥É¤¬âÁ¤·¤¤¸÷¤Çµ±¤¤¤¿¡¥¡¥¡¥");
5341 msg_print("Your shield gleams with blinding light...");
5343 fire_ball(GF_LITE, 0, 300, 6);
5344 confuse_monsters(3 * p_ptr->lev / 2);
5345 o_ptr->timeout = 250;
5351 msg_print("¥«¡¼¥É¤¬Çò¤¯µ±¤¤¤¿¡¥¡¥¡¥");
5353 msg_print("Your card gleams with blinding light...");
5355 if (!recharge(1000)) return;
5356 o_ptr->timeout = 200;
5362 if (get_check("ËÜÅö¤Ë»È¤¤¤Þ¤¹¤«¡©"))
5364 if (get_check("Are you sure?!"))
5368 msg_print("¼Àµ¤¬¿Ì¤¨¤¿¡¥¡¥¡¥");
5370 msg_print("The Muramasa pulsates...");
5376 msg_print("¼Àµ¤Ï²õ¤ì¤¿¡ª");
5378 msg_print("The Muramasa is destroyed!");
5380 curse_weapon(TRUE, item);
5388 msg_print("ÀФ¬ÀÄÇò¤¯¸÷¤Ã¤¿¡¥¡¥¡¥");
5390 msg_print("Your stone glows pale...");
5393 if (!get_aim_dir(&dir)) return;
5394 fire_ball(GF_MANA, dir, 400, 4);
5395 o_ptr->timeout = randint0(250) + 250;
5402 if (!get_rep_dir2(&dir)) return;
5406 if (!(cave[y][x].feat == FEAT_DEEP_WATER) && !(cave[y][x].feat == FEAT_SHAL_WATER))
5409 msg_print("¤½¤³¤ÏΦÃϤÀ¡£");
5411 msg_print("There is no fishing place.");
5415 else if (cave[y][x].m_idx)
5418 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
5420 msg_format("%s¤¬¼ÙËâ¤À¡ª", m_name);
5422 msg_format("%^s is stand in your way.", m_name);
5427 set_action(ACTION_FISH);
5428 p_ptr->redraw |= (PR_STATE);
5433 if (!get_aim_dir(&dir)) return;
5435 msg_print("¥à¥Á¤ò¿¤Ð¤·¤¿¡£");
5437 msg_print("You stretched your wip.");
5440 fetch(dir, 500, TRUE);
5441 o_ptr->timeout = randint0(25) + 25;
5446 u32b mode = PM_ALLOW_GROUP;
5447 bool pet = !one_in_(5);
5448 if (pet) mode |= PM_FORCE_PET;
5449 else mode |= PM_NO_PET;
5451 if (summon_specific((pet ? -1 : 0), py, px, ((p_ptr->lev * 3) / 2), SUMMON_HOUND, mode))
5456 msg_print("¥Ï¥¦¥ó¥É¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5458 msg_print("A group of hounds appear as your servant.");
5463 msg_print("¥Ï¥¦¥ó¥É¤Ï¤¢¤Ê¤¿¤Ë²ç¤ò¸þ¤±¤Æ¤¤¤ë¡ª");
5465 msg_print("A group of hounds appear as your enemy!");
5470 o_ptr->timeout = 300 + randint1(150);
5477 msg_print("¥¹¥Ô¥¢¤ÏâÁ¤·¤¯µ±¤¤¤¿...");
5479 msg_print("Your spear grows brightly...");
5482 if (!get_aim_dir(&dir)) return;
5483 fire_ball(GF_LITE, dir, 200, 3);
5484 o_ptr->timeout = randint0(200) + 200;
5491 monster_type *m_ptr;
5496 if (summon_named_creature(0, py, px, MON_SUKE, PM_FORCE_PET))
5499 msg_print("¡Ø½õ¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5501 msg_print("Suke-san apperars.");
5502 kakusan = "Suke-san";
5506 if (summon_named_creature(0, py, px, MON_KAKU, PM_FORCE_PET))
5509 msg_print("¡Ø³Ê¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5511 msg_print("Kaku-san appears.");
5512 kakusan = "Kaku-san";
5518 for (i = m_max - 1; i > 0; i--)
5521 if (!m_ptr->r_idx) continue;
5522 if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
5523 if (!los(m_ptr->fy, m_ptr->fx, py, px)) continue;
5532 msg_print("¡Ö¼Ô¤É¤â¡¢¤Ò¤«¤¨¤ª¤í¤¦¡ª¡ª¡ª¤³¤Î¤ªÊý¤ò¤É¤Ê¤¿¤È¤³¤³¤í¤¨¤ë¡£¡×");
5534 msg_format("%^s says 'WHO do you think this person is! Bow your head, down your knees!'", kakusan);
5539 confuse_monsters(120);
5541 stasis_monsters(120);
5547 msg_print("¤·¤«¤·¡¢²¿¤âµ¯¤¤Ê¤«¤Ã¤¿¡£");
5549 msg_print("Nothing happen.");
5552 o_ptr->timeout = randint0(150) + 150;
5559 msg_print("Çï»ÒÌÚ¤òÂǤä¿¡£");
5561 msg_print("You beat Your wooden clappers.");
5563 aggravate_monsters(0);
5570 set_hero(randint1(25)+25, FALSE);
5572 o_ptr->timeout = randint0(30) + 30;
5578 (void)set_poisoned(0);
5579 (void)set_confused(0);
5585 o_ptr->timeout = 100;
5591 if (!get_aim_dir(&dir)) return;
5592 (void)charm_animal(dir, p_ptr->lev);
5594 o_ptr->timeout = 200;
5601 msg_print("¥½¡¼¥É¤¬Ã¸¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
5603 msg_print("Your sword glows a pale blue...");
5605 if (!get_aim_dir(&dir)) return;
5606 fire_bolt(GF_COLD, dir, damroll(12, 8));
5607 o_ptr->timeout = 50;
5614 msg_print("³ù¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
5616 msg_print("Your scythe glows brightly!");
5618 for (i = 0; i < TR_FLAG_SIZE; i++)
5619 o_ptr->art_flags[i] = a_info[ART_BLOOD].flags[i];
5621 dummy = randint1(2)+randint1(2);
5622 for (i = 0; i < dummy; i++)
5624 int flag = randint0(19);
5625 if (flag == 18) add_flag(o_ptr->art_flags, TR_SLAY_HUMAN);
5626 else add_flag(o_ptr->art_flags, TR_CHAOTIC + flag);
5628 dummy = randint1(2);
5629 for (i = 0; i < dummy; i++)
5630 one_resistance(o_ptr);
5632 for (i = 0; i < dummy; i++)
5634 int tmp = randint0(11);
5635 if (tmp < 6) add_flag(o_ptr->art_flags, TR_STR + tmp);
5636 else add_flag(o_ptr->art_flags, TR_STEALTH + tmp - 6);
5638 o_ptr->timeout = 3333;
5639 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
5640 p_ptr->update |= (PU_BONUS | PU_HP);
5646 msg_print("Î϶¯¤¯»Í¸Ô¤òƧ¤ó¤À¡£");
5648 msg_print("You stamp. (as if you are in a ring.)");
5650 (void)set_hero(randint1(20) + 20, FALSE);
5651 dispel_evil(p_ptr->lev * 3);
5652 o_ptr->timeout = 100 + randint1(100);
5658 msg_print("¥¯¥í¡¼¥¯¤¬Çò¤¯µ±¤¤¤¿...");
5660 msg_print("Your cloak grows white.");
5662 (void)set_oppose_cold(randint1(20) + 20, FALSE);
5663 o_ptr->timeout = 40 + randint1(40);
5669 msg_print("¥à¥Á¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
5671 msg_print("The whip lets out a shrill wail...");
5675 (void)set_protevil(randint1(25) + k, FALSE);
5676 o_ptr->timeout = randint0(225) + 225;
5681 u32b mode = PM_ALLOW_GROUP;
5682 bool pet = !one_in_(5);
5683 if (pet) mode |= PM_FORCE_PET;
5685 if (summon_named_creature(0, py, px, MON_JIZOTAKO, mode))
5689 msg_print("Âý¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5691 msg_print("A group of octopuses appear as your servant.");
5696 msg_print("Âý¤Ï¤¢¤Ê¤¿¤òâˤó¤Ç¤¤¤ë¡ª");
5698 msg_print("A group of octopuses appear as your enemy!");
5703 o_ptr->timeout = 300 + randint1(150);
5710 msg_print("Å´µå¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
5712 msg_print("The iron ball floods the area with goodness...");
5715 dispel_evil(p_ptr->lev * 5);
5716 o_ptr->timeout = randint0(100) + 100;
5723 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤¬¿¼¤¤°Ç¤Ëʤ¤ï¤ì¤¿...");
5725 msg_print("Your amulet is coverd in pitch-darkness...");
5727 if (!get_aim_dir(&dir)) return;
5728 fire_ball(GF_DARK, dir, 250, 4);
5729 o_ptr->timeout = randint0(150) + 150;
5735 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5741 if (item_tester_hook_smith(o_ptr))
5743 switch (o_ptr->xtra3-1)
5745 case ESSENCE_TMP_RES_ACID:
5746 (void)set_oppose_acid(randint1(20) + 20, FALSE);
5747 o_ptr->timeout = randint0(50) + 50;
5750 case ESSENCE_TMP_RES_ELEC:
5751 (void)set_oppose_elec(randint1(20) + 20, FALSE);
5752 o_ptr->timeout = randint0(50) + 50;
5755 case ESSENCE_TMP_RES_FIRE:
5756 (void)set_oppose_fire(randint1(20) + 20, FALSE);
5757 o_ptr->timeout = randint0(50) + 50;
5760 case ESSENCE_TMP_RES_COLD:
5761 (void)set_oppose_cold(randint1(20) + 20, FALSE);
5762 o_ptr->timeout = randint0(50) + 50;
5766 earthquake(py, px, 5);
5767 o_ptr->timeout = 100 + randint1(100);
5770 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5778 if (o_ptr->name2 == EGO_TRUMP)
5780 teleport_player(100);
5781 o_ptr->timeout = 50 + randint1(50);
5784 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5791 if (o_ptr->name2 == EGO_LITE_ILLUMINATION)
5793 if (!o_ptr->xtra4 && ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
5796 msg_print("dzÎÁ¤¬¤Ê¤¤¡£");
5798 msg_print("It has no fuel.");
5803 lite_area(damroll(2, 15), 3);
5804 o_ptr->timeout = randint0(10) + 10;
5807 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5813 if (o_ptr->name2 == EGO_EARTHQUAKES)
5815 earthquake(py, px, 5);
5816 o_ptr->timeout = 100 + randint1(100);
5819 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5826 if (o_ptr->name2 == EGO_JUMP)
5828 teleport_player(10);
5829 o_ptr->timeout = 10 + randint1(10);
5832 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5839 /* Hack -- Dragon Scale Mail can be activated as well */
5840 if (o_ptr->tval == TV_DRAG_ARMOR)
5842 /* Get a direction for breathing (or abort) */
5843 if (!get_aim_dir(&dir)) return;
5845 /* Branch on the sub-type */
5846 switch (o_ptr->sval)
5848 case SV_DRAGON_BLUE:
5851 msg_print("¤¢¤Ê¤¿¤Ï°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5853 msg_print("You breathe lightning.");
5856 fire_ball(GF_ELEC, dir, 100, -2);
5857 o_ptr->timeout = randint0(150) + 150;
5861 case SV_DRAGON_WHITE:
5864 msg_print("¤¢¤Ê¤¿¤ÏÎ䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5866 msg_print("You breathe frost.");
5869 fire_ball(GF_COLD, dir, 110, -2);
5870 o_ptr->timeout = randint0(150) + 150;
5874 case SV_DRAGON_BLACK:
5877 msg_print("¤¢¤Ê¤¿¤Ï»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5879 msg_print("You breathe acid.");
5882 fire_ball(GF_ACID, dir, 130, -2);
5883 o_ptr->timeout = randint0(150) + 150;
5887 case SV_DRAGON_GREEN:
5890 msg_print("¤¢¤Ê¤¿¤ÏÆÇ¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5892 msg_print("You breathe poison gas.");
5895 fire_ball(GF_POIS, dir, 150, -2);
5896 o_ptr->timeout = randint0(180) + 180;
5903 msg_print("¤¢¤Ê¤¿¤Ï²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5905 msg_print("You breathe fire.");
5908 fire_ball(GF_FIRE, dir, 200, -2);
5909 o_ptr->timeout = randint0(200) + 200;
5913 case SV_DRAGON_MULTIHUED:
5915 chance = randint0(5);
5917 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5918 ((chance == 1) ? "°ðºÊ" :
5919 ((chance == 2) ? "Î䵤" :
5920 ((chance == 3) ? "»À" :
5921 ((chance == 4) ? "ÆÇ¥¬¥¹" : "²Ð±ê")))));
5923 msg_format("You breathe %s.",
5924 ((chance == 1) ? "lightning" :
5925 ((chance == 2) ? "frost" :
5926 ((chance == 3) ? "acid" :
5927 ((chance == 4) ? "poison gas" : "fire")))));
5930 fire_ball(((chance == 1) ? GF_ELEC :
5931 ((chance == 2) ? GF_COLD :
5932 ((chance == 3) ? GF_ACID :
5933 ((chance == 4) ? GF_POIS : GF_FIRE)))),
5935 o_ptr->timeout = randint0(200) + 200;
5939 case SV_DRAGON_BRONZE:
5942 msg_print("¤¢¤Ê¤¿¤Ïº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5944 msg_print("You breathe confusion.");
5947 fire_ball(GF_CONFUSION, dir, 120, -2);
5948 o_ptr->timeout = randint0(180) + 180;
5952 case SV_DRAGON_GOLD:
5955 msg_print("¤¢¤Ê¤¿¤Ï¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5957 msg_print("You breathe sound.");
5960 fire_ball(GF_SOUND, dir, 130, -2);
5961 o_ptr->timeout = randint0(180) + 180;
5965 case SV_DRAGON_CHAOS:
5967 chance = randint0(2);
5969 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5970 ((chance == 1 ? "¥«¥ª¥¹" : "Îô²½")));
5972 msg_format("You breathe %s.",
5973 ((chance == 1 ? "chaos" : "disenchantment")));
5976 fire_ball((chance == 1 ? GF_CHAOS : GF_DISENCHANT),
5978 o_ptr->timeout = randint0(200) + 200;
5984 chance = randint0(2);
5986 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5987 ((chance == 1 ? "¹ì²»" : "ÇËÊÒ")));
5989 msg_format("You breathe %s.",
5990 ((chance == 1 ? "sound" : "shards")));
5993 fire_ball((chance == 1 ? GF_SOUND : GF_SHARDS),
5995 o_ptr->timeout = randint0(200) + 200;
5999 case SV_DRAGON_BALANCE:
6001 chance = randint0(4);
6003 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿",
6004 ((chance == 1) ? "¥«¥ª¥¹" :
6005 ((chance == 2) ? "Îô²½" :
6006 ((chance == 3) ? "¹ì²»" : "ÇËÊÒ"))));
6008 msg_format("You breathe %s.",
6009 ((chance == 1) ? "chaos" :
6010 ((chance == 2) ? "disenchantment" :
6011 ((chance == 3) ? "sound" : "shards"))));
6014 fire_ball(((chance == 1) ? GF_CHAOS :
6015 ((chance == 2) ? GF_DISENCHANT :
6016 ((chance == 3) ? GF_SOUND : GF_SHARDS))),
6018 o_ptr->timeout = randint0(200) + 200;
6022 case SV_DRAGON_SHINING:
6024 chance = randint0(2);
6026 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
6027 ((chance == 0 ? "Á®¸÷" : "°Å¹õ")));
6029 msg_format("You breathe %s.",
6030 ((chance == 0 ? "light" : "darkness")));
6033 fire_ball((chance == 0 ? GF_LITE : GF_DARK), dir, 200, -2);
6034 o_ptr->timeout = randint0(200) + 200;
6038 case SV_DRAGON_POWER:
6041 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6043 msg_print("You breathe the elements.");
6046 fire_ball(GF_MISSILE, dir, 300, -3);
6047 o_ptr->timeout = randint0(200) + 200;
6053 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6059 else if (o_ptr->tval == TV_RING)
6063 bool success = TRUE;
6065 switch (o_ptr->name2)
6068 (void)set_afraid(0);
6069 (void)set_hero(randint1(25) + 25, FALSE);
6070 (void)hp_player(10);
6071 o_ptr->timeout = randint1(100)+100;
6073 case EGO_RING_MAGIC_MIS:
6074 if (!get_aim_dir(&dir)) return;
6075 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
6078 case EGO_RING_FIRE_BOLT:
6079 if (!get_aim_dir(&dir)) return;
6080 fire_bolt(GF_FIRE, dir, damroll(9, 8));
6081 o_ptr->timeout = randint0(8) + 8;
6083 case EGO_RING_COLD_BOLT:
6084 if (!get_aim_dir(&dir)) return;
6085 fire_bolt(GF_COLD, dir, damroll(6, 8));
6086 o_ptr->timeout = randint0(7) + 7;
6088 case EGO_RING_ELEC_BOLT:
6089 if (!get_aim_dir(&dir)) return;
6090 fire_bolt(GF_ELEC, dir, damroll(4, 8));
6091 o_ptr->timeout = randint0(5) + 5;
6093 case EGO_RING_ACID_BOLT:
6094 if (!get_aim_dir(&dir)) return;
6095 fire_bolt(GF_FIRE, dir, damroll(5, 8));
6096 o_ptr->timeout = randint0(6) + 6;
6098 case EGO_RING_MANA_BOLT:
6099 if (!get_aim_dir(&dir)) return;
6100 fire_bolt(GF_MANA, dir, 120);
6101 o_ptr->timeout = randint0(120)+120;
6103 case EGO_RING_FIRE_BALL:
6104 if (!get_aim_dir(&dir)) return;
6105 fire_ball(GF_FIRE, dir, 100, 2);
6106 o_ptr->timeout = randint0(80) + 80;
6108 case EGO_RING_COLD_BALL:
6109 if (!get_aim_dir(&dir)) return;
6110 fire_ball(GF_COLD, dir, 100, 2);
6111 o_ptr->timeout = randint0(80) + 80;
6113 case EGO_RING_ELEC_BALL:
6114 if (!get_aim_dir(&dir)) return;
6115 fire_ball(GF_ELEC, dir, 100, 2);
6116 o_ptr->timeout = randint0(80) + 80;
6118 case EGO_RING_ACID_BALL:
6119 if (!get_aim_dir(&dir)) return;
6120 fire_ball(GF_ACID, dir, 100, 2);
6121 o_ptr->timeout = randint0(80) + 80;
6123 case EGO_RING_MANA_BALL:
6124 if (!get_aim_dir(&dir)) return;
6125 fire_ball(GF_MANA, dir, 250, 2);
6126 o_ptr->timeout = 300;
6128 case EGO_RING_DRAGON_F:
6129 if (!get_aim_dir(&dir)) return;
6130 fire_ball(GF_FIRE, dir, 200, -2);
6131 if (o_ptr->sval == SV_RING_FLAMES)
6133 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6134 o_ptr->timeout = 200;
6136 else o_ptr->timeout = 250;
6138 case EGO_RING_DRAGON_C:
6139 if (!get_aim_dir(&dir)) return;
6140 fire_ball(GF_COLD, dir, 200, -2);
6141 if (o_ptr->sval == SV_RING_ICE)
6143 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6144 o_ptr->timeout = 200;
6146 else o_ptr->timeout = 250;
6148 case EGO_RING_M_DETECT:
6149 (void)detect_monsters_invis(255);
6150 (void)detect_monsters_normal(255);
6151 o_ptr->timeout = 150;
6153 case EGO_RING_D_SPEED:
6154 (void)set_fast(randint1(30) + 15, FALSE);
6155 o_ptr->timeout = 100;
6157 case EGO_RING_BERSERKER:
6158 (void)set_shero(randint1(25) + 25, FALSE);
6159 o_ptr->timeout = randint0(75)+75;
6161 case EGO_RING_TELE_AWAY:
6162 if (!get_aim_dir(&dir)) return;
6163 teleport_monster(dir);
6164 o_ptr->timeout = 150;
6168 int v = randint1(25)+25;
6169 (void)set_afraid(0);
6170 (void)set_hero(v, FALSE);
6171 (void)hp_player(10);
6172 (void)set_blessed(v, FALSE);
6173 (void)set_oppose_acid(v, FALSE);
6174 (void)set_oppose_elec(v, FALSE);
6175 (void)set_oppose_fire(v, FALSE);
6176 (void)set_oppose_cold(v, FALSE);
6177 (void)set_oppose_pois(v, FALSE);
6178 (void)set_ultimate_res(v, FALSE);
6179 o_ptr->timeout = 777;
6186 if (success) return;
6189 /* Get a direction for breathing (or abort) */
6190 if (!get_aim_dir(&dir)) return;
6192 switch (o_ptr->sval)
6196 fire_ball(GF_ACID, dir, 100, 2);
6197 (void)set_oppose_acid(randint1(20) + 20, FALSE);
6198 o_ptr->timeout = randint0(50) + 50;
6204 fire_ball(GF_COLD, dir, 100, 2);
6205 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6206 o_ptr->timeout = randint0(50) + 50;
6210 case SV_RING_FLAMES:
6212 fire_ball(GF_FIRE, dir, 100, 2);
6213 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6214 o_ptr->timeout = randint0(50) + 50;
6220 fire_ball(GF_ELEC, dir, 100, 2);
6221 (void)set_oppose_elec(randint1(20) + 20, FALSE);
6222 o_ptr->timeout = randint0(50) + 50;
6228 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6234 else if (o_ptr->tval == TV_AMULET)
6238 switch (o_ptr->name2)
6241 if (!ident_spell(FALSE)) return;
6242 o_ptr->timeout = 10;
6245 if (!get_aim_dir(&dir)) return;
6246 charm_monster(dir, MAX(20, p_ptr->lev));
6247 o_ptr->timeout = 200;
6250 teleport_player(10);
6251 o_ptr->timeout = randint0(10) + 10;
6253 case EGO_AMU_TELEPORT:
6254 teleport_player(100);
6255 o_ptr->timeout = randint0(50) + 50;
6257 case EGO_AMU_D_DOOR:
6258 (void)dimension_door();
6259 o_ptr->timeout = 200;
6261 case EGO_AMU_RES_FIRE_:
6262 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6263 o_ptr->timeout = randint0(50) + 50;
6265 case EGO_AMU_RES_COLD_:
6266 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6267 o_ptr->timeout = randint0(50) + 50;
6269 case EGO_AMU_RES_ELEC_:
6270 (void)set_oppose_elec(randint1(20) + 20, FALSE);
6271 o_ptr->timeout = randint0(50) + 50;
6273 case EGO_AMU_RES_ACID_:
6274 (void)set_oppose_acid(randint1(20) + 20, FALSE);
6275 o_ptr->timeout = randint0(50) + 50;
6277 case EGO_AMU_DETECTION:
6278 detect_all(DETECT_RAD_DEFAULT);
6279 o_ptr->timeout = randint0(55)+55;
6286 else if (o_ptr->tval == TV_WHISTLE)
6289 if (cursed_p(o_ptr))
6292 msg_print("¥«¥ó¹â¤¤²»¤¬¶Á¤ÅϤä¿¡£");
6294 msg_print("You produce a shrill whistling sound.");
6296 aggravate_monsters(0);
6306 /* Allocate the "who" array */
6307 C_MAKE(who, max_m_idx, u16b);
6309 /* Process the monsters (backwards) */
6310 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6312 if (is_pet(&m_list[pet_ctr]) && (p_ptr->riding != pet_ctr))
6313 who[max_pet++] = pet_ctr;
6316 /* Select the sort method */
6317 ang_sort_comp = ang_sort_comp_pet;
6318 ang_sort_swap = ang_sort_swap_hook;
6320 ang_sort(who, &dummy_why, max_pet);
6322 /* Process the monsters (backwards) */
6323 for (i = 0; i < max_pet; i++)
6326 teleport_monster_to(pet_ctr, py, px, 100);
6329 /* Free the "who" array */
6330 C_KILL(who, max_m_idx, u16b);
6332 o_ptr->timeout = 100+randint1(100);
6335 else if (o_ptr->tval == TV_CAPTURE)
6339 bool old_target_pet = target_pet;
6341 if (!get_aim_dir(&dir))
6343 target_pet = old_target_pet;
6346 target_pet = old_target_pet;
6348 if(fire_ball(GF_CAPTURE, dir, 0, 0))
6350 o_ptr->pval = cap_mon;
6351 o_ptr->xtra3 = cap_mspeed;
6352 o_ptr->xtra4 = cap_hp;
6353 o_ptr->xtra5 = cap_maxhp;
6360 if (o_ptr->inscription)
6361 strcpy(buf, quark_str(o_ptr->inscription));
6363 for (s = buf;*s && (*s != '#'); s++)
6366 if (iskanji(*s)) s++;
6376 t = quark_str(cap_nickname);
6389 o_ptr->inscription = quark_add(buf);
6395 bool success = FALSE;
6396 if (!get_rep_dir2(&dir)) return;
6397 if (cave_floor_bold(py+ddy[dir],px+ddx[dir]))
6399 if (place_monster_aux(0, py + ddy[dir], px + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
6401 if (o_ptr->xtra3) m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
6402 if (o_ptr->xtra5) m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
6403 if (o_ptr->xtra4) m_list[hack_m_idx_ii].hp = o_ptr->xtra4;
6404 m_list[hack_m_idx_ii].maxhp = m_list[hack_m_idx_ii].max_maxhp;
6405 if (o_ptr->inscription)
6413 t = quark_str(o_ptr->inscription);
6414 for (t = quark_str(o_ptr->inscription);*t && (*t != '#'); t++)
6417 if (iskanji(*t)) t++;
6442 if (quote && *(s-1) =='\'')
6446 m_list[hack_m_idx_ii].nickname = quark_add(buf);
6447 t = quark_str(o_ptr->inscription);
6449 while(*t && (*t != '#'))
6456 o_ptr->inscription = quark_add(buf);
6468 msg_print("¤ª¤Ã¤È¡¢²òÊü¤Ë¼ºÇÔ¤·¤¿¡£");
6470 msg_print("Oops. You failed to release your pet.");
6478 msg_print("¤ª¤Ã¤È¡¢¤³¤Î¥¢¥¤¥Æ¥à¤Ï»ÏÆ°¤Ç¤¤Ê¤¤¡£");
6480 msg_print("Oops. That object cannot be activated.");
6486 void do_cmd_activate(void)
6492 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6494 set_action(ACTION_NONE);
6497 item_tester_no_ryoute = TRUE;
6498 /* Prepare the hook */
6499 item_tester_hook = item_tester_hook_activate;
6503 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò»ÏÆ°¤µ¤»¤Þ¤¹¤«? ";
6504 s = "»ÏÆ°¤Ç¤¤ë¥¢¥¤¥Æ¥à¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£";
6506 q = "Activate which item? ";
6507 s = "You have nothing to activate.";
6510 if (!get_item(&item, q, s, (USE_EQUIP))) return;
6512 /* Activate the item */
6513 do_cmd_activate_aux(item);
6518 * Hook to determine if an object is useable
6520 static bool item_tester_hook_use(object_type *o_ptr)
6522 u32b flgs[TR_FLAG_SIZE];
6525 if (o_ptr->tval == p_ptr->tval_ammo)
6528 /* Useable object */
6529 switch (o_ptr->tval)
6547 if (!object_known_p(o_ptr)) return (FALSE);
6549 /* HACK - only items from the equipment can be activated */
6550 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
6552 if (&inventory[i] == o_ptr)
6554 /* Extract the flags */
6555 object_flags(o_ptr, flgs);
6557 /* Check activation flag */
6558 if (have_flag(flgs, TR_ACTIVATE)) return (TRUE);
6571 * XXX - Add actions for other item types
6573 void do_cmd_use(void)
6579 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6581 set_action(ACTION_NONE);
6584 item_tester_no_ryoute = TRUE;
6585 /* Prepare the hook */
6586 item_tester_hook = item_tester_hook_use;
6590 q = "¤É¤ì¤ò»È¤¤¤Þ¤¹¤«¡©";
6591 s = "»È¤¨¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤»¤ó¡£";
6593 q = "Use which item? ";
6594 s = "You have nothing to use.";
6597 if (!get_item(&item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR))) return;
6599 /* Get the item (in the pack) */
6602 o_ptr = &inventory[item];
6604 /* Get the item (on the floor) */
6607 o_ptr = &o_list[0 - item];
6610 switch (o_ptr->tval)
6622 do_cmd_eat_food_aux(item);
6629 do_cmd_aim_wand_aux(item);
6636 do_cmd_use_staff_aux(item);
6643 do_cmd_zap_rod_aux(item);
6647 /* Quaff a potion */
6650 do_cmd_quaff_potion_aux(item);
6657 /* Check some conditions */
6661 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡£");
6663 msg_print("You can't see anything.");
6671 msg_print("ÌÀ¤«¤ê¤¬¤Ê¤¤¤Î¤Ç¡¢°Å¤¯¤ÆÆɤá¤Ê¤¤¡£");
6673 msg_print("You have no light to read by.");
6678 if (p_ptr->confused)
6681 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
6683 msg_print("You are too confused!");
6689 do_cmd_read_scroll_aux(item, TRUE);
6698 do_cmd_fire_aux(item, &inventory[INVEN_BOW]);
6702 /* Activate an artifact */
6705 do_cmd_activate_aux(item);
6711 static int select_magic_eater(bool only_browse)
6715 bool flag, request_list;
6717 int ask = TRUE, i = 0;
6720 int menu_line = (use_menu ? 1 : 0);
6724 if (repeat_pull(&sn))
6726 /* Verify the spell */
6727 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))
6729 else if (sn < EATER_EXT*2 && !(p_ptr->magic_num1[sn] < EATER_CHARGE))
6733 #endif /* ALLOW_REPEAT */
6735 for (i = 0; i < 108; i++)
6737 if (p_ptr->magic_num2[i]) break;
6742 msg_print("ËâË¡¤ò³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6744 msg_print("You don't have any magic!");
6756 prt(format(" %s ¾ó", (menu_line == 1) ? "¡Õ" : " "), 2, 14);
6757 prt(format(" %s ËâË¡ËÀ", (menu_line == 2) ? "¡Õ" : " "), 3, 14);
6758 prt(format(" %s ¥í¥Ã¥É", (menu_line == 3) ? "¡Õ" : " "), 4, 14);
6759 prt("¤É¤Î¼ïÎà¤ÎËâË¡¤ò»È¤¤¤Þ¤¹¤«¡©", 0, 0);
6761 prt(format(" %s staff", (menu_line == 1) ? "> " : " "), 2, 14);
6762 prt(format(" %s wand", (menu_line == 2) ? "> " : " "), 3, 14);
6763 prt(format(" %s rod", (menu_line == 3) ? "> " : " "), 4, 14);
6764 prt("Which type of magic do you usu?", 0, 0);
6787 ext = (menu_line-1)*EATER_EXT;
6788 if (menu_line == 1) tval = TV_STAFF;
6789 else if (menu_line == 2) tval = TV_WAND;
6793 if (menu_line > 3) menu_line -= 3;
6802 if (!get_com("[A] ¾ó, [B] ËâË¡ËÀ, [C] ¥í¥Ã¥É:", &choice, TRUE))
6804 if (!get_com("[A] staff, [B] wand, [C] rod:", &choice, TRUE))
6809 if (choice == 'A' || choice == 'a')
6815 if (choice == 'B' || choice == 'b')
6821 if (choice == 'C' || choice == 'c')
6829 for (i = ext; i < ext + EATER_EXT; i++)
6831 if (p_ptr->magic_num2[i])
6833 if (use_menu) menu_line = i-ext+1;
6837 if (i == ext+EATER_EXT)
6840 msg_print("¤½¤Î¼ïÎà¤ÎËâË¡¤Ï³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6842 msg_print("You don't have that type of magic!");
6847 /* Nothing chosen yet */
6850 /* Build a prompt */
6852 (void) strnfmt(out_val, 78, "('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎËâÎϤò»È¤¤¤Þ¤¹¤«¡©");
6854 (void)strnfmt(out_val, 78, "(*=List, ESC=exit) Use which power? ");
6857 /* Save the screen */
6860 request_list = always_show_list;
6862 /* Get a spell from the user */
6866 if (request_list || use_menu)
6877 for (y = 1; y < 20; y++)
6882 /* Print header(s) */
6884 prt(format(" %s ¼ºÎ¨ %s ¼ºÎ¨", (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô"), (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô")), y++, x);
6886 prt(format(" %s Fail %s Fail", (tval == TV_ROD ? " Stat " : " Charges"), (tval == TV_ROD ? " Stat " : " Charges")), y++, x);
6890 for (ctr = 0; ctr < EATER_EXT; ctr++)
6892 if (!p_ptr->magic_num2[ctr+ext]) continue;
6894 k_idx = lookup_kind(tval, ctr);
6898 if (ctr == (menu_line-1))
6900 strcpy(dummy, "¡Õ");
6902 strcpy(dummy, "> ");
6904 else strcpy(dummy, " ");
6907 /* letter/number for power selection */
6914 letter = '0' + ctr - 26;
6915 sprintf(dummy, "%c)",letter);
6917 x1 = ((ctr < EATER_EXT/2) ? x : x + 40);
6918 y1 = ((ctr < EATER_EXT/2) ? y + ctr : y + ctr - EATER_EXT/2);
6919 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
6920 chance = level * 4 / 5 + 20;
6921 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
6923 if (p_ptr->lev > level)
6925 chance -= 3 * (p_ptr->lev - level);
6927 chance += p_ptr->to_m_chance;
6928 if (p_ptr->heavy_spell) chance += 20;
6929 if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
6930 else if (p_ptr->easy_spell) chance-=3;
6931 else if (p_ptr->dec_mana) chance-=2;
6932 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
6933 /* Stunning makes spells harder */
6934 if (p_ptr->stun > 50) chance += 25;
6935 else if (p_ptr->stun) chance += 15;
6937 if (chance > 95) chance = 95;
6939 if(p_ptr->dec_mana) chance--;
6940 if (p_ptr->heavy_spell) chance += 5;
6948 strcat(dummy, format(
6950 " %-22.22s ½¼Å¶:%2d/%2d%3d%%",
6952 " %-22.22s (%2d/%2d) %3d%%",
6954 k_name + k_info[k_idx].name,
6955 p_ptr->magic_num1[ctr+ext] ?
6956 (p_ptr->magic_num1[ctr+ext] - 1) / (EATER_ROD_CHARGE * k_info[k_idx].pval) +1 : 0,
6957 p_ptr->magic_num2[ctr+ext], chance));
6958 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;
6962 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));
6963 if (p_ptr->magic_num1[ctr+ext] < EATER_CHARGE) col = TERM_RED;
6968 c_prt(col, dummy, y1, x1);
6972 if (!get_com(out_val, &choice, FALSE)) break;
6974 if (use_menu && choice != ' ')
6990 menu_line += EATER_EXT - 1;
6991 if (menu_line > EATER_EXT) menu_line -= EATER_EXT;
6992 } while(!p_ptr->magic_num2[menu_line+ext-1]);
7003 if (menu_line > EATER_EXT) menu_line -= EATER_EXT;
7004 } while(!p_ptr->magic_num2[menu_line+ext-1]);
7015 bool reverse = FALSE;
7016 if ((choice == '4') || (choice == 'h') || (choice == 'H')) reverse = TRUE;
7017 if (menu_line > EATER_EXT/2)
7019 menu_line -= EATER_EXT/2;
7022 else menu_line+=EATER_EXT/2;
7023 while(!p_ptr->magic_num2[menu_line+ext-1])
7028 if (menu_line < 2) reverse = FALSE;
7033 if (menu_line > EATER_EXT-1) reverse = TRUE;
7050 /* Request redraw */
7051 if (use_menu && ask) continue;
7053 /* Request redraw */
7054 if (!use_menu && ((choice == ' ') || (choice == '*') || (choice == '?')))
7060 request_list = FALSE;
7062 /* Restore the screen */
7067 request_list = TRUE;
7075 if (isalpha(choice))
7078 ask = (isupper(choice));
7081 if (ask) choice = tolower(choice);
7083 /* Extract request */
7084 i = (islower(choice) ? A2I(choice) : -1);
7088 ask = FALSE; /* Can't uppercase digits */
7090 i = choice - '0' + 26;
7094 /* Totally Illegal */
7095 if ((i < 0) || (i > EATER_EXT) || !p_ptr->magic_num2[i+ext])
7110 (void) strnfmt(tmp_val, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", k_name + k_info[lookup_kind(tval ,i)].name);
7112 (void) strnfmt(tmp_val, 78, "Use %s?", k_name + k_info[lookup_kind(tval ,i)].name);
7115 /* Belay that order */
7116 if (!get_check(tmp_val)) continue;
7120 if (p_ptr->magic_num1[ext+i] > k_info[lookup_kind(tval, i)].pval * (p_ptr->magic_num2[ext+i] - 1) * EATER_ROD_CHARGE)
7123 msg_print("¤½¤ÎËâË¡¤Ï¤Þ¤À½¼Å¶¤·¤Æ¤¤¤ëºÇÃæ¤À¡£");
7125 msg_print("The magic are still charging.");
7128 if (use_menu) ask = TRUE;
7134 if (p_ptr->magic_num1[ext+i] < EATER_CHARGE)
7137 msg_print("¤½¤ÎËâË¡¤Ï»ÈÍѲó¿ô¤¬ÀÚ¤ì¤Æ¤¤¤ë¡£");
7139 msg_print("The magic has no charges left.");
7142 if (use_menu) ask = TRUE;
7154 /* Clear lines, position cursor (really should use strlen here) */
7155 Term_erase(7, 23, 255);
7156 Term_erase(7, 22, 255);
7157 Term_erase(7, 21, 255);
7158 Term_erase(7, 20, 255);
7160 roff_to_buf(k_text + k_info[lookup_kind(tval, i)].text, 62, temp, sizeof(temp));
7161 for (j = 0, line = 21; temp[j]; j += 1 + strlen(&temp[j]))
7163 prt(&temp[j], line, 10);
7168 prt("²¿¤«¥¡¼¤ò²¡¤·¤Æ²¼¤µ¤¤¡£",0,0);
7170 prt("Hit any key.",0,0);
7180 /* Restore the screen */
7183 if (!flag) return -1;
7187 #endif /* ALLOW_REPEAT */
7193 * Use eaten rod, wand or staff
7195 void do_cmd_magic_eater(bool only_browse)
7197 int item, chance, level, k_idx, tval, sval;
7198 bool use_charge = TRUE;
7200 /* Not when confused */
7201 if (!only_browse && p_ptr->confused)
7204 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
7206 msg_print("You are too confused!");
7212 item = select_magic_eater(only_browse);
7218 if (item >= EATER_EXT*2) {tval = TV_ROD;sval = item - EATER_EXT*2;}
7219 else if (item >= EATER_EXT) {tval = TV_WAND;sval = item - EATER_EXT;}
7220 else {tval = TV_STAFF;sval = item;}
7221 k_idx = lookup_kind(tval, sval);
7223 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
7224 chance = level * 4 / 5 + 20;
7225 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
7227 if (p_ptr->lev > level)
7229 chance -= 3 * (p_ptr->lev - level);
7231 chance += p_ptr->to_m_chance;
7232 if (p_ptr->heavy_spell) chance += 20;
7233 if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
7234 else if (p_ptr->easy_spell) chance-=3;
7235 else if (p_ptr->dec_mana) chance-=2;
7236 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
7237 /* Stunning makes spells harder */
7238 if (p_ptr->stun > 50) chance += 25;
7239 else if (p_ptr->stun) chance += 15;
7241 if (chance > 95) chance = 95;
7243 if(p_ptr->dec_mana) chance--;
7244 if (p_ptr->heavy_spell) chance += 5;
7246 if (randint0(100) < chance)
7248 if (flush_failure) flush();
7251 msg_print("¼öʸ¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª");
7253 msg_format("You failed to get the magic off!");
7257 if (randint1(100) >= chance)
7258 chg_virtue(V_CHANCE,-1);
7269 if ((sval >= SV_ROD_MIN_DIRECTION) && (sval != SV_ROD_HAVOC) && (sval != SV_ROD_AGGRAVATE) && (sval != SV_ROD_PESTICIDE))
7270 if (!get_aim_dir(&dir)) return;
7271 rod_effect(sval, dir, &use_charge, TRUE);
7272 if (!use_charge) return;
7274 else if (tval == TV_WAND)
7276 if (!get_aim_dir(&dir)) return;
7277 wand_effect(sval, dir, TRUE);
7281 staff_effect(sval, &use_charge, TRUE, TRUE);
7282 if (!use_charge) return;
7284 if (randint1(100) < chance)
7285 chg_virtue(V_CHANCE,1);
7288 if (tval == TV_ROD) p_ptr->magic_num1[item] += k_info[k_idx].pval * EATER_ROD_CHARGE;
7289 else p_ptr->magic_num1[item] -= EATER_CHARGE;