‪Black Ops 3 Source Code Explorer  0.1
‪An script explorer for Black Ops 3 by ZeRoY
_zm_weap_octobomb.csc
Go to the documentation of this file.
1 #using scripts\codescripts\struct;
2 #using scripts\shared\clientfield_shared;
3 #using scripts\shared\system_shared;
4 #using scripts\shared\util_shared;
5 
6 #insert scripts\shared\shared.gsh;
7 #insert scripts\shared\version.gsh;
8 #insert scripts\zm\_zm_weap_octobomb.gsh;
9 
10 #using scripts\zm\_zm_utility;
11 #using scripts\zm\_zm_weapons;
12 
13 #precache( "client_fx", "zombie/fx_octobomb_explo_death_zod_zmb" );
14 
15 #precache( "client_fx", "zombie/fx_octobomb_spore_burn_leg_zod_zmb" );
16 #precache( "client_fx", "zombie/fx_octobomb_spore_burn_torso_zod_zmb" );
17 #precache( "client_fx", "zombie/fx_octobomb_sporesplosion_zod_zmb" );
18 #precache( "client_fx", "zombie/fx_octobomb_sporesplosion_tell_zod_zmb" );
19 
20 #precache( "client_fx", "zombie/fx_octobomb_spore_burn_leg_ee_zod_zmb" );
21 #precache( "client_fx", "zombie/fx_octobomb_spore_burn_torso_ee_zod_zmb" );
22 #precache( "client_fx", "zombie/fx_octobomb_sporesplosion_ee_zod_zmb" );
23 #precache( "client_fx", "zombie/fx_octobomb_sporesplosion_tell_ee_zod_zmb" );
24 
25 #precache( "client_fx", "impacts/fx_flesh_hit_knife_lg_zmb" );
26 #precache( "client_fx", "zombie/fx_bmode_attack_grapple_zod_zmb" );
27 
28 ‪REGISTER_SYSTEM_EX( "zm_weap_octobomb", &‪__init__, &‪__main__, undefined )
29 
30 function ‪__init__()
31 {
39  ‪clientfield::register( "toplayer", "octobomb_state", ‪VERSION_SHIP, 3, "int", undefined, !‪CF_HOST_ONLY, ‪CF_CALLBACK_ZERO_ON_NEW_ENT );
40 
41  SetupClientFieldCodeCallbacks( "toplayer", 1, "octobomb_state" );
42 }
43 
44 function ‪__main__()
45 {
47  {
48  return;
49  }
50 
51  level._effect[ "octobomb_explode_fx" ] = "zombie/fx_octobomb_explo_death_zod_zmb";
52 
53  level._effect[ "octobomb_spores" ] = "zombie/fx_octobomb_sporesplosion_zod_zmb";
54  level._effect[ "octobomb_spores_spine" ] = "zombie/fx_octobomb_spore_burn_torso_zod_zmb";
55  level._effect[ "octobomb_spores_legs" ] = "zombie/fx_octobomb_spore_burn_leg_zod_zmb";
56  level._effect[ "octobomb_sporesplosion" ] = "zombie/fx_octobomb_sporesplosion_tell_zod_zmb";
57 
58  level._effect[ "octobomb_ug_spores" ] = "zombie/fx_octobomb_sporesplosion_ee_zod_zmb";
59  level._effect[ "octobomb_ug_spores_spine" ] = "zombie/fx_octobomb_spore_burn_torso_ee_zod_zmb";
60  level._effect[ "octobomb_ug_spores_legs" ] = "zombie/fx_octobomb_spore_burn_leg_zod_zmb";
61  level._effect[ "octobomb_ug_sporesplosion" ] = "zombie/fx_octobomb_sporesplosion_tell_ee_zod_zmb";
62 
63  level._effect[ "octobomb_tentacle_hit" ] = "impacts/fx_flesh_hit_knife_lg_zmb";
64  level._effect[ "zombie_explode" ] = "zombie/fx_bmode_attack_grapple_zod_zmb";
65 }
66 
67 // self == zombie target
68 function ‪octobomb_tentacle_hit_fx( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
69 {
70  if ( newVal )
71  {
72  self.fx_octobomb_tentacle_hit = PlayFXOnTag( localClientNum, level._effect[ "octobomb_tentacle_hit" ], self, "j_spineupper" );
73  }
74  else
75  {
76  if ( isdefined( self.fx_octobomb_tentacle_hit ) )
77  {
78  StopFX( localClientNum, self.fx_octobomb_tentacle_hit );
79  self.fx_octobomb_tentacle_hit = undefined;
80  }
81  }
82 }
83 
84 // self == zombie target
85 function ‪octobomb_fx( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
86 {
87  switch ( newVal )
88  {
90  PlayFX( localClientNum, level._effect[ "octobomb_explode_fx" ], self.origin, AnglesToUp( self.angles ) );
91  break;
93  fx_octobomb = level._effect[ "octobomb_ug_spores" ];
94  PlayFXOnTag( localClientNum, fx_octobomb, self, "tag_origin" );
95  break;
96  default:
97  fx_octobomb = level._effect[ "octobomb_spores" ];
98  PlayFXOnTag( localClientNum, fx_octobomb, self, "tag_origin" );
99  break;
100  }
101 }
102 
103 
104 // self == zombie target
105 function ‪octobomb_spores_fx( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
106 {
107  if ( newVal )
108  {
109  self thread ‪octobomb_spore_fx_on( localClientNum, newVal );
110  }
111 }
112 
113 
114 // self == zombie target
115 function ‪octobomb_spore_fx_on( localClientNum, n_fx_type )
116 {
117  self endon( "entityshutdown" );
118 
119  if ( n_fx_type == ‪CF_OCTOBOMB_UG_FX )
120  {
121  //TODO Replace with upgraded FX when made
122  fx_spine = level._effect[ "octobomb_ug_spores_spine" ];
123  fx_legs = level._effect[ "octobomb_ug_spores_legs" ];
124  }
125  else
126  {
127  fx_spine = level._effect[ "octobomb_spores_spine" ];
128  fx_legs = level._effect[ "octobomb_spores_legs" ];
129  }
130 
131  self.fx_octobomb_spores_spine = PlayFXOnTag( localClientNum, fx_spine, self, "j_spine4" );
132 
133  wait ( ‪OCTOBOMB_DAMAGE_TIME / 2 );
134 
135  self.fx_octobomb_spores_leg_ri = PlayFXOnTag( localClientNum, fx_legs, self, "j_hip_ri" );
136  self.fx_octobomb_spores_leg_le = PlayFXOnTag( localClientNum, fx_legs, self, "j_hip_le" );
137 
138  wait ( ‪OCTOBOMB_DAMAGE_TIME / 2 );
139 
140  StopFX( localClientNum, self.fx_octobomb_spores_spine );
141  StopFX( localClientNum, self.fx_octobomb_spores_leg_ri );
142  StopFX( localClientNum, self.fx_octobomb_spores_leg_le );
143 }
144 
145 // self == zombie target
146 function ‪octobomb_zombie_explode_fx(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
147 {
149  {
150  PlayFXOnTag( localClientNum, level._effect["zombie_explode"], self, "j_spinelower" );
151  }
152 }
153 
154 // self == octobomb
155 function ‪octobomb_spit_fx( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
156 {
157  if ( newVal == ‪CF_OCTOBOMB_UG_FX )
158  {
159  fx_spit = level._effect[ "octobomb_ug_sporesplosion" ];
160  }
161  else
162  {
163  fx_spit = level._effect[ "octobomb_sporesplosion" ];
164  }
165  level thread ‪octobomb_spit_fx_and_cleanup( localClientNum, self.origin, self.angles, fx_spit );
166 }
167 
168 // octobomb spit fx are only ever timed the same way; cleaning them up here to prevent case where the margwa would kill octobomb before the clientfield was reset
169 function ‪octobomb_spit_fx_and_cleanup( localClientNum, v_origin, v_angles, fx_spit )
170 {
171  fx_id = PlayFX( localClientNum, fx_spit, v_origin, AnglesToUp( v_angles ) );
172  wait 3.416675; // amount of time the octobomb was previously calculating to wait before killing the effect
173  StopFx( localClientNum, fx_id );
174 }
175 
‪STR_WEAP_OCTOBOMB
‪#define STR_WEAP_OCTOBOMB
Definition: _zm_weap_octobomb.gsh:1
‪octobomb_spores_fx
‪function octobomb_spores_fx(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _zm_weap_octobomb.csc:105
‪is_gib_restricted_build
‪function is_gib_restricted_build()
Definition: util_shared.csc:1305
‪octobomb_spit_fx_and_cleanup
‪function octobomb_spit_fx_and_cleanup(localClientNum, v_origin, v_angles, fx_spit)
Definition: _zm_weap_octobomb.csc:169
‪is_mature
‪function is_mature()
Definition: util_shared.csc:1300
‪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
‪octobomb_fx
‪function octobomb_fx(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _zm_weap_octobomb.csc:85
‪is_weapon_included
‪function is_weapon_included(weapon)
Definition: _zm_weapons.csc:51
‪CF_OCTOBOMB_UG_FX
‪#define CF_OCTOBOMB_UG_FX
Definition: _zm_weap_octobomb.gsh:21
‪VERSION_TU8
‪#define VERSION_TU8
Definition: version.gsh:54
‪VERSION_TU8_OBSOLETE
‪#define VERSION_TU8_OBSOLETE
Definition: version.gsh:127
‪REGISTER_SYSTEM_EX
‪#define REGISTER_SYSTEM_EX(__sys, __func_init_preload, __func_init_postload, __reqs)
Definition: shared.gsh:209
‪__main__
‪function __main__()
Definition: _zm_weap_octobomb.csc:44
‪CF_HOST_ONLY
‪#define CF_HOST_ONLY
Definition: version.gsh:102
‪CF_OCTOBOMB_EXPLODE_FX
‪#define CF_OCTOBOMB_EXPLODE_FX
Definition: _zm_weap_octobomb.gsh:22
‪__init__
‪function __init__()
Definition: _zm_weap_octobomb.csc:30
‪OCTOBOMB_DAMAGE_TIME
‪#define OCTOBOMB_DAMAGE_TIME
Definition: _zm_weap_octobomb.gsh:7
‪octobomb_spit_fx
‪function octobomb_spit_fx(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _zm_weap_octobomb.csc:155
‪octobomb_zombie_explode_fx
‪function octobomb_zombie_explode_fx(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _zm_weap_octobomb.csc:146
‪register
‪function register()
Definition: _ai_tank.gsc:126
‪octobomb_tentacle_hit_fx
‪function octobomb_tentacle_hit_fx(localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump)
Definition: _zm_weap_octobomb.csc:68
‪octobomb_spore_fx_on
‪function octobomb_spore_fx_on(localClientNum, n_fx_type)
Definition: _zm_weap_octobomb.csc:115