From 57fb032e58ac8a2d5c4c1a97b6399c127d630d37 Mon Sep 17 00:00:00 2001 From: deskull Date: Wed, 16 Oct 2019 20:12:34 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20build=5Ftype7(),=20build?= =?utf8?q?=5Ftype8(),=20build=5Ftype17()=20=E3=81=AB=20floor=5Ftype=20*=20?= =?utf8?q?=E5=BC=95=E6=95=B0=E3=82=92=E8=BF=BD=E5=8A=A0=EF=BC=8E=20/=20Add?= =?utf8?q?=20floor=5Ftype=20*=20argument=20to=20build=5Ftype7(),=20build?= =?utf8?q?=5Ftype8()=20and=20build=5Ftype17().?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/rooms-vault.c | 18 +++++++++--------- src/rooms-vault.h | 6 +++--- src/rooms.c | 6 +++--- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/rooms-vault.c b/src/rooms-vault.c index 36ec04cff..ad2d49105 100644 --- a/src/rooms-vault.c +++ b/src/rooms-vault.c @@ -638,7 +638,7 @@ static void build_vault(floor_type *floor_ptr, POSITION yval, POSITION xval, POS * @brief タイプ7の部屋…v_info.txtより小型vaultを生成する / Type 7 -- simple vaults (see "v_info.txt") * @return なし */ -bool build_type7(void) +bool build_type7(floor_type *floor_ptr) { vault_type *v_ptr = NULL; int dummy; @@ -672,7 +672,7 @@ bool build_type7(void) y = v_ptr->hgt; /* Some huge vault cannot be ratated to fit in the dungeon */ - if (x + 2 > p_ptr->current_floor_ptr->height - 2) + if (x + 2 > floor_ptr->height - 2) { /* Forbid 90 or 270 degree ratation */ transno &= ~1; @@ -708,7 +708,7 @@ bool build_type7(void) msg_format_wizard(CHEAT_DUNGEON, _("小型Vault(%s)を生成しました。", "Lesser vault (%s)."), v_name + v_ptr->name); /* Hack -- Build the vault */ - build_vault(p_ptr->current_floor_ptr, yval, xval, v_ptr->hgt, v_ptr->wid, + build_vault(floor_ptr, yval, xval, v_ptr->hgt, v_ptr->wid, v_text + v_ptr->text, xoffset, yoffset, transno); return TRUE; @@ -718,7 +718,7 @@ bool build_type7(void) * @brief タイプ8の部屋…v_info.txtより大型vaultを生成する / Type 8 -- greater vaults (see "v_info.txt") * @return なし */ -bool build_type8(void) +bool build_type8(floor_type *floor_ptr) { vault_type *v_ptr; int dummy; @@ -752,7 +752,7 @@ bool build_type8(void) y = v_ptr->hgt; /* Some huge vault cannot be ratated to fit in the dungeon */ - if (x + 2 > p_ptr->current_floor_ptr->height - 2) + if (x + 2 > floor_ptr->height - 2) { /* Forbid 90 or 270 degree ratation */ transno &= ~1; @@ -794,7 +794,7 @@ bool build_type8(void) msg_format_wizard(CHEAT_DUNGEON, _("大型固定Vault(%s)を生成しました。", "Greater vault (%s)."), v_name + v_ptr->name); /* Hack -- Build the vault */ - build_vault(p_ptr->current_floor_ptr, yval, xval, v_ptr->hgt, v_ptr->wid, + build_vault(floor_ptr, yval, xval, v_ptr->hgt, v_ptr->wid, v_text + v_ptr->text, xoffset, yoffset, transno); return TRUE; @@ -1238,7 +1238,7 @@ bool build_type10(void) * @brief タイプ17の部屋…v_info.txtより固定特殊部屋を生成する / Type 17 -- fixed special room (see "v_info.txt") * @return なし */ -bool build_type17(void) +bool build_type17(floor_type *floor_ptr) { vault_type *v_ptr = NULL; int dummy; @@ -1272,7 +1272,7 @@ bool build_type17(void) y = v_ptr->hgt; /* Some huge vault cannot be ratated to fit in the dungeon */ - if (x + 2 > p_ptr->current_floor_ptr->height - 2) + if (x + 2 > floor_ptr->height - 2) { /* Forbid 90 or 270 degree ratation */ transno &= ~1; @@ -1308,7 +1308,7 @@ bool build_type17(void) msg_format_wizard(CHEAT_DUNGEON, _("特殊固定部屋(%s)を生成しました。", "Special Fix room (%s)."), v_name + v_ptr->name); /* Hack -- Build the vault */ - build_vault(p_ptr->current_floor_ptr, yval, xval, v_ptr->hgt, v_ptr->wid, + build_vault(floor_ptr, yval, xval, v_ptr->hgt, v_ptr->wid, v_text + v_ptr->text, xoffset, yoffset, transno); return TRUE; diff --git a/src/rooms-vault.h b/src/rooms-vault.h index ef42056fd..430f16762 100644 --- a/src/rooms-vault.h +++ b/src/rooms-vault.h @@ -23,8 +23,8 @@ extern char *v_text; extern VAULT_IDX max_v_idx; -extern bool build_type7(void); -extern bool build_type8(void); +extern bool build_type7(floor_type *floor_ptr); +extern bool build_type8(floor_type *floor_ptr); extern bool build_type10(void); -extern bool build_type17(void); +extern bool build_type17(floor_type *floor_ptr); diff --git a/src/rooms.c b/src/rooms.c index 4b36ab752..d321f2784 100644 --- a/src/rooms.c +++ b/src/rooms.c @@ -2092,8 +2092,8 @@ static bool room_build(EFFECT_ID typ) case ROOM_T_INNER_FEAT: return build_type4(p_ptr->current_floor_ptr); case ROOM_T_NEST: return build_type5(p_ptr->current_floor_ptr); case ROOM_T_PIT: return build_type6(p_ptr->current_floor_ptr); - case ROOM_T_LESSER_VAULT: return build_type7(); - case ROOM_T_GREATER_VAULT: return build_type8(); + case ROOM_T_LESSER_VAULT: return build_type7(p_ptr->current_floor_ptr); + case ROOM_T_GREATER_VAULT: return build_type8(p_ptr->current_floor_ptr); case ROOM_T_FRACAVE: return build_type9(); case ROOM_T_RANDOM_VAULT: return build_type10(); case ROOM_T_OVAL: return build_type11(p_ptr->current_floor_ptr); @@ -2102,7 +2102,7 @@ static bool room_build(EFFECT_ID typ) case ROOM_T_TRAP: return build_type14(); case ROOM_T_GLASS: return build_type15(); case ROOM_T_ARCADE: return build_type16(); - case ROOM_T_FIXED: return build_type17(); + case ROOM_T_FIXED: return build_type17(p_ptr->current_floor_ptr); } return FALSE; } -- 2.11.0