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);
523 /* Don't eat a staff/wand itself */
526 else if ((prace_is_(RACE_DEMON) ||
527 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON)) &&
528 (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_CORPSE &&
529 my_strchr("pht", r_info[o_ptr->pval].d_char)))
531 /* Drain vitality of humanoids */
532 char o_name[MAX_NLEN];
534 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
537 msg_format("%s¤Ïdz¤¨¾å¤ê³¥¤Ë¤Ê¤Ã¤¿¡£ÀºÎϤòµÛ¼ý¤·¤¿µ¤¤¬¤¹¤ë¡£", o_name);
539 msg_format("%^s is burnt to ashes. You absorb its vitality!", o_name);
541 (void)set_food(PY_FOOD_MAX - 1);
543 else if (prace_is_(RACE_SKELETON))
546 if (o_ptr->tval == TV_SKELETON ||
547 (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))
550 msg_print("¤¢¤Ê¤¿¤Ï¹ü¤Ç¼«Ê¬¤ÎÂΤòÊä¤Ã¤¿¡£");
552 msg_print("Your body absorbs the bone.");
554 set_food(p_ptr->food + 5000);
559 if (!((o_ptr->sval == SV_FOOD_WAYBREAD) ||
560 (o_ptr->sval < SV_FOOD_BISCUIT)))
563 object_type *q_ptr = &forge;
566 msg_print("¿©¤Ùʪ¤¬¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¤¿¡ª");
568 msg_print("The food falls through your jaws!");
572 /* Create the item */
573 object_prep(q_ptr, lookup_kind(o_ptr->tval, o_ptr->sval));
575 /* Drop the object from heaven */
576 (void)drop_near(q_ptr, -1, py, px);
581 msg_print("¿©¤Ùʪ¤¬¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¡¢¾Ã¤¨¤¿¡ª");
583 msg_print("The food falls through your jaws and vanishes!");
588 else if (prace_is_(RACE_GOLEM) ||
589 prace_is_(RACE_ZOMBIE) ||
590 prace_is_(RACE_ENT) ||
591 prace_is_(RACE_DEMON) ||
592 prace_is_(RACE_ANDROID) ||
593 prace_is_(RACE_SPECTRE) ||
594 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
597 msg_print("À¸¼Ô¤Î¿©Êª¤Ï¤¢¤Ê¤¿¤Ë¤È¤Ã¤Æ¤Û¤È¤ó¤É±ÉÍܤˤʤé¤Ê¤¤¡£");
599 msg_print("The food of mortals is poor sustenance for you.");
602 set_food(p_ptr->food + ((o_ptr->pval) / 20));
604 else if (o_ptr->tval == TV_FOOD && o_ptr->sval == SV_FOOD_WAYBREAD)
606 /* Waybread is always fully satisfying. */
607 set_food(MAX(p_ptr->food, PY_FOOD_MAX - 1));
611 /* Food can feed the player */
612 (void)set_food(p_ptr->food + o_ptr->pval);
615 /* Destroy a food in the pack */
618 inven_item_increase(item, -1);
619 inven_item_describe(item);
620 inven_item_optimize(item);
623 /* Destroy a food on the floor */
626 floor_item_increase(0 - item, -1);
627 floor_item_describe(0 - item);
628 floor_item_optimize(0 - item);
634 * Hook to determine if an object is eatable
636 static bool item_tester_hook_eatable(object_type *o_ptr)
638 if (o_ptr->tval==TV_FOOD) return TRUE;
641 if (prace_is_(RACE_SKELETON))
643 if (o_ptr->tval == TV_SKELETON ||
644 (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))
650 if (prace_is_(RACE_SKELETON) ||
651 prace_is_(RACE_GOLEM) ||
652 prace_is_(RACE_ZOMBIE) ||
653 prace_is_(RACE_SPECTRE))
655 if (o_ptr->tval == TV_STAFF || o_ptr->tval == TV_WAND)
658 else if (prace_is_(RACE_DEMON) ||
659 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON))
661 if (o_ptr->tval == TV_CORPSE &&
662 o_ptr->sval == SV_CORPSE &&
663 my_strchr("pht", r_info[o_ptr->pval].d_char))
673 * Eat some food (from the pack or floor)
675 void do_cmd_eat_food(void)
681 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
683 set_action(ACTION_NONE);
686 /* Restrict choices to food */
687 item_tester_hook = item_tester_hook_eatable;
691 q = "¤É¤ì¤ò¿©¤Ù¤Þ¤¹¤«? ";
692 s = "¿©¤Ùʪ¤¬¤Ê¤¤¡£";
694 q = "Eat which item? ";
695 s = "You have nothing to eat.";
698 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
701 do_cmd_eat_food_aux(item);
706 * Quaff a potion (from the pack or the floor)
708 static void do_cmd_quaff_potion_aux(int item)
721 if (flush_failure) flush();
723 msg_print("ÉÓ¤«¤é¿å¤¬Î®¤ì½Ð¤Æ¤³¤Ê¤¤¡ª");
725 msg_print("The potion doesn't flow out from a bottle.");
732 if (music_singing_any()) stop_singing();
733 if (hex_spelling_any())
735 if (!hex_spelling(HEX_INHAIL)) stop_hex_spell_all();
738 /* Get the item (in the pack) */
741 o_ptr = &inventory[item];
744 /* Get the item (on the floor) */
747 o_ptr = &o_list[0 - item];
750 /* Get local object */
753 /* Obtain a local object */
754 object_copy(q_ptr, o_ptr);
759 /* Reduce and describe inventory */
762 inven_item_increase(item, -1);
763 inven_item_describe(item);
764 inven_item_optimize(item);
767 /* Reduce and describe floor item */
770 floor_item_increase(0 - item, -1);
771 floor_item_describe(0 - item);
772 floor_item_optimize(0 - item);
779 /* Not identified yet */
783 lev = k_info[q_ptr->k_idx].level;
785 /* Analyze the potion */
786 if (q_ptr->tval == TV_POTION)
791 /* °û¤ß¤´¤¿¤¨¤ò¥ª¥ê¥¸¥Ê¥ë¤è¤êºÙ¤«¤¯É½¸½ */
792 case SV_POTION_WATER:
793 msg_print("¸ý¤ÎÃ椬¤µ¤Ã¤Ñ¤ê¤·¤¿¡£");
794 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
798 case SV_POTION_APPLE_JUICE:
799 msg_print("´Å¤¯¤Æ¥µ¥Ã¥Ñ¥ê¤È¤·¤Æ¤¤¤Æ¡¢¤È¤Æ¤â¤ª¤¤¤·¤¤¡£");
800 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
804 case SV_POTION_SLIME_MOLD:
805 msg_print("¤Ê¤ó¤È¤âÉÔµ¤Ì£¤ÊÌ£¤À¡£");
806 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
811 case SV_POTION_WATER:
812 case SV_POTION_APPLE_JUICE:
813 case SV_POTION_SLIME_MOLD:
814 msg_print("You feel less thirsty.");
819 case SV_POTION_SLOWNESS:
820 if (set_slow(randint1(25) + 15, FALSE)) ident = TRUE;
823 case SV_POTION_SALT_WATER:
825 msg_print("¤¦¤§¡ª»×¤ï¤ºÅǤ¤¤Æ¤·¤Þ¤Ã¤¿¡£");
827 msg_print("The potion makes you vomit!");
830 if (!(prace_is_(RACE_GOLEM) ||
831 prace_is_(RACE_ZOMBIE) ||
832 prace_is_(RACE_DEMON) ||
833 prace_is_(RACE_ANDROID) ||
834 prace_is_(RACE_SPECTRE) ||
835 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING)))
837 /* Only living creatures get thirsty */
838 (void)set_food(PY_FOOD_STARVE - 1);
841 (void)set_poisoned(0);
842 (void)set_paralyzed(p_ptr->paralyzed + 4);
846 case SV_POTION_POISON:
847 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
849 if (set_poisoned(p_ptr->poisoned + randint0(15) + 10))
856 case SV_POTION_BLINDNESS:
857 if (!p_ptr->resist_blind)
859 if (set_blind(p_ptr->blind + randint0(100) + 100))
866 case SV_POTION_CONFUSION: /* Booze */
867 if (p_ptr->pclass != CLASS_MONK) chg_virtue(V_HARMONY, -1);
868 else if (!p_ptr->resist_conf) p_ptr->special_attack |= ATTACK_SUIKEN;
869 if (!p_ptr->resist_conf)
871 if (set_confused(randint0(20) + 15))
877 if (!p_ptr->resist_chaos)
881 if (set_image(p_ptr->image + randint0(150) + 150))
886 if (one_in_(13) && (p_ptr->pclass != CLASS_MONK))
889 if (one_in_(3)) lose_all_info();
891 (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
894 msg_print("ÃΤé¤Ê¤¤¾ì½ê¤ÇÌܤ¬Àä᤿¡£Æ¬Äˤ¬¤¹¤ë¡£");
895 msg_print("²¿¤â»×¤¤½Ð¤»¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ØÍ褿¤Î¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
897 msg_print("You wake up somewhere with a sore head...");
898 msg_print("You can't remember a thing, or how you got here!");
905 case SV_POTION_SLEEP:
906 if (!p_ptr->free_act)
909 msg_print("¤¢¤Ê¤¿¤Ï̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
911 msg_print("You fall asleep.");
915 if (ironman_nightmare)
918 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
920 msg_print("A horrible vision enters your mind.");
924 /* Pick a nightmare */
925 get_mon_num_prep(get_nightmare, NULL);
927 /* Have some nightmares */
928 have_nightmare(get_mon_num(MAX_DEPTH));
930 /* Remove the monster restriction */
931 get_mon_num_prep(NULL, NULL);
933 if (set_paralyzed(p_ptr->paralyzed + randint0(4) + 4))
940 case SV_POTION_LOSE_MEMORIES:
941 if (!p_ptr->hold_life && (p_ptr->exp > 0))
944 msg_print("²áµî¤Îµ²±¤¬Çö¤ì¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
946 msg_print("You feel your memories fade.");
948 chg_virtue(V_KNOWLEDGE, -5);
950 lose_exp(p_ptr->exp / 4);
955 case SV_POTION_RUINATION:
957 msg_print("¿È¤â¿´¤â¼å¤Ã¤Æ¤¤Æ¡¢Àºµ¤¤¬È´¤±¤Æ¤¤¤¯¤è¤¦¤À¡£");
958 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), "ÇËÌǤÎÌô", -1);
960 msg_print("Your nerves and muscles feel weak and lifeless!");
961 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), "a potion of Ruination", -1);
964 (void)dec_stat(A_DEX, 25, TRUE);
965 (void)dec_stat(A_WIS, 25, TRUE);
966 (void)dec_stat(A_CON, 25, TRUE);
967 (void)dec_stat(A_STR, 25, TRUE);
968 (void)dec_stat(A_CHR, 25, TRUE);
969 (void)dec_stat(A_INT, 25, TRUE);
973 case SV_POTION_DEC_STR:
974 if (do_dec_stat(A_STR)) ident = TRUE;
977 case SV_POTION_DEC_INT:
978 if (do_dec_stat(A_INT)) ident = TRUE;
981 case SV_POTION_DEC_WIS:
982 if (do_dec_stat(A_WIS)) ident = TRUE;
985 case SV_POTION_DEC_DEX:
986 if (do_dec_stat(A_DEX)) ident = TRUE;
989 case SV_POTION_DEC_CON:
990 if (do_dec_stat(A_CON)) ident = TRUE;
993 case SV_POTION_DEC_CHR:
994 if (do_dec_stat(A_CHR)) ident = TRUE;
997 case SV_POTION_DETONATIONS:
999 msg_print("ÂΤÎÃæ¤Ç·ã¤·¤¤Çúȯ¤¬µ¯¤¤¿¡ª");
1000 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), "Çúȯ¤ÎÌô", -1);
1002 msg_print("Massive explosions rupture your body!");
1003 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), "a potion of Detonation", -1);
1006 (void)set_stun(p_ptr->stun + 75);
1007 (void)set_cut(p_ptr->cut + 5000);
1011 case SV_POTION_DEATH:
1012 chg_virtue(V_VITALITY, -1);
1013 chg_virtue(V_UNLIFE, 5);
1015 msg_print("»à¤Îͽ´¶¤¬ÂÎÃæ¤ò¶î¤±¤á¤°¤Ã¤¿¡£");
1016 take_hit(DAMAGE_LOSELIFE, 5000, "»à¤ÎÌô", -1);
1018 msg_print("A feeling of Death flows through your body.");
1019 take_hit(DAMAGE_LOSELIFE, 5000, "a potion of Death", -1);
1025 case SV_POTION_INFRAVISION:
1026 if (set_tim_infra(p_ptr->tim_infra + 100 + randint1(100), FALSE))
1032 case SV_POTION_DETECT_INVIS:
1033 if (set_tim_invis(p_ptr->tim_invis + 12 + randint1(12), FALSE))
1039 case SV_POTION_SLOW_POISON:
1040 if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
1043 case SV_POTION_CURE_POISON:
1044 if (set_poisoned(0)) ident = TRUE;
1047 case SV_POTION_BOLDNESS:
1048 if (set_afraid(0)) ident = TRUE;
1051 case SV_POTION_SPEED:
1054 if (set_fast(randint1(25) + 15, FALSE)) ident = TRUE;
1058 (void)set_fast(p_ptr->fast + 5, FALSE);
1062 case SV_POTION_RESIST_HEAT:
1063 if (set_oppose_fire(p_ptr->oppose_fire + randint1(10) + 10, FALSE))
1069 case SV_POTION_RESIST_COLD:
1070 if (set_oppose_cold(p_ptr->oppose_cold + randint1(10) + 10, FALSE))
1076 case SV_POTION_HEROISM:
1077 if (set_afraid(0)) ident = TRUE;
1078 if (set_hero(p_ptr->hero + randint1(25) + 25, FALSE)) ident = TRUE;
1079 if (hp_player(10)) ident = TRUE;
1082 case SV_POTION_BESERK_STRENGTH:
1083 if (set_afraid(0)) ident = TRUE;
1084 if (set_shero(p_ptr->shero + randint1(25) + 25, FALSE)) ident = TRUE;
1085 if (hp_player(30)) ident = TRUE;
1088 case SV_POTION_CURE_LIGHT:
1089 if (hp_player(damroll(2, 8))) ident = TRUE;
1090 if (set_blind(0)) ident = TRUE;
1091 if (set_cut(p_ptr->cut - 10)) ident = TRUE;
1092 if (set_shero(0,TRUE)) ident = TRUE;
1095 case SV_POTION_CURE_SERIOUS:
1096 if (hp_player(damroll(4, 8))) ident = TRUE;
1097 if (set_blind(0)) ident = TRUE;
1098 if (set_confused(0)) ident = TRUE;
1099 if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;
1100 if (set_shero(0,TRUE)) ident = TRUE;
1103 case SV_POTION_CURE_CRITICAL:
1104 if (hp_player(damroll(6, 8))) ident = TRUE;
1105 if (set_blind(0)) ident = TRUE;
1106 if (set_confused(0)) ident = TRUE;
1107 if (set_poisoned(0)) ident = TRUE;
1108 if (set_stun(0)) ident = TRUE;
1109 if (set_cut(0)) ident = TRUE;
1110 if (set_shero(0,TRUE)) ident = TRUE;
1113 case SV_POTION_HEALING:
1114 if (hp_player(300)) ident = TRUE;
1115 if (set_blind(0)) ident = TRUE;
1116 if (set_confused(0)) ident = TRUE;
1117 if (set_poisoned(0)) ident = TRUE;
1118 if (set_stun(0)) ident = TRUE;
1119 if (set_cut(0)) ident = TRUE;
1120 if (set_shero(0,TRUE)) ident = TRUE;
1123 case SV_POTION_STAR_HEALING:
1124 if (hp_player(1200)) ident = TRUE;
1125 if (set_blind(0)) ident = TRUE;
1126 if (set_confused(0)) ident = TRUE;
1127 if (set_poisoned(0)) ident = TRUE;
1128 if (set_stun(0)) ident = TRUE;
1129 if (set_cut(0)) ident = TRUE;
1130 if (set_shero(0,TRUE)) ident = TRUE;
1133 case SV_POTION_LIFE:
1134 chg_virtue(V_VITALITY, 1);
1135 chg_virtue(V_UNLIFE, -5);
1137 msg_print("ÂÎÃæ¤ËÀ¸Ì¿ÎϤ¬Ëþ¤Á¤¢¤Õ¤ì¤Æ¤¤¿¡ª");
1139 msg_print("You feel life flow through your body!");
1143 (void)set_poisoned(0);
1145 (void)set_confused(0);
1149 (void)do_res_stat(A_STR);
1150 (void)do_res_stat(A_CON);
1151 (void)do_res_stat(A_DEX);
1152 (void)do_res_stat(A_WIS);
1153 (void)do_res_stat(A_INT);
1154 (void)do_res_stat(A_CHR);
1155 (void)set_shero(0,TRUE);
1161 case SV_POTION_RESTORE_MANA:
1162 if (p_ptr->pclass == CLASS_MAGIC_EATER)
1165 for (i = 0; i < EATER_EXT*2; i++)
1167 p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i]*EATER_CHARGE/3;
1168 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;
1170 for (; i < EATER_EXT*3; i++)
1172 int k_idx = lookup_kind(TV_ROD, i-EATER_EXT*2);
1173 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;
1174 if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
1177 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
1179 msg_print("You feel your head clear.");
1181 p_ptr->window |= (PW_PLAYER);
1184 else if (p_ptr->csp < p_ptr->msp)
1186 p_ptr->csp = p_ptr->msp;
1187 p_ptr->csp_frac = 0;
1189 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
1191 msg_print("You feel your head clear.");
1194 p_ptr->redraw |= (PR_MANA);
1195 p_ptr->window |= (PW_PLAYER);
1196 p_ptr->window |= (PW_SPELL);
1199 if (set_shero(0,TRUE)) ident = TRUE;
1202 case SV_POTION_RESTORE_EXP:
1203 if (restore_level()) ident = TRUE;
1206 case SV_POTION_RES_STR:
1207 if (do_res_stat(A_STR)) ident = TRUE;
1210 case SV_POTION_RES_INT:
1211 if (do_res_stat(A_INT)) ident = TRUE;
1214 case SV_POTION_RES_WIS:
1215 if (do_res_stat(A_WIS)) ident = TRUE;
1218 case SV_POTION_RES_DEX:
1219 if (do_res_stat(A_DEX)) ident = TRUE;
1222 case SV_POTION_RES_CON:
1223 if (do_res_stat(A_CON)) ident = TRUE;
1226 case SV_POTION_RES_CHR:
1227 if (do_res_stat(A_CHR)) ident = TRUE;
1230 case SV_POTION_INC_STR:
1231 if (do_inc_stat(A_STR)) ident = TRUE;
1234 case SV_POTION_INC_INT:
1235 if (do_inc_stat(A_INT)) ident = TRUE;
1238 case SV_POTION_INC_WIS:
1239 if (do_inc_stat(A_WIS)) ident = TRUE;
1242 case SV_POTION_INC_DEX:
1243 if (do_inc_stat(A_DEX)) ident = TRUE;
1246 case SV_POTION_INC_CON:
1247 if (do_inc_stat(A_CON)) ident = TRUE;
1250 case SV_POTION_INC_CHR:
1251 if (do_inc_stat(A_CHR)) ident = TRUE;
1254 case SV_POTION_AUGMENTATION:
1255 if (do_inc_stat(A_STR)) ident = TRUE;
1256 if (do_inc_stat(A_INT)) ident = TRUE;
1257 if (do_inc_stat(A_WIS)) ident = TRUE;
1258 if (do_inc_stat(A_DEX)) ident = TRUE;
1259 if (do_inc_stat(A_CON)) ident = TRUE;
1260 if (do_inc_stat(A_CHR)) ident = TRUE;
1263 case SV_POTION_ENLIGHTENMENT:
1265 msg_print("¼«Ê¬¤ÎÃÖ¤«¤ì¤Æ¤¤¤ë¾õ¶·¤¬Ç¾Î¢¤ËÉ⤫¤ó¤Ç¤¤¿...");
1267 msg_print("An image of your surroundings forms in your mind...");
1270 chg_virtue(V_KNOWLEDGE, 1);
1271 chg_virtue(V_ENLIGHTEN, 1);
1276 case SV_POTION_STAR_ENLIGHTENMENT:
1278 msg_print("¹¹¤Ê¤ë·¼Ìؤò´¶¤¸¤¿...");
1280 msg_print("You begin to feel more enlightened...");
1283 chg_virtue(V_KNOWLEDGE, 1);
1284 chg_virtue(V_ENLIGHTEN, 2);
1287 (void)do_inc_stat(A_INT);
1288 (void)do_inc_stat(A_WIS);
1289 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1290 (void)detect_doors(DETECT_RAD_DEFAULT);
1291 (void)detect_stairs(DETECT_RAD_DEFAULT);
1292 (void)detect_treasure(DETECT_RAD_DEFAULT);
1293 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
1294 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
1300 case SV_POTION_SELF_KNOWLEDGE:
1302 msg_print("¼«Ê¬¼«¿È¤Î¤³¤È¤¬¾¯¤·¤Ïʬ¤«¤Ã¤¿µ¤¤¬¤¹¤ë...");
1304 msg_print("You begin to know yourself a little better...");
1312 case SV_POTION_EXPERIENCE:
1313 if (p_ptr->prace == RACE_ANDROID) break;
1314 chg_virtue(V_ENLIGHTEN, 1);
1315 if (p_ptr->exp < PY_MAX_EXP)
1317 s32b ee = (p_ptr->exp / 2) + 10;
1318 if (ee > 100000L) ee = 100000L;
1320 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1322 msg_print("You feel more experienced.");
1330 case SV_POTION_RESISTANCE:
1331 (void)set_oppose_acid(p_ptr->oppose_acid + randint1(20) + 20, FALSE);
1332 (void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
1333 (void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
1334 (void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
1335 (void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
1339 case SV_POTION_CURING:
1340 if (hp_player(50)) ident = TRUE;
1341 if (set_blind(0)) ident = TRUE;
1342 if (set_poisoned(0)) ident = TRUE;
1343 if (set_confused(0)) ident = TRUE;
1344 if (set_stun(0)) ident = TRUE;
1345 if (set_cut(0)) ident = TRUE;
1346 if (set_image(0)) ident = TRUE;
1349 case SV_POTION_INVULNERABILITY:
1350 (void)set_invuln(p_ptr->invuln + randint1(4) + 4, FALSE);
1354 case SV_POTION_NEW_LIFE:
1355 do_cmd_rerate(FALSE);
1357 p_ptr->update |= PU_BONUS;
1358 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
1360 chg_virtue(V_CHANCE, -5);
1362 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
1364 msg_print("You are cured of all mutations.");
1367 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
1368 p_ptr->update |= PU_BONUS;
1370 mutant_regenerate_mod = calc_mutant_regenerate_mod();
1375 case SV_POTION_NEO_TSUYOSHI:
1377 (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
1381 case SV_POTION_TSUYOSHI:
1383 msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
1385 msg_print("Brother OKURE!");
1388 p_ptr->tsuyoshi = 1;
1389 (void)set_tsuyoshi(0, TRUE);
1390 if (!p_ptr->resist_chaos)
1392 (void)set_image(50 + randint1(50));
1397 case SV_POTION_POLYMORPH:
1398 if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23))
1400 chg_virtue(V_CHANCE, -5);
1402 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
1404 msg_print("You are cured of all mutations.");
1407 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
1408 p_ptr->update |= PU_BONUS;
1417 if(gain_random_mutation(0)) ident = TRUE;
1419 else if (lose_mutation(0)) ident = TRUE;
1420 } while(!ident || one_in_(2));
1426 if (prace_is_(RACE_SKELETON))
1429 msg_print("±ÕÂΤΰìÉô¤Ï¤¢¤Ê¤¿¤Î¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¤¿¡ª");
1431 msg_print("Some of the fluid falls through your jaws!");
1434 (void)potion_smash_effect(0, py, px, q_ptr->k_idx);
1437 /* Combine / Reorder the pack (later) */
1438 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1440 if (!(object_is_aware(o_ptr)))
1442 chg_virtue(V_PATIENCE, -1);
1443 chg_virtue(V_CHANCE, 1);
1444 chg_virtue(V_KNOWLEDGE, -1);
1447 /* The item has been tried */
1448 object_tried(q_ptr);
1450 /* An identification was made */
1451 if (ident && !object_is_aware(q_ptr))
1453 object_aware(q_ptr);
1454 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
1458 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
1460 /* Potions can feed the player */
1461 switch (p_ptr->mimic_form)
1464 switch (p_ptr->prace)
1467 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
1476 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1479 if (q_ptr->tval == TV_FLASK)
1482 msg_print("¥ª¥¤¥ë¤òÊäµë¤·¤¿¡£");
1484 msg_print("You replenish yourself with the oil.");
1486 set_food(p_ptr->food + 5000);
1490 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1495 msg_print("¿åʬ¤ò¼è¤ê¹þ¤ó¤À¡£");
1497 msg_print("You are moistened.");
1499 set_food(MIN(p_ptr->food + o_ptr->pval + MAX(0, o_ptr->pval * 10) + 2000, PY_FOOD_MAX - 1));
1502 (void)set_food(p_ptr->food + o_ptr->pval);
1507 case MIMIC_DEMON_LORD:
1508 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1511 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
1514 (void)set_food(p_ptr->food + o_ptr->pval);
1521 * Hook to determine if an object can be quaffed
1523 static bool item_tester_hook_quaff(object_type *o_ptr)
1525 if (o_ptr->tval == TV_POTION) return TRUE;
1527 if (prace_is_(RACE_ANDROID))
1529 if (o_ptr->tval == TV_FLASK && o_ptr->sval == SV_FLASK_OIL)
1538 * Quaff some potion (from the pack or floor)
1540 void do_cmd_quaff_potion(void)
1545 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
1547 set_action(ACTION_NONE);
1550 /* Restrict choices to potions */
1551 item_tester_hook = item_tester_hook_quaff;
1555 q = "¤É¤ÎÌô¤ò°û¤ß¤Þ¤¹¤«? ";
1556 s = "°û¤á¤ëÌô¤¬¤Ê¤¤¡£";
1558 q = "Quaff which potion? ";
1559 s = "You have no potions to quaff.";
1562 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1564 /* Quaff the potion */
1565 do_cmd_quaff_potion_aux(item);
1570 * Read a scroll (from the pack or floor).
1572 * Certain scrolls can be "aborted" without losing the scroll. These
1573 * include scrolls with no effects but recharge or identify, which are
1574 * cancelled before use. XXX Reading them still takes a turn, though.
1576 static void do_cmd_read_scroll_aux(int item, bool known)
1578 int k, used_up, ident, lev;
1583 /* Get the item (in the pack) */
1586 o_ptr = &inventory[item];
1589 /* Get the item (on the floor) */
1592 o_ptr = &o_list[0 - item];
1601 if (flush_failure) flush();
1603 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
1605 msg_print("Nothing happen.");
1612 if (p_ptr->pclass == CLASS_BERSERKER)
1615 msg_print("´¬Êª¤Ê¤ó¤ÆÆɤá¤Ê¤¤¡£");
1617 msg_print("You cannot read.");
1622 if (music_singing_any()) stop_singing();
1625 if (hex_spelling_any() && ((p_ptr->lev < 35) || hex_spell_fully())) stop_hex_spell_all();
1627 /* Not identified yet */
1631 lev = k_info[o_ptr->k_idx].level;
1633 /* Assume the scroll will get used up */
1636 if (o_ptr->tval == TV_SCROLL)
1638 /* Analyze the scroll */
1639 switch (o_ptr->sval)
1641 case SV_SCROLL_DARKNESS:
1643 if (!(p_ptr->resist_blind) && !(p_ptr->resist_dark))
1645 (void)set_blind(p_ptr->blind + 3 + randint1(5));
1647 if (unlite_area(10, 3)) ident = TRUE;
1651 case SV_SCROLL_AGGRAVATE_MONSTER:
1654 msg_print("¥«¥ó¹â¤¯¤¦¤Ê¤ëÍͤʲ»¤¬ÊÕ¤ê¤òʤ¤Ã¤¿¡£");
1656 msg_print("There is a high pitched humming noise.");
1659 aggravate_monsters(0);
1664 case SV_SCROLL_CURSE_ARMOR:
1666 if (curse_armor()) ident = TRUE;
1670 case SV_SCROLL_CURSE_WEAPON:
1673 if (buki_motteruka(INVEN_RARM))
1676 if (buki_motteruka(INVEN_LARM) && one_in_(2)) k = INVEN_LARM;
1678 else if (buki_motteruka(INVEN_LARM)) k = INVEN_LARM;
1679 if (k && curse_weapon(FALSE, k)) ident = TRUE;
1683 case SV_SCROLL_SUMMON_MONSTER:
1685 for (k = 0; k < randint1(3); k++)
1687 if (summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
1695 case SV_SCROLL_SUMMON_UNDEAD:
1697 for (k = 0; k < randint1(3); k++)
1699 if (summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
1707 case SV_SCROLL_SUMMON_PET:
1709 if (summon_specific(-1, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_FORCE_PET)))
1716 case SV_SCROLL_SUMMON_KIN:
1718 if (summon_kin_player(p_ptr->lev, py, px, (PM_FORCE_PET | PM_ALLOW_GROUP)))
1725 case SV_SCROLL_TRAP_CREATION:
1727 if (trap_creation(py, px)) ident = TRUE;
1731 case SV_SCROLL_PHASE_DOOR:
1733 teleport_player(10, 0L);
1738 case SV_SCROLL_TELEPORT:
1740 teleport_player(100, 0L);
1745 case SV_SCROLL_TELEPORT_LEVEL:
1747 (void)teleport_level(0);
1752 case SV_SCROLL_WORD_OF_RECALL:
1754 if (!word_of_recall()) used_up = FALSE;
1759 case SV_SCROLL_IDENTIFY:
1761 if (!ident_spell(FALSE)) used_up = FALSE;
1766 case SV_SCROLL_STAR_IDENTIFY:
1768 if (!identify_fully(FALSE)) used_up = FALSE;
1773 case SV_SCROLL_REMOVE_CURSE:
1778 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1780 msg_print("You feel as if someone is watching over you.");
1788 case SV_SCROLL_STAR_REMOVE_CURSE:
1790 if (remove_all_curse())
1793 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1795 msg_print("You feel as if someone is watching over you.");
1802 case SV_SCROLL_ENCHANT_ARMOR:
1805 if (!enchant_spell(0, 0, 1)) used_up = FALSE;
1809 case SV_SCROLL_ENCHANT_WEAPON_TO_HIT:
1811 if (!enchant_spell(1, 0, 0)) used_up = FALSE;
1816 case SV_SCROLL_ENCHANT_WEAPON_TO_DAM:
1818 if (!enchant_spell(0, 1, 0)) used_up = FALSE;
1823 case SV_SCROLL_STAR_ENCHANT_ARMOR:
1825 if (!enchant_spell(0, 0, randint1(3) + 2)) used_up = FALSE;
1830 case SV_SCROLL_STAR_ENCHANT_WEAPON:
1832 if (!enchant_spell(randint1(3), randint1(3), 0)) used_up = FALSE;
1837 case SV_SCROLL_RECHARGING:
1839 if (!recharge(130)) used_up = FALSE;
1844 case SV_SCROLL_MUNDANITY:
1847 if (!mundane_spell(FALSE)) used_up = FALSE;
1851 case SV_SCROLL_LIGHT:
1853 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
1857 case SV_SCROLL_MAPPING:
1859 map_area(DETECT_RAD_MAP);
1864 case SV_SCROLL_DETECT_GOLD:
1866 if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
1867 if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
1871 case SV_SCROLL_DETECT_ITEM:
1873 if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
1877 case SV_SCROLL_DETECT_TRAP:
1879 if (detect_traps(DETECT_RAD_DEFAULT, known)) ident = TRUE;
1883 case SV_SCROLL_DETECT_DOOR:
1885 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
1886 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
1890 case SV_SCROLL_DETECT_INVIS:
1892 if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
1896 case SV_SCROLL_SATISFY_HUNGER:
1898 if (set_food(PY_FOOD_MAX - 1)) ident = TRUE;
1902 case SV_SCROLL_BLESSING:
1904 if (set_blessed(p_ptr->blessed + randint1(12) + 6, FALSE)) ident = TRUE;
1908 case SV_SCROLL_HOLY_CHANT:
1910 if (set_blessed(p_ptr->blessed + randint1(24) + 12, FALSE)) ident = TRUE;
1914 case SV_SCROLL_HOLY_PRAYER:
1916 if (set_blessed(p_ptr->blessed + randint1(48) + 24, FALSE)) ident = TRUE;
1920 case SV_SCROLL_MONSTER_CONFUSION:
1922 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1925 msg_print("¼ê¤¬µ±¤»Ï¤á¤¿¡£");
1927 msg_print("Your hands begin to glow.");
1930 p_ptr->special_attack |= ATTACK_CONFUSE;
1931 p_ptr->redraw |= (PR_STATUS);
1937 case SV_SCROLL_PROTECTION_FROM_EVIL:
1940 if (set_protevil(p_ptr->protevil + randint1(25) + k, FALSE)) ident = TRUE;
1944 case SV_SCROLL_RUNE_OF_PROTECTION:
1951 case SV_SCROLL_TRAP_DOOR_DESTRUCTION:
1953 if (destroy_doors_touch()) ident = TRUE;
1957 case SV_SCROLL_STAR_DESTRUCTION:
1959 if (destroy_area(py, px, 13 + randint0(5), FALSE))
1963 msg_print("¥À¥ó¥¸¥ç¥ó¤¬Íɤ줿...");
1965 msg_print("The dungeon trembles...");
1972 case SV_SCROLL_DISPEL_UNDEAD:
1974 if (dispel_undead(80)) ident = TRUE;
1978 case SV_SCROLL_SPELL:
1980 if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_IMITATOR) || (p_ptr->pclass == CLASS_MINDCRAFTER) || (p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_ARCHER) || (p_ptr->pclass == CLASS_MAGIC_EATER) || (p_ptr->pclass == CLASS_RED_MAGE) || (p_ptr->pclass == CLASS_SAMURAI) || (p_ptr->pclass == CLASS_BLUE_MAGE) || (p_ptr->pclass == CLASS_CAVALRY) || (p_ptr->pclass == CLASS_BERSERKER) || (p_ptr->pclass == CLASS_SMITH) || (p_ptr->pclass == CLASS_MIRROR_MASTER) || (p_ptr->pclass == CLASS_NINJA)) break;
1981 p_ptr->add_spells++;
1982 p_ptr->update |= (PU_SPELLS);
1987 case SV_SCROLL_GENOCIDE:
1989 (void)symbol_genocide(300, TRUE);
1994 case SV_SCROLL_MASS_GENOCIDE:
1996 (void)mass_genocide(300, TRUE);
2001 case SV_SCROLL_ACQUIREMENT:
2003 acquirement(py, px, 1, TRUE, FALSE);
2008 case SV_SCROLL_STAR_ACQUIREMENT:
2010 acquirement(py, px, randint1(2) + 1, TRUE, FALSE);
2015 /* New Hengband scrolls */
2016 case SV_SCROLL_FIRE:
2018 fire_ball(GF_FIRE, 0, 666, 4);
2019 /* Note: "Double" damage since it is centered on the player ... */
2020 if (!(IS_OPPOSE_FIRE() || p_ptr->resist_fire || p_ptr->immune_fire))
2022 take_hit(DAMAGE_NOESCAPE, 50+randint1(50), "±ê¤Î´¬Êª", -1);
2024 take_hit(DAMAGE_NOESCAPE, 50 + randint1(50), "a Scroll of Fire", -1);
2034 fire_ball(GF_ICE, 0, 777, 4);
2035 if (!(IS_OPPOSE_COLD() || p_ptr->resist_cold || p_ptr->immune_cold))
2037 take_hit(DAMAGE_NOESCAPE, 100+randint1(100), "ɹ¤Î´¬Êª", -1);
2039 take_hit(DAMAGE_NOESCAPE, 100 + randint1(100), "a Scroll of Ice", -1);
2046 case SV_SCROLL_CHAOS:
2048 fire_ball(GF_CHAOS, 0, 1000, 4);
2049 if (!p_ptr->resist_chaos)
2051 take_hit(DAMAGE_NOESCAPE, 111+randint1(111), "¥í¥°¥ë¥¹¤Î´¬Êª", -1);
2053 take_hit(DAMAGE_NOESCAPE, 111 + randint1(111), "a Scroll of Logrus", -1);
2060 case SV_SCROLL_RUMOR:
2064 switch (randint1(20))
2068 err = get_rnd_line("chainswd_j.txt", 0, Rumor);
2070 err = get_rnd_line("chainswd.txt", 0, Rumor);
2076 err = get_rnd_line("error_j.txt", 0, Rumor);
2078 err = get_rnd_line("error.txt", 0, Rumor);
2086 err = get_rnd_line("death_j.txt", 0, Rumor);
2088 err = get_rnd_line("death.txt", 0, Rumor);
2094 err = get_rnd_line_jonly("rumors_j.txt", 0, Rumor, 10);
2096 err = get_rnd_line("rumors.txt", 0, Rumor);
2102 /* An error occured */
2104 if (err) strcpy(Rumor, "±³¤Î±½¤â¤¢¤ë¡£");
2106 if (err) strcpy(Rumor, "Some rumors are wrong.");
2111 msg_print("´¬Êª¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤¬½ñ¤«¤ì¤Æ¤¤¤ë:");
2113 msg_print("There is message on the scroll. It says:");
2117 msg_format("%s", Rumor);
2120 msg_print("´¬Êª¤Ï±ì¤òΩ¤Æ¤Æ¾Ã¤¨µî¤Ã¤¿¡ª");
2122 msg_print("The scroll disappears in a puff of smoke!");
2129 case SV_SCROLL_ARTIFACT:
2132 if (!artifact_scroll()) used_up = FALSE;
2136 case SV_SCROLL_RESET_RECALL:
2139 if (!reset_recall()) used_up = FALSE;
2144 else if (o_ptr->name1 == ART_GHB)
2147 msg_print("»ä¤Ï¶ìÏ«¤·¤Æ¡Ø¥°¥ì¡¼¥¿¡¼¡¦¥Ø¥ë=¥Ó¡¼¥¹¥È¡Ù¤òÅݤ·¤¿¡£");
2148 msg_print("¤·¤«¤·¼ê¤ËÆþ¤Ã¤¿¤Î¤Ï¤³¤Î¤¤¿¤Ê¤¤£Ô¥·¥ã¥Ä¤À¤±¤À¤Ã¤¿¡£");
2150 msg_print("I had a very hard time to kill the Greater hell-beast, ");
2151 msg_print("but all I got was this lousy t-shirt!");
2155 else if (o_ptr->name1 == ART_POWER)
2158 msg_print("¡Ö°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤òÅý¤Ù¡¢");
2160 msg_print("°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤ò¸«¤Ä¤±¡¢");
2162 msg_print("°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤òÊá¤é¤¨¤Æ");
2164 msg_print("°Å°Ç¤ÎÃæ¤Ë·Ò¤®¤È¤á¤ë¡£¡×");
2166 msg_print("'One Ring to rule them all, ");
2168 msg_print("One Ring to find them, ");
2170 msg_print("One Ring to bring them all ");
2172 msg_print("and in the darkness bind them.'");
2176 else if (o_ptr->tval==TV_PARCHMENT)
2179 char o_name[MAX_NLEN];
2185 q=format("book-%d_jp.txt",o_ptr->sval);
2187 /* Display object description */
2188 object_desc(o_name, o_ptr, OD_NAME_ONLY);
2190 /* Build the filename */
2191 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, q);
2193 /* Peruse the help file */
2194 (void)show_file(TRUE, buf, o_name, 0, 0);
2203 /* Combine / Reorder the pack (later) */
2204 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2206 if (!(object_is_aware(o_ptr)))
2208 chg_virtue(V_PATIENCE, -1);
2209 chg_virtue(V_CHANCE, 1);
2210 chg_virtue(V_KNOWLEDGE, -1);
2213 /* The item was tried */
2214 object_tried(o_ptr);
2216 /* An identification was made */
2217 if (ident && !object_is_aware(o_ptr))
2219 object_aware(o_ptr);
2220 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
2224 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
2227 /* Hack -- allow certain scrolls to be "preserved" */
2233 sound(SOUND_SCROLL);
2235 /* Destroy a scroll in the pack */
2238 inven_item_increase(item, -1);
2239 inven_item_describe(item);
2240 inven_item_optimize(item);
2243 /* Destroy a scroll on the floor */
2246 floor_item_increase(0 - item, -1);
2247 floor_item_describe(0 - item);
2248 floor_item_optimize(0 - item);
2254 * Hook to determine if an object is readable
2256 static bool item_tester_hook_readable(object_type *o_ptr)
2258 if ((o_ptr->tval==TV_SCROLL) || (o_ptr->tval==TV_PARCHMENT) || (o_ptr->name1 == ART_GHB) || (o_ptr->name1 == ART_POWER)) return (TRUE);
2265 void do_cmd_read_scroll(void)
2271 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
2273 set_action(ACTION_NONE);
2276 /* Check some conditions */
2280 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡£");
2282 msg_print("You can't see anything.");
2290 msg_print("ÌÀ¤«¤ê¤¬¤Ê¤¤¤Î¤Ç¡¢°Å¤¯¤ÆÆɤá¤Ê¤¤¡£");
2292 msg_print("You have no light to read by.");
2297 if (p_ptr->confused)
2300 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡£");
2302 msg_print("You are too confused!");
2309 /* Restrict choices to scrolls */
2310 item_tester_hook = item_tester_hook_readable;
2314 q = "¤É¤Î´¬Êª¤òÆɤߤޤ¹¤«? ";
2315 s = "Æɤá¤ë´¬Êª¤¬¤Ê¤¤¡£";
2317 q = "Read which scroll? ";
2318 s = "You have no scrolls to read.";
2321 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
2323 /* Get the item (in the pack) */
2326 o_ptr = &inventory[item];
2329 /* Get the item (on the floor) */
2332 o_ptr = &o_list[0 - item];
2335 /* Read the scroll */
2336 do_cmd_read_scroll_aux(item, object_is_aware(o_ptr));
2340 static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
2345 /* Analyze the staff */
2348 case SV_STAFF_DARKNESS:
2350 if (!(p_ptr->resist_blind) && !(p_ptr->resist_dark))
2352 if (set_blind(p_ptr->blind + 3 + randint1(5))) ident = TRUE;
2354 if (unlite_area(10, 3)) ident = TRUE;
2358 case SV_STAFF_SLOWNESS:
2360 if (set_slow(p_ptr->slow + randint1(30) + 15, FALSE)) ident = TRUE;
2364 case SV_STAFF_HASTE_MONSTERS:
2366 if (speed_monsters()) ident = TRUE;
2370 case SV_STAFF_SUMMONING:
2372 for (k = 0; k < randint1(4); k++)
2374 if (summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
2382 case SV_STAFF_TELEPORTATION:
2384 teleport_player(100, 0L);
2389 case SV_STAFF_IDENTIFY:
2391 if (!ident_spell(FALSE)) *use_charge = FALSE;
2396 case SV_STAFF_REMOVE_CURSE:
2403 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2405 msg_print("You feel as if someone is watching over you.");
2408 else if (!p_ptr->blind)
2411 msg_print("¾ó¤Ï°ì½Ö¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
2413 msg_print("The staff glows blue for a moment...");
2422 case SV_STAFF_STARLITE:
2424 int num = damroll(5, 3);
2428 if (!p_ptr->blind && !magic)
2431 msg_print("¾ó¤ÎÀ褬ÌÀ¤ë¤¯µ±¤¤¤¿...");
2433 msg_print("The end of the staff glows brightly...");
2437 for (k = 0; k < num; k++)
2443 scatter(&y, &x, py, px, 4, 0);
2445 if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
2447 if (!player_bold(y, x)) break;
2450 project(0, 0, y, x, damroll(6 + p_ptr->lev / 8, 10), GF_LITE_WEAK,
2451 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL), -1);
2459 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
2463 case SV_STAFF_MAPPING:
2465 map_area(DETECT_RAD_MAP);
2470 case SV_STAFF_DETECT_GOLD:
2472 if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
2473 if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
2477 case SV_STAFF_DETECT_ITEM:
2479 if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
2483 case SV_STAFF_DETECT_TRAP:
2485 if (detect_traps(DETECT_RAD_DEFAULT, known)) ident = TRUE;
2489 case SV_STAFF_DETECT_DOOR:
2491 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
2492 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
2496 case SV_STAFF_DETECT_INVIS:
2498 if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
2502 case SV_STAFF_DETECT_EVIL:
2504 if (detect_monsters_evil(DETECT_RAD_DEFAULT)) ident = TRUE;
2508 case SV_STAFF_CURE_LIGHT:
2510 if (hp_player(damroll(2, 8))) ident = TRUE;
2511 if (set_shero(0,TRUE)) ident = TRUE;
2515 case SV_STAFF_CURING:
2517 if (set_blind(0)) ident = TRUE;
2518 if (set_poisoned(0)) ident = TRUE;
2519 if (set_confused(0)) ident = TRUE;
2520 if (set_stun(0)) ident = TRUE;
2521 if (set_cut(0)) ident = TRUE;
2522 if (set_image(0)) ident = TRUE;
2523 if (set_shero(0,TRUE)) ident = TRUE;
2527 case SV_STAFF_HEALING:
2529 if (hp_player(300)) ident = TRUE;
2530 if (set_stun(0)) ident = TRUE;
2531 if (set_cut(0)) ident = TRUE;
2532 if (set_shero(0,TRUE)) ident = TRUE;
2536 case SV_STAFF_THE_MAGI:
2538 if (do_res_stat(A_INT)) ident = TRUE;
2539 if (p_ptr->csp < p_ptr->msp)
2541 p_ptr->csp = p_ptr->msp;
2542 p_ptr->csp_frac = 0;
2545 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
2547 msg_print("You feel your head clear.");
2550 p_ptr->redraw |= (PR_MANA);
2551 p_ptr->window |= (PW_PLAYER);
2552 p_ptr->window |= (PW_SPELL);
2554 if (set_shero(0,TRUE)) ident = TRUE;
2558 case SV_STAFF_SLEEP_MONSTERS:
2560 if (sleep_monsters()) ident = TRUE;
2564 case SV_STAFF_SLOW_MONSTERS:
2566 if (slow_monsters()) ident = TRUE;
2570 case SV_STAFF_SPEED:
2572 if (set_fast(randint1(30) + 15, FALSE)) ident = TRUE;
2576 case SV_STAFF_PROBING:
2583 case SV_STAFF_DISPEL_EVIL:
2585 if (dispel_evil(80)) ident = TRUE;
2589 case SV_STAFF_POWER:
2591 if (dispel_monsters(150)) ident = TRUE;
2595 case SV_STAFF_HOLINESS:
2597 if (dispel_evil(150)) ident = TRUE;
2599 if (set_protevil((magic ? 0 : p_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
2600 if (set_poisoned(0)) ident = TRUE;
2601 if (set_afraid(0)) ident = TRUE;
2602 if (hp_player(50)) ident = TRUE;
2603 if (set_stun(0)) ident = TRUE;
2604 if (set_cut(0)) ident = TRUE;
2608 case SV_STAFF_GENOCIDE:
2610 (void)symbol_genocide((magic ? p_ptr->lev + 50 : 200), TRUE);
2615 case SV_STAFF_EARTHQUAKES:
2617 if (earthquake(py, px, 10))
2621 msg_print("¥À¥ó¥¸¥ç¥ó¤¬Íɤ줿¡£");
2623 msg_print("The dungeon trembles.");
2630 case SV_STAFF_DESTRUCTION:
2632 if (destroy_area(py, px, 13 + randint0(5), FALSE))
2638 case SV_STAFF_ANIMATE_DEAD:
2640 if (animate_dead(0, py, px))
2646 case SV_STAFF_MSTORM:
2649 msg_print("¶¯ÎϤÊËâÎϤ¬Å¨¤ò°ú¤Îö¤¤¤¿¡ª");
2651 msg_print("Mighty magics rend your enemies!");
2653 project(0, 5, py, px,
2654 (randint1(200) + 300) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
2655 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))
2658 (void)take_hit(DAMAGE_NOESCAPE, 50, "¥³¥ó¥È¥í¡¼¥ë¤·Æñ¤¤¶¯ÎϤÊËâÎϤβòÊü", -1);
2660 (void)take_hit(DAMAGE_NOESCAPE, 50, "unleashing magics too mighty to control", -1);
2668 case SV_STAFF_NOTHING:
2671 msg_print("²¿¤âµ¯¤é¤Ê¤«¤Ã¤¿¡£");
2673 msg_print("Nothing happen.");
2675 if (prace_is_(RACE_SKELETON) || prace_is_(RACE_GOLEM) ||
2676 prace_is_(RACE_ZOMBIE) || prace_is_(RACE_SPECTRE))
2678 msg_print("¤â¤Ã¤¿¤¤¤Ê¤¤»ö¤ò¤·¤¿¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£¿©¤Ùʪ¤ÏÂçÀڤˤ·¤Ê¤¯¤Æ¤Ï¡£");
2680 msg_print("What a waste. It's your food!");
2689 * Use a staff. -RAK-
2691 * One charge of one staff disappears.
2693 * Hack -- staffs of identify can be "cancelled".
2695 static void do_cmd_use_staff_aux(int item)
2697 int ident, chance, lev;
2701 /* Hack -- let staffs of identify get aborted */
2702 bool use_charge = TRUE;
2705 /* Get the item (in the pack) */
2708 o_ptr = &inventory[item];
2711 /* Get the item (on the floor) */
2714 o_ptr = &o_list[0 - item];
2718 /* Mega-Hack -- refuse to use a pile from the ground */
2719 if ((item < 0) && (o_ptr->number > 1))
2722 msg_print("¤Þ¤º¤Ï¾ó¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
2724 msg_print("You must first pick up the staffs.");
2734 /* Extract the item level */
2735 lev = k_info[o_ptr->k_idx].level;
2736 if (lev > 50) lev = 50 + (lev - 50)/2;
2738 /* Base chance of success */
2739 chance = p_ptr->skill_dev;
2741 /* Confusion hurts skill */
2742 if (p_ptr->confused) chance = chance / 2;
2744 /* Hight level objects are harder */
2745 chance = chance - lev;
2747 /* Give everyone a (slight) chance */
2748 if ((chance < USE_DEVICE) && one_in_(USE_DEVICE - chance + 1))
2750 chance = USE_DEVICE;
2755 if (flush_failure) flush();
2757 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
2759 msg_print("Nothing happen. Maybe this staff is freezing too.");
2766 /* Roll for usage */
2767 if ((chance < USE_DEVICE) || (randint1(chance) < USE_DEVICE) || (p_ptr->pclass == CLASS_BERSERKER))
2769 if (flush_failure) flush();
2771 msg_print("¾ó¤ò¤¦¤Þ¤¯»È¤¨¤Ê¤«¤Ã¤¿¡£");
2773 msg_print("You failed to use the staff properly.");
2780 /* Notice empty staffs */
2781 if (o_ptr->pval <= 0)
2783 if (flush_failure) flush();
2785 msg_print("¤³¤Î¾ó¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£");
2787 msg_print("The staff has no charges left.");
2790 o_ptr->ident |= (IDENT_EMPTY);
2792 /* Combine / Reorder the pack (later) */
2793 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2794 p_ptr->window |= (PW_INVEN);
2803 ident = staff_effect(o_ptr->sval, &use_charge, FALSE, object_is_aware(o_ptr));
2805 if (!(object_is_aware(o_ptr)))
2807 chg_virtue(V_PATIENCE, -1);
2808 chg_virtue(V_CHANCE, 1);
2809 chg_virtue(V_KNOWLEDGE, -1);
2812 /* Combine / Reorder the pack (later) */
2813 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2815 /* Tried the item */
2816 object_tried(o_ptr);
2818 /* An identification was made */
2819 if (ident && !object_is_aware(o_ptr))
2821 object_aware(o_ptr);
2822 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
2826 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
2829 /* Hack -- some uses are "free" */
2830 if (!use_charge) return;
2833 /* Use a single charge */
2836 /* XXX Hack -- unstack if necessary */
2837 if ((item >= 0) && (o_ptr->number > 1))
2842 /* Get local object */
2845 /* Obtain a local object */
2846 object_copy(q_ptr, o_ptr);
2848 /* Modify quantity */
2851 /* Restore the charges */
2854 /* Unstack the used item */
2856 p_ptr->total_weight -= q_ptr->weight;
2857 item = inven_carry(q_ptr);
2861 msg_print("¾ó¤ò¤Þ¤È¤á¤Ê¤ª¤·¤¿¡£");
2863 msg_print("You unstack your staff.");
2868 /* Describe charges in the pack */
2871 inven_item_charges(item);
2874 /* Describe charges on the floor */
2877 floor_item_charges(0 - item);
2882 void do_cmd_use_staff(void)
2887 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
2889 set_action(ACTION_NONE);
2892 /* Restrict choices to wands */
2893 item_tester_tval = TV_STAFF;
2897 q = "¤É¤Î¾ó¤ò»È¤¤¤Þ¤¹¤«? ";
2898 s = "»È¤¨¤ë¾ó¤¬¤Ê¤¤¡£";
2900 q = "Use which staff? ";
2901 s = "You have no staff to use.";
2904 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
2906 do_cmd_use_staff_aux(item);
2910 static int wand_effect(int sval, int dir, bool magic)
2914 /* XXX Hack -- Wand of wonder can do anything before it */
2915 if (sval == SV_WAND_WONDER)
2917 int vir = virtue_number(V_CHANCE);
2918 sval = randint0(SV_WAND_WONDER);
2922 if (p_ptr->virtues[vir - 1] > 0)
2924 while (randint1(300) < p_ptr->virtues[vir - 1]) sval++;
2925 if (sval > SV_WAND_COLD_BALL) sval = randint0(4) + SV_WAND_ACID_BALL;
2929 while (randint1(300) < (0-p_ptr->virtues[vir - 1])) sval--;
2930 if (sval < SV_WAND_HEAL_MONSTER) sval = randint0(3) + SV_WAND_HEAL_MONSTER;
2933 if (sval < SV_WAND_TELEPORT_AWAY)
2934 chg_virtue(V_CHANCE, 1);
2937 /* Analyze the wand */
2940 case SV_WAND_HEAL_MONSTER:
2942 if (heal_monster(dir, damroll(10, 10))) ident = TRUE;
2946 case SV_WAND_HASTE_MONSTER:
2948 if (speed_monster(dir)) ident = TRUE;
2952 case SV_WAND_CLONE_MONSTER:
2954 if (clone_monster(dir)) ident = TRUE;
2958 case SV_WAND_TELEPORT_AWAY:
2960 if (teleport_monster(dir)) ident = TRUE;
2964 case SV_WAND_DISARMING:
2966 if (disarm_trap(dir)) ident = TRUE;
2970 case SV_WAND_TRAP_DOOR_DEST:
2972 if (destroy_door(dir)) ident = TRUE;
2976 case SV_WAND_STONE_TO_MUD:
2978 if (wall_to_mud(dir)) ident = TRUE;
2985 msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
2987 msg_print("A line of blue shimmering light appears.");
2990 (void)lite_line(dir);
2995 case SV_WAND_SLEEP_MONSTER:
2997 if (sleep_monster(dir)) ident = TRUE;
3001 case SV_WAND_SLOW_MONSTER:
3003 if (slow_monster(dir)) ident = TRUE;
3007 case SV_WAND_CONFUSE_MONSTER:
3009 if (confuse_monster(dir, p_ptr->lev)) ident = TRUE;
3013 case SV_WAND_FEAR_MONSTER:
3015 if (fear_monster(dir, p_ptr->lev)) ident = TRUE;
3019 case SV_WAND_DRAIN_LIFE:
3021 if (drain_life(dir, 80 + p_ptr->lev)) ident = TRUE;
3025 case SV_WAND_POLYMORPH:
3027 if (poly_monster(dir)) ident = TRUE;
3031 case SV_WAND_STINKING_CLOUD:
3033 fire_ball(GF_POIS, dir, 12 + p_ptr->lev / 4, 2);
3038 case SV_WAND_MAGIC_MISSILE:
3040 fire_bolt_or_beam(20, GF_MISSILE, dir, damroll(2 + p_ptr->lev / 10, 6));
3045 case SV_WAND_ACID_BOLT:
3047 fire_bolt_or_beam(20, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
3052 case SV_WAND_CHARM_MONSTER:
3054 if (charm_monster(dir, MAX(20, p_ptr->lev)))
3059 case SV_WAND_FIRE_BOLT:
3061 fire_bolt_or_beam(20, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
3066 case SV_WAND_COLD_BOLT:
3068 fire_bolt_or_beam(20, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
3073 case SV_WAND_ACID_BALL:
3075 fire_ball(GF_ACID, dir, 60 + 3 * p_ptr->lev / 4, 2);
3080 case SV_WAND_ELEC_BALL:
3082 fire_ball(GF_ELEC, dir, 40 + 3 * p_ptr->lev / 4, 2);
3087 case SV_WAND_FIRE_BALL:
3089 fire_ball(GF_FIRE, dir, 70 + 3 * p_ptr->lev / 4, 2);
3094 case SV_WAND_COLD_BALL:
3096 fire_ball(GF_COLD, dir, 50 + 3 * p_ptr->lev / 4, 2);
3101 case SV_WAND_WONDER:
3104 msg_print("¤ª¤Ã¤È¡¢Ææ¤ÎËâË¡ËÀ¤ò»ÏÆ°¤µ¤»¤¿¡£");
3106 msg_print("Oops. Wand of wonder activated.");
3112 case SV_WAND_DRAGON_FIRE:
3114 fire_ball(GF_FIRE, dir, 200, -3);
3119 case SV_WAND_DRAGON_COLD:
3121 fire_ball(GF_COLD, dir, 180, -3);
3126 case SV_WAND_DRAGON_BREATH:
3128 switch (randint1(5))
3132 fire_ball(GF_ACID, dir, 240, -3);
3138 fire_ball(GF_ELEC, dir, 210, -3);
3144 fire_ball(GF_FIRE, dir, 240, -3);
3150 fire_ball(GF_COLD, dir, 210, -3);
3156 fire_ball(GF_POIS, dir, 180, -3);
3165 case SV_WAND_DISINTEGRATE:
3167 fire_ball(GF_DISINTEGRATE, dir, 200 + randint1(p_ptr->lev * 2), 2);
3172 case SV_WAND_ROCKETS:
3175 msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡ª");
3177 msg_print("You launch a rocket!");
3180 fire_rocket(GF_ROCKET, dir, 250 + p_ptr->lev * 3, 2);
3185 case SV_WAND_STRIKING:
3187 fire_bolt(GF_METEOR, dir, damroll(15 + p_ptr->lev / 3, 13));
3192 case SV_WAND_GENOCIDE:
3194 fire_ball_hide(GF_GENOCIDE, dir, magic ? p_ptr->lev + 50 : 250, 0);
3204 * Aim a wand (from the pack or floor).
3206 * Use a single charge from a single item.
3207 * Handle "unstacking" in a logical manner.
3209 * For simplicity, you cannot use a stack of items from the
3210 * ground. This would require too much nasty code.
3212 * There are no wands which can "destroy" themselves, in the inventory
3213 * or on the ground, so we can ignore this possibility. Note that this
3214 * required giving "wand of wonder" the ability to ignore destruction
3215 * by electric balls.
3217 * All wands can be "cancelled" at the "Direction?" prompt for free.
3219 * Note that the basic "bolt" wands do slightly less damage than the
3220 * basic "bolt" rods, but the basic "ball" wands do the same damage
3221 * as the basic "ball" rods.
3223 static void do_cmd_aim_wand_aux(int item)
3225 int lev, ident, chance, dir;
3227 bool old_target_pet = target_pet;
3229 /* Get the item (in the pack) */
3232 o_ptr = &inventory[item];
3235 /* Get the item (on the floor) */
3238 o_ptr = &o_list[0 - item];
3241 /* Mega-Hack -- refuse to aim a pile from the ground */
3242 if ((item < 0) && (o_ptr->number > 1))
3245 msg_print("¤Þ¤º¤ÏËâË¡ËÀ¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
3247 msg_print("You must first pick up the wands.");
3254 /* Allow direction to be cancelled for free */
3255 if (object_is_aware(o_ptr) && (o_ptr->sval == SV_WAND_HEAL_MONSTER
3256 || o_ptr->sval == SV_WAND_HASTE_MONSTER))
3258 if (!get_aim_dir(&dir))
3260 target_pet = old_target_pet;
3263 target_pet = old_target_pet;
3269 lev = k_info[o_ptr->k_idx].level;
3270 if (lev > 50) lev = 50 + (lev - 50)/2;
3272 /* Base chance of success */
3273 chance = p_ptr->skill_dev;
3275 /* Confusion hurts skill */
3276 if (p_ptr->confused) chance = chance / 2;
3278 /* Hight level objects are harder */
3279 chance = chance - lev;
3281 /* Give everyone a (slight) chance */
3282 if ((chance < USE_DEVICE) && one_in_(USE_DEVICE - chance + 1))
3284 chance = USE_DEVICE;
3289 if (flush_failure) flush();
3291 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3293 msg_print("Nothing happen. Maybe this wand is freezing too.");
3300 /* Roll for usage */
3301 if ((chance < USE_DEVICE) || (randint1(chance) < USE_DEVICE) || (p_ptr->pclass == CLASS_BERSERKER))
3303 if (flush_failure) flush();
3305 msg_print("ËâË¡ËÀ¤ò¤¦¤Þ¤¯»È¤¨¤Ê¤«¤Ã¤¿¡£");
3307 msg_print("You failed to use the wand properly.");
3314 /* The wand is already empty! */
3315 if (o_ptr->pval <= 0)
3317 if (flush_failure) flush();
3319 msg_print("¤³¤ÎËâË¡ËÀ¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£");
3321 msg_print("The wand has no charges left.");
3324 o_ptr->ident |= (IDENT_EMPTY);
3326 /* Combine / Reorder the pack (later) */
3327 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3328 p_ptr->window |= (PW_INVEN);
3336 ident = wand_effect(o_ptr->sval, dir, FALSE);
3338 /* Combine / Reorder the pack (later) */
3339 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3341 if (!(object_is_aware(o_ptr)))
3343 chg_virtue(V_PATIENCE, -1);
3344 chg_virtue(V_CHANCE, 1);
3345 chg_virtue(V_KNOWLEDGE, -1);
3348 /* Mark it as tried */
3349 object_tried(o_ptr);
3351 /* Apply identification */
3352 if (ident && !object_is_aware(o_ptr))
3354 object_aware(o_ptr);
3355 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
3359 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3362 /* Use a single charge */
3365 /* Describe the charges in the pack */
3368 inven_item_charges(item);
3371 /* Describe the charges on the floor */
3374 floor_item_charges(0 - item);
3379 void do_cmd_aim_wand(void)
3384 /* Restrict choices to wands */
3385 item_tester_tval = TV_WAND;
3387 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
3389 set_action(ACTION_NONE);
3394 q = "¤É¤ÎËâË¡ËÀ¤ÇÁÀ¤¤¤Þ¤¹¤«? ";
3395 s = "»È¤¨¤ëËâË¡ËÀ¤¬¤Ê¤¤¡£";
3397 q = "Aim which wand? ";
3398 s = "You have no wand to aim.";
3401 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
3404 do_cmd_aim_wand_aux(item);
3408 static int rod_effect(int sval, int dir, bool *use_charge, bool magic)
3415 /* Analyze the rod */
3418 case SV_ROD_DETECT_TRAP:
3420 if (detect_traps(DETECT_RAD_DEFAULT, (bool)(dir ? FALSE : TRUE))) ident = TRUE;
3424 case SV_ROD_DETECT_DOOR:
3426 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
3427 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
3431 case SV_ROD_IDENTIFY:
3433 if (!ident_spell(FALSE)) *use_charge = FALSE;
3440 if (!word_of_recall()) *use_charge = FALSE;
3445 case SV_ROD_ILLUMINATION:
3447 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
3451 case SV_ROD_MAPPING:
3453 map_area(DETECT_RAD_MAP);
3458 case SV_ROD_DETECTION:
3460 detect_all(DETECT_RAD_DEFAULT);
3465 case SV_ROD_PROBING:
3474 if (set_blind(0)) ident = TRUE;
3475 if (set_poisoned(0)) ident = TRUE;
3476 if (set_confused(0)) ident = TRUE;
3477 if (set_stun(0)) ident = TRUE;
3478 if (set_cut(0)) ident = TRUE;
3479 if (set_image(0)) ident = TRUE;
3480 if (set_shero(0,TRUE)) ident = TRUE;
3484 case SV_ROD_HEALING:
3486 if (hp_player(500)) ident = TRUE;
3487 if (set_stun(0)) ident = TRUE;
3488 if (set_cut(0)) ident = TRUE;
3489 if (set_shero(0,TRUE)) ident = TRUE;
3493 case SV_ROD_RESTORATION:
3495 if (restore_level()) ident = TRUE;
3496 if (do_res_stat(A_STR)) ident = TRUE;
3497 if (do_res_stat(A_INT)) ident = TRUE;
3498 if (do_res_stat(A_WIS)) ident = TRUE;
3499 if (do_res_stat(A_DEX)) ident = TRUE;
3500 if (do_res_stat(A_CON)) ident = TRUE;
3501 if (do_res_stat(A_CHR)) ident = TRUE;
3507 if (set_fast(randint1(30) + 15, FALSE)) ident = TRUE;
3511 case SV_ROD_PESTICIDE:
3513 if (dispel_monsters(4)) ident = TRUE;
3517 case SV_ROD_TELEPORT_AWAY:
3519 if (teleport_monster(dir)) ident = TRUE;
3523 case SV_ROD_DISARMING:
3525 if (disarm_trap(dir)) ident = TRUE;
3532 msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3534 msg_print("A line of blue shimmering light appears.");
3537 (void)lite_line(dir);
3542 case SV_ROD_SLEEP_MONSTER:
3544 if (sleep_monster(dir)) ident = TRUE;
3548 case SV_ROD_SLOW_MONSTER:
3550 if (slow_monster(dir)) ident = TRUE;
3554 case SV_ROD_DRAIN_LIFE:
3556 if (drain_life(dir, 70 + 3 * p_ptr->lev / 2)) ident = TRUE;
3560 case SV_ROD_POLYMORPH:
3562 if (poly_monster(dir)) ident = TRUE;
3566 case SV_ROD_ACID_BOLT:
3568 fire_bolt_or_beam(10, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
3573 case SV_ROD_ELEC_BOLT:
3575 fire_bolt_or_beam(10, GF_ELEC, dir, damroll(4 + p_ptr->lev / 9, 8));
3580 case SV_ROD_FIRE_BOLT:
3582 fire_bolt_or_beam(10, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
3587 case SV_ROD_COLD_BOLT:
3589 fire_bolt_or_beam(10, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
3594 case SV_ROD_ACID_BALL:
3596 fire_ball(GF_ACID, dir, 60 + p_ptr->lev, 2);
3601 case SV_ROD_ELEC_BALL:
3603 fire_ball(GF_ELEC, dir, 40 + p_ptr->lev, 2);
3608 case SV_ROD_FIRE_BALL:
3610 fire_ball(GF_FIRE, dir, 70 + p_ptr->lev, 2);
3615 case SV_ROD_COLD_BALL:
3617 fire_ball(GF_COLD, dir, 50 + p_ptr->lev, 2);
3629 case SV_ROD_STONE_TO_MUD:
3631 if (wall_to_mud(dir)) ident = TRUE;
3635 case SV_ROD_AGGRAVATE:
3637 aggravate_monsters(0);
3646 * Activate (zap) a Rod
3648 * Unstack fully charged rods as needed.
3650 * Hack -- rods of perception/genocide can be "cancelled"
3651 * All rods can be cancelled at the "Direction?" prompt
3653 * pvals are defined for each rod in k_info. -LM-
3655 static void do_cmd_zap_rod_aux(int item)
3657 int ident, chance, lev, fail;
3662 /* Hack -- let perception get aborted */
3663 bool use_charge = TRUE;
3667 /* Get the item (in the pack) */
3670 o_ptr = &inventory[item];
3673 /* Get the item (on the floor) */
3676 o_ptr = &o_list[0 - item];
3680 /* Mega-Hack -- refuse to zap a pile from the ground */
3681 if ((item < 0) && (o_ptr->number > 1))
3684 msg_print("¤Þ¤º¤Ï¥í¥Ã¥É¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
3686 msg_print("You must first pick up the rods.");
3693 /* Get a direction (unless KNOWN not to need it) */
3694 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)) ||
3695 !object_is_aware(o_ptr))
3697 /* Get a direction, allow cancel */
3698 if (!get_aim_dir(&dir)) return;
3705 /* Extract the item level */
3706 lev = k_info[o_ptr->k_idx].level;
3708 /* Base chance of success */
3709 chance = p_ptr->skill_dev;
3711 /* Confusion hurts skill */
3712 if (p_ptr->confused) chance = chance / 2;
3715 if (chance > fail) fail -= (chance - fail)*2;
3716 else chance -= (fail - chance)*2;
3717 if (fail < USE_DEVICE) fail = USE_DEVICE;
3718 if (chance < USE_DEVICE) chance = USE_DEVICE;
3722 if (flush_failure) flush();
3724 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3726 msg_print("Nothing happen. Maybe this rod is freezing too.");
3733 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
3734 else if (chance > fail)
3736 if (randint0(chance*2) < fail) success = FALSE;
3737 else success = TRUE;
3741 if (randint0(fail*2) < chance) success = TRUE;
3742 else success = FALSE;
3745 /* Roll for usage */
3748 if (flush_failure) flush();
3750 msg_print("¤¦¤Þ¤¯¥í¥Ã¥É¤ò»È¤¨¤Ê¤«¤Ã¤¿¡£");
3752 msg_print("You failed to use the rod properly.");
3759 k_ptr = &k_info[o_ptr->k_idx];
3761 /* A single rod is still charging */
3762 if ((o_ptr->number == 1) && (o_ptr->timeout))
3764 if (flush_failure) flush();
3766 msg_print("¤³¤Î¥í¥Ã¥É¤Ï¤Þ¤ÀËâÎϤò½¼Å¶¤·¤Æ¤¤¤ëºÇÃæ¤À¡£");
3768 msg_print("The rod is still charging.");
3773 /* A stack of rods lacks enough energy. */
3774 else if ((o_ptr->number > 1) && (o_ptr->timeout > k_ptr->pval * (o_ptr->number - 1)))
3776 if (flush_failure) flush();
3778 msg_print("¤½¤Î¥í¥Ã¥É¤Ï¤Þ¤À½¼Å¶Ãæ¤Ç¤¹¡£");
3780 msg_print("The rods are all still charging.");
3789 ident = rod_effect(o_ptr->sval, dir, &use_charge, FALSE);
3791 /* Increase the timeout by the rod kind's pval. -LM- */
3792 if (use_charge) o_ptr->timeout += k_ptr->pval;
3794 /* Combine / Reorder the pack (later) */
3795 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3797 if (!(object_is_aware(o_ptr)))
3799 chg_virtue(V_PATIENCE, -1);
3800 chg_virtue(V_CHANCE, 1);
3801 chg_virtue(V_KNOWLEDGE, -1);
3804 /* Tried the object */
3805 object_tried(o_ptr);
3807 /* Successfully determined the object function */
3808 if (ident && !object_is_aware(o_ptr))
3810 object_aware(o_ptr);
3811 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
3815 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3819 void do_cmd_zap_rod(void)
3824 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
3826 set_action(ACTION_NONE);
3829 /* Restrict choices to rods */
3830 item_tester_tval = TV_ROD;
3834 q = "¤É¤Î¥í¥Ã¥É¤ò¿¶¤ê¤Þ¤¹¤«? ";
3835 s = "»È¤¨¤ë¥í¥Ã¥É¤¬¤Ê¤¤¡£";
3837 q = "Zap which rod? ";
3838 s = "You have no rod to zap.";
3841 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
3844 do_cmd_zap_rod_aux(item);
3849 * Hook to determine if an object is activatable
3851 static bool item_tester_hook_activate(object_type *o_ptr)
3853 u32b flgs[TR_FLAG_SIZE];
3856 if (!object_is_known(o_ptr)) return (FALSE);
3858 /* Extract the flags */
3859 object_flags(o_ptr, flgs);
3861 /* Check activation flag */
3862 if (have_flag(flgs, TR_ACTIVATE)) return (TRUE);
3870 * Hack -- activate the ring of power
3872 void ring_of_power(int dir)
3874 /* Pick a random effect */
3875 switch (randint1(10))
3882 msg_print("¤¢¤Ê¤¿¤Ï°À¤Î¥ª¡¼¥é¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡£");
3884 msg_print("You are surrounded by a malignant aura.");
3889 /* Decrease all stats (permanently) */
3890 (void)dec_stat(A_STR, 50, TRUE);
3891 (void)dec_stat(A_INT, 50, TRUE);
3892 (void)dec_stat(A_WIS, 50, TRUE);
3893 (void)dec_stat(A_DEX, 50, TRUE);
3894 (void)dec_stat(A_CON, 50, TRUE);
3895 (void)dec_stat(A_CHR, 50, TRUE);
3897 /* Lose some experience (permanently) */
3898 p_ptr->exp -= (p_ptr->exp / 4);
3899 p_ptr->max_exp -= (p_ptr->exp / 4);
3909 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥª¡¼¥é¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡£");
3911 msg_print("You are surrounded by a powerful aura.");
3915 /* Dispel monsters */
3916 dispel_monsters(1000);
3926 fire_ball(GF_MANA, dir, 600, 3);
3937 fire_bolt(GF_MANA, dir, 500);
3945 static bool ang_sort_comp_pet(vptr u, vptr v, int a, int b)
3947 u16b *who = (u16b*)(u);
3952 monster_type *m_ptr1 = &m_list[w1];
3953 monster_type *m_ptr2 = &m_list[w2];
3954 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
3955 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
3960 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
3961 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
3963 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
3964 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
3966 if (r_ptr1->level > r_ptr2->level) return TRUE;
3967 if (r_ptr2->level > r_ptr1->level) return FALSE;
3969 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
3970 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
3976 * Activate a wielded object. Wielded objects never stack.
3977 * And even if they did, activatable objects never stack.
3979 * Currently, only (some) artifacts, and Dragon Scale Mail, can be activated.
3980 * But one could, for example, easily make an activatable "Ring of Plasma".
3982 * Note that it always takes a turn to activate an artifact, even if
3983 * the user hits "escape" at the "direction" prompt.
3985 static void do_cmd_activate_aux(int item)
3987 int k, dir, lev, chance, fail;
3992 /* Get the item (in the pack) */
3995 o_ptr = &inventory[item];
3998 /* Get the item (on the floor) */
4001 o_ptr = &o_list[0 - item];
4007 /* Extract the item level */
4008 lev = k_info[o_ptr->k_idx].level;
4010 /* Hack -- use artifact level instead */
4011 if (object_is_fixed_artifact(o_ptr)) lev = a_info[o_ptr->name1].level;
4012 else if (o_ptr->art_name)
4014 switch (o_ptr->xtra2)
4022 case ACT_CURE_POISON:
4042 case ACT_RESIST_ALL:
4043 case ACT_DETECT_ALL:
4056 case ACT_BANISH_EVIL:
4064 case ACT_CHARM_ANIMAL:
4065 case ACT_SUMMON_ANIMAL:
4068 case ACT_XTRA_SPEED:
4069 case ACT_DETECT_XTRA:
4077 case ACT_CHARM_UNDEAD:
4078 case ACT_CHARM_OTHER:
4079 case ACT_SUMMON_PHANTOM:
4080 case ACT_SUMMON_ELEMENTAL:
4081 case ACT_RUNE_EXPLO:
4085 case ACT_CHARM_ANIMALS:
4086 case ACT_CHARM_OTHERS:
4093 case ACT_CALL_CHAOS:
4098 case ACT_SUMMON_UNDEAD:
4099 case ACT_SUMMON_DEMON:
4110 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
4112 /* Base chance of success */
4113 chance = p_ptr->skill_dev;
4115 /* Confusion hurts skill */
4116 if (p_ptr->confused) chance = chance / 2;
4119 if (chance > fail) fail -= (chance - fail)*2;
4120 else chance -= (fail - chance)*2;
4121 if (fail < USE_DEVICE) fail = USE_DEVICE;
4122 if (chance < USE_DEVICE) chance = USE_DEVICE;
4126 if (flush_failure) flush();
4128 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
4130 msg_print("It shows no reaction.");
4137 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
4138 else if (chance > fail)
4140 if (randint0(chance*2) < fail) success = FALSE;
4141 else success = TRUE;
4145 if (randint0(fail*2) < chance) success = TRUE;
4146 else success = FALSE;
4149 /* Roll for usage */
4152 if (flush_failure) flush();
4154 msg_print("¤¦¤Þ¤¯»ÏÆ°¤µ¤»¤ë¤³¤È¤¬¤Ç¤¤Ê¤«¤Ã¤¿¡£");
4156 msg_print("You failed to activate it properly.");
4163 /* Check the recharge */
4167 msg_print("¤½¤ì¤ÏÈù¤«¤Ë²»¤òΩ¤Æ¡¢µ±¤¡¢¾Ã¤¨¤¿...");
4169 msg_print("It whines, glows and fades...");
4176 /* Activate the artifact */
4178 msg_print("»ÏÆ°¤µ¤»¤¿...");
4180 msg_print("You activate it...");
4188 if (o_ptr->art_name && o_ptr->xtra2)
4190 (void)activate_random_artifact(o_ptr);
4193 p_ptr->window |= (PW_INVEN | PW_EQUIP);
4200 else if (object_is_fixed_artifact(o_ptr))
4203 switch (o_ptr->name1)
4208 msg_print("ààÍþÉÓ¤«¤éÀ¡¤ó¤À¸÷¤¬¤¢¤Õ¤ì½Ð¤¿...");
4210 msg_print("The phial wells with clear light...");
4213 lite_area(damroll(2, 15), 3);
4214 o_ptr->timeout = randint0(10) + 10;
4221 msg_print("À±¤¬âÁ¤·¤¯µ±¤¤¤¿...");
4223 msg_print("The star shines brightly...");
4226 map_area(DETECT_RAD_MAP);
4227 lite_area(damroll(2, 15), 3);
4228 o_ptr->timeout = randint0(50) + 50;
4235 msg_print("¤½¤ÎÊõÀФÏÀÖ¤¯ÌÀ¤ë¤¯¸÷¤Ã¤¿¡ª");
4237 msg_print("The Jewel flashes bright red!");
4240 chg_virtue(V_KNOWLEDGE, 1);
4241 chg_virtue(V_ENLIGHTEN, 1);
4244 msg_print("¤½¤ÎÊõÀФϤ¢¤Ê¤¿¤ÎÂÎÎϤòÃ¥¤Ã¤¿...");
4245 take_hit(DAMAGE_LOSELIFE, damroll(3,8), "¿³È½¤ÎÊõÀÐ", -1);
4247 msg_print("The Jewel drains your vitality...");
4248 take_hit(DAMAGE_LOSELIFE, damroll(3, 8), "the Jewel of Judgement", -1);
4251 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
4252 (void)detect_doors(DETECT_RAD_DEFAULT);
4253 (void)detect_stairs(DETECT_RAD_DEFAULT);
4256 if (get_check("µ¢´Ô¤ÎÎϤò»È¤¤¤Þ¤¹¤«¡©"))
4258 if (get_check("Activate recall? "))
4262 (void)word_of_recall();
4265 o_ptr->timeout = randint0(20) + 20;
4272 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
4274 msg_print("The amulet lets out a shrill wail...");
4278 (void)set_protevil(randint1(25) + k, FALSE);
4279 o_ptr->timeout = randint0(225) + 225;
4286 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
4288 msg_print("The amulet floods the area with goodness...");
4291 dispel_evil(p_ptr->lev * 5);
4292 o_ptr->timeout = randint0(200) + 200;
4299 msg_print("¶À¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
4301 msg_print("The mirror floods the area with goodness...");
4304 dispel_evil(p_ptr->lev * 5);
4305 o_ptr->timeout = randint0(200) + 200;
4312 msg_print("¤¢¤Ê¤¿¤Ï¥Õ¥é¥¥¢¤ËŨ¤òÄù¤á»¦¤¹¤è¤¦Ì¿¤¸¤¿¡£");
4314 msg_print("You order Frakir to strangle your opponent.");
4317 if (!get_aim_dir(&dir)) return;
4318 if (drain_life(dir, 100))
4319 o_ptr->timeout = randint0(100) + 100;
4326 msg_print("»ØÎؤÏÌÀ¤ë¤¯µ±¤¤¤¿...");
4328 msg_print("The ring glows brightly...");
4331 (void)set_fast(randint1(75) + 75, FALSE);
4332 o_ptr->timeout = randint0(150) + 150;
4339 msg_print("»ØÎؤϿ¼¹È¤Ëµ±¤¤¤¿...");
4341 msg_print("The ring glows deep red...");
4344 if (!get_aim_dir(&dir)) return;
4345 fire_ball(GF_FIRE, dir, 300, 3);
4346 o_ptr->timeout = randint0(225) + 225;
4353 msg_print("»ØÎؤÏÇò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4355 msg_print("The ring glows bright white...");
4358 if (!get_aim_dir(&dir)) return;
4359 fire_ball(GF_COLD, dir, 400, 3);
4360 o_ptr->timeout = randint0(325) + 325;
4368 msg_format("%s¤Ï¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...", o_ptr->name1 == ART_VILYA ? "»ØÎØ" : "¥½¡¼¥É");
4370 msg_format("The %s glows deep blue...", o_ptr->name1 == ART_VILYA ? "ring" : "sword");
4373 if (!get_aim_dir(&dir)) return;
4374 fire_ball(GF_ELEC, dir, 500, 3);
4375 o_ptr->timeout = randint0(425) + 425;
4383 msg_print("»ØÎؤϼ¿¹õ¤Ëµ±¤¤¤¿...");
4385 msg_print("The ring glows intensely black...");
4388 if (!get_aim_dir(&dir)) return;
4390 o_ptr->timeout = randint0(450) + 450;
4396 int num = damroll(5, 3);
4401 msg_print("³»¤¬°ðºÊ¤Çʤ¤ï¤ì¤¿...");
4403 msg_print("Your armor is surrounded by lightning...");
4407 for (k = 0; k < num; k++)
4413 scatter(&y, &x, py, px, 4, 0);
4415 if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
4417 if (!player_bold(y, x)) break;
4420 project(0, 3, y, x, 150, GF_ELEC,
4421 (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
4424 o_ptr->timeout = 1000;
4428 case ART_BLADETURNER:
4430 if (!get_aim_dir(&dir)) return;
4432 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
4434 msg_print("You breathe the elements.");
4437 fire_ball(GF_MISSILE, dir, 300, 4);
4439 msg_print("³»¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...");
4441 msg_print("Your armor glows many colours...");
4444 (void)set_afraid(0);
4445 (void)set_hero(randint1(50) + 50, FALSE);
4446 (void)hp_player(10);
4447 (void)set_blessed(randint1(50) + 50, FALSE);
4448 (void)set_oppose_acid(randint1(50) + 50, FALSE);
4449 (void)set_oppose_elec(randint1(50) + 50, FALSE);
4450 (void)set_oppose_fire(randint1(50) + 50, FALSE);
4451 (void)set_oppose_cold(randint1(50) + 50, FALSE);
4452 (void)set_oppose_pois(randint1(50) + 50, FALSE);
4453 o_ptr->timeout = 400;
4457 case ART_SOULKEEPER:
4460 msg_print("³»¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4461 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬¤è¤¤...");
4463 msg_print("Your armor glows a bright white...");
4464 msg_print("You feel much better...");
4467 (void)hp_player(1000);
4469 o_ptr->timeout = 888;
4476 msg_print("Å·¹ñ¤Î²Î¤¬Ê¹¤³¤¨¤ë...");
4478 msg_print("A heavenly choir sings...");
4481 (void)set_poisoned(0);
4484 (void)set_confused(0);
4486 (void)set_afraid(0);
4487 (void)set_hero(randint1(25) + 25, FALSE);
4488 (void)hp_player(777);
4489 o_ptr->timeout = 300;
4496 msg_print("³»¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4498 msg_print("Your armor glows deep blue...");
4501 (void)symbol_genocide(200, TRUE);
4502 o_ptr->timeout = 500;
4509 msg_print("³»¤¬ÀÖ¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4511 msg_print("Your armor glows bright red...");
4514 destroy_doors_touch();
4515 o_ptr->timeout = 10;
4523 turn_monsters(40 + p_ptr->lev);
4524 o_ptr->timeout = 3 * (p_ptr->lev + 10);
4529 case ART_HOLHENNETH:
4532 msg_print("¥Ø¥ë¥á¥Ã¥È¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4533 msg_print("¿´¤Ë¥¤¥á¡¼¥¸¤¬É⤫¤ó¤Ç¤¤¿...");
4535 msg_print("Your helm glows bright white...");
4536 msg_print("An image forms in your mind...");
4539 detect_all(DETECT_RAD_DEFAULT);
4540 o_ptr->timeout = randint0(55) + 55;
4547 msg_print("²¦´§¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4548 msg_print("ÂÎÆâ¤ËÃȤ«¤¤¸ÝÆ°¤¬´¶¤¸¤é¤ì¤ë...");
4550 msg_print("Your crown glows deep blue...");
4551 msg_print("You feel a warm tingling inside...");
4554 (void)hp_player(700);
4556 o_ptr->timeout = 250;
4564 msg_format("%s¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...", o_ptr->name1 == ART_COLLUIN ? "¥¯¥í¡¼¥¯" : "³»");
4566 msg_format("Your %s glows many colours...", o_ptr->name1 == ART_COLLUIN ? "cloak" : "armor");
4569 (void)set_oppose_acid(randint1(20) + 20, FALSE);
4570 (void)set_oppose_elec(randint1(20) + 20, FALSE);
4571 (void)set_oppose_fire(randint1(20) + 20, FALSE);
4572 (void)set_oppose_cold(randint1(20) + 20, FALSE);
4573 (void)set_oppose_pois(randint1(20) + 20, FALSE);
4574 o_ptr->timeout = 111;
4578 case ART_HOLCOLLETH:
4581 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4583 msg_print("Your cloak glows deep blue...");
4586 sleep_monsters_touch();
4587 o_ptr->timeout = 55;
4594 msg_print("¥¯¥í¡¼¥¯¤¬²«¿§¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4596 msg_print("Your cloak glows bright yellow...");
4600 o_ptr->timeout = 70;
4607 msg_print("¥¯¥í¡¼¥¯¤¬ÊÕ¤ê¤Î¶õ´Ö¤ò¤æ¤¬¤Þ¤»¤¿...");
4609 msg_print("Your cloak twists space around you...");
4612 teleport_player(100, 0L);
4613 o_ptr->timeout = 45;
4620 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4622 msg_print("Your cloak glows a deep red...");
4626 o_ptr->timeout = 450;
4630 case ART_HEAVENLY_MAIDEN:
4633 msg_print("¥¯¥í¡¼¥¯¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
4635 msg_print("Your cloak glows soft white...");
4637 if (!word_of_recall()) return;
4638 o_ptr->timeout = 200;
4642 case ART_CAMMITHRIM:
4645 msg_print("¥°¥í¡¼¥Ö¤¬âÁ¤·¤¤¤¯¤é¤¤¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4647 msg_print("Your gloves glow extremely brightly...");
4650 if (!get_aim_dir(&dir)) return;
4651 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
4659 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4661 msg_print("Your gauntlets are covered in fire...");
4664 if (!get_aim_dir(&dir)) return;
4665 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4666 o_ptr->timeout = randint0(8) + 8;
4670 case ART_PAURNIMMEN:
4673 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4675 msg_print("Your gauntlets are covered in frost...");
4678 if (!get_aim_dir(&dir)) return;
4679 fire_bolt(GF_COLD, dir, damroll(6, 8));
4680 o_ptr->timeout = randint0(7) + 7;
4687 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4689 msg_print("Your gauntlets are covered in sparks...");
4692 if (!get_aim_dir(&dir)) return;
4693 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4694 o_ptr->timeout = randint0(5) + 5;
4701 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬»À¤Ëʤ¤ï¤ì¤¿...");
4703 msg_print("Your gauntlets are covered in acid...");
4706 if (!get_aim_dir(&dir)) return;
4707 fire_bolt(GF_ACID, dir, damroll(5, 8));
4708 o_ptr->timeout = randint0(6) + 6;
4715 msg_print("¥»¥¹¥¿¥¹¤ËËâË¡¤Î¥È¥²¤¬¸½¤ì¤¿...");
4717 msg_print("Your cesti grows magical spikes...");
4720 if (!get_aim_dir(&dir)) return;
4721 fire_bolt(GF_ARROW, dir, 150);
4722 o_ptr->timeout = randint0(90) + 90;
4729 msg_print("¥Ö¡¼¥Ä¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4731 msg_print("Your boots glow bright green...");
4734 (void)set_fast(randint1(20) + 20, FALSE);
4735 o_ptr->timeout = 200;
4742 msg_print("¥Ö¡¼¥Ä¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4744 msg_print("Your boots glow deep blue...");
4747 (void)set_afraid(0);
4748 (void)set_poisoned(0);
4756 msg_print("¥À¥¬¡¼¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4758 msg_print("Your dagger is covered in fire...");
4761 if (!get_aim_dir(&dir)) return;
4762 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4763 o_ptr->timeout = randint0(8) + 8;
4770 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4772 msg_print("Your dagger is covered in frost...");
4775 if (!get_aim_dir(&dir)) return;
4776 fire_bolt(GF_COLD, dir, damroll(6, 8));
4777 o_ptr->timeout = randint0(7) + 7;
4784 msg_print("¥À¥¬¡¼¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4786 msg_print("Your dagger is covered in sparks...");
4789 if (!get_aim_dir(&dir)) return;
4790 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4791 o_ptr->timeout = randint0(5) + 5;
4798 msg_print("¥À¥¬¡¼¤¬¿¼¤¤Îп§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4800 msg_print("Your dagger throbs deep green...");
4803 if (!get_aim_dir(&dir)) return;
4804 fire_ball(GF_POIS, dir, 12, 3);
4805 o_ptr->timeout = randint0(4) + 4;
4812 msg_print("Ì·¤¬¿¼¤¤ÀÄ¿§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4814 msg_print("Your dagger throbs deep blue...");
4817 if (!get_aim_dir(&dir)) return;
4818 fire_ball(GF_WATER, dir, 200, 3);
4819 o_ptr->timeout = 250;
4826 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4828 msg_print("Your dagger is covered in frost...");
4831 if (!get_aim_dir(&dir)) return;
4832 fire_ball(GF_COLD, dir, 48, 2);
4833 o_ptr->timeout = randint0(5) + 5;
4838 case ART_WEREWINDLE:
4840 switch (randint1(13))
4842 case 1: case 2: case 3: case 4: case 5:
4843 teleport_player(10, 0L);
4845 case 6: case 7: case 8: case 9: case 10:
4846 teleport_player(222, 0L);
4849 (void)stair_creation();
4853 if (get_check("¤³¤Î³¬¤òµî¤ê¤Þ¤¹¤«¡©"))
4855 if (get_check("Leave this level? "))
4859 if (autosave_l) do_cmd_save_game(TRUE);
4862 p_ptr->leaving = TRUE;
4865 o_ptr->timeout = 35;
4871 teleport_player(222, 0L);
4872 o_ptr->timeout = 25;
4879 msg_print("¥½¡¼¥É¤¬ÀĤ¯·ã¤·¤¯µ±¤¤¤¿...");
4881 msg_print("Your sword glows an intense blue...");
4884 if (!get_aim_dir(&dir)) return;
4885 fire_ball(GF_COLD, dir, 100, 2);
4886 o_ptr->timeout = 200;
4893 msg_print("¶Ç¤Î»ÕÃĤò¾¤´¤·¤¿¡£");
4895 msg_print("You summon the Legion of the Dawn.");
4898 (void)summon_specific(-1, py, px, dun_level, SUMMON_DAWN, (PM_ALLOW_GROUP | PM_FORCE_PET));
4899 o_ptr->timeout = 500 + randint1(500);
4906 msg_print("¥½¡¼¥É¤¬ÀÖ¤¯·ã¤·¤¯µ±¤¤¤¿...");
4908 msg_print("Your sword glows an intense red...");
4911 if (!get_aim_dir(&dir)) return;
4912 fire_ball(GF_FIRE, dir, 72, 2);
4913 o_ptr->timeout = 400;
4920 msg_print("¥¢¥Ã¥¯¥¹¤Î¿Ï¤¬¹õ¤¯µ±¤¤¤¿...");
4922 msg_print("Your axe blade glows black...");
4925 if (!get_aim_dir(&dir)) return;
4926 drain_life(dir, 120);
4927 o_ptr->timeout = 400;
4934 msg_print("¤¢¤Ê¤¿¤ÎÁä¤ÏÅŵ¤¤Ç¥¹¥Ñ¡¼¥¯¤·¤Æ¤¤¤ë...");
4936 msg_print("Your spear crackles with electricity...");
4939 if (!get_aim_dir(&dir)) return;
4940 fire_ball(GF_ELEC, dir, 100, 3);
4941 o_ptr->timeout = 200;
4948 msg_print("¥¹¥Ô¥¢¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4950 msg_print("Your spear glows a bright white...");
4953 if (!get_aim_dir(&dir)) return;
4954 fire_ball(GF_COLD, dir, 100, 3);
4955 o_ptr->timeout = 200;
4962 msg_print("¥¹¥Ô¥¢¤¬¸ÝÆ°¤·¤¿...");
4964 msg_print("Your spear pulsates...");
4967 if (!get_aim_dir(&dir)) return;
4976 msg_print("¤Ä¤ë¤Ï¤·¤¬¸ÝÆ°¤·¤¿...");
4978 msg_print("Your mattock pulsates...");
4981 if (!get_aim_dir(&dir)) return;
4990 msg_print("¥¢¥Ã¥¯¥¹¤«¤é¤Ò¤É¤¯±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
4992 msg_print("Your axe lets out a long, shrill note...");
4995 (void)mass_genocide(200, TRUE);
4996 o_ptr->timeout = 1000;
5003 msg_print("¥Ð¥È¥ë¡¦¥¢¥Ã¥¯¥¹¤¬¿¼»ç¤Î¸÷¤òÊü¼Í¤·¤¿...");
5005 msg_print("Your battle axe radiates deep purple...");
5008 hp_player(damroll(4, 8));
5009 (void)set_cut((p_ptr->cut / 2) - 50);
5010 o_ptr->timeout = randint0(3) + 3;
5017 msg_print("¥È¥é¥¤¥Ç¥ó¥È¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
5019 msg_print("Your trident glows deep red...");
5022 if (!get_aim_dir(&dir)) return;
5023 teleport_monster(dir);
5024 o_ptr->timeout = 150;
5031 msg_print("Âç³ù¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
5033 msg_print("Your scythe glows soft white...");
5035 if (!word_of_recall()) return;
5036 o_ptr->timeout = 200;
5043 msg_print("¸û¶Ì¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
5045 msg_print("Your scythe glows soft white...");
5047 if (!word_of_recall()) return;
5048 o_ptr->timeout = 200;
5055 msg_print("¥Õ¥ì¥¤¥ë¤¬ÍÍ¡¹¤Ê¿§¤Î²Ð²Ö¤òȯ¤·¤¿...");
5057 msg_print("Your flail glows in scintillating colours...");
5060 if (!get_aim_dir(&dir)) return;
5061 confuse_monster(dir, 20);
5062 o_ptr->timeout = 15;
5069 msg_print("¥â¡¼¥Ë¥ó¥°¥¹¥¿¡¼¤«¤é±ê¤¬¿á¤½Ð¤·¤¿...");
5071 msg_print("Your morning star rages in fire...");
5074 if (!get_aim_dir(&dir)) return;
5075 fire_ball(GF_FIRE, dir, 72, 3);
5076 o_ptr->timeout = 100;
5083 msg_print("¥à¥Á¤¬¿¼¤¤ÀÖ¿§¤Ëµ±¤¤¤¿...");
5085 msg_print("Your whip glows deep red...");
5088 if (!get_aim_dir(&dir)) return;
5089 fire_ball(GF_FIRE, dir, 120, 3);
5090 o_ptr->timeout = 15;
5097 msg_print("¥á¥¤¥¹¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
5099 msg_print("Your mace glows bright green...");
5102 (void)set_fast(randint1(20) + 20, FALSE);
5103 o_ptr->timeout = randint0(100) + 100;
5110 msg_print("¥¯¥©¡¼¥¿¡¼¥¹¥¿¥Ã¥Õ¤¬²«¿§¤¯µ±¤¤¤¿...");
5112 msg_print("Your quarterstaff glows yellow...");
5115 if (!ident_spell(FALSE)) return;
5116 o_ptr->timeout = 10;
5123 msg_print("¾ó¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
5125 msg_print("Your quarterstaff glows brightly...");
5128 detect_all(DETECT_RAD_DEFAULT);
5130 identify_fully(FALSE);
5131 o_ptr->timeout = 100;
5138 msg_print("¥Ï¥ó¥Þ¡¼¤¬Çò¤¯µ±¤¤¤¿...");
5140 msg_print("Your hammer glows white...");
5143 if (!get_aim_dir(&dir)) return;
5144 drain_life(dir, 90);
5145 o_ptr->timeout = 70;
5153 msg_print("¥¯¥í¥¹¥Ü¥¦¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
5155 msg_print("Your crossbow glows deep red...");
5158 (void)brand_bolts();
5159 o_ptr->timeout = 999;
5166 int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
5169 msg_print("¤»¤Ã¤«¤¯¤À¤«¤é¡Ø¥¯¥ê¥à¥¾¥ó¡Ù¤ò¤Ö¤Ã¤Ñ¤Ê¤¹¤¼¡ª");
5171 msg_print("I'll fire CRIMSON! SEKKAKUDAKARA!");
5174 if (!get_aim_dir(&dir)) return;
5176 /* Use the given direction */
5177 tx = px + 99 * ddx[dir];
5178 ty = py + 99 * ddy[dir];
5180 /* Hack -- Use an actual "target" */
5181 if ((dir == 5) && target_okay())
5187 if (p_ptr->pclass == CLASS_ARCHER)
5189 /* Extra shot at level 10 */
5190 if (p_ptr->lev >= 10) num++;
5192 /* Extra shot at level 30 */
5193 if (p_ptr->lev >= 30) num++;
5195 /* Extra shot at level 45 */
5196 if (p_ptr->lev >= 45) num++;
5199 for (i = 0; i < num; i++)
5200 project(0, p_ptr->lev/20+1, ty, tx, p_ptr->lev*p_ptr->lev*6/50, GF_ROCKET, flg, -1);
5201 o_ptr->timeout = 15;
5206 monster_type *m_ptr;
5207 monster_race *r_ptr;
5211 msg_print("´ñ̯¤Ê¾ì½ê¤¬Æ¬¤ÎÃæ¤ËÉ⤫¤ó¤À¡¥¡¥¡¥");
5213 msg_print("Some strange places show up in your mind. And you see ...");
5216 /* Process the monsters (backwards) */
5217 for (i = m_max - 1; i >= 1; i--)
5219 /* Access the monster */
5222 /* Ignore "dead" monsters */
5223 if (!m_ptr->r_idx) continue;
5225 r_ptr = &r_info[m_ptr->r_idx];
5227 if(r_ptr->flags1 & RF1_UNIQUE)
5230 msg_format("%s¡¥ ",r_name + r_ptr->name);
5232 msg_format("%s. ",r_name + r_ptr->name);
5236 o_ptr->timeout = 200;
5240 case ART_STONE_LORE:
5243 msg_print("ÀФ¬±£¤µ¤ì¤¿ÈëÌ©¤ò¼Ì¤·½Ð¤·¤¿¡¥¡¥¡¥");
5245 msg_print("The stone reveals hidden mysteries...");
5247 if (!ident_spell(FALSE)) return;
5249 if (mp_ptr->spell_book)
5251 /* Sufficient mana */
5252 if (20 <= p_ptr->csp)
5258 /* Over-exert the player */
5261 int oops = 20 - p_ptr->csp;
5265 p_ptr->csp_frac = 0;
5269 msg_print("ÀФòÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
5271 msg_print("You are too weak to control the stone!");
5274 /* Hack -- Bypass free action */
5275 (void)set_paralyzed(p_ptr->paralyzed +
5276 randint1(5 * oops + 1));
5279 (void)set_confused(p_ptr->confused +
5280 randint1(5 * oops + 1));
5284 p_ptr->redraw |= (PR_MANA);
5288 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "´í¸±¤ÊÈëÌ©", -1);
5290 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "perilous secrets", -1);
5294 if (one_in_(5)) (void)set_confused(p_ptr->confused +
5297 /* Exercise a little care... */
5300 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "´í¸±¤ÊÈëÌ©", -1);
5302 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "perilous secrets", -1);
5310 if (music_singing_any()) stop_singing();
5311 if (hex_spelling_any()) stop_hex_spell_all();
5313 msg_print("¤¢¤Ê¤¿¤ÏÎ϶¯¤¤ÆÍÉ÷¤ò¿á¤ÌĤ餷¤¿¡£¼þ°Ï¤ÎŨ¤¬¿Ì¤¨¾å¤Ã¤Æ¤¤¤ë!");
5315 msg_print("You wind a mighty blast; your enemies tremble!");
5317 (void)turn_monsters((3 * p_ptr->lev / 2) + 10);
5318 o_ptr->timeout = randint0(40) + 40;
5324 msg_print("¤¢¤Ê¤¿¤Ï³²Ãî¤ò°ìÁݤ·¤¿¡£");
5326 msg_print("You exterminate small life.");
5328 (void)dispel_monsters(4);
5329 o_ptr->timeout = randint0(55) + 55;
5336 msg_print("Æߤ¤²»¤¬ÊÕ¤ê¤òÊñ¤ß¤³¤ó¤À¡£");
5338 msg_print("A shrill wailing sound surrounds you.");
5340 (void)set_protevil(randint1(25) + p_ptr->lev, FALSE);
5341 o_ptr->timeout = randint0(200) + 200;
5349 msg_print("¥í¡¼¥Ö¤¬½ã¿è¤ÊËâÎϤǿ̤¨¤¿¡£");
5351 msg_print("The robe pulsates with raw mana...");
5353 if (!get_aim_dir(&dir)) return;
5354 fire_bolt(GF_MANA, dir, 120);
5355 o_ptr->timeout = randint0(120) + 120;
5360 (void)set_fast(randint1(50) + 50, FALSE);
5363 set_hero(randint1(50) + 50, FALSE);
5364 o_ptr->timeout = randint0(200) + 100;
5370 msg_print("¥·¡¼¥ë¥É¤¬âÁ¤·¤¤¸÷¤Çµ±¤¤¤¿¡¥¡¥¡¥");
5372 msg_print("Your shield gleams with blinding light...");
5374 fire_ball(GF_LITE, 0, 300, 6);
5375 confuse_monsters(3 * p_ptr->lev / 2);
5376 o_ptr->timeout = 250;
5382 msg_print("¥«¡¼¥É¤¬Çò¤¯µ±¤¤¤¿¡¥¡¥¡¥");
5384 msg_print("Your card gleams with blinding light...");
5386 if (!recharge(1000)) return;
5387 o_ptr->timeout = 200;
5393 if (get_check("ËÜÅö¤Ë»È¤¤¤Þ¤¹¤«¡©"))
5395 if (get_check("Are you sure?!"))
5399 msg_print("¼Àµ¤¬¿Ì¤¨¤¿¡¥¡¥¡¥");
5401 msg_print("The Muramasa pulsates...");
5407 msg_print("¼Àµ¤Ï²õ¤ì¤¿¡ª");
5409 msg_print("The Muramasa is destroyed!");
5411 curse_weapon(TRUE, item);
5419 msg_print("ÀФ¬ÀÄÇò¤¯¸÷¤Ã¤¿¡¥¡¥¡¥");
5421 msg_print("Your stone glows pale...");
5424 if (!get_aim_dir(&dir)) return;
5425 fire_ball(GF_MANA, dir, 400, 4);
5426 o_ptr->timeout = randint0(250) + 250;
5433 if (!get_rep_dir2(&dir)) return;
5437 if (!cave_have_flag_bold(y, x, FF_WATER))
5440 msg_print("¤½¤³¤Ï¿åÊդǤϤʤ¤¡£");
5442 msg_print("There is no fishing place.");
5446 else if (cave[y][x].m_idx)
5449 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
5451 msg_format("%s¤¬¼ÙËâ¤À¡ª", m_name);
5453 msg_format("%^s is stand in your way.", m_name);
5458 set_action(ACTION_FISH);
5459 p_ptr->redraw |= (PR_STATE);
5464 if (!get_aim_dir(&dir)) return;
5466 msg_print("¥à¥Á¤ò¿¤Ð¤·¤¿¡£");
5468 msg_print("You stretched your whip.");
5471 fetch(dir, 500, TRUE);
5472 o_ptr->timeout = randint0(25) + 25;
5477 u32b mode = PM_ALLOW_GROUP;
5478 bool pet = !one_in_(5);
5479 if (pet) mode |= PM_FORCE_PET;
5480 else mode |= PM_NO_PET;
5482 if (summon_specific((pet ? -1 : 0), py, px, ((p_ptr->lev * 3) / 2), SUMMON_HOUND, mode))
5487 msg_print("¥Ï¥¦¥ó¥É¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5489 msg_print("A group of hounds appear as your servant.");
5494 msg_print("¥Ï¥¦¥ó¥É¤Ï¤¢¤Ê¤¿¤Ë²ç¤ò¸þ¤±¤Æ¤¤¤ë¡ª");
5496 msg_print("A group of hounds appear as your enemy!");
5501 o_ptr->timeout = 300 + randint1(150);
5508 msg_print("¥¹¥Ô¥¢¤ÏâÁ¤·¤¯µ±¤¤¤¿...");
5510 msg_print("Your spear grows brightly...");
5513 if (!get_aim_dir(&dir)) return;
5514 fire_ball(GF_LITE, dir, 200, 3);
5515 o_ptr->timeout = randint0(200) + 200;
5522 monster_type *m_ptr;
5527 if (summon_named_creature(0, py, px, MON_SUKE, PM_FORCE_PET))
5530 msg_print("¡Ø½õ¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5532 msg_print("Suke-san apperars.");
5533 kakusan = "Suke-san";
5537 if (summon_named_creature(0, py, px, MON_KAKU, PM_FORCE_PET))
5540 msg_print("¡Ø³Ê¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5542 msg_print("Kaku-san appears.");
5543 kakusan = "Kaku-san";
5549 for (i = m_max - 1; i > 0; i--)
5552 if (!m_ptr->r_idx) continue;
5553 if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
5554 if (!los(m_ptr->fy, m_ptr->fx, py, px)) continue;
5555 if (!projectable(m_ptr->fy, m_ptr->fx, py, px)) continue;
5564 msg_print("¡Ö¼Ô¤É¤â¡¢¤Ò¤«¤¨¤ª¤í¤¦¡ª¡ª¡ª¤³¤Î¤ªÊý¤ò¤É¤Ê¤¿¤È¤³¤³¤í¤¨¤ë¡£¡×");
5566 msg_format("%^s says 'WHO do you think this person is! Bow your head, down your knees!'", kakusan);
5571 confuse_monsters(120);
5573 stasis_monsters(120);
5579 msg_print("¤·¤«¤·¡¢²¿¤âµ¯¤¤Ê¤«¤Ã¤¿¡£");
5581 msg_print("Nothing happen.");
5584 o_ptr->timeout = randint0(150) + 150;
5591 msg_print("Çï»ÒÌÚ¤òÂǤä¿¡£");
5593 msg_print("You beat Your wooden clappers.");
5595 aggravate_monsters(0);
5602 (void)set_afraid(0);
5603 set_hero(randint1(25)+25, FALSE);
5605 o_ptr->timeout = randint0(30) + 30;
5611 (void)set_poisoned(0);
5612 (void)set_confused(0);
5618 o_ptr->timeout = 100;
5624 if (!get_aim_dir(&dir)) return;
5625 (void)charm_animal(dir, p_ptr->lev);
5627 o_ptr->timeout = 200;
5634 msg_print("¥½¡¼¥É¤¬Ã¸¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
5636 msg_print("Your sword glows a pale blue...");
5638 if (!get_aim_dir(&dir)) return;
5639 fire_bolt(GF_COLD, dir, damroll(12, 8));
5640 o_ptr->timeout = 50;
5646 msg_print("³ù¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
5648 msg_print("Your scythe glows brightly!");
5650 get_bloody_moon_flags(o_ptr);
5651 o_ptr->timeout = 3333;
5652 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
5653 p_ptr->update |= (PU_BONUS | PU_HP);
5659 msg_print("Î϶¯¤¯»Í¸Ô¤òƧ¤ó¤À¡£");
5661 msg_print("You stamp. (as if you are in a ring.)");
5663 (void)set_afraid(0);
5664 (void)set_hero(randint1(20) + 20, FALSE);
5665 dispel_evil(p_ptr->lev * 3);
5666 o_ptr->timeout = 100 + randint1(100);
5672 msg_print("¥¯¥í¡¼¥¯¤¬Çò¤¯µ±¤¤¤¿...");
5674 msg_print("Your cloak grows white.");
5676 (void)set_oppose_cold(randint1(20) + 20, FALSE);
5677 o_ptr->timeout = 40 + randint1(40);
5683 msg_print("¥à¥Á¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
5685 msg_print("The whip lets out a shrill wail...");
5689 (void)set_protevil(randint1(25) + k, FALSE);
5690 o_ptr->timeout = randint0(225) + 225;
5695 u32b mode = PM_ALLOW_GROUP;
5696 bool pet = !one_in_(5);
5697 if (pet) mode |= PM_FORCE_PET;
5699 if (summon_named_creature(0, py, px, MON_JIZOTAKO, mode))
5703 msg_print("Âý¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5705 msg_print("A group of octopuses appear as your servant.");
5710 msg_print("Âý¤Ï¤¢¤Ê¤¿¤òâˤó¤Ç¤¤¤ë¡ª");
5712 msg_print("A group of octopuses appear as your enemy!");
5717 o_ptr->timeout = 300 + randint1(150);
5724 msg_print("Å´µå¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
5726 msg_print("The iron ball floods the area with goodness...");
5729 dispel_evil(p_ptr->lev * 5);
5730 o_ptr->timeout = randint0(100) + 100;
5734 case ART_AESCULAPIUS:
5737 msg_print("Ï»¼ÜËÀ¤ÏÇ»Îп§¤Ëµ±¤¤¤Æ¤¤¤ë...");
5739 msg_print("The jo staff glows a deep green...");
5742 (void)do_res_stat(A_STR);
5743 (void)do_res_stat(A_INT);
5744 (void)do_res_stat(A_WIS);
5745 (void)do_res_stat(A_DEX);
5746 (void)do_res_stat(A_CON);
5747 (void)do_res_stat(A_CHR);
5748 (void)restore_level();
5749 o_ptr->timeout = 750;
5756 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤¬¿¼¤¤°Ç¤Ëʤ¤ï¤ì¤¿...");
5758 msg_print("Your amulet is coverd in pitch-darkness...");
5760 if (!get_aim_dir(&dir)) return;
5761 fire_ball(GF_DARK, dir, 250, 4);
5762 o_ptr->timeout = randint0(150) + 150;
5768 msg_print("¼óÎؤ¬¿¼¤¤°Ç¤Ëʤ¤ï¤ì¤¿...");
5770 msg_print("Your collar harness is coverd in pitch-darkness...");
5772 if (!get_aim_dir(&dir)) return;
5773 fire_ball(GF_DARK, dir, 250, 4);
5774 o_ptr->timeout = randint0(150) + 150;
5777 case ART_SACRED_KNIGHTS:
5780 msg_print("¼ó¾þ¤ê¤¬¿¿¼Â¤ò¾È¤é¤·½Ð¤¹...");
5782 msg_print("Your amulet exhibits the truth...");
5784 if (remove_all_curse())
5787 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
5789 msg_print("You feel as if someone is watching over you.");
5798 msg_print("¥Ú¥ó¥À¥ó¥È¤¬ÀÄÇò¤¯¸÷¤Ã¤¿¡¥¡¥¡¥");
5800 msg_print("Your pendant glows pale...");
5802 if (p_ptr->pclass == CLASS_MAGIC_EATER)
5805 for (i = 0; i < EATER_EXT*2; i++)
5807 p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i]*EATER_CHARGE/3;
5808 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;
5810 for (; i < EATER_EXT*3; i++)
5812 int k_idx = lookup_kind(TV_ROD, i-EATER_EXT*2);
5813 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;
5814 if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
5817 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
5819 msg_print("You feel your head clear.");
5821 p_ptr->window |= (PW_PLAYER);
5823 else if (p_ptr->csp < p_ptr->msp)
5825 p_ptr->csp = p_ptr->msp;
5826 p_ptr->csp_frac = 0;
5828 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
5830 msg_print("You feel your head clear.");
5833 p_ptr->redraw |= (PR_MANA);
5834 p_ptr->window |= (PW_PLAYER);
5835 p_ptr->window |= (PW_SPELL);
5837 o_ptr->timeout = 777;
5843 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5849 if (object_is_smith(o_ptr))
5851 switch (o_ptr->xtra3-1)
5853 case ESSENCE_TMP_RES_ACID:
5854 (void)set_oppose_acid(randint1(20) + 20, FALSE);
5855 o_ptr->timeout = randint0(50) + 50;
5858 case ESSENCE_TMP_RES_ELEC:
5859 (void)set_oppose_elec(randint1(20) + 20, FALSE);
5860 o_ptr->timeout = randint0(50) + 50;
5863 case ESSENCE_TMP_RES_FIRE:
5864 (void)set_oppose_fire(randint1(20) + 20, FALSE);
5865 o_ptr->timeout = randint0(50) + 50;
5868 case ESSENCE_TMP_RES_COLD:
5869 (void)set_oppose_cold(randint1(20) + 20, FALSE);
5870 o_ptr->timeout = randint0(50) + 50;
5874 earthquake(py, px, 5);
5875 o_ptr->timeout = 100 + randint1(100);
5878 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5886 if (o_ptr->name2 == EGO_TRUMP)
5888 teleport_player(100, 0L);
5889 o_ptr->timeout = 50 + randint1(50);
5892 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5899 if (o_ptr->name2 == EGO_LITE_ILLUMINATION)
5901 if (!o_ptr->xtra4 && ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
5904 msg_print("dzÎÁ¤¬¤Ê¤¤¡£");
5906 msg_print("It has no fuel.");
5911 lite_area(damroll(2, 15), 3);
5912 o_ptr->timeout = randint0(10) + 10;
5915 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5921 if (o_ptr->name2 == EGO_EARTHQUAKES)
5923 earthquake(py, px, 5);
5924 o_ptr->timeout = 100 + randint1(100);
5927 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5934 if (o_ptr->name2 == EGO_JUMP)
5936 teleport_player(10, 0L);
5937 o_ptr->timeout = 10 + randint1(10);
5940 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5947 /* Hack -- Dragon Scale Mail can be activated as well */
5948 if (o_ptr->tval == TV_DRAG_ARMOR)
5950 /* Get a direction for breathing (or abort) */
5951 if (!get_aim_dir(&dir)) return;
5953 if (music_singing_any()) stop_singing();
5954 if (hex_spelling_any()) stop_hex_spell_all();
5956 /* Branch on the sub-type */
5957 switch (o_ptr->sval)
5959 case SV_DRAGON_BLUE:
5962 msg_print("¤¢¤Ê¤¿¤Ï°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5964 msg_print("You breathe lightning.");
5967 fire_ball(GF_ELEC, dir, 100, -2);
5968 o_ptr->timeout = randint0(150) + 150;
5972 case SV_DRAGON_WHITE:
5975 msg_print("¤¢¤Ê¤¿¤ÏÎ䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5977 msg_print("You breathe frost.");
5980 fire_ball(GF_COLD, dir, 110, -2);
5981 o_ptr->timeout = randint0(150) + 150;
5985 case SV_DRAGON_BLACK:
5988 msg_print("¤¢¤Ê¤¿¤Ï»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5990 msg_print("You breathe acid.");
5993 fire_ball(GF_ACID, dir, 130, -2);
5994 o_ptr->timeout = randint0(150) + 150;
5998 case SV_DRAGON_GREEN:
6001 msg_print("¤¢¤Ê¤¿¤ÏÆÇ¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6003 msg_print("You breathe poison gas.");
6006 fire_ball(GF_POIS, dir, 150, -2);
6007 o_ptr->timeout = randint0(180) + 180;
6014 msg_print("¤¢¤Ê¤¿¤Ï²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6016 msg_print("You breathe fire.");
6019 fire_ball(GF_FIRE, dir, 200, -2);
6020 o_ptr->timeout = randint0(200) + 200;
6024 case SV_DRAGON_MULTIHUED:
6026 chance = randint0(5);
6028 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
6029 ((chance == 1) ? "°ðºÊ" :
6030 ((chance == 2) ? "Î䵤" :
6031 ((chance == 3) ? "»À" :
6032 ((chance == 4) ? "ÆÇ¥¬¥¹" : "²Ð±ê")))));
6034 msg_format("You breathe %s.",
6035 ((chance == 1) ? "lightning" :
6036 ((chance == 2) ? "frost" :
6037 ((chance == 3) ? "acid" :
6038 ((chance == 4) ? "poison gas" : "fire")))));
6041 fire_ball(((chance == 1) ? GF_ELEC :
6042 ((chance == 2) ? GF_COLD :
6043 ((chance == 3) ? GF_ACID :
6044 ((chance == 4) ? GF_POIS : GF_FIRE)))),
6046 o_ptr->timeout = randint0(200) + 200;
6050 case SV_DRAGON_BRONZE:
6053 msg_print("¤¢¤Ê¤¿¤Ïº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6055 msg_print("You breathe confusion.");
6058 fire_ball(GF_CONFUSION, dir, 120, -2);
6059 o_ptr->timeout = randint0(180) + 180;
6063 case SV_DRAGON_GOLD:
6066 msg_print("¤¢¤Ê¤¿¤Ï¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6068 msg_print("You breathe sound.");
6071 fire_ball(GF_SOUND, dir, 130, -2);
6072 o_ptr->timeout = randint0(180) + 180;
6076 case SV_DRAGON_CHAOS:
6078 chance = randint0(2);
6080 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
6081 ((chance == 1 ? "¥«¥ª¥¹" : "Îô²½")));
6083 msg_format("You breathe %s.",
6084 ((chance == 1 ? "chaos" : "disenchantment")));
6087 fire_ball((chance == 1 ? GF_CHAOS : GF_DISENCHANT),
6089 o_ptr->timeout = randint0(200) + 200;
6095 chance = randint0(2);
6097 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
6098 ((chance == 1 ? "¹ì²»" : "ÇËÊÒ")));
6100 msg_format("You breathe %s.",
6101 ((chance == 1 ? "sound" : "shards")));
6104 fire_ball((chance == 1 ? GF_SOUND : GF_SHARDS),
6106 o_ptr->timeout = randint0(200) + 200;
6110 case SV_DRAGON_BALANCE:
6112 chance = randint0(4);
6114 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿",
6115 ((chance == 1) ? "¥«¥ª¥¹" :
6116 ((chance == 2) ? "Îô²½" :
6117 ((chance == 3) ? "¹ì²»" : "ÇËÊÒ"))));
6119 msg_format("You breathe %s.",
6120 ((chance == 1) ? "chaos" :
6121 ((chance == 2) ? "disenchantment" :
6122 ((chance == 3) ? "sound" : "shards"))));
6125 fire_ball(((chance == 1) ? GF_CHAOS :
6126 ((chance == 2) ? GF_DISENCHANT :
6127 ((chance == 3) ? GF_SOUND : GF_SHARDS))),
6129 o_ptr->timeout = randint0(200) + 200;
6133 case SV_DRAGON_SHINING:
6135 chance = randint0(2);
6137 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
6138 ((chance == 0 ? "Á®¸÷" : "°Å¹õ")));
6140 msg_format("You breathe %s.",
6141 ((chance == 0 ? "light" : "darkness")));
6144 fire_ball((chance == 0 ? GF_LITE : GF_DARK), dir, 200, -2);
6145 o_ptr->timeout = randint0(200) + 200;
6149 case SV_DRAGON_POWER:
6152 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6154 msg_print("You breathe the elements.");
6157 fire_ball(GF_MISSILE, dir, 300, -3);
6158 o_ptr->timeout = randint0(200) + 200;
6164 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6170 else if (o_ptr->tval == TV_RING)
6172 if (object_is_ego(o_ptr))
6174 bool success = TRUE;
6176 switch (o_ptr->name2)
6179 (void)set_afraid(0);
6180 (void)set_hero(randint1(25) + 25, FALSE);
6181 (void)hp_player(10);
6182 o_ptr->timeout = randint1(100)+100;
6184 case EGO_RING_MAGIC_MIS:
6185 if (!get_aim_dir(&dir)) return;
6186 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
6189 case EGO_RING_FIRE_BOLT:
6190 if (!get_aim_dir(&dir)) return;
6191 fire_bolt(GF_FIRE, dir, damroll(9, 8));
6192 o_ptr->timeout = randint0(8) + 8;
6194 case EGO_RING_COLD_BOLT:
6195 if (!get_aim_dir(&dir)) return;
6196 fire_bolt(GF_COLD, dir, damroll(6, 8));
6197 o_ptr->timeout = randint0(7) + 7;
6199 case EGO_RING_ELEC_BOLT:
6200 if (!get_aim_dir(&dir)) return;
6201 fire_bolt(GF_ELEC, dir, damroll(4, 8));
6202 o_ptr->timeout = randint0(5) + 5;
6204 case EGO_RING_ACID_BOLT:
6205 if (!get_aim_dir(&dir)) return;
6206 fire_bolt(GF_ACID, dir, damroll(5, 8));
6207 o_ptr->timeout = randint0(6) + 6;
6209 case EGO_RING_MANA_BOLT:
6210 if (!get_aim_dir(&dir)) return;
6211 fire_bolt(GF_MANA, dir, 120);
6212 o_ptr->timeout = randint0(120)+120;
6214 case EGO_RING_FIRE_BALL:
6215 if (!get_aim_dir(&dir)) return;
6216 fire_ball(GF_FIRE, dir, 100, 2);
6217 o_ptr->timeout = randint0(80) + 80;
6219 case EGO_RING_COLD_BALL:
6220 if (!get_aim_dir(&dir)) return;
6221 fire_ball(GF_COLD, dir, 100, 2);
6222 o_ptr->timeout = randint0(80) + 80;
6224 case EGO_RING_ELEC_BALL:
6225 if (!get_aim_dir(&dir)) return;
6226 fire_ball(GF_ELEC, dir, 100, 2);
6227 o_ptr->timeout = randint0(80) + 80;
6229 case EGO_RING_ACID_BALL:
6230 if (!get_aim_dir(&dir)) return;
6231 fire_ball(GF_ACID, dir, 100, 2);
6232 o_ptr->timeout = randint0(80) + 80;
6234 case EGO_RING_MANA_BALL:
6235 if (!get_aim_dir(&dir)) return;
6236 fire_ball(GF_MANA, dir, 250, 2);
6237 o_ptr->timeout = 300;
6239 case EGO_RING_DRAGON_F:
6240 if (!get_aim_dir(&dir)) return;
6241 fire_ball(GF_FIRE, dir, 200, -2);
6242 if (o_ptr->sval == SV_RING_FLAMES)
6244 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6245 o_ptr->timeout = 200;
6247 else o_ptr->timeout = 250;
6249 case EGO_RING_DRAGON_C:
6250 if (!get_aim_dir(&dir)) return;
6251 fire_ball(GF_COLD, dir, 200, -2);
6252 if (o_ptr->sval == SV_RING_ICE)
6254 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6255 o_ptr->timeout = 200;
6257 else o_ptr->timeout = 250;
6259 case EGO_RING_M_DETECT:
6260 (void)detect_monsters_invis(255);
6261 (void)detect_monsters_normal(255);
6262 o_ptr->timeout = 150;
6264 case EGO_RING_D_SPEED:
6265 (void)set_fast(randint1(30) + 15, FALSE);
6266 o_ptr->timeout = 100;
6268 case EGO_RING_BERSERKER:
6269 (void)set_afraid(0);
6270 (void)set_shero(randint1(25) + 25, FALSE);
6271 o_ptr->timeout = randint0(75)+75;
6273 case EGO_RING_TELE_AWAY:
6274 if (!get_aim_dir(&dir)) return;
6275 teleport_monster(dir);
6276 o_ptr->timeout = 150;
6280 int v = randint1(25)+25;
6281 (void)set_afraid(0);
6282 (void)set_hero(v, FALSE);
6283 (void)hp_player(10);
6284 (void)set_blessed(v, FALSE);
6285 (void)set_oppose_acid(v, FALSE);
6286 (void)set_oppose_elec(v, FALSE);
6287 (void)set_oppose_fire(v, FALSE);
6288 (void)set_oppose_cold(v, FALSE);
6289 (void)set_oppose_pois(v, FALSE);
6290 (void)set_ultimate_res(v, FALSE);
6291 o_ptr->timeout = 777;
6298 if (success) return;
6301 /* Get a direction for breathing (or abort) */
6302 if (!get_aim_dir(&dir)) return;
6304 switch (o_ptr->sval)
6308 fire_ball(GF_ACID, dir, 100, 2);
6309 (void)set_oppose_acid(randint1(20) + 20, FALSE);
6310 o_ptr->timeout = randint0(50) + 50;
6316 fire_ball(GF_COLD, dir, 100, 2);
6317 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6318 o_ptr->timeout = randint0(50) + 50;
6322 case SV_RING_FLAMES:
6324 fire_ball(GF_FIRE, dir, 100, 2);
6325 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6326 o_ptr->timeout = randint0(50) + 50;
6332 fire_ball(GF_ELEC, dir, 100, 2);
6333 (void)set_oppose_elec(randint1(20) + 20, FALSE);
6334 o_ptr->timeout = randint0(50) + 50;
6340 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6346 else if (o_ptr->tval == TV_AMULET)
6348 if (object_is_ego(o_ptr))
6350 switch (o_ptr->name2)
6353 if (!ident_spell(FALSE)) return;
6354 o_ptr->timeout = 10;
6357 if (!get_aim_dir(&dir)) return;
6358 charm_monster(dir, MAX(20, p_ptr->lev));
6359 o_ptr->timeout = 200;
6362 teleport_player(10, 0L);
6363 o_ptr->timeout = randint0(10) + 10;
6365 case EGO_AMU_TELEPORT:
6366 teleport_player(100, 0L);
6367 o_ptr->timeout = randint0(50) + 50;
6369 case EGO_AMU_D_DOOR:
6370 (void)dimension_door();
6371 o_ptr->timeout = 200;
6373 case EGO_AMU_RES_FIRE_:
6374 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6375 o_ptr->timeout = randint0(50) + 50;
6377 case EGO_AMU_RES_COLD_:
6378 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6379 o_ptr->timeout = randint0(50) + 50;
6381 case EGO_AMU_RES_ELEC_:
6382 (void)set_oppose_elec(randint1(20) + 20, FALSE);
6383 o_ptr->timeout = randint0(50) + 50;
6385 case EGO_AMU_RES_ACID_:
6386 (void)set_oppose_acid(randint1(20) + 20, FALSE);
6387 o_ptr->timeout = randint0(50) + 50;
6389 case EGO_AMU_DETECTION:
6390 detect_all(DETECT_RAD_DEFAULT);
6391 o_ptr->timeout = randint0(55)+55;
6398 else if (o_ptr->tval == TV_WHISTLE)
6400 if (music_singing_any()) stop_singing();
6401 if (hex_spelling_any()) stop_hex_spell_all();
6404 if (object_is_cursed(o_ptr))
6407 msg_print("¥«¥ó¹â¤¤²»¤¬¶Á¤ÅϤä¿¡£");
6409 msg_print("You produce a shrill whistling sound.");
6411 aggravate_monsters(0);
6421 /* Allocate the "who" array */
6422 C_MAKE(who, max_m_idx, u16b);
6424 /* Process the monsters (backwards) */
6425 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6427 if (is_pet(&m_list[pet_ctr]) && (p_ptr->riding != pet_ctr))
6428 who[max_pet++] = pet_ctr;
6431 /* Select the sort method */
6432 ang_sort_comp = ang_sort_comp_pet;
6433 ang_sort_swap = ang_sort_swap_hook;
6435 ang_sort(who, &dummy_why, max_pet);
6437 /* Process the monsters (backwards) */
6438 for (i = 0; i < max_pet; i++)
6441 teleport_monster_to(pet_ctr, py, px, 100, TELEPORT_PASSIVE);
6444 /* Free the "who" array */
6445 C_KILL(who, max_m_idx, u16b);
6447 o_ptr->timeout = 100+randint1(100);
6450 else if (o_ptr->tval == TV_CAPTURE)
6454 bool old_target_pet = target_pet;
6456 if (!get_aim_dir(&dir))
6458 target_pet = old_target_pet;
6461 target_pet = old_target_pet;
6463 if(fire_ball(GF_CAPTURE, dir, 0, 0))
6465 o_ptr->pval = cap_mon;
6466 o_ptr->xtra3 = cap_mspeed;
6467 o_ptr->xtra4 = cap_hp;
6468 o_ptr->xtra5 = cap_maxhp;
6475 if (o_ptr->inscription)
6476 strcpy(buf, quark_str(o_ptr->inscription));
6478 for (s = buf;*s && (*s != '#'); s++)
6481 if (iskanji(*s)) s++;
6491 t = quark_str(cap_nickname);
6504 o_ptr->inscription = quark_add(buf);
6510 bool success = FALSE;
6511 if (!get_rep_dir2(&dir)) return;
6512 if (monster_can_enter(py + ddy[dir], px + ddx[dir], &r_info[o_ptr->pval], 0))
6514 if (place_monster_aux(0, py + ddy[dir], px + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
6516 if (o_ptr->xtra3) m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
6517 if (o_ptr->xtra5) m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
6518 if (o_ptr->xtra4) m_list[hack_m_idx_ii].hp = o_ptr->xtra4;
6519 m_list[hack_m_idx_ii].maxhp = m_list[hack_m_idx_ii].max_maxhp;
6520 if (o_ptr->inscription)
6528 t = quark_str(o_ptr->inscription);
6529 for (t = quark_str(o_ptr->inscription);*t && (*t != '#'); t++)
6532 if (iskanji(*t)) t++;
6557 if (quote && *(s-1) =='\'')
6561 m_list[hack_m_idx_ii].nickname = quark_add(buf);
6562 t = quark_str(o_ptr->inscription);
6564 while(*t && (*t != '#'))
6571 o_ptr->inscription = quark_add(buf);
6583 msg_print("¤ª¤Ã¤È¡¢²òÊü¤Ë¼ºÇÔ¤·¤¿¡£");
6585 msg_print("Oops. You failed to release your pet.");
6593 msg_print("¤ª¤Ã¤È¡¢¤³¤Î¥¢¥¤¥Æ¥à¤Ï»ÏÆ°¤Ç¤¤Ê¤¤¡£");
6595 msg_print("Oops. That object cannot be activated.");
6601 void do_cmd_activate(void)
6607 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6609 set_action(ACTION_NONE);
6612 item_tester_no_ryoute = TRUE;
6613 /* Prepare the hook */
6614 item_tester_hook = item_tester_hook_activate;
6618 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò»ÏÆ°¤µ¤»¤Þ¤¹¤«? ";
6619 s = "»ÏÆ°¤Ç¤¤ë¥¢¥¤¥Æ¥à¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£";
6621 q = "Activate which item? ";
6622 s = "You have nothing to activate.";
6625 if (!get_item(&item, q, s, (USE_EQUIP))) return;
6627 /* Activate the item */
6628 do_cmd_activate_aux(item);
6633 * Hook to determine if an object is useable
6635 static bool item_tester_hook_use(object_type *o_ptr)
6637 u32b flgs[TR_FLAG_SIZE];
6640 if (o_ptr->tval == p_ptr->tval_ammo)
6643 /* Useable object */
6644 switch (o_ptr->tval)
6662 if (!object_is_known(o_ptr)) return (FALSE);
6664 /* HACK - only items from the equipment can be activated */
6665 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
6667 if (&inventory[i] == o_ptr)
6669 /* Extract the flags */
6670 object_flags(o_ptr, flgs);
6672 /* Check activation flag */
6673 if (have_flag(flgs, TR_ACTIVATE)) return (TRUE);
6686 * XXX - Add actions for other item types
6688 void do_cmd_use(void)
6694 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6696 set_action(ACTION_NONE);
6699 item_tester_no_ryoute = TRUE;
6700 /* Prepare the hook */
6701 item_tester_hook = item_tester_hook_use;
6705 q = "¤É¤ì¤ò»È¤¤¤Þ¤¹¤«¡©";
6706 s = "»È¤¨¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤»¤ó¡£";
6708 q = "Use which item? ";
6709 s = "You have nothing to use.";
6712 if (!get_item(&item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR))) return;
6714 /* Get the item (in the pack) */
6717 o_ptr = &inventory[item];
6719 /* Get the item (on the floor) */
6722 o_ptr = &o_list[0 - item];
6725 switch (o_ptr->tval)
6737 do_cmd_eat_food_aux(item);
6744 do_cmd_aim_wand_aux(item);
6751 do_cmd_use_staff_aux(item);
6758 do_cmd_zap_rod_aux(item);
6762 /* Quaff a potion */
6765 do_cmd_quaff_potion_aux(item);
6772 /* Check some conditions */
6776 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡£");
6778 msg_print("You can't see anything.");
6786 msg_print("ÌÀ¤«¤ê¤¬¤Ê¤¤¤Î¤Ç¡¢°Å¤¯¤ÆÆɤá¤Ê¤¤¡£");
6788 msg_print("You have no light to read by.");
6793 if (p_ptr->confused)
6796 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
6798 msg_print("You are too confused!");
6804 do_cmd_read_scroll_aux(item, TRUE);
6813 do_cmd_fire_aux(item, &inventory[INVEN_BOW]);
6817 /* Activate an artifact */
6820 do_cmd_activate_aux(item);
6826 static int select_magic_eater(bool only_browse)
6830 bool flag, request_list;
6832 int ask = TRUE, i = 0;
6835 int menu_line = (use_menu ? 1 : 0);
6839 if (repeat_pull(&sn))
6841 /* Verify the spell */
6842 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))
6844 else if (sn < EATER_EXT*2 && !(p_ptr->magic_num1[sn] < EATER_CHARGE))
6848 #endif /* ALLOW_REPEAT */
6850 for (i = 0; i < 108; i++)
6852 if (p_ptr->magic_num2[i]) break;
6857 msg_print("ËâË¡¤ò³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6859 msg_print("You don't have any magic!");
6871 prt(format(" %s ¾ó", (menu_line == 1) ? "¡Õ" : " "), 2, 14);
6872 prt(format(" %s ËâË¡ËÀ", (menu_line == 2) ? "¡Õ" : " "), 3, 14);
6873 prt(format(" %s ¥í¥Ã¥É", (menu_line == 3) ? "¡Õ" : " "), 4, 14);
6874 prt("¤É¤Î¼ïÎà¤ÎËâË¡¤ò»È¤¤¤Þ¤¹¤«¡©", 0, 0);
6876 prt(format(" %s staff", (menu_line == 1) ? "> " : " "), 2, 14);
6877 prt(format(" %s wand", (menu_line == 2) ? "> " : " "), 3, 14);
6878 prt(format(" %s rod", (menu_line == 3) ? "> " : " "), 4, 14);
6879 prt("Which type of magic do you use?", 0, 0);
6902 ext = (menu_line-1)*EATER_EXT;
6903 if (menu_line == 1) tval = TV_STAFF;
6904 else if (menu_line == 2) tval = TV_WAND;
6908 if (menu_line > 3) menu_line -= 3;
6917 if (!get_com("[A] ¾ó, [B] ËâË¡ËÀ, [C] ¥í¥Ã¥É:", &choice, TRUE))
6919 if (!get_com("[A] staff, [B] wand, [C] rod:", &choice, TRUE))
6924 if (choice == 'A' || choice == 'a')
6930 if (choice == 'B' || choice == 'b')
6936 if (choice == 'C' || choice == 'c')
6944 for (i = ext; i < ext + EATER_EXT; i++)
6946 if (p_ptr->magic_num2[i])
6948 if (use_menu) menu_line = i-ext+1;
6952 if (i == ext+EATER_EXT)
6955 msg_print("¤½¤Î¼ïÎà¤ÎËâË¡¤Ï³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6957 msg_print("You don't have that type of magic!");
6962 /* Nothing chosen yet */
6965 /* Build a prompt */
6967 (void) strnfmt(out_val, 78, "('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎËâÎϤò»È¤¤¤Þ¤¹¤«¡©");
6969 (void)strnfmt(out_val, 78, "(*=List, ESC=exit) Use which power? ");
6972 /* Save the screen */
6975 request_list = always_show_list;
6977 /* Get a spell from the user */
6981 if (request_list || use_menu)
6992 for (y = 1; y < 20; y++)
6997 /* Print header(s) */
6999 prt(format(" %s ¼ºÎ¨ %s ¼ºÎ¨", (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô"), (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô")), y++, x);
7001 prt(format(" %s Fail %s Fail", (tval == TV_ROD ? " Stat " : " Charges"), (tval == TV_ROD ? " Stat " : " Charges")), y++, x);
7005 for (ctr = 0; ctr < EATER_EXT; ctr++)
7007 if (!p_ptr->magic_num2[ctr+ext]) continue;
7009 k_idx = lookup_kind(tval, ctr);
7013 if (ctr == (menu_line-1))
7015 strcpy(dummy, "¡Õ");
7017 strcpy(dummy, "> ");
7019 else strcpy(dummy, " ");
7022 /* letter/number for power selection */
7029 letter = '0' + ctr - 26;
7030 sprintf(dummy, "%c)",letter);
7032 x1 = ((ctr < EATER_EXT/2) ? x : x + 40);
7033 y1 = ((ctr < EATER_EXT/2) ? y + ctr : y + ctr - EATER_EXT/2);
7034 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
7035 chance = level * 4 / 5 + 20;
7036 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
7038 if (p_ptr->lev > level)
7040 chance -= 3 * (p_ptr->lev - level);
7042 chance = mod_spell_chance_1(chance);
7043 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
7044 /* Stunning makes spells harder */
7045 if (p_ptr->stun > 50) chance += 25;
7046 else if (p_ptr->stun) chance += 15;
7048 if (chance > 95) chance = 95;
7050 chance = mod_spell_chance_2(chance);
7058 strcat(dummy, format(
7060 " %-22.22s ½¼Å¶:%2d/%2d%3d%%",
7062 " %-22.22s (%2d/%2d) %3d%%",
7064 k_name + k_info[k_idx].name,
7065 p_ptr->magic_num1[ctr+ext] ?
7066 (p_ptr->magic_num1[ctr+ext] - 1) / (EATER_ROD_CHARGE * k_info[k_idx].pval) +1 : 0,
7067 p_ptr->magic_num2[ctr+ext], chance));
7068 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;
7072 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));
7073 if (p_ptr->magic_num1[ctr+ext] < EATER_CHARGE) col = TERM_RED;
7078 c_prt(col, dummy, y1, x1);
7082 if (!get_com(out_val, &choice, FALSE)) break;
7084 if (use_menu && choice != ' ')
7100 menu_line += EATER_EXT - 1;
7101 if (menu_line > EATER_EXT) menu_line -= EATER_EXT;
7102 } while(!p_ptr->magic_num2[menu_line+ext-1]);
7113 if (menu_line > EATER_EXT) menu_line -= EATER_EXT;
7114 } while(!p_ptr->magic_num2[menu_line+ext-1]);
7125 bool reverse = FALSE;
7126 if ((choice == '4') || (choice == 'h') || (choice == 'H')) reverse = TRUE;
7127 if (menu_line > EATER_EXT/2)
7129 menu_line -= EATER_EXT/2;
7132 else menu_line+=EATER_EXT/2;
7133 while(!p_ptr->magic_num2[menu_line+ext-1])
7138 if (menu_line < 2) reverse = FALSE;
7143 if (menu_line > EATER_EXT-1) reverse = TRUE;
7160 /* Request redraw */
7161 if (use_menu && ask) continue;
7163 /* Request redraw */
7164 if (!use_menu && ((choice == ' ') || (choice == '*') || (choice == '?')))
7170 request_list = FALSE;
7172 /* Restore the screen */
7177 request_list = TRUE;
7185 if (isalpha(choice))
7188 ask = (isupper(choice));
7191 if (ask) choice = tolower(choice);
7193 /* Extract request */
7194 i = (islower(choice) ? A2I(choice) : -1);
7198 ask = FALSE; /* Can't uppercase digits */
7200 i = choice - '0' + 26;
7204 /* Totally Illegal */
7205 if ((i < 0) || (i > EATER_EXT) || !p_ptr->magic_num2[i+ext])
7220 (void) strnfmt(tmp_val, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", k_name + k_info[lookup_kind(tval ,i)].name);
7222 (void) strnfmt(tmp_val, 78, "Use %s?", k_name + k_info[lookup_kind(tval ,i)].name);
7225 /* Belay that order */
7226 if (!get_check(tmp_val)) continue;
7230 if (p_ptr->magic_num1[ext+i] > k_info[lookup_kind(tval, i)].pval * (p_ptr->magic_num2[ext+i] - 1) * EATER_ROD_CHARGE)
7233 msg_print("¤½¤ÎËâË¡¤Ï¤Þ¤À½¼Å¶¤·¤Æ¤¤¤ëºÇÃæ¤À¡£");
7235 msg_print("The magic are still charging.");
7238 if (use_menu) ask = TRUE;
7244 if (p_ptr->magic_num1[ext+i] < EATER_CHARGE)
7247 msg_print("¤½¤ÎËâË¡¤Ï»ÈÍѲó¿ô¤¬ÀÚ¤ì¤Æ¤¤¤ë¡£");
7249 msg_print("The magic has no charges left.");
7252 if (use_menu) ask = TRUE;
7264 /* Clear lines, position cursor (really should use strlen here) */
7265 Term_erase(7, 23, 255);
7266 Term_erase(7, 22, 255);
7267 Term_erase(7, 21, 255);
7268 Term_erase(7, 20, 255);
7270 roff_to_buf(k_text + k_info[lookup_kind(tval, i)].text, 62, temp, sizeof(temp));
7271 for (j = 0, line = 21; temp[j]; j += 1 + strlen(&temp[j]))
7273 prt(&temp[j], line, 10);
7278 prt("²¿¤«¥¡¼¤ò²¡¤·¤Æ²¼¤µ¤¤¡£",0,0);
7280 prt("Hit any key.",0,0);
7290 /* Restore the screen */
7293 if (!flag) return -1;
7297 #endif /* ALLOW_REPEAT */
7303 * Use eaten rod, wand or staff
7305 void do_cmd_magic_eater(bool only_browse)
7307 int item, chance, level, k_idx, tval, sval;
7308 bool use_charge = TRUE;
7310 /* Not when confused */
7311 if (!only_browse && p_ptr->confused)
7314 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
7316 msg_print("You are too confused!");
7322 item = select_magic_eater(only_browse);
7328 if (item >= EATER_EXT*2) {tval = TV_ROD;sval = item - EATER_EXT*2;}
7329 else if (item >= EATER_EXT) {tval = TV_WAND;sval = item - EATER_EXT;}
7330 else {tval = TV_STAFF;sval = item;}
7331 k_idx = lookup_kind(tval, sval);
7333 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
7334 chance = level * 4 / 5 + 20;
7335 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
7337 if (p_ptr->lev > level)
7339 chance -= 3 * (p_ptr->lev - level);
7341 chance = mod_spell_chance_1(chance);
7342 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
7343 /* Stunning makes spells harder */
7344 if (p_ptr->stun > 50) chance += 25;
7345 else if (p_ptr->stun) chance += 15;
7347 if (chance > 95) chance = 95;
7349 chance = mod_spell_chance_2(chance);
7351 if (randint0(100) < chance)
7353 if (flush_failure) flush();
7356 msg_print("¼öʸ¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª");
7358 msg_format("You failed to get the magic off!");
7362 if (randint1(100) >= chance)
7363 chg_virtue(V_CHANCE,-1);
7374 if ((sval >= SV_ROD_MIN_DIRECTION) && (sval != SV_ROD_HAVOC) && (sval != SV_ROD_AGGRAVATE) && (sval != SV_ROD_PESTICIDE))
7375 if (!get_aim_dir(&dir)) return;
7376 rod_effect(sval, dir, &use_charge, TRUE);
7377 if (!use_charge) return;
7379 else if (tval == TV_WAND)
7381 if (!get_aim_dir(&dir)) return;
7382 wand_effect(sval, dir, TRUE);
7386 staff_effect(sval, &use_charge, TRUE, TRUE);
7387 if (!use_charge) return;
7389 if (randint1(100) < chance)
7390 chg_virtue(V_CHANCE,1);
7393 if (tval == TV_ROD) p_ptr->magic_num1[item] += k_info[k_idx].pval * EATER_ROD_CHARGE;
7394 else p_ptr->magic_num1[item] -= EATER_CHARGE;