1 #using scripts\codescripts\struct;
3 #using scripts\shared\callbacks_shared;
4 #using scripts\shared\clientfield_shared;
5 #using scripts\shared\util_shared;
7 #insert scripts\shared\shared.gsh;
8 #insert scripts\shared\version.gsh;
10 #precache( "client_fx", "ui/fx_dom_cap_indicator_team" );
11 #precache( "client_fx", "ui/fx_dom_cap_indicator_neutral" );
12 #precache( "client_fx", "ui/fx_dom_marker_team" );
13 #precache( "client_fx", "ui/fx_dom_marker_neutral" );
18 if( GetGametypeSetting(
"silentPlant" ) != 0 )
19 setsoundcontext(
"bomb_plant",
"silent" );
26 while ( !isdefined( level.domFlags[
"a"] ) )
28 self.domFlags[
"a"] = ServerObjective_GetObjective( localClientNum,
"dom_a" );
29 self.domFlags[
"b"] = ServerObjective_GetObjective( localClientNum,
"dom_b" );
30 self.domFlags[
"c"] = ServerObjective_GetObjective( localClientNum,
"dom_c" );
34 foreach( key, flag_objective
in self.
domFlags)
42 if ( !IsDefined( flag_objective ) )
47 flag.name = flag_name;
48 flag.objectiveId = flag_objective;
49 flag.origin = ServerObjective_GetObjectiveOrigin( localClientNum, flag_objective );
50 flag.angles = (0,0,0);
52 flag_entity = ServerObjective_GetObjectiveEntity( localClientNum, flag_objective );
54 if ( isdefined(flag_entity) )
56 flag.origin = flag_entity.origin;
57 flag.angles = flag_entity.angles;
62 flag.last_progress = 0;
66 team = ServerObjective_GetObjectiveTeam( localClientNum, flag_objective );
67 if ( team != flag.last_team )
72 progress = (ServerObjective_GetObjectiveProgress( localClientNum, flag_objective ) > 0);
73 if ( progress != flag.last_progress )
84 if ( isdefined( flag.base_fx ) )
86 StopFx( localClientNum, flag.base_fx );
89 up = anglesToUp(flag.angles);
90 forward = anglesToForward(flag.angles);
91 flag.base_fx =
PlayFx(localClientNum, fx_name, flag.origin, up, forward );
92 SetFxTeam( localClientNum, flag.base_fx, team );
94 flag.last_team = team;
101 if ( team ==
"neutral" )
105 else if ( flag.last_team ==
"neutral" )
111 SetFxTeam( localClientNum, flag.base_fx, team );
112 flag.last_team = team;
118 if ( isdefined( flag.cap_fx ) )
120 KillFx( localClientNum, flag.cap_fx );
123 up = anglesToUp(flag.angles);
124 forward = anglesToForward(flag.angles);
125 flag.cap_fx =
PlayFx(localClientNum, fx_name, flag.origin, up, forward );
126 SetFxTeam( localClientNum, flag.cap_fx, team );
133 if ( isdefined( flag.cap_fx ) )
135 KillFx( localClientNum, flag.cap_fx );
137 flag.last_progress = progress;
145 flag.last_progress = progress;
150 if ( isdefined( level.domFlagBaseFxOverride ) )
152 fx = [[level.domFlagBaseFxOverride]]( flag, team );
153 if ( isdefined( fx ) )
157 if ( team ==
"neutral" )
159 return "ui/fx_dom_marker_neutral";
163 return "ui/fx_dom_marker_team";
169 if ( isdefined( level.domFlagCapFxOverride ) )
171 fx = [[level.domFlagCapFxOverride]]( flag, team );
172 if ( isdefined( fx ) )
176 if ( team ==
"neutral" )
178 return "ui/fx_dom_cap_indicator_neutral";
182 return "ui/fx_dom_cap_indicator_team";