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

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

void ActionRepairTentPart ()
 
override void CreateConditionComponents ()
 
override bool IsUsingProxies ()
 
override bool HasTarget ()
 
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
 

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

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

◆ ActionRepairTentPart()

void ActionRepairTentPart ( )
inlineprivate
26 {
29
30 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
31 m_FullBody = true;
32 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
33 m_Text = "#repair";
34 }
bool m_FullBody
Definition ActionBase.c:61
string m_Text
Definition ActionBase.c:58
float m_SpecialtyWeight
Definition ActionBase.c:77
int m_StanceMask
Definition ActionBase.c:62
Definition ActionRepairTentPart.c:12
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_SpecialtyWeight, ActionBase::m_StanceMask и ActionBase::m_Text.

Методы

◆ ActionCondition()

override bool ActionCondition ( PlayerBase player,
ActionTarget target,
ItemBase item )
inlineprivate
53 {
54 //m_CurrentDamageZone = "";
55 Object targetObject = target.GetObject();
56 Object targetParent = target.GetParent();
57 if ( !targetParent || !targetParent.IsInherited(TentBase) )
58 return false;
59
61 {
65 targetObject.GetActionComponentNameList(target.GetComponentIndex(), selections, "view");
67 if (m_LastValidType != targetObject.Type() || m_LastValidComponentIndex != target.GetComponentIndex() || m_CurrentDamageZone == "" || m_CurrentDamageZone == "Body")
68 {
69 string damageZone = "";
70
71 for (int s = 0; s < selections.Count(); s++)
72 {
73 if ( DamageSystem.GetDamageZoneFromComponentName(tent, selections[s], damageZone) ) //NOTE: relevant fire geometry and view geometry selection names MUST match in order to get a valid damage zone
74 {
75 //Print("#" + s + " damageZone: " + damageZone);
76 if (tent.GetHealthLevel("" + damageZone) == GameConstants.STATE_RUINED )
77 {
79 m_LastValidComponentIndex = target.GetComponentIndex();
80 break;
81 }else
82 continue;
83 }
84 }
85 if ( damageZone != "" && m_CurrentDamageZone != "Body" ) //This may seem like a duplicate but is required to work properly
86 {
88 m_LastValidComponentIndex = target.GetComponentIndex();
89 }
90 }
91
92 if ( m_CurrentDamageZone != "" && m_CurrentDamageZone != "Body" && tent.GetHealthLevel("" + damageZone) == GameConstants.STATE_RUINED )
93 {
94 return true;
95 }
96 }
97
98 return false;
99 }
PluginBase GetPlugin(typename plugin_type)
Definition PluginManager.c:316
m_LastValidType
Definition ActionRepairTentPart.c:21
int m_LastValidComponentIndex
Definition ActionRepairTentPart.c:23
string m_CurrentDamageZone
Definition ActionRepairTentPart.c:22
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition constants.c:638
Definition ObjectTyped.c:2
Definition CarTent.c:2
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const int STATE_RUINED
Definition constants.c:807

Перекрестные ссылки Class::CastTo(), GetPlugin(), m_CurrentDamageZone, m_LastValidComponentIndex, m_LastValidType и GameConstants::STATE_RUINED.

◆ CreateActionData()

override ActionData CreateActionData ( )
inlineprivate

◆ CreateConditionComponents()

override void CreateConditionComponents ( )
inlineprivate
37 {
38 m_ConditionItem = new CCINonRuined; //To change?
40 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:64
ref CCTBase m_ConditionTarget
Definition ActionBase.c:65
Definition CCINonRuined.c:2
Definition CCTCursorParent.c:2
Definition ActionConstants.c:106
const float DEFAULT
Definition ActionConstants.c:108

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

◆ HandleReciveData()

override void HandleReciveData ( ActionReciveData action_recive_data,
ActionData action_data )
inlineprivate
170 {
171 super.HandleReciveData(action_recive_data, action_data);
172
174 RepairTentPartActionData.Cast(action_data).m_DamageZone = recive_data_repair.m_DamageZoneRecived;
175 }
Definition ActionRepairTentPart.c:2

◆ HasTarget()

override bool HasTarget ( )
inlineprivate
48 {
49 return true;
50 }

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

◆ IsUsingProxies()

override bool IsUsingProxies ( )
inlineprivate
43 {
44 return true;
45 }

◆ OnFinishProgressServer()

override void OnFinishProgressServer ( ActionData action_data)
inlineprivate
102 {
103 Object targetParent = action_data.m_Target.GetParent();
104 ItemBase usedItem = action_data.m_MainItem;
105
106 string damageZone = RepairTentPartActionData.Cast(action_data).m_DamageZone;
107 if (!GetGame().IsMultiplayer())
109
110 if ( targetParent && targetParent.IsInherited(TentBase) && damageZone != "" )
111 {
113 float m_RepairedLevel = usedItem.GetHealthLevel();
114
115 tent.SetAllowDamage(true);
116 targetParent.SetHealth01("" + damageZone, "", targetParent.GetHealthLevelValue(m_RepairedLevel));
117 tent.ProcessInvulnerabilityCheck(tent.GetInvulnerabilityTypeString());
118
119 if (usedItem.GetQuantity() > 1)
120 {
121 //Not really clean, but will do for now
122 int val = usedItem.GetQuantity();
123 val--;
124 usedItem.SetQuantity(val);
125 }
126 else
127 usedItem.Delete();
128 }
129 }
Definition InventoryItem.c:731
proto native CGame GetGame()

Перекрестные ссылки GetGame() и m_CurrentDamageZone.

◆ ReadFromContext()

override bool ReadFromContext ( ParamsReadContext ctx,
out ActionReciveData action_recive_data )
inlineprivate
150 {
152 {
154 }
155 super.ReadFromContext(ctx, action_recive_data);
157
158 if( HasTarget() )
159 {
160 string zone;
161 if ( !ctx.Read(zone) )
162 return false;
163
164 recive_data_repair.m_DamageZoneRecived = zone;
165 }
166 return true;
167 }
override bool HasTarget()
Definition ActionRepairTentPart.c:47

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

◆ WriteToContext()

override void WriteToContext ( ParamsWriteContext ctx,
ActionData action_data )
inlineprivate
138 {
139 super.WriteToContext(ctx, action_data);
141
143 {
145 ctx.Write(repair_action_data.m_DamageZone);
146 }
147 }

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

Поля

◆ m_CurrentDamageZone

string m_CurrentDamageZone = ""
private

◆ m_LastValidComponentIndex

int m_LastValidComponentIndex = -1
private

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

◆ m_LastValidType

m_LastValidType
private

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


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