Skip to content

Commit

Permalink
New terrain type - grass.
Browse files Browse the repository at this point in the history
Finally got around to adding grass to EvilHack. I pulled the majority of
the code from xNetHack's implementation (too many commits to reference
them all here), and then made my own modifications to it.

Grass is a new terrain type that you can walk on. It appears as a bright
green dot, same shape and orientation as a regular room/floor tile.
Monsters that can hide (M1_CONCEAL flag) under things can also hide in
the grass (and due to this behavior, can now hide under other bits of
furniture, like thrones, ladders [not stairs], altars, sinks, and
graves). Grass can also be burned away by fire. If a grass tile is
unseen/unlit, it'll darken just like a regular floor tile does.

The only thing I've really added grass to so far, is Aphroditie's level,
and garden rooms. While here, I also made some improvements to
Aphroditie's level - all of the rooms are technically gardens now.
Because garden rooms spawn their own nymphs, fountains, and trees, I've
made some tweaks to the level to compensate (read: not have the level be
completely full of nymphs). Because of these changes, I increased the
minimum level Aphroditie's level can spawn from five to eight.

I'll include grass in some existing levels in future commits. It'll also
be a part of the Druid quest levels once those are created.
  • Loading branch information
k21971 committed Sep 27, 2024
1 parent de16919 commit 40524f9
Show file tree
Hide file tree
Showing 34 changed files with 640 additions and 461 deletions.
20 changes: 10 additions & 10 deletions dat/Druid.des
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ MAZE: "Dru-strt",' '
FLAGS: noteleport,hardfloor
GEOMETRY:center,center
MAP
........................
........................
........................
........................
........................
........................
gggggggggggggggggggggggg
gggggggggggggggggggggggg
gggggggggggggggggggggggg
gggggggggggggggggggggggg
gggggggggggggggggggggggg
gggggggggggggggggggggggg
ENDMAP

# Dungeon Description
Expand Down Expand Up @@ -91,8 +91,8 @@ OBJECT:('[',"runed bracers"),(02,02),blessed,0,name:"Bracers of the First Circle
# and goal levels.
#

MAZE: "Dru-fila" , 'P'
INIT_MAP: mines, '.' , 'P' , false , true , lit , false
MAZE: "Dru-fila" , 't'
INIT_MAP: mines, '.' , 't' , false , true , lit , false
NOMAP
#
STAIR: random, up
Expand Down Expand Up @@ -127,8 +127,8 @@ TRAP: random, random
TRAP: random, random
TRAP: random, random

MAZE: "Dru-filb" , 'P'
INIT_MAP: mines, '.' , 'P' , false , true , lit , false
MAZE: "Dru-filb" , 't'
INIT_MAP: mines, '.' , 't' , false , true , lit , false
NOMAP
#
STAIR: random, up
Expand Down
2 changes: 1 addition & 1 deletion dat/dungeon.def
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ CHAINBRANCH: "Sokoban" "oracle" + (1, 0) up
RNDLEVEL: "bigrm" "B" @ (10, 3) 40 10
CHAINBRANCH: "The Quest" "oracle" + (6, 2) portal
BRANCH: "Fort Ludios" @ (18, 4) portal
LEVEL: "nymph" "N" @ (5, 15) 45
LEVEL: "nymph" "N" @ (8, 15) 45
RNDLEVEL: "medusa" "none" @ (-5, 4) 4
LEVALIGN: chaotic
CHAINBRANCH: "The Ice Queen's Realm" "medusa" + (-1, 0) portal
Expand Down
89 changes: 53 additions & 36 deletions dat/nymph.des
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
# NetHack 3.6 nymph.des $NHDT-Date: 1595116228 2020/07/18 23:50:28 $ $NHDT-Branch: master $:$NHDT-Revision: 1.9 $
#
# Nymph level (from UnNetHack, which came from Slash'EM)
# Level is slightly modified from the original
# Level is modified from the original
#

LEVEL: "nymph"
ROOM: "ordinary", unlit, random, random, (12,7)
ROOM: "garden", unlit, random, random, (12,07)
{
TERRAIN: random, 'T'
TERRAIN: random, 'T'
[30%]: TERRAIN: random, 'T'
[30%]: TERRAIN: random, 'T'
[30%]: TERRAIN: random, 'T'
[30%]: TERRAIN: random, 'T'
FOUNTAIN: random
[30%]:TERRAIN: random, 'T'
[30%]:TERRAIN: random, 'T'
[30%]:TERRAIN: random, 'T'
[30%]:TERRAIN: random, 'T'
FOUNTAIN:random
TRAP:"board",random
TRAP:"board",random
OBJECT:('(',"chest"),random
Expand All @@ -33,60 +31,79 @@ OBJECT:random, random
OBJECT:random, random
OBJECT:random, random
OBJECT:random, random
MONSTER: 'n', random, hostile
MONSTER: 'n', random, hostile
MONSTER: 'n', random, hostile
MONSTER: 'n', random, hostile
MONSTER: 'n', random, hostile
MONSTER:'n', random, hostile
MONSTER:'n', random, hostile
MONSTER:'n', random, hostile
IF [75%] {
IF [75%] {
MONSTER:('s',"centipede"), random, hostile
} ELSE {
MONSTER:('s',"scorpion"), random, hostile
}
}
# nymph queen
MONSTER:('n',"Aphrodite"), random, hostile
}

ROOM: "ordinary", random, random, random, random
# stairs up room
ROOM: "garden", random, random, random, random
{
TERRAIN: random, 'T'
STAIR:random, up
TRAP:"board",random
STAIR: random, up
OBJECT:random,random
MONSTER: 'n', random, hostile
}

ROOM: "ordinary", random, random, random, random
# stairs down room
ROOM: "garden", random, random, random, random
{
[30%]: TERRAIN: random, 'T'
[30%]: TERRAIN: random, 'T'
STAIR:random, down
TRAP:"board",random
TRAP: random, random
STAIR: random, down
TRAP:random, random
OBJECT:random, random
MONSTER: 'n', random, hostile
}

ROOM: "ordinary", random, random, random, random
ROOM: "garden", random, random, random, random
{
[40%]: TERRAIN: random, 'T'
[30%]: TERRAIN: random, 'T'
TRAP:"board",random
OBJECT:random, random
OBJECT:random, random
MONSTER: 'n', random, hostile
IF [50%] {
IF [75%] {
MONSTER:('s',"centipede"), random, hostile
} ELSE {
MONSTER:('S',"snake"), random, hostile
}
}
}

ROOM: "ordinary", random, random, random, random
ROOM: "garden", random, random, random, random
{
[30%]: TERRAIN: random, 't'
[30%]: TERRAIN: random, 'T'
TRAP:"board",random
TRAP: random, random
TRAP:random, random
OBJECT:random, random
MONSTER: 'n', random, hostile
IF [50%] {
IF [75%] {
MONSTER:('s',"centipede"), random, hostile
} ELSE {
MONSTER:('S',"pit viper"), random, hostile
}
}

}

ROOM: "ordinary", random, random, random, random
ROOM: "garden", random, random, random, random
{
TRAP:"board",random
TRAP:random, random
OBJECT:random, random
TRAP: random, random
MONSTER: 'n', random, hostile
IF [50%] {
IF [75%] {
MONSTER:('s',"centipede"), random, hostile
} ELSE {
MONSTER:('s',"scorpion"), random, hostile
}
}

}

RANDOM_CORRIDORS
13 changes: 9 additions & 4 deletions dat/symbols
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ start: NHAccess
S_sewage: \042
S_pool: \042
S_ice: \042
S_grass: \035
S_lava: \035
S_vodbridge: \035
S_hodbridge: \032
Expand Down Expand Up @@ -194,7 +195,6 @@ start: Blank
S_falling_rock_trap: \032
S_feline: \032
S_fire_trap: \032
S_ice_trap: \032
S_flashbeam: \032
S_food: \032
S_forge: \032
Expand All @@ -205,6 +205,7 @@ start: Blank
S_giant: \032
S_gnome: \032
S_golem: \032
S_grass: \032
S_grave: \032
S_gremlin: \032
S_hbeam: \032
Expand All @@ -217,6 +218,7 @@ start: Blank
S_humanoid: \032
S_hwall: \032
S_ice: \032
S_ice_trap: \032
S_imp: \032
S_invisible: \032
S_jabberwock: \032
Expand Down Expand Up @@ -357,7 +359,8 @@ start: IBMgraphics
S_puddle: \xf7 # meta-w, approx. equals
S_sewage: \xf7 # meta-w, approx. equals
S_pool: \xf7 # meta-w, approx. equals
S_ice: \xfa # meta-z, centered dot
S_ice: \xfa # meta-z, centered dot
S_grass: \xfa # meta-z, centered dot
S_lava: \xf7 # meta-w, approx. equals
S_vodbridge: \xfa # meta-z, centered dot
S_hodbridge: \xfa # meta-z, centered dot
Expand Down Expand Up @@ -571,11 +574,12 @@ start: curses
S_ndoor: \xfe # meta-z, centered dot
S_bars: \xfc # meta-|, not-equals sign (was '#')
S_tree: \xe7 # meta-g, plus or minus sign
S_deadtree: \xe7 # meta-g, plus or minus sign
S_deadtree: \xe7 # meta-g, plus or minus sign
S_room: \xfe # meta-z, centered dot
S_corr: \xe1 # meta-a, solid block
S_litcorr: \xe1 # meta-a, solid block
S_ice: \xfe # meta-z, centered dot
S_grass: \xfe # meta-z, centered dot
S_vodbridge: \xfe # meta-z, centered dot
S_hodbridge: \xfe # meta-z, centered dot
S_vbeam: \xf8 # meta-3, vertical rule
Expand Down Expand Up @@ -614,7 +618,8 @@ start: DECgraphics
S_puddle: \xe0 # meta-\, diamond
S_sewage: \xe0 # meta-\, diamond
S_pool: \xe0 # meta-\, diamond
S_ice: \xfe # meta-~, centered dot
S_ice: \xfe # meta-~, centered dot
S_grass: \xfe # meta-~, centered dot
S_lava: \xe0 # meta-\, diamond
S_vodbridge: \xfe # meta-~, centered dot
S_hodbridge: \xfe # meta-~, centered dot
Expand Down
1 change: 1 addition & 0 deletions doc/Guidebook.mn
Original file line number Diff line number Diff line change
Expand Up @@ -4578,6 +4578,7 @@ F S_fungus (fungus or mold)
H S_giant (giant humanoid)
G S_gnome (gnome)
\' S_golem (golem)
\. S_grass (grass)
| S_grave (grave)
g S_gremlin (gremlin)
\- S_hbeam (horizontal beam [zap animation])
Expand Down
1 change: 1 addition & 0 deletions doc/evilhack-changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3637,4 +3637,5 @@ The following changes to date are:
- Initial Druid quest text
- Finish up Druid quest text, fix formatting
- All demons/devils are now unaligned (evil)
- New terrain type - grass

4 changes: 4 additions & 0 deletions include/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@
/* else U_AP_TYPE == M_AP_MONSTER */ \
: monnum_to_glyph(youmonst.mappearance)))

/* Get a string describing the terrain at (x, y) */
#define explain_terrain(x, y) \
(defsyms[back_to_defsym((x), (y))].explanation)

/*
* A glyph is an abstraction that represents a _unique_ monster, object,
* dungeon part, or effect. The uniqueness is important. For example,
Expand Down
2 changes: 2 additions & 0 deletions include/extern.h
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,7 @@ E void FDECL(row_refresh, (int, int, int));
E void NDECL(cls);
E void FDECL(flush_screen, (int));
E int FDECL(back_to_glyph, (XCHAR_P, XCHAR_P));
E int FDECL(back_to_defsym, (XCHAR_P, XCHAR_P));
E int FDECL(zapdir_to_glyph, (int, int, int));
E int FDECL(glyph_at, (XCHAR_P, XCHAR_P));
E void NDECL(set_wall_state);
Expand Down Expand Up @@ -1685,6 +1686,7 @@ E int FDECL(dochug, (struct monst *));
E boolean FDECL(m_digweapon_check, (struct monst *, XCHAR_P, XCHAR_P));
E int FDECL(m_move, (struct monst *, int));
E int FDECL(m_move_aggress, (struct monst *, XCHAR_P, XCHAR_P));
E int FDECL(concealed_spot, (int, int));
E void FDECL(dissolve_bars, (int, int));
E boolean FDECL(closed_door, (int, int));
E boolean FDECL(accessible, (int, int));
Expand Down
Loading

0 comments on commit 40524f9

Please sign in to comment.