| 2038 | } |
| 2039 | |
| 2040 | staticfn boolean |
| 2041 | able_to_loot( |
| 2042 | coordxy x, coordxy y, |
| 2043 | boolean looting) /* loot vs tip */ |
| 2044 | { |
| 2045 | const char *verb = looting ? "loot" : "tip"; |
| 2046 | struct trap *t = t_at(x, y); |
| 2047 | |
| 2048 | if (!can_reach_floor(t && is_pit(t->ttyp))) { |
| 2049 | if (u.usteed && P_SKILL(P_RIDING) < P_BASIC) |
| 2050 | rider_cant_reach(); /* not skilled enough to reach */ |
| 2051 | else |
| 2052 | cant_reach_floor(x, y, FALSE, TRUE, FALSE); |
| 2053 | return FALSE; |
| 2054 | } else if ((is_pool(x, y) && (looting || !Underwater)) || is_lava(x, y)) { |
| 2055 | /* at present, can't loot in water even when Underwater; |
| 2056 | can tip underwater, but not when over--or stuck in--lava */ |
| 2057 | You("cannot %s things that are deep in the %s.", verb, |
| 2058 | hliquid(is_lava(x, y) ? "lava" : "water")); |
| 2059 | return FALSE; |
| 2060 | } else if (nolimbs(gy.youmonst.data)) { |
| 2061 | pline("Without limbs, you cannot %s anything.", verb); |
| 2062 | return FALSE; |
| 2063 | } else if (looting && !freehand()) { |
| 2064 | pline("Without a free %s, you cannot loot anything.", |
| 2065 | body_part(HAND)); |
| 2066 | return FALSE; |
| 2067 | } |
| 2068 | return TRUE; |
| 2069 | } |
| 2070 | |
| 2071 | staticfn boolean |
| 2072 | mon_beside(coordxy x, coordxy y) |
no test coverage detected