describe a pool location's contents; might return a static buffer so caller should use it or copy it before calling waterbody_name() again [5.0: moved here from mkmaze.c] */
| 558 | caller should use it or copy it before calling waterbody_name() again |
| 559 | [5.0: moved here from mkmaze.c] */ |
| 560 | const char * |
| 561 | waterbody_name(coordxy x, coordxy y) |
| 562 | { |
| 563 | static char pooltype[40]; |
| 564 | schar ltyp; |
| 565 | boolean hallucinate = Hallucination && !program_state.gameover; |
| 566 | |
| 567 | if (!isok(x, y)) |
| 568 | return "drink"; /* should never happen */ |
| 569 | ltyp = SURFACE_AT(x, y); |
| 570 | |
| 571 | if (ltyp == LAVAPOOL) { |
| 572 | Snprintf(pooltype, sizeof pooltype, "molten %s", hliquid("lava")); |
| 573 | return pooltype; |
| 574 | } else if (ltyp == ICE) { |
| 575 | if (!hallucinate) |
| 576 | return "ice"; |
| 577 | Snprintf(pooltype, sizeof pooltype, "frozen %s", hliquid("water")); |
| 578 | return pooltype; |
| 579 | } else if (ltyp == POOL) { |
| 580 | Snprintf(pooltype, sizeof pooltype, "pool of %s", hliquid("water")); |
| 581 | return pooltype; |
| 582 | } else if (ltyp == MOAT) { |
| 583 | /* a bit of extra flavor over general moat */ |
| 584 | if (hallucinate) { |
| 585 | Snprintf(pooltype, sizeof pooltype, "deep %s", hliquid("water")); |
| 586 | return pooltype; |
| 587 | } else if (Is_medusa_level(&u.uz)) { |
| 588 | /* somewhat iffy since ordinary stairs can take you beneath, |
| 589 | but previous generic "water" was rather anti-climactic */ |
| 590 | return "shallow sea"; |
| 591 | } else if (Is_juiblex_level(&u.uz)) { |
| 592 | return "swamp"; |
| 593 | } else if (Role_if(PM_SAMURAI) && Is_qstart(&u.uz)) { |
| 594 | /* samurai quest home level has two isolated moat spots; |
| 595 | they sound silly if farlook describes them as such */ |
| 596 | return "pond"; |
| 597 | } else { |
| 598 | return "moat"; |
| 599 | } |
| 600 | } else if (IS_WATERWALL(ltyp)) { |
| 601 | if (Is_waterlevel(&u.uz)) |
| 602 | return "limitless water"; /* even if hallucinating */ |
| 603 | Snprintf(pooltype, sizeof pooltype, "wall of %s", hliquid("water")); |
| 604 | return pooltype; |
| 605 | } else if (ltyp == LAVAWALL) { |
| 606 | Snprintf(pooltype, sizeof pooltype, "wall of %s", hliquid("lava")); |
| 607 | return pooltype; |
| 608 | } |
| 609 | /* default; should be unreachable */ |
| 610 | return "water"; /* don't hallucinate this as some other liquid */ |
| 611 | } |
| 612 | |
| 613 | char * |
| 614 | ice_descr(coordxy x, coordxy y, char *outbuf) |
no test coverage detected