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