]> granicus.if.org Git - nethack/commitdiff
fix #H1232 - hole in ice is described as moat [1 of 2] (trunk only)
authornethack.rankin <nethack.rankin>
Fri, 3 Aug 2007 01:05:50 +0000 (01:05 +0000)
committernethack.rankin <nethack.rankin>
Fri, 3 Aug 2007 01:05:50 +0000 (01:05 +0000)
     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 <Someone>'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
doc/fixes35.0
include/sp_lev.h
src/mkmap.c
src/sp_lev.c
util/lev_comp.y

index 2b35fc1abe7d5f9b5a01025dfa91e420c36b5246..f1c49064746b7bd2d0120f5252acfb0a3337e5bd 100644 (file)
@@ -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
index afefe3f9d75efa15f05302ea397d4741b8a649eb..a563d81f6b94d66bb979b658da96ad24ba520e51 100644 (file)
@@ -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
index 22be7fec47ee3d341df6477db0db7836a0df72b9..042422d8a388059187d35fd91214abaab03e302b 100644 (file)
@@ -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 {
index a843003a0f9dcfe2098835d717593dee83b597a1..2abe8a79d5b06f2c45dd393d8fe9ec395e899865 100644 (file)
@@ -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; i<COLNO; i++)
-           for(j=0; j<ROWNO; j++)
+           for(j=0; j<ROWNO; j++) {
                if (levl[i][j].typ == LAVAPOOL)
                    levl[i][j].lit = TRUE;
+               else if (levl[i][j].typ == ICE)
+                   levl[i][j].icedpool = icedpools ? ICED_POOL : ICED_MOAT;
+           }
 }
 
 /*
@@ -467,7 +471,8 @@ mkmap(init_lev)
        if(join)
            join_map(bg_typ, fg_typ);
 
-       finish_map(fg_typ, bg_typ, (boolean)lit, (boolean)walled);
+       finish_map(fg_typ, bg_typ, (boolean)lit, (boolean)walled,
+                  init_lev->icedpools);
        /* a walled, joined level is cavernous, not mazelike -dlc */
        if (walled && join) {
            level.flags.is_maze_lev = FALSE;
index 2f276d6839f79ca41031f1f22c7b033f6ebbeaa1..fa927abd981c41c229067c47ffdf8a0a48efba99 100644 (file)
@@ -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;
index 2c47ecef8fcaa30e231248bd72f271765a44bf61..56f97e2e0f6a1ad80202ebfa3767d80207eac61b 100644 (file)
@@ -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;
                  }
                ;