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 // Heavy Repeater Weapon
24 #include "cg_local.h"
25 #include "cg_media.h"
26 #include "FxScheduler.h"
27
28 /*
29 ---------------------------
30 FX_RepeaterProjectileThink
31 ---------------------------
32 */
33
FX_RepeaterProjectileThink(centity_t * cent,const struct weaponInfo_s * weapon)34 void FX_RepeaterProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon )
35 {
36 vec3_t forward;
37
38 if ( VectorNormalize2( cent->currentState.pos.trDelta, forward ) == 0.0f )
39 {
40 forward[2] = 1.0f;
41 }
42
43 theFxScheduler.PlayEffect( "repeater/projectile", cent->lerpOrigin, forward );
44 }
45
46 /*
47 ------------------------
48 FX_RepeaterHitWall
49 ------------------------
50 */
51
FX_RepeaterHitWall(vec3_t origin,vec3_t normal)52 void FX_RepeaterHitWall( vec3_t origin, vec3_t normal )
53 {
54 theFxScheduler.PlayEffect( "repeater/wall_impact", origin, normal );
55 }
56
57 /*
58 ------------------------
59 FX_RepeaterHitPlayer
60 ------------------------
61 */
62
FX_RepeaterHitPlayer(vec3_t origin,vec3_t normal,qboolean humanoid)63 void FX_RepeaterHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid )
64 {
65 theFxScheduler.PlayEffect( "repeater/wall_impact", origin, normal );
66 // theFxScheduler.PlayEffect( "repeater/flesh_impact", origin, normal );
67 }
68
69 /*
70 ------------------------------
71 FX_RepeaterAltProjectileThink
72 -----------------------------
73 */
74
FX_RepeaterAltProjectileThink(centity_t * cent,const struct weaponInfo_s * weapon)75 void FX_RepeaterAltProjectileThink( centity_t *cent, const struct weaponInfo_s *weapon )
76 {
77 vec3_t forward;
78
79 if ( VectorNormalize2( cent->currentState.pos.trDelta, forward ) == 0.0f )
80 {
81 forward[2] = 1.0f;
82 }
83
84 theFxScheduler.PlayEffect( "repeater/alt_projectile", cent->lerpOrigin, forward );
85 // theFxScheduler.PlayEffect( "repeater/alt_projectile", cent->lerpOrigin, forward );
86 }
87
88 /*
89 ------------------------
90 FX_RepeaterAltHitWall
91 ------------------------
92 */
93
FX_RepeaterAltHitWall(vec3_t origin,vec3_t normal)94 void FX_RepeaterAltHitWall( vec3_t origin, vec3_t normal )
95 {
96 theFxScheduler.PlayEffect( "repeater/concussion", origin, normal );
97 // theFxScheduler.PlayEffect( "repeater/alt_wall_impact2", origin, normal );
98 }
99
100 /*
101 ------------------------
102 FX_RepeaterAltHitPlayer
103 ------------------------
104 */
105
FX_RepeaterAltHitPlayer(vec3_t origin,vec3_t normal,qboolean humanoid)106 void FX_RepeaterAltHitPlayer( vec3_t origin, vec3_t normal, qboolean humanoid )
107 {
108 theFxScheduler.PlayEffect( "repeater/concussion", origin );
109 // theFxScheduler.PlayEffect( "repeater/alt_wall_impact2", origin, normal );
110 }