1 /*
2 ===========================================================================
3 Copyright (C) 2000 - 2013, Raven Software, Inc.
4 Copyright (C) 2001 - 2013, Activision, Inc.
5 Copyright (C) 2013 - 2015, OpenJK contributors
6 
7 This file is part of the OpenJK source code.
8 
9 OpenJK is free software; you can redistribute it and/or modify it
10 under the terms of the GNU General Public License version 2 as
11 published by the Free Software Foundation.
12 
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, see <http://www.gnu.org/licenses/>.
20 ===========================================================================
21 */
22 
23 // Stuff from g_weapon.cpp
24 extern vec3_t	wpFwd, wpVright, wpUp;
25 extern vec3_t	wpMuzzle;
26 
27 extern gentity_t *ent_list[MAX_GENTITIES];
28 
29 void drop_charge(gentity_t *ent, vec3_t start, vec3_t dir);
30 void ViewHeightFix( const gentity_t * const ent );
31 qboolean LogAccuracyHit( gentity_t *target, gentity_t *attacker );
32 extern qboolean G_BoxInBounds( const vec3_t point, const vec3_t mins, const vec3_t maxs, const vec3_t boundsMins, const vec3_t boundsMaxs );
33 extern qboolean Jedi_DodgeEvasion( gentity_t *self, gentity_t *shooter, trace_t *tr, int hitLoc );
34 extern qboolean PM_DroidMelee( int npc_class );
35 
36 extern int g_rocketLockEntNum;
37 extern int g_rocketLockTime;
38 extern int	g_rocketSlackTime;
39 
40 void WP_TraceSetStart( const gentity_t *ent, vec3_t start, const vec3_t mins, const vec3_t maxs );
41 gentity_t *CreateMissile( vec3_t org, vec3_t dir, float vel, int life, gentity_t *owner, qboolean altFire = qfalse );
42 void WP_Stick( gentity_t *missile, trace_t *trace, float fudge_distance = 0.0f );
43 void WP_Explode( gentity_t *self );
44 void WP_ExplosiveDie( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int meansOfDeath,int dFlags,int hitLoc );
45 
46 
47 // Functions from the wp_ files
48 
49 void WP_ATSTMainFire( gentity_t *ent );
50 void WP_ATSTSideAltFire( gentity_t *ent );
51 void WP_ATSTSideFire( gentity_t *ent );
52 void WP_FireBlaster( gentity_t *ent, qboolean alt_fire );
53 void WP_BotLaser( gentity_t *ent );
54 void WP_FireBowcaster( gentity_t *ent, qboolean alt_fire );
55 void WP_FireBryarPistol( gentity_t *ent, qboolean alt_fire );
56 void WP_FireDEMP2( gentity_t *ent, qboolean alt_fire );
57 void WP_FireDetPack( gentity_t *ent, qboolean alt_fire );
58 int G_GetHitLocFromTrace( trace_t *trace, int mod );
59 void WP_FireDisruptor( gentity_t *ent, qboolean alt_fire );
60 void WP_EmplacedFire( gentity_t *ent );
61 void WP_FireFlechette( gentity_t *ent, qboolean alt_fire );
62 void prox_mine_stick( gentity_t *self, gentity_t *other, trace_t *trace );
63 void prox_mine_think( gentity_t *ent );
64 void WP_Melee( gentity_t *ent );
65 void WP_FireRepeater( gentity_t *ent, qboolean alt_fire );
66 void rocketThink( gentity_t *ent );
67 void WP_FireRocket( gentity_t *ent, qboolean alt_fire );
68 void WP_FireStunBaton( gentity_t *ent, qboolean alt_fire );
69 void thermalDetonatorExplode( gentity_t *ent );
70 void thermal_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod, int dFlags, int hitLoc );
71 qboolean WP_LobFire( gentity_t *self, vec3_t start, vec3_t target, vec3_t mins, vec3_t maxs, int clipmask,
72 				vec3_t velocity, qboolean tracePath, int ignoreEntNum, int enemyNum,
73 				float minSpeed = 0, float maxSpeed = 0, float idealSpeed = 0, qboolean mustHit = qfalse );
74 void WP_ThermalThink( gentity_t *ent );
75 gentity_t *WP_FireThermalDetonator( gentity_t *ent, qboolean alt_fire );
76 gentity_t *WP_DropThermal( gentity_t *ent );
77 void touchLaserTrap( gentity_t *ent, gentity_t *other, trace_t *trace );
78 void WP_prox_mine_think( gentity_t *ent );
79 void laserTrapThink( gentity_t *ent );
80 void CreateLaserTrap( gentity_t *laserTrap, vec3_t start, gentity_t *owner );
81 void WP_PlaceLaserTrap( gentity_t *ent, qboolean alt_fire );