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

Function seffect_mail

src/read.c:2156–2188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2154
2155#ifdef MAIL_STRUCTURES
2156staticfn void
2157seffect_mail(struct obj **sobjp)
2158{
2159 struct obj *sobj = *sobjp;
2160 boolean odd = (sobj->o_id % 2) == 1;
2161
2162 gk.known = TRUE;
2163 switch (sobj->spe) {
2164 case 2:
2165 /* "stamped scroll" created via magic marker--without a stamp */
2166 pline("This scroll is marked \"%s\".",
2167 odd ? "Postage Due" : "Return to Sender");
2168 break;
2169 case 1:
2170 /* scroll of mail obtained from bones file or from wishing;
2171 note to the puzzled: the game Larn actually sends you junk
2172 mail if you win! */
2173 pline("This seems to be %s.",
2174 odd ? "a chain letter threatening your luck"
2175 : "junk mail addressed to the finder of the Eye of Larn");
2176 break;
2177 default:
2178#ifdef MAIL
2179 readmail(sobj);
2180#else
2181 /* unreachable since with MAIL undefined, sobj->spe won't be 0;
2182 as a precaution, be prepared to give arbitrary feedback;
2183 caller has already reported that it disappears upon reading */
2184 pline("That was a scroll of mail?");
2185#endif
2186 break;
2187 }
2188}
2189#endif /* MAIL_STRUCTURES */
2190
2191/* scroll effects; return 1 if we use up the scroll and possibly make it

Callers 1

seffectsFunction · 0.85

Calls 2

readmailFunction · 0.85
plineFunction · 0.70

Tested by

no test coverage detected