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

Function seffects

src/read.c:2193–2291  ·  view source on GitHub ↗

scroll effects; return 1 if we use up the scroll and possibly make it become discovered, 0 if caller should take care of those side-effects */

Source from the content-addressed store, hash-verified

2191/* scroll effects; return 1 if we use up the scroll and possibly make it
2192 become discovered, 0 if caller should take care of those side-effects */
2193int
2194seffects(
2195 struct obj *sobj) /* sobj - scroll or fake spellbook for spell */
2196{
2197 int otyp = sobj->otyp;
2198
2199 if (objects[otyp].oc_magic)
2200 exercise(A_WIS, TRUE); /* just for trying */
2201
2202 switch (otyp) {
2203#ifdef MAIL_STRUCTURES
2204 case SCR_MAIL:
2205 seffect_mail(&sobj);
2206 break;
2207#endif
2208 case SCR_ENCHANT_ARMOR:
2209 seffect_enchant_armor(&sobj);
2210 break;
2211 case SCR_DESTROY_ARMOR:
2212 seffect_destroy_armor(&sobj);
2213 break;
2214 case SCR_CONFUSE_MONSTER:
2215 case SPE_CONFUSE_MONSTER:
2216 seffect_confuse_monster(&sobj);
2217 break;
2218 case SCR_SCARE_MONSTER:
2219 case SPE_CAUSE_FEAR:
2220 seffect_scare_monster(&sobj);
2221 break;
2222 case SCR_BLANK_PAPER:
2223 seffect_blank_paper(&sobj);
2224 break;
2225 case SCR_REMOVE_CURSE:
2226 case SPE_REMOVE_CURSE:
2227 seffect_remove_curse(&sobj);
2228 break;
2229 case SCR_CREATE_MONSTER:
2230 case SPE_CREATE_MONSTER:
2231 seffect_create_monster(&sobj);
2232 break;
2233 case SCR_ENCHANT_WEAPON:
2234 seffect_enchant_weapon(&sobj);
2235 break;
2236 case SCR_TAMING:
2237 case SPE_CHARM_MONSTER:
2238 seffect_taming(&sobj);
2239 break;
2240 case SCR_GENOCIDE:
2241 seffect_genocide(&sobj);
2242 break;
2243 case SCR_LIGHT:
2244 seffect_light(&sobj);
2245 break;
2246 case SCR_TELEPORTATION:
2247 seffect_teleportation(&sobj);
2248 break;
2249 case SCR_GOLD_DETECTION:
2250 seffect_gold_detection(&sobj);

Callers 5

special_throne_effectFunction · 0.85
invoke_tamingFunction · 0.85
domagictrapFunction · 0.85
spelleffectsFunction · 0.85
doreadFunction · 0.85

Calls 15

exerciseFunction · 0.85
seffect_mailFunction · 0.85
seffect_enchant_armorFunction · 0.85
seffect_destroy_armorFunction · 0.85
seffect_confuse_monsterFunction · 0.85
seffect_scare_monsterFunction · 0.85
seffect_blank_paperFunction · 0.85
seffect_remove_curseFunction · 0.85
seffect_create_monsterFunction · 0.85
seffect_enchant_weaponFunction · 0.85
seffect_tamingFunction · 0.85
seffect_genocideFunction · 0.85

Tested by

no test coverage detected