migration destination for objects which fall down to next level */
| 1940 | |
| 1941 | /* migration destination for objects which fall down to next level */ |
| 1942 | schar |
| 1943 | down_gate(coordxy x, coordxy y) |
| 1944 | { |
| 1945 | struct trap *ttmp; |
| 1946 | stairway *stway = stairway_at(x, y); |
| 1947 | |
| 1948 | gg.gate_str = 0; |
| 1949 | /* this matches the player restriction in goto_level() */ |
| 1950 | if (on_level(&u.uz, &qstart_level) && !ok_to_quest()) { |
| 1951 | return MIGR_NOWHERE; |
| 1952 | } |
| 1953 | if (stway && !stway->up && !stway->isladder) { |
| 1954 | gg.gate_str = "down the stairs"; |
| 1955 | return (stway->tolev.dnum == u.uz.dnum) ? MIGR_STAIRS_UP |
| 1956 | : MIGR_SSTAIRS; |
| 1957 | } |
| 1958 | if (stway && !stway->up && stway->isladder) { |
| 1959 | gg.gate_str = "down the ladder"; |
| 1960 | return MIGR_LADDER_UP; |
| 1961 | } |
| 1962 | /* hole will always be flagged as seen; trap drop might or might not */ |
| 1963 | if ((ttmp = t_at(x, y)) != 0 && ttmp->tseen && is_hole(ttmp->ttyp)) { |
| 1964 | gg.gate_str = (ttmp->ttyp == TRAPDOOR) ? "through the trap door" |
| 1965 | : "through the hole"; |
| 1966 | return MIGR_RANDOM; |
| 1967 | } |
| 1968 | return MIGR_NOWHERE; |
| 1969 | } |
| 1970 | |
| 1971 | /*dokick.c*/ |
no test coverage detected