DayZ 1.28
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnTick()

override void HealthRegenMdfr::OnTick ( PlayerBase player,
float deltaT )
inlineprivate

См. определение в файле HealthRegen.c строка 31

32 {
33 if (player.IsAlive())//this needs to be here, some of the other modifiers can kill the character during the same modifier tick, and not checking here can partially revive him(resulting in a broken char)
34 {
35
36 float regen_speed = player.GetHealthRegenSpeed() * deltaT;;
37 player.AddHealth("GlobalHealth", "Health" , regen_speed );
38
39 player.AddHealth("RightArm","Health",regen_speed * PlayerConstants.DAMAGE_ZONE_BLOOD_REGEN_MODIFIER );
40 player.AddHealth("RightHand","Health",regen_speed * PlayerConstants.DAMAGE_ZONE_BLOOD_REGEN_MODIFIER);
41 player.AddHealth("LeftArm","Health",regen_speed * PlayerConstants.DAMAGE_ZONE_BLOOD_REGEN_MODIFIER);
42 player.AddHealth("LeftHand","Health",regen_speed * PlayerConstants.DAMAGE_ZONE_BLOOD_REGEN_MODIFIER);
43
44 //Leg regen when legs are NOT BROKEN
45 if ( player.GetBrokenLegs() == eBrokenLegs.NO_BROKEN_LEGS )
46 {
47 player.AddHealth("RightLeg","Health", PlayerConstants.LEG_HEALTH_REGEN);
48 player.AddHealth("RightFoot","Health", PlayerConstants.LEG_HEALTH_REGEN);
49 player.AddHealth("LeftLeg","Health", PlayerConstants.LEG_HEALTH_REGEN);
50 player.AddHealth("LeftFoot","Health", PlayerConstants.LEG_HEALTH_REGEN);
51 }
52 else
53 {
54 //Leg regen when legs are BROKEN or SPLINTED
55 player.AddHealth("RightLeg","Health", PlayerConstants.LEG_HEALTH_REGEN_BROKEN);
56 player.AddHealth("RightFoot","Health",PlayerConstants.LEG_HEALTH_REGEN_BROKEN);
57 player.AddHealth("LeftLeg","Health", PlayerConstants.LEG_HEALTH_REGEN_BROKEN);
58 player.AddHealth("LeftFoot","Health", PlayerConstants.LEG_HEALTH_REGEN_BROKEN);
59 }
60
61 player.AddHealth("Torso","Health",regen_speed * PlayerConstants.DAMAGE_ZONE_BLOOD_REGEN_MODIFIER);
62
63 // We increase head health regeneration as it is unclear to players what health level individual zones have
64 player.AddHealth("Head","Health",( regen_speed * PlayerConstants.DAMAGE_ZONE_BLOOD_REGEN_MODIFIER ) * 2 );
65 }
66 }
eBrokenLegs
Определения EBrokenLegs.c:2

Перекрестные ссылки PlayerConstants::DAMAGE_ZONE_BLOOD_REGEN_MODIFIER, PlayerConstants::LEG_HEALTH_REGEN и PlayerConstants::LEG_HEALTH_REGEN_BROKEN.