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

Function Boots_on

src/do_wear.c:186–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

184 */
185
186int
187Boots_on(void)
188{
189 long oldprop =
190 u.uprops[objects[uarmf->otyp].oc_oprop].extrinsic & ~WORN_BOOTS;
191
192 switch (uarmf->otyp) {
193 case LOW_BOOTS:
194 case IRON_SHOES:
195 case HIGH_BOOTS:
196 case JUMPING_BOOTS:
197 case KICKING_BOOTS:
198 break;
199 case WATER_WALKING_BOOTS:
200 /*
201 * Sequencing issue? If underwater (perhaps via magical breathing),
202 * putting on water walking boots produces "you slowly rise above
203 * the surface" then "you finish your dressing maneuver".
204 */
205
206 /* spoteffects() doesn't get called here; pooleffects() is called
207 during movement and u.uinwater is already False after setworn() */
208 if (u.uinwater)
209 spoteffects(TRUE);
210 /* init'd in accessory_or_armor_on() and only used here */
211 if (gw.wasinwater) {
212 if (!u.uinwater)
213 makeknown(WATER_WALKING_BOOTS);
214 gw.wasinwater = 0U;
215 }
216 /* (we don't need a lava check here since boots can't be
217 put on while feet are stuck) */
218 break;
219 case SPEED_BOOTS:
220 /* Speed boots are still better than intrinsic speed, */
221 /* though not better than potion speed */
222 if (!oldprop && !(HFast & TIMEOUT)) {
223 makeknown(uarmf->otyp);
224 You_feel("yourself speed up%s.",
225 (oldprop || HFast) ? " a bit more" : "");
226 }
227 break;
228 case ELVEN_BOOTS:
229 toggle_stealth(uarmf, oldprop, TRUE);
230 break;
231 case FUMBLE_BOOTS:
232 if (!oldprop && !(HFumbling & ~TIMEOUT))
233 incr_itimeout(&HFumbling, rnd(20));
234 break;
235 case LEVITATION_BOOTS:
236 if (!oldprop && !HLevitation && !(BLevitation & FROMOUTSIDE)) {
237 uarmf->known = 1; /* might come off if putting on over a sink,
238 * so uarmf could be Null below; status line
239 * gets updated during brief interval they're
240 * worn so hero and player learn enchantment */
241 disp.botl = TRUE; /* status hilites might mark AC changed */
242 makeknown(uarmf->otyp);
243 float_up();

Callers 1

set_wearFunction · 0.85

Calls 9

spoteffectsFunction · 0.85
You_feelFunction · 0.85
toggle_stealthFunction · 0.85
incr_itimeoutFunction · 0.85
rndFunction · 0.85
float_upFunction · 0.85
float_vs_flightFunction · 0.85
update_inventoryFunction · 0.85
impossibleFunction · 0.70

Tested by

no test coverage detected