* Place the ball & chain under the hero. Make sure that the ball & chain * variables are set (actually only needed when blind, but what the heck). * It is assumed that when this is called, the ball and chain are NOT * attached to the object list. * * Should not be called while swallowed except on waterlevel. */
| 117 | * Should not be called while swallowed except on waterlevel. |
| 118 | */ |
| 119 | staticfn void |
| 120 | placebc_core(void) |
| 121 | { |
| 122 | if (!uchain || !uball) { |
| 123 | impossible("Where are your ball and chain?"); |
| 124 | return; |
| 125 | } |
| 126 | |
| 127 | (void) flooreffects(uchain, u.ux, u.uy, ""); /* chain might rust */ |
| 128 | |
| 129 | if (carried(uball)) { /* the ball is carried */ |
| 130 | u.bc_order = BCPOS_DIFFER; |
| 131 | } else { |
| 132 | /* ball might rust -- already checked when carried */ |
| 133 | (void) flooreffects(uball, u.ux, u.uy, ""); |
| 134 | place_object(uball, u.ux, u.uy); |
| 135 | u.bc_order = BCPOS_CHAIN; |
| 136 | } |
| 137 | |
| 138 | place_object(uchain, u.ux, u.uy); |
| 139 | |
| 140 | u.bglyph = u.cglyph = levl[u.ux][u.uy].glyph; /* pick up glyph */ |
| 141 | |
| 142 | newsym(u.ux, u.uy); |
| 143 | bcrestriction = 0; |
| 144 | } |
| 145 | |
| 146 | staticfn void |
| 147 | unplacebc_core(void) |
no test coverage detected