MCPcopy Create free account
hub / github.com/NetHack/NetHack / width_string

Function width_string

win/X11/winstat.c:2106–2174  ·  view source on GitHub ↗

Return a string for the initial width, so use longest possible value. */

Source from the content-addressed store, hash-verified

2104
2105/* Return a string for the initial width, so use longest possible value. */
2106static const char *
2107width_string(int sv_index)
2108{
2109 switch (sv_index) {
2110 case F_DUMMY:
2111 return " ";
2112
2113 case F_STR:
2114 return "018/**";
2115 case F_DEX:
2116 case F_CON:
2117 case F_INT:
2118 case F_WIS:
2119 case F_CHA:
2120 return "088"; /* all but str never get bigger */
2121
2122 case F_HUNGER:
2123 return "Satiated";
2124 case F_ENCUMBER:
2125 return "Overloaded";
2126
2127 case F_LEV:
2128 case F_FLY:
2129 case F_RIDE:
2130 case F_TRAPPED:
2131 case F_TETHERED:
2132 case F_GRABBED:
2133 case F_STONE:
2134 case F_SLIME:
2135 case F_STRNGL:
2136 case F_FOODPOIS:
2137 case F_TERMILL:
2138 case F_IN_LAVA:
2139 case F_HELD:
2140 case F_HOLDING:
2141 case F_BLIND:
2142 case F_DEAF:
2143 case F_STUN:
2144 case F_CONF:
2145 case F_HALLU:
2146 return shown_stats[sv_index].name;
2147
2148 case F_NAME:
2149 case F_DLEVEL:
2150 return ""; /* longest possible value not needed for these */
2151
2152 case F_HP:
2153 case F_MAXHP:
2154 return "9999";
2155 case F_POWER:
2156 case F_MAXPOWER:
2157 return "9999";
2158 case F_AC:
2159 return "-127";
2160 case F_XP_LEVL:
2161 return "99";
2162 case F_GOLD:
2163 /* strongest hero can pick up roughly 30% of this much */

Callers 1

create_widgetFunction · 0.85

Calls 1

impossibleFunction · 0.50

Tested by

no test coverage detected