MCPcopy Create free account
hub / github.com/NetHack/NetHack / Boots_off

Function Boots_off

src/do_wear.c:261–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

259}
260
261int
262Boots_off(void)
263{
264 struct obj *otmp = uarmf;
265 int otyp = otmp->otyp;
266 long oldprop = u.uprops[objects[otyp].oc_oprop].extrinsic & ~WORN_BOOTS;
267
268 svc.context.takeoff.mask &= ~W_ARMF;
269 /* For levitation, float_down() returns if Levitation, so we
270 * must do a setworn() _before_ the levitation case.
271 */
272 setworn((struct obj *) 0, W_ARMF);
273 switch (otyp) {
274 case SPEED_BOOTS:
275 if (!Very_fast && !svc.context.takeoff.cancelled_don) {
276 makeknown(otyp);
277 You_feel("yourself slow down%s.", Fast ? " a bit" : "");
278 }
279 break;
280 case WATER_WALKING_BOOTS:
281 /* check for lava since fireproofed boots make it viable */
282 if ((is_pool(u.ux, u.uy) || is_lava(u.ux, u.uy))
283 && !Levitation && !Flying
284 && !(is_clinger(gy.youmonst.data) && has_ceiling(&u.uz))
285 && !svc.context.takeoff.cancelled_don
286 /* avoid recursive call to lava_effects() */
287 && !iflags.in_lava_effects) {
288 /* make boots known in case you survive the drowning */
289 makeknown(otyp);
290 spoteffects(TRUE);
291 }
292 break;
293 case ELVEN_BOOTS:
294 toggle_stealth(otmp, oldprop, FALSE);
295 break;
296 case FUMBLE_BOOTS:
297 if (!oldprop && !(HFumbling & ~TIMEOUT))
298 HFumbling = EFumbling = 0;
299 break;
300 case LEVITATION_BOOTS:
301 if (!oldprop && !HLevitation && !(BLevitation & FROMOUTSIDE)
302 && !svc.context.takeoff.cancelled_don) {
303 /* lava_effects() sets in_lava_effects and calls Boots_off()
304 so hero is already in midst of floating down */
305 if (!iflags.in_lava_effects)
306 (void) float_down(0L, 0L);
307 makeknown(otyp);
308 } else {
309 float_vs_flight(); /* maybe toggle (BFlying & I_SPECIAL) */
310 }
311 break;
312 case LOW_BOOTS:
313 case IRON_SHOES:
314 case HIGH_BOOTS:
315 case JUMPING_BOOTS:
316 case KICKING_BOOTS:
317 break;
318 default:

Callers 7

remove_worn_itemFunction · 0.85
armoroffFunction · 0.85
do_takeoffFunction · 0.85
wornarm_destroyedFunction · 0.85
dosinkfallFunction · 0.85
break_armorFunction · 0.85
lava_effectsFunction · 0.85

Calls 10

setwornFunction · 0.85
You_feelFunction · 0.85
is_poolFunction · 0.85
is_lavaFunction · 0.85
has_ceilingFunction · 0.85
spoteffectsFunction · 0.85
toggle_stealthFunction · 0.85
float_downFunction · 0.85
float_vs_flightFunction · 0.85
impossibleFunction · 0.70

Tested by

no test coverage detected