1 #using scripts\codescripts\struct;
3 #using scripts\shared\array_shared;
4 #using scripts\shared\audio_shared;
5 #using scripts\shared\callbacks_shared;
6 #using scripts\shared\clientfield_shared;
7 #using scripts\shared\duplicaterender_mgr;
8 #using scripts\shared\filter_shared;
9 #using scripts\shared\util_shared;
12 #insert scripts\shared\duplicaterender.gsh;
13 #insert scripts\shared\shared.gsh;
14 #insert scripts\shared\version.gsh;
15 #insert scripts\shared\weapons\_weaponobjects.gsh;
17 #using scripts\shared\system_shared;
19 #precache( "client_fx", "weapon/fx_equip_light_os" );
21 #namespace weaponobjects;
35 level._effect[
"powerLight" ] =
"weapon/fx_equip_light_os";
43 if(
self != GetLocalPlayer( local_client_num ) )
53 self notify(
"watch_killstreak_tap_activation" );
54 self endon(
"watch_killstreak_tap_activation" );
55 self endon(
"death" );
56 self endon(
"disconnect" );
57 self endon(
"entityshutdown" );
59 while ( IsDefined(
self ) )
61 self waittill(
"notetrack", note );
62 if ( note ==
"activate_datapad" )
64 uimodel = CreateUIModel( GetUIModelForController( local_client_num ),
"hudItems.killstreakActivated" );
65 SetUIModelValue( uimodel, 1 );
68 if ( note ==
"deactivate_datapad" )
70 uimodel = CreateUIModel( GetUIModelForController( local_client_num ),
"hudItems.killstreakActivated" );
71 SetUIModelValue( uimodel, 0 );
86 if ( !IsDefined(
self._proximity_alarm_snd_ent ) )
88 self._proximity_alarm_snd_ent =
Spawn( local_client_num,
self.origin,
"script_origin" );
92 playsound( local_client_num,
"uin_c4_proximity_alarm_start", (0,0,0) );
93 self._proximity_alarm_snd_ent PlayLoopSound(
"uin_c4_proximity_alarm_loop", .1 );
101 playsound( local_client_num,
"uin_c4_proximity_alarm_stop", (0,0,0) );
102 if ( IsDefined(
self._proximity_alarm_snd_ent ) )
104 self._proximity_alarm_snd_ent StopAllLoopSounds( 0.5 );
110 function teamequip_changed( local_client_num, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
120 function retrievable_changed( local_client_num, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
122 self util::add_remove_list( level.retrievable, newVal );
129 if ( IsDefined(
self.owner) &&
self.owner == getlocalplayer( local_client_num ) )
135 if ( IsDefined(
self.currentdrfilter))
140 function enemyequip_changed( local_client_num, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
144 self util::add_remove_list( level.enemyequip, newVal );
151 watcher = GetLocalPlayer( local_client_num );
154 if ( !
friend && IsDefined( watcher ) && watcher HasPerk( local_client_num,
"specialty_showenemyequipment" ) )
177 self notify(
"watch_perks_changed" );
178 self endon(
"watch_perks_changed" );
179 self endon(
"death" );
180 self endon(
"disconnect" );
181 self endon(
"entityshutdown" );
183 while(IsDefined(
self))
186 util::clean_deleted(level.retrievable);
187 util::clean_deleted(level.enemyequip);
190 self waittill(
"perks_changed");
198 if ( !isdefined(
self.owner ) )
202 if ( !isdefined(
self.equipmentOldTeam ) )
204 self.equipmentOldTeam =
self.team;
207 if ( !isdefined(
self.equipmentOldOwnerTeam ) )
209 self.equipmentOldOwnerTeam =
self.owner.team;
212 watcher = GetLocalPlayer( localClientNum );
214 if ( !isdefined(
self.equipmentOldWatcherTeam ) )
216 self.equipmentOldWatcherTeam = watcher.team;
219 if (
self.equipmentOldTeam !=
self.team ||
self.equipmentOldOwnerTeam !=
self.owner.team ||
self.equipmentOldWatcherTeam != watcher.team)
221 self.equipmentOldTeam =
self.team;
222 self.equipmentOldOwnerTeam =
self.owner.team;
223 self.equipmentOldWatcherTeam = watcher.team;
225 self notify(
"team_changed" );
235 if (
IS_TRUE( level.disable_equipment_team_object ) )
240 self endon(
"entityshutdown" );
261 self endon(
"entityshutdown" );
262 level endon(
"player_switch" );
264 if ( !isdefined(
self.equipmentTagFX ) )
266 self.equipmentTagFX =
"tag_origin";
269 if ( !isdefined(
self.equipmentFriendFX ) )
271 self.equipmentTagFX = level._effect[
"powerLightGreen" ];
274 if ( !isdefined(
self.equipmentEnemyFX ) )
276 self.equipmentTagFX = level._effect[
"powerLight" ];
281 fx_handle = PlayFXOnTag( localClientNum,
self.equipmentFriendFX,
self,
self.equipmentTagFX );
285 fx_handle = PlayFXOnTag( localClientNum,
self.equipmentEnemyFX,
self,
self.equipmentTagFX );
299 if ( isdefined( fxHandle ) )
301 stopFx( localClientNum, fxHandle );
306 if ( msg !=
"entityshutdown" && isdefined(
self ) )
318 self endon(
"entityshutdown" );
319 self notify(
"team_changed_watcher" );
320 self endon(
"team_changed_watcher" );
322 watcherPlayer = GetLocalPlayer( localClientNum );
326 level waittill(
"team_changed", clientNum );
328 player = GetLocalPlayer( clientNum );
330 if ( watcherPlayer == player )
332 self notify(
"team_changed" );
341 level
util::waittill_any(
"sndDEDe",
"demo_jump",
"player_switch",
"killcam_begin",
"killcam_end" );
343 if ( isdefined(ent) )
345 ent StopAllLoopSounds( 0.5 );