Source:SLASH'EM 0.0.7E7F2/eshk.h

From NetHackWiki
Jump to navigation Jump to search

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

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: @(#)eshk.h	3.4	1997/05/01	*/
2.    /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3.    /* NetHack may be freely redistributed.  See license for details. */
4.    
5.    #ifndef ESHK_H
6.    #define ESHK_H
7.    
8.    #define REPAIR_DELAY	5	/* minimum delay between shop damage & repair */
9.    
10.   #define BILLSZ	200
11.   
12.   struct bill_x {
13.   	unsigned bo_id;
14.   	boolean useup;
15.   	long price;		/* price per unit */
16.   	long bquan;		/* amount used up */
17.   };
18.   
19.   struct eshk {
20.   	long robbed;		/* amount stolen by most recent customer */
21.   	long credit;		/* amount credited to customer */
22.   	long debit;		/* amount of debt for using unpaid items */
23.   	long loan;		/* shop-gold picked (part of debit) */
24.   	int shoptype;		/* the value of rooms[shoproom].rtype */
25.   	schar shoproom;		/* index in rooms; set by inshop() */
26.   	schar unused;		/* to force alignment for stupid compilers */
27.   	boolean following;	/* following customer since he owes us sth */
28.   	boolean surcharge;	/* angry shk inflates prices */
29.   	coord shk;		/* usual position shopkeeper */
30.   	coord shd;		/* position shop door */
31.   	d_level shoplevel;	/* level (& dungeon) of his shop */
32.   	int billct;		/* no. of entries of bill[] in use */
33.   	struct bill_x bill[BILLSZ];
34.   	struct bill_x *bill_p;
35.   	int visitct;		/* nr of visits by most recent customer */
36.   	char customer[PL_NSIZ];	/* most recent customer */
37.   	char shknam[PL_NSIZ];
38.   #ifdef OTHER_SERVICES
39.   	long services;          /* Services offered */
40.   #define SHK_ID_BASIC    01L
41.   #define SHK_ID_PREMIUM  02L
42.   #define SHK_UNCURSE     010L
43.   #define SHK_APPRAISE    0100L
44.   #define SHK_SPECIAL_A   01000L
45.   #define SHK_SPECIAL_B   02000L
46.   #define SHK_SPECIAL_C   04000L
47.   #endif
48.   };
49.   
50.   #define ESHK(mon)	((struct eshk *)&(mon)->mextra[0])
51.   
52.   #define NOTANGRY(mon)	((mon)->mpeaceful)
53.   #define ANGRY(mon)	(!NOTANGRY(mon))
54.   
55.   # ifdef OTHER_SERVICES
56.   #define SHK_NOMATCH     0       /* Shk !know this class of object       */
57.   #define SHK_MATCH       1       /* Shk is expert                        */
58.   #define SHK_GENERAL     2       /* Shk runs a general store             */
59.   
60.   /*
61.    * FUNCTION shk_class_match
62.    *
63.    * Return TRUE if a object class matches the shop type.
64.    * I.e. shk_class_match(WEAPON_CLASS, shkp)
65.    *
66.    * Return:      SHK_MATCH, SHK_NOMATCH, SHK_GENERAL
67.    */
68.   
69.   #define shk_class_match(class, shkp) \
70.           ((shtypes[ESHK(shkp)->shoptype-SHOPBASE].symb == RANDOM_CLASS) ? \
71.                   SHK_GENERAL : \
72.            ((shtypes[ESHK(shkp)->shoptype-SHOPBASE].symb == class) ? \
73.                   SHK_MATCH : SHK_NOMATCH))
74.   # endif
75.   
76.   #endif /* ESHK_H */