Merge branch 'custom-swallow-glyphs' of https://github.com/ars3niy/NetHack into NetHack-3.7
This commit is contained in:
36
src/glyphs.c
36
src/glyphs.c
@@ -191,6 +191,39 @@ fix_glyphname(char *str)
|
||||
return str;
|
||||
}
|
||||
|
||||
int
|
||||
glyph_to_cmap(int glyph)
|
||||
{
|
||||
if (glyph == GLYPH_CMAP_STONE_OFF)
|
||||
return S_stone;
|
||||
else if (glyph_is_cmap_main(glyph))
|
||||
return (glyph - GLYPH_CMAP_MAIN_OFF) + S_vwall;
|
||||
else if (glyph_is_cmap_mines(glyph))
|
||||
return (glyph - GLYPH_CMAP_MINES_OFF) + S_vwall;
|
||||
else if (glyph_is_cmap_gehennom(glyph))
|
||||
return (glyph - GLYPH_CMAP_GEH_OFF) + S_vwall;
|
||||
else if (glyph_is_cmap_knox(glyph))
|
||||
return (glyph - GLYPH_CMAP_KNOX_OFF) + S_vwall;
|
||||
else if (glyph_is_cmap_sokoban(glyph))
|
||||
return (glyph - GLYPH_CMAP_SOKO_OFF) + S_vwall;
|
||||
else if (glyph_is_cmap_a(glyph))
|
||||
return (glyph - GLYPH_CMAP_A_OFF) + S_ndoor;
|
||||
else if (glyph_is_cmap_altar(glyph))
|
||||
return S_altar;
|
||||
else if (glyph_is_cmap_b(glyph))
|
||||
return (glyph - GLYPH_CMAP_B_OFF) + S_grave;
|
||||
else if (glyph_is_cmap_c(glyph))
|
||||
return (glyph - GLYPH_CMAP_C_OFF) + S_digbeam;
|
||||
else if (glyph_is_cmap_zap(glyph))
|
||||
return ((glyph - GLYPH_ZAP_OFF) % 4) + S_vbeam;
|
||||
else if (glyph_is_swallow(glyph))
|
||||
return glyph_to_swallow(glyph) + S_sw_tl;
|
||||
else if (glyph_is_explosion(glyph))
|
||||
return glyph_to_explosion(glyph) + S_expl_tl;
|
||||
else
|
||||
return MAXPCHARS;
|
||||
}
|
||||
|
||||
staticfn int
|
||||
glyph_find_core(const char *id, struct find_struct *findwhat)
|
||||
{
|
||||
@@ -1026,8 +1059,7 @@ parse_id(const char *id, struct find_struct *findwhat)
|
||||
|
||||
j = glyph - GLYPH_EXPLODE_OFF;
|
||||
expl = j / ((S_expl_br - S_expl_tl) + 1);
|
||||
cmap = (j % ((S_expl_br - S_expl_tl) + 1))
|
||||
+ S_expl_tl;
|
||||
cmap = glyph_to_explosion(glyph) + S_expl_tl;
|
||||
i = cmap - S_expl_tl;
|
||||
Snprintf(buf[2], sizeof buf[2], "%s ",
|
||||
expl_type_texts[expl]);
|
||||
|
||||
Reference in New Issue
Block a user