can monster touch object safely? */
| 1955 | |
| 1956 | /* can monster touch object safely? */ |
| 1957 | boolean |
| 1958 | can_touch_safely(struct monst *mtmp, struct obj *otmp) |
| 1959 | { |
| 1960 | int otyp = otmp->otyp; |
| 1961 | struct permonst *mdat = mtmp->data; |
| 1962 | |
| 1963 | if (otyp == CORPSE && touch_petrifies(&mons[otmp->corpsenm]) |
| 1964 | && !(mtmp->misc_worn_check & W_ARMG) && !resists_ston(mtmp)) |
| 1965 | return FALSE; |
| 1966 | if (otyp == CORPSE && is_rider(&mons[otmp->corpsenm])) |
| 1967 | return FALSE; |
| 1968 | if (objects[otyp].oc_material == SILVER && mon_hates_silver(mtmp) |
| 1969 | && (otyp != BELL_OF_OPENING || !is_covetous(mdat))) |
| 1970 | return FALSE; |
| 1971 | if (!touch_artifact(otmp, mtmp)) |
| 1972 | return FALSE; |
| 1973 | return TRUE; |
| 1974 | } |
| 1975 | |
| 1976 | /* for restricting monsters' object-pickup. |
| 1977 | * |
no test coverage detected