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 if (music_singing_any()) stop_singing();
63 if (hex_spelling_any()) stop_hex_spell_all();
65 /* Get the item (in the pack) */
68 o_ptr = &inventory[item];
71 /* Get the item (on the floor) */
74 o_ptr = &o_list[0 - item];
83 /* Identity not known yet */
87 lev = k_info[o_ptr->k_idx].level;
89 if (o_ptr->tval == TV_FOOD)
91 /* Analyze the food */
96 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
98 if (set_poisoned(p_ptr->poisoned + randint0(10) + 10))
106 case SV_FOOD_BLINDNESS:
108 if (!p_ptr->resist_blind)
110 if (set_blind(p_ptr->blind + randint0(200) + 200))
118 case SV_FOOD_PARANOIA:
120 if (!p_ptr->resist_fear)
122 if (set_afraid(p_ptr->afraid + randint0(10) + 10))
130 case SV_FOOD_CONFUSION:
132 if (!p_ptr->resist_conf)
134 if (set_confused(p_ptr->confused + randint0(10) + 10))
142 case SV_FOOD_HALLUCINATION:
144 if (!p_ptr->resist_chaos)
146 if (set_image(p_ptr->image + randint0(250) + 250))
154 case SV_FOOD_PARALYSIS:
156 if (!p_ptr->free_act)
158 if (set_paralyzed(p_ptr->paralyzed + randint0(10) + 10))
166 case SV_FOOD_WEAKNESS:
169 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "ÆÇÆþ¤ê¿©ÎÁ", -1);
171 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "poisonous food", -1);
174 (void)do_dec_stat(A_STR);
179 case SV_FOOD_SICKNESS:
182 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "ÆÇÆþ¤ê¿©ÎÁ", -1);
184 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "poisonous food", -1);
187 (void)do_dec_stat(A_CON);
192 case SV_FOOD_STUPIDITY:
195 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "ÆÇÆþ¤ê¿©ÎÁ", -1);
197 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "poisonous food", -1);
200 (void)do_dec_stat(A_INT);
205 case SV_FOOD_NAIVETY:
208 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "ÆÇÆþ¤ê¿©ÎÁ", -1);
210 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "poisonous food", -1);
213 (void)do_dec_stat(A_WIS);
218 case SV_FOOD_UNHEALTH:
221 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "ÆÇÆþ¤ê¿©ÎÁ", -1);
223 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "poisonous food", -1);
226 (void)do_dec_stat(A_CON);
231 case SV_FOOD_DISEASE:
234 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "ÆÇÆþ¤ê¿©ÎÁ", -1);
236 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "poisonous food", -1);
239 (void)do_dec_stat(A_STR);
244 case SV_FOOD_CURE_POISON:
246 if (set_poisoned(0)) ident = TRUE;
250 case SV_FOOD_CURE_BLINDNESS:
252 if (set_blind(0)) ident = TRUE;
256 case SV_FOOD_CURE_PARANOIA:
258 if (set_afraid(0)) ident = TRUE;
262 case SV_FOOD_CURE_CONFUSION:
264 if (set_confused(0)) ident = TRUE;
268 case SV_FOOD_CURE_SERIOUS:
270 if (hp_player(damroll(4, 8))) ident = TRUE;
274 case SV_FOOD_RESTORE_STR:
276 if (do_res_stat(A_STR)) ident = TRUE;
280 case SV_FOOD_RESTORE_CON:
282 if (do_res_stat(A_CON)) ident = TRUE;
286 case SV_FOOD_RESTORING:
288 if (do_res_stat(A_STR)) ident = TRUE;
289 if (do_res_stat(A_INT)) ident = TRUE;
290 if (do_res_stat(A_WIS)) ident = TRUE;
291 if (do_res_stat(A_DEX)) ident = TRUE;
292 if (do_res_stat(A_CON)) ident = TRUE;
293 if (do_res_stat(A_CHR)) ident = TRUE;
299 /* ¤½¤ì¤¾¤ì¤Î¿©¤Ùʪ¤Î´¶ÁÛ¤ò¥ª¥ê¥¸¥Ê¥ë¤è¤êºÙ¤«¤¯É½¸½ */
300 case SV_FOOD_BISCUIT:
302 msg_print("´Å¤¯¤Æ¥µ¥¯¥µ¥¯¤·¤Æ¤È¤Æ¤â¤ª¤¤¤·¤¤¡£");
309 msg_print("»õ¤´¤¿¤¨¤¬¤¢¤Ã¤Æ¤ª¤¤¤·¤¤¡£");
314 case SV_FOOD_SLIME_MOLD:
316 msg_print("¤³¤ì¤Ï¤Ê¤ó¤È¤â·ÁÍƤ·¤¬¤¿¤¤Ì£¤À¡£");
323 msg_print("¤³¤ì¤Ï¤ª¤¤¤·¤¤¡£");
329 case SV_FOOD_BISCUIT:
331 case SV_FOOD_SLIME_MOLD:
333 msg_print("That tastes good.");
340 case SV_FOOD_WAYBREAD:
343 msg_print("¤³¤ì¤Ï¤Ò¤¸¤ç¤¦¤ËÈþÌ£¤À¡£");
345 msg_print("That tastes good.");
348 (void)set_poisoned(0);
349 (void)hp_player(damroll(4, 8));
355 case SV_FOOD_PINT_OF_ALE:
357 msg_print("¤Î¤É¤´¤·Á֤䤫¤À¡£");
362 case SV_FOOD_PINT_OF_WINE:
364 msg_print("That tastes good.");
369 case SV_FOOD_PINT_OF_ALE:
370 case SV_FOOD_PINT_OF_WINE:
372 msg_print("That tastes good.");
381 /* Combine / Reorder the pack (later) */
382 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
384 if (!(object_is_aware(o_ptr)))
386 chg_virtue(V_KNOWLEDGE, -1);
387 chg_virtue(V_PATIENCE, -1);
388 chg_virtue(V_CHANCE, 1);
391 /* We have tried it */
392 if (o_ptr->tval == TV_FOOD) object_tried(o_ptr);
394 /* The player is now aware of the object */
395 if (ident && !object_is_aware(o_ptr))
398 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
402 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
405 /* Food can feed the player */
406 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
408 /* Reduced nutritional benefit */
409 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
411 msg_print("¤¢¤Ê¤¿¤Î¤è¤¦¤Ê¼Ô¤Ë¤È¤Ã¤Æ¿©ÎȤʤɶϤ«¤Ê±ÉÍܤˤ·¤«¤Ê¤é¤Ê¤¤¡£");
413 msg_print("Mere victuals hold scant sustenance for a being such as yourself.");
416 if (p_ptr->food < PY_FOOD_ALERT) /* Hungry */
418 msg_print("¤¢¤Ê¤¿¤Îµ²¤¨¤Ï¿·Á¯¤Ê·ì¤Ë¤è¤Ã¤Æ¤Î¤ßËþ¤¿¤µ¤ì¤ë¡ª");
420 msg_print("Your hunger can only be satisfied with fresh blood!");
424 else if ((prace_is_(RACE_SKELETON) ||
425 prace_is_(RACE_GOLEM) ||
426 prace_is_(RACE_ZOMBIE) ||
427 prace_is_(RACE_SPECTRE)) &&
428 (o_ptr->tval == TV_STAFF || o_ptr->tval == TV_WAND))
432 if (o_ptr->tval == TV_STAFF &&
433 (item < 0) && (o_ptr->number > 1))
436 msg_print("¤Þ¤º¤Ï¾ó¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
438 msg_print("You must first pick up the staffs.");
444 staff = (o_ptr->tval == TV_STAFF) ? "¾ó" : "ËâË¡ËÀ";
446 staff = (o_ptr->tval == TV_STAFF) ? "staff" : "wand";
450 if (o_ptr->pval == 0)
453 msg_format("¤³¤Î%s¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£", staff);
455 msg_format("The %s has no charges left.", staff);
458 o_ptr->ident |= (IDENT_EMPTY);
460 /* Combine / Reorder the pack (later) */
461 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
462 p_ptr->window |= (PW_INVEN);
468 msg_format("¤¢¤Ê¤¿¤Ï%s¤ÎËâÎϤò¥¨¥Í¥ë¥®¡¼¸»¤È¤·¤ÆµÛ¼ý¤·¤¿¡£", staff);
470 msg_format("You absorb mana of the %s as your energy.", staff);
473 /* Use a single charge */
477 set_food(p_ptr->food + 5000);
479 /* XXX Hack -- unstack if necessary */
480 if (o_ptr->tval == TV_STAFF &&
481 (item >= 0) && (o_ptr->number > 1))
486 /* Get local object */
489 /* Obtain a local object */
490 object_copy(q_ptr, o_ptr);
492 /* Modify quantity */
495 /* Restore the charges */
498 /* Unstack the used item */
500 p_ptr->total_weight -= q_ptr->weight;
501 item = inven_carry(q_ptr);
505 msg_format("¾ó¤ò¤Þ¤È¤á¤Ê¤ª¤·¤¿¡£");
507 msg_print("You unstack your staff.");
511 /* Describe charges in the pack */
514 inven_item_charges(item);
517 /* Describe charges on the floor */
520 floor_item_charges(0 - item);
524 p_ptr->window |= (PW_INVEN | PW_EQUIP);
526 /* Don't eat a staff/wand itself */
529 else if ((prace_is_(RACE_DEMON) ||
530 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON)) &&
531 (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_CORPSE &&
532 my_strchr("pht", r_info[o_ptr->pval].d_char)))
534 /* Drain vitality of humanoids */
535 char o_name[MAX_NLEN];
537 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
540 msg_format("%s¤Ïdz¤¨¾å¤ê³¥¤Ë¤Ê¤Ã¤¿¡£ÀºÎϤòµÛ¼ý¤·¤¿µ¤¤¬¤¹¤ë¡£", o_name);
542 msg_format("%^s is burnt to ashes. You absorb its vitality!", o_name);
544 (void)set_food(PY_FOOD_MAX - 1);
546 else if (prace_is_(RACE_SKELETON))
549 if (o_ptr->tval == TV_SKELETON ||
550 (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))
553 msg_print("¤¢¤Ê¤¿¤Ï¹ü¤Ç¼«Ê¬¤ÎÂΤòÊä¤Ã¤¿¡£");
555 msg_print("Your body absorbs the bone.");
557 set_food(p_ptr->food + 5000);
562 if (!((o_ptr->sval == SV_FOOD_WAYBREAD) ||
563 (o_ptr->sval < SV_FOOD_BISCUIT)))
566 object_type *q_ptr = &forge;
569 msg_print("¿©¤Ùʪ¤¬¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¤¿¡ª");
571 msg_print("The food falls through your jaws!");
575 /* Create the item */
576 object_prep(q_ptr, lookup_kind(o_ptr->tval, o_ptr->sval));
578 /* Drop the object from heaven */
579 (void)drop_near(q_ptr, -1, py, px);
584 msg_print("¿©¤Ùʪ¤¬¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¡¢¾Ã¤¨¤¿¡ª");
586 msg_print("The food falls through your jaws and vanishes!");
591 else if (prace_is_(RACE_GOLEM) ||
592 prace_is_(RACE_ZOMBIE) ||
593 prace_is_(RACE_ENT) ||
594 prace_is_(RACE_DEMON) ||
595 prace_is_(RACE_ANDROID) ||
596 prace_is_(RACE_SPECTRE) ||
597 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
600 msg_print("À¸¼Ô¤Î¿©Êª¤Ï¤¢¤Ê¤¿¤Ë¤È¤Ã¤Æ¤Û¤È¤ó¤É±ÉÍܤˤʤé¤Ê¤¤¡£");
602 msg_print("The food of mortals is poor sustenance for you.");
605 set_food(p_ptr->food + ((o_ptr->pval) / 20));
607 else if (o_ptr->tval == TV_FOOD && o_ptr->sval == SV_FOOD_WAYBREAD)
609 /* Waybread is always fully satisfying. */
610 set_food(MAX(p_ptr->food, PY_FOOD_MAX - 1));
614 /* Food can feed the player */
615 (void)set_food(p_ptr->food + o_ptr->pval);
618 /* Destroy a food in the pack */
621 inven_item_increase(item, -1);
622 inven_item_describe(item);
623 inven_item_optimize(item);
626 /* Destroy a food on the floor */
629 floor_item_increase(0 - item, -1);
630 floor_item_describe(0 - item);
631 floor_item_optimize(0 - item);
637 * Hook to determine if an object is eatable
639 static bool item_tester_hook_eatable(object_type *o_ptr)
641 if (o_ptr->tval==TV_FOOD) return TRUE;
644 if (prace_is_(RACE_SKELETON))
646 if (o_ptr->tval == TV_SKELETON ||
647 (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))
653 if (prace_is_(RACE_SKELETON) ||
654 prace_is_(RACE_GOLEM) ||
655 prace_is_(RACE_ZOMBIE) ||
656 prace_is_(RACE_SPECTRE))
658 if (o_ptr->tval == TV_STAFF || o_ptr->tval == TV_WAND)
661 else if (prace_is_(RACE_DEMON) ||
662 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON))
664 if (o_ptr->tval == TV_CORPSE &&
665 o_ptr->sval == SV_CORPSE &&
666 my_strchr("pht", r_info[o_ptr->pval].d_char))
676 * Eat some food (from the pack or floor)
678 void do_cmd_eat_food(void)
684 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
686 set_action(ACTION_NONE);
689 /* Restrict choices to food */
690 item_tester_hook = item_tester_hook_eatable;
694 q = "¤É¤ì¤ò¿©¤Ù¤Þ¤¹¤«? ";
695 s = "¿©¤Ùʪ¤¬¤Ê¤¤¡£";
697 q = "Eat which item? ";
698 s = "You have nothing to eat.";
701 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
704 do_cmd_eat_food_aux(item);
709 * Quaff a potion (from the pack or the floor)
711 static void do_cmd_quaff_potion_aux(int item)
724 if (flush_failure) flush();
726 msg_print("ÉÓ¤«¤é¿å¤¬Î®¤ì½Ð¤Æ¤³¤Ê¤¤¡ª");
728 msg_print("The potion doesn't flow out from a bottle.");
735 if (music_singing_any()) stop_singing();
736 if (hex_spelling_any())
738 if (!hex_spelling(HEX_INHAIL)) stop_hex_spell_all();
741 /* Get the item (in the pack) */
744 o_ptr = &inventory[item];
747 /* Get the item (on the floor) */
750 o_ptr = &o_list[0 - item];
753 /* Get local object */
756 /* Obtain a local object */
757 object_copy(q_ptr, o_ptr);
762 /* Reduce and describe inventory */
765 inven_item_increase(item, -1);
766 inven_item_describe(item);
767 inven_item_optimize(item);
770 /* Reduce and describe floor item */
773 floor_item_increase(0 - item, -1);
774 floor_item_describe(0 - item);
775 floor_item_optimize(0 - item);
782 /* Not identified yet */
786 lev = k_info[q_ptr->k_idx].level;
788 /* Analyze the potion */
789 if (q_ptr->tval == TV_POTION)
794 /* °û¤ß¤´¤¿¤¨¤ò¥ª¥ê¥¸¥Ê¥ë¤è¤êºÙ¤«¤¯É½¸½ */
795 case SV_POTION_WATER:
796 msg_print("¸ý¤ÎÃ椬¤µ¤Ã¤Ñ¤ê¤·¤¿¡£");
797 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
801 case SV_POTION_APPLE_JUICE:
802 msg_print("´Å¤¯¤Æ¥µ¥Ã¥Ñ¥ê¤È¤·¤Æ¤¤¤Æ¡¢¤È¤Æ¤â¤ª¤¤¤·¤¤¡£");
803 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
807 case SV_POTION_SLIME_MOLD:
808 msg_print("¤Ê¤ó¤È¤âÉÔµ¤Ì£¤ÊÌ£¤À¡£");
809 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
814 case SV_POTION_WATER:
815 case SV_POTION_APPLE_JUICE:
816 case SV_POTION_SLIME_MOLD:
817 msg_print("You feel less thirsty.");
822 case SV_POTION_SLOWNESS:
823 if (set_slow(randint1(25) + 15, FALSE)) ident = TRUE;
826 case SV_POTION_SALT_WATER:
828 msg_print("¤¦¤§¡ª»×¤ï¤ºÅǤ¤¤Æ¤·¤Þ¤Ã¤¿¡£");
830 msg_print("The potion makes you vomit!");
833 if (!(prace_is_(RACE_GOLEM) ||
834 prace_is_(RACE_ZOMBIE) ||
835 prace_is_(RACE_DEMON) ||
836 prace_is_(RACE_ANDROID) ||
837 prace_is_(RACE_SPECTRE) ||
838 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING)))
840 /* Only living creatures get thirsty */
841 (void)set_food(PY_FOOD_STARVE - 1);
844 (void)set_poisoned(0);
845 (void)set_paralyzed(p_ptr->paralyzed + 4);
849 case SV_POTION_POISON:
850 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
852 if (set_poisoned(p_ptr->poisoned + randint0(15) + 10))
859 case SV_POTION_BLINDNESS:
860 if (!p_ptr->resist_blind)
862 if (set_blind(p_ptr->blind + randint0(100) + 100))
869 case SV_POTION_CONFUSION: /* Booze */
870 if (p_ptr->pclass != CLASS_MONK) chg_virtue(V_HARMONY, -1);
871 else if (!p_ptr->resist_conf) p_ptr->special_attack |= ATTACK_SUIKEN;
872 if (!p_ptr->resist_conf)
874 if (set_confused(randint0(20) + 15))
880 if (!p_ptr->resist_chaos)
884 if (set_image(p_ptr->image + randint0(150) + 150))
889 if (one_in_(13) && (p_ptr->pclass != CLASS_MONK))
892 if (one_in_(3)) lose_all_info();
894 (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
897 msg_print("ÃΤé¤Ê¤¤¾ì½ê¤ÇÌܤ¬Àä᤿¡£Æ¬Äˤ¬¤¹¤ë¡£");
898 msg_print("²¿¤â»×¤¤½Ð¤»¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ØÍ褿¤Î¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
900 msg_print("You wake up somewhere with a sore head...");
901 msg_print("You can't remember a thing, or how you got here!");
908 case SV_POTION_SLEEP:
909 if (!p_ptr->free_act)
912 msg_print("¤¢¤Ê¤¿¤Ï̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
914 msg_print("You fall asleep.");
918 if (ironman_nightmare)
921 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
923 msg_print("A horrible vision enters your mind.");
927 /* Pick a nightmare */
928 get_mon_num_prep(get_nightmare, NULL);
930 /* Have some nightmares */
931 have_nightmare(get_mon_num(MAX_DEPTH));
933 /* Remove the monster restriction */
934 get_mon_num_prep(NULL, NULL);
936 if (set_paralyzed(p_ptr->paralyzed + randint0(4) + 4))
943 case SV_POTION_LOSE_MEMORIES:
944 if (!p_ptr->hold_life && (p_ptr->exp > 0))
947 msg_print("²áµî¤Îµ²±¤¬Çö¤ì¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
949 msg_print("You feel your memories fade.");
951 chg_virtue(V_KNOWLEDGE, -5);
953 lose_exp(p_ptr->exp / 4);
958 case SV_POTION_RUINATION:
960 msg_print("¿È¤â¿´¤â¼å¤Ã¤Æ¤¤Æ¡¢Àºµ¤¤¬È´¤±¤Æ¤¤¤¯¤è¤¦¤À¡£");
961 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), "ÇËÌǤÎÌô", -1);
963 msg_print("Your nerves and muscles feel weak and lifeless!");
964 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), "a potion of Ruination", -1);
967 (void)dec_stat(A_DEX, 25, TRUE);
968 (void)dec_stat(A_WIS, 25, TRUE);
969 (void)dec_stat(A_CON, 25, TRUE);
970 (void)dec_stat(A_STR, 25, TRUE);
971 (void)dec_stat(A_CHR, 25, TRUE);
972 (void)dec_stat(A_INT, 25, TRUE);
976 case SV_POTION_DEC_STR:
977 if (do_dec_stat(A_STR)) ident = TRUE;
980 case SV_POTION_DEC_INT:
981 if (do_dec_stat(A_INT)) ident = TRUE;
984 case SV_POTION_DEC_WIS:
985 if (do_dec_stat(A_WIS)) ident = TRUE;
988 case SV_POTION_DEC_DEX:
989 if (do_dec_stat(A_DEX)) ident = TRUE;
992 case SV_POTION_DEC_CON:
993 if (do_dec_stat(A_CON)) ident = TRUE;
996 case SV_POTION_DEC_CHR:
997 if (do_dec_stat(A_CHR)) ident = TRUE;
1000 case SV_POTION_DETONATIONS:
1002 msg_print("ÂΤÎÃæ¤Ç·ã¤·¤¤Çúȯ¤¬µ¯¤¤¿¡ª");
1003 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), "Çúȯ¤ÎÌô", -1);
1005 msg_print("Massive explosions rupture your body!");
1006 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), "a potion of Detonation", -1);
1009 (void)set_stun(p_ptr->stun + 75);
1010 (void)set_cut(p_ptr->cut + 5000);
1014 case SV_POTION_DEATH:
1015 chg_virtue(V_VITALITY, -1);
1016 chg_virtue(V_UNLIFE, 5);
1018 msg_print("»à¤Îͽ´¶¤¬ÂÎÃæ¤ò¶î¤±¤á¤°¤Ã¤¿¡£");
1019 take_hit(DAMAGE_LOSELIFE, 5000, "»à¤ÎÌô", -1);
1021 msg_print("A feeling of Death flows through your body.");
1022 take_hit(DAMAGE_LOSELIFE, 5000, "a potion of Death", -1);
1028 case SV_POTION_INFRAVISION:
1029 if (set_tim_infra(p_ptr->tim_infra + 100 + randint1(100), FALSE))
1035 case SV_POTION_DETECT_INVIS:
1036 if (set_tim_invis(p_ptr->tim_invis + 12 + randint1(12), FALSE))
1042 case SV_POTION_SLOW_POISON:
1043 if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
1046 case SV_POTION_CURE_POISON:
1047 if (set_poisoned(0)) ident = TRUE;
1050 case SV_POTION_BOLDNESS:
1051 if (set_afraid(0)) ident = TRUE;
1054 case SV_POTION_SPEED:
1057 if (set_fast(randint1(25) + 15, FALSE)) ident = TRUE;
1061 (void)set_fast(p_ptr->fast + 5, FALSE);
1065 case SV_POTION_RESIST_HEAT:
1066 if (set_oppose_fire(p_ptr->oppose_fire + randint1(10) + 10, FALSE))
1072 case SV_POTION_RESIST_COLD:
1073 if (set_oppose_cold(p_ptr->oppose_cold + randint1(10) + 10, FALSE))
1079 case SV_POTION_HEROISM:
1080 if (set_afraid(0)) ident = TRUE;
1081 if (set_hero(p_ptr->hero + randint1(25) + 25, FALSE)) ident = TRUE;
1082 if (hp_player(10)) ident = TRUE;
1085 case SV_POTION_BESERK_STRENGTH:
1086 if (set_afraid(0)) ident = TRUE;
1087 if (set_shero(p_ptr->shero + randint1(25) + 25, FALSE)) ident = TRUE;
1088 if (hp_player(30)) ident = TRUE;
1091 case SV_POTION_CURE_LIGHT:
1092 if (hp_player(damroll(2, 8))) ident = TRUE;
1093 if (set_blind(0)) ident = TRUE;
1094 if (set_cut(p_ptr->cut - 10)) ident = TRUE;
1095 if (set_shero(0,TRUE)) ident = TRUE;
1098 case SV_POTION_CURE_SERIOUS:
1099 if (hp_player(damroll(4, 8))) ident = TRUE;
1100 if (set_blind(0)) ident = TRUE;
1101 if (set_confused(0)) ident = TRUE;
1102 if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;
1103 if (set_shero(0,TRUE)) ident = TRUE;
1106 case SV_POTION_CURE_CRITICAL:
1107 if (hp_player(damroll(6, 8))) ident = TRUE;
1108 if (set_blind(0)) ident = TRUE;
1109 if (set_confused(0)) ident = TRUE;
1110 if (set_poisoned(0)) ident = TRUE;
1111 if (set_stun(0)) ident = TRUE;
1112 if (set_cut(0)) ident = TRUE;
1113 if (set_shero(0,TRUE)) ident = TRUE;
1116 case SV_POTION_HEALING:
1117 if (hp_player(300)) ident = TRUE;
1118 if (set_blind(0)) ident = TRUE;
1119 if (set_confused(0)) ident = TRUE;
1120 if (set_poisoned(0)) ident = TRUE;
1121 if (set_stun(0)) ident = TRUE;
1122 if (set_cut(0)) ident = TRUE;
1123 if (set_shero(0,TRUE)) ident = TRUE;
1126 case SV_POTION_STAR_HEALING:
1127 if (hp_player(1200)) ident = TRUE;
1128 if (set_blind(0)) ident = TRUE;
1129 if (set_confused(0)) ident = TRUE;
1130 if (set_poisoned(0)) ident = TRUE;
1131 if (set_stun(0)) ident = TRUE;
1132 if (set_cut(0)) ident = TRUE;
1133 if (set_shero(0,TRUE)) ident = TRUE;
1136 case SV_POTION_LIFE:
1137 chg_virtue(V_VITALITY, 1);
1138 chg_virtue(V_UNLIFE, -5);
1140 msg_print("ÂÎÃæ¤ËÀ¸Ì¿ÎϤ¬Ëþ¤Á¤¢¤Õ¤ì¤Æ¤¤¿¡ª");
1142 msg_print("You feel life flow through your body!");
1146 (void)set_poisoned(0);
1148 (void)set_confused(0);
1152 (void)do_res_stat(A_STR);
1153 (void)do_res_stat(A_CON);
1154 (void)do_res_stat(A_DEX);
1155 (void)do_res_stat(A_WIS);
1156 (void)do_res_stat(A_INT);
1157 (void)do_res_stat(A_CHR);
1158 (void)set_shero(0,TRUE);
1164 case SV_POTION_RESTORE_MANA:
1165 if (p_ptr->pclass == CLASS_MAGIC_EATER)
1168 for (i = 0; i < EATER_EXT*2; i++)
1170 p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i]*EATER_CHARGE/3;
1171 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;
1173 for (; i < EATER_EXT*3; i++)
1175 int k_idx = lookup_kind(TV_ROD, i-EATER_EXT*2);
1176 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;
1177 if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
1180 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
1182 msg_print("You feel your head clear.");
1184 p_ptr->window |= (PW_PLAYER);
1187 else if (p_ptr->csp < p_ptr->msp)
1189 p_ptr->csp = p_ptr->msp;
1190 p_ptr->csp_frac = 0;
1192 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
1194 msg_print("You feel your head clear.");
1197 p_ptr->redraw |= (PR_MANA);
1198 p_ptr->window |= (PW_PLAYER);
1199 p_ptr->window |= (PW_SPELL);
1202 if (set_shero(0,TRUE)) ident = TRUE;
1205 case SV_POTION_RESTORE_EXP:
1206 if (restore_level()) ident = TRUE;
1209 case SV_POTION_RES_STR:
1210 if (do_res_stat(A_STR)) ident = TRUE;
1213 case SV_POTION_RES_INT:
1214 if (do_res_stat(A_INT)) ident = TRUE;
1217 case SV_POTION_RES_WIS:
1218 if (do_res_stat(A_WIS)) ident = TRUE;
1221 case SV_POTION_RES_DEX:
1222 if (do_res_stat(A_DEX)) ident = TRUE;
1225 case SV_POTION_RES_CON:
1226 if (do_res_stat(A_CON)) ident = TRUE;
1229 case SV_POTION_RES_CHR:
1230 if (do_res_stat(A_CHR)) ident = TRUE;
1233 case SV_POTION_INC_STR:
1234 if (do_inc_stat(A_STR)) ident = TRUE;
1237 case SV_POTION_INC_INT:
1238 if (do_inc_stat(A_INT)) ident = TRUE;
1241 case SV_POTION_INC_WIS:
1242 if (do_inc_stat(A_WIS)) ident = TRUE;
1245 case SV_POTION_INC_DEX:
1246 if (do_inc_stat(A_DEX)) ident = TRUE;
1249 case SV_POTION_INC_CON:
1250 if (do_inc_stat(A_CON)) ident = TRUE;
1253 case SV_POTION_INC_CHR:
1254 if (do_inc_stat(A_CHR)) ident = TRUE;
1257 case SV_POTION_AUGMENTATION:
1258 if (do_inc_stat(A_STR)) ident = TRUE;
1259 if (do_inc_stat(A_INT)) ident = TRUE;
1260 if (do_inc_stat(A_WIS)) ident = TRUE;
1261 if (do_inc_stat(A_DEX)) ident = TRUE;
1262 if (do_inc_stat(A_CON)) ident = TRUE;
1263 if (do_inc_stat(A_CHR)) ident = TRUE;
1266 case SV_POTION_ENLIGHTENMENT:
1268 msg_print("¼«Ê¬¤ÎÃÖ¤«¤ì¤Æ¤¤¤ë¾õ¶·¤¬Ç¾Î¢¤ËÉ⤫¤ó¤Ç¤¤¿...");
1270 msg_print("An image of your surroundings forms in your mind...");
1273 chg_virtue(V_KNOWLEDGE, 1);
1274 chg_virtue(V_ENLIGHTEN, 1);
1279 case SV_POTION_STAR_ENLIGHTENMENT:
1281 msg_print("¹¹¤Ê¤ë·¼Ìؤò´¶¤¸¤¿...");
1283 msg_print("You begin to feel more enlightened...");
1286 chg_virtue(V_KNOWLEDGE, 1);
1287 chg_virtue(V_ENLIGHTEN, 2);
1290 (void)do_inc_stat(A_INT);
1291 (void)do_inc_stat(A_WIS);
1292 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1293 (void)detect_doors(DETECT_RAD_DEFAULT);
1294 (void)detect_stairs(DETECT_RAD_DEFAULT);
1295 (void)detect_treasure(DETECT_RAD_DEFAULT);
1296 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
1297 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
1303 case SV_POTION_SELF_KNOWLEDGE:
1305 msg_print("¼«Ê¬¼«¿È¤Î¤³¤È¤¬¾¯¤·¤Ïʬ¤«¤Ã¤¿µ¤¤¬¤¹¤ë...");
1307 msg_print("You begin to know yourself a little better...");
1315 case SV_POTION_EXPERIENCE:
1316 if (p_ptr->prace == RACE_ANDROID) break;
1317 chg_virtue(V_ENLIGHTEN, 1);
1318 if (p_ptr->exp < PY_MAX_EXP)
1320 s32b ee = (p_ptr->exp / 2) + 10;
1321 if (ee > 100000L) ee = 100000L;
1323 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1325 msg_print("You feel more experienced.");
1333 case SV_POTION_RESISTANCE:
1334 (void)set_oppose_acid(p_ptr->oppose_acid + randint1(20) + 20, FALSE);
1335 (void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
1336 (void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
1337 (void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
1338 (void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
1342 case SV_POTION_CURING:
1343 if (hp_player(50)) ident = TRUE;
1344 if (set_blind(0)) ident = TRUE;
1345 if (set_poisoned(0)) ident = TRUE;
1346 if (set_confused(0)) ident = TRUE;
1347 if (set_stun(0)) ident = TRUE;
1348 if (set_cut(0)) ident = TRUE;
1349 if (set_image(0)) ident = TRUE;
1352 case SV_POTION_INVULNERABILITY:
1353 (void)set_invuln(p_ptr->invuln + randint1(4) + 4, FALSE);
1357 case SV_POTION_NEW_LIFE:
1358 do_cmd_rerate(FALSE);
1360 p_ptr->update |= PU_BONUS;
1361 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
1363 chg_virtue(V_CHANCE, -5);
1365 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
1367 msg_print("You are cured of all mutations.");
1370 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
1371 p_ptr->update |= PU_BONUS;
1373 mutant_regenerate_mod = calc_mutant_regenerate_mod();
1378 case SV_POTION_NEO_TSUYOSHI:
1380 (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
1384 case SV_POTION_TSUYOSHI:
1386 msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
1388 msg_print("Brother OKURE!");
1391 p_ptr->tsuyoshi = 1;
1392 (void)set_tsuyoshi(0, TRUE);
1393 if (!p_ptr->resist_chaos)
1395 (void)set_image(50 + randint1(50));
1400 case SV_POTION_POLYMORPH:
1401 if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23))
1403 chg_virtue(V_CHANCE, -5);
1405 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
1407 msg_print("You are cured of all mutations.");
1410 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
1411 p_ptr->update |= PU_BONUS;
1420 if(gain_random_mutation(0)) ident = TRUE;
1422 else if (lose_mutation(0)) ident = TRUE;
1423 } while(!ident || one_in_(2));
1429 if (prace_is_(RACE_SKELETON))
1432 msg_print("±ÕÂΤΰìÉô¤Ï¤¢¤Ê¤¿¤Î¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¤¿¡ª");
1434 msg_print("Some of the fluid falls through your jaws!");
1437 (void)potion_smash_effect(0, py, px, q_ptr->k_idx);
1440 /* Combine / Reorder the pack (later) */
1441 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1443 if (!(object_is_aware(q_ptr)))
1445 chg_virtue(V_PATIENCE, -1);
1446 chg_virtue(V_CHANCE, 1);
1447 chg_virtue(V_KNOWLEDGE, -1);
1450 /* The item has been tried */
1451 object_tried(q_ptr);
1453 /* An identification was made */
1454 if (ident && !object_is_aware(q_ptr))
1456 object_aware(q_ptr);
1457 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
1461 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
1463 /* Potions can feed the player */
1464 switch (p_ptr->mimic_form)
1467 switch (p_ptr->prace)
1470 (void)set_food(p_ptr->food + (q_ptr->pval / 10));
1479 set_food(p_ptr->food + ((q_ptr->pval) / 20));
1482 if (q_ptr->tval == TV_FLASK)
1485 msg_print("¥ª¥¤¥ë¤òÊäµë¤·¤¿¡£");
1487 msg_print("You replenish yourself with the oil.");
1489 set_food(p_ptr->food + 5000);
1493 set_food(p_ptr->food + ((q_ptr->pval) / 20));
1498 msg_print("¿åʬ¤ò¼è¤ê¹þ¤ó¤À¡£");
1500 msg_print("You are moistened.");
1502 set_food(MIN(p_ptr->food + q_ptr->pval + MAX(0, q_ptr->pval * 10) + 2000, PY_FOOD_MAX - 1));
1505 (void)set_food(p_ptr->food + q_ptr->pval);
1510 case MIMIC_DEMON_LORD:
1511 set_food(p_ptr->food + ((q_ptr->pval) / 20));
1514 (void)set_food(p_ptr->food + (q_ptr->pval / 10));
1517 (void)set_food(p_ptr->food + q_ptr->pval);
1524 * Hook to determine if an object can be quaffed
1526 static bool item_tester_hook_quaff(object_type *o_ptr)
1528 if (o_ptr->tval == TV_POTION) return TRUE;
1530 if (prace_is_(RACE_ANDROID))
1532 if (o_ptr->tval == TV_FLASK && o_ptr->sval == SV_FLASK_OIL)
1541 * Quaff some potion (from the pack or floor)
1543 void do_cmd_quaff_potion(void)
1548 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
1550 set_action(ACTION_NONE);
1553 /* Restrict choices to potions */
1554 item_tester_hook = item_tester_hook_quaff;
1558 q = "¤É¤ÎÌô¤ò°û¤ß¤Þ¤¹¤«? ";
1559 s = "°û¤á¤ëÌô¤¬¤Ê¤¤¡£";
1561 q = "Quaff which potion? ";
1562 s = "You have no potions to quaff.";
1565 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1567 /* Quaff the potion */
1568 do_cmd_quaff_potion_aux(item);
1573 * Read a scroll (from the pack or floor).
1575 * Certain scrolls can be "aborted" without losing the scroll. These
1576 * include scrolls with no effects but recharge or identify, which are
1577 * cancelled before use. XXX Reading them still takes a turn, though.
1579 static void do_cmd_read_scroll_aux(int item, bool known)
1581 int k, used_up, ident, lev;
1586 /* Get the item (in the pack) */
1589 o_ptr = &inventory[item];
1592 /* Get the item (on the floor) */
1595 o_ptr = &o_list[0 - item];
1604 if (flush_failure) flush();
1606 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
1608 msg_print("Nothing happen.");
1615 if (p_ptr->pclass == CLASS_BERSERKER)
1618 msg_print("´¬Êª¤Ê¤ó¤ÆÆɤá¤Ê¤¤¡£");
1620 msg_print("You cannot read.");
1625 if (music_singing_any()) stop_singing();
1628 if (hex_spelling_any() && ((p_ptr->lev < 35) || hex_spell_fully())) stop_hex_spell_all();
1630 /* Not identified yet */
1634 lev = k_info[o_ptr->k_idx].level;
1636 /* Assume the scroll will get used up */
1639 if (o_ptr->tval == TV_SCROLL)
1641 /* Analyze the scroll */
1642 switch (o_ptr->sval)
1644 case SV_SCROLL_DARKNESS:
1646 if (!(p_ptr->resist_blind) && !(p_ptr->resist_dark))
1648 (void)set_blind(p_ptr->blind + 3 + randint1(5));
1650 if (unlite_area(10, 3)) ident = TRUE;
1654 case SV_SCROLL_AGGRAVATE_MONSTER:
1657 msg_print("¥«¥ó¹â¤¯¤¦¤Ê¤ëÍͤʲ»¤¬ÊÕ¤ê¤òʤ¤Ã¤¿¡£");
1659 msg_print("There is a high pitched humming noise.");
1662 aggravate_monsters(0);
1667 case SV_SCROLL_CURSE_ARMOR:
1669 if (curse_armor()) ident = TRUE;
1673 case SV_SCROLL_CURSE_WEAPON:
1676 if (buki_motteruka(INVEN_RARM))
1679 if (buki_motteruka(INVEN_LARM) && one_in_(2)) k = INVEN_LARM;
1681 else if (buki_motteruka(INVEN_LARM)) k = INVEN_LARM;
1682 if (k && curse_weapon(FALSE, k)) ident = TRUE;
1686 case SV_SCROLL_SUMMON_MONSTER:
1688 for (k = 0; k < randint1(3); k++)
1690 if (summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
1698 case SV_SCROLL_SUMMON_UNDEAD:
1700 for (k = 0; k < randint1(3); k++)
1702 if (summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
1710 case SV_SCROLL_SUMMON_PET:
1712 if (summon_specific(-1, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_FORCE_PET)))
1719 case SV_SCROLL_SUMMON_KIN:
1721 if (summon_kin_player(p_ptr->lev, py, px, (PM_FORCE_PET | PM_ALLOW_GROUP)))
1728 case SV_SCROLL_TRAP_CREATION:
1730 if (trap_creation(py, px)) ident = TRUE;
1734 case SV_SCROLL_PHASE_DOOR:
1736 teleport_player(10, 0L);
1741 case SV_SCROLL_TELEPORT:
1743 teleport_player(100, 0L);
1748 case SV_SCROLL_TELEPORT_LEVEL:
1750 (void)teleport_level(0);
1755 case SV_SCROLL_WORD_OF_RECALL:
1757 if (!word_of_recall()) used_up = FALSE;
1762 case SV_SCROLL_IDENTIFY:
1764 if (!ident_spell(FALSE)) used_up = FALSE;
1769 case SV_SCROLL_STAR_IDENTIFY:
1771 if (!identify_fully(FALSE)) used_up = FALSE;
1776 case SV_SCROLL_REMOVE_CURSE:
1781 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1783 msg_print("You feel as if someone is watching over you.");
1791 case SV_SCROLL_STAR_REMOVE_CURSE:
1793 if (remove_all_curse())
1796 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1798 msg_print("You feel as if someone is watching over you.");
1805 case SV_SCROLL_ENCHANT_ARMOR:
1808 if (!enchant_spell(0, 0, 1)) used_up = FALSE;
1812 case SV_SCROLL_ENCHANT_WEAPON_TO_HIT:
1814 if (!enchant_spell(1, 0, 0)) used_up = FALSE;
1819 case SV_SCROLL_ENCHANT_WEAPON_TO_DAM:
1821 if (!enchant_spell(0, 1, 0)) used_up = FALSE;
1826 case SV_SCROLL_STAR_ENCHANT_ARMOR:
1828 if (!enchant_spell(0, 0, randint1(3) + 2)) used_up = FALSE;
1833 case SV_SCROLL_STAR_ENCHANT_WEAPON:
1835 if (!enchant_spell(randint1(3), randint1(3), 0)) used_up = FALSE;
1840 case SV_SCROLL_RECHARGING:
1842 if (!recharge(130)) used_up = FALSE;
1847 case SV_SCROLL_MUNDANITY:
1850 if (!mundane_spell(FALSE)) used_up = FALSE;
1854 case SV_SCROLL_LIGHT:
1856 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
1860 case SV_SCROLL_MAPPING:
1862 map_area(DETECT_RAD_MAP);
1867 case SV_SCROLL_DETECT_GOLD:
1869 if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
1870 if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
1874 case SV_SCROLL_DETECT_ITEM:
1876 if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
1880 case SV_SCROLL_DETECT_TRAP:
1882 if (detect_traps(DETECT_RAD_DEFAULT, known)) ident = TRUE;
1886 case SV_SCROLL_DETECT_DOOR:
1888 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
1889 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
1893 case SV_SCROLL_DETECT_INVIS:
1895 if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
1899 case SV_SCROLL_SATISFY_HUNGER:
1901 if (set_food(PY_FOOD_MAX - 1)) ident = TRUE;
1905 case SV_SCROLL_BLESSING:
1907 if (set_blessed(p_ptr->blessed + randint1(12) + 6, FALSE)) ident = TRUE;
1911 case SV_SCROLL_HOLY_CHANT:
1913 if (set_blessed(p_ptr->blessed + randint1(24) + 12, FALSE)) ident = TRUE;
1917 case SV_SCROLL_HOLY_PRAYER:
1919 if (set_blessed(p_ptr->blessed + randint1(48) + 24, FALSE)) ident = TRUE;
1923 case SV_SCROLL_MONSTER_CONFUSION:
1925 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1928 msg_print("¼ê¤¬µ±¤»Ï¤á¤¿¡£");
1930 msg_print("Your hands begin to glow.");
1933 p_ptr->special_attack |= ATTACK_CONFUSE;
1934 p_ptr->redraw |= (PR_STATUS);
1940 case SV_SCROLL_PROTECTION_FROM_EVIL:
1943 if (set_protevil(p_ptr->protevil + randint1(25) + k, FALSE)) ident = TRUE;
1947 case SV_SCROLL_RUNE_OF_PROTECTION:
1954 case SV_SCROLL_TRAP_DOOR_DESTRUCTION:
1956 if (destroy_doors_touch()) ident = TRUE;
1960 case SV_SCROLL_STAR_DESTRUCTION:
1962 if (destroy_area(py, px, 13 + randint0(5), FALSE))
1966 msg_print("¥À¥ó¥¸¥ç¥ó¤¬Íɤ줿...");
1968 msg_print("The dungeon trembles...");
1975 case SV_SCROLL_DISPEL_UNDEAD:
1977 if (dispel_undead(80)) ident = TRUE;
1981 case SV_SCROLL_SPELL:
1983 if ((p_ptr->pclass == CLASS_WARRIOR) ||
1984 (p_ptr->pclass == CLASS_IMITATOR) ||
1985 (p_ptr->pclass == CLASS_MINDCRAFTER) ||
1986 (p_ptr->pclass == CLASS_SORCERER) ||
1987 (p_ptr->pclass == CLASS_ARCHER) ||
1988 (p_ptr->pclass == CLASS_MAGIC_EATER) ||
1989 (p_ptr->pclass == CLASS_RED_MAGE) ||
1990 (p_ptr->pclass == CLASS_SAMURAI) ||
1991 (p_ptr->pclass == CLASS_BLUE_MAGE) ||
1992 (p_ptr->pclass == CLASS_CAVALRY) ||
1993 (p_ptr->pclass == CLASS_BERSERKER) ||
1994 (p_ptr->pclass == CLASS_SMITH) ||
1995 (p_ptr->pclass == CLASS_MIRROR_MASTER) ||
1996 (p_ptr->pclass == CLASS_NINJA) ||
1997 (p_ptr->pclass == CLASS_SNIPER)) break;
1998 p_ptr->add_spells++;
1999 p_ptr->update |= (PU_SPELLS);
2004 case SV_SCROLL_GENOCIDE:
2006 (void)symbol_genocide(300, TRUE);
2011 case SV_SCROLL_MASS_GENOCIDE:
2013 (void)mass_genocide(300, TRUE);
2018 case SV_SCROLL_ACQUIREMENT:
2020 acquirement(py, px, 1, TRUE, FALSE);
2025 case SV_SCROLL_STAR_ACQUIREMENT:
2027 acquirement(py, px, randint1(2) + 1, TRUE, FALSE);
2032 /* New Hengband scrolls */
2033 case SV_SCROLL_FIRE:
2035 fire_ball(GF_FIRE, 0, 666, 4);
2036 /* Note: "Double" damage since it is centered on the player ... */
2037 if (!(IS_OPPOSE_FIRE() || p_ptr->resist_fire || p_ptr->immune_fire))
2039 take_hit(DAMAGE_NOESCAPE, 50+randint1(50), "±ê¤Î´¬Êª", -1);
2041 take_hit(DAMAGE_NOESCAPE, 50 + randint1(50), "a Scroll of Fire", -1);
2051 fire_ball(GF_ICE, 0, 777, 4);
2052 if (!(IS_OPPOSE_COLD() || p_ptr->resist_cold || p_ptr->immune_cold))
2054 take_hit(DAMAGE_NOESCAPE, 100+randint1(100), "ɹ¤Î´¬Êª", -1);
2056 take_hit(DAMAGE_NOESCAPE, 100 + randint1(100), "a Scroll of Ice", -1);
2063 case SV_SCROLL_CHAOS:
2065 fire_ball(GF_CHAOS, 0, 1000, 4);
2066 if (!p_ptr->resist_chaos)
2068 take_hit(DAMAGE_NOESCAPE, 111+randint1(111), "¥í¥°¥ë¥¹¤Î´¬Êª", -1);
2070 take_hit(DAMAGE_NOESCAPE, 111 + randint1(111), "a Scroll of Logrus", -1);
2077 case SV_SCROLL_RUMOR:
2081 switch (randint1(20))
2085 err = get_rnd_line("chainswd_j.txt", 0, Rumor);
2087 err = get_rnd_line("chainswd.txt", 0, Rumor);
2093 err = get_rnd_line("error_j.txt", 0, Rumor);
2095 err = get_rnd_line("error.txt", 0, Rumor);
2103 err = get_rnd_line("death_j.txt", 0, Rumor);
2105 err = get_rnd_line("death.txt", 0, Rumor);
2111 err = get_rnd_line_jonly("rumors_j.txt", 0, Rumor, 10);
2113 err = get_rnd_line("rumors.txt", 0, Rumor);
2119 /* An error occured */
2121 if (err) strcpy(Rumor, "±³¤Î±½¤â¤¢¤ë¡£");
2123 if (err) strcpy(Rumor, "Some rumors are wrong.");
2128 msg_print("´¬Êª¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤¬½ñ¤«¤ì¤Æ¤¤¤ë:");
2130 msg_print("There is message on the scroll. It says:");
2134 msg_format("%s", Rumor);
2137 msg_print("´¬Êª¤Ï±ì¤òΩ¤Æ¤Æ¾Ã¤¨µî¤Ã¤¿¡ª");
2139 msg_print("The scroll disappears in a puff of smoke!");
2146 case SV_SCROLL_ARTIFACT:
2149 if (!artifact_scroll()) used_up = FALSE;
2153 case SV_SCROLL_RESET_RECALL:
2156 if (!reset_recall()) used_up = FALSE;
2161 else if (o_ptr->name1 == ART_GHB)
2164 msg_print("»ä¤Ï¶ìÏ«¤·¤Æ¡Ø¥°¥ì¡¼¥¿¡¼¡¦¥Ø¥ë=¥Ó¡¼¥¹¥È¡Ù¤òÅݤ·¤¿¡£");
2165 msg_print("¤·¤«¤·¼ê¤ËÆþ¤Ã¤¿¤Î¤Ï¤³¤Î¤¤¿¤Ê¤¤£Ô¥·¥ã¥Ä¤À¤±¤À¤Ã¤¿¡£");
2167 msg_print("I had a very hard time to kill the Greater hell-beast, ");
2168 msg_print("but all I got was this lousy t-shirt!");
2172 else if (o_ptr->name1 == ART_POWER)
2175 msg_print("¡Ö°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤òÅý¤Ù¡¢");
2177 msg_print("°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤ò¸«¤Ä¤±¡¢");
2179 msg_print("°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤òÊá¤é¤¨¤Æ");
2181 msg_print("°Å°Ç¤ÎÃæ¤Ë·Ò¤®¤È¤á¤ë¡£¡×");
2183 msg_print("'One Ring to rule them all, ");
2185 msg_print("One Ring to find them, ");
2187 msg_print("One Ring to bring them all ");
2189 msg_print("and in the darkness bind them.'");
2193 else if (o_ptr->tval==TV_PARCHMENT)
2196 char o_name[MAX_NLEN];
2202 q=format("book-%d_jp.txt",o_ptr->sval);
2204 /* Display object description */
2205 object_desc(o_name, o_ptr, OD_NAME_ONLY);
2207 /* Build the filename */
2208 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, q);
2210 /* Peruse the help file */
2211 (void)show_file(TRUE, buf, o_name, 0, 0);
2220 /* Combine / Reorder the pack (later) */
2221 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2223 if (!(object_is_aware(o_ptr)))
2225 chg_virtue(V_PATIENCE, -1);
2226 chg_virtue(V_CHANCE, 1);
2227 chg_virtue(V_KNOWLEDGE, -1);
2230 /* The item was tried */
2231 object_tried(o_ptr);
2233 /* An identification was made */
2234 if (ident && !object_is_aware(o_ptr))
2236 object_aware(o_ptr);
2237 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
2241 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
2244 /* Hack -- allow certain scrolls to be "preserved" */
2250 sound(SOUND_SCROLL);
2252 /* Destroy a scroll in the pack */
2255 inven_item_increase(item, -1);
2256 inven_item_describe(item);
2257 inven_item_optimize(item);
2260 /* Destroy a scroll on the floor */
2263 floor_item_increase(0 - item, -1);
2264 floor_item_describe(0 - item);
2265 floor_item_optimize(0 - item);
2271 * Hook to determine if an object is readable
2273 static bool item_tester_hook_readable(object_type *o_ptr)
2275 if ((o_ptr->tval==TV_SCROLL) || (o_ptr->tval==TV_PARCHMENT) || (o_ptr->name1 == ART_GHB) || (o_ptr->name1 == ART_POWER)) return (TRUE);
2282 void do_cmd_read_scroll(void)
2288 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
2290 set_action(ACTION_NONE);
2293 /* Check some conditions */
2297 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡£");
2299 msg_print("You can't see anything.");
2307 msg_print("ÌÀ¤«¤ê¤¬¤Ê¤¤¤Î¤Ç¡¢°Å¤¯¤ÆÆɤá¤Ê¤¤¡£");
2309 msg_print("You have no light to read by.");
2314 if (p_ptr->confused)
2317 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡£");
2319 msg_print("You are too confused!");
2326 /* Restrict choices to scrolls */
2327 item_tester_hook = item_tester_hook_readable;
2331 q = "¤É¤Î´¬Êª¤òÆɤߤޤ¹¤«? ";
2332 s = "Æɤá¤ë´¬Êª¤¬¤Ê¤¤¡£";
2334 q = "Read which scroll? ";
2335 s = "You have no scrolls to read.";
2338 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
2340 /* Get the item (in the pack) */
2343 o_ptr = &inventory[item];
2346 /* Get the item (on the floor) */
2349 o_ptr = &o_list[0 - item];
2352 /* Read the scroll */
2353 do_cmd_read_scroll_aux(item, object_is_aware(o_ptr));
2357 static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
2362 /* Analyze the staff */
2365 case SV_STAFF_DARKNESS:
2367 if (!(p_ptr->resist_blind) && !(p_ptr->resist_dark))
2369 if (set_blind(p_ptr->blind + 3 + randint1(5))) ident = TRUE;
2371 if (unlite_area(10, 3)) ident = TRUE;
2375 case SV_STAFF_SLOWNESS:
2377 if (set_slow(p_ptr->slow + randint1(30) + 15, FALSE)) ident = TRUE;
2381 case SV_STAFF_HASTE_MONSTERS:
2383 if (speed_monsters()) ident = TRUE;
2387 case SV_STAFF_SUMMONING:
2389 for (k = 0; k < randint1(4); k++)
2391 if (summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
2399 case SV_STAFF_TELEPORTATION:
2401 teleport_player(100, 0L);
2406 case SV_STAFF_IDENTIFY:
2408 if (!ident_spell(FALSE)) *use_charge = FALSE;
2413 case SV_STAFF_REMOVE_CURSE:
2420 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2422 msg_print("You feel as if someone is watching over you.");
2425 else if (!p_ptr->blind)
2428 msg_print("¾ó¤Ï°ì½Ö¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
2430 msg_print("The staff glows blue for a moment...");
2439 case SV_STAFF_STARLITE:
2441 int num = damroll(5, 3);
2445 if (!p_ptr->blind && !magic)
2448 msg_print("¾ó¤ÎÀ褬ÌÀ¤ë¤¯µ±¤¤¤¿...");
2450 msg_print("The end of the staff glows brightly...");
2454 for (k = 0; k < num; k++)
2460 scatter(&y, &x, py, px, 4, 0);
2462 if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
2464 if (!player_bold(y, x)) break;
2467 project(0, 0, y, x, damroll(6 + p_ptr->lev / 8, 10), GF_LITE_WEAK,
2468 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL), -1);
2476 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
2480 case SV_STAFF_MAPPING:
2482 map_area(DETECT_RAD_MAP);
2487 case SV_STAFF_DETECT_GOLD:
2489 if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
2490 if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
2494 case SV_STAFF_DETECT_ITEM:
2496 if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
2500 case SV_STAFF_DETECT_TRAP:
2502 if (detect_traps(DETECT_RAD_DEFAULT, known)) ident = TRUE;
2506 case SV_STAFF_DETECT_DOOR:
2508 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
2509 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
2513 case SV_STAFF_DETECT_INVIS:
2515 if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
2519 case SV_STAFF_DETECT_EVIL:
2521 if (detect_monsters_evil(DETECT_RAD_DEFAULT)) ident = TRUE;
2525 case SV_STAFF_CURE_LIGHT:
2527 if (hp_player(damroll(2, 8))) ident = TRUE;
2528 if (set_shero(0,TRUE)) ident = TRUE;
2532 case SV_STAFF_CURING:
2534 if (set_blind(0)) ident = TRUE;
2535 if (set_poisoned(0)) ident = TRUE;
2536 if (set_confused(0)) ident = TRUE;
2537 if (set_stun(0)) ident = TRUE;
2538 if (set_cut(0)) ident = TRUE;
2539 if (set_image(0)) ident = TRUE;
2540 if (set_shero(0,TRUE)) ident = TRUE;
2544 case SV_STAFF_HEALING:
2546 if (hp_player(300)) ident = TRUE;
2547 if (set_stun(0)) ident = TRUE;
2548 if (set_cut(0)) ident = TRUE;
2549 if (set_shero(0,TRUE)) ident = TRUE;
2553 case SV_STAFF_THE_MAGI:
2555 if (do_res_stat(A_INT)) ident = TRUE;
2556 if (p_ptr->csp < p_ptr->msp)
2558 p_ptr->csp = p_ptr->msp;
2559 p_ptr->csp_frac = 0;
2562 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
2564 msg_print("You feel your head clear.");
2567 p_ptr->redraw |= (PR_MANA);
2568 p_ptr->window |= (PW_PLAYER);
2569 p_ptr->window |= (PW_SPELL);
2571 if (set_shero(0,TRUE)) ident = TRUE;
2575 case SV_STAFF_SLEEP_MONSTERS:
2577 if (sleep_monsters()) ident = TRUE;
2581 case SV_STAFF_SLOW_MONSTERS:
2583 if (slow_monsters()) ident = TRUE;
2587 case SV_STAFF_SPEED:
2589 if (set_fast(randint1(30) + 15, FALSE)) ident = TRUE;
2593 case SV_STAFF_PROBING:
2600 case SV_STAFF_DISPEL_EVIL:
2602 if (dispel_evil(80)) ident = TRUE;
2606 case SV_STAFF_POWER:
2608 if (dispel_monsters(150)) ident = TRUE;
2612 case SV_STAFF_HOLINESS:
2614 if (dispel_evil(150)) ident = TRUE;
2616 if (set_protevil((magic ? 0 : p_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
2617 if (set_poisoned(0)) ident = TRUE;
2618 if (set_afraid(0)) ident = TRUE;
2619 if (hp_player(50)) ident = TRUE;
2620 if (set_stun(0)) ident = TRUE;
2621 if (set_cut(0)) ident = TRUE;
2625 case SV_STAFF_GENOCIDE:
2627 (void)symbol_genocide((magic ? p_ptr->lev + 50 : 200), TRUE);
2632 case SV_STAFF_EARTHQUAKES:
2634 if (earthquake(py, px, 10))
2638 msg_print("¥À¥ó¥¸¥ç¥ó¤¬Íɤ줿¡£");
2640 msg_print("The dungeon trembles.");
2647 case SV_STAFF_DESTRUCTION:
2649 if (destroy_area(py, px, 13 + randint0(5), FALSE))
2655 case SV_STAFF_ANIMATE_DEAD:
2657 if (animate_dead(0, py, px))
2663 case SV_STAFF_MSTORM:
2666 msg_print("¶¯ÎϤÊËâÎϤ¬Å¨¤ò°ú¤Îö¤¤¤¿¡ª");
2668 msg_print("Mighty magics rend your enemies!");
2670 project(0, 5, py, px,
2671 (randint1(200) + 300) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
2672 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))
2675 (void)take_hit(DAMAGE_NOESCAPE, 50, "¥³¥ó¥È¥í¡¼¥ë¤·Æñ¤¤¶¯ÎϤÊËâÎϤβòÊü", -1);
2677 (void)take_hit(DAMAGE_NOESCAPE, 50, "unleashing magics too mighty to control", -1);
2685 case SV_STAFF_NOTHING:
2688 msg_print("²¿¤âµ¯¤é¤Ê¤«¤Ã¤¿¡£");
2690 msg_print("Nothing happen.");
2692 if (prace_is_(RACE_SKELETON) || prace_is_(RACE_GOLEM) ||
2693 prace_is_(RACE_ZOMBIE) || prace_is_(RACE_SPECTRE))
2695 msg_print("¤â¤Ã¤¿¤¤¤Ê¤¤»ö¤ò¤·¤¿¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£¿©¤Ùʪ¤ÏÂçÀڤˤ·¤Ê¤¯¤Æ¤Ï¡£");
2697 msg_print("What a waste. It's your food!");
2706 * Use a staff. -RAK-
2708 * One charge of one staff disappears.
2710 * Hack -- staffs of identify can be "cancelled".
2712 static void do_cmd_use_staff_aux(int item)
2714 int ident, chance, lev;
2718 /* Hack -- let staffs of identify get aborted */
2719 bool use_charge = TRUE;
2722 /* Get the item (in the pack) */
2725 o_ptr = &inventory[item];
2728 /* Get the item (on the floor) */
2731 o_ptr = &o_list[0 - item];
2735 /* Mega-Hack -- refuse to use a pile from the ground */
2736 if ((item < 0) && (o_ptr->number > 1))
2739 msg_print("¤Þ¤º¤Ï¾ó¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
2741 msg_print("You must first pick up the staffs.");
2751 /* Extract the item level */
2752 lev = k_info[o_ptr->k_idx].level;
2753 if (lev > 50) lev = 50 + (lev - 50)/2;
2755 /* Base chance of success */
2756 chance = p_ptr->skill_dev;
2758 /* Confusion hurts skill */
2759 if (p_ptr->confused) chance = chance / 2;
2761 /* Hight level objects are harder */
2762 chance = chance - lev;
2764 /* Give everyone a (slight) chance */
2765 if ((chance < USE_DEVICE) && one_in_(USE_DEVICE - chance + 1))
2767 chance = USE_DEVICE;
2772 if (flush_failure) flush();
2774 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
2776 msg_print("Nothing happen. Maybe this staff is freezing too.");
2783 /* Roll for usage */
2784 if ((chance < USE_DEVICE) || (randint1(chance) < USE_DEVICE) || (p_ptr->pclass == CLASS_BERSERKER))
2786 if (flush_failure) flush();
2788 msg_print("¾ó¤ò¤¦¤Þ¤¯»È¤¨¤Ê¤«¤Ã¤¿¡£");
2790 msg_print("You failed to use the staff properly.");
2797 /* Notice empty staffs */
2798 if (o_ptr->pval <= 0)
2800 if (flush_failure) flush();
2802 msg_print("¤³¤Î¾ó¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£");
2804 msg_print("The staff has no charges left.");
2807 o_ptr->ident |= (IDENT_EMPTY);
2809 /* Combine / Reorder the pack (later) */
2810 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2811 p_ptr->window |= (PW_INVEN);
2820 ident = staff_effect(o_ptr->sval, &use_charge, FALSE, object_is_aware(o_ptr));
2822 if (!(object_is_aware(o_ptr)))
2824 chg_virtue(V_PATIENCE, -1);
2825 chg_virtue(V_CHANCE, 1);
2826 chg_virtue(V_KNOWLEDGE, -1);
2829 /* Combine / Reorder the pack (later) */
2830 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2832 /* Tried the item */
2833 object_tried(o_ptr);
2835 /* An identification was made */
2836 if (ident && !object_is_aware(o_ptr))
2838 object_aware(o_ptr);
2839 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
2843 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
2846 /* Hack -- some uses are "free" */
2847 if (!use_charge) return;
2850 /* Use a single charge */
2853 /* XXX Hack -- unstack if necessary */
2854 if ((item >= 0) && (o_ptr->number > 1))
2859 /* Get local object */
2862 /* Obtain a local object */
2863 object_copy(q_ptr, o_ptr);
2865 /* Modify quantity */
2868 /* Restore the charges */
2871 /* Unstack the used item */
2873 p_ptr->total_weight -= q_ptr->weight;
2874 item = inven_carry(q_ptr);
2878 msg_print("¾ó¤ò¤Þ¤È¤á¤Ê¤ª¤·¤¿¡£");
2880 msg_print("You unstack your staff.");
2885 /* Describe charges in the pack */
2888 inven_item_charges(item);
2891 /* Describe charges on the floor */
2894 floor_item_charges(0 - item);
2899 void do_cmd_use_staff(void)
2904 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
2906 set_action(ACTION_NONE);
2909 /* Restrict choices to wands */
2910 item_tester_tval = TV_STAFF;
2914 q = "¤É¤Î¾ó¤ò»È¤¤¤Þ¤¹¤«? ";
2915 s = "»È¤¨¤ë¾ó¤¬¤Ê¤¤¡£";
2917 q = "Use which staff? ";
2918 s = "You have no staff to use.";
2921 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
2923 do_cmd_use_staff_aux(item);
2927 static int wand_effect(int sval, int dir, bool magic)
2931 /* XXX Hack -- Wand of wonder can do anything before it */
2932 if (sval == SV_WAND_WONDER)
2934 int vir = virtue_number(V_CHANCE);
2935 sval = randint0(SV_WAND_WONDER);
2939 if (p_ptr->virtues[vir - 1] > 0)
2941 while (randint1(300) < p_ptr->virtues[vir - 1]) sval++;
2942 if (sval > SV_WAND_COLD_BALL) sval = randint0(4) + SV_WAND_ACID_BALL;
2946 while (randint1(300) < (0-p_ptr->virtues[vir - 1])) sval--;
2947 if (sval < SV_WAND_HEAL_MONSTER) sval = randint0(3) + SV_WAND_HEAL_MONSTER;
2950 if (sval < SV_WAND_TELEPORT_AWAY)
2951 chg_virtue(V_CHANCE, 1);
2954 /* Analyze the wand */
2957 case SV_WAND_HEAL_MONSTER:
2959 if (heal_monster(dir, damroll(10, 10))) ident = TRUE;
2963 case SV_WAND_HASTE_MONSTER:
2965 if (speed_monster(dir)) ident = TRUE;
2969 case SV_WAND_CLONE_MONSTER:
2971 if (clone_monster(dir)) ident = TRUE;
2975 case SV_WAND_TELEPORT_AWAY:
2977 if (teleport_monster(dir)) ident = TRUE;
2981 case SV_WAND_DISARMING:
2983 if (disarm_trap(dir)) ident = TRUE;
2987 case SV_WAND_TRAP_DOOR_DEST:
2989 if (destroy_door(dir)) ident = TRUE;
2993 case SV_WAND_STONE_TO_MUD:
2995 if (wall_to_mud(dir)) ident = TRUE;
3002 msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3004 msg_print("A line of blue shimmering light appears.");
3007 (void)lite_line(dir);
3012 case SV_WAND_SLEEP_MONSTER:
3014 if (sleep_monster(dir)) ident = TRUE;
3018 case SV_WAND_SLOW_MONSTER:
3020 if (slow_monster(dir)) ident = TRUE;
3024 case SV_WAND_CONFUSE_MONSTER:
3026 if (confuse_monster(dir, p_ptr->lev)) ident = TRUE;
3030 case SV_WAND_FEAR_MONSTER:
3032 if (fear_monster(dir, p_ptr->lev)) ident = TRUE;
3036 case SV_WAND_DRAIN_LIFE:
3038 if (drain_life(dir, 80 + p_ptr->lev)) ident = TRUE;
3042 case SV_WAND_POLYMORPH:
3044 if (poly_monster(dir)) ident = TRUE;
3048 case SV_WAND_STINKING_CLOUD:
3050 fire_ball(GF_POIS, dir, 12 + p_ptr->lev / 4, 2);
3055 case SV_WAND_MAGIC_MISSILE:
3057 fire_bolt_or_beam(20, GF_MISSILE, dir, damroll(2 + p_ptr->lev / 10, 6));
3062 case SV_WAND_ACID_BOLT:
3064 fire_bolt_or_beam(20, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
3069 case SV_WAND_CHARM_MONSTER:
3071 if (charm_monster(dir, MAX(20, p_ptr->lev)))
3076 case SV_WAND_FIRE_BOLT:
3078 fire_bolt_or_beam(20, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
3083 case SV_WAND_COLD_BOLT:
3085 fire_bolt_or_beam(20, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
3090 case SV_WAND_ACID_BALL:
3092 fire_ball(GF_ACID, dir, 60 + 3 * p_ptr->lev / 4, 2);
3097 case SV_WAND_ELEC_BALL:
3099 fire_ball(GF_ELEC, dir, 40 + 3 * p_ptr->lev / 4, 2);
3104 case SV_WAND_FIRE_BALL:
3106 fire_ball(GF_FIRE, dir, 70 + 3 * p_ptr->lev / 4, 2);
3111 case SV_WAND_COLD_BALL:
3113 fire_ball(GF_COLD, dir, 50 + 3 * p_ptr->lev / 4, 2);
3118 case SV_WAND_WONDER:
3121 msg_print("¤ª¤Ã¤È¡¢Ææ¤ÎËâË¡ËÀ¤ò»ÏÆ°¤µ¤»¤¿¡£");
3123 msg_print("Oops. Wand of wonder activated.");
3129 case SV_WAND_DRAGON_FIRE:
3131 fire_ball(GF_FIRE, dir, 200, -3);
3136 case SV_WAND_DRAGON_COLD:
3138 fire_ball(GF_COLD, dir, 180, -3);
3143 case SV_WAND_DRAGON_BREATH:
3145 switch (randint1(5))
3149 fire_ball(GF_ACID, dir, 240, -3);
3155 fire_ball(GF_ELEC, dir, 210, -3);
3161 fire_ball(GF_FIRE, dir, 240, -3);
3167 fire_ball(GF_COLD, dir, 210, -3);
3173 fire_ball(GF_POIS, dir, 180, -3);
3182 case SV_WAND_DISINTEGRATE:
3184 fire_ball(GF_DISINTEGRATE, dir, 200 + randint1(p_ptr->lev * 2), 2);
3189 case SV_WAND_ROCKETS:
3192 msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡ª");
3194 msg_print("You launch a rocket!");
3197 fire_rocket(GF_ROCKET, dir, 250 + p_ptr->lev * 3, 2);
3202 case SV_WAND_STRIKING:
3204 fire_bolt(GF_METEOR, dir, damroll(15 + p_ptr->lev / 3, 13));
3209 case SV_WAND_GENOCIDE:
3211 fire_ball_hide(GF_GENOCIDE, dir, magic ? p_ptr->lev + 50 : 250, 0);
3221 * Aim a wand (from the pack or floor).
3223 * Use a single charge from a single item.
3224 * Handle "unstacking" in a logical manner.
3226 * For simplicity, you cannot use a stack of items from the
3227 * ground. This would require too much nasty code.
3229 * There are no wands which can "destroy" themselves, in the inventory
3230 * or on the ground, so we can ignore this possibility. Note that this
3231 * required giving "wand of wonder" the ability to ignore destruction
3232 * by electric balls.
3234 * All wands can be "cancelled" at the "Direction?" prompt for free.
3236 * Note that the basic "bolt" wands do slightly less damage than the
3237 * basic "bolt" rods, but the basic "ball" wands do the same damage
3238 * as the basic "ball" rods.
3240 static void do_cmd_aim_wand_aux(int item)
3242 int lev, ident, chance, dir;
3244 bool old_target_pet = target_pet;
3246 /* Get the item (in the pack) */
3249 o_ptr = &inventory[item];
3252 /* Get the item (on the floor) */
3255 o_ptr = &o_list[0 - item];
3258 /* Mega-Hack -- refuse to aim a pile from the ground */
3259 if ((item < 0) && (o_ptr->number > 1))
3262 msg_print("¤Þ¤º¤ÏËâË¡ËÀ¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
3264 msg_print("You must first pick up the wands.");
3271 /* Allow direction to be cancelled for free */
3272 if (object_is_aware(o_ptr) && (o_ptr->sval == SV_WAND_HEAL_MONSTER
3273 || o_ptr->sval == SV_WAND_HASTE_MONSTER))
3275 if (!get_aim_dir(&dir))
3277 target_pet = old_target_pet;
3280 target_pet = old_target_pet;
3286 lev = k_info[o_ptr->k_idx].level;
3287 if (lev > 50) lev = 50 + (lev - 50)/2;
3289 /* Base chance of success */
3290 chance = p_ptr->skill_dev;
3292 /* Confusion hurts skill */
3293 if (p_ptr->confused) chance = chance / 2;
3295 /* Hight level objects are harder */
3296 chance = chance - lev;
3298 /* Give everyone a (slight) chance */
3299 if ((chance < USE_DEVICE) && one_in_(USE_DEVICE - chance + 1))
3301 chance = USE_DEVICE;
3306 if (flush_failure) flush();
3308 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3310 msg_print("Nothing happen. Maybe this wand is freezing too.");
3317 /* Roll for usage */
3318 if ((chance < USE_DEVICE) || (randint1(chance) < USE_DEVICE) || (p_ptr->pclass == CLASS_BERSERKER))
3320 if (flush_failure) flush();
3322 msg_print("ËâË¡ËÀ¤ò¤¦¤Þ¤¯»È¤¨¤Ê¤«¤Ã¤¿¡£");
3324 msg_print("You failed to use the wand properly.");
3331 /* The wand is already empty! */
3332 if (o_ptr->pval <= 0)
3334 if (flush_failure) flush();
3336 msg_print("¤³¤ÎËâË¡ËÀ¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£");
3338 msg_print("The wand has no charges left.");
3341 o_ptr->ident |= (IDENT_EMPTY);
3343 /* Combine / Reorder the pack (later) */
3344 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3345 p_ptr->window |= (PW_INVEN);
3353 ident = wand_effect(o_ptr->sval, dir, FALSE);
3355 /* Combine / Reorder the pack (later) */
3356 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3358 if (!(object_is_aware(o_ptr)))
3360 chg_virtue(V_PATIENCE, -1);
3361 chg_virtue(V_CHANCE, 1);
3362 chg_virtue(V_KNOWLEDGE, -1);
3365 /* Mark it as tried */
3366 object_tried(o_ptr);
3368 /* Apply identification */
3369 if (ident && !object_is_aware(o_ptr))
3371 object_aware(o_ptr);
3372 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
3376 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3379 /* Use a single charge */
3382 /* Describe the charges in the pack */
3385 inven_item_charges(item);
3388 /* Describe the charges on the floor */
3391 floor_item_charges(0 - item);
3396 void do_cmd_aim_wand(void)
3401 /* Restrict choices to wands */
3402 item_tester_tval = TV_WAND;
3404 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
3406 set_action(ACTION_NONE);
3411 q = "¤É¤ÎËâË¡ËÀ¤ÇÁÀ¤¤¤Þ¤¹¤«? ";
3412 s = "»È¤¨¤ëËâË¡ËÀ¤¬¤Ê¤¤¡£";
3414 q = "Aim which wand? ";
3415 s = "You have no wand to aim.";
3418 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
3421 do_cmd_aim_wand_aux(item);
3425 static int rod_effect(int sval, int dir, bool *use_charge, bool magic)
3432 /* Analyze the rod */
3435 case SV_ROD_DETECT_TRAP:
3437 if (detect_traps(DETECT_RAD_DEFAULT, (bool)(dir ? FALSE : TRUE))) ident = TRUE;
3441 case SV_ROD_DETECT_DOOR:
3443 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
3444 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
3448 case SV_ROD_IDENTIFY:
3450 if (!ident_spell(FALSE)) *use_charge = FALSE;
3457 if (!word_of_recall()) *use_charge = FALSE;
3462 case SV_ROD_ILLUMINATION:
3464 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
3468 case SV_ROD_MAPPING:
3470 map_area(DETECT_RAD_MAP);
3475 case SV_ROD_DETECTION:
3477 detect_all(DETECT_RAD_DEFAULT);
3482 case SV_ROD_PROBING:
3491 if (set_blind(0)) ident = TRUE;
3492 if (set_poisoned(0)) ident = TRUE;
3493 if (set_confused(0)) ident = TRUE;
3494 if (set_stun(0)) ident = TRUE;
3495 if (set_cut(0)) ident = TRUE;
3496 if (set_image(0)) ident = TRUE;
3497 if (set_shero(0,TRUE)) ident = TRUE;
3501 case SV_ROD_HEALING:
3503 if (hp_player(500)) ident = TRUE;
3504 if (set_stun(0)) ident = TRUE;
3505 if (set_cut(0)) ident = TRUE;
3506 if (set_shero(0,TRUE)) ident = TRUE;
3510 case SV_ROD_RESTORATION:
3512 if (restore_level()) ident = TRUE;
3513 if (do_res_stat(A_STR)) ident = TRUE;
3514 if (do_res_stat(A_INT)) ident = TRUE;
3515 if (do_res_stat(A_WIS)) ident = TRUE;
3516 if (do_res_stat(A_DEX)) ident = TRUE;
3517 if (do_res_stat(A_CON)) ident = TRUE;
3518 if (do_res_stat(A_CHR)) ident = TRUE;
3524 if (set_fast(randint1(30) + 15, FALSE)) ident = TRUE;
3528 case SV_ROD_PESTICIDE:
3530 if (dispel_monsters(4)) ident = TRUE;
3534 case SV_ROD_TELEPORT_AWAY:
3536 if (teleport_monster(dir)) ident = TRUE;
3540 case SV_ROD_DISARMING:
3542 if (disarm_trap(dir)) ident = TRUE;
3549 msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3551 msg_print("A line of blue shimmering light appears.");
3554 (void)lite_line(dir);
3559 case SV_ROD_SLEEP_MONSTER:
3561 if (sleep_monster(dir)) ident = TRUE;
3565 case SV_ROD_SLOW_MONSTER:
3567 if (slow_monster(dir)) ident = TRUE;
3571 case SV_ROD_DRAIN_LIFE:
3573 if (drain_life(dir, 70 + 3 * p_ptr->lev / 2)) ident = TRUE;
3577 case SV_ROD_POLYMORPH:
3579 if (poly_monster(dir)) ident = TRUE;
3583 case SV_ROD_ACID_BOLT:
3585 fire_bolt_or_beam(10, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
3590 case SV_ROD_ELEC_BOLT:
3592 fire_bolt_or_beam(10, GF_ELEC, dir, damroll(4 + p_ptr->lev / 9, 8));
3597 case SV_ROD_FIRE_BOLT:
3599 fire_bolt_or_beam(10, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
3604 case SV_ROD_COLD_BOLT:
3606 fire_bolt_or_beam(10, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
3611 case SV_ROD_ACID_BALL:
3613 fire_ball(GF_ACID, dir, 60 + p_ptr->lev, 2);
3618 case SV_ROD_ELEC_BALL:
3620 fire_ball(GF_ELEC, dir, 40 + p_ptr->lev, 2);
3625 case SV_ROD_FIRE_BALL:
3627 fire_ball(GF_FIRE, dir, 70 + p_ptr->lev, 2);
3632 case SV_ROD_COLD_BALL:
3634 fire_ball(GF_COLD, dir, 50 + p_ptr->lev, 2);
3646 case SV_ROD_STONE_TO_MUD:
3648 if (wall_to_mud(dir)) ident = TRUE;
3652 case SV_ROD_AGGRAVATE:
3654 aggravate_monsters(0);
3663 * Activate (zap) a Rod
3665 * Unstack fully charged rods as needed.
3667 * Hack -- rods of perception/genocide can be "cancelled"
3668 * All rods can be cancelled at the "Direction?" prompt
3670 * pvals are defined for each rod in k_info. -LM-
3672 static void do_cmd_zap_rod_aux(int item)
3674 int ident, chance, lev, fail;
3679 /* Hack -- let perception get aborted */
3680 bool use_charge = TRUE;
3684 /* Get the item (in the pack) */
3687 o_ptr = &inventory[item];
3690 /* Get the item (on the floor) */
3693 o_ptr = &o_list[0 - item];
3697 /* Mega-Hack -- refuse to zap a pile from the ground */
3698 if ((item < 0) && (o_ptr->number > 1))
3701 msg_print("¤Þ¤º¤Ï¥í¥Ã¥É¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
3703 msg_print("You must first pick up the rods.");
3710 /* Get a direction (unless KNOWN not to need it) */
3711 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)) ||
3712 !object_is_aware(o_ptr))
3714 /* Get a direction, allow cancel */
3715 if (!get_aim_dir(&dir)) return;
3722 /* Extract the item level */
3723 lev = k_info[o_ptr->k_idx].level;
3725 /* Base chance of success */
3726 chance = p_ptr->skill_dev;
3728 /* Confusion hurts skill */
3729 if (p_ptr->confused) chance = chance / 2;
3732 if (chance > fail) fail -= (chance - fail)*2;
3733 else chance -= (fail - chance)*2;
3734 if (fail < USE_DEVICE) fail = USE_DEVICE;
3735 if (chance < USE_DEVICE) chance = USE_DEVICE;
3739 if (flush_failure) flush();
3741 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3743 msg_print("Nothing happen. Maybe this rod is freezing too.");
3750 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
3751 else if (chance > fail)
3753 if (randint0(chance*2) < fail) success = FALSE;
3754 else success = TRUE;
3758 if (randint0(fail*2) < chance) success = TRUE;
3759 else success = FALSE;
3762 /* Roll for usage */
3765 if (flush_failure) flush();
3767 msg_print("¤¦¤Þ¤¯¥í¥Ã¥É¤ò»È¤¨¤Ê¤«¤Ã¤¿¡£");
3769 msg_print("You failed to use the rod properly.");
3776 k_ptr = &k_info[o_ptr->k_idx];
3778 /* A single rod is still charging */
3779 if ((o_ptr->number == 1) && (o_ptr->timeout))
3781 if (flush_failure) flush();
3783 msg_print("¤³¤Î¥í¥Ã¥É¤Ï¤Þ¤ÀËâÎϤò½¼Å¶¤·¤Æ¤¤¤ëºÇÃæ¤À¡£");
3785 msg_print("The rod is still charging.");
3790 /* A stack of rods lacks enough energy. */
3791 else if ((o_ptr->number > 1) && (o_ptr->timeout > k_ptr->pval * (o_ptr->number - 1)))
3793 if (flush_failure) flush();
3795 msg_print("¤½¤Î¥í¥Ã¥É¤Ï¤Þ¤À½¼Å¶Ãæ¤Ç¤¹¡£");
3797 msg_print("The rods are all still charging.");
3806 ident = rod_effect(o_ptr->sval, dir, &use_charge, FALSE);
3808 /* Increase the timeout by the rod kind's pval. -LM- */
3809 if (use_charge) o_ptr->timeout += k_ptr->pval;
3811 /* Combine / Reorder the pack (later) */
3812 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3814 if (!(object_is_aware(o_ptr)))
3816 chg_virtue(V_PATIENCE, -1);
3817 chg_virtue(V_CHANCE, 1);
3818 chg_virtue(V_KNOWLEDGE, -1);
3821 /* Tried the object */
3822 object_tried(o_ptr);
3824 /* Successfully determined the object function */
3825 if (ident && !object_is_aware(o_ptr))
3827 object_aware(o_ptr);
3828 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
3832 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3836 void do_cmd_zap_rod(void)
3841 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
3843 set_action(ACTION_NONE);
3846 /* Restrict choices to rods */
3847 item_tester_tval = TV_ROD;
3851 q = "¤É¤Î¥í¥Ã¥É¤ò¿¶¤ê¤Þ¤¹¤«? ";
3852 s = "»È¤¨¤ë¥í¥Ã¥É¤¬¤Ê¤¤¡£";
3854 q = "Zap which rod? ";
3855 s = "You have no rod to zap.";
3858 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
3861 do_cmd_zap_rod_aux(item);
3866 * Hook to determine if an object is activatable
3868 static bool item_tester_hook_activate(object_type *o_ptr)
3870 u32b flgs[TR_FLAG_SIZE];
3873 if (!object_is_known(o_ptr)) return (FALSE);
3875 /* Extract the flags */
3876 object_flags(o_ptr, flgs);
3878 /* Check activation flag */
3879 if (have_flag(flgs, TR_ACTIVATE)) return (TRUE);
3887 * Hack -- activate the ring of power
3889 void ring_of_power(int dir)
3891 /* Pick a random effect */
3892 switch (randint1(10))
3899 msg_print("¤¢¤Ê¤¿¤Ï°À¤Î¥ª¡¼¥é¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡£");
3901 msg_print("You are surrounded by a malignant aura.");
3906 /* Decrease all stats (permanently) */
3907 (void)dec_stat(A_STR, 50, TRUE);
3908 (void)dec_stat(A_INT, 50, TRUE);
3909 (void)dec_stat(A_WIS, 50, TRUE);
3910 (void)dec_stat(A_DEX, 50, TRUE);
3911 (void)dec_stat(A_CON, 50, TRUE);
3912 (void)dec_stat(A_CHR, 50, TRUE);
3914 /* Lose some experience (permanently) */
3915 p_ptr->exp -= (p_ptr->exp / 4);
3916 p_ptr->max_exp -= (p_ptr->exp / 4);
3926 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥª¡¼¥é¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡£");
3928 msg_print("You are surrounded by a powerful aura.");
3932 /* Dispel monsters */
3933 dispel_monsters(1000);
3943 fire_ball(GF_MANA, dir, 600, 3);
3954 fire_bolt(GF_MANA, dir, 500);
3962 static bool ang_sort_comp_pet(vptr u, vptr v, int a, int b)
3964 u16b *who = (u16b*)(u);
3969 monster_type *m_ptr1 = &m_list[w1];
3970 monster_type *m_ptr2 = &m_list[w2];
3971 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
3972 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
3977 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
3978 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
3980 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
3981 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
3983 if (r_ptr1->level > r_ptr2->level) return TRUE;
3984 if (r_ptr2->level > r_ptr1->level) return FALSE;
3986 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
3987 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
3993 * Activate a wielded object. Wielded objects never stack.
3994 * And even if they did, activatable objects never stack.
3996 * Currently, only (some) artifacts, and Dragon Scale Mail, can be activated.
3997 * But one could, for example, easily make an activatable "Ring of Plasma".
3999 * Note that it always takes a turn to activate an artifact, even if
4000 * the user hits "escape" at the "direction" prompt.
4002 static void do_cmd_activate_aux(int item)
4004 int k, dir, lev, chance, fail;
4009 /* Get the item (in the pack) */
4012 o_ptr = &inventory[item];
4015 /* Get the item (on the floor) */
4018 o_ptr = &o_list[0 - item];
4024 /* Extract the item level */
4025 lev = k_info[o_ptr->k_idx].level;
4027 /* Hack -- use artifact level instead */
4028 if (object_is_fixed_artifact(o_ptr)) lev = a_info[o_ptr->name1].level;
4029 else if (o_ptr->art_name)
4031 switch (o_ptr->xtra2)
4039 case ACT_CURE_POISON:
4059 case ACT_RESIST_ALL:
4060 case ACT_DETECT_ALL:
4073 case ACT_BANISH_EVIL:
4081 case ACT_CHARM_ANIMAL:
4082 case ACT_SUMMON_ANIMAL:
4085 case ACT_XTRA_SPEED:
4086 case ACT_DETECT_XTRA:
4094 case ACT_CHARM_UNDEAD:
4095 case ACT_CHARM_OTHER:
4096 case ACT_SUMMON_PHANTOM:
4097 case ACT_SUMMON_ELEMENTAL:
4098 case ACT_RUNE_EXPLO:
4102 case ACT_CHARM_ANIMALS:
4103 case ACT_CHARM_OTHERS:
4110 case ACT_CALL_CHAOS:
4115 case ACT_SUMMON_UNDEAD:
4116 case ACT_SUMMON_DEMON:
4127 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
4129 /* Base chance of success */
4130 chance = p_ptr->skill_dev;
4132 /* Confusion hurts skill */
4133 if (p_ptr->confused) chance = chance / 2;
4136 if (chance > fail) fail -= (chance - fail)*2;
4137 else chance -= (fail - chance)*2;
4138 if (fail < USE_DEVICE) fail = USE_DEVICE;
4139 if (chance < USE_DEVICE) chance = USE_DEVICE;
4143 if (flush_failure) flush();
4145 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
4147 msg_print("It shows no reaction.");
4154 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
4155 else if (chance > fail)
4157 if (randint0(chance*2) < fail) success = FALSE;
4158 else success = TRUE;
4162 if (randint0(fail*2) < chance) success = TRUE;
4163 else success = FALSE;
4166 /* Roll for usage */
4169 if (flush_failure) flush();
4171 msg_print("¤¦¤Þ¤¯»ÏÆ°¤µ¤»¤ë¤³¤È¤¬¤Ç¤¤Ê¤«¤Ã¤¿¡£");
4173 msg_print("You failed to activate it properly.");
4180 /* Check the recharge */
4184 msg_print("¤½¤ì¤ÏÈù¤«¤Ë²»¤òΩ¤Æ¡¢µ±¤¡¢¾Ã¤¨¤¿...");
4186 msg_print("It whines, glows and fades...");
4193 /* Activate the artifact */
4195 msg_print("»ÏÆ°¤µ¤»¤¿...");
4197 msg_print("You activate it...");
4205 if (o_ptr->art_name && o_ptr->xtra2)
4207 (void)activate_random_artifact(o_ptr);
4210 p_ptr->window |= (PW_INVEN | PW_EQUIP);
4217 else if (object_is_fixed_artifact(o_ptr))
4220 switch (o_ptr->name1)
4225 msg_print("ààÍþÉÓ¤«¤éÀ¡¤ó¤À¸÷¤¬¤¢¤Õ¤ì½Ð¤¿...");
4227 msg_print("The phial wells with clear light...");
4230 lite_area(damroll(2, 15), 3);
4231 o_ptr->timeout = randint0(10) + 10;
4238 msg_print("À±¤¬âÁ¤·¤¯µ±¤¤¤¿...");
4240 msg_print("The star shines brightly...");
4243 map_area(DETECT_RAD_MAP);
4244 lite_area(damroll(2, 15), 3);
4245 o_ptr->timeout = randint0(50) + 50;
4252 msg_print("¤½¤ÎÊõÀФÏÀÖ¤¯ÌÀ¤ë¤¯¸÷¤Ã¤¿¡ª");
4254 msg_print("The Jewel flashes bright red!");
4257 chg_virtue(V_KNOWLEDGE, 1);
4258 chg_virtue(V_ENLIGHTEN, 1);
4261 msg_print("¤½¤ÎÊõÀФϤ¢¤Ê¤¿¤ÎÂÎÎϤòÃ¥¤Ã¤¿...");
4262 take_hit(DAMAGE_LOSELIFE, damroll(3,8), "¿³È½¤ÎÊõÀÐ", -1);
4264 msg_print("The Jewel drains your vitality...");
4265 take_hit(DAMAGE_LOSELIFE, damroll(3, 8), "the Jewel of Judgement", -1);
4268 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
4269 (void)detect_doors(DETECT_RAD_DEFAULT);
4270 (void)detect_stairs(DETECT_RAD_DEFAULT);
4273 if (get_check("µ¢´Ô¤ÎÎϤò»È¤¤¤Þ¤¹¤«¡©"))
4275 if (get_check("Activate recall? "))
4279 (void)word_of_recall();
4282 o_ptr->timeout = randint0(20) + 20;
4289 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
4291 msg_print("The amulet lets out a shrill wail...");
4295 (void)set_protevil(randint1(25) + k, FALSE);
4296 o_ptr->timeout = randint0(225) + 225;
4303 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
4305 msg_print("The amulet floods the area with goodness...");
4308 dispel_evil(p_ptr->lev * 5);
4309 o_ptr->timeout = randint0(200) + 200;
4316 msg_print("¶À¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
4318 msg_print("The mirror floods the area with goodness...");
4321 dispel_evil(p_ptr->lev * 5);
4322 o_ptr->timeout = randint0(200) + 200;
4329 msg_print("¤¢¤Ê¤¿¤Ï¥Õ¥é¥¥¢¤ËŨ¤òÄù¤á»¦¤¹¤è¤¦Ì¿¤¸¤¿¡£");
4331 msg_print("You order Frakir to strangle your opponent.");
4334 if (!get_aim_dir(&dir)) return;
4335 if (drain_life(dir, 100))
4336 o_ptr->timeout = randint0(100) + 100;
4343 msg_print("»ØÎؤÏÌÀ¤ë¤¯µ±¤¤¤¿...");
4345 msg_print("The ring glows brightly...");
4348 (void)set_fast(randint1(75) + 75, FALSE);
4349 o_ptr->timeout = randint0(150) + 150;
4356 msg_print("»ØÎؤϿ¼¹È¤Ëµ±¤¤¤¿...");
4358 msg_print("The ring glows deep red...");
4361 if (!get_aim_dir(&dir)) return;
4362 fire_ball(GF_FIRE, dir, 300, 3);
4363 o_ptr->timeout = randint0(225) + 225;
4370 msg_print("»ØÎؤÏÇò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4372 msg_print("The ring glows bright white...");
4375 if (!get_aim_dir(&dir)) return;
4376 fire_ball(GF_COLD, dir, 400, 3);
4377 o_ptr->timeout = randint0(325) + 325;
4385 msg_format("%s¤Ï¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...", o_ptr->name1 == ART_VILYA ? "»ØÎØ" : "¥½¡¼¥É");
4387 msg_format("The %s glows deep blue...", o_ptr->name1 == ART_VILYA ? "ring" : "sword");
4390 if (!get_aim_dir(&dir)) return;
4391 fire_ball(GF_ELEC, dir, 500, 3);
4392 o_ptr->timeout = randint0(425) + 425;
4400 msg_print("»ØÎؤϼ¿¹õ¤Ëµ±¤¤¤¿...");
4402 msg_print("The ring glows intensely black...");
4405 if (!get_aim_dir(&dir)) return;
4407 o_ptr->timeout = randint0(450) + 450;
4413 int num = damroll(5, 3);
4418 msg_print("³»¤¬°ðºÊ¤Çʤ¤ï¤ì¤¿...");
4420 msg_print("Your armor is surrounded by lightning...");
4424 for (k = 0; k < num; k++)
4430 scatter(&y, &x, py, px, 4, 0);
4432 if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
4434 if (!player_bold(y, x)) break;
4437 project(0, 3, y, x, 150, GF_ELEC,
4438 (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
4441 o_ptr->timeout = 1000;
4445 case ART_BLADETURNER:
4447 if (!get_aim_dir(&dir)) return;
4449 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
4451 msg_print("You breathe the elements.");
4454 fire_ball(GF_MISSILE, dir, 300, 4);
4456 msg_print("³»¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...");
4458 msg_print("Your armor glows many colours...");
4461 (void)set_afraid(0);
4462 (void)set_hero(randint1(50) + 50, FALSE);
4463 (void)hp_player(10);
4464 (void)set_blessed(randint1(50) + 50, FALSE);
4465 (void)set_oppose_acid(randint1(50) + 50, FALSE);
4466 (void)set_oppose_elec(randint1(50) + 50, FALSE);
4467 (void)set_oppose_fire(randint1(50) + 50, FALSE);
4468 (void)set_oppose_cold(randint1(50) + 50, FALSE);
4469 (void)set_oppose_pois(randint1(50) + 50, FALSE);
4470 o_ptr->timeout = 400;
4474 case ART_SOULKEEPER:
4477 msg_print("³»¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4478 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬¤è¤¤...");
4480 msg_print("Your armor glows a bright white...");
4481 msg_print("You feel much better...");
4484 (void)hp_player(1000);
4486 o_ptr->timeout = 888;
4493 msg_print("Å·¹ñ¤Î²Î¤¬Ê¹¤³¤¨¤ë...");
4495 msg_print("A heavenly choir sings...");
4498 (void)set_poisoned(0);
4501 (void)set_confused(0);
4503 (void)set_afraid(0);
4504 (void)set_hero(randint1(25) + 25, FALSE);
4505 (void)hp_player(777);
4506 o_ptr->timeout = 300;
4513 msg_print("³»¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4515 msg_print("Your armor glows deep blue...");
4518 (void)symbol_genocide(200, TRUE);
4519 o_ptr->timeout = 500;
4526 msg_print("³»¤¬ÀÖ¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4528 msg_print("Your armor glows bright red...");
4531 destroy_doors_touch();
4532 o_ptr->timeout = 10;
4540 turn_monsters(40 + p_ptr->lev);
4541 o_ptr->timeout = 3 * (p_ptr->lev + 10);
4546 case ART_HOLHENNETH:
4549 msg_print("¥Ø¥ë¥á¥Ã¥È¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4550 msg_print("¿´¤Ë¥¤¥á¡¼¥¸¤¬É⤫¤ó¤Ç¤¤¿...");
4552 msg_print("Your helm glows bright white...");
4553 msg_print("An image forms in your mind...");
4556 detect_all(DETECT_RAD_DEFAULT);
4557 o_ptr->timeout = randint0(55) + 55;
4564 msg_print("²¦´§¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4565 msg_print("ÂÎÆâ¤ËÃȤ«¤¤¸ÝÆ°¤¬´¶¤¸¤é¤ì¤ë...");
4567 msg_print("Your crown glows deep blue...");
4568 msg_print("You feel a warm tingling inside...");
4571 (void)hp_player(700);
4573 o_ptr->timeout = 250;
4581 msg_format("%s¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...", o_ptr->name1 == ART_COLLUIN ? "¥¯¥í¡¼¥¯" : "³»");
4583 msg_format("Your %s glows many colours...", o_ptr->name1 == ART_COLLUIN ? "cloak" : "armor");
4586 (void)set_oppose_acid(randint1(20) + 20, FALSE);
4587 (void)set_oppose_elec(randint1(20) + 20, FALSE);
4588 (void)set_oppose_fire(randint1(20) + 20, FALSE);
4589 (void)set_oppose_cold(randint1(20) + 20, FALSE);
4590 (void)set_oppose_pois(randint1(20) + 20, FALSE);
4591 o_ptr->timeout = 111;
4595 case ART_HOLCOLLETH:
4598 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4600 msg_print("Your cloak glows deep blue...");
4603 sleep_monsters_touch();
4604 o_ptr->timeout = 55;
4611 msg_print("¥¯¥í¡¼¥¯¤¬²«¿§¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4613 msg_print("Your cloak glows bright yellow...");
4617 o_ptr->timeout = 70;
4624 msg_print("¥¯¥í¡¼¥¯¤¬ÊÕ¤ê¤Î¶õ´Ö¤ò¤æ¤¬¤Þ¤»¤¿...");
4626 msg_print("Your cloak twists space around you...");
4629 teleport_player(100, 0L);
4630 o_ptr->timeout = 45;
4637 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4639 msg_print("Your cloak glows a deep red...");
4643 o_ptr->timeout = 450;
4647 case ART_HEAVENLY_MAIDEN:
4650 msg_print("¥¯¥í¡¼¥¯¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
4652 msg_print("Your cloak glows soft white...");
4654 if (!word_of_recall()) return;
4655 o_ptr->timeout = 200;
4659 case ART_CAMMITHRIM:
4662 msg_print("¥°¥í¡¼¥Ö¤¬âÁ¤·¤¤¤¯¤é¤¤¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4664 msg_print("Your gloves glow extremely brightly...");
4667 if (!get_aim_dir(&dir)) return;
4668 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
4676 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4678 msg_print("Your gauntlets are covered in fire...");
4681 if (!get_aim_dir(&dir)) return;
4682 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4683 o_ptr->timeout = randint0(8) + 8;
4687 case ART_PAURNIMMEN:
4690 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4692 msg_print("Your gauntlets are covered in frost...");
4695 if (!get_aim_dir(&dir)) return;
4696 fire_bolt(GF_COLD, dir, damroll(6, 8));
4697 o_ptr->timeout = randint0(7) + 7;
4704 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4706 msg_print("Your gauntlets are covered in sparks...");
4709 if (!get_aim_dir(&dir)) return;
4710 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4711 o_ptr->timeout = randint0(5) + 5;
4718 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬»À¤Ëʤ¤ï¤ì¤¿...");
4720 msg_print("Your gauntlets are covered in acid...");
4723 if (!get_aim_dir(&dir)) return;
4724 fire_bolt(GF_ACID, dir, damroll(5, 8));
4725 o_ptr->timeout = randint0(6) + 6;
4732 msg_print("¥»¥¹¥¿¥¹¤ËËâË¡¤Î¥È¥²¤¬¸½¤ì¤¿...");
4734 msg_print("Your cesti grows magical spikes...");
4737 if (!get_aim_dir(&dir)) return;
4738 fire_bolt(GF_ARROW, dir, 150);
4739 o_ptr->timeout = randint0(90) + 90;
4746 msg_print("¥Ö¡¼¥Ä¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4748 msg_print("Your boots glow bright green...");
4751 (void)set_fast(randint1(20) + 20, FALSE);
4752 o_ptr->timeout = 200;
4759 msg_print("¥Ö¡¼¥Ä¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4761 msg_print("Your boots glow deep blue...");
4764 (void)set_afraid(0);
4765 (void)set_poisoned(0);
4773 msg_print("¥À¥¬¡¼¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4775 msg_print("Your dagger is covered in fire...");
4778 if (!get_aim_dir(&dir)) return;
4779 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4780 o_ptr->timeout = randint0(8) + 8;
4787 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4789 msg_print("Your dagger is covered in frost...");
4792 if (!get_aim_dir(&dir)) return;
4793 fire_bolt(GF_COLD, dir, damroll(6, 8));
4794 o_ptr->timeout = randint0(7) + 7;
4801 msg_print("¥À¥¬¡¼¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4803 msg_print("Your dagger is covered in sparks...");
4806 if (!get_aim_dir(&dir)) return;
4807 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4808 o_ptr->timeout = randint0(5) + 5;
4815 msg_print("¥À¥¬¡¼¤¬¿¼¤¤Îп§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4817 msg_print("Your dagger throbs deep green...");
4820 if (!get_aim_dir(&dir)) return;
4821 fire_ball(GF_POIS, dir, 12, 3);
4822 o_ptr->timeout = randint0(4) + 4;
4829 msg_print("Ì·¤¬¿¼¤¤ÀÄ¿§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4831 msg_print("Your dagger throbs deep blue...");
4834 if (!get_aim_dir(&dir)) return;
4835 fire_ball(GF_WATER, dir, 200, 3);
4836 o_ptr->timeout = 250;
4843 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4845 msg_print("Your dagger is covered in frost...");
4848 if (!get_aim_dir(&dir)) return;
4849 fire_ball(GF_COLD, dir, 48, 2);
4850 o_ptr->timeout = randint0(5) + 5;
4855 case ART_WEREWINDLE:
4857 switch (randint1(13))
4859 case 1: case 2: case 3: case 4: case 5:
4860 teleport_player(10, 0L);
4862 case 6: case 7: case 8: case 9: case 10:
4863 teleport_player(222, 0L);
4866 (void)stair_creation();
4870 if (get_check("¤³¤Î³¬¤òµî¤ê¤Þ¤¹¤«¡©"))
4872 if (get_check("Leave this level? "))
4876 if (autosave_l) do_cmd_save_game(TRUE);
4879 p_ptr->leaving = TRUE;
4882 o_ptr->timeout = 35;
4888 teleport_player(222, 0L);
4889 o_ptr->timeout = 25;
4896 msg_print("¥½¡¼¥É¤¬ÀĤ¯·ã¤·¤¯µ±¤¤¤¿...");
4898 msg_print("Your sword glows an intense blue...");
4901 if (!get_aim_dir(&dir)) return;
4902 fire_ball(GF_COLD, dir, 100, 2);
4903 o_ptr->timeout = 200;
4910 msg_print("¶Ç¤Î»ÕÃĤò¾¤´¤·¤¿¡£");
4912 msg_print("You summon the Legion of the Dawn.");
4915 (void)summon_specific(-1, py, px, dun_level, SUMMON_DAWN, (PM_ALLOW_GROUP | PM_FORCE_PET));
4916 o_ptr->timeout = 500 + randint1(500);
4923 msg_print("¥½¡¼¥É¤¬ÀÖ¤¯·ã¤·¤¯µ±¤¤¤¿...");
4925 msg_print("Your sword glows an intense red...");
4928 if (!get_aim_dir(&dir)) return;
4929 fire_ball(GF_FIRE, dir, 72, 2);
4930 o_ptr->timeout = 400;
4937 msg_print("¥¢¥Ã¥¯¥¹¤Î¿Ï¤¬¹õ¤¯µ±¤¤¤¿...");
4939 msg_print("Your axe blade glows black...");
4942 if (!get_aim_dir(&dir)) return;
4943 drain_life(dir, 120);
4944 o_ptr->timeout = 400;
4951 msg_print("¤¢¤Ê¤¿¤ÎÁä¤ÏÅŵ¤¤Ç¥¹¥Ñ¡¼¥¯¤·¤Æ¤¤¤ë...");
4953 msg_print("Your spear crackles with electricity...");
4956 if (!get_aim_dir(&dir)) return;
4957 fire_ball(GF_ELEC, dir, 100, 3);
4958 o_ptr->timeout = 200;
4965 msg_print("¥¹¥Ô¥¢¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4967 msg_print("Your spear glows a bright white...");
4970 if (!get_aim_dir(&dir)) return;
4971 fire_ball(GF_COLD, dir, 100, 3);
4972 o_ptr->timeout = 200;
4979 msg_print("¥¹¥Ô¥¢¤¬¸ÝÆ°¤·¤¿...");
4981 msg_print("Your spear pulsates...");
4984 if (!get_aim_dir(&dir)) return;
4993 msg_print("¤Ä¤ë¤Ï¤·¤¬¸ÝÆ°¤·¤¿...");
4995 msg_print("Your mattock pulsates...");
4998 if (!get_aim_dir(&dir)) return;
5007 msg_print("¥¢¥Ã¥¯¥¹¤«¤é¤Ò¤É¤¯±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
5009 msg_print("Your axe lets out a long, shrill note...");
5012 (void)mass_genocide(200, TRUE);
5013 o_ptr->timeout = 1000;
5020 msg_print("¥Ð¥È¥ë¡¦¥¢¥Ã¥¯¥¹¤¬¿¼»ç¤Î¸÷¤òÊü¼Í¤·¤¿...");
5022 msg_print("Your battle axe radiates deep purple...");
5025 hp_player(damroll(4, 8));
5026 (void)set_cut((p_ptr->cut / 2) - 50);
5027 o_ptr->timeout = randint0(3) + 3;
5034 msg_print("¥È¥é¥¤¥Ç¥ó¥È¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
5036 msg_print("Your trident glows deep red...");
5039 if (!get_aim_dir(&dir)) return;
5040 teleport_monster(dir);
5041 o_ptr->timeout = 150;
5048 msg_print("Âç³ù¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
5050 msg_print("Your scythe glows soft white...");
5052 if (!word_of_recall()) return;
5053 o_ptr->timeout = 200;
5060 msg_print("¸û¶Ì¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
5062 msg_print("Your scythe glows soft white...");
5064 if (!word_of_recall()) return;
5065 o_ptr->timeout = 200;
5072 msg_print("¥Õ¥ì¥¤¥ë¤¬ÍÍ¡¹¤Ê¿§¤Î²Ð²Ö¤òȯ¤·¤¿...");
5074 msg_print("Your flail glows in scintillating colours...");
5077 if (!get_aim_dir(&dir)) return;
5078 confuse_monster(dir, 20);
5079 o_ptr->timeout = 15;
5086 msg_print("¥â¡¼¥Ë¥ó¥°¥¹¥¿¡¼¤«¤é±ê¤¬¿á¤½Ð¤·¤¿...");
5088 msg_print("Your morning star rages in fire...");
5091 if (!get_aim_dir(&dir)) return;
5092 fire_ball(GF_FIRE, dir, 72, 3);
5093 o_ptr->timeout = 100;
5100 msg_print("¥à¥Á¤¬¿¼¤¤ÀÖ¿§¤Ëµ±¤¤¤¿...");
5102 msg_print("Your whip glows deep red...");
5105 if (!get_aim_dir(&dir)) return;
5106 fire_ball(GF_FIRE, dir, 120, 3);
5107 o_ptr->timeout = 15;
5114 msg_print("¥á¥¤¥¹¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
5116 msg_print("Your mace glows bright green...");
5119 (void)set_fast(randint1(20) + 20, FALSE);
5120 o_ptr->timeout = randint0(100) + 100;
5127 msg_print("¥¯¥©¡¼¥¿¡¼¥¹¥¿¥Ã¥Õ¤¬²«¿§¤¯µ±¤¤¤¿...");
5129 msg_print("Your quarterstaff glows yellow...");
5132 if (!ident_spell(FALSE)) return;
5133 o_ptr->timeout = 10;
5140 msg_print("¾ó¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
5142 msg_print("Your quarterstaff glows brightly...");
5145 detect_all(DETECT_RAD_DEFAULT);
5147 identify_fully(FALSE);
5148 o_ptr->timeout = 100;
5155 msg_print("¥Ï¥ó¥Þ¡¼¤¬Çò¤¯µ±¤¤¤¿...");
5157 msg_print("Your hammer glows white...");
5160 if (!get_aim_dir(&dir)) return;
5161 drain_life(dir, 90);
5162 o_ptr->timeout = 70;
5170 msg_print("¥¯¥í¥¹¥Ü¥¦¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
5172 msg_print("Your crossbow glows deep red...");
5175 (void)brand_bolts();
5176 o_ptr->timeout = 999;
5183 int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
5186 msg_print("¤»¤Ã¤«¤¯¤À¤«¤é¡Ø¥¯¥ê¥à¥¾¥ó¡Ù¤ò¤Ö¤Ã¤Ñ¤Ê¤¹¤¼¡ª");
5188 msg_print("I'll fire CRIMSON! SEKKAKUDAKARA!");
5191 if (!get_aim_dir(&dir)) return;
5193 /* Use the given direction */
5194 tx = px + 99 * ddx[dir];
5195 ty = py + 99 * ddy[dir];
5197 /* Hack -- Use an actual "target" */
5198 if ((dir == 5) && target_okay())
5204 if (p_ptr->pclass == CLASS_ARCHER)
5206 /* Extra shot at level 10 */
5207 if (p_ptr->lev >= 10) num++;
5209 /* Extra shot at level 30 */
5210 if (p_ptr->lev >= 30) num++;
5212 /* Extra shot at level 45 */
5213 if (p_ptr->lev >= 45) num++;
5216 for (i = 0; i < num; i++)
5217 project(0, p_ptr->lev/20+1, ty, tx, p_ptr->lev*p_ptr->lev*6/50, GF_ROCKET, flg, -1);
5218 o_ptr->timeout = 15;
5223 monster_type *m_ptr;
5224 monster_race *r_ptr;
5228 msg_print("´ñ̯¤Ê¾ì½ê¤¬Æ¬¤ÎÃæ¤ËÉ⤫¤ó¤À¡¥¡¥¡¥");
5230 msg_print("Some strange places show up in your mind. And you see ...");
5233 /* Process the monsters (backwards) */
5234 for (i = m_max - 1; i >= 1; i--)
5236 /* Access the monster */
5239 /* Ignore "dead" monsters */
5240 if (!m_ptr->r_idx) continue;
5242 r_ptr = &r_info[m_ptr->r_idx];
5244 if(r_ptr->flags1 & RF1_UNIQUE)
5247 msg_format("%s¡¥ ",r_name + r_ptr->name);
5249 msg_format("%s. ",r_name + r_ptr->name);
5253 o_ptr->timeout = 200;
5257 case ART_STONE_LORE:
5260 msg_print("ÀФ¬±£¤µ¤ì¤¿ÈëÌ©¤ò¼Ì¤·½Ð¤·¤¿¡¥¡¥¡¥");
5262 msg_print("The stone reveals hidden mysteries...");
5264 if (!ident_spell(FALSE)) return;
5266 if (mp_ptr->spell_book)
5268 /* Sufficient mana */
5269 if (20 <= p_ptr->csp)
5275 /* Over-exert the player */
5278 int oops = 20 - p_ptr->csp;
5282 p_ptr->csp_frac = 0;
5286 msg_print("ÀФòÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
5288 msg_print("You are too weak to control the stone!");
5291 /* Hack -- Bypass free action */
5292 (void)set_paralyzed(p_ptr->paralyzed +
5293 randint1(5 * oops + 1));
5296 (void)set_confused(p_ptr->confused +
5297 randint1(5 * oops + 1));
5301 p_ptr->redraw |= (PR_MANA);
5305 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "´í¸±¤ÊÈëÌ©", -1);
5307 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "perilous secrets", -1);
5311 if (one_in_(5)) (void)set_confused(p_ptr->confused +
5314 /* Exercise a little care... */
5317 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "´í¸±¤ÊÈëÌ©", -1);
5319 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "perilous secrets", -1);
5327 if (music_singing_any()) stop_singing();
5328 if (hex_spelling_any()) stop_hex_spell_all();
5330 msg_print("¤¢¤Ê¤¿¤ÏÎ϶¯¤¤ÆÍÉ÷¤ò¿á¤ÌĤ餷¤¿¡£¼þ°Ï¤ÎŨ¤¬¿Ì¤¨¾å¤Ã¤Æ¤¤¤ë!");
5332 msg_print("You wind a mighty blast; your enemies tremble!");
5334 (void)turn_monsters((3 * p_ptr->lev / 2) + 10);
5335 o_ptr->timeout = randint0(40) + 40;
5341 msg_print("¤¢¤Ê¤¿¤Ï³²Ãî¤ò°ìÁݤ·¤¿¡£");
5343 msg_print("You exterminate small life.");
5345 (void)dispel_monsters(4);
5346 o_ptr->timeout = randint0(55) + 55;
5353 msg_print("Æߤ¤²»¤¬ÊÕ¤ê¤òÊñ¤ß¤³¤ó¤À¡£");
5355 msg_print("A shrill wailing sound surrounds you.");
5357 (void)set_protevil(randint1(25) + p_ptr->lev, FALSE);
5358 o_ptr->timeout = randint0(200) + 200;
5366 msg_print("¥í¡¼¥Ö¤¬½ã¿è¤ÊËâÎϤǿ̤¨¤¿¡£");
5368 msg_print("The robe pulsates with raw mana...");
5370 if (!get_aim_dir(&dir)) return;
5371 fire_bolt(GF_MANA, dir, 120);
5372 o_ptr->timeout = randint0(120) + 120;
5377 (void)set_fast(randint1(50) + 50, FALSE);
5380 set_hero(randint1(50) + 50, FALSE);
5381 o_ptr->timeout = randint0(200) + 100;
5387 msg_print("¥·¡¼¥ë¥É¤¬âÁ¤·¤¤¸÷¤Çµ±¤¤¤¿¡¥¡¥¡¥");
5389 msg_print("Your shield gleams with blinding light...");
5391 fire_ball(GF_LITE, 0, 300, 6);
5392 confuse_monsters(3 * p_ptr->lev / 2);
5393 o_ptr->timeout = 250;
5399 msg_print("¥«¡¼¥É¤¬Çò¤¯µ±¤¤¤¿¡¥¡¥¡¥");
5401 msg_print("Your card gleams with blinding light...");
5403 if (!recharge(1000)) return;
5404 o_ptr->timeout = 200;
5410 if (get_check("ËÜÅö¤Ë»È¤¤¤Þ¤¹¤«¡©"))
5412 if (get_check("Are you sure?!"))
5416 msg_print("¼Àµ¤¬¿Ì¤¨¤¿¡¥¡¥¡¥");
5418 msg_print("The Muramasa pulsates...");
5424 msg_print("¼Àµ¤Ï²õ¤ì¤¿¡ª");
5426 msg_print("The Muramasa is destroyed!");
5428 curse_weapon(TRUE, item);
5436 msg_print("ÀФ¬ÀÄÇò¤¯¸÷¤Ã¤¿¡¥¡¥¡¥");
5438 msg_print("Your stone glows pale...");
5441 if (!get_aim_dir(&dir)) return;
5442 fire_ball(GF_MANA, dir, 400, 4);
5443 o_ptr->timeout = randint0(250) + 250;
5450 if (!get_rep_dir2(&dir)) return;
5454 if (!cave_have_flag_bold(y, x, FF_WATER))
5457 msg_print("¤½¤³¤Ï¿åÊդǤϤʤ¤¡£");
5459 msg_print("There is no fishing place.");
5463 else if (cave[y][x].m_idx)
5466 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
5468 msg_format("%s¤¬¼ÙËâ¤À¡ª", m_name);
5470 msg_format("%^s is stand in your way.", m_name);
5475 set_action(ACTION_FISH);
5476 p_ptr->redraw |= (PR_STATE);
5481 if (!get_aim_dir(&dir)) return;
5483 msg_print("¥à¥Á¤ò¿¤Ð¤·¤¿¡£");
5485 msg_print("You stretched your whip.");
5488 fetch(dir, 500, TRUE);
5489 o_ptr->timeout = randint0(25) + 25;
5494 u32b mode = PM_ALLOW_GROUP;
5495 bool pet = !one_in_(5);
5496 if (pet) mode |= PM_FORCE_PET;
5497 else mode |= PM_NO_PET;
5499 if (summon_specific((pet ? -1 : 0), py, px, ((p_ptr->lev * 3) / 2), SUMMON_HOUND, mode))
5504 msg_print("¥Ï¥¦¥ó¥É¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5506 msg_print("A group of hounds appear as your servant.");
5511 msg_print("¥Ï¥¦¥ó¥É¤Ï¤¢¤Ê¤¿¤Ë²ç¤ò¸þ¤±¤Æ¤¤¤ë¡ª");
5513 msg_print("A group of hounds appear as your enemy!");
5518 o_ptr->timeout = 300 + randint1(150);
5525 msg_print("¥¹¥Ô¥¢¤ÏâÁ¤·¤¯µ±¤¤¤¿...");
5527 msg_print("Your spear grows brightly...");
5530 if (!get_aim_dir(&dir)) return;
5531 fire_ball(GF_LITE, dir, 200, 3);
5532 o_ptr->timeout = randint0(200) + 200;
5539 monster_type *m_ptr;
5544 if (summon_named_creature(0, py, px, MON_SUKE, PM_FORCE_PET))
5547 msg_print("¡Ø½õ¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5549 msg_print("Suke-san apperars.");
5550 kakusan = "Suke-san";
5554 if (summon_named_creature(0, py, px, MON_KAKU, PM_FORCE_PET))
5557 msg_print("¡Ø³Ê¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5559 msg_print("Kaku-san appears.");
5560 kakusan = "Kaku-san";
5566 for (i = m_max - 1; i > 0; i--)
5569 if (!m_ptr->r_idx) continue;
5570 if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
5571 if (!los(m_ptr->fy, m_ptr->fx, py, px)) continue;
5572 if (!projectable(m_ptr->fy, m_ptr->fx, py, px)) continue;
5581 msg_print("¡Ö¼Ô¤É¤â¡¢¤Ò¤«¤¨¤ª¤í¤¦¡ª¡ª¡ª¤³¤Î¤ªÊý¤ò¤É¤Ê¤¿¤È¤³¤³¤í¤¨¤ë¡£¡×");
5583 msg_format("%^s says 'WHO do you think this person is! Bow your head, down your knees!'", kakusan);
5588 confuse_monsters(120);
5590 stasis_monsters(120);
5596 msg_print("¤·¤«¤·¡¢²¿¤âµ¯¤¤Ê¤«¤Ã¤¿¡£");
5598 msg_print("Nothing happen.");
5601 o_ptr->timeout = randint0(150) + 150;
5608 msg_print("Çï»ÒÌÚ¤òÂǤä¿¡£");
5610 msg_print("You beat Your wooden clappers.");
5612 aggravate_monsters(0);
5619 (void)set_afraid(0);
5620 set_hero(randint1(25)+25, FALSE);
5622 o_ptr->timeout = randint0(30) + 30;
5628 (void)set_poisoned(0);
5629 (void)set_confused(0);
5635 o_ptr->timeout = 100;
5641 if (!get_aim_dir(&dir)) return;
5642 (void)charm_animal(dir, p_ptr->lev);
5644 o_ptr->timeout = 200;
5651 msg_print("¥½¡¼¥É¤¬Ã¸¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
5653 msg_print("Your sword glows a pale blue...");
5655 if (!get_aim_dir(&dir)) return;
5656 fire_bolt(GF_COLD, dir, damroll(12, 8));
5657 o_ptr->timeout = 50;
5663 msg_print("³ù¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
5665 msg_print("Your scythe glows brightly!");
5667 get_bloody_moon_flags(o_ptr);
5668 o_ptr->timeout = 3333;
5669 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
5670 p_ptr->update |= (PU_BONUS | PU_HP);
5676 msg_print("Î϶¯¤¯»Í¸Ô¤òƧ¤ó¤À¡£");
5678 msg_print("You stamp. (as if you are in a ring.)");
5680 (void)set_afraid(0);
5681 (void)set_hero(randint1(20) + 20, FALSE);
5682 dispel_evil(p_ptr->lev * 3);
5683 o_ptr->timeout = 100 + randint1(100);
5689 msg_print("¥¯¥í¡¼¥¯¤¬Çò¤¯µ±¤¤¤¿...");
5691 msg_print("Your cloak grows white.");
5693 (void)set_oppose_cold(randint1(20) + 20, FALSE);
5694 o_ptr->timeout = 40 + randint1(40);
5700 msg_print("¥à¥Á¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
5702 msg_print("The whip lets out a shrill wail...");
5706 (void)set_protevil(randint1(25) + k, FALSE);
5707 o_ptr->timeout = randint0(225) + 225;
5712 u32b mode = PM_ALLOW_GROUP;
5713 bool pet = !one_in_(5);
5714 if (pet) mode |= PM_FORCE_PET;
5716 if (summon_named_creature(0, py, px, MON_JIZOTAKO, mode))
5720 msg_print("Âý¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5722 msg_print("A group of octopuses appear as your servant.");
5727 msg_print("Âý¤Ï¤¢¤Ê¤¿¤òâˤó¤Ç¤¤¤ë¡ª");
5729 msg_print("A group of octopuses appear as your enemy!");
5734 o_ptr->timeout = 300 + randint1(150);
5741 msg_print("Å´µå¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
5743 msg_print("The iron ball floods the area with goodness...");
5746 dispel_evil(p_ptr->lev * 5);
5747 o_ptr->timeout = randint0(100) + 100;
5751 case ART_AESCULAPIUS:
5754 msg_print("Ï»¼ÜËÀ¤ÏÇ»Îп§¤Ëµ±¤¤¤Æ¤¤¤ë...");
5756 msg_print("The jo staff glows a deep green...");
5759 (void)do_res_stat(A_STR);
5760 (void)do_res_stat(A_INT);
5761 (void)do_res_stat(A_WIS);
5762 (void)do_res_stat(A_DEX);
5763 (void)do_res_stat(A_CON);
5764 (void)do_res_stat(A_CHR);
5765 (void)restore_level();
5766 o_ptr->timeout = 750;
5773 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤¬¿¼¤¤°Ç¤Ëʤ¤ï¤ì¤¿...");
5775 msg_print("Your amulet is coverd in pitch-darkness...");
5777 if (!get_aim_dir(&dir)) return;
5778 fire_ball(GF_DARK, dir, 250, 4);
5779 o_ptr->timeout = randint0(150) + 150;
5785 msg_print("¼óÎؤ¬¿¼¤¤°Ç¤Ëʤ¤ï¤ì¤¿...");
5787 msg_print("Your collar harness is coverd in pitch-darkness...");
5789 if (!get_aim_dir(&dir)) return;
5790 fire_ball(GF_DARK, dir, 250, 4);
5791 o_ptr->timeout = randint0(150) + 150;
5794 case ART_SACRED_KNIGHTS:
5797 msg_print("¼ó¾þ¤ê¤¬¿¿¼Â¤ò¾È¤é¤·½Ð¤¹...");
5799 msg_print("Your amulet exhibits the truth...");
5801 if (remove_all_curse())
5804 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
5806 msg_print("You feel as if someone is watching over you.");
5815 msg_print("¥Ú¥ó¥À¥ó¥È¤¬ÀÄÇò¤¯¸÷¤Ã¤¿¡¥¡¥¡¥");
5817 msg_print("Your pendant glows pale...");
5819 if (p_ptr->pclass == CLASS_MAGIC_EATER)
5822 for (i = 0; i < EATER_EXT*2; i++)
5824 p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i]*EATER_CHARGE/3;
5825 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;
5827 for (; i < EATER_EXT*3; i++)
5829 int k_idx = lookup_kind(TV_ROD, i-EATER_EXT*2);
5830 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;
5831 if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
5834 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
5836 msg_print("You feel your head clear.");
5838 p_ptr->window |= (PW_PLAYER);
5840 else if (p_ptr->csp < p_ptr->msp)
5842 p_ptr->csp = p_ptr->msp;
5843 p_ptr->csp_frac = 0;
5845 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
5847 msg_print("You feel your head clear.");
5850 p_ptr->redraw |= (PR_MANA);
5851 p_ptr->window |= (PW_PLAYER);
5852 p_ptr->window |= (PW_SPELL);
5854 o_ptr->timeout = 777;
5860 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5866 if (object_is_smith(o_ptr))
5868 switch (o_ptr->xtra3-1)
5870 case ESSENCE_TMP_RES_ACID:
5871 (void)set_oppose_acid(randint1(20) + 20, FALSE);
5872 o_ptr->timeout = randint0(50) + 50;
5875 case ESSENCE_TMP_RES_ELEC:
5876 (void)set_oppose_elec(randint1(20) + 20, FALSE);
5877 o_ptr->timeout = randint0(50) + 50;
5880 case ESSENCE_TMP_RES_FIRE:
5881 (void)set_oppose_fire(randint1(20) + 20, FALSE);
5882 o_ptr->timeout = randint0(50) + 50;
5885 case ESSENCE_TMP_RES_COLD:
5886 (void)set_oppose_cold(randint1(20) + 20, FALSE);
5887 o_ptr->timeout = randint0(50) + 50;
5891 earthquake(py, px, 5);
5892 o_ptr->timeout = 100 + randint1(100);
5895 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5903 if (o_ptr->name2 == EGO_TRUMP)
5905 teleport_player(100, 0L);
5906 o_ptr->timeout = 50 + randint1(50);
5909 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5916 if (o_ptr->name2 == EGO_LITE_ILLUMINATION)
5918 if (!o_ptr->xtra4 && ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
5921 msg_print("dzÎÁ¤¬¤Ê¤¤¡£");
5923 msg_print("It has no fuel.");
5928 lite_area(damroll(2, 15), 3);
5929 o_ptr->timeout = randint0(10) + 10;
5932 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5938 if (o_ptr->name2 == EGO_EARTHQUAKES)
5940 earthquake(py, px, 5);
5941 o_ptr->timeout = 100 + randint1(100);
5944 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5951 if (o_ptr->name2 == EGO_JUMP)
5953 teleport_player(10, 0L);
5954 o_ptr->timeout = 10 + randint1(10);
5957 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5964 /* Hack -- Dragon Scale Mail can be activated as well */
5965 if (o_ptr->tval == TV_DRAG_ARMOR)
5967 /* Get a direction for breathing (or abort) */
5968 if (!get_aim_dir(&dir)) return;
5970 if (music_singing_any()) stop_singing();
5971 if (hex_spelling_any()) stop_hex_spell_all();
5973 /* Branch on the sub-type */
5974 switch (o_ptr->sval)
5976 case SV_DRAGON_BLUE:
5979 msg_print("¤¢¤Ê¤¿¤Ï°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5981 msg_print("You breathe lightning.");
5984 fire_ball(GF_ELEC, dir, 100, -2);
5985 o_ptr->timeout = randint0(150) + 150;
5989 case SV_DRAGON_WHITE:
5992 msg_print("¤¢¤Ê¤¿¤ÏÎ䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5994 msg_print("You breathe frost.");
5997 fire_ball(GF_COLD, dir, 110, -2);
5998 o_ptr->timeout = randint0(150) + 150;
6002 case SV_DRAGON_BLACK:
6005 msg_print("¤¢¤Ê¤¿¤Ï»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6007 msg_print("You breathe acid.");
6010 fire_ball(GF_ACID, dir, 130, -2);
6011 o_ptr->timeout = randint0(150) + 150;
6015 case SV_DRAGON_GREEN:
6018 msg_print("¤¢¤Ê¤¿¤ÏÆÇ¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6020 msg_print("You breathe poison gas.");
6023 fire_ball(GF_POIS, dir, 150, -2);
6024 o_ptr->timeout = randint0(180) + 180;
6031 msg_print("¤¢¤Ê¤¿¤Ï²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6033 msg_print("You breathe fire.");
6036 fire_ball(GF_FIRE, dir, 200, -2);
6037 o_ptr->timeout = randint0(200) + 200;
6041 case SV_DRAGON_MULTIHUED:
6043 chance = randint0(5);
6045 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
6046 ((chance == 1) ? "°ðºÊ" :
6047 ((chance == 2) ? "Î䵤" :
6048 ((chance == 3) ? "»À" :
6049 ((chance == 4) ? "ÆÇ¥¬¥¹" : "²Ð±ê")))));
6051 msg_format("You breathe %s.",
6052 ((chance == 1) ? "lightning" :
6053 ((chance == 2) ? "frost" :
6054 ((chance == 3) ? "acid" :
6055 ((chance == 4) ? "poison gas" : "fire")))));
6058 fire_ball(((chance == 1) ? GF_ELEC :
6059 ((chance == 2) ? GF_COLD :
6060 ((chance == 3) ? GF_ACID :
6061 ((chance == 4) ? GF_POIS : GF_FIRE)))),
6063 o_ptr->timeout = randint0(200) + 200;
6067 case SV_DRAGON_BRONZE:
6070 msg_print("¤¢¤Ê¤¿¤Ïº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6072 msg_print("You breathe confusion.");
6075 fire_ball(GF_CONFUSION, dir, 120, -2);
6076 o_ptr->timeout = randint0(180) + 180;
6080 case SV_DRAGON_GOLD:
6083 msg_print("¤¢¤Ê¤¿¤Ï¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6085 msg_print("You breathe sound.");
6088 fire_ball(GF_SOUND, dir, 130, -2);
6089 o_ptr->timeout = randint0(180) + 180;
6093 case SV_DRAGON_CHAOS:
6095 chance = randint0(2);
6097 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
6098 ((chance == 1 ? "¥«¥ª¥¹" : "Îô²½")));
6100 msg_format("You breathe %s.",
6101 ((chance == 1 ? "chaos" : "disenchantment")));
6104 fire_ball((chance == 1 ? GF_CHAOS : GF_DISENCHANT),
6106 o_ptr->timeout = randint0(200) + 200;
6112 chance = randint0(2);
6114 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
6115 ((chance == 1 ? "¹ì²»" : "ÇËÊÒ")));
6117 msg_format("You breathe %s.",
6118 ((chance == 1 ? "sound" : "shards")));
6121 fire_ball((chance == 1 ? GF_SOUND : GF_SHARDS),
6123 o_ptr->timeout = randint0(200) + 200;
6127 case SV_DRAGON_BALANCE:
6129 chance = randint0(4);
6131 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿",
6132 ((chance == 1) ? "¥«¥ª¥¹" :
6133 ((chance == 2) ? "Îô²½" :
6134 ((chance == 3) ? "¹ì²»" : "ÇËÊÒ"))));
6136 msg_format("You breathe %s.",
6137 ((chance == 1) ? "chaos" :
6138 ((chance == 2) ? "disenchantment" :
6139 ((chance == 3) ? "sound" : "shards"))));
6142 fire_ball(((chance == 1) ? GF_CHAOS :
6143 ((chance == 2) ? GF_DISENCHANT :
6144 ((chance == 3) ? GF_SOUND : GF_SHARDS))),
6146 o_ptr->timeout = randint0(200) + 200;
6150 case SV_DRAGON_SHINING:
6152 chance = randint0(2);
6154 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
6155 ((chance == 0 ? "Á®¸÷" : "°Å¹õ")));
6157 msg_format("You breathe %s.",
6158 ((chance == 0 ? "light" : "darkness")));
6161 fire_ball((chance == 0 ? GF_LITE : GF_DARK), dir, 200, -2);
6162 o_ptr->timeout = randint0(200) + 200;
6166 case SV_DRAGON_POWER:
6169 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6171 msg_print("You breathe the elements.");
6174 fire_ball(GF_MISSILE, dir, 300, -3);
6175 o_ptr->timeout = randint0(200) + 200;
6181 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6187 else if (o_ptr->tval == TV_RING)
6189 if (object_is_ego(o_ptr))
6191 bool success = TRUE;
6193 switch (o_ptr->name2)
6196 (void)set_afraid(0);
6197 (void)set_hero(randint1(25) + 25, FALSE);
6198 (void)hp_player(10);
6199 o_ptr->timeout = randint1(100)+100;
6201 case EGO_RING_MAGIC_MIS:
6202 if (!get_aim_dir(&dir)) return;
6203 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
6206 case EGO_RING_FIRE_BOLT:
6207 if (!get_aim_dir(&dir)) return;
6208 fire_bolt(GF_FIRE, dir, damroll(9, 8));
6209 o_ptr->timeout = randint0(8) + 8;
6211 case EGO_RING_COLD_BOLT:
6212 if (!get_aim_dir(&dir)) return;
6213 fire_bolt(GF_COLD, dir, damroll(6, 8));
6214 o_ptr->timeout = randint0(7) + 7;
6216 case EGO_RING_ELEC_BOLT:
6217 if (!get_aim_dir(&dir)) return;
6218 fire_bolt(GF_ELEC, dir, damroll(4, 8));
6219 o_ptr->timeout = randint0(5) + 5;
6221 case EGO_RING_ACID_BOLT:
6222 if (!get_aim_dir(&dir)) return;
6223 fire_bolt(GF_ACID, dir, damroll(5, 8));
6224 o_ptr->timeout = randint0(6) + 6;
6226 case EGO_RING_MANA_BOLT:
6227 if (!get_aim_dir(&dir)) return;
6228 fire_bolt(GF_MANA, dir, 120);
6229 o_ptr->timeout = randint0(120)+120;
6231 case EGO_RING_FIRE_BALL:
6232 if (!get_aim_dir(&dir)) return;
6233 fire_ball(GF_FIRE, dir, 100, 2);
6234 o_ptr->timeout = randint0(80) + 80;
6236 case EGO_RING_COLD_BALL:
6237 if (!get_aim_dir(&dir)) return;
6238 fire_ball(GF_COLD, dir, 100, 2);
6239 o_ptr->timeout = randint0(80) + 80;
6241 case EGO_RING_ELEC_BALL:
6242 if (!get_aim_dir(&dir)) return;
6243 fire_ball(GF_ELEC, dir, 100, 2);
6244 o_ptr->timeout = randint0(80) + 80;
6246 case EGO_RING_ACID_BALL:
6247 if (!get_aim_dir(&dir)) return;
6248 fire_ball(GF_ACID, dir, 100, 2);
6249 o_ptr->timeout = randint0(80) + 80;
6251 case EGO_RING_MANA_BALL:
6252 if (!get_aim_dir(&dir)) return;
6253 fire_ball(GF_MANA, dir, 250, 2);
6254 o_ptr->timeout = 300;
6256 case EGO_RING_DRAGON_F:
6257 if (!get_aim_dir(&dir)) return;
6258 fire_ball(GF_FIRE, dir, 200, -2);
6259 if (o_ptr->sval == SV_RING_FLAMES)
6261 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6262 o_ptr->timeout = 200;
6264 else o_ptr->timeout = 250;
6266 case EGO_RING_DRAGON_C:
6267 if (!get_aim_dir(&dir)) return;
6268 fire_ball(GF_COLD, dir, 200, -2);
6269 if (o_ptr->sval == SV_RING_ICE)
6271 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6272 o_ptr->timeout = 200;
6274 else o_ptr->timeout = 250;
6276 case EGO_RING_M_DETECT:
6277 (void)detect_monsters_invis(255);
6278 (void)detect_monsters_normal(255);
6279 o_ptr->timeout = 150;
6281 case EGO_RING_D_SPEED:
6282 (void)set_fast(randint1(30) + 15, FALSE);
6283 o_ptr->timeout = 100;
6285 case EGO_RING_BERSERKER:
6286 (void)set_afraid(0);
6287 (void)set_shero(randint1(25) + 25, FALSE);
6288 o_ptr->timeout = randint0(75)+75;
6290 case EGO_RING_TELE_AWAY:
6291 if (!get_aim_dir(&dir)) return;
6292 teleport_monster(dir);
6293 o_ptr->timeout = 150;
6297 int v = randint1(25)+25;
6298 (void)set_afraid(0);
6299 (void)set_hero(v, FALSE);
6300 (void)hp_player(10);
6301 (void)set_blessed(v, FALSE);
6302 (void)set_oppose_acid(v, FALSE);
6303 (void)set_oppose_elec(v, FALSE);
6304 (void)set_oppose_fire(v, FALSE);
6305 (void)set_oppose_cold(v, FALSE);
6306 (void)set_oppose_pois(v, FALSE);
6307 (void)set_ultimate_res(v, FALSE);
6308 o_ptr->timeout = 777;
6315 if (success) return;
6318 /* Get a direction for breathing (or abort) */
6319 if (!get_aim_dir(&dir)) return;
6321 switch (o_ptr->sval)
6325 fire_ball(GF_ACID, dir, 100, 2);
6326 (void)set_oppose_acid(randint1(20) + 20, FALSE);
6327 o_ptr->timeout = randint0(50) + 50;
6333 fire_ball(GF_COLD, dir, 100, 2);
6334 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6335 o_ptr->timeout = randint0(50) + 50;
6339 case SV_RING_FLAMES:
6341 fire_ball(GF_FIRE, dir, 100, 2);
6342 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6343 o_ptr->timeout = randint0(50) + 50;
6349 fire_ball(GF_ELEC, dir, 100, 2);
6350 (void)set_oppose_elec(randint1(20) + 20, FALSE);
6351 o_ptr->timeout = randint0(50) + 50;
6357 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6363 else if (o_ptr->tval == TV_AMULET)
6365 if (object_is_ego(o_ptr))
6367 switch (o_ptr->name2)
6370 if (!ident_spell(FALSE)) return;
6371 o_ptr->timeout = 10;
6374 if (!get_aim_dir(&dir)) return;
6375 charm_monster(dir, MAX(20, p_ptr->lev));
6376 o_ptr->timeout = 200;
6379 teleport_player(10, 0L);
6380 o_ptr->timeout = randint0(10) + 10;
6382 case EGO_AMU_TELEPORT:
6383 teleport_player(100, 0L);
6384 o_ptr->timeout = randint0(50) + 50;
6386 case EGO_AMU_D_DOOR:
6387 (void)dimension_door();
6388 o_ptr->timeout = 200;
6390 case EGO_AMU_RES_FIRE_:
6391 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6392 o_ptr->timeout = randint0(50) + 50;
6394 case EGO_AMU_RES_COLD_:
6395 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6396 o_ptr->timeout = randint0(50) + 50;
6398 case EGO_AMU_RES_ELEC_:
6399 (void)set_oppose_elec(randint1(20) + 20, FALSE);
6400 o_ptr->timeout = randint0(50) + 50;
6402 case EGO_AMU_RES_ACID_:
6403 (void)set_oppose_acid(randint1(20) + 20, FALSE);
6404 o_ptr->timeout = randint0(50) + 50;
6406 case EGO_AMU_DETECTION:
6407 detect_all(DETECT_RAD_DEFAULT);
6408 o_ptr->timeout = randint0(55)+55;
6415 else if (o_ptr->tval == TV_WHISTLE)
6417 if (music_singing_any()) stop_singing();
6418 if (hex_spelling_any()) stop_hex_spell_all();
6421 if (object_is_cursed(o_ptr))
6424 msg_print("¥«¥ó¹â¤¤²»¤¬¶Á¤ÅϤä¿¡£");
6426 msg_print("You produce a shrill whistling sound.");
6428 aggravate_monsters(0);
6438 /* Allocate the "who" array */
6439 C_MAKE(who, max_m_idx, u16b);
6441 /* Process the monsters (backwards) */
6442 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6444 if (is_pet(&m_list[pet_ctr]) && (p_ptr->riding != pet_ctr))
6445 who[max_pet++] = pet_ctr;
6448 /* Select the sort method */
6449 ang_sort_comp = ang_sort_comp_pet;
6450 ang_sort_swap = ang_sort_swap_hook;
6452 ang_sort(who, &dummy_why, max_pet);
6454 /* Process the monsters (backwards) */
6455 for (i = 0; i < max_pet; i++)
6458 teleport_monster_to(pet_ctr, py, px, 100, TELEPORT_PASSIVE);
6461 /* Free the "who" array */
6462 C_KILL(who, max_m_idx, u16b);
6464 o_ptr->timeout = 100+randint1(100);
6467 else if (o_ptr->tval == TV_CAPTURE)
6471 bool old_target_pet = target_pet;
6473 if (!get_aim_dir(&dir))
6475 target_pet = old_target_pet;
6478 target_pet = old_target_pet;
6480 if(fire_ball(GF_CAPTURE, dir, 0, 0))
6482 o_ptr->pval = cap_mon;
6483 o_ptr->xtra3 = cap_mspeed;
6484 o_ptr->xtra4 = cap_hp;
6485 o_ptr->xtra5 = cap_maxhp;
6492 if (o_ptr->inscription)
6493 strcpy(buf, quark_str(o_ptr->inscription));
6495 for (s = buf;*s && (*s != '#'); s++)
6498 if (iskanji(*s)) s++;
6508 t = quark_str(cap_nickname);
6521 o_ptr->inscription = quark_add(buf);
6527 bool success = FALSE;
6528 if (!get_rep_dir2(&dir)) return;
6529 if (monster_can_enter(py + ddy[dir], px + ddx[dir], &r_info[o_ptr->pval], 0))
6531 if (place_monster_aux(0, py + ddy[dir], px + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
6533 if (o_ptr->xtra3) m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
6534 if (o_ptr->xtra5) m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
6535 if (o_ptr->xtra4) m_list[hack_m_idx_ii].hp = o_ptr->xtra4;
6536 m_list[hack_m_idx_ii].maxhp = m_list[hack_m_idx_ii].max_maxhp;
6537 if (o_ptr->inscription)
6545 t = quark_str(o_ptr->inscription);
6546 for (t = quark_str(o_ptr->inscription);*t && (*t != '#'); t++)
6549 if (iskanji(*t)) t++;
6574 if (quote && *(s-1) =='\'')
6578 m_list[hack_m_idx_ii].nickname = quark_add(buf);
6579 t = quark_str(o_ptr->inscription);
6581 while(*t && (*t != '#'))
6588 o_ptr->inscription = quark_add(buf);
6600 msg_print("¤ª¤Ã¤È¡¢²òÊü¤Ë¼ºÇÔ¤·¤¿¡£");
6602 msg_print("Oops. You failed to release your pet.");
6610 msg_print("¤ª¤Ã¤È¡¢¤³¤Î¥¢¥¤¥Æ¥à¤Ï»ÏÆ°¤Ç¤¤Ê¤¤¡£");
6612 msg_print("Oops. That object cannot be activated.");
6618 void do_cmd_activate(void)
6624 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6626 set_action(ACTION_NONE);
6629 item_tester_no_ryoute = TRUE;
6630 /* Prepare the hook */
6631 item_tester_hook = item_tester_hook_activate;
6635 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò»ÏÆ°¤µ¤»¤Þ¤¹¤«? ";
6636 s = "»ÏÆ°¤Ç¤¤ë¥¢¥¤¥Æ¥à¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£";
6638 q = "Activate which item? ";
6639 s = "You have nothing to activate.";
6642 if (!get_item(&item, q, s, (USE_EQUIP))) return;
6644 /* Activate the item */
6645 do_cmd_activate_aux(item);
6650 * Hook to determine if an object is useable
6652 static bool item_tester_hook_use(object_type *o_ptr)
6654 u32b flgs[TR_FLAG_SIZE];
6657 if (o_ptr->tval == p_ptr->tval_ammo)
6660 /* Useable object */
6661 switch (o_ptr->tval)
6679 if (!object_is_known(o_ptr)) return (FALSE);
6681 /* HACK - only items from the equipment can be activated */
6682 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
6684 if (&inventory[i] == o_ptr)
6686 /* Extract the flags */
6687 object_flags(o_ptr, flgs);
6689 /* Check activation flag */
6690 if (have_flag(flgs, TR_ACTIVATE)) return (TRUE);
6703 * XXX - Add actions for other item types
6705 void do_cmd_use(void)
6711 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6713 set_action(ACTION_NONE);
6716 item_tester_no_ryoute = TRUE;
6717 /* Prepare the hook */
6718 item_tester_hook = item_tester_hook_use;
6722 q = "¤É¤ì¤ò»È¤¤¤Þ¤¹¤«¡©";
6723 s = "»È¤¨¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤»¤ó¡£";
6725 q = "Use which item? ";
6726 s = "You have nothing to use.";
6729 if (!get_item(&item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR))) return;
6731 /* Get the item (in the pack) */
6734 o_ptr = &inventory[item];
6736 /* Get the item (on the floor) */
6739 o_ptr = &o_list[0 - item];
6742 switch (o_ptr->tval)
6754 do_cmd_eat_food_aux(item);
6761 do_cmd_aim_wand_aux(item);
6768 do_cmd_use_staff_aux(item);
6775 do_cmd_zap_rod_aux(item);
6779 /* Quaff a potion */
6782 do_cmd_quaff_potion_aux(item);
6789 /* Check some conditions */
6793 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡£");
6795 msg_print("You can't see anything.");
6803 msg_print("ÌÀ¤«¤ê¤¬¤Ê¤¤¤Î¤Ç¡¢°Å¤¯¤ÆÆɤá¤Ê¤¤¡£");
6805 msg_print("You have no light to read by.");
6810 if (p_ptr->confused)
6813 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
6815 msg_print("You are too confused!");
6821 do_cmd_read_scroll_aux(item, TRUE);
6830 do_cmd_fire_aux(item, &inventory[INVEN_BOW]);
6834 /* Activate an artifact */
6837 do_cmd_activate_aux(item);
6843 static int select_magic_eater(bool only_browse)
6847 bool flag, request_list;
6849 int ask = TRUE, i = 0;
6852 int menu_line = (use_menu ? 1 : 0);
6856 if (repeat_pull(&sn))
6858 /* Verify the spell */
6859 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))
6861 else if (sn < EATER_EXT*2 && !(p_ptr->magic_num1[sn] < EATER_CHARGE))
6865 #endif /* ALLOW_REPEAT */
6867 for (i = 0; i < 108; i++)
6869 if (p_ptr->magic_num2[i]) break;
6874 msg_print("ËâË¡¤ò³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6876 msg_print("You don't have any magic!");
6888 prt(format(" %s ¾ó", (menu_line == 1) ? "¡Õ" : " "), 2, 14);
6889 prt(format(" %s ËâË¡ËÀ", (menu_line == 2) ? "¡Õ" : " "), 3, 14);
6890 prt(format(" %s ¥í¥Ã¥É", (menu_line == 3) ? "¡Õ" : " "), 4, 14);
6891 prt("¤É¤Î¼ïÎà¤ÎËâË¡¤ò»È¤¤¤Þ¤¹¤«¡©", 0, 0);
6893 prt(format(" %s staff", (menu_line == 1) ? "> " : " "), 2, 14);
6894 prt(format(" %s wand", (menu_line == 2) ? "> " : " "), 3, 14);
6895 prt(format(" %s rod", (menu_line == 3) ? "> " : " "), 4, 14);
6896 prt("Which type of magic do you use?", 0, 0);
6919 ext = (menu_line-1)*EATER_EXT;
6920 if (menu_line == 1) tval = TV_STAFF;
6921 else if (menu_line == 2) tval = TV_WAND;
6925 if (menu_line > 3) menu_line -= 3;
6934 if (!get_com("[A] ¾ó, [B] ËâË¡ËÀ, [C] ¥í¥Ã¥É:", &choice, TRUE))
6936 if (!get_com("[A] staff, [B] wand, [C] rod:", &choice, TRUE))
6941 if (choice == 'A' || choice == 'a')
6947 if (choice == 'B' || choice == 'b')
6953 if (choice == 'C' || choice == 'c')
6961 for (i = ext; i < ext + EATER_EXT; i++)
6963 if (p_ptr->magic_num2[i])
6965 if (use_menu) menu_line = i-ext+1;
6969 if (i == ext+EATER_EXT)
6972 msg_print("¤½¤Î¼ïÎà¤ÎËâË¡¤Ï³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6974 msg_print("You don't have that type of magic!");
6979 /* Nothing chosen yet */
6982 /* Build a prompt */
6984 (void) strnfmt(out_val, 78, "('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎËâÎϤò»È¤¤¤Þ¤¹¤«¡©");
6986 (void)strnfmt(out_val, 78, "(*=List, ESC=exit) Use which power? ");
6989 /* Save the screen */
6992 request_list = always_show_list;
6994 /* Get a spell from the user */
6998 if (request_list || use_menu)
7009 for (y = 1; y < 20; y++)
7014 /* Print header(s) */
7016 prt(format(" %s ¼ºÎ¨ %s ¼ºÎ¨", (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô"), (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô")), y++, x);
7018 prt(format(" %s Fail %s Fail", (tval == TV_ROD ? " Stat " : " Charges"), (tval == TV_ROD ? " Stat " : " Charges")), y++, x);
7022 for (ctr = 0; ctr < EATER_EXT; ctr++)
7024 if (!p_ptr->magic_num2[ctr+ext]) continue;
7026 k_idx = lookup_kind(tval, ctr);
7030 if (ctr == (menu_line-1))
7032 strcpy(dummy, "¡Õ");
7034 strcpy(dummy, "> ");
7036 else strcpy(dummy, " ");
7039 /* letter/number for power selection */
7046 letter = '0' + ctr - 26;
7047 sprintf(dummy, "%c)",letter);
7049 x1 = ((ctr < EATER_EXT/2) ? x : x + 40);
7050 y1 = ((ctr < EATER_EXT/2) ? y + ctr : y + ctr - EATER_EXT/2);
7051 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
7052 chance = level * 4 / 5 + 20;
7053 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
7055 if (p_ptr->lev > level)
7057 chance -= 3 * (p_ptr->lev - level);
7059 chance = mod_spell_chance_1(chance);
7060 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
7061 /* Stunning makes spells harder */
7062 if (p_ptr->stun > 50) chance += 25;
7063 else if (p_ptr->stun) chance += 15;
7065 if (chance > 95) chance = 95;
7067 chance = mod_spell_chance_2(chance);
7075 strcat(dummy, format(
7077 " %-22.22s ½¼Å¶:%2d/%2d%3d%%",
7079 " %-22.22s (%2d/%2d) %3d%%",
7081 k_name + k_info[k_idx].name,
7082 p_ptr->magic_num1[ctr+ext] ?
7083 (p_ptr->magic_num1[ctr+ext] - 1) / (EATER_ROD_CHARGE * k_info[k_idx].pval) +1 : 0,
7084 p_ptr->magic_num2[ctr+ext], chance));
7085 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;
7089 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));
7090 if (p_ptr->magic_num1[ctr+ext] < EATER_CHARGE) col = TERM_RED;
7095 c_prt(col, dummy, y1, x1);
7099 if (!get_com(out_val, &choice, FALSE)) break;
7101 if (use_menu && choice != ' ')
7117 menu_line += EATER_EXT - 1;
7118 if (menu_line > EATER_EXT) menu_line -= EATER_EXT;
7119 } while(!p_ptr->magic_num2[menu_line+ext-1]);
7130 if (menu_line > EATER_EXT) menu_line -= EATER_EXT;
7131 } while(!p_ptr->magic_num2[menu_line+ext-1]);
7142 bool reverse = FALSE;
7143 if ((choice == '4') || (choice == 'h') || (choice == 'H')) reverse = TRUE;
7144 if (menu_line > EATER_EXT/2)
7146 menu_line -= EATER_EXT/2;
7149 else menu_line+=EATER_EXT/2;
7150 while(!p_ptr->magic_num2[menu_line+ext-1])
7155 if (menu_line < 2) reverse = FALSE;
7160 if (menu_line > EATER_EXT-1) reverse = TRUE;
7177 /* Request redraw */
7178 if (use_menu && ask) continue;
7180 /* Request redraw */
7181 if (!use_menu && ((choice == ' ') || (choice == '*') || (choice == '?')))
7187 request_list = FALSE;
7189 /* Restore the screen */
7194 request_list = TRUE;
7202 if (isalpha(choice))
7205 ask = (isupper(choice));
7208 if (ask) choice = tolower(choice);
7210 /* Extract request */
7211 i = (islower(choice) ? A2I(choice) : -1);
7215 ask = FALSE; /* Can't uppercase digits */
7217 i = choice - '0' + 26;
7221 /* Totally Illegal */
7222 if ((i < 0) || (i > EATER_EXT) || !p_ptr->magic_num2[i+ext])
7237 (void) strnfmt(tmp_val, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", k_name + k_info[lookup_kind(tval ,i)].name);
7239 (void) strnfmt(tmp_val, 78, "Use %s?", k_name + k_info[lookup_kind(tval ,i)].name);
7242 /* Belay that order */
7243 if (!get_check(tmp_val)) continue;
7247 if (p_ptr->magic_num1[ext+i] > k_info[lookup_kind(tval, i)].pval * (p_ptr->magic_num2[ext+i] - 1) * EATER_ROD_CHARGE)
7250 msg_print("¤½¤ÎËâË¡¤Ï¤Þ¤À½¼Å¶¤·¤Æ¤¤¤ëºÇÃæ¤À¡£");
7252 msg_print("The magic are still charging.");
7255 if (use_menu) ask = TRUE;
7261 if (p_ptr->magic_num1[ext+i] < EATER_CHARGE)
7264 msg_print("¤½¤ÎËâË¡¤Ï»ÈÍѲó¿ô¤¬ÀÚ¤ì¤Æ¤¤¤ë¡£");
7266 msg_print("The magic has no charges left.");
7269 if (use_menu) ask = TRUE;
7281 /* Clear lines, position cursor (really should use strlen here) */
7282 Term_erase(7, 23, 255);
7283 Term_erase(7, 22, 255);
7284 Term_erase(7, 21, 255);
7285 Term_erase(7, 20, 255);
7287 roff_to_buf(k_text + k_info[lookup_kind(tval, i)].text, 62, temp, sizeof(temp));
7288 for (j = 0, line = 21; temp[j]; j += 1 + strlen(&temp[j]))
7290 prt(&temp[j], line, 10);
7295 prt("²¿¤«¥¡¼¤ò²¡¤·¤Æ²¼¤µ¤¤¡£",0,0);
7297 prt("Hit any key.",0,0);
7307 /* Restore the screen */
7310 if (!flag) return -1;
7314 #endif /* ALLOW_REPEAT */
7320 * Use eaten rod, wand or staff
7322 void do_cmd_magic_eater(bool only_browse)
7324 int item, chance, level, k_idx, tval, sval;
7325 bool use_charge = TRUE;
7327 /* Not when confused */
7328 if (!only_browse && p_ptr->confused)
7331 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
7333 msg_print("You are too confused!");
7339 item = select_magic_eater(only_browse);
7345 if (item >= EATER_EXT*2) {tval = TV_ROD;sval = item - EATER_EXT*2;}
7346 else if (item >= EATER_EXT) {tval = TV_WAND;sval = item - EATER_EXT;}
7347 else {tval = TV_STAFF;sval = item;}
7348 k_idx = lookup_kind(tval, sval);
7350 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
7351 chance = level * 4 / 5 + 20;
7352 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
7354 if (p_ptr->lev > level)
7356 chance -= 3 * (p_ptr->lev - level);
7358 chance = mod_spell_chance_1(chance);
7359 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
7360 /* Stunning makes spells harder */
7361 if (p_ptr->stun > 50) chance += 25;
7362 else if (p_ptr->stun) chance += 15;
7364 if (chance > 95) chance = 95;
7366 chance = mod_spell_chance_2(chance);
7368 if (randint0(100) < chance)
7370 if (flush_failure) flush();
7373 msg_print("¼öʸ¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª");
7375 msg_format("You failed to get the magic off!");
7379 if (randint1(100) >= chance)
7380 chg_virtue(V_CHANCE,-1);
7391 if ((sval >= SV_ROD_MIN_DIRECTION) && (sval != SV_ROD_HAVOC) && (sval != SV_ROD_AGGRAVATE) && (sval != SV_ROD_PESTICIDE))
7392 if (!get_aim_dir(&dir)) return;
7393 rod_effect(sval, dir, &use_charge, TRUE);
7394 if (!use_charge) return;
7396 else if (tval == TV_WAND)
7398 if (!get_aim_dir(&dir)) return;
7399 wand_effect(sval, dir, TRUE);
7403 staff_effect(sval, &use_charge, TRUE, TRUE);
7404 if (!use_charge) return;
7406 if (randint1(100) < chance)
7407 chg_virtue(V_CHANCE,1);
7410 if (tval == TV_ROD) p_ptr->magic_num1[item] += k_info[k_idx].pval * EATER_ROD_CHARGE;
7411 else p_ptr->magic_num1[item] -= EATER_CHARGE;