moving with 'm' prefix, bump into a monster? */
| 1922 | |
| 1923 | /* moving with 'm' prefix, bump into a monster? */ |
| 1924 | staticfn boolean |
| 1925 | domove_bump_mon(struct monst *mtmp, int glyph) |
| 1926 | { |
| 1927 | /* If they used a 'm' command, trying to move onto a monster |
| 1928 | * prints the below message and wastes a turn. The exception is |
| 1929 | * if the monster is unseen and the player doesn't remember an |
| 1930 | * invisible monster--then, we fall through to do_attack() and |
| 1931 | * attack_check(), which still wastes a turn, but prints a |
| 1932 | * different message and makes the player remember the monster. |
| 1933 | */ |
| 1934 | if (svc.context.nopick && !svc.context.travel |
| 1935 | && (canspotmon(mtmp) || glyph_is_invisible(glyph) |
| 1936 | || glyph_is_warning(glyph))) { |
| 1937 | if (M_AP_TYPE(mtmp) && !Protection_from_shape_changers |
| 1938 | && !sensemon(mtmp)) |
| 1939 | stumble_onto_mimic(mtmp); |
| 1940 | else if (mtmp->mpeaceful && !Hallucination) |
| 1941 | /* m_monnam(): "dog" or "Fido", no "invisible dog" or "it" */ |
| 1942 | pline("Pardon me, %s.", m_monnam(mtmp)); |
| 1943 | else |
| 1944 | You("move right into %s.", mon_nam(mtmp)); |
| 1945 | return TRUE; |
| 1946 | } |
| 1947 | return FALSE; |
| 1948 | } |
| 1949 | |
| 1950 | /* hero is moving, do we maybe attack a monster at (x,y)? |
| 1951 | returns TRUE if hero movement is used up. |
no test coverage detected