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