From 533633cf9f1ba7b4f2126460ed8702d610998f8c Mon Sep 17 00:00:00 2001 From: iks Date: Sun, 4 Apr 2021 17:26:25 +0900 Subject: [PATCH] =?utf8?q?[Fix]=20=E3=83=87=E3=83=90=E3=82=B0=E3=82=B3?= =?utf8?q?=E3=83=9E=E3=83=B3=E3=83=89=E3=81=AE=E6=95=B0=E5=AD=97=E3=81=AE?= =?utf8?q?=E5=85=A5=E5=8A=9B=E3=81=AB=E9=96=A2=E3=81=99=E3=82=8B=E4=BF=AE?= =?utf8?q?=E6=AD=A3=20/=20[Feature]=20=E9=A0=98=E5=9F=9F=E5=A4=89=E6=9B=B4?= =?utf8?q?=E3=81=AE=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/wizard/cmd-wizard.cpp | 2 +- src/wizard/wizard-player-modifier.cpp | 4 +++ src/wizard/wizard-special-process.cpp | 53 +++++++++++++++++++++++++++++------ src/wizard/wizard-special-process.h | 3 +- 4 files changed, 52 insertions(+), 10 deletions(-) diff --git a/src/wizard/cmd-wizard.cpp b/src/wizard/cmd-wizard.cpp index 84cd41da1..c687214e9 100644 --- a/src/wizard/cmd-wizard.cpp +++ b/src/wizard/cmd-wizard.cpp @@ -140,7 +140,7 @@ bool exe_cmd_debug(player_type *creature_ptr, char cmd) wiz_create_item(creature_ptr); break; case 'C': - wiz_create_named_art(creature_ptr); + wiz_create_named_art(creature_ptr, command_arg); break; case 'd': detect_all(creature_ptr, DETECT_RAD_ALL * 3); diff --git a/src/wizard/wizard-player-modifier.cpp b/src/wizard/wizard-player-modifier.cpp index 2adce1e76..3bb188917 100644 --- a/src/wizard/wizard-player-modifier.cpp +++ b/src/wizard/wizard-player-modifier.cpp @@ -23,6 +23,7 @@ std::vector> wizard_player_modifier_menu_table = { { "r", _("種族変更", "Change race") }, { "c", _("職業変更", "Change class") }, + { "R", _("領域変更", "Change realms") }, { "e", _("能力変更", "Change status") }, { "k", _("自己分析", "Self knowledge") }, { "l", _("ライフレート変更", "Set new life rate") }, @@ -90,6 +91,9 @@ void wizard_player_modifier(player_type *creature_ptr) case 'r': wiz_reset_race(creature_ptr); break; + case 'R': + wiz_reset_realms(creature_ptr); + break; default: msg_print("That is not a valid debug command."); break; diff --git a/src/wizard/wizard-special-process.cpp b/src/wizard/wizard-special-process.cpp index a300302fe..cfc7a5970 100644 --- a/src/wizard/wizard-special-process.cpp +++ b/src/wizard/wizard-special-process.cpp @@ -212,15 +212,22 @@ void wiz_create_item(player_type *caster_ptr) * @param caster_ptr プレーヤーへの参照ポインタ * @return なし */ -void wiz_create_named_art(player_type *caster_ptr) +void wiz_create_named_art(player_type *caster_ptr, ARTIFACT_IDX a_idx) { - char tmp_val[10] = ""; - if (!get_string("Artifact ID:", tmp_val, 3)) - return; + if (a_idx <= 0) { + char tmp[80] = ""; + sprintf(tmp, "Artifact ID (1-%d): ", max_a_idx - 1); + char tmp_val[10] = ""; + if (!get_string(tmp, tmp_val, 3)) + return; + + a_idx = (ARTIFACT_IDX)atoi(tmp_val); + } - ARTIFACT_IDX a_idx = (ARTIFACT_IDX)atoi(tmp_val); - if ((a_idx < 0) || (a_idx >= max_a_idx)) - a_idx = 0; + if (a_idx <= 0 || a_idx >= max_a_idx) { + msg_format(_("番号は1から%dの間で指定して下さい。", "ID must be between 1 to %d."), max_a_idx - 1); + return; + } (void)create_named_art(caster_ptr, a_idx, caster_ptr->y, caster_ptr->x); msg_print("Allocated."); @@ -466,7 +473,7 @@ void wiz_reset_race(player_type *creature_ptr) creature_ptr->window_flags |= PW_PLAYER; creature_ptr->update |= PU_BONUS | PU_HP | PU_MANA | PU_SPELLS; - creature_ptr->redraw |= PR_BASIC; + creature_ptr->redraw |= PR_BASIC | PR_HP | PR_MANA | PR_STATS; handle_stuff(creature_ptr); } @@ -492,6 +499,36 @@ void wiz_reset_class(player_type *creature_ptr) creature_ptr->pclass = static_cast(tmp_int); cp_ptr = &class_info[creature_ptr->pclass]; + mp_ptr = &m_info[creature_ptr->pclass]; + creature_ptr->window_flags |= PW_PLAYER; + creature_ptr->update |= PU_BONUS | PU_HP | PU_MANA | PU_SPELLS; + creature_ptr->redraw |= PR_BASIC | PR_HP | PR_MANA | PR_STATS; + handle_stuff(creature_ptr); +} + +/*! + * @brief プレイヤーの領域を変更する + * @return なし + * @todo 存在有無などは未判定。そのうちすべき。 + */ +void wiz_reset_realms(player_type *creature_ptr) +{ + char ppp[80]; + char tmp_val[160]; + + sprintf(ppp, "1st Realm (None=0, 1-%d): ", MAX_REALM - 1); + sprintf(tmp_val, "%d", creature_ptr->realm1); + if (!get_string(ppp, tmp_val, 2)) + return; + + creature_ptr->realm1 = static_cast(atoi(tmp_val)); + + sprintf(ppp, "2st Realm (None=0, 1-%d): ", MAX_REALM - 1); + sprintf(tmp_val, "%d", creature_ptr->realm2); + if (!get_string(ppp, tmp_val, 2)) + return; + + creature_ptr->realm2 = static_cast(atoi(tmp_val)); creature_ptr->window_flags |= PW_PLAYER; creature_ptr->update |= PU_BONUS | PU_HP | PU_MANA | PU_SPELLS; creature_ptr->redraw |= PR_BASIC; diff --git a/src/wizard/wizard-special-process.h b/src/wizard/wizard-special-process.h index 706a7227b..5b26d0efc 100644 --- a/src/wizard/wizard-special-process.h +++ b/src/wizard/wizard-special-process.h @@ -5,13 +5,14 @@ void wiz_cure_all(player_type *creature_ptr); KIND_OBJECT_IDX wiz_create_itemtype(void); void wiz_create_item(player_type *caster_ptr); -void wiz_create_named_art(player_type *caster_ptr); +void wiz_create_named_art(player_type *caster_ptr, ARTIFACT_IDX a_idx); void wiz_change_status(player_type *creature_ptr); void wiz_create_feature(player_type *creature_ptr); void wiz_jump_to_dungeon(player_type *creature_ptr); void wiz_learn_items_all(player_type *caster_ptr); void wiz_reset_race(player_type *creature_ptr); void wiz_reset_class(player_type *creature_ptr); +void wiz_reset_realms(player_type *creature_ptr); void wiz_dump_options(void); void set_gametime(void); void wiz_zap_surrounding_monsters(player_type *caster_ptr); -- 2.11.0