| 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_comcxx . . $ bot_com# { |
| 28 | char actioncxx . . $ bot_com#action.; |
| 29 | void *ptrcxx . . $ bot_com#ptr.; |
| 30 | }; |
| 31 | |
| 32 | // Alien Organism Communication Constants |
| 33 | #define ALIEN_COM_HUNT_TO_OBJcxx . . $ `scripts/AIGame3_External.h:33:9`! 20 |
| 34 | #define ALIEN_COM_SCAV_TO_OBJcxx . . $ `scripts/AIGame3_External.h:34:9`! 21 |
| 35 | |
| 36 | // Alien Boss Communication Constants |
| 37 | #define AB_COM_THRUSTER_IS_FIRINGcxx . . $ `scripts/AIGame3_External.h:37:9`! 0 |
| 38 | #define AB_COM_THRUSTER_MISFIREDcxx . . $ `scripts/AIGame3_External.h:38:9`! 1 |
| 39 | #define AB_COM_SET_SCENARIO_IDScxx . . $ `scripts/AIGame3_External.h:39:9`! 2 |
| 40 | #define AB_COM_IS_NESTINGcxx . . $ `scripts/AIGame3_External.h:40:9`! 3 |
| 41 | #define AB_COM_THRUSTER_IGNITEDcxx . . $ `scripts/AIGame3_External.h:41:9`! 4 |
| 42 | #define AB_COM_ITS_SHOWTIMEcxx . . $ `scripts/AIGame3_External.h:42:9`! 5 |
| 43 | #define AB_COM_START_WAITING_EFFECTcxx . . $ `scripts/AIGame3_External.h:43:9`! 6 |
| 44 | |
| 45 | // Security Camera Communication Constants |
| 46 | #define SC_COM_GET_ALERT_STATUScxx . . $ `scripts/AIGame3_External.h:46:9`! 0 |
| 47 | |
| 48 | // Crowd Control Communication Constants |
| 49 | #define CC_COM_SET_DATAcxx . . $ `scripts/AIGame3_External.h:49:9`! 0 |
| 50 | #define CC_COM_DISABLE_CHECKcxx . . $ `scripts/AIGame3_External.h:50:9`! 1 |
| 51 | |
| 52 | // Alien Boss Scenario ID Packet |
| 53 | struct ab_scenario_idscxx . . $ ab_scenario_ids# { |
| 54 | int nest_handlecxx . . $ ab_scenario_ids#nest_handle.; |
| 55 | int left_hide_roomcxx . . $ ab_scenario_ids#left_hide_room.; |
| 56 | int right_hide_roomcxx . . $ ab_scenario_ids#right_hide_room.; |
| 57 | }; |
| 58 | |
| 59 | // Crowd Control Packet |
| 60 | struct cc_packetcxx . . $ cc_packet# { |
| 61 | int follow_handlecxx . . $ cc_packet#follow_handle.; |
| 62 | float stop_distcxx . . $ cc_packet#stop_dist.; |
| 63 | float slowdown_offsetcxx . . $ cc_packet#slowdown_offset.; |
| 64 | }; |
| 65 | |
| 66 | // Sends a command out to a robot |
| 67 | bool SendCommandcxx . . $ SendCommand(1fae7c3a3935cb04).(int me, int it, char command, void *ptr) { |
| 68 | bot_comcxx . . $ bot_com# com; |
| 69 | |
| 70 | com.actioncxx . . $ bot_com#action. = command; |
| 71 | com.ptrcxx . . $ bot_com#ptr. = ptr; |
| 72 | |
| 73 | tOSIRISEventInfocxx . . $ tOSIRISEventInfo# ei; |
| 74 | |
| 75 | ei.me_handlecxx . . $ tOSIRISEventInfo#me_handle. = it; |
| 76 | ei.extra_infocxx . . $ tOSIRISEventInfo#extra_info. = (void *)&com; |
| 77 | ei.evt_ai_notifycxx . . $ tOSIRISEventInfo#$anonymous_type_1#evt_ai_notify..notify_typecxx . . $ tOSIRISEVTAINOTIFY#notify_type. = AIN_USER_DEFINEDcxx . . $ `Descent3/aistruct_external.h:301:9`!; |
| 78 | ei.evt_ai_notifycxx . . $ tOSIRISEventInfo#$anonymous_type_1#evt_ai_notify..it_handlecxx . . $ tOSIRISEVTAINOTIFY#it_handle. = me; |
| 79 | |
| 80 | return Obj_CallEventcxx . . $ Obj_CallEvent.(it, EVT_AI_NOTIFYcxx . . $ `scripts/osiris_common.h:371:9`!, &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 | */ |