| 2508 | } |
| 2509 | |
| 2510 | staticfn boolean |
| 2511 | figurine_location_checks(struct obj *obj, coord *cc, boolean quietly) |
| 2512 | { |
| 2513 | coordxy x, y; |
| 2514 | |
| 2515 | if (carried(obj) && u.uswallow) { |
| 2516 | if (!quietly) |
| 2517 | You("don't have enough room in here."); |
| 2518 | return FALSE; |
| 2519 | } |
| 2520 | x = cc ? cc->x : u.ux; |
| 2521 | y = cc ? cc->y : u.uy; |
| 2522 | if (!isok(x, y)) { |
| 2523 | if (!quietly) |
| 2524 | You("cannot put the figurine there."); |
| 2525 | return FALSE; |
| 2526 | } |
| 2527 | if (IS_OBSTRUCTED(levl[x][y].typ) |
| 2528 | && !(passes_walls(&mons[obj->corpsenm]) && may_passwall(x, y))) { |
| 2529 | if (!quietly) |
| 2530 | You("cannot place a figurine in %s!", |
| 2531 | IS_TREE(levl[x][y].typ) ? "a tree" : "solid rock"); |
| 2532 | return FALSE; |
| 2533 | } |
| 2534 | if (sobj_at(BOULDER, x, y) && !passes_walls(&mons[obj->corpsenm]) |
| 2535 | && !throws_rocks(&mons[obj->corpsenm])) { |
| 2536 | if (!quietly) |
| 2537 | You("cannot fit the figurine on the boulder."); |
| 2538 | return FALSE; |
| 2539 | } |
| 2540 | return TRUE; |
| 2541 | } |
| 2542 | |
| 2543 | staticfn int |
| 2544 | use_figurine(struct obj **optr) |
no test coverage detected