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

◆ ActionCondition()

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

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

23 {
24 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
25 return false;
26
27 CarScript car = CarScript.Cast(target.GetObject());
28 if (!car)
29 {
30 return false;
31 }
32
33 if (GetGame().IsMultiplayer() && GetGame().IsServer())
34 {
35 return true;
36 }
37
38 if (m_LastValidType != target.Type() || m_LastValidComponentIndex != target.GetComponentIndex() || m_CurrentDamageZone == "")
39 {
40 string damageZone = "";
41 array<string> selections = new array<string>();
42 car.GetActionComponentNameList(target.GetComponentIndex(), selections);
43
44 foreach (string selection : selections)
45 {
46 //NOTE: relevant fire geometry and view geometry selection names MUST match in order to get a valid damage zone
47 if (car && DamageSystem.GetDamageZoneFromComponentName(car, selection, damageZone))
48 {
49 if (damageZone == "Engine")
50 continue;
51
52 int zoneHP = car.GetHealthLevel(damageZone);
53 if (zoneHP > GameConstants.STATE_WORN && zoneHP < GameConstants.STATE_RUINED)
54 {
55 m_CurrentDamageZone = damageZone;
56 m_LastValidComponentIndex = target.GetComponentIndex();
57
58 //Determine if using a "Special" item for repairing
59 WoodenPlank plank = WoodenPlank.Cast(item);
60 Fabric tarp = Fabric.Cast(item);
61
62 //Prevent planks and tarp from repairing non related areas
63 if ((tarp || plank) && (damageZone != "BackWood" && damageZone != "BackTarp"))
64 return false;
65
66 return true;
67 }
68 }
69 }
70 }
71
72 return false;
73 }
void CarScript()
Определения CarScript.c:280
eBrokenLegs
Определения EBrokenLegs.c:2
int m_LastValidComponentIndex
Определения ActionRepairCarChassis.c:7
proto native CGame GetGame()

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