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_afraid(0);
4479 (void)set_hero(randint1(25) + 25, FALSE);
4480 (void)hp_player(777);
4481 o_ptr->timeout = 300;
4488 msg_print("³»¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4490 msg_print("Your armor glows deep blue...");
4493 (void)symbol_genocide(200, TRUE);
4494 o_ptr->timeout = 500;
4501 msg_print("³»¤¬ÀÖ¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4503 msg_print("Your armor glows bright red...");
4506 destroy_doors_touch();
4507 o_ptr->timeout = 10;
4515 turn_monsters(40 + p_ptr->lev);
4516 o_ptr->timeout = 3 * (p_ptr->lev + 10);
4521 case ART_HOLHENNETH:
4524 msg_print("¥Ø¥ë¥á¥Ã¥È¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4525 msg_print("¿´¤Ë¥¤¥á¡¼¥¸¤¬É⤫¤ó¤Ç¤¤¿...");
4527 msg_print("Your helm glows bright white...");
4528 msg_print("An image forms in your mind...");
4531 detect_all(DETECT_RAD_DEFAULT);
4532 o_ptr->timeout = randint0(55) + 55;
4539 msg_print("²¦´§¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4540 msg_print("ÂÎÆâ¤ËÃȤ«¤¤¸ÝÆ°¤¬´¶¤¸¤é¤ì¤ë...");
4542 msg_print("Your crown glows deep blue...");
4543 msg_print("You feel a warm tingling inside...");
4546 (void)hp_player(700);
4548 o_ptr->timeout = 250;
4556 msg_format("%s¤¬ÍÍ¡¹¤Ê¿§¤Ëµ±¤¤¤¿...", o_ptr->name1 == ART_COLLUIN ? "¥¯¥í¡¼¥¯" : "³»");
4558 msg_format("Your %s glows many colours...", o_ptr->name1 == ART_COLLUIN ? "cloak" : "armor");
4561 (void)set_oppose_acid(randint1(20) + 20, FALSE);
4562 (void)set_oppose_elec(randint1(20) + 20, FALSE);
4563 (void)set_oppose_fire(randint1(20) + 20, FALSE);
4564 (void)set_oppose_cold(randint1(20) + 20, FALSE);
4565 (void)set_oppose_pois(randint1(20) + 20, FALSE);
4566 o_ptr->timeout = 111;
4570 case ART_HOLCOLLETH:
4573 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4575 msg_print("Your cloak glows deep blue...");
4578 sleep_monsters_touch();
4579 o_ptr->timeout = 55;
4586 msg_print("¥¯¥í¡¼¥¯¤¬²«¿§¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4588 msg_print("Your cloak glows bright yellow...");
4592 o_ptr->timeout = 70;
4599 msg_print("¥¯¥í¡¼¥¯¤¬ÊÕ¤ê¤Î¶õ´Ö¤ò¤æ¤¬¤Þ¤»¤¿...");
4601 msg_print("Your cloak twists space around you...");
4604 teleport_player(100, 0L);
4605 o_ptr->timeout = 45;
4612 msg_print("¥¯¥í¡¼¥¯¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4614 msg_print("Your cloak glows a deep red...");
4618 o_ptr->timeout = 450;
4622 case ART_CAMMITHRIM:
4625 msg_print("¥°¥í¡¼¥Ö¤¬âÁ¤·¤¤¤¯¤é¤¤¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4627 msg_print("Your gloves glow extremely brightly...");
4630 if (!get_aim_dir(&dir)) return;
4631 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
4639 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4641 msg_print("Your gauntlets are covered in fire...");
4644 if (!get_aim_dir(&dir)) return;
4645 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4646 o_ptr->timeout = randint0(8) + 8;
4650 case ART_PAURNIMMEN:
4653 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4655 msg_print("Your gauntlets are covered in frost...");
4658 if (!get_aim_dir(&dir)) return;
4659 fire_bolt(GF_COLD, dir, damroll(6, 8));
4660 o_ptr->timeout = randint0(7) + 7;
4667 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4669 msg_print("Your gauntlets are covered in sparks...");
4672 if (!get_aim_dir(&dir)) return;
4673 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4674 o_ptr->timeout = randint0(5) + 5;
4681 msg_print("¥¬¥ó¥È¥ì¥Ã¥È¤¬»À¤Ëʤ¤ï¤ì¤¿...");
4683 msg_print("Your gauntlets are covered in acid...");
4686 if (!get_aim_dir(&dir)) return;
4687 fire_bolt(GF_ACID, dir, damroll(5, 8));
4688 o_ptr->timeout = randint0(6) + 6;
4695 msg_print("¥»¥¹¥¿¥¹¤ËËâË¡¤Î¥È¥²¤¬¸½¤ì¤¿...");
4697 msg_print("Your cesti grows magical spikes...");
4700 if (!get_aim_dir(&dir)) return;
4701 fire_bolt(GF_ARROW, dir, 150);
4702 o_ptr->timeout = randint0(90) + 90;
4709 msg_print("¥Ö¡¼¥Ä¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
4711 msg_print("Your boots glow bright green...");
4714 (void)set_fast(randint1(20) + 20, FALSE);
4715 o_ptr->timeout = 200;
4722 msg_print("¥Ö¡¼¥Ä¤¬¿¼¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
4724 msg_print("Your boots glow deep blue...");
4727 (void)set_afraid(0);
4728 (void)set_poisoned(0);
4736 msg_print("¥À¥¬¡¼¤¬±ê¤Ëʤ¤ï¤ì¤¿...");
4738 msg_print("Your dagger is covered in fire...");
4741 if (!get_aim_dir(&dir)) return;
4742 fire_bolt(GF_FIRE, dir, damroll(9, 8));
4743 o_ptr->timeout = randint0(8) + 8;
4750 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4752 msg_print("Your dagger is covered in frost...");
4755 if (!get_aim_dir(&dir)) return;
4756 fire_bolt(GF_COLD, dir, damroll(6, 8));
4757 o_ptr->timeout = randint0(7) + 7;
4764 msg_print("¥À¥¬¡¼¤¬²Ð²Ö¤Ëʤ¤ï¤ì¤¿...");
4766 msg_print("Your dagger is covered in sparks...");
4769 if (!get_aim_dir(&dir)) return;
4770 fire_bolt(GF_ELEC, dir, damroll(4, 8));
4771 o_ptr->timeout = randint0(5) + 5;
4778 msg_print("¥À¥¬¡¼¤¬¿¼¤¤Îп§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4780 msg_print("Your dagger throbs deep green...");
4783 if (!get_aim_dir(&dir)) return;
4784 fire_ball(GF_POIS, dir, 12, 3);
4785 o_ptr->timeout = randint0(4) + 4;
4792 msg_print("Ì·¤¬¿¼¤¤ÀÄ¿§¤Ë¸ÝÆ°¤·¤Æ¤¤¤ë...");
4794 msg_print("Your dagger throbs deep blue...");
4797 if (!get_aim_dir(&dir)) return;
4798 fire_ball(GF_WATER, dir, 200, 3);
4799 o_ptr->timeout = 250;
4806 msg_print("¥À¥¬¡¼¤¬Î䵤¤Ëʤ¤ï¤ì¤¿...");
4808 msg_print("Your dagger is covered in frost...");
4811 if (!get_aim_dir(&dir)) return;
4812 fire_ball(GF_COLD, dir, 48, 2);
4813 o_ptr->timeout = randint0(5) + 5;
4818 case ART_WEREWINDLE:
4820 switch (randint1(13))
4822 case 1: case 2: case 3: case 4: case 5:
4823 teleport_player(10, 0L);
4825 case 6: case 7: case 8: case 9: case 10:
4826 teleport_player(222, 0L);
4829 (void)stair_creation();
4833 if (get_check("¤³¤Î³¬¤òµî¤ê¤Þ¤¹¤«¡©"))
4835 if (get_check("Leave this level? "))
4839 if (autosave_l) do_cmd_save_game(TRUE);
4842 p_ptr->leaving = TRUE;
4845 o_ptr->timeout = 35;
4851 teleport_player(222, 0L);
4852 o_ptr->timeout = 25;
4859 msg_print("¥½¡¼¥É¤¬ÀĤ¯·ã¤·¤¯µ±¤¤¤¿...");
4861 msg_print("Your sword glows an intense blue...");
4864 if (!get_aim_dir(&dir)) return;
4865 fire_ball(GF_COLD, dir, 100, 2);
4866 o_ptr->timeout = 200;
4873 msg_print("¶Ç¤Î»ÕÃĤò¾¤´¤·¤¿¡£");
4875 msg_print("You summon the Legion of the Dawn.");
4878 (void)summon_specific(-1, py, px, dun_level, SUMMON_DAWN, (PM_ALLOW_GROUP | PM_FORCE_PET));
4879 o_ptr->timeout = 500 + randint1(500);
4886 msg_print("¥½¡¼¥É¤¬ÀÖ¤¯·ã¤·¤¯µ±¤¤¤¿...");
4888 msg_print("Your sword glows an intense red...");
4891 if (!get_aim_dir(&dir)) return;
4892 fire_ball(GF_FIRE, dir, 72, 2);
4893 o_ptr->timeout = 400;
4900 msg_print("¥¢¥Ã¥¯¥¹¤Î¿Ï¤¬¹õ¤¯µ±¤¤¤¿...");
4902 msg_print("Your axe blade glows black...");
4905 if (!get_aim_dir(&dir)) return;
4906 drain_life(dir, 120);
4907 o_ptr->timeout = 400;
4914 msg_print("¤¢¤Ê¤¿¤ÎÁä¤ÏÅŵ¤¤Ç¥¹¥Ñ¡¼¥¯¤·¤Æ¤¤¤ë...");
4916 msg_print("Your spear crackles with electricity...");
4919 if (!get_aim_dir(&dir)) return;
4920 fire_ball(GF_ELEC, dir, 100, 3);
4921 o_ptr->timeout = 200;
4928 msg_print("¥¹¥Ô¥¢¤¬Çò¤¯ÌÀ¤ë¤¯µ±¤¤¤¿...");
4930 msg_print("Your spear glows a bright white...");
4933 if (!get_aim_dir(&dir)) return;
4934 fire_ball(GF_COLD, dir, 100, 3);
4935 o_ptr->timeout = 200;
4942 msg_print("¥¹¥Ô¥¢¤¬¸ÝÆ°¤·¤¿...");
4944 msg_print("Your spear pulsates...");
4947 if (!get_aim_dir(&dir)) return;
4956 msg_print("¤Ä¤ë¤Ï¤·¤¬¸ÝÆ°¤·¤¿...");
4958 msg_print("Your mattock pulsates...");
4961 if (!get_aim_dir(&dir)) return;
4970 msg_print("¥¢¥Ã¥¯¥¹¤«¤é¤Ò¤É¤¯±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
4972 msg_print("Your axe lets out a long, shrill note...");
4975 (void)mass_genocide(200, TRUE);
4976 o_ptr->timeout = 1000;
4983 msg_print("¥Ð¥È¥ë¡¦¥¢¥Ã¥¯¥¹¤¬¿¼»ç¤Î¸÷¤òÊü¼Í¤·¤¿...");
4985 msg_print("Your battle axe radiates deep purple...");
4988 hp_player(damroll(4, 8));
4989 (void)set_cut((p_ptr->cut / 2) - 50);
4990 o_ptr->timeout = randint0(3) + 3;
4997 msg_print("¥È¥é¥¤¥Ç¥ó¥È¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
4999 msg_print("Your trident glows deep red...");
5002 if (!get_aim_dir(&dir)) return;
5003 teleport_monster(dir);
5004 o_ptr->timeout = 150;
5011 msg_print("Âç³ù¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
5013 msg_print("Your scythe glows soft white...");
5015 if (!word_of_recall()) return;
5016 o_ptr->timeout = 200;
5023 msg_print("¸û¶Ì¤¬½À¤é¤«¤¯Çò¤¯µ±¤¤¤¿...");
5025 msg_print("Your scythe glows soft white...");
5027 if (!word_of_recall()) return;
5028 o_ptr->timeout = 200;
5035 msg_print("¥Õ¥ì¥¤¥ë¤¬ÍÍ¡¹¤Ê¿§¤Î²Ð²Ö¤òȯ¤·¤¿...");
5037 msg_print("Your flail glows in scintillating colours...");
5040 if (!get_aim_dir(&dir)) return;
5041 confuse_monster(dir, 20);
5042 o_ptr->timeout = 15;
5049 msg_print("¥â¡¼¥Ë¥ó¥°¥¹¥¿¡¼¤«¤é±ê¤¬¿á¤½Ð¤·¤¿...");
5051 msg_print("Your morning star rages in fire...");
5054 if (!get_aim_dir(&dir)) return;
5055 fire_ball(GF_FIRE, dir, 72, 3);
5056 o_ptr->timeout = 100;
5063 msg_print("¥à¥Á¤¬¿¼¤¤ÀÖ¿§¤Ëµ±¤¤¤¿...");
5065 msg_print("Your whip glows deep red...");
5068 if (!get_aim_dir(&dir)) return;
5069 fire_ball(GF_FIRE, dir, 120, 3);
5070 o_ptr->timeout = 15;
5077 msg_print("¥á¥¤¥¹¤¬¥°¥ê¡¼¥ó¤ËÌÀ¤ë¤¯µ±¤¤¤¿...");
5079 msg_print("Your mace glows bright green...");
5082 (void)set_fast(randint1(20) + 20, FALSE);
5083 o_ptr->timeout = randint0(100) + 100;
5090 msg_print("¥¯¥©¡¼¥¿¡¼¥¹¥¿¥Ã¥Õ¤¬²«¿§¤¯µ±¤¤¤¿...");
5092 msg_print("Your quarterstaff glows yellow...");
5095 if (!ident_spell(FALSE)) return;
5096 o_ptr->timeout = 10;
5103 msg_print("¾ó¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
5105 msg_print("Your quarterstaff glows brightly...");
5108 detect_all(DETECT_RAD_DEFAULT);
5110 identify_fully(FALSE);
5111 o_ptr->timeout = 100;
5118 msg_print("¥Ï¥ó¥Þ¡¼¤¬Çò¤¯µ±¤¤¤¿...");
5120 msg_print("Your hammer glows white...");
5123 if (!get_aim_dir(&dir)) return;
5124 drain_life(dir, 90);
5125 o_ptr->timeout = 70;
5132 msg_print("¥¯¥í¥¹¥Ü¥¦¤¬¿¼¹È¤Ëµ±¤¤¤¿...");
5134 msg_print("Your crossbow glows deep red...");
5137 (void)brand_bolts();
5138 o_ptr->timeout = 999;
5145 int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
5148 msg_print("¤»¤Ã¤«¤¯¤À¤«¤é¡Ø¥¯¥ê¥à¥¾¥ó¡Ù¤ò¤Ö¤Ã¤Ñ¤Ê¤¹¤¼¡ª");
5150 msg_print("I'll fire CRIMSON! SEKKAKUDAKARA!");
5153 if (!get_aim_dir(&dir)) return;
5155 /* Use the given direction */
5156 tx = px + 99 * ddx[dir];
5157 ty = py + 99 * ddy[dir];
5159 /* Hack -- Use an actual "target" */
5160 if ((dir == 5) && target_okay())
5166 if (p_ptr->pclass == CLASS_ARCHER)
5168 /* Extra shot at level 10 */
5169 if (p_ptr->lev >= 10) num++;
5171 /* Extra shot at level 30 */
5172 if (p_ptr->lev >= 30) num++;
5174 /* Extra shot at level 45 */
5175 if (p_ptr->lev >= 45) num++;
5178 for (i = 0; i < num; i++)
5179 project(0, p_ptr->lev/20+1, ty, tx, p_ptr->lev*p_ptr->lev*6/50, GF_ROCKET, flg, -1);
5180 o_ptr->timeout = 15;
5185 monster_type *m_ptr;
5186 monster_race *r_ptr;
5190 msg_print("´ñ̯¤Ê¾ì½ê¤¬Æ¬¤ÎÃæ¤ËÉ⤫¤ó¤À¡¥¡¥¡¥");
5192 msg_print("Some strange places show up in your mind. And you see ...");
5195 /* Process the monsters (backwards) */
5196 for (i = m_max - 1; i >= 1; i--)
5198 /* Access the monster */
5201 /* Ignore "dead" monsters */
5202 if (!m_ptr->r_idx) continue;
5204 r_ptr = &r_info[m_ptr->r_idx];
5206 if(r_ptr->flags1 & RF1_UNIQUE)
5209 msg_format("%s¡¥ ",r_name + r_ptr->name);
5211 msg_format("%s. ",r_name + r_ptr->name);
5215 o_ptr->timeout = 200;
5219 case ART_STONE_LORE:
5222 msg_print("ÀФ¬±£¤µ¤ì¤¿ÈëÌ©¤ò¼Ì¤·½Ð¤·¤¿¡¥¡¥¡¥");
5224 msg_print("The stone reveals hidden mysteries...");
5226 if (!ident_spell(FALSE)) return;
5228 if (mp_ptr->spell_book)
5230 /* Sufficient mana */
5231 if (20 <= p_ptr->csp)
5237 /* Over-exert the player */
5240 int oops = 20 - p_ptr->csp;
5244 p_ptr->csp_frac = 0;
5248 msg_print("ÀФòÀ©¸æ¤Ç¤¤Ê¤¤¡ª");
5250 msg_print("You are too weak to control the stone!");
5253 /* Hack -- Bypass free action */
5254 (void)set_paralyzed(p_ptr->paralyzed +
5255 randint1(5 * oops + 1));
5258 (void)set_confused(p_ptr->confused +
5259 randint1(5 * oops + 1));
5263 p_ptr->redraw |= (PR_MANA);
5267 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "´í¸±¤ÊÈëÌ©", -1);
5269 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), "perilous secrets", -1);
5273 if (one_in_(5)) (void)set_confused(p_ptr->confused +
5276 /* Exercise a little care... */
5279 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "´í¸±¤ÊÈëÌ©", -1);
5281 take_hit(DAMAGE_LOSELIFE, damroll(4, 10), "perilous secrets", -1);
5289 if (music_singing_any()) stop_singing();
5291 msg_print("¤¢¤Ê¤¿¤ÏÎ϶¯¤¤ÆÍÉ÷¤ò¿á¤ÌĤ餷¤¿¡£¼þ°Ï¤ÎŨ¤¬¿Ì¤¨¾å¤Ã¤Æ¤¤¤ë!");
5293 msg_print("You wind a mighty blast; your enemies tremble!");
5295 (void)turn_monsters((3 * p_ptr->lev / 2) + 10);
5296 o_ptr->timeout = randint0(40) + 40;
5302 msg_print("¤¢¤Ê¤¿¤Ï³²Ãî¤ò°ìÁݤ·¤¿¡£");
5304 msg_print("You exterminate small life.");
5306 (void)dispel_monsters(4);
5307 o_ptr->timeout = randint0(55) + 55;
5314 msg_print("Æߤ¤²»¤¬ÊÕ¤ê¤òÊñ¤ß¤³¤ó¤À¡£");
5316 msg_print("A shrill wailing sound surrounds you.");
5318 (void)set_protevil(randint1(25) + p_ptr->lev, FALSE);
5319 o_ptr->timeout = randint0(200) + 200;
5327 msg_print("¥í¡¼¥Ö¤¬½ã¿è¤ÊËâÎϤǿ̤¨¤¿¡£");
5329 msg_print("The robe pulsates with raw mana...");
5331 if (!get_aim_dir(&dir)) return;
5332 fire_bolt(GF_MANA, dir, 120);
5333 o_ptr->timeout = randint0(120) + 120;
5338 (void)set_fast(randint1(50) + 50, FALSE);
5341 set_hero(randint1(50) + 50, FALSE);
5342 o_ptr->timeout = randint0(200) + 100;
5348 msg_print("¥·¡¼¥ë¥É¤¬âÁ¤·¤¤¸÷¤Çµ±¤¤¤¿¡¥¡¥¡¥");
5350 msg_print("Your shield gleams with blinding light...");
5352 fire_ball(GF_LITE, 0, 300, 6);
5353 confuse_monsters(3 * p_ptr->lev / 2);
5354 o_ptr->timeout = 250;
5360 msg_print("¥«¡¼¥É¤¬Çò¤¯µ±¤¤¤¿¡¥¡¥¡¥");
5362 msg_print("Your card gleams with blinding light...");
5364 if (!recharge(1000)) return;
5365 o_ptr->timeout = 200;
5371 if (get_check("ËÜÅö¤Ë»È¤¤¤Þ¤¹¤«¡©"))
5373 if (get_check("Are you sure?!"))
5377 msg_print("¼Àµ¤¬¿Ì¤¨¤¿¡¥¡¥¡¥");
5379 msg_print("The Muramasa pulsates...");
5385 msg_print("¼Àµ¤Ï²õ¤ì¤¿¡ª");
5387 msg_print("The Muramasa is destroyed!");
5389 curse_weapon(TRUE, item);
5397 msg_print("ÀФ¬ÀÄÇò¤¯¸÷¤Ã¤¿¡¥¡¥¡¥");
5399 msg_print("Your stone glows pale...");
5402 if (!get_aim_dir(&dir)) return;
5403 fire_ball(GF_MANA, dir, 400, 4);
5404 o_ptr->timeout = randint0(250) + 250;
5411 if (!get_rep_dir2(&dir)) return;
5415 if (!cave_have_flag_bold(y, x, FF_WATER))
5418 msg_print("¤½¤³¤Ï¿åÊդǤϤʤ¤¡£");
5420 msg_print("There is no fishing place.");
5424 else if (cave[y][x].m_idx)
5427 monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
5429 msg_format("%s¤¬¼ÙËâ¤À¡ª", m_name);
5431 msg_format("%^s is stand in your way.", m_name);
5436 set_action(ACTION_FISH);
5437 p_ptr->redraw |= (PR_STATE);
5442 if (!get_aim_dir(&dir)) return;
5444 msg_print("¥à¥Á¤ò¿¤Ð¤·¤¿¡£");
5446 msg_print("You stretched your whip.");
5449 fetch(dir, 500, TRUE);
5450 o_ptr->timeout = randint0(25) + 25;
5455 u32b mode = PM_ALLOW_GROUP;
5456 bool pet = !one_in_(5);
5457 if (pet) mode |= PM_FORCE_PET;
5458 else mode |= PM_NO_PET;
5460 if (summon_specific((pet ? -1 : 0), py, px, ((p_ptr->lev * 3) / 2), SUMMON_HOUND, mode))
5465 msg_print("¥Ï¥¦¥ó¥É¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5467 msg_print("A group of hounds appear as your servant.");
5472 msg_print("¥Ï¥¦¥ó¥É¤Ï¤¢¤Ê¤¿¤Ë²ç¤ò¸þ¤±¤Æ¤¤¤ë¡ª");
5474 msg_print("A group of hounds appear as your enemy!");
5479 o_ptr->timeout = 300 + randint1(150);
5486 msg_print("¥¹¥Ô¥¢¤ÏâÁ¤·¤¯µ±¤¤¤¿...");
5488 msg_print("Your spear grows brightly...");
5491 if (!get_aim_dir(&dir)) return;
5492 fire_ball(GF_LITE, dir, 200, 3);
5493 o_ptr->timeout = randint0(200) + 200;
5500 monster_type *m_ptr;
5505 if (summon_named_creature(0, py, px, MON_SUKE, PM_FORCE_PET))
5508 msg_print("¡Ø½õ¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5510 msg_print("Suke-san apperars.");
5511 kakusan = "Suke-san";
5515 if (summon_named_creature(0, py, px, MON_KAKU, PM_FORCE_PET))
5518 msg_print("¡Ø³Ê¤µ¤ó¡Ù¤¬¸½¤ì¤¿¡£");
5520 msg_print("Kaku-san appears.");
5521 kakusan = "Kaku-san";
5527 for (i = m_max - 1; i > 0; i--)
5530 if (!m_ptr->r_idx) continue;
5531 if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
5532 if (!los(m_ptr->fy, m_ptr->fx, py, px)) continue;
5533 if (!projectable(m_ptr->fy, m_ptr->fx, py, px)) continue;
5542 msg_print("¡Ö¼Ô¤É¤â¡¢¤Ò¤«¤¨¤ª¤í¤¦¡ª¡ª¡ª¤³¤Î¤ªÊý¤ò¤É¤Ê¤¿¤È¤³¤³¤í¤¨¤ë¡£¡×");
5544 msg_format("%^s says 'WHO do you think this person is! Bow your head, down your knees!'", kakusan);
5549 confuse_monsters(120);
5551 stasis_monsters(120);
5557 msg_print("¤·¤«¤·¡¢²¿¤âµ¯¤¤Ê¤«¤Ã¤¿¡£");
5559 msg_print("Nothing happen.");
5562 o_ptr->timeout = randint0(150) + 150;
5569 msg_print("Çï»ÒÌÚ¤òÂǤä¿¡£");
5571 msg_print("You beat Your wooden clappers.");
5573 aggravate_monsters(0);
5580 (void)set_afraid(0);
5581 set_hero(randint1(25)+25, FALSE);
5583 o_ptr->timeout = randint0(30) + 30;
5589 (void)set_poisoned(0);
5590 (void)set_confused(0);
5596 o_ptr->timeout = 100;
5602 if (!get_aim_dir(&dir)) return;
5603 (void)charm_animal(dir, p_ptr->lev);
5605 o_ptr->timeout = 200;
5612 msg_print("¥½¡¼¥É¤¬Ã¸¤¤¥Ö¥ë¡¼¤Ëµ±¤¤¤¿...");
5614 msg_print("Your sword glows a pale blue...");
5616 if (!get_aim_dir(&dir)) return;
5617 fire_bolt(GF_COLD, dir, damroll(12, 8));
5618 o_ptr->timeout = 50;
5624 msg_print("³ù¤¬ÌÀ¤ë¤¯µ±¤¤¤¿...");
5626 msg_print("Your scythe glows brightly!");
5628 get_bloody_moon_flags(o_ptr);
5629 o_ptr->timeout = 3333;
5630 if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
5631 p_ptr->update |= (PU_BONUS | PU_HP);
5637 msg_print("Î϶¯¤¯»Í¸Ô¤òƧ¤ó¤À¡£");
5639 msg_print("You stamp. (as if you are in a ring.)");
5641 (void)set_afraid(0);
5642 (void)set_hero(randint1(20) + 20, FALSE);
5643 dispel_evil(p_ptr->lev * 3);
5644 o_ptr->timeout = 100 + randint1(100);
5650 msg_print("¥¯¥í¡¼¥¯¤¬Çò¤¯µ±¤¤¤¿...");
5652 msg_print("Your cloak grows white.");
5654 (void)set_oppose_cold(randint1(20) + 20, FALSE);
5655 o_ptr->timeout = 40 + randint1(40);
5661 msg_print("¥à¥Á¤«¤é±Ô¤¤²»¤¬Î®¤ì½Ð¤¿...");
5663 msg_print("The whip lets out a shrill wail...");
5667 (void)set_protevil(randint1(25) + k, FALSE);
5668 o_ptr->timeout = randint0(225) + 225;
5673 u32b mode = PM_ALLOW_GROUP;
5674 bool pet = !one_in_(5);
5675 if (pet) mode |= PM_FORCE_PET;
5677 if (summon_named_creature(0, py, px, MON_JIZOTAKO, mode))
5681 msg_print("Âý¤¬¤¢¤Ê¤¿¤Î²¼ËͤȤ·¤Æ½Ð¸½¤·¤¿¡£");
5683 msg_print("A group of octopuses appear as your servant.");
5688 msg_print("Âý¤Ï¤¢¤Ê¤¿¤òâˤó¤Ç¤¤¤ë¡ª");
5690 msg_print("A group of octopuses appear as your enemy!");
5695 o_ptr->timeout = 300 + randint1(150);
5702 msg_print("Å´µå¤ÏÊÕ¤ê¤òÁ±¤Î¥ª¡¼¥é¤ÇËþ¤¿¤·¤¿...");
5704 msg_print("The iron ball floods the area with goodness...");
5707 dispel_evil(p_ptr->lev * 5);
5708 o_ptr->timeout = randint0(100) + 100;
5715 msg_print("¥¢¥ß¥å¥ì¥Ã¥È¤¬¿¼¤¤°Ç¤Ëʤ¤ï¤ì¤¿...");
5717 msg_print("Your amulet is coverd in pitch-darkness...");
5719 if (!get_aim_dir(&dir)) return;
5720 fire_ball(GF_DARK, dir, 250, 4);
5721 o_ptr->timeout = randint0(150) + 150;
5727 msg_print("¼óÎؤ¬¿¼¤¤°Ç¤Ëʤ¤ï¤ì¤¿...");
5729 msg_print("Your collar harness is coverd in pitch-darkness...");
5731 if (!get_aim_dir(&dir)) return;
5732 fire_ball(GF_DARK, dir, 250, 4);
5733 o_ptr->timeout = randint0(150) + 150;
5736 case ART_SACRED_KNIGHTS:
5739 msg_print("¼ó¾þ¤ê¤¬¿¿¼Â¤ò¾È¤é¤·½Ð¤¹...");
5741 msg_print("Your amulet exhibits the truth...");
5743 if (remove_all_curse())
5746 msg_print("狼¤Ë¸«¼é¤é¤ì¤Æ¤¤¤ë¤è¤¦¤Êµ¤¤¬¤¹¤ë¡£");
5748 msg_print("You feel as if someone is watching over you.");
5757 msg_print("¥Ú¥ó¥À¥ó¥È¤¬ÀÄÇò¤¯¸÷¤Ã¤¿¡¥¡¥¡¥");
5759 msg_print("Your pendant glows pale...");
5761 if (p_ptr->pclass == CLASS_MAGIC_EATER)
5764 for (i = 0; i < EATER_EXT*2; i++)
5766 p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i]*EATER_CHARGE/3;
5767 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;
5769 for (; i < EATER_EXT*3; i++)
5771 int k_idx = lookup_kind(TV_ROD, i-EATER_EXT*2);
5772 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;
5773 if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
5776 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
5778 msg_print("You feel your head clear.");
5780 p_ptr->window |= (PW_PLAYER);
5782 else if (p_ptr->csp < p_ptr->msp)
5784 p_ptr->csp = p_ptr->msp;
5785 p_ptr->csp_frac = 0;
5787 msg_print("Ƭ¤¬¥Ï¥Ã¥¥ê¤È¤·¤¿¡£");
5789 msg_print("You feel your head clear.");
5792 p_ptr->redraw |= (PR_MANA);
5793 p_ptr->window |= (PW_PLAYER);
5794 p_ptr->window |= (PW_SPELL);
5796 o_ptr->timeout = 777;
5802 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5808 if (object_is_smith(o_ptr))
5810 switch (o_ptr->xtra3-1)
5812 case ESSENCE_TMP_RES_ACID:
5813 (void)set_oppose_acid(randint1(20) + 20, FALSE);
5814 o_ptr->timeout = randint0(50) + 50;
5817 case ESSENCE_TMP_RES_ELEC:
5818 (void)set_oppose_elec(randint1(20) + 20, FALSE);
5819 o_ptr->timeout = randint0(50) + 50;
5822 case ESSENCE_TMP_RES_FIRE:
5823 (void)set_oppose_fire(randint1(20) + 20, FALSE);
5824 o_ptr->timeout = randint0(50) + 50;
5827 case ESSENCE_TMP_RES_COLD:
5828 (void)set_oppose_cold(randint1(20) + 20, FALSE);
5829 o_ptr->timeout = randint0(50) + 50;
5833 earthquake(py, px, 5);
5834 o_ptr->timeout = 100 + randint1(100);
5837 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5845 if (o_ptr->name2 == EGO_TRUMP)
5847 teleport_player(100, 0L);
5848 o_ptr->timeout = 50 + randint1(50);
5851 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5858 if (o_ptr->name2 == EGO_LITE_ILLUMINATION)
5860 if (!o_ptr->xtra4 && ((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
5863 msg_print("dzÎÁ¤¬¤Ê¤¤¡£");
5865 msg_print("It has no fuel.");
5870 lite_area(damroll(2, 15), 3);
5871 o_ptr->timeout = randint0(10) + 10;
5874 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5880 if (o_ptr->name2 == EGO_EARTHQUAKES)
5882 earthquake(py, px, 5);
5883 o_ptr->timeout = 100 + randint1(100);
5886 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5893 if (o_ptr->name2 == EGO_JUMP)
5895 teleport_player(10, 0L);
5896 o_ptr->timeout = 10 + randint1(10);
5899 p_ptr->window |= (PW_INVEN | PW_EQUIP);
5906 /* Hack -- Dragon Scale Mail can be activated as well */
5907 if (o_ptr->tval == TV_DRAG_ARMOR)
5909 /* Get a direction for breathing (or abort) */
5910 if (!get_aim_dir(&dir)) return;
5912 if (music_singing_any()) stop_singing();
5914 /* Branch on the sub-type */
5915 switch (o_ptr->sval)
5917 case SV_DRAGON_BLUE:
5920 msg_print("¤¢¤Ê¤¿¤Ï°ðºÊ¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5922 msg_print("You breathe lightning.");
5925 fire_ball(GF_ELEC, dir, 100, -2);
5926 o_ptr->timeout = randint0(150) + 150;
5930 case SV_DRAGON_WHITE:
5933 msg_print("¤¢¤Ê¤¿¤ÏÎ䵤¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5935 msg_print("You breathe frost.");
5938 fire_ball(GF_COLD, dir, 110, -2);
5939 o_ptr->timeout = randint0(150) + 150;
5943 case SV_DRAGON_BLACK:
5946 msg_print("¤¢¤Ê¤¿¤Ï»À¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5948 msg_print("You breathe acid.");
5951 fire_ball(GF_ACID, dir, 130, -2);
5952 o_ptr->timeout = randint0(150) + 150;
5956 case SV_DRAGON_GREEN:
5959 msg_print("¤¢¤Ê¤¿¤ÏÆÇ¥¬¥¹¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5961 msg_print("You breathe poison gas.");
5964 fire_ball(GF_POIS, dir, 150, -2);
5965 o_ptr->timeout = randint0(180) + 180;
5972 msg_print("¤¢¤Ê¤¿¤Ï²Ð±ê¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
5974 msg_print("You breathe fire.");
5977 fire_ball(GF_FIRE, dir, 200, -2);
5978 o_ptr->timeout = randint0(200) + 200;
5982 case SV_DRAGON_MULTIHUED:
5984 chance = randint0(5);
5986 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
5987 ((chance == 1) ? "°ðºÊ" :
5988 ((chance == 2) ? "Î䵤" :
5989 ((chance == 3) ? "»À" :
5990 ((chance == 4) ? "ÆÇ¥¬¥¹" : "²Ð±ê")))));
5992 msg_format("You breathe %s.",
5993 ((chance == 1) ? "lightning" :
5994 ((chance == 2) ? "frost" :
5995 ((chance == 3) ? "acid" :
5996 ((chance == 4) ? "poison gas" : "fire")))));
5999 fire_ball(((chance == 1) ? GF_ELEC :
6000 ((chance == 2) ? GF_COLD :
6001 ((chance == 3) ? GF_ACID :
6002 ((chance == 4) ? GF_POIS : GF_FIRE)))),
6004 o_ptr->timeout = randint0(200) + 200;
6008 case SV_DRAGON_BRONZE:
6011 msg_print("¤¢¤Ê¤¿¤Ïº®Íð¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6013 msg_print("You breathe confusion.");
6016 fire_ball(GF_CONFUSION, dir, 120, -2);
6017 o_ptr->timeout = randint0(180) + 180;
6021 case SV_DRAGON_GOLD:
6024 msg_print("¤¢¤Ê¤¿¤Ï¹ì²»¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6026 msg_print("You breathe sound.");
6029 fire_ball(GF_SOUND, dir, 130, -2);
6030 o_ptr->timeout = randint0(180) + 180;
6034 case SV_DRAGON_CHAOS:
6036 chance = randint0(2);
6038 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
6039 ((chance == 1 ? "¥«¥ª¥¹" : "Îô²½")));
6041 msg_format("You breathe %s.",
6042 ((chance == 1 ? "chaos" : "disenchantment")));
6045 fire_ball((chance == 1 ? GF_CHAOS : GF_DISENCHANT),
6047 o_ptr->timeout = randint0(200) + 200;
6053 chance = randint0(2);
6055 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
6056 ((chance == 1 ? "¹ì²»" : "ÇËÊÒ")));
6058 msg_format("You breathe %s.",
6059 ((chance == 1 ? "sound" : "shards")));
6062 fire_ball((chance == 1 ? GF_SOUND : GF_SHARDS),
6064 o_ptr->timeout = randint0(200) + 200;
6068 case SV_DRAGON_BALANCE:
6070 chance = randint0(4);
6072 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿",
6073 ((chance == 1) ? "¥«¥ª¥¹" :
6074 ((chance == 2) ? "Îô²½" :
6075 ((chance == 3) ? "¹ì²»" : "ÇËÊÒ"))));
6077 msg_format("You breathe %s.",
6078 ((chance == 1) ? "chaos" :
6079 ((chance == 2) ? "disenchantment" :
6080 ((chance == 3) ? "sound" : "shards"))));
6083 fire_ball(((chance == 1) ? GF_CHAOS :
6084 ((chance == 2) ? GF_DISENCHANT :
6085 ((chance == 3) ? GF_SOUND : GF_SHARDS))),
6087 o_ptr->timeout = randint0(200) + 200;
6091 case SV_DRAGON_SHINING:
6093 chance = randint0(2);
6095 msg_format("¤¢¤Ê¤¿¤Ï%s¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£",
6096 ((chance == 0 ? "Á®¸÷" : "°Å¹õ")));
6098 msg_format("You breathe %s.",
6099 ((chance == 0 ? "light" : "darkness")));
6102 fire_ball((chance == 0 ? GF_LITE : GF_DARK), dir, 200, -2);
6103 o_ptr->timeout = randint0(200) + 200;
6107 case SV_DRAGON_POWER:
6110 msg_print("¤¢¤Ê¤¿¤Ï¥¨¥ì¥á¥ó¥È¤Î¥Ö¥ì¥¹¤òÅǤ¤¤¿¡£");
6112 msg_print("You breathe the elements.");
6115 fire_ball(GF_MISSILE, dir, 300, -3);
6116 o_ptr->timeout = randint0(200) + 200;
6122 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6128 else if (o_ptr->tval == TV_RING)
6130 if (object_is_ego(o_ptr))
6132 bool success = TRUE;
6134 switch (o_ptr->name2)
6137 (void)set_afraid(0);
6138 (void)set_hero(randint1(25) + 25, FALSE);
6139 (void)hp_player(10);
6140 o_ptr->timeout = randint1(100)+100;
6142 case EGO_RING_MAGIC_MIS:
6143 if (!get_aim_dir(&dir)) return;
6144 fire_bolt(GF_MISSILE, dir, damroll(2, 6));
6147 case EGO_RING_FIRE_BOLT:
6148 if (!get_aim_dir(&dir)) return;
6149 fire_bolt(GF_FIRE, dir, damroll(9, 8));
6150 o_ptr->timeout = randint0(8) + 8;
6152 case EGO_RING_COLD_BOLT:
6153 if (!get_aim_dir(&dir)) return;
6154 fire_bolt(GF_COLD, dir, damroll(6, 8));
6155 o_ptr->timeout = randint0(7) + 7;
6157 case EGO_RING_ELEC_BOLT:
6158 if (!get_aim_dir(&dir)) return;
6159 fire_bolt(GF_ELEC, dir, damroll(4, 8));
6160 o_ptr->timeout = randint0(5) + 5;
6162 case EGO_RING_ACID_BOLT:
6163 if (!get_aim_dir(&dir)) return;
6164 fire_bolt(GF_ACID, dir, damroll(5, 8));
6165 o_ptr->timeout = randint0(6) + 6;
6167 case EGO_RING_MANA_BOLT:
6168 if (!get_aim_dir(&dir)) return;
6169 fire_bolt(GF_MANA, dir, 120);
6170 o_ptr->timeout = randint0(120)+120;
6172 case EGO_RING_FIRE_BALL:
6173 if (!get_aim_dir(&dir)) return;
6174 fire_ball(GF_FIRE, dir, 100, 2);
6175 o_ptr->timeout = randint0(80) + 80;
6177 case EGO_RING_COLD_BALL:
6178 if (!get_aim_dir(&dir)) return;
6179 fire_ball(GF_COLD, dir, 100, 2);
6180 o_ptr->timeout = randint0(80) + 80;
6182 case EGO_RING_ELEC_BALL:
6183 if (!get_aim_dir(&dir)) return;
6184 fire_ball(GF_ELEC, dir, 100, 2);
6185 o_ptr->timeout = randint0(80) + 80;
6187 case EGO_RING_ACID_BALL:
6188 if (!get_aim_dir(&dir)) return;
6189 fire_ball(GF_ACID, dir, 100, 2);
6190 o_ptr->timeout = randint0(80) + 80;
6192 case EGO_RING_MANA_BALL:
6193 if (!get_aim_dir(&dir)) return;
6194 fire_ball(GF_MANA, dir, 250, 2);
6195 o_ptr->timeout = 300;
6197 case EGO_RING_DRAGON_F:
6198 if (!get_aim_dir(&dir)) return;
6199 fire_ball(GF_FIRE, dir, 200, -2);
6200 if (o_ptr->sval == SV_RING_FLAMES)
6202 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6203 o_ptr->timeout = 200;
6205 else o_ptr->timeout = 250;
6207 case EGO_RING_DRAGON_C:
6208 if (!get_aim_dir(&dir)) return;
6209 fire_ball(GF_COLD, dir, 200, -2);
6210 if (o_ptr->sval == SV_RING_ICE)
6212 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6213 o_ptr->timeout = 200;
6215 else o_ptr->timeout = 250;
6217 case EGO_RING_M_DETECT:
6218 (void)detect_monsters_invis(255);
6219 (void)detect_monsters_normal(255);
6220 o_ptr->timeout = 150;
6222 case EGO_RING_D_SPEED:
6223 (void)set_fast(randint1(30) + 15, FALSE);
6224 o_ptr->timeout = 100;
6226 case EGO_RING_BERSERKER:
6227 (void)set_afraid(0);
6228 (void)set_shero(randint1(25) + 25, FALSE);
6229 o_ptr->timeout = randint0(75)+75;
6231 case EGO_RING_TELE_AWAY:
6232 if (!get_aim_dir(&dir)) return;
6233 teleport_monster(dir);
6234 o_ptr->timeout = 150;
6238 int v = randint1(25)+25;
6239 (void)set_afraid(0);
6240 (void)set_hero(v, FALSE);
6241 (void)hp_player(10);
6242 (void)set_blessed(v, FALSE);
6243 (void)set_oppose_acid(v, FALSE);
6244 (void)set_oppose_elec(v, FALSE);
6245 (void)set_oppose_fire(v, FALSE);
6246 (void)set_oppose_cold(v, FALSE);
6247 (void)set_oppose_pois(v, FALSE);
6248 (void)set_ultimate_res(v, FALSE);
6249 o_ptr->timeout = 777;
6256 if (success) return;
6259 /* Get a direction for breathing (or abort) */
6260 if (!get_aim_dir(&dir)) return;
6262 switch (o_ptr->sval)
6266 fire_ball(GF_ACID, dir, 100, 2);
6267 (void)set_oppose_acid(randint1(20) + 20, FALSE);
6268 o_ptr->timeout = randint0(50) + 50;
6274 fire_ball(GF_COLD, dir, 100, 2);
6275 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6276 o_ptr->timeout = randint0(50) + 50;
6280 case SV_RING_FLAMES:
6282 fire_ball(GF_FIRE, dir, 100, 2);
6283 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6284 o_ptr->timeout = randint0(50) + 50;
6290 fire_ball(GF_ELEC, dir, 100, 2);
6291 (void)set_oppose_elec(randint1(20) + 20, FALSE);
6292 o_ptr->timeout = randint0(50) + 50;
6298 p_ptr->window |= (PW_INVEN | PW_EQUIP);
6304 else if (o_ptr->tval == TV_AMULET)
6306 if (object_is_ego(o_ptr))
6308 switch (o_ptr->name2)
6311 if (!ident_spell(FALSE)) return;
6312 o_ptr->timeout = 10;
6315 if (!get_aim_dir(&dir)) return;
6316 charm_monster(dir, MAX(20, p_ptr->lev));
6317 o_ptr->timeout = 200;
6320 teleport_player(10, 0L);
6321 o_ptr->timeout = randint0(10) + 10;
6323 case EGO_AMU_TELEPORT:
6324 teleport_player(100, 0L);
6325 o_ptr->timeout = randint0(50) + 50;
6327 case EGO_AMU_D_DOOR:
6328 (void)dimension_door();
6329 o_ptr->timeout = 200;
6331 case EGO_AMU_RES_FIRE_:
6332 (void)set_oppose_fire(randint1(20) + 20, FALSE);
6333 o_ptr->timeout = randint0(50) + 50;
6335 case EGO_AMU_RES_COLD_:
6336 (void)set_oppose_cold(randint1(20) + 20, FALSE);
6337 o_ptr->timeout = randint0(50) + 50;
6339 case EGO_AMU_RES_ELEC_:
6340 (void)set_oppose_elec(randint1(20) + 20, FALSE);
6341 o_ptr->timeout = randint0(50) + 50;
6343 case EGO_AMU_RES_ACID_:
6344 (void)set_oppose_acid(randint1(20) + 20, FALSE);
6345 o_ptr->timeout = randint0(50) + 50;
6347 case EGO_AMU_DETECTION:
6348 detect_all(DETECT_RAD_DEFAULT);
6349 o_ptr->timeout = randint0(55)+55;
6356 else if (o_ptr->tval == TV_WHISTLE)
6358 if (music_singing_any()) stop_singing();
6361 if (object_is_cursed(o_ptr))
6364 msg_print("¥«¥ó¹â¤¤²»¤¬¶Á¤ÅϤä¿¡£");
6366 msg_print("You produce a shrill whistling sound.");
6368 aggravate_monsters(0);
6378 /* Allocate the "who" array */
6379 C_MAKE(who, max_m_idx, u16b);
6381 /* Process the monsters (backwards) */
6382 for (pet_ctr = m_max - 1; pet_ctr >= 1; pet_ctr--)
6384 if (is_pet(&m_list[pet_ctr]) && (p_ptr->riding != pet_ctr))
6385 who[max_pet++] = pet_ctr;
6388 /* Select the sort method */
6389 ang_sort_comp = ang_sort_comp_pet;
6390 ang_sort_swap = ang_sort_swap_hook;
6392 ang_sort(who, &dummy_why, max_pet);
6394 /* Process the monsters (backwards) */
6395 for (i = 0; i < max_pet; i++)
6398 teleport_monster_to(pet_ctr, py, px, 100, TELEPORT_PASSIVE);
6401 /* Free the "who" array */
6402 C_KILL(who, max_m_idx, u16b);
6404 o_ptr->timeout = 100+randint1(100);
6407 else if (o_ptr->tval == TV_CAPTURE)
6411 bool old_target_pet = target_pet;
6413 if (!get_aim_dir(&dir))
6415 target_pet = old_target_pet;
6418 target_pet = old_target_pet;
6420 if(fire_ball(GF_CAPTURE, dir, 0, 0))
6422 o_ptr->pval = cap_mon;
6423 o_ptr->xtra3 = cap_mspeed;
6424 o_ptr->xtra4 = cap_hp;
6425 o_ptr->xtra5 = cap_maxhp;
6432 if (o_ptr->inscription)
6433 strcpy(buf, quark_str(o_ptr->inscription));
6435 for (s = buf;*s && (*s != '#'); s++)
6438 if (iskanji(*s)) s++;
6448 t = quark_str(cap_nickname);
6461 o_ptr->inscription = quark_add(buf);
6467 bool success = FALSE;
6468 if (!get_rep_dir2(&dir)) return;
6469 if (monster_can_enter(py + ddy[dir], px + ddx[dir], &r_info[o_ptr->pval], 0))
6471 if (place_monster_aux(0, py + ddy[dir], px + ddx[dir], o_ptr->pval, (PM_FORCE_PET | PM_NO_KAGE)))
6473 if (o_ptr->xtra3) m_list[hack_m_idx_ii].mspeed = o_ptr->xtra3;
6474 if (o_ptr->xtra5) m_list[hack_m_idx_ii].max_maxhp = o_ptr->xtra5;
6475 if (o_ptr->xtra4) m_list[hack_m_idx_ii].hp = o_ptr->xtra4;
6476 m_list[hack_m_idx_ii].maxhp = m_list[hack_m_idx_ii].max_maxhp;
6477 if (o_ptr->inscription)
6485 t = quark_str(o_ptr->inscription);
6486 for (t = quark_str(o_ptr->inscription);*t && (*t != '#'); t++)
6489 if (iskanji(*t)) t++;
6514 if (quote && *(s-1) =='\'')
6518 m_list[hack_m_idx_ii].nickname = quark_add(buf);
6519 t = quark_str(o_ptr->inscription);
6521 while(*t && (*t != '#'))
6528 o_ptr->inscription = quark_add(buf);
6540 msg_print("¤ª¤Ã¤È¡¢²òÊü¤Ë¼ºÇÔ¤·¤¿¡£");
6542 msg_print("Oops. You failed to release your pet.");
6550 msg_print("¤ª¤Ã¤È¡¢¤³¤Î¥¢¥¤¥Æ¥à¤Ï»ÏÆ°¤Ç¤¤Ê¤¤¡£");
6552 msg_print("Oops. That object cannot be activated.");
6558 void do_cmd_activate(void)
6564 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6566 set_action(ACTION_NONE);
6569 item_tester_no_ryoute = TRUE;
6570 /* Prepare the hook */
6571 item_tester_hook = item_tester_hook_activate;
6575 q = "¤É¤Î¥¢¥¤¥Æ¥à¤ò»ÏÆ°¤µ¤»¤Þ¤¹¤«? ";
6576 s = "»ÏÆ°¤Ç¤¤ë¥¢¥¤¥Æ¥à¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£";
6578 q = "Activate which item? ";
6579 s = "You have nothing to activate.";
6582 if (!get_item(&item, q, s, (USE_EQUIP))) return;
6584 /* Activate the item */
6585 do_cmd_activate_aux(item);
6590 * Hook to determine if an object is useable
6592 static bool item_tester_hook_use(object_type *o_ptr)
6594 u32b flgs[TR_FLAG_SIZE];
6597 if (o_ptr->tval == p_ptr->tval_ammo)
6600 /* Useable object */
6601 switch (o_ptr->tval)
6619 if (!object_is_known(o_ptr)) return (FALSE);
6621 /* HACK - only items from the equipment can be activated */
6622 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
6624 if (&inventory[i] == o_ptr)
6626 /* Extract the flags */
6627 object_flags(o_ptr, flgs);
6629 /* Check activation flag */
6630 if (have_flag(flgs, TR_ACTIVATE)) return (TRUE);
6643 * XXX - Add actions for other item types
6645 void do_cmd_use(void)
6651 if (p_ptr->special_defense & (KATA_MUSOU | KATA_KOUKIJIN))
6653 set_action(ACTION_NONE);
6656 item_tester_no_ryoute = TRUE;
6657 /* Prepare the hook */
6658 item_tester_hook = item_tester_hook_use;
6662 q = "¤É¤ì¤ò»È¤¤¤Þ¤¹¤«¡©";
6663 s = "»È¤¨¤ë¤â¤Î¤¬¤¢¤ê¤Þ¤»¤ó¡£";
6665 q = "Use which item? ";
6666 s = "You have nothing to use.";
6669 if (!get_item(&item, q, s, (USE_INVEN | USE_EQUIP | USE_FLOOR))) return;
6671 /* Get the item (in the pack) */
6674 o_ptr = &inventory[item];
6676 /* Get the item (on the floor) */
6679 o_ptr = &o_list[0 - item];
6682 switch (o_ptr->tval)
6694 do_cmd_eat_food_aux(item);
6701 do_cmd_aim_wand_aux(item);
6708 do_cmd_use_staff_aux(item);
6715 do_cmd_zap_rod_aux(item);
6719 /* Quaff a potion */
6722 do_cmd_quaff_potion_aux(item);
6729 /* Check some conditions */
6733 msg_print("Ìܤ¬¸«¤¨¤Ê¤¤¡£");
6735 msg_print("You can't see anything.");
6743 msg_print("ÌÀ¤«¤ê¤¬¤Ê¤¤¤Î¤Ç¡¢°Å¤¯¤ÆÆɤá¤Ê¤¤¡£");
6745 msg_print("You have no light to read by.");
6750 if (p_ptr->confused)
6753 msg_print("º®Í𤷤Ƥ¤¤ÆÆɤá¤Ê¤¤¡ª");
6755 msg_print("You are too confused!");
6761 do_cmd_read_scroll_aux(item, TRUE);
6770 do_cmd_fire_aux(item, &inventory[INVEN_BOW]);
6774 /* Activate an artifact */
6777 do_cmd_activate_aux(item);
6783 static int select_magic_eater(bool only_browse)
6787 bool flag, request_list;
6789 int ask = TRUE, i = 0;
6792 int menu_line = (use_menu ? 1 : 0);
6796 if (repeat_pull(&sn))
6798 /* Verify the spell */
6799 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))
6801 else if (sn < EATER_EXT*2 && !(p_ptr->magic_num1[sn] < EATER_CHARGE))
6805 #endif /* ALLOW_REPEAT */
6807 for (i = 0; i < 108; i++)
6809 if (p_ptr->magic_num2[i]) break;
6814 msg_print("ËâË¡¤ò³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6816 msg_print("You don't have any magic!");
6828 prt(format(" %s ¾ó", (menu_line == 1) ? "¡Õ" : " "), 2, 14);
6829 prt(format(" %s ËâË¡ËÀ", (menu_line == 2) ? "¡Õ" : " "), 3, 14);
6830 prt(format(" %s ¥í¥Ã¥É", (menu_line == 3) ? "¡Õ" : " "), 4, 14);
6831 prt("¤É¤Î¼ïÎà¤ÎËâË¡¤ò»È¤¤¤Þ¤¹¤«¡©", 0, 0);
6833 prt(format(" %s staff", (menu_line == 1) ? "> " : " "), 2, 14);
6834 prt(format(" %s wand", (menu_line == 2) ? "> " : " "), 3, 14);
6835 prt(format(" %s rod", (menu_line == 3) ? "> " : " "), 4, 14);
6836 prt("Which type of magic do you use?", 0, 0);
6859 ext = (menu_line-1)*EATER_EXT;
6860 if (menu_line == 1) tval = TV_STAFF;
6861 else if (menu_line == 2) tval = TV_WAND;
6865 if (menu_line > 3) menu_line -= 3;
6874 if (!get_com("[A] ¾ó, [B] ËâË¡ËÀ, [C] ¥í¥Ã¥É:", &choice, TRUE))
6876 if (!get_com("[A] staff, [B] wand, [C] rod:", &choice, TRUE))
6881 if (choice == 'A' || choice == 'a')
6887 if (choice == 'B' || choice == 'b')
6893 if (choice == 'C' || choice == 'c')
6901 for (i = ext; i < ext + EATER_EXT; i++)
6903 if (p_ptr->magic_num2[i])
6905 if (use_menu) menu_line = i-ext+1;
6909 if (i == ext+EATER_EXT)
6912 msg_print("¤½¤Î¼ïÎà¤ÎËâË¡¤Ï³Ð¤¨¤Æ¤¤¤Ê¤¤¡ª");
6914 msg_print("You don't have that type of magic!");
6919 /* Nothing chosen yet */
6922 /* Build a prompt */
6924 (void) strnfmt(out_val, 78, "('*'¤Ç°ìÍ÷, ESC¤ÇÃæÃÇ) ¤É¤ÎËâÎϤò»È¤¤¤Þ¤¹¤«¡©");
6926 (void)strnfmt(out_val, 78, "(*=List, ESC=exit) Use which power? ");
6929 /* Save the screen */
6932 request_list = always_show_list;
6934 /* Get a spell from the user */
6938 if (request_list || use_menu)
6949 for (y = 1; y < 20; y++)
6954 /* Print header(s) */
6956 prt(format(" %s ¼ºÎ¨ %s ¼ºÎ¨", (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô"), (tval == TV_ROD ? " ¾õÂÖ " : "»ÈÍѲó¿ô")), y++, x);
6958 prt(format(" %s Fail %s Fail", (tval == TV_ROD ? " Stat " : " Charges"), (tval == TV_ROD ? " Stat " : " Charges")), y++, x);
6962 for (ctr = 0; ctr < EATER_EXT; ctr++)
6964 if (!p_ptr->magic_num2[ctr+ext]) continue;
6966 k_idx = lookup_kind(tval, ctr);
6970 if (ctr == (menu_line-1))
6972 strcpy(dummy, "¡Õ");
6974 strcpy(dummy, "> ");
6976 else strcpy(dummy, " ");
6979 /* letter/number for power selection */
6986 letter = '0' + ctr - 26;
6987 sprintf(dummy, "%c)",letter);
6989 x1 = ((ctr < EATER_EXT/2) ? x : x + 40);
6990 y1 = ((ctr < EATER_EXT/2) ? y + ctr : y + ctr - EATER_EXT/2);
6991 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
6992 chance = level * 4 / 5 + 20;
6993 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
6995 if (p_ptr->lev > level)
6997 chance -= 3 * (p_ptr->lev - level);
6999 chance = mod_spell_chance_1(chance);
7000 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
7001 /* Stunning makes spells harder */
7002 if (p_ptr->stun > 50) chance += 25;
7003 else if (p_ptr->stun) chance += 15;
7005 if (chance > 95) chance = 95;
7007 chance = mod_spell_chance_2(chance);
7015 strcat(dummy, format(
7017 " %-22.22s ½¼Å¶:%2d/%2d%3d%%",
7019 " %-22.22s (%2d/%2d) %3d%%",
7021 k_name + k_info[k_idx].name,
7022 p_ptr->magic_num1[ctr+ext] ?
7023 (p_ptr->magic_num1[ctr+ext] - 1) / (EATER_ROD_CHARGE * k_info[k_idx].pval) +1 : 0,
7024 p_ptr->magic_num2[ctr+ext], chance));
7025 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;
7029 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));
7030 if (p_ptr->magic_num1[ctr+ext] < EATER_CHARGE) col = TERM_RED;
7035 c_prt(col, dummy, y1, x1);
7039 if (!get_com(out_val, &choice, FALSE)) break;
7041 if (use_menu && choice != ' ')
7057 menu_line += EATER_EXT - 1;
7058 if (menu_line > EATER_EXT) menu_line -= EATER_EXT;
7059 } while(!p_ptr->magic_num2[menu_line+ext-1]);
7070 if (menu_line > EATER_EXT) menu_line -= EATER_EXT;
7071 } while(!p_ptr->magic_num2[menu_line+ext-1]);
7082 bool reverse = FALSE;
7083 if ((choice == '4') || (choice == 'h') || (choice == 'H')) reverse = TRUE;
7084 if (menu_line > EATER_EXT/2)
7086 menu_line -= EATER_EXT/2;
7089 else menu_line+=EATER_EXT/2;
7090 while(!p_ptr->magic_num2[menu_line+ext-1])
7095 if (menu_line < 2) reverse = FALSE;
7100 if (menu_line > EATER_EXT-1) reverse = TRUE;
7117 /* Request redraw */
7118 if (use_menu && ask) continue;
7120 /* Request redraw */
7121 if (!use_menu && ((choice == ' ') || (choice == '*') || (choice == '?')))
7127 request_list = FALSE;
7129 /* Restore the screen */
7134 request_list = TRUE;
7142 if (isalpha(choice))
7145 ask = (isupper(choice));
7148 if (ask) choice = tolower(choice);
7150 /* Extract request */
7151 i = (islower(choice) ? A2I(choice) : -1);
7155 ask = FALSE; /* Can't uppercase digits */
7157 i = choice - '0' + 26;
7161 /* Totally Illegal */
7162 if ((i < 0) || (i > EATER_EXT) || !p_ptr->magic_num2[i+ext])
7177 (void) strnfmt(tmp_val, 78, "%s¤ò»È¤¤¤Þ¤¹¤«¡© ", k_name + k_info[lookup_kind(tval ,i)].name);
7179 (void) strnfmt(tmp_val, 78, "Use %s?", k_name + k_info[lookup_kind(tval ,i)].name);
7182 /* Belay that order */
7183 if (!get_check(tmp_val)) continue;
7187 if (p_ptr->magic_num1[ext+i] > k_info[lookup_kind(tval, i)].pval * (p_ptr->magic_num2[ext+i] - 1) * EATER_ROD_CHARGE)
7190 msg_print("¤½¤ÎËâË¡¤Ï¤Þ¤À½¼Å¶¤·¤Æ¤¤¤ëºÇÃæ¤À¡£");
7192 msg_print("The magic are still charging.");
7195 if (use_menu) ask = TRUE;
7201 if (p_ptr->magic_num1[ext+i] < EATER_CHARGE)
7204 msg_print("¤½¤ÎËâË¡¤Ï»ÈÍѲó¿ô¤¬ÀÚ¤ì¤Æ¤¤¤ë¡£");
7206 msg_print("The magic has no charges left.");
7209 if (use_menu) ask = TRUE;
7221 /* Clear lines, position cursor (really should use strlen here) */
7222 Term_erase(7, 23, 255);
7223 Term_erase(7, 22, 255);
7224 Term_erase(7, 21, 255);
7225 Term_erase(7, 20, 255);
7227 roff_to_buf(k_text + k_info[lookup_kind(tval, i)].text, 62, temp, sizeof(temp));
7228 for (j = 0, line = 21; temp[j]; j += 1 + strlen(&temp[j]))
7230 prt(&temp[j], line, 10);
7235 prt("²¿¤«¥¡¼¤ò²¡¤·¤Æ²¼¤µ¤¤¡£",0,0);
7237 prt("Hit any key.",0,0);
7247 /* Restore the screen */
7250 if (!flag) return -1;
7254 #endif /* ALLOW_REPEAT */
7260 * Use eaten rod, wand or staff
7262 void do_cmd_magic_eater(bool only_browse)
7264 int item, chance, level, k_idx, tval, sval;
7265 bool use_charge = TRUE;
7267 /* Not when confused */
7268 if (!only_browse && p_ptr->confused)
7271 msg_print("º®Í𤷤Ƥ¤¤Æ¾§¤¨¤é¤ì¤Ê¤¤¡ª");
7273 msg_print("You are too confused!");
7279 item = select_magic_eater(only_browse);
7285 if (item >= EATER_EXT*2) {tval = TV_ROD;sval = item - EATER_EXT*2;}
7286 else if (item >= EATER_EXT) {tval = TV_WAND;sval = item - EATER_EXT;}
7287 else {tval = TV_STAFF;sval = item;}
7288 k_idx = lookup_kind(tval, sval);
7290 level = (tval == TV_ROD ? k_info[k_idx].level * 5 / 6 - 5 : k_info[k_idx].level);
7291 chance = level * 4 / 5 + 20;
7292 chance -= 3 * (adj_mag_stat[p_ptr->stat_ind[mp_ptr->spell_stat]] - 1);
7294 if (p_ptr->lev > level)
7296 chance -= 3 * (p_ptr->lev - level);
7298 chance = mod_spell_chance_1(chance);
7299 chance = MAX(chance, adj_mag_fail[p_ptr->stat_ind[mp_ptr->spell_stat]]);
7300 /* Stunning makes spells harder */
7301 if (p_ptr->stun > 50) chance += 25;
7302 else if (p_ptr->stun) chance += 15;
7304 if (chance > 95) chance = 95;
7306 chance = mod_spell_chance_2(chance);
7308 if (randint0(100) < chance)
7310 if (flush_failure) flush();
7313 msg_print("¼öʸ¤ò¤¦¤Þ¤¯¾§¤¨¤é¤ì¤Ê¤«¤Ã¤¿¡ª");
7315 msg_format("You failed to get the magic off!");
7319 if (randint1(100) >= chance)
7320 chg_virtue(V_CHANCE,-1);
7331 if ((sval >= SV_ROD_MIN_DIRECTION) && (sval != SV_ROD_HAVOC) && (sval != SV_ROD_AGGRAVATE) && (sval != SV_ROD_PESTICIDE))
7332 if (!get_aim_dir(&dir)) return;
7333 rod_effect(sval, dir, &use_charge, TRUE);
7334 if (!use_charge) return;
7336 else if (tval == TV_WAND)
7338 if (!get_aim_dir(&dir)) return;
7339 wand_effect(sval, dir, TRUE);
7343 staff_effect(sval, &use_charge, TRUE, TRUE);
7344 if (!use_charge) return;
7346 if (randint1(100) < chance)
7347 chg_virtue(V_CHANCE,1);
7350 if (tval == TV_ROD) p_ptr->magic_num1[item] += k_info[k_idx].pval * EATER_ROD_CHARGE;
7351 else p_ptr->magic_num1[item] -= EATER_CHARGE;