Object hits floor at hero's feet. Called from drop(), throwit(), hold_another_object(), litter(). */
| 603 | /* Object hits floor at hero's feet. |
| 604 | Called from drop(), throwit(), hold_another_object(), litter(). */ |
| 605 | void |
| 606 | hitfloor( |
| 607 | struct obj *obj, |
| 608 | boolean verbosely) /* usually True; False if caller has given drop mesg */ |
| 609 | { |
| 610 | if (IS_SOFT(levl[u.ux][u.uy].typ) || u.uinwater || u.uswallow) { |
| 611 | dropy(obj); |
| 612 | return; |
| 613 | } |
| 614 | if (IS_ALTAR(levl[u.ux][u.uy].typ)) { |
| 615 | doaltarobj(obj); |
| 616 | } else if (verbosely) { |
| 617 | const char *verb = (obj->otyp == WAN_STRIKING) ? "strike" : "hit"; |
| 618 | const char *surf = surface(u.ux, u.uy); |
| 619 | struct trap *t = t_at(u.ux, u.uy); |
| 620 | |
| 621 | /* describe something that might keep the object where it is |
| 622 | or precede next message stating that it falls */ |
| 623 | if (t && t->tseen) { |
| 624 | switch (t->ttyp) { |
| 625 | case TRAPDOOR: |
| 626 | surf = "trap door"; |
| 627 | break; |
| 628 | case HOLE: |
| 629 | surf = "edge of the hole"; |
| 630 | break; |
| 631 | case PIT: |
| 632 | case SPIKED_PIT: |
| 633 | surf = "edge of the pit"; |
| 634 | break; |
| 635 | default: |
| 636 | break; |
| 637 | } |
| 638 | } |
| 639 | pline("%s %s the %s.", Doname2(obj), otense(obj, verb), surf); |
| 640 | } |
| 641 | |
| 642 | if (hero_breaks(obj, u.ux, u.uy, BRK_FROM_INV)) |
| 643 | return; |
| 644 | if (ship_object(obj, u.ux, u.uy, FALSE)) |
| 645 | return; |
| 646 | dropz(obj, TRUE); |
| 647 | } |
| 648 | |
| 649 | /* |
| 650 | * Walk a path from src_cc to dest_cc, calling a proc for each location |
no test coverage detected