diff --git a/dat/themerms.lua b/dat/themerms.lua index 7d5a73860..6aff95286 100644 --- a/dat/themerms.lua +++ b/dat/themerms.lua @@ -1071,7 +1071,10 @@ end -- postprocess callback: turn room walls into trees function make_garden_walls(data) local sel = data.sel:grow(); + -- change walls to trees des.replace_terrain({ selection = sel, fromterrain="w", toterrain = "T" }); + -- update secret doors; attempting to change to AIR will set arboreal flag + des.replace_terrain({ selection = sel, fromterrain="S", toterrain = "A" }); end -- postprocess callback: make a trap diff --git a/include/rm.h b/include/rm.h index 001414a10..f0382870f 100644 --- a/include/rm.h +++ b/include/rm.h @@ -219,6 +219,9 @@ struct rm { #define D_LOCKED 0x08 #define D_TRAPPED 0x10 +/* secret doors aren't trapped or nonpasswall; overload D_TRAPPED and + W_NONPASSWALL for 'arboreal' secret doors (in garden theme room) */ +#define D_ARBOREAL D_TRAPPED #define D_SECRET 0x20 /* only used by sp_lev.c, NOT in rm-struct */ /* diff --git a/src/detect.c b/src/detect.c index 0d1de0c83..89476dc88 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1588,7 +1588,7 @@ do_vicinity_map( void cvt_sdoor_to_door(struct rm *lev) { - int newmask = lev->doormask & ~WM_MASK; + int newmask = lev->doormask & ~(WM_MASK | D_ARBOREAL); if (Is_rogue_level(&u.uz)) { /* rogue didn't have doors, only doorways */ diff --git a/src/display.c b/src/display.c index 71c77bb87..716bdf2b8 100644 --- a/src/display.c +++ b/src/display.c @@ -2289,6 +2289,13 @@ back_to_glyph(coordxy x, coordxy y) case CORR: idx = (ptr->waslit || flags.lit_corridor) ? S_litcorr : S_corr; break; + case SDOOR: + if ((ptr->doormask & D_ARBOREAL) != 0) { + idx = S_tree; + break; + } + FALLTHROUGH; + /*FALLTHRU*/ case HWALL: case VWALL: case TLCORNER: @@ -2300,7 +2307,6 @@ back_to_glyph(coordxy x, coordxy y) case TDWALL: case TLWALL: case TRWALL: - case SDOOR: idx = ptr->seenv ? wall_angle(ptr) : S_stone; break; case DOOR: @@ -3579,6 +3585,10 @@ wall_angle(struct rm *lev) break; case SDOOR: + if ((lev->doormask & D_ARBOREAL) != 0) { + idx = S_tree; + break; + } if (lev->horizontal) goto horiz; FALLTHROUGH; diff --git a/src/mkmaze.c b/src/mkmaze.c index df83d2136..903330cf3 100644 --- a/src/mkmaze.c +++ b/src/mkmaze.c @@ -76,8 +76,16 @@ boolean set_levltyp(coordxy x, coordxy y, schar newtyp) { if (isok(x, y) && newtyp >= STONE && newtyp < MAX_TYPE) { - if (CAN_OVERWRITE_TERRAIN(levl[x][y].typ)) { - schar oldtyp = levl[x][y].typ; + schar oldtyp = levl[x][y].typ; + + /* hack for secret doors in garden theme rooms */ + if (oldtyp == SDOOR && newtyp == AIR) { + /* levl[][].typ stays SDOOR rather than change to AIR */ + levl[x][y].doormask |= D_ARBOREAL; + return TRUE; + } + + if (CAN_OVERWRITE_TERRAIN(oldtyp)) { /* typ==ICE || (typ==DRAWBRIDGE_UP && drawbridgemask==DB_ICE) */ boolean was_ice = is_ice(x, y);