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);
87 eat_callback(o_ptr->sval);
89 if (!object_eat_callback(o_ptr))
90 #endif /* USE_SCRIPT */
93 if (o_ptr->tval == TV_FOOD)
95 /* Analyze the food */
100 if (!(p_ptr->resist_pois || p_ptr->oppose_pois))
102 if (set_poisoned(p_ptr->poisoned + rand_int(10) + 10))
110 case SV_FOOD_BLINDNESS:
112 if (!p_ptr->resist_blind)
114 if (set_blind(p_ptr->blind + rand_int(200) + 200))
122 case SV_FOOD_PARANOIA:
124 if (!p_ptr->resist_fear)
126 if (set_afraid(p_ptr->afraid + rand_int(10) + 10))
134 case SV_FOOD_CONFUSION:
136 if (!p_ptr->resist_conf)
138 if (set_confused(p_ptr->confused + rand_int(10) + 10))
146 case SV_FOOD_HALLUCINATION:
148 if (!p_ptr->resist_chaos)
150 if (set_image(p_ptr->image + rand_int(250) + 250))
158 case SV_FOOD_PARALYSIS:
160 if (!p_ptr->free_act)
162 if (set_paralyzed(p_ptr->paralyzed + rand_int(10) + 10))
170 case SV_FOOD_WEAKNESS:
173 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "ÆÇÆþ¤ê¿©ÎÁ", -1);
175 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "poisonous food", -1);
178 (void)do_dec_stat(A_STR);
183 case SV_FOOD_SICKNESS:
186 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "ÆÇÆþ¤ê¿©ÎÁ", -1);
188 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "poisonous food", -1);
191 (void)do_dec_stat(A_CON);
196 case SV_FOOD_STUPIDITY:
199 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "ÆÇÆþ¤ê¿©ÎÁ", -1);
201 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "poisonous food", -1);
204 (void)do_dec_stat(A_INT);
209 case SV_FOOD_NAIVETY:
212 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "ÆÇÆþ¤ê¿©ÎÁ", -1);
214 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "poisonous food", -1);
217 (void)do_dec_stat(A_WIS);
222 case SV_FOOD_UNHEALTH:
225 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "ÆÇÆþ¤ê¿©ÎÁ", -1);
227 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "poisonous food", -1);
230 (void)do_dec_stat(A_CON);
235 case SV_FOOD_DISEASE:
238 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "ÆÇÆþ¤ê¿©ÎÁ", -1);
240 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "poisonous food", -1);
243 (void)do_dec_stat(A_STR);
248 case SV_FOOD_CURE_POISON:
250 if (set_poisoned(0)) ident = TRUE;
254 case SV_FOOD_CURE_BLINDNESS:
256 if (set_blind(0)) ident = TRUE;
260 case SV_FOOD_CURE_PARANOIA:
262 if (set_afraid(0)) ident = TRUE;
266 case SV_FOOD_CURE_CONFUSION:
268 if (set_confused(0)) ident = TRUE;
272 case SV_FOOD_CURE_SERIOUS:
274 if (hp_player(damroll(4, 8))) ident = TRUE;
278 case SV_FOOD_RESTORE_STR:
280 if (do_res_stat(A_STR)) ident = TRUE;
284 case SV_FOOD_RESTORE_CON:
286 if (do_res_stat(A_CON)) ident = TRUE;
290 case SV_FOOD_RESTORING:
292 if (do_res_stat(A_STR)) ident = TRUE;
293 if (do_res_stat(A_INT)) ident = TRUE;
294 if (do_res_stat(A_WIS)) ident = TRUE;
295 if (do_res_stat(A_DEX)) ident = TRUE;
296 if (do_res_stat(A_CON)) ident = TRUE;
297 if (do_res_stat(A_CHR)) ident = TRUE;
303 /* ¤½¤ì¤¾¤ì¤Î¿©¤Ùʪ¤Î´¶ÁÛ¤ò¥ª¥ê¥¸¥Ê¥ë¤è¤êºÙ¤«¤¯É½¸½ */
304 case SV_FOOD_BISCUIT:
306 msg_print("´Å¤¯¤Æ¥µ¥¯¥µ¥¯¤·¤Æ¤È¤Æ¤â¤ª¤¤¤·¤¤¡£");
313 msg_print("»õ¤´¤¿¤¨¤¬¤¢¤Ã¤Æ¤ª¤¤¤·¤¤¡£");
318 case SV_FOOD_SLIME_MOLD:
320 msg_print("¤³¤ì¤Ï¤Ê¤ó¤È¤â·ÁÍƤ·¤¬¤¿¤¤Ì£¤À¡£");
327 msg_print("¤³¤ì¤Ï¤ª¤¤¤·¤¤¡£");
333 case SV_FOOD_BISCUIT:
335 case SV_FOOD_SLIME_MOLD:
337 msg_print("That tastes good.");
344 case SV_FOOD_WAYBREAD:
347 msg_print("¤³¤ì¤Ï¤Ò¤¸¤ç¤¦¤ËÈþÌ£¤À¡£");
349 msg_print("That tastes good.");
352 (void)set_poisoned(0);
353 (void)hp_player(damroll(4, 8));
359 case SV_FOOD_PINT_OF_ALE:
361 msg_print("¤Î¤É¤´¤·Á֤䤫¤À¡£");
366 case SV_FOOD_PINT_OF_WINE:
368 msg_print("That tastes good.");
373 case SV_FOOD_PINT_OF_ALE:
374 case SV_FOOD_PINT_OF_WINE:
376 msg_print("That tastes good.");
389 /* Combine / Reorder the pack (later) */
390 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
392 if (!(object_aware_p(o_ptr)))
394 chg_virtue(V_KNOWLEDGE, -1);
395 chg_virtue(V_PATIENCE, -1);
396 chg_virtue(V_CHANCE, 1);
399 /* We have tried it */
402 /* The player is now aware of the object */
403 if (ident && !object_aware_p(o_ptr))
406 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
410 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
413 /* Food can feed the player */
414 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
416 /* Reduced nutritional benefit */
417 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
419 msg_print("¤¢¤Ê¤¿¤Î¤è¤¦¤Ê¼Ô¤Ë¤È¤Ã¤Æ¿©ÎȤʤɶϤ«¤Ê±ÉÍܤˤ·¤«¤Ê¤é¤Ê¤¤¡£");
421 msg_print("Mere victuals hold scant sustenance for a being such as yourself.");
424 if (p_ptr->food < PY_FOOD_ALERT) /* Hungry */
426 msg_print("¤¢¤Ê¤¿¤Îµ²¤¨¤Ï¿·Á¯¤Ê·ì¤Ë¤è¤Ã¤Æ¤Î¤ßËþ¤¿¤µ¤ì¤ë¡ª");
428 msg_print("Your hunger can only be satisfied with fresh blood!");
432 else if (p_ptr->prace == RACE_SKELETON)
434 if (!((o_ptr->sval == SV_FOOD_WAYBREAD) ||
435 (o_ptr->sval < SV_FOOD_BISCUIT)))
438 object_type *q_ptr = &forge;
441 msg_print("¿©¤Ùʪ¤¬¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¤¿¡ª");
443 msg_print("The food falls through your jaws!");
447 /* Create the item */
448 object_prep(q_ptr, lookup_kind(o_ptr->tval, o_ptr->sval));
451 q_ptr->python = object_create_callback(q_ptr);
452 #endif /* USE_SCRIPT */
454 /* Drop the object from heaven */
455 (void)drop_near(q_ptr, -1, py, px);
460 msg_print("¿©¤Ùʪ¤¬¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¡¢¾Ã¤¨¤¿¡ª");
462 msg_print("The food falls through your jaws and vanishes!");
467 else if ((p_ptr->prace == RACE_GOLEM) ||
468 (p_ptr->prace == RACE_ZOMBIE) ||
469 (p_ptr->prace == RACE_ENT) ||
470 (p_ptr->prace == RACE_DEMON) ||
471 (p_ptr->prace == RACE_ANDROID) ||
472 (p_ptr->prace == RACE_SPECTRE) ||
473 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
476 msg_print("À¸¼Ô¤Î¿©Êª¤Ï¤¢¤Ê¤¿¤Ë¤È¤Ã¤Æ¤Û¤È¤ó¤É±ÉÍܤˤʤé¤Ê¤¤¡£");
478 msg_print("The food of mortals is poor sustenance for you.");
481 set_food(p_ptr->food + ((o_ptr->pval) / 20));
485 (void)set_food(p_ptr->food + o_ptr->pval);
488 /* Destroy a food in the pack */
491 inven_item_increase(item, -1);
492 inven_item_describe(item);
493 inven_item_optimize(item);
496 /* Destroy a food on the floor */
499 floor_item_increase(0 - item, -1);
500 floor_item_describe(0 - item);
501 floor_item_optimize(0 - item);
507 * Hook to determine if an object is eatable
509 static bool item_tester_hook_eatable(object_type *o_ptr)
511 /* if ((o_ptr->tval==TV_FOOD) || ((o_ptr->tval==TV_CORPSE) && o_ptr->sval)) return (TRUE); */
512 if (o_ptr->tval==TV_FOOD) return (TRUE);
520 * Eat some food (from the pack or floor)
522 void do_cmd_eat_food(void)
528 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
530 set_action(ACTION_NONE);
533 /* Restrict choices to food */
534 item_tester_hook = item_tester_hook_eatable;
538 q = "¤É¤ì¤ò¿©¤Ù¤Þ¤¹¤«? ";
539 s = "¿©¤Ùʪ¤¬¤Ê¤¤¡£";
541 q = "Eat which item? ";
542 s = "You have nothing to eat.";
545 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
548 do_cmd_eat_food_aux(item);
553 * Quaff a potion (from the pack or the floor)
555 static void do_cmd_quaff_potion_aux(int item)
568 if (flush_failure) flush();
570 msg_print("ÉÓ¤«¤é¿å¤¬Î®¤ì½Ð¤Æ¤³¤Ê¤¤¡ª");
572 msg_print("The potion doesn't flow out from a bottle.");
579 if((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0])
584 /* Get the item (in the pack) */
587 o_ptr = &inventory[item];
590 /* Get the item (on the floor) */
593 o_ptr = &o_list[0 - item];
596 /* Get local object */
599 /* Obtain a local object */
600 object_copy(q_ptr, o_ptr);
605 /* Reduce and describe inventory */
608 inven_item_increase(item, -1);
609 inven_item_describe(item);
610 inven_item_optimize(item);
613 /* Reduce and describe floor item */
616 floor_item_increase(0 - item, -1);
617 floor_item_describe(0 - item);
618 floor_item_optimize(0 - item);
625 /* Not identified yet */
629 lev = get_object_level(q_ptr);
631 /* Analyze the potion */
635 /* °û¤ß¤´¤¿¤¨¤ò¥ª¥ê¥¸¥Ê¥ë¤è¤êºÙ¤«¤¯É½¸½ */
636 case SV_POTION_WATER:
638 msg_print("¸ý¤ÎÃ椬¤µ¤Ã¤Ñ¤ê¤·¤¿¡£");
639 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
643 case SV_POTION_APPLE_JUICE:
645 msg_print("´Å¤¯¤Æ¥µ¥Ã¥Ñ¥ê¤È¤·¤Æ¤¤¤Æ¡¢¤È¤Æ¤â¤ª¤¤¤·¤¤¡£");
646 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
650 case SV_POTION_SLIME_MOLD:
652 msg_print("¤Ê¤ó¤È¤âÉÔµ¤Ì£¤ÊÌ£¤À¡£");
653 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
658 case SV_POTION_WATER:
659 case SV_POTION_APPLE_JUICE:
660 case SV_POTION_SLIME_MOLD:
662 msg_print("You feel less thirsty.");
669 case SV_POTION_SLOWNESS:
671 if (set_slow(randint(25) + 15, FALSE)) ident = TRUE;
675 case SV_POTION_SALT_WATER:
678 msg_print("¤¦¤§¡ª»×¤ï¤ºÅǤ¤¤Æ¤·¤Þ¤Ã¤¿¡£");
680 msg_print("The potion makes you vomit!");
683 (void)set_food(PY_FOOD_STARVE - 1);
684 (void)set_poisoned(0);
685 (void)set_paralyzed(p_ptr->paralyzed + 4);
690 case SV_POTION_POISON:
692 if (!(p_ptr->resist_pois || p_ptr->oppose_pois))
694 if (set_poisoned(p_ptr->poisoned + rand_int(15) + 10))
702 case SV_POTION_BLINDNESS:
704 if (!p_ptr->resist_blind)
706 if (set_blind(p_ptr->blind + rand_int(100) + 100))
714 case SV_POTION_CONFUSION: /* Booze */
716 if (p_ptr->pclass != CLASS_MONK) chg_virtue(V_HARMONY, -1);
717 else if (!p_ptr->resist_conf) p_ptr->special_attack |= ATTACK_SUIKEN;
718 if (!p_ptr->resist_conf)
720 if (set_confused(rand_int(20) + 15))
726 if (!p_ptr->resist_chaos)
730 if (set_image(p_ptr->image + rand_int(150) + 150))
735 if (one_in_(13) && (p_ptr->pclass != CLASS_MONK))
738 if (one_in_(3)) lose_all_info();
740 teleport_player(100);
743 msg_print("ÃΤé¤Ê¤¤¾ì½ê¤ÇÌܤ¬Àä᤿¡£Æ¬Äˤ¬¤¹¤ë¡£");
744 msg_print("²¿¤â»×¤¤½Ð¤»¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ØÍ褿¤Î¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
746 msg_print("You wake up somewhere with a sore head...");
747 msg_print("You can't remember a thing, or how you got here!");
755 case SV_POTION_SLEEP:
757 if (!p_ptr->free_act)
760 msg_print("¤¢¤Ê¤¿¤Ï̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
762 msg_print("You fall asleep.");
766 if (ironman_nightmare)
769 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
771 msg_print("A horrible vision enters your mind.");
775 /* Pick a nightmare */
776 get_mon_num_prep(get_nightmare, NULL);
778 /* Have some nightmares */
779 have_nightmare(get_mon_num(MAX_DEPTH));
781 /* Remove the monster restriction */
782 get_mon_num_prep(NULL, NULL);
784 if (set_paralyzed(p_ptr->paralyzed + rand_int(4) + 4))
792 case SV_POTION_LOSE_MEMORIES:
794 if (!p_ptr->hold_life && (p_ptr->exp > 0))
797 msg_print("²áµî¤Îµ²±¤¬Çö¤ì¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
799 msg_print("You feel your memories fade.");
801 chg_virtue(V_KNOWLEDGE, -5);
803 lose_exp(p_ptr->exp / 4);
809 case SV_POTION_RUINATION:
812 msg_print("¿È¤â¿´¤â¼å¤Ã¤Æ¤¤Æ¡¢Àºµ¤¤¬È´¤±¤Æ¤¤¤¯¤è¤¦¤À¡£");
813 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), "ÇËÌǤÎÌô", -1);
815 msg_print("Your nerves and muscles feel weak and lifeless!");
816 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), "a potion of Ruination", -1);
819 (void)dec_stat(A_DEX, 25, TRUE);
820 (void)dec_stat(A_WIS, 25, TRUE);
821 (void)dec_stat(A_CON, 25, TRUE);
822 (void)dec_stat(A_STR, 25, TRUE);
823 (void)dec_stat(A_CHR, 25, TRUE);
824 (void)dec_stat(A_INT, 25, TRUE);
829 case SV_POTION_DEC_STR:
831 if (do_dec_stat(A_STR)) ident = TRUE;
835 case SV_POTION_DEC_INT:
837 if (do_dec_stat(A_INT)) ident = TRUE;
841 case SV_POTION_DEC_WIS:
843 if (do_dec_stat(A_WIS)) ident = TRUE;
847 case SV_POTION_DEC_DEX:
849 if (do_dec_stat(A_DEX)) ident = TRUE;
853 case SV_POTION_DEC_CON:
855 if (do_dec_stat(A_CON)) ident = TRUE;
859 case SV_POTION_DEC_CHR:
861 if (do_dec_stat(A_CHR)) ident = TRUE;
865 case SV_POTION_DETONATIONS:
868 msg_print("ÂΤÎÃæ¤Ç·ã¤·¤¤Çúȯ¤¬µ¯¤¤¿¡ª");
869 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), "Çúȯ¤ÎÌô", -1);
871 msg_print("Massive explosions rupture your body!");
872 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), "a potion of Detonation", -1);
875 (void)set_stun(p_ptr->stun + 75);
876 (void)set_cut(p_ptr->cut + 5000);
881 case SV_POTION_DEATH:
883 chg_virtue(V_VITALITY, -1);
884 chg_virtue(V_UNLIFE, 5);
886 msg_print("»à¤Îͽ´¶¤¬ÂÎÃæ¤ò¶î¤±¤á¤°¤Ã¤¿¡£");
887 take_hit(DAMAGE_LOSELIFE, 5000, "»à¤ÎÌô", -1);
889 msg_print("A feeling of Death flows through your body.");
890 take_hit(DAMAGE_LOSELIFE, 5000, "a potion of Death", -1);
897 case SV_POTION_INFRAVISION:
899 if (set_tim_infra(p_ptr->tim_infra + 100 + randint(100), FALSE))
906 case SV_POTION_DETECT_INVIS:
908 if (set_tim_invis(p_ptr->tim_invis + 12 + randint(12), FALSE))
915 case SV_POTION_SLOW_POISON:
917 if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
921 case SV_POTION_CURE_POISON:
923 if (set_poisoned(0)) ident = TRUE;
927 case SV_POTION_BOLDNESS:
929 if (set_afraid(0)) ident = TRUE;
933 case SV_POTION_SPEED:
937 if (set_fast(randint(25) + 15, FALSE)) ident = TRUE;
941 (void)set_fast(p_ptr->fast + 5, FALSE);
946 case SV_POTION_RESIST_HEAT:
948 if (set_oppose_fire(p_ptr->oppose_fire + randint(10) + 10, FALSE))
955 case SV_POTION_RESIST_COLD:
957 if (set_oppose_cold(p_ptr->oppose_cold + randint(10) + 10, FALSE))
964 case SV_POTION_HEROISM:
966 if (set_afraid(0)) ident = TRUE;
967 if (set_hero(p_ptr->hero + randint(25) + 25, FALSE)) ident = TRUE;
968 if (hp_player(10)) ident = TRUE;
972 case SV_POTION_BESERK_STRENGTH:
974 if (set_afraid(0)) ident = TRUE;
975 if (set_shero(p_ptr->shero + randint(25) + 25, FALSE)) ident = TRUE;
976 if (hp_player(30)) ident = TRUE;
980 case SV_POTION_CURE_LIGHT:
982 if (hp_player(damroll(2, 8))) ident = TRUE;
983 if (set_blind(0)) ident = TRUE;
984 if (set_cut(p_ptr->cut - 10)) ident = TRUE;
985 if (set_shero(0,TRUE)) ident = TRUE;
989 case SV_POTION_CURE_SERIOUS:
991 if (hp_player(damroll(4, 8))) ident = TRUE;
992 if (set_blind(0)) ident = TRUE;
993 if (set_confused(0)) ident = TRUE;
994 if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;
995 if (set_shero(0,TRUE)) ident = TRUE;
999 case SV_POTION_CURE_CRITICAL:
1001 if (hp_player(damroll(6, 8))) ident = TRUE;
1002 if (set_blind(0)) ident = TRUE;
1003 if (set_confused(0)) ident = TRUE;
1004 if (set_poisoned(0)) ident = TRUE;
1005 if (set_stun(0)) ident = TRUE;
1006 if (set_cut(0)) ident = TRUE;
1007 if (set_shero(0,TRUE)) ident = TRUE;
1011 case SV_POTION_HEALING:
1013 if (hp_player(300)) ident = TRUE;
1014 if (set_blind(0)) ident = TRUE;
1015 if (set_confused(0)) ident = TRUE;
1016 if (set_poisoned(0)) ident = TRUE;
1017 if (set_stun(0)) ident = TRUE;
1018 if (set_cut(0)) ident = TRUE;
1019 if (set_shero(0,TRUE)) ident = TRUE;
1023 case SV_POTION_STAR_HEALING:
1025 if (hp_player(1200)) ident = TRUE;
1026 if (set_blind(0)) ident = TRUE;
1027 if (set_confused(0)) ident = TRUE;
1028 if (set_poisoned(0)) ident = TRUE;
1029 if (set_stun(0)) ident = TRUE;
1030 if (set_cut(0)) ident = TRUE;
1031 if (set_shero(0,TRUE)) ident = TRUE;
1035 case SV_POTION_LIFE:
1037 chg_virtue(V_VITALITY, 1);
1038 chg_virtue(V_UNLIFE, -5);
1040 msg_print("ÂÎÃæ¤ËÀ¸Ì¿ÎϤ¬Ëþ¤Á¤¢¤Õ¤ì¤Æ¤¤¿¡ª");
1042 msg_print("You feel life flow through your body!");
1046 (void)set_poisoned(0);
1048 (void)set_confused(0);
1052 (void)do_res_stat(A_STR);
1053 (void)do_res_stat(A_CON);
1054 (void)do_res_stat(A_DEX);
1055 (void)do_res_stat(A_WIS);
1056 (void)do_res_stat(A_INT);
1057 (void)do_res_stat(A_CHR);
1058 (void)set_shero(0,TRUE);
1065 case SV_POTION_RESTORE_MANA:
1067 if (p_ptr->pclass == CLASS_MAGIC_EATER)
1070 for (i = 0; i < 72; i++)
1072 p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? 0x30000 : p_ptr->magic_num2[i]*0x05555;
1073 if (p_ptr->magic_num1[i] > p_ptr->magic_num2[i]*0x10000) p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*0x10000L;
1075 for (; i < 108; i++)
1077 int k_idx = lookup_kind(TV_ROD, i-72);
1078 p_ptr->magic_num1[i] -= ((p_ptr->magic_num2[i] < 10) ? 0x30000 : p_ptr->magic_num2[i]*0x5555)*k_info[k_idx].pval;
1079 if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
1082 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
1084 msg_print("Your feel your head clear.");
1086 p_ptr->window |= (PW_PLAYER);
1089 else if (p_ptr->csp < p_ptr->msp)
1091 p_ptr->csp = p_ptr->msp;
1092 p_ptr->csp_frac = 0;
1094 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
1096 msg_print("Your feel your head clear.");
1099 p_ptr->redraw |= (PR_MANA);
1100 p_ptr->window |= (PW_PLAYER);
1101 p_ptr->window |= (PW_SPELL);
1104 if (set_shero(0,TRUE)) ident = TRUE;
1108 case SV_POTION_RESTORE_EXP:
1110 if (restore_level()) ident = TRUE;
1114 case SV_POTION_RES_STR:
1116 if (do_res_stat(A_STR)) ident = TRUE;
1120 case SV_POTION_RES_INT:
1122 if (do_res_stat(A_INT)) ident = TRUE;
1126 case SV_POTION_RES_WIS:
1128 if (do_res_stat(A_WIS)) ident = TRUE;
1132 case SV_POTION_RES_DEX:
1134 if (do_res_stat(A_DEX)) ident = TRUE;
1138 case SV_POTION_RES_CON:
1140 if (do_res_stat(A_CON)) ident = TRUE;
1144 case SV_POTION_RES_CHR:
1146 if (do_res_stat(A_CHR)) ident = TRUE;
1150 case SV_POTION_INC_STR:
1152 if (do_inc_stat(A_STR)) ident = TRUE;
1156 case SV_POTION_INC_INT:
1158 if (do_inc_stat(A_INT)) ident = TRUE;
1162 case SV_POTION_INC_WIS:
1164 if (do_inc_stat(A_WIS)) ident = TRUE;
1168 case SV_POTION_INC_DEX:
1170 if (do_inc_stat(A_DEX)) ident = TRUE;
1174 case SV_POTION_INC_CON:
1176 if (do_inc_stat(A_CON)) ident = TRUE;
1180 case SV_POTION_INC_CHR:
1182 if (do_inc_stat(A_CHR)) ident = TRUE;
1186 case SV_POTION_AUGMENTATION:
1188 if (do_inc_stat(A_STR)) ident = TRUE;
1189 if (do_inc_stat(A_INT)) ident = TRUE;
1190 if (do_inc_stat(A_WIS)) ident = TRUE;
1191 if (do_inc_stat(A_DEX)) ident = TRUE;
1192 if (do_inc_stat(A_CON)) ident = TRUE;
1193 if (do_inc_stat(A_CHR)) ident = TRUE;
1197 case SV_POTION_ENLIGHTENMENT:
1199 chg_virtue(V_ENLIGHTEN, 1);
1201 msg_print("¼«Ê¬¤ÎÃÖ¤«¤ì¤Æ¤¤¤ë¾õ¶·¤¬Ç¾Î¢¤ËÉ⤫¤ó¤Ç¤¤¿...");
1203 msg_print("An image of your surroundings forms in your mind...");
1206 chg_virtue(V_KNOWLEDGE, 1);
1207 chg_virtue(V_ENLIGHTEN, 1);
1208 wiz_lite(FALSE, FALSE);
1213 case SV_POTION_STAR_ENLIGHTENMENT:
1216 msg_print("¹¹¤Ê¤ë·¼Ìؤò´¶¤¸¤¿...");
1218 msg_print("You begin to feel more enlightened...");
1221 chg_virtue(V_KNOWLEDGE, 1);
1222 chg_virtue(V_ENLIGHTEN, 1);
1224 wiz_lite(TRUE, FALSE);
1225 (void)do_inc_stat(A_INT);
1226 (void)do_inc_stat(A_WIS);
1227 (void)detect_traps(DETECT_RAD_DEFAULT);
1228 (void)detect_doors(DETECT_RAD_DEFAULT);
1229 (void)detect_stairs(DETECT_RAD_DEFAULT);
1230 (void)detect_treasure(DETECT_RAD_DEFAULT);
1231 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
1232 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
1239 case SV_POTION_SELF_KNOWLEDGE:
1242 msg_print("¼«Ê¬¼«¿È¤Î¤³¤È¤¬¾¯¤·¤Ïʬ¤«¤Ã¤¿µ¤¤¬¤¹¤ë...");
1244 msg_print("You begin to know yourself a little better...");
1253 case SV_POTION_EXPERIENCE:
1255 if (p_ptr->prace == RACE_ANDROID) break;
1256 chg_virtue(V_ENLIGHTEN, 1);
1257 if (p_ptr->exp < PY_MAX_EXP)
1259 s32b ee = (p_ptr->exp / 2) + 10;
1260 if (ee > 100000L) ee = 100000L;
1262 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1264 msg_print("You feel more experienced.");
1273 case SV_POTION_RESISTANCE:
1275 (void)set_oppose_acid(p_ptr->oppose_acid + randint(20) + 20, FALSE);
1276 (void)set_oppose_elec(p_ptr->oppose_elec + randint(20) + 20, FALSE);
1277 (void)set_oppose_fire(p_ptr->oppose_fire + randint(20) + 20, FALSE);
1278 (void)set_oppose_cold(p_ptr->oppose_cold + randint(20) + 20, FALSE);
1279 (void)set_oppose_pois(p_ptr->oppose_pois + randint(20) + 20, FALSE);
1284 case SV_POTION_CURING:
1286 if (hp_player(50)) ident = TRUE;
1287 if (set_blind(0)) ident = TRUE;
1288 if (set_poisoned(0)) ident = TRUE;
1289 if (set_confused(0)) ident = TRUE;
1290 if (set_stun(0)) ident = TRUE;
1291 if (set_cut(0)) ident = TRUE;
1292 if (set_image(0)) ident = TRUE;
1296 case SV_POTION_INVULNERABILITY:
1298 (void)set_invuln(p_ptr->invuln + randint(4) + 4, FALSE);
1303 case SV_POTION_NEW_LIFE:
1305 do_cmd_rerate(FALSE);
1307 p_ptr->update |= PU_BONUS;
1308 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
1310 chg_virtue(V_CHANCE, -5);
1312 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
1314 msg_print("You are cured of all mutations.");
1317 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
1318 p_ptr->update |= PU_BONUS;
1320 mutant_regenerate_mod = calc_mutant_regenerate_mod();
1326 case SV_POTION_NEO_TSUYOSHI:
1329 (void)set_tsuyoshi(p_ptr->tsuyoshi + randint(100) + 100, FALSE);
1334 case SV_POTION_TSUYOSHI:
1337 msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
1339 msg_print("Brother OKURE!");
1342 p_ptr->tsuyoshi = 1;
1343 (void)set_tsuyoshi(0, TRUE);
1344 if (!p_ptr->resist_chaos)
1346 (void)set_image(50 + randint(50));
1352 case SV_POTION_POLYMORPH:
1354 if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23))
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;
1373 if(gain_random_mutation(0)) ident = TRUE;
1375 else if (lose_mutation(0)) ident = TRUE;
1376 } while(!ident || one_in_(2));
1382 if (p_ptr->prace == RACE_SKELETON)
1385 msg_print("±ÕÂΤΰìÉô¤Ï¤¢¤Ê¤¿¤Î¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¤¿¡ª");
1387 msg_print("Some of the fluid falls through your jaws!");
1390 (void)potion_smash_effect(0, py, px, q_ptr->k_idx);
1393 /* Combine / Reorder the pack (later) */
1394 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1396 if (!(object_aware_p(o_ptr)))
1398 chg_virtue(V_PATIENCE, -1);
1399 chg_virtue(V_CHANCE, 1);
1400 chg_virtue(V_KNOWLEDGE, -1);
1403 /* The item has been tried */
1404 object_tried(q_ptr);
1406 /* An identification was made */
1407 if (ident && !object_aware_p(q_ptr))
1409 object_aware(q_ptr);
1410 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
1414 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
1416 /* Potions can feed the player */
1417 switch (p_ptr->mimic_form)
1420 switch (p_ptr->prace)
1423 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
1434 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1437 (void)set_food(p_ptr->food + o_ptr->pval);
1442 case MIMIC_DEMON_LORD:
1443 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1446 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
1449 (void)set_food(p_ptr->food + o_ptr->pval);
1455 void do_cmd_quaff_potion(void)
1460 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
1462 set_action(ACTION_NONE);
1465 /* Restrict choices to potions */
1466 item_tester_tval = TV_POTION;
1470 q = "¤É¤ÎÌô¤ò°û¤ß¤Þ¤¹¤«? ";
1471 s = "°û¤á¤ëÌô¤¬¤Ê¤¤¡£";
1473 q = "Quaff which potion? ";
1474 s = "You have no potions to quaff.";
1477 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1479 /* Quaff the potion */
1480 do_cmd_quaff_potion_aux(item);
1485 * Read a scroll (from the pack or floor).
1487 * Certain scrolls can be "aborted" without losing the scroll. These
1488 * include scrolls with no effects but recharge or identify, which are
1489 * cancelled before use. XXX Reading them still takes a turn, though.
1491 static void do_cmd_read_scroll_aux(int item)
1493 int k, used_up, ident, lev;
1498 /* Get the item (in the pack) */
1501 o_ptr = &inventory[item];
1504 /* Get the item (on the floor) */
1507 o_ptr = &o_list[0 - item];
1516 if (flush_failure) flush();
1518 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
1520 msg_print("Nothing happen.");
1527 if (p_ptr->pclass == CLASS_BERSERKER)
1530 msg_print("´¬Êª¤Ê¤ó¤ÆÆɤá¤Ê¤¤¡£");
1532 msg_print("You cannot read.");
1537 if((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0])
1542 /* Not identified yet */
1546 lev = get_object_level(o_ptr);
1548 /* Assume the scroll will get used up */
1551 if (o_ptr->tval == TV_SCROLL)
1553 /* Analyze the scroll */
1554 switch (o_ptr->sval)
1556 case SV_SCROLL_DARKNESS:
1558 if (!(p_ptr->resist_blind) && !(p_ptr->resist_dark))
1560 (void)set_blind(p_ptr->blind + 3 + randint(5));
1562 if (unlite_area(10, 3)) ident = TRUE;
1566 case SV_SCROLL_AGGRAVATE_MONSTER:
1569 msg_print("¥«¥ó¹â¤¯¤¦¤Ê¤ëÍͤʲ»¤¬ÊÕ¤ê¤òʤ¤Ã¤¿¡£");
1571 msg_print("There is a high pitched humming noise.");
1574 aggravate_monsters(0);
1579 case SV_SCROLL_CURSE_ARMOR:
1581 if (curse_armor()) ident = TRUE;
1585 case SV_SCROLL_CURSE_WEAPON:
1587 if (curse_weapon(FALSE, INVEN_RARM)) ident = TRUE;
1591 case SV_SCROLL_SUMMON_MONSTER:
1593 for (k = 0; k < randint(3); k++)
1595 if (summon_specific(0, py, px, dun_level, 0, TRUE, FALSE, FALSE, TRUE, TRUE))
1603 case SV_SCROLL_SUMMON_UNDEAD:
1605 for (k = 0; k < randint(3); k++)
1607 if (summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, TRUE, FALSE, FALSE, TRUE, TRUE))
1615 case SV_SCROLL_SUMMON_PET:
1617 if (summon_specific(-1, py, px, dun_level, 0, TRUE, TRUE, TRUE, FALSE, FALSE))
1624 case SV_SCROLL_SUMMON_KIN:
1626 if (summon_kin_player(TRUE, p_ptr->lev, py, px, TRUE))
1633 case SV_SCROLL_TRAP_CREATION:
1635 if (trap_creation(py, px)) ident = TRUE;
1639 case SV_SCROLL_PHASE_DOOR:
1641 teleport_player(10);
1646 case SV_SCROLL_TELEPORT:
1648 teleport_player(100);
1653 case SV_SCROLL_TELEPORT_LEVEL:
1655 (void)teleport_player_level();
1660 case SV_SCROLL_WORD_OF_RECALL:
1662 if (!word_of_recall()) used_up = FALSE;
1667 case SV_SCROLL_IDENTIFY:
1670 if (!ident_spell(FALSE)) used_up = FALSE;
1674 case SV_SCROLL_STAR_IDENTIFY:
1677 if (!identify_fully(FALSE)) used_up = FALSE;
1681 case SV_SCROLL_REMOVE_CURSE:
1686 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1688 msg_print("You feel as if someone is watching over you.");
1696 case SV_SCROLL_STAR_REMOVE_CURSE:
1698 if (remove_all_curse())
1701 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1703 msg_print("You feel as if someone is watching over you.");
1710 case SV_SCROLL_ENCHANT_ARMOR:
1713 if (!enchant_spell(0, 0, 1)) used_up = FALSE;
1717 case SV_SCROLL_ENCHANT_WEAPON_TO_HIT:
1719 if (!enchant_spell(1, 0, 0)) used_up = FALSE;
1724 case SV_SCROLL_ENCHANT_WEAPON_TO_DAM:
1726 if (!enchant_spell(0, 1, 0)) used_up = FALSE;
1731 case SV_SCROLL_STAR_ENCHANT_ARMOR:
1733 if (!enchant_spell(0, 0, randint(3) + 2)) used_up = FALSE;
1738 case SV_SCROLL_STAR_ENCHANT_WEAPON:
1740 if (!enchant_spell(randint(3), randint(3), 0)) used_up = FALSE;
1745 case SV_SCROLL_RECHARGING:
1747 if (!recharge(130)) used_up = FALSE;
1752 case SV_SCROLL_MUNDANITY:
1755 if (!mundane_spell(FALSE)) used_up = FALSE;
1759 case SV_SCROLL_LIGHT:
1761 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
1765 case SV_SCROLL_MAPPING:
1767 map_area(DETECT_RAD_MAP);
1772 case SV_SCROLL_DETECT_GOLD:
1774 if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
1775 if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
1779 case SV_SCROLL_DETECT_ITEM:
1781 if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
1785 case SV_SCROLL_DETECT_TRAP:
1787 if (detect_traps(DETECT_RAD_DEFAULT)) ident = TRUE;
1791 case SV_SCROLL_DETECT_DOOR:
1793 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
1794 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
1798 case SV_SCROLL_DETECT_INVIS:
1800 if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
1804 case SV_SCROLL_SATISFY_HUNGER:
1806 if (set_food(PY_FOOD_MAX - 1)) ident = TRUE;
1810 case SV_SCROLL_BLESSING:
1812 if (set_blessed(p_ptr->blessed + randint(12) + 6, FALSE)) ident = TRUE;
1816 case SV_SCROLL_HOLY_CHANT:
1818 if (set_blessed(p_ptr->blessed + randint(24) + 12, FALSE)) ident = TRUE;
1822 case SV_SCROLL_HOLY_PRAYER:
1824 if (set_blessed(p_ptr->blessed + randint(48) + 24, FALSE)) ident = TRUE;
1828 case SV_SCROLL_MONSTER_CONFUSION:
1830 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1833 msg_print("¼ê¤¬µ±¤»Ï¤á¤¿¡£");
1835 msg_print("Your hands begin to glow.");
1838 p_ptr->special_attack |= ATTACK_CONFUSE;
1839 p_ptr->redraw |= (PR_STATUS);
1845 case SV_SCROLL_PROTECTION_FROM_EVIL:
1848 if (set_protevil(p_ptr->protevil + randint(25) + k, FALSE)) ident = TRUE;
1852 case SV_SCROLL_RUNE_OF_PROTECTION:
1859 case SV_SCROLL_TRAP_DOOR_DESTRUCTION:
1861 if (destroy_doors_touch()) ident = TRUE;
1865 case SV_SCROLL_STAR_DESTRUCTION:
1867 if (destroy_area(py, px, 13+rand_int(5), TRUE))
1871 msg_print("¥À¥ó¥¸¥ç¥ó¤¬Íɤ줿...");
1873 msg_print("The dungeon trembles...");
1880 case SV_SCROLL_DISPEL_UNDEAD:
1882 if (dispel_undead(80)) ident = TRUE;
1886 case SV_SCROLL_SPELL:
1888 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;
1889 p_ptr->add_spells++;
1890 p_ptr->update |= (PU_SPELLS);
1895 case SV_SCROLL_GENOCIDE:
1897 (void)symbol_genocide(300, TRUE);
1902 case SV_SCROLL_MASS_GENOCIDE:
1904 (void)mass_genocide(300, TRUE);
1909 case SV_SCROLL_ACQUIREMENT:
1911 acquirement(py, px, 1, TRUE, FALSE);
1916 case SV_SCROLL_STAR_ACQUIREMENT:
1918 acquirement(py, px, randint(2) + 1, TRUE, FALSE);
1923 /* New Hengband scrolls */
1924 case SV_SCROLL_FIRE:
1926 fire_ball(GF_FIRE, 0, 666, 4);
1927 /* Note: "Double" damage since it is centered on the player ... */
1928 if (!(p_ptr->oppose_fire || p_ptr->resist_fire || p_ptr->immune_fire))
1930 take_hit(DAMAGE_NOESCAPE, 50+randint(50), "±ê¤Î´¬Êª", -1);
1932 take_hit(DAMAGE_NOESCAPE, 50 + randint(50), "a Scroll of Fire", -1);
1942 fire_ball(GF_ICE, 0, 777, 4);
1943 if (!(p_ptr->oppose_cold || p_ptr->resist_cold || p_ptr->immune_cold))
1945 take_hit(DAMAGE_NOESCAPE, 100+randint(100), "ɹ¤Î´¬Êª", -1);
1947 take_hit(DAMAGE_NOESCAPE, 100 + randint(100), "a Scroll of Ice", -1);
1954 case SV_SCROLL_CHAOS:
1956 fire_ball(GF_CHAOS, 0, 1000, 4);
1957 if (!p_ptr->resist_chaos)
1959 take_hit(DAMAGE_NOESCAPE, 111+randint(111), "¥í¥°¥ë¥¹¤Î´¬Êª", -1);
1961 take_hit(DAMAGE_NOESCAPE, 111 + randint(111), "a Scroll of Logrus", -1);
1968 case SV_SCROLL_RUMOR:
1972 switch (randint(20))
1976 err = get_rnd_line("chainswd_j.txt", 0, Rumor);
1978 err = get_rnd_line("chainswd.txt", 0, Rumor);
1984 err = get_rnd_line("error_j.txt", 0, Rumor);
1986 err = get_rnd_line("error.txt", 0, Rumor);
1994 err = get_rnd_line("death_j.txt", 0, Rumor);
1996 err = get_rnd_line("death.txt", 0, Rumor);
2002 err = get_rnd_line_jonly("rumors_j.txt", 0, Rumor, 10);
2004 err = get_rnd_line("rumors.txt", 0, Rumor);
2010 /* An error occured */
2012 if (err) strcpy(Rumor, "±³¤Î±½¤â¤¢¤ë¡£");
2014 if (err) strcpy(Rumor, "Some rumors are wrong.");
2019 msg_print("´¬Êª¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤¬½ñ¤«¤ì¤Æ¤¤¤ë:");
2021 msg_print("There is message on the scroll. It says:");
2025 msg_format("%s", Rumor);
2028 msg_print("´¬Êª¤Ï±ì¤òΩ¤Æ¤Æ¾Ã¤¨µî¤Ã¤¿¡ª");
2030 msg_print("The scroll disappears in a puff of smoke!");
2037 case SV_SCROLL_ARTIFACT:
2040 if (!artifact_scroll()) used_up = FALSE;
2044 case SV_SCROLL_RESET_RECALL:
2047 if (!reset_recall()) used_up = FALSE;
2052 else if (o_ptr->tval == TV_SOFT_ARMOR)
2055 msg_print("»ä¤Ï¶ìÏ«¤·¤Æ¡Ø¥°¥ì¡¼¥¿¡¼¡¦¥Ø¥ë=¥Ó¡¼¥¹¥È¡Ù¤òÅݤ·¤¿¡£");
2056 msg_print("¤·¤«¤·¼ê¤ËÆþ¤Ã¤¿¤Î¤Ï¤³¤Î¤¤¿¤Ê¤¤£Ô¥·¥ã¥Ä¤À¤±¤À¤Ã¤¿¡£");
2058 msg_print("I had a very hard time to kill the Greater hell-beast, ");
2059 msg_print("but all I got was this lousy t-shirt!");
2063 else if (o_ptr->name1 == ART_POWER)
2066 msg_print("¡Ö°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤òÅý¤Ù¡¢");
2068 msg_print("°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤ò¸«¤Ä¤±¡¢");
2070 msg_print("°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤òÊá¤é¤¨¤Æ");
2072 msg_print("°Å°Ç¤ÎÃæ¤Ë·Ò¤®¤È¤á¤ë¡£¡×");
2074 msg_print("'One Ring to rule them all, ");
2076 msg_print("One Ring to find them, ");
2078 msg_print("One Ring to bring them all ");
2080 msg_print("and in the darkness bind them.'");
2087 char o_name[MAX_NLEN];
2093 q=format("book-%d_jp.txt",o_ptr->sval);
2095 /* Display object description */
2096 object_desc(o_name, o_ptr, TRUE, 0);
2098 /* Build the filename */
2099 path_build(buf, 1024, ANGBAND_DIR_FILE, q);
2101 /* Peruse the help file */
2102 (void)show_file(TRUE, buf, o_name, 0, 0);
2111 /* Combine / Reorder the pack (later) */
2112 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2114 if (!(object_aware_p(o_ptr)))
2116 chg_virtue(V_PATIENCE, -1);
2117 chg_virtue(V_CHANCE, 1);
2118 chg_virtue(V_KNOWLEDGE, -1);
2121 /* The item was tried */
2122 object_tried(o_ptr);
2124 /* An identification was made */
2125 if (ident && !object_aware_p(o_ptr))
2127 object_aware(o_ptr);
2128 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
2132 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
2135 /* Hack -- allow certain scrolls to be "preserved" */
2141 sound(SOUND_SCROLL);
2143 /* Destroy a scroll in the pack */
2146 inven_item_increase(item, -1);
2147 inven_item_describe(item);
2148 inven_item_optimize(item);
2151 /* Destroy a scroll on the floor */
2154 floor_item_increase(0 - item, -1);
2155 floor_item_describe(0 - item);
2156 floor_item_optimize(0 - item);
2159 /* Can save again */
2164 * Hook to determine if an object is readable
2166 static bool item_tester_hook_readable(object_type *o_ptr)
2168 if ((o_ptr->tval==TV_SCROLL) || (o_ptr->tval==TV_PARCHEMENT) || ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_T_SHIRT)) || (o_ptr->name1 == ART_POWER)) return (TRUE);
2175 void do_cmd_read_scroll(void)
2180 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
2182 set_action(ACTION_NONE);
2185 /* Check some conditions */
2189 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡£");
2191 msg_print("You can't see anything.");
2199 msg_print("ÌÀ¤«¤ê¤¬¤Ê¤¤¤Î¤Ç¡¢°Å¤¯¤ÆÆɤá¤Ê¤¤¡£");
2201 msg_print("You have no light to read by.");
2206 if (p_ptr->confused)
2209 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡£");
2211 msg_print("You are too confused!");
2218 /* Restrict choices to scrolls */
2219 item_tester_hook = item_tester_hook_readable;
2223 q = "¤É¤Î´¬Êª¤òÆɤߤޤ¹¤«? ";
2224 s = "Æɤá¤ë´¬Êª¤¬¤Ê¤¤¡£";
2226 q = "Read which scroll? ";
2227 s = "You have no scrolls to read.";
2230 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
2232 /* Read the scroll */
2233 do_cmd_read_scroll_aux(item);
2237 static int staff_effect(int sval, bool *use_charge, bool magic)
2242 /* Analyze the staff */
2245 case SV_STAFF_DARKNESS:
2247 if (!(p_ptr->resist_blind) && !(p_ptr->resist_dark))
2249 if (set_blind(p_ptr->blind + 3 + randint(5))) ident = TRUE;
2251 if (unlite_area(10, 3)) ident = TRUE;
2255 case SV_STAFF_SLOWNESS:
2257 if (set_slow(p_ptr->slow + randint(30) + 15, FALSE)) ident = TRUE;
2261 case SV_STAFF_HASTE_MONSTERS:
2263 if (speed_monsters()) ident = TRUE;
2267 case SV_STAFF_SUMMONING:
2269 for (k = 0; k < randint(4); k++)
2271 if (summon_specific(0, py, px, dun_level, 0, TRUE, FALSE, FALSE, TRUE, TRUE))
2279 case SV_STAFF_TELEPORTATION:
2281 teleport_player(100);
2286 case SV_STAFF_IDENTIFY:
2288 if (!ident_spell(FALSE)) *use_charge = FALSE;
2293 case SV_STAFF_REMOVE_CURSE:
2300 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2302 msg_print("You feel as if someone is watching over you.");
2305 else if (!p_ptr->blind)
2308 msg_print("¾ó¤Ï°ì½Ö¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
2310 msg_print("The staff glows blue for a moment...");
2319 case SV_STAFF_STARLITE:
2321 int num = damroll(5, 3);
2325 if (!p_ptr->blind && !magic)
2328 msg_print("¾ó¤ÎÀ褬ÌÀ¤ë¤¯µ±¤¤¤¿...");
2330 msg_print("The end of the staff glows brightly...");
2334 for (k = 0; k < num; k++)
2340 scatter(&y, &x, py, px, 4, 0);
2342 if (!cave_floor_bold(y, x)) continue;
2344 if ((y != py) || (x != px)) break;
2347 project(0, 0, y, x, damroll(6 + p_ptr->lev / 8, 10), GF_LITE_WEAK,
2348 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL), -1);
2356 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
2360 case SV_STAFF_MAPPING:
2362 map_area(DETECT_RAD_MAP);
2367 case SV_STAFF_DETECT_GOLD:
2369 if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
2370 if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
2374 case SV_STAFF_DETECT_ITEM:
2376 if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
2380 case SV_STAFF_DETECT_TRAP:
2382 if (detect_traps(DETECT_RAD_DEFAULT)) ident = TRUE;
2386 case SV_STAFF_DETECT_DOOR:
2388 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
2389 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
2393 case SV_STAFF_DETECT_INVIS:
2395 if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
2399 case SV_STAFF_DETECT_EVIL:
2401 if (detect_monsters_evil(DETECT_RAD_DEFAULT)) ident = TRUE;
2405 case SV_STAFF_CURE_LIGHT:
2407 if (hp_player(damroll(2, 8))) ident = TRUE;
2408 if (set_shero(0,TRUE)) ident = TRUE;
2412 case SV_STAFF_CURING:
2414 if (set_blind(0)) ident = TRUE;
2415 if (set_poisoned(0)) ident = TRUE;
2416 if (set_confused(0)) ident = TRUE;
2417 if (set_stun(0)) ident = TRUE;
2418 if (set_cut(0)) ident = TRUE;
2419 if (set_image(0)) ident = TRUE;
2420 if (set_shero(0,TRUE)) ident = TRUE;
2424 case SV_STAFF_HEALING:
2426 if (hp_player(300)) ident = TRUE;
2427 if (set_stun(0)) ident = TRUE;
2428 if (set_cut(0)) ident = TRUE;
2429 if (set_shero(0,TRUE)) ident = TRUE;
2433 case SV_STAFF_THE_MAGI:
2435 if (do_res_stat(A_INT)) ident = TRUE;
2436 if (p_ptr->csp < p_ptr->msp)
2438 p_ptr->csp = p_ptr->msp;
2439 p_ptr->csp_frac = 0;
2442 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
2444 msg_print("Your feel your head clear.");
2447 p_ptr->redraw |= (PR_MANA);
2448 p_ptr->window |= (PW_PLAYER);
2449 p_ptr->window |= (PW_SPELL);
2451 if (set_shero(0,TRUE)) ident = TRUE;
2455 case SV_STAFF_SLEEP_MONSTERS:
2457 if (sleep_monsters()) ident = TRUE;
2461 case SV_STAFF_SLOW_MONSTERS:
2463 if (slow_monsters()) ident = TRUE;
2467 case SV_STAFF_SPEED:
2469 if (set_fast(randint(30) + 15, FALSE)) ident = TRUE;
2473 case SV_STAFF_PROBING:
2480 case SV_STAFF_DISPEL_EVIL:
2482 if (dispel_evil(80)) ident = TRUE;
2486 case SV_STAFF_POWER:
2488 if (dispel_monsters(150)) ident = TRUE;
2492 case SV_STAFF_HOLINESS:
2494 if (dispel_evil(150)) ident = TRUE;
2496 if (set_protevil((magic ? 0 : p_ptr->protevil) + randint(25) + k, FALSE)) ident = TRUE;
2497 if (set_poisoned(0)) ident = TRUE;
2498 if (set_afraid(0)) ident = TRUE;
2499 if (hp_player(50)) ident = TRUE;
2500 if (set_stun(0)) ident = TRUE;
2501 if (set_cut(0)) ident = TRUE;
2505 case SV_STAFF_GENOCIDE:
2507 (void)symbol_genocide((magic ? p_ptr->lev + 50 : 200), TRUE);
2512 case SV_STAFF_EARTHQUAKES:
2514 if (earthquake(py, px, 10))
2518 msg_print("¥À¥ó¥¸¥ç¥ó¤¬Íɤ줿¡£");
2520 msg_print("The dungeon trembles.");
2527 case SV_STAFF_DESTRUCTION:
2529 if (destroy_area(py, px, 13+rand_int(5), TRUE))
2535 case SV_STAFF_ANIMATE_DEAD:
2537 if (animate_dead(0, py, px))
2543 case SV_STAFF_MSTORM:
2546 msg_print("¶¯ÎϤÊËâÎϤ¬Å¨¤ò°ú¤Îö¤¤¤¿¡ª");
2548 msg_print("Mighty magics rend your enemies!");
2550 project(0, 5, py, px,
2551 (randint(200) + 300) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID | PROJECT_NO_REF, -1);
2552 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))
2555 (void)take_hit(DAMAGE_NOESCAPE, 50, "¥³¥ó¥È¥í¡¼¥ë¤·Æñ¤¤¶¯ÎϤÊËâÎϤβòÊü", -1);
2557 (void)take_hit(DAMAGE_NOESCAPE, 50, "unleashing magics too mighty to control", -1);
2569 * Use a staff. -RAK-
2571 * One charge of one staff disappears.
2573 * Hack -- staffs of identify can be "cancelled".
2575 static void do_cmd_use_staff_aux(int item)
2577 int ident, chance, lev;
2581 /* Hack -- let staffs of identify get aborted */
2582 bool use_charge = TRUE;
2585 /* Get the item (in the pack) */
2588 o_ptr = &inventory[item];
2591 /* Get the item (on the floor) */
2594 o_ptr = &o_list[0 - item];
2598 /* Mega-Hack -- refuse to use a pile from the ground */
2599 if ((item < 0) && (o_ptr->number > 1))
2602 msg_print("¤Þ¤º¤Ï¾ó¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
2604 msg_print("You must first pick up the staffs.");
2614 /* Extract the item level */
2615 lev = get_object_level(o_ptr);
2616 if (lev > 50) lev = 50 + (lev - 50)/2;
2618 /* Base chance of success */
2619 chance = p_ptr->skill_dev;
2621 /* Confusion hurts skill */
2622 if (p_ptr->confused) chance = chance / 2;
2624 /* Hight level objects are harder */
2625 chance = chance - lev;
2627 /* Give everyone a (slight) chance */
2628 if ((chance < USE_DEVICE) && (rand_int(USE_DEVICE - chance + 1) == 0))
2630 chance = USE_DEVICE;
2635 if (flush_failure) flush();
2637 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
2639 msg_print("Nothing happen. Maybe this staff is freezing too.");
2646 /* Roll for usage */
2647 if ((chance < USE_DEVICE) || (randint(chance) < USE_DEVICE) || (p_ptr->pclass == CLASS_BERSERKER))
2649 if (flush_failure) flush();
2651 msg_print("¾ó¤ò¤¦¤Þ¤¯»È¤¨¤Ê¤«¤Ã¤¿¡£");
2653 msg_print("You failed to use the staff properly.");
2660 /* Notice empty staffs */
2661 if (o_ptr->pval <= 0)
2663 if (flush_failure) flush();
2665 msg_print("¤³¤Î¾ó¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£");
2667 msg_print("The staff has no charges left.");
2670 o_ptr->ident |= (IDENT_EMPTY);
2672 /* Combine / Reorder the pack (later) */
2673 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2682 ident = staff_effect(o_ptr->sval, &use_charge, FALSE);
2684 if (!(object_aware_p(o_ptr)))
2686 chg_virtue(V_PATIENCE, -1);
2687 chg_virtue(V_CHANCE, 1);
2688 chg_virtue(V_KNOWLEDGE, -1);
2691 /* Combine / Reorder the pack (later) */
2692 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2694 /* Tried the item */
2695 object_tried(o_ptr);
2697 /* An identification was made */
2698 if (ident && !object_aware_p(o_ptr))
2700 object_aware(o_ptr);
2701 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
2705 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
2708 /* Hack -- some uses are "free" */
2709 if (!use_charge) return;
2712 /* Use a single charge */
2715 /* XXX Hack -- unstack if necessary */
2716 if ((item >= 0) && (o_ptr->number > 1))
2721 /* Get local object */
2724 /* Obtain a local object */
2725 object_copy(q_ptr, o_ptr);
2727 /* Modify quantity */
2730 /* Restore the charges */
2733 /* Unstack the used item */
2735 p_ptr->total_weight -= q_ptr->weight;
2736 item = inven_carry(q_ptr);
2740 msg_print("¾ó¤ò¤Þ¤È¤á¤Ê¤ª¤·¤¿¡£");
2742 msg_print("You unstack your staff.");
2747 /* Describe charges in the pack */
2750 inven_item_charges(item);
2753 /* Describe charges on the floor */
2756 floor_item_charges(0 - item);
2761 void do_cmd_use_staff(void)
2766 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
2768 set_action(ACTION_NONE);
2771 /* Restrict choices to wands */
2772 item_tester_tval = TV_STAFF;
2776 q = "¤É¤Î¾ó¤ò»È¤¤¤Þ¤¹¤«? ";
2777 s = "»È¤¨¤ë¾ó¤¬¤Ê¤¤¡£";
2779 q = "Use which staff? ";
2780 s = "You have no staff to use.";
2783 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
2785 do_cmd_use_staff_aux(item);
2789 static int wand_effect(int sval, int dir, bool magic)
2793 /* XXX Hack -- Wand of wonder can do anything before it */
2794 if (sval == SV_WAND_WONDER)
2796 int vir = virtue_number(V_CHANCE);
2797 sval = rand_int(SV_WAND_WONDER);
2801 if (p_ptr->virtues[vir - 1] > 0)
2803 while (randint(300) < p_ptr->virtues[vir - 1]) sval++;
2804 if (sval > SV_WAND_COLD_BALL) sval = rand_int(4) + SV_WAND_ACID_BALL;
2808 while (randint(300) < (0-p_ptr->virtues[vir - 1])) sval--;
2809 if (sval < SV_WAND_HEAL_MONSTER) sval = rand_int(3) + SV_WAND_HEAL_MONSTER;
2812 if (sval < SV_WAND_TELEPORT_AWAY)
2813 chg_virtue(V_CHANCE, 1);
2816 /* Analyze the wand */
2819 case SV_WAND_HEAL_MONSTER:
2821 if (heal_monster(dir, damroll(10, 10))) ident = TRUE;
2825 case SV_WAND_HASTE_MONSTER:
2827 if (speed_monster(dir)) ident = TRUE;
2831 case SV_WAND_CLONE_MONSTER:
2833 if (clone_monster(dir)) ident = TRUE;
2837 case SV_WAND_TELEPORT_AWAY:
2839 if (teleport_monster(dir)) ident = TRUE;
2843 case SV_WAND_DISARMING:
2845 if (disarm_trap(dir)) ident = TRUE;
2849 case SV_WAND_TRAP_DOOR_DEST:
2851 if (destroy_door(dir)) ident = TRUE;
2855 case SV_WAND_STONE_TO_MUD:
2857 if (wall_to_mud(dir)) ident = TRUE;
2864 msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
2866 msg_print("A line of blue shimmering light appears.");
2869 (void)lite_line(dir);
2874 case SV_WAND_SLEEP_MONSTER:
2876 if (sleep_monster(dir)) ident = TRUE;
2880 case SV_WAND_SLOW_MONSTER:
2882 if (slow_monster(dir)) ident = TRUE;
2886 case SV_WAND_CONFUSE_MONSTER:
2888 if (confuse_monster(dir, p_ptr->lev)) ident = TRUE;
2892 case SV_WAND_FEAR_MONSTER:
2894 if (fear_monster(dir, p_ptr->lev)) ident = TRUE;
2898 case SV_WAND_DRAIN_LIFE:
2900 if (drain_life(dir, 80 + p_ptr->lev)) ident = TRUE;
2904 case SV_WAND_POLYMORPH:
2906 if (poly_monster(dir)) ident = TRUE;
2910 case SV_WAND_STINKING_CLOUD:
2912 fire_ball(GF_POIS, dir, 12 + p_ptr->lev / 4, 2);
2917 case SV_WAND_MAGIC_MISSILE:
2919 fire_bolt_or_beam(20, GF_MISSILE, dir, damroll(2 + p_ptr->lev / 10, 6));
2924 case SV_WAND_ACID_BOLT:
2926 fire_bolt_or_beam(20, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
2931 case SV_WAND_CHARM_MONSTER:
2933 if (charm_monster(dir, MAX(20, p_ptr->lev)))
2938 case SV_WAND_FIRE_BOLT:
2940 fire_bolt_or_beam(20, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
2945 case SV_WAND_COLD_BOLT:
2947 fire_bolt_or_beam(20, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
2952 case SV_WAND_ACID_BALL:
2954 fire_ball(GF_ACID, dir, 60 + 3 * p_ptr->lev / 4, 2);
2959 case SV_WAND_ELEC_BALL:
2961 fire_ball(GF_ELEC, dir, 40 + 3 * p_ptr->lev / 4, 2);
2966 case SV_WAND_FIRE_BALL:
2968 fire_ball(GF_FIRE, dir, 70 + 3 * p_ptr->lev / 4, 2);
2973 case SV_WAND_COLD_BALL:
2975 fire_ball(GF_COLD, dir, 50 + 3 * p_ptr->lev / 4, 2);
2980 case SV_WAND_WONDER:
2983 msg_print("¤ª¤Ã¤È¡¢Ææ¤ÎËâË¡ËÀ¤ò»ÏÆ°¤µ¤»¤¿¡£");
2985 msg_print("Oops. Wand of wonder activated.");
2991 case SV_WAND_DRAGON_FIRE:
2993 fire_ball(GF_FIRE, dir, 200, -3);
2998 case SV_WAND_DRAGON_COLD:
3000 fire_ball(GF_COLD, dir, 180, -3);
3005 case SV_WAND_DRAGON_BREATH:
3011 fire_ball(GF_ACID, dir, 240, -3);
3017 fire_ball(GF_ELEC, dir, 210, -3);
3023 fire_ball(GF_FIRE, dir, 240, -3);
3029 fire_ball(GF_COLD, dir, 210, -3);
3035 fire_ball(GF_POIS, dir, 180, -3);
3044 case SV_WAND_DISINTEGRATE:
3046 fire_ball(GF_DISINTEGRATE, dir, 200 + randint(p_ptr->lev * 2), 2);
3051 case SV_WAND_ROCKETS:
3054 msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡ª");
3056 msg_print("You launch a rocket!");
3059 fire_rocket(GF_ROCKET, dir, 250 + p_ptr->lev * 3, 2);
3064 case SV_WAND_STRIKING:
3066 fire_bolt(GF_METEOR, dir, damroll(15 + p_ptr->lev / 3, 13));
3071 case SV_WAND_GENOCIDE:
3073 fire_ball_hide(GF_GENOCIDE, dir, magic ? p_ptr->lev + 50 : 250, 0);
3083 * Aim a wand (from the pack or floor).
3085 * Use a single charge from a single item.
3086 * Handle "unstacking" in a logical manner.
3088 * For simplicity, you cannot use a stack of items from the
3089 * ground. This would require too much nasty code.
3091 * There are no wands which can "destroy" themselves, in the inventory
3092 * or on the ground, so we can ignore this possibility. Note that this
3093 * required giving "wand of wonder" the ability to ignore destruction
3094 * by electric balls.
3096 * All wands can be "cancelled" at the "Direction?" prompt for free.
3098 * Note that the basic "bolt" wands do slightly less damage than the
3099 * basic "bolt" rods, but the basic "ball" wands do the same damage
3100 * as the basic "ball" rods.
3102 static void do_cmd_aim_wand_aux(int item)
3104 int lev, ident, chance, dir;
3106 bool old_target_pet = target_pet;
3108 /* Get the item (in the pack) */
3111 o_ptr = &inventory[item];
3114 /* Get the item (on the floor) */
3117 o_ptr = &o_list[0 - item];
3120 /* Mega-Hack -- refuse to aim a pile from the ground */
3121 if ((item < 0) && (o_ptr->number > 1))
3124 msg_print("¤Þ¤º¤ÏËâË¡ËÀ¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
3126 msg_print("You must first pick up the wands.");
3133 /* Allow direction to be cancelled for free */
3134 if (object_aware_p(o_ptr) && (o_ptr->sval == SV_WAND_HEAL_MONSTER
3135 || o_ptr->sval == SV_WAND_HASTE_MONSTER))
3137 if (!get_aim_dir(&dir))
3139 target_pet = old_target_pet;
3142 target_pet = old_target_pet;
3148 lev = get_object_level(o_ptr);
3149 if (lev > 50) lev = 50 + (lev - 50)/2;
3151 /* Base chance of success */
3152 chance = p_ptr->skill_dev;
3154 /* Confusion hurts skill */
3155 if (p_ptr->confused) chance = chance / 2;
3157 /* Hight level objects are harder */
3158 chance = chance - lev;
3160 /* Give everyone a (slight) chance */
3161 if ((chance < USE_DEVICE) && (rand_int(USE_DEVICE - chance + 1) == 0))
3163 chance = USE_DEVICE;
3168 if (flush_failure) flush();
3170 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3172 msg_print("Nothing happen. Maybe this wand is freezing too.");
3179 /* Roll for usage */
3180 if ((chance < USE_DEVICE) || (randint(chance) < USE_DEVICE) || (p_ptr->pclass == CLASS_BERSERKER))
3182 if (flush_failure) flush();
3184 msg_print("ËâË¡ËÀ¤ò¤¦¤Þ¤¯»È¤¨¤Ê¤«¤Ã¤¿¡£");
3186 msg_print("You failed to use the wand properly.");
3193 /* The wand is already empty! */
3194 if (o_ptr->pval <= 0)
3196 if (flush_failure) flush();
3198 msg_print("¤³¤ÎËâË¡ËÀ¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£");
3200 msg_print("The wand has no charges left.");
3203 o_ptr->ident |= (IDENT_EMPTY);
3205 /* Combine / Reorder the pack (later) */
3206 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3214 ident = wand_effect(o_ptr->sval, dir, FALSE);
3216 /* Combine / Reorder the pack (later) */
3217 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3219 if (!(object_aware_p(o_ptr)))
3221 chg_virtue(V_PATIENCE, -1);
3222 chg_virtue(V_CHANCE, 1);
3223 chg_virtue(V_KNOWLEDGE, -1);
3226 /* Mark it as tried */
3227 object_tried(o_ptr);
3229 /* Apply identification */
3230 if (ident && !object_aware_p(o_ptr))
3232 object_aware(o_ptr);
3233 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
3237 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3240 /* Use a single charge */
3243 /* Describe the charges in the pack */
3246 inven_item_charges(item);
3249 /* Describe the charges on the floor */
3252 floor_item_charges(0 - item);
3257 void do_cmd_aim_wand(void)
3262 /* Restrict choices to wands */
3263 item_tester_tval = TV_WAND;
3265 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
3267 set_action(ACTION_NONE);
3272 q = "¤É¤ÎËâË¡ËÀ¤ÇÁÀ¤¤¤Þ¤¹¤«? ";
3273 s = "»È¤¨¤ëËâË¡ËÀ¤¬¤Ê¤¤¡£";
3275 q = "Aim which wand? ";
3276 s = "You have no wand to aim.";
3279 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
3282 do_cmd_aim_wand_aux(item);
3286 static int rod_effect(int sval, int dir, bool *use_charge, bool magic)
3290 /* Analyze the rod */
3293 case SV_ROD_DETECT_TRAP:
3295 if (detect_traps(DETECT_RAD_DEFAULT)) ident = TRUE;
3299 case SV_ROD_DETECT_DOOR:
3301 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
3302 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
3306 case SV_ROD_IDENTIFY:
3309 if (!ident_spell(FALSE)) *use_charge = FALSE;
3315 if (!word_of_recall()) *use_charge = FALSE;
3320 case SV_ROD_ILLUMINATION:
3322 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
3326 case SV_ROD_MAPPING:
3328 map_area(DETECT_RAD_MAP);
3333 case SV_ROD_DETECTION:
3335 detect_all(DETECT_RAD_DEFAULT);
3340 case SV_ROD_PROBING:
3349 if (set_blind(0)) ident = TRUE;
3350 if (set_poisoned(0)) ident = TRUE;
3351 if (set_confused(0)) ident = TRUE;
3352 if (set_stun(0)) ident = TRUE;
3353 if (set_cut(0)) ident = TRUE;
3354 if (set_image(0)) ident = TRUE;
3355 if (set_shero(0,TRUE)) ident = TRUE;
3359 case SV_ROD_HEALING:
3361 if (hp_player(500)) ident = TRUE;
3362 if (set_stun(0)) ident = TRUE;
3363 if (set_cut(0)) ident = TRUE;
3364 if (set_shero(0,TRUE)) ident = TRUE;
3368 case SV_ROD_RESTORATION:
3370 if (restore_level()) ident = TRUE;
3371 if (do_res_stat(A_STR)) ident = TRUE;
3372 if (do_res_stat(A_INT)) ident = TRUE;
3373 if (do_res_stat(A_WIS)) ident = TRUE;
3374 if (do_res_stat(A_DEX)) ident = TRUE;
3375 if (do_res_stat(A_CON)) ident = TRUE;
3376 if (do_res_stat(A_CHR)) ident = TRUE;
3382 if (set_fast(randint(30) + 15, FALSE)) ident = TRUE;
3386 case SV_ROD_PESTICIDE:
3388 if (dispel_monsters(4)) ident = TRUE;
3392 case SV_ROD_TELEPORT_AWAY:
3394 if (teleport_monster(dir)) ident = TRUE;
3398 case SV_ROD_DISARMING:
3400 if (disarm_trap(dir)) ident = TRUE;
3407 msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3409 msg_print("A line of blue shimmering light appears.");
3412 (void)lite_line(dir);
3417 case SV_ROD_SLEEP_MONSTER:
3419 if (sleep_monster(dir)) ident = TRUE;
3423 case SV_ROD_SLOW_MONSTER:
3425 if (slow_monster(dir)) ident = TRUE;
3429 case SV_ROD_DRAIN_LIFE:
3431 if (drain_life(dir, 70 + 3 * p_ptr->lev / 2)) ident = TRUE;
3435 case SV_ROD_POLYMORPH:
3437 if (poly_monster(dir)) ident = TRUE;
3441 case SV_ROD_ACID_BOLT:
3443 fire_bolt_or_beam(10, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
3448 case SV_ROD_ELEC_BOLT:
3450 fire_bolt_or_beam(10, GF_ELEC, dir, damroll(4 + p_ptr->lev / 9, 8));
3455 case SV_ROD_FIRE_BOLT:
3457 fire_bolt_or_beam(10, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
3462 case SV_ROD_COLD_BOLT:
3464 fire_bolt_or_beam(10, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
3469 case SV_ROD_ACID_BALL:
3471 fire_ball(GF_ACID, dir, 60 + p_ptr->lev, 2);
3476 case SV_ROD_ELEC_BALL:
3478 fire_ball(GF_ELEC, dir, 40 + p_ptr->lev, 2);
3483 case SV_ROD_FIRE_BALL:
3485 fire_ball(GF_FIRE, dir, 70 + p_ptr->lev, 2);
3490 case SV_ROD_COLD_BALL:
3492 fire_ball(GF_COLD, dir, 50 + p_ptr->lev, 2);
3504 case SV_ROD_STONE_TO_MUD:
3506 if (wall_to_mud(dir)) ident = TRUE;
3510 case SV_ROD_AGGRAVATE:
3512 aggravate_monsters(0);
3521 * Activate (zap) a Rod
3523 * Unstack fully charged rods as needed.
3525 * Hack -- rods of perception/genocide can be "cancelled"
3526 * All rods can be cancelled at the "Direction?" prompt
3528 * pvals are defined for each rod in k_info. -LM-
3530 static void do_cmd_zap_rod_aux(int item)
3532 int ident, chance, dir, lev, fail;
3536 /* Hack -- let perception get aborted */
3537 bool use_charge = TRUE;
3541 /* Get the item (in the pack) */
3544 o_ptr = &inventory[item];
3547 /* Get the item (on the floor) */
3550 o_ptr = &o_list[0 - item];
3554 /* Mega-Hack -- refuse to zap a pile from the ground */
3555 if ((item < 0) && (o_ptr->number > 1))
3558 msg_print("¤Þ¤º¤Ï¥í¥Ã¥É¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
3560 msg_print("You must first pick up the rods.");
3567 /* Get a direction (unless KNOWN not to need it) */
3568 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)) ||
3569 !object_aware_p(o_ptr))
3571 /* Get a direction, allow cancel */
3572 if (!get_aim_dir(&dir)) return;
3579 /* Extract the item level */
3580 lev = get_object_level(o_ptr);
3582 /* Base chance of success */
3583 chance = p_ptr->skill_dev;
3585 /* Confusion hurts skill */
3586 if (p_ptr->confused) chance = chance / 2;
3589 if (chance > fail) fail -= (chance - fail)*2;
3590 else chance -= (fail - chance)*2;
3591 if (fail < USE_DEVICE) fail = USE_DEVICE;
3592 if (chance < USE_DEVICE) chance = USE_DEVICE;
3596 if (flush_failure) flush();
3598 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3600 msg_print("Nothing happen. Maybe this rod is freezing too.");
3607 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
3608 else if (chance > fail)
3610 if (rand_int(chance*2) < fail) success = FALSE;
3611 else success = TRUE;
3615 if (rand_int(fail*2) < chance) success = TRUE;
3616 else success = FALSE;
3619 /* Roll for usage */
3622 if (flush_failure) flush();
3624 msg_print("¤¦¤Þ¤¯¥í¥Ã¥É¤ò»È¤¨¤Ê¤«¤Ã¤¿¡£");
3626 msg_print("You failed to use the rod properly.");
3633 k_ptr = &k_info[o_ptr->k_idx];
3635 /* A single rod is still charging */
3636 if ((o_ptr->number == 1) && (o_ptr->timeout))
3638 if (flush_failure) flush();
3640 msg_print("¤³¤Î¥í¥Ã¥É¤Ï¤Þ¤ÀËâÎϤò½¼Å¶¤·¤Æ¤¤¤ëºÇÃæ¤À¡£");
3642 msg_print("The rod is still charging.");
3647 /* A stack of rods lacks enough energy. */
3648 else if ((o_ptr->number > 1) && (o_ptr->timeout > k_ptr->pval * (o_ptr->number - 1)))
3650 if (flush_failure) flush();
3652 msg_print("¤½¤Î¥í¥Ã¥É¤Ï¤Þ¤À½¼Å¶Ãæ¤Ç¤¹¡£");
3654 msg_print("The rods are all still charging.");
3663 ident = rod_effect(o_ptr->sval, dir, &use_charge, FALSE);
3665 /* Increase the timeout by the rod kind's pval. -LM- */
3666 if (use_charge) o_ptr->timeout += k_ptr->pval;
3668 /* Combine / Reorder the pack (later) */
3669 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3671 if (!(object_aware_p(o_ptr)))
3673 chg_virtue(V_PATIENCE, -1);
3674 chg_virtue(V_CHANCE, 1);
3675 chg_virtue(V_KNOWLEDGE, -1);
3678 /* Tried the object */
3679 object_tried(o_ptr);
3681 /* Successfully determined the object function */
3682 if (ident && !object_aware_p(o_ptr))
3684 object_aware(o_ptr);
3685 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
3689 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3693 void do_cmd_zap_rod(void)
3698 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
3700 set_action(ACTION_NONE);
3703 /* Restrict choices to rods */
3704 item_tester_tval = TV_ROD;
3708 q = "¤É¤Î¥í¥Ã¥É¤ò¿¶¤ê¤Þ¤¹¤«? ";
3709 s = "»È¤¨¤ë¥í¥Ã¥É¤¬¤Ê¤¤¡£";
3711 q = "Zap which rod? ";
3712 s = "You have no rod to zap.";
3715 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
3718 do_cmd_zap_rod_aux(item);
3723 * Hook to determine if an object is activatable
3725 static bool item_tester_hook_activate(object_type *o_ptr)
3730 if (!object_known_p(o_ptr)) return (FALSE);
3732 /* Extract the flags */
3733 object_flags(o_ptr, &f1, &f2, &f3);
3735 /* Check activation flag */
3736 if (f3 & (TR3_ACTIVATE)) return (TRUE);
3738 if ((o_ptr->tval > TV_CAPTURE) && o_ptr->xtra3)
3740 switch(o_ptr->xtra3)
3741 case ESSENCE_TMP_RES_ACID:
3742 case ESSENCE_TMP_RES_ELEC:
3743 case ESSENCE_TMP_RES_FIRE:
3744 case ESSENCE_TMP_RES_COLD:
3745 case ESSENCE_EARTHQUAKE:
3755 * Hack -- activate the ring of power
3757 void ring_of_power(int dir)
3759 /* Pick a random effect */
3760 switch (randint(10))
3767 msg_print("¤¢¤Ê¤¿¤Ï°À¤Î¥ª¡¼¥é¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡£");
3769 msg_print("You are surrounded by a malignant aura.");
3774 /* Decrease all stats (permanently) */
3775 (void)dec_stat(A_STR, 50, TRUE);
3776 (void)dec_stat(A_INT, 50, TRUE);
3777 (void)dec_stat(A_WIS, 50, TRUE);
3778 (void)dec_stat(A_DEX, 50, TRUE);
3779 (void)dec_stat(A_CON, 50, TRUE);
3780 (void)dec_stat(A_CHR, 50, TRUE);
3782 /* Lose some experience (permanently) */
3783 p_ptr->exp -= (p_ptr->exp / 4);
3784 p_ptr->max_exp -= (p_ptr->exp / 4);
3794 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥª¡¼¥é¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡£");
3796 msg_print("You are surrounded by a powerful aura.");
3800 /* Dispel monsters */
3801 dispel_monsters(1000);
3811 fire_ball(GF_MANA, dir, 600, 3);
3822 fire_bolt(GF_MANA, dir, 500);
3830 static bool ang_sort_comp_pet(vptr u, vptr v, int a, int b)
3832 u16b *who = (u16b*)(u);
3837 monster_type *m_ptr1 = &m_list[w1];
3838 monster_type *m_ptr2 = &m_list[w2];
3839 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
3840 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
3842 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
3843 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
3845 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
3846 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
3848 if (r_ptr1->level > r_ptr2->level) return TRUE;
3849 if (r_ptr2->level > r_ptr1->level) return FALSE;
3851 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
3852 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
3858 * Activate a wielded object. Wielded objects never stack.
3859 * And even if they did, activatable objects never stack.
3861 * Currently, only (some) artifacts, and Dragon Scale Mail, can be activated.
3862 * But one could, for example, easily make an activatable "Ring of Plasma".
3864 * Note that it always takes a turn to activate an artifact, even if
3865 * the user hits "escape" at the "direction" prompt.
3867 static void do_cmd_activate_aux(int item)
3869 int k, dir, lev, chance, fail;
3874 /* Get the item (in the pack) */
3877 o_ptr = &inventory[item];
3880 /* Get the item (on the floor) */
3883 o_ptr = &o_list[0 - item];
3889 /* Extract the item level */
3890 lev = get_object_level(o_ptr);
3892 /* Hack -- use artifact level instead */
3893 if (artifact_p(o_ptr)) lev = a_info[o_ptr->name1].level;
3894 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
3896 /* Base chance of success */
3897 chance = p_ptr->skill_dev;
3899 /* Confusion hurts skill */
3900 if (p_ptr->confused) chance = chance / 2;
3903 if (chance > fail) fail -= (chance - fail)*2;
3904 else chance -= (fail - chance)*2;
3905 if (fail < USE_DEVICE) fail = USE_DEVICE;
3906 if (chance < USE_DEVICE) chance = USE_DEVICE;
3910 if (flush_failure) flush();
3912 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3914 msg_print("It shows no reaction.");
3921 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
3922 else if (chance > fail)
3924 if (rand_int(chance*2) < fail) success = FALSE;
3925 else success = TRUE;
3929 if (rand_int(fail*2) < chance) success = TRUE;
3930 else success = FALSE;
3933 /* Roll for usage */
3936 if (flush_failure) flush();
3938 msg_print("¤¦¤Þ¤¯»ÏÆ°¤µ¤»¤ë¤³¤È¤¬¤Ç¤¤Ê¤«¤Ã¤¿¡£");
3940 msg_print("You failed to activate it properly.");
3947 /* Check the recharge */
3951 msg_print("¤½¤ì¤ÏÈù¤«¤Ë²»¤òΩ¤Æ¡¢µ±¤¡¢¾Ã¤¨¤¿...");
3953 msg_print("It whines, glows and fades...");
3960 /* Activate the artifact */
3962 msg_print("»ÏÆ°¤µ¤»¤¿...");
3964 msg_print("You activate it...");
3972 if (o_ptr->art_name && o_ptr->xtra2)
3974 (void)activate_random_artifact(o_ptr);
3977 p_ptr->window |= (PW_INVEN | PW_EQUIP);
3984 else if (o_ptr->name1)
3987 switch (o_ptr->name1)
3992 msg_print("ààÎÜÉÓ¤«¤éÀ¡¤ó¤À¸÷¤¬¤¢¤Õ¤ì½Ð¤¿...");
3994 msg_print("The phial wells with clear light...");
3997 lite_area(damroll(2, 15), 3);
3998 o_ptr->timeout = rand_int(10) + 10;
4005 msg_print("À±¤¬âÁ¤·¤¯µ±¤¤¤¿...");
4007 msg_print("The star shines brightly...");
4010 map_area(DETECT_RAD_MAP);
4011 lite_area(damroll(2, 15), 3);
4012 o_ptr->timeout = rand_int(50) + 50;
4019 msg_print("¤½¤ÎÊõÀФÏÀÖ¤¯ÌÀ¤ë¤¯¸÷¤Ã¤¿¡ª");
4021 msg_print("The Jewel flashes bright red!");
4024 chg_virtue(V_KNOWLEDGE, 1);
4025 chg_virtue(V_ENLIGHTEN, 1);
4026 wiz_lite(FALSE, FALSE);
4028 msg_print("¤½¤ÎÊõÀФϤ¢¤Ê¤¿¤ÎÂÎÎϤòÃ¥¤Ã¤¿...");
4029 take_hit(DAMAGE_LOSELIFE, damroll(3,8), "¿³È½¤ÎÊõÀÐ", -1);
4031 msg_print("The Jewel drains your vitality...");
4032 take_hit(DAMAGE_LOSELIFE, damroll(3, 8), "the Jewel of Judgement", -1);
4035 (void)detect_traps(DETECT_RAD_DEFAULT);
4036 (void)detect_doors(DETECT_RAD_DEFAULT);
4037 (void)detect_stairs(DETECT_RAD_DEFAULT);
4040 if (get_check("µ¢´Ô¤ÎÎϤò»È¤¤¤Þ¤¹¤«¡©"))
4042 if (get_check("Activate recall? "))
4046 (void)word_of_recall();
4049 o_ptr->timeout = rand_int(20) + 20;
4056 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
4058 msg_print("The amulet lets out a shrill wail...");
4062 (void)set_protevil(randint(25) + k, FALSE);
4063 o_ptr->timeout = rand_int(225) + 225;
4070 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
4072 msg_print("The amulet floods the area with goodness...");
4075 dispel_evil(p_ptr->lev * 5);
4076 o_ptr->timeout = rand_int(200) + 200;
4083 msg_print("¶À¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
4085 msg_print("The mirror floods the area with goodness...");
4088 dispel_evil(p_ptr->lev * 5);
4089 o_ptr->timeout = rand_int(200) + 200;
4096 msg_print("¤¢¤Ê¤¿¤Ï¥Õ¥é¥¥¢¤ËŨ¤òÄù¤á»¦¤¹¤è¤¦Ì¿¤¸¤¿¡£");
4098 msg_print("You order Frakir to strangle your opponent.");
4101 if (!get_aim_dir(&dir)) return;
4102 if (drain_life(dir, 100))
4103 o_ptr->timeout = rand_int(100) + 100;
4110 msg_print("»ØÎؤÏÌÀ¤ë¤¯µ±¤¤¤¿...");
4112 msg_print("The ring glows brightly...");
4115 (void)set_fast(randint(75) + 75, FALSE);
4116 o_ptr->timeout = rand_int(150) + 150;
4123 msg_print("»ØÎؤϿ¼¹È¤Ëµ±¤¤¤¿...");
4125 msg_print("The ring glows deep red...");
4128 if (!get_aim_dir(&dir)) return;
4129 fire_ball(GF_FIRE, dir, 300, 3);
4130 o_ptr->timeout = rand_int(225) + 225;
4137 msg_print("»ØÎؤÏÇò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4139 msg_print("The ring glows bright white...");
4142 if (!get_aim_dir(&dir)) return;
4143 fire_ball(GF_COLD, dir, 400, 3);
4144 o_ptr->timeout = rand_int(325) + 325;
4152 msg_print("»ØÎؤϿ¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4154 msg_print("The ring glows deep blue...");
4157 if (!get_aim_dir(&dir)) return;
4158 fire_ball(GF_ELEC, dir, 500, 3);
4159 o_ptr->timeout = rand_int(425) + 425;
4167 msg_print("»ØÎؤϼ¿¹õ¤Ëµ±¤¤¤¿...");
4169 msg_print("The ring glows intensely black...");
4172 if (!get_aim_dir(&dir)) return;
4174 o_ptr->timeout = rand_int(450) + 450;
4180 int num = damroll(5, 3);
4185 msg_print("³»¤¬°ðºÊ¤Çʤ¤ï¤ì¤¿...");
4187 msg_print("Your armor is surrounded by lightning...");
4191 for (k = 0; k < num; k++)
4197 scatter(&y, &x, py, px, 4, 0);
4199 if (!cave_floor_bold(y, x)) continue;
4201 if ((y != py) || (x != px)) break;
4204 project(0, 3, y, x, 150, GF_ELEC,
4205 (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
4208 o_ptr->timeout = 1000;
4212 case ART_BLADETURNER:
4214 if (!get_aim_dir(&dir)) return;
4216 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
4218 msg_print("You breathe the elements.");
4221 fire_ball(GF_MISSILE, dir, 300, 4);
4223 msg_print("¥¢¡¼¥Þ¡¼¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...");
4225 msg_print("Your armor glows many colours...");
4228 (void)set_afraid(0);
4229 (void)set_hero(randint(50) + 50, FALSE);
4230 (void)hp_player(10);
4231 (void)set_blessed(randint(50) + 50, FALSE);
4232 (void)set_oppose_acid(randint(50) + 50, FALSE);
4233 (void)set_oppose_elec(randint(50) + 50, FALSE);
4234 (void)set_oppose_fire(randint(50) + 50, FALSE);
4235 (void)set_oppose_cold(randint(50) + 50, FALSE);
4236 (void)set_oppose_pois(randint(50) + 50, FALSE);
4237 o_ptr->timeout = 400;
4241 case ART_SOULKEEPER:
4244 msg_print("¥¢¡¼¥Þ¡¼¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4245 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬¤è¤¤...");
4247 msg_print("Your armor glows a bright white...");
4248 msg_print("You feel much better...");
4251 (void)hp_player(1000);
4253 o_ptr->timeout = 888;
4257 case ART_BELEGENNON:
4260 msg_print("Å·¹ñ¤Î²Î¤¬Ê¹¤³¤¨¤ë...");
4262 msg_print("A heavenly choir sings...");
4265 (void)set_poisoned(0);
4268 (void)set_confused(0);
4270 (void)set_hero(randint(25) + 25, FALSE);
4271 (void)hp_player(777);
4272 o_ptr->timeout = 300;
4279 msg_print("¥¢¡¼¥Þ¡¼¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4281 msg_print("Your armor glows deep blue...");
4284 (void)symbol_genocide(200, TRUE);
4285 o_ptr->timeout = 500;
4292 msg_print("¥¢¡¼¥Þ¡¼¤¬ÀÖ¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4294 msg_print("Your armor glows bright red...");
4297 destroy_doors_touch();
4298 o_ptr->timeout = 10;
4306 turn_monsters(40 + p_ptr->lev);
4307 o_ptr->timeout = 3 * (p_ptr->lev + 10);
4312 case ART_HOLHENNETH:
4315 msg_print("¥Ø¥ë¥á¥Ã¥È¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4316 msg_print("¿´¤Ë¥¤¥á¡¼¥¸¤¬É⤫¤ó¤Ç¤¤¿...");
4318 msg_print("Your helm glows bright white...");
4319 msg_print("An image forms in your mind...");
4322 detect_all(DETECT_RAD_DEFAULT);
4323 o_ptr->timeout = rand_int(55) + 55;
4330 msg_print("²¦´§¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4331 msg_print("ÂÎÆâ¤ËÃȤ«¤¤¸ÝÆ°¤¬´¶¤¸¤é¤ì¤ë...");
4333 msg_print("Your crown glows deep blue...");
4334 msg_print("You feel a warm tingling inside...");
4337 (void)hp_player(700);
4339 o_ptr->timeout = 250;
4347 msg_format("%s¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...", o_ptr->name1 == ART_COLLUIN ? "¥¯¥í¡¼¥¯" : "³»");
4349 msg_format("Your cloak glows many colours...");
4352 (void)set_oppose_acid(randint(20) + 20, FALSE);
4353 (void)set_oppose_elec(randint(20) + 20, FALSE);
4354 (void)set_oppose_fire(randint(20) + 20, FALSE);
4355 (void)set_oppose_cold(randint(20) + 20, FALSE);
4356 (void)set_oppose_pois(randint(20) + 20, FALSE);
4357 o_ptr->timeout = 111;
4361 case ART_HOLCOLLETH:
4364 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4366 msg_print("Your cloak glows deep blue...");
4369 sleep_monsters_touch();
4370 o_ptr->timeout = 55;
4377 msg_print("¥¯¥í¡¼¥¯¤¬²«¿§¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4379 msg_print("Your cloak glows bright yellow...");
4383 o_ptr->timeout = 70;
4390 msg_print("¥¯¥í¡¼¥¯¤¬ÊÕ¤ê¤Î¶õ´Ö¤ò¤æ¤¬¤Þ¤»¤¿...");
4392 msg_print("Your cloak twists space around you...");
4395 teleport_player(100);
4396 o_ptr->timeout = 45;
4403 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4405 msg_print("Your cloak glows a deep red...");
4409 o_ptr->timeout = 450;
4413 case ART_CAMMITHRIM:
4416 msg_print("¥°¥í¡¼¥Ö¤¬âÁ¤·¤¤¤¯¤é¤¤¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4418 msg_print("Your gloves glow extremely brightly...");
4421 if (!get_aim_dir(&dir)) return;
4422 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
4430 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4432 msg_print("Your gauntlets are covered in fire...");
4435 if (!get_aim_dir(&dir)) return;
4436 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4437 o_ptr->timeout = rand_int(8) + 8;
4441 case ART_PAURNIMMEN:
4444 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4446 msg_print("Your gauntlets are covered in frost...");
4449 if (!get_aim_dir(&dir)) return;
4450 fire_bolt(GF_COLD, dir, damroll(6, 8));
4451 o_ptr->timeout = rand_int(7) + 7;
4458 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4460 msg_print("Your gauntlets are covered in sparks...");
4463 if (!get_aim_dir(&dir)) return;
4464 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4465 o_ptr->timeout = rand_int(5) + 5;
4472 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬»À¤Ëʤ¤ï¤ì¤¿...");
4474 msg_print("Your gauntlets are covered in acid...");
4477 if (!get_aim_dir(&dir)) return;
4478 fire_bolt(GF_ACID, dir, damroll(5, 8));
4479 o_ptr->timeout = rand_int(6) + 6;
4486 msg_print("¥»¥¹¥¿¥¹¤ËËâË¡¤Î¥È¥²¤¬¸½¤ì¤¿...");
4488 msg_print("Your cesti grows magical spikes...");
4491 if (!get_aim_dir(&dir)) return;
4492 fire_bolt(GF_ARROW, dir, 150);
4493 o_ptr->timeout = rand_int(90) + 90;
4500 msg_print("¥Ö¡¼¥Ä¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4502 msg_print("Your boots glow bright green...");
4505 (void)set_fast(randint(20) + 20, FALSE);
4506 o_ptr->timeout = 200;
4513 msg_print("¥Ö¡¼¥Ä¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4515 msg_print("Your boots glow deep blue...");
4518 (void)set_afraid(0);
4519 (void)set_poisoned(0);
4527 msg_print("¥À¥¬¡¼¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4529 msg_print("Your dagger is covered in fire...");
4532 if (!get_aim_dir(&dir)) return;
4533 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4534 o_ptr->timeout = rand_int(8) + 8;
4541 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4543 msg_print("Your dagger is covered in frost...");
4546 if (!get_aim_dir(&dir)) return;
4547 fire_bolt(GF_COLD, dir, damroll(6, 8));
4548 o_ptr->timeout = rand_int(7) + 7;
4555 msg_print("¥À¥¬¡¼¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4557 msg_print("Your dagger is covered in sparks...");
4560 if (!get_aim_dir(&dir)) return;
4561 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4562 o_ptr->timeout = rand_int(5) + 5;
4569 msg_print("¥À¥¬¡¼¤¬¿¼¤¤Îп§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4571 msg_print("Your dagger throbs deep green...");
4574 if (!get_aim_dir(&dir)) return;
4575 fire_ball(GF_POIS, dir, 12, 3);
4576 o_ptr->timeout = rand_int(4) + 4;
4583 msg_print("Ì·¤¬¿¼¤¤ÀÄ¿§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4585 msg_print("Your dagger throbs deep blue...");
4588 if (!get_aim_dir(&dir)) return;
4589 fire_ball(GF_WATER, dir, 200, 3);
4590 o_ptr->timeout = 250;
4597 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4599 msg_print("Your dagger is covered in frost...");
4602 if (!get_aim_dir(&dir)) return;
4603 fire_ball(GF_COLD, dir, 48, 2);
4604 o_ptr->timeout = rand_int(5) + 5;
4611 switch (randint(13))
4613 case 1: case 2: case 3: case 4: case 5:
4614 teleport_player(10);
4616 case 6: case 7: case 8: case 9: case 10:
4617 teleport_player(222);
4620 (void)stair_creation();
4624 if (get_check("¤³¤Î³¬¤òµî¤ê¤Þ¤¹¤«¡©"))
4626 if (get_check("Leave this level? "))
4630 if (autosave_l) do_cmd_save_game(TRUE);
4633 p_ptr->leaving = TRUE;
4636 o_ptr->timeout = 35;
4642 teleport_player(222);
4643 o_ptr->timeout = 25;
4650 msg_print("¥½¡¼¥É¤¬ÀĤ¯·ã¤·¤¯µ±¤¤¤¿...");
4652 msg_print("Your sword glows an intense blue...");
4655 if (!get_aim_dir(&dir)) return;
4656 fire_ball(GF_COLD, dir, 100, 2);
4657 o_ptr->timeout = 200;
4664 msg_print("¶Ç¤Î»ÕÃĤò¾¤´¤·¤¿¡£");
4666 msg_print("You summon the Legion of the Dawn.");
4669 (void)summon_specific(-1, py, px, dun_level, SUMMON_DAWN, TRUE, TRUE, TRUE, FALSE, FALSE);
4670 o_ptr->timeout = 500 + randint(500);
4677 msg_print("¥½¡¼¥É¤¬ÀÖ¤¯·ã¤·¤¯µ±¤¤¤¿...");
4679 msg_print("Your sword glows an intense red...");
4682 if (!get_aim_dir(&dir)) return;
4683 fire_ball(GF_FIRE, dir, 72, 2);
4684 o_ptr->timeout = 400;
4691 msg_print("¥¢¥Ã¥¯¥¹¤Î¿Ï¤¬¹õ¤¯µ±¤¤¤¿...");
4693 msg_print("Your axe blade glows black...");
4696 if (!get_aim_dir(&dir)) return;
4697 drain_life(dir, 120);
4698 o_ptr->timeout = 400;
4705 msg_print("¤¢¤Ê¤¿¤ÎÁä¤ÏÅŵ¤¤Ç¥¹¥Ñ¡¼¥¯¤·¤Æ¤¤¤ë...");
4707 msg_print("Your spear crackles with electricity...");
4710 if (!get_aim_dir(&dir)) return;
4711 fire_ball(GF_ELEC, dir, 100, 3);
4712 o_ptr->timeout = 200;
4719 msg_print("¥¹¥Ô¥¢¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4721 msg_print("Your spear glows a bright white...");
4724 if (!get_aim_dir(&dir)) return;
4725 fire_ball(GF_COLD, dir, 100, 3);
4726 o_ptr->timeout = 200;
4733 msg_print("¥¹¥Ô¥¢¤¬¸ÝÆ°¤·¤¿...");
4735 msg_print("Your spear pulsates...");
4738 if (!get_aim_dir(&dir)) return;
4747 msg_print("¤Ä¤ë¤Ï¤·¤¬¸ÝÆ°¤·¤¿...");
4749 msg_print("Your mattock pulsates...");
4752 if (!get_aim_dir(&dir)) return;
4761 msg_print("¥¢¥Ã¥¯¥¹¤«¤é¤Ò¤É¤¯±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
4763 msg_print("Your axe lets out a long, shrill note...");
4766 (void)mass_genocide(200, TRUE);
4767 o_ptr->timeout = 1000;
4774 msg_print("¥Ð¥È¥ë¡¦¥¢¥Ã¥¯¥¹¤¬¿¼»ç¤Î¸÷¤òÊü¼Í¤·¤¿...");
4776 msg_print("Your battle axe radiates deep purple...");
4779 hp_player(damroll(4, 8));
4780 (void)set_cut((p_ptr->cut / 2) - 50);
4781 o_ptr->timeout = rand_int(3) + 3;
4788 msg_print("¥È¥é¥¤¥Ç¥ó¥È¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4790 msg_print("Your trident glows deep red...");
4793 if (!get_aim_dir(&dir)) return;
4794 teleport_monster(dir);
4795 o_ptr->timeout = 150;
4802 msg_print("Âç³ù¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
4804 msg_print("Your scythe glows soft white...");
4806 if (!word_of_recall()) return;
4807 o_ptr->timeout = 200;
4814 msg_print("¸û¶Ì¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
4816 msg_print("Your scythe glows soft white...");
4818 if (!word_of_recall()) return;
4819 o_ptr->timeout = 200;
4826 msg_print("¥Õ¥ì¥¤¥ë¤¬ÍÍ¡¹¤Ê¿§¤Î²Ð²Ö¤òȯ¤·¤¿...");
4828 msg_print("Your flail glows in scintillating colours...");
4831 if (!get_aim_dir(&dir)) return;
4832 confuse_monster(dir, 20);
4833 o_ptr->timeout = 15;
4840 msg_print("¥â¡¼¥Ë¥ó¥°¥¹¥¿¡¼¤«¤é±ê¤¬¿á¤½Ð¤·¤¿...");
4842 msg_print("Your morning star rages in fire...");
4845 if (!get_aim_dir(&dir)) return;
4846 fire_ball(GF_FIRE, dir, 72, 3);
4847 o_ptr->timeout = 100;
4854 msg_print("¥à¥Á¤¬¿¼¤¤ÀÖ¿§¤Ëµ±¤¤¤¿...");
4856 msg_print("Your whip glows deep red...");
4859 if (!get_aim_dir(&dir)) return;
4860 fire_ball(GF_FIRE, dir, 120, 3);
4861 o_ptr->timeout = 15;
4868 msg_print("¥á¥¤¥¹¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4870 msg_print("Your mace glows bright green...");
4873 (void)set_fast(randint(20) + 20, FALSE);
4874 o_ptr->timeout = rand_int(100) + 100;
4881 msg_print("¥¯¥©¡¼¥¿¡¼¥¹¥¿¥Ã¥Õ¤¬²«¿§¤¯µ±¤¤¤¿...");
4883 msg_print("Your quarterstaff glows yellow...");
4886 if (!ident_spell(FALSE)) return;
4887 o_ptr->timeout = 10;
4894 msg_print("¾ó¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
4896 msg_print("Your quarterstaff glows brightly...");
4899 detect_all(DETECT_RAD_DEFAULT);
4901 identify_fully(FALSE);
4902 o_ptr->timeout = 1000;
4909 msg_print("¥Ï¥ó¥Þ¡¼¤¬Çò¤¯µ±¤¤¤¿...");
4911 msg_print("Your hammer glows white...");
4914 if (!get_aim_dir(&dir)) return;
4915 drain_life(dir, 90);
4916 o_ptr->timeout = 70;
4923 msg_print("¥¯¥í¥¹¥Ü¥¦¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4925 msg_print("Your crossbow glows deep red...");
4928 (void)brand_bolts();
4929 o_ptr->timeout = 999;
4936 int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_NO_REF;
4939 msg_print("¤»¤Ã¤«¤¯¤À¤«¤é¡Ø¥¯¥ê¥à¥¾¥ó¡Ù¤ò¤Ö¤Ã¤Ñ¤Ê¤¹¤¼¡ª");
4941 msg_print("I'll fire CRIMSON! SEKKAKUDAKARA!");
4944 if (!get_aim_dir(&dir)) return;
4946 /* Use the given direction */
4947 tx = px + 99 * ddx[dir];
4948 ty = py + 99 * ddy[dir];
4950 /* Hack -- Use an actual "target" */
4951 if ((dir == 5) && target_okay())
4957 if (p_ptr->pclass == CLASS_ARCHER)
4959 /* Extra shot at level 10 */
4960 if (p_ptr->lev >= 10) num++;
4962 /* Extra shot at level 30 */
4963 if (p_ptr->lev >= 30) num++;
4965 /* Extra shot at level 45 */
4966 if (p_ptr->lev >= 45) num++;
4969 for (i = 0; i < num; i++)
4970 project(0, p_ptr->lev/20+1, ty, tx, p_ptr->lev*6, GF_ROCKET, flg, -1);
4971 o_ptr->timeout = 15;
4976 monster_type *m_ptr;
4977 monster_race *r_ptr;
4981 msg_print("´ñ̯¤Ê¾ì½ê¤¬Æ¬¤ÎÃæ¤ËÉ⤫¤ó¤À¡¥¡¥¡¥");
4983 msg_print("Some strange places show up in your mind. And you see ...");
4986 /* Process the monsters (backwards) */
4987 for (i = m_max - 1; i >= 1; i--)
4989 /* Access the monster */
4992 /* Ignore "dead" monsters */
4993 if (!m_ptr->r_idx) continue;
4995 r_ptr = &r_info[m_ptr->r_idx];
4997 if(r_ptr->flags1 & RF1_UNIQUE)
5000 msg_format("%s¡¥ ",r_name + r_ptr->name);
5002 msg_format("%s. ",r_name + r_ptr->name);
5006 o_ptr->timeout = 200;
5010 case ART_STONE_LORE:
5013 msg_print("ÀФ¬±£¤µ¤ì¤¿ÈëÌ©¤ò¼Ì¤·½Ð¤·¤¿¡¥¡¥¡¥");
5015 msg_print("The stone reveals hidden mysteries...");
5017 if (!ident_spell(FALSE)) return;
5019 if (mp_ptr->spell_book)
5021 /* Sufficient mana */
5022 if (20 <= p_ptr->csp)
5028 /* Over-exert the player */
5031 int oops = 20 - p_ptr->csp;
5035 p_ptr->csp_frac = 0;
5039 msg_print("ÀФòÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
5041 msg_print("You are too weak to control the stone!");
5044 /* Hack -- Bypass free action */
5045 (void)set_paralyzed(p_ptr->paralyzed +
5046 randint(5 * oops + 1));
5049 (void)set_confused(p_ptr->confused +
5050 randint(5 * oops + 1));
5054 p_ptr->redraw |= (PR_MANA);
5058 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "´í¸±¤ÊÈëÌ©", -1);
5060 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "perilous secrets", -1);
5064 if (rand_int(5) == 0) (void)set_confused(p_ptr->confused +
5067 /* Exercise a little care... */
5068 if (rand_int(20) == 0)
5070 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "´í¸±¤ÊÈëÌ©", -1);
5072 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "perilous secrets", -1);
5080 msg_print("You wind a mighty blast; your enemies tremble!");
5081 (void)turn_monsters((3 * p_ptr->lev / 2) + 10);
5082 o_ptr->timeout = rand_int(40) + 40;
5088 msg_print("¤¢¤Ê¤¿¤Ï³²Ãî¤ò°ìÁݤ·¤¿¡£");
5090 msg_print("You exterminate small life.");
5092 (void)dispel_monsters(4);
5093 o_ptr->timeout = rand_int(55) + 55;
5100 msg_print("Æߤ¤²»¤¬ÊÕ¤ê¤òÊñ¤ß¤³¤ó¤À¡£");
5102 msg_print("A shrill wailing sound surrounds you.");
5104 (void)set_protevil(randint(25) + p_ptr->lev, FALSE);
5105 o_ptr->timeout = rand_int(200) + 200;
5113 msg_print("¥í¡¼¥Ö¤¬½ã¿è¤ÊËâÎϤǿ̤¨¤¿¡£");
5115 msg_print("The robe pulsates with raw mana...");
5117 if (!get_aim_dir(&dir)) return;
5118 fire_bolt(GF_MANA, dir, 120);
5119 o_ptr->timeout = rand_int(120) + 120;
5124 (void)set_fast(randint(50) + 50, FALSE);
5127 set_hero(randint(50) + 50, FALSE);
5128 o_ptr->timeout = rand_int(200) + 100;
5134 msg_print("¥·¡¼¥ë¥É¤¬âÁ¤·¤¤¸÷¤Çµ±¤¤¤¿¡¥¡¥¡¥");
5136 msg_print("Your shield gleams with blinding light...");
5138 fire_ball(GF_LITE, 0, 300, 6);
5139 confuse_monsters(3 * p_ptr->lev / 2);
5140 o_ptr->timeout = 250;
5146 msg_print("¥«¡¼¥É¤¬Çò¤¯µ±¤¤¤¿¡¥¡¥¡¥");
5148 msg_print("Your card gleams with blinding light...");
5150 if (!recharge(1000)) return;
5151 o_ptr->timeout = 200;
5157 if (get_check("ËÜÅö¤Ë»È¤¤¤Þ¤¹¤«¡©"))
5159 if (get_check("Are you sure?!"))
5163 msg_print("¼Àµ¤¬¿Ì¤¨¤¿¡¥¡¥¡¥");
5165 msg_print("The Muramasa pulsates...");
5171 msg_print("¼Àµ¤Ï²õ¤ì¤¿¡ª");
5173 msg_print("The Muramasa is destroyed!");
5175 curse_weapon(TRUE, item);
5183 msg_print("ÀФ¬ÀÄÇò¤¯¸÷¤Ã¤¿¡¥¡¥¡¥");
5185 msg_print("Your stone glows pale...");
5188 if (!get_aim_dir(&dir)) return;
5189 fire_ball(GF_MANA, dir, 400, 4);
5190 o_ptr->timeout = rand_int(250) + 250;
5197 if (!get_rep_dir2(&dir)) return;
5201 if (!(cave[y][x].feat == FEAT_DEEP_WATER) && !(cave[y][x].feat == FEAT_SHAL_WATER))
5204 msg_print("¤½¤³¤ÏΦÃϤÀ¡£");
5206 msg_print("There is no fishing place.");
5210 else if (cave[y][x].m_idx)
5213 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
5215 msg_format("%s¤¬¼ÙËâ¤À¡ª", m_name);
5217 msg_format("%^s is stand in your way.", m_name);
5222 set_action(ACTION_FISH);
5223 p_ptr->redraw |= (PR_STATE);
5228 if (!get_aim_dir(&dir)) return;
5230 msg_print("¥à¥Á¤ò¿¤Ð¤·¤¿¡£");
5232 msg_print("You stretched your wip.");
5235 fetch(dir, 500, TRUE);
5236 o_ptr->timeout = rand_int(25) + 25;
5241 bool pet = (randint(5) != 1);
5243 if (summon_specific((pet ? -1 : 0), py, px, ((p_ptr->lev * 3) / 2), SUMMON_HOUND, TRUE, FALSE, pet, FALSE, (bool)(!pet)))
5248 msg_print("¥Ï¥¦¥ó¥É¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5250 msg_print("A group of hounds appear as your servant.");
5255 msg_print("¥Ï¥¦¥ó¥É¤Ï¤¢¤Ê¤¿¤Ë²ç¤ò¸þ¤±¤Æ¤¤¤ë¡ª");
5257 msg_print("A group of hounds appear as your enemy!");
5262 o_ptr->timeout = 300 + randint(150);
5269 msg_print("¥¹¥Ô¥¢¤ÏâÁ¤·¤¯µ±¤¤¤¿...");
5271 msg_print("Your spear grows brightly...");
5274 if (!get_aim_dir(&dir)) return;
5275 fire_ball(GF_LITE, dir, 200, 3);
5276 o_ptr->timeout = rand_int(200) + 200;
5283 monster_type *m_ptr;
5288 if (summon_named_creature(py, px, MON_SUKE, FALSE, FALSE, TRUE, TRUE))
5291 msg_print("¡Ø½õ¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5293 msg_print("Suke-san apperars.");
5294 kakusan = "Suke-san";
5298 if (summon_named_creature(py, px, MON_KAKU, FALSE, FALSE, TRUE, TRUE))
5301 msg_print("¡Ø³Ê¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5303 msg_print("Kaku-san appears.");
5304 kakusan = "Kaku-san";
5310 for (i = m_max - 1; i > 0; i--)
5313 if (!m_ptr->r_idx) continue;
5314 if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
5315 if (!los(m_ptr->fy, m_ptr->fx, py, px)) continue;
5324 msg_print("¡Ö¼Ô¤É¤â¡¢¤Ò¤«¤¨¤ª¤í¤¦¡ª¡ª¡ª¤³¤Î¤ªÊý¤ò¤É¤Ê¤¿¤È¤³¤³¤í¤¨¤ë¡£¡×");
5326 msg_format("%^s says 'WHO do you think this person is! Bow your head, down your knees!'", kakusan);
5331 confuse_monsters(120);
5333 stasis_monsters(120);
5339 msg_print("¤·¤«¤·¡¢²¿¤âµ¯¤¤Ê¤«¤Ã¤¿¡£");
5341 msg_print("Nothing happen.");
5344 o_ptr->timeout = rand_int(150) + 150;
5351 msg_print("Çï»ÒÌÚ¤òÂǤä¿¡£");
5353 msg_print("You beat Your wooden clappers.");
5355 aggravate_monsters(0);
5362 set_hero(randint(25)+25, FALSE);
5364 o_ptr->timeout = rand_int(30) + 30;
5370 (void)set_poisoned(0);
5371 (void)set_confused(0);
5377 o_ptr->timeout = 100;
5383 if (!get_aim_dir(&dir)) return;
5384 (void)charm_animal(dir, p_ptr->lev);
5386 o_ptr->timeout = 200;
5393 msg_print("¥½¡¼¥É¤¬Ã¸¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
5395 msg_print("Your sword glows a pale blue...");
5397 if (!get_aim_dir(&dir)) return;
5398 fire_bolt(GF_COLD, dir, damroll(12, 8));
5399 o_ptr->timeout = 50;
5406 msg_print("³ù¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
5408 msg_print("Your scythe glows brightly!");
5410 o_ptr->art_flags1 = a_info[ART_BLOOD].flags1;
5411 o_ptr->art_flags2 = a_info[ART_BLOOD].flags2;
5412 dummy = randint(2)+randint(2);
5413 for (i = 0; i < dummy; i++)
5414 o_ptr->art_flags1 |= (TR1_CHAOTIC << rand_int(18));
5416 for (i = 0; i < dummy; i++)
5417 random_resistance(o_ptr, FALSE, randint(34) + 4);
5419 for (i = 0; i < dummy; i++)
5421 int tmp = rand_int(11);
5422 if (tmp < 6) o_ptr->art_flags1 |= (TR1_STR << tmp);
5423 else o_ptr->art_flags1 |= (TR1_STEALTH << (tmp - 6));
5425 o_ptr->timeout = 3333;
5426 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
5427 p_ptr->update |= (PU_BONUS | PU_HP);
5433 msg_print("Î϶¯¤¯»Í¸Ô¤òƧ¤ó¤À¡£");
5435 msg_print("You stamp. (as if you are in a ring.)");
5437 (void)set_hero(randint(20) + 20, FALSE);
5438 dispel_evil(p_ptr->lev * 3);
5439 o_ptr->timeout = 100 + randint(100);
5445 msg_print("¥¯¥í¡¼¥¯¤¬Çò¤¯µ±¤¤¤¿...");
5447 msg_print("Your cloak grows white.");
5449 (void)set_oppose_cold(randint(20) + 20, FALSE);
5450 o_ptr->timeout = 40 + randint(40);
5456 msg_print("¥à¥Á¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
5458 msg_print("The whip lets out a shrill wail...");
5462 (void)set_protevil(randint(25) + k, FALSE);
5463 o_ptr->timeout = rand_int(225) + 225;
5468 bool pet = (randint(5) != 1);
5470 if (summon_named_creature(py, px, MON_JIZOTAKO, FALSE, TRUE, FALSE, pet))
5474 msg_print("Âý¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5476 msg_print("A group of octopuses appear as your servant.");
5481 msg_print("Âý¤Ï¤¢¤Ê¤¿¤òâˤó¤Ç¤¤¤ë¡ª");
5483 msg_print("A group of octopuses appear as your enemy!");
5488 o_ptr->timeout = 300 + randint(150);
5495 msg_print("Å´µå¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
5497 msg_print("The iron ball floods the area with goodness...");
5500 dispel_evil(p_ptr->lev * 5);
5501 o_ptr->timeout = rand_int(100) + 100;
5508 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤¬¿¼¤¤°Ç¤Ëʤ¤ï¤ì¤¿...");
5510 msg_print("Your amulet is coverd in pitch-darkness...");
5512 if (!get_aim_dir(&dir)) return;
5513 fire_ball(GF_DARK, dir, 250, 4);
5514 o_ptr->timeout = rand_int(150) + 150;
5520 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5526 else if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_TMP_RES_ACID))
5528 (void)set_oppose_acid(randint(20) + 20, FALSE);
5529 o_ptr->timeout = rand_int(50) + 50;
5533 else if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_TMP_RES_ELEC))
5535 (void)set_oppose_elec(randint(20) + 20, FALSE);
5536 o_ptr->timeout = rand_int(50) + 50;
5540 else if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_TMP_RES_FIRE))
5542 (void)set_oppose_fire(randint(20) + 20, FALSE);
5543 o_ptr->timeout = rand_int(50) + 50;
5547 else if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_TMP_RES_COLD))
5549 (void)set_oppose_cold(randint(20) + 20, FALSE);
5550 o_ptr->timeout = rand_int(50) + 50;
5554 else if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_EARTHQUAKE))
5556 earthquake(py, px, 5);
5557 o_ptr->timeout = 100 + randint(100);
5560 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5567 else if (o_ptr->name2 == EGO_TRUMP)
5569 teleport_player(100);
5570 o_ptr->timeout = 50 + randint(50);
5573 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5580 else if (o_ptr->name2 == EGO_LITE_ILLUMINATION)
5582 if (!o_ptr->xtra4 && ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
5585 msg_print("dzÎÁ¤¬¤Ê¤¤¡£");
5587 msg_print("It has no fuel.");
5592 lite_area(damroll(2, 15), 3);
5593 o_ptr->timeout = rand_int(10) + 10;
5596 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5602 else if (o_ptr->name2 == EGO_EARTHQUAKES)
5604 earthquake(py, px, 5);
5605 o_ptr->timeout = 100 + randint(100);
5608 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5615 else if (o_ptr->name2 == EGO_JUMP)
5617 teleport_player(10);
5618 o_ptr->timeout = 10 + randint(10);
5621 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5628 /* Hack -- Dragon Scale Mail can be activated as well */
5629 else if (o_ptr->tval == TV_DRAG_ARMOR)
5631 /* Get a direction for breathing (or abort) */
5632 if (!get_aim_dir(&dir)) return;
5634 /* Branch on the sub-type */
5635 switch (o_ptr->sval)
5637 case SV_DRAGON_BLUE:
5640 msg_print("¤¢¤Ê¤¿¤Ï°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5642 msg_print("You breathe lightning.");
5645 fire_ball(GF_ELEC, dir, 100, -2);
5646 o_ptr->timeout = rand_int(150) + 150;
5650 case SV_DRAGON_WHITE:
5653 msg_print("¤¢¤Ê¤¿¤ÏÎ䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5655 msg_print("You breathe frost.");
5658 fire_ball(GF_COLD, dir, 110, -2);
5659 o_ptr->timeout = rand_int(150) + 150;
5663 case SV_DRAGON_BLACK:
5666 msg_print("¤¢¤Ê¤¿¤Ï»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5668 msg_print("You breathe acid.");
5671 fire_ball(GF_ACID, dir, 130, -2);
5672 o_ptr->timeout = rand_int(150) + 150;
5676 case SV_DRAGON_GREEN:
5679 msg_print("¤¢¤Ê¤¿¤ÏÆÇ¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5681 msg_print("You breathe poison gas.");
5684 fire_ball(GF_POIS, dir, 150, -2);
5685 o_ptr->timeout = rand_int(180) + 180;
5692 msg_print("¤¢¤Ê¤¿¤Ï²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5694 msg_print("You breathe fire.");
5697 fire_ball(GF_FIRE, dir, 200, -2);
5698 o_ptr->timeout = rand_int(200) + 200;
5702 case SV_DRAGON_MULTIHUED:
5704 chance = rand_int(5);
5706 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5707 ((chance == 1) ? "°ðºÊ" :
5708 ((chance == 2) ? "Î䵤" :
5709 ((chance == 3) ? "»À" :
5710 ((chance == 4) ? "ÆÇ¥¬¥¹" : "²Ð±ê")))));
5712 msg_format("You breathe %s.",
5713 ((chance == 1) ? "lightning" :
5714 ((chance == 2) ? "frost" :
5715 ((chance == 3) ? "acid" :
5716 ((chance == 4) ? "poison gas" : "fire")))));
5719 fire_ball(((chance == 1) ? GF_ELEC :
5720 ((chance == 2) ? GF_COLD :
5721 ((chance == 3) ? GF_ACID :
5722 ((chance == 4) ? GF_POIS : GF_FIRE)))),
5724 o_ptr->timeout = rand_int(200) + 200;
5728 case SV_DRAGON_BRONZE:
5731 msg_print("¤¢¤Ê¤¿¤Ïº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5733 msg_print("You breathe confusion.");
5736 fire_ball(GF_CONFUSION, dir, 120, -2);
5737 o_ptr->timeout = rand_int(180) + 180;
5741 case SV_DRAGON_GOLD:
5744 msg_print("¤¢¤Ê¤¿¤Ï¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5746 msg_print("You breathe sound.");
5749 fire_ball(GF_SOUND, dir, 130, -2);
5750 o_ptr->timeout = rand_int(180) + 180;
5754 case SV_DRAGON_CHAOS:
5756 chance = rand_int(2);
5758 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5759 ((chance == 1 ? "¥«¥ª¥¹" : "Îô²½")));
5761 msg_format("You breathe %s.",
5762 ((chance == 1 ? "chaos" : "disenchantment")));
5765 fire_ball((chance == 1 ? GF_CHAOS : GF_DISENCHANT),
5767 o_ptr->timeout = rand_int(200) + 200;
5773 chance = rand_int(2);
5775 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5776 ((chance == 1 ? "¹ì²»" : "ÇËÊÒ")));
5778 msg_format("You breathe %s.",
5779 ((chance == 1 ? "sound" : "shards")));
5782 fire_ball((chance == 1 ? GF_SOUND : GF_SHARDS),
5784 o_ptr->timeout = rand_int(200) + 200;
5788 case SV_DRAGON_BALANCE:
5790 chance = rand_int(4);
5792 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿",
5793 ((chance == 1) ? "¥«¥ª¥¹" :
5794 ((chance == 2) ? "Îô²½" :
5795 ((chance == 3) ? "¹ì²»" : "ÇËÊÒ"))));
5797 msg_format("You breathe %s.",
5798 ((chance == 1) ? "chaos" :
5799 ((chance == 2) ? "disenchantment" :
5800 ((chance == 3) ? "sound" : "shards"))));
5803 fire_ball(((chance == 1) ? GF_CHAOS :
5804 ((chance == 2) ? GF_DISENCHANT :
5805 ((chance == 3) ? GF_SOUND : GF_SHARDS))),
5807 o_ptr->timeout = rand_int(200) + 200;
5811 case SV_DRAGON_SHINING:
5813 chance = rand_int(2);
5815 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5816 ((chance == 0 ? "Á®¸÷" : "°Å¹õ")));
5818 msg_format("You breathe %s.",
5819 ((chance == 0 ? "light" : "darkness")));
5822 fire_ball((chance == 0 ? GF_LITE : GF_DARK), dir, 200, -2);
5823 o_ptr->timeout = rand_int(200) + 200;
5827 case SV_DRAGON_POWER:
5830 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5832 msg_print("You breathe the elements.");
5835 fire_ball(GF_MISSILE, dir, 300, -3);
5836 o_ptr->timeout = rand_int(200) + 200;
5842 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5848 else if (o_ptr->tval == TV_RING)
5852 bool success = TRUE;
5854 switch (o_ptr->name2)
5857 (void)set_afraid(0);
5858 (void)set_hero(randint(25) + 25, FALSE);
5859 (void)hp_player(10);
5860 o_ptr->timeout = randint(100)+100;
5862 case EGO_RING_MAGIC_MIS:
5863 if (!get_aim_dir(&dir)) return;
5864 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
5867 case EGO_RING_FIRE_BOLT:
5868 if (!get_aim_dir(&dir)) return;
5869 fire_bolt(GF_FIRE, dir, damroll(9, 8));
5870 o_ptr->timeout = rand_int(8) + 8;
5872 case EGO_RING_COLD_BOLT:
5873 if (!get_aim_dir(&dir)) return;
5874 fire_bolt(GF_COLD, dir, damroll(6, 8));
5875 o_ptr->timeout = rand_int(7) + 7;
5877 case EGO_RING_ELEC_BOLT:
5878 if (!get_aim_dir(&dir)) return;
5879 fire_bolt(GF_ELEC, dir, damroll(4, 8));
5880 o_ptr->timeout = rand_int(5) + 5;
5882 case EGO_RING_ACID_BOLT:
5883 if (!get_aim_dir(&dir)) return;
5884 fire_bolt(GF_FIRE, dir, damroll(5, 8));
5885 o_ptr->timeout = rand_int(6) + 6;
5887 case EGO_RING_MANA_BOLT:
5888 if (!get_aim_dir(&dir)) return;
5889 fire_bolt(GF_MANA, dir, 120);
5890 o_ptr->timeout = rand_int(120)+120;
5892 case EGO_RING_FIRE_BALL:
5893 if (!get_aim_dir(&dir)) return;
5894 fire_ball(GF_FIRE, dir, 100, 2);
5895 o_ptr->timeout = rand_int(80) + 80;
5897 case EGO_RING_COLD_BALL:
5898 if (!get_aim_dir(&dir)) return;
5899 fire_ball(GF_COLD, dir, 100, 2);
5900 o_ptr->timeout = rand_int(80) + 80;
5902 case EGO_RING_ELEC_BALL:
5903 if (!get_aim_dir(&dir)) return;
5904 fire_ball(GF_ELEC, dir, 100, 2);
5905 o_ptr->timeout = rand_int(80) + 80;
5907 case EGO_RING_ACID_BALL:
5908 if (!get_aim_dir(&dir)) return;
5909 fire_ball(GF_ACID, dir, 100, 2);
5910 o_ptr->timeout = rand_int(80) + 80;
5912 case EGO_RING_MANA_BALL:
5913 if (!get_aim_dir(&dir)) return;
5914 fire_ball(GF_MANA, dir, 250, 2);
5915 o_ptr->timeout = 300;
5917 case EGO_RING_DRAGON_F:
5918 if (!get_aim_dir(&dir)) return;
5919 fire_ball(GF_FIRE, dir, 200, -2);
5920 if (o_ptr->sval == SV_RING_FLAMES)
5922 (void)set_oppose_fire(randint(20) + 20, FALSE);
5923 o_ptr->timeout = 200;
5925 else o_ptr->timeout = 250;
5927 case EGO_RING_DRAGON_C:
5928 if (!get_aim_dir(&dir)) return;
5929 fire_ball(GF_COLD, dir, 200, -2);
5930 if (o_ptr->sval == SV_RING_ICE)
5932 (void)set_oppose_cold(randint(20) + 20, FALSE);
5933 o_ptr->timeout = 200;
5935 else o_ptr->timeout = 250;
5937 case EGO_RING_M_DETECT:
5938 (void)detect_monsters_invis(255);
5939 (void)detect_monsters_normal(255);
5940 o_ptr->timeout = 150;
5942 case EGO_RING_D_SPEED:
5943 (void)set_fast(randint(30) + 15, FALSE);
5944 o_ptr->timeout = 100;
5946 case EGO_RING_BERSERKER:
5947 (void)set_shero(randint(25) + 25, FALSE);
5948 o_ptr->timeout = rand_int(75)+75;
5950 case EGO_RING_TELE_AWAY:
5951 if (!get_aim_dir(&dir)) return;
5952 teleport_monster(dir);
5953 o_ptr->timeout = 150;
5957 int v = randint(25)+25;
5958 (void)set_afraid(0);
5959 (void)set_hero(v, FALSE);
5960 (void)hp_player(10);
5961 (void)set_blessed(v, FALSE);
5962 (void)set_oppose_acid(v, FALSE);
5963 (void)set_oppose_elec(v, FALSE);
5964 (void)set_oppose_fire(v, FALSE);
5965 (void)set_oppose_cold(v, FALSE);
5966 (void)set_oppose_pois(v, FALSE);
5967 (void)set_ultimate_res(v, FALSE);
5968 o_ptr->timeout = 777;
5975 if (success) return;
5978 /* Get a direction for breathing (or abort) */
5979 if (!get_aim_dir(&dir)) return;
5981 switch (o_ptr->sval)
5985 fire_ball(GF_ACID, dir, 100, 2);
5986 (void)set_oppose_acid(randint(20) + 20, FALSE);
5987 o_ptr->timeout = rand_int(50) + 50;
5993 fire_ball(GF_COLD, dir, 100, 2);
5994 (void)set_oppose_cold(randint(20) + 20, FALSE);
5995 o_ptr->timeout = rand_int(50) + 50;
5999 case SV_RING_FLAMES:
6001 fire_ball(GF_FIRE, dir, 100, 2);
6002 (void)set_oppose_fire(randint(20) + 20, FALSE);
6003 o_ptr->timeout = rand_int(50) + 50;
6009 fire_ball(GF_ELEC, dir, 100, 2);
6010 (void)set_oppose_elec(randint(20) + 20, FALSE);
6011 o_ptr->timeout = rand_int(50) + 50;
6017 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6023 else if (o_ptr->tval == TV_AMULET)
6027 switch (o_ptr->name2)
6030 if (!ident_spell(FALSE)) return;
6031 o_ptr->timeout = 10;
6034 if (!get_aim_dir(&dir)) return;
6035 charm_monster(dir, MAX(20, p_ptr->lev));
6036 o_ptr->timeout = 200;
6039 teleport_player(10);
6040 o_ptr->timeout = rand_int(10) + 10;
6042 case EGO_AMU_TELEPORT:
6043 teleport_player(100);
6044 o_ptr->timeout = rand_int(50) + 50;
6046 case EGO_AMU_D_DOOR:
6047 (void)dimension_door();
6048 o_ptr->timeout = 200;
6050 case EGO_AMU_RES_FIRE_:
6051 (void)set_oppose_fire(randint(20) + 20, FALSE);
6052 o_ptr->timeout = rand_int(50) + 50;
6054 case EGO_AMU_RES_COLD_:
6055 (void)set_oppose_cold(randint(20) + 20, FALSE);
6056 o_ptr->timeout = rand_int(50) + 50;
6058 case EGO_AMU_RES_ELEC_:
6059 (void)set_oppose_elec(randint(20) + 20, FALSE);
6060 o_ptr->timeout = rand_int(50) + 50;
6062 case EGO_AMU_RES_ACID_:
6063 (void)set_oppose_acid(randint(20) + 20, FALSE);
6064 o_ptr->timeout = rand_int(50) + 50;
6066 case EGO_AMU_DETECTION:
6067 detect_all(DETECT_RAD_DEFAULT);
6068 o_ptr->timeout = rand_int(55)+55;
6075 else if (o_ptr->tval == TV_WHISTLE)
6078 if (cursed_p(o_ptr))
6081 msg_print("¥«¥ó¹â¤¤²»¤¬¶Á¤ÅϤä¿¡£");
6083 msg_print("You produce a shrill whistling sound.");
6085 aggravate_monsters(0);
6095 /* Allocate the "who" array */
6096 C_MAKE(who, max_m_idx, u16b);
6098 /* Process the monsters (backwards) */
6099 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6101 if (is_pet(&m_list[pet_ctr]) && (p_ptr->riding != pet_ctr))
6102 who[max_pet++] = pet_ctr;
6105 /* Select the sort method */
6106 ang_sort_comp = ang_sort_comp_pet;
6107 ang_sort_swap = ang_sort_swap_hook;
6109 ang_sort(who, &dummy_why, max_pet);
6111 /* Process the monsters (backwards) */
6112 for (i = 0; i < max_pet; i++)
6115 teleport_to_player(pet_ctr, 100);
6118 /* Free the "who" array */
6119 C_KILL(who, max_m_idx, u16b);
6121 o_ptr->timeout = 100+randint(100);
6124 else if (o_ptr->tval == TV_CAPTURE)
6128 bool old_target_pet = target_pet;
6130 if (!get_aim_dir(&dir))
6132 target_pet = old_target_pet;
6135 target_pet = old_target_pet;
6137 if(fire_ball(GF_CAPTURE, dir, 0, 0))
6139 o_ptr->pval = cap_mon;
6140 o_ptr->xtra3 = cap_mspeed;
6141 o_ptr->xtra4 = cap_hp;
6142 o_ptr->xtra5 = cap_maxhp;
6149 if (o_ptr->inscription)
6150 strcpy(buf, quark_str(o_ptr->inscription));
6152 for (s = buf;*s && (*s != '#'); s++)
6155 if (iskanji(*s)) s++;
6165 t = quark_str(cap_nickname);
6178 o_ptr->inscription = quark_add(buf);
6184 bool success = FALSE;
6185 if (!get_rep_dir2(&dir)) return;
6186 if (cave_floor_bold(py+ddy[dir],px+ddx[dir]))
6188 if (place_monster_aux(py + ddy[dir], px + ddx[dir], o_ptr->pval, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE))
6190 if (o_ptr->xtra3) m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
6191 if (o_ptr->xtra5) m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
6192 if (o_ptr->xtra4) m_list[hack_m_idx_ii].hp = o_ptr->xtra4;
6193 m_list[hack_m_idx_ii].maxhp = m_list[hack_m_idx_ii].max_maxhp;
6194 if (o_ptr->inscription)
6202 t = quark_str(o_ptr->inscription);
6203 for (t = quark_str(o_ptr->inscription);*t && (*t != '#'); t++)
6206 if (iskanji(*t)) t++;
6231 if (quote && *(s-1) =='\'')
6235 m_list[hack_m_idx_ii].nickname = quark_add(buf);
6236 t = quark_str(o_ptr->inscription);
6238 while(*t && (*t != '#'))
6245 o_ptr->inscription = quark_add(buf);
6257 msg_print("¤ª¤Ã¤È¡¢²òÊü¤Ë¼ºÇÔ¤·¤¿¡£");
6259 msg_print("Oops. You failed to release your pet.");
6267 msg_print("¤ª¤Ã¤È¡¢¤³¤Î¥¢¥¤¥Æ¥à¤Ï»ÏÆ°¤Ç¤¤Ê¤¤¡£");
6269 msg_print("Oops. That object cannot be activated.");
6275 void do_cmd_activate(void)
6281 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6283 set_action(ACTION_NONE);
6286 item_tester_no_ryoute = TRUE;
6287 /* Prepare the hook */
6288 item_tester_hook = item_tester_hook_activate;
6292 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò»ÏÆ°¤µ¤»¤Þ¤¹¤«? ";
6293 s = "»ÏÆ°¤Ç¤¤ë¥¢¥¤¥Æ¥à¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£";
6295 q = "Activate which item? ";
6296 s = "You have nothing to activate.";
6299 if (!get_item(&item, q, s, (USE_EQUIP))) return;
6301 /* Activate the item */
6302 do_cmd_activate_aux(item);
6307 * Hook to determine if an object is useable
6309 static bool item_tester_hook_use(object_type *o_ptr)
6314 if (o_ptr->tval == p_ptr->tval_ammo)
6317 /* Useable object */
6318 switch (o_ptr->tval)
6336 if (!object_known_p(o_ptr)) return (FALSE);
6338 /* HACK - only items from the equipment can be activated */
6339 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
6341 if (&inventory[i] == o_ptr)
6343 /* Extract the flags */
6344 object_flags(o_ptr, &f1, &f2, &f3);
6346 /* Check activation flag */
6347 if (f3 & TR3_ACTIVATE) return (TRUE);
6360 * XXX - Add actions for other item types
6362 void do_cmd_use(void)
6368 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6370 set_action(ACTION_NONE);
6373 item_tester_no_ryoute = TRUE;
6374 /* Prepare the hook */
6375 item_tester_hook = item_tester_hook_use;
6379 q = "¤É¤ì¤ò»È¤¤¤Þ¤¹¤«¡©";
6380 s = "»È¤¨¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤»¤ó¡£";
6382 q = "Use which item? ";
6383 s = "You have nothing to use.";
6386 if (!get_item(&item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR))) return;
6388 /* Get the item (in the pack) */
6391 o_ptr = &inventory[item];
6393 /* Get the item (on the floor) */
6396 o_ptr = &o_list[0 - item];
6399 switch (o_ptr->tval)
6411 do_cmd_eat_food_aux(item);
6418 do_cmd_aim_wand_aux(item);
6425 do_cmd_use_staff_aux(item);
6432 do_cmd_zap_rod_aux(item);
6436 /* Quaff a potion */
6439 do_cmd_quaff_potion_aux(item);
6446 /* Check some conditions */
6450 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡£");
6452 msg_print("You can't see anything.");
6460 msg_print("ÌÀ¤«¤ê¤¬¤Ê¤¤¤Î¤Ç¡¢°Å¤¯¤ÆÆɤá¤Ê¤¤¡£");
6462 msg_print("You have no light to read by.");
6467 if (p_ptr->confused)
6470 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
6472 msg_print("You are too confused!");
6478 do_cmd_read_scroll_aux(item);
6487 do_cmd_fire_aux(item, &inventory[INVEN_BOW]);
6491 /* Activate an artifact */
6494 do_cmd_activate_aux(item);
6500 static bool select_magic_eater(int mode)
6506 int ask = TRUE, i = 0;
6509 int menu_line = (use_menu ? 1 : 0);
6513 if (repeat_pull(&sn))
6515 /* Verify the spell */
6516 if (sn > 71 && !(p_ptr->magic_num1[sn] > k_info[lookup_kind(TV_ROD, i)].pval * (p_ptr->magic_num2[sn] - 1) * 0x10000L))
6518 else if (sn < 72 && !(p_ptr->magic_num1[sn] < 0x10000))
6522 #endif /* ALLOW_REPEAT */
6524 for (i = 0; i < 108; i++)
6526 if (p_ptr->magic_num2[i]) break;
6531 msg_print("ËâË¡¤ò³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6533 msg_print("You don't have any magic!");
6545 prt(format(" %s ¾ó", (menu_line == 1) ? "¡Õ" : " "), 2, 14);
6546 prt(format(" %s ËâË¡ËÀ", (menu_line == 2) ? "¡Õ" : " "), 3, 14);
6547 prt(format(" %s ¥í¥Ã¥É", (menu_line == 3) ? "¡Õ" : " "), 4, 14);
6548 prt("¤É¤Î¼ïÎà¤ÎËâË¡¤ò»È¤¤¤Þ¤¹¤«¡©", 0, 0);
6550 prt(format(" %s staff", (menu_line == 1) ? "> " : " "), 2, 14);
6551 prt(format(" %s wand", (menu_line == 2) ? "> " : " "), 3, 14);
6552 prt(format(" %s rod", (menu_line == 3) ? "> " : " "), 4, 14);
6553 prt("Which type of magic do you usu?", 0, 0);
6576 ext = (menu_line-1)*36;
6577 if (menu_line == 1) tval = TV_STAFF;
6578 else if (menu_line == 2) tval = TV_WAND;
6582 if (menu_line > 3) menu_line -= 3;
6591 if (!get_com("[A] ¾ó, [B] ËâË¡ËÀ, [C] ¥í¥Ã¥É:", &choice, TRUE))
6593 if (!get_com("[A] staff, [B] wand, [C] rod:", &choice, TRUE))
6598 if (choice == 'A' || choice == 'a')
6604 if (choice == 'B' || choice == 'b')
6610 if (choice == 'C' || choice == 'c')
6618 for (i = ext; i < ext + 36; i++)
6620 if (p_ptr->magic_num2[i])
6622 if (use_menu) menu_line = i-ext+1;
6629 msg_print("¤½¤Î¼ïÎà¤ÎËâË¡¤Ï³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6631 msg_print("You don't have that type of magic!");
6636 /* Nothing chosen yet */
6642 /* Build a prompt */
6644 (void) strnfmt(out_val, 78, "('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎËâÎϤò»È¤¤¤Þ¤¹¤«¡©");
6646 (void)strnfmt(out_val, 78, "(*=List, ESC=exit) Use which power? ");
6648 if (use_menu) screen_save();
6650 /* Get a spell from the user */
6652 choice = (always_show_list || use_menu) ? ESCAPE:1;
6655 if( choice==ESCAPE ) choice = ' ';
6656 else if( !get_com(out_val, &choice, FALSE) )break;
6658 if (use_menu && choice != ' ')
6676 if (menu_line > 36) menu_line -= 36;
6677 } while(!p_ptr->magic_num2[menu_line+ext-1]);
6688 if (menu_line > 36) menu_line -= 36;
6689 } while(!p_ptr->magic_num2[menu_line+ext-1]);
6700 bool reverse = FALSE;
6701 if ((choice == '4') || (choice == 'h') || (choice == 'H')) reverse = TRUE;
6708 while(!p_ptr->magic_num2[menu_line+ext-1])
6713 if (menu_line < 2) reverse = FALSE;
6718 if (menu_line > 35) reverse = TRUE;
6734 /* Request redraw */
6735 if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && ask))
6738 if (!redraw || use_menu)
6752 /* Save the screen */
6753 if (!use_menu) screen_save();
6755 for (y = 1; y < 20; y++)
6760 /* Print header(s) */
6762 prt(format(" %s ¼ºÎ¨ %s ¼ºÎ¨", (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô"), (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô")), y++, x);
6764 prt(format(" %s Fail %s Fail", (tval == TV_ROD ? " Stat " : " Charges"), (tval == TV_ROD ? " Stat " : " Charges")), y++, x);
6768 for (ctr = 0; ctr < 36; ctr++)
6770 if (!p_ptr->magic_num2[ctr+ext]) continue;
6772 k_idx = lookup_kind(tval, ctr);
6776 if (ctr == (menu_line-1))
6778 strcpy(dummy, "¡Õ");
6780 strcpy(dummy, "> ");
6782 else strcpy(dummy, " ");
6785 /* letter/number for power selection */
6792 letter = '0' + ctr - 26;
6793 sprintf(dummy, "%c)",letter);
6795 x1 = ((ctr < 18) ? x : x + 40);
6796 y1 = ((ctr < 18) ? y + ctr : y + ctr - 18);
6797 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
6798 chance = level * 4 / 5 + 20;
6799 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
6801 if (p_ptr->lev > level)
6803 chance -= 3 * (p_ptr->lev - level);
6805 if (p_ptr->pseikaku == SEIKAKU_NAMAKE) chance += 10;
6806 if (p_ptr->heavy_spell) chance += 20;
6807 if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
6808 else if (p_ptr->easy_spell) chance-=3;
6809 else if (p_ptr->dec_mana) chance-=2;
6810 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
6811 /* Stunning makes spells harder */
6812 if (p_ptr->stun > 50) chance += 25;
6813 else if (p_ptr->stun) chance += 15;
6815 if (chance > 95) chance = 95;
6817 if(p_ptr->dec_mana) chance--;
6818 if (p_ptr->heavy_spell) chance += 5;
6826 strcat(dummy, format(
6828 " %-22.22s ½¼Å¶:%2d/%2d%3d%%",
6830 " %-22.22s (%2d/%2d) %3d%%",
6832 k_name + k_info[k_idx].name,
6833 p_ptr->magic_num1[ctr+ext] ?
6834 (p_ptr->magic_num1[ctr+ext] - 1) / (0x10000L * k_info[k_idx].pval) +1 : 0,
6835 p_ptr->magic_num2[ctr+ext], chance));
6836 if (p_ptr->magic_num1[ctr+ext] > k_info[k_idx].pval * (p_ptr->magic_num2[ctr+ext]-1) * 0x10000L) col = TERM_RED;
6840 strcat(dummy, format(" %-22.22s %2d/%2d %3d%%", k_name + k_info[k_idx].name, (s16b)(p_ptr->magic_num1[ctr+ext]/0x10000), p_ptr->magic_num2[ctr+ext], chance));
6841 if (p_ptr->magic_num1[ctr+ext] < 0x10000L) col = TERM_RED;
6846 c_prt(col, dummy, y1, x1);
6856 /* Restore the screen */
6866 if (isalpha(choice))
6869 ask = (isupper(choice));
6872 if (ask) choice = tolower(choice);
6874 /* Extract request */
6875 i = (islower(choice) ? A2I(choice) : -1);
6879 ask = FALSE; /* Can't uppercase digits */
6881 i = choice - '0' + 26;
6885 /* Totally Illegal */
6886 if ((i < 0) || (i > 36) || !p_ptr->magic_num2[i+ext])
6901 (void) strnfmt(tmp_val, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", k_name + k_info[lookup_kind(tval ,i)].name);
6903 (void) strnfmt(tmp_val, 78, "Use %s?", k_name + k_info[lookup_kind(tval ,i)].name);
6906 /* Belay that order */
6907 if (!get_check(tmp_val)) continue;
6911 if (p_ptr->magic_num1[ext+i] > k_info[lookup_kind(tval, i)].pval * (p_ptr->magic_num2[ext+i] - 1) * 0x10000L)
6914 msg_print("¤½¤ÎËâË¡¤Ï¤Þ¤À½¼Å¶¤·¤Æ¤¤¤ëºÇÃæ¤À¡£");
6916 msg_print("The magic are still charging.");
6919 if (use_menu) ask = TRUE;
6925 if (p_ptr->magic_num1[ext+i] < 0x10000L)
6928 msg_print("¤½¤ÎËâË¡¤Ï»ÈÍѲó¿ô¤¬ÀÚ¤ì¤Æ¤¤¤ë¡£");
6930 msg_print("The magic has no charges left.");
6933 if (use_menu) ask = TRUE;
6943 /* Restore the screen */
6944 if (redraw) screen_load();
6946 if (!flag) return -1;
6950 #endif /* ALLOW_REPEAT */
6954 void do_cmd_magic_eater(void)
6956 int item, dir, chance, level, k_idx, tval, sval;
6957 bool use_charge = TRUE;
6959 /* Not when confused */
6960 if (p_ptr->confused)
6963 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
6965 msg_print("You are too confused!");
6971 item = select_magic_eater(0);
6977 if (item > 71) {tval = TV_ROD;sval = item - 72;}
6978 else if (item > 35) {tval = TV_WAND;sval = item - 36;}
6979 else {tval = TV_STAFF;sval = item;}
6980 k_idx = lookup_kind(tval, sval);
6982 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
6983 chance = level * 4 / 5 + 20;
6984 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
6986 if (p_ptr->lev > level)
6988 chance -= 3 * (p_ptr->lev - level);
6990 if (p_ptr->pseikaku == SEIKAKU_NAMAKE) chance += 10;
6991 if (p_ptr->heavy_spell) chance += 20;
6992 if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
6993 else if (p_ptr->easy_spell) chance-=3;
6994 else if (p_ptr->dec_mana) chance-=2;
6995 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
6996 /* Stunning makes spells harder */
6997 if (p_ptr->stun > 50) chance += 25;
6998 else if (p_ptr->stun) chance += 15;
7000 if (chance > 95) chance = 95;
7002 if(p_ptr->dec_mana) chance--;
7003 if (p_ptr->heavy_spell) chance += 5;
7005 if (rand_int(100) < chance)
7007 if (flush_failure) flush();
7010 msg_print("¼öʸ¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª");
7012 msg_format("You failed to get the magic off!");
7016 if (randint(100) >= chance)
7017 chg_virtue(V_CHANCE,-1);
7026 if ((sval >= SV_ROD_MIN_DIRECTION) && (sval != SV_ROD_HAVOC) && (sval != SV_ROD_AGGRAVATE) && (sval != SV_ROD_PESTICIDE))
7027 if (!get_aim_dir(&dir)) return;
7028 rod_effect(sval, dir, &use_charge, TRUE);
7029 if (!use_charge) return;
7031 else if (tval == TV_WAND)
7033 if (!get_aim_dir(&dir)) return;
7034 wand_effect(sval, dir, TRUE);
7038 staff_effect(sval, &use_charge, TRUE);
7039 if (!use_charge) return;
7041 if (randint(100) < chance)
7042 chg_virtue(V_CHANCE,1);
7045 if (tval == TV_ROD) p_ptr->magic_num1[item] += k_info[k_idx].pval * 0x10000L;
7046 else p_ptr->magic_num1[item] -= 0x10000L;