define in botl.c */
| 176 | extern const char *hu_stat[]; /* defined in eat.c */ |
| 177 | extern const char *enc_stat[]; /* define in botl.c */ |
| 178 | void |
| 179 | FormatStatusString(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 |
no test coverage detected