3 /* Purpose: Object commands */
6 * Copyright (c) 1989 James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research, and
9 * not for profit purposes provided that this copyright and statement are
10 * included in all such copies.
17 * This file includes code for eating food, drinking potions,
18 * reading scrolls, aiming wands, using staffs, zapping rods,
19 * and activating artifacts.
21 * In all cases, if the player becomes "aware" of the item's use
22 * by testing it, mark it as "aware" and reward some experience
23 * based on the object's level, always rounding up. If the player
24 * remains "unaware", mark that object "kind" as "tried".
26 * This code now correctly handles the unstacking of wands, staffs,
27 * and rods. Note the overly paranoid warning about potential pack
28 * overflow, which allows the player to use and drop a stacked item.
30 * In all "unstacking" scenarios, the "used" object is "carried" as if
31 * the player had just picked it up. In particular, this means that if
32 * the use of an item induces pack overflow, that item will be dropped.
34 * For simplicity, these routines induce a full "pack reorganization"
35 * which not only combines similar items, but also reorganizes various
36 * items to obey the current "sorting" method. This may require about
37 * 400 item comparisons, but only occasionally.
39 * There may be a BIG problem with any "effect" that can cause "changes"
40 * to the inventory. For example, a "scroll of recharging" can cause
41 * a wand/staff to "disappear", moving the inventory up. Luckily, the
42 * scrolls all appear BEFORE the staffs/wands, so this is not a problem.
43 * But, for example, a "staff of recharging" could cause MAJOR problems.
44 * In such a case, it will be best to either (1) "postpone" the effect
45 * until the end of the function, or (2) "change" the effect, say, into
46 * giving a staff "negative" charges, or "turning a staff into a stick".
47 * It seems as though a "rod of recharging" might in fact cause problems.
48 * The basic problem is that the act of recharging (and destroying) an
49 * item causes the inducer of that action to "move", causing "o_ptr" to
50 * no longer point at the correct item, with horrifying results.
52 * Note that food/potions/scrolls no longer use bit-flags for effects,
53 * but instead use the "sval" (which is also used to sort the objects).
57 static void do_cmd_eat_food_aux(int item)
62 /* Get the item (in the pack) */
65 o_ptr = &inventory[item];
68 /* Get the item (on the floor) */
71 o_ptr = &o_list[0 - item];
80 /* Identity not known yet */
84 lev = get_object_level(o_ptr);
86 if (o_ptr->tval == TV_FOOD)
88 /* Analyze the food */
93 if (!(p_ptr->resist_pois || p_ptr->oppose_pois))
95 if (set_poisoned(p_ptr->poisoned + randint0(10) + 10))
103 case SV_FOOD_BLINDNESS:
105 if (!p_ptr->resist_blind)
107 if (set_blind(p_ptr->blind + randint0(200) + 200))
115 case SV_FOOD_PARANOIA:
117 if (!p_ptr->resist_fear)
119 if (set_afraid(p_ptr->afraid + randint0(10) + 10))
127 case SV_FOOD_CONFUSION:
129 if (!p_ptr->resist_conf)
131 if (set_confused(p_ptr->confused + randint0(10) + 10))
139 case SV_FOOD_HALLUCINATION:
141 if (!p_ptr->resist_chaos)
143 if (set_image(p_ptr->image + randint0(250) + 250))
151 case SV_FOOD_PARALYSIS:
153 if (!p_ptr->free_act)
155 if (set_paralyzed(p_ptr->paralyzed + randint0(10) + 10))
163 case SV_FOOD_WEAKNESS:
166 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "ÆÇÆþ¤ê¿©ÎÁ", -1);
168 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "poisonous food", -1);
171 (void)do_dec_stat(A_STR);
176 case SV_FOOD_SICKNESS:
179 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "ÆÇÆþ¤ê¿©ÎÁ", -1);
181 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "poisonous food", -1);
184 (void)do_dec_stat(A_CON);
189 case SV_FOOD_STUPIDITY:
192 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "ÆÇÆþ¤ê¿©ÎÁ", -1);
194 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "poisonous food", -1);
197 (void)do_dec_stat(A_INT);
202 case SV_FOOD_NAIVETY:
205 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "ÆÇÆþ¤ê¿©ÎÁ", -1);
207 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "poisonous food", -1);
210 (void)do_dec_stat(A_WIS);
215 case SV_FOOD_UNHEALTH:
218 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "ÆÇÆþ¤ê¿©ÎÁ", -1);
220 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "poisonous food", -1);
223 (void)do_dec_stat(A_CON);
228 case SV_FOOD_DISEASE:
231 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "ÆÇÆþ¤ê¿©ÎÁ", -1);
233 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "poisonous food", -1);
236 (void)do_dec_stat(A_STR);
241 case SV_FOOD_CURE_POISON:
243 if (set_poisoned(0)) ident = TRUE;
247 case SV_FOOD_CURE_BLINDNESS:
249 if (set_blind(0)) ident = TRUE;
253 case SV_FOOD_CURE_PARANOIA:
255 if (set_afraid(0)) ident = TRUE;
259 case SV_FOOD_CURE_CONFUSION:
261 if (set_confused(0)) ident = TRUE;
265 case SV_FOOD_CURE_SERIOUS:
267 if (hp_player(damroll(4, 8))) ident = TRUE;
271 case SV_FOOD_RESTORE_STR:
273 if (do_res_stat(A_STR)) ident = TRUE;
277 case SV_FOOD_RESTORE_CON:
279 if (do_res_stat(A_CON)) ident = TRUE;
283 case SV_FOOD_RESTORING:
285 if (do_res_stat(A_STR)) ident = TRUE;
286 if (do_res_stat(A_INT)) ident = TRUE;
287 if (do_res_stat(A_WIS)) ident = TRUE;
288 if (do_res_stat(A_DEX)) ident = TRUE;
289 if (do_res_stat(A_CON)) ident = TRUE;
290 if (do_res_stat(A_CHR)) ident = TRUE;
296 /* ¤½¤ì¤¾¤ì¤Î¿©¤Ùʪ¤Î´¶ÁÛ¤ò¥ª¥ê¥¸¥Ê¥ë¤è¤êºÙ¤«¤¯É½¸½ */
297 case SV_FOOD_BISCUIT:
299 msg_print("´Å¤¯¤Æ¥µ¥¯¥µ¥¯¤·¤Æ¤È¤Æ¤â¤ª¤¤¤·¤¤¡£");
306 msg_print("»õ¤´¤¿¤¨¤¬¤¢¤Ã¤Æ¤ª¤¤¤·¤¤¡£");
311 case SV_FOOD_SLIME_MOLD:
313 msg_print("¤³¤ì¤Ï¤Ê¤ó¤È¤â·ÁÍƤ·¤¬¤¿¤¤Ì£¤À¡£");
320 msg_print("¤³¤ì¤Ï¤ª¤¤¤·¤¤¡£");
326 case SV_FOOD_BISCUIT:
328 case SV_FOOD_SLIME_MOLD:
330 msg_print("That tastes good.");
337 case SV_FOOD_WAYBREAD:
340 msg_print("¤³¤ì¤Ï¤Ò¤¸¤ç¤¦¤ËÈþÌ£¤À¡£");
342 msg_print("That tastes good.");
345 (void)set_poisoned(0);
346 (void)hp_player(damroll(4, 8));
352 case SV_FOOD_PINT_OF_ALE:
354 msg_print("¤Î¤É¤´¤·Á֤䤫¤À¡£");
359 case SV_FOOD_PINT_OF_WINE:
361 msg_print("That tastes good.");
366 case SV_FOOD_PINT_OF_ALE:
367 case SV_FOOD_PINT_OF_WINE:
369 msg_print("That tastes good.");
378 /* Combine / Reorder the pack (later) */
379 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
381 if (!(object_aware_p(o_ptr)))
383 chg_virtue(V_KNOWLEDGE, -1);
384 chg_virtue(V_PATIENCE, -1);
385 chg_virtue(V_CHANCE, 1);
388 /* We have tried it */
391 /* The player is now aware of the object */
392 if (ident && !object_aware_p(o_ptr))
395 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
399 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
402 /* Food can feed the player */
403 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
405 /* Reduced nutritional benefit */
406 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
408 msg_print("¤¢¤Ê¤¿¤Î¤è¤¦¤Ê¼Ô¤Ë¤È¤Ã¤Æ¿©ÎȤʤɶϤ«¤Ê±ÉÍܤˤ·¤«¤Ê¤é¤Ê¤¤¡£");
410 msg_print("Mere victuals hold scant sustenance for a being such as yourself.");
413 if (p_ptr->food < PY_FOOD_ALERT) /* Hungry */
415 msg_print("¤¢¤Ê¤¿¤Îµ²¤¨¤Ï¿·Á¯¤Ê·ì¤Ë¤è¤Ã¤Æ¤Î¤ßËþ¤¿¤µ¤ì¤ë¡ª");
417 msg_print("Your hunger can only be satisfied with fresh blood!");
421 else if (p_ptr->prace == RACE_SKELETON)
423 if (!((o_ptr->sval == SV_FOOD_WAYBREAD) ||
424 (o_ptr->sval < SV_FOOD_BISCUIT)))
427 object_type *q_ptr = &forge;
430 msg_print("¿©¤Ùʪ¤¬¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¤¿¡ª");
432 msg_print("The food falls through your jaws!");
436 /* Create the item */
437 object_prep(q_ptr, lookup_kind(o_ptr->tval, o_ptr->sval));
439 /* Drop the object from heaven */
440 (void)drop_near(q_ptr, -1, py, px);
445 msg_print("¿©¤Ùʪ¤¬¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¡¢¾Ã¤¨¤¿¡ª");
447 msg_print("The food falls through your jaws and vanishes!");
452 else if ((p_ptr->prace == RACE_GOLEM) ||
453 (p_ptr->prace == RACE_ZOMBIE) ||
454 (p_ptr->prace == RACE_ENT) ||
455 (p_ptr->prace == RACE_DEMON) ||
456 (p_ptr->prace == RACE_ANDROID) ||
457 (p_ptr->prace == RACE_SPECTRE) ||
458 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
461 msg_print("À¸¼Ô¤Î¿©Êª¤Ï¤¢¤Ê¤¿¤Ë¤È¤Ã¤Æ¤Û¤È¤ó¤É±ÉÍܤˤʤé¤Ê¤¤¡£");
463 msg_print("The food of mortals is poor sustenance for you.");
466 set_food(p_ptr->food + ((o_ptr->pval) / 20));
470 (void)set_food(p_ptr->food + o_ptr->pval);
473 /* Destroy a food in the pack */
476 inven_item_increase(item, -1);
477 inven_item_describe(item);
478 inven_item_optimize(item);
481 /* Destroy a food on the floor */
484 floor_item_increase(0 - item, -1);
485 floor_item_describe(0 - item);
486 floor_item_optimize(0 - item);
492 * Hook to determine if an object is eatable
494 static bool item_tester_hook_eatable(object_type *o_ptr)
496 /* if ((o_ptr->tval==TV_FOOD) || ((o_ptr->tval==TV_CORPSE) && o_ptr->sval)) return (TRUE); */
497 if (o_ptr->tval==TV_FOOD) return (TRUE);
505 * Eat some food (from the pack or floor)
507 void do_cmd_eat_food(void)
513 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
515 set_action(ACTION_NONE);
518 /* Restrict choices to food */
519 item_tester_hook = item_tester_hook_eatable;
523 q = "¤É¤ì¤ò¿©¤Ù¤Þ¤¹¤«? ";
524 s = "¿©¤Ùʪ¤¬¤Ê¤¤¡£";
526 q = "Eat which item? ";
527 s = "You have nothing to eat.";
530 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
533 do_cmd_eat_food_aux(item);
538 * Quaff a potion (from the pack or the floor)
540 static void do_cmd_quaff_potion_aux(int item)
553 if (flush_failure) flush();
555 msg_print("ÉÓ¤«¤é¿å¤¬Î®¤ì½Ð¤Æ¤³¤Ê¤¤¡ª");
557 msg_print("The potion doesn't flow out from a bottle.");
564 if((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0])
569 /* Get the item (in the pack) */
572 o_ptr = &inventory[item];
575 /* Get the item (on the floor) */
578 o_ptr = &o_list[0 - item];
581 /* Get local object */
584 /* Obtain a local object */
585 object_copy(q_ptr, o_ptr);
590 /* Reduce and describe inventory */
593 inven_item_increase(item, -1);
594 inven_item_describe(item);
595 inven_item_optimize(item);
598 /* Reduce and describe floor item */
601 floor_item_increase(0 - item, -1);
602 floor_item_describe(0 - item);
603 floor_item_optimize(0 - item);
610 /* Not identified yet */
614 lev = get_object_level(q_ptr);
616 /* Analyze the potion */
620 /* °û¤ß¤´¤¿¤¨¤ò¥ª¥ê¥¸¥Ê¥ë¤è¤êºÙ¤«¤¯É½¸½ */
621 case SV_POTION_WATER:
623 msg_print("¸ý¤ÎÃ椬¤µ¤Ã¤Ñ¤ê¤·¤¿¡£");
624 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
628 case SV_POTION_APPLE_JUICE:
630 msg_print("´Å¤¯¤Æ¥µ¥Ã¥Ñ¥ê¤È¤·¤Æ¤¤¤Æ¡¢¤È¤Æ¤â¤ª¤¤¤·¤¤¡£");
631 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
635 case SV_POTION_SLIME_MOLD:
637 msg_print("¤Ê¤ó¤È¤âÉÔµ¤Ì£¤ÊÌ£¤À¡£");
638 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
643 case SV_POTION_WATER:
644 case SV_POTION_APPLE_JUICE:
645 case SV_POTION_SLIME_MOLD:
647 msg_print("You feel less thirsty.");
654 case SV_POTION_SLOWNESS:
656 if (set_slow(randint1(25) + 15, FALSE)) ident = TRUE;
660 case SV_POTION_SALT_WATER:
663 msg_print("¤¦¤§¡ª»×¤ï¤ºÅǤ¤¤Æ¤·¤Þ¤Ã¤¿¡£");
665 msg_print("The potion makes you vomit!");
668 (void)set_food(PY_FOOD_STARVE - 1);
669 (void)set_poisoned(0);
670 (void)set_paralyzed(p_ptr->paralyzed + 4);
675 case SV_POTION_POISON:
677 if (!(p_ptr->resist_pois || p_ptr->oppose_pois))
679 if (set_poisoned(p_ptr->poisoned + randint0(15) + 10))
687 case SV_POTION_BLINDNESS:
689 if (!p_ptr->resist_blind)
691 if (set_blind(p_ptr->blind + randint0(100) + 100))
699 case SV_POTION_CONFUSION: /* Booze */
701 if (p_ptr->pclass != CLASS_MONK) chg_virtue(V_HARMONY, -1);
702 else if (!p_ptr->resist_conf) p_ptr->special_attack |= ATTACK_SUIKEN;
703 if (!p_ptr->resist_conf)
705 if (set_confused(randint0(20) + 15))
711 if (!p_ptr->resist_chaos)
715 if (set_image(p_ptr->image + randint0(150) + 150))
720 if (one_in_(13) && (p_ptr->pclass != CLASS_MONK))
723 if (one_in_(3)) lose_all_info();
725 teleport_player(100);
728 msg_print("ÃΤé¤Ê¤¤¾ì½ê¤ÇÌܤ¬Àä᤿¡£Æ¬Äˤ¬¤¹¤ë¡£");
729 msg_print("²¿¤â»×¤¤½Ð¤»¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ØÍ褿¤Î¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
731 msg_print("You wake up somewhere with a sore head...");
732 msg_print("You can't remember a thing, or how you got here!");
740 case SV_POTION_SLEEP:
742 if (!p_ptr->free_act)
745 msg_print("¤¢¤Ê¤¿¤Ï̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
747 msg_print("You fall asleep.");
751 if (ironman_nightmare)
754 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
756 msg_print("A horrible vision enters your mind.");
760 /* Pick a nightmare */
761 get_mon_num_prep(get_nightmare, NULL);
763 /* Have some nightmares */
764 have_nightmare(get_mon_num(MAX_DEPTH));
766 /* Remove the monster restriction */
767 get_mon_num_prep(NULL, NULL);
769 if (set_paralyzed(p_ptr->paralyzed + randint0(4) + 4))
777 case SV_POTION_LOSE_MEMORIES:
779 if (!p_ptr->hold_life && (p_ptr->exp > 0))
782 msg_print("²áµî¤Îµ²±¤¬Çö¤ì¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
784 msg_print("You feel your memories fade.");
786 chg_virtue(V_KNOWLEDGE, -5);
788 lose_exp(p_ptr->exp / 4);
794 case SV_POTION_RUINATION:
797 msg_print("¿È¤â¿´¤â¼å¤Ã¤Æ¤¤Æ¡¢Àºµ¤¤¬È´¤±¤Æ¤¤¤¯¤è¤¦¤À¡£");
798 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), "ÇËÌǤÎÌô", -1);
800 msg_print("Your nerves and muscles feel weak and lifeless!");
801 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), "a potion of Ruination", -1);
804 (void)dec_stat(A_DEX, 25, TRUE);
805 (void)dec_stat(A_WIS, 25, TRUE);
806 (void)dec_stat(A_CON, 25, TRUE);
807 (void)dec_stat(A_STR, 25, TRUE);
808 (void)dec_stat(A_CHR, 25, TRUE);
809 (void)dec_stat(A_INT, 25, TRUE);
814 case SV_POTION_DEC_STR:
816 if (do_dec_stat(A_STR)) ident = TRUE;
820 case SV_POTION_DEC_INT:
822 if (do_dec_stat(A_INT)) ident = TRUE;
826 case SV_POTION_DEC_WIS:
828 if (do_dec_stat(A_WIS)) ident = TRUE;
832 case SV_POTION_DEC_DEX:
834 if (do_dec_stat(A_DEX)) ident = TRUE;
838 case SV_POTION_DEC_CON:
840 if (do_dec_stat(A_CON)) ident = TRUE;
844 case SV_POTION_DEC_CHR:
846 if (do_dec_stat(A_CHR)) ident = TRUE;
850 case SV_POTION_DETONATIONS:
853 msg_print("ÂΤÎÃæ¤Ç·ã¤·¤¤Çúȯ¤¬µ¯¤¤¿¡ª");
854 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), "Çúȯ¤ÎÌô", -1);
856 msg_print("Massive explosions rupture your body!");
857 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), "a potion of Detonation", -1);
860 (void)set_stun(p_ptr->stun + 75);
861 (void)set_cut(p_ptr->cut + 5000);
866 case SV_POTION_DEATH:
868 chg_virtue(V_VITALITY, -1);
869 chg_virtue(V_UNLIFE, 5);
871 msg_print("»à¤Îͽ´¶¤¬ÂÎÃæ¤ò¶î¤±¤á¤°¤Ã¤¿¡£");
872 take_hit(DAMAGE_LOSELIFE, 5000, "»à¤ÎÌô", -1);
874 msg_print("A feeling of Death flows through your body.");
875 take_hit(DAMAGE_LOSELIFE, 5000, "a potion of Death", -1);
882 case SV_POTION_INFRAVISION:
884 if (set_tim_infra(p_ptr->tim_infra + 100 + randint1(100), FALSE))
891 case SV_POTION_DETECT_INVIS:
893 if (set_tim_invis(p_ptr->tim_invis + 12 + randint1(12), FALSE))
900 case SV_POTION_SLOW_POISON:
902 if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
906 case SV_POTION_CURE_POISON:
908 if (set_poisoned(0)) ident = TRUE;
912 case SV_POTION_BOLDNESS:
914 if (set_afraid(0)) ident = TRUE;
918 case SV_POTION_SPEED:
922 if (set_fast(randint1(25) + 15, FALSE)) ident = TRUE;
926 (void)set_fast(p_ptr->fast + 5, FALSE);
931 case SV_POTION_RESIST_HEAT:
933 if (set_oppose_fire(p_ptr->oppose_fire + randint1(10) + 10, FALSE))
940 case SV_POTION_RESIST_COLD:
942 if (set_oppose_cold(p_ptr->oppose_cold + randint1(10) + 10, FALSE))
949 case SV_POTION_HEROISM:
951 if (set_afraid(0)) ident = TRUE;
952 if (set_hero(p_ptr->hero + randint1(25) + 25, FALSE)) ident = TRUE;
953 if (hp_player(10)) ident = TRUE;
957 case SV_POTION_BESERK_STRENGTH:
959 if (set_afraid(0)) ident = TRUE;
960 if (set_shero(p_ptr->shero + randint1(25) + 25, FALSE)) ident = TRUE;
961 if (hp_player(30)) ident = TRUE;
965 case SV_POTION_CURE_LIGHT:
967 if (hp_player(damroll(2, 8))) ident = TRUE;
968 if (set_blind(0)) ident = TRUE;
969 if (set_cut(p_ptr->cut - 10)) ident = TRUE;
970 if (set_shero(0,TRUE)) ident = TRUE;
974 case SV_POTION_CURE_SERIOUS:
976 if (hp_player(damroll(4, 8))) ident = TRUE;
977 if (set_blind(0)) ident = TRUE;
978 if (set_confused(0)) ident = TRUE;
979 if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;
980 if (set_shero(0,TRUE)) ident = TRUE;
984 case SV_POTION_CURE_CRITICAL:
986 if (hp_player(damroll(6, 8))) ident = TRUE;
987 if (set_blind(0)) ident = TRUE;
988 if (set_confused(0)) ident = TRUE;
989 if (set_poisoned(0)) ident = TRUE;
990 if (set_stun(0)) ident = TRUE;
991 if (set_cut(0)) ident = TRUE;
992 if (set_shero(0,TRUE)) ident = TRUE;
996 case SV_POTION_HEALING:
998 if (hp_player(300)) ident = TRUE;
999 if (set_blind(0)) ident = TRUE;
1000 if (set_confused(0)) ident = TRUE;
1001 if (set_poisoned(0)) ident = TRUE;
1002 if (set_stun(0)) ident = TRUE;
1003 if (set_cut(0)) ident = TRUE;
1004 if (set_shero(0,TRUE)) ident = TRUE;
1008 case SV_POTION_STAR_HEALING:
1010 if (hp_player(1200)) ident = TRUE;
1011 if (set_blind(0)) ident = TRUE;
1012 if (set_confused(0)) ident = TRUE;
1013 if (set_poisoned(0)) ident = TRUE;
1014 if (set_stun(0)) ident = TRUE;
1015 if (set_cut(0)) ident = TRUE;
1016 if (set_shero(0,TRUE)) ident = TRUE;
1020 case SV_POTION_LIFE:
1022 chg_virtue(V_VITALITY, 1);
1023 chg_virtue(V_UNLIFE, -5);
1025 msg_print("ÂÎÃæ¤ËÀ¸Ì¿ÎϤ¬Ëþ¤Á¤¢¤Õ¤ì¤Æ¤¤¿¡ª");
1027 msg_print("You feel life flow through your body!");
1031 (void)set_poisoned(0);
1033 (void)set_confused(0);
1037 (void)do_res_stat(A_STR);
1038 (void)do_res_stat(A_CON);
1039 (void)do_res_stat(A_DEX);
1040 (void)do_res_stat(A_WIS);
1041 (void)do_res_stat(A_INT);
1042 (void)do_res_stat(A_CHR);
1043 (void)set_shero(0,TRUE);
1050 case SV_POTION_RESTORE_MANA:
1052 if (p_ptr->pclass == CLASS_MAGIC_EATER)
1055 for (i = 0; i < EATER_EXT*2; i++)
1057 p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i]*EATER_CHARGE/3;
1058 if (p_ptr->magic_num1[i] > p_ptr->magic_num2[i]*EATER_CHARGE) p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*EATER_CHARGE;
1060 for (; i < EATER_EXT*3; i++)
1062 int k_idx = lookup_kind(TV_ROD, i-EATER_EXT*2);
1063 p_ptr->magic_num1[i] -= ((p_ptr->magic_num2[i] < 10) ? EATER_ROD_CHARGE*3 : p_ptr->magic_num2[i]*EATER_ROD_CHARGE/3)*k_info[k_idx].pval;
1064 if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
1067 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
1069 msg_print("Your feel your head clear.");
1071 p_ptr->window |= (PW_PLAYER);
1074 else if (p_ptr->csp < p_ptr->msp)
1076 p_ptr->csp = p_ptr->msp;
1077 p_ptr->csp_frac = 0;
1079 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
1081 msg_print("Your feel your head clear.");
1084 p_ptr->redraw |= (PR_MANA);
1085 p_ptr->window |= (PW_PLAYER);
1086 p_ptr->window |= (PW_SPELL);
1089 if (set_shero(0,TRUE)) ident = TRUE;
1093 case SV_POTION_RESTORE_EXP:
1095 if (restore_level()) ident = TRUE;
1099 case SV_POTION_RES_STR:
1101 if (do_res_stat(A_STR)) ident = TRUE;
1105 case SV_POTION_RES_INT:
1107 if (do_res_stat(A_INT)) ident = TRUE;
1111 case SV_POTION_RES_WIS:
1113 if (do_res_stat(A_WIS)) ident = TRUE;
1117 case SV_POTION_RES_DEX:
1119 if (do_res_stat(A_DEX)) ident = TRUE;
1123 case SV_POTION_RES_CON:
1125 if (do_res_stat(A_CON)) ident = TRUE;
1129 case SV_POTION_RES_CHR:
1131 if (do_res_stat(A_CHR)) ident = TRUE;
1135 case SV_POTION_INC_STR:
1137 if (do_inc_stat(A_STR)) ident = TRUE;
1141 case SV_POTION_INC_INT:
1143 if (do_inc_stat(A_INT)) ident = TRUE;
1147 case SV_POTION_INC_WIS:
1149 if (do_inc_stat(A_WIS)) ident = TRUE;
1153 case SV_POTION_INC_DEX:
1155 if (do_inc_stat(A_DEX)) ident = TRUE;
1159 case SV_POTION_INC_CON:
1161 if (do_inc_stat(A_CON)) ident = TRUE;
1165 case SV_POTION_INC_CHR:
1167 if (do_inc_stat(A_CHR)) ident = TRUE;
1171 case SV_POTION_AUGMENTATION:
1173 if (do_inc_stat(A_STR)) ident = TRUE;
1174 if (do_inc_stat(A_INT)) ident = TRUE;
1175 if (do_inc_stat(A_WIS)) ident = TRUE;
1176 if (do_inc_stat(A_DEX)) ident = TRUE;
1177 if (do_inc_stat(A_CON)) ident = TRUE;
1178 if (do_inc_stat(A_CHR)) ident = TRUE;
1182 case SV_POTION_ENLIGHTENMENT:
1185 msg_print("¼«Ê¬¤ÎÃÖ¤«¤ì¤Æ¤¤¤ë¾õ¶·¤¬Ç¾Î¢¤ËÉ⤫¤ó¤Ç¤¤¿...");
1187 msg_print("An image of your surroundings forms in your mind...");
1190 chg_virtue(V_KNOWLEDGE, 1);
1191 chg_virtue(V_ENLIGHTEN, 1);
1192 wiz_lite(FALSE, FALSE);
1197 case SV_POTION_STAR_ENLIGHTENMENT:
1200 msg_print("¹¹¤Ê¤ë·¼Ìؤò´¶¤¸¤¿...");
1202 msg_print("You begin to feel more enlightened...");
1205 chg_virtue(V_KNOWLEDGE, 1);
1206 chg_virtue(V_ENLIGHTEN, 2);
1208 wiz_lite(TRUE, FALSE);
1209 (void)do_inc_stat(A_INT);
1210 (void)do_inc_stat(A_WIS);
1211 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1212 (void)detect_doors(DETECT_RAD_DEFAULT);
1213 (void)detect_stairs(DETECT_RAD_DEFAULT);
1214 (void)detect_treasure(DETECT_RAD_DEFAULT);
1215 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
1216 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
1223 case SV_POTION_SELF_KNOWLEDGE:
1226 msg_print("¼«Ê¬¼«¿È¤Î¤³¤È¤¬¾¯¤·¤Ïʬ¤«¤Ã¤¿µ¤¤¬¤¹¤ë...");
1228 msg_print("You begin to know yourself a little better...");
1237 case SV_POTION_EXPERIENCE:
1239 if (p_ptr->prace == RACE_ANDROID) break;
1240 chg_virtue(V_ENLIGHTEN, 1);
1241 if (p_ptr->exp < PY_MAX_EXP)
1243 s32b ee = (p_ptr->exp / 2) + 10;
1244 if (ee > 100000L) ee = 100000L;
1246 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1248 msg_print("You feel more experienced.");
1257 case SV_POTION_RESISTANCE:
1259 (void)set_oppose_acid(p_ptr->oppose_acid + randint1(20) + 20, FALSE);
1260 (void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
1261 (void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
1262 (void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
1263 (void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
1268 case SV_POTION_CURING:
1270 if (hp_player(50)) ident = TRUE;
1271 if (set_blind(0)) ident = TRUE;
1272 if (set_poisoned(0)) ident = TRUE;
1273 if (set_confused(0)) ident = TRUE;
1274 if (set_stun(0)) ident = TRUE;
1275 if (set_cut(0)) ident = TRUE;
1276 if (set_image(0)) ident = TRUE;
1280 case SV_POTION_INVULNERABILITY:
1282 (void)set_invuln(p_ptr->invuln + randint1(4) + 4, FALSE);
1287 case SV_POTION_NEW_LIFE:
1289 do_cmd_rerate(FALSE);
1291 p_ptr->update |= PU_BONUS;
1292 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
1294 chg_virtue(V_CHANCE, -5);
1296 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
1298 msg_print("You are cured of all mutations.");
1301 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
1302 p_ptr->update |= PU_BONUS;
1304 mutant_regenerate_mod = calc_mutant_regenerate_mod();
1310 case SV_POTION_NEO_TSUYOSHI:
1313 (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
1318 case SV_POTION_TSUYOSHI:
1321 msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
1323 msg_print("Brother OKURE!");
1326 p_ptr->tsuyoshi = 1;
1327 (void)set_tsuyoshi(0, TRUE);
1328 if (!p_ptr->resist_chaos)
1330 (void)set_image(50 + randint1(50));
1336 case SV_POTION_POLYMORPH:
1338 if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23))
1340 chg_virtue(V_CHANCE, -5);
1342 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
1344 msg_print("You are cured of all mutations.");
1347 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
1348 p_ptr->update |= PU_BONUS;
1357 if(gain_random_mutation(0)) ident = TRUE;
1359 else if (lose_mutation(0)) ident = TRUE;
1360 } while(!ident || one_in_(2));
1366 if (p_ptr->prace == RACE_SKELETON)
1369 msg_print("±ÕÂΤΰìÉô¤Ï¤¢¤Ê¤¿¤Î¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¤¿¡ª");
1371 msg_print("Some of the fluid falls through your jaws!");
1374 (void)potion_smash_effect(0, py, px, q_ptr->k_idx);
1377 /* Combine / Reorder the pack (later) */
1378 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1380 if (!(object_aware_p(o_ptr)))
1382 chg_virtue(V_PATIENCE, -1);
1383 chg_virtue(V_CHANCE, 1);
1384 chg_virtue(V_KNOWLEDGE, -1);
1387 /* The item has been tried */
1388 object_tried(q_ptr);
1390 /* An identification was made */
1391 if (ident && !object_aware_p(q_ptr))
1393 object_aware(q_ptr);
1394 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
1398 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
1400 /* Potions can feed the player */
1401 switch (p_ptr->mimic_form)
1404 switch (p_ptr->prace)
1407 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
1418 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1421 (void)set_food(p_ptr->food + o_ptr->pval);
1426 case MIMIC_DEMON_LORD:
1427 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1430 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
1433 (void)set_food(p_ptr->food + o_ptr->pval);
1439 void do_cmd_quaff_potion(void)
1444 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
1446 set_action(ACTION_NONE);
1449 /* Restrict choices to potions */
1450 item_tester_tval = TV_POTION;
1454 q = "¤É¤ÎÌô¤ò°û¤ß¤Þ¤¹¤«? ";
1455 s = "°û¤á¤ëÌô¤¬¤Ê¤¤¡£";
1457 q = "Quaff which potion? ";
1458 s = "You have no potions to quaff.";
1461 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1463 /* Quaff the potion */
1464 do_cmd_quaff_potion_aux(item);
1469 * Read a scroll (from the pack or floor).
1471 * Certain scrolls can be "aborted" without losing the scroll. These
1472 * include scrolls with no effects but recharge or identify, which are
1473 * cancelled before use. XXX Reading them still takes a turn, though.
1475 static void do_cmd_read_scroll_aux(int item, bool known)
1477 int k, used_up, ident, lev;
1482 /* Get the item (in the pack) */
1485 o_ptr = &inventory[item];
1488 /* Get the item (on the floor) */
1491 o_ptr = &o_list[0 - item];
1500 if (flush_failure) flush();
1502 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
1504 msg_print("Nothing happen.");
1511 if (p_ptr->pclass == CLASS_BERSERKER)
1514 msg_print("´¬Êª¤Ê¤ó¤ÆÆɤá¤Ê¤¤¡£");
1516 msg_print("You cannot read.");
1521 if((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0])
1526 /* Not identified yet */
1530 lev = get_object_level(o_ptr);
1532 /* Assume the scroll will get used up */
1535 if (o_ptr->tval == TV_SCROLL)
1537 /* Analyze the scroll */
1538 switch (o_ptr->sval)
1540 case SV_SCROLL_DARKNESS:
1542 if (!(p_ptr->resist_blind) && !(p_ptr->resist_dark))
1544 (void)set_blind(p_ptr->blind + 3 + randint1(5));
1546 if (unlite_area(10, 3)) ident = TRUE;
1550 case SV_SCROLL_AGGRAVATE_MONSTER:
1553 msg_print("¥«¥ó¹â¤¯¤¦¤Ê¤ëÍͤʲ»¤¬ÊÕ¤ê¤òʤ¤Ã¤¿¡£");
1555 msg_print("There is a high pitched humming noise.");
1558 aggravate_monsters(0);
1563 case SV_SCROLL_CURSE_ARMOR:
1565 if (curse_armor()) ident = TRUE;
1569 case SV_SCROLL_CURSE_WEAPON:
1571 if (curse_weapon(FALSE, INVEN_RARM)) ident = TRUE;
1575 case SV_SCROLL_SUMMON_MONSTER:
1577 for (k = 0; k < randint1(3); k++)
1579 if (summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
1587 case SV_SCROLL_SUMMON_UNDEAD:
1589 for (k = 0; k < randint1(3); k++)
1591 if (summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
1599 case SV_SCROLL_SUMMON_PET:
1601 if (summon_specific(-1, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_FORCE_PET)))
1608 case SV_SCROLL_SUMMON_KIN:
1610 if (summon_kin_player(p_ptr->lev, py, px, (PM_FORCE_PET | PM_ALLOW_GROUP)))
1617 case SV_SCROLL_TRAP_CREATION:
1619 if (trap_creation(py, px)) ident = TRUE;
1623 case SV_SCROLL_PHASE_DOOR:
1625 teleport_player(10);
1630 case SV_SCROLL_TELEPORT:
1632 teleport_player(100);
1637 case SV_SCROLL_TELEPORT_LEVEL:
1639 (void)teleport_player_level();
1644 case SV_SCROLL_WORD_OF_RECALL:
1646 if (!word_of_recall()) used_up = FALSE;
1651 case SV_SCROLL_IDENTIFY:
1654 if (!ident_spell(FALSE, TRUE)) used_up = FALSE;
1658 case SV_SCROLL_STAR_IDENTIFY:
1661 if (!identify_fully(FALSE, TRUE)) used_up = FALSE;
1665 case SV_SCROLL_REMOVE_CURSE:
1670 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1672 msg_print("You feel as if someone is watching over you.");
1680 case SV_SCROLL_STAR_REMOVE_CURSE:
1682 if (remove_all_curse())
1685 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1687 msg_print("You feel as if someone is watching over you.");
1694 case SV_SCROLL_ENCHANT_ARMOR:
1697 if (!enchant_spell(0, 0, 1)) used_up = FALSE;
1701 case SV_SCROLL_ENCHANT_WEAPON_TO_HIT:
1703 if (!enchant_spell(1, 0, 0)) used_up = FALSE;
1708 case SV_SCROLL_ENCHANT_WEAPON_TO_DAM:
1710 if (!enchant_spell(0, 1, 0)) used_up = FALSE;
1715 case SV_SCROLL_STAR_ENCHANT_ARMOR:
1717 if (!enchant_spell(0, 0, randint1(3) + 2)) used_up = FALSE;
1722 case SV_SCROLL_STAR_ENCHANT_WEAPON:
1724 if (!enchant_spell(randint1(3), randint1(3), 0)) used_up = FALSE;
1729 case SV_SCROLL_RECHARGING:
1731 if (!recharge(130)) used_up = FALSE;
1736 case SV_SCROLL_MUNDANITY:
1739 if (!mundane_spell(FALSE)) used_up = FALSE;
1743 case SV_SCROLL_LIGHT:
1745 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
1749 case SV_SCROLL_MAPPING:
1751 map_area(DETECT_RAD_MAP);
1756 case SV_SCROLL_DETECT_GOLD:
1758 if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
1759 if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
1763 case SV_SCROLL_DETECT_ITEM:
1765 if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
1769 case SV_SCROLL_DETECT_TRAP:
1771 if (detect_traps(DETECT_RAD_DEFAULT, known)) ident = TRUE;
1775 case SV_SCROLL_DETECT_DOOR:
1777 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
1778 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
1782 case SV_SCROLL_DETECT_INVIS:
1784 if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
1788 case SV_SCROLL_SATISFY_HUNGER:
1790 if (set_food(PY_FOOD_MAX - 1)) ident = TRUE;
1794 case SV_SCROLL_BLESSING:
1796 if (set_blessed(p_ptr->blessed + randint1(12) + 6, FALSE)) ident = TRUE;
1800 case SV_SCROLL_HOLY_CHANT:
1802 if (set_blessed(p_ptr->blessed + randint1(24) + 12, FALSE)) ident = TRUE;
1806 case SV_SCROLL_HOLY_PRAYER:
1808 if (set_blessed(p_ptr->blessed + randint1(48) + 24, FALSE)) ident = TRUE;
1812 case SV_SCROLL_MONSTER_CONFUSION:
1814 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1817 msg_print("¼ê¤¬µ±¤»Ï¤á¤¿¡£");
1819 msg_print("Your hands begin to glow.");
1822 p_ptr->special_attack |= ATTACK_CONFUSE;
1823 p_ptr->redraw |= (PR_STATUS);
1829 case SV_SCROLL_PROTECTION_FROM_EVIL:
1832 if (set_protevil(p_ptr->protevil + randint1(25) + k, FALSE)) ident = TRUE;
1836 case SV_SCROLL_RUNE_OF_PROTECTION:
1843 case SV_SCROLL_TRAP_DOOR_DESTRUCTION:
1845 if (destroy_doors_touch()) ident = TRUE;
1849 case SV_SCROLL_STAR_DESTRUCTION:
1851 if (destroy_area(py, px, 13+randint0(5), TRUE))
1855 msg_print("¥À¥ó¥¸¥ç¥ó¤¬Íɤ줿...");
1857 msg_print("The dungeon trembles...");
1864 case SV_SCROLL_DISPEL_UNDEAD:
1866 if (dispel_undead(80)) ident = TRUE;
1870 case SV_SCROLL_SPELL:
1872 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;
1873 p_ptr->add_spells++;
1874 p_ptr->update |= (PU_SPELLS);
1879 case SV_SCROLL_GENOCIDE:
1881 (void)symbol_genocide(300, TRUE);
1886 case SV_SCROLL_MASS_GENOCIDE:
1888 (void)mass_genocide(300, TRUE);
1893 case SV_SCROLL_ACQUIREMENT:
1895 acquirement(py, px, 1, TRUE, FALSE);
1900 case SV_SCROLL_STAR_ACQUIREMENT:
1902 acquirement(py, px, randint1(2) + 1, TRUE, FALSE);
1907 /* New Hengband scrolls */
1908 case SV_SCROLL_FIRE:
1910 fire_ball(GF_FIRE, 0, 666, 4);
1911 /* Note: "Double" damage since it is centered on the player ... */
1912 if (!(p_ptr->oppose_fire || p_ptr->resist_fire || p_ptr->immune_fire))
1914 take_hit(DAMAGE_NOESCAPE, 50+randint1(50), "±ê¤Î´¬Êª", -1);
1916 take_hit(DAMAGE_NOESCAPE, 50 + randint1(50), "a Scroll of Fire", -1);
1926 fire_ball(GF_ICE, 0, 777, 4);
1927 if (!(p_ptr->oppose_cold || p_ptr->resist_cold || p_ptr->immune_cold))
1929 take_hit(DAMAGE_NOESCAPE, 100+randint1(100), "ɹ¤Î´¬Êª", -1);
1931 take_hit(DAMAGE_NOESCAPE, 100 + randint1(100), "a Scroll of Ice", -1);
1938 case SV_SCROLL_CHAOS:
1940 fire_ball(GF_CHAOS, 0, 1000, 4);
1941 if (!p_ptr->resist_chaos)
1943 take_hit(DAMAGE_NOESCAPE, 111+randint1(111), "¥í¥°¥ë¥¹¤Î´¬Êª", -1);
1945 take_hit(DAMAGE_NOESCAPE, 111 + randint1(111), "a Scroll of Logrus", -1);
1952 case SV_SCROLL_RUMOR:
1956 switch (randint1(20))
1960 err = get_rnd_line("chainswd_j.txt", 0, Rumor);
1962 err = get_rnd_line("chainswd.txt", 0, Rumor);
1968 err = get_rnd_line("error_j.txt", 0, Rumor);
1970 err = get_rnd_line("error.txt", 0, Rumor);
1978 err = get_rnd_line("death_j.txt", 0, Rumor);
1980 err = get_rnd_line("death.txt", 0, Rumor);
1986 err = get_rnd_line_jonly("rumors_j.txt", 0, Rumor, 10);
1988 err = get_rnd_line("rumors.txt", 0, Rumor);
1994 /* An error occured */
1996 if (err) strcpy(Rumor, "±³¤Î±½¤â¤¢¤ë¡£");
1998 if (err) strcpy(Rumor, "Some rumors are wrong.");
2003 msg_print("´¬Êª¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤¬½ñ¤«¤ì¤Æ¤¤¤ë:");
2005 msg_print("There is message on the scroll. It says:");
2009 msg_format("%s", Rumor);
2012 msg_print("´¬Êª¤Ï±ì¤òΩ¤Æ¤Æ¾Ã¤¨µî¤Ã¤¿¡ª");
2014 msg_print("The scroll disappears in a puff of smoke!");
2021 case SV_SCROLL_ARTIFACT:
2024 if (!artifact_scroll()) used_up = FALSE;
2028 case SV_SCROLL_RESET_RECALL:
2031 if (!reset_recall()) used_up = FALSE;
2036 else if (o_ptr->name1 == ART_GHB)
2039 msg_print("»ä¤Ï¶ìÏ«¤·¤Æ¡Ø¥°¥ì¡¼¥¿¡¼¡¦¥Ø¥ë=¥Ó¡¼¥¹¥È¡Ù¤òÅݤ·¤¿¡£");
2040 msg_print("¤·¤«¤·¼ê¤ËÆþ¤Ã¤¿¤Î¤Ï¤³¤Î¤¤¿¤Ê¤¤£Ô¥·¥ã¥Ä¤À¤±¤À¤Ã¤¿¡£");
2042 msg_print("I had a very hard time to kill the Greater hell-beast, ");
2043 msg_print("but all I got was this lousy t-shirt!");
2047 else if (o_ptr->name1 == ART_POWER)
2050 msg_print("¡Ö°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤òÅý¤Ù¡¢");
2052 msg_print("°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤ò¸«¤Ä¤±¡¢");
2054 msg_print("°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤òÊá¤é¤¨¤Æ");
2056 msg_print("°Å°Ç¤ÎÃæ¤Ë·Ò¤®¤È¤á¤ë¡£¡×");
2058 msg_print("'One Ring to rule them all, ");
2060 msg_print("One Ring to find them, ");
2062 msg_print("One Ring to bring them all ");
2064 msg_print("and in the darkness bind them.'");
2068 else if (o_ptr->tval==TV_PARCHEMENT)
2071 char o_name[MAX_NLEN];
2077 q=format("book-%d_jp.txt",o_ptr->sval);
2079 /* Display object description */
2080 object_desc(o_name, o_ptr, TRUE, 0);
2082 /* Build the filename */
2083 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, q);
2085 /* Peruse the help file */
2086 (void)show_file(TRUE, buf, o_name, 0, 0);
2095 /* Combine / Reorder the pack (later) */
2096 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2098 if (!(object_aware_p(o_ptr)))
2100 chg_virtue(V_PATIENCE, -1);
2101 chg_virtue(V_CHANCE, 1);
2102 chg_virtue(V_KNOWLEDGE, -1);
2105 /* The item was tried */
2106 object_tried(o_ptr);
2108 /* An identification was made */
2109 if (ident && !object_aware_p(o_ptr))
2111 object_aware(o_ptr);
2112 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
2116 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
2119 /* Hack -- allow certain scrolls to be "preserved" */
2125 sound(SOUND_SCROLL);
2127 /* Destroy a scroll in the pack */
2130 inven_item_increase(item, -1);
2131 inven_item_describe(item);
2132 inven_item_optimize(item);
2135 /* Destroy a scroll on the floor */
2138 floor_item_increase(0 - item, -1);
2139 floor_item_describe(0 - item);
2140 floor_item_optimize(0 - item);
2143 /* Delayed optimization */
2144 optimize_inventry_auto_destroy();
2149 * Hook to determine if an object is readable
2151 static bool item_tester_hook_readable(object_type *o_ptr)
2153 if ((o_ptr->tval==TV_SCROLL) || (o_ptr->tval==TV_PARCHEMENT) || (o_ptr->name1 == ART_GHB) || (o_ptr->name1 == ART_POWER)) return (TRUE);
2160 void do_cmd_read_scroll(void)
2166 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
2168 set_action(ACTION_NONE);
2171 /* Check some conditions */
2175 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡£");
2177 msg_print("You can't see anything.");
2185 msg_print("ÌÀ¤«¤ê¤¬¤Ê¤¤¤Î¤Ç¡¢°Å¤¯¤ÆÆɤá¤Ê¤¤¡£");
2187 msg_print("You have no light to read by.");
2192 if (p_ptr->confused)
2195 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡£");
2197 msg_print("You are too confused!");
2204 /* Restrict choices to scrolls */
2205 item_tester_hook = item_tester_hook_readable;
2209 q = "¤É¤Î´¬Êª¤òÆɤߤޤ¹¤«? ";
2210 s = "Æɤá¤ë´¬Êª¤¬¤Ê¤¤¡£";
2212 q = "Read which scroll? ";
2213 s = "You have no scrolls to read.";
2216 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
2218 /* Get the item (in the pack) */
2221 o_ptr = &inventory[item];
2224 /* Get the item (on the floor) */
2227 o_ptr = &o_list[0 - item];
2230 /* Read the scroll */
2231 do_cmd_read_scroll_aux(item, object_aware_p(o_ptr));
2235 static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
2240 /* Analyze the staff */
2243 case SV_STAFF_DARKNESS:
2245 if (!(p_ptr->resist_blind) && !(p_ptr->resist_dark))
2247 if (set_blind(p_ptr->blind + 3 + randint1(5))) ident = TRUE;
2249 if (unlite_area(10, 3)) ident = TRUE;
2253 case SV_STAFF_SLOWNESS:
2255 if (set_slow(p_ptr->slow + randint1(30) + 15, FALSE)) ident = TRUE;
2259 case SV_STAFF_HASTE_MONSTERS:
2261 if (speed_monsters()) ident = TRUE;
2265 case SV_STAFF_SUMMONING:
2267 for (k = 0; k < randint1(4); k++)
2269 if (summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
2277 case SV_STAFF_TELEPORTATION:
2279 teleport_player(100);
2284 case SV_STAFF_IDENTIFY:
2286 if (!ident_spell(FALSE, TRUE)) *use_charge = FALSE;
2291 case SV_STAFF_REMOVE_CURSE:
2298 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2300 msg_print("You feel as if someone is watching over you.");
2303 else if (!p_ptr->blind)
2306 msg_print("¾ó¤Ï°ì½Ö¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
2308 msg_print("The staff glows blue for a moment...");
2317 case SV_STAFF_STARLITE:
2319 int num = damroll(5, 3);
2323 if (!p_ptr->blind && !magic)
2326 msg_print("¾ó¤ÎÀ褬ÌÀ¤ë¤¯µ±¤¤¤¿...");
2328 msg_print("The end of the staff glows brightly...");
2332 for (k = 0; k < num; k++)
2338 scatter(&y, &x, py, px, 4, 0);
2340 if (!cave_floor_bold(y, x)) continue;
2342 if ((y != py) || (x != px)) break;
2345 project(0, 0, y, x, damroll(6 + p_ptr->lev / 8, 10), GF_LITE_WEAK,
2346 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL), -1);
2354 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
2358 case SV_STAFF_MAPPING:
2360 map_area(DETECT_RAD_MAP);
2365 case SV_STAFF_DETECT_GOLD:
2367 if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
2368 if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
2372 case SV_STAFF_DETECT_ITEM:
2374 if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
2378 case SV_STAFF_DETECT_TRAP:
2380 if (detect_traps(DETECT_RAD_DEFAULT, known)) ident = TRUE;
2384 case SV_STAFF_DETECT_DOOR:
2386 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
2387 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
2391 case SV_STAFF_DETECT_INVIS:
2393 if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
2397 case SV_STAFF_DETECT_EVIL:
2399 if (detect_monsters_evil(DETECT_RAD_DEFAULT)) ident = TRUE;
2403 case SV_STAFF_CURE_LIGHT:
2405 if (hp_player(damroll(2, 8))) ident = TRUE;
2406 if (set_shero(0,TRUE)) ident = TRUE;
2410 case SV_STAFF_CURING:
2412 if (set_blind(0)) ident = TRUE;
2413 if (set_poisoned(0)) ident = TRUE;
2414 if (set_confused(0)) ident = TRUE;
2415 if (set_stun(0)) ident = TRUE;
2416 if (set_cut(0)) ident = TRUE;
2417 if (set_image(0)) ident = TRUE;
2418 if (set_shero(0,TRUE)) ident = TRUE;
2422 case SV_STAFF_HEALING:
2424 if (hp_player(300)) ident = TRUE;
2425 if (set_stun(0)) ident = TRUE;
2426 if (set_cut(0)) ident = TRUE;
2427 if (set_shero(0,TRUE)) ident = TRUE;
2431 case SV_STAFF_THE_MAGI:
2433 if (do_res_stat(A_INT)) ident = TRUE;
2434 if (p_ptr->csp < p_ptr->msp)
2436 p_ptr->csp = p_ptr->msp;
2437 p_ptr->csp_frac = 0;
2440 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
2442 msg_print("Your feel your head clear.");
2445 p_ptr->redraw |= (PR_MANA);
2446 p_ptr->window |= (PW_PLAYER);
2447 p_ptr->window |= (PW_SPELL);
2449 if (set_shero(0,TRUE)) ident = TRUE;
2453 case SV_STAFF_SLEEP_MONSTERS:
2455 if (sleep_monsters()) ident = TRUE;
2459 case SV_STAFF_SLOW_MONSTERS:
2461 if (slow_monsters()) ident = TRUE;
2465 case SV_STAFF_SPEED:
2467 if (set_fast(randint1(30) + 15, FALSE)) ident = TRUE;
2471 case SV_STAFF_PROBING:
2478 case SV_STAFF_DISPEL_EVIL:
2480 if (dispel_evil(80)) ident = TRUE;
2484 case SV_STAFF_POWER:
2486 if (dispel_monsters(150)) ident = TRUE;
2490 case SV_STAFF_HOLINESS:
2492 if (dispel_evil(150)) ident = TRUE;
2494 if (set_protevil((magic ? 0 : p_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
2495 if (set_poisoned(0)) ident = TRUE;
2496 if (set_afraid(0)) ident = TRUE;
2497 if (hp_player(50)) ident = TRUE;
2498 if (set_stun(0)) ident = TRUE;
2499 if (set_cut(0)) ident = TRUE;
2503 case SV_STAFF_GENOCIDE:
2505 (void)symbol_genocide((magic ? p_ptr->lev + 50 : 200), TRUE);
2510 case SV_STAFF_EARTHQUAKES:
2512 if (earthquake(py, px, 10))
2516 msg_print("¥À¥ó¥¸¥ç¥ó¤¬Íɤ줿¡£");
2518 msg_print("The dungeon trembles.");
2525 case SV_STAFF_DESTRUCTION:
2527 if (destroy_area(py, px, 13+randint0(5), TRUE))
2533 case SV_STAFF_ANIMATE_DEAD:
2535 if (animate_dead(0, py, px))
2541 case SV_STAFF_MSTORM:
2544 msg_print("¶¯ÎϤÊËâÎϤ¬Å¨¤ò°ú¤Îö¤¤¤¿¡ª");
2546 msg_print("Mighty magics rend your enemies!");
2548 project(0, 5, py, px,
2549 (randint1(200) + 300) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
2550 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))
2553 (void)take_hit(DAMAGE_NOESCAPE, 50, "¥³¥ó¥È¥í¡¼¥ë¤·Æñ¤¤¶¯ÎϤÊËâÎϤβòÊü", -1);
2555 (void)take_hit(DAMAGE_NOESCAPE, 50, "unleashing magics too mighty to control", -1);
2567 * Use a staff. -RAK-
2569 * One charge of one staff disappears.
2571 * Hack -- staffs of identify can be "cancelled".
2573 static void do_cmd_use_staff_aux(int item)
2575 int ident, chance, lev;
2579 /* Hack -- let staffs of identify get aborted */
2580 bool use_charge = TRUE;
2583 /* Get the item (in the pack) */
2586 o_ptr = &inventory[item];
2589 /* Get the item (on the floor) */
2592 o_ptr = &o_list[0 - item];
2596 /* Mega-Hack -- refuse to use a pile from the ground */
2597 if ((item < 0) && (o_ptr->number > 1))
2600 msg_print("¤Þ¤º¤Ï¾ó¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
2602 msg_print("You must first pick up the staffs.");
2612 /* Extract the item level */
2613 lev = get_object_level(o_ptr);
2614 if (lev > 50) lev = 50 + (lev - 50)/2;
2616 /* Base chance of success */
2617 chance = p_ptr->skill_dev;
2619 /* Confusion hurts skill */
2620 if (p_ptr->confused) chance = chance / 2;
2622 /* Hight level objects are harder */
2623 chance = chance - lev;
2625 /* Give everyone a (slight) chance */
2626 if ((chance < USE_DEVICE) && one_in_(USE_DEVICE - chance + 1))
2628 chance = USE_DEVICE;
2633 if (flush_failure) flush();
2635 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
2637 msg_print("Nothing happen. Maybe this staff is freezing too.");
2644 /* Roll for usage */
2645 if ((chance < USE_DEVICE) || (randint1(chance) < USE_DEVICE) || (p_ptr->pclass == CLASS_BERSERKER))
2647 if (flush_failure) flush();
2649 msg_print("¾ó¤ò¤¦¤Þ¤¯»È¤¨¤Ê¤«¤Ã¤¿¡£");
2651 msg_print("You failed to use the staff properly.");
2658 /* Notice empty staffs */
2659 if (o_ptr->pval <= 0)
2661 if (flush_failure) flush();
2663 msg_print("¤³¤Î¾ó¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£");
2665 msg_print("The staff has no charges left.");
2668 o_ptr->ident |= (IDENT_EMPTY);
2670 /* Combine / Reorder the pack (later) */
2671 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2672 p_ptr->window |= (PW_INVEN);
2681 ident = staff_effect(o_ptr->sval, &use_charge, FALSE, object_aware_p(o_ptr));
2683 if (!(object_aware_p(o_ptr)))
2685 chg_virtue(V_PATIENCE, -1);
2686 chg_virtue(V_CHANCE, 1);
2687 chg_virtue(V_KNOWLEDGE, -1);
2690 /* Combine / Reorder the pack (later) */
2691 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2693 /* Tried the item */
2694 object_tried(o_ptr);
2696 /* An identification was made */
2697 if (ident && !object_aware_p(o_ptr))
2699 object_aware(o_ptr);
2700 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
2704 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
2707 /* Hack -- some uses are "free" */
2708 if (!use_charge) return;
2711 /* Use a single charge */
2714 /* XXX Hack -- unstack if necessary */
2715 if ((item >= 0) && (o_ptr->number > 1))
2720 /* Get local object */
2723 /* Obtain a local object */
2724 object_copy(q_ptr, o_ptr);
2726 /* Modify quantity */
2729 /* Restore the charges */
2732 /* Unstack the used item */
2734 p_ptr->total_weight -= q_ptr->weight;
2735 item = inven_carry(q_ptr);
2739 msg_print("¾ó¤ò¤Þ¤È¤á¤Ê¤ª¤·¤¿¡£");
2741 msg_print("You unstack your staff.");
2746 /* Describe charges in the pack */
2749 inven_item_charges(item);
2752 /* Describe charges on the floor */
2755 floor_item_charges(0 - item);
2758 /* Delayed optimization */
2759 optimize_inventry_auto_destroy();
2763 void do_cmd_use_staff(void)
2768 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
2770 set_action(ACTION_NONE);
2773 /* Restrict choices to wands */
2774 item_tester_tval = TV_STAFF;
2778 q = "¤É¤Î¾ó¤ò»È¤¤¤Þ¤¹¤«? ";
2779 s = "»È¤¨¤ë¾ó¤¬¤Ê¤¤¡£";
2781 q = "Use which staff? ";
2782 s = "You have no staff to use.";
2785 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
2787 do_cmd_use_staff_aux(item);
2791 static int wand_effect(int sval, int dir, bool magic)
2795 /* XXX Hack -- Wand of wonder can do anything before it */
2796 if (sval == SV_WAND_WONDER)
2798 int vir = virtue_number(V_CHANCE);
2799 sval = randint0(SV_WAND_WONDER);
2803 if (p_ptr->virtues[vir - 1] > 0)
2805 while (randint1(300) < p_ptr->virtues[vir - 1]) sval++;
2806 if (sval > SV_WAND_COLD_BALL) sval = randint0(4) + SV_WAND_ACID_BALL;
2810 while (randint1(300) < (0-p_ptr->virtues[vir - 1])) sval--;
2811 if (sval < SV_WAND_HEAL_MONSTER) sval = randint0(3) + SV_WAND_HEAL_MONSTER;
2814 if (sval < SV_WAND_TELEPORT_AWAY)
2815 chg_virtue(V_CHANCE, 1);
2818 /* Analyze the wand */
2821 case SV_WAND_HEAL_MONSTER:
2823 if (heal_monster(dir, damroll(10, 10))) ident = TRUE;
2827 case SV_WAND_HASTE_MONSTER:
2829 if (speed_monster(dir)) ident = TRUE;
2833 case SV_WAND_CLONE_MONSTER:
2835 if (clone_monster(dir)) ident = TRUE;
2839 case SV_WAND_TELEPORT_AWAY:
2841 if (teleport_monster(dir)) ident = TRUE;
2845 case SV_WAND_DISARMING:
2847 if (disarm_trap(dir)) ident = TRUE;
2851 case SV_WAND_TRAP_DOOR_DEST:
2853 if (destroy_door(dir)) ident = TRUE;
2857 case SV_WAND_STONE_TO_MUD:
2859 if (wall_to_mud(dir)) ident = TRUE;
2866 msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
2868 msg_print("A line of blue shimmering light appears.");
2871 (void)lite_line(dir);
2876 case SV_WAND_SLEEP_MONSTER:
2878 if (sleep_monster(dir)) ident = TRUE;
2882 case SV_WAND_SLOW_MONSTER:
2884 if (slow_monster(dir)) ident = TRUE;
2888 case SV_WAND_CONFUSE_MONSTER:
2890 if (confuse_monster(dir, p_ptr->lev)) ident = TRUE;
2894 case SV_WAND_FEAR_MONSTER:
2896 if (fear_monster(dir, p_ptr->lev)) ident = TRUE;
2900 case SV_WAND_DRAIN_LIFE:
2902 if (drain_life(dir, 80 + p_ptr->lev)) ident = TRUE;
2906 case SV_WAND_POLYMORPH:
2908 if (poly_monster(dir)) ident = TRUE;
2912 case SV_WAND_STINKING_CLOUD:
2914 fire_ball(GF_POIS, dir, 12 + p_ptr->lev / 4, 2);
2919 case SV_WAND_MAGIC_MISSILE:
2921 fire_bolt_or_beam(20, GF_MISSILE, dir, damroll(2 + p_ptr->lev / 10, 6));
2926 case SV_WAND_ACID_BOLT:
2928 fire_bolt_or_beam(20, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
2933 case SV_WAND_CHARM_MONSTER:
2935 if (charm_monster(dir, MAX(20, p_ptr->lev)))
2940 case SV_WAND_FIRE_BOLT:
2942 fire_bolt_or_beam(20, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
2947 case SV_WAND_COLD_BOLT:
2949 fire_bolt_or_beam(20, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
2954 case SV_WAND_ACID_BALL:
2956 fire_ball(GF_ACID, dir, 60 + 3 * p_ptr->lev / 4, 2);
2961 case SV_WAND_ELEC_BALL:
2963 fire_ball(GF_ELEC, dir, 40 + 3 * p_ptr->lev / 4, 2);
2968 case SV_WAND_FIRE_BALL:
2970 fire_ball(GF_FIRE, dir, 70 + 3 * p_ptr->lev / 4, 2);
2975 case SV_WAND_COLD_BALL:
2977 fire_ball(GF_COLD, dir, 50 + 3 * p_ptr->lev / 4, 2);
2982 case SV_WAND_WONDER:
2985 msg_print("¤ª¤Ã¤È¡¢Ææ¤ÎËâË¡ËÀ¤ò»ÏÆ°¤µ¤»¤¿¡£");
2987 msg_print("Oops. Wand of wonder activated.");
2993 case SV_WAND_DRAGON_FIRE:
2995 fire_ball(GF_FIRE, dir, 200, -3);
3000 case SV_WAND_DRAGON_COLD:
3002 fire_ball(GF_COLD, dir, 180, -3);
3007 case SV_WAND_DRAGON_BREATH:
3009 switch (randint1(5))
3013 fire_ball(GF_ACID, dir, 240, -3);
3019 fire_ball(GF_ELEC, dir, 210, -3);
3025 fire_ball(GF_FIRE, dir, 240, -3);
3031 fire_ball(GF_COLD, dir, 210, -3);
3037 fire_ball(GF_POIS, dir, 180, -3);
3046 case SV_WAND_DISINTEGRATE:
3048 fire_ball(GF_DISINTEGRATE, dir, 200 + randint1(p_ptr->lev * 2), 2);
3053 case SV_WAND_ROCKETS:
3056 msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡ª");
3058 msg_print("You launch a rocket!");
3061 fire_rocket(GF_ROCKET, dir, 250 + p_ptr->lev * 3, 2);
3066 case SV_WAND_STRIKING:
3068 fire_bolt(GF_METEOR, dir, damroll(15 + p_ptr->lev / 3, 13));
3073 case SV_WAND_GENOCIDE:
3075 fire_ball_hide(GF_GENOCIDE, dir, magic ? p_ptr->lev + 50 : 250, 0);
3085 * Aim a wand (from the pack or floor).
3087 * Use a single charge from a single item.
3088 * Handle "unstacking" in a logical manner.
3090 * For simplicity, you cannot use a stack of items from the
3091 * ground. This would require too much nasty code.
3093 * There are no wands which can "destroy" themselves, in the inventory
3094 * or on the ground, so we can ignore this possibility. Note that this
3095 * required giving "wand of wonder" the ability to ignore destruction
3096 * by electric balls.
3098 * All wands can be "cancelled" at the "Direction?" prompt for free.
3100 * Note that the basic "bolt" wands do slightly less damage than the
3101 * basic "bolt" rods, but the basic "ball" wands do the same damage
3102 * as the basic "ball" rods.
3104 static void do_cmd_aim_wand_aux(int item)
3106 int lev, ident, chance, dir;
3108 bool old_target_pet = target_pet;
3110 /* Get the item (in the pack) */
3113 o_ptr = &inventory[item];
3116 /* Get the item (on the floor) */
3119 o_ptr = &o_list[0 - item];
3122 /* Mega-Hack -- refuse to aim a pile from the ground */
3123 if ((item < 0) && (o_ptr->number > 1))
3126 msg_print("¤Þ¤º¤ÏËâË¡ËÀ¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
3128 msg_print("You must first pick up the wands.");
3135 /* Allow direction to be cancelled for free */
3136 if (object_aware_p(o_ptr) && (o_ptr->sval == SV_WAND_HEAL_MONSTER
3137 || o_ptr->sval == SV_WAND_HASTE_MONSTER))
3139 if (!get_aim_dir(&dir))
3141 target_pet = old_target_pet;
3144 target_pet = old_target_pet;
3150 lev = get_object_level(o_ptr);
3151 if (lev > 50) lev = 50 + (lev - 50)/2;
3153 /* Base chance of success */
3154 chance = p_ptr->skill_dev;
3156 /* Confusion hurts skill */
3157 if (p_ptr->confused) chance = chance / 2;
3159 /* Hight level objects are harder */
3160 chance = chance - lev;
3162 /* Give everyone a (slight) chance */
3163 if ((chance < USE_DEVICE) && one_in_(USE_DEVICE - chance + 1))
3165 chance = USE_DEVICE;
3170 if (flush_failure) flush();
3172 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3174 msg_print("Nothing happen. Maybe this wand is freezing too.");
3181 /* Roll for usage */
3182 if ((chance < USE_DEVICE) || (randint1(chance) < USE_DEVICE) || (p_ptr->pclass == CLASS_BERSERKER))
3184 if (flush_failure) flush();
3186 msg_print("ËâË¡ËÀ¤ò¤¦¤Þ¤¯»È¤¨¤Ê¤«¤Ã¤¿¡£");
3188 msg_print("You failed to use the wand properly.");
3195 /* The wand is already empty! */
3196 if (o_ptr->pval <= 0)
3198 if (flush_failure) flush();
3200 msg_print("¤³¤ÎËâË¡ËÀ¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£");
3202 msg_print("The wand has no charges left.");
3205 o_ptr->ident |= (IDENT_EMPTY);
3207 /* Combine / Reorder the pack (later) */
3208 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3209 p_ptr->window |= (PW_INVEN);
3217 ident = wand_effect(o_ptr->sval, dir, FALSE);
3219 /* Combine / Reorder the pack (later) */
3220 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3222 if (!(object_aware_p(o_ptr)))
3224 chg_virtue(V_PATIENCE, -1);
3225 chg_virtue(V_CHANCE, 1);
3226 chg_virtue(V_KNOWLEDGE, -1);
3229 /* Mark it as tried */
3230 object_tried(o_ptr);
3232 /* Apply identification */
3233 if (ident && !object_aware_p(o_ptr))
3235 object_aware(o_ptr);
3236 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
3240 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3243 /* Use a single charge */
3246 /* Describe the charges in the pack */
3249 inven_item_charges(item);
3252 /* Describe the charges on the floor */
3255 floor_item_charges(0 - item);
3260 void do_cmd_aim_wand(void)
3265 /* Restrict choices to wands */
3266 item_tester_tval = TV_WAND;
3268 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
3270 set_action(ACTION_NONE);
3275 q = "¤É¤ÎËâË¡ËÀ¤ÇÁÀ¤¤¤Þ¤¹¤«? ";
3276 s = "»È¤¨¤ëËâË¡ËÀ¤¬¤Ê¤¤¡£";
3278 q = "Aim which wand? ";
3279 s = "You have no wand to aim.";
3282 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
3285 do_cmd_aim_wand_aux(item);
3289 static int rod_effect(int sval, int dir, bool *use_charge, bool magic)
3293 /* Analyze the rod */
3296 case SV_ROD_DETECT_TRAP:
3298 if (detect_traps(DETECT_RAD_DEFAULT, dir ? FALSE : TRUE)) ident = TRUE;
3302 case SV_ROD_DETECT_DOOR:
3304 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
3305 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
3309 case SV_ROD_IDENTIFY:
3312 if (!ident_spell(FALSE, FALSE)) *use_charge = FALSE;
3318 if (!word_of_recall()) *use_charge = FALSE;
3323 case SV_ROD_ILLUMINATION:
3325 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
3329 case SV_ROD_MAPPING:
3331 map_area(DETECT_RAD_MAP);
3336 case SV_ROD_DETECTION:
3338 detect_all(DETECT_RAD_DEFAULT);
3343 case SV_ROD_PROBING:
3352 if (set_blind(0)) ident = TRUE;
3353 if (set_poisoned(0)) ident = TRUE;
3354 if (set_confused(0)) ident = TRUE;
3355 if (set_stun(0)) ident = TRUE;
3356 if (set_cut(0)) ident = TRUE;
3357 if (set_image(0)) ident = TRUE;
3358 if (set_shero(0,TRUE)) ident = TRUE;
3362 case SV_ROD_HEALING:
3364 if (hp_player(500)) ident = TRUE;
3365 if (set_stun(0)) ident = TRUE;
3366 if (set_cut(0)) ident = TRUE;
3367 if (set_shero(0,TRUE)) ident = TRUE;
3371 case SV_ROD_RESTORATION:
3373 if (restore_level()) ident = TRUE;
3374 if (do_res_stat(A_STR)) ident = TRUE;
3375 if (do_res_stat(A_INT)) ident = TRUE;
3376 if (do_res_stat(A_WIS)) ident = TRUE;
3377 if (do_res_stat(A_DEX)) ident = TRUE;
3378 if (do_res_stat(A_CON)) ident = TRUE;
3379 if (do_res_stat(A_CHR)) ident = TRUE;
3385 if (set_fast(randint1(30) + 15, FALSE)) ident = TRUE;
3389 case SV_ROD_PESTICIDE:
3391 if (dispel_monsters(4)) ident = TRUE;
3395 case SV_ROD_TELEPORT_AWAY:
3397 if (teleport_monster(dir)) ident = TRUE;
3401 case SV_ROD_DISARMING:
3403 if (disarm_trap(dir)) ident = TRUE;
3410 msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3412 msg_print("A line of blue shimmering light appears.");
3415 (void)lite_line(dir);
3420 case SV_ROD_SLEEP_MONSTER:
3422 if (sleep_monster(dir)) ident = TRUE;
3426 case SV_ROD_SLOW_MONSTER:
3428 if (slow_monster(dir)) ident = TRUE;
3432 case SV_ROD_DRAIN_LIFE:
3434 if (drain_life(dir, 70 + 3 * p_ptr->lev / 2)) ident = TRUE;
3438 case SV_ROD_POLYMORPH:
3440 if (poly_monster(dir)) ident = TRUE;
3444 case SV_ROD_ACID_BOLT:
3446 fire_bolt_or_beam(10, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
3451 case SV_ROD_ELEC_BOLT:
3453 fire_bolt_or_beam(10, GF_ELEC, dir, damroll(4 + p_ptr->lev / 9, 8));
3458 case SV_ROD_FIRE_BOLT:
3460 fire_bolt_or_beam(10, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
3465 case SV_ROD_COLD_BOLT:
3467 fire_bolt_or_beam(10, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
3472 case SV_ROD_ACID_BALL:
3474 fire_ball(GF_ACID, dir, 60 + p_ptr->lev, 2);
3479 case SV_ROD_ELEC_BALL:
3481 fire_ball(GF_ELEC, dir, 40 + p_ptr->lev, 2);
3486 case SV_ROD_FIRE_BALL:
3488 fire_ball(GF_FIRE, dir, 70 + p_ptr->lev, 2);
3493 case SV_ROD_COLD_BALL:
3495 fire_ball(GF_COLD, dir, 50 + p_ptr->lev, 2);
3507 case SV_ROD_STONE_TO_MUD:
3509 if (wall_to_mud(dir)) ident = TRUE;
3513 case SV_ROD_AGGRAVATE:
3515 aggravate_monsters(0);
3524 * Activate (zap) a Rod
3526 * Unstack fully charged rods as needed.
3528 * Hack -- rods of perception/genocide can be "cancelled"
3529 * All rods can be cancelled at the "Direction?" prompt
3531 * pvals are defined for each rod in k_info. -LM-
3533 static void do_cmd_zap_rod_aux(int item)
3535 int ident, chance, lev, fail;
3540 /* Hack -- let perception get aborted */
3541 bool use_charge = TRUE;
3545 /* Get the item (in the pack) */
3548 o_ptr = &inventory[item];
3551 /* Get the item (on the floor) */
3554 o_ptr = &o_list[0 - item];
3558 /* Mega-Hack -- refuse to zap a pile from the ground */
3559 if ((item < 0) && (o_ptr->number > 1))
3562 msg_print("¤Þ¤º¤Ï¥í¥Ã¥É¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
3564 msg_print("You must first pick up the rods.");
3571 /* Get a direction (unless KNOWN not to need it) */
3572 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)) ||
3573 !object_aware_p(o_ptr))
3575 /* Get a direction, allow cancel */
3576 if (!get_aim_dir(&dir)) return;
3583 /* Extract the item level */
3584 lev = get_object_level(o_ptr);
3586 /* Base chance of success */
3587 chance = p_ptr->skill_dev;
3589 /* Confusion hurts skill */
3590 if (p_ptr->confused) chance = chance / 2;
3593 if (chance > fail) fail -= (chance - fail)*2;
3594 else chance -= (fail - chance)*2;
3595 if (fail < USE_DEVICE) fail = USE_DEVICE;
3596 if (chance < USE_DEVICE) chance = USE_DEVICE;
3600 if (flush_failure) flush();
3602 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3604 msg_print("Nothing happen. Maybe this rod is freezing too.");
3611 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
3612 else if (chance > fail)
3614 if (randint0(chance*2) < fail) success = FALSE;
3615 else success = TRUE;
3619 if (randint0(fail*2) < chance) success = TRUE;
3620 else success = FALSE;
3623 /* Roll for usage */
3626 if (flush_failure) flush();
3628 msg_print("¤¦¤Þ¤¯¥í¥Ã¥É¤ò»È¤¨¤Ê¤«¤Ã¤¿¡£");
3630 msg_print("You failed to use the rod properly.");
3637 k_ptr = &k_info[o_ptr->k_idx];
3639 /* A single rod is still charging */
3640 if ((o_ptr->number == 1) && (o_ptr->timeout))
3642 if (flush_failure) flush();
3644 msg_print("¤³¤Î¥í¥Ã¥É¤Ï¤Þ¤ÀËâÎϤò½¼Å¶¤·¤Æ¤¤¤ëºÇÃæ¤À¡£");
3646 msg_print("The rod is still charging.");
3651 /* A stack of rods lacks enough energy. */
3652 else if ((o_ptr->number > 1) && (o_ptr->timeout > k_ptr->pval * (o_ptr->number - 1)))
3654 if (flush_failure) flush();
3656 msg_print("¤½¤Î¥í¥Ã¥É¤Ï¤Þ¤À½¼Å¶Ãæ¤Ç¤¹¡£");
3658 msg_print("The rods are all still charging.");
3667 ident = rod_effect(o_ptr->sval, dir, &use_charge, FALSE);
3669 /* Increase the timeout by the rod kind's pval. -LM- */
3670 if (use_charge) o_ptr->timeout += k_ptr->pval;
3672 /* Combine / Reorder the pack (later) */
3673 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3675 if (!(object_aware_p(o_ptr)))
3677 chg_virtue(V_PATIENCE, -1);
3678 chg_virtue(V_CHANCE, 1);
3679 chg_virtue(V_KNOWLEDGE, -1);
3682 /* Tried the object */
3683 object_tried(o_ptr);
3685 /* Successfully determined the object function */
3686 if (ident && !object_aware_p(o_ptr))
3688 object_aware(o_ptr);
3689 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
3693 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3697 void do_cmd_zap_rod(void)
3702 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
3704 set_action(ACTION_NONE);
3707 /* Restrict choices to rods */
3708 item_tester_tval = TV_ROD;
3712 q = "¤É¤Î¥í¥Ã¥É¤ò¿¶¤ê¤Þ¤¹¤«? ";
3713 s = "»È¤¨¤ë¥í¥Ã¥É¤¬¤Ê¤¤¡£";
3715 q = "Zap which rod? ";
3716 s = "You have no rod to zap.";
3719 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
3722 do_cmd_zap_rod_aux(item);
3727 * Hook to determine if an object is activatable
3729 static bool item_tester_hook_activate(object_type *o_ptr)
3731 u32b flgs[TR_FLAG_SIZE];
3734 if (!object_known_p(o_ptr)) return (FALSE);
3736 /* Extract the flags */
3737 object_flags(o_ptr, flgs);
3739 /* Check activation flag */
3740 if (have_flag(flgs, TR_ACTIVATE)) return (TRUE);
3748 * Hack -- activate the ring of power
3750 void ring_of_power(int dir)
3752 /* Pick a random effect */
3753 switch (randint1(10))
3760 msg_print("¤¢¤Ê¤¿¤Ï°À¤Î¥ª¡¼¥é¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡£");
3762 msg_print("You are surrounded by a malignant aura.");
3767 /* Decrease all stats (permanently) */
3768 (void)dec_stat(A_STR, 50, TRUE);
3769 (void)dec_stat(A_INT, 50, TRUE);
3770 (void)dec_stat(A_WIS, 50, TRUE);
3771 (void)dec_stat(A_DEX, 50, TRUE);
3772 (void)dec_stat(A_CON, 50, TRUE);
3773 (void)dec_stat(A_CHR, 50, TRUE);
3775 /* Lose some experience (permanently) */
3776 p_ptr->exp -= (p_ptr->exp / 4);
3777 p_ptr->max_exp -= (p_ptr->exp / 4);
3787 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥª¡¼¥é¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡£");
3789 msg_print("You are surrounded by a powerful aura.");
3793 /* Dispel monsters */
3794 dispel_monsters(1000);
3804 fire_ball(GF_MANA, dir, 600, 3);
3815 fire_bolt(GF_MANA, dir, 500);
3823 static bool ang_sort_comp_pet(vptr u, vptr v, int a, int b)
3825 u16b *who = (u16b*)(u);
3830 monster_type *m_ptr1 = &m_list[w1];
3831 monster_type *m_ptr2 = &m_list[w2];
3832 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
3833 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
3835 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
3836 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
3838 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
3839 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
3841 if (r_ptr1->level > r_ptr2->level) return TRUE;
3842 if (r_ptr2->level > r_ptr1->level) return FALSE;
3844 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
3845 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
3851 * Activate a wielded object. Wielded objects never stack.
3852 * And even if they did, activatable objects never stack.
3854 * Currently, only (some) artifacts, and Dragon Scale Mail, can be activated.
3855 * But one could, for example, easily make an activatable "Ring of Plasma".
3857 * Note that it always takes a turn to activate an artifact, even if
3858 * the user hits "escape" at the "direction" prompt.
3860 static void do_cmd_activate_aux(int item)
3862 int k, dir, lev, chance, fail;
3867 /* Get the item (in the pack) */
3870 o_ptr = &inventory[item];
3873 /* Get the item (on the floor) */
3876 o_ptr = &o_list[0 - item];
3882 /* Extract the item level */
3883 lev = get_object_level(o_ptr);
3885 /* Hack -- use artifact level instead */
3886 if (artifact_p(o_ptr)) lev = a_info[o_ptr->name1].level;
3887 else if (o_ptr->art_name)
3889 switch (o_ptr->xtra2)
3897 case ACT_CURE_POISON:
3917 case ACT_RESIST_ALL:
3918 case ACT_DETECT_ALL:
3931 case ACT_BANISH_EVIL:
3939 case ACT_CHARM_ANIMAL:
3940 case ACT_SUMMON_ANIMAL:
3943 case ACT_XTRA_SPEED:
3944 case ACT_DETECT_XTRA:
3952 case ACT_CHARM_UNDEAD:
3953 case ACT_CHARM_OTHER:
3954 case ACT_SUMMON_PHANTOM:
3955 case ACT_SUMMON_ELEMENTAL:
3956 case ACT_RUNE_EXPLO:
3960 case ACT_CHARM_ANIMALS:
3961 case ACT_CHARM_OTHERS:
3968 case ACT_CALL_CHAOS:
3973 case ACT_SUMMON_UNDEAD:
3974 case ACT_SUMMON_DEMON:
3985 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
3987 /* Base chance of success */
3988 chance = p_ptr->skill_dev;
3990 /* Confusion hurts skill */
3991 if (p_ptr->confused) chance = chance / 2;
3994 if (chance > fail) fail -= (chance - fail)*2;
3995 else chance -= (fail - chance)*2;
3996 if (fail < USE_DEVICE) fail = USE_DEVICE;
3997 if (chance < USE_DEVICE) chance = USE_DEVICE;
4001 if (flush_failure) flush();
4003 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
4005 msg_print("It shows no reaction.");
4012 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
4013 else if (chance > fail)
4015 if (randint0(chance*2) < fail) success = FALSE;
4016 else success = TRUE;
4020 if (randint0(fail*2) < chance) success = TRUE;
4021 else success = FALSE;
4024 /* Roll for usage */
4027 if (flush_failure) flush();
4029 msg_print("¤¦¤Þ¤¯»ÏÆ°¤µ¤»¤ë¤³¤È¤¬¤Ç¤¤Ê¤«¤Ã¤¿¡£");
4031 msg_print("You failed to activate it properly.");
4038 /* Check the recharge */
4042 msg_print("¤½¤ì¤ÏÈù¤«¤Ë²»¤òΩ¤Æ¡¢µ±¤¡¢¾Ã¤¨¤¿...");
4044 msg_print("It whines, glows and fades...");
4051 /* Activate the artifact */
4053 msg_print("»ÏÆ°¤µ¤»¤¿...");
4055 msg_print("You activate it...");
4063 if (o_ptr->art_name && o_ptr->xtra2)
4065 (void)activate_random_artifact(o_ptr);
4068 p_ptr->window |= (PW_INVEN | PW_EQUIP);
4075 else if (o_ptr->name1)
4078 switch (o_ptr->name1)
4083 msg_print("ààÎÜÉÓ¤«¤éÀ¡¤ó¤À¸÷¤¬¤¢¤Õ¤ì½Ð¤¿...");
4085 msg_print("The phial wells with clear light...");
4088 lite_area(damroll(2, 15), 3);
4089 o_ptr->timeout = randint0(10) + 10;
4096 msg_print("À±¤¬âÁ¤·¤¯µ±¤¤¤¿...");
4098 msg_print("The star shines brightly...");
4101 map_area(DETECT_RAD_MAP);
4102 lite_area(damroll(2, 15), 3);
4103 o_ptr->timeout = randint0(50) + 50;
4110 msg_print("¤½¤ÎÊõÀФÏÀÖ¤¯ÌÀ¤ë¤¯¸÷¤Ã¤¿¡ª");
4112 msg_print("The Jewel flashes bright red!");
4115 chg_virtue(V_KNOWLEDGE, 1);
4116 chg_virtue(V_ENLIGHTEN, 1);
4117 wiz_lite(FALSE, FALSE);
4119 msg_print("¤½¤ÎÊõÀФϤ¢¤Ê¤¿¤ÎÂÎÎϤòÃ¥¤Ã¤¿...");
4120 take_hit(DAMAGE_LOSELIFE, damroll(3,8), "¿³È½¤ÎÊõÀÐ", -1);
4122 msg_print("The Jewel drains your vitality...");
4123 take_hit(DAMAGE_LOSELIFE, damroll(3, 8), "the Jewel of Judgement", -1);
4126 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
4127 (void)detect_doors(DETECT_RAD_DEFAULT);
4128 (void)detect_stairs(DETECT_RAD_DEFAULT);
4131 if (get_check("µ¢´Ô¤ÎÎϤò»È¤¤¤Þ¤¹¤«¡©"))
4133 if (get_check("Activate recall? "))
4137 (void)word_of_recall();
4140 o_ptr->timeout = randint0(20) + 20;
4147 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
4149 msg_print("The amulet lets out a shrill wail...");
4153 (void)set_protevil(randint1(25) + k, FALSE);
4154 o_ptr->timeout = randint0(225) + 225;
4161 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
4163 msg_print("The amulet floods the area with goodness...");
4166 dispel_evil(p_ptr->lev * 5);
4167 o_ptr->timeout = randint0(200) + 200;
4174 msg_print("¶À¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
4176 msg_print("The mirror floods the area with goodness...");
4179 dispel_evil(p_ptr->lev * 5);
4180 o_ptr->timeout = randint0(200) + 200;
4187 msg_print("¤¢¤Ê¤¿¤Ï¥Õ¥é¥¥¢¤ËŨ¤òÄù¤á»¦¤¹¤è¤¦Ì¿¤¸¤¿¡£");
4189 msg_print("You order Frakir to strangle your opponent.");
4192 if (!get_aim_dir(&dir)) return;
4193 if (drain_life(dir, 100))
4194 o_ptr->timeout = randint0(100) + 100;
4201 msg_print("»ØÎؤÏÌÀ¤ë¤¯µ±¤¤¤¿...");
4203 msg_print("The ring glows brightly...");
4206 (void)set_fast(randint1(75) + 75, FALSE);
4207 o_ptr->timeout = randint0(150) + 150;
4214 msg_print("»ØÎؤϿ¼¹È¤Ëµ±¤¤¤¿...");
4216 msg_print("The ring glows deep red...");
4219 if (!get_aim_dir(&dir)) return;
4220 fire_ball(GF_FIRE, dir, 300, 3);
4221 o_ptr->timeout = randint0(225) + 225;
4228 msg_print("»ØÎؤÏÇò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4230 msg_print("The ring glows bright white...");
4233 if (!get_aim_dir(&dir)) return;
4234 fire_ball(GF_COLD, dir, 400, 3);
4235 o_ptr->timeout = randint0(325) + 325;
4243 msg_format("%s¤Ï¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...", o_ptr->name1 == ART_VILYA ? "»ØÎØ" : "¥½¡¼¥É");
4245 msg_format("The %s glows deep blue...", o_ptr->name1 == ART_VILYA ? "ring" : "sword");
4248 if (!get_aim_dir(&dir)) return;
4249 fire_ball(GF_ELEC, dir, 500, 3);
4250 o_ptr->timeout = randint0(425) + 425;
4258 msg_print("»ØÎؤϼ¿¹õ¤Ëµ±¤¤¤¿...");
4260 msg_print("The ring glows intensely black...");
4263 if (!get_aim_dir(&dir)) return;
4265 o_ptr->timeout = randint0(450) + 450;
4271 int num = damroll(5, 3);
4276 msg_print("³»¤¬°ðºÊ¤Çʤ¤ï¤ì¤¿...");
4278 msg_print("Your armor is surrounded by lightning...");
4282 for (k = 0; k < num; k++)
4288 scatter(&y, &x, py, px, 4, 0);
4290 if (!cave_floor_bold(y, x)) continue;
4292 if ((y != py) || (x != px)) break;
4295 project(0, 3, y, x, 150, GF_ELEC,
4296 (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
4299 o_ptr->timeout = 1000;
4303 case ART_BLADETURNER:
4305 if (!get_aim_dir(&dir)) return;
4307 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
4309 msg_print("You breathe the elements.");
4312 fire_ball(GF_MISSILE, dir, 300, 4);
4314 msg_print("³»¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...");
4316 msg_print("Your armor glows many colours...");
4319 (void)set_afraid(0);
4320 (void)set_hero(randint1(50) + 50, FALSE);
4321 (void)hp_player(10);
4322 (void)set_blessed(randint1(50) + 50, FALSE);
4323 (void)set_oppose_acid(randint1(50) + 50, FALSE);
4324 (void)set_oppose_elec(randint1(50) + 50, FALSE);
4325 (void)set_oppose_fire(randint1(50) + 50, FALSE);
4326 (void)set_oppose_cold(randint1(50) + 50, FALSE);
4327 (void)set_oppose_pois(randint1(50) + 50, FALSE);
4328 o_ptr->timeout = 400;
4332 case ART_SOULKEEPER:
4335 msg_print("³»¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4336 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬¤è¤¤...");
4338 msg_print("Your armor glows a bright white...");
4339 msg_print("You feel much better...");
4342 (void)hp_player(1000);
4344 o_ptr->timeout = 888;
4351 msg_print("Å·¹ñ¤Î²Î¤¬Ê¹¤³¤¨¤ë...");
4353 msg_print("A heavenly choir sings...");
4356 (void)set_poisoned(0);
4359 (void)set_confused(0);
4361 (void)set_hero(randint1(25) + 25, FALSE);
4362 (void)hp_player(777);
4363 o_ptr->timeout = 300;
4370 msg_print("³»¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4372 msg_print("Your armor glows deep blue...");
4375 (void)symbol_genocide(200, TRUE);
4376 o_ptr->timeout = 500;
4383 msg_print("³»¤¬ÀÖ¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4385 msg_print("Your armor glows bright red...");
4388 destroy_doors_touch();
4389 o_ptr->timeout = 10;
4397 turn_monsters(40 + p_ptr->lev);
4398 o_ptr->timeout = 3 * (p_ptr->lev + 10);
4403 case ART_HOLHENNETH:
4406 msg_print("¥Ø¥ë¥á¥Ã¥È¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4407 msg_print("¿´¤Ë¥¤¥á¡¼¥¸¤¬É⤫¤ó¤Ç¤¤¿...");
4409 msg_print("Your helm glows bright white...");
4410 msg_print("An image forms in your mind...");
4413 detect_all(DETECT_RAD_DEFAULT);
4414 o_ptr->timeout = randint0(55) + 55;
4421 msg_print("²¦´§¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4422 msg_print("ÂÎÆâ¤ËÃȤ«¤¤¸ÝÆ°¤¬´¶¤¸¤é¤ì¤ë...");
4424 msg_print("Your crown glows deep blue...");
4425 msg_print("You feel a warm tingling inside...");
4428 (void)hp_player(700);
4430 o_ptr->timeout = 250;
4438 msg_format("%s¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...", o_ptr->name1 == ART_COLLUIN ? "¥¯¥í¡¼¥¯" : "³»");
4440 msg_format("Your %s glows many colours...", o_ptr->name1 == ART_COLLUIN ? "cloak" : "armor");
4443 (void)set_oppose_acid(randint1(20) + 20, FALSE);
4444 (void)set_oppose_elec(randint1(20) + 20, FALSE);
4445 (void)set_oppose_fire(randint1(20) + 20, FALSE);
4446 (void)set_oppose_cold(randint1(20) + 20, FALSE);
4447 (void)set_oppose_pois(randint1(20) + 20, FALSE);
4448 o_ptr->timeout = 111;
4452 case ART_HOLCOLLETH:
4455 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4457 msg_print("Your cloak glows deep blue...");
4460 sleep_monsters_touch();
4461 o_ptr->timeout = 55;
4468 msg_print("¥¯¥í¡¼¥¯¤¬²«¿§¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4470 msg_print("Your cloak glows bright yellow...");
4474 o_ptr->timeout = 70;
4481 msg_print("¥¯¥í¡¼¥¯¤¬ÊÕ¤ê¤Î¶õ´Ö¤ò¤æ¤¬¤Þ¤»¤¿...");
4483 msg_print("Your cloak twists space around you...");
4486 teleport_player(100);
4487 o_ptr->timeout = 45;
4494 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4496 msg_print("Your cloak glows a deep red...");
4500 o_ptr->timeout = 450;
4504 case ART_CAMMITHRIM:
4507 msg_print("¥°¥í¡¼¥Ö¤¬âÁ¤·¤¤¤¯¤é¤¤¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4509 msg_print("Your gloves glow extremely brightly...");
4512 if (!get_aim_dir(&dir)) return;
4513 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
4521 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4523 msg_print("Your gauntlets are covered in fire...");
4526 if (!get_aim_dir(&dir)) return;
4527 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4528 o_ptr->timeout = randint0(8) + 8;
4532 case ART_PAURNIMMEN:
4535 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4537 msg_print("Your gauntlets are covered in frost...");
4540 if (!get_aim_dir(&dir)) return;
4541 fire_bolt(GF_COLD, dir, damroll(6, 8));
4542 o_ptr->timeout = randint0(7) + 7;
4549 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4551 msg_print("Your gauntlets are covered in sparks...");
4554 if (!get_aim_dir(&dir)) return;
4555 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4556 o_ptr->timeout = randint0(5) + 5;
4563 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬»À¤Ëʤ¤ï¤ì¤¿...");
4565 msg_print("Your gauntlets are covered in acid...");
4568 if (!get_aim_dir(&dir)) return;
4569 fire_bolt(GF_ACID, dir, damroll(5, 8));
4570 o_ptr->timeout = randint0(6) + 6;
4577 msg_print("¥»¥¹¥¿¥¹¤ËËâË¡¤Î¥È¥²¤¬¸½¤ì¤¿...");
4579 msg_print("Your cesti grows magical spikes...");
4582 if (!get_aim_dir(&dir)) return;
4583 fire_bolt(GF_ARROW, dir, 150);
4584 o_ptr->timeout = randint0(90) + 90;
4591 msg_print("¥Ö¡¼¥Ä¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4593 msg_print("Your boots glow bright green...");
4596 (void)set_fast(randint1(20) + 20, FALSE);
4597 o_ptr->timeout = 200;
4604 msg_print("¥Ö¡¼¥Ä¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4606 msg_print("Your boots glow deep blue...");
4609 (void)set_afraid(0);
4610 (void)set_poisoned(0);
4618 msg_print("¥À¥¬¡¼¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4620 msg_print("Your dagger is covered in fire...");
4623 if (!get_aim_dir(&dir)) return;
4624 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4625 o_ptr->timeout = randint0(8) + 8;
4632 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4634 msg_print("Your dagger is covered in frost...");
4637 if (!get_aim_dir(&dir)) return;
4638 fire_bolt(GF_COLD, dir, damroll(6, 8));
4639 o_ptr->timeout = randint0(7) + 7;
4646 msg_print("¥À¥¬¡¼¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4648 msg_print("Your dagger is covered in sparks...");
4651 if (!get_aim_dir(&dir)) return;
4652 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4653 o_ptr->timeout = randint0(5) + 5;
4660 msg_print("¥À¥¬¡¼¤¬¿¼¤¤Îп§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4662 msg_print("Your dagger throbs deep green...");
4665 if (!get_aim_dir(&dir)) return;
4666 fire_ball(GF_POIS, dir, 12, 3);
4667 o_ptr->timeout = randint0(4) + 4;
4674 msg_print("Ì·¤¬¿¼¤¤ÀÄ¿§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4676 msg_print("Your dagger throbs deep blue...");
4679 if (!get_aim_dir(&dir)) return;
4680 fire_ball(GF_WATER, dir, 200, 3);
4681 o_ptr->timeout = 250;
4688 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4690 msg_print("Your dagger is covered in frost...");
4693 if (!get_aim_dir(&dir)) return;
4694 fire_ball(GF_COLD, dir, 48, 2);
4695 o_ptr->timeout = randint0(5) + 5;
4700 case ART_WEREWINDLE:
4702 switch (randint1(13))
4704 case 1: case 2: case 3: case 4: case 5:
4705 teleport_player(10);
4707 case 6: case 7: case 8: case 9: case 10:
4708 teleport_player(222);
4711 (void)stair_creation();
4715 if (get_check("¤³¤Î³¬¤òµî¤ê¤Þ¤¹¤«¡©"))
4717 if (get_check("Leave this level? "))
4721 if (autosave_l) do_cmd_save_game(TRUE);
4724 p_ptr->leaving = TRUE;
4727 o_ptr->timeout = 35;
4733 teleport_player(222);
4734 o_ptr->timeout = 25;
4741 msg_print("¥½¡¼¥É¤¬ÀĤ¯·ã¤·¤¯µ±¤¤¤¿...");
4743 msg_print("Your sword glows an intense blue...");
4746 if (!get_aim_dir(&dir)) return;
4747 fire_ball(GF_COLD, dir, 100, 2);
4748 o_ptr->timeout = 200;
4755 msg_print("¶Ç¤Î»ÕÃĤò¾¤´¤·¤¿¡£");
4757 msg_print("You summon the Legion of the Dawn.");
4760 (void)summon_specific(-1, py, px, dun_level, SUMMON_DAWN, (PM_ALLOW_GROUP | PM_FORCE_PET));
4761 o_ptr->timeout = 500 + randint1(500);
4768 msg_print("¥½¡¼¥É¤¬ÀÖ¤¯·ã¤·¤¯µ±¤¤¤¿...");
4770 msg_print("Your sword glows an intense red...");
4773 if (!get_aim_dir(&dir)) return;
4774 fire_ball(GF_FIRE, dir, 72, 2);
4775 o_ptr->timeout = 400;
4782 msg_print("¥¢¥Ã¥¯¥¹¤Î¿Ï¤¬¹õ¤¯µ±¤¤¤¿...");
4784 msg_print("Your axe blade glows black...");
4787 if (!get_aim_dir(&dir)) return;
4788 drain_life(dir, 120);
4789 o_ptr->timeout = 400;
4796 msg_print("¤¢¤Ê¤¿¤ÎÁä¤ÏÅŵ¤¤Ç¥¹¥Ñ¡¼¥¯¤·¤Æ¤¤¤ë...");
4798 msg_print("Your spear crackles with electricity...");
4801 if (!get_aim_dir(&dir)) return;
4802 fire_ball(GF_ELEC, dir, 100, 3);
4803 o_ptr->timeout = 200;
4810 msg_print("¥¹¥Ô¥¢¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4812 msg_print("Your spear glows a bright white...");
4815 if (!get_aim_dir(&dir)) return;
4816 fire_ball(GF_COLD, dir, 100, 3);
4817 o_ptr->timeout = 200;
4824 msg_print("¥¹¥Ô¥¢¤¬¸ÝÆ°¤·¤¿...");
4826 msg_print("Your spear pulsates...");
4829 if (!get_aim_dir(&dir)) return;
4838 msg_print("¤Ä¤ë¤Ï¤·¤¬¸ÝÆ°¤·¤¿...");
4840 msg_print("Your mattock pulsates...");
4843 if (!get_aim_dir(&dir)) return;
4852 msg_print("¥¢¥Ã¥¯¥¹¤«¤é¤Ò¤É¤¯±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
4854 msg_print("Your axe lets out a long, shrill note...");
4857 (void)mass_genocide(200, TRUE);
4858 o_ptr->timeout = 1000;
4865 msg_print("¥Ð¥È¥ë¡¦¥¢¥Ã¥¯¥¹¤¬¿¼»ç¤Î¸÷¤òÊü¼Í¤·¤¿...");
4867 msg_print("Your battle axe radiates deep purple...");
4870 hp_player(damroll(4, 8));
4871 (void)set_cut((p_ptr->cut / 2) - 50);
4872 o_ptr->timeout = randint0(3) + 3;
4879 msg_print("¥È¥é¥¤¥Ç¥ó¥È¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4881 msg_print("Your trident glows deep red...");
4884 if (!get_aim_dir(&dir)) return;
4885 teleport_monster(dir);
4886 o_ptr->timeout = 150;
4893 msg_print("Âç³ù¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
4895 msg_print("Your scythe glows soft white...");
4897 if (!word_of_recall()) return;
4898 o_ptr->timeout = 200;
4905 msg_print("¸û¶Ì¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
4907 msg_print("Your scythe glows soft white...");
4909 if (!word_of_recall()) return;
4910 o_ptr->timeout = 200;
4917 msg_print("¥Õ¥ì¥¤¥ë¤¬ÍÍ¡¹¤Ê¿§¤Î²Ð²Ö¤òȯ¤·¤¿...");
4919 msg_print("Your flail glows in scintillating colours...");
4922 if (!get_aim_dir(&dir)) return;
4923 confuse_monster(dir, 20);
4924 o_ptr->timeout = 15;
4931 msg_print("¥â¡¼¥Ë¥ó¥°¥¹¥¿¡¼¤«¤é±ê¤¬¿á¤½Ð¤·¤¿...");
4933 msg_print("Your morning star rages in fire...");
4936 if (!get_aim_dir(&dir)) return;
4937 fire_ball(GF_FIRE, dir, 72, 3);
4938 o_ptr->timeout = 100;
4945 msg_print("¥à¥Á¤¬¿¼¤¤ÀÖ¿§¤Ëµ±¤¤¤¿...");
4947 msg_print("Your whip glows deep red...");
4950 if (!get_aim_dir(&dir)) return;
4951 fire_ball(GF_FIRE, dir, 120, 3);
4952 o_ptr->timeout = 15;
4959 msg_print("¥á¥¤¥¹¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4961 msg_print("Your mace glows bright green...");
4964 (void)set_fast(randint1(20) + 20, FALSE);
4965 o_ptr->timeout = randint0(100) + 100;
4972 msg_print("¥¯¥©¡¼¥¿¡¼¥¹¥¿¥Ã¥Õ¤¬²«¿§¤¯µ±¤¤¤¿...");
4974 msg_print("Your quarterstaff glows yellow...");
4977 if (!ident_spell(FALSE, FALSE)) return;
4978 o_ptr->timeout = 10;
4985 msg_print("¾ó¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
4987 msg_print("Your quarterstaff glows brightly...");
4990 detect_all(DETECT_RAD_DEFAULT);
4992 identify_fully(FALSE, TRUE);
4993 o_ptr->timeout = 1000;
5000 msg_print("¥Ï¥ó¥Þ¡¼¤¬Çò¤¯µ±¤¤¤¿...");
5002 msg_print("Your hammer glows white...");
5005 if (!get_aim_dir(&dir)) return;
5006 drain_life(dir, 90);
5007 o_ptr->timeout = 70;
5014 msg_print("¥¯¥í¥¹¥Ü¥¦¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
5016 msg_print("Your crossbow glows deep red...");
5019 (void)brand_bolts();
5020 o_ptr->timeout = 999;
5027 int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
5030 msg_print("¤»¤Ã¤«¤¯¤À¤«¤é¡Ø¥¯¥ê¥à¥¾¥ó¡Ù¤ò¤Ö¤Ã¤Ñ¤Ê¤¹¤¼¡ª");
5032 msg_print("I'll fire CRIMSON! SEKKAKUDAKARA!");
5035 if (!get_aim_dir(&dir)) return;
5037 /* Use the given direction */
5038 tx = px + 99 * ddx[dir];
5039 ty = py + 99 * ddy[dir];
5041 /* Hack -- Use an actual "target" */
5042 if ((dir == 5) && target_okay())
5048 if (p_ptr->pclass == CLASS_ARCHER)
5050 /* Extra shot at level 10 */
5051 if (p_ptr->lev >= 10) num++;
5053 /* Extra shot at level 30 */
5054 if (p_ptr->lev >= 30) num++;
5056 /* Extra shot at level 45 */
5057 if (p_ptr->lev >= 45) num++;
5060 for (i = 0; i < num; i++)
5061 project(0, p_ptr->lev/20+1, ty, tx, p_ptr->lev*p_ptr->lev*6/50, GF_ROCKET, flg, -1);
5062 o_ptr->timeout = 15;
5067 monster_type *m_ptr;
5068 monster_race *r_ptr;
5072 msg_print("´ñ̯¤Ê¾ì½ê¤¬Æ¬¤ÎÃæ¤ËÉ⤫¤ó¤À¡¥¡¥¡¥");
5074 msg_print("Some strange places show up in your mind. And you see ...");
5077 /* Process the monsters (backwards) */
5078 for (i = m_max - 1; i >= 1; i--)
5080 /* Access the monster */
5083 /* Ignore "dead" monsters */
5084 if (!m_ptr->r_idx) continue;
5086 r_ptr = &r_info[m_ptr->r_idx];
5088 if(r_ptr->flags1 & RF1_UNIQUE)
5091 msg_format("%s¡¥ ",r_name + r_ptr->name);
5093 msg_format("%s. ",r_name + r_ptr->name);
5097 o_ptr->timeout = 200;
5101 case ART_STONE_LORE:
5104 msg_print("ÀФ¬±£¤µ¤ì¤¿ÈëÌ©¤ò¼Ì¤·½Ð¤·¤¿¡¥¡¥¡¥");
5106 msg_print("The stone reveals hidden mysteries...");
5108 if (!ident_spell(FALSE, FALSE)) return;
5110 if (mp_ptr->spell_book)
5112 /* Sufficient mana */
5113 if (20 <= p_ptr->csp)
5119 /* Over-exert the player */
5122 int oops = 20 - p_ptr->csp;
5126 p_ptr->csp_frac = 0;
5130 msg_print("ÀФòÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
5132 msg_print("You are too weak to control the stone!");
5135 /* Hack -- Bypass free action */
5136 (void)set_paralyzed(p_ptr->paralyzed +
5137 randint1(5 * oops + 1));
5140 (void)set_confused(p_ptr->confused +
5141 randint1(5 * oops + 1));
5145 p_ptr->redraw |= (PR_MANA);
5149 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "´í¸±¤ÊÈëÌ©", -1);
5151 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "perilous secrets", -1);
5155 if (one_in_(5)) (void)set_confused(p_ptr->confused +
5158 /* Exercise a little care... */
5161 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "´í¸±¤ÊÈëÌ©", -1);
5163 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "perilous secrets", -1);
5171 msg_print("You wind a mighty blast; your enemies tremble!");
5172 (void)turn_monsters((3 * p_ptr->lev / 2) + 10);
5173 o_ptr->timeout = randint0(40) + 40;
5179 msg_print("¤¢¤Ê¤¿¤Ï³²Ãî¤ò°ìÁݤ·¤¿¡£");
5181 msg_print("You exterminate small life.");
5183 (void)dispel_monsters(4);
5184 o_ptr->timeout = randint0(55) + 55;
5191 msg_print("Æߤ¤²»¤¬ÊÕ¤ê¤òÊñ¤ß¤³¤ó¤À¡£");
5193 msg_print("A shrill wailing sound surrounds you.");
5195 (void)set_protevil(randint1(25) + p_ptr->lev, FALSE);
5196 o_ptr->timeout = randint0(200) + 200;
5204 msg_print("¥í¡¼¥Ö¤¬½ã¿è¤ÊËâÎϤǿ̤¨¤¿¡£");
5206 msg_print("The robe pulsates with raw mana...");
5208 if (!get_aim_dir(&dir)) return;
5209 fire_bolt(GF_MANA, dir, 120);
5210 o_ptr->timeout = randint0(120) + 120;
5215 (void)set_fast(randint1(50) + 50, FALSE);
5218 set_hero(randint1(50) + 50, FALSE);
5219 o_ptr->timeout = randint0(200) + 100;
5225 msg_print("¥·¡¼¥ë¥É¤¬âÁ¤·¤¤¸÷¤Çµ±¤¤¤¿¡¥¡¥¡¥");
5227 msg_print("Your shield gleams with blinding light...");
5229 fire_ball(GF_LITE, 0, 300, 6);
5230 confuse_monsters(3 * p_ptr->lev / 2);
5231 o_ptr->timeout = 250;
5237 msg_print("¥«¡¼¥É¤¬Çò¤¯µ±¤¤¤¿¡¥¡¥¡¥");
5239 msg_print("Your card gleams with blinding light...");
5241 if (!recharge(1000)) return;
5242 o_ptr->timeout = 200;
5248 if (get_check("ËÜÅö¤Ë»È¤¤¤Þ¤¹¤«¡©"))
5250 if (get_check("Are you sure?!"))
5254 msg_print("¼Àµ¤¬¿Ì¤¨¤¿¡¥¡¥¡¥");
5256 msg_print("The Muramasa pulsates...");
5262 msg_print("¼Àµ¤Ï²õ¤ì¤¿¡ª");
5264 msg_print("The Muramasa is destroyed!");
5266 curse_weapon(TRUE, item);
5274 msg_print("ÀФ¬ÀÄÇò¤¯¸÷¤Ã¤¿¡¥¡¥¡¥");
5276 msg_print("Your stone glows pale...");
5279 if (!get_aim_dir(&dir)) return;
5280 fire_ball(GF_MANA, dir, 400, 4);
5281 o_ptr->timeout = randint0(250) + 250;
5288 if (!get_rep_dir2(&dir)) return;
5292 if (!(cave[y][x].feat == FEAT_DEEP_WATER) && !(cave[y][x].feat == FEAT_SHAL_WATER))
5295 msg_print("¤½¤³¤ÏΦÃϤÀ¡£");
5297 msg_print("There is no fishing place.");
5301 else if (cave[y][x].m_idx)
5304 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
5306 msg_format("%s¤¬¼ÙËâ¤À¡ª", m_name);
5308 msg_format("%^s is stand in your way.", m_name);
5313 set_action(ACTION_FISH);
5314 p_ptr->redraw |= (PR_STATE);
5319 if (!get_aim_dir(&dir)) return;
5321 msg_print("¥à¥Á¤ò¿¤Ð¤·¤¿¡£");
5323 msg_print("You stretched your wip.");
5326 fetch(dir, 500, TRUE);
5327 o_ptr->timeout = randint0(25) + 25;
5332 u32b mode = PM_ALLOW_GROUP;
5333 bool pet = !one_in_(5);
5334 if (pet) mode |= PM_FORCE_PET;
5335 else mode |= PM_NO_PET;
5337 if (summon_specific((pet ? -1 : 0), py, px, ((p_ptr->lev * 3) / 2), SUMMON_HOUND, mode))
5342 msg_print("¥Ï¥¦¥ó¥É¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5344 msg_print("A group of hounds appear as your servant.");
5349 msg_print("¥Ï¥¦¥ó¥É¤Ï¤¢¤Ê¤¿¤Ë²ç¤ò¸þ¤±¤Æ¤¤¤ë¡ª");
5351 msg_print("A group of hounds appear as your enemy!");
5356 o_ptr->timeout = 300 + randint1(150);
5363 msg_print("¥¹¥Ô¥¢¤ÏâÁ¤·¤¯µ±¤¤¤¿...");
5365 msg_print("Your spear grows brightly...");
5368 if (!get_aim_dir(&dir)) return;
5369 fire_ball(GF_LITE, dir, 200, 3);
5370 o_ptr->timeout = randint0(200) + 200;
5377 monster_type *m_ptr;
5382 if (summon_named_creature(0, py, px, MON_SUKE, PM_FORCE_PET))
5385 msg_print("¡Ø½õ¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5387 msg_print("Suke-san apperars.");
5388 kakusan = "Suke-san";
5392 if (summon_named_creature(0, py, px, MON_KAKU, PM_FORCE_PET))
5395 msg_print("¡Ø³Ê¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5397 msg_print("Kaku-san appears.");
5398 kakusan = "Kaku-san";
5404 for (i = m_max - 1; i > 0; i--)
5407 if (!m_ptr->r_idx) continue;
5408 if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
5409 if (!los(m_ptr->fy, m_ptr->fx, py, px)) continue;
5418 msg_print("¡Ö¼Ô¤É¤â¡¢¤Ò¤«¤¨¤ª¤í¤¦¡ª¡ª¡ª¤³¤Î¤ªÊý¤ò¤É¤Ê¤¿¤È¤³¤³¤í¤¨¤ë¡£¡×");
5420 msg_format("%^s says 'WHO do you think this person is! Bow your head, down your knees!'", kakusan);
5425 confuse_monsters(120);
5427 stasis_monsters(120);
5433 msg_print("¤·¤«¤·¡¢²¿¤âµ¯¤¤Ê¤«¤Ã¤¿¡£");
5435 msg_print("Nothing happen.");
5438 o_ptr->timeout = randint0(150) + 150;
5445 msg_print("Çï»ÒÌÚ¤òÂǤä¿¡£");
5447 msg_print("You beat Your wooden clappers.");
5449 aggravate_monsters(0);
5456 set_hero(randint1(25)+25, FALSE);
5458 o_ptr->timeout = randint0(30) + 30;
5464 (void)set_poisoned(0);
5465 (void)set_confused(0);
5471 o_ptr->timeout = 100;
5477 if (!get_aim_dir(&dir)) return;
5478 (void)charm_animal(dir, p_ptr->lev);
5480 o_ptr->timeout = 200;
5487 msg_print("¥½¡¼¥É¤¬Ã¸¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
5489 msg_print("Your sword glows a pale blue...");
5491 if (!get_aim_dir(&dir)) return;
5492 fire_bolt(GF_COLD, dir, damroll(12, 8));
5493 o_ptr->timeout = 50;
5500 msg_print("³ù¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
5502 msg_print("Your scythe glows brightly!");
5504 for (i = 0; i < TR_FLAG_SIZE; i++)
5505 o_ptr->art_flags[i] = a_info[ART_BLOOD].flags[i];
5507 dummy = randint1(2)+randint1(2);
5508 for (i = 0; i < dummy; i++)
5510 int flag = randint0(19);
5511 if (flag == 18) add_flag(o_ptr->art_flags, TR_SLAY_HUMAN);
5512 else add_flag(o_ptr->art_flags, TR_CHAOTIC + flag);
5514 dummy = randint1(2);
5515 for (i = 0; i < dummy; i++)
5516 one_resistance(o_ptr);
5518 for (i = 0; i < dummy; i++)
5520 int tmp = randint0(11);
5521 if (tmp < 6) add_flag(o_ptr->art_flags, TR_STR + tmp);
5522 else add_flag(o_ptr->art_flags, TR_STEALTH + tmp - 6);
5524 o_ptr->timeout = 3333;
5525 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
5526 p_ptr->update |= (PU_BONUS | PU_HP);
5532 msg_print("Î϶¯¤¯»Í¸Ô¤òƧ¤ó¤À¡£");
5534 msg_print("You stamp. (as if you are in a ring.)");
5536 (void)set_hero(randint1(20) + 20, FALSE);
5537 dispel_evil(p_ptr->lev * 3);
5538 o_ptr->timeout = 100 + randint1(100);
5544 msg_print("¥¯¥í¡¼¥¯¤¬Çò¤¯µ±¤¤¤¿...");
5546 msg_print("Your cloak grows white.");
5548 (void)set_oppose_cold(randint1(20) + 20, FALSE);
5549 o_ptr->timeout = 40 + randint1(40);
5555 msg_print("¥à¥Á¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
5557 msg_print("The whip lets out a shrill wail...");
5561 (void)set_protevil(randint1(25) + k, FALSE);
5562 o_ptr->timeout = randint0(225) + 225;
5567 u32b mode = PM_ALLOW_GROUP;
5568 bool pet = !one_in_(5);
5569 if (pet) mode |= PM_FORCE_PET;
5571 if (summon_named_creature(0, py, px, MON_JIZOTAKO, mode))
5575 msg_print("Âý¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5577 msg_print("A group of octopuses appear as your servant.");
5582 msg_print("Âý¤Ï¤¢¤Ê¤¿¤òâˤó¤Ç¤¤¤ë¡ª");
5584 msg_print("A group of octopuses appear as your enemy!");
5589 o_ptr->timeout = 300 + randint1(150);
5596 msg_print("Å´µå¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
5598 msg_print("The iron ball floods the area with goodness...");
5601 dispel_evil(p_ptr->lev * 5);
5602 o_ptr->timeout = randint0(100) + 100;
5609 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤¬¿¼¤¤°Ç¤Ëʤ¤ï¤ì¤¿...");
5611 msg_print("Your amulet is coverd in pitch-darkness...");
5613 if (!get_aim_dir(&dir)) return;
5614 fire_ball(GF_DARK, dir, 250, 4);
5615 o_ptr->timeout = randint0(150) + 150;
5621 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5627 else if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3))
5629 switch (o_ptr->xtra3-1)
5631 case ESSENCE_TMP_RES_ACID:
5632 (void)set_oppose_acid(randint1(20) + 20, FALSE);
5633 o_ptr->timeout = randint0(50) + 50;
5636 case ESSENCE_TMP_RES_ELEC:
5637 (void)set_oppose_elec(randint1(20) + 20, FALSE);
5638 o_ptr->timeout = randint0(50) + 50;
5641 case ESSENCE_TMP_RES_FIRE:
5642 (void)set_oppose_fire(randint1(20) + 20, FALSE);
5643 o_ptr->timeout = randint0(50) + 50;
5646 case ESSENCE_TMP_RES_COLD:
5647 (void)set_oppose_cold(randint1(20) + 20, FALSE);
5648 o_ptr->timeout = randint0(50) + 50;
5652 earthquake(py, px, 5);
5653 o_ptr->timeout = 100 + randint1(100);
5656 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5664 else if (o_ptr->name2 == EGO_TRUMP)
5666 teleport_player(100);
5667 o_ptr->timeout = 50 + randint1(50);
5670 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5677 else if (o_ptr->name2 == EGO_LITE_ILLUMINATION)
5679 if (!o_ptr->xtra4 && ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
5682 msg_print("dzÎÁ¤¬¤Ê¤¤¡£");
5684 msg_print("It has no fuel.");
5689 lite_area(damroll(2, 15), 3);
5690 o_ptr->timeout = randint0(10) + 10;
5693 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5699 else if (o_ptr->name2 == EGO_EARTHQUAKES)
5701 earthquake(py, px, 5);
5702 o_ptr->timeout = 100 + randint1(100);
5705 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5712 else if (o_ptr->name2 == EGO_JUMP)
5714 teleport_player(10);
5715 o_ptr->timeout = 10 + randint1(10);
5718 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5725 /* Hack -- Dragon Scale Mail can be activated as well */
5726 else if (o_ptr->tval == TV_DRAG_ARMOR)
5728 /* Get a direction for breathing (or abort) */
5729 if (!get_aim_dir(&dir)) return;
5731 /* Branch on the sub-type */
5732 switch (o_ptr->sval)
5734 case SV_DRAGON_BLUE:
5737 msg_print("¤¢¤Ê¤¿¤Ï°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5739 msg_print("You breathe lightning.");
5742 fire_ball(GF_ELEC, dir, 100, -2);
5743 o_ptr->timeout = randint0(150) + 150;
5747 case SV_DRAGON_WHITE:
5750 msg_print("¤¢¤Ê¤¿¤ÏÎ䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5752 msg_print("You breathe frost.");
5755 fire_ball(GF_COLD, dir, 110, -2);
5756 o_ptr->timeout = randint0(150) + 150;
5760 case SV_DRAGON_BLACK:
5763 msg_print("¤¢¤Ê¤¿¤Ï»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5765 msg_print("You breathe acid.");
5768 fire_ball(GF_ACID, dir, 130, -2);
5769 o_ptr->timeout = randint0(150) + 150;
5773 case SV_DRAGON_GREEN:
5776 msg_print("¤¢¤Ê¤¿¤ÏÆÇ¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5778 msg_print("You breathe poison gas.");
5781 fire_ball(GF_POIS, dir, 150, -2);
5782 o_ptr->timeout = randint0(180) + 180;
5789 msg_print("¤¢¤Ê¤¿¤Ï²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5791 msg_print("You breathe fire.");
5794 fire_ball(GF_FIRE, dir, 200, -2);
5795 o_ptr->timeout = randint0(200) + 200;
5799 case SV_DRAGON_MULTIHUED:
5801 chance = randint0(5);
5803 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5804 ((chance == 1) ? "°ðºÊ" :
5805 ((chance == 2) ? "Î䵤" :
5806 ((chance == 3) ? "»À" :
5807 ((chance == 4) ? "ÆÇ¥¬¥¹" : "²Ð±ê")))));
5809 msg_format("You breathe %s.",
5810 ((chance == 1) ? "lightning" :
5811 ((chance == 2) ? "frost" :
5812 ((chance == 3) ? "acid" :
5813 ((chance == 4) ? "poison gas" : "fire")))));
5816 fire_ball(((chance == 1) ? GF_ELEC :
5817 ((chance == 2) ? GF_COLD :
5818 ((chance == 3) ? GF_ACID :
5819 ((chance == 4) ? GF_POIS : GF_FIRE)))),
5821 o_ptr->timeout = randint0(200) + 200;
5825 case SV_DRAGON_BRONZE:
5828 msg_print("¤¢¤Ê¤¿¤Ïº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5830 msg_print("You breathe confusion.");
5833 fire_ball(GF_CONFUSION, dir, 120, -2);
5834 o_ptr->timeout = randint0(180) + 180;
5838 case SV_DRAGON_GOLD:
5841 msg_print("¤¢¤Ê¤¿¤Ï¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5843 msg_print("You breathe sound.");
5846 fire_ball(GF_SOUND, dir, 130, -2);
5847 o_ptr->timeout = randint0(180) + 180;
5851 case SV_DRAGON_CHAOS:
5853 chance = randint0(2);
5855 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5856 ((chance == 1 ? "¥«¥ª¥¹" : "Îô²½")));
5858 msg_format("You breathe %s.",
5859 ((chance == 1 ? "chaos" : "disenchantment")));
5862 fire_ball((chance == 1 ? GF_CHAOS : GF_DISENCHANT),
5864 o_ptr->timeout = randint0(200) + 200;
5870 chance = randint0(2);
5872 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5873 ((chance == 1 ? "¹ì²»" : "ÇËÊÒ")));
5875 msg_format("You breathe %s.",
5876 ((chance == 1 ? "sound" : "shards")));
5879 fire_ball((chance == 1 ? GF_SOUND : GF_SHARDS),
5881 o_ptr->timeout = randint0(200) + 200;
5885 case SV_DRAGON_BALANCE:
5887 chance = randint0(4);
5889 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿",
5890 ((chance == 1) ? "¥«¥ª¥¹" :
5891 ((chance == 2) ? "Îô²½" :
5892 ((chance == 3) ? "¹ì²»" : "ÇËÊÒ"))));
5894 msg_format("You breathe %s.",
5895 ((chance == 1) ? "chaos" :
5896 ((chance == 2) ? "disenchantment" :
5897 ((chance == 3) ? "sound" : "shards"))));
5900 fire_ball(((chance == 1) ? GF_CHAOS :
5901 ((chance == 2) ? GF_DISENCHANT :
5902 ((chance == 3) ? GF_SOUND : GF_SHARDS))),
5904 o_ptr->timeout = randint0(200) + 200;
5908 case SV_DRAGON_SHINING:
5910 chance = randint0(2);
5912 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5913 ((chance == 0 ? "Á®¸÷" : "°Å¹õ")));
5915 msg_format("You breathe %s.",
5916 ((chance == 0 ? "light" : "darkness")));
5919 fire_ball((chance == 0 ? GF_LITE : GF_DARK), dir, 200, -2);
5920 o_ptr->timeout = randint0(200) + 200;
5924 case SV_DRAGON_POWER:
5927 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5929 msg_print("You breathe the elements.");
5932 fire_ball(GF_MISSILE, dir, 300, -3);
5933 o_ptr->timeout = randint0(200) + 200;
5939 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5945 else if (o_ptr->tval == TV_RING)
5949 bool success = TRUE;
5951 switch (o_ptr->name2)
5954 (void)set_afraid(0);
5955 (void)set_hero(randint1(25) + 25, FALSE);
5956 (void)hp_player(10);
5957 o_ptr->timeout = randint1(100)+100;
5959 case EGO_RING_MAGIC_MIS:
5960 if (!get_aim_dir(&dir)) return;
5961 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
5964 case EGO_RING_FIRE_BOLT:
5965 if (!get_aim_dir(&dir)) return;
5966 fire_bolt(GF_FIRE, dir, damroll(9, 8));
5967 o_ptr->timeout = randint0(8) + 8;
5969 case EGO_RING_COLD_BOLT:
5970 if (!get_aim_dir(&dir)) return;
5971 fire_bolt(GF_COLD, dir, damroll(6, 8));
5972 o_ptr->timeout = randint0(7) + 7;
5974 case EGO_RING_ELEC_BOLT:
5975 if (!get_aim_dir(&dir)) return;
5976 fire_bolt(GF_ELEC, dir, damroll(4, 8));
5977 o_ptr->timeout = randint0(5) + 5;
5979 case EGO_RING_ACID_BOLT:
5980 if (!get_aim_dir(&dir)) return;
5981 fire_bolt(GF_FIRE, dir, damroll(5, 8));
5982 o_ptr->timeout = randint0(6) + 6;
5984 case EGO_RING_MANA_BOLT:
5985 if (!get_aim_dir(&dir)) return;
5986 fire_bolt(GF_MANA, dir, 120);
5987 o_ptr->timeout = randint0(120)+120;
5989 case EGO_RING_FIRE_BALL:
5990 if (!get_aim_dir(&dir)) return;
5991 fire_ball(GF_FIRE, dir, 100, 2);
5992 o_ptr->timeout = randint0(80) + 80;
5994 case EGO_RING_COLD_BALL:
5995 if (!get_aim_dir(&dir)) return;
5996 fire_ball(GF_COLD, dir, 100, 2);
5997 o_ptr->timeout = randint0(80) + 80;
5999 case EGO_RING_ELEC_BALL:
6000 if (!get_aim_dir(&dir)) return;
6001 fire_ball(GF_ELEC, dir, 100, 2);
6002 o_ptr->timeout = randint0(80) + 80;
6004 case EGO_RING_ACID_BALL:
6005 if (!get_aim_dir(&dir)) return;
6006 fire_ball(GF_ACID, dir, 100, 2);
6007 o_ptr->timeout = randint0(80) + 80;
6009 case EGO_RING_MANA_BALL:
6010 if (!get_aim_dir(&dir)) return;
6011 fire_ball(GF_MANA, dir, 250, 2);
6012 o_ptr->timeout = 300;
6014 case EGO_RING_DRAGON_F:
6015 if (!get_aim_dir(&dir)) return;
6016 fire_ball(GF_FIRE, dir, 200, -2);
6017 if (o_ptr->sval == SV_RING_FLAMES)
6019 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6020 o_ptr->timeout = 200;
6022 else o_ptr->timeout = 250;
6024 case EGO_RING_DRAGON_C:
6025 if (!get_aim_dir(&dir)) return;
6026 fire_ball(GF_COLD, dir, 200, -2);
6027 if (o_ptr->sval == SV_RING_ICE)
6029 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6030 o_ptr->timeout = 200;
6032 else o_ptr->timeout = 250;
6034 case EGO_RING_M_DETECT:
6035 (void)detect_monsters_invis(255);
6036 (void)detect_monsters_normal(255);
6037 o_ptr->timeout = 150;
6039 case EGO_RING_D_SPEED:
6040 (void)set_fast(randint1(30) + 15, FALSE);
6041 o_ptr->timeout = 100;
6043 case EGO_RING_BERSERKER:
6044 (void)set_shero(randint1(25) + 25, FALSE);
6045 o_ptr->timeout = randint0(75)+75;
6047 case EGO_RING_TELE_AWAY:
6048 if (!get_aim_dir(&dir)) return;
6049 teleport_monster(dir);
6050 o_ptr->timeout = 150;
6054 int v = randint1(25)+25;
6055 (void)set_afraid(0);
6056 (void)set_hero(v, FALSE);
6057 (void)hp_player(10);
6058 (void)set_blessed(v, FALSE);
6059 (void)set_oppose_acid(v, FALSE);
6060 (void)set_oppose_elec(v, FALSE);
6061 (void)set_oppose_fire(v, FALSE);
6062 (void)set_oppose_cold(v, FALSE);
6063 (void)set_oppose_pois(v, FALSE);
6064 (void)set_ultimate_res(v, FALSE);
6065 o_ptr->timeout = 777;
6072 if (success) return;
6075 /* Get a direction for breathing (or abort) */
6076 if (!get_aim_dir(&dir)) return;
6078 switch (o_ptr->sval)
6082 fire_ball(GF_ACID, dir, 100, 2);
6083 (void)set_oppose_acid(randint1(20) + 20, FALSE);
6084 o_ptr->timeout = randint0(50) + 50;
6090 fire_ball(GF_COLD, dir, 100, 2);
6091 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6092 o_ptr->timeout = randint0(50) + 50;
6096 case SV_RING_FLAMES:
6098 fire_ball(GF_FIRE, dir, 100, 2);
6099 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6100 o_ptr->timeout = randint0(50) + 50;
6106 fire_ball(GF_ELEC, dir, 100, 2);
6107 (void)set_oppose_elec(randint1(20) + 20, FALSE);
6108 o_ptr->timeout = randint0(50) + 50;
6114 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6120 else if (o_ptr->tval == TV_AMULET)
6124 switch (o_ptr->name2)
6127 if (!ident_spell(FALSE, FALSE)) return;
6128 o_ptr->timeout = 10;
6131 if (!get_aim_dir(&dir)) return;
6132 charm_monster(dir, MAX(20, p_ptr->lev));
6133 o_ptr->timeout = 200;
6136 teleport_player(10);
6137 o_ptr->timeout = randint0(10) + 10;
6139 case EGO_AMU_TELEPORT:
6140 teleport_player(100);
6141 o_ptr->timeout = randint0(50) + 50;
6143 case EGO_AMU_D_DOOR:
6144 (void)dimension_door();
6145 o_ptr->timeout = 200;
6147 case EGO_AMU_RES_FIRE_:
6148 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6149 o_ptr->timeout = randint0(50) + 50;
6151 case EGO_AMU_RES_COLD_:
6152 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6153 o_ptr->timeout = randint0(50) + 50;
6155 case EGO_AMU_RES_ELEC_:
6156 (void)set_oppose_elec(randint1(20) + 20, FALSE);
6157 o_ptr->timeout = randint0(50) + 50;
6159 case EGO_AMU_RES_ACID_:
6160 (void)set_oppose_acid(randint1(20) + 20, FALSE);
6161 o_ptr->timeout = randint0(50) + 50;
6163 case EGO_AMU_DETECTION:
6164 detect_all(DETECT_RAD_DEFAULT);
6165 o_ptr->timeout = randint0(55)+55;
6172 else if (o_ptr->tval == TV_WHISTLE)
6175 if (cursed_p(o_ptr))
6178 msg_print("¥«¥ó¹â¤¤²»¤¬¶Á¤ÅϤä¿¡£");
6180 msg_print("You produce a shrill whistling sound.");
6182 aggravate_monsters(0);
6192 /* Allocate the "who" array */
6193 C_MAKE(who, max_m_idx, u16b);
6195 /* Process the monsters (backwards) */
6196 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6198 if (is_pet(&m_list[pet_ctr]) && (p_ptr->riding != pet_ctr))
6199 who[max_pet++] = pet_ctr;
6202 /* Select the sort method */
6203 ang_sort_comp = ang_sort_comp_pet;
6204 ang_sort_swap = ang_sort_swap_hook;
6206 ang_sort(who, &dummy_why, max_pet);
6208 /* Process the monsters (backwards) */
6209 for (i = 0; i < max_pet; i++)
6212 teleport_to_player(pet_ctr, 100);
6215 /* Free the "who" array */
6216 C_KILL(who, max_m_idx, u16b);
6218 o_ptr->timeout = 100+randint1(100);
6221 else if (o_ptr->tval == TV_CAPTURE)
6225 bool old_target_pet = target_pet;
6227 if (!get_aim_dir(&dir))
6229 target_pet = old_target_pet;
6232 target_pet = old_target_pet;
6234 if(fire_ball(GF_CAPTURE, dir, 0, 0))
6236 o_ptr->pval = cap_mon;
6237 o_ptr->xtra3 = cap_mspeed;
6238 o_ptr->xtra4 = cap_hp;
6239 o_ptr->xtra5 = cap_maxhp;
6246 if (o_ptr->inscription)
6247 strcpy(buf, quark_str(o_ptr->inscription));
6249 for (s = buf;*s && (*s != '#'); s++)
6252 if (iskanji(*s)) s++;
6262 t = quark_str(cap_nickname);
6275 o_ptr->inscription = quark_add(buf);
6281 bool success = FALSE;
6282 if (!get_rep_dir2(&dir)) return;
6283 if (cave_floor_bold(py+ddy[dir],px+ddx[dir]))
6285 if (place_monster_aux(0, py + ddy[dir], px + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
6287 if (o_ptr->xtra3) m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
6288 if (o_ptr->xtra5) m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
6289 if (o_ptr->xtra4) m_list[hack_m_idx_ii].hp = o_ptr->xtra4;
6290 m_list[hack_m_idx_ii].maxhp = m_list[hack_m_idx_ii].max_maxhp;
6291 if (o_ptr->inscription)
6299 t = quark_str(o_ptr->inscription);
6300 for (t = quark_str(o_ptr->inscription);*t && (*t != '#'); t++)
6303 if (iskanji(*t)) t++;
6328 if (quote && *(s-1) =='\'')
6332 m_list[hack_m_idx_ii].nickname = quark_add(buf);
6333 t = quark_str(o_ptr->inscription);
6335 while(*t && (*t != '#'))
6342 o_ptr->inscription = quark_add(buf);
6354 msg_print("¤ª¤Ã¤È¡¢²òÊü¤Ë¼ºÇÔ¤·¤¿¡£");
6356 msg_print("Oops. You failed to release your pet.");
6364 msg_print("¤ª¤Ã¤È¡¢¤³¤Î¥¢¥¤¥Æ¥à¤Ï»ÏÆ°¤Ç¤¤Ê¤¤¡£");
6366 msg_print("Oops. That object cannot be activated.");
6372 void do_cmd_activate(void)
6378 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6380 set_action(ACTION_NONE);
6383 item_tester_no_ryoute = TRUE;
6384 /* Prepare the hook */
6385 item_tester_hook = item_tester_hook_activate;
6389 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò»ÏÆ°¤µ¤»¤Þ¤¹¤«? ";
6390 s = "»ÏÆ°¤Ç¤¤ë¥¢¥¤¥Æ¥à¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£";
6392 q = "Activate which item? ";
6393 s = "You have nothing to activate.";
6396 if (!get_item(&item, q, s, (USE_EQUIP))) return;
6398 /* Activate the item */
6399 do_cmd_activate_aux(item);
6404 * Hook to determine if an object is useable
6406 static bool item_tester_hook_use(object_type *o_ptr)
6408 u32b flgs[TR_FLAG_SIZE];
6411 if (o_ptr->tval == p_ptr->tval_ammo)
6414 /* Useable object */
6415 switch (o_ptr->tval)
6433 if (!object_known_p(o_ptr)) return (FALSE);
6435 /* HACK - only items from the equipment can be activated */
6436 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
6438 if (&inventory[i] == o_ptr)
6440 /* Extract the flags */
6441 object_flags(o_ptr, flgs);
6443 /* Check activation flag */
6444 if (have_flag(flgs, TR_ACTIVATE)) return (TRUE);
6457 * XXX - Add actions for other item types
6459 void do_cmd_use(void)
6465 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6467 set_action(ACTION_NONE);
6470 item_tester_no_ryoute = TRUE;
6471 /* Prepare the hook */
6472 item_tester_hook = item_tester_hook_use;
6476 q = "¤É¤ì¤ò»È¤¤¤Þ¤¹¤«¡©";
6477 s = "»È¤¨¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤»¤ó¡£";
6479 q = "Use which item? ";
6480 s = "You have nothing to use.";
6483 if (!get_item(&item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR))) return;
6485 /* Get the item (in the pack) */
6488 o_ptr = &inventory[item];
6490 /* Get the item (on the floor) */
6493 o_ptr = &o_list[0 - item];
6496 switch (o_ptr->tval)
6508 do_cmd_eat_food_aux(item);
6515 do_cmd_aim_wand_aux(item);
6522 do_cmd_use_staff_aux(item);
6529 do_cmd_zap_rod_aux(item);
6533 /* Quaff a potion */
6536 do_cmd_quaff_potion_aux(item);
6543 /* Check some conditions */
6547 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡£");
6549 msg_print("You can't see anything.");
6557 msg_print("ÌÀ¤«¤ê¤¬¤Ê¤¤¤Î¤Ç¡¢°Å¤¯¤ÆÆɤá¤Ê¤¤¡£");
6559 msg_print("You have no light to read by.");
6564 if (p_ptr->confused)
6567 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
6569 msg_print("You are too confused!");
6575 do_cmd_read_scroll_aux(item, TRUE);
6584 do_cmd_fire_aux(item, &inventory[INVEN_BOW]);
6588 /* Activate an artifact */
6591 do_cmd_activate_aux(item);
6597 static bool select_magic_eater(bool only_browse)
6601 bool flag, redraw, request_list;
6603 int ask = TRUE, i = 0;
6606 int menu_line = (use_menu ? 1 : 0);
6610 if (repeat_pull(&sn))
6612 /* Verify the spell */
6613 if (sn >= EATER_EXT*2 && !(p_ptr->magic_num1[sn] > k_info[lookup_kind(TV_ROD, sn-EATER_EXT*2)].pval * (p_ptr->magic_num2[sn] - 1) * EATER_ROD_CHARGE))
6615 else if (sn < EATER_EXT*2 && !(p_ptr->magic_num1[sn] < EATER_CHARGE))
6619 #endif /* ALLOW_REPEAT */
6621 for (i = 0; i < 108; i++)
6623 if (p_ptr->magic_num2[i]) break;
6628 msg_print("ËâË¡¤ò³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6630 msg_print("You don't have any magic!");
6642 prt(format(" %s ¾ó", (menu_line == 1) ? "¡Õ" : " "), 2, 14);
6643 prt(format(" %s ËâË¡ËÀ", (menu_line == 2) ? "¡Õ" : " "), 3, 14);
6644 prt(format(" %s ¥í¥Ã¥É", (menu_line == 3) ? "¡Õ" : " "), 4, 14);
6645 prt("¤É¤Î¼ïÎà¤ÎËâË¡¤ò»È¤¤¤Þ¤¹¤«¡©", 0, 0);
6647 prt(format(" %s staff", (menu_line == 1) ? "> " : " "), 2, 14);
6648 prt(format(" %s wand", (menu_line == 2) ? "> " : " "), 3, 14);
6649 prt(format(" %s rod", (menu_line == 3) ? "> " : " "), 4, 14);
6650 prt("Which type of magic do you usu?", 0, 0);
6673 ext = (menu_line-1)*EATER_EXT;
6674 if (menu_line == 1) tval = TV_STAFF;
6675 else if (menu_line == 2) tval = TV_WAND;
6679 if (menu_line > 3) menu_line -= 3;
6688 if (!get_com("[A] ¾ó, [B] ËâË¡ËÀ, [C] ¥í¥Ã¥É:", &choice, TRUE))
6690 if (!get_com("[A] staff, [B] wand, [C] rod:", &choice, TRUE))
6695 if (choice == 'A' || choice == 'a')
6701 if (choice == 'B' || choice == 'b')
6707 if (choice == 'C' || choice == 'c')
6715 for (i = ext; i < ext + EATER_EXT; i++)
6717 if (p_ptr->magic_num2[i])
6719 if (use_menu) menu_line = i-ext+1;
6723 if (i == ext+EATER_EXT)
6726 msg_print("¤½¤Î¼ïÎà¤ÎËâË¡¤Ï³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6728 msg_print("You don't have that type of magic!");
6733 /* Nothing chosen yet */
6739 /* Build a prompt */
6741 (void) strnfmt(out_val, 78, "('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎËâÎϤò»È¤¤¤Þ¤¹¤«¡©");
6743 (void)strnfmt(out_val, 78, "(*=List, ESC=exit) Use which power? ");
6746 /* Save the screen */
6749 request_list = always_show_list;
6751 /* Get a spell from the user */
6755 if (request_list || use_menu)
6766 for (y = 1; y < 20; y++)
6771 /* Print header(s) */
6773 prt(format(" %s ¼ºÎ¨ %s ¼ºÎ¨", (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô"), (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô")), y++, x);
6775 prt(format(" %s Fail %s Fail", (tval == TV_ROD ? " Stat " : " Charges"), (tval == TV_ROD ? " Stat " : " Charges")), y++, x);
6779 for (ctr = 0; ctr < EATER_EXT; ctr++)
6781 if (!p_ptr->magic_num2[ctr+ext]) continue;
6783 k_idx = lookup_kind(tval, ctr);
6787 if (ctr == (menu_line-1))
6789 strcpy(dummy, "¡Õ");
6791 strcpy(dummy, "> ");
6793 else strcpy(dummy, " ");
6796 /* letter/number for power selection */
6803 letter = '0' + ctr - 26;
6804 sprintf(dummy, "%c)",letter);
6806 x1 = ((ctr < EATER_EXT/2) ? x : x + 40);
6807 y1 = ((ctr < EATER_EXT/2) ? y + ctr : y + ctr - EATER_EXT/2);
6808 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
6809 chance = level * 4 / 5 + 20;
6810 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
6812 if (p_ptr->lev > level)
6814 chance -= 3 * (p_ptr->lev - level);
6816 chance += p_ptr->to_m_chance;
6817 if (p_ptr->heavy_spell) chance += 20;
6818 if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
6819 else if (p_ptr->easy_spell) chance-=3;
6820 else if (p_ptr->dec_mana) chance-=2;
6821 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
6822 /* Stunning makes spells harder */
6823 if (p_ptr->stun > 50) chance += 25;
6824 else if (p_ptr->stun) chance += 15;
6826 if (chance > 95) chance = 95;
6828 if(p_ptr->dec_mana) chance--;
6829 if (p_ptr->heavy_spell) chance += 5;
6837 strcat(dummy, format(
6839 " %-22.22s ½¼Å¶:%2d/%2d%3d%%",
6841 " %-22.22s (%2d/%2d) %3d%%",
6843 k_name + k_info[k_idx].name,
6844 p_ptr->magic_num1[ctr+ext] ?
6845 (p_ptr->magic_num1[ctr+ext] - 1) / (EATER_ROD_CHARGE * k_info[k_idx].pval) +1 : 0,
6846 p_ptr->magic_num2[ctr+ext], chance));
6847 if (p_ptr->magic_num1[ctr+ext] > k_info[k_idx].pval * (p_ptr->magic_num2[ctr+ext]-1) * EATER_ROD_CHARGE) col = TERM_RED;
6851 strcat(dummy, format(" %-22.22s %2d/%2d %3d%%", k_name + k_info[k_idx].name, (s16b)(p_ptr->magic_num1[ctr+ext]/EATER_CHARGE), p_ptr->magic_num2[ctr+ext], chance));
6852 if (p_ptr->magic_num1[ctr+ext] < EATER_CHARGE) col = TERM_RED;
6857 c_prt(col, dummy, y1, x1);
6861 if(!get_com(out_val, &choice, FALSE)) break;
6863 if (use_menu && choice != ' ')
6880 menu_line += EATER_EXT - 1;
6881 if (menu_line > EATER_EXT) menu_line -= EATER_EXT;
6882 } while(!p_ptr->magic_num2[menu_line+ext-1]);
6893 if (menu_line > EATER_EXT) menu_line -= EATER_EXT;
6894 } while(!p_ptr->magic_num2[menu_line+ext-1]);
6905 bool reverse = FALSE;
6906 if ((choice == '4') || (choice == 'h') || (choice == 'H')) reverse = TRUE;
6907 if (menu_line > EATER_EXT/2)
6909 menu_line -= EATER_EXT/2;
6912 else menu_line+=EATER_EXT/2;
6913 while(!p_ptr->magic_num2[menu_line+ext-1])
6918 if (menu_line < 2) reverse = FALSE;
6923 if (menu_line > EATER_EXT-1) reverse = TRUE;
6940 /* Request redraw */
6941 if (use_menu && ask) continue;
6943 /* Request redraw */
6944 if (!use_menu && ((choice == ' ') || (choice == '*') || (choice == '?')))
6950 request_list = FALSE;
6952 /* Restore the screen */
6957 request_list = TRUE;
6965 if (isalpha(choice))
6968 ask = (isupper(choice));
6971 if (ask) choice = tolower(choice);
6973 /* Extract request */
6974 i = (islower(choice) ? A2I(choice) : -1);
6978 ask = FALSE; /* Can't uppercase digits */
6980 i = choice - '0' + 26;
6984 /* Totally Illegal */
6985 if ((i < 0) || (i > EATER_EXT) || !p_ptr->magic_num2[i+ext])
7000 (void) strnfmt(tmp_val, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", k_name + k_info[lookup_kind(tval ,i)].name);
7002 (void) strnfmt(tmp_val, 78, "Use %s?", k_name + k_info[lookup_kind(tval ,i)].name);
7005 /* Belay that order */
7006 if (!get_check(tmp_val)) continue;
7010 if (p_ptr->magic_num1[ext+i] > k_info[lookup_kind(tval, i)].pval * (p_ptr->magic_num2[ext+i] - 1) * EATER_ROD_CHARGE)
7013 msg_print("¤½¤ÎËâË¡¤Ï¤Þ¤À½¼Å¶¤·¤Æ¤¤¤ëºÇÃæ¤À¡£");
7015 msg_print("The magic are still charging.");
7018 if (use_menu) ask = TRUE;
7024 if (p_ptr->magic_num1[ext+i] < EATER_CHARGE)
7027 msg_print("¤½¤ÎËâË¡¤Ï»ÈÍѲó¿ô¤¬ÀÚ¤ì¤Æ¤¤¤ë¡£");
7029 msg_print("The magic has no charges left.");
7032 if (use_menu) ask = TRUE;
7044 /* Clear lines, position cursor (really should use strlen here) */
7045 Term_erase(7, 23, 255);
7046 Term_erase(7, 22, 255);
7047 Term_erase(7, 21, 255);
7048 Term_erase(7, 20, 255);
7050 roff_to_buf(k_text + k_info[lookup_kind(tval, i)].text, 62, temp);
7051 for (j = 0, line = 21; temp[j]; j += 1 + strlen(&temp[j]))
7053 prt(&temp[j], line, 10);
7058 prt("²¿¤«¥¡¼¤ò²¡¤·¤Æ²¼¤µ¤¤¡£",0,0);
7060 prt("Hit any key.",0,0);
7070 /* Restore the screen */
7073 if (!flag) return -1;
7077 #endif /* ALLOW_REPEAT */
7083 * Use eaten rod, wand or staff
7085 void do_cmd_magic_eater(bool only_browse)
7087 int item, dir, chance, level, k_idx, tval, sval;
7088 bool use_charge = TRUE;
7090 /* Not when confused */
7091 if (!only_browse && p_ptr->confused)
7094 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
7096 msg_print("You are too confused!");
7102 item = select_magic_eater(only_browse);
7108 if (item >= EATER_EXT*2) {tval = TV_ROD;sval = item - EATER_EXT*2;}
7109 else if (item >= EATER_EXT) {tval = TV_WAND;sval = item - EATER_EXT;}
7110 else {tval = TV_STAFF;sval = item;}
7111 k_idx = lookup_kind(tval, sval);
7113 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
7114 chance = level * 4 / 5 + 20;
7115 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
7117 if (p_ptr->lev > level)
7119 chance -= 3 * (p_ptr->lev - level);
7121 chance += p_ptr->to_m_chance;
7122 if (p_ptr->heavy_spell) chance += 20;
7123 if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
7124 else if (p_ptr->easy_spell) chance-=3;
7125 else if (p_ptr->dec_mana) chance-=2;
7126 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
7127 /* Stunning makes spells harder */
7128 if (p_ptr->stun > 50) chance += 25;
7129 else if (p_ptr->stun) chance += 15;
7131 if (chance > 95) chance = 95;
7133 if(p_ptr->dec_mana) chance--;
7134 if (p_ptr->heavy_spell) chance += 5;
7136 if (randint0(100) < chance)
7138 if (flush_failure) flush();
7141 msg_print("¼öʸ¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª");
7143 msg_format("You failed to get the magic off!");
7147 if (randint1(100) >= chance)
7148 chg_virtue(V_CHANCE,-1);
7157 if ((sval >= SV_ROD_MIN_DIRECTION) && (sval != SV_ROD_HAVOC) && (sval != SV_ROD_AGGRAVATE) && (sval != SV_ROD_PESTICIDE))
7158 if (!get_aim_dir(&dir)) return;
7159 rod_effect(sval, dir, &use_charge, TRUE);
7160 if (!use_charge) return;
7162 else if (tval == TV_WAND)
7164 if (!get_aim_dir(&dir)) return;
7165 wand_effect(sval, dir, TRUE);
7169 staff_effect(sval, &use_charge, TRUE, TRUE);
7170 if (!use_charge) return;
7172 /* Delayed optimization */
7173 optimize_inventry_auto_destroy();
7175 if (randint1(100) < chance)
7176 chg_virtue(V_CHANCE,1);
7179 if (tval == TV_ROD) p_ptr->magic_num1[item] += k_info[k_idx].pval * EATER_ROD_CHARGE;
7180 else p_ptr->magic_num1[item] -= EATER_CHARGE;