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

Function check_strangling

src/polyself.c:167–194  ·  view source on GitHub ↗

for changing into form that's immune to strangulation */

Source from the content-addressed store, hash-verified

165
166/* for changing into form that's immune to strangulation */
167staticfn void
168check_strangling(boolean on)
169{
170 /* on -- maybe resume strangling */
171 if (on) {
172 boolean was_strangled = (Strangled != 0L);
173
174 /* when Strangled is already set, polymorphing from one
175 vulnerable form into another causes the counter to be reset */
176 if (uamul && uamul->otyp == AMULET_OF_STRANGULATION
177 && can_be_strangled(&gy.youmonst)) {
178 Strangled = 6L;
179 disp.botl = TRUE;
180 Your("%s %s your %s!", simpleonames(uamul),
181 was_strangled ? "still constricts" : "begins constricting",
182 body_part(NECK)); /* "throat" */
183 makeknown(AMULET_OF_STRANGULATION);
184 }
185
186 /* off -- maybe block strangling */
187 } else {
188 if (Strangled && !can_be_strangled(&gy.youmonst)) {
189 Strangled = 0L;
190 disp.botl = TRUE;
191 You("are no longer being strangled.");
192 }
193 }
194}
195
196DISABLE_WARNING_FORMAT_NONLITERAL
197

Callers 2

polymanFunction · 0.85
polymonFunction · 0.85

Calls 5

can_be_strangledFunction · 0.85
YourFunction · 0.85
simpleonamesFunction · 0.85
body_partFunction · 0.85
YouFunction · 0.85

Tested by

no test coverage detected