Source:SLASH'EM 0.0.7E7F2/spell.h

From NetHackWiki
Jump to: navigation, search

Below is the full text to spell.h from the source code of SLASH'EM 0.0.7E7F2. To link to a particular line, write [[SLASH'EM 0.0.7E7F2/spell.h#line123]], for example.

The latest source code for vanilla NetHack is at Source code.


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.    /*	SCCS Id: @(#)spell.h	3.4	1995/06/01	*/
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.    struct spell {
9.        short	sp_id;			/* spell id (== object.otyp) */
10.       xchar	sp_lev;			/* power level */
11.       int		sp_know;		/* knowlege of spell */
12.   };
13.   
14.   /* levels of memory destruction with a scroll of amnesia */
15.   #define ALL_MAP		0x1
16.   #define ALL_SPELLS	0x2
17.   
18.   #define decrnknow(spell)	spl_book[spell].sp_know--
19.   #define spellid(spell)		spl_book[spell].sp_id
20.   #define spellknow(spell)	spl_book[spell].sp_know
21.   
22.   /* Zap types, also used for explosions */
23.   #define ZT_MAGIC_MISSILE        (AD_MAGM-1)
24.   #define ZT_FIRE                 (AD_FIRE-1)
25.   #define ZT_COLD                 (AD_COLD-1)
26.   #define ZT_SLEEP                (AD_SLEE-1)
27.   #define ZT_DEATH                (AD_DISN-1)     /* or disintegration */
28.   #define ZT_LIGHTNING            (AD_ELEC-1)
29.   #define ZT_POISON_GAS           (AD_DRST-1)
30.   #define ZT_ACID                 (AD_ACID-1)
31.   
32.   #define ZT_LAST                 (ZT_ACID) /*For checking of spells of a type*/
33.   #define ZT_FIRST                (ZT_MAGIC_MISSILE)
34.   /* 8 and 9 are currently unassigned */
35.   
36.   #define ZT_WAND(x)              (x)
37.   #define ZT_SPELL(x)             (10+(x))
38.   #define ZT_BREATH(x)    (20+(x))
39.   #define ZT_MEGA(x)      (30+(x))
40.   #define ZT_MONWAND(x)   (-(30+(x)))
41.   
42.   #endif /* SPELL_H */