MCPcopy Index your code
hub / github.com/NetHack/NetHack / FormatStatusString

Function FormatStatusString

outdated/sys/wince/mhstatus.c:178–280  ·  view source on GitHub ↗

define in botl.c */

Source from the content-addressed store, hash-verified

176extern const char *hu_stat[]; /* defined in eat.c */
177extern const char *enc_stat[]; /* define in botl.c */
178void
179FormatStatusString(char *text, int format)
180{
181 register char *nb;
182 int hp, hpmax;
183 int cap = near_capacity();
184
185 Strcpy(text, svp.plname);
186 if ('a' <= text[0] && text[0] <= 'z')
187 text[0] += 'A' - 'a';
188 text[10] = 0;
189 Sprintf(nb = eos(text), " the ");
190
191 if (Upolyd) {
192 char mbot[BUFSZ];
193 int k = 0;
194
195 Strcpy(mbot, mons[u.umonnum].mname);
196 while (mbot[k] != 0) {
197 if ((k == 0 || (k > 0 && mbot[k - 1] == ' ')) && 'a' <= mbot[k]
198 && mbot[k] <= 'z')
199 mbot[k] += 'A' - 'a';
200 k++;
201 }
202 Sprintf(nb = eos(nb), mbot);
203 } else
204 Sprintf(nb = eos(nb), rank_of(u.ulevel, Role_switch, flags.female));
205
206 if (format == NHSTAT_LINES_4)
207 Sprintf(nb = eos(nb), "\r\n");
208
209 if (ACURR(A_STR) > 18) {
210 if (ACURR(A_STR) > STR18(100))
211 Sprintf(nb = eos(nb), "St:%2d ", ACURR(A_STR) - 100);
212 else if (ACURR(A_STR) < STR18(100))
213 Sprintf(nb = eos(nb), "St:18/%02d ", ACURR(A_STR) - 18);
214 else
215 Sprintf(nb = eos(nb), "St:18/** ");
216 } else
217 Sprintf(nb = eos(nb), "St:%-1d ", ACURR(A_STR));
218 Sprintf(nb = eos(nb), "Dx:%-1d Co:%-1d In:%-1d Wi:%-1d Ch:%-1d",
219 ACURR(A_DEX), ACURR(A_CON), ACURR(A_INT), ACURR(A_WIS),
220 ACURR(A_CHA));
221 Sprintf(nb = eos(nb),
222 (u.ualign.type == A_CHAOTIC)
223 ? " Chaotic"
224 : (u.ualign.type == A_NEUTRAL) ? " Neutral" : " Lawful");
225#ifdef SCORE_ON_BOTL
226 if (flags.showscore)
227 Sprintf(nb = eos(nb), " S:%ld", botl_score());
228#endif
229 if (format == NHSTAT_LINES_4 || format == NHSTAT_LINES_2)
230 strcat(text, "\r\n");
231
232 /* third line */
233 hp = Upolyd ? u.mh : u.uhp;
234 hpmax = Upolyd ? u.mhmax : u.uhpmax;
235

Callers 1

StatusWndProcFunction · 0.85

Calls 6

near_capacityFunction · 0.85
eosFunction · 0.85
rank_ofFunction · 0.85
botl_scoreFunction · 0.85
describe_levelFunction · 0.85
money_cntFunction · 0.85

Tested by

no test coverage detected