3 * @brief 呪術の処理実装 / Hex code
6 * 2014 Deskull rearranged comment for Doxygen.\n
9 * 0: Flag bits of spelling spells\n
10 * 1: Flag bits of despelled spells\n
13 * 0: Number of spelling spells\n
14 * 1: Type of revenge\n
15 * 2: Turn count for revenge\n
22 #include "cmd-spell.h"
23 #include "cmd-quaff.h"
24 #include "object-flavor.h"
25 #include "object-hook.h"
26 #include "object-curse.h"
27 #include "spells-status.h"
29 #include "player-status.h"
30 #include "player-effects.h"
31 #include "player-skill.h"
32 #include "player-inventory.h"
33 #include "realm-hex.h"
35 #include "monsterrace.h"
36 #include "targeting.h"
37 #include "realm-song.h"
38 #include "view-mainwindow.h"
41 #define MAX_KEEP 4 /*!<呪術の最大詠唱数 */
44 * @brief プレイヤーが詠唱中の全呪術を停止する
47 bool stop_hex_spell_all(player_type *caster_ptr)
51 for (i = 0; i < 32; i++)
53 if (hex_spelling(i)) exe_spell(caster_ptr, REALM_HEX, i, SPELL_STOP);
56 CASTING_HEX_FLAGS(caster_ptr) = 0;
57 CASTING_HEX_NUM(caster_ptr) = 0;
59 if (caster_ptr->action == ACTION_SPELL) set_action(caster_ptr, ACTION_NONE);
61 caster_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
62 caster_ptr->redraw |= (PR_EXTRA | PR_HP | PR_MANA);
68 * @brief プレイヤーが詠唱中の呪術から一つを選んで停止する
71 bool stop_hex_spell(player_type *caster_ptr)
81 if (!hex_spelling_any(caster_ptr))
83 msg_print(_("呪文を詠唱していません。", "You are casting no spell."));
88 else if ((CASTING_HEX_NUM(caster_ptr) == 1) || (caster_ptr->lev < 35))
90 return stop_hex_spell_all(caster_ptr);
94 strnfmt(out_val, 78, _("どの呪文の詠唱を中断しますか?(呪文 %c-%c, 'l'全て, ESC)", "Which spell do you stop casting? (Spell %c-%c, 'l' to all, ESC)"),
95 I2A(0), I2A(CASTING_HEX_NUM(caster_ptr) - 1));
102 Term_erase(x, y, 255);
103 prt(_(" 名前", " Name"), y, x + 5);
104 for (spell = 0; spell < 32; spell++)
106 if (hex_spelling(spell))
108 Term_erase(x, y + n + 1, 255);
109 put_str(format("%c) %s", I2A(n), exe_spell(caster_ptr, REALM_HEX, spell, SPELL_NAME)), y + n + 1, x + 2);
114 if (!get_com(out_val, &choice, TRUE)) break;
115 if (isupper(choice)) choice = (char)tolower(choice);
117 if (choice == 'l') /* All */
120 return stop_hex_spell_all(caster_ptr);
122 if ((choice < I2A(0)) || (choice > I2A(CASTING_HEX_NUM(caster_ptr) - 1))) continue;
131 int n = sp[A2I(choice)];
133 exe_spell(caster_ptr, REALM_HEX, n, SPELL_STOP);
134 CASTING_HEX_FLAGS(caster_ptr) &= ~(1L << n);
135 CASTING_HEX_NUM(caster_ptr)--;
138 caster_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
139 caster_ptr->redraw |= (PR_EXTRA | PR_HP | PR_MANA);
146 * @brief 一定時間毎に呪術で消費するMPを処理する /
147 * Upkeeping hex spells Called from dungeon.c
150 void check_hex(player_type *caster_ptr)
153 MANA_POINT need_mana;
157 /* Spells spelled by player */
158 if (caster_ptr->realm1 != REALM_HEX) return;
159 if (!CASTING_HEX_FLAGS(caster_ptr) && !caster_ptr->magic_num1[1]) return;
161 if (caster_ptr->magic_num1[1])
163 caster_ptr->magic_num1[0] = caster_ptr->magic_num1[1];
164 caster_ptr->magic_num1[1] = 0;
168 /* Stop all spells when anti-magic ability is given */
169 if (caster_ptr->anti_magic)
171 stop_hex_spell_all(caster_ptr);
176 for (spell = 0; spell < 32; spell++)
178 if (hex_spelling(spell))
180 const magic_type *s_ptr;
181 s_ptr = &technic_info[REALM_HEX - MIN_TECHNIC][spell];
182 need_mana += mod_need_mana(caster_ptr, s_ptr->smana, spell, REALM_HEX);
186 /* Culcurates final mana cost */
188 s64b_div(&need_mana, &need_mana_frac, 0, 3); /* Divide by 3 */
189 need_mana += (CASTING_HEX_NUM(caster_ptr) - 1);
191 /* Not enough mana */
192 if (s64b_cmp(caster_ptr->csp, caster_ptr->csp_frac, need_mana, need_mana_frac) < 0)
194 stop_hex_spell_all(caster_ptr);
201 s64b_sub(&(caster_ptr->csp), &(caster_ptr->csp_frac), need_mana, need_mana_frac);
203 caster_ptr->redraw |= PR_MANA;
206 msg_print(_("詠唱を再開した。", "You restart spelling."));
208 caster_ptr->action = ACTION_SPELL;
210 caster_ptr->update |= (PU_BONUS | PU_HP);
211 caster_ptr->redraw |= (PR_MAP | PR_STATUS | PR_STATE);
212 caster_ptr->update |= (PU_MONSTERS);
213 caster_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
217 /* Gain experiences of spelling spells */
218 for (spell = 0; spell < 32; spell++)
220 const magic_type *s_ptr;
222 if (!hex_spelling(spell)) continue;
224 s_ptr = &technic_info[REALM_HEX - MIN_TECHNIC][spell];
226 if (caster_ptr->spell_exp[spell] < SPELL_EXP_BEGINNER)
227 caster_ptr->spell_exp[spell] += 5;
228 else if(caster_ptr->spell_exp[spell] < SPELL_EXP_SKILLED)
229 { if (one_in_(2) && (caster_ptr->current_floor_ptr->dun_level > 4) && ((caster_ptr->current_floor_ptr->dun_level + 10) > caster_ptr->lev)) caster_ptr->spell_exp[spell] += 1; }
230 else if(caster_ptr->spell_exp[spell] < SPELL_EXP_EXPERT)
231 { if (one_in_(5) && ((caster_ptr->current_floor_ptr->dun_level + 5) > caster_ptr->lev) && ((caster_ptr->current_floor_ptr->dun_level + 5) > s_ptr->slevel)) caster_ptr->spell_exp[spell] += 1; }
232 else if(caster_ptr->spell_exp[spell] < SPELL_EXP_MASTER)
233 { if (one_in_(5) && ((caster_ptr->current_floor_ptr->dun_level + 5) > caster_ptr->lev) && (caster_ptr->current_floor_ptr->dun_level > s_ptr->slevel)) caster_ptr->spell_exp[spell] += 1; }
236 /* Do any effects of continual spells */
237 for (spell = 0; spell < 32; spell++)
239 if (hex_spelling(spell))
241 exe_spell(caster_ptr, REALM_HEX, spell, SPELL_CONT);
247 * @brief プレイヤーの呪術詠唱枠がすでに最大かどうかを返す
248 * @return すでに全枠を利用しているならTRUEを返す
250 bool hex_spell_fully(player_type *caster_ptr)
253 k_max = (caster_ptr->lev / 15) + 1;
254 k_max = MIN(k_max, MAX_KEEP);
255 if (CASTING_HEX_NUM(caster_ptr) < k_max) return FALSE;
260 * @brief 一定ゲームターン毎に復讐処理の残り期間の判定を行う
263 void revenge_spell(player_type *caster_ptr)
265 if (caster_ptr->realm1 != REALM_HEX) return;
266 if (HEX_REVENGE_TURN(caster_ptr) <= 0) return;
268 switch(HEX_REVENGE_TYPE(caster_ptr))
270 case 1: exe_spell(caster_ptr, REALM_HEX, HEX_PATIENCE, SPELL_CONT); break;
271 case 2: exe_spell(caster_ptr, REALM_HEX, HEX_REVENGE, SPELL_CONT); break;
276 * @brief 復讐ダメージの追加を行う
277 * @param dam 蓄積されるダメージ量
280 void revenge_store(player_type *caster_ptr, HIT_POINT dam)
282 if (caster_ptr->realm1 != REALM_HEX) return;
283 if (HEX_REVENGE_TURN(caster_ptr) <= 0) return;
285 HEX_REVENGE_POWER(caster_ptr) += dam;
290 * @param m_idx 判定の対象となるモンスターID
291 * @return 反テレポートの効果が適用されるならTRUEを返す
293 bool teleport_barrier(player_type *caster_ptr, MONSTER_IDX m_idx)
295 monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[m_idx];
296 monster_race *r_ptr = &r_info[m_ptr->r_idx];
298 if (!hex_spelling(HEX_ANTI_TELE)) return FALSE;
299 if ((caster_ptr->lev * 3 / 2) < randint1(r_ptr->level)) return FALSE;
306 * @param m_idx 判定の対象となるモンスターID
307 * @return 反魔法の効果が適用されるならTRUEを返す
309 bool magic_barrier(player_type *target_ptr, MONSTER_IDX m_idx)
311 monster_type *m_ptr = &target_ptr->current_floor_ptr->m_list[m_idx];
312 monster_race *r_ptr = &r_info[m_ptr->r_idx];
314 if (!hex_spelling(HEX_ANTI_MAGIC)) return FALSE;
315 if ((target_ptr->lev * 3 / 2) < randint1(r_ptr->level)) return FALSE;
322 * @param m_idx 判定の対象となるモンスターID
323 * @return 反増殖の効果が適用されるならTRUEを返す
325 bool multiply_barrier(player_type *caster_ptr, MONSTER_IDX m_idx)
327 monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[m_idx];
328 monster_race *r_ptr = &r_info[m_ptr->r_idx];
330 if (!hex_spelling(HEX_ANTI_MULTI)) return FALSE;
331 if ((caster_ptr->lev * 3 / 2) < randint1(r_ptr->level)) return FALSE;
337 * @brief 呪術領域魔法の各処理を行う
339 * @param mode 処理内容 (SPELL_NAME / SPELL_DESC / SPELL_INFO / SPELL_CAST / SPELL_CONT / SPELL_STOP)
340 * @return SPELL_NAME / SPELL_DESC / SPELL_INFO 時には文字列ポインタを返す。SPELL_CAST / SPELL_CONT / SPELL_STOP 時はNULL文字列を返す。
342 concptr do_hex_spell(player_type *caster_ptr, SPELL_IDX spell, BIT_FLAGS mode)
344 bool name = (mode == SPELL_NAME) ? TRUE : FALSE;
345 bool desc = (mode == SPELL_DESC) ? TRUE : FALSE;
346 bool info = (mode == SPELL_INFO) ? TRUE : FALSE;
347 bool cast = (mode == SPELL_CAST) ? TRUE : FALSE;
348 bool cont = (mode == SPELL_CONT) ? TRUE : FALSE;
349 bool stop = (mode == SPELL_STOP) ? TRUE : FALSE;
353 PLAYER_LEVEL plev = caster_ptr->lev;
358 /*** 1st book (0-7) ***/
360 if (name) return _("邪なる祝福", "Evily blessing");
361 if (desc) return _("祝福により攻撃精度と防御力が上がる。", "Attempts to increase +to_hit of a weapon and AC");
364 if (!caster_ptr->blessed)
366 msg_print(_("高潔な気分になった!", "You feel righteous!"));
371 if (!caster_ptr->blessed)
373 msg_print(_("高潔な気分が消え失せた。", "The prayer has expired."));
379 if (name) return _("軽傷の治癒", "Cure light wounds");
380 if (desc) return _("HPや傷を少し回復させる。", "Heals cut and HP a little.");
381 if (info) return info_heal(1, 10, 0);
384 msg_print(_("気分が良くなってくる。", "You feel better and better."));
386 if (cast || cont) (void)cure_light_wounds(caster_ptr, 1, 10);
390 if (name) return _("悪魔のオーラ", "Demonic aura");
391 if (desc) return _("炎のオーラを身にまとい、回復速度が速くなる。", "Gives fire aura and regeneration.");
394 msg_print(_("体が炎のオーラで覆われた。", "You have enveloped by fiery aura!"));
398 msg_print(_("炎のオーラが消え去った。", "Fiery aura disappeared."));
403 if (name) return _("悪臭霧", "Stinking mist");
404 if (desc) return _("視界内のモンスターに微弱量の毒のダメージを与える。", "Deals few damages of poison to all monsters in your sight.");
405 power = plev / 2 + 5;
406 if (info) return info_damage(1, power, 0);
409 project_all_los(caster_ptr, GF_POIS, randint1(power));
414 if (name) return _("腕力強化", "Extra might");
415 if (desc) return _("術者の腕力を上昇させる。", "Attempts to increase your strength.");
418 msg_print(_("何だか力が湧いて来る。", "You feel you get stronger."));
423 if (name) return _("武器呪縛", "Curse weapon");
424 if (desc) return _("装備している武器を呪う。", "Curses your weapon.");
429 GAME_TEXT o_name[MAX_NLEN];
431 u32b f[TR_FLAG_SIZE];
433 item_tester_hook = item_tester_hook_weapon_except_bow;
434 q = _("どれを呪いますか?", "Which weapon do you curse?");
435 s = _("武器を装備していない。", "You wield no weapons.");
437 o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP), 0);
438 if (!o_ptr) return FALSE;
440 object_desc(o_name, o_ptr, OD_NAME_ONLY);
441 object_flags(o_ptr, f);
443 if (!get_check(format(_("本当に %s を呪いますか?", "Do you curse %s, really?"), o_name))) return FALSE;
446 (object_is_artifact(o_ptr) || have_flag(f, TR_BLESSED)))
448 msg_format(_("%s は呪いを跳ね返した。", "%s resists the effect."), o_name);
453 o_ptr->to_d -= randint1(3) % 2;
454 if (o_ptr->to_d < 0) o_ptr->to_d = 0;
458 o_ptr->to_h -= randint1(3) % 2;
459 if (o_ptr->to_h < 0) o_ptr->to_h = 0;
463 o_ptr->to_a -= randint1(3) % 2;
464 if (o_ptr->to_a < 0) o_ptr->to_a = 0;
466 msg_format(_("%s は劣化してしまった。", "Your %s was disenchanted!"), o_name);
472 msg_format(_("恐怖の暗黒オーラがあなたの%sを包み込んだ!", "A terrible black aura blasts your %s!"), o_name);
473 o_ptr->curse_flags |= (TRC_CURSED);
475 if (object_is_artifact(o_ptr) || object_is_ego(o_ptr))
478 if (one_in_(3)) o_ptr->curse_flags |= (TRC_HEAVY_CURSE);
481 o_ptr->curse_flags |= (TRC_TY_CURSE);
482 if (one_in_(666)) o_ptr->curse_flags |= (TRC_PERMA_CURSE);
484 add_flag(o_ptr->art_flags, TR_AGGRAVATE);
485 add_flag(o_ptr->art_flags, TR_VORPAL);
486 add_flag(o_ptr->art_flags, TR_VAMPIRIC);
487 msg_print(_("血だ!血だ!血だ!", "Blood, Blood, Blood!"));
492 o_ptr->curse_flags |= get_curse(curse_rank, o_ptr);
495 caster_ptr->update |= (PU_BONUS);
501 if (name) return _("邪悪感知", "Evil detection");
502 if (desc) return _("周囲の邪悪なモンスターを感知する。", "Detects evil monsters.");
503 if (info) return info_range(MAX_SIGHT);
506 msg_print(_("邪悪な生物の存在を感じ取ろうとした。", "You attend to the presence of evil creatures."));
511 if (name) return _("我慢", "Patience");
512 if (desc) return _("数ターン攻撃を耐えた後、受けたダメージを地獄の業火として周囲に放出する。",
513 "Bursts hell fire strongly after patients any damage while few turns.");
514 power = MIN(200, (HEX_REVENGE_POWER(caster_ptr) * 2));
515 if (info) return info_damage(0, 0, power);
518 int a = 3 - (caster_ptr->pspeed - 100) / 10;
519 MAGIC_NUM2 r = 3 + randint1(3) + MAX(0, MIN(3, a));
521 if (HEX_REVENGE_TURN(caster_ptr) > 0)
523 msg_print(_("すでに我慢をしている。", "You are already patienting."));
527 HEX_REVENGE_TYPE(caster_ptr) = 1;
528 HEX_REVENGE_TURN(caster_ptr) = r;
529 HEX_REVENGE_POWER(caster_ptr) = 0;
530 msg_print(_("じっと耐えることにした。", "You decide to patient all damages."));
535 POSITION rad = 2 + (power / 50);
537 HEX_REVENGE_TURN(caster_ptr)--;
539 if ((HEX_REVENGE_TURN(caster_ptr) <= 0) || (power >= 200))
541 msg_print(_("我慢が解かれた!", "Time for end of patioence!"));
544 project(caster_ptr, 0, rad, caster_ptr->y, caster_ptr->x, power, GF_HELL_FIRE,
545 (PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
547 if (current_world_ptr->wizard)
549 msg_format(_("%d点のダメージを返した。", "You return %d damages."), power);
553 HEX_REVENGE_TYPE(caster_ptr) = 0;
554 HEX_REVENGE_TURN(caster_ptr) = 0;
555 HEX_REVENGE_POWER(caster_ptr) = 0;
560 /*** 2nd book (8-15) ***/
562 if (name) return _("氷の鎧", "Ice armor");
563 if (desc) return _("氷のオーラを身にまとい、防御力が上昇する。", "Gives fire aura and bonus to AC.");
566 msg_print(_("体が氷の鎧で覆われた。", "You have enveloped by ice armor!"));
570 msg_print(_("氷の鎧が消え去った。", "Ice armor disappeared."));
575 if (name) return _("重傷の治癒", "Cure serious wounds");
576 if (desc) return _("体力や傷を多少回復させる。", "Heals cut and HP more.");
577 if (info) return info_heal(2, 10, 0);
580 msg_print(_("気分が良くなってくる。", "You feel better and better."));
582 if (cast || cont) (void)cure_serious_wounds(caster_ptr, 2, 10);
586 if (name) return _("薬品吸入", "Inhail potion");
587 if (desc) return _("呪文詠唱を中止することなく、薬の効果を得ることができる。", "Quaffs a potion without canceling of casting a spell.");
590 CASTING_HEX_FLAGS(caster_ptr) |= (1L << HEX_INHAIL);
591 do_cmd_quaff_potion(caster_ptr);
592 CASTING_HEX_FLAGS(caster_ptr) &= ~(1L << HEX_INHAIL);
598 if (name) return _("衰弱の霧", "Hypodynamic mist");
599 if (desc) return _("視界内のモンスターに微弱量の衰弱属性のダメージを与える。",
600 "Deals few damages of hypodynamia to all monsters in your sight.");
601 power = (plev / 2) + 5;
602 if (info) return info_damage(1, power, 0);
605 project_all_los(caster_ptr, GF_HYPODYNAMIA, randint1(power));
610 if (name) return _("魔剣化", "Swords to runeswords");
611 if (desc) return _("武器の攻撃力を上げる。切れ味を得、呪いに応じて与えるダメージが上昇し、善良なモンスターに対するダメージが2倍になる。",
612 "Gives vorpal ability to your weapon. Increases damages by your weapon acccording to curse of your weapon.");
616 msg_print("あなたの武器が黒く輝いた。");
618 if (!empty_hands(caster_ptr, FALSE))
619 msg_print("Your weapons glow bright black.");
621 msg_print("Your weapon glows bright black.");
627 msg_print("武器の輝きが消え去った。");
629 msg_format("Brightness of weapon%s disappeared.", (empty_hands(caster_ptr, FALSE)) ? "" : "s");
635 if (name) return _("混乱の手", "Touch of confusion");
636 if (desc) return _("攻撃した際モンスターを混乱させる。", "Confuses a monster when you attack.");
639 msg_print(_("あなたの手が赤く輝き始めた。", "Your hands glow bright red."));
643 msg_print(_("手の輝きがなくなった。", "Brightness on your hands disappeard."));
648 if (name) return _("肉体強化", "Building up");
649 if (desc) return _("術者の腕力、器用さ、耐久力を上昇させる。攻撃回数の上限を 1 増加させる。",
650 "Attempts to increases your strength, dexterity and constitusion.");
653 msg_print(_("身体が強くなった気がした。", "You feel your body is developed more now."));
658 if (name) return _("反テレポート結界", "Anti teleport barrier");
659 if (desc) return _("視界内のモンスターのテレポートを阻害するバリアを張る。", "Obstructs all teleportations by monsters in your sight.");
660 power = plev * 3 / 2;
661 if (info) return info_power(power);
664 msg_print(_("テレポートを防ぐ呪いをかけた。", "You feel anyone can not teleport except you."));
668 /*** 3rd book (16-23) ***/
670 if (name) return _("衝撃のクローク", "Cloak of shock");
671 if (desc) return _("電気のオーラを身にまとい、動きが速くなる。", "Gives lightning aura and a bonus to speed.");
674 msg_print(_("体が稲妻のオーラで覆われた。", "You have enveloped by electrical aura!"));
678 msg_print(_("稲妻のオーラが消え去った。", "Electrical aura disappeared."));
683 if (name) return _("致命傷の治癒", "Cure critical wounds");
684 if (desc) return _("体力や傷を回復させる。", "Heals cut and HP greatry.");
685 if (info) return info_heal(4, 10, 0);
688 msg_print(_("気分が良くなってくる。", "You feel better and better."));
690 if (cast || cont) (void)cure_critical_wounds(caster_ptr, damroll(4, 10));
694 if (name) return _("呪力封入", "Recharging");
695 if (desc) return _("魔法の道具に魔力を再充填する。", "Recharges a magic device.");
697 if (info) return info_power(power);
700 if (!recharge(caster_ptr, power)) return NULL;
706 if (name) return _("死者復活", "Animate Dead");
707 if (desc) return _("死体を蘇らせてペットにする。", "Raises corpses and skeletons from dead.");
710 msg_print(_("死者への呼びかけを始めた。", "You start to call deads.!"));
714 animate_dead(caster_ptr, 0, caster_ptr->y, caster_ptr->x);
719 if (name) return _("防具呪縛", "Curse armor");
720 if (desc) return _("装備している防具に呪いをかける。", "Curse a piece of armour that you wielding.");
725 GAME_TEXT o_name[MAX_NLEN];
727 u32b f[TR_FLAG_SIZE];
729 item_tester_hook = object_is_armour;
730 q = _("どれを呪いますか?", "Which piece of armour do you curse?");
731 s = _("防具を装備していない。", "You wield no piece of armours.");
733 o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP), 0);
734 if (!o_ptr) return FALSE;
736 o_ptr = &caster_ptr->inventory_list[item];
737 object_desc(o_name, o_ptr, OD_NAME_ONLY);
738 object_flags(o_ptr, f);
740 if (!get_check(format(_("本当に %s を呪いますか?", "Do you curse %s, really?"), o_name))) return FALSE;
743 (object_is_artifact(o_ptr) || have_flag(f, TR_BLESSED)))
745 msg_format(_("%s は呪いを跳ね返した。", "%s resists the effect."), o_name);
750 o_ptr->to_d -= randint1(3) % 2;
751 if (o_ptr->to_d < 0) o_ptr->to_d = 0;
755 o_ptr->to_h -= randint1(3) % 2;
756 if (o_ptr->to_h < 0) o_ptr->to_h = 0;
760 o_ptr->to_a -= randint1(3) % 2;
761 if (o_ptr->to_a < 0) o_ptr->to_a = 0;
763 msg_format(_("%s は劣化してしまった。", "Your %s was disenchanted!"), o_name);
769 msg_format(_("恐怖の暗黒オーラがあなたの%sを包み込んだ!", "A terrible black aura blasts your %s!"), o_name);
770 o_ptr->curse_flags |= (TRC_CURSED);
772 if (object_is_artifact(o_ptr) || object_is_ego(o_ptr))
775 if (one_in_(3)) o_ptr->curse_flags |= (TRC_HEAVY_CURSE);
778 o_ptr->curse_flags |= (TRC_TY_CURSE);
779 if (one_in_(666)) o_ptr->curse_flags |= (TRC_PERMA_CURSE);
781 add_flag(o_ptr->art_flags, TR_AGGRAVATE);
782 add_flag(o_ptr->art_flags, TR_RES_POIS);
783 add_flag(o_ptr->art_flags, TR_RES_DARK);
784 add_flag(o_ptr->art_flags, TR_RES_NETHER);
785 msg_print(_("血だ!血だ!血だ!", "Blood, Blood, Blood!"));
790 o_ptr->curse_flags |= get_curse(curse_rank, o_ptr);
793 caster_ptr->update |= (PU_BONUS);
799 if (name) return _("影のクローク", "Cloak of shadow");
800 if (desc) return _("影のオーラを身にまとい、敵に影のダメージを与える。", "Gives aura of shadow.");
803 object_type *o_ptr = &caster_ptr->inventory_list[INVEN_OUTER];
807 msg_print(_("クロークを身につけていない!", "You don't ware any cloak."));
810 else if (!object_is_cursed(o_ptr))
812 msg_print(_("クロークは呪われていない!", "Your cloak is not cursed."));
817 msg_print(_("影のオーラを身にまとった。", "You have enveloped by shadow aura!"));
822 object_type *o_ptr = &caster_ptr->inventory_list[INVEN_OUTER];
824 if ((!o_ptr->k_idx) || (!object_is_cursed(o_ptr)))
826 exe_spell(caster_ptr, REALM_HEX, spell, SPELL_STOP);
827 CASTING_HEX_FLAGS(caster_ptr) &= ~(1L << spell);
828 CASTING_HEX_NUM(caster_ptr)--;
829 if (!SINGING_SONG_ID(caster_ptr)) set_action(caster_ptr, ACTION_NONE);
834 msg_print(_("影のオーラが消え去った。", "Shadow aura disappeared."));
839 if (name) return _("苦痛を魔力に", "Pains to mana");
840 if (desc) return _("視界内のモンスターに精神ダメージ与え、魔力を吸い取る。", "Deals psychic damages to all monsters in sight, and drains some mana.");
841 power = plev * 3 / 2;
842 if (info) return info_damage(1, power, 0);
845 project_all_los(caster_ptr, GF_PSI_DRAIN, randint1(power));
850 if (name) return _("目には目を", "Eye for an eye");
851 if (desc) return _("打撃や魔法で受けたダメージを、攻撃元のモンスターにも与える。", "Returns same damage which you got to the monster which damaged you.");
854 msg_print(_("復讐したい欲望にかられた。", "You wish strongly you want to revenge anything."));
858 /*** 4th book (24-31) ***/
860 if (name) return _("反増殖結界", "Anti multiply barrier");
861 if (desc) return _("その階の増殖するモンスターの増殖を阻止する。", "Obstructs all multiplying by monsters in entire floor.");
864 msg_print(_("増殖を阻止する呪いをかけた。", "You feel anyone can not already multiply."));
869 if (name) return _("全復活", "Restoration");
870 if (desc) return _("経験値を徐々に復活し、減少した能力値を回復させる。", "Restores experience and status.");
873 msg_print(_("体が元の活力を取り戻し始めた。", "You feel your lost status starting to return."));
878 int d = (caster_ptr->max_exp - caster_ptr->exp);
879 int r = (caster_ptr->exp / 20);
885 caster_ptr->exp = caster_ptr->max_exp;
887 caster_ptr->exp += r;
889 /* Check the experience */
890 check_experience(caster_ptr);
894 for (i = A_STR; i < A_MAX; i++)
896 if (caster_ptr->stat_cur[i] < caster_ptr->stat_max[i])
898 if (caster_ptr->stat_cur[i] < 18)
899 caster_ptr->stat_cur[i]++;
901 caster_ptr->stat_cur[i] += 10;
903 if (caster_ptr->stat_cur[i] > caster_ptr->stat_max[i])
904 caster_ptr->stat_cur[i] = caster_ptr->stat_max[i];
905 caster_ptr->update |= (PU_BONUS);
913 msg_format(_("%sの呪文の詠唱をやめた。", "Finish casting '%^s'."), exe_spell(caster_ptr, REALM_HEX, HEX_RESTORE, SPELL_NAME));
914 CASTING_HEX_FLAGS(caster_ptr) &= ~(1L << HEX_RESTORE);
915 if (cont) CASTING_HEX_NUM(caster_ptr)--;
916 if (CASTING_HEX_NUM(caster_ptr)) caster_ptr->action = ACTION_NONE;
918 caster_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
919 caster_ptr->redraw |= (PR_EXTRA);
927 if (name) return _("呪力吸収", "Drain curse power");
928 if (desc) return _("呪われた武器の呪いを吸収して魔力を回復する。", "Drains curse on your weapon and heals SP a little.");
933 u32b f[TR_FLAG_SIZE];
936 item_tester_hook = item_tester_hook_cursed;
937 q = _("どの装備品から吸収しますか?", "Which cursed equipment do you drain mana from?");
938 s = _("呪われたアイテムを装備していない。", "You have no cursed equipment.");
940 o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP), 0);
941 if (!o_ptr) return FALSE;
943 object_flags(o_ptr, f);
945 caster_ptr->csp += (caster_ptr->lev / 5) + randint1(caster_ptr->lev / 5);
946 if (have_flag(f, TR_TY_CURSE) || (o_ptr->curse_flags & TRC_TY_CURSE)) caster_ptr->csp += randint1(5);
947 if (caster_ptr->csp > caster_ptr->msp) caster_ptr->csp = caster_ptr->msp;
949 if (o_ptr->curse_flags & TRC_PERMA_CURSE)
953 else if (o_ptr->curse_flags & TRC_HEAVY_CURSE)
957 msg_print(_("呪いを全て吸い取った。", "Heavy curse vanished away."));
958 o_ptr->curse_flags = 0L;
961 else if ((o_ptr->curse_flags & (TRC_CURSED)) && one_in_(3))
963 msg_print(_("呪いを全て吸い取った。", "Curse vanished away."));
964 o_ptr->curse_flags = 0L;
972 if (name) return _("吸血の刃", "Swords to vampires");
973 if (desc) return _("吸血属性で攻撃する。", "Gives vampiric ability to your weapon.");
977 msg_print("あなたの武器が血を欲している。");
979 if (!empty_hands(caster_ptr, FALSE))
980 msg_print("Your weapons want more blood now.");
982 msg_print("Your weapon wants more blood now.");
988 msg_print("武器の渇望が消え去った。");
990 msg_format("Thirsty of weapon%s disappeared.", (empty_hands(caster_ptr, FALSE)) ? "" : "s");
996 if (name) return _("朦朧の言葉", "Word of stun");
997 if (desc) return _("視界内のモンスターを朦朧とさせる。", "Stuns all monsters in your sight.");
999 if (info) return info_power(power);
1002 stun_monsters(caster_ptr, power);
1007 if (name) return _("影移動", "Moving into shadow");
1008 if (desc) return _("モンスターの隣のマスに瞬間移動する。", "Teleports you close to a monster.");
1015 for (i = 0; i < 3; i++)
1017 if (!tgt_pt(caster_ptr, &x, &y)) return FALSE;
1021 for (dir = 0; dir < 8; dir++)
1023 int dy = y + ddy_ddd[dir];
1024 int dx = x + ddx_ddd[dir];
1025 if (dir == 5) continue;
1026 if (caster_ptr->current_floor_ptr->grid_array[dy][dx].m_idx) flag = TRUE;
1029 if (!cave_empty_bold(caster_ptr->current_floor_ptr, y, x) || (caster_ptr->current_floor_ptr->grid_array[y][x].info & CAVE_ICKY) ||
1030 (distance(y, x, caster_ptr->y, caster_ptr->x) > plev + 2))
1032 msg_print(_("そこには移動できない。", "Can not teleport to there."));
1038 if (flag && randint0(plev * plev / 2))
1040 teleport_player_to(caster_ptr, y, x, 0L);
1044 msg_print(_("おっと!", "Oops!"));
1045 teleport_player(caster_ptr, 30, 0L);
1053 if (name) return _("反魔法結界", "Anti magic barrier");
1054 if (desc) return _("視界内のモンスターの魔法を阻害するバリアを張る。", "Obstructs all magic spell of monsters in your sight.");
1055 power = plev * 3 / 2;
1056 if (info) return info_power(power);
1059 msg_print(_("魔法を防ぐ呪いをかけた。", "You feel anyone can not cast spells except you."));
1064 if (name) return _("復讐の宣告", "Revenge sentence");
1065 if (desc) return _("数ターン後にそれまで受けたダメージに応じた威力の地獄の劫火の弾を放つ。",
1066 "Fires a ball of hell fire to try revenging after few turns.");
1067 power = HEX_REVENGE_POWER(caster_ptr);
1068 if (info) return info_damage(0, 0, power);
1072 int a = 3 - (caster_ptr->pspeed - 100) / 10;
1073 r = 1 + randint1(2) + MAX(0, MIN(3, a));
1075 if (HEX_REVENGE_TURN(caster_ptr) > 0)
1077 msg_print(_("すでに復讐は宣告済みだ。", "You already pronounced your revenge."));
1081 HEX_REVENGE_TYPE(caster_ptr) = 2;
1082 HEX_REVENGE_TURN(caster_ptr) = r;
1083 msg_format(_("あなたは復讐を宣告した。あと %d ターン。", "You pronounce your revenge. %d turns left."), r);
1088 HEX_REVENGE_TURN(caster_ptr)--;
1090 if (HEX_REVENGE_TURN(caster_ptr) <= 0)
1100 msg_print(_("復讐の時だ!", "Time to revenge!"));
1101 } while (!get_aim_dir(&dir));
1103 fire_ball(caster_ptr, GF_HELL_FIRE, dir, power, 1);
1105 if (current_world_ptr->wizard)
1107 msg_format(_("%d点のダメージを返した。", "You return %d damages."), power);
1112 msg_print(_("復讐する気が失せた。", "You are not a mood to revenge."));
1114 HEX_REVENGE_POWER(caster_ptr) = 0;
1121 if ((cast) && (add))
1124 CASTING_HEX_FLAGS(caster_ptr) |= 1L << (spell);
1125 CASTING_HEX_NUM(caster_ptr)++;
1127 if (caster_ptr->action != ACTION_SPELL) set_action(caster_ptr, ACTION_SPELL);
1132 caster_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
1133 caster_ptr->redraw |= (PR_EXTRA | PR_HP | PR_MANA);