‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
_bouncingbetty.csc
Go to the documentation of this file.
1 #using scripts\codescripts\struct;
2 
3 #using scripts\shared\callbacks_shared;
4 #using scripts\shared\clientfield_shared;
5 #using scripts\shared\system_shared;
6 #using scripts\shared\util_shared;
7 #using scripts\shared\weapons\_weaponobjects;
8 
9 #insert scripts\shared\shared.gsh;
10 #insert scripts\shared\version.gsh;
11 
12 #precache( "client_fx", "weapon/fx_betty_exp" );
13 #precache( "client_fx", "weapon/fx_betty_exp_death" );
14 #precache( "client_fx", "weapon/fx_betty_launch_dust" );
15 
16 #using_animtree ( "bouncing_betty" );
17 
18 #namespace bouncingbetty;
19 
20 function ‪init_shared( localClientNum )
21 {
22  level.explode_1st_offset = 55;
23  level.explode_2nd_offset = 95;
24  level.explode_main_offset = 140;
25 
26  level._effect["fx_betty_friendly_light"] = "weapon/fx_betty_light_blue";
27  level._effect["fx_betty_enemy_light"] = "weapon/fx_betty_light_orng";
28  level._effect["fx_betty_exp"] = "weapon/fx_betty_exp";
29  level._effect["fx_betty_exp_death"] = "weapon/fx_betty_exp_death";
30  level._effect["fx_betty_launch_dust"] = "weapon/fx_betty_launch_dust";
31 
34 }
35 
36 function ‪bouncingbetty_state_change( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
37 {
38  self endon("entityshutdown");
39 
40  self ‪util::waittill_dobj( localClientNum );
41 
42  if ( !isdefined(self) )
43  return;
44 
45  switch( newVal )
46  {
48  {
49  self thread ‪bouncingbetty_detonating( localClientNum );
50  break;
51  }
53  {
54  self thread ‪bouncingbetty_deploying( localClientNum );
55  break;
56  }
57  }
58 }
59 
60 
61 function ‪bouncingbetty_deploying( localClientNum )
62 {
63  self endon("entityshutdown");
64 
65  self UseAnimTree( #animtree );
66  self SetAnim( %o_spider_mine_deploy, 1.0, 0.0, 1.0 );
67 }
68 
69 function ‪bouncingbetty_detonating( localClientNum )
70 {
71  self endon("entityshutdown");
72 
73  up = anglesToUp(self.angles);
74  forward = anglesToForward(self.angles);
75  playfx( localClientNum, level._effect["fx_betty_launch_dust"], self.origin, up, forward );
76  self playsound( localClientNum, "wpn_betty_jump" );
77 
78  self UseAnimTree( #animtree );
79  self SetAnim( %o_spider_mine_detonate, 1.0, 0.0, 1.0 );
80  self thread ‪watchForExplosionNotetracks( localClientNum, up, forward );
81 }
82 
83 
84 function ‪watchForExplosionNotetracks( localClientNum, up, forward )
85 {
86  self endon("entityshutdown");
87 
88  while( 1 )
89  {
90  notetrack = self ‪util::waittill_any_return( "explode_1st", "explode_2nd", "explode_main", "entityshutdown" );
91 
92  switch( noteTrack )
93  {
94  case "explode_1st":
95  {
96  playfx( localClientNum, level._effect["fx_betty_exp"], self.origin + ( up * level.explode_1st_offset ), up, forward );
97  }
98  break;
99  case "explode_2nd":
100  {
101  playfx( localClientNum, level._effect["fx_betty_exp"], self.origin + ( up * level.explode_2nd_offset ), up, forward );
102  }
103  break;
104  case "explode_main":
105  {
106  playfx( localClientNum, level._effect["fx_betty_exp"], self.origin + ( up * level.explode_main_offset ), up, forward );
107  playfx( localClientNum, level._effect["fx_betty_exp_death"], self.origin, up, forward );
108  }
109  break;
110  default:
111  break;
112  }
113  }
114 }
‪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
‪waittill_any_return
‪function waittill_any_return(string1, string2, string3, string4, string5, string6, string7)
Definition: util_shared.csc:212
‪BOUNCINGBETTY_DEPLOYING
‪#define BOUNCINGBETTY_DEPLOYING
Definition: shared.gsh:328
‪bouncingbetty_detonating
‪function bouncingbetty_detonating(localClientNum)
Definition: _bouncingbetty.csc:69
‪watchForExplosionNotetracks
‪function watchForExplosionNotetracks(localClientNum, up, forward)
Definition: _bouncingbetty.csc:84
‪bouncingbetty_deploying
‪function bouncingbetty_deploying(localClientNum)
Definition: _bouncingbetty.csc:61
‪CF_HOST_ONLY
‪#define CF_HOST_ONLY
Definition: version.gsh:102
‪waittill_dobj
‪function waittill_dobj(localClientNum)
Definition: util_shared.csc:1117
‪init_shared
‪function init_shared(localClientNum)
Definition: _bouncingbetty.csc:20
‪BOUNCINGBETTY_DETONATING
‪#define BOUNCINGBETTY_DETONATING
Definition: shared.gsh:327
‪register
‪function register()
Definition: _ai_tank.gsc:126
‪bouncingbetty_state_change
‪function bouncingbetty_state_change(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _bouncingbetty.csc:36