Debian Codegraph @

scripts/AIGame3_External.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
19 //
20 // AIGame3_External.h
21 //
22 // ------------------
23 //
24 // This file provides a link between Dallas scripts and AIGame3.cpp
25
26 // Bot Communication packet
27 struct bot_com {
28 char action;
29 void *ptr;
30 };
31
32 // Alien Organism Communication Constants
33 #define ALIEN_COM_HUNT_TO_OBJ 20
34 #define ALIEN_COM_SCAV_TO_OBJ 21
35
36 // Alien Boss Communication Constants
37 #define AB_COM_THRUSTER_IS_FIRING 0
38 #define AB_COM_THRUSTER_MISFIRED 1
39 #define AB_COM_SET_SCENARIO_IDS 2
40 #define AB_COM_IS_NESTING 3
41 #define AB_COM_THRUSTER_IGNITED 4
42 #define AB_COM_ITS_SHOWTIME 5
43 #define AB_COM_START_WAITING_EFFECT 6
44
45 // Security Camera Communication Constants
46 #define SC_COM_GET_ALERT_STATUS 0
47
48 // Crowd Control Communication Constants
49 #define CC_COM_SET_DATA 0
50 #define CC_COM_DISABLE_CHECK 1
51
52 // Alien Boss Scenario ID Packet
53 struct ab_scenario_ids {
54 int nest_handle;
55 int left_hide_room;
56 int right_hide_room;
57 };
58
59 // Crowd Control Packet
60 struct cc_packet {
61 int follow_handle;
62 float stop_dist;
63 float slowdown_offset;
64 };
65
66 // Sends a command out to a robot
67 bool SendCommand(int me, int it, char command, void *ptr) {
68 bot_com com;
69
70 com.action = command;
71 com.ptr = ptr;
72
73 tOSIRISEventInfo ei;
74
75 ei.me_handle = it;
76 ei.extra_info = (void *)&com;
77 ei.evt_ai_notify.notify_type = AIN_USER_DEFINED;
78 ei.evt_ai_notify.it_handle = me;
79
80 return Obj_CallEvent(it, EVT_AI_NOTIFY, &ei);
81 }
82
83 // =======================================================================
84 // Copy and Paste the following into the custom section of a Dallas script
85 // =======================================================================
86
87 /*
88 $$QUERY
89 Custom
90 b:[o:Security Camera] has been alerted
91 qSecurityCameraAlerted
92 Security Camera has been alerted
93 Determines if a security camera has been alerted
94
95 Parameters:
96 Security Camera: the security camera object to check
97 $$END
98 */
99 /*
100 bool qSecurityCameraAlerted(int obj_handle)
101 {
102 bool camera_alerted;
103
104 SendCommand(obj_handle,obj_handle,SC_COM_GET_ALERT_STATUS,&camera_alerted);
105
106 return camera_alerted;
107 }
108 */
109
110 /*
111 $$ACTION
112 Custom
113 Tell [o:Alien Organism] to hunt to [o:Destination Object]
114 aAlienOrganismHunt
115 Tell Alien Organism to hunt to Destination Object
116 Causes an alien organism (and possibly its squad) to go hunting toward a particular object.
117
118 Parameters:
119 Alien Organism: the alien that should go hunting
120 Destination Object: the object to hunt towards
121 $$END
122 */
123 /*
124 void aAlienOrganismHunt(int alien_handle, int dest_handle)
125 {
126 SendCommand(alien_handle,alien_handle,ALIEN_COM_HUNT_TO_OBJ,&dest_handle);
127 }
128 */
129
130 /*
131 $$ACTION
132 Custom
133 Tell [o:Alien Organism] to scavenge to [o:Destination Object]
134 aAlienOrganismScav
135 Tell Alien Organism to scavenge to Destination Object
136 Causes an alien organism (and possibly its squad) to go scavenging toward a particular object.
137
138 Parameters:
139 Alien Organism: the alien that should go scavenging
140 Destination Object: the object to scavenge towards
141 $$END
142 */
143 /*
144 void aAlienOrganismScav(int alien_handle, int dest_handle)
145 {
146 SendCommand(alien_handle,alien_handle,ALIEN_COM_SCAV_TO_OBJ,&dest_handle);
147 }
148 */