Debian Codegraph @

Descent3/trigger.h

raw symbols SCIP
1 /*
2 * Descent 3
3 * Copyright (C) 2024 Parallax Software
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
18 --- HISTORICAL COMMENTS FOLLOW ---
19
20 * $Logfile: /DescentIII/main/trigger.h $
21 * $Revision: 17 $
22 * $Date: 5/20/99 9:03p $
23 * $Author: Matt $
24 *
25 * Trigger header
26 *
27 * $Log: /DescentIII/main/trigger.h $
28 *
29 * 17 5/20/99 9:03p Matt
30 * Changed trigger system so that collisions with rendered portals don't
31 * set off triggers on the portals.
32 *
33 * 16 4/14/99 3:57a Jeff
34 * fixed case mismatch in #includes
35 *
36 * 15 3/23/99 5:52p Matt
37 * Added clutter activators for triggers
38 *
39 * 14 2/21/99 4:35p Chris
40 * Improving the level goal system... Not done.
41 *
42 * 13 2/11/99 1:10p Matt
43 * Added functions to get & set a triggers enabled/disabled state
44 *
45 * 12 1/21/99 11:34a Matt
46 * Got rid of portal triggers. Since we don't have multi-face portals, a
47 * face trigger works fine for a portal. Also fixed a few editor/trigger
48 * bugs.
49 *
50 * 11 1/14/99 11:06a Matt
51 * Added names to triggers
52 *
53 * 10 1/08/99 2:56p Samir
54 * Ripped out OSIRIS1.
55 *
56 * 9 12/16/98 10:18p Jeff
57 * added new osiris struct members
58 *
59 * 8 4/24/98 1:53a Samir
60 * added trigger init and free.
61 *
62 * 7 2/03/98 11:12a Samir
63 * If pointer passed to TRIGNUM is NULL return -1.
64 *
65 * 6 1/20/98 4:12p Samir
66 * New script housekeeping system.
67 *
68 * 5 9/24/97 6:18p Samir
69 * Use script names instead of script id values to identify scripts.
70 *
71 * 4 9/12/97 3:58p Matt
72 * Added support for activators and one-shot triggers
73 *
74 * 3 9/11/97 1:57p Matt
75 * Added trigger struct & a bunch of functions. System is not done yet,
76 * though.
77 *
78 * 2 9/08/97 10:01a Matt
79 * Ripped out old trigger code
80 *
81 * $NoKeywords: $
82 */
83
84 #ifndef TRIGGER_H
85 #define TRIGGER_Hcxx . . $ `Descent3/trigger.h:85:9`!
86
87 #include "pstypes.h"cxx . . $ `<file>/lib/pstypes.h`/
88 #include "ObjScript.h"cxx . . $ `<file>/Descent3/ObjScript.h`/
89 #include "object_external_struct.h"cxx . . $ `<file>/lib/object_external_struct.h`/
90 #include "vecmat.h"cxx . . $ `<file>/lib/vecmat.h`/
91
92 // Trigger flags
93 #define TF_UNUSEDcxx . . $ `Descent3/trigger.h:93:9`! 1 //
94 #define TF_DISABLEDcxx . . $ `Descent3/trigger.h:94:9`! 2 // This trigger is currently not active
95 #define TF_DEADcxx . . $ `Descent3/trigger.h:95:9`! 4 // This trigger has been tripped and is now dead
96 #define TF_ONESHOTcxx . . $ `Descent3/trigger.h:96:9`! 8 // This trigger only works once
97 #define TF_INFORM_ACTIVATE_TO_LGcxx . . $ `Descent3/trigger.h:97:9`! 16 // This trigger is involved in the level goal system
98
99 // Activator flags
100 #define AF_PLAYERcxx . . $ `Descent3/trigger.h:100:9`! 1 // The player can activate this trigger
101 #define AF_PLAYER_WEAPONcxx . . $ `Descent3/trigger.h:101:9`! 2 // The player's weapons can activate this trigger
102 #define AF_ROBOTcxx . . $ `Descent3/trigger.h:102:9`! 4 // A robot can activate this trigger
103 #define AF_ROBOT_WEAPONcxx . . $ `Descent3/trigger.h:103:9`! 8 // A robot's weapon can activate this trigger
104 #define AF_CLUTTERcxx . . $ `Descent3/trigger.h:104:9`! 16 // A piece of clutter
105
106 // Declare this here so we don't have to include the header file
107 //@$-struct tD3XThread;
108
109 struct tOSIRISTriggerScriptcxx . . $ tOSIRISTriggerScript# {
110 int script_idcxx . . $ tOSIRISTriggerScript#script_id.;
111 void *script_instancecxx . . $ tOSIRISTriggerScript#script_instance.;
112 };
113
114 #define TRIG_NAME_LENcxx . . $ `Descent3/trigger.h:114:9`! 19
115
116 // The trigger structure
117 struct triggercxx . . $ trigger# {
118 char namecxx . . $ trigger#name.[TRIG_NAME_LENcxx . . $ `Descent3/trigger.h:114:9`! + 1]; // the name of this trigger
119 int roomnumcxx . . $ trigger#roomnum.; // the room this trigger is in
120 int facenumcxx . . $ trigger#facenum.; // the face to which this trigger is attched
121 int16_t flagscxx . . $ trigger#flags.; // flags for this trigger
122 int16_t activatorcxx . . $ trigger#activator.; // flags for what can activate this trigger
123 // This is allocated when the level is started
124 tOSIRISTriggerScriptcxx . . $ tOSIRISTriggerScript# osiris_scriptcxx . . $ trigger#osiris_script.;
125 };
126
127 // The number of triggers currently in the mine
128 extern int Num_triggerscxx . . $ Num_triggers.;
129
130 // The list of triggers for the mine
131 extern triggercxx . . $ trigger# Triggerscxx . . $ Triggers.[];
132
133 // Macro to get trigger number
134 #define TRIGNUMcxx . . $ `Descent3/trigger.h:134:9`!(tp) (tp) ? ((tp)-Triggers) : -1
135
136 // initializes trigger system
137 void InitTriggerscxx . . $ InitTriggers(49f6e7a06ebc5aa8).();
138
139 // Free triggers.
140 void FreeTriggerscxx . . $ FreeTriggers(49f6e7a06ebc5aa8).();
141
142 // types for CheckTrigger()
143 #define TT_PASS_THROUGHcxx . . $ `Descent3/trigger.h:143:9`! 0
144 #define TT_COLLIDEcxx . . $ `Descent3/trigger.h:144:9`! 1
145
146 // Called to see if a trigger was tripped
147 void CheckTriggercxx . . $ CheckTrigger(11e0cce86948d892).(int roomnum, int facenum, objectcxx . . $ object# *objp, int type);
148
149 // Enable or disable a trigger
150 void TriggerSetStatecxx . . $ TriggerSetState(918ebd27a9ddbad3).(int trigger_num, bool enabled);
151
152 // Determines if a trigger is enabled or disabled
153 // Returns TRUE if enabled, else false
154 bool TriggerGetStatecxx . . $ TriggerGetState(83c267b20bac841a).(int trigger_num);
155
156 // Create a new trigger
157 // Parameters: roomnum,facenum - where the trigger is
158 // activator - activator mask
159 // script - handle for the script for this trigger
160 // Returns: trigger number of new trigger, or -1 if error
161 int AddTriggercxx . . $ AddTrigger(413ad55539164a66).(char *name, int roomnum, int facenum, int activator, const char *script);
162
163 // Remove a trigger
164 // Paramters: trig_num - the trigger to delete
165 void DeleteTriggercxx . . $ DeleteTrigger(d4f767463ce0a6b3).(int trig_num);
166
167 // Remove a trigger
168 // Paramters: roomnum,facenum - where the trigger is
169 void DeleteTriggercxx . . $ DeleteTrigger(3e454b8ccf442868).(int roomnum, int facenum);
170
171 #endif