describe u.utraptype; used by status_enlightenment() and self_lookat() */
| 230 | |
| 231 | /* describe u.utraptype; used by status_enlightenment() and self_lookat() */ |
| 232 | char * |
| 233 | trap_predicament(char *outbuf, int final, boolean wizxtra) |
| 234 | { |
| 235 | struct trap *t; |
| 236 | |
| 237 | /* caller has verified u.utrap */ |
| 238 | *outbuf = '\0'; |
| 239 | switch (u.utraptype) { |
| 240 | case TT_BURIEDBALL: |
| 241 | Strcpy(outbuf, "tethered to something buried"); |
| 242 | break; |
| 243 | case TT_LAVA: |
| 244 | Sprintf(outbuf, "sinking into %s", final ? "lava" : hliquid("lava")); |
| 245 | break; |
| 246 | case TT_INFLOOR: |
| 247 | Sprintf(outbuf, "stuck in %s", the(surface(u.ux, u.uy))); |
| 248 | break; |
| 249 | default: /* TT_BEARTRAP, TT_PIT, or TT_WEB */ |
| 250 | Strcpy(outbuf, "trapped"); |
| 251 | if ((t = t_at(u.ux, u.uy)) != 0) /* should never be null */ |
| 252 | Sprintf(eos(outbuf), " in %s", an(trapname(t->ttyp, FALSE))); |
| 253 | break; |
| 254 | } |
| 255 | if (wizxtra) { /* give extra information for wizard mode enlightenment */ |
| 256 | /* curly braces: u.utrap is an escape attempt counter rather than a |
| 257 | turn timer so use different ornamentation than usual parentheses */ |
| 258 | Sprintf(eos(outbuf), " {%u}", u.utrap); |
| 259 | } |
| 260 | return outbuf; |
| 261 | } |
| 262 | |
| 263 | /* check whether hero is wearing something that player definitely knows |
| 264 | confers the target property; item must have been seen and its type |