3 /* Purpose: Object commands */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
17 * This file includes code for eating food, drinking potions,
18 * reading scrolls, aiming wands, using staffs, zapping rods,
19 * and activating artifacts.
21 * In all cases, if the player becomes "aware" of the item's use
22 * by testing it, mark it as "aware" and reward some experience
23 * based on the object's level, always rounding up. If the player
24 * remains "unaware", mark that object "kind" as "tried".
26 * This code now correctly handles the unstacking of wands, staffs,
27 * and rods. Note the overly paranoid warning about potential pack
28 * overflow, which allows the player to use and drop a stacked item.
30 * In all "unstacking" scenarios, the "used" object is "carried" as if
31 * the player had just picked it up. In particular, this means that if
32 * the use of an item induces pack overflow, that item will be dropped.
34 * For simplicity, these routines induce a full "pack reorganization"
35 * which not only combines similar items, but also reorganizes various
36 * items to obey the current "sorting" method. This may require about
37 * 400 item comparisons, but only occasionally.
39 * There may be a BIG problem with any "effect" that can cause "changes"
40 * to the inventory. For example, a "scroll of recharging" can cause
41 * a wand/staff to "disappear", moving the inventory up. Luckily, the
42 * scrolls all appear BEFORE the staffs/wands, so this is not a problem.
43 * But, for example, a "staff of recharging" could cause MAJOR problems.
44 * In such a case, it will be best to either (1) "postpone" the effect
45 * until the end of the function, or (2) "change" the effect, say, into
46 * giving a staff "negative" charges, or "turning a staff into a stick".
47 * It seems as though a "rod of recharging" might in fact cause problems.
48 * The basic problem is that the act of recharging (and destroying) an
49 * item causes the inducer of that action to "move", causing "o_ptr" to
50 * no longer point at the correct item, with horrifying results.
52 * Note that food/potions/scrolls no longer use bit-flags for effects,
53 * but instead use the "sval" (which is also used to sort the objects).
57 static void do_cmd_eat_food_aux(int item)
62 /* Get the item (in the pack) */
65 o_ptr = &inventory[item];
68 /* Get the item (on the floor) */
71 o_ptr = &o_list[0 - item];
80 /* Identity not known yet */
84 lev = get_object_level(o_ptr);
86 if (o_ptr->tval == TV_FOOD)
88 /* Analyze the food */
93 if (!(p_ptr->resist_pois || p_ptr->oppose_pois))
95 if (set_poisoned(p_ptr->poisoned + randint0(10) + 10))
103 case SV_FOOD_BLINDNESS:
105 if (!p_ptr->resist_blind)
107 if (set_blind(p_ptr->blind + randint0(200) + 200))
115 case SV_FOOD_PARANOIA:
117 if (!p_ptr->resist_fear)
119 if (set_afraid(p_ptr->afraid + randint0(10) + 10))
127 case SV_FOOD_CONFUSION:
129 if (!p_ptr->resist_conf)
131 if (set_confused(p_ptr->confused + randint0(10) + 10))
139 case SV_FOOD_HALLUCINATION:
141 if (!p_ptr->resist_chaos)
143 if (set_image(p_ptr->image + randint0(250) + 250))
151 case SV_FOOD_PARALYSIS:
153 if (!p_ptr->free_act)
155 if (set_paralyzed(p_ptr->paralyzed + randint0(10) + 10))
163 case SV_FOOD_WEAKNESS:
166 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "ÆÇÆþ¤ê¿©ÎÁ", -1);
168 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "poisonous food", -1);
171 (void)do_dec_stat(A_STR);
176 case SV_FOOD_SICKNESS:
179 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "ÆÇÆþ¤ê¿©ÎÁ", -1);
181 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "poisonous food", -1);
184 (void)do_dec_stat(A_CON);
189 case SV_FOOD_STUPIDITY:
192 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "ÆÇÆþ¤ê¿©ÎÁ", -1);
194 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "poisonous food", -1);
197 (void)do_dec_stat(A_INT);
202 case SV_FOOD_NAIVETY:
205 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "ÆÇÆþ¤ê¿©ÎÁ", -1);
207 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "poisonous food", -1);
210 (void)do_dec_stat(A_WIS);
215 case SV_FOOD_UNHEALTH:
218 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "ÆÇÆþ¤ê¿©ÎÁ", -1);
220 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "poisonous food", -1);
223 (void)do_dec_stat(A_CON);
228 case SV_FOOD_DISEASE:
231 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "ÆÇÆþ¤ê¿©ÎÁ", -1);
233 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "poisonous food", -1);
236 (void)do_dec_stat(A_STR);
241 case SV_FOOD_CURE_POISON:
243 if (set_poisoned(0)) ident = TRUE;
247 case SV_FOOD_CURE_BLINDNESS:
249 if (set_blind(0)) ident = TRUE;
253 case SV_FOOD_CURE_PARANOIA:
255 if (set_afraid(0)) ident = TRUE;
259 case SV_FOOD_CURE_CONFUSION:
261 if (set_confused(0)) ident = TRUE;
265 case SV_FOOD_CURE_SERIOUS:
267 if (hp_player(damroll(4, 8))) ident = TRUE;
271 case SV_FOOD_RESTORE_STR:
273 if (do_res_stat(A_STR)) ident = TRUE;
277 case SV_FOOD_RESTORE_CON:
279 if (do_res_stat(A_CON)) ident = TRUE;
283 case SV_FOOD_RESTORING:
285 if (do_res_stat(A_STR)) ident = TRUE;
286 if (do_res_stat(A_INT)) ident = TRUE;
287 if (do_res_stat(A_WIS)) ident = TRUE;
288 if (do_res_stat(A_DEX)) ident = TRUE;
289 if (do_res_stat(A_CON)) ident = TRUE;
290 if (do_res_stat(A_CHR)) ident = TRUE;
296 /* ¤½¤ì¤¾¤ì¤Î¿©¤Ùʪ¤Î´¶ÁÛ¤ò¥ª¥ê¥¸¥Ê¥ë¤è¤êºÙ¤«¤¯É½¸½ */
297 case SV_FOOD_BISCUIT:
299 msg_print("´Å¤¯¤Æ¥µ¥¯¥µ¥¯¤·¤Æ¤È¤Æ¤â¤ª¤¤¤·¤¤¡£");
306 msg_print("»õ¤´¤¿¤¨¤¬¤¢¤Ã¤Æ¤ª¤¤¤·¤¤¡£");
311 case SV_FOOD_SLIME_MOLD:
313 msg_print("¤³¤ì¤Ï¤Ê¤ó¤È¤â·ÁÍƤ·¤¬¤¿¤¤Ì£¤À¡£");
320 msg_print("¤³¤ì¤Ï¤ª¤¤¤·¤¤¡£");
326 case SV_FOOD_BISCUIT:
328 case SV_FOOD_SLIME_MOLD:
330 msg_print("That tastes good.");
337 case SV_FOOD_WAYBREAD:
340 msg_print("¤³¤ì¤Ï¤Ò¤¸¤ç¤¦¤ËÈþÌ£¤À¡£");
342 msg_print("That tastes good.");
345 (void)set_poisoned(0);
346 (void)hp_player(damroll(4, 8));
352 case SV_FOOD_PINT_OF_ALE:
354 msg_print("¤Î¤É¤´¤·Á֤䤫¤À¡£");
359 case SV_FOOD_PINT_OF_WINE:
361 msg_print("That tastes good.");
366 case SV_FOOD_PINT_OF_ALE:
367 case SV_FOOD_PINT_OF_WINE:
369 msg_print("That tastes good.");
378 /* Combine / Reorder the pack (later) */
379 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
381 if (!(object_aware_p(o_ptr)))
383 chg_virtue(V_KNOWLEDGE, -1);
384 chg_virtue(V_PATIENCE, -1);
385 chg_virtue(V_CHANCE, 1);
388 /* We have tried it */
389 if (o_ptr->tval == TV_FOOD) object_tried(o_ptr);
391 /* The player is now aware of the object */
392 if (ident && !object_aware_p(o_ptr))
395 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
399 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
402 /* Food can feed the player */
403 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
405 /* Reduced nutritional benefit */
406 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
408 msg_print("¤¢¤Ê¤¿¤Î¤è¤¦¤Ê¼Ô¤Ë¤È¤Ã¤Æ¿©ÎȤʤɶϤ«¤Ê±ÉÍܤˤ·¤«¤Ê¤é¤Ê¤¤¡£");
410 msg_print("Mere victuals hold scant sustenance for a being such as yourself.");
413 if (p_ptr->food < PY_FOOD_ALERT) /* Hungry */
415 msg_print("¤¢¤Ê¤¿¤Îµ²¤¨¤Ï¿·Á¯¤Ê·ì¤Ë¤è¤Ã¤Æ¤Î¤ßËþ¤¿¤µ¤ì¤ë¡ª");
417 msg_print("Your hunger can only be satisfied with fresh blood!");
421 else if ((prace_is_(RACE_SKELETON) ||
422 prace_is_(RACE_GOLEM) ||
423 prace_is_(RACE_ZOMBIE) ||
424 prace_is_(RACE_SPECTRE)) &&
425 (o_ptr->tval == TV_STAFF || o_ptr->tval == TV_WAND))
429 if (o_ptr->tval == TV_STAFF &&
430 (item < 0) && (o_ptr->number > 1))
433 msg_print("¤Þ¤º¤Ï¾ó¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
435 msg_print("You must first pick up the staffs.");
441 staff = (o_ptr->tval == TV_STAFF) ? "¾ó" : "ËâË¡ËÀ";
443 staff = (o_ptr->tval == TV_STAFF) ? "staff" : "wand";
447 if (o_ptr->pval == 0)
450 msg_format("¤³¤Î%s¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£", staff);
452 msg_format("The %s has no charges left.", staff);
455 o_ptr->ident |= (IDENT_EMPTY);
457 /* Combine / Reorder the pack (later) */
458 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
459 p_ptr->window |= (PW_INVEN);
465 msg_format("¤¢¤Ê¤¿¤Ï%s¤ÎËâÎϤò¥¨¥Í¥ë¥®¡¼¸»¤È¤·¤ÆµÛ¼ý¤·¤¿¡£", staff);
467 msg_format("You absorb mana of the %s as your energy.", staff);
470 /* Use a single charge */
474 set_food(p_ptr->food + 5000);
476 /* XXX Hack -- unstack if necessary */
477 if (o_ptr->tval == TV_STAFF &&
478 (item >= 0) && (o_ptr->number > 1))
483 /* Get local object */
486 /* Obtain a local object */
487 object_copy(q_ptr, o_ptr);
489 /* Modify quantity */
492 /* Restore the charges */
495 /* Unstack the used item */
497 p_ptr->total_weight -= q_ptr->weight;
498 item = inven_carry(q_ptr);
502 msg_format("¾ó¤ò¤Þ¤È¤á¤Ê¤ª¤·¤¿¡£");
504 msg_print("You unstack your staff.");
508 /* Describe charges in the pack */
511 inven_item_charges(item);
514 /* Describe charges on the floor */
517 floor_item_charges(0 - item);
520 /* Don't eat a staff/wand itself */
523 else if ((prace_is_(RACE_DEMON) ||
524 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON)) &&
525 (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_CORPSE &&
526 strchr("pht", r_info[o_ptr->pval].d_char)))
528 /* Drain vitality of humanoids */
529 char o_name[MAX_NLEN];
531 object_desc(o_name, o_ptr, FALSE, 0);
534 msg_format("%s¤Ïdz¤¨¾å¤ê³¥¤Ë¤Ê¤Ã¤¿¡£ÀºÎϤòµÛ¼ý¤·¤¿µ¤¤¬¤¹¤ë¡£", o_name);
536 msg_format("%^s is burnt to ashes. You absorb its vitality!", o_name);
538 (void)set_food(PY_FOOD_MAX - 1);
540 else if (prace_is_(RACE_SKELETON))
543 if (o_ptr->tval == TV_SKELETON ||
544 (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))
547 msg_print("¤¢¤Ê¤¿¤Ï¹ü¤Ç¼«Ê¬¤ÎÂΤòÊä¤Ã¤¿¡£");
549 msg_print("Your body absorbs the bone.");
551 set_food(p_ptr->food + 5000);
556 if (!((o_ptr->sval == SV_FOOD_WAYBREAD) ||
557 (o_ptr->sval < SV_FOOD_BISCUIT)))
560 object_type *q_ptr = &forge;
563 msg_print("¿©¤Ùʪ¤¬¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¤¿¡ª");
565 msg_print("The food falls through your jaws!");
569 /* Create the item */
570 object_prep(q_ptr, lookup_kind(o_ptr->tval, o_ptr->sval));
572 /* Drop the object from heaven */
573 (void)drop_near(q_ptr, -1, py, px);
578 msg_print("¿©¤Ùʪ¤¬¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¡¢¾Ã¤¨¤¿¡ª");
580 msg_print("The food falls through your jaws and vanishes!");
585 else if (prace_is_(RACE_GOLEM) ||
586 prace_is_(RACE_ZOMBIE) ||
587 prace_is_(RACE_ENT) ||
588 prace_is_(RACE_DEMON) ||
589 prace_is_(RACE_ANDROID) ||
590 prace_is_(RACE_SPECTRE) ||
591 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
594 msg_print("À¸¼Ô¤Î¿©Êª¤Ï¤¢¤Ê¤¿¤Ë¤È¤Ã¤Æ¤Û¤È¤ó¤É±ÉÍܤˤʤé¤Ê¤¤¡£");
596 msg_print("The food of mortals is poor sustenance for you.");
599 set_food(p_ptr->food + ((o_ptr->pval) / 20));
601 else if (o_ptr->tval == TV_FOOD && o_ptr->sval == SV_FOOD_WAYBREAD)
603 /* Waybread is always fully satisfying. */
604 set_food(MAX(p_ptr->food, PY_FOOD_MAX - 1));
608 /* Food can feed the player */
609 (void)set_food(p_ptr->food + o_ptr->pval);
612 /* Destroy a food in the pack */
615 inven_item_increase(item, -1);
616 inven_item_describe(item);
617 inven_item_optimize(item);
620 /* Destroy a food on the floor */
623 floor_item_increase(0 - item, -1);
624 floor_item_describe(0 - item);
625 floor_item_optimize(0 - item);
631 * Hook to determine if an object is eatable
633 static bool item_tester_hook_eatable(object_type *o_ptr)
635 if (o_ptr->tval==TV_FOOD) return TRUE;
638 if (prace_is_(RACE_SKELETON))
640 if (o_ptr->tval == TV_SKELETON ||
641 (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))
647 if (prace_is_(RACE_SKELETON) ||
648 prace_is_(RACE_GOLEM) ||
649 prace_is_(RACE_ZOMBIE) ||
650 prace_is_(RACE_SPECTRE))
652 if (o_ptr->tval == TV_STAFF || o_ptr->tval == TV_WAND)
655 else if (prace_is_(RACE_DEMON) ||
656 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON))
658 if (o_ptr->tval == TV_CORPSE &&
659 o_ptr->sval == SV_CORPSE &&
660 strchr("pht", r_info[o_ptr->pval].d_char))
670 * Eat some food (from the pack or floor)
672 void do_cmd_eat_food(void)
678 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
680 set_action(ACTION_NONE);
683 /* Restrict choices to food */
684 item_tester_hook = item_tester_hook_eatable;
688 q = "¤É¤ì¤ò¿©¤Ù¤Þ¤¹¤«? ";
689 s = "¿©¤Ùʪ¤¬¤Ê¤¤¡£";
691 q = "Eat which item? ";
692 s = "You have nothing to eat.";
695 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
698 do_cmd_eat_food_aux(item);
703 * Quaff a potion (from the pack or the floor)
705 static void do_cmd_quaff_potion_aux(int item)
718 if (flush_failure) flush();
720 msg_print("ÉÓ¤«¤é¿å¤¬Î®¤ì½Ð¤Æ¤³¤Ê¤¤¡ª");
722 msg_print("The potion doesn't flow out from a bottle.");
729 if((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0])
734 /* Get the item (in the pack) */
737 o_ptr = &inventory[item];
740 /* Get the item (on the floor) */
743 o_ptr = &o_list[0 - item];
746 /* Get local object */
749 /* Obtain a local object */
750 object_copy(q_ptr, o_ptr);
755 /* Reduce and describe inventory */
758 inven_item_increase(item, -1);
759 inven_item_describe(item);
760 inven_item_optimize(item);
763 /* Reduce and describe floor item */
766 floor_item_increase(0 - item, -1);
767 floor_item_describe(0 - item);
768 floor_item_optimize(0 - item);
775 /* Not identified yet */
779 lev = get_object_level(q_ptr);
781 /* Analyze the potion */
782 if (q_ptr->tval == TV_POTION)
787 /* °û¤ß¤´¤¿¤¨¤ò¥ª¥ê¥¸¥Ê¥ë¤è¤êºÙ¤«¤¯É½¸½ */
788 case SV_POTION_WATER:
789 msg_print("¸ý¤ÎÃ椬¤µ¤Ã¤Ñ¤ê¤·¤¿¡£");
790 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
794 case SV_POTION_APPLE_JUICE:
795 msg_print("´Å¤¯¤Æ¥µ¥Ã¥Ñ¥ê¤È¤·¤Æ¤¤¤Æ¡¢¤È¤Æ¤â¤ª¤¤¤·¤¤¡£");
796 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
800 case SV_POTION_SLIME_MOLD:
801 msg_print("¤Ê¤ó¤È¤âÉÔµ¤Ì£¤ÊÌ£¤À¡£");
802 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
807 case SV_POTION_WATER:
808 case SV_POTION_APPLE_JUICE:
809 case SV_POTION_SLIME_MOLD:
810 msg_print("You feel less thirsty.");
815 case SV_POTION_SLOWNESS:
816 if (set_slow(randint1(25) + 15, FALSE)) ident = TRUE;
819 case SV_POTION_SALT_WATER:
821 msg_print("¤¦¤§¡ª»×¤ï¤ºÅǤ¤¤Æ¤·¤Þ¤Ã¤¿¡£");
823 msg_print("The potion makes you vomit!");
826 if (prace_is_(RACE_GOLEM) ||
827 prace_is_(RACE_ZOMBIE) ||
828 prace_is_(RACE_DEMON) ||
829 prace_is_(RACE_ANDROID) ||
830 prace_is_(RACE_SPECTRE) ||
831 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
833 /* Only living creatures get thirsty */
834 (void)set_food(PY_FOOD_STARVE - 1);
837 (void)set_poisoned(0);
838 (void)set_paralyzed(p_ptr->paralyzed + 4);
842 case SV_POTION_POISON:
843 if (!(p_ptr->resist_pois || p_ptr->oppose_pois))
845 if (set_poisoned(p_ptr->poisoned + randint0(15) + 10))
852 case SV_POTION_BLINDNESS:
853 if (!p_ptr->resist_blind)
855 if (set_blind(p_ptr->blind + randint0(100) + 100))
862 case SV_POTION_CONFUSION: /* Booze */
863 if (p_ptr->pclass != CLASS_MONK) chg_virtue(V_HARMONY, -1);
864 else if (!p_ptr->resist_conf) p_ptr->special_attack |= ATTACK_SUIKEN;
865 if (!p_ptr->resist_conf)
867 if (set_confused(randint0(20) + 15))
873 if (!p_ptr->resist_chaos)
877 if (set_image(p_ptr->image + randint0(150) + 150))
882 if (one_in_(13) && (p_ptr->pclass != CLASS_MONK))
885 if (one_in_(3)) lose_all_info();
887 teleport_player(100);
890 msg_print("ÃΤé¤Ê¤¤¾ì½ê¤ÇÌܤ¬Àä᤿¡£Æ¬Äˤ¬¤¹¤ë¡£");
891 msg_print("²¿¤â»×¤¤½Ð¤»¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ØÍ褿¤Î¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
893 msg_print("You wake up somewhere with a sore head...");
894 msg_print("You can't remember a thing, or how you got here!");
901 case SV_POTION_SLEEP:
902 if (!p_ptr->free_act)
905 msg_print("¤¢¤Ê¤¿¤Ï̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
907 msg_print("You fall asleep.");
911 if (ironman_nightmare)
914 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
916 msg_print("A horrible vision enters your mind.");
920 /* Pick a nightmare */
921 get_mon_num_prep(get_nightmare, NULL);
923 /* Have some nightmares */
924 have_nightmare(get_mon_num(MAX_DEPTH));
926 /* Remove the monster restriction */
927 get_mon_num_prep(NULL, NULL);
929 if (set_paralyzed(p_ptr->paralyzed + randint0(4) + 4))
936 case SV_POTION_LOSE_MEMORIES:
937 if (!p_ptr->hold_life && (p_ptr->exp > 0))
940 msg_print("²áµî¤Îµ²±¤¬Çö¤ì¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
942 msg_print("You feel your memories fade.");
944 chg_virtue(V_KNOWLEDGE, -5);
946 lose_exp(p_ptr->exp / 4);
951 case SV_POTION_RUINATION:
953 msg_print("¿È¤â¿´¤â¼å¤Ã¤Æ¤¤Æ¡¢Àºµ¤¤¬È´¤±¤Æ¤¤¤¯¤è¤¦¤À¡£");
954 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), "ÇËÌǤÎÌô", -1);
956 msg_print("Your nerves and muscles feel weak and lifeless!");
957 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), "a potion of Ruination", -1);
960 (void)dec_stat(A_DEX, 25, TRUE);
961 (void)dec_stat(A_WIS, 25, TRUE);
962 (void)dec_stat(A_CON, 25, TRUE);
963 (void)dec_stat(A_STR, 25, TRUE);
964 (void)dec_stat(A_CHR, 25, TRUE);
965 (void)dec_stat(A_INT, 25, TRUE);
969 case SV_POTION_DEC_STR:
970 if (do_dec_stat(A_STR)) ident = TRUE;
973 case SV_POTION_DEC_INT:
974 if (do_dec_stat(A_INT)) ident = TRUE;
977 case SV_POTION_DEC_WIS:
978 if (do_dec_stat(A_WIS)) ident = TRUE;
981 case SV_POTION_DEC_DEX:
982 if (do_dec_stat(A_DEX)) ident = TRUE;
985 case SV_POTION_DEC_CON:
986 if (do_dec_stat(A_CON)) ident = TRUE;
989 case SV_POTION_DEC_CHR:
990 if (do_dec_stat(A_CHR)) ident = TRUE;
993 case SV_POTION_DETONATIONS:
995 msg_print("ÂΤÎÃæ¤Ç·ã¤·¤¤Çúȯ¤¬µ¯¤¤¿¡ª");
996 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), "Çúȯ¤ÎÌô", -1);
998 msg_print("Massive explosions rupture your body!");
999 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), "a potion of Detonation", -1);
1002 (void)set_stun(p_ptr->stun + 75);
1003 (void)set_cut(p_ptr->cut + 5000);
1007 case SV_POTION_DEATH:
1008 chg_virtue(V_VITALITY, -1);
1009 chg_virtue(V_UNLIFE, 5);
1011 msg_print("»à¤Îͽ´¶¤¬ÂÎÃæ¤ò¶î¤±¤á¤°¤Ã¤¿¡£");
1012 take_hit(DAMAGE_LOSELIFE, 5000, "»à¤ÎÌô", -1);
1014 msg_print("A feeling of Death flows through your body.");
1015 take_hit(DAMAGE_LOSELIFE, 5000, "a potion of Death", -1);
1021 case SV_POTION_INFRAVISION:
1022 if (set_tim_infra(p_ptr->tim_infra + 100 + randint1(100), FALSE))
1028 case SV_POTION_DETECT_INVIS:
1029 if (set_tim_invis(p_ptr->tim_invis + 12 + randint1(12), FALSE))
1035 case SV_POTION_SLOW_POISON:
1036 if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
1039 case SV_POTION_CURE_POISON:
1040 if (set_poisoned(0)) ident = TRUE;
1043 case SV_POTION_BOLDNESS:
1044 if (set_afraid(0)) ident = TRUE;
1047 case SV_POTION_SPEED:
1050 if (set_fast(randint1(25) + 15, FALSE)) ident = TRUE;
1054 (void)set_fast(p_ptr->fast + 5, FALSE);
1058 case SV_POTION_RESIST_HEAT:
1059 if (set_oppose_fire(p_ptr->oppose_fire + randint1(10) + 10, FALSE))
1065 case SV_POTION_RESIST_COLD:
1066 if (set_oppose_cold(p_ptr->oppose_cold + randint1(10) + 10, FALSE))
1072 case SV_POTION_HEROISM:
1073 if (set_afraid(0)) ident = TRUE;
1074 if (set_hero(p_ptr->hero + randint1(25) + 25, FALSE)) ident = TRUE;
1075 if (hp_player(10)) ident = TRUE;
1078 case SV_POTION_BESERK_STRENGTH:
1079 if (set_afraid(0)) ident = TRUE;
1080 if (set_shero(p_ptr->shero + randint1(25) + 25, FALSE)) ident = TRUE;
1081 if (hp_player(30)) ident = TRUE;
1084 case SV_POTION_CURE_LIGHT:
1085 if (hp_player(damroll(2, 8))) ident = TRUE;
1086 if (set_blind(0)) ident = TRUE;
1087 if (set_cut(p_ptr->cut - 10)) ident = TRUE;
1088 if (set_shero(0,TRUE)) ident = TRUE;
1091 case SV_POTION_CURE_SERIOUS:
1092 if (hp_player(damroll(4, 8))) ident = TRUE;
1093 if (set_blind(0)) ident = TRUE;
1094 if (set_confused(0)) ident = TRUE;
1095 if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;
1096 if (set_shero(0,TRUE)) ident = TRUE;
1099 case SV_POTION_CURE_CRITICAL:
1100 if (hp_player(damroll(6, 8))) ident = TRUE;
1101 if (set_blind(0)) ident = TRUE;
1102 if (set_confused(0)) ident = TRUE;
1103 if (set_poisoned(0)) ident = TRUE;
1104 if (set_stun(0)) ident = TRUE;
1105 if (set_cut(0)) ident = TRUE;
1106 if (set_shero(0,TRUE)) ident = TRUE;
1109 case SV_POTION_HEALING:
1110 if (hp_player(300)) ident = TRUE;
1111 if (set_blind(0)) ident = TRUE;
1112 if (set_confused(0)) ident = TRUE;
1113 if (set_poisoned(0)) ident = TRUE;
1114 if (set_stun(0)) ident = TRUE;
1115 if (set_cut(0)) ident = TRUE;
1116 if (set_shero(0,TRUE)) ident = TRUE;
1119 case SV_POTION_STAR_HEALING:
1120 if (hp_player(1200)) ident = TRUE;
1121 if (set_blind(0)) ident = TRUE;
1122 if (set_confused(0)) ident = TRUE;
1123 if (set_poisoned(0)) ident = TRUE;
1124 if (set_stun(0)) ident = TRUE;
1125 if (set_cut(0)) ident = TRUE;
1126 if (set_shero(0,TRUE)) ident = TRUE;
1129 case SV_POTION_LIFE:
1130 chg_virtue(V_VITALITY, 1);
1131 chg_virtue(V_UNLIFE, -5);
1133 msg_print("ÂÎÃæ¤ËÀ¸Ì¿ÎϤ¬Ëþ¤Á¤¢¤Õ¤ì¤Æ¤¤¿¡ª");
1135 msg_print("You feel life flow through your body!");
1139 (void)set_poisoned(0);
1141 (void)set_confused(0);
1145 (void)do_res_stat(A_STR);
1146 (void)do_res_stat(A_CON);
1147 (void)do_res_stat(A_DEX);
1148 (void)do_res_stat(A_WIS);
1149 (void)do_res_stat(A_INT);
1150 (void)do_res_stat(A_CHR);
1151 (void)set_shero(0,TRUE);
1157 case SV_POTION_RESTORE_MANA:
1158 if (p_ptr->pclass == CLASS_MAGIC_EATER)
1161 for (i = 0; i < EATER_EXT*2; i++)
1163 p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i]*EATER_CHARGE/3;
1164 if (p_ptr->magic_num1[i] > p_ptr->magic_num2[i]*EATER_CHARGE) p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*EATER_CHARGE;
1166 for (; i < EATER_EXT*3; i++)
1168 int k_idx = lookup_kind(TV_ROD, i-EATER_EXT*2);
1169 p_ptr->magic_num1[i] -= ((p_ptr->magic_num2[i] < 10) ? EATER_ROD_CHARGE*3 : p_ptr->magic_num2[i]*EATER_ROD_CHARGE/3)*k_info[k_idx].pval;
1170 if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
1173 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
1175 msg_print("Your feel your head clear.");
1177 p_ptr->window |= (PW_PLAYER);
1180 else if (p_ptr->csp < p_ptr->msp)
1182 p_ptr->csp = p_ptr->msp;
1183 p_ptr->csp_frac = 0;
1185 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
1187 msg_print("Your feel your head clear.");
1190 p_ptr->redraw |= (PR_MANA);
1191 p_ptr->window |= (PW_PLAYER);
1192 p_ptr->window |= (PW_SPELL);
1195 if (set_shero(0,TRUE)) ident = TRUE;
1198 case SV_POTION_RESTORE_EXP:
1199 if (restore_level()) ident = TRUE;
1202 case SV_POTION_RES_STR:
1203 if (do_res_stat(A_STR)) ident = TRUE;
1206 case SV_POTION_RES_INT:
1207 if (do_res_stat(A_INT)) ident = TRUE;
1210 case SV_POTION_RES_WIS:
1211 if (do_res_stat(A_WIS)) ident = TRUE;
1214 case SV_POTION_RES_DEX:
1215 if (do_res_stat(A_DEX)) ident = TRUE;
1218 case SV_POTION_RES_CON:
1219 if (do_res_stat(A_CON)) ident = TRUE;
1222 case SV_POTION_RES_CHR:
1223 if (do_res_stat(A_CHR)) ident = TRUE;
1226 case SV_POTION_INC_STR:
1227 if (do_inc_stat(A_STR)) ident = TRUE;
1230 case SV_POTION_INC_INT:
1231 if (do_inc_stat(A_INT)) ident = TRUE;
1234 case SV_POTION_INC_WIS:
1235 if (do_inc_stat(A_WIS)) ident = TRUE;
1238 case SV_POTION_INC_DEX:
1239 if (do_inc_stat(A_DEX)) ident = TRUE;
1242 case SV_POTION_INC_CON:
1243 if (do_inc_stat(A_CON)) ident = TRUE;
1246 case SV_POTION_INC_CHR:
1247 if (do_inc_stat(A_CHR)) ident = TRUE;
1250 case SV_POTION_AUGMENTATION:
1251 if (do_inc_stat(A_STR)) ident = TRUE;
1252 if (do_inc_stat(A_INT)) ident = TRUE;
1253 if (do_inc_stat(A_WIS)) ident = TRUE;
1254 if (do_inc_stat(A_DEX)) ident = TRUE;
1255 if (do_inc_stat(A_CON)) ident = TRUE;
1256 if (do_inc_stat(A_CHR)) ident = TRUE;
1259 case SV_POTION_ENLIGHTENMENT:
1261 msg_print("¼«Ê¬¤ÎÃÖ¤«¤ì¤Æ¤¤¤ë¾õ¶·¤¬Ç¾Î¢¤ËÉ⤫¤ó¤Ç¤¤¿...");
1263 msg_print("An image of your surroundings forms in your mind...");
1266 chg_virtue(V_KNOWLEDGE, 1);
1267 chg_virtue(V_ENLIGHTEN, 1);
1268 wiz_lite(FALSE, FALSE);
1272 case SV_POTION_STAR_ENLIGHTENMENT:
1274 msg_print("¹¹¤Ê¤ë·¼Ìؤò´¶¤¸¤¿...");
1276 msg_print("You begin to feel more enlightened...");
1279 chg_virtue(V_KNOWLEDGE, 1);
1280 chg_virtue(V_ENLIGHTEN, 2);
1282 wiz_lite(TRUE, FALSE);
1283 (void)do_inc_stat(A_INT);
1284 (void)do_inc_stat(A_WIS);
1285 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1286 (void)detect_doors(DETECT_RAD_DEFAULT);
1287 (void)detect_stairs(DETECT_RAD_DEFAULT);
1288 (void)detect_treasure(DETECT_RAD_DEFAULT);
1289 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
1290 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
1296 case SV_POTION_SELF_KNOWLEDGE:
1298 msg_print("¼«Ê¬¼«¿È¤Î¤³¤È¤¬¾¯¤·¤Ïʬ¤«¤Ã¤¿µ¤¤¬¤¹¤ë...");
1300 msg_print("You begin to know yourself a little better...");
1308 case SV_POTION_EXPERIENCE:
1309 if (p_ptr->prace == RACE_ANDROID) break;
1310 chg_virtue(V_ENLIGHTEN, 1);
1311 if (p_ptr->exp < PY_MAX_EXP)
1313 s32b ee = (p_ptr->exp / 2) + 10;
1314 if (ee > 100000L) ee = 100000L;
1316 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1318 msg_print("You feel more experienced.");
1326 case SV_POTION_RESISTANCE:
1327 (void)set_oppose_acid(p_ptr->oppose_acid + randint1(20) + 20, FALSE);
1328 (void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
1329 (void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
1330 (void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
1331 (void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
1335 case SV_POTION_CURING:
1336 if (hp_player(50)) ident = TRUE;
1337 if (set_blind(0)) ident = TRUE;
1338 if (set_poisoned(0)) ident = TRUE;
1339 if (set_confused(0)) ident = TRUE;
1340 if (set_stun(0)) ident = TRUE;
1341 if (set_cut(0)) ident = TRUE;
1342 if (set_image(0)) ident = TRUE;
1345 case SV_POTION_INVULNERABILITY:
1346 (void)set_invuln(p_ptr->invuln + randint1(4) + 4, FALSE);
1350 case SV_POTION_NEW_LIFE:
1351 do_cmd_rerate(FALSE);
1353 p_ptr->update |= PU_BONUS;
1354 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
1356 chg_virtue(V_CHANCE, -5);
1358 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
1360 msg_print("You are cured of all mutations.");
1363 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
1364 p_ptr->update |= PU_BONUS;
1366 mutant_regenerate_mod = calc_mutant_regenerate_mod();
1371 case SV_POTION_NEO_TSUYOSHI:
1373 (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
1377 case SV_POTION_TSUYOSHI:
1379 msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
1381 msg_print("Brother OKURE!");
1384 p_ptr->tsuyoshi = 1;
1385 (void)set_tsuyoshi(0, TRUE);
1386 if (!p_ptr->resist_chaos)
1388 (void)set_image(50 + randint1(50));
1393 case SV_POTION_POLYMORPH:
1394 if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23))
1396 chg_virtue(V_CHANCE, -5);
1398 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
1400 msg_print("You are cured of all mutations.");
1403 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
1404 p_ptr->update |= PU_BONUS;
1413 if(gain_random_mutation(0)) ident = TRUE;
1415 else if (lose_mutation(0)) ident = TRUE;
1416 } while(!ident || one_in_(2));
1422 if (prace_is_(RACE_SKELETON))
1425 msg_print("±ÕÂΤΰìÉô¤Ï¤¢¤Ê¤¿¤Î¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¤¿¡ª");
1427 msg_print("Some of the fluid falls through your jaws!");
1430 (void)potion_smash_effect(0, py, px, q_ptr->k_idx);
1433 /* Combine / Reorder the pack (later) */
1434 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1436 if (!(object_aware_p(o_ptr)))
1438 chg_virtue(V_PATIENCE, -1);
1439 chg_virtue(V_CHANCE, 1);
1440 chg_virtue(V_KNOWLEDGE, -1);
1443 /* The item has been tried */
1444 object_tried(q_ptr);
1446 /* An identification was made */
1447 if (ident && !object_aware_p(q_ptr))
1449 object_aware(q_ptr);
1450 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
1454 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
1456 /* Potions can feed the player */
1457 switch (p_ptr->mimic_form)
1460 switch (p_ptr->prace)
1463 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
1472 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1475 if (o_ptr->tval == TV_FLASK)
1478 msg_print("¥ª¥¤¥ë¤òÊäµë¤·¤¿¡£");
1480 msg_print("You replenish yourself with the oil.");
1482 set_food(p_ptr->food + 5000);
1486 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1491 msg_print("¿åʬ¤ò¼è¤ê¹þ¤ó¤À¡£");
1493 msg_print("You are moistened.");
1495 set_food(MIN(p_ptr->food + o_ptr->pval + MAX(0, o_ptr->pval * 10) + 2000, PY_FOOD_MAX - 1));
1498 (void)set_food(p_ptr->food + o_ptr->pval);
1503 case MIMIC_DEMON_LORD:
1504 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1507 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
1510 (void)set_food(p_ptr->food + o_ptr->pval);
1517 * Hook to determine if an object can be quaffed
1519 static bool item_tester_hook_quaff(object_type *o_ptr)
1521 if (o_ptr->tval == TV_POTION) return TRUE;
1523 if (prace_is_(RACE_ANDROID))
1525 if (o_ptr->tval == TV_FLASK && o_ptr->sval == SV_FLASK_OIL)
1534 * Quaff some potion (from the pack or floor)
1536 void do_cmd_quaff_potion(void)
1541 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
1543 set_action(ACTION_NONE);
1546 /* Restrict choices to potions */
1547 item_tester_hook = item_tester_hook_quaff;
1551 q = "¤É¤ÎÌô¤ò°û¤ß¤Þ¤¹¤«? ";
1552 s = "°û¤á¤ëÌô¤¬¤Ê¤¤¡£";
1554 q = "Quaff which potion? ";
1555 s = "You have no potions to quaff.";
1558 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1560 /* Quaff the potion */
1561 do_cmd_quaff_potion_aux(item);
1566 * Read a scroll (from the pack or floor).
1568 * Certain scrolls can be "aborted" without losing the scroll. These
1569 * include scrolls with no effects but recharge or identify, which are
1570 * cancelled before use. XXX Reading them still takes a turn, though.
1572 static void do_cmd_read_scroll_aux(int item, bool known)
1574 int k, used_up, ident, lev;
1579 /* Get the item (in the pack) */
1582 o_ptr = &inventory[item];
1585 /* Get the item (on the floor) */
1588 o_ptr = &o_list[0 - item];
1597 if (flush_failure) flush();
1599 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
1601 msg_print("Nothing happen.");
1608 if (p_ptr->pclass == CLASS_BERSERKER)
1611 msg_print("´¬Êª¤Ê¤ó¤ÆÆɤá¤Ê¤¤¡£");
1613 msg_print("You cannot read.");
1618 if((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0])
1623 /* Not identified yet */
1627 lev = get_object_level(o_ptr);
1629 /* Assume the scroll will get used up */
1632 if (o_ptr->tval == TV_SCROLL)
1634 /* Analyze the scroll */
1635 switch (o_ptr->sval)
1637 case SV_SCROLL_DARKNESS:
1639 if (!(p_ptr->resist_blind) && !(p_ptr->resist_dark))
1641 (void)set_blind(p_ptr->blind + 3 + randint1(5));
1643 if (unlite_area(10, 3)) ident = TRUE;
1647 case SV_SCROLL_AGGRAVATE_MONSTER:
1650 msg_print("¥«¥ó¹â¤¯¤¦¤Ê¤ëÍͤʲ»¤¬ÊÕ¤ê¤òʤ¤Ã¤¿¡£");
1652 msg_print("There is a high pitched humming noise.");
1655 aggravate_monsters(0);
1660 case SV_SCROLL_CURSE_ARMOR:
1662 if (curse_armor()) ident = TRUE;
1666 case SV_SCROLL_CURSE_WEAPON:
1668 if (curse_weapon(FALSE, INVEN_RARM)) ident = TRUE;
1672 case SV_SCROLL_SUMMON_MONSTER:
1674 for (k = 0; k < randint1(3); k++)
1676 if (summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
1684 case SV_SCROLL_SUMMON_UNDEAD:
1686 for (k = 0; k < randint1(3); k++)
1688 if (summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
1696 case SV_SCROLL_SUMMON_PET:
1698 if (summon_specific(-1, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_FORCE_PET)))
1705 case SV_SCROLL_SUMMON_KIN:
1707 if (summon_kin_player(p_ptr->lev, py, px, (PM_FORCE_PET | PM_ALLOW_GROUP)))
1714 case SV_SCROLL_TRAP_CREATION:
1716 if (trap_creation(py, px)) ident = TRUE;
1720 case SV_SCROLL_PHASE_DOOR:
1722 teleport_player(10);
1727 case SV_SCROLL_TELEPORT:
1729 teleport_player(100);
1734 case SV_SCROLL_TELEPORT_LEVEL:
1736 (void)teleport_player_level();
1741 case SV_SCROLL_WORD_OF_RECALL:
1743 if (!word_of_recall()) used_up = FALSE;
1748 case SV_SCROLL_IDENTIFY:
1750 if (!ident_spell(FALSE)) used_up = FALSE;
1755 case SV_SCROLL_STAR_IDENTIFY:
1757 if (!identify_fully(FALSE)) used_up = FALSE;
1762 case SV_SCROLL_REMOVE_CURSE:
1767 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1769 msg_print("You feel as if someone is watching over you.");
1777 case SV_SCROLL_STAR_REMOVE_CURSE:
1779 if (remove_all_curse())
1782 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1784 msg_print("You feel as if someone is watching over you.");
1791 case SV_SCROLL_ENCHANT_ARMOR:
1794 if (!enchant_spell(0, 0, 1)) used_up = FALSE;
1798 case SV_SCROLL_ENCHANT_WEAPON_TO_HIT:
1800 if (!enchant_spell(1, 0, 0)) used_up = FALSE;
1805 case SV_SCROLL_ENCHANT_WEAPON_TO_DAM:
1807 if (!enchant_spell(0, 1, 0)) used_up = FALSE;
1812 case SV_SCROLL_STAR_ENCHANT_ARMOR:
1814 if (!enchant_spell(0, 0, randint1(3) + 2)) used_up = FALSE;
1819 case SV_SCROLL_STAR_ENCHANT_WEAPON:
1821 if (!enchant_spell(randint1(3), randint1(3), 0)) used_up = FALSE;
1826 case SV_SCROLL_RECHARGING:
1828 if (!recharge(130)) used_up = FALSE;
1833 case SV_SCROLL_MUNDANITY:
1836 if (!mundane_spell(FALSE)) used_up = FALSE;
1840 case SV_SCROLL_LIGHT:
1842 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
1846 case SV_SCROLL_MAPPING:
1848 map_area(DETECT_RAD_MAP);
1853 case SV_SCROLL_DETECT_GOLD:
1855 if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
1856 if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
1860 case SV_SCROLL_DETECT_ITEM:
1862 if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
1866 case SV_SCROLL_DETECT_TRAP:
1868 if (detect_traps(DETECT_RAD_DEFAULT, known)) ident = TRUE;
1872 case SV_SCROLL_DETECT_DOOR:
1874 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
1875 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
1879 case SV_SCROLL_DETECT_INVIS:
1881 if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
1885 case SV_SCROLL_SATISFY_HUNGER:
1887 if (set_food(PY_FOOD_MAX - 1)) ident = TRUE;
1891 case SV_SCROLL_BLESSING:
1893 if (set_blessed(p_ptr->blessed + randint1(12) + 6, FALSE)) ident = TRUE;
1897 case SV_SCROLL_HOLY_CHANT:
1899 if (set_blessed(p_ptr->blessed + randint1(24) + 12, FALSE)) ident = TRUE;
1903 case SV_SCROLL_HOLY_PRAYER:
1905 if (set_blessed(p_ptr->blessed + randint1(48) + 24, FALSE)) ident = TRUE;
1909 case SV_SCROLL_MONSTER_CONFUSION:
1911 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1914 msg_print("¼ê¤¬µ±¤»Ï¤á¤¿¡£");
1916 msg_print("Your hands begin to glow.");
1919 p_ptr->special_attack |= ATTACK_CONFUSE;
1920 p_ptr->redraw |= (PR_STATUS);
1926 case SV_SCROLL_PROTECTION_FROM_EVIL:
1929 if (set_protevil(p_ptr->protevil + randint1(25) + k, FALSE)) ident = TRUE;
1933 case SV_SCROLL_RUNE_OF_PROTECTION:
1940 case SV_SCROLL_TRAP_DOOR_DESTRUCTION:
1942 if (destroy_doors_touch()) ident = TRUE;
1946 case SV_SCROLL_STAR_DESTRUCTION:
1948 if (destroy_area(py, px, 13+randint0(5), TRUE))
1952 msg_print("¥À¥ó¥¸¥ç¥ó¤¬Íɤ줿...");
1954 msg_print("The dungeon trembles...");
1961 case SV_SCROLL_DISPEL_UNDEAD:
1963 if (dispel_undead(80)) ident = TRUE;
1967 case SV_SCROLL_SPELL:
1969 if ((p_ptr->pclass == CLASS_WARRIOR) || (p_ptr->pclass == CLASS_IMITATOR) || (p_ptr->pclass == CLASS_MINDCRAFTER) || (p_ptr->pclass == CLASS_SORCERER) || (p_ptr->pclass == CLASS_ARCHER) || (p_ptr->pclass == CLASS_MAGIC_EATER) || (p_ptr->pclass == CLASS_RED_MAGE) || (p_ptr->pclass == CLASS_SAMURAI) || (p_ptr->pclass == CLASS_BLUE_MAGE) || (p_ptr->pclass == CLASS_CAVALRY) || (p_ptr->pclass == CLASS_BERSERKER) || (p_ptr->pclass == CLASS_SMITH) || (p_ptr->pclass == CLASS_MIRROR_MASTER) || (p_ptr->pclass == CLASS_NINJA)) break;
1970 p_ptr->add_spells++;
1971 p_ptr->update |= (PU_SPELLS);
1976 case SV_SCROLL_GENOCIDE:
1978 (void)symbol_genocide(300, TRUE);
1983 case SV_SCROLL_MASS_GENOCIDE:
1985 (void)mass_genocide(300, TRUE);
1990 case SV_SCROLL_ACQUIREMENT:
1992 acquirement(py, px, 1, TRUE, FALSE);
1997 case SV_SCROLL_STAR_ACQUIREMENT:
1999 acquirement(py, px, randint1(2) + 1, TRUE, FALSE);
2004 /* New Hengband scrolls */
2005 case SV_SCROLL_FIRE:
2007 fire_ball(GF_FIRE, 0, 666, 4);
2008 /* Note: "Double" damage since it is centered on the player ... */
2009 if (!(p_ptr->oppose_fire || p_ptr->resist_fire || p_ptr->immune_fire))
2011 take_hit(DAMAGE_NOESCAPE, 50+randint1(50), "±ê¤Î´¬Êª", -1);
2013 take_hit(DAMAGE_NOESCAPE, 50 + randint1(50), "a Scroll of Fire", -1);
2023 fire_ball(GF_ICE, 0, 777, 4);
2024 if (!(p_ptr->oppose_cold || p_ptr->resist_cold || p_ptr->immune_cold))
2026 take_hit(DAMAGE_NOESCAPE, 100+randint1(100), "ɹ¤Î´¬Êª", -1);
2028 take_hit(DAMAGE_NOESCAPE, 100 + randint1(100), "a Scroll of Ice", -1);
2035 case SV_SCROLL_CHAOS:
2037 fire_ball(GF_CHAOS, 0, 1000, 4);
2038 if (!p_ptr->resist_chaos)
2040 take_hit(DAMAGE_NOESCAPE, 111+randint1(111), "¥í¥°¥ë¥¹¤Î´¬Êª", -1);
2042 take_hit(DAMAGE_NOESCAPE, 111 + randint1(111), "a Scroll of Logrus", -1);
2049 case SV_SCROLL_RUMOR:
2053 switch (randint1(20))
2057 err = get_rnd_line("chainswd_j.txt", 0, Rumor);
2059 err = get_rnd_line("chainswd.txt", 0, Rumor);
2065 err = get_rnd_line("error_j.txt", 0, Rumor);
2067 err = get_rnd_line("error.txt", 0, Rumor);
2075 err = get_rnd_line("death_j.txt", 0, Rumor);
2077 err = get_rnd_line("death.txt", 0, Rumor);
2083 err = get_rnd_line_jonly("rumors_j.txt", 0, Rumor, 10);
2085 err = get_rnd_line("rumors.txt", 0, Rumor);
2091 /* An error occured */
2093 if (err) strcpy(Rumor, "±³¤Î±½¤â¤¢¤ë¡£");
2095 if (err) strcpy(Rumor, "Some rumors are wrong.");
2100 msg_print("´¬Êª¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤¬½ñ¤«¤ì¤Æ¤¤¤ë:");
2102 msg_print("There is message on the scroll. It says:");
2106 msg_format("%s", Rumor);
2109 msg_print("´¬Êª¤Ï±ì¤òΩ¤Æ¤Æ¾Ã¤¨µî¤Ã¤¿¡ª");
2111 msg_print("The scroll disappears in a puff of smoke!");
2118 case SV_SCROLL_ARTIFACT:
2121 if (!artifact_scroll()) used_up = FALSE;
2125 case SV_SCROLL_RESET_RECALL:
2128 if (!reset_recall()) used_up = FALSE;
2133 else if (o_ptr->name1 == ART_GHB)
2136 msg_print("»ä¤Ï¶ìÏ«¤·¤Æ¡Ø¥°¥ì¡¼¥¿¡¼¡¦¥Ø¥ë=¥Ó¡¼¥¹¥È¡Ù¤òÅݤ·¤¿¡£");
2137 msg_print("¤·¤«¤·¼ê¤ËÆþ¤Ã¤¿¤Î¤Ï¤³¤Î¤¤¿¤Ê¤¤£Ô¥·¥ã¥Ä¤À¤±¤À¤Ã¤¿¡£");
2139 msg_print("I had a very hard time to kill the Greater hell-beast, ");
2140 msg_print("but all I got was this lousy t-shirt!");
2144 else if (o_ptr->name1 == ART_POWER)
2147 msg_print("¡Ö°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤òÅý¤Ù¡¢");
2149 msg_print("°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤ò¸«¤Ä¤±¡¢");
2151 msg_print("°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤òÊá¤é¤¨¤Æ");
2153 msg_print("°Å°Ç¤ÎÃæ¤Ë·Ò¤®¤È¤á¤ë¡£¡×");
2155 msg_print("'One Ring to rule them all, ");
2157 msg_print("One Ring to find them, ");
2159 msg_print("One Ring to bring them all ");
2161 msg_print("and in the darkness bind them.'");
2165 else if (o_ptr->tval==TV_PARCHEMENT)
2168 char o_name[MAX_NLEN];
2174 q=format("book-%d_jp.txt",o_ptr->sval);
2176 /* Display object description */
2177 object_desc(o_name, o_ptr, TRUE, 0);
2179 /* Build the filename */
2180 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, q);
2182 /* Peruse the help file */
2183 (void)show_file(TRUE, buf, o_name, 0, 0);
2192 /* Combine / Reorder the pack (later) */
2193 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2195 if (!(object_aware_p(o_ptr)))
2197 chg_virtue(V_PATIENCE, -1);
2198 chg_virtue(V_CHANCE, 1);
2199 chg_virtue(V_KNOWLEDGE, -1);
2202 /* The item was tried */
2203 object_tried(o_ptr);
2205 /* An identification was made */
2206 if (ident && !object_aware_p(o_ptr))
2208 object_aware(o_ptr);
2209 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
2213 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
2216 /* Hack -- allow certain scrolls to be "preserved" */
2222 sound(SOUND_SCROLL);
2224 /* Destroy a scroll in the pack */
2227 inven_item_increase(item, -1);
2228 inven_item_describe(item);
2229 inven_item_optimize(item);
2232 /* Destroy a scroll on the floor */
2235 floor_item_increase(0 - item, -1);
2236 floor_item_describe(0 - item);
2237 floor_item_optimize(0 - item);
2243 * Hook to determine if an object is readable
2245 static bool item_tester_hook_readable(object_type *o_ptr)
2247 if ((o_ptr->tval==TV_SCROLL) || (o_ptr->tval==TV_PARCHEMENT) || (o_ptr->name1 == ART_GHB) || (o_ptr->name1 == ART_POWER)) return (TRUE);
2254 void do_cmd_read_scroll(void)
2260 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
2262 set_action(ACTION_NONE);
2265 /* Check some conditions */
2269 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡£");
2271 msg_print("You can't see anything.");
2279 msg_print("ÌÀ¤«¤ê¤¬¤Ê¤¤¤Î¤Ç¡¢°Å¤¯¤ÆÆɤá¤Ê¤¤¡£");
2281 msg_print("You have no light to read by.");
2286 if (p_ptr->confused)
2289 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡£");
2291 msg_print("You are too confused!");
2298 /* Restrict choices to scrolls */
2299 item_tester_hook = item_tester_hook_readable;
2303 q = "¤É¤Î´¬Êª¤òÆɤߤޤ¹¤«? ";
2304 s = "Æɤá¤ë´¬Êª¤¬¤Ê¤¤¡£";
2306 q = "Read which scroll? ";
2307 s = "You have no scrolls to read.";
2310 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
2312 /* Get the item (in the pack) */
2315 o_ptr = &inventory[item];
2318 /* Get the item (on the floor) */
2321 o_ptr = &o_list[0 - item];
2324 /* Read the scroll */
2325 do_cmd_read_scroll_aux(item, object_aware_p(o_ptr));
2329 static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
2334 /* Analyze the staff */
2337 case SV_STAFF_DARKNESS:
2339 if (!(p_ptr->resist_blind) && !(p_ptr->resist_dark))
2341 if (set_blind(p_ptr->blind + 3 + randint1(5))) ident = TRUE;
2343 if (unlite_area(10, 3)) ident = TRUE;
2347 case SV_STAFF_SLOWNESS:
2349 if (set_slow(p_ptr->slow + randint1(30) + 15, FALSE)) ident = TRUE;
2353 case SV_STAFF_HASTE_MONSTERS:
2355 if (speed_monsters()) ident = TRUE;
2359 case SV_STAFF_SUMMONING:
2361 for (k = 0; k < randint1(4); k++)
2363 if (summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
2371 case SV_STAFF_TELEPORTATION:
2373 teleport_player(100);
2378 case SV_STAFF_IDENTIFY:
2380 if (!ident_spell(FALSE)) *use_charge = FALSE;
2385 case SV_STAFF_REMOVE_CURSE:
2392 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2394 msg_print("You feel as if someone is watching over you.");
2397 else if (!p_ptr->blind)
2400 msg_print("¾ó¤Ï°ì½Ö¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
2402 msg_print("The staff glows blue for a moment...");
2411 case SV_STAFF_STARLITE:
2413 int num = damroll(5, 3);
2417 if (!p_ptr->blind && !magic)
2420 msg_print("¾ó¤ÎÀ褬ÌÀ¤ë¤¯µ±¤¤¤¿...");
2422 msg_print("The end of the staff glows brightly...");
2426 for (k = 0; k < num; k++)
2432 scatter(&y, &x, py, px, 4, 0);
2434 if (!cave_floor_bold(y, x)) continue;
2436 if ((y != py) || (x != px)) break;
2439 project(0, 0, y, x, damroll(6 + p_ptr->lev / 8, 10), GF_LITE_WEAK,
2440 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL), -1);
2448 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
2452 case SV_STAFF_MAPPING:
2454 map_area(DETECT_RAD_MAP);
2459 case SV_STAFF_DETECT_GOLD:
2461 if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
2462 if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
2466 case SV_STAFF_DETECT_ITEM:
2468 if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
2472 case SV_STAFF_DETECT_TRAP:
2474 if (detect_traps(DETECT_RAD_DEFAULT, known)) ident = TRUE;
2478 case SV_STAFF_DETECT_DOOR:
2480 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
2481 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
2485 case SV_STAFF_DETECT_INVIS:
2487 if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
2491 case SV_STAFF_DETECT_EVIL:
2493 if (detect_monsters_evil(DETECT_RAD_DEFAULT)) ident = TRUE;
2497 case SV_STAFF_CURE_LIGHT:
2499 if (hp_player(damroll(2, 8))) ident = TRUE;
2500 if (set_shero(0,TRUE)) ident = TRUE;
2504 case SV_STAFF_CURING:
2506 if (set_blind(0)) ident = TRUE;
2507 if (set_poisoned(0)) ident = TRUE;
2508 if (set_confused(0)) ident = TRUE;
2509 if (set_stun(0)) ident = TRUE;
2510 if (set_cut(0)) ident = TRUE;
2511 if (set_image(0)) ident = TRUE;
2512 if (set_shero(0,TRUE)) ident = TRUE;
2516 case SV_STAFF_HEALING:
2518 if (hp_player(300)) ident = TRUE;
2519 if (set_stun(0)) ident = TRUE;
2520 if (set_cut(0)) ident = TRUE;
2521 if (set_shero(0,TRUE)) ident = TRUE;
2525 case SV_STAFF_THE_MAGI:
2527 if (do_res_stat(A_INT)) ident = TRUE;
2528 if (p_ptr->csp < p_ptr->msp)
2530 p_ptr->csp = p_ptr->msp;
2531 p_ptr->csp_frac = 0;
2534 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
2536 msg_print("Your feel your head clear.");
2539 p_ptr->redraw |= (PR_MANA);
2540 p_ptr->window |= (PW_PLAYER);
2541 p_ptr->window |= (PW_SPELL);
2543 if (set_shero(0,TRUE)) ident = TRUE;
2547 case SV_STAFF_SLEEP_MONSTERS:
2549 if (sleep_monsters()) ident = TRUE;
2553 case SV_STAFF_SLOW_MONSTERS:
2555 if (slow_monsters()) ident = TRUE;
2559 case SV_STAFF_SPEED:
2561 if (set_fast(randint1(30) + 15, FALSE)) ident = TRUE;
2565 case SV_STAFF_PROBING:
2572 case SV_STAFF_DISPEL_EVIL:
2574 if (dispel_evil(80)) ident = TRUE;
2578 case SV_STAFF_POWER:
2580 if (dispel_monsters(150)) ident = TRUE;
2584 case SV_STAFF_HOLINESS:
2586 if (dispel_evil(150)) ident = TRUE;
2588 if (set_protevil((magic ? 0 : p_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
2589 if (set_poisoned(0)) ident = TRUE;
2590 if (set_afraid(0)) ident = TRUE;
2591 if (hp_player(50)) ident = TRUE;
2592 if (set_stun(0)) ident = TRUE;
2593 if (set_cut(0)) ident = TRUE;
2597 case SV_STAFF_GENOCIDE:
2599 (void)symbol_genocide((magic ? p_ptr->lev + 50 : 200), TRUE);
2604 case SV_STAFF_EARTHQUAKES:
2606 if (earthquake(py, px, 10))
2610 msg_print("¥À¥ó¥¸¥ç¥ó¤¬Íɤ줿¡£");
2612 msg_print("The dungeon trembles.");
2619 case SV_STAFF_DESTRUCTION:
2621 if (destroy_area(py, px, 13+randint0(5), TRUE))
2627 case SV_STAFF_ANIMATE_DEAD:
2629 if (animate_dead(0, py, px))
2635 case SV_STAFF_MSTORM:
2638 msg_print("¶¯ÎϤÊËâÎϤ¬Å¨¤ò°ú¤Îö¤¤¤¿¡ª");
2640 msg_print("Mighty magics rend your enemies!");
2642 project(0, 5, py, px,
2643 (randint1(200) + 300) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
2644 if ((p_ptr->pclass != CLASS_MAGE) && (p_ptr->pclass != CLASS_HIGH_MAGE) && (p_ptr->pclass != CLASS_SORCERER) && (p_ptr->pclass != CLASS_MAGIC_EATER) && (p_ptr->pclass != CLASS_BLUE_MAGE))
2647 (void)take_hit(DAMAGE_NOESCAPE, 50, "¥³¥ó¥È¥í¡¼¥ë¤·Æñ¤¤¶¯ÎϤÊËâÎϤβòÊü", -1);
2649 (void)take_hit(DAMAGE_NOESCAPE, 50, "unleashing magics too mighty to control", -1);
2657 case SV_STAFF_NOTHING:
2660 msg_print("²¿¤âµ¯¤é¤Ê¤«¤Ã¤¿¡£");
2662 msg_print("Nothing happen.");
2664 if (prace_is_(RACE_SKELETON) || prace_is_(RACE_GOLEM) ||
2665 prace_is_(RACE_ZOMBIE) || prace_is_(RACE_SPECTRE))
2667 msg_print("¤â¤Ã¤¿¤¤¤Ê¤¤»ö¤ò¤·¤¿¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£¿©¤Ùʪ¤ÏÂçÀڤˤ·¤Ê¤¯¤Æ¤Ï¡£");
2669 msg_print("What a waste. It's your food!");
2678 * Use a staff. -RAK-
2680 * One charge of one staff disappears.
2682 * Hack -- staffs of identify can be "cancelled".
2684 static void do_cmd_use_staff_aux(int item)
2686 int ident, chance, lev;
2690 /* Hack -- let staffs of identify get aborted */
2691 bool use_charge = TRUE;
2694 /* Get the item (in the pack) */
2697 o_ptr = &inventory[item];
2700 /* Get the item (on the floor) */
2703 o_ptr = &o_list[0 - item];
2707 /* Mega-Hack -- refuse to use a pile from the ground */
2708 if ((item < 0) && (o_ptr->number > 1))
2711 msg_print("¤Þ¤º¤Ï¾ó¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
2713 msg_print("You must first pick up the staffs.");
2723 /* Extract the item level */
2724 lev = get_object_level(o_ptr);
2725 if (lev > 50) lev = 50 + (lev - 50)/2;
2727 /* Base chance of success */
2728 chance = p_ptr->skill_dev;
2730 /* Confusion hurts skill */
2731 if (p_ptr->confused) chance = chance / 2;
2733 /* Hight level objects are harder */
2734 chance = chance - lev;
2736 /* Give everyone a (slight) chance */
2737 if ((chance < USE_DEVICE) && one_in_(USE_DEVICE - chance + 1))
2739 chance = USE_DEVICE;
2744 if (flush_failure) flush();
2746 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
2748 msg_print("Nothing happen. Maybe this staff is freezing too.");
2755 /* Roll for usage */
2756 if ((chance < USE_DEVICE) || (randint1(chance) < USE_DEVICE) || (p_ptr->pclass == CLASS_BERSERKER))
2758 if (flush_failure) flush();
2760 msg_print("¾ó¤ò¤¦¤Þ¤¯»È¤¨¤Ê¤«¤Ã¤¿¡£");
2762 msg_print("You failed to use the staff properly.");
2769 /* Notice empty staffs */
2770 if (o_ptr->pval <= 0)
2772 if (flush_failure) flush();
2774 msg_print("¤³¤Î¾ó¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£");
2776 msg_print("The staff has no charges left.");
2779 o_ptr->ident |= (IDENT_EMPTY);
2781 /* Combine / Reorder the pack (later) */
2782 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2783 p_ptr->window |= (PW_INVEN);
2792 ident = staff_effect(o_ptr->sval, &use_charge, FALSE, object_aware_p(o_ptr));
2794 if (!(object_aware_p(o_ptr)))
2796 chg_virtue(V_PATIENCE, -1);
2797 chg_virtue(V_CHANCE, 1);
2798 chg_virtue(V_KNOWLEDGE, -1);
2801 /* Combine / Reorder the pack (later) */
2802 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2804 /* Tried the item */
2805 object_tried(o_ptr);
2807 /* An identification was made */
2808 if (ident && !object_aware_p(o_ptr))
2810 object_aware(o_ptr);
2811 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
2815 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
2818 /* Hack -- some uses are "free" */
2819 if (!use_charge) return;
2822 /* Use a single charge */
2825 /* XXX Hack -- unstack if necessary */
2826 if ((item >= 0) && (o_ptr->number > 1))
2831 /* Get local object */
2834 /* Obtain a local object */
2835 object_copy(q_ptr, o_ptr);
2837 /* Modify quantity */
2840 /* Restore the charges */
2843 /* Unstack the used item */
2845 p_ptr->total_weight -= q_ptr->weight;
2846 item = inven_carry(q_ptr);
2850 msg_print("¾ó¤ò¤Þ¤È¤á¤Ê¤ª¤·¤¿¡£");
2852 msg_print("You unstack your staff.");
2857 /* Describe charges in the pack */
2860 inven_item_charges(item);
2863 /* Describe charges on the floor */
2866 floor_item_charges(0 - item);
2871 void do_cmd_use_staff(void)
2876 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
2878 set_action(ACTION_NONE);
2881 /* Restrict choices to wands */
2882 item_tester_tval = TV_STAFF;
2886 q = "¤É¤Î¾ó¤ò»È¤¤¤Þ¤¹¤«? ";
2887 s = "»È¤¨¤ë¾ó¤¬¤Ê¤¤¡£";
2889 q = "Use which staff? ";
2890 s = "You have no staff to use.";
2893 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
2895 do_cmd_use_staff_aux(item);
2899 static int wand_effect(int sval, int dir, bool magic)
2903 /* XXX Hack -- Wand of wonder can do anything before it */
2904 if (sval == SV_WAND_WONDER)
2906 int vir = virtue_number(V_CHANCE);
2907 sval = randint0(SV_WAND_WONDER);
2911 if (p_ptr->virtues[vir - 1] > 0)
2913 while (randint1(300) < p_ptr->virtues[vir - 1]) sval++;
2914 if (sval > SV_WAND_COLD_BALL) sval = randint0(4) + SV_WAND_ACID_BALL;
2918 while (randint1(300) < (0-p_ptr->virtues[vir - 1])) sval--;
2919 if (sval < SV_WAND_HEAL_MONSTER) sval = randint0(3) + SV_WAND_HEAL_MONSTER;
2922 if (sval < SV_WAND_TELEPORT_AWAY)
2923 chg_virtue(V_CHANCE, 1);
2926 /* Analyze the wand */
2929 case SV_WAND_HEAL_MONSTER:
2931 if (heal_monster(dir, damroll(10, 10))) ident = TRUE;
2935 case SV_WAND_HASTE_MONSTER:
2937 if (speed_monster(dir)) ident = TRUE;
2941 case SV_WAND_CLONE_MONSTER:
2943 if (clone_monster(dir)) ident = TRUE;
2947 case SV_WAND_TELEPORT_AWAY:
2949 if (teleport_monster(dir)) ident = TRUE;
2953 case SV_WAND_DISARMING:
2955 if (disarm_trap(dir)) ident = TRUE;
2959 case SV_WAND_TRAP_DOOR_DEST:
2961 if (destroy_door(dir)) ident = TRUE;
2965 case SV_WAND_STONE_TO_MUD:
2967 if (wall_to_mud(dir)) ident = TRUE;
2974 msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
2976 msg_print("A line of blue shimmering light appears.");
2979 (void)lite_line(dir);
2984 case SV_WAND_SLEEP_MONSTER:
2986 if (sleep_monster(dir)) ident = TRUE;
2990 case SV_WAND_SLOW_MONSTER:
2992 if (slow_monster(dir)) ident = TRUE;
2996 case SV_WAND_CONFUSE_MONSTER:
2998 if (confuse_monster(dir, p_ptr->lev)) ident = TRUE;
3002 case SV_WAND_FEAR_MONSTER:
3004 if (fear_monster(dir, p_ptr->lev)) ident = TRUE;
3008 case SV_WAND_DRAIN_LIFE:
3010 if (drain_life(dir, 80 + p_ptr->lev)) ident = TRUE;
3014 case SV_WAND_POLYMORPH:
3016 if (poly_monster(dir)) ident = TRUE;
3020 case SV_WAND_STINKING_CLOUD:
3022 fire_ball(GF_POIS, dir, 12 + p_ptr->lev / 4, 2);
3027 case SV_WAND_MAGIC_MISSILE:
3029 fire_bolt_or_beam(20, GF_MISSILE, dir, damroll(2 + p_ptr->lev / 10, 6));
3034 case SV_WAND_ACID_BOLT:
3036 fire_bolt_or_beam(20, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
3041 case SV_WAND_CHARM_MONSTER:
3043 if (charm_monster(dir, MAX(20, p_ptr->lev)))
3048 case SV_WAND_FIRE_BOLT:
3050 fire_bolt_or_beam(20, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
3055 case SV_WAND_COLD_BOLT:
3057 fire_bolt_or_beam(20, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
3062 case SV_WAND_ACID_BALL:
3064 fire_ball(GF_ACID, dir, 60 + 3 * p_ptr->lev / 4, 2);
3069 case SV_WAND_ELEC_BALL:
3071 fire_ball(GF_ELEC, dir, 40 + 3 * p_ptr->lev / 4, 2);
3076 case SV_WAND_FIRE_BALL:
3078 fire_ball(GF_FIRE, dir, 70 + 3 * p_ptr->lev / 4, 2);
3083 case SV_WAND_COLD_BALL:
3085 fire_ball(GF_COLD, dir, 50 + 3 * p_ptr->lev / 4, 2);
3090 case SV_WAND_WONDER:
3093 msg_print("¤ª¤Ã¤È¡¢Ææ¤ÎËâË¡ËÀ¤ò»ÏÆ°¤µ¤»¤¿¡£");
3095 msg_print("Oops. Wand of wonder activated.");
3101 case SV_WAND_DRAGON_FIRE:
3103 fire_ball(GF_FIRE, dir, 200, -3);
3108 case SV_WAND_DRAGON_COLD:
3110 fire_ball(GF_COLD, dir, 180, -3);
3115 case SV_WAND_DRAGON_BREATH:
3117 switch (randint1(5))
3121 fire_ball(GF_ACID, dir, 240, -3);
3127 fire_ball(GF_ELEC, dir, 210, -3);
3133 fire_ball(GF_FIRE, dir, 240, -3);
3139 fire_ball(GF_COLD, dir, 210, -3);
3145 fire_ball(GF_POIS, dir, 180, -3);
3154 case SV_WAND_DISINTEGRATE:
3156 fire_ball(GF_DISINTEGRATE, dir, 200 + randint1(p_ptr->lev * 2), 2);
3161 case SV_WAND_ROCKETS:
3164 msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡ª");
3166 msg_print("You launch a rocket!");
3169 fire_rocket(GF_ROCKET, dir, 250 + p_ptr->lev * 3, 2);
3174 case SV_WAND_STRIKING:
3176 fire_bolt(GF_METEOR, dir, damroll(15 + p_ptr->lev / 3, 13));
3181 case SV_WAND_GENOCIDE:
3183 fire_ball_hide(GF_GENOCIDE, dir, magic ? p_ptr->lev + 50 : 250, 0);
3193 * Aim a wand (from the pack or floor).
3195 * Use a single charge from a single item.
3196 * Handle "unstacking" in a logical manner.
3198 * For simplicity, you cannot use a stack of items from the
3199 * ground. This would require too much nasty code.
3201 * There are no wands which can "destroy" themselves, in the inventory
3202 * or on the ground, so we can ignore this possibility. Note that this
3203 * required giving "wand of wonder" the ability to ignore destruction
3204 * by electric balls.
3206 * All wands can be "cancelled" at the "Direction?" prompt for free.
3208 * Note that the basic "bolt" wands do slightly less damage than the
3209 * basic "bolt" rods, but the basic "ball" wands do the same damage
3210 * as the basic "ball" rods.
3212 static void do_cmd_aim_wand_aux(int item)
3214 int lev, ident, chance, dir;
3216 bool old_target_pet = target_pet;
3218 /* Get the item (in the pack) */
3221 o_ptr = &inventory[item];
3224 /* Get the item (on the floor) */
3227 o_ptr = &o_list[0 - item];
3230 /* Mega-Hack -- refuse to aim a pile from the ground */
3231 if ((item < 0) && (o_ptr->number > 1))
3234 msg_print("¤Þ¤º¤ÏËâË¡ËÀ¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
3236 msg_print("You must first pick up the wands.");
3243 /* Allow direction to be cancelled for free */
3244 if (object_aware_p(o_ptr) && (o_ptr->sval == SV_WAND_HEAL_MONSTER
3245 || o_ptr->sval == SV_WAND_HASTE_MONSTER))
3247 if (!get_aim_dir(&dir))
3249 target_pet = old_target_pet;
3252 target_pet = old_target_pet;
3258 lev = get_object_level(o_ptr);
3259 if (lev > 50) lev = 50 + (lev - 50)/2;
3261 /* Base chance of success */
3262 chance = p_ptr->skill_dev;
3264 /* Confusion hurts skill */
3265 if (p_ptr->confused) chance = chance / 2;
3267 /* Hight level objects are harder */
3268 chance = chance - lev;
3270 /* Give everyone a (slight) chance */
3271 if ((chance < USE_DEVICE) && one_in_(USE_DEVICE - chance + 1))
3273 chance = USE_DEVICE;
3278 if (flush_failure) flush();
3280 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3282 msg_print("Nothing happen. Maybe this wand is freezing too.");
3289 /* Roll for usage */
3290 if ((chance < USE_DEVICE) || (randint1(chance) < USE_DEVICE) || (p_ptr->pclass == CLASS_BERSERKER))
3292 if (flush_failure) flush();
3294 msg_print("ËâË¡ËÀ¤ò¤¦¤Þ¤¯»È¤¨¤Ê¤«¤Ã¤¿¡£");
3296 msg_print("You failed to use the wand properly.");
3303 /* The wand is already empty! */
3304 if (o_ptr->pval <= 0)
3306 if (flush_failure) flush();
3308 msg_print("¤³¤ÎËâË¡ËÀ¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£");
3310 msg_print("The wand has no charges left.");
3313 o_ptr->ident |= (IDENT_EMPTY);
3315 /* Combine / Reorder the pack (later) */
3316 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3317 p_ptr->window |= (PW_INVEN);
3325 ident = wand_effect(o_ptr->sval, dir, FALSE);
3327 /* Combine / Reorder the pack (later) */
3328 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3330 if (!(object_aware_p(o_ptr)))
3332 chg_virtue(V_PATIENCE, -1);
3333 chg_virtue(V_CHANCE, 1);
3334 chg_virtue(V_KNOWLEDGE, -1);
3337 /* Mark it as tried */
3338 object_tried(o_ptr);
3340 /* Apply identification */
3341 if (ident && !object_aware_p(o_ptr))
3343 object_aware(o_ptr);
3344 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
3348 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3351 /* Use a single charge */
3354 /* Describe the charges in the pack */
3357 inven_item_charges(item);
3360 /* Describe the charges on the floor */
3363 floor_item_charges(0 - item);
3368 void do_cmd_aim_wand(void)
3373 /* Restrict choices to wands */
3374 item_tester_tval = TV_WAND;
3376 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
3378 set_action(ACTION_NONE);
3383 q = "¤É¤ÎËâË¡ËÀ¤ÇÁÀ¤¤¤Þ¤¹¤«? ";
3384 s = "»È¤¨¤ëËâË¡ËÀ¤¬¤Ê¤¤¡£";
3386 q = "Aim which wand? ";
3387 s = "You have no wand to aim.";
3390 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
3393 do_cmd_aim_wand_aux(item);
3397 static int rod_effect(int sval, int dir, bool *use_charge, bool magic)
3401 /* Analyze the rod */
3404 case SV_ROD_DETECT_TRAP:
3406 if (detect_traps(DETECT_RAD_DEFAULT, (bool)(dir ? FALSE : TRUE))) ident = TRUE;
3410 case SV_ROD_DETECT_DOOR:
3412 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
3413 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
3417 case SV_ROD_IDENTIFY:
3419 if (!ident_spell(FALSE)) *use_charge = FALSE;
3426 if (!word_of_recall()) *use_charge = FALSE;
3431 case SV_ROD_ILLUMINATION:
3433 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
3437 case SV_ROD_MAPPING:
3439 map_area(DETECT_RAD_MAP);
3444 case SV_ROD_DETECTION:
3446 detect_all(DETECT_RAD_DEFAULT);
3451 case SV_ROD_PROBING:
3460 if (set_blind(0)) ident = TRUE;
3461 if (set_poisoned(0)) ident = TRUE;
3462 if (set_confused(0)) ident = TRUE;
3463 if (set_stun(0)) ident = TRUE;
3464 if (set_cut(0)) ident = TRUE;
3465 if (set_image(0)) ident = TRUE;
3466 if (set_shero(0,TRUE)) ident = TRUE;
3470 case SV_ROD_HEALING:
3472 if (hp_player(500)) ident = TRUE;
3473 if (set_stun(0)) ident = TRUE;
3474 if (set_cut(0)) ident = TRUE;
3475 if (set_shero(0,TRUE)) ident = TRUE;
3479 case SV_ROD_RESTORATION:
3481 if (restore_level()) ident = TRUE;
3482 if (do_res_stat(A_STR)) ident = TRUE;
3483 if (do_res_stat(A_INT)) ident = TRUE;
3484 if (do_res_stat(A_WIS)) ident = TRUE;
3485 if (do_res_stat(A_DEX)) ident = TRUE;
3486 if (do_res_stat(A_CON)) ident = TRUE;
3487 if (do_res_stat(A_CHR)) ident = TRUE;
3493 if (set_fast(randint1(30) + 15, FALSE)) ident = TRUE;
3497 case SV_ROD_PESTICIDE:
3499 if (dispel_monsters(4)) ident = TRUE;
3503 case SV_ROD_TELEPORT_AWAY:
3505 if (teleport_monster(dir)) ident = TRUE;
3509 case SV_ROD_DISARMING:
3511 if (disarm_trap(dir)) ident = TRUE;
3518 msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3520 msg_print("A line of blue shimmering light appears.");
3523 (void)lite_line(dir);
3528 case SV_ROD_SLEEP_MONSTER:
3530 if (sleep_monster(dir)) ident = TRUE;
3534 case SV_ROD_SLOW_MONSTER:
3536 if (slow_monster(dir)) ident = TRUE;
3540 case SV_ROD_DRAIN_LIFE:
3542 if (drain_life(dir, 70 + 3 * p_ptr->lev / 2)) ident = TRUE;
3546 case SV_ROD_POLYMORPH:
3548 if (poly_monster(dir)) ident = TRUE;
3552 case SV_ROD_ACID_BOLT:
3554 fire_bolt_or_beam(10, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
3559 case SV_ROD_ELEC_BOLT:
3561 fire_bolt_or_beam(10, GF_ELEC, dir, damroll(4 + p_ptr->lev / 9, 8));
3566 case SV_ROD_FIRE_BOLT:
3568 fire_bolt_or_beam(10, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
3573 case SV_ROD_COLD_BOLT:
3575 fire_bolt_or_beam(10, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
3580 case SV_ROD_ACID_BALL:
3582 fire_ball(GF_ACID, dir, 60 + p_ptr->lev, 2);
3587 case SV_ROD_ELEC_BALL:
3589 fire_ball(GF_ELEC, dir, 40 + p_ptr->lev, 2);
3594 case SV_ROD_FIRE_BALL:
3596 fire_ball(GF_FIRE, dir, 70 + p_ptr->lev, 2);
3601 case SV_ROD_COLD_BALL:
3603 fire_ball(GF_COLD, dir, 50 + p_ptr->lev, 2);
3615 case SV_ROD_STONE_TO_MUD:
3617 if (wall_to_mud(dir)) ident = TRUE;
3621 case SV_ROD_AGGRAVATE:
3623 aggravate_monsters(0);
3632 * Activate (zap) a Rod
3634 * Unstack fully charged rods as needed.
3636 * Hack -- rods of perception/genocide can be "cancelled"
3637 * All rods can be cancelled at the "Direction?" prompt
3639 * pvals are defined for each rod in k_info. -LM-
3641 static void do_cmd_zap_rod_aux(int item)
3643 int ident, chance, lev, fail;
3648 /* Hack -- let perception get aborted */
3649 bool use_charge = TRUE;
3653 /* Get the item (in the pack) */
3656 o_ptr = &inventory[item];
3659 /* Get the item (on the floor) */
3662 o_ptr = &o_list[0 - item];
3666 /* Mega-Hack -- refuse to zap a pile from the ground */
3667 if ((item < 0) && (o_ptr->number > 1))
3670 msg_print("¤Þ¤º¤Ï¥í¥Ã¥É¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
3672 msg_print("You must first pick up the rods.");
3679 /* Get a direction (unless KNOWN not to need it) */
3680 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)) ||
3681 !object_aware_p(o_ptr))
3683 /* Get a direction, allow cancel */
3684 if (!get_aim_dir(&dir)) return;
3691 /* Extract the item level */
3692 lev = get_object_level(o_ptr);
3694 /* Base chance of success */
3695 chance = p_ptr->skill_dev;
3697 /* Confusion hurts skill */
3698 if (p_ptr->confused) chance = chance / 2;
3701 if (chance > fail) fail -= (chance - fail)*2;
3702 else chance -= (fail - chance)*2;
3703 if (fail < USE_DEVICE) fail = USE_DEVICE;
3704 if (chance < USE_DEVICE) chance = USE_DEVICE;
3708 if (flush_failure) flush();
3710 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3712 msg_print("Nothing happen. Maybe this rod is freezing too.");
3719 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
3720 else if (chance > fail)
3722 if (randint0(chance*2) < fail) success = FALSE;
3723 else success = TRUE;
3727 if (randint0(fail*2) < chance) success = TRUE;
3728 else success = FALSE;
3731 /* Roll for usage */
3734 if (flush_failure) flush();
3736 msg_print("¤¦¤Þ¤¯¥í¥Ã¥É¤ò»È¤¨¤Ê¤«¤Ã¤¿¡£");
3738 msg_print("You failed to use the rod properly.");
3745 k_ptr = &k_info[o_ptr->k_idx];
3747 /* A single rod is still charging */
3748 if ((o_ptr->number == 1) && (o_ptr->timeout))
3750 if (flush_failure) flush();
3752 msg_print("¤³¤Î¥í¥Ã¥É¤Ï¤Þ¤ÀËâÎϤò½¼Å¶¤·¤Æ¤¤¤ëºÇÃæ¤À¡£");
3754 msg_print("The rod is still charging.");
3759 /* A stack of rods lacks enough energy. */
3760 else if ((o_ptr->number > 1) && (o_ptr->timeout > k_ptr->pval * (o_ptr->number - 1)))
3762 if (flush_failure) flush();
3764 msg_print("¤½¤Î¥í¥Ã¥É¤Ï¤Þ¤À½¼Å¶Ãæ¤Ç¤¹¡£");
3766 msg_print("The rods are all still charging.");
3775 ident = rod_effect(o_ptr->sval, dir, &use_charge, FALSE);
3777 /* Increase the timeout by the rod kind's pval. -LM- */
3778 if (use_charge) o_ptr->timeout += k_ptr->pval;
3780 /* Combine / Reorder the pack (later) */
3781 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3783 if (!(object_aware_p(o_ptr)))
3785 chg_virtue(V_PATIENCE, -1);
3786 chg_virtue(V_CHANCE, 1);
3787 chg_virtue(V_KNOWLEDGE, -1);
3790 /* Tried the object */
3791 object_tried(o_ptr);
3793 /* Successfully determined the object function */
3794 if (ident && !object_aware_p(o_ptr))
3796 object_aware(o_ptr);
3797 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
3801 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3805 void do_cmd_zap_rod(void)
3810 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
3812 set_action(ACTION_NONE);
3815 /* Restrict choices to rods */
3816 item_tester_tval = TV_ROD;
3820 q = "¤É¤Î¥í¥Ã¥É¤ò¿¶¤ê¤Þ¤¹¤«? ";
3821 s = "»È¤¨¤ë¥í¥Ã¥É¤¬¤Ê¤¤¡£";
3823 q = "Zap which rod? ";
3824 s = "You have no rod to zap.";
3827 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
3830 do_cmd_zap_rod_aux(item);
3835 * Hook to determine if an object is activatable
3837 static bool item_tester_hook_activate(object_type *o_ptr)
3839 u32b flgs[TR_FLAG_SIZE];
3842 if (!object_known_p(o_ptr)) return (FALSE);
3844 /* Extract the flags */
3845 object_flags(o_ptr, flgs);
3847 /* Check activation flag */
3848 if (have_flag(flgs, TR_ACTIVATE)) return (TRUE);
3856 * Hack -- activate the ring of power
3858 void ring_of_power(int dir)
3860 /* Pick a random effect */
3861 switch (randint1(10))
3868 msg_print("¤¢¤Ê¤¿¤Ï°À¤Î¥ª¡¼¥é¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡£");
3870 msg_print("You are surrounded by a malignant aura.");
3875 /* Decrease all stats (permanently) */
3876 (void)dec_stat(A_STR, 50, TRUE);
3877 (void)dec_stat(A_INT, 50, TRUE);
3878 (void)dec_stat(A_WIS, 50, TRUE);
3879 (void)dec_stat(A_DEX, 50, TRUE);
3880 (void)dec_stat(A_CON, 50, TRUE);
3881 (void)dec_stat(A_CHR, 50, TRUE);
3883 /* Lose some experience (permanently) */
3884 p_ptr->exp -= (p_ptr->exp / 4);
3885 p_ptr->max_exp -= (p_ptr->exp / 4);
3895 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥª¡¼¥é¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡£");
3897 msg_print("You are surrounded by a powerful aura.");
3901 /* Dispel monsters */
3902 dispel_monsters(1000);
3912 fire_ball(GF_MANA, dir, 600, 3);
3923 fire_bolt(GF_MANA, dir, 500);
3931 static bool ang_sort_comp_pet(vptr u, vptr v, int a, int b)
3933 u16b *who = (u16b*)(u);
3938 monster_type *m_ptr1 = &m_list[w1];
3939 monster_type *m_ptr2 = &m_list[w2];
3940 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
3941 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
3943 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
3944 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
3946 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
3947 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
3949 if (r_ptr1->level > r_ptr2->level) return TRUE;
3950 if (r_ptr2->level > r_ptr1->level) return FALSE;
3952 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
3953 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
3959 * Activate a wielded object. Wielded objects never stack.
3960 * And even if they did, activatable objects never stack.
3962 * Currently, only (some) artifacts, and Dragon Scale Mail, can be activated.
3963 * But one could, for example, easily make an activatable "Ring of Plasma".
3965 * Note that it always takes a turn to activate an artifact, even if
3966 * the user hits "escape" at the "direction" prompt.
3968 static void do_cmd_activate_aux(int item)
3970 int k, dir, lev, chance, fail;
3975 /* Get the item (in the pack) */
3978 o_ptr = &inventory[item];
3981 /* Get the item (on the floor) */
3984 o_ptr = &o_list[0 - item];
3990 /* Extract the item level */
3991 lev = get_object_level(o_ptr);
3993 /* Hack -- use artifact level instead */
3994 if (artifact_p(o_ptr)) lev = a_info[o_ptr->name1].level;
3995 else if (o_ptr->art_name)
3997 switch (o_ptr->xtra2)
4005 case ACT_CURE_POISON:
4025 case ACT_RESIST_ALL:
4026 case ACT_DETECT_ALL:
4039 case ACT_BANISH_EVIL:
4047 case ACT_CHARM_ANIMAL:
4048 case ACT_SUMMON_ANIMAL:
4051 case ACT_XTRA_SPEED:
4052 case ACT_DETECT_XTRA:
4060 case ACT_CHARM_UNDEAD:
4061 case ACT_CHARM_OTHER:
4062 case ACT_SUMMON_PHANTOM:
4063 case ACT_SUMMON_ELEMENTAL:
4064 case ACT_RUNE_EXPLO:
4068 case ACT_CHARM_ANIMALS:
4069 case ACT_CHARM_OTHERS:
4076 case ACT_CALL_CHAOS:
4081 case ACT_SUMMON_UNDEAD:
4082 case ACT_SUMMON_DEMON:
4093 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
4095 /* Base chance of success */
4096 chance = p_ptr->skill_dev;
4098 /* Confusion hurts skill */
4099 if (p_ptr->confused) chance = chance / 2;
4102 if (chance > fail) fail -= (chance - fail)*2;
4103 else chance -= (fail - chance)*2;
4104 if (fail < USE_DEVICE) fail = USE_DEVICE;
4105 if (chance < USE_DEVICE) chance = USE_DEVICE;
4109 if (flush_failure) flush();
4111 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
4113 msg_print("It shows no reaction.");
4120 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
4121 else if (chance > fail)
4123 if (randint0(chance*2) < fail) success = FALSE;
4124 else success = TRUE;
4128 if (randint0(fail*2) < chance) success = TRUE;
4129 else success = FALSE;
4132 /* Roll for usage */
4135 if (flush_failure) flush();
4137 msg_print("¤¦¤Þ¤¯»ÏÆ°¤µ¤»¤ë¤³¤È¤¬¤Ç¤¤Ê¤«¤Ã¤¿¡£");
4139 msg_print("You failed to activate it properly.");
4146 /* Check the recharge */
4150 msg_print("¤½¤ì¤ÏÈù¤«¤Ë²»¤òΩ¤Æ¡¢µ±¤¡¢¾Ã¤¨¤¿...");
4152 msg_print("It whines, glows and fades...");
4159 /* Activate the artifact */
4161 msg_print("»ÏÆ°¤µ¤»¤¿...");
4163 msg_print("You activate it...");
4171 if (o_ptr->art_name && o_ptr->xtra2)
4173 (void)activate_random_artifact(o_ptr);
4176 p_ptr->window |= (PW_INVEN | PW_EQUIP);
4183 else if (o_ptr->name1)
4186 switch (o_ptr->name1)
4191 msg_print("ààÎÜÉÓ¤«¤éÀ¡¤ó¤À¸÷¤¬¤¢¤Õ¤ì½Ð¤¿...");
4193 msg_print("The phial wells with clear light...");
4196 lite_area(damroll(2, 15), 3);
4197 o_ptr->timeout = randint0(10) + 10;
4204 msg_print("À±¤¬âÁ¤·¤¯µ±¤¤¤¿...");
4206 msg_print("The star shines brightly...");
4209 map_area(DETECT_RAD_MAP);
4210 lite_area(damroll(2, 15), 3);
4211 o_ptr->timeout = randint0(50) + 50;
4218 msg_print("¤½¤ÎÊõÀФÏÀÖ¤¯ÌÀ¤ë¤¯¸÷¤Ã¤¿¡ª");
4220 msg_print("The Jewel flashes bright red!");
4223 chg_virtue(V_KNOWLEDGE, 1);
4224 chg_virtue(V_ENLIGHTEN, 1);
4225 wiz_lite(FALSE, FALSE);
4227 msg_print("¤½¤ÎÊõÀФϤ¢¤Ê¤¿¤ÎÂÎÎϤòÃ¥¤Ã¤¿...");
4228 take_hit(DAMAGE_LOSELIFE, damroll(3,8), "¿³È½¤ÎÊõÀÐ", -1);
4230 msg_print("The Jewel drains your vitality...");
4231 take_hit(DAMAGE_LOSELIFE, damroll(3, 8), "the Jewel of Judgement", -1);
4234 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
4235 (void)detect_doors(DETECT_RAD_DEFAULT);
4236 (void)detect_stairs(DETECT_RAD_DEFAULT);
4239 if (get_check("µ¢´Ô¤ÎÎϤò»È¤¤¤Þ¤¹¤«¡©"))
4241 if (get_check("Activate recall? "))
4245 (void)word_of_recall();
4248 o_ptr->timeout = randint0(20) + 20;
4255 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
4257 msg_print("The amulet lets out a shrill wail...");
4261 (void)set_protevil(randint1(25) + k, FALSE);
4262 o_ptr->timeout = randint0(225) + 225;
4269 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
4271 msg_print("The amulet floods the area with goodness...");
4274 dispel_evil(p_ptr->lev * 5);
4275 o_ptr->timeout = randint0(200) + 200;
4282 msg_print("¶À¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
4284 msg_print("The mirror floods the area with goodness...");
4287 dispel_evil(p_ptr->lev * 5);
4288 o_ptr->timeout = randint0(200) + 200;
4295 msg_print("¤¢¤Ê¤¿¤Ï¥Õ¥é¥¥¢¤ËŨ¤òÄù¤á»¦¤¹¤è¤¦Ì¿¤¸¤¿¡£");
4297 msg_print("You order Frakir to strangle your opponent.");
4300 if (!get_aim_dir(&dir)) return;
4301 if (drain_life(dir, 100))
4302 o_ptr->timeout = randint0(100) + 100;
4309 msg_print("»ØÎؤÏÌÀ¤ë¤¯µ±¤¤¤¿...");
4311 msg_print("The ring glows brightly...");
4314 (void)set_fast(randint1(75) + 75, FALSE);
4315 o_ptr->timeout = randint0(150) + 150;
4322 msg_print("»ØÎؤϿ¼¹È¤Ëµ±¤¤¤¿...");
4324 msg_print("The ring glows deep red...");
4327 if (!get_aim_dir(&dir)) return;
4328 fire_ball(GF_FIRE, dir, 300, 3);
4329 o_ptr->timeout = randint0(225) + 225;
4336 msg_print("»ØÎؤÏÇò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4338 msg_print("The ring glows bright white...");
4341 if (!get_aim_dir(&dir)) return;
4342 fire_ball(GF_COLD, dir, 400, 3);
4343 o_ptr->timeout = randint0(325) + 325;
4351 msg_format("%s¤Ï¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...", o_ptr->name1 == ART_VILYA ? "»ØÎØ" : "¥½¡¼¥É");
4353 msg_format("The %s glows deep blue...", o_ptr->name1 == ART_VILYA ? "ring" : "sword");
4356 if (!get_aim_dir(&dir)) return;
4357 fire_ball(GF_ELEC, dir, 500, 3);
4358 o_ptr->timeout = randint0(425) + 425;
4366 msg_print("»ØÎؤϼ¿¹õ¤Ëµ±¤¤¤¿...");
4368 msg_print("The ring glows intensely black...");
4371 if (!get_aim_dir(&dir)) return;
4373 o_ptr->timeout = randint0(450) + 450;
4379 int num = damroll(5, 3);
4384 msg_print("³»¤¬°ðºÊ¤Çʤ¤ï¤ì¤¿...");
4386 msg_print("Your armor is surrounded by lightning...");
4390 for (k = 0; k < num; k++)
4396 scatter(&y, &x, py, px, 4, 0);
4398 if (!cave_floor_bold(y, x)) continue;
4400 if ((y != py) || (x != px)) break;
4403 project(0, 3, y, x, 150, GF_ELEC,
4404 (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
4407 o_ptr->timeout = 1000;
4411 case ART_BLADETURNER:
4413 if (!get_aim_dir(&dir)) return;
4415 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
4417 msg_print("You breathe the elements.");
4420 fire_ball(GF_MISSILE, dir, 300, 4);
4422 msg_print("³»¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...");
4424 msg_print("Your armor glows many colours...");
4427 (void)set_afraid(0);
4428 (void)set_hero(randint1(50) + 50, FALSE);
4429 (void)hp_player(10);
4430 (void)set_blessed(randint1(50) + 50, FALSE);
4431 (void)set_oppose_acid(randint1(50) + 50, FALSE);
4432 (void)set_oppose_elec(randint1(50) + 50, FALSE);
4433 (void)set_oppose_fire(randint1(50) + 50, FALSE);
4434 (void)set_oppose_cold(randint1(50) + 50, FALSE);
4435 (void)set_oppose_pois(randint1(50) + 50, FALSE);
4436 o_ptr->timeout = 400;
4440 case ART_SOULKEEPER:
4443 msg_print("³»¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4444 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬¤è¤¤...");
4446 msg_print("Your armor glows a bright white...");
4447 msg_print("You feel much better...");
4450 (void)hp_player(1000);
4452 o_ptr->timeout = 888;
4459 msg_print("Å·¹ñ¤Î²Î¤¬Ê¹¤³¤¨¤ë...");
4461 msg_print("A heavenly choir sings...");
4464 (void)set_poisoned(0);
4467 (void)set_confused(0);
4469 (void)set_hero(randint1(25) + 25, FALSE);
4470 (void)hp_player(777);
4471 o_ptr->timeout = 300;
4478 msg_print("³»¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4480 msg_print("Your armor glows deep blue...");
4483 (void)symbol_genocide(200, TRUE);
4484 o_ptr->timeout = 500;
4491 msg_print("³»¤¬ÀÖ¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4493 msg_print("Your armor glows bright red...");
4496 destroy_doors_touch();
4497 o_ptr->timeout = 10;
4505 turn_monsters(40 + p_ptr->lev);
4506 o_ptr->timeout = 3 * (p_ptr->lev + 10);
4511 case ART_HOLHENNETH:
4514 msg_print("¥Ø¥ë¥á¥Ã¥È¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4515 msg_print("¿´¤Ë¥¤¥á¡¼¥¸¤¬É⤫¤ó¤Ç¤¤¿...");
4517 msg_print("Your helm glows bright white...");
4518 msg_print("An image forms in your mind...");
4521 detect_all(DETECT_RAD_DEFAULT);
4522 o_ptr->timeout = randint0(55) + 55;
4529 msg_print("²¦´§¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4530 msg_print("ÂÎÆâ¤ËÃȤ«¤¤¸ÝÆ°¤¬´¶¤¸¤é¤ì¤ë...");
4532 msg_print("Your crown glows deep blue...");
4533 msg_print("You feel a warm tingling inside...");
4536 (void)hp_player(700);
4538 o_ptr->timeout = 250;
4546 msg_format("%s¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...", o_ptr->name1 == ART_COLLUIN ? "¥¯¥í¡¼¥¯" : "³»");
4548 msg_format("Your %s glows many colours...", o_ptr->name1 == ART_COLLUIN ? "cloak" : "armor");
4551 (void)set_oppose_acid(randint1(20) + 20, FALSE);
4552 (void)set_oppose_elec(randint1(20) + 20, FALSE);
4553 (void)set_oppose_fire(randint1(20) + 20, FALSE);
4554 (void)set_oppose_cold(randint1(20) + 20, FALSE);
4555 (void)set_oppose_pois(randint1(20) + 20, FALSE);
4556 o_ptr->timeout = 111;
4560 case ART_HOLCOLLETH:
4563 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4565 msg_print("Your cloak glows deep blue...");
4568 sleep_monsters_touch();
4569 o_ptr->timeout = 55;
4576 msg_print("¥¯¥í¡¼¥¯¤¬²«¿§¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4578 msg_print("Your cloak glows bright yellow...");
4582 o_ptr->timeout = 70;
4589 msg_print("¥¯¥í¡¼¥¯¤¬ÊÕ¤ê¤Î¶õ´Ö¤ò¤æ¤¬¤Þ¤»¤¿...");
4591 msg_print("Your cloak twists space around you...");
4594 teleport_player(100);
4595 o_ptr->timeout = 45;
4602 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4604 msg_print("Your cloak glows a deep red...");
4608 o_ptr->timeout = 450;
4612 case ART_CAMMITHRIM:
4615 msg_print("¥°¥í¡¼¥Ö¤¬âÁ¤·¤¤¤¯¤é¤¤¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4617 msg_print("Your gloves glow extremely brightly...");
4620 if (!get_aim_dir(&dir)) return;
4621 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
4629 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4631 msg_print("Your gauntlets are covered in fire...");
4634 if (!get_aim_dir(&dir)) return;
4635 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4636 o_ptr->timeout = randint0(8) + 8;
4640 case ART_PAURNIMMEN:
4643 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4645 msg_print("Your gauntlets are covered in frost...");
4648 if (!get_aim_dir(&dir)) return;
4649 fire_bolt(GF_COLD, dir, damroll(6, 8));
4650 o_ptr->timeout = randint0(7) + 7;
4657 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4659 msg_print("Your gauntlets are covered in sparks...");
4662 if (!get_aim_dir(&dir)) return;
4663 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4664 o_ptr->timeout = randint0(5) + 5;
4671 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬»À¤Ëʤ¤ï¤ì¤¿...");
4673 msg_print("Your gauntlets are covered in acid...");
4676 if (!get_aim_dir(&dir)) return;
4677 fire_bolt(GF_ACID, dir, damroll(5, 8));
4678 o_ptr->timeout = randint0(6) + 6;
4685 msg_print("¥»¥¹¥¿¥¹¤ËËâË¡¤Î¥È¥²¤¬¸½¤ì¤¿...");
4687 msg_print("Your cesti grows magical spikes...");
4690 if (!get_aim_dir(&dir)) return;
4691 fire_bolt(GF_ARROW, dir, 150);
4692 o_ptr->timeout = randint0(90) + 90;
4699 msg_print("¥Ö¡¼¥Ä¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4701 msg_print("Your boots glow bright green...");
4704 (void)set_fast(randint1(20) + 20, FALSE);
4705 o_ptr->timeout = 200;
4712 msg_print("¥Ö¡¼¥Ä¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4714 msg_print("Your boots glow deep blue...");
4717 (void)set_afraid(0);
4718 (void)set_poisoned(0);
4726 msg_print("¥À¥¬¡¼¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4728 msg_print("Your dagger is covered in fire...");
4731 if (!get_aim_dir(&dir)) return;
4732 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4733 o_ptr->timeout = randint0(8) + 8;
4740 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4742 msg_print("Your dagger is covered in frost...");
4745 if (!get_aim_dir(&dir)) return;
4746 fire_bolt(GF_COLD, dir, damroll(6, 8));
4747 o_ptr->timeout = randint0(7) + 7;
4754 msg_print("¥À¥¬¡¼¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4756 msg_print("Your dagger is covered in sparks...");
4759 if (!get_aim_dir(&dir)) return;
4760 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4761 o_ptr->timeout = randint0(5) + 5;
4768 msg_print("¥À¥¬¡¼¤¬¿¼¤¤Îп§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4770 msg_print("Your dagger throbs deep green...");
4773 if (!get_aim_dir(&dir)) return;
4774 fire_ball(GF_POIS, dir, 12, 3);
4775 o_ptr->timeout = randint0(4) + 4;
4782 msg_print("Ì·¤¬¿¼¤¤ÀÄ¿§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4784 msg_print("Your dagger throbs deep blue...");
4787 if (!get_aim_dir(&dir)) return;
4788 fire_ball(GF_WATER, dir, 200, 3);
4789 o_ptr->timeout = 250;
4796 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4798 msg_print("Your dagger is covered in frost...");
4801 if (!get_aim_dir(&dir)) return;
4802 fire_ball(GF_COLD, dir, 48, 2);
4803 o_ptr->timeout = randint0(5) + 5;
4808 case ART_WEREWINDLE:
4810 switch (randint1(13))
4812 case 1: case 2: case 3: case 4: case 5:
4813 teleport_player(10);
4815 case 6: case 7: case 8: case 9: case 10:
4816 teleport_player(222);
4819 (void)stair_creation();
4823 if (get_check("¤³¤Î³¬¤òµî¤ê¤Þ¤¹¤«¡©"))
4825 if (get_check("Leave this level? "))
4829 if (autosave_l) do_cmd_save_game(TRUE);
4832 p_ptr->leaving = TRUE;
4835 o_ptr->timeout = 35;
4841 teleport_player(222);
4842 o_ptr->timeout = 25;
4849 msg_print("¥½¡¼¥É¤¬ÀĤ¯·ã¤·¤¯µ±¤¤¤¿...");
4851 msg_print("Your sword glows an intense blue...");
4854 if (!get_aim_dir(&dir)) return;
4855 fire_ball(GF_COLD, dir, 100, 2);
4856 o_ptr->timeout = 200;
4863 msg_print("¶Ç¤Î»ÕÃĤò¾¤´¤·¤¿¡£");
4865 msg_print("You summon the Legion of the Dawn.");
4868 (void)summon_specific(-1, py, px, dun_level, SUMMON_DAWN, (PM_ALLOW_GROUP | PM_FORCE_PET));
4869 o_ptr->timeout = 500 + randint1(500);
4876 msg_print("¥½¡¼¥É¤¬ÀÖ¤¯·ã¤·¤¯µ±¤¤¤¿...");
4878 msg_print("Your sword glows an intense red...");
4881 if (!get_aim_dir(&dir)) return;
4882 fire_ball(GF_FIRE, dir, 72, 2);
4883 o_ptr->timeout = 400;
4890 msg_print("¥¢¥Ã¥¯¥¹¤Î¿Ï¤¬¹õ¤¯µ±¤¤¤¿...");
4892 msg_print("Your axe blade glows black...");
4895 if (!get_aim_dir(&dir)) return;
4896 drain_life(dir, 120);
4897 o_ptr->timeout = 400;
4904 msg_print("¤¢¤Ê¤¿¤ÎÁä¤ÏÅŵ¤¤Ç¥¹¥Ñ¡¼¥¯¤·¤Æ¤¤¤ë...");
4906 msg_print("Your spear crackles with electricity...");
4909 if (!get_aim_dir(&dir)) return;
4910 fire_ball(GF_ELEC, dir, 100, 3);
4911 o_ptr->timeout = 200;
4918 msg_print("¥¹¥Ô¥¢¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4920 msg_print("Your spear glows a bright white...");
4923 if (!get_aim_dir(&dir)) return;
4924 fire_ball(GF_COLD, dir, 100, 3);
4925 o_ptr->timeout = 200;
4932 msg_print("¥¹¥Ô¥¢¤¬¸ÝÆ°¤·¤¿...");
4934 msg_print("Your spear pulsates...");
4937 if (!get_aim_dir(&dir)) return;
4946 msg_print("¤Ä¤ë¤Ï¤·¤¬¸ÝÆ°¤·¤¿...");
4948 msg_print("Your mattock pulsates...");
4951 if (!get_aim_dir(&dir)) return;
4960 msg_print("¥¢¥Ã¥¯¥¹¤«¤é¤Ò¤É¤¯±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
4962 msg_print("Your axe lets out a long, shrill note...");
4965 (void)mass_genocide(200, TRUE);
4966 o_ptr->timeout = 1000;
4973 msg_print("¥Ð¥È¥ë¡¦¥¢¥Ã¥¯¥¹¤¬¿¼»ç¤Î¸÷¤òÊü¼Í¤·¤¿...");
4975 msg_print("Your battle axe radiates deep purple...");
4978 hp_player(damroll(4, 8));
4979 (void)set_cut((p_ptr->cut / 2) - 50);
4980 o_ptr->timeout = randint0(3) + 3;
4987 msg_print("¥È¥é¥¤¥Ç¥ó¥È¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4989 msg_print("Your trident glows deep red...");
4992 if (!get_aim_dir(&dir)) return;
4993 teleport_monster(dir);
4994 o_ptr->timeout = 150;
5001 msg_print("Âç³ù¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
5003 msg_print("Your scythe glows soft white...");
5005 if (!word_of_recall()) return;
5006 o_ptr->timeout = 200;
5013 msg_print("¸û¶Ì¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
5015 msg_print("Your scythe glows soft white...");
5017 if (!word_of_recall()) return;
5018 o_ptr->timeout = 200;
5025 msg_print("¥Õ¥ì¥¤¥ë¤¬ÍÍ¡¹¤Ê¿§¤Î²Ð²Ö¤òȯ¤·¤¿...");
5027 msg_print("Your flail glows in scintillating colours...");
5030 if (!get_aim_dir(&dir)) return;
5031 confuse_monster(dir, 20);
5032 o_ptr->timeout = 15;
5039 msg_print("¥â¡¼¥Ë¥ó¥°¥¹¥¿¡¼¤«¤é±ê¤¬¿á¤½Ð¤·¤¿...");
5041 msg_print("Your morning star rages in fire...");
5044 if (!get_aim_dir(&dir)) return;
5045 fire_ball(GF_FIRE, dir, 72, 3);
5046 o_ptr->timeout = 100;
5053 msg_print("¥à¥Á¤¬¿¼¤¤ÀÖ¿§¤Ëµ±¤¤¤¿...");
5055 msg_print("Your whip glows deep red...");
5058 if (!get_aim_dir(&dir)) return;
5059 fire_ball(GF_FIRE, dir, 120, 3);
5060 o_ptr->timeout = 15;
5067 msg_print("¥á¥¤¥¹¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
5069 msg_print("Your mace glows bright green...");
5072 (void)set_fast(randint1(20) + 20, FALSE);
5073 o_ptr->timeout = randint0(100) + 100;
5080 msg_print("¥¯¥©¡¼¥¿¡¼¥¹¥¿¥Ã¥Õ¤¬²«¿§¤¯µ±¤¤¤¿...");
5082 msg_print("Your quarterstaff glows yellow...");
5085 if (!ident_spell(FALSE)) return;
5086 o_ptr->timeout = 10;
5093 msg_print("¾ó¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
5095 msg_print("Your quarterstaff glows brightly...");
5098 detect_all(DETECT_RAD_DEFAULT);
5100 identify_fully(FALSE);
5101 o_ptr->timeout = 1000;
5108 msg_print("¥Ï¥ó¥Þ¡¼¤¬Çò¤¯µ±¤¤¤¿...");
5110 msg_print("Your hammer glows white...");
5113 if (!get_aim_dir(&dir)) return;
5114 drain_life(dir, 90);
5115 o_ptr->timeout = 70;
5122 msg_print("¥¯¥í¥¹¥Ü¥¦¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
5124 msg_print("Your crossbow glows deep red...");
5127 (void)brand_bolts();
5128 o_ptr->timeout = 999;
5135 int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
5138 msg_print("¤»¤Ã¤«¤¯¤À¤«¤é¡Ø¥¯¥ê¥à¥¾¥ó¡Ù¤ò¤Ö¤Ã¤Ñ¤Ê¤¹¤¼¡ª");
5140 msg_print("I'll fire CRIMSON! SEKKAKUDAKARA!");
5143 if (!get_aim_dir(&dir)) return;
5145 /* Use the given direction */
5146 tx = px + 99 * ddx[dir];
5147 ty = py + 99 * ddy[dir];
5149 /* Hack -- Use an actual "target" */
5150 if ((dir == 5) && target_okay())
5156 if (p_ptr->pclass == CLASS_ARCHER)
5158 /* Extra shot at level 10 */
5159 if (p_ptr->lev >= 10) num++;
5161 /* Extra shot at level 30 */
5162 if (p_ptr->lev >= 30) num++;
5164 /* Extra shot at level 45 */
5165 if (p_ptr->lev >= 45) num++;
5168 for (i = 0; i < num; i++)
5169 project(0, p_ptr->lev/20+1, ty, tx, p_ptr->lev*p_ptr->lev*6/50, GF_ROCKET, flg, -1);
5170 o_ptr->timeout = 15;
5175 monster_type *m_ptr;
5176 monster_race *r_ptr;
5180 msg_print("´ñ̯¤Ê¾ì½ê¤¬Æ¬¤ÎÃæ¤ËÉ⤫¤ó¤À¡¥¡¥¡¥");
5182 msg_print("Some strange places show up in your mind. And you see ...");
5185 /* Process the monsters (backwards) */
5186 for (i = m_max - 1; i >= 1; i--)
5188 /* Access the monster */
5191 /* Ignore "dead" monsters */
5192 if (!m_ptr->r_idx) continue;
5194 r_ptr = &r_info[m_ptr->r_idx];
5196 if(r_ptr->flags1 & RF1_UNIQUE)
5199 msg_format("%s¡¥ ",r_name + r_ptr->name);
5201 msg_format("%s. ",r_name + r_ptr->name);
5205 o_ptr->timeout = 200;
5209 case ART_STONE_LORE:
5212 msg_print("ÀФ¬±£¤µ¤ì¤¿ÈëÌ©¤ò¼Ì¤·½Ð¤·¤¿¡¥¡¥¡¥");
5214 msg_print("The stone reveals hidden mysteries...");
5216 if (!ident_spell(FALSE)) return;
5218 if (mp_ptr->spell_book)
5220 /* Sufficient mana */
5221 if (20 <= p_ptr->csp)
5227 /* Over-exert the player */
5230 int oops = 20 - p_ptr->csp;
5234 p_ptr->csp_frac = 0;
5238 msg_print("ÀФòÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
5240 msg_print("You are too weak to control the stone!");
5243 /* Hack -- Bypass free action */
5244 (void)set_paralyzed(p_ptr->paralyzed +
5245 randint1(5 * oops + 1));
5248 (void)set_confused(p_ptr->confused +
5249 randint1(5 * oops + 1));
5253 p_ptr->redraw |= (PR_MANA);
5257 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "´í¸±¤ÊÈëÌ©", -1);
5259 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "perilous secrets", -1);
5263 if (one_in_(5)) (void)set_confused(p_ptr->confused +
5266 /* Exercise a little care... */
5269 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "´í¸±¤ÊÈëÌ©", -1);
5271 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "perilous secrets", -1);
5279 msg_print("You wind a mighty blast; your enemies tremble!");
5280 (void)turn_monsters((3 * p_ptr->lev / 2) + 10);
5281 o_ptr->timeout = randint0(40) + 40;
5287 msg_print("¤¢¤Ê¤¿¤Ï³²Ãî¤ò°ìÁݤ·¤¿¡£");
5289 msg_print("You exterminate small life.");
5291 (void)dispel_monsters(4);
5292 o_ptr->timeout = randint0(55) + 55;
5299 msg_print("Æߤ¤²»¤¬ÊÕ¤ê¤òÊñ¤ß¤³¤ó¤À¡£");
5301 msg_print("A shrill wailing sound surrounds you.");
5303 (void)set_protevil(randint1(25) + p_ptr->lev, FALSE);
5304 o_ptr->timeout = randint0(200) + 200;
5312 msg_print("¥í¡¼¥Ö¤¬½ã¿è¤ÊËâÎϤǿ̤¨¤¿¡£");
5314 msg_print("The robe pulsates with raw mana...");
5316 if (!get_aim_dir(&dir)) return;
5317 fire_bolt(GF_MANA, dir, 120);
5318 o_ptr->timeout = randint0(120) + 120;
5323 (void)set_fast(randint1(50) + 50, FALSE);
5326 set_hero(randint1(50) + 50, FALSE);
5327 o_ptr->timeout = randint0(200) + 100;
5333 msg_print("¥·¡¼¥ë¥É¤¬âÁ¤·¤¤¸÷¤Çµ±¤¤¤¿¡¥¡¥¡¥");
5335 msg_print("Your shield gleams with blinding light...");
5337 fire_ball(GF_LITE, 0, 300, 6);
5338 confuse_monsters(3 * p_ptr->lev / 2);
5339 o_ptr->timeout = 250;
5345 msg_print("¥«¡¼¥É¤¬Çò¤¯µ±¤¤¤¿¡¥¡¥¡¥");
5347 msg_print("Your card gleams with blinding light...");
5349 if (!recharge(1000)) return;
5350 o_ptr->timeout = 200;
5356 if (get_check("ËÜÅö¤Ë»È¤¤¤Þ¤¹¤«¡©"))
5358 if (get_check("Are you sure?!"))
5362 msg_print("¼Àµ¤¬¿Ì¤¨¤¿¡¥¡¥¡¥");
5364 msg_print("The Muramasa pulsates...");
5370 msg_print("¼Àµ¤Ï²õ¤ì¤¿¡ª");
5372 msg_print("The Muramasa is destroyed!");
5374 curse_weapon(TRUE, item);
5382 msg_print("ÀФ¬ÀÄÇò¤¯¸÷¤Ã¤¿¡¥¡¥¡¥");
5384 msg_print("Your stone glows pale...");
5387 if (!get_aim_dir(&dir)) return;
5388 fire_ball(GF_MANA, dir, 400, 4);
5389 o_ptr->timeout = randint0(250) + 250;
5396 if (!get_rep_dir2(&dir)) return;
5400 if (!(cave[y][x].feat == FEAT_DEEP_WATER) && !(cave[y][x].feat == FEAT_SHAL_WATER))
5403 msg_print("¤½¤³¤ÏΦÃϤÀ¡£");
5405 msg_print("There is no fishing place.");
5409 else if (cave[y][x].m_idx)
5412 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
5414 msg_format("%s¤¬¼ÙËâ¤À¡ª", m_name);
5416 msg_format("%^s is stand in your way.", m_name);
5421 set_action(ACTION_FISH);
5422 p_ptr->redraw |= (PR_STATE);
5427 if (!get_aim_dir(&dir)) return;
5429 msg_print("¥à¥Á¤ò¿¤Ð¤·¤¿¡£");
5431 msg_print("You stretched your wip.");
5434 fetch(dir, 500, TRUE);
5435 o_ptr->timeout = randint0(25) + 25;
5440 u32b mode = PM_ALLOW_GROUP;
5441 bool pet = !one_in_(5);
5442 if (pet) mode |= PM_FORCE_PET;
5443 else mode |= PM_NO_PET;
5445 if (summon_specific((pet ? -1 : 0), py, px, ((p_ptr->lev * 3) / 2), SUMMON_HOUND, mode))
5450 msg_print("¥Ï¥¦¥ó¥É¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5452 msg_print("A group of hounds appear as your servant.");
5457 msg_print("¥Ï¥¦¥ó¥É¤Ï¤¢¤Ê¤¿¤Ë²ç¤ò¸þ¤±¤Æ¤¤¤ë¡ª");
5459 msg_print("A group of hounds appear as your enemy!");
5464 o_ptr->timeout = 300 + randint1(150);
5471 msg_print("¥¹¥Ô¥¢¤ÏâÁ¤·¤¯µ±¤¤¤¿...");
5473 msg_print("Your spear grows brightly...");
5476 if (!get_aim_dir(&dir)) return;
5477 fire_ball(GF_LITE, dir, 200, 3);
5478 o_ptr->timeout = randint0(200) + 200;
5485 monster_type *m_ptr;
5490 if (summon_named_creature(0, py, px, MON_SUKE, PM_FORCE_PET))
5493 msg_print("¡Ø½õ¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5495 msg_print("Suke-san apperars.");
5496 kakusan = "Suke-san";
5500 if (summon_named_creature(0, py, px, MON_KAKU, PM_FORCE_PET))
5503 msg_print("¡Ø³Ê¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5505 msg_print("Kaku-san appears.");
5506 kakusan = "Kaku-san";
5512 for (i = m_max - 1; i > 0; i--)
5515 if (!m_ptr->r_idx) continue;
5516 if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
5517 if (!los(m_ptr->fy, m_ptr->fx, py, px)) continue;
5526 msg_print("¡Ö¼Ô¤É¤â¡¢¤Ò¤«¤¨¤ª¤í¤¦¡ª¡ª¡ª¤³¤Î¤ªÊý¤ò¤É¤Ê¤¿¤È¤³¤³¤í¤¨¤ë¡£¡×");
5528 msg_format("%^s says 'WHO do you think this person is! Bow your head, down your knees!'", kakusan);
5533 confuse_monsters(120);
5535 stasis_monsters(120);
5541 msg_print("¤·¤«¤·¡¢²¿¤âµ¯¤¤Ê¤«¤Ã¤¿¡£");
5543 msg_print("Nothing happen.");
5546 o_ptr->timeout = randint0(150) + 150;
5553 msg_print("Çï»ÒÌÚ¤òÂǤä¿¡£");
5555 msg_print("You beat Your wooden clappers.");
5557 aggravate_monsters(0);
5564 set_hero(randint1(25)+25, FALSE);
5566 o_ptr->timeout = randint0(30) + 30;
5572 (void)set_poisoned(0);
5573 (void)set_confused(0);
5579 o_ptr->timeout = 100;
5585 if (!get_aim_dir(&dir)) return;
5586 (void)charm_animal(dir, p_ptr->lev);
5588 o_ptr->timeout = 200;
5595 msg_print("¥½¡¼¥É¤¬Ã¸¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
5597 msg_print("Your sword glows a pale blue...");
5599 if (!get_aim_dir(&dir)) return;
5600 fire_bolt(GF_COLD, dir, damroll(12, 8));
5601 o_ptr->timeout = 50;
5608 msg_print("³ù¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
5610 msg_print("Your scythe glows brightly!");
5612 for (i = 0; i < TR_FLAG_SIZE; i++)
5613 o_ptr->art_flags[i] = a_info[ART_BLOOD].flags[i];
5615 dummy = randint1(2)+randint1(2);
5616 for (i = 0; i < dummy; i++)
5618 int flag = randint0(19);
5619 if (flag == 18) add_flag(o_ptr->art_flags, TR_SLAY_HUMAN);
5620 else add_flag(o_ptr->art_flags, TR_CHAOTIC + flag);
5622 dummy = randint1(2);
5623 for (i = 0; i < dummy; i++)
5624 one_resistance(o_ptr);
5626 for (i = 0; i < dummy; i++)
5628 int tmp = randint0(11);
5629 if (tmp < 6) add_flag(o_ptr->art_flags, TR_STR + tmp);
5630 else add_flag(o_ptr->art_flags, TR_STEALTH + tmp - 6);
5632 o_ptr->timeout = 3333;
5633 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
5634 p_ptr->update |= (PU_BONUS | PU_HP);
5640 msg_print("Î϶¯¤¯»Í¸Ô¤òƧ¤ó¤À¡£");
5642 msg_print("You stamp. (as if you are in a ring.)");
5644 (void)set_hero(randint1(20) + 20, FALSE);
5645 dispel_evil(p_ptr->lev * 3);
5646 o_ptr->timeout = 100 + randint1(100);
5652 msg_print("¥¯¥í¡¼¥¯¤¬Çò¤¯µ±¤¤¤¿...");
5654 msg_print("Your cloak grows white.");
5656 (void)set_oppose_cold(randint1(20) + 20, FALSE);
5657 o_ptr->timeout = 40 + randint1(40);
5663 msg_print("¥à¥Á¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
5665 msg_print("The whip lets out a shrill wail...");
5669 (void)set_protevil(randint1(25) + k, FALSE);
5670 o_ptr->timeout = randint0(225) + 225;
5675 u32b mode = PM_ALLOW_GROUP;
5676 bool pet = !one_in_(5);
5677 if (pet) mode |= PM_FORCE_PET;
5679 if (summon_named_creature(0, py, px, MON_JIZOTAKO, mode))
5683 msg_print("Âý¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5685 msg_print("A group of octopuses appear as your servant.");
5690 msg_print("Âý¤Ï¤¢¤Ê¤¿¤òâˤó¤Ç¤¤¤ë¡ª");
5692 msg_print("A group of octopuses appear as your enemy!");
5697 o_ptr->timeout = 300 + randint1(150);
5704 msg_print("Å´µå¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
5706 msg_print("The iron ball floods the area with goodness...");
5709 dispel_evil(p_ptr->lev * 5);
5710 o_ptr->timeout = randint0(100) + 100;
5717 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤¬¿¼¤¤°Ç¤Ëʤ¤ï¤ì¤¿...");
5719 msg_print("Your amulet is coverd in pitch-darkness...");
5721 if (!get_aim_dir(&dir)) return;
5722 fire_ball(GF_DARK, dir, 250, 4);
5723 o_ptr->timeout = randint0(150) + 150;
5729 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5735 if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3))
5737 switch (o_ptr->xtra3-1)
5739 case ESSENCE_TMP_RES_ACID:
5740 (void)set_oppose_acid(randint1(20) + 20, FALSE);
5741 o_ptr->timeout = randint0(50) + 50;
5744 case ESSENCE_TMP_RES_ELEC:
5745 (void)set_oppose_elec(randint1(20) + 20, FALSE);
5746 o_ptr->timeout = randint0(50) + 50;
5749 case ESSENCE_TMP_RES_FIRE:
5750 (void)set_oppose_fire(randint1(20) + 20, FALSE);
5751 o_ptr->timeout = randint0(50) + 50;
5754 case ESSENCE_TMP_RES_COLD:
5755 (void)set_oppose_cold(randint1(20) + 20, FALSE);
5756 o_ptr->timeout = randint0(50) + 50;
5760 earthquake(py, px, 5);
5761 o_ptr->timeout = 100 + randint1(100);
5764 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5772 if (o_ptr->name2 == EGO_TRUMP)
5774 teleport_player(100);
5775 o_ptr->timeout = 50 + randint1(50);
5778 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5785 if (o_ptr->name2 == EGO_LITE_ILLUMINATION)
5787 if (!o_ptr->xtra4 && ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
5790 msg_print("dzÎÁ¤¬¤Ê¤¤¡£");
5792 msg_print("It has no fuel.");
5797 lite_area(damroll(2, 15), 3);
5798 o_ptr->timeout = randint0(10) + 10;
5801 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5807 if (o_ptr->name2 == EGO_EARTHQUAKES)
5809 earthquake(py, px, 5);
5810 o_ptr->timeout = 100 + randint1(100);
5813 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5820 if (o_ptr->name2 == EGO_JUMP)
5822 teleport_player(10);
5823 o_ptr->timeout = 10 + randint1(10);
5826 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5833 /* Hack -- Dragon Scale Mail can be activated as well */
5834 if (o_ptr->tval == TV_DRAG_ARMOR)
5836 /* Get a direction for breathing (or abort) */
5837 if (!get_aim_dir(&dir)) return;
5839 /* Branch on the sub-type */
5840 switch (o_ptr->sval)
5842 case SV_DRAGON_BLUE:
5845 msg_print("¤¢¤Ê¤¿¤Ï°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5847 msg_print("You breathe lightning.");
5850 fire_ball(GF_ELEC, dir, 100, -2);
5851 o_ptr->timeout = randint0(150) + 150;
5855 case SV_DRAGON_WHITE:
5858 msg_print("¤¢¤Ê¤¿¤ÏÎ䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5860 msg_print("You breathe frost.");
5863 fire_ball(GF_COLD, dir, 110, -2);
5864 o_ptr->timeout = randint0(150) + 150;
5868 case SV_DRAGON_BLACK:
5871 msg_print("¤¢¤Ê¤¿¤Ï»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5873 msg_print("You breathe acid.");
5876 fire_ball(GF_ACID, dir, 130, -2);
5877 o_ptr->timeout = randint0(150) + 150;
5881 case SV_DRAGON_GREEN:
5884 msg_print("¤¢¤Ê¤¿¤ÏÆÇ¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5886 msg_print("You breathe poison gas.");
5889 fire_ball(GF_POIS, dir, 150, -2);
5890 o_ptr->timeout = randint0(180) + 180;
5897 msg_print("¤¢¤Ê¤¿¤Ï²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5899 msg_print("You breathe fire.");
5902 fire_ball(GF_FIRE, dir, 200, -2);
5903 o_ptr->timeout = randint0(200) + 200;
5907 case SV_DRAGON_MULTIHUED:
5909 chance = randint0(5);
5911 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5912 ((chance == 1) ? "°ðºÊ" :
5913 ((chance == 2) ? "Î䵤" :
5914 ((chance == 3) ? "»À" :
5915 ((chance == 4) ? "ÆÇ¥¬¥¹" : "²Ð±ê")))));
5917 msg_format("You breathe %s.",
5918 ((chance == 1) ? "lightning" :
5919 ((chance == 2) ? "frost" :
5920 ((chance == 3) ? "acid" :
5921 ((chance == 4) ? "poison gas" : "fire")))));
5924 fire_ball(((chance == 1) ? GF_ELEC :
5925 ((chance == 2) ? GF_COLD :
5926 ((chance == 3) ? GF_ACID :
5927 ((chance == 4) ? GF_POIS : GF_FIRE)))),
5929 o_ptr->timeout = randint0(200) + 200;
5933 case SV_DRAGON_BRONZE:
5936 msg_print("¤¢¤Ê¤¿¤Ïº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5938 msg_print("You breathe confusion.");
5941 fire_ball(GF_CONFUSION, dir, 120, -2);
5942 o_ptr->timeout = randint0(180) + 180;
5946 case SV_DRAGON_GOLD:
5949 msg_print("¤¢¤Ê¤¿¤Ï¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5951 msg_print("You breathe sound.");
5954 fire_ball(GF_SOUND, dir, 130, -2);
5955 o_ptr->timeout = randint0(180) + 180;
5959 case SV_DRAGON_CHAOS:
5961 chance = randint0(2);
5963 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5964 ((chance == 1 ? "¥«¥ª¥¹" : "Îô²½")));
5966 msg_format("You breathe %s.",
5967 ((chance == 1 ? "chaos" : "disenchantment")));
5970 fire_ball((chance == 1 ? GF_CHAOS : GF_DISENCHANT),
5972 o_ptr->timeout = randint0(200) + 200;
5978 chance = randint0(2);
5980 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5981 ((chance == 1 ? "¹ì²»" : "ÇËÊÒ")));
5983 msg_format("You breathe %s.",
5984 ((chance == 1 ? "sound" : "shards")));
5987 fire_ball((chance == 1 ? GF_SOUND : GF_SHARDS),
5989 o_ptr->timeout = randint0(200) + 200;
5993 case SV_DRAGON_BALANCE:
5995 chance = randint0(4);
5997 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿",
5998 ((chance == 1) ? "¥«¥ª¥¹" :
5999 ((chance == 2) ? "Îô²½" :
6000 ((chance == 3) ? "¹ì²»" : "ÇËÊÒ"))));
6002 msg_format("You breathe %s.",
6003 ((chance == 1) ? "chaos" :
6004 ((chance == 2) ? "disenchantment" :
6005 ((chance == 3) ? "sound" : "shards"))));
6008 fire_ball(((chance == 1) ? GF_CHAOS :
6009 ((chance == 2) ? GF_DISENCHANT :
6010 ((chance == 3) ? GF_SOUND : GF_SHARDS))),
6012 o_ptr->timeout = randint0(200) + 200;
6016 case SV_DRAGON_SHINING:
6018 chance = randint0(2);
6020 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
6021 ((chance == 0 ? "Á®¸÷" : "°Å¹õ")));
6023 msg_format("You breathe %s.",
6024 ((chance == 0 ? "light" : "darkness")));
6027 fire_ball((chance == 0 ? GF_LITE : GF_DARK), dir, 200, -2);
6028 o_ptr->timeout = randint0(200) + 200;
6032 case SV_DRAGON_POWER:
6035 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6037 msg_print("You breathe the elements.");
6040 fire_ball(GF_MISSILE, dir, 300, -3);
6041 o_ptr->timeout = randint0(200) + 200;
6047 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6053 else if (o_ptr->tval == TV_RING)
6057 bool success = TRUE;
6059 switch (o_ptr->name2)
6062 (void)set_afraid(0);
6063 (void)set_hero(randint1(25) + 25, FALSE);
6064 (void)hp_player(10);
6065 o_ptr->timeout = randint1(100)+100;
6067 case EGO_RING_MAGIC_MIS:
6068 if (!get_aim_dir(&dir)) return;
6069 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
6072 case EGO_RING_FIRE_BOLT:
6073 if (!get_aim_dir(&dir)) return;
6074 fire_bolt(GF_FIRE, dir, damroll(9, 8));
6075 o_ptr->timeout = randint0(8) + 8;
6077 case EGO_RING_COLD_BOLT:
6078 if (!get_aim_dir(&dir)) return;
6079 fire_bolt(GF_COLD, dir, damroll(6, 8));
6080 o_ptr->timeout = randint0(7) + 7;
6082 case EGO_RING_ELEC_BOLT:
6083 if (!get_aim_dir(&dir)) return;
6084 fire_bolt(GF_ELEC, dir, damroll(4, 8));
6085 o_ptr->timeout = randint0(5) + 5;
6087 case EGO_RING_ACID_BOLT:
6088 if (!get_aim_dir(&dir)) return;
6089 fire_bolt(GF_FIRE, dir, damroll(5, 8));
6090 o_ptr->timeout = randint0(6) + 6;
6092 case EGO_RING_MANA_BOLT:
6093 if (!get_aim_dir(&dir)) return;
6094 fire_bolt(GF_MANA, dir, 120);
6095 o_ptr->timeout = randint0(120)+120;
6097 case EGO_RING_FIRE_BALL:
6098 if (!get_aim_dir(&dir)) return;
6099 fire_ball(GF_FIRE, dir, 100, 2);
6100 o_ptr->timeout = randint0(80) + 80;
6102 case EGO_RING_COLD_BALL:
6103 if (!get_aim_dir(&dir)) return;
6104 fire_ball(GF_COLD, dir, 100, 2);
6105 o_ptr->timeout = randint0(80) + 80;
6107 case EGO_RING_ELEC_BALL:
6108 if (!get_aim_dir(&dir)) return;
6109 fire_ball(GF_ELEC, dir, 100, 2);
6110 o_ptr->timeout = randint0(80) + 80;
6112 case EGO_RING_ACID_BALL:
6113 if (!get_aim_dir(&dir)) return;
6114 fire_ball(GF_ACID, dir, 100, 2);
6115 o_ptr->timeout = randint0(80) + 80;
6117 case EGO_RING_MANA_BALL:
6118 if (!get_aim_dir(&dir)) return;
6119 fire_ball(GF_MANA, dir, 250, 2);
6120 o_ptr->timeout = 300;
6122 case EGO_RING_DRAGON_F:
6123 if (!get_aim_dir(&dir)) return;
6124 fire_ball(GF_FIRE, dir, 200, -2);
6125 if (o_ptr->sval == SV_RING_FLAMES)
6127 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6128 o_ptr->timeout = 200;
6130 else o_ptr->timeout = 250;
6132 case EGO_RING_DRAGON_C:
6133 if (!get_aim_dir(&dir)) return;
6134 fire_ball(GF_COLD, dir, 200, -2);
6135 if (o_ptr->sval == SV_RING_ICE)
6137 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6138 o_ptr->timeout = 200;
6140 else o_ptr->timeout = 250;
6142 case EGO_RING_M_DETECT:
6143 (void)detect_monsters_invis(255);
6144 (void)detect_monsters_normal(255);
6145 o_ptr->timeout = 150;
6147 case EGO_RING_D_SPEED:
6148 (void)set_fast(randint1(30) + 15, FALSE);
6149 o_ptr->timeout = 100;
6151 case EGO_RING_BERSERKER:
6152 (void)set_shero(randint1(25) + 25, FALSE);
6153 o_ptr->timeout = randint0(75)+75;
6155 case EGO_RING_TELE_AWAY:
6156 if (!get_aim_dir(&dir)) return;
6157 teleport_monster(dir);
6158 o_ptr->timeout = 150;
6162 int v = randint1(25)+25;
6163 (void)set_afraid(0);
6164 (void)set_hero(v, FALSE);
6165 (void)hp_player(10);
6166 (void)set_blessed(v, FALSE);
6167 (void)set_oppose_acid(v, FALSE);
6168 (void)set_oppose_elec(v, FALSE);
6169 (void)set_oppose_fire(v, FALSE);
6170 (void)set_oppose_cold(v, FALSE);
6171 (void)set_oppose_pois(v, FALSE);
6172 (void)set_ultimate_res(v, FALSE);
6173 o_ptr->timeout = 777;
6180 if (success) return;
6183 /* Get a direction for breathing (or abort) */
6184 if (!get_aim_dir(&dir)) return;
6186 switch (o_ptr->sval)
6190 fire_ball(GF_ACID, dir, 100, 2);
6191 (void)set_oppose_acid(randint1(20) + 20, FALSE);
6192 o_ptr->timeout = randint0(50) + 50;
6198 fire_ball(GF_COLD, dir, 100, 2);
6199 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6200 o_ptr->timeout = randint0(50) + 50;
6204 case SV_RING_FLAMES:
6206 fire_ball(GF_FIRE, dir, 100, 2);
6207 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6208 o_ptr->timeout = randint0(50) + 50;
6214 fire_ball(GF_ELEC, dir, 100, 2);
6215 (void)set_oppose_elec(randint1(20) + 20, FALSE);
6216 o_ptr->timeout = randint0(50) + 50;
6222 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6228 else if (o_ptr->tval == TV_AMULET)
6232 switch (o_ptr->name2)
6235 if (!ident_spell(FALSE)) return;
6236 o_ptr->timeout = 10;
6239 if (!get_aim_dir(&dir)) return;
6240 charm_monster(dir, MAX(20, p_ptr->lev));
6241 o_ptr->timeout = 200;
6244 teleport_player(10);
6245 o_ptr->timeout = randint0(10) + 10;
6247 case EGO_AMU_TELEPORT:
6248 teleport_player(100);
6249 o_ptr->timeout = randint0(50) + 50;
6251 case EGO_AMU_D_DOOR:
6252 (void)dimension_door();
6253 o_ptr->timeout = 200;
6255 case EGO_AMU_RES_FIRE_:
6256 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6257 o_ptr->timeout = randint0(50) + 50;
6259 case EGO_AMU_RES_COLD_:
6260 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6261 o_ptr->timeout = randint0(50) + 50;
6263 case EGO_AMU_RES_ELEC_:
6264 (void)set_oppose_elec(randint1(20) + 20, FALSE);
6265 o_ptr->timeout = randint0(50) + 50;
6267 case EGO_AMU_RES_ACID_:
6268 (void)set_oppose_acid(randint1(20) + 20, FALSE);
6269 o_ptr->timeout = randint0(50) + 50;
6271 case EGO_AMU_DETECTION:
6272 detect_all(DETECT_RAD_DEFAULT);
6273 o_ptr->timeout = randint0(55)+55;
6280 else if (o_ptr->tval == TV_WHISTLE)
6283 if (cursed_p(o_ptr))
6286 msg_print("¥«¥ó¹â¤¤²»¤¬¶Á¤ÅϤä¿¡£");
6288 msg_print("You produce a shrill whistling sound.");
6290 aggravate_monsters(0);
6300 /* Allocate the "who" array */
6301 C_MAKE(who, max_m_idx, u16b);
6303 /* Process the monsters (backwards) */
6304 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6306 if (is_pet(&m_list[pet_ctr]) && (p_ptr->riding != pet_ctr))
6307 who[max_pet++] = pet_ctr;
6310 /* Select the sort method */
6311 ang_sort_comp = ang_sort_comp_pet;
6312 ang_sort_swap = ang_sort_swap_hook;
6314 ang_sort(who, &dummy_why, max_pet);
6316 /* Process the monsters (backwards) */
6317 for (i = 0; i < max_pet; i++)
6320 teleport_to_player(pet_ctr, 100);
6323 /* Free the "who" array */
6324 C_KILL(who, max_m_idx, u16b);
6326 o_ptr->timeout = 100+randint1(100);
6329 else if (o_ptr->tval == TV_CAPTURE)
6333 bool old_target_pet = target_pet;
6335 if (!get_aim_dir(&dir))
6337 target_pet = old_target_pet;
6340 target_pet = old_target_pet;
6342 if(fire_ball(GF_CAPTURE, dir, 0, 0))
6344 o_ptr->pval = cap_mon;
6345 o_ptr->xtra3 = cap_mspeed;
6346 o_ptr->xtra4 = cap_hp;
6347 o_ptr->xtra5 = cap_maxhp;
6354 if (o_ptr->inscription)
6355 strcpy(buf, quark_str(o_ptr->inscription));
6357 for (s = buf;*s && (*s != '#'); s++)
6360 if (iskanji(*s)) s++;
6370 t = quark_str(cap_nickname);
6383 o_ptr->inscription = quark_add(buf);
6389 bool success = FALSE;
6390 if (!get_rep_dir2(&dir)) return;
6391 if (cave_floor_bold(py+ddy[dir],px+ddx[dir]))
6393 if (place_monster_aux(0, py + ddy[dir], px + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
6395 if (o_ptr->xtra3) m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
6396 if (o_ptr->xtra5) m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
6397 if (o_ptr->xtra4) m_list[hack_m_idx_ii].hp = o_ptr->xtra4;
6398 m_list[hack_m_idx_ii].maxhp = m_list[hack_m_idx_ii].max_maxhp;
6399 if (o_ptr->inscription)
6407 t = quark_str(o_ptr->inscription);
6408 for (t = quark_str(o_ptr->inscription);*t && (*t != '#'); t++)
6411 if (iskanji(*t)) t++;
6436 if (quote && *(s-1) =='\'')
6440 m_list[hack_m_idx_ii].nickname = quark_add(buf);
6441 t = quark_str(o_ptr->inscription);
6443 while(*t && (*t != '#'))
6450 o_ptr->inscription = quark_add(buf);
6462 msg_print("¤ª¤Ã¤È¡¢²òÊü¤Ë¼ºÇÔ¤·¤¿¡£");
6464 msg_print("Oops. You failed to release your pet.");
6472 msg_print("¤ª¤Ã¤È¡¢¤³¤Î¥¢¥¤¥Æ¥à¤Ï»ÏÆ°¤Ç¤¤Ê¤¤¡£");
6474 msg_print("Oops. That object cannot be activated.");
6480 void do_cmd_activate(void)
6486 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6488 set_action(ACTION_NONE);
6491 item_tester_no_ryoute = TRUE;
6492 /* Prepare the hook */
6493 item_tester_hook = item_tester_hook_activate;
6497 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò»ÏÆ°¤µ¤»¤Þ¤¹¤«? ";
6498 s = "»ÏÆ°¤Ç¤¤ë¥¢¥¤¥Æ¥à¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£";
6500 q = "Activate which item? ";
6501 s = "You have nothing to activate.";
6504 if (!get_item(&item, q, s, (USE_EQUIP))) return;
6506 /* Activate the item */
6507 do_cmd_activate_aux(item);
6512 * Hook to determine if an object is useable
6514 static bool item_tester_hook_use(object_type *o_ptr)
6516 u32b flgs[TR_FLAG_SIZE];
6519 if (o_ptr->tval == p_ptr->tval_ammo)
6522 /* Useable object */
6523 switch (o_ptr->tval)
6541 if (!object_known_p(o_ptr)) return (FALSE);
6543 /* HACK - only items from the equipment can be activated */
6544 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
6546 if (&inventory[i] == o_ptr)
6548 /* Extract the flags */
6549 object_flags(o_ptr, flgs);
6551 /* Check activation flag */
6552 if (have_flag(flgs, TR_ACTIVATE)) return (TRUE);
6565 * XXX - Add actions for other item types
6567 void do_cmd_use(void)
6573 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6575 set_action(ACTION_NONE);
6578 item_tester_no_ryoute = TRUE;
6579 /* Prepare the hook */
6580 item_tester_hook = item_tester_hook_use;
6584 q = "¤É¤ì¤ò»È¤¤¤Þ¤¹¤«¡©";
6585 s = "»È¤¨¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤»¤ó¡£";
6587 q = "Use which item? ";
6588 s = "You have nothing to use.";
6591 if (!get_item(&item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR))) return;
6593 /* Get the item (in the pack) */
6596 o_ptr = &inventory[item];
6598 /* Get the item (on the floor) */
6601 o_ptr = &o_list[0 - item];
6604 switch (o_ptr->tval)
6616 do_cmd_eat_food_aux(item);
6623 do_cmd_aim_wand_aux(item);
6630 do_cmd_use_staff_aux(item);
6637 do_cmd_zap_rod_aux(item);
6641 /* Quaff a potion */
6644 do_cmd_quaff_potion_aux(item);
6651 /* Check some conditions */
6655 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡£");
6657 msg_print("You can't see anything.");
6665 msg_print("ÌÀ¤«¤ê¤¬¤Ê¤¤¤Î¤Ç¡¢°Å¤¯¤ÆÆɤá¤Ê¤¤¡£");
6667 msg_print("You have no light to read by.");
6672 if (p_ptr->confused)
6675 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
6677 msg_print("You are too confused!");
6683 do_cmd_read_scroll_aux(item, TRUE);
6692 do_cmd_fire_aux(item, &inventory[INVEN_BOW]);
6696 /* Activate an artifact */
6699 do_cmd_activate_aux(item);
6705 static bool select_magic_eater(bool only_browse)
6709 bool flag, redraw, request_list;
6711 int ask = TRUE, i = 0;
6714 int menu_line = (use_menu ? 1 : 0);
6718 if (repeat_pull(&sn))
6720 /* Verify the spell */
6721 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))
6723 else if (sn < EATER_EXT*2 && !(p_ptr->magic_num1[sn] < EATER_CHARGE))
6727 #endif /* ALLOW_REPEAT */
6729 for (i = 0; i < 108; i++)
6731 if (p_ptr->magic_num2[i]) break;
6736 msg_print("ËâË¡¤ò³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6738 msg_print("You don't have any magic!");
6750 prt(format(" %s ¾ó", (menu_line == 1) ? "¡Õ" : " "), 2, 14);
6751 prt(format(" %s ËâË¡ËÀ", (menu_line == 2) ? "¡Õ" : " "), 3, 14);
6752 prt(format(" %s ¥í¥Ã¥É", (menu_line == 3) ? "¡Õ" : " "), 4, 14);
6753 prt("¤É¤Î¼ïÎà¤ÎËâË¡¤ò»È¤¤¤Þ¤¹¤«¡©", 0, 0);
6755 prt(format(" %s staff", (menu_line == 1) ? "> " : " "), 2, 14);
6756 prt(format(" %s wand", (menu_line == 2) ? "> " : " "), 3, 14);
6757 prt(format(" %s rod", (menu_line == 3) ? "> " : " "), 4, 14);
6758 prt("Which type of magic do you usu?", 0, 0);
6781 ext = (menu_line-1)*EATER_EXT;
6782 if (menu_line == 1) tval = TV_STAFF;
6783 else if (menu_line == 2) tval = TV_WAND;
6787 if (menu_line > 3) menu_line -= 3;
6796 if (!get_com("[A] ¾ó, [B] ËâË¡ËÀ, [C] ¥í¥Ã¥É:", &choice, TRUE))
6798 if (!get_com("[A] staff, [B] wand, [C] rod:", &choice, TRUE))
6803 if (choice == 'A' || choice == 'a')
6809 if (choice == 'B' || choice == 'b')
6815 if (choice == 'C' || choice == 'c')
6823 for (i = ext; i < ext + EATER_EXT; i++)
6825 if (p_ptr->magic_num2[i])
6827 if (use_menu) menu_line = i-ext+1;
6831 if (i == ext+EATER_EXT)
6834 msg_print("¤½¤Î¼ïÎà¤ÎËâË¡¤Ï³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6836 msg_print("You don't have that type of magic!");
6841 /* Nothing chosen yet */
6847 /* Build a prompt */
6849 (void) strnfmt(out_val, 78, "('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎËâÎϤò»È¤¤¤Þ¤¹¤«¡©");
6851 (void)strnfmt(out_val, 78, "(*=List, ESC=exit) Use which power? ");
6854 /* Save the screen */
6857 request_list = always_show_list;
6859 /* Get a spell from the user */
6863 if (request_list || use_menu)
6874 for (y = 1; y < 20; y++)
6879 /* Print header(s) */
6881 prt(format(" %s ¼ºÎ¨ %s ¼ºÎ¨", (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô"), (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô")), y++, x);
6883 prt(format(" %s Fail %s Fail", (tval == TV_ROD ? " Stat " : " Charges"), (tval == TV_ROD ? " Stat " : " Charges")), y++, x);
6887 for (ctr = 0; ctr < EATER_EXT; ctr++)
6889 if (!p_ptr->magic_num2[ctr+ext]) continue;
6891 k_idx = lookup_kind(tval, ctr);
6895 if (ctr == (menu_line-1))
6897 strcpy(dummy, "¡Õ");
6899 strcpy(dummy, "> ");
6901 else strcpy(dummy, " ");
6904 /* letter/number for power selection */
6911 letter = '0' + ctr - 26;
6912 sprintf(dummy, "%c)",letter);
6914 x1 = ((ctr < EATER_EXT/2) ? x : x + 40);
6915 y1 = ((ctr < EATER_EXT/2) ? y + ctr : y + ctr - EATER_EXT/2);
6916 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
6917 chance = level * 4 / 5 + 20;
6918 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
6920 if (p_ptr->lev > level)
6922 chance -= 3 * (p_ptr->lev - level);
6924 chance += p_ptr->to_m_chance;
6925 if (p_ptr->heavy_spell) chance += 20;
6926 if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
6927 else if (p_ptr->easy_spell) chance-=3;
6928 else if (p_ptr->dec_mana) chance-=2;
6929 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
6930 /* Stunning makes spells harder */
6931 if (p_ptr->stun > 50) chance += 25;
6932 else if (p_ptr->stun) chance += 15;
6934 if (chance > 95) chance = 95;
6936 if(p_ptr->dec_mana) chance--;
6937 if (p_ptr->heavy_spell) chance += 5;
6945 strcat(dummy, format(
6947 " %-22.22s ½¼Å¶:%2d/%2d%3d%%",
6949 " %-22.22s (%2d/%2d) %3d%%",
6951 k_name + k_info[k_idx].name,
6952 p_ptr->magic_num1[ctr+ext] ?
6953 (p_ptr->magic_num1[ctr+ext] - 1) / (EATER_ROD_CHARGE * k_info[k_idx].pval) +1 : 0,
6954 p_ptr->magic_num2[ctr+ext], chance));
6955 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;
6959 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));
6960 if (p_ptr->magic_num1[ctr+ext] < EATER_CHARGE) col = TERM_RED;
6965 c_prt(col, dummy, y1, x1);
6969 if(!get_com(out_val, &choice, FALSE)) break;
6971 if (use_menu && choice != ' ')
6988 menu_line += EATER_EXT - 1;
6989 if (menu_line > EATER_EXT) menu_line -= EATER_EXT;
6990 } while(!p_ptr->magic_num2[menu_line+ext-1]);
7001 if (menu_line > EATER_EXT) menu_line -= EATER_EXT;
7002 } while(!p_ptr->magic_num2[menu_line+ext-1]);
7013 bool reverse = FALSE;
7014 if ((choice == '4') || (choice == 'h') || (choice == 'H')) reverse = TRUE;
7015 if (menu_line > EATER_EXT/2)
7017 menu_line -= EATER_EXT/2;
7020 else menu_line+=EATER_EXT/2;
7021 while(!p_ptr->magic_num2[menu_line+ext-1])
7026 if (menu_line < 2) reverse = FALSE;
7031 if (menu_line > EATER_EXT-1) reverse = TRUE;
7048 /* Request redraw */
7049 if (use_menu && ask) continue;
7051 /* Request redraw */
7052 if (!use_menu && ((choice == ' ') || (choice == '*') || (choice == '?')))
7058 request_list = FALSE;
7060 /* Restore the screen */
7065 request_list = TRUE;
7073 if (isalpha(choice))
7076 ask = (isupper(choice));
7079 if (ask) choice = tolower(choice);
7081 /* Extract request */
7082 i = (islower(choice) ? A2I(choice) : -1);
7086 ask = FALSE; /* Can't uppercase digits */
7088 i = choice - '0' + 26;
7092 /* Totally Illegal */
7093 if ((i < 0) || (i > EATER_EXT) || !p_ptr->magic_num2[i+ext])
7108 (void) strnfmt(tmp_val, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", k_name + k_info[lookup_kind(tval ,i)].name);
7110 (void) strnfmt(tmp_val, 78, "Use %s?", k_name + k_info[lookup_kind(tval ,i)].name);
7113 /* Belay that order */
7114 if (!get_check(tmp_val)) continue;
7118 if (p_ptr->magic_num1[ext+i] > k_info[lookup_kind(tval, i)].pval * (p_ptr->magic_num2[ext+i] - 1) * EATER_ROD_CHARGE)
7121 msg_print("¤½¤ÎËâË¡¤Ï¤Þ¤À½¼Å¶¤·¤Æ¤¤¤ëºÇÃæ¤À¡£");
7123 msg_print("The magic are still charging.");
7126 if (use_menu) ask = TRUE;
7132 if (p_ptr->magic_num1[ext+i] < EATER_CHARGE)
7135 msg_print("¤½¤ÎËâË¡¤Ï»ÈÍѲó¿ô¤¬ÀÚ¤ì¤Æ¤¤¤ë¡£");
7137 msg_print("The magic has no charges left.");
7140 if (use_menu) ask = TRUE;
7152 /* Clear lines, position cursor (really should use strlen here) */
7153 Term_erase(7, 23, 255);
7154 Term_erase(7, 22, 255);
7155 Term_erase(7, 21, 255);
7156 Term_erase(7, 20, 255);
7158 roff_to_buf(k_text + k_info[lookup_kind(tval, i)].text, 62, temp, sizeof(temp));
7159 for (j = 0, line = 21; temp[j]; j += 1 + strlen(&temp[j]))
7161 prt(&temp[j], line, 10);
7166 prt("²¿¤«¥¡¼¤ò²¡¤·¤Æ²¼¤µ¤¤¡£",0,0);
7168 prt("Hit any key.",0,0);
7178 /* Restore the screen */
7181 if (!flag) return -1;
7185 #endif /* ALLOW_REPEAT */
7191 * Use eaten rod, wand or staff
7193 void do_cmd_magic_eater(bool only_browse)
7195 int item, chance, level, k_idx, tval, sval;
7196 bool use_charge = TRUE;
7198 /* Not when confused */
7199 if (!only_browse && p_ptr->confused)
7202 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
7204 msg_print("You are too confused!");
7210 item = select_magic_eater(only_browse);
7216 if (item >= EATER_EXT*2) {tval = TV_ROD;sval = item - EATER_EXT*2;}
7217 else if (item >= EATER_EXT) {tval = TV_WAND;sval = item - EATER_EXT;}
7218 else {tval = TV_STAFF;sval = item;}
7219 k_idx = lookup_kind(tval, sval);
7221 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
7222 chance = level * 4 / 5 + 20;
7223 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
7225 if (p_ptr->lev > level)
7227 chance -= 3 * (p_ptr->lev - level);
7229 chance += p_ptr->to_m_chance;
7230 if (p_ptr->heavy_spell) chance += 20;
7231 if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
7232 else if (p_ptr->easy_spell) chance-=3;
7233 else if (p_ptr->dec_mana) chance-=2;
7234 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
7235 /* Stunning makes spells harder */
7236 if (p_ptr->stun > 50) chance += 25;
7237 else if (p_ptr->stun) chance += 15;
7239 if (chance > 95) chance = 95;
7241 if(p_ptr->dec_mana) chance--;
7242 if (p_ptr->heavy_spell) chance += 5;
7244 if (randint0(100) < chance)
7246 if (flush_failure) flush();
7249 msg_print("¼öʸ¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª");
7251 msg_format("You failed to get the magic off!");
7255 if (randint1(100) >= chance)
7256 chg_virtue(V_CHANCE,-1);
7267 if ((sval >= SV_ROD_MIN_DIRECTION) && (sval != SV_ROD_HAVOC) && (sval != SV_ROD_AGGRAVATE) && (sval != SV_ROD_PESTICIDE))
7268 if (!get_aim_dir(&dir)) return;
7269 rod_effect(sval, dir, &use_charge, TRUE);
7270 if (!use_charge) return;
7272 else if (tval == TV_WAND)
7274 if (!get_aim_dir(&dir)) return;
7275 wand_effect(sval, dir, TRUE);
7279 staff_effect(sval, &use_charge, TRUE, TRUE);
7280 if (!use_charge) return;
7282 if (randint1(100) < chance)
7283 chg_virtue(V_CHANCE,1);
7286 if (tval == TV_ROD) p_ptr->magic_num1[item] += k_info[k_idx].pval * EATER_ROD_CHARGE;
7287 else p_ptr->magic_num1[item] -= EATER_CHARGE;