From 711b1d6a37c1f40e3aad10d5773483dee4961eb4 Mon Sep 17 00:00:00 2001 From: nothere Date: Tue, 16 Sep 2003 07:07:23 +0000 Subject: [PATCH] =?utf8?q?=E4=BE=8B=E3=81=88=E3=81=B0,=20=E3=83=88?= =?utf8?q?=E3=83=A9=E3=83=83=E3=83=97pit=E3=81=AE=E3=82=BF=E3=82=A4?= =?utf8?q?=E3=83=97=E3=81=A8=E3=81=97=E3=81=A6=E3=82=B7=E3=83=B3=E3=83=9C?= =?utf8?q?=E3=83=AB(=E5=96=84)(U)=E3=81=A8=E3=81=84=E3=81=A3=E3=81=9F?= =?utf8?q?=E3=82=82=E3=81=AE=E3=81=8C=E6=8C=87=E5=AE=9A=E3=81=95=20?= =?utf8?q?=E3=82=8C=E3=81=9F=E5=A0=B4=E5=90=88,=20=E5=96=84=E8=89=AF?= =?utf8?q?=E3=81=BE=E3=81=9F=E3=81=AF=E4=B8=AD=E7=AB=8B=E3=81=AE=E9=9D=9E?= =?utf8?q?=E3=83=A6=E3=83=8B=E3=83=BC=E3=82=AF=E3=81=AE'U'=E3=81=AF?= =?utf8?q?=E5=AD=98=E5=9C=A8=E3=81=97=E3=81=AA=E3=81=84=E3=81=9F=E3=82=81,?= =?utf8?q?=20=E3=83=A2=E3=83=B3=E3=82=B9=E3=82=BF=E3=83=BC=20=E3=81=AE?= =?utf8?q?=E3=81=84=E3=81=AA=E3=81=84=E3=83=88=E3=83=A9=E3=83=83=E3=83=97p?= =?utf8?q?it=E3=81=8C=E7=94=9F=E6=88=90=E3=81=95=E3=82=8C=E3=81=A6?= =?utf8?q?=E3=81=84=E3=81=9F.=20=E3=81=93=E3=81=AE=E7=8F=BE=E8=B1=A1?= =?utf8?q?=E3=81=AF=E6=99=AE=E9=80=9A=E3=81=AEpit/nest=E3=81=A7=E3=82=82?= =?utf8?q?=E8=B5=B7=E3=81=8D=20=E3=81=A6=E3=81=84=E3=81=9F.=20=E3=81=9D?= =?utf8?q?=E3=81=93=E3=81=A7,=20=E3=83=A2=E3=83=B3=E3=82=B9=E3=82=BF?= =?utf8?q?=E3=83=BC=E3=81=AE=E7=A8=AE=E5=88=A5=E6=B1=BA=E5=AE=9A=E3=82=92?= =?utf8?q?=E9=83=A8=E5=B1=8B=E4=BD=9C=E6=88=90=E3=81=AE=E5=89=8D=E3=81=AB?= =?utf8?q?=E6=8C=81=E3=81=A3=E3=81=A6=E3=81=8F=E3=82=8B=E3=81=93=E3=81=A8?= =?utf8?q?=E3=81=AB=20=E3=82=88=E3=82=8A,=20=E7=A9=BA=E3=81=AEpit/nest?= =?utf8?q?=E3=81=8C=E7=94=9F=E6=88=90=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84?= =?utf8?q?=E3=82=88=E3=81=86=E3=81=AB=E4=BF=AE=E6=AD=A3.=20=E3=81=BE?= =?utf8?q?=E3=81=9F,=20=E3=83=88=E3=83=A9=E3=83=83=E3=83=97pit=E3=81=8C?= =?utf8?q?=E9=89=84=E7=8D=84=E3=81=A7=20=E3=81=97=E3=81=8B=E7=94=9F?= =?utf8?q?=E6=88=90=E3=81=95=E3=82=8C=E3=81=AA=E3=81=84=E6=9D=A1=E4=BB=B6?= =?utf8?q?=E3=81=AE=E3=83=80=E3=83=B3=E3=82=B8=E3=83=A7=E3=83=B3ID?= =?utf8?q?=E3=81=AF=E8=A8=98=E5=8F=B7=E5=AE=9A=E6=95=B0=E3=81=AB=E7=9B=B4?= =?utf8?q?=E3=81=97=E3=81=9F.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/rooms.c | 240 +++++++++++++++++++++++++++++------------------------------- 1 file changed, 115 insertions(+), 125 deletions(-) diff --git a/src/rooms.c b/src/rooms.c index 8353320be..6fd5b9f61 100644 --- a/src/rooms.c +++ b/src/rooms.c @@ -2093,20 +2093,52 @@ static bool build_type5(void) int cur_nest_type = pick_vault_type(nest_types, d_info[dungeon_type].nest); vault_aux_type *n_ptr; - /* Find and reserve some space in the dungeon. Get center of room. */ - if (!find_space(&yval, &xval, 11, 25)) return FALSE; - /* No type available */ - if (cur_nest_type < 0) - { - return FALSE; - } + if (cur_nest_type < 0) return FALSE; n_ptr = &nest_types[cur_nest_type]; /* Process a preparation function if necessary */ if (n_ptr->prep_func) (*(n_ptr->prep_func))(); + /* Prepare allocation table */ + get_mon_num_prep(n_ptr->hook_func, NULL); + + align.sub_align = SUB_ALIGN_NEUTRAL; + + /* Pick some monster types */ + for (i = 0; i < NUM_NEST_MON_TYPE; i++) + { + int r_idx = 0, attempts = 100; + monster_race *r_ptr = NULL; + + while (attempts--) + { + /* Get a (hard) monster type */ + r_idx = get_mon_num(dun_level + 10); + r_ptr = &r_info[r_idx]; + + /* Decline incorrect alignment */ + if (monster_has_hostile_align(&align, 0, 0, r_ptr)) continue; + + /* Accept this monster */ + break; + } + + /* Notice failure */ + if (!r_idx || !attempts) return FALSE; + + /* Note the alignment */ + if (r_ptr->flags3 & RF3_EVIL) align.sub_align |= SUB_ALIGN_EVIL; + if (r_ptr->flags3 & RF3_GOOD) align.sub_align |= SUB_ALIGN_GOOD; + + nest_mon_info[i].r_idx = r_idx; + nest_mon_info[i].used = FALSE; + } + + /* Find and reserve some space in the dungeon. Get center of room. */ + if (!find_space(&yval, &xval, 11, 25)) return FALSE; + /* Large room */ y1 = yval - 4; y2 = yval + 4; @@ -2171,7 +2203,6 @@ static bool build_type5(void) } } - /* Place a secret door */ switch (randint1(4)) { @@ -2181,42 +2212,6 @@ static bool build_type5(void) case 4: place_secret_door(yval, x2 + 1); break; } - - /* Prepare allocation table */ - get_mon_num_prep(n_ptr->hook_func, NULL); - - align.sub_align = SUB_ALIGN_NEUTRAL; - - /* Pick some monster types */ - for (i = 0; i < NUM_NEST_MON_TYPE; i++) - { - int r_idx = 0, attempts = 100; - monster_race *r_ptr = NULL; - - while (attempts--) - { - /* Get a (hard) monster type */ - r_idx = get_mon_num(dun_level + 10); - r_ptr = &r_info[r_idx]; - - /* Decline incorrect alignment */ - if (monster_has_hostile_align(&align, 0, 0, r_ptr)) continue; - - /* Accept this monster */ - break; - } - - /* Notice failure */ - if (!r_idx || !attempts) return FALSE; - - /* Note the alignment */ - if (r_ptr->flags3 & RF3_EVIL) align.sub_align |= SUB_ALIGN_EVIL; - if (r_ptr->flags3 & RF3_GOOD) align.sub_align |= SUB_ALIGN_GOOD; - - nest_mon_info[i].r_idx = r_idx; - nest_mon_info[i].used = FALSE; - } - /* Describe */ if (cheat_room) { @@ -2327,20 +2322,51 @@ static bool build_type6(void) int cur_pit_type = pick_vault_type(pit_types, d_info[dungeon_type].pit); vault_aux_type *n_ptr; - /* Find and reserve some space in the dungeon. Get center of room. */ - if (!find_space(&yval, &xval, 11, 25)) return FALSE; - /* No type available */ - if (cur_pit_type < 0) - { - return FALSE; - } + if (cur_pit_type < 0) return FALSE; n_ptr = &pit_types[cur_pit_type]; /* Process a preparation function if necessary */ if (n_ptr->prep_func) (*(n_ptr->prep_func))(); + /* Prepare allocation table */ + get_mon_num_prep(n_ptr->hook_func, NULL); + + align.sub_align = SUB_ALIGN_NEUTRAL; + + /* Pick some monster types */ + for (i = 0; i < 16; i++) + { + int r_idx = 0, attempts = 100; + monster_race *r_ptr = NULL; + + while (attempts--) + { + /* Get a (hard) monster type */ + r_idx = get_mon_num(dun_level + 10); + r_ptr = &r_info[r_idx]; + + /* Decline incorrect alignment */ + if (monster_has_hostile_align(&align, 0, 0, r_ptr)) continue; + + /* Accept this monster */ + break; + } + + /* Notice failure */ + if (!r_idx || !attempts) return FALSE; + + /* Note the alignment */ + if (r_ptr->flags3 & RF3_EVIL) align.sub_align |= SUB_ALIGN_EVIL; + if (r_ptr->flags3 & RF3_GOOD) align.sub_align |= SUB_ALIGN_GOOD; + + what[i] = r_idx; + } + + /* Find and reserve some space in the dungeon. Get center of room. */ + if (!find_space(&yval, &xval, 11, 25)) return FALSE; + /* Large room */ y1 = yval - 4; y2 = yval + 4; @@ -2412,41 +2438,6 @@ static bool build_type6(void) case 4: place_secret_door(yval, x2 + 1); break; } - - /* Prepare allocation table */ - get_mon_num_prep(n_ptr->hook_func, NULL); - - align.sub_align = SUB_ALIGN_NEUTRAL; - - /* Pick some monster types */ - for (i = 0; i < 16; i++) - { - int r_idx = 0, attempts = 100; - monster_race *r_ptr = NULL; - - while (attempts--) - { - /* Get a (hard) monster type */ - r_idx = get_mon_num(dun_level + 10); - r_ptr = &r_info[r_idx]; - - /* Decline incorrect alignment */ - if (monster_has_hostile_align(&align, 0, 0, r_ptr)) continue; - - /* Accept this monster */ - break; - } - - /* Notice failure */ - if (!r_idx || !attempts) return FALSE; - - /* Note the alignment */ - if (r_ptr->flags3 & RF3_EVIL) align.sub_align |= SUB_ALIGN_EVIL; - if (r_ptr->flags3 & RF3_GOOD) align.sub_align |= SUB_ALIGN_GOOD; - - what[i] = r_idx; - } - /* Sort the entries */ for (i = 0; i < 16 - 1; i++) { @@ -5618,10 +5609,7 @@ static bool build_type13(void) vault_aux_type *n_ptr; /* Only in Angband */ - if (dungeon_type != 1) return FALSE; - - /* Find and reserve some space in the dungeon. Get center of room. */ - if (!find_space(&yval, &xval, 13, 25)) return FALSE; + if (dungeon_type != DUNGEON_ANGBAND) return FALSE; /* No type available */ if (cur_pit_type < 0) return FALSE; @@ -5631,6 +5619,43 @@ static bool build_type13(void) /* Process a preparation function if necessary */ if (n_ptr->prep_func) (*(n_ptr->prep_func))(); + /* Prepare allocation table */ + get_mon_num_prep(n_ptr->hook_func, vault_aux_trapped_pit); + + align.sub_align = SUB_ALIGN_NEUTRAL; + + /* Pick some monster types */ + for (i = 0; i < 16; i++) + { + int r_idx = 0, attempts = 100; + monster_race *r_ptr = NULL; + + while (attempts--) + { + /* Get a (hard) monster type */ + r_idx = get_mon_num(dun_level + 0); + r_ptr = &r_info[r_idx]; + + /* Decline incorrect alignment */ + if (monster_has_hostile_align(&align, 0, 0, r_ptr)) continue; + + /* Accept this monster */ + break; + } + + /* Notice failure */ + if (!r_idx || !attempts) return FALSE; + + /* Note the alignment */ + if (r_ptr->flags3 & RF3_EVIL) align.sub_align |= SUB_ALIGN_EVIL; + if (r_ptr->flags3 & RF3_GOOD) align.sub_align |= SUB_ALIGN_GOOD; + + what[i] = r_idx; + } + + /* Find and reserve some space in the dungeon. Get center of room. */ + if (!find_space(&yval, &xval, 13, 25)) return FALSE; + /* Large room */ y1 = yval - 5; y2 = yval + 5; @@ -5731,40 +5756,6 @@ static bool build_type13(void) cave[yval][xval].mimic = cave[yval][xval].feat; cave[yval][xval].feat = FEAT_TRAP_OPEN; - /* Prepare allocation table */ - get_mon_num_prep(n_ptr->hook_func, vault_aux_trapped_pit); - - align.sub_align = SUB_ALIGN_NEUTRAL; - - /* Pick some monster types */ - for (i = 0; i < 16; i++) - { - int r_idx = 0, attempts = 100; - monster_race *r_ptr = NULL; - - while (attempts--) - { - /* Get a (hard) monster type */ - r_idx = get_mon_num(dun_level + 0); - r_ptr = &r_info[r_idx]; - - /* Decline incorrect alignment */ - if (monster_has_hostile_align(&align, 0, 0, r_ptr)) continue; - - /* Accept this monster */ - break; - } - - /* Notice failure */ - if (!r_idx || !attempts) return FALSE; - - /* Note the alignment */ - if (r_ptr->flags3 & RF3_EVIL) align.sub_align |= SUB_ALIGN_EVIL; - if (r_ptr->flags3 & RF3_GOOD) align.sub_align |= SUB_ALIGN_GOOD; - - what[i] = r_idx; - } - /* Sort the entries */ for (i = 0; i < 16 - 1; i++) { @@ -5820,7 +5811,6 @@ static bool build_type13(void) good_item_flag = TRUE; } - for (i = 0; placing[i][2] >= 0; i++) { y = yval + placing[i][0]; -- 2.11.0