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 + rand_int(10) + 10))
103 case SV_FOOD_BLINDNESS:
105 if (!p_ptr->resist_blind)
107 if (set_blind(p_ptr->blind + rand_int(200) + 200))
115 case SV_FOOD_PARANOIA:
117 if (!p_ptr->resist_fear)
119 if (set_afraid(p_ptr->afraid + rand_int(10) + 10))
127 case SV_FOOD_CONFUSION:
129 if (!p_ptr->resist_conf)
131 if (set_confused(p_ptr->confused + rand_int(10) + 10))
139 case SV_FOOD_HALLUCINATION:
141 if (!p_ptr->resist_chaos)
143 if (set_image(p_ptr->image + rand_int(250) + 250))
151 case SV_FOOD_PARALYSIS:
153 if (!p_ptr->free_act)
155 if (set_paralyzed(p_ptr->paralyzed + rand_int(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(randint(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 + rand_int(15) + 10))
687 case SV_POTION_BLINDNESS:
689 if (!p_ptr->resist_blind)
691 if (set_blind(p_ptr->blind + rand_int(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(rand_int(20) + 15))
711 if (!p_ptr->resist_chaos)
715 if (set_image(p_ptr->image + rand_int(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 + rand_int(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 + randint(100), FALSE))
891 case SV_POTION_DETECT_INVIS:
893 if (set_tim_invis(p_ptr->tim_invis + 12 + randint(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(randint(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 + randint(10) + 10, FALSE))
940 case SV_POTION_RESIST_COLD:
942 if (set_oppose_cold(p_ptr->oppose_cold + randint(10) + 10, FALSE))
949 case SV_POTION_HEROISM:
951 if (set_afraid(0)) ident = TRUE;
952 if (set_hero(p_ptr->hero + randint(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 + randint(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 < 72; i++)
1057 p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? 0x30000 : p_ptr->magic_num2[i]*0x05555;
1058 if (p_ptr->magic_num1[i] > p_ptr->magic_num2[i]*0x10000) p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*0x10000L;
1060 for (; i < 108; i++)
1062 int k_idx = lookup_kind(TV_ROD, i-72);
1063 p_ptr->magic_num1[i] -= ((p_ptr->magic_num2[i] < 10) ? 0x30000 : p_ptr->magic_num2[i]*0x5555)*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:
1184 chg_virtue(V_ENLIGHTEN, 1);
1186 msg_print("¼«Ê¬¤ÎÃÖ¤«¤ì¤Æ¤¤¤ë¾õ¶·¤¬Ç¾Î¢¤ËÉ⤫¤ó¤Ç¤¤¿...");
1188 msg_print("An image of your surroundings forms in your mind...");
1191 chg_virtue(V_KNOWLEDGE, 1);
1192 chg_virtue(V_ENLIGHTEN, 1);
1193 wiz_lite(FALSE, FALSE);
1198 case SV_POTION_STAR_ENLIGHTENMENT:
1201 msg_print("¹¹¤Ê¤ë·¼Ìؤò´¶¤¸¤¿...");
1203 msg_print("You begin to feel more enlightened...");
1206 chg_virtue(V_KNOWLEDGE, 1);
1207 chg_virtue(V_ENLIGHTEN, 1);
1209 wiz_lite(TRUE, FALSE);
1210 (void)do_inc_stat(A_INT);
1211 (void)do_inc_stat(A_WIS);
1212 (void)detect_traps(DETECT_RAD_DEFAULT);
1213 (void)detect_doors(DETECT_RAD_DEFAULT);
1214 (void)detect_stairs(DETECT_RAD_DEFAULT);
1215 (void)detect_treasure(DETECT_RAD_DEFAULT);
1216 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
1217 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
1224 case SV_POTION_SELF_KNOWLEDGE:
1227 msg_print("¼«Ê¬¼«¿È¤Î¤³¤È¤¬¾¯¤·¤Ïʬ¤«¤Ã¤¿µ¤¤¬¤¹¤ë...");
1229 msg_print("You begin to know yourself a little better...");
1238 case SV_POTION_EXPERIENCE:
1240 if (p_ptr->prace == RACE_ANDROID) break;
1241 chg_virtue(V_ENLIGHTEN, 1);
1242 if (p_ptr->exp < PY_MAX_EXP)
1244 s32b ee = (p_ptr->exp / 2) + 10;
1245 if (ee > 100000L) ee = 100000L;
1247 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1249 msg_print("You feel more experienced.");
1258 case SV_POTION_RESISTANCE:
1260 (void)set_oppose_acid(p_ptr->oppose_acid + randint(20) + 20, FALSE);
1261 (void)set_oppose_elec(p_ptr->oppose_elec + randint(20) + 20, FALSE);
1262 (void)set_oppose_fire(p_ptr->oppose_fire + randint(20) + 20, FALSE);
1263 (void)set_oppose_cold(p_ptr->oppose_cold + randint(20) + 20, FALSE);
1264 (void)set_oppose_pois(p_ptr->oppose_pois + randint(20) + 20, FALSE);
1269 case SV_POTION_CURING:
1271 if (hp_player(50)) ident = TRUE;
1272 if (set_blind(0)) ident = TRUE;
1273 if (set_poisoned(0)) ident = TRUE;
1274 if (set_confused(0)) ident = TRUE;
1275 if (set_stun(0)) ident = TRUE;
1276 if (set_cut(0)) ident = TRUE;
1277 if (set_image(0)) ident = TRUE;
1281 case SV_POTION_INVULNERABILITY:
1283 (void)set_invuln(p_ptr->invuln + randint(4) + 4, FALSE);
1288 case SV_POTION_NEW_LIFE:
1290 do_cmd_rerate(FALSE);
1292 p_ptr->update |= PU_BONUS;
1293 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
1295 chg_virtue(V_CHANCE, -5);
1297 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
1299 msg_print("You are cured of all mutations.");
1302 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
1303 p_ptr->update |= PU_BONUS;
1305 mutant_regenerate_mod = calc_mutant_regenerate_mod();
1311 case SV_POTION_NEO_TSUYOSHI:
1314 (void)set_tsuyoshi(p_ptr->tsuyoshi + randint(100) + 100, FALSE);
1319 case SV_POTION_TSUYOSHI:
1322 msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
1324 msg_print("Brother OKURE!");
1327 p_ptr->tsuyoshi = 1;
1328 (void)set_tsuyoshi(0, TRUE);
1329 if (!p_ptr->resist_chaos)
1331 (void)set_image(50 + randint(50));
1337 case SV_POTION_POLYMORPH:
1339 if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23))
1341 chg_virtue(V_CHANCE, -5);
1343 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
1345 msg_print("You are cured of all mutations.");
1348 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
1349 p_ptr->update |= PU_BONUS;
1358 if(gain_random_mutation(0)) ident = TRUE;
1360 else if (lose_mutation(0)) ident = TRUE;
1361 } while(!ident || one_in_(2));
1367 if (p_ptr->prace == RACE_SKELETON)
1370 msg_print("±ÕÂΤΰìÉô¤Ï¤¢¤Ê¤¿¤Î¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¤¿¡ª");
1372 msg_print("Some of the fluid falls through your jaws!");
1375 (void)potion_smash_effect(0, py, px, q_ptr->k_idx);
1378 /* Combine / Reorder the pack (later) */
1379 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1381 if (!(object_aware_p(o_ptr)))
1383 chg_virtue(V_PATIENCE, -1);
1384 chg_virtue(V_CHANCE, 1);
1385 chg_virtue(V_KNOWLEDGE, -1);
1388 /* The item has been tried */
1389 object_tried(q_ptr);
1391 /* An identification was made */
1392 if (ident && !object_aware_p(q_ptr))
1394 object_aware(q_ptr);
1395 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
1399 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
1401 /* Potions can feed the player */
1402 switch (p_ptr->mimic_form)
1405 switch (p_ptr->prace)
1408 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
1419 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1422 (void)set_food(p_ptr->food + o_ptr->pval);
1427 case MIMIC_DEMON_LORD:
1428 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1431 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
1434 (void)set_food(p_ptr->food + o_ptr->pval);
1440 void do_cmd_quaff_potion(void)
1445 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
1447 set_action(ACTION_NONE);
1450 /* Restrict choices to potions */
1451 item_tester_tval = TV_POTION;
1455 q = "¤É¤ÎÌô¤ò°û¤ß¤Þ¤¹¤«? ";
1456 s = "°û¤á¤ëÌô¤¬¤Ê¤¤¡£";
1458 q = "Quaff which potion? ";
1459 s = "You have no potions to quaff.";
1462 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1464 /* Quaff the potion */
1465 do_cmd_quaff_potion_aux(item);
1470 * Read a scroll (from the pack or floor).
1472 * Certain scrolls can be "aborted" without losing the scroll. These
1473 * include scrolls with no effects but recharge or identify, which are
1474 * cancelled before use. XXX Reading them still takes a turn, though.
1476 static void do_cmd_read_scroll_aux(int item)
1478 int k, used_up, ident, lev;
1483 /* Get the item (in the pack) */
1486 o_ptr = &inventory[item];
1489 /* Get the item (on the floor) */
1492 o_ptr = &o_list[0 - item];
1501 if (flush_failure) flush();
1503 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
1505 msg_print("Nothing happen.");
1512 if (p_ptr->pclass == CLASS_BERSERKER)
1515 msg_print("´¬Êª¤Ê¤ó¤ÆÆɤá¤Ê¤¤¡£");
1517 msg_print("You cannot read.");
1522 if((p_ptr->pclass == CLASS_BARD) && p_ptr->magic_num1[0])
1527 /* Not identified yet */
1531 lev = get_object_level(o_ptr);
1533 /* Assume the scroll will get used up */
1536 if (o_ptr->tval == TV_SCROLL)
1538 /* Analyze the scroll */
1539 switch (o_ptr->sval)
1541 case SV_SCROLL_DARKNESS:
1543 if (!(p_ptr->resist_blind) && !(p_ptr->resist_dark))
1545 (void)set_blind(p_ptr->blind + 3 + randint(5));
1547 if (unlite_area(10, 3)) ident = TRUE;
1551 case SV_SCROLL_AGGRAVATE_MONSTER:
1554 msg_print("¥«¥ó¹â¤¯¤¦¤Ê¤ëÍͤʲ»¤¬ÊÕ¤ê¤òʤ¤Ã¤¿¡£");
1556 msg_print("There is a high pitched humming noise.");
1559 aggravate_monsters(0);
1564 case SV_SCROLL_CURSE_ARMOR:
1566 if (curse_armor()) ident = TRUE;
1570 case SV_SCROLL_CURSE_WEAPON:
1572 if (curse_weapon(FALSE, INVEN_RARM)) ident = TRUE;
1576 case SV_SCROLL_SUMMON_MONSTER:
1578 for (k = 0; k < randint(3); k++)
1580 if (summon_specific(0, py, px, dun_level, 0, TRUE, FALSE, FALSE, TRUE, TRUE))
1588 case SV_SCROLL_SUMMON_UNDEAD:
1590 for (k = 0; k < randint(3); k++)
1592 if (summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, TRUE, FALSE, FALSE, TRUE, TRUE))
1600 case SV_SCROLL_SUMMON_PET:
1602 if (summon_specific(-1, py, px, dun_level, 0, TRUE, TRUE, TRUE, FALSE, FALSE))
1609 case SV_SCROLL_SUMMON_KIN:
1611 if (summon_kin_player(TRUE, p_ptr->lev, py, px, TRUE))
1618 case SV_SCROLL_TRAP_CREATION:
1620 if (trap_creation(py, px)) ident = TRUE;
1624 case SV_SCROLL_PHASE_DOOR:
1626 teleport_player(10);
1631 case SV_SCROLL_TELEPORT:
1633 teleport_player(100);
1638 case SV_SCROLL_TELEPORT_LEVEL:
1640 (void)teleport_player_level();
1645 case SV_SCROLL_WORD_OF_RECALL:
1647 if (!word_of_recall()) used_up = FALSE;
1652 case SV_SCROLL_IDENTIFY:
1655 if (!ident_spell(FALSE)) used_up = FALSE;
1659 case SV_SCROLL_STAR_IDENTIFY:
1662 if (!identify_fully(FALSE)) used_up = FALSE;
1666 case SV_SCROLL_REMOVE_CURSE:
1671 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1673 msg_print("You feel as if someone is watching over you.");
1681 case SV_SCROLL_STAR_REMOVE_CURSE:
1683 if (remove_all_curse())
1686 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1688 msg_print("You feel as if someone is watching over you.");
1695 case SV_SCROLL_ENCHANT_ARMOR:
1698 if (!enchant_spell(0, 0, 1)) used_up = FALSE;
1702 case SV_SCROLL_ENCHANT_WEAPON_TO_HIT:
1704 if (!enchant_spell(1, 0, 0)) used_up = FALSE;
1709 case SV_SCROLL_ENCHANT_WEAPON_TO_DAM:
1711 if (!enchant_spell(0, 1, 0)) used_up = FALSE;
1716 case SV_SCROLL_STAR_ENCHANT_ARMOR:
1718 if (!enchant_spell(0, 0, randint(3) + 2)) used_up = FALSE;
1723 case SV_SCROLL_STAR_ENCHANT_WEAPON:
1725 if (!enchant_spell(randint(3), randint(3), 0)) used_up = FALSE;
1730 case SV_SCROLL_RECHARGING:
1732 if (!recharge(130)) used_up = FALSE;
1737 case SV_SCROLL_MUNDANITY:
1740 if (!mundane_spell(FALSE)) used_up = FALSE;
1744 case SV_SCROLL_LIGHT:
1746 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
1750 case SV_SCROLL_MAPPING:
1752 map_area(DETECT_RAD_MAP);
1757 case SV_SCROLL_DETECT_GOLD:
1759 if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
1760 if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
1764 case SV_SCROLL_DETECT_ITEM:
1766 if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
1770 case SV_SCROLL_DETECT_TRAP:
1772 if (detect_traps(DETECT_RAD_DEFAULT)) ident = TRUE;
1776 case SV_SCROLL_DETECT_DOOR:
1778 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
1779 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
1783 case SV_SCROLL_DETECT_INVIS:
1785 if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
1789 case SV_SCROLL_SATISFY_HUNGER:
1791 if (set_food(PY_FOOD_MAX - 1)) ident = TRUE;
1795 case SV_SCROLL_BLESSING:
1797 if (set_blessed(p_ptr->blessed + randint(12) + 6, FALSE)) ident = TRUE;
1801 case SV_SCROLL_HOLY_CHANT:
1803 if (set_blessed(p_ptr->blessed + randint(24) + 12, FALSE)) ident = TRUE;
1807 case SV_SCROLL_HOLY_PRAYER:
1809 if (set_blessed(p_ptr->blessed + randint(48) + 24, FALSE)) ident = TRUE;
1813 case SV_SCROLL_MONSTER_CONFUSION:
1815 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1818 msg_print("¼ê¤¬µ±¤»Ï¤á¤¿¡£");
1820 msg_print("Your hands begin to glow.");
1823 p_ptr->special_attack |= ATTACK_CONFUSE;
1824 p_ptr->redraw |= (PR_STATUS);
1830 case SV_SCROLL_PROTECTION_FROM_EVIL:
1833 if (set_protevil(p_ptr->protevil + randint(25) + k, FALSE)) ident = TRUE;
1837 case SV_SCROLL_RUNE_OF_PROTECTION:
1844 case SV_SCROLL_TRAP_DOOR_DESTRUCTION:
1846 if (destroy_doors_touch()) ident = TRUE;
1850 case SV_SCROLL_STAR_DESTRUCTION:
1852 if (destroy_area(py, px, 13+rand_int(5), TRUE))
1856 msg_print("¥À¥ó¥¸¥ç¥ó¤¬Íɤ줿...");
1858 msg_print("The dungeon trembles...");
1865 case SV_SCROLL_DISPEL_UNDEAD:
1867 if (dispel_undead(80)) ident = TRUE;
1871 case SV_SCROLL_SPELL:
1873 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;
1874 p_ptr->add_spells++;
1875 p_ptr->update |= (PU_SPELLS);
1880 case SV_SCROLL_GENOCIDE:
1882 (void)symbol_genocide(300, TRUE);
1887 case SV_SCROLL_MASS_GENOCIDE:
1889 (void)mass_genocide(300, TRUE);
1894 case SV_SCROLL_ACQUIREMENT:
1896 acquirement(py, px, 1, TRUE, FALSE);
1901 case SV_SCROLL_STAR_ACQUIREMENT:
1903 acquirement(py, px, randint(2) + 1, TRUE, FALSE);
1908 /* New Hengband scrolls */
1909 case SV_SCROLL_FIRE:
1911 fire_ball(GF_FIRE, 0, 666, 4);
1912 /* Note: "Double" damage since it is centered on the player ... */
1913 if (!(p_ptr->oppose_fire || p_ptr->resist_fire || p_ptr->immune_fire))
1915 take_hit(DAMAGE_NOESCAPE, 50+randint(50), "±ê¤Î´¬Êª", -1);
1917 take_hit(DAMAGE_NOESCAPE, 50 + randint(50), "a Scroll of Fire", -1);
1927 fire_ball(GF_ICE, 0, 777, 4);
1928 if (!(p_ptr->oppose_cold || p_ptr->resist_cold || p_ptr->immune_cold))
1930 take_hit(DAMAGE_NOESCAPE, 100+randint(100), "ɹ¤Î´¬Êª", -1);
1932 take_hit(DAMAGE_NOESCAPE, 100 + randint(100), "a Scroll of Ice", -1);
1939 case SV_SCROLL_CHAOS:
1941 fire_ball(GF_CHAOS, 0, 1000, 4);
1942 if (!p_ptr->resist_chaos)
1944 take_hit(DAMAGE_NOESCAPE, 111+randint(111), "¥í¥°¥ë¥¹¤Î´¬Êª", -1);
1946 take_hit(DAMAGE_NOESCAPE, 111 + randint(111), "a Scroll of Logrus", -1);
1953 case SV_SCROLL_RUMOR:
1957 switch (randint(20))
1961 err = get_rnd_line("chainswd_j.txt", 0, Rumor);
1963 err = get_rnd_line("chainswd.txt", 0, Rumor);
1969 err = get_rnd_line("error_j.txt", 0, Rumor);
1971 err = get_rnd_line("error.txt", 0, Rumor);
1979 err = get_rnd_line("death_j.txt", 0, Rumor);
1981 err = get_rnd_line("death.txt", 0, Rumor);
1987 err = get_rnd_line_jonly("rumors_j.txt", 0, Rumor, 10);
1989 err = get_rnd_line("rumors.txt", 0, Rumor);
1995 /* An error occured */
1997 if (err) strcpy(Rumor, "±³¤Î±½¤â¤¢¤ë¡£");
1999 if (err) strcpy(Rumor, "Some rumors are wrong.");
2004 msg_print("´¬Êª¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤¬½ñ¤«¤ì¤Æ¤¤¤ë:");
2006 msg_print("There is message on the scroll. It says:");
2010 msg_format("%s", Rumor);
2013 msg_print("´¬Êª¤Ï±ì¤òΩ¤Æ¤Æ¾Ã¤¨µî¤Ã¤¿¡ª");
2015 msg_print("The scroll disappears in a puff of smoke!");
2022 case SV_SCROLL_ARTIFACT:
2025 if (!artifact_scroll()) used_up = FALSE;
2029 case SV_SCROLL_RESET_RECALL:
2032 if (!reset_recall()) used_up = FALSE;
2037 else if (o_ptr->tval == TV_SOFT_ARMOR)
2040 msg_print("»ä¤Ï¶ìÏ«¤·¤Æ¡Ø¥°¥ì¡¼¥¿¡¼¡¦¥Ø¥ë=¥Ó¡¼¥¹¥È¡Ù¤òÅݤ·¤¿¡£");
2041 msg_print("¤·¤«¤·¼ê¤ËÆþ¤Ã¤¿¤Î¤Ï¤³¤Î¤¤¿¤Ê¤¤£Ô¥·¥ã¥Ä¤À¤±¤À¤Ã¤¿¡£");
2043 msg_print("I had a very hard time to kill the Greater hell-beast, ");
2044 msg_print("but all I got was this lousy t-shirt!");
2048 else if (o_ptr->name1 == ART_POWER)
2051 msg_print("¡Ö°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤òÅý¤Ù¡¢");
2053 msg_print("°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤ò¸«¤Ä¤±¡¢");
2055 msg_print("°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤òÊá¤é¤¨¤Æ");
2057 msg_print("°Å°Ç¤ÎÃæ¤Ë·Ò¤®¤È¤á¤ë¡£¡×");
2059 msg_print("'One Ring to rule them all, ");
2061 msg_print("One Ring to find them, ");
2063 msg_print("One Ring to bring them all ");
2065 msg_print("and in the darkness bind them.'");
2072 char o_name[MAX_NLEN];
2078 q=format("book-%d_jp.txt",o_ptr->sval);
2080 /* Display object description */
2081 object_desc(o_name, o_ptr, TRUE, 0);
2083 /* Build the filename */
2084 path_build(buf, 1024, ANGBAND_DIR_FILE, q);
2086 /* Peruse the help file */
2087 (void)show_file(TRUE, buf, o_name, 0, 0);
2096 /* Combine / Reorder the pack (later) */
2097 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2099 if (!(object_aware_p(o_ptr)))
2101 chg_virtue(V_PATIENCE, -1);
2102 chg_virtue(V_CHANCE, 1);
2103 chg_virtue(V_KNOWLEDGE, -1);
2106 /* The item was tried */
2107 object_tried(o_ptr);
2109 /* An identification was made */
2110 if (ident && !object_aware_p(o_ptr))
2112 object_aware(o_ptr);
2113 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
2117 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
2120 /* Hack -- allow certain scrolls to be "preserved" */
2126 sound(SOUND_SCROLL);
2128 /* Destroy a scroll in the pack */
2131 inven_item_increase(item, -1);
2132 inven_item_describe(item);
2133 inven_item_optimize(item);
2136 /* Destroy a scroll on the floor */
2139 floor_item_increase(0 - item, -1);
2140 floor_item_describe(0 - item);
2141 floor_item_optimize(0 - item);
2144 /* Can save again */
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->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_T_SHIRT)) || (o_ptr->name1 == ART_POWER)) return (TRUE);
2160 void do_cmd_read_scroll(void)
2165 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
2167 set_action(ACTION_NONE);
2170 /* Check some conditions */
2174 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡£");
2176 msg_print("You can't see anything.");
2184 msg_print("ÌÀ¤«¤ê¤¬¤Ê¤¤¤Î¤Ç¡¢°Å¤¯¤ÆÆɤá¤Ê¤¤¡£");
2186 msg_print("You have no light to read by.");
2191 if (p_ptr->confused)
2194 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡£");
2196 msg_print("You are too confused!");
2203 /* Restrict choices to scrolls */
2204 item_tester_hook = item_tester_hook_readable;
2208 q = "¤É¤Î´¬Êª¤òÆɤߤޤ¹¤«? ";
2209 s = "Æɤá¤ë´¬Êª¤¬¤Ê¤¤¡£";
2211 q = "Read which scroll? ";
2212 s = "You have no scrolls to read.";
2215 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
2217 /* Read the scroll */
2218 do_cmd_read_scroll_aux(item);
2222 static int staff_effect(int sval, bool *use_charge, bool magic)
2227 /* Analyze the staff */
2230 case SV_STAFF_DARKNESS:
2232 if (!(p_ptr->resist_blind) && !(p_ptr->resist_dark))
2234 if (set_blind(p_ptr->blind + 3 + randint(5))) ident = TRUE;
2236 if (unlite_area(10, 3)) ident = TRUE;
2240 case SV_STAFF_SLOWNESS:
2242 if (set_slow(p_ptr->slow + randint(30) + 15, FALSE)) ident = TRUE;
2246 case SV_STAFF_HASTE_MONSTERS:
2248 if (speed_monsters()) ident = TRUE;
2252 case SV_STAFF_SUMMONING:
2254 for (k = 0; k < randint(4); k++)
2256 if (summon_specific(0, py, px, dun_level, 0, TRUE, FALSE, FALSE, TRUE, TRUE))
2264 case SV_STAFF_TELEPORTATION:
2266 teleport_player(100);
2271 case SV_STAFF_IDENTIFY:
2273 if (!ident_spell(FALSE)) *use_charge = FALSE;
2278 case SV_STAFF_REMOVE_CURSE:
2285 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2287 msg_print("You feel as if someone is watching over you.");
2290 else if (!p_ptr->blind)
2293 msg_print("¾ó¤Ï°ì½Ö¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
2295 msg_print("The staff glows blue for a moment...");
2304 case SV_STAFF_STARLITE:
2306 int num = damroll(5, 3);
2310 if (!p_ptr->blind && !magic)
2313 msg_print("¾ó¤ÎÀ褬ÌÀ¤ë¤¯µ±¤¤¤¿...");
2315 msg_print("The end of the staff glows brightly...");
2319 for (k = 0; k < num; k++)
2325 scatter(&y, &x, py, px, 4, 0);
2327 if (!cave_floor_bold(y, x)) continue;
2329 if ((y != py) || (x != px)) break;
2332 project(0, 0, y, x, damroll(6 + p_ptr->lev / 8, 10), GF_LITE_WEAK,
2333 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL), -1);
2341 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
2345 case SV_STAFF_MAPPING:
2347 map_area(DETECT_RAD_MAP);
2352 case SV_STAFF_DETECT_GOLD:
2354 if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
2355 if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
2359 case SV_STAFF_DETECT_ITEM:
2361 if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
2365 case SV_STAFF_DETECT_TRAP:
2367 if (detect_traps(DETECT_RAD_DEFAULT)) ident = TRUE;
2371 case SV_STAFF_DETECT_DOOR:
2373 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
2374 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
2378 case SV_STAFF_DETECT_INVIS:
2380 if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
2384 case SV_STAFF_DETECT_EVIL:
2386 if (detect_monsters_evil(DETECT_RAD_DEFAULT)) ident = TRUE;
2390 case SV_STAFF_CURE_LIGHT:
2392 if (hp_player(damroll(2, 8))) ident = TRUE;
2393 if (set_shero(0,TRUE)) ident = TRUE;
2397 case SV_STAFF_CURING:
2399 if (set_blind(0)) ident = TRUE;
2400 if (set_poisoned(0)) ident = TRUE;
2401 if (set_confused(0)) ident = TRUE;
2402 if (set_stun(0)) ident = TRUE;
2403 if (set_cut(0)) ident = TRUE;
2404 if (set_image(0)) ident = TRUE;
2405 if (set_shero(0,TRUE)) ident = TRUE;
2409 case SV_STAFF_HEALING:
2411 if (hp_player(300)) ident = TRUE;
2412 if (set_stun(0)) ident = TRUE;
2413 if (set_cut(0)) ident = TRUE;
2414 if (set_shero(0,TRUE)) ident = TRUE;
2418 case SV_STAFF_THE_MAGI:
2420 if (do_res_stat(A_INT)) ident = TRUE;
2421 if (p_ptr->csp < p_ptr->msp)
2423 p_ptr->csp = p_ptr->msp;
2424 p_ptr->csp_frac = 0;
2427 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
2429 msg_print("Your feel your head clear.");
2432 p_ptr->redraw |= (PR_MANA);
2433 p_ptr->window |= (PW_PLAYER);
2434 p_ptr->window |= (PW_SPELL);
2436 if (set_shero(0,TRUE)) ident = TRUE;
2440 case SV_STAFF_SLEEP_MONSTERS:
2442 if (sleep_monsters()) ident = TRUE;
2446 case SV_STAFF_SLOW_MONSTERS:
2448 if (slow_monsters()) ident = TRUE;
2452 case SV_STAFF_SPEED:
2454 if (set_fast(randint(30) + 15, FALSE)) ident = TRUE;
2458 case SV_STAFF_PROBING:
2465 case SV_STAFF_DISPEL_EVIL:
2467 if (dispel_evil(80)) ident = TRUE;
2471 case SV_STAFF_POWER:
2473 if (dispel_monsters(150)) ident = TRUE;
2477 case SV_STAFF_HOLINESS:
2479 if (dispel_evil(150)) ident = TRUE;
2481 if (set_protevil((magic ? 0 : p_ptr->protevil) + randint(25) + k, FALSE)) ident = TRUE;
2482 if (set_poisoned(0)) ident = TRUE;
2483 if (set_afraid(0)) ident = TRUE;
2484 if (hp_player(50)) ident = TRUE;
2485 if (set_stun(0)) ident = TRUE;
2486 if (set_cut(0)) ident = TRUE;
2490 case SV_STAFF_GENOCIDE:
2492 (void)symbol_genocide((magic ? p_ptr->lev + 50 : 200), TRUE);
2497 case SV_STAFF_EARTHQUAKES:
2499 if (earthquake(py, px, 10))
2503 msg_print("¥À¥ó¥¸¥ç¥ó¤¬Íɤ줿¡£");
2505 msg_print("The dungeon trembles.");
2512 case SV_STAFF_DESTRUCTION:
2514 if (destroy_area(py, px, 13+rand_int(5), TRUE))
2520 case SV_STAFF_ANIMATE_DEAD:
2522 if (animate_dead(0, py, px))
2528 case SV_STAFF_MSTORM:
2531 msg_print("¶¯ÎϤÊËâÎϤ¬Å¨¤ò°ú¤Îö¤¤¤¿¡ª");
2533 msg_print("Mighty magics rend your enemies!");
2535 project(0, 5, py, px,
2536 (randint(200) + 300) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID | PROJECT_NO_REF, -1);
2537 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))
2540 (void)take_hit(DAMAGE_NOESCAPE, 50, "¥³¥ó¥È¥í¡¼¥ë¤·Æñ¤¤¶¯ÎϤÊËâÎϤβòÊü", -1);
2542 (void)take_hit(DAMAGE_NOESCAPE, 50, "unleashing magics too mighty to control", -1);
2554 * Use a staff. -RAK-
2556 * One charge of one staff disappears.
2558 * Hack -- staffs of identify can be "cancelled".
2560 static void do_cmd_use_staff_aux(int item)
2562 int ident, chance, lev;
2566 /* Hack -- let staffs of identify get aborted */
2567 bool use_charge = TRUE;
2570 /* Get the item (in the pack) */
2573 o_ptr = &inventory[item];
2576 /* Get the item (on the floor) */
2579 o_ptr = &o_list[0 - item];
2583 /* Mega-Hack -- refuse to use a pile from the ground */
2584 if ((item < 0) && (o_ptr->number > 1))
2587 msg_print("¤Þ¤º¤Ï¾ó¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
2589 msg_print("You must first pick up the staffs.");
2599 /* Extract the item level */
2600 lev = get_object_level(o_ptr);
2601 if (lev > 50) lev = 50 + (lev - 50)/2;
2603 /* Base chance of success */
2604 chance = p_ptr->skill_dev;
2606 /* Confusion hurts skill */
2607 if (p_ptr->confused) chance = chance / 2;
2609 /* Hight level objects are harder */
2610 chance = chance - lev;
2612 /* Give everyone a (slight) chance */
2613 if ((chance < USE_DEVICE) && (rand_int(USE_DEVICE - chance + 1) == 0))
2615 chance = USE_DEVICE;
2620 if (flush_failure) flush();
2622 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
2624 msg_print("Nothing happen. Maybe this staff is freezing too.");
2631 /* Roll for usage */
2632 if ((chance < USE_DEVICE) || (randint(chance) < USE_DEVICE) || (p_ptr->pclass == CLASS_BERSERKER))
2634 if (flush_failure) flush();
2636 msg_print("¾ó¤ò¤¦¤Þ¤¯»È¤¨¤Ê¤«¤Ã¤¿¡£");
2638 msg_print("You failed to use the staff properly.");
2645 /* Notice empty staffs */
2646 if (o_ptr->pval <= 0)
2648 if (flush_failure) flush();
2650 msg_print("¤³¤Î¾ó¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£");
2652 msg_print("The staff has no charges left.");
2655 o_ptr->ident |= (IDENT_EMPTY);
2657 /* Combine / Reorder the pack (later) */
2658 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2667 ident = staff_effect(o_ptr->sval, &use_charge, FALSE);
2669 if (!(object_aware_p(o_ptr)))
2671 chg_virtue(V_PATIENCE, -1);
2672 chg_virtue(V_CHANCE, 1);
2673 chg_virtue(V_KNOWLEDGE, -1);
2676 /* Combine / Reorder the pack (later) */
2677 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2679 /* Tried the item */
2680 object_tried(o_ptr);
2682 /* An identification was made */
2683 if (ident && !object_aware_p(o_ptr))
2685 object_aware(o_ptr);
2686 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
2690 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
2693 /* Hack -- some uses are "free" */
2694 if (!use_charge) return;
2697 /* Use a single charge */
2700 /* XXX Hack -- unstack if necessary */
2701 if ((item >= 0) && (o_ptr->number > 1))
2706 /* Get local object */
2709 /* Obtain a local object */
2710 object_copy(q_ptr, o_ptr);
2712 /* Modify quantity */
2715 /* Restore the charges */
2718 /* Unstack the used item */
2720 p_ptr->total_weight -= q_ptr->weight;
2721 item = inven_carry(q_ptr);
2725 msg_print("¾ó¤ò¤Þ¤È¤á¤Ê¤ª¤·¤¿¡£");
2727 msg_print("You unstack your staff.");
2732 /* Describe charges in the pack */
2735 inven_item_charges(item);
2738 /* Describe charges on the floor */
2741 floor_item_charges(0 - item);
2746 void do_cmd_use_staff(void)
2751 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
2753 set_action(ACTION_NONE);
2756 /* Restrict choices to wands */
2757 item_tester_tval = TV_STAFF;
2761 q = "¤É¤Î¾ó¤ò»È¤¤¤Þ¤¹¤«? ";
2762 s = "»È¤¨¤ë¾ó¤¬¤Ê¤¤¡£";
2764 q = "Use which staff? ";
2765 s = "You have no staff to use.";
2768 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
2770 do_cmd_use_staff_aux(item);
2774 static int wand_effect(int sval, int dir, bool magic)
2778 /* XXX Hack -- Wand of wonder can do anything before it */
2779 if (sval == SV_WAND_WONDER)
2781 int vir = virtue_number(V_CHANCE);
2782 sval = rand_int(SV_WAND_WONDER);
2786 if (p_ptr->virtues[vir - 1] > 0)
2788 while (randint(300) < p_ptr->virtues[vir - 1]) sval++;
2789 if (sval > SV_WAND_COLD_BALL) sval = rand_int(4) + SV_WAND_ACID_BALL;
2793 while (randint(300) < (0-p_ptr->virtues[vir - 1])) sval--;
2794 if (sval < SV_WAND_HEAL_MONSTER) sval = rand_int(3) + SV_WAND_HEAL_MONSTER;
2797 if (sval < SV_WAND_TELEPORT_AWAY)
2798 chg_virtue(V_CHANCE, 1);
2801 /* Analyze the wand */
2804 case SV_WAND_HEAL_MONSTER:
2806 if (heal_monster(dir, damroll(10, 10))) ident = TRUE;
2810 case SV_WAND_HASTE_MONSTER:
2812 if (speed_monster(dir)) ident = TRUE;
2816 case SV_WAND_CLONE_MONSTER:
2818 if (clone_monster(dir)) ident = TRUE;
2822 case SV_WAND_TELEPORT_AWAY:
2824 if (teleport_monster(dir)) ident = TRUE;
2828 case SV_WAND_DISARMING:
2830 if (disarm_trap(dir)) ident = TRUE;
2834 case SV_WAND_TRAP_DOOR_DEST:
2836 if (destroy_door(dir)) ident = TRUE;
2840 case SV_WAND_STONE_TO_MUD:
2842 if (wall_to_mud(dir)) ident = TRUE;
2849 msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
2851 msg_print("A line of blue shimmering light appears.");
2854 (void)lite_line(dir);
2859 case SV_WAND_SLEEP_MONSTER:
2861 if (sleep_monster(dir)) ident = TRUE;
2865 case SV_WAND_SLOW_MONSTER:
2867 if (slow_monster(dir)) ident = TRUE;
2871 case SV_WAND_CONFUSE_MONSTER:
2873 if (confuse_monster(dir, p_ptr->lev)) ident = TRUE;
2877 case SV_WAND_FEAR_MONSTER:
2879 if (fear_monster(dir, p_ptr->lev)) ident = TRUE;
2883 case SV_WAND_DRAIN_LIFE:
2885 if (drain_life(dir, 80 + p_ptr->lev)) ident = TRUE;
2889 case SV_WAND_POLYMORPH:
2891 if (poly_monster(dir)) ident = TRUE;
2895 case SV_WAND_STINKING_CLOUD:
2897 fire_ball(GF_POIS, dir, 12 + p_ptr->lev / 4, 2);
2902 case SV_WAND_MAGIC_MISSILE:
2904 fire_bolt_or_beam(20, GF_MISSILE, dir, damroll(2 + p_ptr->lev / 10, 6));
2909 case SV_WAND_ACID_BOLT:
2911 fire_bolt_or_beam(20, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
2916 case SV_WAND_CHARM_MONSTER:
2918 if (charm_monster(dir, MAX(20, p_ptr->lev)))
2923 case SV_WAND_FIRE_BOLT:
2925 fire_bolt_or_beam(20, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
2930 case SV_WAND_COLD_BOLT:
2932 fire_bolt_or_beam(20, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
2937 case SV_WAND_ACID_BALL:
2939 fire_ball(GF_ACID, dir, 60 + 3 * p_ptr->lev / 4, 2);
2944 case SV_WAND_ELEC_BALL:
2946 fire_ball(GF_ELEC, dir, 40 + 3 * p_ptr->lev / 4, 2);
2951 case SV_WAND_FIRE_BALL:
2953 fire_ball(GF_FIRE, dir, 70 + 3 * p_ptr->lev / 4, 2);
2958 case SV_WAND_COLD_BALL:
2960 fire_ball(GF_COLD, dir, 50 + 3 * p_ptr->lev / 4, 2);
2965 case SV_WAND_WONDER:
2968 msg_print("¤ª¤Ã¤È¡¢Ææ¤ÎËâË¡ËÀ¤ò»ÏÆ°¤µ¤»¤¿¡£");
2970 msg_print("Oops. Wand of wonder activated.");
2976 case SV_WAND_DRAGON_FIRE:
2978 fire_ball(GF_FIRE, dir, 200, -3);
2983 case SV_WAND_DRAGON_COLD:
2985 fire_ball(GF_COLD, dir, 180, -3);
2990 case SV_WAND_DRAGON_BREATH:
2996 fire_ball(GF_ACID, dir, 240, -3);
3002 fire_ball(GF_ELEC, dir, 210, -3);
3008 fire_ball(GF_FIRE, dir, 240, -3);
3014 fire_ball(GF_COLD, dir, 210, -3);
3020 fire_ball(GF_POIS, dir, 180, -3);
3029 case SV_WAND_DISINTEGRATE:
3031 fire_ball(GF_DISINTEGRATE, dir, 200 + randint(p_ptr->lev * 2), 2);
3036 case SV_WAND_ROCKETS:
3039 msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡ª");
3041 msg_print("You launch a rocket!");
3044 fire_rocket(GF_ROCKET, dir, 250 + p_ptr->lev * 3, 2);
3049 case SV_WAND_STRIKING:
3051 fire_bolt(GF_METEOR, dir, damroll(15 + p_ptr->lev / 3, 13));
3056 case SV_WAND_GENOCIDE:
3058 fire_ball_hide(GF_GENOCIDE, dir, magic ? p_ptr->lev + 50 : 250, 0);
3068 * Aim a wand (from the pack or floor).
3070 * Use a single charge from a single item.
3071 * Handle "unstacking" in a logical manner.
3073 * For simplicity, you cannot use a stack of items from the
3074 * ground. This would require too much nasty code.
3076 * There are no wands which can "destroy" themselves, in the inventory
3077 * or on the ground, so we can ignore this possibility. Note that this
3078 * required giving "wand of wonder" the ability to ignore destruction
3079 * by electric balls.
3081 * All wands can be "cancelled" at the "Direction?" prompt for free.
3083 * Note that the basic "bolt" wands do slightly less damage than the
3084 * basic "bolt" rods, but the basic "ball" wands do the same damage
3085 * as the basic "ball" rods.
3087 static void do_cmd_aim_wand_aux(int item)
3089 int lev, ident, chance, dir;
3091 bool old_target_pet = target_pet;
3093 /* Get the item (in the pack) */
3096 o_ptr = &inventory[item];
3099 /* Get the item (on the floor) */
3102 o_ptr = &o_list[0 - item];
3105 /* Mega-Hack -- refuse to aim a pile from the ground */
3106 if ((item < 0) && (o_ptr->number > 1))
3109 msg_print("¤Þ¤º¤ÏËâË¡ËÀ¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
3111 msg_print("You must first pick up the wands.");
3118 /* Allow direction to be cancelled for free */
3119 if (object_aware_p(o_ptr) && (o_ptr->sval == SV_WAND_HEAL_MONSTER
3120 || o_ptr->sval == SV_WAND_HASTE_MONSTER))
3122 if (!get_aim_dir(&dir))
3124 target_pet = old_target_pet;
3127 target_pet = old_target_pet;
3133 lev = get_object_level(o_ptr);
3134 if (lev > 50) lev = 50 + (lev - 50)/2;
3136 /* Base chance of success */
3137 chance = p_ptr->skill_dev;
3139 /* Confusion hurts skill */
3140 if (p_ptr->confused) chance = chance / 2;
3142 /* Hight level objects are harder */
3143 chance = chance - lev;
3145 /* Give everyone a (slight) chance */
3146 if ((chance < USE_DEVICE) && (rand_int(USE_DEVICE - chance + 1) == 0))
3148 chance = USE_DEVICE;
3153 if (flush_failure) flush();
3155 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3157 msg_print("Nothing happen. Maybe this wand is freezing too.");
3164 /* Roll for usage */
3165 if ((chance < USE_DEVICE) || (randint(chance) < USE_DEVICE) || (p_ptr->pclass == CLASS_BERSERKER))
3167 if (flush_failure) flush();
3169 msg_print("ËâË¡ËÀ¤ò¤¦¤Þ¤¯»È¤¨¤Ê¤«¤Ã¤¿¡£");
3171 msg_print("You failed to use the wand properly.");
3178 /* The wand is already empty! */
3179 if (o_ptr->pval <= 0)
3181 if (flush_failure) flush();
3183 msg_print("¤³¤ÎËâË¡ËÀ¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£");
3185 msg_print("The wand has no charges left.");
3188 o_ptr->ident |= (IDENT_EMPTY);
3190 /* Combine / Reorder the pack (later) */
3191 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3199 ident = wand_effect(o_ptr->sval, dir, FALSE);
3201 /* Combine / Reorder the pack (later) */
3202 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3204 if (!(object_aware_p(o_ptr)))
3206 chg_virtue(V_PATIENCE, -1);
3207 chg_virtue(V_CHANCE, 1);
3208 chg_virtue(V_KNOWLEDGE, -1);
3211 /* Mark it as tried */
3212 object_tried(o_ptr);
3214 /* Apply identification */
3215 if (ident && !object_aware_p(o_ptr))
3217 object_aware(o_ptr);
3218 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
3222 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3225 /* Use a single charge */
3228 /* Describe the charges in the pack */
3231 inven_item_charges(item);
3234 /* Describe the charges on the floor */
3237 floor_item_charges(0 - item);
3242 void do_cmd_aim_wand(void)
3247 /* Restrict choices to wands */
3248 item_tester_tval = TV_WAND;
3250 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
3252 set_action(ACTION_NONE);
3257 q = "¤É¤ÎËâË¡ËÀ¤ÇÁÀ¤¤¤Þ¤¹¤«? ";
3258 s = "»È¤¨¤ëËâË¡ËÀ¤¬¤Ê¤¤¡£";
3260 q = "Aim which wand? ";
3261 s = "You have no wand to aim.";
3264 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
3267 do_cmd_aim_wand_aux(item);
3271 static int rod_effect(int sval, int dir, bool *use_charge, bool magic)
3275 /* Analyze the rod */
3278 case SV_ROD_DETECT_TRAP:
3280 if (detect_traps(DETECT_RAD_DEFAULT)) ident = TRUE;
3284 case SV_ROD_DETECT_DOOR:
3286 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
3287 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
3291 case SV_ROD_IDENTIFY:
3294 if (!ident_spell(FALSE)) *use_charge = FALSE;
3300 if (!word_of_recall()) *use_charge = FALSE;
3305 case SV_ROD_ILLUMINATION:
3307 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
3311 case SV_ROD_MAPPING:
3313 map_area(DETECT_RAD_MAP);
3318 case SV_ROD_DETECTION:
3320 detect_all(DETECT_RAD_DEFAULT);
3325 case SV_ROD_PROBING:
3334 if (set_blind(0)) ident = TRUE;
3335 if (set_poisoned(0)) ident = TRUE;
3336 if (set_confused(0)) ident = TRUE;
3337 if (set_stun(0)) ident = TRUE;
3338 if (set_cut(0)) ident = TRUE;
3339 if (set_image(0)) ident = TRUE;
3340 if (set_shero(0,TRUE)) ident = TRUE;
3344 case SV_ROD_HEALING:
3346 if (hp_player(500)) ident = TRUE;
3347 if (set_stun(0)) ident = TRUE;
3348 if (set_cut(0)) ident = TRUE;
3349 if (set_shero(0,TRUE)) ident = TRUE;
3353 case SV_ROD_RESTORATION:
3355 if (restore_level()) ident = TRUE;
3356 if (do_res_stat(A_STR)) ident = TRUE;
3357 if (do_res_stat(A_INT)) ident = TRUE;
3358 if (do_res_stat(A_WIS)) ident = TRUE;
3359 if (do_res_stat(A_DEX)) ident = TRUE;
3360 if (do_res_stat(A_CON)) ident = TRUE;
3361 if (do_res_stat(A_CHR)) ident = TRUE;
3367 if (set_fast(randint(30) + 15, FALSE)) ident = TRUE;
3371 case SV_ROD_PESTICIDE:
3373 if (dispel_monsters(4)) ident = TRUE;
3377 case SV_ROD_TELEPORT_AWAY:
3379 if (teleport_monster(dir)) ident = TRUE;
3383 case SV_ROD_DISARMING:
3385 if (disarm_trap(dir)) ident = TRUE;
3392 msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3394 msg_print("A line of blue shimmering light appears.");
3397 (void)lite_line(dir);
3402 case SV_ROD_SLEEP_MONSTER:
3404 if (sleep_monster(dir)) ident = TRUE;
3408 case SV_ROD_SLOW_MONSTER:
3410 if (slow_monster(dir)) ident = TRUE;
3414 case SV_ROD_DRAIN_LIFE:
3416 if (drain_life(dir, 70 + 3 * p_ptr->lev / 2)) ident = TRUE;
3420 case SV_ROD_POLYMORPH:
3422 if (poly_monster(dir)) ident = TRUE;
3426 case SV_ROD_ACID_BOLT:
3428 fire_bolt_or_beam(10, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
3433 case SV_ROD_ELEC_BOLT:
3435 fire_bolt_or_beam(10, GF_ELEC, dir, damroll(4 + p_ptr->lev / 9, 8));
3440 case SV_ROD_FIRE_BOLT:
3442 fire_bolt_or_beam(10, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
3447 case SV_ROD_COLD_BOLT:
3449 fire_bolt_or_beam(10, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
3454 case SV_ROD_ACID_BALL:
3456 fire_ball(GF_ACID, dir, 60 + p_ptr->lev, 2);
3461 case SV_ROD_ELEC_BALL:
3463 fire_ball(GF_ELEC, dir, 40 + p_ptr->lev, 2);
3468 case SV_ROD_FIRE_BALL:
3470 fire_ball(GF_FIRE, dir, 70 + p_ptr->lev, 2);
3475 case SV_ROD_COLD_BALL:
3477 fire_ball(GF_COLD, dir, 50 + p_ptr->lev, 2);
3489 case SV_ROD_STONE_TO_MUD:
3491 if (wall_to_mud(dir)) ident = TRUE;
3495 case SV_ROD_AGGRAVATE:
3497 aggravate_monsters(0);
3506 * Activate (zap) a Rod
3508 * Unstack fully charged rods as needed.
3510 * Hack -- rods of perception/genocide can be "cancelled"
3511 * All rods can be cancelled at the "Direction?" prompt
3513 * pvals are defined for each rod in k_info. -LM-
3515 static void do_cmd_zap_rod_aux(int item)
3517 int ident, chance, dir, lev, fail;
3521 /* Hack -- let perception get aborted */
3522 bool use_charge = TRUE;
3526 /* Get the item (in the pack) */
3529 o_ptr = &inventory[item];
3532 /* Get the item (on the floor) */
3535 o_ptr = &o_list[0 - item];
3539 /* Mega-Hack -- refuse to zap a pile from the ground */
3540 if ((item < 0) && (o_ptr->number > 1))
3543 msg_print("¤Þ¤º¤Ï¥í¥Ã¥É¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
3545 msg_print("You must first pick up the rods.");
3552 /* Get a direction (unless KNOWN not to need it) */
3553 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)) ||
3554 !object_aware_p(o_ptr))
3556 /* Get a direction, allow cancel */
3557 if (!get_aim_dir(&dir)) return;
3564 /* Extract the item level */
3565 lev = get_object_level(o_ptr);
3567 /* Base chance of success */
3568 chance = p_ptr->skill_dev;
3570 /* Confusion hurts skill */
3571 if (p_ptr->confused) chance = chance / 2;
3574 if (chance > fail) fail -= (chance - fail)*2;
3575 else chance -= (fail - chance)*2;
3576 if (fail < USE_DEVICE) fail = USE_DEVICE;
3577 if (chance < USE_DEVICE) chance = USE_DEVICE;
3581 if (flush_failure) flush();
3583 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3585 msg_print("Nothing happen. Maybe this rod is freezing too.");
3592 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
3593 else if (chance > fail)
3595 if (rand_int(chance*2) < fail) success = FALSE;
3596 else success = TRUE;
3600 if (rand_int(fail*2) < chance) success = TRUE;
3601 else success = FALSE;
3604 /* Roll for usage */
3607 if (flush_failure) flush();
3609 msg_print("¤¦¤Þ¤¯¥í¥Ã¥É¤ò»È¤¨¤Ê¤«¤Ã¤¿¡£");
3611 msg_print("You failed to use the rod properly.");
3618 k_ptr = &k_info[o_ptr->k_idx];
3620 /* A single rod is still charging */
3621 if ((o_ptr->number == 1) && (o_ptr->timeout))
3623 if (flush_failure) flush();
3625 msg_print("¤³¤Î¥í¥Ã¥É¤Ï¤Þ¤ÀËâÎϤò½¼Å¶¤·¤Æ¤¤¤ëºÇÃæ¤À¡£");
3627 msg_print("The rod is still charging.");
3632 /* A stack of rods lacks enough energy. */
3633 else if ((o_ptr->number > 1) && (o_ptr->timeout > k_ptr->pval * (o_ptr->number - 1)))
3635 if (flush_failure) flush();
3637 msg_print("¤½¤Î¥í¥Ã¥É¤Ï¤Þ¤À½¼Å¶Ãæ¤Ç¤¹¡£");
3639 msg_print("The rods are all still charging.");
3648 ident = rod_effect(o_ptr->sval, dir, &use_charge, FALSE);
3650 /* Increase the timeout by the rod kind's pval. -LM- */
3651 if (use_charge) o_ptr->timeout += k_ptr->pval;
3653 /* Combine / Reorder the pack (later) */
3654 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3656 if (!(object_aware_p(o_ptr)))
3658 chg_virtue(V_PATIENCE, -1);
3659 chg_virtue(V_CHANCE, 1);
3660 chg_virtue(V_KNOWLEDGE, -1);
3663 /* Tried the object */
3664 object_tried(o_ptr);
3666 /* Successfully determined the object function */
3667 if (ident && !object_aware_p(o_ptr))
3669 object_aware(o_ptr);
3670 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
3674 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3678 void do_cmd_zap_rod(void)
3683 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
3685 set_action(ACTION_NONE);
3688 /* Restrict choices to rods */
3689 item_tester_tval = TV_ROD;
3693 q = "¤É¤Î¥í¥Ã¥É¤ò¿¶¤ê¤Þ¤¹¤«? ";
3694 s = "»È¤¨¤ë¥í¥Ã¥É¤¬¤Ê¤¤¡£";
3696 q = "Zap which rod? ";
3697 s = "You have no rod to zap.";
3700 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
3703 do_cmd_zap_rod_aux(item);
3708 * Hook to determine if an object is activatable
3710 static bool item_tester_hook_activate(object_type *o_ptr)
3715 if (!object_known_p(o_ptr)) return (FALSE);
3717 /* Extract the flags */
3718 object_flags(o_ptr, &f1, &f2, &f3);
3720 /* Check activation flag */
3721 if (f3 & (TR3_ACTIVATE)) return (TRUE);
3723 if ((o_ptr->tval > TV_CAPTURE) && o_ptr->xtra3)
3725 switch(o_ptr->xtra3)
3726 case ESSENCE_TMP_RES_ACID:
3727 case ESSENCE_TMP_RES_ELEC:
3728 case ESSENCE_TMP_RES_FIRE:
3729 case ESSENCE_TMP_RES_COLD:
3730 case ESSENCE_EARTHQUAKE:
3740 * Hack -- activate the ring of power
3742 void ring_of_power(int dir)
3744 /* Pick a random effect */
3745 switch (randint(10))
3752 msg_print("¤¢¤Ê¤¿¤Ï°À¤Î¥ª¡¼¥é¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡£");
3754 msg_print("You are surrounded by a malignant aura.");
3759 /* Decrease all stats (permanently) */
3760 (void)dec_stat(A_STR, 50, TRUE);
3761 (void)dec_stat(A_INT, 50, TRUE);
3762 (void)dec_stat(A_WIS, 50, TRUE);
3763 (void)dec_stat(A_DEX, 50, TRUE);
3764 (void)dec_stat(A_CON, 50, TRUE);
3765 (void)dec_stat(A_CHR, 50, TRUE);
3767 /* Lose some experience (permanently) */
3768 p_ptr->exp -= (p_ptr->exp / 4);
3769 p_ptr->max_exp -= (p_ptr->exp / 4);
3779 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥª¡¼¥é¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡£");
3781 msg_print("You are surrounded by a powerful aura.");
3785 /* Dispel monsters */
3786 dispel_monsters(1000);
3796 fire_ball(GF_MANA, dir, 600, 3);
3807 fire_bolt(GF_MANA, dir, 500);
3815 static bool ang_sort_comp_pet(vptr u, vptr v, int a, int b)
3817 u16b *who = (u16b*)(u);
3822 monster_type *m_ptr1 = &m_list[w1];
3823 monster_type *m_ptr2 = &m_list[w2];
3824 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
3825 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
3827 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
3828 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
3830 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
3831 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
3833 if (r_ptr1->level > r_ptr2->level) return TRUE;
3834 if (r_ptr2->level > r_ptr1->level) return FALSE;
3836 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
3837 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
3843 * Activate a wielded object. Wielded objects never stack.
3844 * And even if they did, activatable objects never stack.
3846 * Currently, only (some) artifacts, and Dragon Scale Mail, can be activated.
3847 * But one could, for example, easily make an activatable "Ring of Plasma".
3849 * Note that it always takes a turn to activate an artifact, even if
3850 * the user hits "escape" at the "direction" prompt.
3852 static void do_cmd_activate_aux(int item)
3854 int k, dir, lev, chance, fail;
3859 /* Get the item (in the pack) */
3862 o_ptr = &inventory[item];
3865 /* Get the item (on the floor) */
3868 o_ptr = &o_list[0 - item];
3874 /* Extract the item level */
3875 lev = get_object_level(o_ptr);
3877 /* Hack -- use artifact level instead */
3878 if (artifact_p(o_ptr)) lev = a_info[o_ptr->name1].level;
3879 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
3881 /* Base chance of success */
3882 chance = p_ptr->skill_dev;
3884 /* Confusion hurts skill */
3885 if (p_ptr->confused) chance = chance / 2;
3888 if (chance > fail) fail -= (chance - fail)*2;
3889 else chance -= (fail - chance)*2;
3890 if (fail < USE_DEVICE) fail = USE_DEVICE;
3891 if (chance < USE_DEVICE) chance = USE_DEVICE;
3895 if (flush_failure) flush();
3897 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3899 msg_print("It shows no reaction.");
3906 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
3907 else if (chance > fail)
3909 if (rand_int(chance*2) < fail) success = FALSE;
3910 else success = TRUE;
3914 if (rand_int(fail*2) < chance) success = TRUE;
3915 else success = FALSE;
3918 /* Roll for usage */
3921 if (flush_failure) flush();
3923 msg_print("¤¦¤Þ¤¯»ÏÆ°¤µ¤»¤ë¤³¤È¤¬¤Ç¤¤Ê¤«¤Ã¤¿¡£");
3925 msg_print("You failed to activate it properly.");
3932 /* Check the recharge */
3936 msg_print("¤½¤ì¤ÏÈù¤«¤Ë²»¤òΩ¤Æ¡¢µ±¤¡¢¾Ã¤¨¤¿...");
3938 msg_print("It whines, glows and fades...");
3945 /* Activate the artifact */
3947 msg_print("»ÏÆ°¤µ¤»¤¿...");
3949 msg_print("You activate it...");
3957 if (o_ptr->art_name && o_ptr->xtra2)
3959 (void)activate_random_artifact(o_ptr);
3962 p_ptr->window |= (PW_INVEN | PW_EQUIP);
3969 else if (o_ptr->name1)
3972 switch (o_ptr->name1)
3977 msg_print("ààÎÜÉÓ¤«¤éÀ¡¤ó¤À¸÷¤¬¤¢¤Õ¤ì½Ð¤¿...");
3979 msg_print("The phial wells with clear light...");
3982 lite_area(damroll(2, 15), 3);
3983 o_ptr->timeout = rand_int(10) + 10;
3990 msg_print("À±¤¬âÁ¤·¤¯µ±¤¤¤¿...");
3992 msg_print("The star shines brightly...");
3995 map_area(DETECT_RAD_MAP);
3996 lite_area(damroll(2, 15), 3);
3997 o_ptr->timeout = rand_int(50) + 50;
4004 msg_print("¤½¤ÎÊõÀФÏÀÖ¤¯ÌÀ¤ë¤¯¸÷¤Ã¤¿¡ª");
4006 msg_print("The Jewel flashes bright red!");
4009 chg_virtue(V_KNOWLEDGE, 1);
4010 chg_virtue(V_ENLIGHTEN, 1);
4011 wiz_lite(FALSE, FALSE);
4013 msg_print("¤½¤ÎÊõÀФϤ¢¤Ê¤¿¤ÎÂÎÎϤòÃ¥¤Ã¤¿...");
4014 take_hit(DAMAGE_LOSELIFE, damroll(3,8), "¿³È½¤ÎÊõÀÐ", -1);
4016 msg_print("The Jewel drains your vitality...");
4017 take_hit(DAMAGE_LOSELIFE, damroll(3, 8), "the Jewel of Judgement", -1);
4020 (void)detect_traps(DETECT_RAD_DEFAULT);
4021 (void)detect_doors(DETECT_RAD_DEFAULT);
4022 (void)detect_stairs(DETECT_RAD_DEFAULT);
4025 if (get_check("µ¢´Ô¤ÎÎϤò»È¤¤¤Þ¤¹¤«¡©"))
4027 if (get_check("Activate recall? "))
4031 (void)word_of_recall();
4034 o_ptr->timeout = rand_int(20) + 20;
4041 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
4043 msg_print("The amulet lets out a shrill wail...");
4047 (void)set_protevil(randint(25) + k, FALSE);
4048 o_ptr->timeout = rand_int(225) + 225;
4055 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
4057 msg_print("The amulet floods the area with goodness...");
4060 dispel_evil(p_ptr->lev * 5);
4061 o_ptr->timeout = rand_int(200) + 200;
4068 msg_print("¶À¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
4070 msg_print("The mirror floods the area with goodness...");
4073 dispel_evil(p_ptr->lev * 5);
4074 o_ptr->timeout = rand_int(200) + 200;
4081 msg_print("¤¢¤Ê¤¿¤Ï¥Õ¥é¥¥¢¤ËŨ¤òÄù¤á»¦¤¹¤è¤¦Ì¿¤¸¤¿¡£");
4083 msg_print("You order Frakir to strangle your opponent.");
4086 if (!get_aim_dir(&dir)) return;
4087 if (drain_life(dir, 100))
4088 o_ptr->timeout = rand_int(100) + 100;
4095 msg_print("»ØÎؤÏÌÀ¤ë¤¯µ±¤¤¤¿...");
4097 msg_print("The ring glows brightly...");
4100 (void)set_fast(randint(75) + 75, FALSE);
4101 o_ptr->timeout = rand_int(150) + 150;
4108 msg_print("»ØÎؤϿ¼¹È¤Ëµ±¤¤¤¿...");
4110 msg_print("The ring glows deep red...");
4113 if (!get_aim_dir(&dir)) return;
4114 fire_ball(GF_FIRE, dir, 300, 3);
4115 o_ptr->timeout = rand_int(225) + 225;
4122 msg_print("»ØÎؤÏÇò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4124 msg_print("The ring glows bright white...");
4127 if (!get_aim_dir(&dir)) return;
4128 fire_ball(GF_COLD, dir, 400, 3);
4129 o_ptr->timeout = rand_int(325) + 325;
4137 msg_print("»ØÎؤϿ¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4139 msg_print("The ring glows deep blue...");
4142 if (!get_aim_dir(&dir)) return;
4143 fire_ball(GF_ELEC, dir, 500, 3);
4144 o_ptr->timeout = rand_int(425) + 425;
4152 msg_print("»ØÎؤϼ¿¹õ¤Ëµ±¤¤¤¿...");
4154 msg_print("The ring glows intensely black...");
4157 if (!get_aim_dir(&dir)) return;
4159 o_ptr->timeout = rand_int(450) + 450;
4165 int num = damroll(5, 3);
4170 msg_print("³»¤¬°ðºÊ¤Çʤ¤ï¤ì¤¿...");
4172 msg_print("Your armor is surrounded by lightning...");
4176 for (k = 0; k < num; k++)
4182 scatter(&y, &x, py, px, 4, 0);
4184 if (!cave_floor_bold(y, x)) continue;
4186 if ((y != py) || (x != px)) break;
4189 project(0, 3, y, x, 150, GF_ELEC,
4190 (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
4193 o_ptr->timeout = 1000;
4197 case ART_BLADETURNER:
4199 if (!get_aim_dir(&dir)) return;
4201 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
4203 msg_print("You breathe the elements.");
4206 fire_ball(GF_MISSILE, dir, 300, 4);
4208 msg_print("¥¢¡¼¥Þ¡¼¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...");
4210 msg_print("Your armor glows many colours...");
4213 (void)set_afraid(0);
4214 (void)set_hero(randint(50) + 50, FALSE);
4215 (void)hp_player(10);
4216 (void)set_blessed(randint(50) + 50, FALSE);
4217 (void)set_oppose_acid(randint(50) + 50, FALSE);
4218 (void)set_oppose_elec(randint(50) + 50, FALSE);
4219 (void)set_oppose_fire(randint(50) + 50, FALSE);
4220 (void)set_oppose_cold(randint(50) + 50, FALSE);
4221 (void)set_oppose_pois(randint(50) + 50, FALSE);
4222 o_ptr->timeout = 400;
4226 case ART_SOULKEEPER:
4229 msg_print("¥¢¡¼¥Þ¡¼¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4230 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬¤è¤¤...");
4232 msg_print("Your armor glows a bright white...");
4233 msg_print("You feel much better...");
4236 (void)hp_player(1000);
4238 o_ptr->timeout = 888;
4242 case ART_BELEGENNON:
4245 msg_print("Å·¹ñ¤Î²Î¤¬Ê¹¤³¤¨¤ë...");
4247 msg_print("A heavenly choir sings...");
4250 (void)set_poisoned(0);
4253 (void)set_confused(0);
4255 (void)set_hero(randint(25) + 25, FALSE);
4256 (void)hp_player(777);
4257 o_ptr->timeout = 300;
4264 msg_print("¥¢¡¼¥Þ¡¼¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4266 msg_print("Your armor glows deep blue...");
4269 (void)symbol_genocide(200, TRUE);
4270 o_ptr->timeout = 500;
4277 msg_print("¥¢¡¼¥Þ¡¼¤¬ÀÖ¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4279 msg_print("Your armor glows bright red...");
4282 destroy_doors_touch();
4283 o_ptr->timeout = 10;
4291 turn_monsters(40 + p_ptr->lev);
4292 o_ptr->timeout = 3 * (p_ptr->lev + 10);
4297 case ART_HOLHENNETH:
4300 msg_print("¥Ø¥ë¥á¥Ã¥È¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4301 msg_print("¿´¤Ë¥¤¥á¡¼¥¸¤¬É⤫¤ó¤Ç¤¤¿...");
4303 msg_print("Your helm glows bright white...");
4304 msg_print("An image forms in your mind...");
4307 detect_all(DETECT_RAD_DEFAULT);
4308 o_ptr->timeout = rand_int(55) + 55;
4315 msg_print("²¦´§¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4316 msg_print("ÂÎÆâ¤ËÃȤ«¤¤¸ÝÆ°¤¬´¶¤¸¤é¤ì¤ë...");
4318 msg_print("Your crown glows deep blue...");
4319 msg_print("You feel a warm tingling inside...");
4322 (void)hp_player(700);
4324 o_ptr->timeout = 250;
4332 msg_format("%s¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...", o_ptr->name1 == ART_COLLUIN ? "¥¯¥í¡¼¥¯" : "³»");
4334 msg_format("Your cloak glows many colours...");
4337 (void)set_oppose_acid(randint(20) + 20, FALSE);
4338 (void)set_oppose_elec(randint(20) + 20, FALSE);
4339 (void)set_oppose_fire(randint(20) + 20, FALSE);
4340 (void)set_oppose_cold(randint(20) + 20, FALSE);
4341 (void)set_oppose_pois(randint(20) + 20, FALSE);
4342 o_ptr->timeout = 111;
4346 case ART_HOLCOLLETH:
4349 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4351 msg_print("Your cloak glows deep blue...");
4354 sleep_monsters_touch();
4355 o_ptr->timeout = 55;
4362 msg_print("¥¯¥í¡¼¥¯¤¬²«¿§¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4364 msg_print("Your cloak glows bright yellow...");
4368 o_ptr->timeout = 70;
4375 msg_print("¥¯¥í¡¼¥¯¤¬ÊÕ¤ê¤Î¶õ´Ö¤ò¤æ¤¬¤Þ¤»¤¿...");
4377 msg_print("Your cloak twists space around you...");
4380 teleport_player(100);
4381 o_ptr->timeout = 45;
4388 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4390 msg_print("Your cloak glows a deep red...");
4394 o_ptr->timeout = 450;
4398 case ART_CAMMITHRIM:
4401 msg_print("¥°¥í¡¼¥Ö¤¬âÁ¤·¤¤¤¯¤é¤¤¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4403 msg_print("Your gloves glow extremely brightly...");
4406 if (!get_aim_dir(&dir)) return;
4407 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
4415 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4417 msg_print("Your gauntlets are covered in fire...");
4420 if (!get_aim_dir(&dir)) return;
4421 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4422 o_ptr->timeout = rand_int(8) + 8;
4426 case ART_PAURNIMMEN:
4429 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4431 msg_print("Your gauntlets are covered in frost...");
4434 if (!get_aim_dir(&dir)) return;
4435 fire_bolt(GF_COLD, dir, damroll(6, 8));
4436 o_ptr->timeout = rand_int(7) + 7;
4443 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4445 msg_print("Your gauntlets are covered in sparks...");
4448 if (!get_aim_dir(&dir)) return;
4449 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4450 o_ptr->timeout = rand_int(5) + 5;
4457 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬»À¤Ëʤ¤ï¤ì¤¿...");
4459 msg_print("Your gauntlets are covered in acid...");
4462 if (!get_aim_dir(&dir)) return;
4463 fire_bolt(GF_ACID, dir, damroll(5, 8));
4464 o_ptr->timeout = rand_int(6) + 6;
4471 msg_print("¥»¥¹¥¿¥¹¤ËËâË¡¤Î¥È¥²¤¬¸½¤ì¤¿...");
4473 msg_print("Your cesti grows magical spikes...");
4476 if (!get_aim_dir(&dir)) return;
4477 fire_bolt(GF_ARROW, dir, 150);
4478 o_ptr->timeout = rand_int(90) + 90;
4485 msg_print("¥Ö¡¼¥Ä¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4487 msg_print("Your boots glow bright green...");
4490 (void)set_fast(randint(20) + 20, FALSE);
4491 o_ptr->timeout = 200;
4498 msg_print("¥Ö¡¼¥Ä¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4500 msg_print("Your boots glow deep blue...");
4503 (void)set_afraid(0);
4504 (void)set_poisoned(0);
4512 msg_print("¥À¥¬¡¼¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4514 msg_print("Your dagger is covered in fire...");
4517 if (!get_aim_dir(&dir)) return;
4518 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4519 o_ptr->timeout = rand_int(8) + 8;
4526 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4528 msg_print("Your dagger is covered in frost...");
4531 if (!get_aim_dir(&dir)) return;
4532 fire_bolt(GF_COLD, dir, damroll(6, 8));
4533 o_ptr->timeout = rand_int(7) + 7;
4540 msg_print("¥À¥¬¡¼¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4542 msg_print("Your dagger is covered in sparks...");
4545 if (!get_aim_dir(&dir)) return;
4546 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4547 o_ptr->timeout = rand_int(5) + 5;
4554 msg_print("¥À¥¬¡¼¤¬¿¼¤¤Îп§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4556 msg_print("Your dagger throbs deep green...");
4559 if (!get_aim_dir(&dir)) return;
4560 fire_ball(GF_POIS, dir, 12, 3);
4561 o_ptr->timeout = rand_int(4) + 4;
4568 msg_print("Ì·¤¬¿¼¤¤ÀÄ¿§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4570 msg_print("Your dagger throbs deep blue...");
4573 if (!get_aim_dir(&dir)) return;
4574 fire_ball(GF_WATER, dir, 200, 3);
4575 o_ptr->timeout = 250;
4582 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4584 msg_print("Your dagger is covered in frost...");
4587 if (!get_aim_dir(&dir)) return;
4588 fire_ball(GF_COLD, dir, 48, 2);
4589 o_ptr->timeout = rand_int(5) + 5;
4596 switch (randint(13))
4598 case 1: case 2: case 3: case 4: case 5:
4599 teleport_player(10);
4601 case 6: case 7: case 8: case 9: case 10:
4602 teleport_player(222);
4605 (void)stair_creation();
4609 if (get_check("¤³¤Î³¬¤òµî¤ê¤Þ¤¹¤«¡©"))
4611 if (get_check("Leave this level? "))
4615 if (autosave_l) do_cmd_save_game(TRUE);
4618 p_ptr->leaving = TRUE;
4621 o_ptr->timeout = 35;
4627 teleport_player(222);
4628 o_ptr->timeout = 25;
4635 msg_print("¥½¡¼¥É¤¬ÀĤ¯·ã¤·¤¯µ±¤¤¤¿...");
4637 msg_print("Your sword glows an intense blue...");
4640 if (!get_aim_dir(&dir)) return;
4641 fire_ball(GF_COLD, dir, 100, 2);
4642 o_ptr->timeout = 200;
4649 msg_print("¶Ç¤Î»ÕÃĤò¾¤´¤·¤¿¡£");
4651 msg_print("You summon the Legion of the Dawn.");
4654 (void)summon_specific(-1, py, px, dun_level, SUMMON_DAWN, TRUE, TRUE, TRUE, FALSE, FALSE);
4655 o_ptr->timeout = 500 + randint(500);
4662 msg_print("¥½¡¼¥É¤¬ÀÖ¤¯·ã¤·¤¯µ±¤¤¤¿...");
4664 msg_print("Your sword glows an intense red...");
4667 if (!get_aim_dir(&dir)) return;
4668 fire_ball(GF_FIRE, dir, 72, 2);
4669 o_ptr->timeout = 400;
4676 msg_print("¥¢¥Ã¥¯¥¹¤Î¿Ï¤¬¹õ¤¯µ±¤¤¤¿...");
4678 msg_print("Your axe blade glows black...");
4681 if (!get_aim_dir(&dir)) return;
4682 drain_life(dir, 120);
4683 o_ptr->timeout = 400;
4690 msg_print("¤¢¤Ê¤¿¤ÎÁä¤ÏÅŵ¤¤Ç¥¹¥Ñ¡¼¥¯¤·¤Æ¤¤¤ë...");
4692 msg_print("Your spear crackles with electricity...");
4695 if (!get_aim_dir(&dir)) return;
4696 fire_ball(GF_ELEC, dir, 100, 3);
4697 o_ptr->timeout = 200;
4704 msg_print("¥¹¥Ô¥¢¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4706 msg_print("Your spear glows a bright white...");
4709 if (!get_aim_dir(&dir)) return;
4710 fire_ball(GF_COLD, dir, 100, 3);
4711 o_ptr->timeout = 200;
4718 msg_print("¥¹¥Ô¥¢¤¬¸ÝÆ°¤·¤¿...");
4720 msg_print("Your spear pulsates...");
4723 if (!get_aim_dir(&dir)) return;
4732 msg_print("¤Ä¤ë¤Ï¤·¤¬¸ÝÆ°¤·¤¿...");
4734 msg_print("Your mattock pulsates...");
4737 if (!get_aim_dir(&dir)) return;
4746 msg_print("¥¢¥Ã¥¯¥¹¤«¤é¤Ò¤É¤¯±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
4748 msg_print("Your axe lets out a long, shrill note...");
4751 (void)mass_genocide(200, TRUE);
4752 o_ptr->timeout = 1000;
4759 msg_print("¥Ð¥È¥ë¡¦¥¢¥Ã¥¯¥¹¤¬¿¼»ç¤Î¸÷¤òÊü¼Í¤·¤¿...");
4761 msg_print("Your battle axe radiates deep purple...");
4764 hp_player(damroll(4, 8));
4765 (void)set_cut((p_ptr->cut / 2) - 50);
4766 o_ptr->timeout = rand_int(3) + 3;
4773 msg_print("¥È¥é¥¤¥Ç¥ó¥È¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4775 msg_print("Your trident glows deep red...");
4778 if (!get_aim_dir(&dir)) return;
4779 teleport_monster(dir);
4780 o_ptr->timeout = 150;
4787 msg_print("Âç³ù¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
4789 msg_print("Your scythe glows soft white...");
4791 if (!word_of_recall()) return;
4792 o_ptr->timeout = 200;
4799 msg_print("¸û¶Ì¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
4801 msg_print("Your scythe glows soft white...");
4803 if (!word_of_recall()) return;
4804 o_ptr->timeout = 200;
4811 msg_print("¥Õ¥ì¥¤¥ë¤¬ÍÍ¡¹¤Ê¿§¤Î²Ð²Ö¤òȯ¤·¤¿...");
4813 msg_print("Your flail glows in scintillating colours...");
4816 if (!get_aim_dir(&dir)) return;
4817 confuse_monster(dir, 20);
4818 o_ptr->timeout = 15;
4825 msg_print("¥â¡¼¥Ë¥ó¥°¥¹¥¿¡¼¤«¤é±ê¤¬¿á¤½Ð¤·¤¿...");
4827 msg_print("Your morning star rages in fire...");
4830 if (!get_aim_dir(&dir)) return;
4831 fire_ball(GF_FIRE, dir, 72, 3);
4832 o_ptr->timeout = 100;
4839 msg_print("¥à¥Á¤¬¿¼¤¤ÀÖ¿§¤Ëµ±¤¤¤¿...");
4841 msg_print("Your whip glows deep red...");
4844 if (!get_aim_dir(&dir)) return;
4845 fire_ball(GF_FIRE, dir, 120, 3);
4846 o_ptr->timeout = 15;
4853 msg_print("¥á¥¤¥¹¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4855 msg_print("Your mace glows bright green...");
4858 (void)set_fast(randint(20) + 20, FALSE);
4859 o_ptr->timeout = rand_int(100) + 100;
4866 msg_print("¥¯¥©¡¼¥¿¡¼¥¹¥¿¥Ã¥Õ¤¬²«¿§¤¯µ±¤¤¤¿...");
4868 msg_print("Your quarterstaff glows yellow...");
4871 if (!ident_spell(FALSE)) return;
4872 o_ptr->timeout = 10;
4879 msg_print("¾ó¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
4881 msg_print("Your quarterstaff glows brightly...");
4884 detect_all(DETECT_RAD_DEFAULT);
4886 identify_fully(FALSE);
4887 o_ptr->timeout = 1000;
4894 msg_print("¥Ï¥ó¥Þ¡¼¤¬Çò¤¯µ±¤¤¤¿...");
4896 msg_print("Your hammer glows white...");
4899 if (!get_aim_dir(&dir)) return;
4900 drain_life(dir, 90);
4901 o_ptr->timeout = 70;
4908 msg_print("¥¯¥í¥¹¥Ü¥¦¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4910 msg_print("Your crossbow glows deep red...");
4913 (void)brand_bolts();
4914 o_ptr->timeout = 999;
4921 int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_NO_REF;
4924 msg_print("¤»¤Ã¤«¤¯¤À¤«¤é¡Ø¥¯¥ê¥à¥¾¥ó¡Ù¤ò¤Ö¤Ã¤Ñ¤Ê¤¹¤¼¡ª");
4926 msg_print("I'll fire CRIMSON! SEKKAKUDAKARA!");
4929 if (!get_aim_dir(&dir)) return;
4931 /* Use the given direction */
4932 tx = px + 99 * ddx[dir];
4933 ty = py + 99 * ddy[dir];
4935 /* Hack -- Use an actual "target" */
4936 if ((dir == 5) && target_okay())
4942 if (p_ptr->pclass == CLASS_ARCHER)
4944 /* Extra shot at level 10 */
4945 if (p_ptr->lev >= 10) num++;
4947 /* Extra shot at level 30 */
4948 if (p_ptr->lev >= 30) num++;
4950 /* Extra shot at level 45 */
4951 if (p_ptr->lev >= 45) num++;
4954 for (i = 0; i < num; i++)
4955 project(0, p_ptr->lev/20+1, ty, tx, p_ptr->lev*6, GF_ROCKET, flg, -1);
4956 o_ptr->timeout = 15;
4961 monster_type *m_ptr;
4962 monster_race *r_ptr;
4966 msg_print("´ñ̯¤Ê¾ì½ê¤¬Æ¬¤ÎÃæ¤ËÉ⤫¤ó¤À¡¥¡¥¡¥");
4968 msg_print("Some strange places show up in your mind. And you see ...");
4971 /* Process the monsters (backwards) */
4972 for (i = m_max - 1; i >= 1; i--)
4974 /* Access the monster */
4977 /* Ignore "dead" monsters */
4978 if (!m_ptr->r_idx) continue;
4980 r_ptr = &r_info[m_ptr->r_idx];
4982 if(r_ptr->flags1 & RF1_UNIQUE)
4985 msg_format("%s¡¥ ",r_name + r_ptr->name);
4987 msg_format("%s. ",r_name + r_ptr->name);
4991 o_ptr->timeout = 200;
4995 case ART_STONE_LORE:
4998 msg_print("ÀФ¬±£¤µ¤ì¤¿ÈëÌ©¤ò¼Ì¤·½Ð¤·¤¿¡¥¡¥¡¥");
5000 msg_print("The stone reveals hidden mysteries...");
5002 if (!ident_spell(FALSE)) return;
5004 if (mp_ptr->spell_book)
5006 /* Sufficient mana */
5007 if (20 <= p_ptr->csp)
5013 /* Over-exert the player */
5016 int oops = 20 - p_ptr->csp;
5020 p_ptr->csp_frac = 0;
5024 msg_print("ÀФòÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
5026 msg_print("You are too weak to control the stone!");
5029 /* Hack -- Bypass free action */
5030 (void)set_paralyzed(p_ptr->paralyzed +
5031 randint(5 * oops + 1));
5034 (void)set_confused(p_ptr->confused +
5035 randint(5 * oops + 1));
5039 p_ptr->redraw |= (PR_MANA);
5043 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "´í¸±¤ÊÈëÌ©", -1);
5045 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "perilous secrets", -1);
5049 if (rand_int(5) == 0) (void)set_confused(p_ptr->confused +
5052 /* Exercise a little care... */
5053 if (rand_int(20) == 0)
5055 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "´í¸±¤ÊÈëÌ©", -1);
5057 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "perilous secrets", -1);
5065 msg_print("You wind a mighty blast; your enemies tremble!");
5066 (void)turn_monsters((3 * p_ptr->lev / 2) + 10);
5067 o_ptr->timeout = rand_int(40) + 40;
5073 msg_print("¤¢¤Ê¤¿¤Ï³²Ãî¤ò°ìÁݤ·¤¿¡£");
5075 msg_print("You exterminate small life.");
5077 (void)dispel_monsters(4);
5078 o_ptr->timeout = rand_int(55) + 55;
5085 msg_print("Æߤ¤²»¤¬ÊÕ¤ê¤òÊñ¤ß¤³¤ó¤À¡£");
5087 msg_print("A shrill wailing sound surrounds you.");
5089 (void)set_protevil(randint(25) + p_ptr->lev, FALSE);
5090 o_ptr->timeout = rand_int(200) + 200;
5098 msg_print("¥í¡¼¥Ö¤¬½ã¿è¤ÊËâÎϤǿ̤¨¤¿¡£");
5100 msg_print("The robe pulsates with raw mana...");
5102 if (!get_aim_dir(&dir)) return;
5103 fire_bolt(GF_MANA, dir, 120);
5104 o_ptr->timeout = rand_int(120) + 120;
5109 (void)set_fast(randint(50) + 50, FALSE);
5112 set_hero(randint(50) + 50, FALSE);
5113 o_ptr->timeout = rand_int(200) + 100;
5119 msg_print("¥·¡¼¥ë¥É¤¬âÁ¤·¤¤¸÷¤Çµ±¤¤¤¿¡¥¡¥¡¥");
5121 msg_print("Your shield gleams with blinding light...");
5123 fire_ball(GF_LITE, 0, 300, 6);
5124 confuse_monsters(3 * p_ptr->lev / 2);
5125 o_ptr->timeout = 250;
5131 msg_print("¥«¡¼¥É¤¬Çò¤¯µ±¤¤¤¿¡¥¡¥¡¥");
5133 msg_print("Your card gleams with blinding light...");
5135 if (!recharge(1000)) return;
5136 o_ptr->timeout = 200;
5142 if (get_check("ËÜÅö¤Ë»È¤¤¤Þ¤¹¤«¡©"))
5144 if (get_check("Are you sure?!"))
5148 msg_print("¼Àµ¤¬¿Ì¤¨¤¿¡¥¡¥¡¥");
5150 msg_print("The Muramasa pulsates...");
5156 msg_print("¼Àµ¤Ï²õ¤ì¤¿¡ª");
5158 msg_print("The Muramasa is destroyed!");
5160 curse_weapon(TRUE, item);
5168 msg_print("ÀФ¬ÀÄÇò¤¯¸÷¤Ã¤¿¡¥¡¥¡¥");
5170 msg_print("Your stone glows pale...");
5173 if (!get_aim_dir(&dir)) return;
5174 fire_ball(GF_MANA, dir, 400, 4);
5175 o_ptr->timeout = rand_int(250) + 250;
5182 if (!get_rep_dir2(&dir)) return;
5186 if (!(cave[y][x].feat == FEAT_DEEP_WATER) && !(cave[y][x].feat == FEAT_SHAL_WATER))
5189 msg_print("¤½¤³¤ÏΦÃϤÀ¡£");
5191 msg_print("There is no fishing place.");
5195 else if (cave[y][x].m_idx)
5198 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
5200 msg_format("%s¤¬¼ÙËâ¤À¡ª", m_name);
5202 msg_format("%^s is stand in your way.", m_name);
5207 set_action(ACTION_FISH);
5208 p_ptr->redraw |= (PR_STATE);
5213 if (!get_aim_dir(&dir)) return;
5215 msg_print("¥à¥Á¤ò¿¤Ð¤·¤¿¡£");
5217 msg_print("You stretched your wip.");
5220 fetch(dir, 500, TRUE);
5221 o_ptr->timeout = rand_int(25) + 25;
5226 bool pet = (randint(5) != 1);
5228 if (summon_specific((pet ? -1 : 0), py, px, ((p_ptr->lev * 3) / 2), SUMMON_HOUND, TRUE, FALSE, pet, FALSE, (bool)(!pet)))
5233 msg_print("¥Ï¥¦¥ó¥É¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5235 msg_print("A group of hounds appear as your servant.");
5240 msg_print("¥Ï¥¦¥ó¥É¤Ï¤¢¤Ê¤¿¤Ë²ç¤ò¸þ¤±¤Æ¤¤¤ë¡ª");
5242 msg_print("A group of hounds appear as your enemy!");
5247 o_ptr->timeout = 300 + randint(150);
5254 msg_print("¥¹¥Ô¥¢¤ÏâÁ¤·¤¯µ±¤¤¤¿...");
5256 msg_print("Your spear grows brightly...");
5259 if (!get_aim_dir(&dir)) return;
5260 fire_ball(GF_LITE, dir, 200, 3);
5261 o_ptr->timeout = rand_int(200) + 200;
5268 monster_type *m_ptr;
5273 if (summon_named_creature(py, px, MON_SUKE, FALSE, FALSE, TRUE, TRUE))
5276 msg_print("¡Ø½õ¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5278 msg_print("Suke-san apperars.");
5279 kakusan = "Suke-san";
5283 if (summon_named_creature(py, px, MON_KAKU, FALSE, FALSE, TRUE, TRUE))
5286 msg_print("¡Ø³Ê¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5288 msg_print("Kaku-san appears.");
5289 kakusan = "Kaku-san";
5295 for (i = m_max - 1; i > 0; i--)
5298 if (!m_ptr->r_idx) continue;
5299 if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
5300 if (!los(m_ptr->fy, m_ptr->fx, py, px)) continue;
5309 msg_print("¡Ö¼Ô¤É¤â¡¢¤Ò¤«¤¨¤ª¤í¤¦¡ª¡ª¡ª¤³¤Î¤ªÊý¤ò¤É¤Ê¤¿¤È¤³¤³¤í¤¨¤ë¡£¡×");
5311 msg_format("%^s says 'WHO do you think this person is! Bow your head, down your knees!'", kakusan);
5316 confuse_monsters(120);
5318 stasis_monsters(120);
5324 msg_print("¤·¤«¤·¡¢²¿¤âµ¯¤¤Ê¤«¤Ã¤¿¡£");
5326 msg_print("Nothing happen.");
5329 o_ptr->timeout = rand_int(150) + 150;
5336 msg_print("Çï»ÒÌÚ¤òÂǤä¿¡£");
5338 msg_print("You beat Your wooden clappers.");
5340 aggravate_monsters(0);
5347 set_hero(randint(25)+25, FALSE);
5349 o_ptr->timeout = rand_int(30) + 30;
5355 (void)set_poisoned(0);
5356 (void)set_confused(0);
5362 o_ptr->timeout = 100;
5368 if (!get_aim_dir(&dir)) return;
5369 (void)charm_animal(dir, p_ptr->lev);
5371 o_ptr->timeout = 200;
5378 msg_print("¥½¡¼¥É¤¬Ã¸¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
5380 msg_print("Your sword glows a pale blue...");
5382 if (!get_aim_dir(&dir)) return;
5383 fire_bolt(GF_COLD, dir, damroll(12, 8));
5384 o_ptr->timeout = 50;
5391 msg_print("³ù¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
5393 msg_print("Your scythe glows brightly!");
5395 o_ptr->art_flags1 = a_info[ART_BLOOD].flags1;
5396 o_ptr->art_flags2 = a_info[ART_BLOOD].flags2;
5397 dummy = randint(2)+randint(2);
5398 for (i = 0; i < dummy; i++)
5399 o_ptr->art_flags1 |= (TR1_CHAOTIC << rand_int(18));
5401 for (i = 0; i < dummy; i++)
5402 random_resistance(o_ptr, FALSE, randint(34) + 4);
5404 for (i = 0; i < dummy; i++)
5406 int tmp = rand_int(11);
5407 if (tmp < 6) o_ptr->art_flags1 |= (TR1_STR << tmp);
5408 else o_ptr->art_flags1 |= (TR1_STEALTH << (tmp - 6));
5410 o_ptr->timeout = 3333;
5411 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
5412 p_ptr->update |= (PU_BONUS | PU_HP);
5418 msg_print("Î϶¯¤¯»Í¸Ô¤òƧ¤ó¤À¡£");
5420 msg_print("You stamp. (as if you are in a ring.)");
5422 (void)set_hero(randint(20) + 20, FALSE);
5423 dispel_evil(p_ptr->lev * 3);
5424 o_ptr->timeout = 100 + randint(100);
5430 msg_print("¥¯¥í¡¼¥¯¤¬Çò¤¯µ±¤¤¤¿...");
5432 msg_print("Your cloak grows white.");
5434 (void)set_oppose_cold(randint(20) + 20, FALSE);
5435 o_ptr->timeout = 40 + randint(40);
5441 msg_print("¥à¥Á¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
5443 msg_print("The whip lets out a shrill wail...");
5447 (void)set_protevil(randint(25) + k, FALSE);
5448 o_ptr->timeout = rand_int(225) + 225;
5453 bool pet = (randint(5) != 1);
5455 if (summon_named_creature(py, px, MON_JIZOTAKO, FALSE, TRUE, FALSE, pet))
5459 msg_print("Âý¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5461 msg_print("A group of octopuses appear as your servant.");
5466 msg_print("Âý¤Ï¤¢¤Ê¤¿¤òâˤó¤Ç¤¤¤ë¡ª");
5468 msg_print("A group of octopuses appear as your enemy!");
5473 o_ptr->timeout = 300 + randint(150);
5480 msg_print("Å´µå¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
5482 msg_print("The iron ball floods the area with goodness...");
5485 dispel_evil(p_ptr->lev * 5);
5486 o_ptr->timeout = rand_int(100) + 100;
5493 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤¬¿¼¤¤°Ç¤Ëʤ¤ï¤ì¤¿...");
5495 msg_print("Your amulet is coverd in pitch-darkness...");
5497 if (!get_aim_dir(&dir)) return;
5498 fire_ball(GF_DARK, dir, 250, 4);
5499 o_ptr->timeout = rand_int(150) + 150;
5505 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5511 else if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_TMP_RES_ACID))
5513 (void)set_oppose_acid(randint(20) + 20, FALSE);
5514 o_ptr->timeout = rand_int(50) + 50;
5518 else if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_TMP_RES_ELEC))
5520 (void)set_oppose_elec(randint(20) + 20, FALSE);
5521 o_ptr->timeout = rand_int(50) + 50;
5525 else if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_TMP_RES_FIRE))
5527 (void)set_oppose_fire(randint(20) + 20, FALSE);
5528 o_ptr->timeout = rand_int(50) + 50;
5532 else if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_TMP_RES_COLD))
5534 (void)set_oppose_cold(randint(20) + 20, FALSE);
5535 o_ptr->timeout = rand_int(50) + 50;
5539 else if ((o_ptr->tval > TV_CAPTURE) && (o_ptr->xtra3 == ESSENCE_EARTHQUAKE))
5541 earthquake(py, px, 5);
5542 o_ptr->timeout = 100 + randint(100);
5545 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5552 else if (o_ptr->name2 == EGO_TRUMP)
5554 teleport_player(100);
5555 o_ptr->timeout = 50 + randint(50);
5558 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5565 else if (o_ptr->name2 == EGO_LITE_ILLUMINATION)
5567 if (!o_ptr->xtra4 && ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
5570 msg_print("dzÎÁ¤¬¤Ê¤¤¡£");
5572 msg_print("It has no fuel.");
5577 lite_area(damroll(2, 15), 3);
5578 o_ptr->timeout = rand_int(10) + 10;
5581 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5587 else if (o_ptr->name2 == EGO_EARTHQUAKES)
5589 earthquake(py, px, 5);
5590 o_ptr->timeout = 100 + randint(100);
5593 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5600 else if (o_ptr->name2 == EGO_JUMP)
5602 teleport_player(10);
5603 o_ptr->timeout = 10 + randint(10);
5606 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5613 /* Hack -- Dragon Scale Mail can be activated as well */
5614 else if (o_ptr->tval == TV_DRAG_ARMOR)
5616 /* Get a direction for breathing (or abort) */
5617 if (!get_aim_dir(&dir)) return;
5619 /* Branch on the sub-type */
5620 switch (o_ptr->sval)
5622 case SV_DRAGON_BLUE:
5625 msg_print("¤¢¤Ê¤¿¤Ï°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5627 msg_print("You breathe lightning.");
5630 fire_ball(GF_ELEC, dir, 100, -2);
5631 o_ptr->timeout = rand_int(150) + 150;
5635 case SV_DRAGON_WHITE:
5638 msg_print("¤¢¤Ê¤¿¤ÏÎ䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5640 msg_print("You breathe frost.");
5643 fire_ball(GF_COLD, dir, 110, -2);
5644 o_ptr->timeout = rand_int(150) + 150;
5648 case SV_DRAGON_BLACK:
5651 msg_print("¤¢¤Ê¤¿¤Ï»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5653 msg_print("You breathe acid.");
5656 fire_ball(GF_ACID, dir, 130, -2);
5657 o_ptr->timeout = rand_int(150) + 150;
5661 case SV_DRAGON_GREEN:
5664 msg_print("¤¢¤Ê¤¿¤ÏÆÇ¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5666 msg_print("You breathe poison gas.");
5669 fire_ball(GF_POIS, dir, 150, -2);
5670 o_ptr->timeout = rand_int(180) + 180;
5677 msg_print("¤¢¤Ê¤¿¤Ï²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5679 msg_print("You breathe fire.");
5682 fire_ball(GF_FIRE, dir, 200, -2);
5683 o_ptr->timeout = rand_int(200) + 200;
5687 case SV_DRAGON_MULTIHUED:
5689 chance = rand_int(5);
5691 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5692 ((chance == 1) ? "°ðºÊ" :
5693 ((chance == 2) ? "Î䵤" :
5694 ((chance == 3) ? "»À" :
5695 ((chance == 4) ? "ÆÇ¥¬¥¹" : "²Ð±ê")))));
5697 msg_format("You breathe %s.",
5698 ((chance == 1) ? "lightning" :
5699 ((chance == 2) ? "frost" :
5700 ((chance == 3) ? "acid" :
5701 ((chance == 4) ? "poison gas" : "fire")))));
5704 fire_ball(((chance == 1) ? GF_ELEC :
5705 ((chance == 2) ? GF_COLD :
5706 ((chance == 3) ? GF_ACID :
5707 ((chance == 4) ? GF_POIS : GF_FIRE)))),
5709 o_ptr->timeout = rand_int(200) + 200;
5713 case SV_DRAGON_BRONZE:
5716 msg_print("¤¢¤Ê¤¿¤Ïº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5718 msg_print("You breathe confusion.");
5721 fire_ball(GF_CONFUSION, dir, 120, -2);
5722 o_ptr->timeout = rand_int(180) + 180;
5726 case SV_DRAGON_GOLD:
5729 msg_print("¤¢¤Ê¤¿¤Ï¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5731 msg_print("You breathe sound.");
5734 fire_ball(GF_SOUND, dir, 130, -2);
5735 o_ptr->timeout = rand_int(180) + 180;
5739 case SV_DRAGON_CHAOS:
5741 chance = rand_int(2);
5743 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5744 ((chance == 1 ? "¥«¥ª¥¹" : "Îô²½")));
5746 msg_format("You breathe %s.",
5747 ((chance == 1 ? "chaos" : "disenchantment")));
5750 fire_ball((chance == 1 ? GF_CHAOS : GF_DISENCHANT),
5752 o_ptr->timeout = rand_int(200) + 200;
5758 chance = rand_int(2);
5760 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5761 ((chance == 1 ? "¹ì²»" : "ÇËÊÒ")));
5763 msg_format("You breathe %s.",
5764 ((chance == 1 ? "sound" : "shards")));
5767 fire_ball((chance == 1 ? GF_SOUND : GF_SHARDS),
5769 o_ptr->timeout = rand_int(200) + 200;
5773 case SV_DRAGON_BALANCE:
5775 chance = rand_int(4);
5777 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿",
5778 ((chance == 1) ? "¥«¥ª¥¹" :
5779 ((chance == 2) ? "Îô²½" :
5780 ((chance == 3) ? "¹ì²»" : "ÇËÊÒ"))));
5782 msg_format("You breathe %s.",
5783 ((chance == 1) ? "chaos" :
5784 ((chance == 2) ? "disenchantment" :
5785 ((chance == 3) ? "sound" : "shards"))));
5788 fire_ball(((chance == 1) ? GF_CHAOS :
5789 ((chance == 2) ? GF_DISENCHANT :
5790 ((chance == 3) ? GF_SOUND : GF_SHARDS))),
5792 o_ptr->timeout = rand_int(200) + 200;
5796 case SV_DRAGON_SHINING:
5798 chance = rand_int(2);
5800 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5801 ((chance == 0 ? "Á®¸÷" : "°Å¹õ")));
5803 msg_format("You breathe %s.",
5804 ((chance == 0 ? "light" : "darkness")));
5807 fire_ball((chance == 0 ? GF_LITE : GF_DARK), dir, 200, -2);
5808 o_ptr->timeout = rand_int(200) + 200;
5812 case SV_DRAGON_POWER:
5815 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5817 msg_print("You breathe the elements.");
5820 fire_ball(GF_MISSILE, dir, 300, -3);
5821 o_ptr->timeout = rand_int(200) + 200;
5827 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5833 else if (o_ptr->tval == TV_RING)
5837 bool success = TRUE;
5839 switch (o_ptr->name2)
5842 (void)set_afraid(0);
5843 (void)set_hero(randint(25) + 25, FALSE);
5844 (void)hp_player(10);
5845 o_ptr->timeout = randint(100)+100;
5847 case EGO_RING_MAGIC_MIS:
5848 if (!get_aim_dir(&dir)) return;
5849 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
5852 case EGO_RING_FIRE_BOLT:
5853 if (!get_aim_dir(&dir)) return;
5854 fire_bolt(GF_FIRE, dir, damroll(9, 8));
5855 o_ptr->timeout = rand_int(8) + 8;
5857 case EGO_RING_COLD_BOLT:
5858 if (!get_aim_dir(&dir)) return;
5859 fire_bolt(GF_COLD, dir, damroll(6, 8));
5860 o_ptr->timeout = rand_int(7) + 7;
5862 case EGO_RING_ELEC_BOLT:
5863 if (!get_aim_dir(&dir)) return;
5864 fire_bolt(GF_ELEC, dir, damroll(4, 8));
5865 o_ptr->timeout = rand_int(5) + 5;
5867 case EGO_RING_ACID_BOLT:
5868 if (!get_aim_dir(&dir)) return;
5869 fire_bolt(GF_FIRE, dir, damroll(5, 8));
5870 o_ptr->timeout = rand_int(6) + 6;
5872 case EGO_RING_MANA_BOLT:
5873 if (!get_aim_dir(&dir)) return;
5874 fire_bolt(GF_MANA, dir, 120);
5875 o_ptr->timeout = rand_int(120)+120;
5877 case EGO_RING_FIRE_BALL:
5878 if (!get_aim_dir(&dir)) return;
5879 fire_ball(GF_FIRE, dir, 100, 2);
5880 o_ptr->timeout = rand_int(80) + 80;
5882 case EGO_RING_COLD_BALL:
5883 if (!get_aim_dir(&dir)) return;
5884 fire_ball(GF_COLD, dir, 100, 2);
5885 o_ptr->timeout = rand_int(80) + 80;
5887 case EGO_RING_ELEC_BALL:
5888 if (!get_aim_dir(&dir)) return;
5889 fire_ball(GF_ELEC, dir, 100, 2);
5890 o_ptr->timeout = rand_int(80) + 80;
5892 case EGO_RING_ACID_BALL:
5893 if (!get_aim_dir(&dir)) return;
5894 fire_ball(GF_ACID, dir, 100, 2);
5895 o_ptr->timeout = rand_int(80) + 80;
5897 case EGO_RING_MANA_BALL:
5898 if (!get_aim_dir(&dir)) return;
5899 fire_ball(GF_MANA, dir, 250, 2);
5900 o_ptr->timeout = 300;
5902 case EGO_RING_DRAGON_F:
5903 if (!get_aim_dir(&dir)) return;
5904 fire_ball(GF_FIRE, dir, 200, -2);
5905 if (o_ptr->sval == SV_RING_FLAMES)
5907 (void)set_oppose_fire(randint(20) + 20, FALSE);
5908 o_ptr->timeout = 200;
5910 else o_ptr->timeout = 250;
5912 case EGO_RING_DRAGON_C:
5913 if (!get_aim_dir(&dir)) return;
5914 fire_ball(GF_COLD, dir, 200, -2);
5915 if (o_ptr->sval == SV_RING_ICE)
5917 (void)set_oppose_cold(randint(20) + 20, FALSE);
5918 o_ptr->timeout = 200;
5920 else o_ptr->timeout = 250;
5922 case EGO_RING_M_DETECT:
5923 (void)detect_monsters_invis(255);
5924 (void)detect_monsters_normal(255);
5925 o_ptr->timeout = 150;
5927 case EGO_RING_D_SPEED:
5928 (void)set_fast(randint(30) + 15, FALSE);
5929 o_ptr->timeout = 100;
5931 case EGO_RING_BERSERKER:
5932 (void)set_shero(randint(25) + 25, FALSE);
5933 o_ptr->timeout = rand_int(75)+75;
5935 case EGO_RING_TELE_AWAY:
5936 if (!get_aim_dir(&dir)) return;
5937 teleport_monster(dir);
5938 o_ptr->timeout = 150;
5942 int v = randint(25)+25;
5943 (void)set_afraid(0);
5944 (void)set_hero(v, FALSE);
5945 (void)hp_player(10);
5946 (void)set_blessed(v, FALSE);
5947 (void)set_oppose_acid(v, FALSE);
5948 (void)set_oppose_elec(v, FALSE);
5949 (void)set_oppose_fire(v, FALSE);
5950 (void)set_oppose_cold(v, FALSE);
5951 (void)set_oppose_pois(v, FALSE);
5952 (void)set_ultimate_res(v, FALSE);
5953 o_ptr->timeout = 777;
5960 if (success) return;
5963 /* Get a direction for breathing (or abort) */
5964 if (!get_aim_dir(&dir)) return;
5966 switch (o_ptr->sval)
5970 fire_ball(GF_ACID, dir, 100, 2);
5971 (void)set_oppose_acid(randint(20) + 20, FALSE);
5972 o_ptr->timeout = rand_int(50) + 50;
5978 fire_ball(GF_COLD, dir, 100, 2);
5979 (void)set_oppose_cold(randint(20) + 20, FALSE);
5980 o_ptr->timeout = rand_int(50) + 50;
5984 case SV_RING_FLAMES:
5986 fire_ball(GF_FIRE, dir, 100, 2);
5987 (void)set_oppose_fire(randint(20) + 20, FALSE);
5988 o_ptr->timeout = rand_int(50) + 50;
5994 fire_ball(GF_ELEC, dir, 100, 2);
5995 (void)set_oppose_elec(randint(20) + 20, FALSE);
5996 o_ptr->timeout = rand_int(50) + 50;
6002 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6008 else if (o_ptr->tval == TV_AMULET)
6012 switch (o_ptr->name2)
6015 if (!ident_spell(FALSE)) return;
6016 o_ptr->timeout = 10;
6019 if (!get_aim_dir(&dir)) return;
6020 charm_monster(dir, MAX(20, p_ptr->lev));
6021 o_ptr->timeout = 200;
6024 teleport_player(10);
6025 o_ptr->timeout = rand_int(10) + 10;
6027 case EGO_AMU_TELEPORT:
6028 teleport_player(100);
6029 o_ptr->timeout = rand_int(50) + 50;
6031 case EGO_AMU_D_DOOR:
6032 (void)dimension_door();
6033 o_ptr->timeout = 200;
6035 case EGO_AMU_RES_FIRE_:
6036 (void)set_oppose_fire(randint(20) + 20, FALSE);
6037 o_ptr->timeout = rand_int(50) + 50;
6039 case EGO_AMU_RES_COLD_:
6040 (void)set_oppose_cold(randint(20) + 20, FALSE);
6041 o_ptr->timeout = rand_int(50) + 50;
6043 case EGO_AMU_RES_ELEC_:
6044 (void)set_oppose_elec(randint(20) + 20, FALSE);
6045 o_ptr->timeout = rand_int(50) + 50;
6047 case EGO_AMU_RES_ACID_:
6048 (void)set_oppose_acid(randint(20) + 20, FALSE);
6049 o_ptr->timeout = rand_int(50) + 50;
6051 case EGO_AMU_DETECTION:
6052 detect_all(DETECT_RAD_DEFAULT);
6053 o_ptr->timeout = rand_int(55)+55;
6060 else if (o_ptr->tval == TV_WHISTLE)
6063 if (cursed_p(o_ptr))
6066 msg_print("¥«¥ó¹â¤¤²»¤¬¶Á¤ÅϤä¿¡£");
6068 msg_print("You produce a shrill whistling sound.");
6070 aggravate_monsters(0);
6080 /* Allocate the "who" array */
6081 C_MAKE(who, max_m_idx, u16b);
6083 /* Process the monsters (backwards) */
6084 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6086 if (is_pet(&m_list[pet_ctr]) && (p_ptr->riding != pet_ctr))
6087 who[max_pet++] = pet_ctr;
6090 /* Select the sort method */
6091 ang_sort_comp = ang_sort_comp_pet;
6092 ang_sort_swap = ang_sort_swap_hook;
6094 ang_sort(who, &dummy_why, max_pet);
6096 /* Process the monsters (backwards) */
6097 for (i = 0; i < max_pet; i++)
6100 teleport_to_player(pet_ctr, 100);
6103 /* Free the "who" array */
6104 C_KILL(who, max_m_idx, u16b);
6106 o_ptr->timeout = 100+randint(100);
6109 else if (o_ptr->tval == TV_CAPTURE)
6113 bool old_target_pet = target_pet;
6115 if (!get_aim_dir(&dir))
6117 target_pet = old_target_pet;
6120 target_pet = old_target_pet;
6122 if(fire_ball(GF_CAPTURE, dir, 0, 0))
6124 o_ptr->pval = cap_mon;
6125 o_ptr->xtra3 = cap_mspeed;
6126 o_ptr->xtra4 = cap_hp;
6127 o_ptr->xtra5 = cap_maxhp;
6134 if (o_ptr->inscription)
6135 strcpy(buf, quark_str(o_ptr->inscription));
6137 for (s = buf;*s && (*s != '#'); s++)
6140 if (iskanji(*s)) s++;
6150 t = quark_str(cap_nickname);
6163 o_ptr->inscription = quark_add(buf);
6169 bool success = FALSE;
6170 if (!get_rep_dir2(&dir)) return;
6171 if (cave_floor_bold(py+ddy[dir],px+ddx[dir]))
6173 if (place_monster_aux(py + ddy[dir], px + ddx[dir], o_ptr->pval, FALSE, FALSE, TRUE, TRUE, TRUE, FALSE))
6175 if (o_ptr->xtra3) m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
6176 if (o_ptr->xtra5) m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
6177 if (o_ptr->xtra4) m_list[hack_m_idx_ii].hp = o_ptr->xtra4;
6178 m_list[hack_m_idx_ii].maxhp = m_list[hack_m_idx_ii].max_maxhp;
6179 if (o_ptr->inscription)
6187 t = quark_str(o_ptr->inscription);
6188 for (t = quark_str(o_ptr->inscription);*t && (*t != '#'); t++)
6191 if (iskanji(*t)) t++;
6216 if (quote && *(s-1) =='\'')
6220 m_list[hack_m_idx_ii].nickname = quark_add(buf);
6221 t = quark_str(o_ptr->inscription);
6223 while(*t && (*t != '#'))
6230 o_ptr->inscription = quark_add(buf);
6242 msg_print("¤ª¤Ã¤È¡¢²òÊü¤Ë¼ºÇÔ¤·¤¿¡£");
6244 msg_print("Oops. You failed to release your pet.");
6252 msg_print("¤ª¤Ã¤È¡¢¤³¤Î¥¢¥¤¥Æ¥à¤Ï»ÏÆ°¤Ç¤¤Ê¤¤¡£");
6254 msg_print("Oops. That object cannot be activated.");
6260 void do_cmd_activate(void)
6266 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6268 set_action(ACTION_NONE);
6271 item_tester_no_ryoute = TRUE;
6272 /* Prepare the hook */
6273 item_tester_hook = item_tester_hook_activate;
6277 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò»ÏÆ°¤µ¤»¤Þ¤¹¤«? ";
6278 s = "»ÏÆ°¤Ç¤¤ë¥¢¥¤¥Æ¥à¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£";
6280 q = "Activate which item? ";
6281 s = "You have nothing to activate.";
6284 if (!get_item(&item, q, s, (USE_EQUIP))) return;
6286 /* Activate the item */
6287 do_cmd_activate_aux(item);
6292 * Hook to determine if an object is useable
6294 static bool item_tester_hook_use(object_type *o_ptr)
6299 if (o_ptr->tval == p_ptr->tval_ammo)
6302 /* Useable object */
6303 switch (o_ptr->tval)
6321 if (!object_known_p(o_ptr)) return (FALSE);
6323 /* HACK - only items from the equipment can be activated */
6324 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
6326 if (&inventory[i] == o_ptr)
6328 /* Extract the flags */
6329 object_flags(o_ptr, &f1, &f2, &f3);
6331 /* Check activation flag */
6332 if (f3 & TR3_ACTIVATE) return (TRUE);
6345 * XXX - Add actions for other item types
6347 void do_cmd_use(void)
6353 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6355 set_action(ACTION_NONE);
6358 item_tester_no_ryoute = TRUE;
6359 /* Prepare the hook */
6360 item_tester_hook = item_tester_hook_use;
6364 q = "¤É¤ì¤ò»È¤¤¤Þ¤¹¤«¡©";
6365 s = "»È¤¨¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤»¤ó¡£";
6367 q = "Use which item? ";
6368 s = "You have nothing to use.";
6371 if (!get_item(&item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR))) return;
6373 /* Get the item (in the pack) */
6376 o_ptr = &inventory[item];
6378 /* Get the item (on the floor) */
6381 o_ptr = &o_list[0 - item];
6384 switch (o_ptr->tval)
6396 do_cmd_eat_food_aux(item);
6403 do_cmd_aim_wand_aux(item);
6410 do_cmd_use_staff_aux(item);
6417 do_cmd_zap_rod_aux(item);
6421 /* Quaff a potion */
6424 do_cmd_quaff_potion_aux(item);
6431 /* Check some conditions */
6435 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡£");
6437 msg_print("You can't see anything.");
6445 msg_print("ÌÀ¤«¤ê¤¬¤Ê¤¤¤Î¤Ç¡¢°Å¤¯¤ÆÆɤá¤Ê¤¤¡£");
6447 msg_print("You have no light to read by.");
6452 if (p_ptr->confused)
6455 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
6457 msg_print("You are too confused!");
6463 do_cmd_read_scroll_aux(item);
6472 do_cmd_fire_aux(item, &inventory[INVEN_BOW]);
6476 /* Activate an artifact */
6479 do_cmd_activate_aux(item);
6485 static bool select_magic_eater(int mode)
6491 int ask = TRUE, i = 0;
6494 int menu_line = (use_menu ? 1 : 0);
6498 if (repeat_pull(&sn))
6500 /* Verify the spell */
6501 if (sn > 71 && !(p_ptr->magic_num1[sn] > k_info[lookup_kind(TV_ROD, i)].pval * (p_ptr->magic_num2[sn] - 1) * 0x10000L))
6503 else if (sn < 72 && !(p_ptr->magic_num1[sn] < 0x10000))
6507 #endif /* ALLOW_REPEAT */
6509 for (i = 0; i < 108; i++)
6511 if (p_ptr->magic_num2[i]) break;
6516 msg_print("ËâË¡¤ò³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6518 msg_print("You don't have any magic!");
6530 prt(format(" %s ¾ó", (menu_line == 1) ? "¡Õ" : " "), 2, 14);
6531 prt(format(" %s ËâË¡ËÀ", (menu_line == 2) ? "¡Õ" : " "), 3, 14);
6532 prt(format(" %s ¥í¥Ã¥É", (menu_line == 3) ? "¡Õ" : " "), 4, 14);
6533 prt("¤É¤Î¼ïÎà¤ÎËâË¡¤ò»È¤¤¤Þ¤¹¤«¡©", 0, 0);
6535 prt(format(" %s staff", (menu_line == 1) ? "> " : " "), 2, 14);
6536 prt(format(" %s wand", (menu_line == 2) ? "> " : " "), 3, 14);
6537 prt(format(" %s rod", (menu_line == 3) ? "> " : " "), 4, 14);
6538 prt("Which type of magic do you usu?", 0, 0);
6561 ext = (menu_line-1)*36;
6562 if (menu_line == 1) tval = TV_STAFF;
6563 else if (menu_line == 2) tval = TV_WAND;
6567 if (menu_line > 3) menu_line -= 3;
6576 if (!get_com("[A] ¾ó, [B] ËâË¡ËÀ, [C] ¥í¥Ã¥É:", &choice, TRUE))
6578 if (!get_com("[A] staff, [B] wand, [C] rod:", &choice, TRUE))
6583 if (choice == 'A' || choice == 'a')
6589 if (choice == 'B' || choice == 'b')
6595 if (choice == 'C' || choice == 'c')
6603 for (i = ext; i < ext + 36; i++)
6605 if (p_ptr->magic_num2[i])
6607 if (use_menu) menu_line = i-ext+1;
6614 msg_print("¤½¤Î¼ïÎà¤ÎËâË¡¤Ï³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6616 msg_print("You don't have that type of magic!");
6621 /* Nothing chosen yet */
6627 /* Build a prompt */
6629 (void) strnfmt(out_val, 78, "('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎËâÎϤò»È¤¤¤Þ¤¹¤«¡©");
6631 (void)strnfmt(out_val, 78, "(*=List, ESC=exit) Use which power? ");
6633 if (use_menu) screen_save();
6635 /* Get a spell from the user */
6637 choice = (always_show_list || use_menu) ? ESCAPE:1;
6640 if( choice==ESCAPE ) choice = ' ';
6641 else if( !get_com(out_val, &choice, FALSE) )break;
6643 if (use_menu && choice != ' ')
6661 if (menu_line > 36) menu_line -= 36;
6662 } while(!p_ptr->magic_num2[menu_line+ext-1]);
6673 if (menu_line > 36) menu_line -= 36;
6674 } while(!p_ptr->magic_num2[menu_line+ext-1]);
6685 bool reverse = FALSE;
6686 if ((choice == '4') || (choice == 'h') || (choice == 'H')) reverse = TRUE;
6693 while(!p_ptr->magic_num2[menu_line+ext-1])
6698 if (menu_line < 2) reverse = FALSE;
6703 if (menu_line > 35) reverse = TRUE;
6719 /* Request redraw */
6720 if ((choice == ' ') || (choice == '*') || (choice == '?') || (use_menu && ask))
6723 if (!redraw || use_menu)
6737 /* Save the screen */
6738 if (!use_menu) screen_save();
6740 for (y = 1; y < 20; y++)
6745 /* Print header(s) */
6747 prt(format(" %s ¼ºÎ¨ %s ¼ºÎ¨", (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô"), (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô")), y++, x);
6749 prt(format(" %s Fail %s Fail", (tval == TV_ROD ? " Stat " : " Charges"), (tval == TV_ROD ? " Stat " : " Charges")), y++, x);
6753 for (ctr = 0; ctr < 36; ctr++)
6755 if (!p_ptr->magic_num2[ctr+ext]) continue;
6757 k_idx = lookup_kind(tval, ctr);
6761 if (ctr == (menu_line-1))
6763 strcpy(dummy, "¡Õ");
6765 strcpy(dummy, "> ");
6767 else strcpy(dummy, " ");
6770 /* letter/number for power selection */
6777 letter = '0' + ctr - 26;
6778 sprintf(dummy, "%c)",letter);
6780 x1 = ((ctr < 18) ? x : x + 40);
6781 y1 = ((ctr < 18) ? y + ctr : y + ctr - 18);
6782 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
6783 chance = level * 4 / 5 + 20;
6784 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
6786 if (p_ptr->lev > level)
6788 chance -= 3 * (p_ptr->lev - level);
6790 if (p_ptr->pseikaku == SEIKAKU_NAMAKE) chance += 10;
6791 if (p_ptr->heavy_spell) chance += 20;
6792 if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
6793 else if (p_ptr->easy_spell) chance-=3;
6794 else if (p_ptr->dec_mana) chance-=2;
6795 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
6796 /* Stunning makes spells harder */
6797 if (p_ptr->stun > 50) chance += 25;
6798 else if (p_ptr->stun) chance += 15;
6800 if (chance > 95) chance = 95;
6802 if(p_ptr->dec_mana) chance--;
6803 if (p_ptr->heavy_spell) chance += 5;
6811 strcat(dummy, format(
6813 " %-22.22s ½¼Å¶:%2d/%2d%3d%%",
6815 " %-22.22s (%2d/%2d) %3d%%",
6817 k_name + k_info[k_idx].name,
6818 p_ptr->magic_num1[ctr+ext] ?
6819 (p_ptr->magic_num1[ctr+ext] - 1) / (0x10000L * k_info[k_idx].pval) +1 : 0,
6820 p_ptr->magic_num2[ctr+ext], chance));
6821 if (p_ptr->magic_num1[ctr+ext] > k_info[k_idx].pval * (p_ptr->magic_num2[ctr+ext]-1) * 0x10000L) col = TERM_RED;
6825 strcat(dummy, format(" %-22.22s %2d/%2d %3d%%", k_name + k_info[k_idx].name, (s16b)(p_ptr->magic_num1[ctr+ext]/0x10000), p_ptr->magic_num2[ctr+ext], chance));
6826 if (p_ptr->magic_num1[ctr+ext] < 0x10000L) col = TERM_RED;
6831 c_prt(col, dummy, y1, x1);
6841 /* Restore the screen */
6851 if (isalpha(choice))
6854 ask = (isupper(choice));
6857 if (ask) choice = tolower(choice);
6859 /* Extract request */
6860 i = (islower(choice) ? A2I(choice) : -1);
6864 ask = FALSE; /* Can't uppercase digits */
6866 i = choice - '0' + 26;
6870 /* Totally Illegal */
6871 if ((i < 0) || (i > 36) || !p_ptr->magic_num2[i+ext])
6886 (void) strnfmt(tmp_val, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", k_name + k_info[lookup_kind(tval ,i)].name);
6888 (void) strnfmt(tmp_val, 78, "Use %s?", k_name + k_info[lookup_kind(tval ,i)].name);
6891 /* Belay that order */
6892 if (!get_check(tmp_val)) continue;
6896 if (p_ptr->magic_num1[ext+i] > k_info[lookup_kind(tval, i)].pval * (p_ptr->magic_num2[ext+i] - 1) * 0x10000L)
6899 msg_print("¤½¤ÎËâË¡¤Ï¤Þ¤À½¼Å¶¤·¤Æ¤¤¤ëºÇÃæ¤À¡£");
6901 msg_print("The magic are still charging.");
6904 if (use_menu) ask = TRUE;
6910 if (p_ptr->magic_num1[ext+i] < 0x10000L)
6913 msg_print("¤½¤ÎËâË¡¤Ï»ÈÍѲó¿ô¤¬ÀÚ¤ì¤Æ¤¤¤ë¡£");
6915 msg_print("The magic has no charges left.");
6918 if (use_menu) ask = TRUE;
6928 /* Restore the screen */
6929 if (redraw) screen_load();
6931 if (!flag) return -1;
6935 #endif /* ALLOW_REPEAT */
6939 void do_cmd_magic_eater(void)
6941 int item, dir, chance, level, k_idx, tval, sval;
6942 bool use_charge = TRUE;
6944 /* Not when confused */
6945 if (p_ptr->confused)
6948 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
6950 msg_print("You are too confused!");
6956 item = select_magic_eater(0);
6962 if (item > 71) {tval = TV_ROD;sval = item - 72;}
6963 else if (item > 35) {tval = TV_WAND;sval = item - 36;}
6964 else {tval = TV_STAFF;sval = item;}
6965 k_idx = lookup_kind(tval, sval);
6967 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
6968 chance = level * 4 / 5 + 20;
6969 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
6971 if (p_ptr->lev > level)
6973 chance -= 3 * (p_ptr->lev - level);
6975 if (p_ptr->pseikaku == SEIKAKU_NAMAKE) chance += 10;
6976 if (p_ptr->heavy_spell) chance += 20;
6977 if(p_ptr->dec_mana && p_ptr->easy_spell) chance-=4;
6978 else if (p_ptr->easy_spell) chance-=3;
6979 else if (p_ptr->dec_mana) chance-=2;
6980 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
6981 /* Stunning makes spells harder */
6982 if (p_ptr->stun > 50) chance += 25;
6983 else if (p_ptr->stun) chance += 15;
6985 if (chance > 95) chance = 95;
6987 if(p_ptr->dec_mana) chance--;
6988 if (p_ptr->heavy_spell) chance += 5;
6990 if (rand_int(100) < chance)
6992 if (flush_failure) flush();
6995 msg_print("¼öʸ¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª");
6997 msg_format("You failed to get the magic off!");
7001 if (randint(100) >= chance)
7002 chg_virtue(V_CHANCE,-1);
7011 if ((sval >= SV_ROD_MIN_DIRECTION) && (sval != SV_ROD_HAVOC) && (sval != SV_ROD_AGGRAVATE) && (sval != SV_ROD_PESTICIDE))
7012 if (!get_aim_dir(&dir)) return;
7013 rod_effect(sval, dir, &use_charge, TRUE);
7014 if (!use_charge) return;
7016 else if (tval == TV_WAND)
7018 if (!get_aim_dir(&dir)) return;
7019 wand_effect(sval, dir, TRUE);
7023 staff_effect(sval, &use_charge, TRUE);
7024 if (!use_charge) return;
7026 if (randint(100) < chance)
7027 chg_virtue(V_CHANCE,1);
7030 if (tval == TV_ROD) p_ptr->magic_num1[item] += k_info[k_idx].pval * 0x10000L;
7031 else p_ptr->magic_num1[item] -= 0x10000L;