2 * @brief ウィザードモード専用のスペル処理
7 #include "wizard/wizard-spells.h"
8 #include "blue-magic/blue-magic-checker.h"
9 #include "core/asking-player.h"
10 #include "effect/effect-characteristics.h"
11 #include "floor/cave.h"
12 #include "floor/floor-util.h"
13 #include "mind/mind-blue-mage.h"
14 #include "monster-floor/monster-generator.h"
15 #include "monster-floor/monster-summon.h"
16 #include "monster-floor/place-monster-types.h"
17 #include "mutation/mutation-processor.h"
18 #include "spell-kind/spells-launcher.h"
19 #include "spell-kind/spells-teleport.h"
20 #include "spell-realm/spells-chaos.h"
21 #include "spell/spell-types.h"
22 #include "spell/spells-status.h"
23 #include "spell/summon-types.h"
24 #include "system/floor-type-definition.h"
25 #include "target/grid-selector.h"
26 #include "target/target-checker.h"
27 #include "target/target-getter.h"
28 #include "view/display-messages.h"
30 debug_spell_command debug_spell_commands_list[SPELL_MAX] = {
31 { 2, "vanish dungeon", { .spell2 = { vanish_dungeon } } },
32 { 3, "true healing", { .spell3 = { true_healing } } },
33 { 2, "drop weapons", { .spell2 = { drop_weapons } } },
37 * @brief コマンド入力により任意にスペル効果を起こす / Wizard spells
38 * @return 実際にテレポートを行ったらTRUEを返す
40 bool wiz_debug_spell(player_type *creature_ptr)
42 char tmp_val[50] = "\0";
45 if (!get_string("SPELL: ", tmp_val, 32))
48 for (int i = 0; i < SPELL_MAX; i++) {
49 if (strcmp(tmp_val, debug_spell_commands_list[i].command_name) != 0)
52 switch (debug_spell_commands_list[i].type) {
54 (*(debug_spell_commands_list[i].command_function.spell2.spell_function))(creature_ptr);
59 if (!get_string("POWER:", tmp_val, 32))
61 tmp_int = atoi(tmp_val);
62 (*(debug_spell_commands_list[i].command_function.spell3.spell_function))(creature_ptr, tmp_int);
70 msg_format("Command not found.");
75 * @brief 必ず成功するウィザードモード用次元の扉処理 / Wizard Dimension Door
76 * @param caster_ptr プレーヤーへの参照ポインタ
79 void wiz_dimension_door(player_type *caster_ptr)
81 POSITION x = 0, y = 0;
82 if (!tgt_pt(caster_ptr, &x, &y))
85 teleport_player_to(caster_ptr, y, x, TELEPORT_NONMAGICAL);
89 * @brief ウィザードモード用モンスターの群れ生成 / Summon a horde of monsters
90 * @param caster_ptr プレーヤーへの参照ポインタ
93 void wiz_summon_horde(player_type *caster_ptr)
95 POSITION wy = caster_ptr->y, wx = caster_ptr->x;
99 scatter(caster_ptr, &wy, &wx, caster_ptr->y, caster_ptr->x, 3, PROJECT_NONE);
100 if (is_cave_empty_bold(caster_ptr, wy, wx))
104 (void)alloc_horde(caster_ptr, wy, wx, summon_specific);
108 * @brief ウィザードモード用処理としてターゲット中の相手をテレポートバックする / Hack -- Teleport to the target
111 void wiz_teleport_back(player_type *caster_ptr)
116 teleport_player_to(caster_ptr, target_row, target_col, TELEPORT_NONMAGICAL);
120 * @brief 青魔導師の魔法を全て習得済みにする /
121 * debug command for blue mage
124 void wiz_learn_blue_magic_all(player_type *caster_ptr)
126 BIT_FLAGS f4 = 0L, f5 = 0L, f6 = 0L;
127 for (int j = 1; j < A_MAX; j++) {
128 set_rf_masks(&f4, &f5, &f6, static_cast<blue_magic_type>(j));
131 for (i = 0; i < 32; i++) {
132 if ((0x00000001U << i) & f4)
133 caster_ptr->magic_num2[i] = 1;
136 for (; i < 64; i++) {
137 if ((0x00000001U << (i - 32)) & f5)
138 caster_ptr->magic_num2[i] = 1;
141 for (; i < 96; i++) {
142 if ((0x00000001U << (i - 64)) & f6)
143 caster_ptr->magic_num2[i] = 1;
149 * @brief 現在のフロアに合ったモンスターをランダムに召喚する /
150 * Summon some creatures
151 * @param caster_ptr プレーヤーへの参照ポインタ
155 void wiz_summon_random_enemy(player_type *caster_ptr, int num)
157 for (int i = 0; i < num; i++)
158 (void)summon_specific(caster_ptr, 0, caster_ptr->y, caster_ptr->x, caster_ptr->current_floor_ptr->dun_level, SUMMON_NONE, PM_ALLOW_GROUP | PM_ALLOW_UNIQUE);
162 * @brief モンスターを種族IDを指定して敵対的に召喚する /
163 * Summon a creature of the specified type
164 * @param r_idx モンスター種族ID
167 * This function is rather dangerous
169 void wiz_summon_specific_enemy(player_type *summoner_ptr, MONRACE_IDX r_idx)
171 (void)summon_named_creature(summoner_ptr, 0, summoner_ptr->y, summoner_ptr->x, r_idx, PM_ALLOW_SLEEP | PM_ALLOW_GROUP);
175 * @brief モンスターを種族IDを指定してペット召喚する /
176 * Summon a creature of the specified type
177 * @param r_idx モンスター種族ID
180 * This function is rather dangerous
182 void wiz_summon_pet(player_type *summoner_ptr, MONRACE_IDX r_idx)
184 (void)summon_named_creature(summoner_ptr, 0, summoner_ptr->y, summoner_ptr->x, r_idx, PM_ALLOW_SLEEP | PM_ALLOW_GROUP | PM_FORCE_PET);
188 * @brief ターゲットを指定してダメージ100万・半径0の弱魔力のボールを放つ
192 void wiz_kill_enemy(player_type *caster_ptr)
196 if (!get_aim_dir(caster_ptr, &dir))
199 fire_ball(caster_ptr, GF_MISSILE, dir, 1000000, 0);