4 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
6 * This software may be copied and distributed for educational, research,
7 * and not for profit purposes provided that this copyright and statement
8 * are included in all such copies. Other copyrights may also apply.
11 /* Purpose: Object commands */
17 * This file includes code for eating food, drinking potions,
18 * reading scrolls, aiming wands, using staffs, zapping rods,
19 * and activating artifacts.
21 * In all cases, if the player becomes "aware" of the item's use
22 * by testing it, mark it as "aware" and reward some experience
23 * based on the object's level, always rounding up. If the player
24 * remains "unaware", mark that object "kind" as "tried".
26 * This code now correctly handles the unstacking of wands, staffs,
27 * and rods. Note the overly paranoid warning about potential pack
28 * overflow, which allows the player to use and drop a stacked item.
30 * In all "unstacking" scenarios, the "used" object is "carried" as if
31 * the player had just picked it up. In particular, this means that if
32 * the use of an item induces pack overflow, that item will be dropped.
34 * For simplicity, these routines induce a full "pack reorganization"
35 * which not only combines similar items, but also reorganizes various
36 * items to obey the current "sorting" method. This may require about
37 * 400 item comparisons, but only occasionally.
39 * There may be a BIG problem with any "effect" that can cause "changes"
40 * to the inventory. For example, a "scroll of recharging" can cause
41 * a wand/staff to "disappear", moving the inventory up. Luckily, the
42 * scrolls all appear BEFORE the staffs/wands, so this is not a problem.
43 * But, for example, a "staff of recharging" could cause MAJOR problems.
44 * In such a case, it will be best to either (1) "postpone" the effect
45 * until the end of the function, or (2) "change" the effect, say, into
46 * giving a staff "negative" charges, or "turning a staff into a stick".
47 * It seems as though a "rod of recharging" might in fact cause problems.
48 * The basic problem is that the act of recharging (and destroying) an
49 * item causes the inducer of that action to "move", causing "o_ptr" to
50 * no longer point at the correct item, with horrifying results.
52 * Note that food/potions/scrolls no longer use bit-flags for effects,
53 * but instead use the "sval" (which is also used to sort the objects).
57 static void do_cmd_eat_food_aux(int item)
62 if (music_singing_any()) stop_singing();
64 /* Get the item (in the pack) */
67 o_ptr = &inventory[item];
70 /* Get the item (on the floor) */
73 o_ptr = &o_list[0 - item];
82 /* Identity not known yet */
86 lev = k_info[o_ptr->k_idx].level;
88 if (o_ptr->tval == TV_FOOD)
90 /* Analyze the food */
95 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
97 if (set_poisoned(p_ptr->poisoned + randint0(10) + 10))
105 case SV_FOOD_BLINDNESS:
107 if (!p_ptr->resist_blind)
109 if (set_blind(p_ptr->blind + randint0(200) + 200))
117 case SV_FOOD_PARANOIA:
119 if (!p_ptr->resist_fear)
121 if (set_afraid(p_ptr->afraid + randint0(10) + 10))
129 case SV_FOOD_CONFUSION:
131 if (!p_ptr->resist_conf)
133 if (set_confused(p_ptr->confused + randint0(10) + 10))
141 case SV_FOOD_HALLUCINATION:
143 if (!p_ptr->resist_chaos)
145 if (set_image(p_ptr->image + randint0(250) + 250))
153 case SV_FOOD_PARALYSIS:
155 if (!p_ptr->free_act)
157 if (set_paralyzed(p_ptr->paralyzed + randint0(10) + 10))
165 case SV_FOOD_WEAKNESS:
168 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "ÆÇÆþ¤ê¿©ÎÁ", -1);
170 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "poisonous food", -1);
173 (void)do_dec_stat(A_STR);
178 case SV_FOOD_SICKNESS:
181 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "ÆÇÆþ¤ê¿©ÎÁ", -1);
183 take_hit(DAMAGE_NOESCAPE, damroll(6, 6), "poisonous food", -1);
186 (void)do_dec_stat(A_CON);
191 case SV_FOOD_STUPIDITY:
194 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "ÆÇÆþ¤ê¿©ÎÁ", -1);
196 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "poisonous food", -1);
199 (void)do_dec_stat(A_INT);
204 case SV_FOOD_NAIVETY:
207 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "ÆÇÆþ¤ê¿©ÎÁ", -1);
209 take_hit(DAMAGE_NOESCAPE, damroll(8, 8), "poisonous food", -1);
212 (void)do_dec_stat(A_WIS);
217 case SV_FOOD_UNHEALTH:
220 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "ÆÇÆþ¤ê¿©ÎÁ", -1);
222 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "poisonous food", -1);
225 (void)do_dec_stat(A_CON);
230 case SV_FOOD_DISEASE:
233 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "ÆÇÆþ¤ê¿©ÎÁ", -1);
235 take_hit(DAMAGE_NOESCAPE, damroll(10, 10), "poisonous food", -1);
238 (void)do_dec_stat(A_STR);
243 case SV_FOOD_CURE_POISON:
245 if (set_poisoned(0)) ident = TRUE;
249 case SV_FOOD_CURE_BLINDNESS:
251 if (set_blind(0)) ident = TRUE;
255 case SV_FOOD_CURE_PARANOIA:
257 if (set_afraid(0)) ident = TRUE;
261 case SV_FOOD_CURE_CONFUSION:
263 if (set_confused(0)) ident = TRUE;
267 case SV_FOOD_CURE_SERIOUS:
269 if (hp_player(damroll(4, 8))) ident = TRUE;
273 case SV_FOOD_RESTORE_STR:
275 if (do_res_stat(A_STR)) ident = TRUE;
279 case SV_FOOD_RESTORE_CON:
281 if (do_res_stat(A_CON)) ident = TRUE;
285 case SV_FOOD_RESTORING:
287 if (do_res_stat(A_STR)) ident = TRUE;
288 if (do_res_stat(A_INT)) ident = TRUE;
289 if (do_res_stat(A_WIS)) ident = TRUE;
290 if (do_res_stat(A_DEX)) ident = TRUE;
291 if (do_res_stat(A_CON)) ident = TRUE;
292 if (do_res_stat(A_CHR)) ident = TRUE;
298 /* ¤½¤ì¤¾¤ì¤Î¿©¤Ùʪ¤Î´¶ÁÛ¤ò¥ª¥ê¥¸¥Ê¥ë¤è¤êºÙ¤«¤¯É½¸½ */
299 case SV_FOOD_BISCUIT:
301 msg_print("´Å¤¯¤Æ¥µ¥¯¥µ¥¯¤·¤Æ¤È¤Æ¤â¤ª¤¤¤·¤¤¡£");
308 msg_print("»õ¤´¤¿¤¨¤¬¤¢¤Ã¤Æ¤ª¤¤¤·¤¤¡£");
313 case SV_FOOD_SLIME_MOLD:
315 msg_print("¤³¤ì¤Ï¤Ê¤ó¤È¤â·ÁÍƤ·¤¬¤¿¤¤Ì£¤À¡£");
322 msg_print("¤³¤ì¤Ï¤ª¤¤¤·¤¤¡£");
328 case SV_FOOD_BISCUIT:
330 case SV_FOOD_SLIME_MOLD:
332 msg_print("That tastes good.");
339 case SV_FOOD_WAYBREAD:
342 msg_print("¤³¤ì¤Ï¤Ò¤¸¤ç¤¦¤ËÈþÌ£¤À¡£");
344 msg_print("That tastes good.");
347 (void)set_poisoned(0);
348 (void)hp_player(damroll(4, 8));
354 case SV_FOOD_PINT_OF_ALE:
356 msg_print("¤Î¤É¤´¤·Á֤䤫¤À¡£");
361 case SV_FOOD_PINT_OF_WINE:
363 msg_print("That tastes good.");
368 case SV_FOOD_PINT_OF_ALE:
369 case SV_FOOD_PINT_OF_WINE:
371 msg_print("That tastes good.");
380 /* Combine / Reorder the pack (later) */
381 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
383 if (!(object_is_aware(o_ptr)))
385 chg_virtue(V_KNOWLEDGE, -1);
386 chg_virtue(V_PATIENCE, -1);
387 chg_virtue(V_CHANCE, 1);
390 /* We have tried it */
391 if (o_ptr->tval == TV_FOOD) object_tried(o_ptr);
393 /* The player is now aware of the object */
394 if (ident && !object_is_aware(o_ptr))
397 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
401 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
404 /* Food can feed the player */
405 if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
407 /* Reduced nutritional benefit */
408 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
410 msg_print("¤¢¤Ê¤¿¤Î¤è¤¦¤Ê¼Ô¤Ë¤È¤Ã¤Æ¿©ÎȤʤɶϤ«¤Ê±ÉÍܤˤ·¤«¤Ê¤é¤Ê¤¤¡£");
412 msg_print("Mere victuals hold scant sustenance for a being such as yourself.");
415 if (p_ptr->food < PY_FOOD_ALERT) /* Hungry */
417 msg_print("¤¢¤Ê¤¿¤Îµ²¤¨¤Ï¿·Á¯¤Ê·ì¤Ë¤è¤Ã¤Æ¤Î¤ßËþ¤¿¤µ¤ì¤ë¡ª");
419 msg_print("Your hunger can only be satisfied with fresh blood!");
423 else if ((prace_is_(RACE_SKELETON) ||
424 prace_is_(RACE_GOLEM) ||
425 prace_is_(RACE_ZOMBIE) ||
426 prace_is_(RACE_SPECTRE)) &&
427 (o_ptr->tval == TV_STAFF || o_ptr->tval == TV_WAND))
431 if (o_ptr->tval == TV_STAFF &&
432 (item < 0) && (o_ptr->number > 1))
435 msg_print("¤Þ¤º¤Ï¾ó¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
437 msg_print("You must first pick up the staffs.");
443 staff = (o_ptr->tval == TV_STAFF) ? "¾ó" : "ËâË¡ËÀ";
445 staff = (o_ptr->tval == TV_STAFF) ? "staff" : "wand";
449 if (o_ptr->pval == 0)
452 msg_format("¤³¤Î%s¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£", staff);
454 msg_format("The %s has no charges left.", staff);
457 o_ptr->ident |= (IDENT_EMPTY);
459 /* Combine / Reorder the pack (later) */
460 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
461 p_ptr->window |= (PW_INVEN);
467 msg_format("¤¢¤Ê¤¿¤Ï%s¤ÎËâÎϤò¥¨¥Í¥ë¥®¡¼¸»¤È¤·¤ÆµÛ¼ý¤·¤¿¡£", staff);
469 msg_format("You absorb mana of the %s as your energy.", staff);
472 /* Use a single charge */
476 set_food(p_ptr->food + 5000);
478 /* XXX Hack -- unstack if necessary */
479 if (o_ptr->tval == TV_STAFF &&
480 (item >= 0) && (o_ptr->number > 1))
485 /* Get local object */
488 /* Obtain a local object */
489 object_copy(q_ptr, o_ptr);
491 /* Modify quantity */
494 /* Restore the charges */
497 /* Unstack the used item */
499 p_ptr->total_weight -= q_ptr->weight;
500 item = inven_carry(q_ptr);
504 msg_format("¾ó¤ò¤Þ¤È¤á¤Ê¤ª¤·¤¿¡£");
506 msg_print("You unstack your staff.");
510 /* Describe charges in the pack */
513 inven_item_charges(item);
516 /* Describe charges on the floor */
519 floor_item_charges(0 - item);
522 /* Don't eat a staff/wand itself */
525 else if ((prace_is_(RACE_DEMON) ||
526 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON)) &&
527 (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_CORPSE &&
528 my_strchr("pht", r_info[o_ptr->pval].d_char)))
530 /* Drain vitality of humanoids */
531 char o_name[MAX_NLEN];
533 object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
536 msg_format("%s¤Ïdz¤¨¾å¤ê³¥¤Ë¤Ê¤Ã¤¿¡£ÀºÎϤòµÛ¼ý¤·¤¿µ¤¤¬¤¹¤ë¡£", o_name);
538 msg_format("%^s is burnt to ashes. You absorb its vitality!", o_name);
540 (void)set_food(PY_FOOD_MAX - 1);
542 else if (prace_is_(RACE_SKELETON))
545 if (o_ptr->tval == TV_SKELETON ||
546 (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))
549 msg_print("¤¢¤Ê¤¿¤Ï¹ü¤Ç¼«Ê¬¤ÎÂΤòÊä¤Ã¤¿¡£");
551 msg_print("Your body absorbs the bone.");
553 set_food(p_ptr->food + 5000);
558 if (!((o_ptr->sval == SV_FOOD_WAYBREAD) ||
559 (o_ptr->sval < SV_FOOD_BISCUIT)))
562 object_type *q_ptr = &forge;
565 msg_print("¿©¤Ùʪ¤¬¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¤¿¡ª");
567 msg_print("The food falls through your jaws!");
571 /* Create the item */
572 object_prep(q_ptr, lookup_kind(o_ptr->tval, o_ptr->sval));
574 /* Drop the object from heaven */
575 (void)drop_near(q_ptr, -1, py, px);
580 msg_print("¿©¤Ùʪ¤¬¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¡¢¾Ã¤¨¤¿¡ª");
582 msg_print("The food falls through your jaws and vanishes!");
587 else if (prace_is_(RACE_GOLEM) ||
588 prace_is_(RACE_ZOMBIE) ||
589 prace_is_(RACE_ENT) ||
590 prace_is_(RACE_DEMON) ||
591 prace_is_(RACE_ANDROID) ||
592 prace_is_(RACE_SPECTRE) ||
593 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING))
596 msg_print("À¸¼Ô¤Î¿©Êª¤Ï¤¢¤Ê¤¿¤Ë¤È¤Ã¤Æ¤Û¤È¤ó¤É±ÉÍܤˤʤé¤Ê¤¤¡£");
598 msg_print("The food of mortals is poor sustenance for you.");
601 set_food(p_ptr->food + ((o_ptr->pval) / 20));
603 else if (o_ptr->tval == TV_FOOD && o_ptr->sval == SV_FOOD_WAYBREAD)
605 /* Waybread is always fully satisfying. */
606 set_food(MAX(p_ptr->food, PY_FOOD_MAX - 1));
610 /* Food can feed the player */
611 (void)set_food(p_ptr->food + o_ptr->pval);
614 /* Destroy a food in the pack */
617 inven_item_increase(item, -1);
618 inven_item_describe(item);
619 inven_item_optimize(item);
622 /* Destroy a food on the floor */
625 floor_item_increase(0 - item, -1);
626 floor_item_describe(0 - item);
627 floor_item_optimize(0 - item);
633 * Hook to determine if an object is eatable
635 static bool item_tester_hook_eatable(object_type *o_ptr)
637 if (o_ptr->tval==TV_FOOD) return TRUE;
640 if (prace_is_(RACE_SKELETON))
642 if (o_ptr->tval == TV_SKELETON ||
643 (o_ptr->tval == TV_CORPSE && o_ptr->sval == SV_SKELETON))
649 if (prace_is_(RACE_SKELETON) ||
650 prace_is_(RACE_GOLEM) ||
651 prace_is_(RACE_ZOMBIE) ||
652 prace_is_(RACE_SPECTRE))
654 if (o_ptr->tval == TV_STAFF || o_ptr->tval == TV_WAND)
657 else if (prace_is_(RACE_DEMON) ||
658 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_DEMON))
660 if (o_ptr->tval == TV_CORPSE &&
661 o_ptr->sval == SV_CORPSE &&
662 my_strchr("pht", r_info[o_ptr->pval].d_char))
672 * Eat some food (from the pack or floor)
674 void do_cmd_eat_food(void)
680 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
682 set_action(ACTION_NONE);
685 /* Restrict choices to food */
686 item_tester_hook = item_tester_hook_eatable;
690 q = "¤É¤ì¤ò¿©¤Ù¤Þ¤¹¤«? ";
691 s = "¿©¤Ùʪ¤¬¤Ê¤¤¡£";
693 q = "Eat which item? ";
694 s = "You have nothing to eat.";
697 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
700 do_cmd_eat_food_aux(item);
705 * Quaff a potion (from the pack or the floor)
707 static void do_cmd_quaff_potion_aux(int item)
720 if (flush_failure) flush();
722 msg_print("ÉÓ¤«¤é¿å¤¬Î®¤ì½Ð¤Æ¤³¤Ê¤¤¡ª");
724 msg_print("The potion doesn't flow out from a bottle.");
731 if (music_singing_any()) stop_singing();
733 /* Get the item (in the pack) */
736 o_ptr = &inventory[item];
739 /* Get the item (on the floor) */
742 o_ptr = &o_list[0 - item];
745 /* Get local object */
748 /* Obtain a local object */
749 object_copy(q_ptr, o_ptr);
754 /* Reduce and describe inventory */
757 inven_item_increase(item, -1);
758 inven_item_describe(item);
759 inven_item_optimize(item);
762 /* Reduce and describe floor item */
765 floor_item_increase(0 - item, -1);
766 floor_item_describe(0 - item);
767 floor_item_optimize(0 - item);
774 /* Not identified yet */
778 lev = k_info[q_ptr->k_idx].level;
780 /* Analyze the potion */
781 if (q_ptr->tval == TV_POTION)
786 /* °û¤ß¤´¤¿¤¨¤ò¥ª¥ê¥¸¥Ê¥ë¤è¤êºÙ¤«¤¯É½¸½ */
787 case SV_POTION_WATER:
788 msg_print("¸ý¤ÎÃ椬¤µ¤Ã¤Ñ¤ê¤·¤¿¡£");
789 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
793 case SV_POTION_APPLE_JUICE:
794 msg_print("´Å¤¯¤Æ¥µ¥Ã¥Ñ¥ê¤È¤·¤Æ¤¤¤Æ¡¢¤È¤Æ¤â¤ª¤¤¤·¤¤¡£");
795 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
799 case SV_POTION_SLIME_MOLD:
800 msg_print("¤Ê¤ó¤È¤âÉÔµ¤Ì£¤ÊÌ£¤À¡£");
801 msg_print("¤Î¤É¤Î³é¤¤¬¾¯¤·¤ª¤µ¤Þ¤Ã¤¿¡£");
806 case SV_POTION_WATER:
807 case SV_POTION_APPLE_JUICE:
808 case SV_POTION_SLIME_MOLD:
809 msg_print("You feel less thirsty.");
814 case SV_POTION_SLOWNESS:
815 if (set_slow(randint1(25) + 15, FALSE)) ident = TRUE;
818 case SV_POTION_SALT_WATER:
820 msg_print("¤¦¤§¡ª»×¤ï¤ºÅǤ¤¤Æ¤·¤Þ¤Ã¤¿¡£");
822 msg_print("The potion makes you vomit!");
825 if (!(prace_is_(RACE_GOLEM) ||
826 prace_is_(RACE_ZOMBIE) ||
827 prace_is_(RACE_DEMON) ||
828 prace_is_(RACE_ANDROID) ||
829 prace_is_(RACE_SPECTRE) ||
830 (mimic_info[p_ptr->mimic_form].MIMIC_FLAGS & MIMIC_IS_NONLIVING)))
832 /* Only living creatures get thirsty */
833 (void)set_food(PY_FOOD_STARVE - 1);
836 (void)set_poisoned(0);
837 (void)set_paralyzed(p_ptr->paralyzed + 4);
841 case SV_POTION_POISON:
842 if (!(p_ptr->resist_pois || IS_OPPOSE_POIS()))
844 if (set_poisoned(p_ptr->poisoned + randint0(15) + 10))
851 case SV_POTION_BLINDNESS:
852 if (!p_ptr->resist_blind)
854 if (set_blind(p_ptr->blind + randint0(100) + 100))
861 case SV_POTION_CONFUSION: /* Booze */
862 if (p_ptr->pclass != CLASS_MONK) chg_virtue(V_HARMONY, -1);
863 else if (!p_ptr->resist_conf) p_ptr->special_attack |= ATTACK_SUIKEN;
864 if (!p_ptr->resist_conf)
866 if (set_confused(randint0(20) + 15))
872 if (!p_ptr->resist_chaos)
876 if (set_image(p_ptr->image + randint0(150) + 150))
881 if (one_in_(13) && (p_ptr->pclass != CLASS_MONK))
884 if (one_in_(3)) lose_all_info();
886 (void)teleport_player_aux(100, TELEPORT_NONMAGICAL | TELEPORT_PASSIVE);
889 msg_print("ÃΤé¤Ê¤¤¾ì½ê¤ÇÌܤ¬Àä᤿¡£Æ¬Äˤ¬¤¹¤ë¡£");
890 msg_print("²¿¤â»×¤¤½Ð¤»¤Ê¤¤¡£¤É¤¦¤ä¤Ã¤Æ¤³¤³¤ØÍ褿¤Î¤«¤âʬ¤«¤é¤Ê¤¤¡ª");
892 msg_print("You wake up somewhere with a sore head...");
893 msg_print("You can't remember a thing, or how you got here!");
900 case SV_POTION_SLEEP:
901 if (!p_ptr->free_act)
904 msg_print("¤¢¤Ê¤¿¤Ï̲¤Ã¤Æ¤·¤Þ¤Ã¤¿¡£");
906 msg_print("You fall asleep.");
910 if (ironman_nightmare)
913 msg_print("¶²¤í¤·¤¤¸÷·Ê¤¬Æ¬¤ËÉ⤫¤ó¤Ç¤¤¿¡£");
915 msg_print("A horrible vision enters your mind.");
919 /* Pick a nightmare */
920 get_mon_num_prep(get_nightmare, NULL);
922 /* Have some nightmares */
923 have_nightmare(get_mon_num(MAX_DEPTH));
925 /* Remove the monster restriction */
926 get_mon_num_prep(NULL, NULL);
928 if (set_paralyzed(p_ptr->paralyzed + randint0(4) + 4))
935 case SV_POTION_LOSE_MEMORIES:
936 if (!p_ptr->hold_life && (p_ptr->exp > 0))
939 msg_print("²áµî¤Îµ²±¤¬Çö¤ì¤Æ¤¤¤¯µ¤¤¬¤¹¤ë¡£");
941 msg_print("You feel your memories fade.");
943 chg_virtue(V_KNOWLEDGE, -5);
945 lose_exp(p_ptr->exp / 4);
950 case SV_POTION_RUINATION:
952 msg_print("¿È¤â¿´¤â¼å¤Ã¤Æ¤¤Æ¡¢Àºµ¤¤¬È´¤±¤Æ¤¤¤¯¤è¤¦¤À¡£");
953 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), "ÇËÌǤÎÌô", -1);
955 msg_print("Your nerves and muscles feel weak and lifeless!");
956 take_hit(DAMAGE_LOSELIFE, damroll(10, 10), "a potion of Ruination", -1);
959 (void)dec_stat(A_DEX, 25, TRUE);
960 (void)dec_stat(A_WIS, 25, TRUE);
961 (void)dec_stat(A_CON, 25, TRUE);
962 (void)dec_stat(A_STR, 25, TRUE);
963 (void)dec_stat(A_CHR, 25, TRUE);
964 (void)dec_stat(A_INT, 25, TRUE);
968 case SV_POTION_DEC_STR:
969 if (do_dec_stat(A_STR)) ident = TRUE;
972 case SV_POTION_DEC_INT:
973 if (do_dec_stat(A_INT)) ident = TRUE;
976 case SV_POTION_DEC_WIS:
977 if (do_dec_stat(A_WIS)) ident = TRUE;
980 case SV_POTION_DEC_DEX:
981 if (do_dec_stat(A_DEX)) ident = TRUE;
984 case SV_POTION_DEC_CON:
985 if (do_dec_stat(A_CON)) ident = TRUE;
988 case SV_POTION_DEC_CHR:
989 if (do_dec_stat(A_CHR)) ident = TRUE;
992 case SV_POTION_DETONATIONS:
994 msg_print("ÂΤÎÃæ¤Ç·ã¤·¤¤Çúȯ¤¬µ¯¤¤¿¡ª");
995 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), "Çúȯ¤ÎÌô", -1);
997 msg_print("Massive explosions rupture your body!");
998 take_hit(DAMAGE_NOESCAPE, damroll(50, 20), "a potion of Detonation", -1);
1001 (void)set_stun(p_ptr->stun + 75);
1002 (void)set_cut(p_ptr->cut + 5000);
1006 case SV_POTION_DEATH:
1007 chg_virtue(V_VITALITY, -1);
1008 chg_virtue(V_UNLIFE, 5);
1010 msg_print("»à¤Îͽ´¶¤¬ÂÎÃæ¤ò¶î¤±¤á¤°¤Ã¤¿¡£");
1011 take_hit(DAMAGE_LOSELIFE, 5000, "»à¤ÎÌô", -1);
1013 msg_print("A feeling of Death flows through your body.");
1014 take_hit(DAMAGE_LOSELIFE, 5000, "a potion of Death", -1);
1020 case SV_POTION_INFRAVISION:
1021 if (set_tim_infra(p_ptr->tim_infra + 100 + randint1(100), FALSE))
1027 case SV_POTION_DETECT_INVIS:
1028 if (set_tim_invis(p_ptr->tim_invis + 12 + randint1(12), FALSE))
1034 case SV_POTION_SLOW_POISON:
1035 if (set_poisoned(p_ptr->poisoned / 2)) ident = TRUE;
1038 case SV_POTION_CURE_POISON:
1039 if (set_poisoned(0)) ident = TRUE;
1042 case SV_POTION_BOLDNESS:
1043 if (set_afraid(0)) ident = TRUE;
1046 case SV_POTION_SPEED:
1049 if (set_fast(randint1(25) + 15, FALSE)) ident = TRUE;
1053 (void)set_fast(p_ptr->fast + 5, FALSE);
1057 case SV_POTION_RESIST_HEAT:
1058 if (set_oppose_fire(p_ptr->oppose_fire + randint1(10) + 10, FALSE))
1064 case SV_POTION_RESIST_COLD:
1065 if (set_oppose_cold(p_ptr->oppose_cold + randint1(10) + 10, FALSE))
1071 case SV_POTION_HEROISM:
1072 if (set_afraid(0)) ident = TRUE;
1073 if (set_hero(p_ptr->hero + randint1(25) + 25, FALSE)) ident = TRUE;
1074 if (hp_player(10)) ident = TRUE;
1077 case SV_POTION_BESERK_STRENGTH:
1078 if (set_afraid(0)) ident = TRUE;
1079 if (set_shero(p_ptr->shero + randint1(25) + 25, FALSE)) ident = TRUE;
1080 if (hp_player(30)) ident = TRUE;
1083 case SV_POTION_CURE_LIGHT:
1084 if (hp_player(damroll(2, 8))) ident = TRUE;
1085 if (set_blind(0)) ident = TRUE;
1086 if (set_cut(p_ptr->cut - 10)) ident = TRUE;
1087 if (set_shero(0,TRUE)) ident = TRUE;
1090 case SV_POTION_CURE_SERIOUS:
1091 if (hp_player(damroll(4, 8))) ident = TRUE;
1092 if (set_blind(0)) ident = TRUE;
1093 if (set_confused(0)) ident = TRUE;
1094 if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;
1095 if (set_shero(0,TRUE)) ident = TRUE;
1098 case SV_POTION_CURE_CRITICAL:
1099 if (hp_player(damroll(6, 8))) ident = TRUE;
1100 if (set_blind(0)) ident = TRUE;
1101 if (set_confused(0)) ident = TRUE;
1102 if (set_poisoned(0)) ident = TRUE;
1103 if (set_stun(0)) ident = TRUE;
1104 if (set_cut(0)) ident = TRUE;
1105 if (set_shero(0,TRUE)) ident = TRUE;
1108 case SV_POTION_HEALING:
1109 if (hp_player(300)) ident = TRUE;
1110 if (set_blind(0)) ident = TRUE;
1111 if (set_confused(0)) ident = TRUE;
1112 if (set_poisoned(0)) ident = TRUE;
1113 if (set_stun(0)) ident = TRUE;
1114 if (set_cut(0)) ident = TRUE;
1115 if (set_shero(0,TRUE)) ident = TRUE;
1118 case SV_POTION_STAR_HEALING:
1119 if (hp_player(1200)) ident = TRUE;
1120 if (set_blind(0)) ident = TRUE;
1121 if (set_confused(0)) ident = TRUE;
1122 if (set_poisoned(0)) ident = TRUE;
1123 if (set_stun(0)) ident = TRUE;
1124 if (set_cut(0)) ident = TRUE;
1125 if (set_shero(0,TRUE)) ident = TRUE;
1128 case SV_POTION_LIFE:
1129 chg_virtue(V_VITALITY, 1);
1130 chg_virtue(V_UNLIFE, -5);
1132 msg_print("ÂÎÃæ¤ËÀ¸Ì¿ÎϤ¬Ëþ¤Á¤¢¤Õ¤ì¤Æ¤¤¿¡ª");
1134 msg_print("You feel life flow through your body!");
1138 (void)set_poisoned(0);
1140 (void)set_confused(0);
1144 (void)do_res_stat(A_STR);
1145 (void)do_res_stat(A_CON);
1146 (void)do_res_stat(A_DEX);
1147 (void)do_res_stat(A_WIS);
1148 (void)do_res_stat(A_INT);
1149 (void)do_res_stat(A_CHR);
1150 (void)set_shero(0,TRUE);
1156 case SV_POTION_RESTORE_MANA:
1157 if (p_ptr->pclass == CLASS_MAGIC_EATER)
1160 for (i = 0; i < EATER_EXT*2; i++)
1162 p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i]*EATER_CHARGE/3;
1163 if (p_ptr->magic_num1[i] > p_ptr->magic_num2[i]*EATER_CHARGE) p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*EATER_CHARGE;
1165 for (; i < EATER_EXT*3; i++)
1167 int k_idx = lookup_kind(TV_ROD, i-EATER_EXT*2);
1168 p_ptr->magic_num1[i] -= ((p_ptr->magic_num2[i] < 10) ? EATER_ROD_CHARGE*3 : p_ptr->magic_num2[i]*EATER_ROD_CHARGE/3)*k_info[k_idx].pval;
1169 if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
1172 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
1174 msg_print("You feel your head clear.");
1176 p_ptr->window |= (PW_PLAYER);
1179 else if (p_ptr->csp < p_ptr->msp)
1181 p_ptr->csp = p_ptr->msp;
1182 p_ptr->csp_frac = 0;
1184 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
1186 msg_print("You feel your head clear.");
1189 p_ptr->redraw |= (PR_MANA);
1190 p_ptr->window |= (PW_PLAYER);
1191 p_ptr->window |= (PW_SPELL);
1194 if (set_shero(0,TRUE)) ident = TRUE;
1197 case SV_POTION_RESTORE_EXP:
1198 if (restore_level()) ident = TRUE;
1201 case SV_POTION_RES_STR:
1202 if (do_res_stat(A_STR)) ident = TRUE;
1205 case SV_POTION_RES_INT:
1206 if (do_res_stat(A_INT)) ident = TRUE;
1209 case SV_POTION_RES_WIS:
1210 if (do_res_stat(A_WIS)) ident = TRUE;
1213 case SV_POTION_RES_DEX:
1214 if (do_res_stat(A_DEX)) ident = TRUE;
1217 case SV_POTION_RES_CON:
1218 if (do_res_stat(A_CON)) ident = TRUE;
1221 case SV_POTION_RES_CHR:
1222 if (do_res_stat(A_CHR)) ident = TRUE;
1225 case SV_POTION_INC_STR:
1226 if (do_inc_stat(A_STR)) ident = TRUE;
1229 case SV_POTION_INC_INT:
1230 if (do_inc_stat(A_INT)) ident = TRUE;
1233 case SV_POTION_INC_WIS:
1234 if (do_inc_stat(A_WIS)) ident = TRUE;
1237 case SV_POTION_INC_DEX:
1238 if (do_inc_stat(A_DEX)) ident = TRUE;
1241 case SV_POTION_INC_CON:
1242 if (do_inc_stat(A_CON)) ident = TRUE;
1245 case SV_POTION_INC_CHR:
1246 if (do_inc_stat(A_CHR)) ident = TRUE;
1249 case SV_POTION_AUGMENTATION:
1250 if (do_inc_stat(A_STR)) ident = TRUE;
1251 if (do_inc_stat(A_INT)) ident = TRUE;
1252 if (do_inc_stat(A_WIS)) ident = TRUE;
1253 if (do_inc_stat(A_DEX)) ident = TRUE;
1254 if (do_inc_stat(A_CON)) ident = TRUE;
1255 if (do_inc_stat(A_CHR)) ident = TRUE;
1258 case SV_POTION_ENLIGHTENMENT:
1260 msg_print("¼«Ê¬¤ÎÃÖ¤«¤ì¤Æ¤¤¤ë¾õ¶·¤¬Ç¾Î¢¤ËÉ⤫¤ó¤Ç¤¤¿...");
1262 msg_print("An image of your surroundings forms in your mind...");
1265 chg_virtue(V_KNOWLEDGE, 1);
1266 chg_virtue(V_ENLIGHTEN, 1);
1271 case SV_POTION_STAR_ENLIGHTENMENT:
1273 msg_print("¹¹¤Ê¤ë·¼Ìؤò´¶¤¸¤¿...");
1275 msg_print("You begin to feel more enlightened...");
1278 chg_virtue(V_KNOWLEDGE, 1);
1279 chg_virtue(V_ENLIGHTEN, 2);
1282 (void)do_inc_stat(A_INT);
1283 (void)do_inc_stat(A_WIS);
1284 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
1285 (void)detect_doors(DETECT_RAD_DEFAULT);
1286 (void)detect_stairs(DETECT_RAD_DEFAULT);
1287 (void)detect_treasure(DETECT_RAD_DEFAULT);
1288 (void)detect_objects_gold(DETECT_RAD_DEFAULT);
1289 (void)detect_objects_normal(DETECT_RAD_DEFAULT);
1295 case SV_POTION_SELF_KNOWLEDGE:
1297 msg_print("¼«Ê¬¼«¿È¤Î¤³¤È¤¬¾¯¤·¤Ïʬ¤«¤Ã¤¿µ¤¤¬¤¹¤ë...");
1299 msg_print("You begin to know yourself a little better...");
1307 case SV_POTION_EXPERIENCE:
1308 if (p_ptr->prace == RACE_ANDROID) break;
1309 chg_virtue(V_ENLIGHTEN, 1);
1310 if (p_ptr->exp < PY_MAX_EXP)
1312 s32b ee = (p_ptr->exp / 2) + 10;
1313 if (ee > 100000L) ee = 100000L;
1315 msg_print("¹¹¤Ë·Ð¸³¤òÀѤó¤À¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1317 msg_print("You feel more experienced.");
1325 case SV_POTION_RESISTANCE:
1326 (void)set_oppose_acid(p_ptr->oppose_acid + randint1(20) + 20, FALSE);
1327 (void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
1328 (void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
1329 (void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
1330 (void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
1334 case SV_POTION_CURING:
1335 if (hp_player(50)) ident = TRUE;
1336 if (set_blind(0)) ident = TRUE;
1337 if (set_poisoned(0)) ident = TRUE;
1338 if (set_confused(0)) ident = TRUE;
1339 if (set_stun(0)) ident = TRUE;
1340 if (set_cut(0)) ident = TRUE;
1341 if (set_image(0)) ident = TRUE;
1344 case SV_POTION_INVULNERABILITY:
1345 (void)set_invuln(p_ptr->invuln + randint1(4) + 4, FALSE);
1349 case SV_POTION_NEW_LIFE:
1350 do_cmd_rerate(FALSE);
1352 p_ptr->update |= PU_BONUS;
1353 if (p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3)
1355 chg_virtue(V_CHANCE, -5);
1357 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
1359 msg_print("You are cured of all mutations.");
1362 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
1363 p_ptr->update |= PU_BONUS;
1365 mutant_regenerate_mod = calc_mutant_regenerate_mod();
1370 case SV_POTION_NEO_TSUYOSHI:
1372 (void)set_tsuyoshi(p_ptr->tsuyoshi + randint1(100) + 100, FALSE);
1376 case SV_POTION_TSUYOSHI:
1378 msg_print("¡Ö¥ª¥¯¥ì·»¤µ¤ó¡ª¡×");
1380 msg_print("Brother OKURE!");
1383 p_ptr->tsuyoshi = 1;
1384 (void)set_tsuyoshi(0, TRUE);
1385 if (!p_ptr->resist_chaos)
1387 (void)set_image(50 + randint1(50));
1392 case SV_POTION_POLYMORPH:
1393 if ((p_ptr->muta1 || p_ptr->muta2 || p_ptr->muta3) && one_in_(23))
1395 chg_virtue(V_CHANCE, -5);
1397 msg_print("Á´¤Æ¤ÎÆÍÁ³ÊÑ°Û¤¬¼£¤Ã¤¿¡£");
1399 msg_print("You are cured of all mutations.");
1402 p_ptr->muta1 = p_ptr->muta2 = p_ptr->muta3 = 0;
1403 p_ptr->update |= PU_BONUS;
1412 if(gain_random_mutation(0)) ident = TRUE;
1414 else if (lose_mutation(0)) ident = TRUE;
1415 } while(!ident || one_in_(2));
1421 if (prace_is_(RACE_SKELETON))
1424 msg_print("±ÕÂΤΰìÉô¤Ï¤¢¤Ê¤¿¤Î¥¢¥´¤òÁÇÄ̤ꤷ¤ÆÍî¤Á¤¿¡ª");
1426 msg_print("Some of the fluid falls through your jaws!");
1429 (void)potion_smash_effect(0, py, px, q_ptr->k_idx);
1432 /* Combine / Reorder the pack (later) */
1433 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
1435 if (!(object_is_aware(o_ptr)))
1437 chg_virtue(V_PATIENCE, -1);
1438 chg_virtue(V_CHANCE, 1);
1439 chg_virtue(V_KNOWLEDGE, -1);
1442 /* The item has been tried */
1443 object_tried(q_ptr);
1445 /* An identification was made */
1446 if (ident && !object_is_aware(q_ptr))
1448 object_aware(q_ptr);
1449 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
1453 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
1455 /* Potions can feed the player */
1456 switch (p_ptr->mimic_form)
1459 switch (p_ptr->prace)
1462 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
1471 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1474 if (o_ptr->tval == TV_FLASK)
1477 msg_print("¥ª¥¤¥ë¤òÊäµë¤·¤¿¡£");
1479 msg_print("You replenish yourself with the oil.");
1481 set_food(p_ptr->food + 5000);
1485 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1490 msg_print("¿åʬ¤ò¼è¤ê¹þ¤ó¤À¡£");
1492 msg_print("You are moistened.");
1494 set_food(MIN(p_ptr->food + o_ptr->pval + MAX(0, o_ptr->pval * 10) + 2000, PY_FOOD_MAX - 1));
1497 (void)set_food(p_ptr->food + o_ptr->pval);
1502 case MIMIC_DEMON_LORD:
1503 set_food(p_ptr->food + ((o_ptr->pval) / 20));
1506 (void)set_food(p_ptr->food + (o_ptr->pval / 10));
1509 (void)set_food(p_ptr->food + o_ptr->pval);
1516 * Hook to determine if an object can be quaffed
1518 static bool item_tester_hook_quaff(object_type *o_ptr)
1520 if (o_ptr->tval == TV_POTION) return TRUE;
1522 if (prace_is_(RACE_ANDROID))
1524 if (o_ptr->tval == TV_FLASK && o_ptr->sval == SV_FLASK_OIL)
1533 * Quaff some potion (from the pack or floor)
1535 void do_cmd_quaff_potion(void)
1540 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
1542 set_action(ACTION_NONE);
1545 /* Restrict choices to potions */
1546 item_tester_hook = item_tester_hook_quaff;
1550 q = "¤É¤ÎÌô¤ò°û¤ß¤Þ¤¹¤«? ";
1551 s = "°û¤á¤ëÌô¤¬¤Ê¤¤¡£";
1553 q = "Quaff which potion? ";
1554 s = "You have no potions to quaff.";
1557 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
1559 /* Quaff the potion */
1560 do_cmd_quaff_potion_aux(item);
1565 * Read a scroll (from the pack or floor).
1567 * Certain scrolls can be "aborted" without losing the scroll. These
1568 * include scrolls with no effects but recharge or identify, which are
1569 * cancelled before use. XXX Reading them still takes a turn, though.
1571 static void do_cmd_read_scroll_aux(int item, bool known)
1573 int k, used_up, ident, lev;
1578 /* Get the item (in the pack) */
1581 o_ptr = &inventory[item];
1584 /* Get the item (on the floor) */
1587 o_ptr = &o_list[0 - item];
1596 if (flush_failure) flush();
1598 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
1600 msg_print("Nothing happen.");
1607 if (p_ptr->pclass == CLASS_BERSERKER)
1610 msg_print("´¬Êª¤Ê¤ó¤ÆÆɤá¤Ê¤¤¡£");
1612 msg_print("You cannot read.");
1617 if (music_singing_any()) stop_singing();
1619 /* Not identified yet */
1623 lev = k_info[o_ptr->k_idx].level;
1625 /* Assume the scroll will get used up */
1628 if (o_ptr->tval == TV_SCROLL)
1630 /* Analyze the scroll */
1631 switch (o_ptr->sval)
1633 case SV_SCROLL_DARKNESS:
1635 if (!(p_ptr->resist_blind) && !(p_ptr->resist_dark))
1637 (void)set_blind(p_ptr->blind + 3 + randint1(5));
1639 if (unlite_area(10, 3)) ident = TRUE;
1643 case SV_SCROLL_AGGRAVATE_MONSTER:
1646 msg_print("¥«¥ó¹â¤¯¤¦¤Ê¤ëÍͤʲ»¤¬ÊÕ¤ê¤òʤ¤Ã¤¿¡£");
1648 msg_print("There is a high pitched humming noise.");
1651 aggravate_monsters(0);
1656 case SV_SCROLL_CURSE_ARMOR:
1658 if (curse_armor()) ident = TRUE;
1662 case SV_SCROLL_CURSE_WEAPON:
1665 if (buki_motteruka(INVEN_RARM))
1668 if (buki_motteruka(INVEN_LARM) && one_in_(2)) k = INVEN_LARM;
1670 else if (buki_motteruka(INVEN_LARM)) k = INVEN_LARM;
1671 if (k && curse_weapon(FALSE, k)) ident = TRUE;
1675 case SV_SCROLL_SUMMON_MONSTER:
1677 for (k = 0; k < randint1(3); k++)
1679 if (summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
1687 case SV_SCROLL_SUMMON_UNDEAD:
1689 for (k = 0; k < randint1(3); k++)
1691 if (summon_specific(0, py, px, dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
1699 case SV_SCROLL_SUMMON_PET:
1701 if (summon_specific(-1, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_FORCE_PET)))
1708 case SV_SCROLL_SUMMON_KIN:
1710 if (summon_kin_player(p_ptr->lev, py, px, (PM_FORCE_PET | PM_ALLOW_GROUP)))
1717 case SV_SCROLL_TRAP_CREATION:
1719 if (trap_creation(py, px)) ident = TRUE;
1723 case SV_SCROLL_PHASE_DOOR:
1725 teleport_player(10, 0L);
1730 case SV_SCROLL_TELEPORT:
1732 teleport_player(100, 0L);
1737 case SV_SCROLL_TELEPORT_LEVEL:
1739 (void)teleport_level(0);
1744 case SV_SCROLL_WORD_OF_RECALL:
1746 if (!word_of_recall()) used_up = FALSE;
1751 case SV_SCROLL_IDENTIFY:
1753 if (!ident_spell(FALSE)) used_up = FALSE;
1758 case SV_SCROLL_STAR_IDENTIFY:
1760 if (!identify_fully(FALSE)) used_up = FALSE;
1765 case SV_SCROLL_REMOVE_CURSE:
1770 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1772 msg_print("You feel as if someone is watching over you.");
1780 case SV_SCROLL_STAR_REMOVE_CURSE:
1782 if (remove_all_curse())
1785 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
1787 msg_print("You feel as if someone is watching over you.");
1794 case SV_SCROLL_ENCHANT_ARMOR:
1797 if (!enchant_spell(0, 0, 1)) used_up = FALSE;
1801 case SV_SCROLL_ENCHANT_WEAPON_TO_HIT:
1803 if (!enchant_spell(1, 0, 0)) used_up = FALSE;
1808 case SV_SCROLL_ENCHANT_WEAPON_TO_DAM:
1810 if (!enchant_spell(0, 1, 0)) used_up = FALSE;
1815 case SV_SCROLL_STAR_ENCHANT_ARMOR:
1817 if (!enchant_spell(0, 0, randint1(3) + 2)) used_up = FALSE;
1822 case SV_SCROLL_STAR_ENCHANT_WEAPON:
1824 if (!enchant_spell(randint1(3), randint1(3), 0)) used_up = FALSE;
1829 case SV_SCROLL_RECHARGING:
1831 if (!recharge(130)) used_up = FALSE;
1836 case SV_SCROLL_MUNDANITY:
1839 if (!mundane_spell(FALSE)) used_up = FALSE;
1843 case SV_SCROLL_LIGHT:
1845 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
1849 case SV_SCROLL_MAPPING:
1851 map_area(DETECT_RAD_MAP);
1856 case SV_SCROLL_DETECT_GOLD:
1858 if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
1859 if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
1863 case SV_SCROLL_DETECT_ITEM:
1865 if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
1869 case SV_SCROLL_DETECT_TRAP:
1871 if (detect_traps(DETECT_RAD_DEFAULT, known)) ident = TRUE;
1875 case SV_SCROLL_DETECT_DOOR:
1877 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
1878 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
1882 case SV_SCROLL_DETECT_INVIS:
1884 if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
1888 case SV_SCROLL_SATISFY_HUNGER:
1890 if (set_food(PY_FOOD_MAX - 1)) ident = TRUE;
1894 case SV_SCROLL_BLESSING:
1896 if (set_blessed(p_ptr->blessed + randint1(12) + 6, FALSE)) ident = TRUE;
1900 case SV_SCROLL_HOLY_CHANT:
1902 if (set_blessed(p_ptr->blessed + randint1(24) + 12, FALSE)) ident = TRUE;
1906 case SV_SCROLL_HOLY_PRAYER:
1908 if (set_blessed(p_ptr->blessed + randint1(48) + 24, FALSE)) ident = TRUE;
1912 case SV_SCROLL_MONSTER_CONFUSION:
1914 if (!(p_ptr->special_attack & ATTACK_CONFUSE))
1917 msg_print("¼ê¤¬µ±¤»Ï¤á¤¿¡£");
1919 msg_print("Your hands begin to glow.");
1922 p_ptr->special_attack |= ATTACK_CONFUSE;
1923 p_ptr->redraw |= (PR_STATUS);
1929 case SV_SCROLL_PROTECTION_FROM_EVIL:
1932 if (set_protevil(p_ptr->protevil + randint1(25) + k, FALSE)) ident = TRUE;
1936 case SV_SCROLL_RUNE_OF_PROTECTION:
1943 case SV_SCROLL_TRAP_DOOR_DESTRUCTION:
1945 if (destroy_doors_touch()) ident = TRUE;
1949 case SV_SCROLL_STAR_DESTRUCTION:
1951 if (destroy_area(py, px, 13 + randint0(5), FALSE))
1955 msg_print("¥À¥ó¥¸¥ç¥ó¤¬Íɤ줿...");
1957 msg_print("The dungeon trembles...");
1964 case SV_SCROLL_DISPEL_UNDEAD:
1966 if (dispel_undead(80)) ident = TRUE;
1970 case SV_SCROLL_SPELL:
1972 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;
1973 p_ptr->add_spells++;
1974 p_ptr->update |= (PU_SPELLS);
1979 case SV_SCROLL_GENOCIDE:
1981 (void)symbol_genocide(300, TRUE);
1986 case SV_SCROLL_MASS_GENOCIDE:
1988 (void)mass_genocide(300, TRUE);
1993 case SV_SCROLL_ACQUIREMENT:
1995 acquirement(py, px, 1, TRUE, FALSE);
2000 case SV_SCROLL_STAR_ACQUIREMENT:
2002 acquirement(py, px, randint1(2) + 1, TRUE, FALSE);
2007 /* New Hengband scrolls */
2008 case SV_SCROLL_FIRE:
2010 fire_ball(GF_FIRE, 0, 666, 4);
2011 /* Note: "Double" damage since it is centered on the player ... */
2012 if (!(IS_OPPOSE_FIRE() || p_ptr->resist_fire || p_ptr->immune_fire))
2014 take_hit(DAMAGE_NOESCAPE, 50+randint1(50), "±ê¤Î´¬Êª", -1);
2016 take_hit(DAMAGE_NOESCAPE, 50 + randint1(50), "a Scroll of Fire", -1);
2026 fire_ball(GF_ICE, 0, 777, 4);
2027 if (!(IS_OPPOSE_COLD() || p_ptr->resist_cold || p_ptr->immune_cold))
2029 take_hit(DAMAGE_NOESCAPE, 100+randint1(100), "ɹ¤Î´¬Êª", -1);
2031 take_hit(DAMAGE_NOESCAPE, 100 + randint1(100), "a Scroll of Ice", -1);
2038 case SV_SCROLL_CHAOS:
2040 fire_ball(GF_CHAOS, 0, 1000, 4);
2041 if (!p_ptr->resist_chaos)
2043 take_hit(DAMAGE_NOESCAPE, 111+randint1(111), "¥í¥°¥ë¥¹¤Î´¬Êª", -1);
2045 take_hit(DAMAGE_NOESCAPE, 111 + randint1(111), "a Scroll of Logrus", -1);
2052 case SV_SCROLL_RUMOR:
2056 switch (randint1(20))
2060 err = get_rnd_line("chainswd_j.txt", 0, Rumor);
2062 err = get_rnd_line("chainswd.txt", 0, Rumor);
2068 err = get_rnd_line("error_j.txt", 0, Rumor);
2070 err = get_rnd_line("error.txt", 0, Rumor);
2078 err = get_rnd_line("death_j.txt", 0, Rumor);
2080 err = get_rnd_line("death.txt", 0, Rumor);
2086 err = get_rnd_line_jonly("rumors_j.txt", 0, Rumor, 10);
2088 err = get_rnd_line("rumors.txt", 0, Rumor);
2094 /* An error occured */
2096 if (err) strcpy(Rumor, "±³¤Î±½¤â¤¢¤ë¡£");
2098 if (err) strcpy(Rumor, "Some rumors are wrong.");
2103 msg_print("´¬Êª¤Ë¤Ï¥á¥Ã¥»¡¼¥¸¤¬½ñ¤«¤ì¤Æ¤¤¤ë:");
2105 msg_print("There is message on the scroll. It says:");
2109 msg_format("%s", Rumor);
2112 msg_print("´¬Êª¤Ï±ì¤òΩ¤Æ¤Æ¾Ã¤¨µî¤Ã¤¿¡ª");
2114 msg_print("The scroll disappears in a puff of smoke!");
2121 case SV_SCROLL_ARTIFACT:
2124 if (!artifact_scroll()) used_up = FALSE;
2128 case SV_SCROLL_RESET_RECALL:
2131 if (!reset_recall()) used_up = FALSE;
2136 else if (o_ptr->name1 == ART_GHB)
2139 msg_print("»ä¤Ï¶ìÏ«¤·¤Æ¡Ø¥°¥ì¡¼¥¿¡¼¡¦¥Ø¥ë=¥Ó¡¼¥¹¥È¡Ù¤òÅݤ·¤¿¡£");
2140 msg_print("¤·¤«¤·¼ê¤ËÆþ¤Ã¤¿¤Î¤Ï¤³¤Î¤¤¿¤Ê¤¤£Ô¥·¥ã¥Ä¤À¤±¤À¤Ã¤¿¡£");
2142 msg_print("I had a very hard time to kill the Greater hell-beast, ");
2143 msg_print("but all I got was this lousy t-shirt!");
2147 else if (o_ptr->name1 == ART_POWER)
2150 msg_print("¡Ö°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤òÅý¤Ù¡¢");
2152 msg_print("°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤ò¸«¤Ä¤±¡¢");
2154 msg_print("°ì¤Ä¤Î»ØÎؤÏÁ´¤Æ¤òÊá¤é¤¨¤Æ");
2156 msg_print("°Å°Ç¤ÎÃæ¤Ë·Ò¤®¤È¤á¤ë¡£¡×");
2158 msg_print("'One Ring to rule them all, ");
2160 msg_print("One Ring to find them, ");
2162 msg_print("One Ring to bring them all ");
2164 msg_print("and in the darkness bind them.'");
2168 else if (o_ptr->tval==TV_PARCHMENT)
2171 char o_name[MAX_NLEN];
2177 q=format("book-%d_jp.txt",o_ptr->sval);
2179 /* Display object description */
2180 object_desc(o_name, o_ptr, OD_NAME_ONLY);
2182 /* Build the filename */
2183 path_build(buf, sizeof(buf), ANGBAND_DIR_FILE, q);
2185 /* Peruse the help file */
2186 (void)show_file(TRUE, buf, o_name, 0, 0);
2195 /* Combine / Reorder the pack (later) */
2196 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2198 if (!(object_is_aware(o_ptr)))
2200 chg_virtue(V_PATIENCE, -1);
2201 chg_virtue(V_CHANCE, 1);
2202 chg_virtue(V_KNOWLEDGE, -1);
2205 /* The item was tried */
2206 object_tried(o_ptr);
2208 /* An identification was made */
2209 if (ident && !object_is_aware(o_ptr))
2211 object_aware(o_ptr);
2212 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
2216 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
2219 /* Hack -- allow certain scrolls to be "preserved" */
2225 sound(SOUND_SCROLL);
2227 /* Destroy a scroll in the pack */
2230 inven_item_increase(item, -1);
2231 inven_item_describe(item);
2232 inven_item_optimize(item);
2235 /* Destroy a scroll on the floor */
2238 floor_item_increase(0 - item, -1);
2239 floor_item_describe(0 - item);
2240 floor_item_optimize(0 - item);
2246 * Hook to determine if an object is readable
2248 static bool item_tester_hook_readable(object_type *o_ptr)
2250 if ((o_ptr->tval==TV_SCROLL) || (o_ptr->tval==TV_PARCHMENT) || (o_ptr->name1 == ART_GHB) || (o_ptr->name1 == ART_POWER)) return (TRUE);
2257 void do_cmd_read_scroll(void)
2263 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
2265 set_action(ACTION_NONE);
2268 /* Check some conditions */
2272 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡£");
2274 msg_print("You can't see anything.");
2282 msg_print("ÌÀ¤«¤ê¤¬¤Ê¤¤¤Î¤Ç¡¢°Å¤¯¤ÆÆɤá¤Ê¤¤¡£");
2284 msg_print("You have no light to read by.");
2289 if (p_ptr->confused)
2292 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡£");
2294 msg_print("You are too confused!");
2301 /* Restrict choices to scrolls */
2302 item_tester_hook = item_tester_hook_readable;
2306 q = "¤É¤Î´¬Êª¤òÆɤߤޤ¹¤«? ";
2307 s = "Æɤá¤ë´¬Êª¤¬¤Ê¤¤¡£";
2309 q = "Read which scroll? ";
2310 s = "You have no scrolls to read.";
2313 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
2315 /* Get the item (in the pack) */
2318 o_ptr = &inventory[item];
2321 /* Get the item (on the floor) */
2324 o_ptr = &o_list[0 - item];
2327 /* Read the scroll */
2328 do_cmd_read_scroll_aux(item, object_is_aware(o_ptr));
2332 static int staff_effect(int sval, bool *use_charge, bool magic, bool known)
2337 /* Analyze the staff */
2340 case SV_STAFF_DARKNESS:
2342 if (!(p_ptr->resist_blind) && !(p_ptr->resist_dark))
2344 if (set_blind(p_ptr->blind + 3 + randint1(5))) ident = TRUE;
2346 if (unlite_area(10, 3)) ident = TRUE;
2350 case SV_STAFF_SLOWNESS:
2352 if (set_slow(p_ptr->slow + randint1(30) + 15, FALSE)) ident = TRUE;
2356 case SV_STAFF_HASTE_MONSTERS:
2358 if (speed_monsters()) ident = TRUE;
2362 case SV_STAFF_SUMMONING:
2364 for (k = 0; k < randint1(4); k++)
2366 if (summon_specific(0, py, px, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET)))
2374 case SV_STAFF_TELEPORTATION:
2376 teleport_player(100, 0L);
2381 case SV_STAFF_IDENTIFY:
2383 if (!ident_spell(FALSE)) *use_charge = FALSE;
2388 case SV_STAFF_REMOVE_CURSE:
2395 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
2397 msg_print("You feel as if someone is watching over you.");
2400 else if (!p_ptr->blind)
2403 msg_print("¾ó¤Ï°ì½Ö¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
2405 msg_print("The staff glows blue for a moment...");
2414 case SV_STAFF_STARLITE:
2416 int num = damroll(5, 3);
2420 if (!p_ptr->blind && !magic)
2423 msg_print("¾ó¤ÎÀ褬ÌÀ¤ë¤¯µ±¤¤¤¿...");
2425 msg_print("The end of the staff glows brightly...");
2429 for (k = 0; k < num; k++)
2435 scatter(&y, &x, py, px, 4, 0);
2437 if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
2439 if (!player_bold(y, x)) break;
2442 project(0, 0, y, x, damroll(6 + p_ptr->lev / 8, 10), GF_LITE_WEAK,
2443 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_KILL), -1);
2451 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
2455 case SV_STAFF_MAPPING:
2457 map_area(DETECT_RAD_MAP);
2462 case SV_STAFF_DETECT_GOLD:
2464 if (detect_treasure(DETECT_RAD_DEFAULT)) ident = TRUE;
2465 if (detect_objects_gold(DETECT_RAD_DEFAULT)) ident = TRUE;
2469 case SV_STAFF_DETECT_ITEM:
2471 if (detect_objects_normal(DETECT_RAD_DEFAULT)) ident = TRUE;
2475 case SV_STAFF_DETECT_TRAP:
2477 if (detect_traps(DETECT_RAD_DEFAULT, known)) ident = TRUE;
2481 case SV_STAFF_DETECT_DOOR:
2483 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
2484 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
2488 case SV_STAFF_DETECT_INVIS:
2490 if (detect_monsters_invis(DETECT_RAD_DEFAULT)) ident = TRUE;
2494 case SV_STAFF_DETECT_EVIL:
2496 if (detect_monsters_evil(DETECT_RAD_DEFAULT)) ident = TRUE;
2500 case SV_STAFF_CURE_LIGHT:
2502 if (hp_player(damroll(2, 8))) ident = TRUE;
2503 if (set_shero(0,TRUE)) ident = TRUE;
2507 case SV_STAFF_CURING:
2509 if (set_blind(0)) ident = TRUE;
2510 if (set_poisoned(0)) ident = TRUE;
2511 if (set_confused(0)) ident = TRUE;
2512 if (set_stun(0)) ident = TRUE;
2513 if (set_cut(0)) ident = TRUE;
2514 if (set_image(0)) ident = TRUE;
2515 if (set_shero(0,TRUE)) ident = TRUE;
2519 case SV_STAFF_HEALING:
2521 if (hp_player(300)) ident = TRUE;
2522 if (set_stun(0)) ident = TRUE;
2523 if (set_cut(0)) ident = TRUE;
2524 if (set_shero(0,TRUE)) ident = TRUE;
2528 case SV_STAFF_THE_MAGI:
2530 if (do_res_stat(A_INT)) ident = TRUE;
2531 if (p_ptr->csp < p_ptr->msp)
2533 p_ptr->csp = p_ptr->msp;
2534 p_ptr->csp_frac = 0;
2537 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
2539 msg_print("You feel your head clear.");
2542 p_ptr->redraw |= (PR_MANA);
2543 p_ptr->window |= (PW_PLAYER);
2544 p_ptr->window |= (PW_SPELL);
2546 if (set_shero(0,TRUE)) ident = TRUE;
2550 case SV_STAFF_SLEEP_MONSTERS:
2552 if (sleep_monsters()) ident = TRUE;
2556 case SV_STAFF_SLOW_MONSTERS:
2558 if (slow_monsters()) ident = TRUE;
2562 case SV_STAFF_SPEED:
2564 if (set_fast(randint1(30) + 15, FALSE)) ident = TRUE;
2568 case SV_STAFF_PROBING:
2575 case SV_STAFF_DISPEL_EVIL:
2577 if (dispel_evil(80)) ident = TRUE;
2581 case SV_STAFF_POWER:
2583 if (dispel_monsters(150)) ident = TRUE;
2587 case SV_STAFF_HOLINESS:
2589 if (dispel_evil(150)) ident = TRUE;
2591 if (set_protevil((magic ? 0 : p_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
2592 if (set_poisoned(0)) ident = TRUE;
2593 if (set_afraid(0)) ident = TRUE;
2594 if (hp_player(50)) ident = TRUE;
2595 if (set_stun(0)) ident = TRUE;
2596 if (set_cut(0)) ident = TRUE;
2600 case SV_STAFF_GENOCIDE:
2602 (void)symbol_genocide((magic ? p_ptr->lev + 50 : 200), TRUE);
2607 case SV_STAFF_EARTHQUAKES:
2609 if (earthquake(py, px, 10))
2613 msg_print("¥À¥ó¥¸¥ç¥ó¤¬Íɤ줿¡£");
2615 msg_print("The dungeon trembles.");
2622 case SV_STAFF_DESTRUCTION:
2624 if (destroy_area(py, px, 13 + randint0(5), FALSE))
2630 case SV_STAFF_ANIMATE_DEAD:
2632 if (animate_dead(0, py, px))
2638 case SV_STAFF_MSTORM:
2641 msg_print("¶¯ÎϤÊËâÎϤ¬Å¨¤ò°ú¤Îö¤¤¤¿¡ª");
2643 msg_print("Mighty magics rend your enemies!");
2645 project(0, 5, py, px,
2646 (randint1(200) + 300) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
2647 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))
2650 (void)take_hit(DAMAGE_NOESCAPE, 50, "¥³¥ó¥È¥í¡¼¥ë¤·Æñ¤¤¶¯ÎϤÊËâÎϤβòÊü", -1);
2652 (void)take_hit(DAMAGE_NOESCAPE, 50, "unleashing magics too mighty to control", -1);
2660 case SV_STAFF_NOTHING:
2663 msg_print("²¿¤âµ¯¤é¤Ê¤«¤Ã¤¿¡£");
2665 msg_print("Nothing happen.");
2667 if (prace_is_(RACE_SKELETON) || prace_is_(RACE_GOLEM) ||
2668 prace_is_(RACE_ZOMBIE) || prace_is_(RACE_SPECTRE))
2670 msg_print("¤â¤Ã¤¿¤¤¤Ê¤¤»ö¤ò¤·¤¿¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£¿©¤Ùʪ¤ÏÂçÀڤˤ·¤Ê¤¯¤Æ¤Ï¡£");
2672 msg_print("What a waste. It's your food!");
2681 * Use a staff. -RAK-
2683 * One charge of one staff disappears.
2685 * Hack -- staffs of identify can be "cancelled".
2687 static void do_cmd_use_staff_aux(int item)
2689 int ident, chance, lev;
2693 /* Hack -- let staffs of identify get aborted */
2694 bool use_charge = TRUE;
2697 /* Get the item (in the pack) */
2700 o_ptr = &inventory[item];
2703 /* Get the item (on the floor) */
2706 o_ptr = &o_list[0 - item];
2710 /* Mega-Hack -- refuse to use a pile from the ground */
2711 if ((item < 0) && (o_ptr->number > 1))
2714 msg_print("¤Þ¤º¤Ï¾ó¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
2716 msg_print("You must first pick up the staffs.");
2726 /* Extract the item level */
2727 lev = k_info[o_ptr->k_idx].level;
2728 if (lev > 50) lev = 50 + (lev - 50)/2;
2730 /* Base chance of success */
2731 chance = p_ptr->skill_dev;
2733 /* Confusion hurts skill */
2734 if (p_ptr->confused) chance = chance / 2;
2736 /* Hight level objects are harder */
2737 chance = chance - lev;
2739 /* Give everyone a (slight) chance */
2740 if ((chance < USE_DEVICE) && one_in_(USE_DEVICE - chance + 1))
2742 chance = USE_DEVICE;
2747 if (flush_failure) flush();
2749 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
2751 msg_print("Nothing happen. Maybe this staff is freezing too.");
2758 /* Roll for usage */
2759 if ((chance < USE_DEVICE) || (randint1(chance) < USE_DEVICE) || (p_ptr->pclass == CLASS_BERSERKER))
2761 if (flush_failure) flush();
2763 msg_print("¾ó¤ò¤¦¤Þ¤¯»È¤¨¤Ê¤«¤Ã¤¿¡£");
2765 msg_print("You failed to use the staff properly.");
2772 /* Notice empty staffs */
2773 if (o_ptr->pval <= 0)
2775 if (flush_failure) flush();
2777 msg_print("¤³¤Î¾ó¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£");
2779 msg_print("The staff has no charges left.");
2782 o_ptr->ident |= (IDENT_EMPTY);
2784 /* Combine / Reorder the pack (later) */
2785 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2786 p_ptr->window |= (PW_INVEN);
2795 ident = staff_effect(o_ptr->sval, &use_charge, FALSE, object_is_aware(o_ptr));
2797 if (!(object_is_aware(o_ptr)))
2799 chg_virtue(V_PATIENCE, -1);
2800 chg_virtue(V_CHANCE, 1);
2801 chg_virtue(V_KNOWLEDGE, -1);
2804 /* Combine / Reorder the pack (later) */
2805 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
2807 /* Tried the item */
2808 object_tried(o_ptr);
2810 /* An identification was made */
2811 if (ident && !object_is_aware(o_ptr))
2813 object_aware(o_ptr);
2814 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
2818 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
2821 /* Hack -- some uses are "free" */
2822 if (!use_charge) return;
2825 /* Use a single charge */
2828 /* XXX Hack -- unstack if necessary */
2829 if ((item >= 0) && (o_ptr->number > 1))
2834 /* Get local object */
2837 /* Obtain a local object */
2838 object_copy(q_ptr, o_ptr);
2840 /* Modify quantity */
2843 /* Restore the charges */
2846 /* Unstack the used item */
2848 p_ptr->total_weight -= q_ptr->weight;
2849 item = inven_carry(q_ptr);
2853 msg_print("¾ó¤ò¤Þ¤È¤á¤Ê¤ª¤·¤¿¡£");
2855 msg_print("You unstack your staff.");
2860 /* Describe charges in the pack */
2863 inven_item_charges(item);
2866 /* Describe charges on the floor */
2869 floor_item_charges(0 - item);
2874 void do_cmd_use_staff(void)
2879 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
2881 set_action(ACTION_NONE);
2884 /* Restrict choices to wands */
2885 item_tester_tval = TV_STAFF;
2889 q = "¤É¤Î¾ó¤ò»È¤¤¤Þ¤¹¤«? ";
2890 s = "»È¤¨¤ë¾ó¤¬¤Ê¤¤¡£";
2892 q = "Use which staff? ";
2893 s = "You have no staff to use.";
2896 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
2898 do_cmd_use_staff_aux(item);
2902 static int wand_effect(int sval, int dir, bool magic)
2906 /* XXX Hack -- Wand of wonder can do anything before it */
2907 if (sval == SV_WAND_WONDER)
2909 int vir = virtue_number(V_CHANCE);
2910 sval = randint0(SV_WAND_WONDER);
2914 if (p_ptr->virtues[vir - 1] > 0)
2916 while (randint1(300) < p_ptr->virtues[vir - 1]) sval++;
2917 if (sval > SV_WAND_COLD_BALL) sval = randint0(4) + SV_WAND_ACID_BALL;
2921 while (randint1(300) < (0-p_ptr->virtues[vir - 1])) sval--;
2922 if (sval < SV_WAND_HEAL_MONSTER) sval = randint0(3) + SV_WAND_HEAL_MONSTER;
2925 if (sval < SV_WAND_TELEPORT_AWAY)
2926 chg_virtue(V_CHANCE, 1);
2929 /* Analyze the wand */
2932 case SV_WAND_HEAL_MONSTER:
2934 if (heal_monster(dir, damroll(10, 10))) ident = TRUE;
2938 case SV_WAND_HASTE_MONSTER:
2940 if (speed_monster(dir)) ident = TRUE;
2944 case SV_WAND_CLONE_MONSTER:
2946 if (clone_monster(dir)) ident = TRUE;
2950 case SV_WAND_TELEPORT_AWAY:
2952 if (teleport_monster(dir)) ident = TRUE;
2956 case SV_WAND_DISARMING:
2958 if (disarm_trap(dir)) ident = TRUE;
2962 case SV_WAND_TRAP_DOOR_DEST:
2964 if (destroy_door(dir)) ident = TRUE;
2968 case SV_WAND_STONE_TO_MUD:
2970 if (wall_to_mud(dir)) ident = TRUE;
2977 msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
2979 msg_print("A line of blue shimmering light appears.");
2982 (void)lite_line(dir);
2987 case SV_WAND_SLEEP_MONSTER:
2989 if (sleep_monster(dir)) ident = TRUE;
2993 case SV_WAND_SLOW_MONSTER:
2995 if (slow_monster(dir)) ident = TRUE;
2999 case SV_WAND_CONFUSE_MONSTER:
3001 if (confuse_monster(dir, p_ptr->lev)) ident = TRUE;
3005 case SV_WAND_FEAR_MONSTER:
3007 if (fear_monster(dir, p_ptr->lev)) ident = TRUE;
3011 case SV_WAND_DRAIN_LIFE:
3013 if (drain_life(dir, 80 + p_ptr->lev)) ident = TRUE;
3017 case SV_WAND_POLYMORPH:
3019 if (poly_monster(dir)) ident = TRUE;
3023 case SV_WAND_STINKING_CLOUD:
3025 fire_ball(GF_POIS, dir, 12 + p_ptr->lev / 4, 2);
3030 case SV_WAND_MAGIC_MISSILE:
3032 fire_bolt_or_beam(20, GF_MISSILE, dir, damroll(2 + p_ptr->lev / 10, 6));
3037 case SV_WAND_ACID_BOLT:
3039 fire_bolt_or_beam(20, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
3044 case SV_WAND_CHARM_MONSTER:
3046 if (charm_monster(dir, MAX(20, p_ptr->lev)))
3051 case SV_WAND_FIRE_BOLT:
3053 fire_bolt_or_beam(20, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
3058 case SV_WAND_COLD_BOLT:
3060 fire_bolt_or_beam(20, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
3065 case SV_WAND_ACID_BALL:
3067 fire_ball(GF_ACID, dir, 60 + 3 * p_ptr->lev / 4, 2);
3072 case SV_WAND_ELEC_BALL:
3074 fire_ball(GF_ELEC, dir, 40 + 3 * p_ptr->lev / 4, 2);
3079 case SV_WAND_FIRE_BALL:
3081 fire_ball(GF_FIRE, dir, 70 + 3 * p_ptr->lev / 4, 2);
3086 case SV_WAND_COLD_BALL:
3088 fire_ball(GF_COLD, dir, 50 + 3 * p_ptr->lev / 4, 2);
3093 case SV_WAND_WONDER:
3096 msg_print("¤ª¤Ã¤È¡¢Ææ¤ÎËâË¡ËÀ¤ò»ÏÆ°¤µ¤»¤¿¡£");
3098 msg_print("Oops. Wand of wonder activated.");
3104 case SV_WAND_DRAGON_FIRE:
3106 fire_ball(GF_FIRE, dir, 200, -3);
3111 case SV_WAND_DRAGON_COLD:
3113 fire_ball(GF_COLD, dir, 180, -3);
3118 case SV_WAND_DRAGON_BREATH:
3120 switch (randint1(5))
3124 fire_ball(GF_ACID, dir, 240, -3);
3130 fire_ball(GF_ELEC, dir, 210, -3);
3136 fire_ball(GF_FIRE, dir, 240, -3);
3142 fire_ball(GF_COLD, dir, 210, -3);
3148 fire_ball(GF_POIS, dir, 180, -3);
3157 case SV_WAND_DISINTEGRATE:
3159 fire_ball(GF_DISINTEGRATE, dir, 200 + randint1(p_ptr->lev * 2), 2);
3164 case SV_WAND_ROCKETS:
3167 msg_print("¥í¥±¥Ã¥È¤òȯ¼Í¤·¤¿¡ª");
3169 msg_print("You launch a rocket!");
3172 fire_rocket(GF_ROCKET, dir, 250 + p_ptr->lev * 3, 2);
3177 case SV_WAND_STRIKING:
3179 fire_bolt(GF_METEOR, dir, damroll(15 + p_ptr->lev / 3, 13));
3184 case SV_WAND_GENOCIDE:
3186 fire_ball_hide(GF_GENOCIDE, dir, magic ? p_ptr->lev + 50 : 250, 0);
3196 * Aim a wand (from the pack or floor).
3198 * Use a single charge from a single item.
3199 * Handle "unstacking" in a logical manner.
3201 * For simplicity, you cannot use a stack of items from the
3202 * ground. This would require too much nasty code.
3204 * There are no wands which can "destroy" themselves, in the inventory
3205 * or on the ground, so we can ignore this possibility. Note that this
3206 * required giving "wand of wonder" the ability to ignore destruction
3207 * by electric balls.
3209 * All wands can be "cancelled" at the "Direction?" prompt for free.
3211 * Note that the basic "bolt" wands do slightly less damage than the
3212 * basic "bolt" rods, but the basic "ball" wands do the same damage
3213 * as the basic "ball" rods.
3215 static void do_cmd_aim_wand_aux(int item)
3217 int lev, ident, chance, dir;
3219 bool old_target_pet = target_pet;
3221 /* Get the item (in the pack) */
3224 o_ptr = &inventory[item];
3227 /* Get the item (on the floor) */
3230 o_ptr = &o_list[0 - item];
3233 /* Mega-Hack -- refuse to aim a pile from the ground */
3234 if ((item < 0) && (o_ptr->number > 1))
3237 msg_print("¤Þ¤º¤ÏËâË¡ËÀ¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
3239 msg_print("You must first pick up the wands.");
3246 /* Allow direction to be cancelled for free */
3247 if (object_is_aware(o_ptr) && (o_ptr->sval == SV_WAND_HEAL_MONSTER
3248 || o_ptr->sval == SV_WAND_HASTE_MONSTER))
3250 if (!get_aim_dir(&dir))
3252 target_pet = old_target_pet;
3255 target_pet = old_target_pet;
3261 lev = k_info[o_ptr->k_idx].level;
3262 if (lev > 50) lev = 50 + (lev - 50)/2;
3264 /* Base chance of success */
3265 chance = p_ptr->skill_dev;
3267 /* Confusion hurts skill */
3268 if (p_ptr->confused) chance = chance / 2;
3270 /* Hight level objects are harder */
3271 chance = chance - lev;
3273 /* Give everyone a (slight) chance */
3274 if ((chance < USE_DEVICE) && one_in_(USE_DEVICE - chance + 1))
3276 chance = USE_DEVICE;
3281 if (flush_failure) flush();
3283 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3285 msg_print("Nothing happen. Maybe this wand is freezing too.");
3292 /* Roll for usage */
3293 if ((chance < USE_DEVICE) || (randint1(chance) < USE_DEVICE) || (p_ptr->pclass == CLASS_BERSERKER))
3295 if (flush_failure) flush();
3297 msg_print("ËâË¡ËÀ¤ò¤¦¤Þ¤¯»È¤¨¤Ê¤«¤Ã¤¿¡£");
3299 msg_print("You failed to use the wand properly.");
3306 /* The wand is already empty! */
3307 if (o_ptr->pval <= 0)
3309 if (flush_failure) flush();
3311 msg_print("¤³¤ÎËâË¡ËÀ¤Ë¤Ï¤â¤¦ËâÎϤ¬»Ä¤Ã¤Æ¤¤¤Ê¤¤¡£");
3313 msg_print("The wand has no charges left.");
3316 o_ptr->ident |= (IDENT_EMPTY);
3318 /* Combine / Reorder the pack (later) */
3319 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3320 p_ptr->window |= (PW_INVEN);
3328 ident = wand_effect(o_ptr->sval, dir, FALSE);
3330 /* Combine / Reorder the pack (later) */
3331 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3333 if (!(object_is_aware(o_ptr)))
3335 chg_virtue(V_PATIENCE, -1);
3336 chg_virtue(V_CHANCE, 1);
3337 chg_virtue(V_KNOWLEDGE, -1);
3340 /* Mark it as tried */
3341 object_tried(o_ptr);
3343 /* Apply identification */
3344 if (ident && !object_is_aware(o_ptr))
3346 object_aware(o_ptr);
3347 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
3351 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3354 /* Use a single charge */
3357 /* Describe the charges in the pack */
3360 inven_item_charges(item);
3363 /* Describe the charges on the floor */
3366 floor_item_charges(0 - item);
3371 void do_cmd_aim_wand(void)
3376 /* Restrict choices to wands */
3377 item_tester_tval = TV_WAND;
3379 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
3381 set_action(ACTION_NONE);
3386 q = "¤É¤ÎËâË¡ËÀ¤ÇÁÀ¤¤¤Þ¤¹¤«? ";
3387 s = "»È¤¨¤ëËâË¡ËÀ¤¬¤Ê¤¤¡£";
3389 q = "Aim which wand? ";
3390 s = "You have no wand to aim.";
3393 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
3396 do_cmd_aim_wand_aux(item);
3400 static int rod_effect(int sval, int dir, bool *use_charge, bool magic)
3407 /* Analyze the rod */
3410 case SV_ROD_DETECT_TRAP:
3412 if (detect_traps(DETECT_RAD_DEFAULT, (bool)(dir ? FALSE : TRUE))) ident = TRUE;
3416 case SV_ROD_DETECT_DOOR:
3418 if (detect_doors(DETECT_RAD_DEFAULT)) ident = TRUE;
3419 if (detect_stairs(DETECT_RAD_DEFAULT)) ident = TRUE;
3423 case SV_ROD_IDENTIFY:
3425 if (!ident_spell(FALSE)) *use_charge = FALSE;
3432 if (!word_of_recall()) *use_charge = FALSE;
3437 case SV_ROD_ILLUMINATION:
3439 if (lite_area(damroll(2, 8), 2)) ident = TRUE;
3443 case SV_ROD_MAPPING:
3445 map_area(DETECT_RAD_MAP);
3450 case SV_ROD_DETECTION:
3452 detect_all(DETECT_RAD_DEFAULT);
3457 case SV_ROD_PROBING:
3466 if (set_blind(0)) ident = TRUE;
3467 if (set_poisoned(0)) ident = TRUE;
3468 if (set_confused(0)) ident = TRUE;
3469 if (set_stun(0)) ident = TRUE;
3470 if (set_cut(0)) ident = TRUE;
3471 if (set_image(0)) ident = TRUE;
3472 if (set_shero(0,TRUE)) ident = TRUE;
3476 case SV_ROD_HEALING:
3478 if (hp_player(500)) ident = TRUE;
3479 if (set_stun(0)) ident = TRUE;
3480 if (set_cut(0)) ident = TRUE;
3481 if (set_shero(0,TRUE)) ident = TRUE;
3485 case SV_ROD_RESTORATION:
3487 if (restore_level()) ident = TRUE;
3488 if (do_res_stat(A_STR)) ident = TRUE;
3489 if (do_res_stat(A_INT)) ident = TRUE;
3490 if (do_res_stat(A_WIS)) ident = TRUE;
3491 if (do_res_stat(A_DEX)) ident = TRUE;
3492 if (do_res_stat(A_CON)) ident = TRUE;
3493 if (do_res_stat(A_CHR)) ident = TRUE;
3499 if (set_fast(randint1(30) + 15, FALSE)) ident = TRUE;
3503 case SV_ROD_PESTICIDE:
3505 if (dispel_monsters(4)) ident = TRUE;
3509 case SV_ROD_TELEPORT_AWAY:
3511 if (teleport_monster(dir)) ident = TRUE;
3515 case SV_ROD_DISARMING:
3517 if (disarm_trap(dir)) ident = TRUE;
3524 msg_print("ÀĤ¯µ±¤¯¸÷Àþ¤¬Êü¤¿¤ì¤¿¡£");
3526 msg_print("A line of blue shimmering light appears.");
3529 (void)lite_line(dir);
3534 case SV_ROD_SLEEP_MONSTER:
3536 if (sleep_monster(dir)) ident = TRUE;
3540 case SV_ROD_SLOW_MONSTER:
3542 if (slow_monster(dir)) ident = TRUE;
3546 case SV_ROD_DRAIN_LIFE:
3548 if (drain_life(dir, 70 + 3 * p_ptr->lev / 2)) ident = TRUE;
3552 case SV_ROD_POLYMORPH:
3554 if (poly_monster(dir)) ident = TRUE;
3558 case SV_ROD_ACID_BOLT:
3560 fire_bolt_or_beam(10, GF_ACID, dir, damroll(6 + p_ptr->lev / 7, 8));
3565 case SV_ROD_ELEC_BOLT:
3567 fire_bolt_or_beam(10, GF_ELEC, dir, damroll(4 + p_ptr->lev / 9, 8));
3572 case SV_ROD_FIRE_BOLT:
3574 fire_bolt_or_beam(10, GF_FIRE, dir, damroll(7 + p_ptr->lev / 6, 8));
3579 case SV_ROD_COLD_BOLT:
3581 fire_bolt_or_beam(10, GF_COLD, dir, damroll(5 + p_ptr->lev / 8, 8));
3586 case SV_ROD_ACID_BALL:
3588 fire_ball(GF_ACID, dir, 60 + p_ptr->lev, 2);
3593 case SV_ROD_ELEC_BALL:
3595 fire_ball(GF_ELEC, dir, 40 + p_ptr->lev, 2);
3600 case SV_ROD_FIRE_BALL:
3602 fire_ball(GF_FIRE, dir, 70 + p_ptr->lev, 2);
3607 case SV_ROD_COLD_BALL:
3609 fire_ball(GF_COLD, dir, 50 + p_ptr->lev, 2);
3621 case SV_ROD_STONE_TO_MUD:
3623 if (wall_to_mud(dir)) ident = TRUE;
3627 case SV_ROD_AGGRAVATE:
3629 aggravate_monsters(0);
3638 * Activate (zap) a Rod
3640 * Unstack fully charged rods as needed.
3642 * Hack -- rods of perception/genocide can be "cancelled"
3643 * All rods can be cancelled at the "Direction?" prompt
3645 * pvals are defined for each rod in k_info. -LM-
3647 static void do_cmd_zap_rod_aux(int item)
3649 int ident, chance, lev, fail;
3654 /* Hack -- let perception get aborted */
3655 bool use_charge = TRUE;
3659 /* Get the item (in the pack) */
3662 o_ptr = &inventory[item];
3665 /* Get the item (on the floor) */
3668 o_ptr = &o_list[0 - item];
3672 /* Mega-Hack -- refuse to zap a pile from the ground */
3673 if ((item < 0) && (o_ptr->number > 1))
3676 msg_print("¤Þ¤º¤Ï¥í¥Ã¥É¤ò½¦¤ï¤Ê¤±¤ì¤Ð¡£");
3678 msg_print("You must first pick up the rods.");
3685 /* Get a direction (unless KNOWN not to need it) */
3686 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)) ||
3687 !object_is_aware(o_ptr))
3689 /* Get a direction, allow cancel */
3690 if (!get_aim_dir(&dir)) return;
3697 /* Extract the item level */
3698 lev = k_info[o_ptr->k_idx].level;
3700 /* Base chance of success */
3701 chance = p_ptr->skill_dev;
3703 /* Confusion hurts skill */
3704 if (p_ptr->confused) chance = chance / 2;
3707 if (chance > fail) fail -= (chance - fail)*2;
3708 else chance -= (fail - chance)*2;
3709 if (fail < USE_DEVICE) fail = USE_DEVICE;
3710 if (chance < USE_DEVICE) chance = USE_DEVICE;
3714 if (flush_failure) flush();
3716 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
3718 msg_print("Nothing happen. Maybe this rod is freezing too.");
3725 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
3726 else if (chance > fail)
3728 if (randint0(chance*2) < fail) success = FALSE;
3729 else success = TRUE;
3733 if (randint0(fail*2) < chance) success = TRUE;
3734 else success = FALSE;
3737 /* Roll for usage */
3740 if (flush_failure) flush();
3742 msg_print("¤¦¤Þ¤¯¥í¥Ã¥É¤ò»È¤¨¤Ê¤«¤Ã¤¿¡£");
3744 msg_print("You failed to use the rod properly.");
3751 k_ptr = &k_info[o_ptr->k_idx];
3753 /* A single rod is still charging */
3754 if ((o_ptr->number == 1) && (o_ptr->timeout))
3756 if (flush_failure) flush();
3758 msg_print("¤³¤Î¥í¥Ã¥É¤Ï¤Þ¤ÀËâÎϤò½¼Å¶¤·¤Æ¤¤¤ëºÇÃæ¤À¡£");
3760 msg_print("The rod is still charging.");
3765 /* A stack of rods lacks enough energy. */
3766 else if ((o_ptr->number > 1) && (o_ptr->timeout > k_ptr->pval * (o_ptr->number - 1)))
3768 if (flush_failure) flush();
3770 msg_print("¤½¤Î¥í¥Ã¥É¤Ï¤Þ¤À½¼Å¶Ãæ¤Ç¤¹¡£");
3772 msg_print("The rods are all still charging.");
3781 ident = rod_effect(o_ptr->sval, dir, &use_charge, FALSE);
3783 /* Increase the timeout by the rod kind's pval. -LM- */
3784 if (use_charge) o_ptr->timeout += k_ptr->pval;
3786 /* Combine / Reorder the pack (later) */
3787 p_ptr->notice |= (PN_COMBINE | PN_REORDER);
3789 if (!(object_is_aware(o_ptr)))
3791 chg_virtue(V_PATIENCE, -1);
3792 chg_virtue(V_CHANCE, 1);
3793 chg_virtue(V_KNOWLEDGE, -1);
3796 /* Tried the object */
3797 object_tried(o_ptr);
3799 /* Successfully determined the object function */
3800 if (ident && !object_is_aware(o_ptr))
3802 object_aware(o_ptr);
3803 gain_exp((lev + (p_ptr->lev >> 1)) / p_ptr->lev);
3807 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
3811 void do_cmd_zap_rod(void)
3816 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
3818 set_action(ACTION_NONE);
3821 /* Restrict choices to rods */
3822 item_tester_tval = TV_ROD;
3826 q = "¤É¤Î¥í¥Ã¥É¤ò¿¶¤ê¤Þ¤¹¤«? ";
3827 s = "»È¤¨¤ë¥í¥Ã¥É¤¬¤Ê¤¤¡£";
3829 q = "Zap which rod? ";
3830 s = "You have no rod to zap.";
3833 if (!get_item(&item, q, s, (USE_INVEN | USE_FLOOR))) return;
3836 do_cmd_zap_rod_aux(item);
3841 * Hook to determine if an object is activatable
3843 static bool item_tester_hook_activate(object_type *o_ptr)
3845 u32b flgs[TR_FLAG_SIZE];
3848 if (!object_is_known(o_ptr)) return (FALSE);
3850 /* Extract the flags */
3851 object_flags(o_ptr, flgs);
3853 /* Check activation flag */
3854 if (have_flag(flgs, TR_ACTIVATE)) return (TRUE);
3862 * Hack -- activate the ring of power
3864 void ring_of_power(int dir)
3866 /* Pick a random effect */
3867 switch (randint1(10))
3874 msg_print("¤¢¤Ê¤¿¤Ï°À¤Î¥ª¡¼¥é¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡£");
3876 msg_print("You are surrounded by a malignant aura.");
3881 /* Decrease all stats (permanently) */
3882 (void)dec_stat(A_STR, 50, TRUE);
3883 (void)dec_stat(A_INT, 50, TRUE);
3884 (void)dec_stat(A_WIS, 50, TRUE);
3885 (void)dec_stat(A_DEX, 50, TRUE);
3886 (void)dec_stat(A_CON, 50, TRUE);
3887 (void)dec_stat(A_CHR, 50, TRUE);
3889 /* Lose some experience (permanently) */
3890 p_ptr->exp -= (p_ptr->exp / 4);
3891 p_ptr->max_exp -= (p_ptr->exp / 4);
3901 msg_print("¤¢¤Ê¤¿¤Ï¶¯ÎϤʥª¡¼¥é¤ËÊñ¤ß¹þ¤Þ¤ì¤¿¡£");
3903 msg_print("You are surrounded by a powerful aura.");
3907 /* Dispel monsters */
3908 dispel_monsters(1000);
3918 fire_ball(GF_MANA, dir, 600, 3);
3929 fire_bolt(GF_MANA, dir, 500);
3937 static bool ang_sort_comp_pet(vptr u, vptr v, int a, int b)
3939 u16b *who = (u16b*)(u);
3944 monster_type *m_ptr1 = &m_list[w1];
3945 monster_type *m_ptr2 = &m_list[w2];
3946 monster_race *r_ptr1 = &r_info[m_ptr1->r_idx];
3947 monster_race *r_ptr2 = &r_info[m_ptr2->r_idx];
3952 if (m_ptr1->nickname && !m_ptr2->nickname) return TRUE;
3953 if (m_ptr2->nickname && !m_ptr1->nickname) return FALSE;
3955 if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return TRUE;
3956 if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return FALSE;
3958 if (r_ptr1->level > r_ptr2->level) return TRUE;
3959 if (r_ptr2->level > r_ptr1->level) return FALSE;
3961 if (m_ptr1->hp > m_ptr2->hp) return TRUE;
3962 if (m_ptr2->hp > m_ptr1->hp) return FALSE;
3968 * Activate a wielded object. Wielded objects never stack.
3969 * And even if they did, activatable objects never stack.
3971 * Currently, only (some) artifacts, and Dragon Scale Mail, can be activated.
3972 * But one could, for example, easily make an activatable "Ring of Plasma".
3974 * Note that it always takes a turn to activate an artifact, even if
3975 * the user hits "escape" at the "direction" prompt.
3977 static void do_cmd_activate_aux(int item)
3979 int k, dir, lev, chance, fail;
3984 /* Get the item (in the pack) */
3987 o_ptr = &inventory[item];
3990 /* Get the item (on the floor) */
3993 o_ptr = &o_list[0 - item];
3999 /* Extract the item level */
4000 lev = k_info[o_ptr->k_idx].level;
4002 /* Hack -- use artifact level instead */
4003 if (object_is_fixed_artifact(o_ptr)) lev = a_info[o_ptr->name1].level;
4004 else if (o_ptr->art_name)
4006 switch (o_ptr->xtra2)
4014 case ACT_CURE_POISON:
4034 case ACT_RESIST_ALL:
4035 case ACT_DETECT_ALL:
4048 case ACT_BANISH_EVIL:
4056 case ACT_CHARM_ANIMAL:
4057 case ACT_SUMMON_ANIMAL:
4060 case ACT_XTRA_SPEED:
4061 case ACT_DETECT_XTRA:
4069 case ACT_CHARM_UNDEAD:
4070 case ACT_CHARM_OTHER:
4071 case ACT_SUMMON_PHANTOM:
4072 case ACT_SUMMON_ELEMENTAL:
4073 case ACT_RUNE_EXPLO:
4077 case ACT_CHARM_ANIMALS:
4078 case ACT_CHARM_OTHERS:
4085 case ACT_CALL_CHAOS:
4090 case ACT_SUMMON_UNDEAD:
4091 case ACT_SUMMON_DEMON:
4102 else if (((o_ptr->tval == TV_RING) || (o_ptr->tval == TV_AMULET)) && o_ptr->name2) lev = e_info[o_ptr->name2].level;
4104 /* Base chance of success */
4105 chance = p_ptr->skill_dev;
4107 /* Confusion hurts skill */
4108 if (p_ptr->confused) chance = chance / 2;
4111 if (chance > fail) fail -= (chance - fail)*2;
4112 else chance -= (fail - chance)*2;
4113 if (fail < USE_DEVICE) fail = USE_DEVICE;
4114 if (chance < USE_DEVICE) chance = USE_DEVICE;
4118 if (flush_failure) flush();
4120 msg_print("»ß¤Þ¤Ã¤¿»þ¤ÎÃæ¤Ç¤Ï¤¦¤Þ¤¯Æ¯¤«¤Ê¤¤¤è¤¦¤À¡£");
4122 msg_print("It shows no reaction.");
4129 if (p_ptr->pclass == CLASS_BERSERKER) success = FALSE;
4130 else if (chance > fail)
4132 if (randint0(chance*2) < fail) success = FALSE;
4133 else success = TRUE;
4137 if (randint0(fail*2) < chance) success = TRUE;
4138 else success = FALSE;
4141 /* Roll for usage */
4144 if (flush_failure) flush();
4146 msg_print("¤¦¤Þ¤¯»ÏÆ°¤µ¤»¤ë¤³¤È¤¬¤Ç¤¤Ê¤«¤Ã¤¿¡£");
4148 msg_print("You failed to activate it properly.");
4155 /* Check the recharge */
4159 msg_print("¤½¤ì¤ÏÈù¤«¤Ë²»¤òΩ¤Æ¡¢µ±¤¡¢¾Ã¤¨¤¿...");
4161 msg_print("It whines, glows and fades...");
4168 /* Activate the artifact */
4170 msg_print("»ÏÆ°¤µ¤»¤¿...");
4172 msg_print("You activate it...");
4180 if (o_ptr->art_name && o_ptr->xtra2)
4182 (void)activate_random_artifact(o_ptr);
4185 p_ptr->window |= (PW_INVEN | PW_EQUIP);
4192 else if (object_is_fixed_artifact(o_ptr))
4195 switch (o_ptr->name1)
4200 msg_print("ààÎÜÉÓ¤«¤éÀ¡¤ó¤À¸÷¤¬¤¢¤Õ¤ì½Ð¤¿...");
4202 msg_print("The phial wells with clear light...");
4205 lite_area(damroll(2, 15), 3);
4206 o_ptr->timeout = randint0(10) + 10;
4213 msg_print("À±¤¬âÁ¤·¤¯µ±¤¤¤¿...");
4215 msg_print("The star shines brightly...");
4218 map_area(DETECT_RAD_MAP);
4219 lite_area(damroll(2, 15), 3);
4220 o_ptr->timeout = randint0(50) + 50;
4227 msg_print("¤½¤ÎÊõÀФÏÀÖ¤¯ÌÀ¤ë¤¯¸÷¤Ã¤¿¡ª");
4229 msg_print("The Jewel flashes bright red!");
4232 chg_virtue(V_KNOWLEDGE, 1);
4233 chg_virtue(V_ENLIGHTEN, 1);
4236 msg_print("¤½¤ÎÊõÀФϤ¢¤Ê¤¿¤ÎÂÎÎϤòÃ¥¤Ã¤¿...");
4237 take_hit(DAMAGE_LOSELIFE, damroll(3,8), "¿³È½¤ÎÊõÀÐ", -1);
4239 msg_print("The Jewel drains your vitality...");
4240 take_hit(DAMAGE_LOSELIFE, damroll(3, 8), "the Jewel of Judgement", -1);
4243 (void)detect_traps(DETECT_RAD_DEFAULT, TRUE);
4244 (void)detect_doors(DETECT_RAD_DEFAULT);
4245 (void)detect_stairs(DETECT_RAD_DEFAULT);
4248 if (get_check("µ¢´Ô¤ÎÎϤò»È¤¤¤Þ¤¹¤«¡©"))
4250 if (get_check("Activate recall? "))
4254 (void)word_of_recall();
4257 o_ptr->timeout = randint0(20) + 20;
4264 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
4266 msg_print("The amulet lets out a shrill wail...");
4270 (void)set_protevil(randint1(25) + k, FALSE);
4271 o_ptr->timeout = randint0(225) + 225;
4278 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
4280 msg_print("The amulet floods the area with goodness...");
4283 dispel_evil(p_ptr->lev * 5);
4284 o_ptr->timeout = randint0(200) + 200;
4291 msg_print("¶À¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
4293 msg_print("The mirror floods the area with goodness...");
4296 dispel_evil(p_ptr->lev * 5);
4297 o_ptr->timeout = randint0(200) + 200;
4304 msg_print("¤¢¤Ê¤¿¤Ï¥Õ¥é¥¥¢¤ËŨ¤òÄù¤á»¦¤¹¤è¤¦Ì¿¤¸¤¿¡£");
4306 msg_print("You order Frakir to strangle your opponent.");
4309 if (!get_aim_dir(&dir)) return;
4310 if (drain_life(dir, 100))
4311 o_ptr->timeout = randint0(100) + 100;
4318 msg_print("»ØÎؤÏÌÀ¤ë¤¯µ±¤¤¤¿...");
4320 msg_print("The ring glows brightly...");
4323 (void)set_fast(randint1(75) + 75, FALSE);
4324 o_ptr->timeout = randint0(150) + 150;
4331 msg_print("»ØÎؤϿ¼¹È¤Ëµ±¤¤¤¿...");
4333 msg_print("The ring glows deep red...");
4336 if (!get_aim_dir(&dir)) return;
4337 fire_ball(GF_FIRE, dir, 300, 3);
4338 o_ptr->timeout = randint0(225) + 225;
4345 msg_print("»ØÎؤÏÇò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4347 msg_print("The ring glows bright white...");
4350 if (!get_aim_dir(&dir)) return;
4351 fire_ball(GF_COLD, dir, 400, 3);
4352 o_ptr->timeout = randint0(325) + 325;
4360 msg_format("%s¤Ï¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...", o_ptr->name1 == ART_VILYA ? "»ØÎØ" : "¥½¡¼¥É");
4362 msg_format("The %s glows deep blue...", o_ptr->name1 == ART_VILYA ? "ring" : "sword");
4365 if (!get_aim_dir(&dir)) return;
4366 fire_ball(GF_ELEC, dir, 500, 3);
4367 o_ptr->timeout = randint0(425) + 425;
4375 msg_print("»ØÎؤϼ¿¹õ¤Ëµ±¤¤¤¿...");
4377 msg_print("The ring glows intensely black...");
4380 if (!get_aim_dir(&dir)) return;
4382 o_ptr->timeout = randint0(450) + 450;
4388 int num = damroll(5, 3);
4393 msg_print("³»¤¬°ðºÊ¤Çʤ¤ï¤ì¤¿...");
4395 msg_print("Your armor is surrounded by lightning...");
4399 for (k = 0; k < num; k++)
4405 scatter(&y, &x, py, px, 4, 0);
4407 if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
4409 if (!player_bold(y, x)) break;
4412 project(0, 3, y, x, 150, GF_ELEC,
4413 (PROJECT_THRU | PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
4416 o_ptr->timeout = 1000;
4420 case ART_BLADETURNER:
4422 if (!get_aim_dir(&dir)) return;
4424 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
4426 msg_print("You breathe the elements.");
4429 fire_ball(GF_MISSILE, dir, 300, 4);
4431 msg_print("³»¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...");
4433 msg_print("Your armor glows many colours...");
4436 (void)set_afraid(0);
4437 (void)set_hero(randint1(50) + 50, FALSE);
4438 (void)hp_player(10);
4439 (void)set_blessed(randint1(50) + 50, FALSE);
4440 (void)set_oppose_acid(randint1(50) + 50, FALSE);
4441 (void)set_oppose_elec(randint1(50) + 50, FALSE);
4442 (void)set_oppose_fire(randint1(50) + 50, FALSE);
4443 (void)set_oppose_cold(randint1(50) + 50, FALSE);
4444 (void)set_oppose_pois(randint1(50) + 50, FALSE);
4445 o_ptr->timeout = 400;
4449 case ART_SOULKEEPER:
4452 msg_print("³»¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4453 msg_print("¤Ò¤¸¤ç¤¦¤Ëµ¤Ê¬¤¬¤è¤¤...");
4455 msg_print("Your armor glows a bright white...");
4456 msg_print("You feel much better...");
4459 (void)hp_player(1000);
4461 o_ptr->timeout = 888;
4468 msg_print("Å·¹ñ¤Î²Î¤¬Ê¹¤³¤¨¤ë...");
4470 msg_print("A heavenly choir sings...");
4473 (void)set_poisoned(0);
4476 (void)set_confused(0);
4478 (void)set_hero(randint1(25) + 25, FALSE);
4479 (void)hp_player(777);
4480 o_ptr->timeout = 300;
4487 msg_print("³»¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4489 msg_print("Your armor glows deep blue...");
4492 (void)symbol_genocide(200, TRUE);
4493 o_ptr->timeout = 500;
4500 msg_print("³»¤¬ÀÖ¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4502 msg_print("Your armor glows bright red...");
4505 destroy_doors_touch();
4506 o_ptr->timeout = 10;
4514 turn_monsters(40 + p_ptr->lev);
4515 o_ptr->timeout = 3 * (p_ptr->lev + 10);
4520 case ART_HOLHENNETH:
4523 msg_print("¥Ø¥ë¥á¥Ã¥È¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4524 msg_print("¿´¤Ë¥¤¥á¡¼¥¸¤¬É⤫¤ó¤Ç¤¤¿...");
4526 msg_print("Your helm glows bright white...");
4527 msg_print("An image forms in your mind...");
4530 detect_all(DETECT_RAD_DEFAULT);
4531 o_ptr->timeout = randint0(55) + 55;
4538 msg_print("²¦´§¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4539 msg_print("ÂÎÆâ¤ËÃȤ«¤¤¸ÝÆ°¤¬´¶¤¸¤é¤ì¤ë...");
4541 msg_print("Your crown glows deep blue...");
4542 msg_print("You feel a warm tingling inside...");
4545 (void)hp_player(700);
4547 o_ptr->timeout = 250;
4555 msg_format("%s¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...", o_ptr->name1 == ART_COLLUIN ? "¥¯¥í¡¼¥¯" : "³»");
4557 msg_format("Your %s glows many colours...", o_ptr->name1 == ART_COLLUIN ? "cloak" : "armor");
4560 (void)set_oppose_acid(randint1(20) + 20, FALSE);
4561 (void)set_oppose_elec(randint1(20) + 20, FALSE);
4562 (void)set_oppose_fire(randint1(20) + 20, FALSE);
4563 (void)set_oppose_cold(randint1(20) + 20, FALSE);
4564 (void)set_oppose_pois(randint1(20) + 20, FALSE);
4565 o_ptr->timeout = 111;
4569 case ART_HOLCOLLETH:
4572 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4574 msg_print("Your cloak glows deep blue...");
4577 sleep_monsters_touch();
4578 o_ptr->timeout = 55;
4585 msg_print("¥¯¥í¡¼¥¯¤¬²«¿§¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4587 msg_print("Your cloak glows bright yellow...");
4591 o_ptr->timeout = 70;
4598 msg_print("¥¯¥í¡¼¥¯¤¬ÊÕ¤ê¤Î¶õ´Ö¤ò¤æ¤¬¤Þ¤»¤¿...");
4600 msg_print("Your cloak twists space around you...");
4603 teleport_player(100, 0L);
4604 o_ptr->timeout = 45;
4611 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4613 msg_print("Your cloak glows a deep red...");
4617 o_ptr->timeout = 450;
4621 case ART_CAMMITHRIM:
4624 msg_print("¥°¥í¡¼¥Ö¤¬âÁ¤·¤¤¤¯¤é¤¤¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4626 msg_print("Your gloves glow extremely brightly...");
4629 if (!get_aim_dir(&dir)) return;
4630 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
4638 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4640 msg_print("Your gauntlets are covered in fire...");
4643 if (!get_aim_dir(&dir)) return;
4644 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4645 o_ptr->timeout = randint0(8) + 8;
4649 case ART_PAURNIMMEN:
4652 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4654 msg_print("Your gauntlets are covered in frost...");
4657 if (!get_aim_dir(&dir)) return;
4658 fire_bolt(GF_COLD, dir, damroll(6, 8));
4659 o_ptr->timeout = randint0(7) + 7;
4666 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4668 msg_print("Your gauntlets are covered in sparks...");
4671 if (!get_aim_dir(&dir)) return;
4672 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4673 o_ptr->timeout = randint0(5) + 5;
4680 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬»À¤Ëʤ¤ï¤ì¤¿...");
4682 msg_print("Your gauntlets are covered in acid...");
4685 if (!get_aim_dir(&dir)) return;
4686 fire_bolt(GF_ACID, dir, damroll(5, 8));
4687 o_ptr->timeout = randint0(6) + 6;
4694 msg_print("¥»¥¹¥¿¥¹¤ËËâË¡¤Î¥È¥²¤¬¸½¤ì¤¿...");
4696 msg_print("Your cesti grows magical spikes...");
4699 if (!get_aim_dir(&dir)) return;
4700 fire_bolt(GF_ARROW, dir, 150);
4701 o_ptr->timeout = randint0(90) + 90;
4708 msg_print("¥Ö¡¼¥Ä¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4710 msg_print("Your boots glow bright green...");
4713 (void)set_fast(randint1(20) + 20, FALSE);
4714 o_ptr->timeout = 200;
4721 msg_print("¥Ö¡¼¥Ä¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4723 msg_print("Your boots glow deep blue...");
4726 (void)set_afraid(0);
4727 (void)set_poisoned(0);
4735 msg_print("¥À¥¬¡¼¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4737 msg_print("Your dagger is covered in fire...");
4740 if (!get_aim_dir(&dir)) return;
4741 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4742 o_ptr->timeout = randint0(8) + 8;
4749 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4751 msg_print("Your dagger is covered in frost...");
4754 if (!get_aim_dir(&dir)) return;
4755 fire_bolt(GF_COLD, dir, damroll(6, 8));
4756 o_ptr->timeout = randint0(7) + 7;
4763 msg_print("¥À¥¬¡¼¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4765 msg_print("Your dagger is covered in sparks...");
4768 if (!get_aim_dir(&dir)) return;
4769 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4770 o_ptr->timeout = randint0(5) + 5;
4777 msg_print("¥À¥¬¡¼¤¬¿¼¤¤Îп§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4779 msg_print("Your dagger throbs deep green...");
4782 if (!get_aim_dir(&dir)) return;
4783 fire_ball(GF_POIS, dir, 12, 3);
4784 o_ptr->timeout = randint0(4) + 4;
4791 msg_print("Ì·¤¬¿¼¤¤ÀÄ¿§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4793 msg_print("Your dagger throbs deep blue...");
4796 if (!get_aim_dir(&dir)) return;
4797 fire_ball(GF_WATER, dir, 200, 3);
4798 o_ptr->timeout = 250;
4805 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4807 msg_print("Your dagger is covered in frost...");
4810 if (!get_aim_dir(&dir)) return;
4811 fire_ball(GF_COLD, dir, 48, 2);
4812 o_ptr->timeout = randint0(5) + 5;
4817 case ART_WEREWINDLE:
4819 switch (randint1(13))
4821 case 1: case 2: case 3: case 4: case 5:
4822 teleport_player(10, 0L);
4824 case 6: case 7: case 8: case 9: case 10:
4825 teleport_player(222, 0L);
4828 (void)stair_creation();
4832 if (get_check("¤³¤Î³¬¤òµî¤ê¤Þ¤¹¤«¡©"))
4834 if (get_check("Leave this level? "))
4838 if (autosave_l) do_cmd_save_game(TRUE);
4841 p_ptr->leaving = TRUE;
4844 o_ptr->timeout = 35;
4850 teleport_player(222, 0L);
4851 o_ptr->timeout = 25;
4858 msg_print("¥½¡¼¥É¤¬ÀĤ¯·ã¤·¤¯µ±¤¤¤¿...");
4860 msg_print("Your sword glows an intense blue...");
4863 if (!get_aim_dir(&dir)) return;
4864 fire_ball(GF_COLD, dir, 100, 2);
4865 o_ptr->timeout = 200;
4872 msg_print("¶Ç¤Î»ÕÃĤò¾¤´¤·¤¿¡£");
4874 msg_print("You summon the Legion of the Dawn.");
4877 (void)summon_specific(-1, py, px, dun_level, SUMMON_DAWN, (PM_ALLOW_GROUP | PM_FORCE_PET));
4878 o_ptr->timeout = 500 + randint1(500);
4885 msg_print("¥½¡¼¥É¤¬ÀÖ¤¯·ã¤·¤¯µ±¤¤¤¿...");
4887 msg_print("Your sword glows an intense red...");
4890 if (!get_aim_dir(&dir)) return;
4891 fire_ball(GF_FIRE, dir, 72, 2);
4892 o_ptr->timeout = 400;
4899 msg_print("¥¢¥Ã¥¯¥¹¤Î¿Ï¤¬¹õ¤¯µ±¤¤¤¿...");
4901 msg_print("Your axe blade glows black...");
4904 if (!get_aim_dir(&dir)) return;
4905 drain_life(dir, 120);
4906 o_ptr->timeout = 400;
4913 msg_print("¤¢¤Ê¤¿¤ÎÁä¤ÏÅŵ¤¤Ç¥¹¥Ñ¡¼¥¯¤·¤Æ¤¤¤ë...");
4915 msg_print("Your spear crackles with electricity...");
4918 if (!get_aim_dir(&dir)) return;
4919 fire_ball(GF_ELEC, dir, 100, 3);
4920 o_ptr->timeout = 200;
4927 msg_print("¥¹¥Ô¥¢¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4929 msg_print("Your spear glows a bright white...");
4932 if (!get_aim_dir(&dir)) return;
4933 fire_ball(GF_COLD, dir, 100, 3);
4934 o_ptr->timeout = 200;
4941 msg_print("¥¹¥Ô¥¢¤¬¸ÝÆ°¤·¤¿...");
4943 msg_print("Your spear pulsates...");
4946 if (!get_aim_dir(&dir)) return;
4955 msg_print("¤Ä¤ë¤Ï¤·¤¬¸ÝÆ°¤·¤¿...");
4957 msg_print("Your mattock pulsates...");
4960 if (!get_aim_dir(&dir)) return;
4969 msg_print("¥¢¥Ã¥¯¥¹¤«¤é¤Ò¤É¤¯±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
4971 msg_print("Your axe lets out a long, shrill note...");
4974 (void)mass_genocide(200, TRUE);
4975 o_ptr->timeout = 1000;
4982 msg_print("¥Ð¥È¥ë¡¦¥¢¥Ã¥¯¥¹¤¬¿¼»ç¤Î¸÷¤òÊü¼Í¤·¤¿...");
4984 msg_print("Your battle axe radiates deep purple...");
4987 hp_player(damroll(4, 8));
4988 (void)set_cut((p_ptr->cut / 2) - 50);
4989 o_ptr->timeout = randint0(3) + 3;
4996 msg_print("¥È¥é¥¤¥Ç¥ó¥È¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4998 msg_print("Your trident glows deep red...");
5001 if (!get_aim_dir(&dir)) return;
5002 teleport_monster(dir);
5003 o_ptr->timeout = 150;
5010 msg_print("Âç³ù¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
5012 msg_print("Your scythe glows soft white...");
5014 if (!word_of_recall()) return;
5015 o_ptr->timeout = 200;
5022 msg_print("¸û¶Ì¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
5024 msg_print("Your scythe glows soft white...");
5026 if (!word_of_recall()) return;
5027 o_ptr->timeout = 200;
5034 msg_print("¥Õ¥ì¥¤¥ë¤¬ÍÍ¡¹¤Ê¿§¤Î²Ð²Ö¤òȯ¤·¤¿...");
5036 msg_print("Your flail glows in scintillating colours...");
5039 if (!get_aim_dir(&dir)) return;
5040 confuse_monster(dir, 20);
5041 o_ptr->timeout = 15;
5048 msg_print("¥â¡¼¥Ë¥ó¥°¥¹¥¿¡¼¤«¤é±ê¤¬¿á¤½Ð¤·¤¿...");
5050 msg_print("Your morning star rages in fire...");
5053 if (!get_aim_dir(&dir)) return;
5054 fire_ball(GF_FIRE, dir, 72, 3);
5055 o_ptr->timeout = 100;
5062 msg_print("¥à¥Á¤¬¿¼¤¤ÀÖ¿§¤Ëµ±¤¤¤¿...");
5064 msg_print("Your whip glows deep red...");
5067 if (!get_aim_dir(&dir)) return;
5068 fire_ball(GF_FIRE, dir, 120, 3);
5069 o_ptr->timeout = 15;
5076 msg_print("¥á¥¤¥¹¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
5078 msg_print("Your mace glows bright green...");
5081 (void)set_fast(randint1(20) + 20, FALSE);
5082 o_ptr->timeout = randint0(100) + 100;
5089 msg_print("¥¯¥©¡¼¥¿¡¼¥¹¥¿¥Ã¥Õ¤¬²«¿§¤¯µ±¤¤¤¿...");
5091 msg_print("Your quarterstaff glows yellow...");
5094 if (!ident_spell(FALSE)) return;
5095 o_ptr->timeout = 10;
5102 msg_print("¾ó¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
5104 msg_print("Your quarterstaff glows brightly...");
5107 detect_all(DETECT_RAD_DEFAULT);
5109 identify_fully(FALSE);
5110 o_ptr->timeout = 100;
5117 msg_print("¥Ï¥ó¥Þ¡¼¤¬Çò¤¯µ±¤¤¤¿...");
5119 msg_print("Your hammer glows white...");
5122 if (!get_aim_dir(&dir)) return;
5123 drain_life(dir, 90);
5124 o_ptr->timeout = 70;
5131 msg_print("¥¯¥í¥¹¥Ü¥¦¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
5133 msg_print("Your crossbow glows deep red...");
5136 (void)brand_bolts();
5137 o_ptr->timeout = 999;
5144 int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
5147 msg_print("¤»¤Ã¤«¤¯¤À¤«¤é¡Ø¥¯¥ê¥à¥¾¥ó¡Ù¤ò¤Ö¤Ã¤Ñ¤Ê¤¹¤¼¡ª");
5149 msg_print("I'll fire CRIMSON! SEKKAKUDAKARA!");
5152 if (!get_aim_dir(&dir)) return;
5154 /* Use the given direction */
5155 tx = px + 99 * ddx[dir];
5156 ty = py + 99 * ddy[dir];
5158 /* Hack -- Use an actual "target" */
5159 if ((dir == 5) && target_okay())
5165 if (p_ptr->pclass == CLASS_ARCHER)
5167 /* Extra shot at level 10 */
5168 if (p_ptr->lev >= 10) num++;
5170 /* Extra shot at level 30 */
5171 if (p_ptr->lev >= 30) num++;
5173 /* Extra shot at level 45 */
5174 if (p_ptr->lev >= 45) num++;
5177 for (i = 0; i < num; i++)
5178 project(0, p_ptr->lev/20+1, ty, tx, p_ptr->lev*p_ptr->lev*6/50, GF_ROCKET, flg, -1);
5179 o_ptr->timeout = 15;
5184 monster_type *m_ptr;
5185 monster_race *r_ptr;
5189 msg_print("´ñ̯¤Ê¾ì½ê¤¬Æ¬¤ÎÃæ¤ËÉ⤫¤ó¤À¡¥¡¥¡¥");
5191 msg_print("Some strange places show up in your mind. And you see ...");
5194 /* Process the monsters (backwards) */
5195 for (i = m_max - 1; i >= 1; i--)
5197 /* Access the monster */
5200 /* Ignore "dead" monsters */
5201 if (!m_ptr->r_idx) continue;
5203 r_ptr = &r_info[m_ptr->r_idx];
5205 if(r_ptr->flags1 & RF1_UNIQUE)
5208 msg_format("%s¡¥ ",r_name + r_ptr->name);
5210 msg_format("%s. ",r_name + r_ptr->name);
5214 o_ptr->timeout = 200;
5218 case ART_STONE_LORE:
5221 msg_print("ÀФ¬±£¤µ¤ì¤¿ÈëÌ©¤ò¼Ì¤·½Ð¤·¤¿¡¥¡¥¡¥");
5223 msg_print("The stone reveals hidden mysteries...");
5225 if (!ident_spell(FALSE)) return;
5227 if (mp_ptr->spell_book)
5229 /* Sufficient mana */
5230 if (20 <= p_ptr->csp)
5236 /* Over-exert the player */
5239 int oops = 20 - p_ptr->csp;
5243 p_ptr->csp_frac = 0;
5247 msg_print("ÀФòÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
5249 msg_print("You are too weak to control the stone!");
5252 /* Hack -- Bypass free action */
5253 (void)set_paralyzed(p_ptr->paralyzed +
5254 randint1(5 * oops + 1));
5257 (void)set_confused(p_ptr->confused +
5258 randint1(5 * oops + 1));
5262 p_ptr->redraw |= (PR_MANA);
5266 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "´í¸±¤ÊÈëÌ©", -1);
5268 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "perilous secrets", -1);
5272 if (one_in_(5)) (void)set_confused(p_ptr->confused +
5275 /* Exercise a little care... */
5278 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "´í¸±¤ÊÈëÌ©", -1);
5280 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "perilous secrets", -1);
5288 if (music_singing_any()) stop_singing();
5290 msg_print("¤¢¤Ê¤¿¤ÏÎ϶¯¤¤ÆÍÉ÷¤ò¿á¤ÌĤ餷¤¿¡£¼þ°Ï¤ÎŨ¤¬¿Ì¤¨¾å¤Ã¤Æ¤¤¤ë!");
5292 msg_print("You wind a mighty blast; your enemies tremble!");
5294 (void)turn_monsters((3 * p_ptr->lev / 2) + 10);
5295 o_ptr->timeout = randint0(40) + 40;
5301 msg_print("¤¢¤Ê¤¿¤Ï³²Ãî¤ò°ìÁݤ·¤¿¡£");
5303 msg_print("You exterminate small life.");
5305 (void)dispel_monsters(4);
5306 o_ptr->timeout = randint0(55) + 55;
5313 msg_print("Æߤ¤²»¤¬ÊÕ¤ê¤òÊñ¤ß¤³¤ó¤À¡£");
5315 msg_print("A shrill wailing sound surrounds you.");
5317 (void)set_protevil(randint1(25) + p_ptr->lev, FALSE);
5318 o_ptr->timeout = randint0(200) + 200;
5326 msg_print("¥í¡¼¥Ö¤¬½ã¿è¤ÊËâÎϤǿ̤¨¤¿¡£");
5328 msg_print("The robe pulsates with raw mana...");
5330 if (!get_aim_dir(&dir)) return;
5331 fire_bolt(GF_MANA, dir, 120);
5332 o_ptr->timeout = randint0(120) + 120;
5337 (void)set_fast(randint1(50) + 50, FALSE);
5340 set_hero(randint1(50) + 50, FALSE);
5341 o_ptr->timeout = randint0(200) + 100;
5347 msg_print("¥·¡¼¥ë¥É¤¬âÁ¤·¤¤¸÷¤Çµ±¤¤¤¿¡¥¡¥¡¥");
5349 msg_print("Your shield gleams with blinding light...");
5351 fire_ball(GF_LITE, 0, 300, 6);
5352 confuse_monsters(3 * p_ptr->lev / 2);
5353 o_ptr->timeout = 250;
5359 msg_print("¥«¡¼¥É¤¬Çò¤¯µ±¤¤¤¿¡¥¡¥¡¥");
5361 msg_print("Your card gleams with blinding light...");
5363 if (!recharge(1000)) return;
5364 o_ptr->timeout = 200;
5370 if (get_check("ËÜÅö¤Ë»È¤¤¤Þ¤¹¤«¡©"))
5372 if (get_check("Are you sure?!"))
5376 msg_print("¼Àµ¤¬¿Ì¤¨¤¿¡¥¡¥¡¥");
5378 msg_print("The Muramasa pulsates...");
5384 msg_print("¼Àµ¤Ï²õ¤ì¤¿¡ª");
5386 msg_print("The Muramasa is destroyed!");
5388 curse_weapon(TRUE, item);
5396 msg_print("ÀФ¬ÀÄÇò¤¯¸÷¤Ã¤¿¡¥¡¥¡¥");
5398 msg_print("Your stone glows pale...");
5401 if (!get_aim_dir(&dir)) return;
5402 fire_ball(GF_MANA, dir, 400, 4);
5403 o_ptr->timeout = randint0(250) + 250;
5410 if (!get_rep_dir2(&dir)) return;
5414 if (!cave_have_flag_bold(y, x, FF_WATER))
5417 msg_print("¤½¤³¤Ï¿åÊդǤϤʤ¤¡£");
5419 msg_print("There is no fishing place.");
5423 else if (cave[y][x].m_idx)
5426 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
5428 msg_format("%s¤¬¼ÙËâ¤À¡ª", m_name);
5430 msg_format("%^s is stand in your way.", m_name);
5435 set_action(ACTION_FISH);
5436 p_ptr->redraw |= (PR_STATE);
5441 if (!get_aim_dir(&dir)) return;
5443 msg_print("¥à¥Á¤ò¿¤Ð¤·¤¿¡£");
5445 msg_print("You stretched your whip.");
5448 fetch(dir, 500, TRUE);
5449 o_ptr->timeout = randint0(25) + 25;
5454 u32b mode = PM_ALLOW_GROUP;
5455 bool pet = !one_in_(5);
5456 if (pet) mode |= PM_FORCE_PET;
5457 else mode |= PM_NO_PET;
5459 if (summon_specific((pet ? -1 : 0), py, px, ((p_ptr->lev * 3) / 2), SUMMON_HOUND, mode))
5464 msg_print("¥Ï¥¦¥ó¥É¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5466 msg_print("A group of hounds appear as your servant.");
5471 msg_print("¥Ï¥¦¥ó¥É¤Ï¤¢¤Ê¤¿¤Ë²ç¤ò¸þ¤±¤Æ¤¤¤ë¡ª");
5473 msg_print("A group of hounds appear as your enemy!");
5478 o_ptr->timeout = 300 + randint1(150);
5485 msg_print("¥¹¥Ô¥¢¤ÏâÁ¤·¤¯µ±¤¤¤¿...");
5487 msg_print("Your spear grows brightly...");
5490 if (!get_aim_dir(&dir)) return;
5491 fire_ball(GF_LITE, dir, 200, 3);
5492 o_ptr->timeout = randint0(200) + 200;
5499 monster_type *m_ptr;
5504 if (summon_named_creature(0, py, px, MON_SUKE, PM_FORCE_PET))
5507 msg_print("¡Ø½õ¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5509 msg_print("Suke-san apperars.");
5510 kakusan = "Suke-san";
5514 if (summon_named_creature(0, py, px, MON_KAKU, PM_FORCE_PET))
5517 msg_print("¡Ø³Ê¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5519 msg_print("Kaku-san appears.");
5520 kakusan = "Kaku-san";
5526 for (i = m_max - 1; i > 0; i--)
5529 if (!m_ptr->r_idx) continue;
5530 if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
5531 if (!los(m_ptr->fy, m_ptr->fx, py, px)) continue;
5532 if (!projectable(m_ptr->fy, m_ptr->fx, py, px)) continue;
5541 msg_print("¡Ö¼Ô¤É¤â¡¢¤Ò¤«¤¨¤ª¤í¤¦¡ª¡ª¡ª¤³¤Î¤ªÊý¤ò¤É¤Ê¤¿¤È¤³¤³¤í¤¨¤ë¡£¡×");
5543 msg_format("%^s says 'WHO do you think this person is! Bow your head, down your knees!'", kakusan);
5548 confuse_monsters(120);
5550 stasis_monsters(120);
5556 msg_print("¤·¤«¤·¡¢²¿¤âµ¯¤¤Ê¤«¤Ã¤¿¡£");
5558 msg_print("Nothing happen.");
5561 o_ptr->timeout = randint0(150) + 150;
5568 msg_print("Çï»ÒÌÚ¤òÂǤä¿¡£");
5570 msg_print("You beat Your wooden clappers.");
5572 aggravate_monsters(0);
5579 set_hero(randint1(25)+25, FALSE);
5581 o_ptr->timeout = randint0(30) + 30;
5587 (void)set_poisoned(0);
5588 (void)set_confused(0);
5594 o_ptr->timeout = 100;
5600 if (!get_aim_dir(&dir)) return;
5601 (void)charm_animal(dir, p_ptr->lev);
5603 o_ptr->timeout = 200;
5610 msg_print("¥½¡¼¥É¤¬Ã¸¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
5612 msg_print("Your sword glows a pale blue...");
5614 if (!get_aim_dir(&dir)) return;
5615 fire_bolt(GF_COLD, dir, damroll(12, 8));
5616 o_ptr->timeout = 50;
5623 msg_print("³ù¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
5625 msg_print("Your scythe glows brightly!");
5627 for (i = 0; i < TR_FLAG_SIZE; i++)
5628 o_ptr->art_flags[i] = a_info[ART_BLOOD].flags[i];
5630 dummy = randint1(2)+randint1(2);
5631 for (i = 0; i < dummy; i++)
5633 int flag = randint0(19);
5634 if (flag == 18) add_flag(o_ptr->art_flags, TR_SLAY_HUMAN);
5635 else add_flag(o_ptr->art_flags, TR_CHAOTIC + flag);
5637 dummy = randint1(2);
5638 for (i = 0; i < dummy; i++)
5639 one_resistance(o_ptr);
5641 for (i = 0; i < dummy; i++)
5643 int tmp = randint0(11);
5644 if (tmp < 6) add_flag(o_ptr->art_flags, TR_STR + tmp);
5645 else add_flag(o_ptr->art_flags, TR_STEALTH + tmp - 6);
5647 o_ptr->timeout = 3333;
5648 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
5649 p_ptr->update |= (PU_BONUS | PU_HP);
5655 msg_print("Î϶¯¤¯»Í¸Ô¤òƧ¤ó¤À¡£");
5657 msg_print("You stamp. (as if you are in a ring.)");
5659 (void)set_hero(randint1(20) + 20, FALSE);
5660 dispel_evil(p_ptr->lev * 3);
5661 o_ptr->timeout = 100 + randint1(100);
5667 msg_print("¥¯¥í¡¼¥¯¤¬Çò¤¯µ±¤¤¤¿...");
5669 msg_print("Your cloak grows white.");
5671 (void)set_oppose_cold(randint1(20) + 20, FALSE);
5672 o_ptr->timeout = 40 + randint1(40);
5678 msg_print("¥à¥Á¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
5680 msg_print("The whip lets out a shrill wail...");
5684 (void)set_protevil(randint1(25) + k, FALSE);
5685 o_ptr->timeout = randint0(225) + 225;
5690 u32b mode = PM_ALLOW_GROUP;
5691 bool pet = !one_in_(5);
5692 if (pet) mode |= PM_FORCE_PET;
5694 if (summon_named_creature(0, py, px, MON_JIZOTAKO, mode))
5698 msg_print("Âý¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5700 msg_print("A group of octopuses appear as your servant.");
5705 msg_print("Âý¤Ï¤¢¤Ê¤¿¤òâˤó¤Ç¤¤¤ë¡ª");
5707 msg_print("A group of octopuses appear as your enemy!");
5712 o_ptr->timeout = 300 + randint1(150);
5719 msg_print("Å´µå¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
5721 msg_print("The iron ball floods the area with goodness...");
5724 dispel_evil(p_ptr->lev * 5);
5725 o_ptr->timeout = randint0(100) + 100;
5732 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤¬¿¼¤¤°Ç¤Ëʤ¤ï¤ì¤¿...");
5734 msg_print("Your amulet is coverd in pitch-darkness...");
5736 if (!get_aim_dir(&dir)) return;
5737 fire_ball(GF_DARK, dir, 250, 4);
5738 o_ptr->timeout = randint0(150) + 150;
5744 msg_print("¼óÎؤ¬¿¼¤¤°Ç¤Ëʤ¤ï¤ì¤¿...");
5746 msg_print("Your collar harness is coverd in pitch-darkness...");
5748 if (!get_aim_dir(&dir)) return;
5749 fire_ball(GF_DARK, dir, 250, 4);
5750 o_ptr->timeout = randint0(150) + 150;
5753 case ART_SACRED_KNIGHTS:
5756 msg_print("¼ó¾þ¤ê¤¬¿¿¼Â¤ò¾È¤é¤·½Ð¤¹...");
5758 msg_print("Your amulet exhibits the truth...");
5760 if (remove_all_curse())
5763 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
5765 msg_print("You feel as if someone is watching over you.");
5774 msg_print("¥Ú¥ó¥À¥ó¥È¤¬ÀÄÇò¤¯¸÷¤Ã¤¿¡¥¡¥¡¥");
5776 msg_print("Your pendant glows pale...");
5778 if (p_ptr->pclass == CLASS_MAGIC_EATER)
5781 for (i = 0; i < EATER_EXT*2; i++)
5783 p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i]*EATER_CHARGE/3;
5784 if (p_ptr->magic_num1[i] > p_ptr->magic_num2[i]*EATER_CHARGE) p_ptr->magic_num1[i] = p_ptr->magic_num2[i]*EATER_CHARGE;
5786 for (; i < EATER_EXT*3; i++)
5788 int k_idx = lookup_kind(TV_ROD, i-EATER_EXT*2);
5789 p_ptr->magic_num1[i] -= ((p_ptr->magic_num2[i] < 10) ? EATER_ROD_CHARGE*3 : p_ptr->magic_num2[i]*EATER_ROD_CHARGE/3)*k_info[k_idx].pval;
5790 if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
5793 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
5795 msg_print("You feel your head clear.");
5797 p_ptr->window |= (PW_PLAYER);
5799 else if (p_ptr->csp < p_ptr->msp)
5801 p_ptr->csp = p_ptr->msp;
5802 p_ptr->csp_frac = 0;
5804 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
5806 msg_print("You feel your head clear.");
5809 p_ptr->redraw |= (PR_MANA);
5810 p_ptr->window |= (PW_PLAYER);
5811 p_ptr->window |= (PW_SPELL);
5813 o_ptr->timeout = 777;
5819 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5825 if (object_is_smith(o_ptr))
5827 switch (o_ptr->xtra3-1)
5829 case ESSENCE_TMP_RES_ACID:
5830 (void)set_oppose_acid(randint1(20) + 20, FALSE);
5831 o_ptr->timeout = randint0(50) + 50;
5834 case ESSENCE_TMP_RES_ELEC:
5835 (void)set_oppose_elec(randint1(20) + 20, FALSE);
5836 o_ptr->timeout = randint0(50) + 50;
5839 case ESSENCE_TMP_RES_FIRE:
5840 (void)set_oppose_fire(randint1(20) + 20, FALSE);
5841 o_ptr->timeout = randint0(50) + 50;
5844 case ESSENCE_TMP_RES_COLD:
5845 (void)set_oppose_cold(randint1(20) + 20, FALSE);
5846 o_ptr->timeout = randint0(50) + 50;
5850 earthquake(py, px, 5);
5851 o_ptr->timeout = 100 + randint1(100);
5854 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5862 if (o_ptr->name2 == EGO_TRUMP)
5864 teleport_player(100, 0L);
5865 o_ptr->timeout = 50 + randint1(50);
5868 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5875 if (o_ptr->name2 == EGO_LITE_ILLUMINATION)
5877 if (!o_ptr->xtra4 && ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
5880 msg_print("dzÎÁ¤¬¤Ê¤¤¡£");
5882 msg_print("It has no fuel.");
5887 lite_area(damroll(2, 15), 3);
5888 o_ptr->timeout = randint0(10) + 10;
5891 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5897 if (o_ptr->name2 == EGO_EARTHQUAKES)
5899 earthquake(py, px, 5);
5900 o_ptr->timeout = 100 + randint1(100);
5903 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5910 if (o_ptr->name2 == EGO_JUMP)
5912 teleport_player(10, 0L);
5913 o_ptr->timeout = 10 + randint1(10);
5916 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5923 /* Hack -- Dragon Scale Mail can be activated as well */
5924 if (o_ptr->tval == TV_DRAG_ARMOR)
5926 /* Get a direction for breathing (or abort) */
5927 if (!get_aim_dir(&dir)) return;
5929 if (music_singing_any()) stop_singing();
5931 /* Branch on the sub-type */
5932 switch (o_ptr->sval)
5934 case SV_DRAGON_BLUE:
5937 msg_print("¤¢¤Ê¤¿¤Ï°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5939 msg_print("You breathe lightning.");
5942 fire_ball(GF_ELEC, dir, 100, -2);
5943 o_ptr->timeout = randint0(150) + 150;
5947 case SV_DRAGON_WHITE:
5950 msg_print("¤¢¤Ê¤¿¤ÏÎ䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5952 msg_print("You breathe frost.");
5955 fire_ball(GF_COLD, dir, 110, -2);
5956 o_ptr->timeout = randint0(150) + 150;
5960 case SV_DRAGON_BLACK:
5963 msg_print("¤¢¤Ê¤¿¤Ï»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5965 msg_print("You breathe acid.");
5968 fire_ball(GF_ACID, dir, 130, -2);
5969 o_ptr->timeout = randint0(150) + 150;
5973 case SV_DRAGON_GREEN:
5976 msg_print("¤¢¤Ê¤¿¤ÏÆÇ¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5978 msg_print("You breathe poison gas.");
5981 fire_ball(GF_POIS, dir, 150, -2);
5982 o_ptr->timeout = randint0(180) + 180;
5989 msg_print("¤¢¤Ê¤¿¤Ï²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5991 msg_print("You breathe fire.");
5994 fire_ball(GF_FIRE, dir, 200, -2);
5995 o_ptr->timeout = randint0(200) + 200;
5999 case SV_DRAGON_MULTIHUED:
6001 chance = randint0(5);
6003 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
6004 ((chance == 1) ? "°ðºÊ" :
6005 ((chance == 2) ? "Î䵤" :
6006 ((chance == 3) ? "»À" :
6007 ((chance == 4) ? "ÆÇ¥¬¥¹" : "²Ð±ê")))));
6009 msg_format("You breathe %s.",
6010 ((chance == 1) ? "lightning" :
6011 ((chance == 2) ? "frost" :
6012 ((chance == 3) ? "acid" :
6013 ((chance == 4) ? "poison gas" : "fire")))));
6016 fire_ball(((chance == 1) ? GF_ELEC :
6017 ((chance == 2) ? GF_COLD :
6018 ((chance == 3) ? GF_ACID :
6019 ((chance == 4) ? GF_POIS : GF_FIRE)))),
6021 o_ptr->timeout = randint0(200) + 200;
6025 case SV_DRAGON_BRONZE:
6028 msg_print("¤¢¤Ê¤¿¤Ïº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6030 msg_print("You breathe confusion.");
6033 fire_ball(GF_CONFUSION, dir, 120, -2);
6034 o_ptr->timeout = randint0(180) + 180;
6038 case SV_DRAGON_GOLD:
6041 msg_print("¤¢¤Ê¤¿¤Ï¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6043 msg_print("You breathe sound.");
6046 fire_ball(GF_SOUND, dir, 130, -2);
6047 o_ptr->timeout = randint0(180) + 180;
6051 case SV_DRAGON_CHAOS:
6053 chance = randint0(2);
6055 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
6056 ((chance == 1 ? "¥«¥ª¥¹" : "Îô²½")));
6058 msg_format("You breathe %s.",
6059 ((chance == 1 ? "chaos" : "disenchantment")));
6062 fire_ball((chance == 1 ? GF_CHAOS : GF_DISENCHANT),
6064 o_ptr->timeout = randint0(200) + 200;
6070 chance = randint0(2);
6072 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
6073 ((chance == 1 ? "¹ì²»" : "ÇËÊÒ")));
6075 msg_format("You breathe %s.",
6076 ((chance == 1 ? "sound" : "shards")));
6079 fire_ball((chance == 1 ? GF_SOUND : GF_SHARDS),
6081 o_ptr->timeout = randint0(200) + 200;
6085 case SV_DRAGON_BALANCE:
6087 chance = randint0(4);
6089 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿",
6090 ((chance == 1) ? "¥«¥ª¥¹" :
6091 ((chance == 2) ? "Îô²½" :
6092 ((chance == 3) ? "¹ì²»" : "ÇËÊÒ"))));
6094 msg_format("You breathe %s.",
6095 ((chance == 1) ? "chaos" :
6096 ((chance == 2) ? "disenchantment" :
6097 ((chance == 3) ? "sound" : "shards"))));
6100 fire_ball(((chance == 1) ? GF_CHAOS :
6101 ((chance == 2) ? GF_DISENCHANT :
6102 ((chance == 3) ? GF_SOUND : GF_SHARDS))),
6104 o_ptr->timeout = randint0(200) + 200;
6108 case SV_DRAGON_SHINING:
6110 chance = randint0(2);
6112 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
6113 ((chance == 0 ? "Á®¸÷" : "°Å¹õ")));
6115 msg_format("You breathe %s.",
6116 ((chance == 0 ? "light" : "darkness")));
6119 fire_ball((chance == 0 ? GF_LITE : GF_DARK), dir, 200, -2);
6120 o_ptr->timeout = randint0(200) + 200;
6124 case SV_DRAGON_POWER:
6127 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6129 msg_print("You breathe the elements.");
6132 fire_ball(GF_MISSILE, dir, 300, -3);
6133 o_ptr->timeout = randint0(200) + 200;
6139 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6145 else if (o_ptr->tval == TV_RING)
6147 if (object_is_ego(o_ptr))
6149 bool success = TRUE;
6151 switch (o_ptr->name2)
6154 (void)set_afraid(0);
6155 (void)set_hero(randint1(25) + 25, FALSE);
6156 (void)hp_player(10);
6157 o_ptr->timeout = randint1(100)+100;
6159 case EGO_RING_MAGIC_MIS:
6160 if (!get_aim_dir(&dir)) return;
6161 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
6164 case EGO_RING_FIRE_BOLT:
6165 if (!get_aim_dir(&dir)) return;
6166 fire_bolt(GF_FIRE, dir, damroll(9, 8));
6167 o_ptr->timeout = randint0(8) + 8;
6169 case EGO_RING_COLD_BOLT:
6170 if (!get_aim_dir(&dir)) return;
6171 fire_bolt(GF_COLD, dir, damroll(6, 8));
6172 o_ptr->timeout = randint0(7) + 7;
6174 case EGO_RING_ELEC_BOLT:
6175 if (!get_aim_dir(&dir)) return;
6176 fire_bolt(GF_ELEC, dir, damroll(4, 8));
6177 o_ptr->timeout = randint0(5) + 5;
6179 case EGO_RING_ACID_BOLT:
6180 if (!get_aim_dir(&dir)) return;
6181 fire_bolt(GF_ACID, dir, damroll(5, 8));
6182 o_ptr->timeout = randint0(6) + 6;
6184 case EGO_RING_MANA_BOLT:
6185 if (!get_aim_dir(&dir)) return;
6186 fire_bolt(GF_MANA, dir, 120);
6187 o_ptr->timeout = randint0(120)+120;
6189 case EGO_RING_FIRE_BALL:
6190 if (!get_aim_dir(&dir)) return;
6191 fire_ball(GF_FIRE, dir, 100, 2);
6192 o_ptr->timeout = randint0(80) + 80;
6194 case EGO_RING_COLD_BALL:
6195 if (!get_aim_dir(&dir)) return;
6196 fire_ball(GF_COLD, dir, 100, 2);
6197 o_ptr->timeout = randint0(80) + 80;
6199 case EGO_RING_ELEC_BALL:
6200 if (!get_aim_dir(&dir)) return;
6201 fire_ball(GF_ELEC, dir, 100, 2);
6202 o_ptr->timeout = randint0(80) + 80;
6204 case EGO_RING_ACID_BALL:
6205 if (!get_aim_dir(&dir)) return;
6206 fire_ball(GF_ACID, dir, 100, 2);
6207 o_ptr->timeout = randint0(80) + 80;
6209 case EGO_RING_MANA_BALL:
6210 if (!get_aim_dir(&dir)) return;
6211 fire_ball(GF_MANA, dir, 250, 2);
6212 o_ptr->timeout = 300;
6214 case EGO_RING_DRAGON_F:
6215 if (!get_aim_dir(&dir)) return;
6216 fire_ball(GF_FIRE, dir, 200, -2);
6217 if (o_ptr->sval == SV_RING_FLAMES)
6219 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6220 o_ptr->timeout = 200;
6222 else o_ptr->timeout = 250;
6224 case EGO_RING_DRAGON_C:
6225 if (!get_aim_dir(&dir)) return;
6226 fire_ball(GF_COLD, dir, 200, -2);
6227 if (o_ptr->sval == SV_RING_ICE)
6229 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6230 o_ptr->timeout = 200;
6232 else o_ptr->timeout = 250;
6234 case EGO_RING_M_DETECT:
6235 (void)detect_monsters_invis(255);
6236 (void)detect_monsters_normal(255);
6237 o_ptr->timeout = 150;
6239 case EGO_RING_D_SPEED:
6240 (void)set_fast(randint1(30) + 15, FALSE);
6241 o_ptr->timeout = 100;
6243 case EGO_RING_BERSERKER:
6244 (void)set_shero(randint1(25) + 25, FALSE);
6245 o_ptr->timeout = randint0(75)+75;
6247 case EGO_RING_TELE_AWAY:
6248 if (!get_aim_dir(&dir)) return;
6249 teleport_monster(dir);
6250 o_ptr->timeout = 150;
6254 int v = randint1(25)+25;
6255 (void)set_afraid(0);
6256 (void)set_hero(v, FALSE);
6257 (void)hp_player(10);
6258 (void)set_blessed(v, FALSE);
6259 (void)set_oppose_acid(v, FALSE);
6260 (void)set_oppose_elec(v, FALSE);
6261 (void)set_oppose_fire(v, FALSE);
6262 (void)set_oppose_cold(v, FALSE);
6263 (void)set_oppose_pois(v, FALSE);
6264 (void)set_ultimate_res(v, FALSE);
6265 o_ptr->timeout = 777;
6272 if (success) return;
6275 /* Get a direction for breathing (or abort) */
6276 if (!get_aim_dir(&dir)) return;
6278 switch (o_ptr->sval)
6282 fire_ball(GF_ACID, dir, 100, 2);
6283 (void)set_oppose_acid(randint1(20) + 20, FALSE);
6284 o_ptr->timeout = randint0(50) + 50;
6290 fire_ball(GF_COLD, dir, 100, 2);
6291 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6292 o_ptr->timeout = randint0(50) + 50;
6296 case SV_RING_FLAMES:
6298 fire_ball(GF_FIRE, dir, 100, 2);
6299 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6300 o_ptr->timeout = randint0(50) + 50;
6306 fire_ball(GF_ELEC, dir, 100, 2);
6307 (void)set_oppose_elec(randint1(20) + 20, FALSE);
6308 o_ptr->timeout = randint0(50) + 50;
6314 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6320 else if (o_ptr->tval == TV_AMULET)
6322 if (object_is_ego(o_ptr))
6324 switch (o_ptr->name2)
6327 if (!ident_spell(FALSE)) return;
6328 o_ptr->timeout = 10;
6331 if (!get_aim_dir(&dir)) return;
6332 charm_monster(dir, MAX(20, p_ptr->lev));
6333 o_ptr->timeout = 200;
6336 teleport_player(10, 0L);
6337 o_ptr->timeout = randint0(10) + 10;
6339 case EGO_AMU_TELEPORT:
6340 teleport_player(100, 0L);
6341 o_ptr->timeout = randint0(50) + 50;
6343 case EGO_AMU_D_DOOR:
6344 (void)dimension_door();
6345 o_ptr->timeout = 200;
6347 case EGO_AMU_RES_FIRE_:
6348 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6349 o_ptr->timeout = randint0(50) + 50;
6351 case EGO_AMU_RES_COLD_:
6352 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6353 o_ptr->timeout = randint0(50) + 50;
6355 case EGO_AMU_RES_ELEC_:
6356 (void)set_oppose_elec(randint1(20) + 20, FALSE);
6357 o_ptr->timeout = randint0(50) + 50;
6359 case EGO_AMU_RES_ACID_:
6360 (void)set_oppose_acid(randint1(20) + 20, FALSE);
6361 o_ptr->timeout = randint0(50) + 50;
6363 case EGO_AMU_DETECTION:
6364 detect_all(DETECT_RAD_DEFAULT);
6365 o_ptr->timeout = randint0(55)+55;
6372 else if (o_ptr->tval == TV_WHISTLE)
6374 if (music_singing_any()) stop_singing();
6377 if (object_is_cursed(o_ptr))
6380 msg_print("¥«¥ó¹â¤¤²»¤¬¶Á¤ÅϤä¿¡£");
6382 msg_print("You produce a shrill whistling sound.");
6384 aggravate_monsters(0);
6394 /* Allocate the "who" array */
6395 C_MAKE(who, max_m_idx, u16b);
6397 /* Process the monsters (backwards) */
6398 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6400 if (is_pet(&m_list[pet_ctr]) && (p_ptr->riding != pet_ctr))
6401 who[max_pet++] = pet_ctr;
6404 /* Select the sort method */
6405 ang_sort_comp = ang_sort_comp_pet;
6406 ang_sort_swap = ang_sort_swap_hook;
6408 ang_sort(who, &dummy_why, max_pet);
6410 /* Process the monsters (backwards) */
6411 for (i = 0; i < max_pet; i++)
6414 teleport_monster_to(pet_ctr, py, px, 100, TELEPORT_PASSIVE);
6417 /* Free the "who" array */
6418 C_KILL(who, max_m_idx, u16b);
6420 o_ptr->timeout = 100+randint1(100);
6423 else if (o_ptr->tval == TV_CAPTURE)
6427 bool old_target_pet = target_pet;
6429 if (!get_aim_dir(&dir))
6431 target_pet = old_target_pet;
6434 target_pet = old_target_pet;
6436 if(fire_ball(GF_CAPTURE, dir, 0, 0))
6438 o_ptr->pval = cap_mon;
6439 o_ptr->xtra3 = cap_mspeed;
6440 o_ptr->xtra4 = cap_hp;
6441 o_ptr->xtra5 = cap_maxhp;
6448 if (o_ptr->inscription)
6449 strcpy(buf, quark_str(o_ptr->inscription));
6451 for (s = buf;*s && (*s != '#'); s++)
6454 if (iskanji(*s)) s++;
6464 t = quark_str(cap_nickname);
6477 o_ptr->inscription = quark_add(buf);
6483 bool success = FALSE;
6484 if (!get_rep_dir2(&dir)) return;
6485 if (monster_can_enter(py + ddy[dir], px + ddx[dir], &r_info[o_ptr->pval], 0))
6487 if (place_monster_aux(0, py + ddy[dir], px + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
6489 if (o_ptr->xtra3) m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
6490 if (o_ptr->xtra5) m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
6491 if (o_ptr->xtra4) m_list[hack_m_idx_ii].hp = o_ptr->xtra4;
6492 m_list[hack_m_idx_ii].maxhp = m_list[hack_m_idx_ii].max_maxhp;
6493 if (o_ptr->inscription)
6501 t = quark_str(o_ptr->inscription);
6502 for (t = quark_str(o_ptr->inscription);*t && (*t != '#'); t++)
6505 if (iskanji(*t)) t++;
6530 if (quote && *(s-1) =='\'')
6534 m_list[hack_m_idx_ii].nickname = quark_add(buf);
6535 t = quark_str(o_ptr->inscription);
6537 while(*t && (*t != '#'))
6544 o_ptr->inscription = quark_add(buf);
6556 msg_print("¤ª¤Ã¤È¡¢²òÊü¤Ë¼ºÇÔ¤·¤¿¡£");
6558 msg_print("Oops. You failed to release your pet.");
6566 msg_print("¤ª¤Ã¤È¡¢¤³¤Î¥¢¥¤¥Æ¥à¤Ï»ÏÆ°¤Ç¤¤Ê¤¤¡£");
6568 msg_print("Oops. That object cannot be activated.");
6574 void do_cmd_activate(void)
6580 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6582 set_action(ACTION_NONE);
6585 item_tester_no_ryoute = TRUE;
6586 /* Prepare the hook */
6587 item_tester_hook = item_tester_hook_activate;
6591 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò»ÏÆ°¤µ¤»¤Þ¤¹¤«? ";
6592 s = "»ÏÆ°¤Ç¤¤ë¥¢¥¤¥Æ¥à¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£";
6594 q = "Activate which item? ";
6595 s = "You have nothing to activate.";
6598 if (!get_item(&item, q, s, (USE_EQUIP))) return;
6600 /* Activate the item */
6601 do_cmd_activate_aux(item);
6606 * Hook to determine if an object is useable
6608 static bool item_tester_hook_use(object_type *o_ptr)
6610 u32b flgs[TR_FLAG_SIZE];
6613 if (o_ptr->tval == p_ptr->tval_ammo)
6616 /* Useable object */
6617 switch (o_ptr->tval)
6635 if (!object_is_known(o_ptr)) return (FALSE);
6637 /* HACK - only items from the equipment can be activated */
6638 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
6640 if (&inventory[i] == o_ptr)
6642 /* Extract the flags */
6643 object_flags(o_ptr, flgs);
6645 /* Check activation flag */
6646 if (have_flag(flgs, TR_ACTIVATE)) return (TRUE);
6659 * XXX - Add actions for other item types
6661 void do_cmd_use(void)
6667 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6669 set_action(ACTION_NONE);
6672 item_tester_no_ryoute = TRUE;
6673 /* Prepare the hook */
6674 item_tester_hook = item_tester_hook_use;
6678 q = "¤É¤ì¤ò»È¤¤¤Þ¤¹¤«¡©";
6679 s = "»È¤¨¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤»¤ó¡£";
6681 q = "Use which item? ";
6682 s = "You have nothing to use.";
6685 if (!get_item(&item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR))) return;
6687 /* Get the item (in the pack) */
6690 o_ptr = &inventory[item];
6692 /* Get the item (on the floor) */
6695 o_ptr = &o_list[0 - item];
6698 switch (o_ptr->tval)
6710 do_cmd_eat_food_aux(item);
6717 do_cmd_aim_wand_aux(item);
6724 do_cmd_use_staff_aux(item);
6731 do_cmd_zap_rod_aux(item);
6735 /* Quaff a potion */
6738 do_cmd_quaff_potion_aux(item);
6745 /* Check some conditions */
6749 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡£");
6751 msg_print("You can't see anything.");
6759 msg_print("ÌÀ¤«¤ê¤¬¤Ê¤¤¤Î¤Ç¡¢°Å¤¯¤ÆÆɤá¤Ê¤¤¡£");
6761 msg_print("You have no light to read by.");
6766 if (p_ptr->confused)
6769 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
6771 msg_print("You are too confused!");
6777 do_cmd_read_scroll_aux(item, TRUE);
6786 do_cmd_fire_aux(item, &inventory[INVEN_BOW]);
6790 /* Activate an artifact */
6793 do_cmd_activate_aux(item);
6799 static int select_magic_eater(bool only_browse)
6803 bool flag, request_list;
6805 int ask = TRUE, i = 0;
6808 int menu_line = (use_menu ? 1 : 0);
6812 if (repeat_pull(&sn))
6814 /* Verify the spell */
6815 if (sn >= EATER_EXT*2 && !(p_ptr->magic_num1[sn] > k_info[lookup_kind(TV_ROD, sn-EATER_EXT*2)].pval * (p_ptr->magic_num2[sn] - 1) * EATER_ROD_CHARGE))
6817 else if (sn < EATER_EXT*2 && !(p_ptr->magic_num1[sn] < EATER_CHARGE))
6821 #endif /* ALLOW_REPEAT */
6823 for (i = 0; i < 108; i++)
6825 if (p_ptr->magic_num2[i]) break;
6830 msg_print("ËâË¡¤ò³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6832 msg_print("You don't have any magic!");
6844 prt(format(" %s ¾ó", (menu_line == 1) ? "¡Õ" : " "), 2, 14);
6845 prt(format(" %s ËâË¡ËÀ", (menu_line == 2) ? "¡Õ" : " "), 3, 14);
6846 prt(format(" %s ¥í¥Ã¥É", (menu_line == 3) ? "¡Õ" : " "), 4, 14);
6847 prt("¤É¤Î¼ïÎà¤ÎËâË¡¤ò»È¤¤¤Þ¤¹¤«¡©", 0, 0);
6849 prt(format(" %s staff", (menu_line == 1) ? "> " : " "), 2, 14);
6850 prt(format(" %s wand", (menu_line == 2) ? "> " : " "), 3, 14);
6851 prt(format(" %s rod", (menu_line == 3) ? "> " : " "), 4, 14);
6852 prt("Which type of magic do you use?", 0, 0);
6875 ext = (menu_line-1)*EATER_EXT;
6876 if (menu_line == 1) tval = TV_STAFF;
6877 else if (menu_line == 2) tval = TV_WAND;
6881 if (menu_line > 3) menu_line -= 3;
6890 if (!get_com("[A] ¾ó, [B] ËâË¡ËÀ, [C] ¥í¥Ã¥É:", &choice, TRUE))
6892 if (!get_com("[A] staff, [B] wand, [C] rod:", &choice, TRUE))
6897 if (choice == 'A' || choice == 'a')
6903 if (choice == 'B' || choice == 'b')
6909 if (choice == 'C' || choice == 'c')
6917 for (i = ext; i < ext + EATER_EXT; i++)
6919 if (p_ptr->magic_num2[i])
6921 if (use_menu) menu_line = i-ext+1;
6925 if (i == ext+EATER_EXT)
6928 msg_print("¤½¤Î¼ïÎà¤ÎËâË¡¤Ï³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6930 msg_print("You don't have that type of magic!");
6935 /* Nothing chosen yet */
6938 /* Build a prompt */
6940 (void) strnfmt(out_val, 78, "('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎËâÎϤò»È¤¤¤Þ¤¹¤«¡©");
6942 (void)strnfmt(out_val, 78, "(*=List, ESC=exit) Use which power? ");
6945 /* Save the screen */
6948 request_list = always_show_list;
6950 /* Get a spell from the user */
6954 if (request_list || use_menu)
6965 for (y = 1; y < 20; y++)
6970 /* Print header(s) */
6972 prt(format(" %s ¼ºÎ¨ %s ¼ºÎ¨", (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô"), (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô")), y++, x);
6974 prt(format(" %s Fail %s Fail", (tval == TV_ROD ? " Stat " : " Charges"), (tval == TV_ROD ? " Stat " : " Charges")), y++, x);
6978 for (ctr = 0; ctr < EATER_EXT; ctr++)
6980 if (!p_ptr->magic_num2[ctr+ext]) continue;
6982 k_idx = lookup_kind(tval, ctr);
6986 if (ctr == (menu_line-1))
6988 strcpy(dummy, "¡Õ");
6990 strcpy(dummy, "> ");
6992 else strcpy(dummy, " ");
6995 /* letter/number for power selection */
7002 letter = '0' + ctr - 26;
7003 sprintf(dummy, "%c)",letter);
7005 x1 = ((ctr < EATER_EXT/2) ? x : x + 40);
7006 y1 = ((ctr < EATER_EXT/2) ? y + ctr : y + ctr - EATER_EXT/2);
7007 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
7008 chance = level * 4 / 5 + 20;
7009 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
7011 if (p_ptr->lev > level)
7013 chance -= 3 * (p_ptr->lev - level);
7015 chance = mod_spell_chance_1(chance);
7016 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
7017 /* Stunning makes spells harder */
7018 if (p_ptr->stun > 50) chance += 25;
7019 else if (p_ptr->stun) chance += 15;
7021 if (chance > 95) chance = 95;
7023 chance = mod_spell_chance_2(chance);
7031 strcat(dummy, format(
7033 " %-22.22s ½¼Å¶:%2d/%2d%3d%%",
7035 " %-22.22s (%2d/%2d) %3d%%",
7037 k_name + k_info[k_idx].name,
7038 p_ptr->magic_num1[ctr+ext] ?
7039 (p_ptr->magic_num1[ctr+ext] - 1) / (EATER_ROD_CHARGE * k_info[k_idx].pval) +1 : 0,
7040 p_ptr->magic_num2[ctr+ext], chance));
7041 if (p_ptr->magic_num1[ctr+ext] > k_info[k_idx].pval * (p_ptr->magic_num2[ctr+ext]-1) * EATER_ROD_CHARGE) col = TERM_RED;
7045 strcat(dummy, format(" %-22.22s %2d/%2d %3d%%", k_name + k_info[k_idx].name, (s16b)(p_ptr->magic_num1[ctr+ext]/EATER_CHARGE), p_ptr->magic_num2[ctr+ext], chance));
7046 if (p_ptr->magic_num1[ctr+ext] < EATER_CHARGE) col = TERM_RED;
7051 c_prt(col, dummy, y1, x1);
7055 if (!get_com(out_val, &choice, FALSE)) break;
7057 if (use_menu && choice != ' ')
7073 menu_line += EATER_EXT - 1;
7074 if (menu_line > EATER_EXT) menu_line -= EATER_EXT;
7075 } while(!p_ptr->magic_num2[menu_line+ext-1]);
7086 if (menu_line > EATER_EXT) menu_line -= EATER_EXT;
7087 } while(!p_ptr->magic_num2[menu_line+ext-1]);
7098 bool reverse = FALSE;
7099 if ((choice == '4') || (choice == 'h') || (choice == 'H')) reverse = TRUE;
7100 if (menu_line > EATER_EXT/2)
7102 menu_line -= EATER_EXT/2;
7105 else menu_line+=EATER_EXT/2;
7106 while(!p_ptr->magic_num2[menu_line+ext-1])
7111 if (menu_line < 2) reverse = FALSE;
7116 if (menu_line > EATER_EXT-1) reverse = TRUE;
7133 /* Request redraw */
7134 if (use_menu && ask) continue;
7136 /* Request redraw */
7137 if (!use_menu && ((choice == ' ') || (choice == '*') || (choice == '?')))
7143 request_list = FALSE;
7145 /* Restore the screen */
7150 request_list = TRUE;
7158 if (isalpha(choice))
7161 ask = (isupper(choice));
7164 if (ask) choice = tolower(choice);
7166 /* Extract request */
7167 i = (islower(choice) ? A2I(choice) : -1);
7171 ask = FALSE; /* Can't uppercase digits */
7173 i = choice - '0' + 26;
7177 /* Totally Illegal */
7178 if ((i < 0) || (i > EATER_EXT) || !p_ptr->magic_num2[i+ext])
7193 (void) strnfmt(tmp_val, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", k_name + k_info[lookup_kind(tval ,i)].name);
7195 (void) strnfmt(tmp_val, 78, "Use %s?", k_name + k_info[lookup_kind(tval ,i)].name);
7198 /* Belay that order */
7199 if (!get_check(tmp_val)) continue;
7203 if (p_ptr->magic_num1[ext+i] > k_info[lookup_kind(tval, i)].pval * (p_ptr->magic_num2[ext+i] - 1) * EATER_ROD_CHARGE)
7206 msg_print("¤½¤ÎËâË¡¤Ï¤Þ¤À½¼Å¶¤·¤Æ¤¤¤ëºÇÃæ¤À¡£");
7208 msg_print("The magic are still charging.");
7211 if (use_menu) ask = TRUE;
7217 if (p_ptr->magic_num1[ext+i] < EATER_CHARGE)
7220 msg_print("¤½¤ÎËâË¡¤Ï»ÈÍѲó¿ô¤¬ÀÚ¤ì¤Æ¤¤¤ë¡£");
7222 msg_print("The magic has no charges left.");
7225 if (use_menu) ask = TRUE;
7237 /* Clear lines, position cursor (really should use strlen here) */
7238 Term_erase(7, 23, 255);
7239 Term_erase(7, 22, 255);
7240 Term_erase(7, 21, 255);
7241 Term_erase(7, 20, 255);
7243 roff_to_buf(k_text + k_info[lookup_kind(tval, i)].text, 62, temp, sizeof(temp));
7244 for (j = 0, line = 21; temp[j]; j += 1 + strlen(&temp[j]))
7246 prt(&temp[j], line, 10);
7251 prt("²¿¤«¥¡¼¤ò²¡¤·¤Æ²¼¤µ¤¤¡£",0,0);
7253 prt("Hit any key.",0,0);
7263 /* Restore the screen */
7266 if (!flag) return -1;
7270 #endif /* ALLOW_REPEAT */
7276 * Use eaten rod, wand or staff
7278 void do_cmd_magic_eater(bool only_browse)
7280 int item, chance, level, k_idx, tval, sval;
7281 bool use_charge = TRUE;
7283 /* Not when confused */
7284 if (!only_browse && p_ptr->confused)
7287 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
7289 msg_print("You are too confused!");
7295 item = select_magic_eater(only_browse);
7301 if (item >= EATER_EXT*2) {tval = TV_ROD;sval = item - EATER_EXT*2;}
7302 else if (item >= EATER_EXT) {tval = TV_WAND;sval = item - EATER_EXT;}
7303 else {tval = TV_STAFF;sval = item;}
7304 k_idx = lookup_kind(tval, sval);
7306 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
7307 chance = level * 4 / 5 + 20;
7308 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
7310 if (p_ptr->lev > level)
7312 chance -= 3 * (p_ptr->lev - level);
7314 chance = mod_spell_chance_1(chance);
7315 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
7316 /* Stunning makes spells harder */
7317 if (p_ptr->stun > 50) chance += 25;
7318 else if (p_ptr->stun) chance += 15;
7320 if (chance > 95) chance = 95;
7322 chance = mod_spell_chance_2(chance);
7324 if (randint0(100) < chance)
7326 if (flush_failure) flush();
7329 msg_print("¼öʸ¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª");
7331 msg_format("You failed to get the magic off!");
7335 if (randint1(100) >= chance)
7336 chg_virtue(V_CHANCE,-1);
7347 if ((sval >= SV_ROD_MIN_DIRECTION) && (sval != SV_ROD_HAVOC) && (sval != SV_ROD_AGGRAVATE) && (sval != SV_ROD_PESTICIDE))
7348 if (!get_aim_dir(&dir)) return;
7349 rod_effect(sval, dir, &use_charge, TRUE);
7350 if (!use_charge) return;
7352 else if (tval == TV_WAND)
7354 if (!get_aim_dir(&dir)) return;
7355 wand_effect(sval, dir, TRUE);
7359 staff_effect(sval, &use_charge, TRUE, TRUE);
7360 if (!use_charge) return;
7362 if (randint1(100) < chance)
7363 chg_virtue(V_CHANCE,1);
7366 if (tval == TV_ROD) p_ptr->magic_num1[item] += k_info[k_idx].pval * EATER_ROD_CHARGE;
7367 else p_ptr->magic_num1[item] -= EATER_CHARGE;