}
+/* Hex */
+static bool item_tester_hook_weapon_except_bow(object_type *o_ptr)
+{
+ switch (o_ptr->tval)
+ {
+ case TV_SWORD:
+ case TV_HAFTED:
+ case TV_POLEARM:
+ case TV_DIGGING:
+ {
+ return (TRUE);
+ }
+ }
+
+ return (FALSE);
+}
+
+static bool item_tester_hook_cursed(object_type *o_ptr)
+{
+ return (bool)(object_is_cursed(o_ptr));
+}
+
+static cptr do_hex_spell(int spell, int mode)
+{
+ bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
+ bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
+ bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
+ bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
+ bool fail = (mode == SPELL_FAIL) ? TRUE : FALSE;
+ bool cont = (mode == SPELL_CONT) ? TRUE : FALSE;
+ bool stop = (mode == SPELL_STOP) ? TRUE : FALSE;
+
+ bool add = TRUE;
+
+ int plev = p_ptr->lev;
+ int power;
+
+ switch (spell)
+ {
+ /*** 1st book (0-7) ***/
+ case 0:
+#ifdef JP
+ if (name) return "¼Ù¤Ê¤ë½ËÊ¡";
+ if (desc) return "½ËÊ¡¤Ë¤è¤ê¹¶·âÀºÅÙ¤ÈËɸæÎϤ¬¾å¤¬¤ë¡£";
+#else
+ if (name) return "Evily blessing";
+ if (desc) return "Attempts to increase +to_hit of a weapon and AC";
+#endif
+ if (cast)
+ {
+ if (!p_ptr->blessed)
+ {
+#ifdef JP
+ msg_print("¹â·é¤Êµ¤Ê¬¤Ë¤Ê¤Ã¤¿¡ª");
+#else
+ msg_print("You feel righteous!");
+#endif
+ }
+ }
+ if (stop)
+ {
+ if (!p_ptr->blessed)
+ {
+#ifdef JP
+ msg_print("¹â·é¤Êµ¤Ê¬¤¬¾Ã¤¨¼º¤»¤¿¡£");
+#else
+ msg_print("The prayer has expired.");
+#endif
+ }
+ }
+ break;
+
+ case 1:
+#ifdef JP
+ if (name) return "·Ú½ý¤Î¼£Ìþ";
+ if (desc) return "HP¤ä½ý¤ò¾¯¤·²óÉü¤µ¤»¤ë¡£";
+#else
+ if (name) return "Cure light wounds";
+ if (desc) return "Heals cut and HP a little.";
+#endif
+ if (info) return info_heal(1, 10, 0);
+ if (cast)
+ {
+#ifdef JP
+ msg_print("µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤Æ¤¯¤ë¡£");
+#else
+ msg_print("You feel better and better.");
+#endif
+ }
+ if (cast || cont)
+ {
+ hp_player(damroll(1, 10));
+ set_cut(p_ptr->cut - 10);
+ }
+ break;
+
+ case 2:
+#ifdef JP
+ if (name) return "°Ëâ¤Î¥ª¡¼¥é";
+ if (desc) return "±ê¤Î¥ª¡¼¥é¤ò¿È¤Ë¤Þ¤È¤¤¡¢²óÉü®ÅÙ¤¬Â®¤¯¤Ê¤ë¡£";
+#else
+ if (name) return "Demonic aura";
+ if (desc) return "Gives fire aura and regeneration.";
+#endif
+ if (cast)
+ {
+#ifdef JP
+ msg_print("ÂΤ¬±ê¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
+#else
+ msg_print("You have enveloped by fiery aura!");
+#endif
+ }
+ if (stop)
+ {
+#ifdef JP
+ msg_print("±ê¤Î¥ª¡¼¥é¤¬¾Ã¤¨µî¤Ã¤¿¡£");
+#else
+ msg_print("Fiery aura disappeared.");
+#endif
+ }
+ break;
+
+ case 3:
+#ifdef JP
+ if (name) return "°½Ì¸";
+ if (desc) return "»ë³¦Æâ¤Î¥â¥ó¥¹¥¿¡¼¤ËÈù¼åÎ̤ÎÆǤΥÀ¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
+#else
+ if (name) return "Stinking mist";
+ if (desc) return "Deals few damages of poison to all monsters in your sight.";
+#endif
+ power = plev / 2 + 5;
+ if (info) return info_damage(1, power, 0);
+ if (cast || cont)
+ {
+ project_hack(GF_POIS, randint1(power));
+ }
+ break;
+
+ case 4:
+#ifdef JP
+ if (name) return "ÏÓÎ϶¯²½";
+ if (desc) return "½Ñ¼Ô¤ÎÏÓÎϤò¾å¾º¤µ¤»¤ë¡£";
+#else
+ if (name) return "Extra might";
+ if (desc) return "Attempts to increase your strength.";
+#endif
+ if (cast)
+ {
+#ifdef JP
+ msg_print("²¿¤À¤«ÎϤ¬Í¯¤¤¤ÆÍè¤ë¡£");
+#else
+ msg_print("You feel you get stronger.");
+#endif
+ }
+ break;
+
+ case 5:
+#ifdef JP
+ if (name) return "Éð´ï¼öÇû";
+ if (desc) return "ÁõÈ÷¤·¤Æ¤¤¤ëÉð´ï¤ò¼ö¤¦¡£";
+#else
+ if (name) return "Curse weapon";
+ if (desc) return "Curses your weapon.";
+#endif
+ if (cast)
+ {
+ int item;
+ char *q, *s;
+ char o_name[MAX_NLEN];
+ object_type *o_ptr;
+ u32b f[TR_FLAG_SIZE];
+
+ item_tester_hook = item_tester_hook_weapon_except_bow;
+#ifdef JP
+ q = "¤É¤ì¤ò¼ö¤¤¤Þ¤¹¤«¡©";
+ s = "Éð´ï¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£";
+#else
+ q = "Which weapon do you curse?";
+ s = "You wield no weapons.";
+#endif
+
+ if (!get_item(&item, q, s, (USE_EQUIP))) return FALSE;
+
+ o_ptr = &inventory[item];
+ object_desc(o_name, o_ptr, OD_NAME_ONLY);
+ object_flags(o_ptr, f);
+
+#ifdef JP
+ if (!get_check(format("ËÜÅö¤Ë %s ¤ò¼ö¤¤¤Þ¤¹¤«¡©", o_name))) return FALSE;
+#else
+ if (!get_check(format("Do you curse %s, really¡©", o_name))) return FALSE;
+#endif
+
+ if (!one_in_(3) &&
+ (object_is_artifact(o_ptr) || have_flag(f, TR_BLESSED)))
+ {
+#ifdef JP
+ msg_format("%s ¤Ï¼ö¤¤¤òÄ·¤ÍÊÖ¤·¤¿¡£", o_name);
+#else
+ msg_format("%s resists the effect.", o_name);
+#endif
+ if (one_in_(3))
+ {
+ if (o_ptr->to_d > 0)
+ {
+ o_ptr->to_d -= randint1(3) % 2;
+ if (o_ptr->to_d < 0) o_ptr->to_d = 0;
+ }
+ if (o_ptr->to_h > 0)
+ {
+ o_ptr->to_h -= randint1(3) % 2;
+ if (o_ptr->to_h < 0) o_ptr->to_h = 0;
+ }
+ if (o_ptr->to_a > 0)
+ {
+ o_ptr->to_a -= randint1(3) % 2;
+ if (o_ptr->to_a < 0) o_ptr->to_a = 0;
+ }
+#ifdef JP
+ msg_format("%s ¤ÏÎô²½¤·¤Æ¤·¤Þ¤Ã¤¿¡£", o_name);
+#else
+ msg_format("Your %s was disenchanted!", o_name);
+#endif
+ }
+ }
+ else
+ {
+ int power = 0;
+#ifdef JP
+ msg_format("¶²ÉݤΰŹõ¥ª¡¼¥é¤¬¤¢¤Ê¤¿¤Î%s¤òÊñ¤ß¹þ¤ó¤À¡ª", o_name);
+#else
+ msg_format("A terrible black aura blasts your %s!", o_name);
+#endif
+ o_ptr->curse_flags |= (TRC_CURSED);
+
+ if (object_is_artifact(o_ptr) || object_is_ego(o_ptr))
+ {
+
+ if (one_in_(3)) o_ptr->curse_flags |= (TRC_HEAVY_CURSE);
+ if (one_in_(666))
+ {
+ o_ptr->curse_flags |= (TRC_TY_CURSE);
+ if (one_in_(666)) o_ptr->curse_flags |= (TRC_PERMA_CURSE);
+
+ add_flag(o_ptr->art_flags, TR_AGGRAVATE);
+ add_flag(o_ptr->art_flags, TR_VORPAL);
+ add_flag(o_ptr->art_flags, TR_VAMPIRIC);
+#ifdef JP
+ msg_print("·ì¤À¡ª·ì¤À¡ª·ì¤À¡ª");
+#else
+ msg_print("Blood, Blood, Blood!");
+#endif
+ power = 2;
+ }
+ }
+
+ o_ptr->curse_flags |= get_curse(power, o_ptr);
+ }
+
+ p_ptr->update |= (PU_BONUS);
+ add = FALSE;
+ }
+ break;
+
+ case 6:
+#ifdef JP
+ if (name) return "¼Ù°´¶ÃÎ";
+ if (desc) return "¼þ°Ï¤Î¼Ù°¤Ê¥â¥ó¥¹¥¿¡¼¤ò´¶ÃΤ¹¤ë¡£";
+#else
+ if (name) return "Evil detection";
+ if (desc) return "Detects evil monsters.";
+#endif
+ if (info) return info_range(MAX_SIGHT);
+ if (cast)
+ {
+#ifdef JP
+ msg_print("¼Ù°¤ÊÀ¸Êª¤Î¸ºß¤ò´¶¤¸¼è¤í¤¦¤È¤·¤¿¡£");
+#else
+ msg_print("You attend to the presence of evil creatures.");
+#endif
+ }
+ break;
+
+ case 7:
+#ifdef JP
+ if (name) return "²æËý";
+ if (desc) return "¿ô¥¿¡¼¥ó¹¶·â¤òÂѤ¨¡¢¼õ¤±¤¿¥À¥á¡¼¥¸¤Î1/5¤òËâÎϤεå¤È¤·¤ÆÊü¤Ä¡£";
+#else
+ if (name) return "Patience";
+ if (desc) return "Fires strong mana ball after patient any damage while few turns.";
+#endif
+ power = MIN(200, (p_ptr->magic_num1[2] * 2));
+ if (info) return info_damage(0, 0, power);
+ if (cast)
+ {
+ int a = 3 - (p_ptr->pspeed - 100) / 10;
+ int r = 3 + randint1(3) + MAX(0, MIN(3, a));
+
+ if (p_ptr->magic_num2[2] > 0)
+ {
+#ifdef JP
+ msg_print("¤¹¤Ç¤Ë²æËý¤ò¤·¤Æ¤¤¤ë¡£");
+#else
+ msg_print("You are already patienting.");
+#endif
+ return NULL;
+ }
+
+ p_ptr->magic_num2[1] = 1;
+ p_ptr->magic_num2[2] = r;
+ p_ptr->magic_num1[2] = 0;
+#ifdef JP
+ msg_print("¤¸¤Ã¤ÈÂѤ¨¤ë¤³¤È¤Ë¤·¤¿¡£");
+#else
+ msg_print("You decide to patient all damages.");
+#endif
+ add = FALSE;
+ }
+ if (cont)
+ {
+ int rad = 2 + (power / 50);
+
+ p_ptr->magic_num2[2]--;
+
+ if ((p_ptr->magic_num2[2] <= 0) || (power >= 200))
+ {
+#ifdef JP
+ msg_print("²æËý¤¬²ò¤«¤ì¤¿¡ª");
+#else
+ msg_print("Time for end of patioence!");
+#endif
+ if (power)
+ {
+ project(0, rad, py, px, power, GF_HELL_FIRE,
+ (PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
+ }
+ if (p_ptr->wizard)
+ {
+#ifdef JP
+ msg_format("%dÅÀ¤Î¥À¥á¡¼¥¸¤òÊÖ¤·¤¿¡£", power);
+#else
+ msg_format("You return %d damages.", power);
+#endif
+ }
+ p_ptr->magic_num1[2] = 0;
+ }
+ }
+ break;
+
+ /*** 2nd book (8-15) ***/
+ case 8:
+#ifdef JP
+ if (name) return "ɹ¤Î³»";
+ if (desc) return "ɹ¤Î¥ª¡¼¥é¤ò¿È¤Ë¤Þ¤È¤¤¡¢ËɸæÎϤ¬¾å¾º¤¹¤ë¡£";
+#else
+ if (name) return "Ice armor";
+ if (desc) return "Gives fire aura and bonus to AC.";
+#endif
+ if (cast)
+ {
+#ifdef JP
+ msg_print("ÂΤ¬É¹¤Î³»¤Çʤ¤ï¤ì¤¿¡£");
+#else
+ msg_print("You have enveloped by ice armor!");
+#endif
+ }
+ if (stop)
+ {
+#ifdef JP
+ msg_print("ɹ¤Î³»¤¬¾Ã¤¨µî¤Ã¤¿¡£");
+#else
+ msg_print("Ice armor disappeared.");
+#endif
+ }
+ break;
+
+ case 9:
+#ifdef JP
+ if (name) return "½Å½ý¤Î¼£Ìþ";
+ if (desc) return "ÂÎÎϤä½ý¤ò¿¾¯²óÉü¤µ¤»¤ë¡£";
+#else
+ if (name) return "Cure serious wounds";
+ if (desc) return "Heals cut and HP more.";
+#endif
+ if (info) return info_heal(2, 10, 0);
+ if (cast)
+ {
+#ifdef JP
+ msg_print("µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤Æ¤¯¤ë¡£");
+#else
+ msg_print("You feel better and better.");
+#endif
+ }
+ if (cast || cont)
+ {
+ hp_player(damroll(2, 10));
+ set_cut((p_ptr->cut / 2) - 10);
+ }
+ break;
+
+ case 10:
+#ifdef JP
+ if (name) return "ÌôÉʵÛÆþ";
+ if (desc) return "¼öʸ±Ó¾§¤òÃæ»ß¤¹¤ë¤³¤È¤Ê¤¯¡¢Ìô¤Î¸ú²Ì¤òÆÀ¤ë¤³¤È¤¬¤Ç¤¤ë¡£";
+#else
+ if (name) return "Inhail potion";
+ if (desc) return "Quaffs a potion without canceling of casting a spell.";
+#endif
+ if (cast)
+ {
+ p_ptr->magic_num1[0] |= (1L << HEX_INHAIL);
+ do_cmd_quaff_potion();
+ p_ptr->magic_num1[0] &= ~(1L << HEX_INHAIL);
+ add = FALSE;
+ }
+ break;
+
+ case 11:
+#ifdef JP
+ if (name) return "µÛ·ì̸";
+ if (desc) return "»ë³¦Æâ¤Î¥â¥ó¥¹¥¿¡¼¤ËÈù¼åÎ̤ÎÀ¸Ì¿Îϵۼý¤Î¥À¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£Í¿¤¨¤¿¥À¥á¡¼¥¸¤Îʬ¡¢ÂÎÎϤ¬²óÉü¤¹¤ë¡£";
+#else
+ if (name) return "Vampiric mist";
+ if (desc) return "Deals few dameges of drain life to all monsters in your sight.";
+#endif
+ power = (plev / 2) + 5;
+ if (info) return info_damage(1, power, 0);
+ if (cast || cont)
+ {
+ project_hack(GF_OLD_DRAIN, randint1(power));
+ }
+ break;
+
+ case 12:
+#ifdef JP
+ if (name) return "Ëâ·õ²½";
+ if (desc) return "Éð´ï¤Î¹¶·âÎϤò¾å¤²¤ë¡£ÀÚ¤ìÌ£¤òÆÀ¡¢¼ö¤¤¤Ë±þ¤¸¤ÆÍ¿¤¨¤ë¥À¥á¡¼¥¸¤¬¾å¾º¤·¡¢Á±Îɤʥâ¥ó¥¹¥¿¡¼¤ËÂФ¹¤ë¥À¥á¡¼¥¸¤¬2Çܤˤʤ롣";
+#else
+ if (name) return "Swords to runeswords";
+ if (desc) return "Gives vorpal ability to your weapon. Increases damages by your weapon acccording to curse of your weapon.";
+#endif
+ if (cast)
+ {
+#ifdef JP
+ msg_print("¤¢¤Ê¤¿¤ÎÉð´ï¤¬¹õ¤¯µ±¤¤¤¿¡£");
+#else
+ if (!empty_hands(FALSE))
+ msg_print("Your weapons glow bright black.");
+ else
+ msg_print("Your weapon glows bright black.");
+#endif
+ }
+ if (stop)
+ {
+#ifdef JP
+ msg_print("Éð´ï¤Îµ±¤¤¬¾Ã¤¨µî¤Ã¤¿¡£");
+#else
+ msg_format("Brightness of weapon%s disappeared.", (empty_hands(FALSE)) ? "" : "s");
+#endif
+ }
+ break;
+
+ case 13:
+#ifdef JP
+ if (name) return "º®Íð¤Î¼ê";
+ if (desc) return "¹¶·â¤·¤¿ºÝ¥â¥ó¥¹¥¿¡¼¤òº®Í𤵤»¤ë¡£";
+#else
+ if (name) return "Touch of confusion";
+ if (desc) return "Confuses a monster when you attack.";
+#endif
+ if (cast)
+ {
+#ifdef JP
+ msg_print("¤¢¤Ê¤¿¤Î¼ê¤¬ÀÖ¤¯µ±¤»Ï¤á¤¿¡£");
+#else
+ msg_print("Your hands glow bright red.");
+#endif
+ }
+ if (stop)
+ {
+#ifdef JP
+ msg_print("¼ê¤Îµ±¤¤¬¤Ê¤¯¤Ê¤Ã¤¿¡£");
+#else
+ msg_print("Brightness on your hands disappeard.");
+#endif
+ }
+ break;
+
+ case 14:
+#ifdef JP
+ if (name) return "ÆùÂζ¯²½";
+ if (desc) return "½Ñ¼Ô¤ÎÏÓÎÏ¡¢´ïÍѤµ¡¢Âѵ×ÎϤò¾å¾º¤µ¤»¤ë¡£¹¶·â²ó¿ô¤Î¾å¸Â¤ò 1 Áý²Ã¤µ¤»¤ë¡£";
+#else
+ if (name) return "Building up";
+ if (desc) return "Attempts to increases your strength, dexterity and constitusion.";
+#endif
+ if (cast)
+ {
+#ifdef JP
+ msg_print("¿ÈÂΤ¬¶¯¤¯¤Ê¤Ã¤¿µ¤¤¬¤·¤¿¡£");
+#else
+ msg_print("You feel your body is developed more now.");
+#endif
+ }
+ break;
+
+ case 15:
+#ifdef JP
+ if (name) return "È¿¥Æ¥ì¥Ý¡¼¥È·ë³¦";
+ if (desc) return "»ë³¦Æâ¤Î¥â¥ó¥¹¥¿¡¼¤Î¥Æ¥ì¥Ý¡¼¥È¤òÁ˳²¤¹¤ë¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
+#else
+ if (name) return "Anti teleport barrier";
+ if (desc) return "Obstructs all teleportations by monsters in your sight.";
+#endif
+ power = plev * 3 / 2;
+ if (info) return info_power(power);
+ if (cast)
+ {
+#ifdef JP
+ msg_print("¥Æ¥ì¥Ý¡¼¥È¤òËɤ°¼ö¤¤¤ò¤«¤±¤¿¡£");
+#else
+ msg_print("You feel anyone can not teleport except you.");
+#endif
+ }
+ break;
+
+ /*** 3rd book (16-23) ***/
+ case 16:
+#ifdef JP
+ if (name) return "¾×·â¤Î¥¯¥í¡¼¥¯";
+ if (desc) return "Åŵ¤¤Î¥ª¡¼¥é¤ò¿È¤Ë¤Þ¤È¤¤¡¢Æ°¤¤¬Â®¤¯¤Ê¤ë¡£";
+#else
+ if (name) return "Cloak of shock";
+ if (desc) return "Gives lightning aura and a bonus to speed.";
+#endif
+ if (cast)
+ {
+#ifdef JP
+ msg_print("ÂΤ¬°ðºÊ¤Î¥ª¡¼¥é¤Çʤ¤ï¤ì¤¿¡£");
+#else
+ msg_print("You have enveloped by electrical aura!");
+#endif
+ }
+ if (stop)
+ {
+#ifdef JP
+ msg_print("°ðºÊ¤Î¥ª¡¼¥é¤¬¾Ã¤¨µî¤Ã¤¿¡£");
+#else
+ msg_print("Electrical aura disappeared.");
+#endif
+ }
+ break;
+
+ case 17:
+#ifdef JP
+ if (name) return "Ã×Ì¿½ý¤Î¼£Ìþ";
+ if (desc) return "ÂÎÎϤä½ý¤ò²óÉü¤µ¤»¤ë¡£";
+#else
+ if (name) return "Cure critical wounds";
+ if (desc) return "Heals cut and HP greatry.";
+#endif
+ if (info) return info_heal(4, 10, 0);
+ if (cast)
+ {
+#ifdef JP
+ msg_print("µ¤Ê¬¤¬Îɤ¯¤Ê¤Ã¤Æ¤¯¤ë¡£");
+#else
+ msg_print("You feel better and better.");
+#endif
+ }
+ if (cast || cont)
+ {
+ hp_player(damroll(4, 10));
+ set_stun(0);
+ set_cut(0);
+ set_poisoned(0);
+ }
+ break;
+
+ case 18:
+#ifdef JP
+ if (name) return "¼öÎÏÉõÆþ";
+ if (desc) return "ËâË¡¤ÎÆ»¶ñ¤ËËâÎϤòºÆ½¼Å¶¤¹¤ë¡£";
+#else
+ if (name) return "Recharging";
+ if (desc) return "Recharges a magic device.";
+#endif
+ power = plev * 2;
+ if (info) return info_power(power);
+ if (cast)
+ {
+ if (!recharge(power)) return NULL;
+ add = FALSE;
+ }
+ break;
+
+ case 19:
+#ifdef JP
+ if (name) return "»à¼ÔÉü³è";
+ if (desc) return "»àÂΤòÁɤ餻¤Æ¥Ú¥Ã¥È¤Ë¤¹¤ë¡£";
+#else
+ if (name) return "Animate Dead";
+ if (desc) return "Raises corpses and skeletons from dead.";
+#endif
+ if (cast)
+ {
+#ifdef JP
+ msg_print("»à¼Ô¤Ø¤Î¸Æ¤Ó¤«¤±¤ò»Ï¤á¤¿¡£");
+#else
+ msg_print("You start to call deads.!");
+#endif
+ }
+ if (cast || cont)
+ {
+ animate_dead(0, py, px);
+ }
+ break;
+
+ case 20:
+#ifdef JP
+ if (name) return "Ëɶñ¼öÇû";
+ if (desc) return "ÁõÈ÷¤·¤Æ¤¤¤ëËɶñ¤Ë¼ö¤¤¤ò¤«¤±¤ë¡£";
+#else
+ if (name) return "Curse armor";
+ if (desc) return "Curse a piece of armour that you wielding.";
+#endif
+ if (cast)
+ {
+ int item;
+ char *q, *s;
+ char o_name[MAX_NLEN];
+ object_type *o_ptr;
+ u32b f[TR_FLAG_SIZE];
+
+ item_tester_hook = object_is_armour;
+#ifdef JP
+ q = "¤É¤ì¤ò¼ö¤¤¤Þ¤¹¤«¡©";
+ s = "Ëɶñ¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£";
+#else
+ q = "Which piece of armour do you curse?";
+ s = "You wield no piece of armours.";
+#endif
+
+ if (!get_item(&item, q, s, (USE_EQUIP))) return FALSE;
+
+ o_ptr = &inventory[item];
+ object_desc(o_name, o_ptr, OD_NAME_ONLY);
+ object_flags(o_ptr, f);
+
+#ifdef JP
+ if (!get_check(format("ËÜÅö¤Ë %s ¤ò¼ö¤¤¤Þ¤¹¤«¡©", o_name))) return FALSE;
+#else
+ if (!get_check(format("Do you curse %s, really¡©", o_name))) return FALSE;
+#endif
+
+ if (!one_in_(3) &&
+ (object_is_artifact(o_ptr) || have_flag(f, TR_BLESSED)))
+ {
+#ifdef JP
+ msg_format("%s ¤Ï¼ö¤¤¤òÄ·¤ÍÊÖ¤·¤¿¡£", o_name);
+#else
+ msg_format("%s resists the effect.", o_name);
+#endif
+ if (one_in_(3))
+ {
+ if (o_ptr->to_d > 0)
+ {
+ o_ptr->to_d -= randint1(3) % 2;
+ if (o_ptr->to_d < 0) o_ptr->to_d = 0;
+ }
+ if (o_ptr->to_h > 0)
+ {
+ o_ptr->to_h -= randint1(3) % 2;
+ if (o_ptr->to_h < 0) o_ptr->to_h = 0;
+ }
+ if (o_ptr->to_a > 0)
+ {
+ o_ptr->to_a -= randint1(3) % 2;
+ if (o_ptr->to_a < 0) o_ptr->to_a = 0;
+ }
+#ifdef JP
+ msg_format("%s ¤ÏÎô²½¤·¤Æ¤·¤Þ¤Ã¤¿¡£", o_name);
+#else
+ msg_format("Your %s was disenchanted!", o_name);
+#endif
+ }
+ }
+ else
+ {
+ int power = 0;
+#ifdef JP
+ msg_format("¶²ÉݤΰŹõ¥ª¡¼¥é¤¬¤¢¤Ê¤¿¤Î%s¤òÊñ¤ß¹þ¤ó¤À¡ª", o_name);
+#else
+ msg_format("A terrible black aura blasts your %s!", o_name);
+#endif
+ o_ptr->curse_flags |= (TRC_CURSED);
+
+ if (object_is_artifact(o_ptr) || object_is_ego(o_ptr))
+ {
+
+ if (one_in_(3)) o_ptr->curse_flags |= (TRC_HEAVY_CURSE);
+ if (one_in_(666))
+ {
+ o_ptr->curse_flags |= (TRC_TY_CURSE);
+ if (one_in_(666)) o_ptr->curse_flags |= (TRC_PERMA_CURSE);
+
+ add_flag(o_ptr->art_flags, TR_AGGRAVATE);
+ add_flag(o_ptr->art_flags, TR_RES_POIS);
+ add_flag(o_ptr->art_flags, TR_RES_DARK);
+ add_flag(o_ptr->art_flags, TR_RES_NETHER);
+#ifdef JP
+ msg_print("·ì¤À¡ª·ì¤À¡ª·ì¤À¡ª");
+#else
+ msg_print("Blood, Blood, Blood!");
+#endif
+ power = 2;
+ }
+ }
+
+ o_ptr->curse_flags |= get_curse(power, o_ptr);
+ }
+
+ p_ptr->update |= (PU_BONUS);
+ add = FALSE;
+ }
+ break;
+
+ case 21:
+#ifdef JP
+ if (name) return "±Æ¤Î¥¯¥í¡¼¥¯";
+ if (desc) return "±Æ¤Î¥ª¡¼¥é¤ò¿È¤Ë¤Þ¤È¤¤¡¢Å¨¤Ë±Æ¤Î¥À¥á¡¼¥¸¤òÍ¿¤¨¤ë¡£";
+#else
+ if (name) return "Cloak of shadow";
+ if (desc) return "Gives aura of shadow.";
+#endif
+ if (cast)
+ {
+ object_type *o_ptr = &inventory[INVEN_OUTER];
+
+ if (!o_ptr->k_idx)
+ {
+#ifdef JP
+ msg_print("¥¯¥í¡¼¥¯¤ò¿È¤Ë¤Ä¤±¤Æ¤¤¤Ê¤¤¡ª");
+#else
+ msg_print("You don't ware any cloak.");
+#endif
+ return NULL;
+ }
+ else if (!object_is_cursed(o_ptr))
+ {
+#ifdef JP
+ msg_print("¥¯¥í¡¼¥¯¤Ï¼ö¤ï¤ì¤Æ¤¤¤Ê¤¤¡ª");
+#else
+ msg_print("Your cloak is not cursed.");
+#endif
+ return NULL;
+ }
+ else
+ {
+#ifdef JP
+ msg_print("±Æ¤Î¥ª¡¼¥é¤ò¿È¤Ë¤Þ¤È¤Ã¤¿¡£");
+#else
+ msg_print("You have enveloped by shadow aura!");
+#endif
+ }
+ }
+ if (cont)
+ {
+ object_type *o_ptr = &inventory[INVEN_OUTER];
+
+ if (!o_ptr->k_idx) do_spell(REALM_HEX, spell, SPELL_STOP);
+ if (!object_is_cursed(o_ptr)) do_spell(REALM_HEX, spell, SPELL_STOP);
+ }
+ if (stop)
+ {
+#ifdef JP
+ msg_print("±Æ¤Î¥ª¡¼¥é¤¬¾Ã¤¨µî¤Ã¤¿¡£");
+#else
+ msg_print("Shadow aura disappeared.");
+#endif
+ }
+ break;
+
+ case 22:
+#ifdef JP
+ if (name) return "¶ìÄˤòËâÎϤË";
+ if (desc) return "»ë³¦Æâ¤Î¥â¥ó¥¹¥¿¡¼¤ËÀº¿À¥À¥á¡¼¥¸Í¿¤¨¡¢ËâÎϤòµÛ¤¤¼è¤ë¡£";
+#else
+ if (name) return "Pains to mana";
+ if (desc) return "Deals psychic damages to all monsters in sight, and drains some mana.";
+#endif
+ power = plev * 3 / 2;
+ if (info) return info_damage(1, power, 0);
+ if (cast || cont)
+ {
+ project_hack(GF_PSI_DRAIN, randint1(power));
+ }
+ break;
+
+ case 23:
+#ifdef JP
+ if (name) return "ÌܤˤÏÌܤò";
+ if (desc) return "ÂÇ·â¤äËâË¡¤Ç¼õ¤±¤¿¥À¥á¡¼¥¸¤ò¡¢¹¶·â¸µ¤Î¥â¥ó¥¹¥¿¡¼¤Ë¤âÍ¿¤¨¤ë¡£";
+#else
+ if (name) return "Eye for an eye";
+ if (desc) return "Returns same damage which you got to the monster which damaged you.";
+#endif
+ if (cast)
+ {
+#ifdef JP
+ msg_print("Éü½²¤·¤¿¤¤Íß˾¤Ë¤«¤é¤ì¤¿¡£");
+#else
+ msg_print("You wish strongly you want to revenge anything.");
+#endif
+ }
+ break;
+
+ /*** 4th book (24-31) ***/
+ case 24:
+#ifdef JP
+ if (name) return "È¿Áý¿£·ë³¦";
+ if (desc) return "¤½¤Î³¬¤ÎÁý¿£¤¹¤ë¥â¥ó¥¹¥¿¡¼¤ÎÁý¿£¤òÁ˻ߤ¹¤ë¡£";
+#else
+ if (name) return "Anti multiply barrier";
+ if (desc) return "Obstructs all multiplying by monsters in entire floor.";
+#endif
+ if (cast)
+ {
+#ifdef JP
+ msg_print("Áý¿£¤òÁ˻ߤ¹¤ë¼ö¤¤¤ò¤«¤±¤¿¡£");
+#else
+ msg_print("You feel anyone can not already multiply.");
+#endif
+ }
+ break;
+
+ case 25:
+#ifdef JP
+ if (name) return "À¸Ì¿ÎÏÉü³è";
+ if (desc) return "·Ð¸³Ãͤò½ù¡¹¤ËÉü³è¤·¡¢¸º¾¯¤·¤¿Ç½ÎÏÃͤò²óÉü¤µ¤»¤ë¡£";
+#else
+ if (name) return "Restore life";
+ if (desc) return "Restores life energy and status.";
+#endif
+ if (cast)
+ {
+#ifdef JP
+ msg_print("À¸Ì¿ÎϤ¬Ìá¤ê»Ï¤á¤¿¡£");
+#else
+ msg_print("You feel your life energy starting to return.");
+#endif
+ }
+ if (cast || cont)
+ {
+ bool flag = FALSE;
+ int d = (p_ptr->max_exp - p_ptr->exp);
+ int r = (p_ptr->exp / 20);
+ int i;
+
+ if (d > 0)
+ {
+ if (d < r)
+ p_ptr->exp = p_ptr->max_exp;
+ else
+ p_ptr->exp += r;
+
+ /* Check the experience */
+ check_experience();
+
+ flag = TRUE;
+ }
+ for (i = A_STR; i < 6; i ++)
+ {
+ if (p_ptr->stat_cur[i] < p_ptr->stat_max[i])
+ {
+ if (p_ptr->stat_cur[i] < 18)
+ p_ptr->stat_cur[i]++;
+ else
+ p_ptr->stat_cur[i] += 10;
+
+ if (p_ptr->stat_cur[i] > p_ptr->stat_max[i])
+ p_ptr->stat_cur[i] = p_ptr->stat_max[i];
+
+ /* Recalculate bonuses */
+ p_ptr->update |= (PU_BONUS);
+
+ flag = TRUE;
+ }
+ }
+
+ if (!flag)
+ {
+#ifdef JP
+ msg_format("%s¤Î¼öʸ¤Î±Ó¾§¤ò¤ä¤á¤¿¡£", do_spell(REALM_HEX, HEX_RESTORE, SPELL_NAME));
+#else
+ msg_format("Finish casting '%^s'.", do_spell(REALM_HEX, HEX_RESTORE, SPELL_NAME));
+#endif
+ p_ptr->magic_num1[0] &= ~(1L << HEX_RESTORE);
+ if (cont) p_ptr->magic_num2[0]--;
+ if (p_ptr->magic_num2) p_ptr->action = ACTION_NONE;
+
+ /* Redraw status */
+ p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
+ p_ptr->redraw |= (PR_EXTRA);
+
+ return "";
+ }
+ }
+ break;
+
+ case 26:
+#ifdef JP
+ if (name) return "¼öÎϵۼý";
+ if (desc) return "¼ö¤ï¤ì¤¿Éð´ï¤Î¼ö¤¤¤òµÛ¼ý¤·¤ÆËâÎϤò²óÉü¤¹¤ë¡£";
+#else
+ if (name) return "Drain curse power";
+ if (desc) return "Drains curse on your weapon and heals SP a little.";
+#endif
+ if (cast)
+ {
+ int item;
+ char *s, *q;
+ u32b f[TR_FLAG_SIZE];
+ object_type *o_ptr;
+
+ item_tester_hook = item_tester_hook_cursed;
+#ifdef JP
+ q = "¤É¤ÎÁõÈ÷Éʤ«¤éµÛ¼ý¤·¤Þ¤¹¤«¡©";
+ s = "¼ö¤ï¤ì¤¿¥¢¥¤¥Æ¥à¤òÁõÈ÷¤·¤Æ¤¤¤Ê¤¤¡£";
+#else
+ q = "Which cursed equipment do you drain mana from?";
+ s = "You have no cursed equipment.";
+#endif
+
+ if (!get_item(&item, q, s, (USE_EQUIP))) return FALSE;
+
+ o_ptr = &inventory[item];
+ object_flags(o_ptr, f);
+
+ p_ptr->csp += (p_ptr->lev / 5) + randint1(p_ptr->lev / 5);
+ if (have_flag(f, TR_TY_CURSE) || (o_ptr->curse_flags & TRC_TY_CURSE)) p_ptr->csp += randint1(5);
+ if (p_ptr->csp > p_ptr->msp) p_ptr->csp = p_ptr->msp;
+
+ if (o_ptr->curse_flags & TRC_PERMA_CURSE)
+ {
+ /* Nothing */
+ }
+ else if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
+ {
+ if (one_in_(7))
+ {
+#ifdef JP
+ msg_print("¼ö¤¤¤òÁ´¤ÆµÛ¤¤¼è¤Ã¤¿¡£");
+#else
+ msg_print("Heavy curse vanished away.");
+#endif
+ o_ptr->curse_flags = 0L;
+ }
+ }
+ else if ((o_ptr->curse_flags & (TRC_CURSED)) && one_in_(3))
+ {
+#ifdef JP
+ msg_print("¼ö¤¤¤òÁ´¤ÆµÛ¤¤¼è¤Ã¤¿¡£");
+#else
+ msg_print("Curse vanished away.");
+#endif
+ o_ptr->curse_flags = 0L;
+ }
+
+ add = FALSE;
+ }
+ break;
+
+ case 27:
+#ifdef JP
+ if (name) return "µÛ·ì¤Î¿Ï";
+ if (desc) return "µÛ·ì°À¤Ç¹¶·â¤¹¤ë¡£";
+#else
+ if (name) return "Swords to vampires";
+ if (desc) return "Gives vampiric ability to your weapon.";
+#endif
+ if (cast)
+ {
+#ifdef JP
+ msg_print("Éð´ï¤Î³é˾¤¬¾Ã¤¨µî¤Ã¤¿¡£");
+#else
+ msg_format("Thirsty of weapon%s disappeared.", (empty_hands(FALSE)) ? "" : "s");
+#endif
+ }
+ if (stop)
+ {
+#ifdef JP
+ msg_print("¤¢¤Ê¤¿¤ÎÉð´ï¤¬·ì¤òÍߤ·¤Æ¤¤¤ë¡£");
+#else
+ if (!empty_hands(FALSE))
+ msg_print("Your weapons want more blood now.");
+ else
+ msg_print("Your weapon wants more blood now.");
+#endif
+ }
+ break;
+
+ case 28:
+#ifdef JP
+ if (name) return "Û¯Û°¤Î¸ÀÍÕ";
+ if (desc) return "»ë³¦Æâ¤Î¥â¥ó¥¹¥¿¡¼¤òÛ¯Û°¤È¤µ¤»¤ë¡£";
+#else
+ if (name) return "Word of stun";
+ if (desc) return "Stuns all monsters in your sight.";
+#endif
+ power = plev * 4;
+ if (info) return info_power(power);
+ if (cast || cont)
+ {
+ stun_monsters(power);
+ }
+ break;
+
+ case 29:
+#ifdef JP
+ if (name) return "±Æ°ÜÆ°";
+ if (desc) return "¥â¥ó¥¹¥¿¡¼¤ÎÎ٤Υޥ¹¤Ë½Ö´Ö°ÜÆ°¤¹¤ë¡£";
+#else
+ if (name) return "Moving into shadow";
+ if (desc) return "Teleports you close to a monster.";
+#endif
+ if (cast)
+ {
+ int i, y, x, dir;
+ bool flag;
+
+ for (i = 0; i < 3; i++)
+ {
+ if (!tgt_pt(&x, &y)) return FALSE;
+
+ flag = FALSE;
+
+ for (dir = 0; dir < 8; dir++)
+ {
+ int dy = y + ddy_ddd[dir];
+ int dx = x + ddx_ddd[dir];
+ if (dir == 5) continue;
+ if(cave[dy][dx].m_idx) flag = TRUE;
+ }
+
+ if (!cave_empty_bold(y, x) || (cave[y][x].info & CAVE_ICKY) ||
+ (distance(y, x, py, px) > plev + 2))
+ {
+#ifdef JP
+ msg_print("¤½¤³¤Ë¤Ï°ÜÆ°¤Ç¤¤Ê¤¤¡£");
+#else
+ msg_print("Can not teleport to there.");
+#endif
+ continue;
+ }
+ break;
+ }
+
+ if (flag && randint0(plev * plev / 2))
+ {
+ teleport_player_to(y, x, 0L);
+ }
+ else
+ {
+#ifdef JP
+ msg_print("¤ª¤Ã¤È¡ª");
+#else
+ msg_print("Oops!");
+#endif
+ teleport_player(30, 0L);
+ }
+
+ add = FALSE;
+ }
+ break;
+
+ case 30:
+#ifdef JP
+ if (name) return "È¿ËâË¡·ë³¦";
+ if (desc) return "»ë³¦Æâ¤Î¥â¥ó¥¹¥¿¡¼¤ÎËâË¡¤òÁ˳²¤¹¤ë¥Ð¥ê¥¢¤òÄ¥¤ë¡£";
+#else
+ if (name) return "Anti magic barrier";
+ if (desc) return "Obstructs all magic spell of monsters in your sight.";
+#endif
+ power = plev * 3 / 2;
+ if (info) return info_power(power);
+ if (cast)
+ {
+#ifdef JP
+ msg_print("ËâË¡¤òËɤ°¼ö¤¤¤ò¤«¤±¤¿¡£");
+#else
+ msg_print("You feel anyone can not cast spells except you.");
+#endif
+ }
+ break;
+
+ case 31:
+#ifdef JP
+ if (name) return "Éü½²¤ÎÀë¹ð";
+ if (desc) return "¿ô¥¿¡¼¥ó¸å¤Ë¡¢¤½¤ì¤Þ¤Ç¼õ¤±¤¿¥À¥á¡¼¥¸¤Ë±þ¤¸¤¿°ÒÎϤÎËâË¡¤ÎÃƤò¡¢ÂоݤΥâ¥ó¥¹¥¿¡¼¤¬¤½¤Î»þ¤¤¤¿°ÌÃÖ¤ËÊü¤Ä¡£";
+#else
+ if (name) return "Revenge sentence";
+ if (desc) return "Fires magic ball to revenge after few turns.";
+#endif
+ power = p_ptr->magic_num1[2];
+ if (info) return info_damage(0, 0, power);
+ if (cast)
+ {
+ int r;
+ int a = 3 - (p_ptr->pspeed - 100) / 10;
+ r = 1 + randint1(2) + MAX(0, MIN(3, a));
+
+ if (p_ptr->magic_num2[2] > 0)
+ {
+#ifdef JP
+ msg_print("¤¹¤Ç¤ËÉü½²¤ÏÀë¹ðºÑ¤ß¤À¡£");
+#else
+ msg_print("You already pronounced your revenge.");
+#endif
+ return NULL;
+ }
+
+ p_ptr->magic_num2[1] = 2;
+ p_ptr->magic_num2[2] = r;
+#ifdef JP
+ msg_format("¤¢¤Ê¤¿¤ÏÉü½²¤òÀë¹ð¤·¤¿¡£¤¢¤È %d ¥¿¡¼¥ó¡£", r);
+#else
+ msg_format("You pronounce your revenge. %d turns left.", r);
+#endif
+ add = FALSE;
+ }
+ if (cont)
+ {
+ p_ptr->magic_num2[2]--;
+
+ if (p_ptr->magic_num2[2] <= 0)
+ {
+ int dir;
+
+ if (power)
+ {
+ command_dir = 0;
+
+ do
+ {
+#ifdef JP
+ msg_print("Éü½²¤Î»þ¤À¡ª");
+#else
+ msg_print("Time to revenge!");
+#endif
+ }
+ while (!get_aim_dir(&dir));
+
+ fire_ball(GF_HELL_FIRE, dir, power, 1);
+
+ if (p_ptr->wizard)
+ {
+#ifdef JP
+ msg_format("%dÅÀ¤Î¥À¥á¡¼¥¸¤òÊÖ¤·¤¿¡£", power);
+#else
+ msg_format("You return %d damages.", power);
+#endif
+ }
+ }
+ else
+ {
+#ifdef JP
+ msg_print("Éü½²¤¹¤ëµ¤¤¬¼º¤»¤¿¡£");
+#else
+ msg_print("You are not a mood to revenge.");
+#endif
+ }
+ p_ptr->magic_num1[2] = 0;
+ }
+ }
+ break;
+ }
+
+ /* start casting */
+ if ((cast) && (add))
+ {
+ /* add spell */
+ p_ptr->magic_num1[0] |= 1L << (spell);
+ p_ptr->magic_num2[0]++;
+
+ if (p_ptr->action != ACTION_SPELL) set_action(ACTION_SPELL);
+ }
+
+ /* Redraw status */
+ if (!info)
+ {
+ p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
+ p_ptr->redraw |= (PR_EXTRA | PR_HP | PR_MANA);
+ }
+
+ return "";
+}
+
+
/*
* Do everything for each spell
*/
case REALM_CRUSADE: return do_crusade_spell(spell, mode);
case REALM_MUSIC: return do_music_spell(spell, mode);
case REALM_HISSATSU: return do_hissatsu_spell(spell, mode);
+ case REALM_HEX: return do_hex_spell(spell, mode);
}
return NULL;