3 * @brief 魔法効果の実装/ Spell code (part 2)
7 * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
8 * This software may be copied and distributed for educational, research,
9 * and not for profit purposes provided that this copyright and statement
10 * are included in all such copies. Other copyrights may also apply.
14 #include "spell/spells2.h"
15 #include "autopick/autopick.h"
16 #include "cmd-action/cmd-attack.h"
17 #include "cmd-action/cmd-pet.h"
18 #include "cmd-io/cmd-dump.h"
19 #include "combat/combat-options-type.h"
20 #include "core/stuff-handler.h"
21 #include "dungeon/dungeon.h"
22 #include "dungeon/quest.h"
23 #include "effect/effect-characteristics.h"
24 #include "effect/spells-effect-util.h"
25 #include "floor/floor-events.h"
26 #include "floor/floor-object.h"
27 #include "grid/feature.h"
28 #include "grid/grid.h"
29 #include "inventory/player-inventory.h"
30 #include "io/targeting.h"
31 #include "io/write-diary.h"
32 #include "locale/english.h"
33 #include "main/sound-definitions-table.h"
34 #include "monster/creature.h"
35 #include "monster/monster-race.h"
36 #include "monster/monster-status.h"
37 #include "mutation/mutation.h"
38 #include "object-enchant/item-feeling.h"
39 #include "object/item-use-flags.h"
40 #include "perception/object-perception.h"
41 #include "object/object-flavor.h"
42 #include "object/object-generator.h"
43 #include "object/object-kind-hook.h"
44 #include "object/object-mark-types.h"
45 #include "object-enchant/special-object-flags.h"
46 #include "pet/pet-fall-off.h"
47 #include "pet/pet-util.h"
48 #include "perception/simple-perception.h"
49 #include "player/avatar.h"
50 #include "player/player-class.h"
51 #include "player/player-damage.h"
52 #include "player/player-effects.h"
53 #include "player/player-skill.h"
54 #include "player/player-status.h"
55 #include "spell/process-effect.h"
56 #include "spell/spells-diceroll.h"
57 #include "spell/spells-floor.h"
58 #include "spell/spells-genocide.h"
59 #include "spell/spells-launcher.h"
60 #include "spell/spells-lite.h"
61 #include "spell/spells-sight.h"
62 #include "spell/spells-status.h"
63 #include "spell/spells-summon.h"
64 #include "spell/spells-teleport.h"
65 #include "spell/spells-type.h"
66 #include "spell/range-calc.h"
67 #include "spell/spells3.h"
68 #include "sv-definition/sv-food-types.h"
69 #include "system/system-variables.h"
70 #include "util/util.h"
71 #include "view/display-main-window.h"
72 #include "world/world.h"
75 * todo ここにこれがあるのは少し違和感、spells-staffonlyとかに分離したい
77 * @param creature_ptr プレーヤーへの参照ポインタ
78 * @magic 魔法の効果である場合TRUE (杖と同じ効果の呪文はあったか? 要調査)
79 * @powerful 効果が増強される時TRUE (TRUEになるタイミングはあるか? 要調査)
81 bool cleansing_nova(player_type *creature_ptr, bool magic, bool powerful)
84 if (dispel_evil(creature_ptr, powerful ? 225 : 150)) ident = TRUE;
85 int k = 3 * creature_ptr->lev;
86 if (set_protevil(creature_ptr, (magic ? 0 : creature_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
87 if (set_poisoned(creature_ptr, 0)) ident = TRUE;
88 if (set_afraid(creature_ptr, 0)) ident = TRUE;
89 if (hp_player(creature_ptr, 50)) ident = TRUE;
90 if (set_stun(creature_ptr, 0)) ident = TRUE;
91 if (set_cut(creature_ptr, 0)) ident = TRUE;
97 * todo ここにこれがあるのは少し違和感、spells-staffonlyとかに分離したい
99 * @param creature_ptr プレーヤーへの参照ポインタ
100 * @powerful 効果が増強される時TRUE (TRUEになるタイミングはあるか? 要調査)
102 bool unleash_mana_storm(player_type *creature_ptr, bool powerful)
104 msg_print(_("強力な魔力が敵を引き裂いた!", "Mighty magics rend your enemies!"));
105 project(creature_ptr, 0, (powerful ? 7 : 5), creature_ptr->y, creature_ptr->x,
106 (randint1(200) + (powerful ? 500 : 300)) * 2, GF_MANA, PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID, -1);
108 bool is_special_class = creature_ptr->pclass != CLASS_MAGE;
109 is_special_class &= creature_ptr->pclass != CLASS_HIGH_MAGE;
110 is_special_class &= creature_ptr->pclass != CLASS_SORCERER;
111 is_special_class &= creature_ptr->pclass != CLASS_MAGIC_EATER;
112 is_special_class &= creature_ptr->pclass != CLASS_BLUE_MAGE;
113 if (is_special_class)
115 (void)take_hit(creature_ptr, DAMAGE_NOESCAPE, 50, _("コントロールし難い強力な魔力の解放", "unleashing magics too mighty to control"), -1);
123 * @brief 周辺モンスターを調査する / Probe nearby monsters
124 * @return 効力があった場合TRUEを返す
126 bool probing(player_type *caster_ptr)
128 bool cu = Term->scr->cu;
129 bool cv = Term->scr->cv;
137 for (int i = 1; i < caster_ptr->current_floor_ptr->m_max; i++)
139 monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i];
140 monster_race *r_ptr = &r_info[m_ptr->r_idx];
141 if (!monster_is_valid(m_ptr)) continue;
142 if (!player_has_los_bold(caster_ptr, m_ptr->fy, m_ptr->fx)) continue;
143 if (!m_ptr->ml) continue;
145 GAME_TEXT m_name[MAX_NLEN];
146 if (!probe) msg_print(_("調査中...", "Probing..."));
149 if (!is_original_ap(m_ptr))
151 if (m_ptr->mflag2 & MFLAG2_KAGE)
152 m_ptr->mflag2 &= ~(MFLAG2_KAGE);
154 m_ptr->ap_r_idx = m_ptr->r_idx;
155 lite_spot(caster_ptr, m_ptr->fy, m_ptr->fx);
158 monster_desc(caster_ptr, m_name, m_ptr, MD_IGNORE_HALLU | MD_INDEF_HIDDEN);
159 speed = m_ptr->mspeed - 110;
160 if (MON_FAST(m_ptr)) speed += 10;
161 if (MON_SLOW(m_ptr)) speed -= 10;
162 if (ironman_nightmare) speed += 5;
164 if ((r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) == (RF3_EVIL | RF3_GOOD)) align = _("善悪", "good&evil");
165 else if (r_ptr->flags3 & RF3_EVIL) align = _("邪悪", "evil");
166 else if (r_ptr->flags3 & RF3_GOOD) align = _("善良", "good");
167 else if ((m_ptr->sub_align & (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) == (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) align = _("中立(善悪)", "neutral(good&evil)");
168 else if (m_ptr->sub_align & SUB_ALIGN_EVIL) align = _("中立(邪悪)", "neutral(evil)");
169 else if (m_ptr->sub_align & SUB_ALIGN_GOOD) align = _("中立(善良)", "neutral(good)");
170 else align = _("中立", "neutral");
172 sprintf(buf, _("%s ... 属性:%s HP:%d/%d AC:%d 速度:%s%d 経験:", "%s ... align:%s HP:%d/%d AC:%d speed:%s%d exp:"),
173 m_name, align, (int)m_ptr->hp, (int)m_ptr->maxhp, r_ptr->ac, (speed > 0) ? "+" : "", speed);
175 if (r_ptr->next_r_idx)
177 strcat(buf, format("%d/%d ", m_ptr->exp, r_ptr->next_exp));
184 if (MON_CSLEEP(m_ptr)) strcat(buf, _("睡眠 ", "sleeping "));
185 if (MON_STUNNED(m_ptr)) strcat(buf, _("朦朧 ", "stunned "));
186 if (MON_MONFEAR(m_ptr)) strcat(buf, _("恐怖 ", "scared "));
187 if (MON_CONFUSED(m_ptr)) strcat(buf, _("混乱 ", "confused "));
188 if (MON_INVULNER(m_ptr)) strcat(buf, _("無敵 ", "invulnerable "));
189 buf[strlen(buf) - 1] = '\0';
193 caster_ptr->window |= (PW_MESSAGE);
194 handle_stuff(caster_ptr);
195 move_cursor_relative(m_ptr->fy, m_ptr->fx);
197 Term_erase(0, 0, 255);
198 if (lore_do_probe(caster_ptr, m_ptr->r_idx))
200 strcpy(buf, (r_name + r_ptr->name));
202 msg_format("%sについてさらに詳しくなった気がする。", buf);
205 msg_format("You now know more about %s.", buf);
219 chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
220 msg_print(_("これで全部です。", "That's all."));
231 void discharge_minion(player_type *caster_ptr)
234 for (MONSTER_IDX i = 1; i < caster_ptr->current_floor_ptr->m_max; i++)
236 monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i];
237 if (!m_ptr->r_idx || !is_pet(m_ptr)) continue;
238 if (m_ptr->nickname) okay = FALSE;
241 if (!okay || caster_ptr->riding)
243 if (!get_check(_("本当に全ペットを爆破しますか?", "You will blast all pets. Are you sure? ")))
247 for (MONSTER_IDX i = 1; i < caster_ptr->current_floor_ptr->m_max; i++)
249 monster_type *m_ptr = &caster_ptr->current_floor_ptr->m_list[i];
250 if (!m_ptr->r_idx || !is_pet(m_ptr)) continue;
253 r_ptr = &r_info[m_ptr->r_idx];
254 if (r_ptr->flags1 & RF1_UNIQUE)
256 GAME_TEXT m_name[MAX_NLEN];
257 monster_desc(caster_ptr, m_name, m_ptr, 0x00);
258 msg_format(_("%sは爆破されるのを嫌がり、勝手に自分の世界へと帰った。", "%^s resists being blasted and runs away."), m_name);
259 delete_monster_idx(caster_ptr, i);
263 HIT_POINT dam = m_ptr->maxhp / 2;
264 if (dam > 100) dam = (dam - 100) / 2 + 100;
265 if (dam > 400) dam = (dam - 400) / 2 + 400;
266 if (dam > 800) dam = 800;
267 project(caster_ptr, i, 2 + (r_ptr->level / 20), m_ptr->fy, m_ptr->fx, dam, GF_PLASMA,
268 PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
270 if (record_named_pet && m_ptr->nickname)
272 GAME_TEXT m_name[MAX_NLEN];
274 monster_desc(caster_ptr, m_name, m_ptr, MD_INDEF_VISIBLE);
275 exe_write_diary(caster_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_BLAST, m_name);
278 delete_monster_idx(caster_ptr, i);
285 * @param caster_ptr プレーヤーへの参照ポインタ
286 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
288 * @return 作用が実際にあった場合TRUEを返す
290 bool hypodynamic_bolt(player_type *caster_ptr, DIRECTION dir, HIT_POINT dam)
292 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
293 return (project_hook(caster_ptr, GF_HYPODYNAMIA, dir, dam, flg));
299 * @param caster_ptr プレーヤーへの参照ポインタ
300 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
302 * @return 作用が実際にあった場合TRUEを返す
304 bool wall_to_mud(player_type *caster_ptr, DIRECTION dir, HIT_POINT dam)
306 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
307 return (project_hook(caster_ptr, GF_KILL_WALL, dir, dam, flg));
313 * @param caster_ptr プレーヤーへの参照ポインタ
314 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
315 * @return 作用が実際にあった場合TRUEを返す
317 bool wizard_lock(player_type *caster_ptr, DIRECTION dir)
319 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
320 return (project_hook(caster_ptr, GF_JAM_DOOR, dir, 20 + randint1(30), flg));
326 * @param caster_ptr プレーヤーへの参照ポインタ
327 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
328 * @return 作用が実際にあった場合TRUEを返す
330 bool destroy_door(player_type *caster_ptr, DIRECTION dir)
332 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
333 return (project_hook(caster_ptr, GF_KILL_DOOR, dir, 0, flg));
339 * @param caster_ptr プレーヤーへの参照ポインタ
340 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
341 * @return 作用が実際にあった場合TRUEを返す
343 bool disarm_trap(player_type *caster_ptr, DIRECTION dir)
345 BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
346 return (project_hook(caster_ptr, GF_KILL_TRAP, dir, 0, flg));
352 * @param caster_ptr プレーヤーへの参照ポインタ
353 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
354 * @param plev プレイヤーレベル(効力はplev*200)
355 * @return 作用が実際にあった場合TRUEを返す
357 bool death_ray(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev)
359 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
360 return (project_hook(caster_ptr, GF_DEATH_RAY, dir, plev * 200, flg));
365 * @brief ドア生成処理(プレイヤー中心に周囲1マス) / Hooks -- affect adjacent grids (radius 1 ball attack)
366 * @param caster_ptr プレーヤーへの参照ポインタ
367 * @return 作用が実際にあった場合TRUEを返す
369 bool door_creation(player_type *caster_ptr, POSITION y, POSITION x)
371 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
372 return (project(caster_ptr, 0, 1, y, x, 0, GF_MAKE_DOOR, flg, -1));
377 * @brief トラップ生成処理(起点から周囲1マス)
378 * @param caster_ptr プレーヤーへの参照ポインタ
381 * @return 作用が実際にあった場合TRUEを返す
383 bool trap_creation(player_type *caster_ptr, POSITION y, POSITION x)
385 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
386 return (project(caster_ptr, 0, 1, y, x, 0, GF_MAKE_TRAP, flg, -1));
391 * @brief 森林生成処理(プレイヤー中心に周囲1マス)
392 * @param caster_ptr プレーヤーへの参照ポインタ
393 * @return 作用が実際にあった場合TRUEを返す
395 bool tree_creation(player_type *caster_ptr, POSITION y, POSITION x)
397 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
398 return (project(caster_ptr, 0, 1, y, x, 0, GF_MAKE_TREE, flg, -1));
403 * @brief 魔法のルーン生成処理(プレイヤー中心に周囲1マス)
404 * @param caster_ptr プレーヤーへの参照ポインタ
405 * @return 作用が実際にあった場合TRUEを返す
407 bool glyph_creation(player_type *caster_ptr, POSITION y, POSITION x)
409 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM;
410 return (project(caster_ptr, 0, 1, y, x, 0, GF_MAKE_GLYPH, flg, -1));
415 * @brief 壁生成処理(プレイヤー中心に周囲1マス)
416 * @param caster_ptr プレーヤーへの参照ポインタ
417 * @return 作用が実際にあった場合TRUEを返す
419 bool wall_stone(player_type *caster_ptr)
421 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
422 bool dummy = (project(caster_ptr, 0, 1, caster_ptr->y, caster_ptr->x, 0, GF_STONE_WALL, flg, -1));
423 caster_ptr->update |= (PU_FLOW);
424 caster_ptr->redraw |= (PR_MAP);
430 * @brief ドア破壊処理(プレイヤー中心に周囲1マス)
431 * @param caster_ptr プレーヤーへの参照ポインタ
432 * @return 作用が実際にあった場合TRUEを返す
434 bool destroy_doors_touch(player_type *caster_ptr)
436 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
437 return (project(caster_ptr, 0, 1, caster_ptr->y, caster_ptr->x, 0, GF_KILL_DOOR, flg, -1));
442 * @brief トラップ解除処理(プレイヤー中心に周囲1マス)
443 * @param caster_ptr プレーヤーへの参照ポインタ
444 * @return 作用が実際にあった場合TRUEを返す
446 bool disarm_traps_touch(player_type *caster_ptr)
448 BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
449 return (project(caster_ptr, 0, 1, caster_ptr->y, caster_ptr->x, 0, GF_KILL_TRAP, flg, -1));
454 * @brief スリープモンスター処理(プレイヤー中心に周囲1マス)
455 * @param caster_ptr プレーヤーへの参照ポインタ
456 * @return 作用が実際にあった場合TRUEを返す
458 bool sleep_monsters_touch(player_type *caster_ptr)
460 BIT_FLAGS flg = PROJECT_KILL | PROJECT_HIDE;
461 return (project(caster_ptr, 0, 1, caster_ptr->y, caster_ptr->x, caster_ptr->lev, GF_OLD_SLEEP, flg, -1));
466 * @brief 死者復活処理(起点より周囲5マス)
467 * @param caster_ptr プレーヤーへの参照ポインタ
468 * @param who 術者モンスターID(0ならばプレイヤー)
471 * @return 作用が実際にあった場合TRUEを返す
473 bool animate_dead(player_type *caster_ptr, MONSTER_IDX who, POSITION y, POSITION x)
475 BIT_FLAGS flg = PROJECT_ITEM | PROJECT_HIDE;
476 return (project(caster_ptr, who, 5, y, x, 0, GF_ANIM_DEAD, flg, -1));
482 * @return 作用が実際にあった場合TRUEを返す
484 void call_chaos(player_type *caster_ptr)
488 GF_ELEC, GF_POIS, GF_ACID, GF_COLD,
489 GF_FIRE, GF_MISSILE, GF_ARROW, GF_PLASMA,
490 GF_HOLY_FIRE, GF_WATER, GF_LITE, GF_DARK,
491 GF_FORCE, GF_INERTIAL, GF_MANA, GF_METEOR,
492 GF_ICE, GF_CHAOS, GF_NETHER, GF_DISENCHANT,
493 GF_SHARDS, GF_SOUND, GF_NEXUS, GF_CONFUSION,
494 GF_TIME, GF_GRAVITY, GF_ROCKET, GF_NUKE,
495 GF_HELL_FIRE, GF_DISINTEGRATE, GF_PSY_SPEAR
498 int chaos_type = hurt_types[randint0(31)];
499 bool line_chaos = FALSE;
500 if (one_in_(4)) line_chaos = TRUE;
505 for (int dummy = 1; dummy < 10; dummy++)
510 fire_beam(caster_ptr, chaos_type, dummy, 150);
512 fire_ball(caster_ptr, chaos_type, dummy, 150, 2);
521 fire_ball(caster_ptr, chaos_type, 0, 500, 8);
525 if (!get_aim_dir(caster_ptr, &dir)) return;
527 fire_beam(caster_ptr, chaos_type, dir, 250);
529 fire_ball(caster_ptr, chaos_type, dir, 250, 3 + (caster_ptr->lev / 35));
534 * @brief TY_CURSE処理発動 / Activate the evil Topi Ylinen curse
535 * @param target_ptr プレーヤーへの参照ポインタ
536 * @param stop_ty 再帰処理停止フラグ
538 * @return 作用が実際にあった場合TRUEを返す
541 * rr9: Stop the nasty things when a Cyberdemon is summoned
542 * or the player gets paralyzed.
545 bool activate_ty_curse(player_type *target_ptr, bool stop_ty, int *count)
547 BIT_FLAGS flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
548 bool is_first_curse = TRUE;
549 floor_type *floor_ptr = target_ptr->current_floor_ptr;
550 while (is_first_curse || (one_in_(3) && !stop_ty))
552 is_first_curse = FALSE;
553 switch (randint1(34))
558 msg_print(_("地面が揺れた...", "The ground trembles..."));
559 earthquake(target_ptr, target_ptr->y, target_ptr->x, 5 + randint0(10), 0);
560 if (!one_in_(6)) break;
566 HIT_POINT dam = damroll(10, 10);
567 msg_print(_("純粋な魔力の次元への扉が開いた!", "A portal opens to a plane of raw mana!"));
568 project(target_ptr, 0, 8, target_ptr->y, target_ptr->x, dam, GF_MANA, flg, -1);
569 take_hit(target_ptr, DAMAGE_NOESCAPE, dam, _("純粋な魔力の解放", "released pure mana"), -1);
570 if (!one_in_(6)) break;
576 msg_print(_("周囲の空間が歪んだ!", "Space warps about you!"));
577 teleport_player(target_ptr, damroll(10, 10), TELEPORT_PASSIVE);
578 if (randint0(13)) (*count) += activate_hi_summon(target_ptr, target_ptr->y, target_ptr->x, FALSE);
579 if (!one_in_(6)) break;
583 msg_print(_("エネルギーのうねりを感じた!", "You feel a surge of energy!"));
584 wall_breaker(target_ptr);
587 project(target_ptr, 0, 7, target_ptr->y, target_ptr->x, 50, GF_KILL_WALL, flg, -1);
588 take_hit(target_ptr, DAMAGE_NOESCAPE, 50, _("エネルギーのうねり", "surge of energy"), -1);
591 if (!one_in_(6)) break;
593 case 1: case 2: case 3: case 16: case 17:
594 aggravate_monsters(target_ptr, 0);
595 if (!one_in_(6)) break;
597 case 4: case 5: case 6:
598 (*count) += activate_hi_summon(target_ptr, target_ptr->y, target_ptr->x, FALSE);
599 if (!one_in_(6)) break;
601 case 7: case 8: case 9: case 18:
602 (*count) += summon_specific(target_ptr, 0, target_ptr->y, target_ptr->x, floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
603 if (!one_in_(6)) break;
605 case 10: case 11: case 12:
606 msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
607 lose_exp(target_ptr, target_ptr->exp / 16);
608 if (!one_in_(6)) break;
610 case 13: case 14: case 15: case 19: case 20:
612 bool is_statue = stop_ty;
613 is_statue |= target_ptr->free_act && (randint1(125) < target_ptr->skill_sav);
614 is_statue |= target_ptr->pclass == CLASS_BERSERKER;
617 msg_print(_("彫像になった気分だ!", "You feel like a statue!"));
618 if (target_ptr->free_act)
619 set_paralyzed(target_ptr, target_ptr->paralyzed + randint1(3));
621 set_paralyzed(target_ptr, target_ptr->paralyzed + randint1(13));
625 if (!one_in_(6)) break;
628 case 21: case 22: case 23:
629 (void)do_dec_stat(target_ptr, randint0(6));
630 if (!one_in_(6)) break;
633 msg_print(_("ほえ?私は誰?ここで何してる?", "Huh? Who am I? What am I doing here?"));
634 lose_all_info(target_ptr);
635 if (!one_in_(6)) break;
638 if ((floor_ptr->dun_level > 65) && !stop_ty)
640 (*count) += summon_cyber(target_ptr, -1, target_ptr->y, target_ptr->x);
645 if (!one_in_(6)) break;
648 for (int i = 0; i < A_MAX; i++)
650 bool is_first_dec_stat = TRUE;
651 while (is_first_dec_stat || one_in_(2))
653 is_first_dec_stat = FALSE;
654 (void)do_dec_stat(target_ptr, i);
665 * todo 引数にPOSITION x/yは必要か? 要調査
666 * @brief HI_SUMMON(上級召喚)処理発動
667 * @param caster_ptr プレーヤーへの参照ポインタ
670 * @param can_pet プレイヤーのペットとなる可能性があるならばTRUEにする
671 * @return 作用が実際にあった場合TRUEを返す
673 int activate_hi_summon(player_type *caster_ptr, POSITION y, POSITION x, bool can_pet)
675 BIT_FLAGS mode = PM_ALLOW_GROUP;
681 mode |= PM_FORCE_FRIENDLY;
685 mode |= PM_FORCE_PET;
690 if (!pet) mode |= PM_NO_PET;
692 DEPTH dungeon_level = caster_ptr->current_floor_ptr->dun_level;
693 DEPTH summon_lev = (pet ? caster_ptr->lev * 2 / 3 + randint1(caster_ptr->lev / 2) : dungeon_level);
695 for (int i = 0; i < (randint1(7) + (dungeon_level / 40)); i++)
697 switch (randint1(25) + (dungeon_level / 20))
700 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_ANT, mode);
703 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_SPIDER, mode);
706 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_HOUND, mode);
709 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_HYDRA, mode);
712 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_ANGEL, mode);
715 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_UNDEAD, mode);
718 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_DRAGON, mode);
721 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_DEMON, mode);
725 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
729 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE));
732 if (!can_pet) mode |= PM_ALLOW_UNIQUE;
733 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_UNDEAD, mode);
736 if (!can_pet) mode |= PM_ALLOW_UNIQUE;
737 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_DRAGON, mode);
740 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, 100, SUMMON_CYBER, mode);
743 if (!can_pet) mode |= PM_ALLOW_UNIQUE;
744 count += summon_specific(caster_ptr, (pet ? -1 : 0), y, x, pet ? summon_lev : (((summon_lev * 3) / 2) + 5), 0, mode);
753 * @brief 周辺破壊効果(プレイヤー中心)
754 * @param caster_ptr プレーヤーへの参照ポインタ
755 * @return 作用が実際にあった場合TRUEを返す
757 void wall_breaker(player_type *caster_ptr)
759 POSITION y = 0, x = 0;
761 if (randint1(80 + caster_ptr->lev) < 70)
765 scatter(caster_ptr, &y, &x, caster_ptr->y, caster_ptr->x, 4, 0);
767 if (!cave_have_flag_bold(caster_ptr->current_floor_ptr, y, x, FF_PROJECT)) continue;
769 if (!player_bold(caster_ptr, y, x)) break;
772 project(caster_ptr, 0, 0, y, x, 20 + randint1(30), GF_KILL_WALL,
773 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
777 if (randint1(100) > 30)
779 earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 1, 0);
783 int num = damroll(5, 3);
784 for (int i = 0; i < num; i++)
788 scatter(caster_ptr, &y, &x, caster_ptr->y, caster_ptr->x, 10, 0);
790 if (!player_bold(caster_ptr, y, x)) break;
793 project(caster_ptr, 0, 0, y, x, 20 + randint1(30), GF_KILL_WALL,
794 (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
800 * @brief チャーム・モンスター(1体)
801 * @param caster_ptr プレーヤーへの参照ポインタ
802 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
804 * @return 作用が実際にあった場合TRUEを返す
806 bool charm_monster(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev)
808 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
809 return (project_hook(caster_ptr, GF_CHARM, dir, plev, flg));
815 * @param caster_ptr プレーヤーへの参照ポインタ
816 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
818 * @return 作用が実際にあった場合TRUEを返す
820 bool control_one_undead(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev)
822 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
823 return (project_hook(caster_ptr, GF_CONTROL_UNDEAD, dir, plev, flg));
829 * @param caster_ptr プレーヤーへの参照ポインタ
830 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
832 * @return 作用が実際にあった場合TRUEを返す
834 bool control_one_demon(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev)
836 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
837 return (project_hook(caster_ptr, GF_CONTROL_DEMON, dir, plev, flg));
843 * @param caster_ptr プレーヤーへの参照ポインタ
844 * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
846 * @return 作用が実際にあった場合TRUEを返す
848 bool charm_animal(player_type *caster_ptr, DIRECTION dir, PLAYER_LEVEL plev)
850 BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
851 return (project_hook(caster_ptr, GF_CONTROL_ANIMAL, dir, plev, flg));
856 * @brief 『一つの指輪』の効果処理 /
857 * Hack -- activate the ring of power
858 * @param caster_ptr プレーヤーへの参照ポインタ
862 void ring_of_power(player_type *caster_ptr, DIRECTION dir)
864 switch (randint1(10))
869 msg_print(_("あなたは悪性のオーラに包み込まれた。", "You are surrounded by a malignant aura."));
872 /* Decrease all stats (permanently) */
873 (void)dec_stat(caster_ptr, A_STR, 50, TRUE);
874 (void)dec_stat(caster_ptr, A_INT, 50, TRUE);
875 (void)dec_stat(caster_ptr, A_WIS, 50, TRUE);
876 (void)dec_stat(caster_ptr, A_DEX, 50, TRUE);
877 (void)dec_stat(caster_ptr, A_CON, 50, TRUE);
878 (void)dec_stat(caster_ptr, A_CHR, 50, TRUE);
880 /* Lose some experience (permanently) */
881 caster_ptr->exp -= (caster_ptr->exp / 4);
882 caster_ptr->max_exp -= (caster_ptr->exp / 4);
883 check_experience(caster_ptr);
890 msg_print(_("あなたは強力なオーラに包み込まれた。", "You are surrounded by a powerful aura."));
891 dispel_monsters(caster_ptr, 1000);
899 fire_ball(caster_ptr, GF_MANA, dir, 600, 3);
908 fire_bolt(caster_ptr, GF_MANA, dir, 500);
916 * @brief 運命の輪、並びにカオス的な効果の発動
917 * @param caster_ptr プレーヤーへの参照ポインタ
918 * @param spell ランダムな効果を選択するための基準ID
921 void wild_magic(player_type *caster_ptr, int spell)
923 int type = SUMMON_MOLD + randint0(6);
924 if (type < SUMMON_MOLD) type = SUMMON_MOLD;
925 else if (type > SUMMON_MIMIC) type = SUMMON_MIMIC;
927 floor_type *floor_ptr = caster_ptr->current_floor_ptr;
928 switch (randint1(spell) + randint1(8) + 1)
933 teleport_player(caster_ptr, 10, TELEPORT_PASSIVE);
938 teleport_player(caster_ptr, 100, TELEPORT_PASSIVE);
942 teleport_player(caster_ptr, 200, TELEPORT_PASSIVE);
947 unlite_area(caster_ptr, 10, 3);
952 lite_area(caster_ptr, damroll(2, 3), 2);
955 destroy_doors_touch(caster_ptr);
958 wall_breaker(caster_ptr);
961 sleep_monsters_touch(caster_ptr);
965 trap_creation(caster_ptr, caster_ptr->y, caster_ptr->x);
969 door_creation(caster_ptr, caster_ptr->y, caster_ptr->x);
974 aggravate_monsters(caster_ptr, 0);
977 earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 5, 0);
981 (void)gain_mutation(caster_ptr, 0);
985 apply_disenchant(caster_ptr, 1);
988 lose_all_info(caster_ptr);
991 fire_ball(caster_ptr, GF_CHAOS, 0, spell + 5, 1 + (spell / 10));
994 wall_stone(caster_ptr);
998 for (int counter = 0; counter < 8; counter++)
1000 (void)summon_specific(caster_ptr, 0, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3) / 2, type, (PM_ALLOW_GROUP | PM_NO_PET));
1006 activate_hi_summon(caster_ptr, caster_ptr->y, caster_ptr->x, FALSE);
1009 (void)summon_cyber(caster_ptr, -1, caster_ptr->y, caster_ptr->x);
1014 (void)activate_ty_curse(caster_ptr, FALSE, &count);
1022 * @brief カオス魔法「流星群」の処理としてプレイヤーを中心に隕石落下処理を10+1d10回繰り返す。
1023 * / Drop 10+1d10 meteor ball at random places near the player
1024 * @param caster_ptr プレーヤーへの参照ポインタ
1029 void cast_meteor(player_type *caster_ptr, HIT_POINT dam, POSITION rad)
1031 int b = 10 + randint1(10);
1032 for (int i = 0; i < b; i++)
1034 POSITION y = 0, x = 0;
1037 for (count = 0; count <= 20; count++)
1041 x = caster_ptr->x - 8 + randint0(17);
1042 y = caster_ptr->y - 8 + randint0(17);
1043 dx = (caster_ptr->x > x) ? (caster_ptr->x - x) : (x - caster_ptr->x);
1044 dy = (caster_ptr->y > y) ? (caster_ptr->y - y) : (y - caster_ptr->y);
1045 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
1047 if (d >= 9) continue;
1049 floor_type *floor_ptr = caster_ptr->current_floor_ptr;
1050 if (!in_bounds(floor_ptr, y, x) || !projectable(caster_ptr, caster_ptr->y, caster_ptr->x, y, x)
1051 || !cave_have_flag_bold(floor_ptr, y, x, FF_PROJECT)) continue;
1056 if (count > 20) continue;
1058 project(caster_ptr, 0, rad, y, x, dam, GF_METEOR, PROJECT_KILL | PROJECT_JUMP | PROJECT_ITEM, -1);
1064 * @brief 破邪魔法「神の怒り」の処理としてターゲットを指定した後分解のボールを最大20回発生させる。
1065 * @param caster_ptr プレーヤーへの参照ポインタ
1068 * @return ターゲットを指定し、実行したならばTRUEを返す。
1070 bool cast_wrath_of_the_god(player_type *caster_ptr, HIT_POINT dam, POSITION rad)
1073 if (!get_aim_dir(caster_ptr, &dir)) return FALSE;
1075 POSITION tx = caster_ptr->x + 99 * ddx[dir];
1076 POSITION ty = caster_ptr->y + 99 * ddy[dir];
1077 if ((dir == 5) && target_okay(caster_ptr))
1083 POSITION x = caster_ptr->x;
1084 POSITION y = caster_ptr->y;
1088 if ((y == ty) && (x == tx)) break;
1092 mmove2(&ny, &nx, caster_ptr->y, caster_ptr->x, ty, tx);
1093 if (MAX_RANGE <= distance(caster_ptr->y, caster_ptr->x, ny, nx)) break;
1094 if (!cave_have_flag_bold(caster_ptr->current_floor_ptr, ny, nx, FF_PROJECT)) break;
1095 if ((dir != 5) && caster_ptr->current_floor_ptr->grid_array[ny][nx].m_idx != 0) break;
1104 int b = 10 + randint1(10);
1105 for (int i = 0; i < b; i++)
1107 int count = 20, d = 0;
1113 x = tx - 5 + randint0(11);
1114 y = ty - 5 + randint0(11);
1116 dx = (tx > x) ? (tx - x) : (x - tx);
1117 dy = (ty > y) ? (ty - y) : (y - ty);
1119 d = (dy > dx) ? (dy + (dx >> 1)) : (dx + (dy >> 1));
1123 if (count < 0) continue;
1125 if (!in_bounds(caster_ptr->current_floor_ptr, y, x) ||
1126 cave_stop_disintegration(caster_ptr->current_floor_ptr, y, x) ||
1127 !in_disintegration_range(caster_ptr->current_floor_ptr, ty, tx, y, x))
1130 project(caster_ptr, 0, rad, y, x, dam, GF_DISINTEGRATE, PROJECT_JUMP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
1138 * @brief 「ワンダー」のランダムな効果を決定して処理する。
1139 * @param caster_ptr プレーヤーへの参照ポインタ
1143 * This spell should become more useful (more controlled) as the\n
1144 * player gains experience levels. Thus, add 1/5 of the player's\n
1145 * level to the die roll. This eliminates the worst effects later on,\n
1146 * while keeping the results quite random. It also allows some potent\n
1147 * effects only at high level.
1149 void cast_wonder(player_type *caster_ptr, DIRECTION dir)
1151 PLAYER_LEVEL plev = caster_ptr->lev;
1152 int die = randint1(100) + plev / 5;
1153 int vir = virtue_number(caster_ptr, V_CHANCE);
1156 if (caster_ptr->virtues[vir - 1] > 0)
1158 while (randint1(400) < caster_ptr->virtues[vir - 1]) die++;
1162 while (randint1(400) < (0 - caster_ptr->virtues[vir - 1])) die--;
1168 chg_virtue(caster_ptr, V_CHANCE, 1);
1173 msg_print(_("あなたは力がみなぎるのを感じた!", "You feel a surge of power!"));
1178 clone_monster(caster_ptr, dir);
1184 speed_monster(caster_ptr, dir, plev);
1190 heal_monster(caster_ptr, dir, damroll(4, 6));
1196 poly_monster(caster_ptr, dir, plev);
1202 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_MISSILE, dir,
1203 damroll(3 + ((plev - 1) / 5), 4));
1209 confuse_monster(caster_ptr, dir, plev);
1215 fire_ball(caster_ptr, GF_POIS, dir, 20 + (plev / 2), 3);
1221 (void)lite_line(caster_ptr, dir, damroll(6, 8));
1227 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_ELEC, dir,
1228 damroll(3 + ((plev - 5) / 4), 8));
1234 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_COLD, dir,
1235 damroll(5 + ((plev - 5) / 4), 8));
1241 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_ACID, dir,
1242 damroll(6 + ((plev - 5) / 4), 8));
1248 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_FIRE, dir,
1249 damroll(8 + ((plev - 5) / 4), 8));
1255 hypodynamic_bolt(caster_ptr, dir, 75);
1261 fire_ball(caster_ptr, GF_ELEC, dir, 30 + plev / 2, 2);
1267 fire_ball(caster_ptr, GF_ACID, dir, 40 + plev, 2);
1273 fire_ball(caster_ptr, GF_ICE, dir, 70 + plev, 3);
1279 fire_ball(caster_ptr, GF_FIRE, dir, 80 + plev, 3);
1285 hypodynamic_bolt(caster_ptr, dir, 100 + plev);
1291 earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 12, 0);
1297 (void)destroy_area(caster_ptr, caster_ptr->y, caster_ptr->x, 13 + randint0(5), FALSE);
1303 symbol_genocide(caster_ptr, plev + 50, TRUE);
1309 dispel_monsters(caster_ptr, 120);
1313 dispel_monsters(caster_ptr, 150);
1314 slow_monsters(caster_ptr, plev);
1315 sleep_monsters(caster_ptr, plev);
1316 hp_player(caster_ptr, 300);
1321 * @brief 「悪霊召喚」のランダムな効果を決定して処理する。
1322 * @param caster_ptr プレーヤーへの参照ポインタ
1326 void cast_invoke_spirits(player_type *caster_ptr, DIRECTION dir)
1328 PLAYER_LEVEL plev = caster_ptr->lev;
1329 int die = randint1(100) + plev / 5;
1330 int vir = virtue_number(caster_ptr, V_CHANCE);
1334 if (caster_ptr->virtues[vir - 1] > 0)
1336 while (randint1(400) < caster_ptr->virtues[vir - 1]) die++;
1340 while (randint1(400) < (0 - caster_ptr->virtues[vir - 1])) die--;
1344 msg_print(_("あなたは死者たちの力を招集した...", "You call on the power of the dead..."));
1346 chg_virtue(caster_ptr, V_CHANCE, 1);
1350 msg_print(_("あなたはおどろおどろしい力のうねりを感じた!", "You feel a surge of eldritch force!"));
1355 msg_print(_("なんてこった!あなたの周りの地面から朽ちた人影が立ち上がってきた!",
1356 "Oh no! Mouldering forms rise from the earth around you!"));
1358 (void)summon_specific(caster_ptr, 0, caster_ptr->y, caster_ptr->x, caster_ptr->current_floor_ptr->dun_level, SUMMON_UNDEAD, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
1359 chg_virtue(caster_ptr, V_UNLIFE, 1);
1363 msg_print(_("名状し難い邪悪な存在があなたの心を通り過ぎて行った...", "An unnamable evil brushes against your mind..."));
1365 set_afraid(caster_ptr, caster_ptr->afraid + randint1(4) + 4);
1369 msg_print(_("あなたの頭に大量の幽霊たちの騒々しい声が押し寄せてきた...",
1370 "Your head is invaded by a horde of gibbering spectral voices..."));
1372 set_confused(caster_ptr, caster_ptr->confused + randint1(4) + 4);
1376 poly_monster(caster_ptr, dir, plev);
1380 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_MISSILE, dir,
1381 damroll(3 + ((plev - 1) / 5), 4));
1385 confuse_monster(caster_ptr, dir, plev);
1389 fire_ball(caster_ptr, GF_POIS, dir, 20 + (plev / 2), 3);
1393 (void)lite_line(caster_ptr, dir, damroll(6, 8));
1397 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_ELEC, dir,
1398 damroll(3 + ((plev - 5) / 4), 8));
1402 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr) - 10, GF_COLD, dir,
1403 damroll(5 + ((plev - 5) / 4), 8));
1407 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_ACID, dir,
1408 damroll(6 + ((plev - 5) / 4), 8));
1412 fire_bolt_or_beam(caster_ptr, beam_chance(caster_ptr), GF_FIRE, dir,
1413 damroll(8 + ((plev - 5) / 4), 8));
1417 hypodynamic_bolt(caster_ptr, dir, 75);
1421 fire_ball(caster_ptr, GF_ELEC, dir, 30 + plev / 2, 2);
1425 fire_ball(caster_ptr, GF_ACID, dir, 40 + plev, 2);
1429 fire_ball(caster_ptr, GF_ICE, dir, 70 + plev, 3);
1433 fire_ball(caster_ptr, GF_FIRE, dir, 80 + plev, 3);
1437 hypodynamic_bolt(caster_ptr, dir, 100 + plev);
1441 earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 12, 0);
1445 (void)destroy_area(caster_ptr, caster_ptr->y, caster_ptr->x, 13 + randint0(5), FALSE);
1449 symbol_genocide(caster_ptr, plev + 50, TRUE);
1453 dispel_monsters(caster_ptr, 120);
1457 dispel_monsters(caster_ptr, 150);
1458 slow_monsters(caster_ptr, plev);
1459 sleep_monsters(caster_ptr, plev);
1460 hp_player(caster_ptr, 300);
1465 msg_print(_("陰欝な声がクスクス笑う。「もうすぐおまえは我々の仲間になるだろう。弱き者よ。」",
1466 "Sepulchral voices chuckle. 'Soon you will join us, mortal.'"));
1472 * @brief トランプ領域の「シャッフル」の効果をランダムに決めて処理する。
1473 * @param caster_ptr プレーヤーへの参照ポインタ
1476 void cast_shuffle(player_type *caster_ptr)
1478 PLAYER_LEVEL plev = caster_ptr->lev;
1481 int vir = virtue_number(caster_ptr, V_CHANCE);
1484 if ((caster_ptr->pclass == CLASS_ROGUE) ||
1485 (caster_ptr->pclass == CLASS_HIGH_MAGE) ||
1486 (caster_ptr->pclass == CLASS_SORCERER))
1487 die = (randint1(110)) + plev / 5;
1489 die = randint1(120);
1493 if (caster_ptr->virtues[vir - 1] > 0)
1495 while (randint1(400) < caster_ptr->virtues[vir - 1]) die++;
1499 while (randint1(400) < (0 - caster_ptr->virtues[vir - 1])) die--;
1503 msg_print(_("あなたはカードを切って一枚引いた...", "You shuffle the deck and draw a card..."));
1507 chg_virtue(caster_ptr, V_CHANCE, 1);
1510 floor_type *floor_ptr = caster_ptr->current_floor_ptr;
1513 msg_print(_("なんてこった!《死》だ!", "Oh no! It's Death!"));
1515 for (i = 0; i < randint1(3); i++)
1517 activate_hi_summon(caster_ptr, caster_ptr->y, caster_ptr->x, FALSE);
1525 msg_print(_("なんてこった!《悪魔》だ!", "Oh no! It's the Devil!"));
1526 summon_specific(caster_ptr, 0, caster_ptr->y, caster_ptr->x, floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
1533 msg_print(_("なんてこった!《吊られた男》だ!", "Oh no! It's the Hanged Man."));
1534 activate_ty_curse(caster_ptr, FALSE, &count);
1540 msg_print(_("《不調和の剣》だ。", "It's the swords of discord."));
1541 aggravate_monsters(caster_ptr, 0);
1547 msg_print(_("《愚者》だ。", "It's the Fool."));
1548 do_dec_stat(caster_ptr, A_INT);
1549 do_dec_stat(caster_ptr, A_WIS);
1555 msg_print(_("奇妙なモンスターの絵だ。", "It's the picture of a strange monster."));
1556 trump_summoning(caster_ptr, 1, FALSE, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3 / 2), (32 + randint1(6)), PM_ALLOW_GROUP | PM_ALLOW_UNIQUE);
1562 msg_print(_("《月》だ。", "It's the Moon."));
1563 unlite_area(caster_ptr, 10, 3);
1569 msg_print(_("《運命の輪》だ。", "It's the Wheel of Fortune."));
1570 wild_magic(caster_ptr, randint0(32));
1576 msg_print(_("テレポート・カードだ。", "It's a teleport trump card."));
1577 teleport_player(caster_ptr, 10, TELEPORT_PASSIVE);
1583 msg_print(_("《正義》だ。", "It's Justice."));
1584 set_blessed(caster_ptr, caster_ptr->lev, FALSE);
1590 msg_print(_("テレポート・カードだ。", "It's a teleport trump card."));
1591 teleport_player(caster_ptr, 100, TELEPORT_PASSIVE);
1597 msg_print(_("テレポート・カードだ。", "It's a teleport trump card."));
1598 teleport_player(caster_ptr, 200, TELEPORT_PASSIVE);
1604 msg_print(_("《塔》だ。", "It's the Tower."));
1605 wall_breaker(caster_ptr);
1611 msg_print(_("《節制》だ。", "It's Temperance."));
1612 sleep_monsters_touch(caster_ptr);
1618 msg_print(_("《塔》だ。", "It's the Tower."));
1619 earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 5, 0);
1625 msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
1626 trump_summoning(caster_ptr, 1, TRUE, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3 / 2), SUMMON_MOLD, 0L);
1632 msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
1633 trump_summoning(caster_ptr, 1, TRUE, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3 / 2), SUMMON_BAT, 0L);
1639 msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
1640 trump_summoning(caster_ptr, 1, TRUE, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3 / 2), SUMMON_VORTEX, 0L);
1646 msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
1647 trump_summoning(caster_ptr, 1, TRUE, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3 / 2), SUMMON_COIN_MIMIC, 0L);
1653 msg_print(_("《恋人》だ。", "It's the Lovers."));
1655 if (get_aim_dir(caster_ptr, &dir))
1657 charm_monster(caster_ptr, dir, MIN(caster_ptr->lev, 20));
1665 msg_print(_("《隠者》だ。", "It's the Hermit."));
1666 wall_stone(caster_ptr);
1672 msg_print(_("《審判》だ。", "It's the Judgement."));
1673 roll_hitdice(caster_ptr, 0L);
1674 lose_all_mutations(caster_ptr);
1680 msg_print(_("《太陽》だ。", "It's the Sun."));
1681 chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
1682 chg_virtue(caster_ptr, V_ENLIGHTEN, 1);
1683 wiz_lite(caster_ptr, FALSE);
1687 msg_print(_("《世界》だ。", "It's the World."));
1688 if (caster_ptr->exp >= PY_MAX_EXP)
1693 s32b ee = (caster_ptr->exp / 25) + 1;
1694 if (ee > 5000) ee = 5000;
1695 msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
1696 gain_exp(caster_ptr, ee);
1700 bool vampirism(player_type *caster_ptr)
1702 if (d_info[caster_ptr->dungeon_idx].flags1 & DF1_NO_MELEE)
1704 msg_print(_("なぜか攻撃することができない。", "Something prevents you from attacking."));
1709 if (!get_direction(caster_ptr, &dir, FALSE, FALSE)) return FALSE;
1711 POSITION y = caster_ptr->y + ddy[dir];
1712 POSITION x = caster_ptr->x + ddx[dir];
1714 g_ptr = &caster_ptr->current_floor_ptr->grid_array[y][x];
1715 stop_mouth(caster_ptr);
1716 if (!(g_ptr->m_idx))
1718 msg_print(_("何もない場所に噛みついた!", "You bite into thin air!"));
1722 msg_print(_("あなたはニヤリとして牙をむいた...", "You grin and bare your fangs..."));
1724 int dummy = caster_ptr->lev * 2;
1725 if (!hypodynamic_bolt(caster_ptr, dir, dummy))
1727 msg_print(_("げぇ!ひどい味だ。", "Yechh. That tastes foul."));
1731 if (caster_ptr->food < PY_FOOD_FULL)
1732 (void)hp_player(caster_ptr, dummy);
1734 msg_print(_("あなたは空腹ではありません。", "You were not hungry."));
1736 /* Gain nutritional sustenance: 150/hp drained */
1737 /* A Food ration gives 5000 food points (by contrast) */
1738 /* Don't ever get more than "Full" this way */
1739 /* But if we ARE Gorged, it won't cure us */
1740 dummy = caster_ptr->food + MIN(5000, 100 * dummy);
1741 if (caster_ptr->food < PY_FOOD_MAX) /* Not gorged already */
1742 (void)set_food(caster_ptr, dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
1748 * ヒット&アウェイのレイシャルパワー/突然変異
1749 * @param caster_ptr プレーヤーへの参照ポインタ
1750 * @return コマンドの入力先にモンスターがいたらTRUE
1752 bool hit_and_away(player_type *caster_ptr)
1755 if (!get_direction(caster_ptr, &dir, FALSE, FALSE)) return FALSE;
1756 POSITION y = caster_ptr->y + ddy[dir];
1757 POSITION x = caster_ptr->x + ddx[dir];
1758 if (caster_ptr->current_floor_ptr->grid_array[y][x].m_idx)
1760 do_cmd_attack(caster_ptr, y, x, 0);
1761 if (randint0(caster_ptr->skill_dis) < 7)
1762 msg_print(_("うまく逃げられなかった。", "You failed to run away."));
1764 teleport_player(caster_ptr, 30, TELEPORT_SPONTANEOUS);
1768 msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
1775 * @brief 超能力者のサイコメトリー処理/ Forcibly pseudo-identify an object in the inventory (or on the floor)
1776 * @param caster_ptr プレーヤーへの参照ポインタ
1779 * currently this function allows pseudo-id of any object,
1780 * including silly ones like potions & scrolls, which always
1781 * get '{average}'. This should be changed, either to stop such
1782 * items from being pseudo-id'd, or to allow psychometry to
1783 * detect whether the unidentified potion/scroll/etc is
1784 * good (Cure Light Wounds, Restore Strength, etc) or
1785 * bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
1787 bool psychometry(player_type *caster_ptr)
1789 concptr q = _("どのアイテムを調べますか?", "Meditate on which item? ");
1790 concptr s = _("調べるアイテムがありません。", "You have nothing appropriate.");
1793 o_ptr = choose_object(caster_ptr, &item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR | IGNORE_BOTHHAND_SLOT), 0);
1794 if (!o_ptr) return FALSE;
1796 if (object_is_known(o_ptr))
1798 msg_print(_("何も新しいことは判らなかった。", "You cannot find out anything more about that."));
1802 item_feel_type feel = pseudo_value_check_heavy(o_ptr);
1803 GAME_TEXT o_name[MAX_NLEN];
1804 object_desc(caster_ptr, o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
1808 msg_format(_("%sからは特に変わった事は感じとれなかった。", "You do not perceive anything unusual about the %s."), o_name);
1813 msg_format("%sは%sという感じがする...", o_name, game_inscriptions[feel]);
1815 msg_format("You feel that the %s %s %s...",
1816 o_name, ((o_ptr->number == 1) ? "is" : "are"), game_inscriptions[feel]);
1819 o_ptr->ident |= (IDENT_SENSE);
1820 o_ptr->feeling = feel;
1821 o_ptr->marked |= OM_TOUCHED;
1823 caster_ptr->update |= (PU_COMBINE | PU_REORDER);
1824 caster_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
1827 switch (o_ptr->tval)
1855 autopick_alter_item(caster_ptr, item, (bool)(okay && destroy_feeling));
1860 bool draconian_breath(player_type *creature_ptr)
1862 int Type = (one_in_(3) ? GF_COLD : GF_FIRE);
1863 concptr Type_desc = ((Type == GF_COLD) ? _("冷気", "cold") : _("炎", "fire"));
1865 if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
1867 if (randint1(100) < creature_ptr->lev)
1869 switch (creature_ptr->pclass)
1872 case CLASS_BERSERKER:
1875 case CLASS_IMITATOR:
1881 Type_desc = _("エレメント", "the elements");
1886 Type_desc = _("破片", "shards");
1891 case CLASS_WARRIOR_MAGE:
1892 case CLASS_HIGH_MAGE:
1893 case CLASS_SORCERER:
1894 case CLASS_MAGIC_EATER:
1895 case CLASS_RED_MAGE:
1896 case CLASS_BLUE_MAGE:
1897 case CLASS_MIRROR_MASTER:
1901 Type_desc = _("魔力", "mana");
1905 Type = GF_DISENCHANT;
1906 Type_desc = _("劣化", "disenchantment");
1910 case CLASS_CHAOS_WARRIOR:
1913 Type = GF_CONFUSION;
1914 Type_desc = _("混乱", "confusion");
1919 Type_desc = _("カオス", "chaos");
1925 case CLASS_FORCETRAINER:
1928 Type = GF_CONFUSION;
1929 Type_desc = _("混乱", "confusion");
1934 Type_desc = _("轟音", "sound");
1938 case CLASS_MINDCRAFTER:
1941 Type = GF_CONFUSION;
1942 Type_desc = _("混乱", "confusion");
1947 Type_desc = _("精神エネルギー", "mental energy");
1955 Type = GF_HELL_FIRE;
1956 Type_desc = _("地獄の劫火", "hellfire");
1960 Type = GF_HOLY_FIRE;
1961 Type_desc = _("聖なる炎", "holy fire");
1970 Type_desc = _("暗黒", "darkness");
1975 Type_desc = _("毒", "poison");
1983 Type_desc = _("轟音", "sound");
1987 Type = GF_CONFUSION;
1988 Type_desc = _("混乱", "confusion");
1995 stop_mouth(creature_ptr);
1996 msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), Type_desc);
1998 fire_breath(creature_ptr, Type, dir, creature_ptr->lev * 2, (creature_ptr->lev / 15) + 1);
2003 bool android_inside_weapon(player_type *creature_ptr)
2006 if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
2008 if (creature_ptr->lev < 10)
2010 msg_print(_("レイガンを発射した。", "You fire your ray gun."));
2011 fire_bolt(creature_ptr, GF_MISSILE, dir, (creature_ptr->lev + 1) / 2);
2015 if (creature_ptr->lev < 25)
2017 msg_print(_("ブラスターを発射した。", "You fire your blaster."));
2018 fire_bolt(creature_ptr, GF_MISSILE, dir, creature_ptr->lev);
2022 if (creature_ptr->lev < 35)
2024 msg_print(_("バズーカを発射した。", "You fire your bazooka."));
2025 fire_ball(creature_ptr, GF_MISSILE, dir, creature_ptr->lev * 2, 2);
2029 if (creature_ptr->lev < 45)
2031 msg_print(_("ビームキャノンを発射した。", "You fire a beam cannon."));
2032 fire_beam(creature_ptr, GF_MISSILE, dir, creature_ptr->lev * 2);
2036 msg_print(_("ロケットを発射した。", "You fire a rocket."));
2037 fire_rocket(creature_ptr, GF_ROCKET, dir, creature_ptr->lev * 5, 2);
2042 bool create_ration(player_type *creature_ptr)
2048 /* Create the food ration */
2049 object_prep(q_ptr, lookup_kind(TV_FOOD, SV_FOOD_RATION));
2051 /* Drop the object from heaven */
2052 (void)drop_near(creature_ptr, q_ptr, -1, creature_ptr->y, creature_ptr->x);
2053 msg_print(_("食事を料理して作った。", "You cook some food."));
2058 void hayagake(player_type *creature_ptr)
2060 if (creature_ptr->action == ACTION_HAYAGAKE)
2062 set_action(creature_ptr, ACTION_NONE);
2063 creature_ptr->energy_use = 0;
2067 grid_type *g_ptr = &creature_ptr->current_floor_ptr->grid_array[creature_ptr->y][creature_ptr->x];
2068 feature_type *f_ptr = &f_info[g_ptr->feat];
2070 if (!have_flag(f_ptr->flags, FF_PROJECT) ||
2071 (!creature_ptr->levitation && have_flag(f_ptr->flags, FF_DEEP)))
2073 msg_print(_("ここでは素早く動けない。", "You cannot run in here."));
2077 set_action(creature_ptr, ACTION_HAYAGAKE);
2080 creature_ptr->energy_use = 0;
2084 bool double_attack(player_type *creature_ptr)
2087 if (!get_rep_dir(creature_ptr, &dir, FALSE)) return FALSE;
2088 POSITION y = creature_ptr->y + ddy[dir];
2089 POSITION x = creature_ptr->x + ddx[dir];
2090 if (!creature_ptr->current_floor_ptr->grid_array[y][x].m_idx)
2092 msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
2098 msg_print(_("あーたたたたたたたたたたたたたたたたたたたたたた!!!",
2099 "Ahhhtatatatatatatatatatatatatatataatatatatattaaaaa!!!!"));
2100 else if (one_in_(2))
2101 msg_print(_("無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄無駄!!!",
2102 "Mudamudamudamudamudamudamudamudamudamudamudamudamuda!!!!"));
2104 msg_print(_("オラオラオラオラオラオラオラオラオラオラオラオラ!!!",
2105 "Oraoraoraoraoraoraoraoraoraoraoraoraoraoraoraoraora!!!!"));
2107 do_cmd_attack(creature_ptr, y, x, 0);
2108 if (creature_ptr->current_floor_ptr->grid_array[y][x].m_idx)
2110 handle_stuff(creature_ptr);
2111 do_cmd_attack(creature_ptr, y, x, 0);
2114 creature_ptr->energy_need += ENERGY_NEED();
2119 bool comvert_hp_to_mp(player_type *creature_ptr)
2121 int gain_sp = take_hit(creature_ptr, DAMAGE_USELIFE, creature_ptr->lev, _("HPからMPへの無謀な変換", "thoughtless conversion from HP to SP"), -1) / 5;
2124 msg_print(_("変換に失敗した。", "You failed to convert."));
2125 creature_ptr->redraw |= (PR_HP | PR_MANA);
2129 creature_ptr->csp += gain_sp;
2130 if (creature_ptr->csp > creature_ptr->msp)
2132 creature_ptr->csp = creature_ptr->msp;
2133 creature_ptr->csp_frac = 0;
2136 creature_ptr->redraw |= (PR_HP | PR_MANA);
2141 bool comvert_mp_to_hp(player_type *creature_ptr)
2143 if (creature_ptr->csp >= creature_ptr->lev / 5)
2145 creature_ptr->csp -= creature_ptr->lev / 5;
2146 hp_player(creature_ptr, creature_ptr->lev);
2150 msg_print(_("変換に失敗した。", "You failed to convert."));
2153 creature_ptr->redraw |= (PR_HP | PR_MANA);
2158 bool demonic_breath(player_type *creature_ptr)
2161 int type = (one_in_(2) ? GF_NETHER : GF_FIRE);
2162 if (!get_aim_dir(creature_ptr, &dir)) return FALSE;
2163 stop_mouth(creature_ptr);
2164 msg_format(_("あなたは%sのブレスを吐いた。", "You breathe %s."), ((type == GF_NETHER) ? _("地獄", "nether") : _("火炎", "fire")));
2165 fire_breath(creature_ptr, type, dir, creature_ptr->lev * 3, (creature_ptr->lev / 15) + 1);
2172 * @param creature_ptr プレーヤーへの参照ポインタ
2175 bool sword_dancing(player_type *creature_ptr)
2178 POSITION y = 0, x = 0;
2180 for (int i = 0; i < 6; i++)
2183 y = creature_ptr->y + ddy_ddd[dir];
2184 x = creature_ptr->x + ddx_ddd[dir];
2185 g_ptr = &creature_ptr->current_floor_ptr->grid_array[y][x];
2187 /* Hack -- attack monsters */
2189 do_cmd_attack(creature_ptr, y, x, 0);
2192 msg_print(_("攻撃が空をきった。", "You attack the empty air."));
2202 * @param creature_ptr プレーヤーへの参照ポインタ
2205 bool confusing_light(player_type *creature_ptr)
2207 msg_print(_("辺りを睨んだ...", "You glare nearby monsters..."));
2208 slow_monsters(creature_ptr, creature_ptr->lev);
2209 stun_monsters(creature_ptr, creature_ptr->lev * 4);
2210 confuse_monsters(creature_ptr, creature_ptr->lev * 4);
2211 turn_monsters(creature_ptr, creature_ptr->lev * 4);
2212 stasis_monsters(creature_ptr, creature_ptr->lev * 4);
2217 bool clear_mind(player_type *creature_ptr)
2221 msg_print(_("今はペットを操ることに集中していないと。", "Your pets demand all of your attention."));
2225 msg_print(_("少し頭がハッキリした。", "You feel your head clear a little."));
2227 creature_ptr->csp += (3 + creature_ptr->lev / 20);
2228 if (creature_ptr->csp >= creature_ptr->msp)
2230 creature_ptr->csp = creature_ptr->msp;
2231 creature_ptr->csp_frac = 0;
2234 creature_ptr->redraw |= (PR_MANA);