| 1822 | } |
| 1823 | |
| 1824 | staticfn int |
| 1825 | trapeffect_pit( |
| 1826 | struct monst *mtmp, |
| 1827 | struct trap *trap, |
| 1828 | unsigned int trflags) |
| 1829 | { |
| 1830 | int ttype = trap->ttyp; |
| 1831 | /* relevant_spikes is initially always true for spiked pits, but |
| 1832 | set to false if the spikes are found to not be relevant */ |
| 1833 | boolean relevant_spikes = ttype == SPIKED_PIT; |
| 1834 | |
| 1835 | if (mtmp == &gy.youmonst) { |
| 1836 | boolean plunged = (trflags & TOOKPLUNGE) != 0; |
| 1837 | boolean viasitting = (trflags & VIASITTING) != 0; |
| 1838 | boolean conj_pit = conjoined_pits(trap, t_at(u.ux0, u.uy0), TRUE); |
| 1839 | boolean adj_pit = adj_nonconjoined_pit(trap); |
| 1840 | boolean already_known = trap->tseen ? TRUE : FALSE; |
| 1841 | boolean deliberate = FALSE; |
| 1842 | int steed_article = ARTICLE_THE; |
| 1843 | |
| 1844 | /* suppress article in various steed messages when using its |
| 1845 | name (which won't occur when hallucinating) */ |
| 1846 | if (u.usteed && has_mgivenname(u.usteed) && !Hallucination) |
| 1847 | steed_article = ARTICLE_NONE; |
| 1848 | |
| 1849 | /* KMH -- You can't escape the Sokoban level traps */ |
| 1850 | if (!Sokoban && (Levitation || (Flying && !plunged && !viasitting))) |
| 1851 | return Trap_Effect_Finished; |
| 1852 | feeltrap(trap); |
| 1853 | if (!Sokoban && is_clinger(gy.youmonst.data) && !plunged) { |
| 1854 | if (already_known) { |
| 1855 | You_see("%s %spit below you.", a_your[trap->madeby_u], |
| 1856 | ttype == SPIKED_PIT ? "spiked " : ""); |
| 1857 | } else { |
| 1858 | pline("%s pit %sopens up under you!", A_Your[trap->madeby_u], |
| 1859 | ttype == SPIKED_PIT ? "full of spikes " : ""); |
| 1860 | You("don't fall in!"); |
| 1861 | } |
| 1862 | return Trap_Effect_Finished; |
| 1863 | } |
| 1864 | if (!Sokoban) { |
| 1865 | char verbbuf[BUFSZ]; |
| 1866 | |
| 1867 | *verbbuf = '\0'; |
| 1868 | if (u.usteed) { |
| 1869 | if ((trflags & RECURSIVETRAP) != 0) |
| 1870 | Sprintf(verbbuf, "and %s fall", |
| 1871 | x_monnam(u.usteed, steed_article, (char *) 0, |
| 1872 | SUPPRESS_SADDLE, FALSE)); |
| 1873 | else |
| 1874 | Sprintf(verbbuf, "lead %s", |
| 1875 | x_monnam(u.usteed, steed_article, "poor", |
| 1876 | SUPPRESS_SADDLE, FALSE)); |
| 1877 | } else if (iflags.menu_requested && already_known) { |
| 1878 | You("carefully %s into the pit.", |
| 1879 | u_locomotion("lower yourself")); |
| 1880 | deliberate = TRUE; |
| 1881 | } else if (conj_pit) { |
no test coverage detected