Source:NetHack 3.4.3/include/trap.h

From NetHackWiki
Jump to: navigation, search

Below is the full text to include/trap.h from NetHack 3.4.3. To link to a particular line, write [[trap.h#line123]], for example.

  1. /*	SCCS Id: @(#)trap.h	3.4	2000/08/30	*/
  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. /* note for 3.1.0 and later: no longer manipulated by 'makedefs' */
  2.  
  3. #ifndef TRAP_H
  4. #define TRAP_H
  5.  
  6. union vlaunchinfo {
  7. 	short v_launch_otyp;	/* type of object to be triggered */
  8. 	coord v_launch2;	/* secondary launch point (for boulders) */
  9. };
  10.  
  11. struct trap {
  12. 	struct trap *ntrap;
  13. 	xchar tx,ty;
  14. 	d_level dst;	/* destination for portals */
  15. 	coord launch;
  16. 	Bitfield(ttyp,5);
  17. 	Bitfield(tseen,1);
  18. 	Bitfield(once,1);
  19. 	Bitfield(madeby_u,1); /* So monsters may take offence when you trap
  20. 				 them.	Recognizing who made the trap isn't
  21. 				 completely unreasonable, everybody has
  22. 				 their own style.  This flag is also needed
  23. 				 when you untrap a monster.  It would be too
  24. 				 easy to make a monster peaceful if you could
  25. 				 set a trap for it and then untrap it. */
  26. 	union vlaunchinfo vl;
  27. #define launch_otyp	vl.v_launch_otyp
  28. #define launch2		vl.v_launch2
  29. };
  30.  
  31. extern struct trap *ftrap;
  32. #define newtrap()	(struct trap *) alloc(sizeof(struct trap))
  33. #define dealloc_trap(trap) free((genericptr_t) (trap))
  34.  
  35. /* reasons for statue animation */
  36. #define ANIMATE_NORMAL	0
  37. #define ANIMATE_SHATTER 1
  38. #define ANIMATE_SPELL	2
  39.  
  40. /* reasons for animate_statue's failure */
  41. #define AS_OK		 0	/* didn't fail */
  42. #define AS_NO_MON	 1	/* makemon failed */
  43. #define AS_MON_IS_UNIQUE 2	/* statue monster is unique */
  44.  
  45. /* Note: if adding/removing a trap, adjust trap_engravings[] in mklev.c */
  46.  
  47. /* unconditional traps */
  48. #define NO_TRAP		0
  49. #define ARROW_TRAP	1
  50. #define DART_TRAP	2
  51. #define ROCKTRAP	3
  52. #define SQKY_BOARD	4
  53. #define BEAR_TRAP	5
  54. #define LANDMINE	6
  55. #define ROLLING_BOULDER_TRAP	7
  56. #define SLP_GAS_TRAP	8
  57. #define RUST_TRAP	9
  58. #define FIRE_TRAP	10
  59. #define PIT		11
  60. #define SPIKED_PIT	12
  61. #define HOLE		13
  62. #define TRAPDOOR	14
  63. #define TELEP_TRAP	15
  64. #define LEVEL_TELEP	16
  65. #define MAGIC_PORTAL	17
  66. #define WEB		18
  67. #define STATUE_TRAP	19
  68. #define MAGIC_TRAP	20
  69. #define ANTI_MAGIC	21
  70. #define POLY_TRAP	22
  71. #define TRAPNUM 23
  72.  
  73. #endif /* TRAP_H */