‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
_gadget_infrared.csc
Go to the documentation of this file.
1 #using scripts\codescripts\struct;
2 #using scripts\shared\callbacks_shared;
3 #using scripts\shared\clientfield_shared;
4 #using scripts\shared\duplicaterender_mgr;
5 #using scripts\shared\filter_shared;
6 #using scripts\shared\visionset_mgr_shared;
7 #using scripts\shared\util_shared;
8 
9 #using scripts\shared\abilities\_ability_player;
10 #using scripts\shared\abilities\_ability_power;
11 #using scripts\shared\abilities\_ability_util;
12 
13 #insert scripts\shared\duplicaterender.gsh;
14 #insert scripts\shared\shared.gsh;
15 #insert scripts\shared\version.gsh;
16 #insert scripts\shared\abilities\_ability_util.gsh;
17 
18 #using scripts\shared\system_shared;
19 
20 
21 ‪REGISTER_SYSTEM( "gadget_infrared", &‪__init__, undefined )
22 
23 function ‪__init__()
24 {
26 
28 
29  level.thermalActive = 0;
30 }
31 
32 
33 function ‪infrared_changed( localclientnum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
34 {
35  level.thermalActive = newVal;
36 
37  GadgetSetInfrared( localclientnum, newVal );
38 
39  players = GetPlayers( localclientnum );
40  foreach( player in players )
41  {
42  if( self ‪util::IsEnemyPlayer( player ) )
43  {
44  player ‪duplicate_render::set_entity_thermal( localclientnum, newVal );
45  }
46  }
47 }
48 
49 function ‪on_player_spawned( localClientNum )
50 {
51  localPlayer = GetLocalPlayer( localClientNum );
52  if( localPlayer != self )
53  {
54  if( localPlayer ‪util::IsEnemyPlayer( self ) )
55  {
56  self ‪duplicate_render::set_entity_thermal( localClientNum, level.thermalActive );
57  }
58 
59  return;
60  }
61 }
62 
63 
‪CF_CALLBACK_ZERO_ON_NEW_ENT
‪#define CF_CALLBACK_ZERO_ON_NEW_ENT
Definition: version.gsh:103
‪VERSION_SHIP
‪#define VERSION_SHIP
Definition: version.gsh:36
‪__init__
‪function __init__()
Definition: _gadget_infrared.csc:23
‪IsEnemyPlayer
‪function IsEnemyPlayer(player)
Definition: util_shared.csc:1220
‪infrared_changed
‪function infrared_changed(localclientnum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _gadget_infrared.csc:33
‪on_spawned
‪function on_spawned(func, obj)
Definition: callbacks_shared.csc:245
‪CF_HOST_ONLY
‪#define CF_HOST_ONLY
Definition: version.gsh:102
‪on_player_spawned
‪function on_player_spawned(localClientNum)
Definition: _gadget_infrared.csc:49
‪REGISTER_SYSTEM
‪#define REGISTER_SYSTEM(__sys, __func_init_preload, __reqs)
Definition: shared.gsh:204
‪set_entity_thermal
‪function set_entity_thermal(localClientNum, on_off)
Definition: duplicaterender_mgr.csc:464
‪register
‪function register()
Definition: _ai_tank.gsc:126