#include "term.h"
#include "dungeon.h"
-#include "cmd-dump.h"
+#include "io/write-diary.h"
+#include "cmd/cmd-draw.h"
+#include "cmd/cmd-dump.h"
+#include "cmd/cmd-help.h"
+#include "cmd/cmd-save.h"
#include "util.h"
#include "birth.h"
#include "selfinfo.h"
#include "dungeon-file.h"
#include "files.h"
#include "monster-spell.h"
-#include "bldg.h"
+#include "market/building.h"
#include "objectkind.h"
#include "targeting.h"
#include "view-mainwindow.h"
extern void do_cmd_debug(player_type *creature_ptr);
-#ifdef ALLOW_WIZARD
-/*
-typedef struct debug_spell_commands1
-{
- int type;
- char *command;
- bool(*spell_function_type1)(player_type *);
-} debug_spell_commands1;
-
-typedef struct debug_spell_commands2
-{
- int type;
- char *command;
- bool(*spell_function_type2)(player_type *, floor_type *);
-} debug_spell_commands2;
-
-typedef struct debug_spell_commands3
-{
- int type;
- char *command;
- bool(*spell_function_type3)(player_type *, HIT_POINT);
-} debug_spell_commands3;
-
-typedef union debug_spell_commands {
- debug_spell_commands1 command1;
- debug_spell_commands2 command2;
- debug_spell_commands3 command3;
-} debug_spell_commands;
-
-debug_spell_commands debug_spell_commands_list[] =
-{
- .command3 = {3, "true healing", true_healing}
-};
-*/
-
typedef union spell_functions {
struct debug_spell_type1 { bool(*spell_function)(player_type *, floor_type *); } spell1;
struct debug_spell_type2 { bool(*spell_function)(player_type *); } spell2;
spell_functions command_function;
} debug_spell_command;
-#define SPELL_MAX 2
+#define SPELL_MAX 3
debug_spell_command debug_spell_commands_list[SPELL_MAX] =
{
- { 2, "vanish dungeon", {.spell2 = vanish_dungeon} },
- { 3, "true healing", {.spell3 = true_healing} }
+ { 2, "vanish dungeon", {.spell2 = { vanish_dungeon } } },
+ { 3, "true healing", {.spell3 = { true_healing } } },
+ { 2, "drop weapons", {.spell2 = { drop_weapons } } }
};
/*!
char tmp_val[50] = "\0";
int tmp_int;
- if (!get_string("SPELL:", tmp_val, 32)) return FALSE;
+ if (!get_string("SPELL: ", tmp_val, 32)) return FALSE;
for (int i = 0; i < SPELL_MAX; i++)
{
{
case 2:
(*(debug_spell_commands_list[i].command_function.spell2.spell_function))(creature_ptr);
+ return TRUE;
break;
case 3:
tmp_val[0] = '\0';
if (!get_string("POWER:", tmp_val, 32)) return FALSE;
tmp_int = atoi(tmp_val);
(*(debug_spell_commands_list[i].command_function.spell3.spell_function))(creature_ptr, tmp_int);
+ return TRUE;
break;
default:
break;
}
}
+ msg_format("Command not found.");
+
return FALSE;
}
POSITION x = 0, y = 0;
if (!tgt_pt(caster_ptr, &x, &y)) return FALSE;
teleport_player_to(caster_ptr, y, x, TELEPORT_NONMAGICAL);
- return (TRUE);
+ return TRUE;
}
/*!
if (a_idx < 0) a_idx = 0;
if (a_idx >= max_a_idx) a_idx = 0;
- (void)create_named_art(a_idx, caster_ptr->y, caster_ptr->x);
+ (void)create_named_art(caster_ptr, a_idx, caster_ptr->y, caster_ptr->x);
/* All done */
msg_print("Allocated.");
while (--attempts)
{
- scatter(caster_ptr->current_floor_ptr, &wy, &wx, caster_ptr->y, caster_ptr->x, 3, 0);
- if (cave_empty_bold(caster_ptr->current_floor_ptr, wy, wx)) break;
+ scatter(caster_ptr, &wy, &wx, caster_ptr->y, caster_ptr->x, 3, 0);
+ if (is_cave_empty_bold(caster_ptr, wy, wx)) break;
}
- (void)alloc_horde(wy, wx);
+ (void)alloc_horde(caster_ptr, wy, wx);
}
/*!
if (tmp_int < 0 || tmp_int >= MAX_CLASS) return;
/* Save it */
- creature_ptr->pclass = (byte_hack)tmp_int;
+ creature_ptr->pclass = (byte)tmp_int;
/* Redraw inscription */
creature_ptr->window |= (PW_PLAYER);
/* {.} and {$} effect creature_ptr->warning and TRC_TELEPORT_SELF */
creature_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
- handle_stuff();
+ handle_stuff(creature_ptr);
}
/*!
* @brief アイテムの詳細ステータスを表示する /
* Change various "permanent" player variables.
+ * @param player_ptr プレーヤーへの参照ポインタ
* @param o_ptr 詳細を表示するアイテム情報の参照ポインタ
* @return なし
* @details
* Originally by David Reeve Sward <sward+@CMU.EDU>
* Verbose item flags by -Bernd-
*/
-static void wiz_display_item(object_type *o_ptr)
+static void wiz_display_item(player_type *player_ptr, object_type *o_ptr)
{
BIT_FLAGS flgs[TR_FLAG_SIZE];
object_flags(o_ptr, flgs);
/* Describe fully */
char buf[256];
- object_desc(buf, o_ptr, OD_STORE);
+ object_desc(player_ptr, buf, o_ptr, OD_STORE);
prt(buf, 2, j);
max_num = num;
/* Choose! */
- if (!get_com("Get what type of object? ", &ch, FALSE)) return (0);
+ if (!get_com("Get what type of object? ", &ch, FALSE)) return 0;
/* Analyze choice */
for (num = 0; num < max_num; num++)
}
/* Bail out if choice is illegal */
- if ((num < 0) || (num >= max_num)) return (0);
+ if ((num < 0) || (num >= max_num)) return 0;
/* Base object type chosen, fill in tval */
tval = tvals[num].tval;
max_num = num;
/* Choose! */
- if (!get_com(format("What Kind of %s? ", tval_desc), &ch, FALSE)) return (0);
+ if (!get_com(format("What Kind of %s? ", tval_desc), &ch, FALSE)) return 0;
/* Analyze choice */
for (num = 0; num < max_num; num++)
}
/* Bail out if choice is "illegal" */
- if ((num < 0) || (num >= max_num)) return (0);
+ if ((num < 0) || (num >= max_num)) return 0;
/* And return successful */
return (choice[num]);
/*!
* @briefアイテムの基礎能力値を調整する / Tweak an item
+ * @param player_ptr プレーヤーへの参照ポインタ
* @param o_ptr 調整するアイテムの参照ポインタ
* @return なし
*/
-static void wiz_tweak_item(object_type *o_ptr)
+static void wiz_tweak_item(player_type *player_ptr, object_type *o_ptr)
{
if (object_is_artifact(o_ptr)) return;
sprintf(tmp_val, "%d", o_ptr->pval);
if (!get_string(p, tmp_val, 5)) return;
o_ptr->pval = (s16b)atoi(tmp_val);
- wiz_display_item(o_ptr);
+ wiz_display_item(player_ptr, o_ptr);
p = "Enter new 'to_a' setting: ";
sprintf(tmp_val, "%d", o_ptr->to_a);
if (!get_string(p, tmp_val, 5)) return;
o_ptr->to_a = (s16b)atoi(tmp_val);
- wiz_display_item(o_ptr);
+ wiz_display_item(player_ptr, o_ptr);
p = "Enter new 'to_h' setting: ";
sprintf(tmp_val, "%d", o_ptr->to_h);
if (!get_string(p, tmp_val, 5)) return;
o_ptr->to_h = (s16b)atoi(tmp_val);
- wiz_display_item(o_ptr);
+ wiz_display_item(player_ptr, o_ptr);
p = "Enter new 'to_d' setting: ";
sprintf(tmp_val, "%d", (int)o_ptr->to_d);
if (!get_string(p, tmp_val, 5)) return;
o_ptr->to_d = (s16b)atoi(tmp_val);
- wiz_display_item(o_ptr);
+ wiz_display_item(player_ptr, o_ptr);
}
while (TRUE)
{
/* Display full item debug information */
- wiz_display_item(q_ptr);
+ wiz_display_item(owner_ptr, q_ptr);
/* Ask wizard what to do. */
if (!get_com("[a]ccept, [w]orthless, [c]ursed, [n]ormal, [g]ood, [e]xcellent, [s]pecial? ", &ch, FALSE))
case 'w': case 'W':
{
object_prep(q_ptr, o_ptr->k_idx);
- apply_magic(q_ptr, owner_ptr->current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_GREAT | AM_CURSED);
+ apply_magic(owner_ptr, q_ptr, owner_ptr->current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_GREAT | AM_CURSED);
break;
}
/* Apply bad magic, but first clear object */
case 'c': case 'C':
{
object_prep(q_ptr, o_ptr->k_idx);
- apply_magic(q_ptr, owner_ptr->current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_CURSED);
+ apply_magic(owner_ptr, q_ptr, owner_ptr->current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_CURSED);
break;
}
/* Apply normal magic, but first clear object */
case 'n': case 'N':
{
object_prep(q_ptr, o_ptr->k_idx);
- apply_magic(q_ptr, owner_ptr->current_floor_ptr->dun_level, AM_NO_FIXED_ART);
+ apply_magic(owner_ptr, q_ptr, owner_ptr->current_floor_ptr->dun_level, AM_NO_FIXED_ART);
break;
}
/* Apply good magic, but first clear object */
case 'g': case 'G':
{
object_prep(q_ptr, o_ptr->k_idx);
- apply_magic(q_ptr, owner_ptr->current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD);
+ apply_magic(owner_ptr, q_ptr, owner_ptr->current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD);
break;
}
/* Apply great magic, but first clear object */
case 'e': case 'E':
{
object_prep(q_ptr, o_ptr->k_idx);
- apply_magic(q_ptr, owner_ptr->current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_GREAT);
+ apply_magic(owner_ptr, q_ptr, owner_ptr->current_floor_ptr->dun_level, AM_NO_FIXED_ART | AM_GOOD | AM_GREAT);
break;
}
/* Apply special magic, but first clear object */
case 's': case 'S':
{
object_prep(q_ptr, o_ptr->k_idx);
- apply_magic(q_ptr, owner_ptr->current_floor_ptr->dun_level, AM_GOOD | AM_GREAT | AM_SPECIAL);
+ apply_magic(owner_ptr, q_ptr, owner_ptr->current_floor_ptr->dun_level, AM_GOOD | AM_GREAT | AM_SPECIAL);
/* Failed to create artifact; make a random one */
- if (!object_is_artifact(q_ptr)) become_random_artifact(q_ptr, FALSE);
+ if (!object_is_artifact(q_ptr)) become_random_artifact(owner_ptr, q_ptr, FALSE);
break;
}
}
concptr pmt = "Roll for [n]ormal, [g]ood, or [e]xcellent treasure? ";
/* Display item */
- wiz_display_item(o_ptr);
+ wiz_display_item(caster_ptr, o_ptr);
/* Get choices */
if (!get_com(pmt, &ch, FALSE)) break;
object_wipe(q_ptr);
/* Create an object */
- make_object(q_ptr, mode);
+ make_object(caster_ptr, q_ptr, mode);
/* Mega-Hack -- allow multiple artifacts */
/*!
* @brief 検査対象のアイテムの数を変更する /
* Change the quantity of a the item
+ * @param caster_ptr プレーヤーへの参照ポインタ
* @param o_ptr 変更するアイテム情報構造体の参照ポインタ
* @return なし
*/
if (tmp_int > 99) tmp_int = 99;
/* Accept modifications */
- o_ptr->number = (byte_hack)tmp_int;
+ o_ptr->number = (byte)tmp_int;
}
if (o_ptr->tval == TV_ROD)
if (!o_ptr) return;
- screen_save();
+ screen_save(creature_ptr);
object_type forge;
object_type *q_ptr;
while (TRUE)
{
/* Display the item */
- wiz_display_item(q_ptr);
+ wiz_display_item(creature_ptr, q_ptr);
/* Get choice */
if (!get_com("[a]ccept [s]tatistics [r]eroll [t]weak [q]uantity? ", &ch, FALSE))
if (ch == 't' || ch == 'T')
{
- wiz_tweak_item(q_ptr);
+ wiz_tweak_item(creature_ptr, q_ptr);
}
if (ch == 'q' || ch == 'Q')
}
}
- screen_load();
-
+ screen_load(creature_ptr);
/* Accept change */
if (changed)
*/
static void wiz_create_item(player_type *caster_ptr)
{
- screen_save();
+ screen_save(caster_ptr);
/* Get object base type */
OBJECT_IDX k_idx = wiz_create_itemtype();
- screen_load();
+ screen_load(caster_ptr);
/* Return if failed */
if (!k_idx) return;
if (a_info[i].sval != k_info[k_idx].sval) continue;
/* Create this artifact */
- (void)create_named_art(i, caster_ptr->y, caster_ptr->x);
+ (void)create_named_art(caster_ptr, i, caster_ptr->y, caster_ptr->x);
/* All done */
msg_print("Allocated(INSTA_ART).");
q_ptr = &forge;
object_prep(q_ptr, k_idx);
- apply_magic(q_ptr, caster_ptr->current_floor_ptr->dun_level, AM_NO_FIXED_ART);
+ apply_magic(caster_ptr, q_ptr, caster_ptr->current_floor_ptr->dun_level, AM_NO_FIXED_ART);
/* Drop the object from heaven */
- (void)drop_near(q_ptr, -1, caster_ptr->y, caster_ptr->x);
+ (void)drop_near(caster_ptr, q_ptr, -1, caster_ptr->y, caster_ptr->x);
/* All done */
msg_print("Allocated.");
leave_quest_check(creature_ptr);
- if (record_stair) exe_write_diary(creature_ptr, NIKKI_WIZ_TELE, 0, NULL);
+ if (record_stair) exe_write_diary(creature_ptr, DIARY_WIZ_TELE, 0, NULL);
creature_ptr->current_floor_ptr->inside_quest = 0;
free_turn(creature_ptr);
/*!
* @brief 全ベースアイテムを鑑定済みにする /
* Become aware of a lot of objects
+ * @param caster_ptr プレーヤーへの参照ポインタ
* @return なし
*/
-static void do_cmd_wiz_learn(void)
+static void do_cmd_wiz_learn(player_type *caster_ptr)
{
/* Scan every object */
object_type forge;
{
q_ptr = &forge;
object_prep(q_ptr, i);
- object_aware(q_ptr);
+ object_aware(caster_ptr, q_ptr);
}
}
}
/*!
* @brief 現在のフロアに合ったモンスターをランダムに召喚する /
* Summon some creatures
+ * @param caster_ptr プレーヤーへの参照ポインタ
* @param num 生成処理回数
* @return なし
*/
{
for (int i = 0; i < num; i++)
{
- (void)summon_specific(0, caster_ptr->y, caster_ptr->x, caster_ptr->current_floor_ptr->dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
+ (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));
}
}
*/
static void do_cmd_wiz_named(player_type *summoner_ptr, MONRACE_IDX r_idx)
{
- (void)summon_named_creature(0, summoner_ptr->y, summoner_ptr->x, r_idx, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
+ (void)summon_named_creature(summoner_ptr, 0, summoner_ptr->y, summoner_ptr->x, r_idx, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP));
}
*/
static void do_cmd_wiz_named_friendly(player_type *summoner_ptr, MONRACE_IDX r_idx)
{
- (void)summon_named_creature(0, summoner_ptr->y, summoner_ptr->x, r_idx, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP | PM_FORCE_PET));
+ (void)summon_named_creature(summoner_ptr, 0, summoner_ptr->y, summoner_ptr->x, r_idx, (PM_ALLOW_SLEEP | PM_ALLOW_GROUP | PM_FORCE_PET));
}
{
GAME_TEXT m_name[MAX_NLEN];
- monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
- exe_write_diary(caster_ptr, NIKKI_NAMED_PET, RECORD_NAMED_PET_WIZ_ZAP, m_name);
+ monster_desc(caster_ptr, m_name, m_ptr, MD_INDEF_VISIBLE);
+ exe_write_diary(caster_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_WIZ_ZAP, m_name);
}
- delete_monster_idx(i);
+ delete_monster_idx(caster_ptr, i);
}
}
{
GAME_TEXT m_name[MAX_NLEN];
- monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
- exe_write_diary(caster_ptr, NIKKI_NAMED_PET, RECORD_NAMED_PET_WIZ_ZAP, m_name);
+ monster_desc(caster_ptr, m_name, m_ptr, MD_INDEF_VISIBLE);
+ exe_write_diary(caster_ptr, DIARY_NAMED_PET, RECORD_NAMED_PET_WIZ_ZAP, m_name);
}
/* Delete this monster */
- delete_monster_idx(i);
+ delete_monster_idx(caster_ptr, i);
}
}
if (tmp_mimic < 0) tmp_mimic = 0;
else if (tmp_mimic >= max_f_idx) tmp_mimic = max_f_idx - 1;
- cave_set_feat(creature_ptr->current_floor_ptr, y, x, tmp_feat);
+ cave_set_feat(creature_ptr, y, x, tmp_feat);
g_ptr->mimic = (s16b)tmp_mimic;
feature_type *f_ptr;
else if (have_flag(f_ptr->flags, FF_MIRROR))
g_ptr->info |= (CAVE_GLOW | CAVE_OBJECT);
- note_spot(y, x);
- lite_spot(y, x);
+ note_spot(creature_ptr, y, x);
+ lite_spot(creature_ptr, y, x);
creature_ptr->update |= (PU_FLOW);
prev_feat = tmp_feat;
/*!
* @brief 現在のオプション設定をダンプ出力する /
+ * @param creature_ptr プレーヤーへの参照ポインタ
* Hack -- Dump option bits usage
* @return なし
*/
-static void do_cmd_dump_options(void)
+static void do_cmd_dump_options()
{
char buf[1024];
path_build(buf, sizeof buf, ANGBAND_DIR_USER, "opt_info.txt");
case '\r':
break;
-#ifdef ALLOW_SPOILERS
/* Hack -- Generate Spoilers */
case '"':
- do_cmd_spoilers();
+ do_cmd_spoilers(creature_ptr);
break;
-#endif /* ALLOW_SPOILERS */
/* Hack -- Help */
case '?':
- do_cmd_help();
+ do_cmd_help(creature_ptr);
break;
/* Cure all maladies */
break;
case 'B':
- update_gambling_monsters();
+ update_gambling_monsters(creature_ptr);
break;
/* Create any object */
/* Good Objects */
case 'g':
if (command_arg <= 0) command_arg = 1;
- acquirement(creature_ptr->y, creature_ptr->x, command_arg, FALSE, FALSE, TRUE);
+ acquirement(creature_ptr, creature_ptr->y, creature_ptr->x, command_arg, FALSE, FALSE, TRUE);
break;
/* Hitpoint rerating */
/* Learn about objects */
case 'l':
- do_cmd_wiz_learn();
+ do_cmd_wiz_learn(creature_ptr);
break;
/* Magic Mapping */
if (tmp_int >= max_q_idx) break;
creature_ptr->current_floor_ptr->inside_quest = (QUEST_IDX)tmp_int;
- process_dungeon_file("q_info.txt", 0, 0, 0, 0);
+ process_dungeon_file(creature_ptr, "q_info.txt", 0, 0, 0, 0);
quest[tmp_int].status = QUEST_STATUS_TAKEN;
creature_ptr->current_floor_ptr->inside_quest = 0;
}
{
if (quest[creature_ptr->current_floor_ptr->inside_quest].status == QUEST_STATUS_TAKEN)
{
- complete_quest(creature_ptr->current_floor_ptr->inside_quest);
+ complete_quest(creature_ptr, creature_ptr->current_floor_ptr->inside_quest);
break;
}
}
/* Special(Random Artifact) Objects */
case 'S':
if (command_arg <= 0) command_arg = 1;
- acquirement(creature_ptr->y, creature_ptr->x, command_arg, TRUE, TRUE, TRUE);
+ acquirement(creature_ptr, creature_ptr->y, creature_ptr->x, command_arg, TRUE, TRUE, TRUE);
break;
/* Teleport */
/* Very Good Objects */
case 'v':
if (command_arg <= 0) command_arg = 1;
- acquirement(creature_ptr->y, creature_ptr->x, command_arg, TRUE, FALSE, TRUE);
+ acquirement(creature_ptr, creature_ptr->y, creature_ptr->x, command_arg, TRUE, FALSE, TRUE);
break;
/* Wizard Light the Level */
INVENTORY_IDX i;
for (i = INVEN_TOTAL - 1; i >= 0; i--)
{
- if (creature_ptr->inventory_list[i].k_idx) inven_drop(i, 999);
+ if (creature_ptr->inventory_list[i].k_idx) drop_from_inventory(creature_ptr, i, 999);
}
player_outfit(creature_ptr);
break;
break;
}
}
-
-#else
-
-#ifdef MACINTOSH
-static int i = 0;
-#endif
-
-#endif