called during each move whilst opening a tin */
| 1700 | |
| 1701 | /* called during each move whilst opening a tin */ |
| 1702 | staticfn int |
| 1703 | opentin(void) |
| 1704 | { |
| 1705 | /* perhaps it was stolen (although that should cause interruption) */ |
| 1706 | if (!carried(svc.context.tin.tin) |
| 1707 | && (!obj_here(svc.context.tin.tin, u.ux, u.uy) |
| 1708 | || !can_reach_floor(TRUE))) |
| 1709 | return 0; /* %% probably we should use tinoid */ |
| 1710 | if (svc.context.tin.usedtime++ >= 50) { |
| 1711 | You("give up your attempt to open the tin."); |
| 1712 | return 0; |
| 1713 | } |
| 1714 | if (svc.context.tin.usedtime < svc.context.tin.reqtime) |
| 1715 | return 1; /* still busy */ |
| 1716 | |
| 1717 | consume_tin("You succeed in opening the tin."); |
| 1718 | return 0; |
| 1719 | } |
| 1720 | |
| 1721 | /* called when starting to open a tin */ |
| 1722 | staticfn void |
nothing calls this directly
no test coverage detected