From 4c83db0294f654346c931464f3babc7acf4227f5 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Fri, 3 Aug 2007 01:05:50 +0000 Subject: [PATCH] fix #H1232 - hole in ice is described as moat [1 of 2] (trunk only) From a bug report, when ice on the Valkyrie quest home level was melted and a boulder filled the resulting pool, that pool was described as a moat. This was actually a terrain issue rather than a formatting glitch, so instead of tweaking waterbody_name() with an extra special case, extend the level compiler to allow specifying ice as frozen pool instead of always being frozen moat. There's no provision for having both types of ice on the same level, just a level-wide flag to control which of the two applies for ice on that level. This change has a side-effect for the V quest levels: once ice has been melted, a second blast of fire will now boil away the pool and leave a pit. The unfrozen water locations on the home level already behaved that way (ie, they are pools rather than moats) so this should be ok. I also added 's suggestion to make one of the two drawbridges on the goal level start in random state instead of always being open. --- dat/Valkyrie.des | 13 +++++++------ doc/fixes35.0 | 1 + include/sp_lev.h | 3 ++- src/mkmap.c | 19 ++++++++++++------- src/sp_lev.c | 5 ++++- util/lev_comp.y | 22 +++++++++++++++++++++- 6 files changed, 47 insertions(+), 16 deletions(-) diff --git a/dat/Valkyrie.des b/dat/Valkyrie.des index 2b35fc1ab..f1c490647 100644 --- a/dat/Valkyrie.des +++ b/dat/Valkyrie.des @@ -1,4 +1,4 @@ -# SCCS Id: @(#)Valkyrie.des 3.5 2002/05/02 +# SCCS Id: @(#)Valkyrie.des 3.5 2007/08/01 # Copyright (c) 1989 by Jean-Christophe Collet # Copyright (c) 1991-2 by M. Stephenson # NetHack may be freely redistributed. See license for details. @@ -10,6 +10,7 @@ # MAZE: "Val-strt",' ' FLAGS: noteleport,hardfloor +INIT_MAP: '.', 'I', true, true, lit, false, true GEOMETRY:center,center MAP IIIIIIPPPIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII @@ -89,7 +90,7 @@ MONSTER: 'H',"fire giant",(10,16),hostile MAZE: "Val-loca",' ' FLAGS: hardfloor -INIT_MAP: '.' , 'I' , true , true , lit , false +INIT_MAP: '.', 'I', true, true, lit, false, true GEOMETRY:center,center MAP PPPP.... ....PPPPP. @@ -174,7 +175,7 @@ MONSTER:'H',random,random,hostile # MAZE: "Val-goal", 'L' -INIT_MAP: '.' , 'L' , true , true , lit , false +INIT_MAP: '.', 'L', true, true, lit, false, true GEOMETRY:center,center MAP .L............................LLLLL @@ -203,7 +204,7 @@ STAIR:(45,10),up # Non diggable walls NON_DIGGABLE:(00,00,34,16) # Drawbridges -DRAWBRIDGE:(17,02),south,open +DRAWBRIDGE:(17,02),south,random DRAWBRIDGE:(17,14),north,open # Objects OBJECT:'(',"crystal ball",(17,08),blessed,5,"The Orb of Fate" @@ -264,7 +265,7 @@ MONSTER:'H',random,random,hostile # MAZE: "Val-fila" , 'I' -INIT_MAP: '.' , 'I' , true , true , lit, false +INIT_MAP: '.', 'I', true, true, lit, false, true NOMAP # STAIR: random, up @@ -297,7 +298,7 @@ TRAP: random, random TRAP: random, random MAZE: "Val-filb" , 'L' -INIT_MAP: '.' , 'L' , true , true , lit, false +INIT_MAP: '.', 'L', true, true, lit, false, true NOMAP # STAIR: random, up diff --git a/doc/fixes35.0 b/doc/fixes35.0 index afefe3f9d..a563d81f6 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -260,6 +260,7 @@ require confirmation to read a scroll of mail if doing so will be the first violation of illiteracy conduct using F to force an attack towards a boulder gave "you attack thin air" random "treasure drop" upon monster's death bypassed dropping side-effects +melted ice on Valkyrie quest should be pool, not moat Platform- and/or Interface-Specific Fixes diff --git a/include/sp_lev.h b/include/sp_lev.h index 22be7fec4..042422d8a 100644 --- a/include/sp_lev.h +++ b/include/sp_lev.h @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)sp_lev.h 3.5 1996/05/08 */ +/* SCCS Id: @(#)sp_lev.h 3.5 2007/08/01 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -41,6 +41,7 @@ typedef struct { char fg, bg; boolean smoothed, joined; xchar lit, walled; + boolean icedpools; /* for ice locations: ICED_POOL vs ICED_MOAT */ } lev_init; typedef struct { diff --git a/src/mkmap.c b/src/mkmap.c index a843003a0..2abe8a79d 100644 --- a/src/mkmap.c +++ b/src/mkmap.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)mkmap.c 3.5 2007/02/09 */ +/* SCCS Id: @(#)mkmap.c 3.5 2007/08/01 */ /* Copyright (c) J. C. Collet, M. Stephenson and D. Cohrs, 1992 */ /* NetHack may be freely redistributed. See license for details. */ @@ -16,7 +16,7 @@ STATIC_DCL void FDECL(pass_two,(SCHAR_P,SCHAR_P)); STATIC_DCL void FDECL(pass_three,(SCHAR_P,SCHAR_P)); STATIC_DCL void NDECL(wallify_map); STATIC_DCL void FDECL(join_map,(SCHAR_P,SCHAR_P)); -STATIC_DCL void FDECL(finish_map,(SCHAR_P,SCHAR_P,BOOLEAN_P,BOOLEAN_P)); +STATIC_DCL void FDECL(finish_map,(SCHAR_P,SCHAR_P,BOOLEAN_P,BOOLEAN_P,BOOLEAN_P)); STATIC_DCL void FDECL(remove_room,(unsigned)); void FDECL(mkmap, (lev_init *)); @@ -336,9 +336,9 @@ joinm: } STATIC_OVL void -finish_map(fg_typ, bg_typ, lit, walled) +finish_map(fg_typ, bg_typ, lit, walled, icedpools) schar fg_typ, bg_typ; - boolean lit, walled; + boolean lit, walled, icedpools; { int i, j; @@ -355,11 +355,15 @@ finish_map(fg_typ, bg_typ, lit, walled) for(i = 0; i < nroom; i++) rooms[i].rlit = 1; } - /* light lava even if everything's otherwise unlit */ + /* light lava even if everything's otherwise unlit; + ice might be frozen pool rather than frozen moat */ for(i=1; iicedpools); /* a walled, joined level is cavernous, not mazelike -dlc */ if (walled && join) { level.flags.is_maze_lev = FALSE; diff --git a/src/sp_lev.c b/src/sp_lev.c index 2f276d683..fa927abd9 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)sp_lev.c 3.5 2007/04/20 */ +/* SCCS Id: @(#)sp_lev.c 3.5 2007/08/01 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -2220,6 +2220,9 @@ dlb *fd; levl[x][y].horizontal = 1; else if(levl[x][y].typ == LAVAPOOL) levl[x][y].lit = 1; + else if (init_lev.init_present && levl[x][y].typ == ICE) + levl[x][y].icedpool = init_lev.icedpools ? ICED_POOL : + ICED_MOAT; else if(levl[x][y].typ == CROSSWALL) has_bounds = TRUE; Map[x][y] = 1; diff --git a/util/lev_comp.y b/util/lev_comp.y index 2c47ecef8..56f97e2e0 100644 --- a/util/lev_comp.y +++ b/util/lev_comp.y @@ -1,5 +1,5 @@ %{ -/* SCCS Id: @(#)lev_yacc.c 3.5 2007/04/20 */ +/* SCCS Id: @(#)lev_yacc.c 3.5 2007/08/01 */ /* Copyright (c) 1989 by Jean-Christophe Collet */ /* NetHack may be freely redistributed. See license for details. */ @@ -279,6 +279,26 @@ lev_init : /* nothing */ yyerror("Invalid foreground type for joined map."); init_lev.lit = $11; init_lev.walled = $13; + init_lev.icedpools = FALSE; + $$ = 1; + } + | LEV_INIT_ID ':' CHAR ',' CHAR ',' BOOLEAN ',' BOOLEAN ',' light_state ',' walled ',' BOOLEAN + { + init_lev.init_present = TRUE; + init_lev.fg = what_map_char((char) $3); + if (init_lev.fg == INVALID_TYPE) + yyerror("Invalid foreground type."); + init_lev.bg = what_map_char((char) $5); + if (init_lev.bg == INVALID_TYPE) + yyerror("Invalid background type."); + init_lev.smoothed = $7; + init_lev.joined = $9; + if (init_lev.joined && + init_lev.fg != CORR && init_lev.fg != ROOM) + yyerror("Invalid foreground type for joined map."); + init_lev.lit = $11; + init_lev.walled = $13; + init_lev.icedpools = $15; $$ = 1; } ;