Source:NetHack 3.4.3/include/eshk.h

From NetHackWiki
(Redirected from Eshk.h)
Jump to: navigation, search

Below is the full text to include/eshk.h from NetHack 3.4.3. To link to a particular line, write {{sourcecode|eshk.h|123}}, for example.

  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. */

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. #ifndef ESHK_H
  2. #define ESHK_H
  3.  
  4. #define REPAIR_DELAY	5	/* minimum delay between shop damage & repair */
  5.  
  6. #define BILLSZ	200

Each shopkeeper has a fixed-length array to track what you owe them. If your bill exceeds this length, the shopkeeper will not charge you. (shk.c, line 2093, shk.c, line 2210)

  1. struct bill_x {
  2. 	unsigned bo_id;
  3. 	boolean useup;
  4. 	long price;		/* price per unit */
  5. 	long bquan;		/* amount used up */
  6. };
  7.  
  8. struct eshk {
  9. 	long robbed;		/* amount stolen by most recent customer */
  10. 	long credit;		/* amount credited to customer */
  11. 	long debit;		/* amount of debt for using unpaid items */
  12. 	long loan;		/* shop-gold picked (part of debit) */
  13. 	int shoptype;		/* the value of rooms[shoproom].rtype */
  14. 	schar shoproom;		/* index in rooms; set by inshop() */
  15. 	schar unused;		/* to force alignment for stupid compilers */
  16. 	boolean following;	/* following customer since he owes us sth */
  17. 	boolean surcharge;	/* angry shk inflates prices */
  18. 	coord shk;		/* usual position shopkeeper */
  19. 	coord shd;		/* position shop door */
  20. 	d_level shoplevel;	/* level (& dungeon) of his shop */
  21. 	int billct;		/* no. of entries of bill[] in use */
  22. 	struct bill_x bill[BILLSZ];
  23. 	struct bill_x *bill_p;
  24. 	int visitct;		/* nr of visits by most recent customer */
  25. 	char customer[PL_NSIZ]; /* most recent customer */
  26. 	char shknam[PL_NSIZ];
  27. };
  28.  
  29. #define ESHK(mon)	((struct eshk *)&(mon)->mextra[0])
  30.  
  31. #define NOTANGRY(mon)	((mon)->mpeaceful)
  32. #define ANGRY(mon)	(!NOTANGRY(mon))
  33.  
  34. #endif /* ESHK_H */