From a9d169be97377201d500428f7bfd1bda7a1e0c3d Mon Sep 17 00:00:00 2001 From: mogami Date: Wed, 23 Oct 2002 10:02:26 +0000 Subject: [PATCH] =?utf8?q?=E3=83=94=E3=83=A9=E3=83=8B=E3=82=A2=E3=83=BB?= =?utf8?q?=E3=83=88=E3=83=A9=E3=83=83=E3=83=97=E3=81=AE=E9=83=A8=E5=B1=8B?= =?utf8?q?=E3=81=A8=E3=83=8F=E3=83=AB=E3=83=9E=E3=82=B2=E3=83=89=E3=83=B3?= =?utf8?q?=E3=83=BB=E3=83=88=E3=83=A9=E3=83=83=E3=83=97=E3=81=AE=E9=83=A8?= =?utf8?q?=E5=B1=8B=E5=AE=9F=E8=A3=85=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/cave.c | 2 ++ src/cmd1.c | 59 ++++++++++++++++++++++++++++++++++++++ src/defines.h | 6 ++++ src/generate.c | 3 ++ src/monster2.c | 5 ++++ src/rooms.c | 90 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- 6 files changed, 164 insertions(+), 1 deletion(-) diff --git a/src/cave.c b/src/cave.c index 99c5c47f6..7a530d9ae 100644 --- a/src/cave.c +++ b/src/cave.c @@ -77,6 +77,8 @@ bool is_trap(int feat) case FEAT_TRAP_TRAPS: case FEAT_TRAP_ALARM: case FEAT_TRAP_OPEN: + case FEAT_TRAP_ARMAGEDDON: + case FEAT_TRAP_PIRANHA: { /* A trap */ return (TRUE); diff --git a/src/cmd1.c b/src/cmd1.c index 5fe2c1e6f..62d324141 100644 --- a/src/cmd1.c +++ b/src/cmd1.c @@ -1622,6 +1622,65 @@ msg_print(" break; } + + case FEAT_TRAP_ARMAGEDDON: + { + static int levs[10] = {0, 0, 20, 10, 5, 3, 2, 1, 1, 1}; + + int lev; +#ifdef JP + msg_print("ÆÍÁ³Å·³¦¤ÎÀïÁè¤Ë´¬¤­¹þ¤Þ¤ì¤¿¡ª"); +#else + msg_print("Suddenly, you are surrounded by immotal beings!"); +#endif + + /* Destroy this trap */ + cave_set_feat(y, x, floor_type[randint0(100)]); + + /* Summon Demons and Angels */ + for (lev = dun_level; lev >= 20; lev -= 1 + lev/16) + { + num = levs[MIN(lev/10, 9)]; + for (i = 0; i < num; i++) + { + int x1 = rand_spread(x, 7); + int y1 = rand_spread(y, 5); + + /* Skip illegal grids */ + if (!in_bounds(y1, x1)) continue; + + /* Require line of sight */ + if (!player_has_los_bold(y1, x1)) continue; + + (void)summon_specific(0, y1, x1, lev, SUMMON_DEMON, (PM_NO_PET)); + (void)summon_specific(0, y1, x1, lev, SUMMON_ANGEL, (PM_NO_PET)); + } + } + break; + } + + case FEAT_TRAP_PIRANHA: + { +#ifdef JP + msg_print("ÆÍÁ³Êɤ«¤é¿å¤¬°î¤ì½Ð¤·¤¿¡ª¥Ô¥é¥Ë¥¢¤¬¤¤¤ë¡ª"); +#else + msg_print("Suddenly, the room is filled with water with piranhas!"); +#endif + + /* Destroy this trap */ + cave_set_feat(y, x, floor_type[randint0(100)]); + + /* Water fills room */ + fire_ball_hide(GF_WATER_FLOW, 0, 1, 10); + + /* Summon Piranhas */ + num = 1 + dun_level/20; + for (i = 0; i < num; i++) + { + (void)summon_specific(0, y, x, dun_level, SUMMON_PIRANHAS, (PM_ALLOW_GROUP | PM_NO_PET)); + } + break; + } } if (break_trap && is_trap(c_ptr->feat)) { diff --git a/src/defines.h b/src/defines.h index eeebb2c62..51d9cab4b 100644 --- a/src/defines.h +++ b/src/defines.h @@ -1065,6 +1065,10 @@ /* unknown grid (not detected) */ #define FEAT_UNDETECTD 0xc4 +/* special traps */ +#define FEAT_TRAP_ARMAGEDDON 0xc5 +#define FEAT_TRAP_PIRANHA 0xc6 + /* * Wilderness terrains */ @@ -2681,6 +2685,7 @@ #define SUMMON_GUARDIANS 62 #define SUMMON_KNIGHTS 63 #define SUMMON_EAGLES 64 +#define SUMMON_PIRANHAS 65 /* @@ -4550,6 +4555,7 @@ extern int PlayerUID; #define MON_WOLF 54 #define MON_FANG 55 #define MON_LOUSE 69 +#define MON_PIRANHA 70 #define MON_COPPER_COINS 85 #define MON_NOV_PALADIN 97 #define MON_GREEN_G 100 diff --git a/src/generate.c b/src/generate.c index a585518ae..2589e3013 100644 --- a/src/generate.c +++ b/src/generate.c @@ -692,6 +692,9 @@ if (cheat_room) msg_print(" /* Type 13 -- Trapped monster pit (5%) */ if ((k < 37) && room_build(y, x, 13)) continue; + + /* Type 14 -- Trapped room (5%) */ + if ((k < 42) && room_build(y, x, 14)) continue; #endif } diff --git a/src/monster2.c b/src/monster2.c index a966b1dbe..4484dc108 100644 --- a/src/monster2.c +++ b/src/monster2.c @@ -861,6 +861,11 @@ static bool summon_specific_aux(int r_idx) (r_ptr->flags8 & RF8_WILD_ONLY)); break; } + case SUMMON_PIRANHAS: + { + okay = (r_idx == MON_PIRANHA); + break; + } } /* Result */ diff --git a/src/rooms.c b/src/rooms.c index dbd93d5e9..41eb5ae0d 100644 --- a/src/rooms.c +++ b/src/rooms.c @@ -293,6 +293,7 @@ static bool room_alloc(int x, int y, bool crowded, int by0, int bx0, int *xx, in * 11 -- circular rooms * 12 -- crypts * 13 -- trapped monster pits + * 14 -- trapped room */ @@ -5325,7 +5326,6 @@ static void build_type13(int by0, int bx0) /* Place the wall open trap */ cave[yval][xval].mimic = cave[yval][xval].feat; cave[yval][xval].feat = FEAT_TRAP_OPEN; - add_cave_info(yval, xval, CAVE_ROOM); /* Prepare allocation table */ get_mon_num_prep(n_ptr->hook_func, vault_aux_trapped_pit); @@ -5427,6 +5427,93 @@ static void build_type13(int by0, int bx0) /* + * Type 14 -- trapped rooms + * + * A special trap is placed at center of the room + */ +static void build_type14(int by0, int bx0) +{ + int y, x, y2, x2, yval, xval; + int y1, x1, xsize, ysize; + + bool light; + + cave_type *c_ptr; + byte trap; + + /* Pick a room size */ + y1 = randint1(4); + x1 = randint1(11); + y2 = randint1(3); + x2 = randint1(11); + + xsize = x1 + x2 + 1; + ysize = y1 + y2 + 1; + + /* Try to allocate space for room. If fails, exit */ + if (!room_alloc(xsize + 2, ysize + 2, FALSE, by0, bx0, &xval, &yval)) return; + + /* Choose lite or dark */ + light = ((dun_level <= randint1(25)) && !(d_info[dungeon_type].flags1 & DF1_DARKNESS)); + + + /* Get corner values */ + y1 = yval - ysize / 2; + x1 = xval - xsize / 2; + y2 = yval + (ysize - 1) / 2; + x2 = xval + (xsize - 1) / 2; + + + /* Place a full floor under the room */ + for (y = y1 - 1; y <= y2 + 1; y++) + { + for (x = x1 - 1; x <= x2 + 1; x++) + { + c_ptr = &cave[y][x]; + place_floor_grid(c_ptr); + c_ptr->info |= (CAVE_ROOM); + if (light) c_ptr->info |= (CAVE_GLOW); + } + } + + /* Walls around the room */ + for (y = y1 - 1; y <= y2 + 1; y++) + { + c_ptr = &cave[y][x1 - 1]; + place_outer_grid(c_ptr); + c_ptr = &cave[y][x2 + 1]; + place_outer_grid(c_ptr); + } + for (x = x1 - 1; x <= x2 + 1; x++) + { + c_ptr = &cave[y1 - 1][x]; + place_outer_grid(c_ptr); + c_ptr = &cave[y2 + 1][x]; + place_outer_grid(c_ptr); + } + + if (dun_level < 30 + randint1(30)) + trap = FEAT_TRAP_PIRANHA; + else + trap = FEAT_TRAP_ARMAGEDDON; + + /* Place a special trap */ + cave[yval][xval].mimic = cave[yval][xval].feat; + cave[yval][xval].feat = trap; + + /* Message */ + if (cheat_room) + { +#ifdef JP + msg_format("%s¤ÎÉô²°", f_name + f_info[trap].name); +#else + msg_format("Room of %s", f_name + f_info[trap].name); +#endif + } +} + + +/* * Attempt to build a room of the given type at the given block * * Note that we restrict the number of "crowded" rooms to reduce @@ -5444,6 +5531,7 @@ bool room_build(int by0, int bx0, int typ) switch (typ) { /* Build an appropriate room */ + case 14: build_type14(by0, bx0); break; case 13: build_type13(by0, bx0); break; case 12: build_type12(by0, bx0); break; case 11: build_type11(by0, bx0); break; -- 2.11.0