Add colored branch stairs

Different color for stairs that go to another dungeon branch.

Adds four new glyphs, S_br{up,dn}{stair,ladder}, which use the
same character as normal stairs/ladders, but yellow color.
In tiles, the up/down arrow is yellow-green instead of while-blue.

This feature has been around a lot and is in several different
variants, but this is implemented from scratch so tiles work too.
This commit is contained in:
Pasi Kallinen
2021-07-27 17:11:02 +03:00
parent 141a7915d6
commit 267ac5add2
8 changed files with 385 additions and 279 deletions

View File

@@ -1806,6 +1806,7 @@ back_to_glyph(xchar x, xchar y)
{
int idx;
struct rm *ptr = &(levl[x][y]);
struct stairway *sway;
switch (ptr->typ) {
case SCORR:
@@ -1854,10 +1855,18 @@ back_to_glyph(xchar x, xchar y)
idx = S_pool;
break;
case STAIRS:
idx = (ptr->ladder & LA_DOWN) ? S_dnstair : S_upstair;
sway = stairway_at(x, y);
if (sway && (sway->tolev.dnum != u.uz.dnum))
idx = (ptr->ladder & LA_DOWN) ? S_brdnstair : S_brupstair;
else
idx = (ptr->ladder & LA_DOWN) ? S_dnstair : S_upstair;
break;
case LADDER:
idx = (ptr->ladder & LA_DOWN) ? S_dnladder : S_upladder;
sway = stairway_at(x, y);
if (sway && (sway->tolev.dnum != u.uz.dnum))
idx = (ptr->ladder & LA_DOWN) ? S_brdnladder : S_brupladder;
else
idx = (ptr->ladder & LA_DOWN) ? S_dnladder : S_upladder;
break;
case FOUNTAIN:
idx = S_fountain;

View File

@@ -157,6 +157,10 @@ const struct symdef defsyms[MAXPCHARS] = {
{ '>', "staircase down", C(CLR_GRAY) }, /* dnstair */
{ '<', "ladder up", C(CLR_BROWN) }, /* upladder */
{ '>', "ladder down", C(CLR_BROWN) }, /* dnladder */
{ '<', "branch staircase up", C(CLR_YELLOW) }, /* brupstair */
{ '>', "branch staircase down", C(CLR_YELLOW) }, /* brdnstair */
{ '<', "branch ladder up", C(CLR_YELLOW) }, /* brupladder */
{ '>', "branch ladder down", C(CLR_YELLOW) }, /* brdnladder */
{ '_', "altar", C(CLR_GRAY) }, /* altar */
{ '|', "grave", C(CLR_WHITE) }, /* grave */
{ '\\', "opulent throne", C(HI_GOLD) }, /* throne */

View File

@@ -383,6 +383,10 @@ const struct symparse loadsyms[] = {
{ SYM_PCHAR, S_dnstair, "S_dnstair" },
{ SYM_PCHAR, S_upladder, "S_upladder" },
{ SYM_PCHAR, S_dnladder, "S_dnladder" },
{ SYM_PCHAR, S_brupstair, "S_brupstair" },
{ SYM_PCHAR, S_brdnstair, "S_brdnstair" },
{ SYM_PCHAR, S_brupladder, "S_brupladder" },
{ SYM_PCHAR, S_brdnladder, "S_brdnladder" },
{ SYM_PCHAR, S_altar, "S_altar" },
{ SYM_PCHAR, S_grave, "S_grave" },
{ SYM_PCHAR, S_throne, "S_throne" },