Source:NetHack 5.0.0/include/spell.h

From NetHackWiki
Jump to navigation Jump to search

Below is the full text to spell.h from the source code of NetHack 5.0.0. To link to a particular line, write [[Source:NetHack 5.0.0/include/spell.h#line12]], for example.

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

1. /* NetHack 5.0	spell.h	$NHDT-Date: 1646838388 2022/03/09 15:06:28 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.14 $ */
2. /* Copyright 1986, M. Stephenson                                  */
3. /* NetHack may be freely redistributed.  See license for details. */
4. 
5. #ifndef SPELL_H
6. #define SPELL_H
7. 
8. #define NO_SPELL 0
9. #define UNKNOWN_SPELL (-1)
10. 
11. /* spellbook re-use control; used when reading and when polymorphing */
12. #define MAX_SPELL_STUDY 3
13. 
14. struct spell {
15.     short sp_id;  /* spell id (== object.otyp) */
16.     xint16 sp_lev; /* power level */
17.     int sp_know;  /* knowledge of spell */
18. };
19. 
20. enum spellknowledge {
21.     spe_Forgotten  = -1, /* known but no longer castable */
22.     spe_Unknown    =  0, /* not yet known */
23.     spe_Fresh      =  1, /* castable if various casting criteria are met */
24.     spe_GoingStale =  2  /* still castable but nearly forgotten */
25. };
26. 
27. /* levels of memory destruction with a scroll of amnesia */
28. #define ALL_MAP 0x1
29. #define ALL_SPELLS 0x2
30. 
31. #define decrnknow(spell) svs.spl_book[spell].sp_know--
32. #define spellid(spell) svs.spl_book[spell].sp_id
33. #define spellknow(spell) svs.spl_book[spell].sp_know
34. 
35. /* how much Pw a spell of level lvl costs to cast? */
36. #define SPELL_LEV_PW(lvl) ((lvl) * 5)
37. 
38. #endif /* SPELL_H */