1 /* 2 =========================================================================== 3 Copyright (C) 1999 - 2005, Id Software, Inc. 4 Copyright (C) 2000 - 2013, Raven Software, Inc. 5 Copyright (C) 2001 - 2013, Activision, Inc. 6 Copyright (C) 2013 - 2015, OpenJK contributors 7 8 This file is part of the OpenJK source code. 9 10 OpenJK is free software; you can redistribute it and/or modify it 11 under the terms of the GNU General Public License version 2 as 12 published by the Free Software Foundation. 13 14 This program is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with this program; if not, see <http://www.gnu.org/licenses/>. 21 =========================================================================== 22 */ 23 24 // Filename:- weapons.h 25 // 26 // Note that this is now included from both server and game modules, so don't include any other header files 27 // within this one that might break stuff... 28 29 #ifndef __WEAPONS_H__ 30 #define __WEAPONS_H__ 31 32 #include "../qcommon/q_shared.h" 33 34 typedef enum //# weapon_e 35 { 36 WP_NONE, 37 38 // Player weapons 39 WP_SABER, // player and NPC weapon 40 WP_BLASTER_PISTOL, // player and NPC weapon 41 WP_BLASTER, // player and NPC weapon 42 WP_DISRUPTOR, // player and NPC weapon 43 WP_BOWCASTER, // NPC weapon - player can pick this up, but never starts with them 44 WP_REPEATER, // NPC weapon - player can pick this up, but never starts with them 45 WP_DEMP2, // NPC weapon - player can pick this up, but never starts with them 46 WP_FLECHETTE, // NPC weapon - player can pick this up, but never starts with them 47 WP_ROCKET_LAUNCHER, // NPC weapon - player can pick this up, but never starts with them 48 WP_THERMAL, // player and NPC weapon 49 WP_TRIP_MINE, // NPC weapon - player can pick this up, but never starts with them 50 WP_DET_PACK, // NPC weapon - player can pick this up, but never starts with them 51 WP_CONCUSSION, // NPC weapon - player can pick this up, but never starts with them 52 53 //extras 54 WP_MELEE, // player and NPC weapon - Any ol' melee attack 55 56 //when in atst 57 WP_ATST_MAIN, 58 WP_ATST_SIDE, 59 60 // These can never be gotten directly by the player 61 WP_STUN_BATON, // stupid weapon, should remove 62 63 //NPC weapons 64 WP_BRYAR_PISTOL, // NPC weapon - player can pick this up, but never starts with them 65 66 WP_EMPLACED_GUN, 67 68 WP_BOT_LASER, // Probe droid - Laser blast 69 70 WP_TURRET, // turret guns 71 72 WP_TIE_FIGHTER, 73 74 WP_RAPID_FIRE_CONC, 75 76 WP_JAWA, 77 WP_TUSKEN_RIFLE, 78 WP_TUSKEN_STAFF, 79 WP_SCEPTER, 80 WP_NOGHRI_STICK, 81 82 //# #eol 83 WP_NUM_WEAPONS 84 } weapon_t; 85 86 #define FIRST_WEAPON WP_SABER // this is the first weapon for next and prev weapon switching 87 #define MAX_PLAYER_WEAPONS WP_STUN_BATON // this is the max you can switch to and get with the give all. - FIXME: it's actually this one *minus* one... why? 88 89 // AMMO_NONE must be first and AMMO_MAX must be last, cause weapon load validates based off of these vals 90 typedef enum //# ammo_e 91 { 92 AMMO_NONE, 93 AMMO_FORCE, // AMMO_PHASER 94 AMMO_BLASTER, // AMMO_STARFLEET, 95 AMMO_POWERCELL, // AMMO_ALIEN, 96 AMMO_METAL_BOLTS, 97 AMMO_ROCKETS, 98 AMMO_EMPLACED, 99 AMMO_THERMAL, 100 AMMO_TRIPMINE, 101 AMMO_DETPACK, 102 AMMO_MAX 103 } ammo_t; 104 105 106 typedef struct weaponData_s 107 { 108 char classname[32]; // Spawning name 109 char weaponMdl[64]; // Weapon Model 110 char firingSnd[64]; // Sound made when fired 111 char altFiringSnd[64]; // Sound made when alt-fired 112 // char flashSnd[64]; // Sound made by flash 113 // char altFlashSnd[64]; // Sound made by an alt-flash 114 char stopSnd[64]; // Sound made when weapon stops firing 115 char chargeSnd[64]; // sound to start when the weapon initiates the charging sequence 116 char altChargeSnd[64]; // alt sound to start when the weapon initiates the charging sequence 117 char selectSnd[64]; // the sound to play when this weapon gets selected 118 119 int ammoIndex; // Index to proper ammo slot 120 int ammoLow; // Count when ammo is low 121 122 int energyPerShot; // Amount of energy used per shot 123 int fireTime; // Amount of time between firings 124 int range; // Range of weapon 125 126 int altEnergyPerShot; // Amount of energy used for alt-fire 127 int altFireTime; // Amount of time between alt-firings 128 int altRange; // Range of alt-fire 129 130 char weaponIcon[64]; // Name of weapon icon file 131 int numBarrels; // how many barrels should we expect for this weapon? 132 133 char missileMdl[64]; // Missile Model 134 char missileSound[64]; // Missile flight sound 135 float missileDlight; // what is says 136 vec3_t missileDlightColor; // ditto 137 138 char alt_missileMdl[64]; // Missile Model 139 char alt_missileSound[64]; // Missile sound 140 float alt_missileDlight; // what is says 141 vec3_t alt_missileDlightColor; // ditto 142 143 char missileHitSound[64]; // Missile impact sound 144 char altmissileHitSound[64]; // alt Missile impact sound 145 void *func; 146 void *altfunc; 147 148 char mMuzzleEffect[64]; 149 int mMuzzleEffectID; 150 char mAltMuzzleEffect[64]; 151 int mAltMuzzleEffectID; 152 153 int damage; 154 int altDamage; 155 int splashDamage; 156 int altSplashDamage; 157 float splashRadius; 158 float altSplashRadius; 159 160 } weaponData_t; 161 162 163 typedef struct ammoData_s 164 { 165 char icon[64]; // Name of ammo icon file 166 int max; // Max amount player can hold of ammo 167 } ammoData_t; 168 169 // Bryar Pistol 170 //-------- 171 #define BRYAR_PISTOL_VEL 1800 172 #define BRYAR_PISTOL_DAMAGE 14 173 #define BRYAR_CHARGE_UNIT 200.0f // bryar charging gives us one more unit every 200ms--if you change this, you'll have to do the same in bg_pmove 174 175 // E11 Blaster 176 //--------- 177 #define BLASTER_MAIN_SPREAD 0.5f 178 #define BLASTER_ALT_SPREAD 1.5f 179 #define BLASTER_NPC_SPREAD 0.5f 180 #define BLASTER_VELOCITY 2300 181 #define BLASTER_NPC_VEL_CUT 0.5f 182 #define BLASTER_NPC_HARD_VEL_CUT 0.7f 183 #define BLASTER_DAMAGE 20 184 #define BLASTER_NPC_DAMAGE_EASY 6 185 #define BLASTER_NPC_DAMAGE_NORMAL 12 // 14 186 #define BLASTER_NPC_DAMAGE_HARD 16 // 18 187 188 // Tenloss Disruptor 189 //---------- 190 #define DISRUPTOR_MAIN_DAMAGE 14 191 #define DISRUPTOR_NPC_MAIN_DAMAGE_EASY 5 192 #define DISRUPTOR_NPC_MAIN_DAMAGE_MEDIUM 10 193 #define DISRUPTOR_NPC_MAIN_DAMAGE_HARD 15 194 195 #define DISRUPTOR_ALT_DAMAGE 12 196 #define DISRUPTOR_NPC_ALT_DAMAGE_EASY 15 197 #define DISRUPTOR_NPC_ALT_DAMAGE_MEDIUM 25 198 #define DISRUPTOR_NPC_ALT_DAMAGE_HARD 30 199 #define DISRUPTOR_ALT_TRACES 3 // can go through a max of 3 entities 200 #define DISRUPTOR_CHARGE_UNIT 150.0f // distruptor charging gives us one more unit every 150ms--if you change this, you'll have to do the same in bg_pmove 201 202 // Wookie Bowcaster 203 //---------- 204 #define BOWCASTER_DAMAGE 45 205 #define BOWCASTER_VELOCITY 1300 206 #define BOWCASTER_NPC_DAMAGE_EASY 12 207 #define BOWCASTER_NPC_DAMAGE_NORMAL 24 208 #define BOWCASTER_NPC_DAMAGE_HARD 36 209 #define BOWCASTER_SPLASH_DAMAGE 0 210 #define BOWCASTER_SPLASH_RADIUS 0 211 #define BOWCASTER_SIZE 2 212 213 #define BOWCASTER_ALT_SPREAD 5.0f 214 #define BOWCASTER_VEL_RANGE 0.3f 215 #define BOWCASTER_CHARGE_UNIT 200.0f // bowcaster charging gives us one more unit every 200ms--if you change this, you'll have to do the same in bg_pmove 216 217 // Heavy Repeater 218 //---------- 219 #define REPEATER_SPREAD 1.4f 220 #define REPEATER_NPC_SPREAD 0.7f 221 #define REPEATER_DAMAGE 8 222 #define REPEATER_VELOCITY 1600 223 #define REPEATER_NPC_DAMAGE_EASY 2 224 #define REPEATER_NPC_DAMAGE_NORMAL 4 225 #define REPEATER_NPC_DAMAGE_HARD 6 226 227 #define REPEATER_ALT_SIZE 3 // half of bbox size 228 #define REPEATER_ALT_DAMAGE 60 229 #define REPEATER_ALT_SPLASH_DAMAGE 60 230 #define REPEATER_ALT_SPLASH_RADIUS 128 231 #define REPEATER_ALT_VELOCITY 1100 232 #define REPEATER_ALT_NPC_DAMAGE_EASY 15 233 #define REPEATER_ALT_NPC_DAMAGE_NORMAL 30 234 #define REPEATER_ALT_NPC_DAMAGE_HARD 45 235 236 // DEMP2 237 //---------- 238 #define DEMP2_DAMAGE 15 239 #define DEMP2_VELOCITY 1800 240 #define DEMP2_NPC_DAMAGE_EASY 6 241 #define DEMP2_NPC_DAMAGE_NORMAL 12 242 #define DEMP2_NPC_DAMAGE_HARD 18 243 #define DEMP2_SIZE 2 // half of bbox size 244 245 #define DEMP2_ALT_DAMAGE 15 246 #define DEMP2_CHARGE_UNIT 500.0f // demp2 charging gives us one more unit every 500ms--if you change this, you'll have to do the same in bg_pmove 247 #define DEMP2_ALT_RANGE 4096 248 #define DEMP2_ALT_SPLASHRADIUS 256 249 250 // Golan Arms Flechette 251 //--------- 252 #define FLECHETTE_SHOTS 6 253 #define FLECHETTE_SPREAD 4.0f 254 #define FLECHETTE_DAMAGE 15 255 #define FLECHETTE_VEL 3500 256 #define FLECHETTE_SIZE 1 257 258 #define FLECHETTE_ALT_DAMAGE 20 259 #define FLECHETTE_ALT_SPLASH_DAM 20 260 #define FLECHETTE_ALT_SPLASH_RAD 128 261 262 // NOT CURRENTLY USED 263 #define FLECHETTE_MINE_RADIUS_CHECK 200 264 #define FLECHETTE_MINE_VEL 1000 265 #define FLECHETTE_MINE_DAMAGE 100 266 #define FLECHETTE_MINE_SPLASH_DAMAGE 200 267 #define FLECHETTE_MINE_SPLASH_RADIUS 200 268 269 // Personal Rocket Launcher 270 //--------- 271 #define ROCKET_VELOCITY 900 272 #define ROCKET_DAMAGE 100 273 #define ROCKET_SPLASH_DAMAGE 100 274 #define ROCKET_SPLASH_RADIUS 160 275 #define ROCKET_NPC_DAMAGE_EASY 20 276 #define ROCKET_NPC_DAMAGE_NORMAL 40 277 #define ROCKET_NPC_DAMAGE_HARD 60 278 #define ROCKET_SIZE 3 279 280 #define ROCKET_ALT_VELOCITY (ROCKET_VELOCITY*0.5) 281 #define ROCKET_ALT_THINK_TIME 100 282 283 // Concussion Rifle 284 //--------- 285 //primary 286 #define CONC_VELOCITY 3000 287 #define CONC_DAMAGE 150 288 #define CONC_NPC_SPREAD 0.7f 289 #define CONC_NPC_DAMAGE_EASY 15 290 #define CONC_NPC_DAMAGE_NORMAL 30 291 #define CONC_NPC_DAMAGE_HARD 50 292 #define CONC_SPLASH_DAMAGE 50 293 #define CONC_SPLASH_RADIUS 300 294 //alt 295 #define CONC_ALT_DAMAGE 225//100 296 #define CONC_ALT_NPC_DAMAGE_EASY 10 297 #define CONC_ALT_NPC_DAMAGE_MEDIUM 20 298 #define CONC_ALT_NPC_DAMAGE_HARD 30 299 300 // Emplaced Gun 301 //-------------- 302 #define EMPLACED_VEL 6000 // very fast 303 #define EMPLACED_DAMAGE 150 // and very damaging 304 #define EMPLACED_SIZE 5 // make it easier to hit things 305 306 // ATST Main Gun 307 //-------------- 308 #define ATST_MAIN_VEL 4000 // 309 #define ATST_MAIN_DAMAGE 25 // 310 #define ATST_MAIN_SIZE 3 // make it easier to hit things 311 312 // ATST Side Gun 313 //--------------- 314 #define ATST_SIDE_MAIN_DAMAGE 75 315 #define ATST_SIDE_MAIN_VELOCITY 1300 316 #define ATST_SIDE_MAIN_NPC_DAMAGE_EASY 30 317 #define ATST_SIDE_MAIN_NPC_DAMAGE_NORMAL 40 318 #define ATST_SIDE_MAIN_NPC_DAMAGE_HARD 50 319 #define ATST_SIDE_MAIN_SIZE 4 320 #define ATST_SIDE_MAIN_SPLASH_DAMAGE 10 // yeah, pretty small, either zero out or make it worth having? 321 #define ATST_SIDE_MAIN_SPLASH_RADIUS 16 // yeah, pretty small, either zero out or make it worth having? 322 323 #define ATST_SIDE_ALT_VELOCITY 1100 324 #define ATST_SIDE_ALT_NPC_VELOCITY 600 325 #define ATST_SIDE_ALT_DAMAGE 130 326 327 #define ATST_SIDE_ROCKET_NPC_DAMAGE_EASY 30 328 #define ATST_SIDE_ROCKET_NPC_DAMAGE_NORMAL 50 329 #define ATST_SIDE_ROCKET_NPC_DAMAGE_HARD 90 330 331 #define ATST_SIDE_ALT_SPLASH_DAMAGE 130 332 #define ATST_SIDE_ALT_SPLASH_RADIUS 200 333 #define ATST_SIDE_ALT_ROCKET_SIZE 5 334 #define ATST_SIDE_ALT_ROCKET_SPLASH_SCALE 0.5f // scales splash for NPC's 335 336 // Stun Baton 337 //-------------- 338 #define STUN_BATON_DAMAGE 22 339 #define STUN_BATON_ALT_DAMAGE 22 340 #define STUN_BATON_RANGE 25 341 342 // Laser Trip Mine 343 //-------------- 344 #define LT_DAMAGE 150 345 #define LT_SPLASH_RAD 256.0f 346 #define LT_SPLASH_DAM 90 347 348 #define LT_VELOCITY 250.0f 349 #define LT_ALT_VELOCITY 1000.0f 350 351 #define PROX_MINE_RADIUS_CHECK 190 352 353 #define LT_SIZE 3.0f 354 #define LT_ALT_TIME 2000 355 #define LT_ACTIVATION_DELAY 1000 356 #define LT_DELAY_TIME 50 357 358 // Thermal Detonator 359 //-------------- 360 #define TD_DAMAGE 100 361 #define TD_NPC_DAMAGE_CUT 0.6f // NPC thrown dets deliver only 60% of the damage that a player thrown one does 362 #define TD_SPLASH_RAD 128 363 #define TD_SPLASH_DAM 90 364 #define TD_VELOCITY 900 365 #define TD_MIN_CHARGE 0.15f 366 #define TD_TIME 4000 367 #define TD_THINK_TIME 300 // don't think too often? 368 #define TD_TEST_RAD (TD_SPLASH_RAD * 0.8f) // no sense in auto-blowing up if exactly on the radius edge--it would hardly do any damage 369 #define TD_ALT_TIME 3000 370 371 #define TD_ALT_DAMAGE 100 372 #define TD_ALT_SPLASH_RAD 128 373 #define TD_ALT_SPLASH_DAM 90 374 #define TD_ALT_VELOCITY 600 375 #define TD_ALT_MIN_CHARGE 0.15f 376 #define TD_ALT_TIME 3000 377 378 // Tusken Rifle Shot 379 //-------------- 380 #define TUSKEN_RIFLE_VEL 3000 // fast 381 #define TUSKEN_RIFLE_DAMAGE_EASY 20 // damaging 382 #define TUSKEN_RIFLE_DAMAGE_MEDIUM 30 // very damaging 383 #define TUSKEN_RIFLE_DAMAGE_HARD 50 // extremely damaging 384 385 386 #endif//#ifndef __WEAPONS_H__ 387