DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс ActionRepairCarChassis
+ Граф наследования:ActionRepairCarChassis:

Защищенные члены

void ActionRepairCarChassis ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void AdjustItemQuantityServer (ActionData action_data)
 

Защищенные данные

 m_LastValidType
 
int m_LastValidComponentIndex
 

Дополнительные унаследованные члены

- Закрытые члены унаследованные от ActionRepairVehiclePartBase
override void CreateConditionComponents ()
 
override void OnFinishProgressServer (ActionData action_data)
 
void AdjustVehicleHealthServer (ActionData action_data)
 
void AdjustItemQuantityServer (ActionData action_data)
 
override ActionData CreateActionData ()
 
override void WriteToContext (ParamsWriteContext ctx, ActionData action_data)
 
override bool ReadFromContext (ParamsReadContext ctx, out ActionReciveData action_recive_data)
 
override void HandleReciveData (ActionReciveData action_recive_data, ActionData action_data)
 
- Закрытые данные унаследованные от ActionRepairVehiclePartBase
string m_CurrentDamageZone
 

Подробное описание

Конструктор(ы)

◆ ActionRepairCarChassis()

void ActionRepairCarChassis ( )
inlineprotected
10 {
13 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
14 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
15 m_FullBody = true;
16 m_LockTargetOnUse = false;
17 m_Text = "#repair";
18
20 }
int m_StanceMask
Definition ActionBase.c:33
bool m_FullBody
Definition ActionBase.c:61
string m_Text
Definition ActionBase.c:58
bool m_LockTargetOnUse
Definition ActionBase.c:60
float m_SpecialtyWeight
Definition ActionBase.c:77
Definition ActionRepairCarChassis.c:2
int m_LastValidComponentIndex
Definition ActionRepairCarChassis.c:7
int m_CommandUID
Definition AnimatedActionBase.c:143
m_CallbackClass
Definition AnimatedActionBase.c:145
Definition EntityAI.c:95
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602

Перекрестные ссылки AnimatedActionBase::m_CallbackClass, AnimatedActionBase::m_CommandUID, ActionBase::m_FullBody, m_LastValidComponentIndex, ActionBase::m_LockTargetOnUse, ActionBase::m_SpecialtyWeight, m_StanceMask и ActionBase::m_Text.

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprotected
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 = "";
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);
54 {
56 m_LastValidComponentIndex = target.GetComponentIndex();
57
58 //Determine if using a "Special" item for repairing
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 }
eBrokenLegs
Definition EBrokenLegs.c:2
m_LastValidType
Definition ActionRepairCarChassis.c:6
string m_CurrentDamageZone
Definition ActionRepairVehiclePartBase.c:21
Definition CivilianSedan.c:2
Definition crafting.c:107
Definition constants.c:638
proto native CGame GetGame()
const int STATE_RUINED
Definition constants.c:807
const int STATE_WORN
Definition constants.c:810

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

◆ AdjustItemQuantityServer()

override void AdjustItemQuantityServer ( ActionData action_data)
inlineprotected
76 {
77 if (action_data.m_MainItem.HasQuantity())
78 {
79 if (action_data.m_MainItem.GetQuantity() > 1)
80 {
81 int qnt = action_data.m_MainItem.GetQuantity();
82 Fabric usedTarp = Fabric.Cast(action_data.m_MainItem);
84 if (usedTarp || usedPlank)
85 {
86 qnt -= 1;
87 }
88 else
89 {
90 qnt -= action_data.m_MainItem.GetQuantityMax() * 0.25;
91 }
92
93 action_data.m_MainItem.SetQuantity(qnt);
94 }
95 else
96 {
97 action_data.m_MainItem.Delete();
98 }
99 }
100 }

Поля

◆ m_LastValidComponentIndex

int m_LastValidComponentIndex
protected

Используется в ActionCondition() и ActionRepairCarChassis().

◆ m_LastValidType

m_LastValidType
protected

Используется в ActionCondition().


Объявления и описания членов класса находятся в файле: