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

Function levitation_dialogue

src/timeout.c:352–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350};
351
352staticfn void
353levitation_dialogue(void)
354{
355 /* -1 because the last message comes via float_down() */
356 long i = (((HLevitation & TIMEOUT) - 1L) / 2L);
357
358 if (ELevitation)
359 return;
360
361 if (!ACCESSIBLE(levl[u.ux][u.uy].typ)
362 && !is_pool_or_lava(u.ux,u.uy))
363 return;
364
365 if (((HLevitation & TIMEOUT) % 2L) && i > 0L && i <= SIZE(levi_texts)) {
366 const char *s = levi_texts[SIZE(levi_texts) - i];
367
368 if (strchr(s, '%')) {
369 boolean danger = (is_pool_or_lava(u.ux, u.uy)
370 && !Is_waterlevel(&u.uz));
371
372 urgent_pline(s, danger ? "over" : "in",
373 danger ? surface(u.ux, u.uy) : "air");
374 } else
375 pline1(s);
376 stop_occupation();
377 }
378}
379
380static NEARDATA const char *const slime_texts[] = {
381 "You are turning a little %s.", /* 5 */

Callers 1

nh_timeoutFunction · 0.85

Calls 4

is_pool_or_lavaFunction · 0.85
urgent_plineFunction · 0.85
surfaceFunction · 0.85
stop_occupationFunction · 0.85

Tested by

no test coverage detected