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

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )

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

21 {
22 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
23 return false;
24
25 CarScript car = CarScript.Cast(target.GetObject());
26 if (!car || car.EngineIsOn())
27 return false;
28
29 if (GetGame().IsDedicatedServer())
30 return true;
31
32 if (m_LastValidType != target.Type() || m_LastValidComponentIndex != target.GetComponentIndex() || m_CurrentDamageZone == "")
33 {
34 string damageZone = "";
35 array<string> selections = new array<string>();
36 car.GetActionComponentNameList(target.GetComponentIndex(), selections, LOD.NAME_VIEW);
37
38 foreach (string selection : selections)
39 {
40 if (car && DamageSystem.GetDamageZoneFromComponentName(car, selection, damageZone))
41 {
42 if (damageZone == "Engine")
43 {
44 int zoneHP = car.GetHealthLevel(damageZone);
45 if (zoneHP > GameConstants.STATE_WORN && zoneHP < GameConstants.STATE_RUINED)
46 {
47 m_CurrentDamageZone = damageZone;
48 m_LastValidComponentIndex = target.GetComponentIndex();
49
50 return true;
51 }
52 }
53 }
54 }
55 }
56
57 return false;
58 }
int m_LastValidComponentIndex
Определения ActionRepairCarEngine.c:7
ActionRepairCarEngineCB m_LastValidType
eBrokenLegs
Определения EBrokenLegs.c:2
Определения CivilianSedan.c:2
Определения constants.c:659
static const string NAME_VIEW
Определения gameplay.c:207
LOD class.
Определения gameplay.c:204
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
const int STATE_RUINED
Определения constants.c:846
const int STATE_WORN
Определения constants.c:849

Перекрестные ссылки ActionTarget, GetGame(), m_LastValidComponentIndex, m_LastValidType, LOD::NAME_VIEW, GameConstants::STATE_RUINED и GameConstants::STATE_WORN.