2 * @brief ウィザードモード専用のスペル処理
7 #include "wizard/wizard-spells.h"
8 #include "core/asking-player.h"
9 #include "floor/floor.h"
10 #include "io/targeting.h"
11 #include "monster-floor/monster-generator.h"
12 #include "monster-floor/monster-summon.h"
13 #include "monster-floor/place-monster-types.h"
14 #include "mutation/mutation-processor.h"
15 #include "mspell/mspells3.h"
16 #include "spell-kind/spells-teleport.h"
17 #include "spell-realm/spells-chaos.h"
18 #include "spell/spells-status.h"
19 #include "system/floor-type-definition.h"
20 #include "view/display-messages.h"
22 debug_spell_command debug_spell_commands_list[SPELL_MAX] = {
23 { 2, "vanish dungeon", { .spell2 = { vanish_dungeon } } },
24 { 3, "true healing", { .spell3 = { true_healing } } },
25 { 2, "drop weapons", { .spell2 = { drop_weapons } } },
29 * @brief コマンド入力により任意にスペル効果を起こす / Wizard spells
30 * @return 実際にテレポートを行ったらTRUEを返す
32 bool do_cmd_debug_spell(player_type *creature_ptr)
34 char tmp_val[50] = "\0";
37 if (!get_string("SPELL: ", tmp_val, 32))
40 for (int i = 0; i < SPELL_MAX; i++) {
41 if (strcmp(tmp_val, debug_spell_commands_list[i].command_name) != 0)
44 switch (debug_spell_commands_list[i].type) {
46 (*(debug_spell_commands_list[i].command_function.spell2.spell_function))(creature_ptr);
51 if (!get_string("POWER:", tmp_val, 32))
53 tmp_int = atoi(tmp_val);
54 (*(debug_spell_commands_list[i].command_function.spell3.spell_function))(creature_ptr, tmp_int);
62 msg_format("Command not found.");
67 * @brief 必ず成功するウィザードモード用次元の扉処理 / Wizard Dimension Door
68 * @param caster_ptr プレーヤーへの参照ポインタ
71 void wiz_dimension_door(player_type *caster_ptr)
73 POSITION x = 0, y = 0;
74 if (!tgt_pt(caster_ptr, &x, &y))
77 teleport_player_to(caster_ptr, y, x, TELEPORT_NONMAGICAL);
81 * @brief ウィザードモード用モンスターの群れ生成 / Summon a horde of monsters
82 * @param caster_ptr プレーヤーへの参照ポインタ
85 void do_cmd_summon_horde(player_type *caster_ptr)
87 POSITION wy = caster_ptr->y, wx = caster_ptr->x;
91 scatter(caster_ptr, &wy, &wx, caster_ptr->y, caster_ptr->x, 3, 0);
92 if (is_cave_empty_bold(caster_ptr, wy, wx))
96 (void)alloc_horde(caster_ptr, wy, wx, summon_specific);
100 * @brief ウィザードモード用処理としてターゲット中の相手をテレポートバックする / Hack -- Teleport to the target
103 void do_cmd_wiz_bamf(player_type *caster_ptr)
108 teleport_player_to(caster_ptr, target_row, target_col, TELEPORT_NONMAGICAL);
112 * @brief 青魔導師の魔法を全て習得済みにする /
113 * debug command for blue mage
116 void do_cmd_wiz_blue_mage(player_type *caster_ptr)
118 BIT_FLAGS f4 = 0L, f5 = 0L, f6 = 0L;
119 for (int j = 1; j < A_MAX; j++) {
120 set_rf_masks(&f4, &f5, &f6, j);
123 for (i = 0; i < 32; i++) {
124 if ((0x00000001 << i) & f4)
125 caster_ptr->magic_num2[i] = 1;
128 for (; i < 64; i++) {
129 if ((0x00000001 << (i - 32)) & f5)
130 caster_ptr->magic_num2[i] = 1;
133 for (; i < 96; i++) {
134 if ((0x00000001 << (i - 64)) & f6)
135 caster_ptr->magic_num2[i] = 1;
141 * @brief 現在のフロアに合ったモンスターをランダムに召喚する /
142 * Summon some creatures
143 * @param caster_ptr プレーヤーへの参照ポインタ
147 void do_cmd_wiz_summon(player_type *caster_ptr, int num)
149 for (int i = 0; i < num; i++) {
150 (void)summon_specific(caster_ptr, 0, caster_ptr->y, caster_ptr->x, caster_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
155 * @brief モンスターを種族IDを指定して敵対的に召喚する /
156 * Summon a creature of the specified type
157 * @param r_idx モンスター種族ID
160 * This function is rather dangerous
162 void do_cmd_wiz_named(player_type *summoner_ptr, MONRACE_IDX r_idx)
164 (void)summon_named_creature(summoner_ptr, 0, summoner_ptr->y, summoner_ptr->x, r_idx, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
168 * @brief モンスターを種族IDを指定してペット召喚する /
169 * Summon a creature of the specified type
170 * @param r_idx モンスター種族ID
173 * This function is rather dangerous
175 void do_cmd_wiz_named_friendly(player_type *summoner_ptr, MONRACE_IDX r_idx)
177 (void)summon_named_creature(summoner_ptr, 0, summoner_ptr->y, summoner_ptr->x, r_idx, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP | PM_FORCE_PET));