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

Закрытые члены

void ActionRepairCarPart ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnFinishProgressServer (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)
 
- Закрытые члены унаследованные от ActionContinuousBase
void OnStartAnimationLoopServer (ActionData action_data)
 
void OnStartAnimationLoopClient (ActionData action_data)
 
void OnEndAnimationLoopServer (ActionData action_data)
 
void OnEndAnimationLoopClient (ActionData action_data)
 
void OnFinishProgressServer (ActionData action_data)
 
void OnFinishProgressClient (ActionData action_data)
 

Закрытые данные

 m_LastValidType
 
string m_CurrentDamageZone = ""
 
int m_LastValidComponentIndex = -1
 

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

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

◆ ActionRepairCarPart()

void ActionRepairCarPart ( )
inlineprivate
22 {
23 m_CallbackClass = ActionRepairCarPartCB;
25
26 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
27 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT;
28 m_FullBody = true;
29 m_LockTargetOnUse = false;
30 m_Text = "#repair";
31 }
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
int m_StanceMask
Definition ActionBase.c:62
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, ActionBase::m_LockTargetOnUse, ActionBase::m_SpecialtyWeight, ActionBase::m_StanceMask и ActionBase::m_Text.

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
40 {
41 if (player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
42 return false;
43
44 Object targetObject = target.GetObject();
45 Object targetParent = target.GetParent();
47
48 if (!carDoor || !player)
49 return false;
50
51 if (GetGame().IsMultiplayer() && GetGame().IsServer())
52 return true;
53
54 if (carDoor)
55 {
56 //Check if item is attached to car -> If so, block repair if door is closed
57 if (targetParent != null)
58 {
60 bool isPresent = carDoor.GetInventory().GetCurrentInventoryLocation(loc);
61
62 if (!isPresent || loc.GetSlot() == -1)
63 return false;
64
65 string slotName = InventorySlots.GetSlotName(loc.GetSlot());
67 return false;
68 }
69
70 //Check health level of door
71 int zoneHP = carDoor.GetHealthLevel("");
73 }
74
75 return false;
76 }
CarDoorState
Definition CarScript.c:2
PlayerSpawnPreset slotName
eBrokenLegs
Definition EBrokenLegs.c:2
Definition InventoryItem.c:496
Definition CivilianSedan.c:2
override int GetCarDoorsState(string slotType)
Definition CivilianSedan.c:165
Definition constants.c:638
InventoryLocation.
Definition InventoryLocation.c:29
provides access to slot configuration
Definition InventorySlots.c:6
static proto native owned string GetSlotName(int id)
converts slot_id to string
Definition ObjectTyped.c:2
proto native CGame GetGame()
const int STATE_RUINED
Definition constants.c:807
const int STATE_WORN
Definition constants.c:810

Перекрестные ссылки CarScript::GetCarDoorsState(), GetGame(), InventorySlots::GetSlotName(), slotName, GameConstants::STATE_RUINED и GameConstants::STATE_WORN.

◆ CreateActionData()

override ActionData CreateActionData ( )
inlineprivate

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
34 {
37 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:64
ref CCTBase m_ConditionTarget
Definition ActionBase.c:65
Definition CCINonRuined.c:2
Definition CCTCursor.c:2
Definition ActionConstants.c:106
const float REPAIR
Definition ActionConstants.c:109

Перекрестные ссылки ActionBase::m_ConditionItem, ActionBase::m_ConditionTarget и UAMaxDistances::REPAIR.

◆ HandleReciveData()

override void HandleReciveData ( ActionReciveData action_recive_data,
ActionData action_data )
inlineprivate
167 {
168 super.HandleReciveData(action_recive_data, action_data);
169
171 RepairCarPartActionData.Cast(action_data).m_DamageZone = reciveDataRepair.m_DamageZoneRecived;
172 }
Definition ActionRepairCarPart.c:2

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)
inlineprivate
79 {
80 Object tgObject = action_data.m_Target.GetObject();
81
82 string damageZone = RepairCarPartActionData.Cast(action_data).m_DamageZone;
83 if (!GetGame().IsMultiplayer())
85
86 if (tgObject)
87 {
89 if (carDoor)
90 {
92 float zoneMax = carDoor.GetMaxHealth("", "");
93 float randomValue = Math.RandomFloatInclusive(zoneMax * 0.05, zoneMax * 0.15);
94
95 switch (newDmgLevel)
96 {
99 break;
100
103 break;
104
107 break;
108
109 default:
110 break;
111 }
112
113 if (action_data.m_MainItem.HasQuantity())
114 {
115 if (action_data.m_MainItem.GetQuantity() > 1)
116 {
117 int qnt = action_data.m_MainItem.GetQuantity();
118 qnt -= action_data.m_MainItem.GetQuantityMax() * 0.25;
119 action_data.m_MainItem.SetQuantity(qnt);
120 }
121 else
122 action_data.m_MainItem.Delete();
123 }
124 }
125 }
126 }
string m_CurrentDamageZone
Definition ActionRepairCarPart.c:18
Definition EnMath.c:7
const float DAMAGE_RUINED_VALUE
Definition constants.c:823
const float DAMAGE_DAMAGED_VALUE
Definition constants.c:821
const float DAMAGE_BADLY_DAMAGED_VALUE
Definition constants.c:822
const int STATE_BADLY_DAMAGED
Definition constants.c:808
const int STATE_DAMAGED
Definition constants.c:809
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:106

Перекрестные ссылки Math::Clamp(), GameConstants::DAMAGE_BADLY_DAMAGED_VALUE, GameConstants::DAMAGE_DAMAGED_VALUE, GameConstants::DAMAGE_RUINED_VALUE, GetGame(), m_CurrentDamageZone, Math::RandomFloatInclusive(), GameConstants::STATE_BADLY_DAMAGED, GameConstants::STATE_DAMAGED, GameConstants::STATE_RUINED и GameConstants::STATE_WORN.

◆ ReadFromContext()

override bool ReadFromContext ( ParamsReadContext ctx,
out ActionReciveData action_recive_data )
inlineprivate
147 {
150
151 super.ReadFromContext(ctx, action_recive_data);
153
154 if (HasTarget())
155 {
156 string zone;
157 if (!ctx.Read(zone))
158 return false;
159
160 reciveDataRepair.m_DamageZoneRecived = zone;
161 }
162
163 return true;
164 }
bool HasTarget()
Definition ActionBase.c:244

Перекрестные ссылки ActionBase::HasTarget().

◆ WriteToContext()

override void WriteToContext ( ParamsWriteContext ctx,
ActionData action_data )
inlineprivate
135 {
136 super.WriteToContext(ctx, action_data);
138
140 {
142 ctx.Write(repairActionData.m_DamageZone);
143 }
144 }
Super root of all classes in Enforce script.
Definition EnScript.c:11
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo(), ActionBase::HasTarget() и m_CurrentDamageZone.

Поля

◆ m_CurrentDamageZone

string m_CurrentDamageZone = ""
private

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

◆ m_LastValidComponentIndex

int m_LastValidComponentIndex = -1
private

◆ m_LastValidType

m_LastValidType
private

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