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

Function seffect_magic_mapping

src/read.c:2101–2153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2099}
2100
2101staticfn void
2102seffect_magic_mapping(struct obj **sobjp)
2103{
2104 struct obj *sobj = *sobjp;
2105 boolean is_scroll = (sobj->oclass == SCROLL_CLASS);
2106 boolean sblessed = sobj->blessed;
2107 boolean scursed = sobj->cursed;
2108 boolean confused = (Confusion != 0);
2109 int cval;
2110
2111 if (is_scroll) {
2112 if (svl.level.flags.nommap) {
2113 Your("mind is filled with crazy lines!");
2114 if (Hallucination)
2115 pline("Wow! Modern art.");
2116 else
2117 Your("%s spins in bewilderment.", body_part(HEAD));
2118 make_confused(HConfusion + rnd(30), FALSE);
2119 return;
2120 }
2121 if (sblessed) {
2122 coordxy x, y;
2123
2124 for (x = 1; x < COLNO; x++)
2125 for (y = 0; y < ROWNO; y++)
2126 if (levl[x][y].typ == SDOOR) {
2127 cvt_sdoor_to_door(&levl[x][y]);
2128 if (Is_rogue_level(&u.uz))
2129 unblock_point(x, y);
2130 }
2131 /* do_mapping() already reveals secret passages */
2132 }
2133 gk.known = TRUE;
2134 }
2135
2136 if (svl.level.flags.nommap) {
2137 Your("%s spins as %s blocks the spell!", body_part(HEAD),
2138 something);
2139 make_confused(HConfusion + rnd(30), FALSE);
2140 return;
2141 }
2142 pline("A map coalesces in your mind!");
2143 cval = (scursed && !confused);
2144 if (cval)
2145 HConfusion = 1; /* to screw up map */
2146 notice_mon_off();
2147 do_mapping();
2148 notice_mon_on();
2149 if (cval) {
2150 HConfusion = 0; /* restore */
2151 pline("Unfortunately, you can't grasp the details.");
2152 }
2153}
2154
2155#ifdef MAIL_STRUCTURES
2156staticfn void

Callers 1

seffectsFunction · 0.85

Calls 8

YourFunction · 0.85
body_partFunction · 0.85
make_confusedFunction · 0.85
rndFunction · 0.85
cvt_sdoor_to_doorFunction · 0.85
unblock_pointFunction · 0.85
do_mappingFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected