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

Function hliquid

src/do_name.c:1492–1510  ·  view source on GitHub ↗

if hallucinating, return a random liquid instead of 'liquidpref' */

Source from the content-addressed store, hash-verified

1490
1491/* if hallucinating, return a random liquid instead of 'liquidpref' */
1492const char *
1493hliquid(
1494 const char *liquidpref) /* use as-is when not hallucintg (unless empty) */
1495{
1496 boolean hallucinate = Hallucination && !program_state.gameover;
1497
1498 if (hallucinate || !liquidpref || !*liquidpref) {
1499 int indx, count = SIZE(hliquids);
1500
1501 /* if we have a non-hallucinatory default value, include it
1502 among the choices */
1503 if (liquidpref && *liquidpref)
1504 ++count;
1505 indx = rn2_on_display_rng(count);
1506 if (IndexOk(indx, hliquids))
1507 return hliquids[indx];
1508 }
1509 return liquidpref;
1510}
1511
1512/* Aliases for road-runner nemesis
1513 */

Callers 15

dositFunction · 0.85
peffect_waterFunction · 0.85
Amulet_offFunction · 0.85
mhitm_ad_acidFunction · 0.85
passiveFunction · 0.85
mount_steedFunction · 0.85
dismount_steedFunction · 0.85
drop_ballFunction · 0.85
boulder_hits_poolFunction · 0.85
dosinkringFunction · 0.85
trapmoveFunction · 0.85
avoid_moving_on_liquidFunction · 0.85

Calls 1

rn2_on_display_rngFunction · 0.85

Tested by

no test coverage detected