| 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/weapon.h $ |
| 21 | * $Revision: 87 $ |
| 22 | * $Date: 4/12/99 12:49p $ |
| 23 | * $Author: Jeff $ |
| 24 | * |
| 25 | * Header for weapon.cpp & weaponfire.cpp |
| 26 | * |
| 27 | * $Log: /DescentIII/main/weapon.h $ |
| 28 | * |
| 29 | * 87 4/12/99 12:49p Jeff |
| 30 | * added recoil_force to weapon's page |
| 31 | * |
| 32 | * 86 4/05/99 4:39p Jason |
| 33 | * added groovy new smoke trails |
| 34 | * |
| 35 | * 85 3/31/99 10:27a Samir |
| 36 | * code to reset auto select states when ship is initializiaed and code to |
| 37 | * save and load these states from disk. |
| 38 | * |
| 39 | * 84 3/05/99 12:19p Matt |
| 40 | * Delete now-unused function AddWeaponAmmoToPlayer() |
| 41 | * |
| 42 | * 83 3/03/99 5:09p Samir |
| 43 | * AddWeaponAmmoToPlayer added. |
| 44 | * |
| 45 | * 82 3/02/99 7:22p Chris |
| 46 | * Add the 'fire at target' check box for weapon batteries |
| 47 | * |
| 48 | * 81 2/22/99 2:05p Jason |
| 49 | * added different damages for players and generics |
| 50 | * |
| 51 | * 80 2/08/99 5:29p Jason |
| 52 | * added more weapon options |
| 53 | * |
| 54 | * 79 1/25/99 7:43a Chris |
| 55 | * Added the GUID (Goal Unique Id) and added the ability for weapon |
| 56 | * batteries to always fire exactly forward. |
| 57 | * |
| 58 | * 78 1/11/99 2:14p Chris |
| 59 | * Massive work on OSIRIS and AI |
| 60 | * |
| 61 | * 77 11/13/98 12:30p Jason |
| 62 | * changes for weapons |
| 63 | * |
| 64 | * 76 10/22/98 2:41p Samir |
| 65 | * fixed autoselection for good. |
| 66 | * |
| 67 | * 75 10/21/98 11:52p Samir |
| 68 | * print different message if autoselecting a recently acquired weapon. |
| 69 | * |
| 70 | * 74 10/15/98 6:46p Chris |
| 71 | * Added custom size for weapons |
| 72 | * |
| 73 | * 73 10/07/98 9:36p Samir |
| 74 | * added a function to switch a player's weapon to another in the given |
| 75 | * weapon class. |
| 76 | * |
| 77 | * 72 10/01/98 6:56p Jason |
| 78 | * turned off energy weapon hit effects if the object getting hit is the |
| 79 | * viewer - this helps cut down on the general clutter in heavy combat |
| 80 | * |
| 81 | * 71 9/30/98 4:31p Samir |
| 82 | * added functions to handle weapon select list. |
| 83 | * |
| 84 | * 70 9/28/98 10:43a Chris |
| 85 | * Fixed a bug with HAS_FLAG |
| 86 | * |
| 87 | * 69 9/10/98 5:56p Chris |
| 88 | * Added more shit to the matcen code :) |
| 89 | * |
| 90 | * 68 9/08/98 5:35p Jason |
| 91 | * added WF_NO_ROTATE flag to weapons |
| 92 | * |
| 93 | * 67 9/01/98 4:41p Matt |
| 94 | * Removed obsolete fields in the weapon structure |
| 95 | * |
| 96 | * 66 8/31/98 1:35p Keneta |
| 97 | * Made some use count unsigned shorts |
| 98 | * |
| 99 | * 65 8/31/98 11:15a Keneta |
| 100 | * Upp'ed max weapons |
| 101 | * |
| 102 | * 64 8/19/98 2:48p Jason |
| 103 | * fixed some weapon firing and weapon exploding bugs |
| 104 | * |
| 105 | * 63 8/06/98 1:00p Chris |
| 106 | * Added new homing flags |
| 107 | * |
| 108 | * 62 8/03/98 1:09p Jason |
| 109 | * added some more weapons flags |
| 110 | * |
| 111 | * 61 7/31/98 5:23p Jason |
| 112 | * added ship armor scalars |
| 113 | * |
| 114 | * 60 7/30/98 6:03p Jason |
| 115 | * (Jeff) checked in so we can compile...missing 2 WF_* flags |
| 116 | * |
| 117 | * 59 7/30/98 11:09a Jason |
| 118 | * added weapons that freeze and deform terrain |
| 119 | * |
| 120 | * 58 7/06/98 11:52a Jason |
| 121 | * added countermeasure prototype |
| 122 | * |
| 123 | * 57 7/01/98 12:12p Jason |
| 124 | * added countermeasures |
| 125 | * |
| 126 | * 56 6/22/98 6:26p Jason |
| 127 | * added gravity field effect for weapons |
| 128 | * |
| 129 | * 55 6/19/98 12:04p Jason |
| 130 | * |
| 131 | * 54 6/16/98 10:54a Jeff |
| 132 | * |
| 133 | * 53 5/26/98 5:06p Samir |
| 134 | * changed name of weapon indices and added function to get weapon's icon |
| 135 | * image. |
| 136 | * |
| 137 | * 52 5/25/98 8:36p Matt |
| 138 | * Added code to set different sizes for different weapon scorch marks. |
| 139 | * Also, don't leave scorch marks on lights. |
| 140 | * |
| 141 | * 51 5/25/98 8:17p Matt |
| 142 | * Moved MAX_PLAYER_WEAPONS fromw weapon.h to player.h, so that the latter |
| 143 | * doesn't need to include the former, drastically speeding build times |
| 144 | * when weapon.h is changed. |
| 145 | * |
| 146 | * 50 5/25/98 6:39p Jason |
| 147 | * got icons working for weapons |
| 148 | * |
| 149 | * 49 5/22/98 12:34p Matt |
| 150 | * Added scorch mark/bullet hole system. |
| 151 | * |
| 152 | * 48 5/19/98 4:42a Chris |
| 153 | * Added shockwave's -- enjoy. :) |
| 154 | * |
| 155 | * 47 5/07/98 2:40p Chris |
| 156 | * Added death_dot and bounce sound for weapons |
| 157 | * |
| 158 | * 46 4/24/98 8:02a Samir |
| 159 | * added a int16_t weapon name array. |
| 160 | * |
| 161 | * 45 4/19/98 5:00p Jason |
| 162 | * added cool napalm effect, plus made object effects dynamically |
| 163 | * allocated |
| 164 | * |
| 165 | * 44 4/17/98 1:59p Jason |
| 166 | * added cool object effects |
| 167 | * |
| 168 | * 43 4/15/98 12:22p Jason |
| 169 | * lots of miscellaneous stuff pertaining to lighting and vis effects |
| 170 | * |
| 171 | * 42 4/10/98 2:16p Jason |
| 172 | * fixed guided missile problems |
| 173 | * |
| 174 | * 41 4/10/98 12:39p Jason |
| 175 | * added expanding explosion bitmaps |
| 176 | * |
| 177 | * 40 4/09/98 12:05p Chris |
| 178 | * Added parenting for all object types. :) |
| 179 | * |
| 180 | * 39 4/07/98 3:31p Jason |
| 181 | * got particle effects working with weapons |
| 182 | * |
| 183 | * 38 4/06/98 4:53p Jason |
| 184 | * got pageable polymodels working correctly with editor |
| 185 | * |
| 186 | * 37 2/17/98 11:32p Matt |
| 187 | * Fixed player wepon fire problem when down_count != 0 && down_time == 0 |
| 188 | * Add function to clear out player firing activity for when die or switch |
| 189 | * weapons |
| 190 | * |
| 191 | */ |
| 192 | |
| 193 | #ifndef WEAPON_H |
| 194 | #define WEAPON_Hcxx . . $ `Descent3/weapon.h:194:9`! |
| 195 | |
| 196 | #include "pstypes.h"cxx . . $ `<file>/lib/pstypes.h`/ |
| 197 | #include "manage.h"cxx . . $ `<file>/lib/manage.h`/ |
| 198 | #include "object.h"cxx . . $ `<file>/Descent3/object.h`/ |
| 199 | #include "objinfo.h"cxx . . $ `<file>/Descent3/objinfo.h`/ |
| 200 | #include "weapon_external.h"cxx . . $ `<file>/Descent3/weapon_external.h`/ |
| 201 | |
| 202 | #define MAX_PRIMARY_WEAPONScxx . . $ `Descent3/weapon.h:202:9`! 10 |
| 203 | #define MAX_SECONDARY_WEAPONScxx . . $ `Descent3/weapon.h:203:9`! 10 |
| 204 | |
| 205 | #define MAX_WEAPON_NOT_HIT_PARENT_TIMEcxx . . $ `Descent3/weapon.h:205:9`! 3.0f |
| 206 | |
| 207 | // This can be changed safely |
| 208 | #define MAX_WEAPONScxx . . $ `Descent3/weapon.h:208:9`! 200 |
| 209 | |
| 210 | // THIS CONSTANT SHOULD EQUAL THE NUMBER OF WEAPONS SELECTABLE!!! |
| 211 | #define MAX_STATIC_WEAPONScxx . . $ `Descent3/weapon.h:211:9`! 21 |
| 212 | |
| 213 | #define DEFAULT_WEAPON_SIZEcxx . . $ `Descent3/weapon.h:213:9`! 1.0 // Default size of a weapon -- used for bitmap weapons |
| 214 | |
| 215 | #define HAS_FLAGcxx . . $ `Descent3/weapon.h:215:9`!(a) (1 << (a)) |
| 216 | |
| 217 | // Weapon flags |
| 218 | #define WF_HUD_ANIMATEDcxx . . $ `Descent3/weapon.h:218:9`! (1 << 0) |
| 219 | #define WF_IMAGE_BITMAPcxx . . $ `Descent3/weapon.h:219:9`! (1 << 1) // whether or not the firing image is a bitmap or model |
| 220 | #define WF_SMOKEcxx . . $ `Descent3/weapon.h:220:9`! (1 << 2) // Weapon drops smoke as it moves |
| 221 | #define WF_MATTER_WEAPONcxx . . $ `Descent3/weapon.h:221:9`! (1 << 3) // This a matter weapon, as opposed to an energy weapon |
| 222 | #define WF_ELECTRICALcxx . . $ `Descent3/weapon.h:222:9`! (1 << 4) // This weapons fires as an electrical storm |
| 223 | #define WF_IMAGE_VCLIPcxx . . $ `Descent3/weapon.h:223:9`! (1 << 5) // This weapon fire image is a vclip |
| 224 | #define WF_SPRAYcxx . . $ `Descent3/weapon.h:224:9`! (1 << 6) // This weapon is a spray, like a flamethrower |
| 225 | #define WF_STREAMERcxx . . $ `Descent3/weapon.h:225:9`! (1 << 7) // This weapon has a streamer effect attached |
| 226 | #define WF_INVISIBLEcxx . . $ `Descent3/weapon.h:226:9`! (1 << 8) // This weapon is invisible |
| 227 | #define WF_RINGcxx . . $ `Descent3/weapon.h:227:9`! (1 << 9) // This weapon is drawn ring style |
| 228 | #define WF_SATURATEcxx . . $ `Descent3/weapon.h:228:9`! (1 << 10) // Saturate this bitmap weapon |
| 229 | #define WF_BLAST_RINGcxx . . $ `Descent3/weapon.h:229:9`! (1 << 11) // Creates a blast ring upon explosion |
| 230 | #define WF_PLANAR_BLASTcxx . . $ `Descent3/weapon.h:230:9`! (1 << 12) // Blast bitmap takes on the walls plane |
| 231 | #define WF_PLANARcxx . . $ `Descent3/weapon.h:231:9`! (1 << 13) // This weapon doesn't always face you |
| 232 | #define WF_ENABLE_CAMERAcxx . . $ `Descent3/weapon.h:232:9`! (1 << 14) // This weapon can be used for missile camera |
| 233 | #define WF_SPAWNS_IMPACTcxx . . $ `Descent3/weapon.h:233:9`! (1 << 15) // This weapon spawns others on impact |
| 234 | #define WF_SPAWNS_TIMEOUTcxx . . $ `Descent3/weapon.h:234:9`! (1 << 16) // This weapon spawns others when it times out |
| 235 | #define WF_EXPANDcxx . . $ `Descent3/weapon.h:235:9`! (1 << 17) // This weapon expands when exploding |
| 236 | #define WF_MUZZLEcxx . . $ `Descent3/weapon.h:236:9`! (1 << 18) // This weapon produces a muzzle flash when fired |
| 237 | #define WF_MICROWAVEcxx . . $ `Descent3/weapon.h:237:9`! (1 << 19) // This weapon makes a microwave effect on the victim |
| 238 | #define WF_NAPALMcxx . . $ `Descent3/weapon.h:238:9`! (1 << 20) // This weapon does a napalm effect to objects it touches |
| 239 | #define WF_REVERSE_SMOKEcxx . . $ `Descent3/weapon.h:239:9`! (1 << 21) // The smoke trail gets smaller as it ages |
| 240 | #define WF_GRAVITY_FIELDcxx . . $ `Descent3/weapon.h:240:9`! (1 << 22) // This weapon has a gravity field |
| 241 | #define WF_COUNTERMEASUREcxx . . $ `Descent3/weapon.h:241:9`! (1 << 23) // This weapon is a countermeasure |
| 242 | #define WF_SPAWNS_ROBOTcxx . . $ `Descent3/weapon.h:242:9`! (1 << 24) // This weapon spawns a robot upon death |
| 243 | #define WF_FREEZEcxx . . $ `Descent3/weapon.h:243:9`! (1 << 25) // This weapon slows a ship/object down |
| 244 | #define WF_TIMEOUT_WALLcxx . . $ `Descent3/weapon.h:244:9`! (1 << 26) // This weapon times out like a wall hit |
| 245 | #define WF_PLANAR_SMOKEcxx . . $ `Descent3/weapon.h:245:9`! (1 << 27) // This weapon has a planar smoke trail instead of a blob |
| 246 | #define WF_SILENT_HOMINGcxx . . $ `Descent3/weapon.h:246:9`! (1 << 28) // This weapon does not give a homing lock sound |
| 247 | #define WF_HOMING_SPLITcxx . . $ `Descent3/weapon.h:247:9`! (1 << 29) // This weapon homes when it splits |
| 248 | #define WF_NO_ROTATEcxx . . $ `Descent3/weapon.h:248:9`! (1 << 30) // This weapon does not rotate as a bitmap |
| 249 | #define WF_CUSTOM_SIZEcxx . . $ `Descent3/weapon.h:249:9`! (1 << 31) // This weapon uses a custom size |
| 250 | |
| 251 | #define MAX_LASER_LEVELcxx . . $ `Descent3/weapon.h:251:9`! 4 |
| 252 | #define MAX_SUPER_LASER_LEVELcxx . . $ `Descent3/weapon.h:252:9`! 6 |
| 253 | |
| 254 | #define PRIMARY_INDEXcxx . . $ `Descent3/weapon.h:254:9`! 0 |
| 255 | #define SECONDARY_INDEXcxx . . $ `Descent3/weapon.h:255:9`! 10 |
| 256 | |
| 257 | // These defines must correspond to the Static_weapons_names array |
| 258 | |
| 259 | #define MAX_WEAPON_SOUNDScxx . . $ `Descent3/weapon.h:259:9`! 7 |
| 260 | #define WSI_FIREcxx . . $ `Descent3/weapon.h:260:9`! \ |
| 261 | 0 // chrishack -- removed! Change const when we add a new slot |
| 262 | // grep for occurances of WSI_FIRE and fix (or remove) old code |
| 263 | #define WSI_IMPACT_WALLcxx . . $ `Descent3/weapon.h:263:9`! 1 |
| 264 | #define WSI_FLYINGcxx . . $ `Descent3/weapon.h:264:9`! 2 |
| 265 | #define WSI_IMPACT_ROBOTcxx . . $ `Descent3/weapon.h:265:9`! 3 |
| 266 | #define WSI_BOUNCEcxx . . $ `Descent3/weapon.h:266:9`! 4 |
| 267 | |
| 268 | struct weaponcxx . . $ weapon# { |
| 269 | char namecxx . . $ weapon#name.[PAGENAME_LENcxx . . $ `lib/manage_external.h:49:9`!]; |
| 270 | float player_damagecxx . . $ weapon#player_damage.; // how much damage a full impact causes a player |
| 271 | float generic_damagecxx . . $ weapon#generic_damage.; // how much damage a full impact causes a robot |
| 272 | float alphacxx . . $ weapon#alpha.; // What alpha to draw this weapon with |
| 273 | int16_tcxx . . $ int16_t# soundscxx . . $ weapon#sounds.[MAX_WEAPON_SOUNDScxx . . $ `Descent3/weapon.h:259:9`!]; // sounds for various things |
| 274 | int16_tcxx . . $ int16_t# hud_image_handlecxx . . $ weapon#hud_image_handle.; // a handle to a bitmap or vclip for the hud display |
| 275 | int16_tcxx . . $ int16_t# fire_image_handlecxx . . $ weapon#fire_image_handle.; // model or bitmap. Shown when you fire this weapon |
| 276 | int16_tcxx . . $ int16_t# explode_image_handlecxx . . $ weapon#explode_image_handle.; // exploding vclip |
| 277 | int16_tcxx . . $ int16_t# smoke_handlecxx . . $ weapon#smoke_handle.; // smoke trail handle to texture |
| 278 | int16_tcxx . . $ int16_t# spawn_handlecxx . . $ weapon#spawn_handle.; // weapon handle that gets spawned |
| 279 | int16_tcxx . . $ int16_t# alternate_spawn_handlecxx . . $ weapon#alternate_spawn_handle.; // weapon handle that gets spawned (sometimes) |
| 280 | int16_tcxx . . $ int16_t# robot_spawn_handlecxx . . $ weapon#robot_spawn_handle.; // robot that gets spawned as a countermeasure |
| 281 | int16_tcxx . . $ int16_t# particle_handlecxx . . $ weapon#particle_handle.; // particle handle to texture |
| 282 | int16_tcxx . . $ int16_t# icon_handlecxx . . $ weapon#icon_handle.; |
| 283 | int16_tcxx . . $ int16_t# scorch_handlecxx . . $ weapon#scorch_handle.; // handle for scorch bitmap, or -1 for none |
| 284 | uint8_tcxx . . $ uint8_t# spawn_countcxx . . $ weapon#spawn_count.; // how many of spawn handle gets created |
| 285 | uint8_tcxx . . $ uint8_t# alternate_chancecxx . . $ weapon#alternate_chance.; // how often the alternate spawn weapon gets chosen (0 to 100) |
| 286 | |
| 287 | uint16_tcxx . . $ uint16_t# usedcxx . . $ weapon#used.; |
| 288 | |
| 289 | uint8_tcxx . . $ uint8_t# particle_countcxx . . $ weapon#particle_count.; |
| 290 | uint8_tcxx . . $ uint8_t# terrain_damage_depthcxx . . $ weapon#terrain_damage_depth.; |
| 291 | |
| 292 | float terrain_damage_sizecxx . . $ weapon#terrain_damage_size.; |
| 293 | |
| 294 | float scorch_sizecxx . . $ weapon#scorch_size.; // how big the scorch mark is |
| 295 | |
| 296 | int flagscxx . . $ weapon#flags.; // see above |
| 297 | |
| 298 | float sizecxx . . $ weapon#size.; |
| 299 | float life_timecxx . . $ weapon#life_time.; |
| 300 | float thrust_timecxx . . $ weapon#thrust_time.; |
| 301 | float impact_sizecxx . . $ weapon#impact_size.; |
| 302 | float impact_timecxx . . $ weapon#impact_time.; |
| 303 | float impact_player_damagecxx . . $ weapon#impact_player_damage., impact_generic_damagecxx . . $ weapon#impact_generic_damage.; |
| 304 | float impact_forcecxx . . $ weapon#impact_force.; |
| 305 | float explode_sizecxx . . $ weapon#explode_size.; |
| 306 | float explode_timecxx . . $ weapon#explode_time.; |
| 307 | float particle_sizecxx . . $ weapon#particle_size.; |
| 308 | float particle_lifecxx . . $ weapon#particle_life.; |
| 309 | float gravity_sizecxx . . $ weapon#gravity_size.; |
| 310 | float gravity_timecxx . . $ weapon#gravity_time.; |
| 311 | float custom_sizecxx . . $ weapon#custom_size.; |
| 312 | float homing_fovcxx . . $ weapon#homing_fov.; |
| 313 | float recoil_forcecxx . . $ weapon#recoil_force.; |
| 314 | |
| 315 | light_infocxx . . $ light_info# lighting_infocxx . . $ weapon#lighting_info.; |
| 316 | physics_infocxx . . $ physics_info# phys_infocxx . . $ weapon#phys_info.; |
| 317 | |
| 318 | }; |
| 319 | |
| 320 | struct fusion_effectcxx . . $ fusion_effect# { |
| 321 | float total_timecxx . . $ fusion_effect#total_time.; |
| 322 | |
| 323 | }; |
| 324 | |
| 325 | extern float Primary_ramp_timecxx . . $ Primary_ramp_time., Secondary_ramp_timecxx . . $ Secondary_ramp_time.; |
| 326 | |
| 327 | extern int Num_weaponscxx . . $ Num_weapons.; |
| 328 | extern weaponcxx . . $ weapon# Weaponscxx . . $ Weapons.[MAX_WEAPONScxx . . $ `Descent3/weapon.h:208:9`!]; |
| 329 | extern const char *Static_weapon_namescxx . . $ Static_weapon_names.[]; |
| 330 | extern int Static_weapon_names_msgcxx . . $ Static_weapon_names_msg.[]; |
| 331 | extern int Static_weapon_ckpt_namescxx . . $ Static_weapon_ckpt_names.[][2]; |
| 332 | |
| 333 | // Sets all weapons to unused |
| 334 | void InitWeaponscxx . . $ InitWeapons(49f6e7a06ebc5aa8).(); |
| 335 | |
| 336 | // Allocs a weapon for use, returns -1 if error, else index on success |
| 337 | int AllocWeaponcxx . . $ AllocWeapon(b126dc7c1de90089).(); |
| 338 | |
| 339 | // Frees weapon index n |
| 340 | void FreeWeaponcxx . . $ FreeWeapon(d4f767463ce0a6b3).(int n); |
| 341 | |
| 342 | // Gets next weapon from n that has actually been alloced |
| 343 | int GetNextWeaponcxx . . $ GetNextWeapon(7864480464b09eea).(int n); |
| 344 | |
| 345 | // Gets previous weapon from n that has actually been alloced |
| 346 | int GetPrevWeaponcxx . . $ GetPrevWeapon(7864480464b09eea).(int n); |
| 347 | |
| 348 | // Searches thru all weapons for a specific name, returns -1 if not found |
| 349 | // or index of weapon with name |
| 350 | int FindWeaponNamecxx . . $ FindWeaponName(5c4306d8553b3696).(const char *name); |
| 351 | |
| 352 | // Given a filename, loads either the model or vclip found in that file. If type |
| 353 | // is not NULL, sets it to 1 if file is model, otherwise sets it to zero |
| 354 | int LoadWeaponHudImagecxx . . $ LoadWeaponHudImage(b0a0d720b596a511).(char *filename, int *type); |
| 355 | |
| 356 | // Given a weapon handle, returns that weapons image for framenum |
| 357 | int GetWeaponHudImagecxx . . $ GetWeaponHudImage(9b79fb6aee4c0440).(int handle, int framenum); |
| 358 | |
| 359 | // Given a filename, loads either the model or vclip found in that file. If type |
| 360 | // is not NULL, sets it to 1 if file is model, otherwise sets it to zero |
| 361 | int LoadWeaponFireImagecxx . . $ LoadWeaponFireImage(d5888b9b9a45a23).(char *filename, int *type, int *anim, int pageable = 1); |
| 362 | |
| 363 | // Given a weapon handle, returns that weapons firing bitmap/model |
| 364 | int GetWeaponFireImagecxx . . $ GetWeaponFireImage(9b79fb6aee4c0440).(int handle, int frame); |
| 365 | |
| 366 | // Given a weapon name, assigns that weapon to a specific index into |
| 367 | // the Weapons array. Returns -1 if the named weapon is not found, 0 if the weapon |
| 368 | // is already in its place, or 1 if successfully moved |
| 369 | int MatchWeaponToIndexcxx . . $ MatchWeaponToIndex(6abd07ddb1a912f0).(char *name, int dest_index); |
| 370 | |
| 371 | // Moves a weapon from a given index into a new one (above MAX_STATIC_POWERUPS) |
| 372 | // returns new index |
| 373 | int MoveWeaponFromIndexcxx . . $ MoveWeaponFromIndex(7864480464b09eea).(int index); |
| 374 | |
| 375 | // This is a very confusing function. It takes all the weapons that we have loaded |
| 376 | // and remaps then into their proper places (if they are static). |
| 377 | void RemapWeaponscxx . . $ RemapWeapons(49f6e7a06ebc5aa8).(); |
| 378 | |
| 379 | // goes thru every entity that could possible have a weapon index (ie objects, weapons, etc) |
| 380 | // and changes the old index to the new index |
| 381 | void RemapAllWeaponObjectscxx . . $ RemapAllWeaponObjects(3e454b8ccf442868).(int old_index, int new_index); |
| 382 | |
| 383 | // Creates a weapon |
| 384 | // Returns the objnum of the weapon object |
| 385 | int CreateWeaponObjectcxx . . $ CreateWeaponObject(36434746a779d45e).(int weapon_num, int segnum, vectorcxx . . $ vector# *position, int flags); |
| 386 | |
| 387 | // Creates an weapon and sends it speeding on its way |
| 388 | // returns the objnum of the weapon |
| 389 | int CreateAndFireWeaponcxx . . $ CreateAndFireWeapon(8720b471d3264b3b).(vectorcxx . . $ vector# *pos, vectorcxx . . $ vector# *dir, objectcxx . . $ object# *parent, int weapon_num); |
| 390 | |
| 391 | // Given an object and a weapon, fires a shot from that object |
| 392 | // returns the object number of the weapon |
| 393 | int FireWeaponFromObjectcxx . . $ FireWeaponFromObject(3c611958fe04e279).(objectcxx . . $ object# *obj, int weapon_num, int gun_num = -1, bool f_force_forward = false, |
| 394 | bool f_force_target = false); |
| 395 | |
| 396 | // Draws a weapon |
| 397 | void DrawWeaponObjectcxx . . $ DrawWeaponObject(419c470199a90a97).(objectcxx . . $ object# *obj); |
| 398 | |
| 399 | // unconditionally adds a weapon and ammo to a player. |
| 400 | int AddWeaponToPlayercxx . . $ AddWeaponToPlayer(2326284602b0bb2d).(int slot, int weap_index, int ammo); |
| 401 | |
| 402 | // Called when a player dies or switches weapons to clear out any active weapon stuff |
| 403 | void ClearPlayerFiringcxx . . $ ClearPlayerFiring(766a1b7183ffa4b4).(objectcxx . . $ object# *objp, int weapon_type); |
| 404 | |
| 405 | // Fires a weapon from our player. Won't fire if ammo/energy requirements aren't met. |
| 406 | // Parameters: weapon_type - either PW_PRIMARY or PW_SECONDARY |
| 407 | void FireWeaponFromPlayercxx . . $ FireWeaponFromPlayer(c0304a89cf526e9b).(objectcxx . . $ object# *objp, int weapon_type, int down_count, bool down_state, float down_time); |
| 408 | |
| 409 | // Fires a flare from our player. |
| 410 | // It might make sense to combine this with FireWeaponFromPlayer(), or maybe not |
| 411 | void FireFlareFromPlayercxx . . $ FireFlareFromPlayer(419c470199a90a97).(objectcxx . . $ object# *objp); |
| 412 | |
| 413 | // Does per frame weapon code |
| 414 | void WeaponDoFramecxx . . $ WeaponDoFrame(419c470199a90a97).(objectcxx . . $ object# *obj); |
| 415 | |
| 416 | // Returns the position and the normal of a gun point |
| 417 | bool WeaponCalcGuncxx . . $ WeaponCalcGun(85e3752e9562a225).(vectorcxx . . $ vector# *gun_point, vectorcxx . . $ vector# *gun_normal, objectcxx . . $ object# *obj, int gun_num); |
| 418 | |
| 419 | // Checks for relation between weapons and other objects |
| 420 | extern bool ObjectsAreRelatedcxx . . $ ObjectsAreRelated(cf9ef193275fa6d8).(int o1, int o2); |
| 421 | |
| 422 | // A quick way to see where a weapon hits. Weapons make debris. |
| 423 | void CreateWeaponDebriscxx . . $ CreateWeaponDebris(419c470199a90a97).(objectcxx . . $ object# *obj); |
| 424 | |
| 425 | // Selects a weapon |
| 426 | void SelectWeaponcxx . . $ SelectWeapon(d4f767463ce0a6b3).(int slot); |
| 427 | |
| 428 | // automatically switches primary weapon to this value. and type. |
| 429 | int SwitchPlayerWeaponcxx . . $ SwitchPlayerWeapon(7864480464b09eea).(int weapon_type); |
| 430 | |
| 431 | // Auto selects a weapon, usually the next best weapon. |
| 432 | // weapon_type is either PW_PRIMARY or PW_SECONDARY |
| 433 | // if new_wpn != -1, then we will see if the current weapon is inferior, to new weapon. If |
| 434 | // it isn't, then the new weapon is selected. |
| 435 | // returns true if selecting new weapon, otherwise false. |
| 436 | bool AutoSelectWeaponcxx . . $ AutoSelectWeapon(cf9ef193275fa6d8).(int weapon_type, int new_wpn = -1); |
| 437 | |
| 438 | // is a weapon secondary or primary? |
| 439 | bool IsWeaponSecondarycxx . . $ IsWeaponSecondary(83c267b20bac841a).(int index); |
| 440 | |
| 441 | // used for sequencing |
| 442 | // resets memory for what slots have high priority weapons (laser->super_laser, for instance) when user selects |
| 443 | void ResetWeaponSelectStatescxx . . $ ResetWeaponSelectStates(ed53e3bbd3fa2f69).(uint16_tcxx . . $ uint16_t# new_state = 0); |
| 444 | |
| 445 | // save and load weapon state information |
| 446 | void SaveWeaponSelectStatescxx . . $ SaveWeaponSelectStates(3639e799710acb68).(CFILEcxx . . $ CFILE# *fp); |
| 447 | void LoadWeaponSelectStatescxx . . $ LoadWeaponSelectStates(3639e799710acb68).(CFILEcxx . . $ CFILE# *fp); |
| 448 | |
| 449 | // Draws an alpha blended polygon over the entire 3d rendering scene |
| 450 | // The r,g,b floats specify the color |
| 451 | void DrawAlphaBlendedScreencxx . . $ DrawAlphaBlendedScreen(7e9a355db6148521).(float r, float g, float b, float alpha); |
| 452 | |
| 453 | // Does the weapon spray effect for an object |
| 454 | void DoSprayEffectcxx . . $ DoSprayEffect(8a3ad1df6cc7128b).(objectcxx . . $ object# *obj, otype_wb_infocxx . . $ otype_wb_info# *static_wb, uint8_tcxx . . $ uint8_t# wb_index); |
| 455 | |
| 456 | // Plays the animation that accompanies a weapon death |
| 457 | void DoWeaponExplodedcxx . . $ DoWeaponExploded(7abc5162509c28d6).(objectcxx . . $ object# *, vectorcxx . . $ vector# *norm = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!, vectorcxx . . $ vector# *collision_point = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:416:9`!, objectcxx . . $ object# *hit_object = NULLcxx . . $ `<external>/15298297234472979974/stddef.h:416:9`!); |
| 458 | |
| 459 | void TimeoutWeaponcxx . . $ TimeoutWeapon(419c470199a90a97).(objectcxx . . $ object# *); |
| 460 | |
| 461 | // Creates chidren from a dying weapon |
| 462 | void CreateImpactSpawnFromWeaponcxx . . $ CreateImpactSpawnFromWeapon(835e87111e401cce).(objectcxx . . $ object# *obj, vectorcxx . . $ vector# *norm); |
| 463 | |
| 464 | // Releases the guided missile of a passed in player |
| 465 | void ReleaseGuidedMissilecxx . . $ ReleaseGuidedMissile(d4f767463ce0a6b3).(int slot); |
| 466 | |
| 467 | // Releases the user timeout of a passed in player |
| 468 | void ReleaseUserTimeoutMissilecxx . . $ ReleaseUserTimeoutMissile(d4f767463ce0a6b3).(int slot); |
| 469 | |
| 470 | // Retreives the weapon in the weapon array based off of an 'index' from 0-19 (non-mapped |
| 471 | // primary and secondaries) (we need a ship too.) |
| 472 | weaponcxx . . $ weapon# *GetWeaponFromIndexcxx . . $ GetWeaponFromIndex(8877214bf23c386e).(int player, int index); |
| 473 | |
| 474 | // Creates a robot as a countermeasure |
| 475 | void CreateRobotSpawnFromWeaponcxx . . $ CreateRobotSpawnFromWeapon(419c470199a90a97).(objectcxx . . $ object# *obj); |
| 476 | |
| 477 | // Given a parent object and a weapon id, creates that countermeasure |
| 478 | void CreateCountermeasureFromObjectcxx . . $ CreateCountermeasureFromObject(766a1b7183ffa4b4).(objectcxx . . $ object# *parent, int weapon_id); |
| 479 | |
| 480 | ////////////////////////////////////////////////////////////////////////////// |
| 481 | const uint16_tcxx . . $ uint16_t# WPNSEL_SKIPcxx . . $ WPNSEL_SKIP. = 0x8000, WPNSEL_INVALIDcxx . . $ WPNSEL_INVALID. = 0xffff; |
| 482 | |
| 483 | const uint16_tcxx . . $ uint16_t# DefaultPrimarySelectListcxx . . $ DefaultPrimarySelectList.[MAX_PRIMARY_WEAPONScxx . . $ `Descent3/weapon.h:202:9`!] = { |
| 484 | LASER_INDEXcxx . . $ `Descent3/weapon_external.h:22:9`!, VAUSS_INDEXcxx . . $ `Descent3/weapon_external.h:23:9`!, MICROWAVE_INDEXcxx . . $ `Descent3/weapon_external.h:24:9`!, PLASMA_INDEXcxx . . $ `Descent3/weapon_external.h:25:9`!, FUSION_INDEXcxx . . $ `Descent3/weapon_external.h:26:9`!, |
| 485 | SUPER_LASER_INDEXcxx . . $ `Descent3/weapon_external.h:27:9`!, MASSDRIVER_INDEXcxx . . $ `Descent3/weapon_external.h:28:9`!, NAPALM_INDEXcxx . . $ `Descent3/weapon_external.h:29:9`!, EMD_INDEXcxx . . $ `Descent3/weapon_external.h:30:9`!, OMEGA_INDEXcxx . . $ `Descent3/weapon_external.h:31:9`!}; |
| 486 | |
| 487 | const uint16_tcxx . . $ uint16_t# DefaultSecondarySelectListcxx . . $ DefaultSecondarySelectList.[MAX_SECONDARY_WEAPONScxx . . $ `Descent3/weapon.h:203:9`!] = { |
| 488 | CONCUSSION_INDEXcxx . . $ `Descent3/weapon_external.h:32:9`!, HOMING_INDEXcxx . . $ `Descent3/weapon_external.h:33:9`!, IMPACTMORTAR_INDEXcxx . . $ `Descent3/weapon_external.h:34:9`!, SMART_INDEXcxx . . $ `Descent3/weapon_external.h:35:9`!, MEGA_INDEXcxx . . $ `Descent3/weapon_external.h:36:9`!, FRAG_INDEXcxx . . $ `Descent3/weapon_external.h:37:9`!, |
| 489 | GUIDED_INDEXcxx . . $ `Descent3/weapon_external.h:38:9`! + WPNSEL_SKIPcxx . . $ WPNSEL_SKIP., NAPALMROCKET_INDEXcxx . . $ `Descent3/weapon_external.h:39:9`!, CYCLONE_INDEXcxx . . $ `Descent3/weapon_external.h:40:9`!, BLACKSHARK_INDEXcxx . . $ `Descent3/weapon_external.h:41:9`!}; |
| 490 | |
| 491 | // weapon auto selection info. |
| 492 | uint16_tcxx . . $ uint16_t# GetAutoSelectPrimaryWpnIdxcxx . . $ GetAutoSelectPrimaryWpnIdx(1ab5934a54f935a6).(int slot); |
| 493 | uint16_tcxx . . $ uint16_t# GetAutoSelectSecondaryWpnIdxcxx . . $ GetAutoSelectSecondaryWpnIdx(1ab5934a54f935a6).(int slot); |
| 494 | void SetAutoSelectPrimaryWpnIdxcxx . . $ SetAutoSelectPrimaryWpnIdx(a7050f1a4cb56049).(int slot, uint16_tcxx . . $ uint16_t# idx); |
| 495 | void SetAutoSelectSecondaryWpnIdxcxx . . $ SetAutoSelectSecondaryWpnIdx(a7050f1a4cb56049).(int slot, uint16_tcxx . . $ uint16_t# idx); |
| 496 | |
| 497 | #endif |