29 protected static const int LIFESPAN_MAX = 240;
88 string config_name =
"CfgVehicles";
89 int config_count =
GetGame().ConfigGetChildrenCount( config_name );
94 for ( i = 0; i < config_count; i++ )
96 string survivor_name =
"";
97 GetGame().ConfigGetChildName( config_name, i, survivor_name );
99 if ( survivor_name !=
"" && survivor_name !=
"access" )
101 if (
GetGame().IsKindOf(survivor_name,
"SurvivorMale_Base") ||
GetGame().IsKindOf(survivor_name,
"SurvivorFemale_Base") )
103 string survivor_path = config_name +
" " + survivor_name;
104 int survivor_lifespan_count =
GetGame().ConfigGetChildrenCount( survivor_path );
107 for ( j = 0; j < survivor_lifespan_count; j++ )
109 string survivor_lifespan_name =
"";
110 GetGame().ConfigGetChildName( survivor_path, j, survivor_lifespan_name );
112 string survivor_lifespan_path = survivor_path +
" " + survivor_lifespan_name;
114 if ( survivor_lifespan_name ==
"Lifespan" )
116 int survivor_lifespan_beard_count =
GetGame().ConfigGetChildrenCount( survivor_lifespan_path );
118 for ( k = 0; k < survivor_lifespan_beard_count; k++ )
120 string survivor_lifespan_beard_name =
"";
121 GetGame().ConfigGetChildName( survivor_lifespan_path, k, survivor_lifespan_beard_name );
123 string survivor_lifespan_beard_path = survivor_lifespan_path +
" " + survivor_lifespan_beard_name;
125 if ( survivor_lifespan_beard_name ==
"Beard" )
128 int cfg_class_member_member_variable_count =
GetGame().ConfigGetChildrenCount( survivor_lifespan_beard_path );
130 for ( l = 0; l < cfg_class_member_member_variable_count; l++ )
132 string survivor_lifespan_beard_material_name =
"";
133 GetGame().ConfigGetChildName( survivor_lifespan_beard_path, l, survivor_lifespan_beard_material_name );
134 string survivor_lifespan_beard_material_path = survivor_lifespan_beard_path +
" " + survivor_lifespan_beard_material_name;
136 if ( survivor_lifespan_beard_material_name ==
"mat" )
138 GetGame().ConfigGetTextArray( survivor_lifespan_beard_material_path, materials );
142 int level_count = materials.Count() / 2;
143 for ( m = 0; m < level_count; m++ )
147 if ( mat < materials.Count() )
150 lifespan_levels.Insert(
new LifespanLevel(m, threshold, materials.Get(tex), materials.Get(mat)) );
155 if ( lifespan_levels.Count() > 0 )
164 else if ( survivor_lifespan_name ==
"BloodyHands" )
166 string bloody_material, normal_material;
167 string path_normal = survivor_lifespan_path +
" mat_normal";
168 string path_bloody = survivor_lifespan_path +
" mat_blood";
169 GetGame().ConfigGetText(path_normal, normal_material);
170 GetGame().ConfigGetText(path_bloody, bloody_material);
209 if ( !
GetGame().IsMultiplayer() )
229 float playerBeard = playerPlaytime - player.GetLastShavedSeconds();
230 playerBeard = playerBeard / 60.0;
238 if ( !player.IsAlive() )
245 if ( player_beard > current_level.GetThreshold() || force_update )
249 if ( next_level != NULL )
275 if ( lifespan_levels != NULL )
277 for (
int i = lifespan_levels.Count() - 1; i >= 0; i-- )
281 if ( age >= level.GetThreshold() )
293 if (player.m_CorpseState != 0)
296 EntityAI players_head = player.GetInventory().FindPlaceholderForSlot( slot_id );
300 switch (level.GetLevel())
302 case LifeSpanState.BEARD_NONE:
304 players_head.SetObjectTexture( 0,
"");
305 players_head.SetObjectMaterial( 0,
"");
307 player.SetFaceTexture( level.GetTextureName() );
308 player.SetFaceMaterial( level.GetMaterialName() );
310 player.SetLifeSpanStateVisible(LifeSpanState.BEARD_NONE);
314 case LifeSpanState.BEARD_MEDIUM:
316 players_head.SetObjectTexture( 0,
"");
317 players_head.SetObjectMaterial( 0,
"");
319 player.SetFaceTexture( level.GetTextureName() );
320 player.SetFaceMaterial( level.GetMaterialName() );
322 player.SetLifeSpanStateVisible(LifeSpanState.BEARD_MEDIUM);
327 case LifeSpanState.BEARD_LARGE:
329 players_head.SetObjectTexture( 0,
"");
330 players_head.SetObjectMaterial( 0,
"");
332 player.SetFaceTexture( level.GetTextureName() );
333 player.SetFaceMaterial( level.GetMaterialName() );
335 player.SetLifeSpanStateVisible(LifeSpanState.BEARD_LARGE);
340 case LifeSpanState.BEARD_EXTRA:
342 players_head.SetObjectTexture( 0, level.GetTextureName() );
343 players_head.SetObjectMaterial( 0, level.GetMaterialName() );
346 LifespanLevel prev_level = lifespan_levels.Get(LifeSpanState.BEARD_LARGE);
348 player.SetFaceTexture( prev_level.GetTextureName() );
349 player.SetFaceMaterial( prev_level.GetMaterialName() );
351 player.SetLifeSpanStateVisible(LifeSpanState.BEARD_EXTRA);
358 Print(
"Lifespan state missing");
371 case LifeSpanState.BEARD_NONE:
377 case LifeSpanState.BEARD_MEDIUM:
380 player_beard = LIFESPAN_MAX/3;
384 case LifeSpanState.BEARD_LARGE:
387 player_beard = LIFESPAN_MAX/1.5;
391 case LifeSpanState.BEARD_EXTRA:
394 player_beard = LIFESPAN_MAX;
400 Print(
"Lifespan state missing");
436 player.SetBloodyHandsEx( type );
451 player.SetBloodyHands( show );
465 string player_class = player.GetPlayerClass();
472 eai = player.GetInventory().FindPlaceholderForSlot( slot_id );
476 eai.SetObjectMaterial( 0,
m_BloodyHands.Get(player_class).GetMaterial(material_type) );
487 return !player.FindAttachmentBySlotName(
"Gloves" ) );
496 player.SetBloodTypeVisible( show );
500 player.m_Hud.UpdateBloodName();
506 player.SetBloodType( blood_type );
528 return current_level.GetTextureName();
538 return current_level.GetMaterialName();