1 #using scripts\shared\ai_shared;
2 #using scripts\shared\clientfield_shared;
3 #using scripts\shared\postfx_shared;
6 #insert scripts\shared\shared.gsh;
7 #insert scripts\shared\version.gsh;
8 #insert scripts\shared\ai\raz.gsh;
9 #insert scripts\shared\archetype_shared\archetype_shared.gsh;
11 #precache( "client_fx", RAZ_FOOTSTEP_FX_FILE );
12 #precache( "client_fx", RAZ_TORPEDO_EXPLOSION_FX_FILE );
13 #precache( "client_fx", RAZ_TORPEDO_TRAIL_FX_FILE );
14 #precache( "client_fx", RAZ_GUN_DETACH_FX_FILE );
15 #precache( "client_fx", RAZ_GUN_ONGOING_DAMAGE_FX_FILE );
16 #precache( "client_fx", RAZ_GUN_WEAKPOINT_HIT_FX_FILE );
17 #precache( "client_fx", RAZ_TORPEDO_SELF_FX_FILE );
18 #precache( "client_fx", RAZ_ARMOR_DETACH_FX_FILE );
21 #using_animtree( "generic" );
51 level._raz_taunts = [];
52 ARRAY_ADD(level._raz_taunts,
"vox_mang_mangler_taunt_0");
53 ARRAY_ADD(level._raz_taunts,
"vox_mang_mangler_taunt_1");
54 ARRAY_ADD(level._raz_taunts,
"vox_mang_mangler_taunt_2");
55 ARRAY_ADD(level._raz_taunts,
"vox_mang_mangler_taunt_3");
56 ARRAY_ADD(level._raz_taunts,
"vox_mang_mangler_taunt_4");
57 ARRAY_ADD(level._raz_taunts,
"vox_mang_mangler_taunt_5");
58 ARRAY_ADD(level._raz_taunts,
"vox_mang_mangler_taunt_6");
59 ARRAY_ADD(level._raz_taunts,
"vox_mang_mangler_taunt_7");
60 ARRAY_ADD(level._raz_taunts,
"vox_mang_mangler_taunt_8");
61 ARRAY_ADD(level._raz_taunts,
"vox_mang_mangler_taunt_9");
62 ARRAY_ADD(level._raz_taunts,
"vox_mang_mangler_taunt_10");
63 ARRAY_ADD(level._raz_taunts,
"vox_mang_mangler_taunt_11");
64 ARRAY_ADD(level._raz_taunts,
"vox_mang_mangler_taunt_12");
65 ARRAY_ADD(level._raz_taunts,
"vox_mang_mangler_taunt_13");
68 #namespace RazClientUtils;
83 while( isdefined(
self) )
85 self waittill(
"lights_on");
86 self MapShaderConstant( localClientNum, 0,
"scriptVector3", 0, 1, 1);
88 self waittill(
"lights_off");
89 self MapShaderConstant( localClientNum, 0,
"scriptVector3", 0, 0, 0);
97 while( isdefined(
self) )
99 self waittill(
"roar");
100 self PlaySound(localClientNum,
"vox_raz_exert_enrage",
self GetTagOrigin(
"tag_eye" ));
107 self endon(
"death_start");
111 while( isdefined(
self) )
113 taunt_wait = RandomIntRange(5, 12);
116 if(
IS_TRUE( level.voxAIdeactivate ) )
121 else if(isdefined(
self))
123 taunt_alias = level._raz_taunts[RandomInt(level._raz_taunts.size)];
124 self.taunt_id =
self PlaySound(localClientNum, taunt_alias,
self GetTagOrigin(
"tag_eye" ));
131 self waittill(
"death_start");
133 if( isdefined(
self.taunt_id) )
135 StopSound(
self.taunt_id );
141 e_player = GetLocalPlayer( localClientNum );
142 n_dist = DistanceSquared( pos, e_player.origin );
145 n_scale = ( n_raz_dist - n_dist ) / n_raz_dist;
149 if( n_scale > 1 || n_scale < 0 )
return;
151 if( n_scale <= 0.01 )
return;
152 earthquake_scale = n_scale * 0.1;
154 if( earthquake_scale > 0.01)
156 e_player Earthquake( earthquake_scale, 0.1, pos, n_dist );
159 if( n_scale <= 1 && n_scale > 0.8 )
161 e_player PlayRumbleOnEntity( localClientNum,
"damage_heavy" );
164 else if( n_scale <= 0.8 && n_scale > 0.4 )
166 e_player PlayRumbleOnEntity( localClientNum,
"damage_light" );
170 e_player PlayRumbleOnEntity( localClientNum,
"reload_small" );
173 fx = PlayFXOnTag( localClientNum, level._effect[
RAZ_FOOTSTEP_FX ],
self, bone );
181 function private razTorpedoPlayTrailFX( localClientNum, oldValue, newValue, bNewEnt, bInitialSnap, fieldName, wasDemoJump )
186 function private razPlaySelfFX( localClientNum, oldValue, newValue, bNewEnt, bInitialSnap, fieldName, wasDemoJump )
188 if( newValue == 0 && isDefined(
self.raz_torpedo_self_fx ) )
190 stopFX( localClientNum,
self.raz_torpedo_self_fx );
191 self.raz_torpedo_self_fx = undefined;
193 if( newValue == 1 && !isDefined(
self.raz_torpedo_self_fx ) )
201 if( !isdefined(pos) || !isdefined(angles) )
206 velocity =
self GetVelocity();
208 velocity_normal = VectorNormalize(velocity);
209 velocity_length = Length(velocity);
211 if( isdefined(direction) && direction ==
"back" )
213 launch_dir = AnglesToForward(
self.angles) * -1;
217 launch_dir = AnglesToForward(
self.angles);
220 velocity_length = velocity_length * 0.1;
222 if(velocity_length < 10)
224 velocity_length = 10;
227 launch_dir = launch_dir * 0.5 + velocity_normal * 0.5;
228 launch_dir = launch_dir * velocity_length;
230 CreateDynEntAndLaunch( localClientNum, model, pos, angles,
self.origin, launch_dir * vel_factor );
233 function private razDetachGunFX( localClientNum, oldValue, newValue, bNewEnt, bInitialSnap, fieldName, wasDemoJump )
246 self PlaySound( localClientNum,
"zmb_raz_gun_explo",
self GetTagOrigin(
"tag_eye" ) );
249 function private razGunWeakpointHitFX( localClientNum, oldValue, newValue, bNewEnt, bInitialSnap, fieldName, wasDemoJump )
254 function razHelmetDetach( localClientNum, oldValue, newValue, bNewEnt, bInitialSnap, fieldName, wasDemoJump )
262 thread
ApplyNewFaceAnim( localClientNum,
"ai_zm_dlc3_face_armored_zombie_generic_idle_1");
264 self PlaySound( localClientNum,
"zmb_raz_armor_explo",
self GetTagOrigin(
"tag_eye" ) );
267 function razChestArmorDetach( localClientNum, oldValue, newValue, bNewEnt, bInitialSnap, fieldName, wasDemoJump )
275 self PlaySound( localClientNum,
"zmb_raz_armor_explo",
self GetTagOrigin(
"tag_eye" ) );
286 self PlaySound( localClientNum,
"zmb_raz_armor_explo",
self GetTagOrigin(
"tag_eye" ) );
297 self PlaySound( localClientNum,
"zmb_raz_armor_explo",
self GetTagOrigin(
"tag_eye" ) );
308 self PlaySound( localClientNum,
"zmb_raz_armor_explo",
self GetTagOrigin(
"tag_eye" ) );
316 self endon(
"disconnect");
320 if( isdefined( animation ) )
322 self._currentFaceAnim = animation;
324 if(
self HasDObj(localClientNum) &&
self HasAnimTree() )
326 self SetFlaggedAnimKnob(
"ai_secondary_facial_anim", animation, 1.0, 0.1, 1.0 );
328 self waittill(
"death_start" );
337 if( isdefined(
self._currentFaceAnim ) &&
self HasDObj(localClientNum) &&
self HasAnimTree() )
339 self ClearAnim(
self._currentFaceAnim, 0.2 );
342 self._currentFaceAnim = undefined;