1 #using scripts\codescripts\struct;
3 #using scripts\shared\callbacks_shared;
4 #using scripts\shared\clientfield_shared;
5 #using scripts\shared\filter_shared;
6 #using scripts\shared\system_shared;
7 #using scripts\shared\util_shared;
8 #using scripts\shared\vehicle_shared;
10 #insert scripts\shared\shared.gsh;
11 #insert scripts\shared\version.gsh;
27 player = GetLocalPlayer( localClientNum );
28 if( isdefined( player ) )
33 self.notifyOnBulletImpact =
true;
37 self.trophy_on =
false;
43 if ( isdefined(
self ) )
52 self endon(
"disconnect" );
53 self notify(
"player_shock_fx_fade_off_end" );
54 self endon(
"player_shock_fx_fade_off_end" );
56 if ( !isAlive(
self ) )
66 while ( GetTime() <=
startTime + fadeoutTime * 1000 && isAlive(
self ) )
68 ratio = ( GetTime() -
startTime ) / ( fadeoutTime * 1000 );
69 currentValue = LerpFloat( amount, 0, ratio );
85 self endon(
"entityshutdown" );
86 self notify(
"stop_set_trophy_state" );
87 self endon(
"stop_set_trophy_state" );
89 if ( isdefined(
self.trophydestroy_fx_handle ) )
91 StopFX( localClientNum,
self.trophydestroy_fx_handle );
94 if ( isdefined(
self.trophylight_fx_handle ) )
96 StopFX( localClientNum,
self.trophylight_fx_handle );
101 if( isdefined(
self.scriptbundlesettings ) )
106 if ( !isdefined( settings ) )
113 warmuptime =
VAL( settings.trophywarmup, 0.1 );
117 while ( GetTime() <= start + warmuptime * 1000 )
119 if ( isdefined( settings.trophylight_fx_1 ) && isdefined( settings.trophylight_tag_1 ) )
121 self.trophylight_fx_handle = PlayFXOnTag( localClientNum, settings.trophylight_fx_1,
self, settings.trophylight_tag_1 );
126 if ( isdefined(
self.trophylight_fx_handle ) )
128 StopFX( localClientNum,
self.trophylight_fx_handle );
131 wait max( interval, 0.05 );
135 if ( isdefined( settings.trophylight_fx_1 ) && isdefined( settings.trophylight_tag_1 ) )
137 self.trophylight_fx_handle = PlayFXOnTag( localClientNum, settings.trophylight_fx_1,
self, settings.trophylight_tag_1 );
140 self.trophy_on =
true;
142 self PlayLoopSound (
"wpn_trophy_spin_loop");
145 while ( isdefined( settings.trophyanim ) && rate < 1 )
148 self SetAnim( settings.trophyanim, 1.0, 0.1, rate );
151 self SetAnim( settings.trophyanim, 1.0, 0.1, 1.0 );
155 self.trophy_on =
false;
157 self StopAllLoopSounds();
159 if ( isdefined( settings.trophyanim ) )
161 self SetAnim( settings.trophyanim, 0.0, 0.2, 1.0 );
164 if ( isdefined( settings.trophydestroyfx ) )
166 self.trophydestroy_fx_handle = PlayFXOnTag( localClientNum, settings.trophydestroyfx,
self,
"tag_target_lower" );
173 self endon(
"entityshutdown" );
175 if( isdefined(
self.scriptbundlesettings ) )
186 self waittill(
"damage", attacker, impactPos, effectDir, partname );
187 if( partName ==
"tag_target_lower" || partName ==
"tag_target_upper" || partName ==
"tag_defense_active" || partName ==
"tag_body_animate" )
191 if( IsDefined( attacker ) && attacker IsPlayer() && attacker.team !=
self.team )
193 PlayFx( localClientNum, settings.weakspotfx, impactPos, effectDir );
194 self playsound( 0,
"veh_quadtank_panel_hit" );