1 #using scripts\zm\_load;
2 #using scripts\zm\_util;
3 #using scripts\shared\clientfield_shared;
4 #using scripts\shared\system_shared;
5 #using scripts\shared\visionset_mgr_shared;
7 #insert scripts\shared\version.gsh;
8 #insert scripts\shared\shared.gsh;
10 #insert scripts\zm\_zm_laststand.gsh;
12 #namespace zm_laststand;
18 level.laststands = [];
19 for( i = 0; i < 4; i++ )
21 level.laststands[i] = SpawnStruct();
22 level.laststands[i].bleedoutTime = 0;
23 level.laststands[i].laststand_update_clientfields =
"laststand_update" + i;
24 level.laststands[i].lastBleedoutTime = 0;
40 level waittill(
"notetrack", localClientNum, note );
41 if( note ==
"revive_shader_constant" )
44 player = GetLocalPlayer( localClientNum );
46 player MapShaderConstant( localClientNum, 0,
"scriptVector2", 0, 1, 0, GetServerTime( localClientNum ) / 1000.0 );
53 self endon(
"new_val" );
55 timeSinceLastUpdate = 0;
57 if( oldValue == newValue )
59 newValue = oldValue - 1;
62 while( timeSinceLastUpdate <= 1.0 )
64 timeSinceLastUpdate = ( ( GetRealTime() -
startTime ) / 1000.0 );
65 lerpValue = ( LerpFloat( oldValue, newValue, timeSinceLastUpdate ) / 30.0 );
66 SetUIModelValue( model, lerpValue );
73 substr = GetSubStr( fieldName, 16 ) ;
74 playerNum = Int( substr );
76 level.laststands[ playerNum ].lastBleedoutTime = level.laststands[ playerNum ].bleedoutTime;
77 level.laststands[ playerNum ].bleedoutTime = newVal - 1;
79 if( level.laststands[ playerNum ].lastBleedoutTime < level.laststands[ playerNum ].bleedoutTime )
81 level.laststands[ playerNum ].lastBleedoutTime = level.laststands[ playerNum ].bleedoutTime;
84 model = GetUIModel(GetUIModelForController(localClientNum),
"WorldSpaceIndicators.bleedOutModel" + playerNum +
".bleedOutPercent" );
85 if( isdefined( model ) )
89 level.laststands[ playerNum ].bleedoutTime = 0;
90 level.laststands[ playerNum ].lastBleedoutTime = 0;
91 SetUIModelValue( model, 1.0 );
93 else if( newVal == 29 )
95 level.laststands[ playerNum ] notify(
"new_val" );
100 level.laststands[ playerNum ] notify(
"new_val" );
101 level.laststands[ playerNum ] thread
animation_update( model, level.laststands[ playerNum ].lastBleedoutTime, level.laststands[ playerNum ].bleedoutTime );