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

Function known_spell

src/spell.c:2362–2375  ·  view source on GitHub ↗

returns one of spe_Unknown, spe_Fresh, spe_GoingStale, spe_Forgotten */

Source from the content-addressed store, hash-verified

2360
2361/* returns one of spe_Unknown, spe_Fresh, spe_GoingStale, spe_Forgotten */
2362int
2363known_spell(short otyp)
2364{
2365 int i, k;
2366
2367 for (i = 0; (i < MAXSPELL) && (spellid(i) != NO_SPELL); i++)
2368 if (spellid(i) == otyp) {
2369 k = spellknow(i);
2370 return (k > KEEN / 10) ? spe_Fresh
2371 : (k > 0) ? spe_GoingStale
2372 : spe_Forgotten;
2373 }
2374 return spe_Unknown;
2375}
2376
2377/* return index for spell otyp, or UNKNOWN_SPELL if not found */
2378int

Callers 7

doteleFunction · 0.85
gcrownuFunction · 0.85
give_spellFunction · 0.85
doturnFunction · 0.85
force_learn_spellFunction · 0.85
jumpFunction · 0.85
dowriteFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected