| 599 | } |
| 600 | |
| 601 | void |
| 602 | fall_through( |
| 603 | boolean td, /* td == TRUE : trap door or hole */ |
| 604 | unsigned ftflags) |
| 605 | { |
| 606 | d_level dtmp; |
| 607 | char msgbuf[BUFSZ]; |
| 608 | const char *dont_fall = 0; |
| 609 | int newlevel; |
| 610 | struct trap *t = (struct trap *) 0; |
| 611 | boolean controlled_flight = FALSE; |
| 612 | |
| 613 | /* we'll fall even while levitating in Sokoban; otherwise, if we |
| 614 | won't fall and won't be told that we aren't falling, give up now */ |
| 615 | if (Blind && Levitation && !Sokoban) |
| 616 | return; |
| 617 | |
| 618 | newlevel = dunlev(&u.uz); /* current level */ |
| 619 | newlevel++; |
| 620 | |
| 621 | if (td) { |
| 622 | t = t_at(u.ux, u.uy); |
| 623 | feeltrap(t); |
| 624 | if (!Sokoban && !(ftflags & TOOKPLUNGE)) { |
| 625 | if (t->ttyp == TRAPDOOR) |
| 626 | pline("A trap door opens up under you!"); |
| 627 | else |
| 628 | pline("There's a gaping hole under you!"); |
| 629 | } |
| 630 | } else |
| 631 | pline_The("%s opens up under you!", surface(u.ux, u.uy)); |
| 632 | |
| 633 | if (Sokoban && Can_fall_thru(&u.uz)) { |
| 634 | ; /* KMH -- You can't escape the Sokoban level traps */ |
| 635 | } else if (Levitation || u.ustuck |
| 636 | || (!Can_fall_thru(&u.uz) && !levl[u.ux][u.uy].candig) |
| 637 | || ((Flying || is_clinger(gy.youmonst.data) |
| 638 | || (ceiling_hider(gy.youmonst.data) && u.uundetected)) |
| 639 | && !(ftflags & TOOKPLUNGE))) { |
| 640 | dont_fall = "don't fall in."; |
| 641 | } else if (gy.youmonst.data->msize >= MZ_HUGE) { |
| 642 | dont_fall = "don't fit through."; |
| 643 | } else if (!next_to_u()) { |
| 644 | dont_fall = "are jerked back by your pet!"; |
| 645 | } |
| 646 | if (dont_fall) { |
| 647 | You1(dont_fall); |
| 648 | /* hero didn't fall through, but any objects here might */ |
| 649 | impact_drop((struct obj *) 0, u.ux, u.uy, 0); |
| 650 | if (!td) { |
| 651 | display_nhwindow(WIN_MESSAGE, FALSE); |
| 652 | pline_The("opening under you closes up."); |
| 653 | } |
| 654 | return; |
| 655 | } |
| 656 | if ((Flying || is_clinger(gy.youmonst.data)) |
| 657 | && (ftflags & TOOKPLUNGE) && td && t) { |
| 658 | if (Flying) |
no test coverage detected