MCPcopy Index your code
hub / github.com/NetHack/NetHack / float_vs_flight

Function float_vs_flight

src/polyself.c:130–154  ·  view source on GitHub ↗

Levitation overrides Flying; set or clear BFlying|I_SPECIAL */

Source from the content-addressed store, hash-verified

128
129/* Levitation overrides Flying; set or clear BFlying|I_SPECIAL */
130void
131float_vs_flight(void)
132{
133 boolean stuck_in_floor = (u.utrap && u.utraptype != TT_PIT);
134
135 /* floating overrides flight; so does being trapped in the floor */
136 if ((HLevitation || ELevitation)
137 || ((HFlying || EFlying) && stuck_in_floor))
138 BFlying |= I_SPECIAL;
139 else
140 BFlying &= ~I_SPECIAL;
141 /* being trapped on the ground (bear trap, web, molten lava survived
142 with fire resistance, former lava solidified via cold, tethered
143 to a buried iron ball) overrides floating--the floor is reachable */
144 if ((HLevitation || ELevitation) && stuck_in_floor)
145 BLevitation |= I_SPECIAL;
146 else
147 BLevitation &= ~I_SPECIAL;
148
149 /* riding blocks stealth unless hero+steed fly, so a change in flying
150 might cause a change in stealth */
151 steed_vs_stealth();
152
153 disp.botl = TRUE;
154}
155
156/* riding blocks stealth unless hero+steed fly */
157void

Callers 15

peffect_levitationFunction · 0.85
Boots_onFunction · 0.85
Boots_offFunction · 0.85
Amulet_onFunction · 0.85
Amulet_offFunction · 0.85
Ring_onFunction · 0.85
Ring_off_or_goneFunction · 0.85
dosinkfallFunction · 0.85
switch_terrainFunction · 0.85
weight_capFunction · 0.85
wiz_intrinsicFunction · 0.85
set_uasmonFunction · 0.85

Calls 1

steed_vs_stealthFunction · 0.85

Tested by

no test coverage detected