When digging into location , what are you actually digging into? */
| 166 | |
| 167 | /* When digging into location <x,y>, what are you actually digging into? */ |
| 168 | int |
| 169 | dig_typ(struct obj *otmp, coordxy x, coordxy y) |
| 170 | { |
| 171 | int ltyp; |
| 172 | |
| 173 | if (!isok(x, y) || !otmp || (!is_pick(otmp) && !is_axe(otmp))) |
| 174 | return DIGTYP_UNDIGGABLE; |
| 175 | |
| 176 | ltyp = levl[x][y].typ; |
| 177 | if (is_axe(otmp)) |
| 178 | return closed_door(x, y) ? DIGTYP_DOOR |
| 179 | : IS_TREE(ltyp) ? DIGTYP_TREE /* axe vs tree */ |
| 180 | : DIGTYP_UNDIGGABLE; |
| 181 | /*assert(is_pick(otmp));*/ |
| 182 | return (sobj_at(STATUE, x, y) && pick_can_reach(otmp, x, y)) |
| 183 | ? DIGTYP_STATUE |
| 184 | : (sobj_at(BOULDER, x, y) && pick_can_reach(otmp, x, y)) |
| 185 | ? DIGTYP_BOULDER |
| 186 | : closed_door(x, y) ? DIGTYP_DOOR |
| 187 | : IS_TREE(ltyp) ? DIGTYP_UNDIGGABLE /* pick vs tree */ |
| 188 | : (IS_OBSTRUCTED(ltyp) |
| 189 | && (!svl.level.flags.arboreal || IS_WALL(ltyp))) |
| 190 | ? DIGTYP_ROCK |
| 191 | : DIGTYP_UNDIGGABLE; |
| 192 | } |
| 193 | |
| 194 | boolean |
| 195 | is_digging(void) |
no test coverage detected