SWITCH.H 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. /*
  2. THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
  3. SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO
  4. END-USERS, AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN, GRANTS A
  5. ROYALTY-FREE, PERPETUAL LICENSE TO SUCH END-USERS FOR USE BY SUCH END-USERS
  6. IN USING, DISPLAYING, AND CREATING DERIVATIVE WORKS THEREOF, SO LONG AS
  7. SUCH USE, DISPLAY OR CREATION IS FOR NON-COMMERCIAL, ROYALTY OR REVENUE
  8. FREE PURPOSES. IN NO EVENT SHALL THE END-USER USE THE COMPUTER CODE
  9. CONTAINED HEREIN FOR REVENUE-BEARING PURPOSES. THE END-USER UNDERSTANDS
  10. AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE.
  11. COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED.
  12. */
  13. /*
  14. * $Source: f:/miner/source/main/rcs/switch.h $
  15. * $Revision: 2.0 $
  16. * $Author: john $
  17. * $Date: 1995/02/27 11:26:52 $
  18. *
  19. * Triggers and Switches.
  20. *
  21. * $Log: switch.h $
  22. * Revision 2.0 1995/02/27 11:26:52 john
  23. * New version 2.0, which has no anonymous unions, builds with
  24. * Watcom 10.0, and doesn't require parsing BITMAPS.TBL.
  25. *
  26. * Revision 1.19 1995/01/12 17:00:36 rob
  27. * Fixed a problem with switches and secret levels.
  28. *
  29. * Revision 1.18 1994/10/06 21:24:40 matt
  30. * Added switch for exit to secret level
  31. *
  32. * Revision 1.17 1994/09/29 17:05:52 matt
  33. * Removed unused constant
  34. *
  35. * Revision 1.16 1994/09/24 17:10:07 yuan
  36. * Added Matcen triggers.
  37. *
  38. * Revision 1.15 1994/08/15 18:06:39 yuan
  39. * Added external trigger.
  40. *
  41. * Revision 1.14 1994/06/16 16:20:52 john
  42. * Made player start out in physics mode; Neatend up game loop a bit.
  43. *
  44. * Revision 1.13 1994/05/30 20:22:08 yuan
  45. * New triggers.
  46. *
  47. * Revision 1.12 1994/05/27 10:32:44 yuan
  48. * New dialog boxes (Walls and Triggers) added.
  49. *
  50. *
  51. * Revision 1.11 1994/05/25 18:06:32 yuan
  52. * Making new dialog box controls for walls and triggers.
  53. *
  54. * Revision 1.10 1994/04/28 18:04:40 yuan
  55. * Gamesave added.
  56. * Trigger problem fixed (seg pointer is replaced by index now.)
  57. *
  58. * Revision 1.9 1994/04/26 11:19:01 yuan
  59. * Make it so a trigger can only be triggered every 5 seconds.
  60. *
  61. */
  62. #ifndef _SWITCH_H
  63. #define _SWITCH_H
  64. #include "inferno.h"
  65. #include "segment.h"
  66. #define MAX_WALLS_PER_LINK 10
  67. #define TRIGGER_DEFAULT 2*F1_0
  68. #define MAX_TRIGGERS 100
  69. #define MAX_WALL_SWITCHES 50
  70. #define MAX_WALL_LINKS 100
  71. // Trigger flags
  72. #define TRIGGER_CONTROL_DOORS 1 // Control Trigger
  73. #define TRIGGER_SHIELD_DAMAGE 2 // Shield Damage Trigger
  74. #define TRIGGER_ENERGY_DRAIN 4 // Energy Drain Trigger
  75. #define TRIGGER_EXIT 8 // End of level Trigger
  76. #define TRIGGER_ON 16 // Whether Trigger is active
  77. #define TRIGGER_ONE_SHOT 32 // If Trigger can only be triggered once
  78. #define TRIGGER_MATCEN 64 // Trigger for materialization centers
  79. #define TRIGGER_ILLUSION_OFF 128 // Switch Illusion OFF trigger
  80. #define TRIGGER_ILLUSION_ON 512 // Switch Illusion ON trigger
  81. #define TRIGGER_SECRET_EXIT 256 // Exit to secret level
  82. // Trigger delay times before they can be retriggered (Recharge time)
  83. #define TRIGGER_DELAY_DOOR F1_0*1 // 1 second for doors
  84. #define TRIGGER_DELAY_ZAPS F1_0/10 // 1/10 second for quickie stuff
  85. // New unimplemented trigger ideas
  86. #define TRIGGER_CONTROL_ROBOTS 64 // If Trigger is a Door control trigger (Linked)
  87. #define CONTROL_ROBOTS 8 // If Trigger modifies robot behavior
  88. #define CONTROL_LIGHTS_ON 16 // If Trigger turns on lights in a certain area
  89. #define CONTROL_LIGHTS_OFF 32 // If Trigger turns off lights in a certain area
  90. typedef struct trigger {
  91. byte type;
  92. short flags;
  93. fix value;
  94. fix time;
  95. byte link_num;
  96. short num_links;
  97. short seg[MAX_WALLS_PER_LINK];
  98. short side[MAX_WALLS_PER_LINK];
  99. } trigger;
  100. //typedef struct link {
  101. // short num_walls;
  102. // short seg[MAX_WALLS_PER_LINK];
  103. // short side[MAX_WALLS_PER_LINK];
  104. // } link;
  105. extern trigger Triggers[MAX_TRIGGERS];
  106. //extern link Links[MAX_WALL_LINKS];
  107. extern int Num_triggers;
  108. //extern int Num_links;
  109. extern void trigger_init();
  110. extern void check_trigger(segment *seg, short side, short objnum);
  111. extern int check_trigger_sub(int trigger_num, int player_num);
  112. extern void triggers_frame_process();
  113. #endif
  114.