| 1747 | } |
| 1748 | |
| 1749 | const char * |
| 1750 | surface(coordxy x, coordxy y) |
| 1751 | { |
| 1752 | struct rm *lev = &levl[x][y]; |
| 1753 | int levtyp = SURFACE_AT(x, y); |
| 1754 | |
| 1755 | if (u_at(x, y) && u.uswallow && is_animal(u.ustuck->data)) |
| 1756 | /* 'husk' is iffy but maw is wrong for 't' class */ |
| 1757 | return digests(u.ustuck->data) ? "maw" |
| 1758 | : enfolds(u.ustuck->data) ? "husk" |
| 1759 | : "nonesuch"; /* can't happen (fingers crossed...) */ |
| 1760 | else if (IS_AIR(levtyp)) |
| 1761 | return Is_waterlevel(&u.uz) ? "air bubble" |
| 1762 | : (levtyp == CLOUD) ? "cloud" : "air"; |
| 1763 | else if (is_pool(x, y)) |
| 1764 | return (Underwater && !Is_waterlevel(&u.uz)) |
| 1765 | ? "bottom" : hliquid("water"); |
| 1766 | else if (is_ice(x, y)) |
| 1767 | return "ice"; |
| 1768 | else if (is_lava(x, y)) |
| 1769 | return hliquid("lava"); |
| 1770 | else if (lev->typ == DRAWBRIDGE_DOWN) |
| 1771 | return "bridge"; |
| 1772 | else if (IS_ALTAR(levtyp)) |
| 1773 | return "altar"; |
| 1774 | else if (IS_GRAVE(levtyp)) |
| 1775 | return "headstone"; |
| 1776 | else if (IS_FOUNTAIN(levtyp)) |
| 1777 | return "fountain"; |
| 1778 | else if (On_stairs(x, y)) |
| 1779 | return "stairs"; |
| 1780 | else if (IS_WALL(levtyp) || levtyp == SDOOR) |
| 1781 | return "wall"; /* 'surface' during Passes_walls */ |
| 1782 | else if (IS_DOOR(levtyp)) |
| 1783 | return "doorway"; /* even for closed door */ |
| 1784 | else if (IS_ROOM(levtyp) && !Is_earthlevel(&u.uz)) |
| 1785 | return "floor"; |
| 1786 | else |
| 1787 | return "ground"; |
| 1788 | } |
| 1789 | |
| 1790 | /* |
| 1791 | * It is expected that the second argument of get_level is a depth value, |
no test coverage detected