1 #using scripts\codescripts\struct;
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\visionset_mgr_shared;
8 #using scripts\shared\ai\systems\gib;
10 #using scripts\shared\weapons\_weaponobjects;
12 #insert scripts\shared\shared.gsh;
13 #insert scripts\shared\version.gsh;
15 #insert scripts\shared\ai\systems\gib.gsh;
16 #insert scripts\shared\weapons\_hive_gun.gsh;
20 #precache( "client_fx", "weapon/fx_hero_firefly_hunting" );
21 #precache( "client_fx", "weapon/fx_hero_firefly_death" );
22 #precache( "client_fx", "weapon/fx_hero_firefly_attack" );
23 #precache( "client_fx", "weapon/fx_ability_firefly_attack_1p" );
24 #precache( "client_fx", "weapon/fx_ability_firefly_chase_1p" );
25 #precache( "client_fx", "weapon/fx_hero_firefly_attack_limb" );
26 #precache( "client_fx", "weapon/fx_hero_firefly_attack_limb_reaper" );
28 #precache( "client_fx", "weapon/fx_hero_firefly_start_entity" );
33 level thread
register();
46 if ( team ==
"allies" )
48 else if ( team ==
"axis" )
54 function fireflies_attacking( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
56 self endon(
"entityshutdown");
59 if ( !isdefined(
self) )
64 self notify (
"stop_player_fx" );
66 if (
self IsLocalPlayer() && !(
self GetInKillcam( localClientNum )) )
68 fx = PlayFXOnCamera( localClientNum,
"weapon/fx_ability_firefly_attack_1p", (0,0,0), (1,0,0), (0,0,1) );
74 self notify (
"stop_player_fx" );
78 function fireflies_chasing( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
80 self endon(
"entityshutdown");
83 if ( !isdefined(
self) )
88 self notify (
"stop_player_fx" );
90 if (
self IsLocalPlayer() && !(
self GetInKillcam( localClientNum )) )
92 fx = PlayFXOnCamera( localClientNum,
"weapon/fx_ability_firefly_chase_1p", (0,0,0), (1,0,0), (0,0,1) );
93 sound =
self PlayLoopSound(
"wpn_gelgun_hive_hunt_lp" );
94 self PlayRumbleLoopOnEntity( localClientNum,
"firefly_chase_rumble_loop" );
100 self notify (
"stop_player_fx" );
108 if( isDefined(
self ) )
110 self StopRumble( localClientNum,
"firefly_chase_rumble_loop" );
113 if ( IsDefined( fx ) )
115 StopFx( localClientNum, fx );
118 if ( isdefined( sound ) && isDefined(
self ) )
120 self StopLoopSound( sound );
126 self endon(
"entityshutdown");
130 if ( !isdefined(
self) )
133 if ( !isdefined(
self.initied ) )
170 if ( isdefined(ent) && isdefined(ent.origin) &&
self === ent && !
IS_TRUE(
self.no_death_fx ) )
172 fx = PlayFX( localClientNum,
"weapon/fx_hero_firefly_death", ent.origin, (0,0,1) );
173 SetFXTeam( localClientNum, fx, ent.team );
184 fx = PlayFX( localClientNum,
"weapon/fx_hero_firefly_start",
self.origin, AnglesToUp(
self.angles) );
185 SetFXTeam( localClientNum, fx,
self.team );
190 fx = PlayFXOnTag( localClientNum,
"weapon/fx_hero_firefly_hunting",
self,
"tag_origin");
191 SetFXTeam( localClientNum, fx,
self.team );
199 if ( isdefined( fx ) )
201 StopFx( localClientNum, fx );
207 self notify (
"stop_effects" );
208 self.no_death_fx =
true;
213 fx = PlayFX( localClientNum,
"weapon/fx_hero_firefly_start_entity",
self.origin, AnglesToUp(
self.angles) );
214 SetFXTeam( localClientNum, fx,
self.team );
216 self notify (
"stop_effects" );
217 self.no_death_fx =
true;
220 function gib_fx( localClientNum, fxFileName, gibFlag )
223 if ( isdefined( fxTag ) )
225 fx = PlayFxOnTag( localClientNum, fxFileName,
self, fxTag );
232 self endon(
"entityshutdown");
239 self endon(
"entityshutdown");
244 fxFileName =
"weapon/fx_hero_firefly_attack_limb";
245 bodyType =
self GetCharacterBodyType();
248 bodyTypeFields = GetCharacterFields( bodyType, CurrentSessionMode() );
249 if(
VAL( bodyTypeFields.digitalBlood,
false ) )
251 fxFileName =
"weapon/fx_hero_firefly_attack_limb_reaper";
260 notetrack =
self util::waittill_any_return(
"gib_leftarm",
"gib_leftleg",
"gib_rightarm",
"gib_rightleg",
"entityshutdown" );
266 arm_gib = arm_gib | 1;
269 self SetCorpseGibState( leg_gib, arm_gib );
274 arm_gib = arm_gib | 2;
277 self SetCorpseGibState( leg_gib, arm_gib );
282 leg_gib = leg_gib | 1;
285 self SetCorpseGibState( leg_gib, arm_gib );
290 leg_gib = leg_gib | 2;
293 self SetCorpseGibState( leg_gib, arm_gib );