DayZ 1.24
Loading...
Searching...
No Matches
ActionRepairTent Class Reference
Inheritance diagram for ActionRepairTent:
[legend]
Collaboration diagram for ActionRepairTent:
[legend]

Private Member Functions

void ActionRepairTent ()
 
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)
 
void RepairDamageTransfer (PlayerBase player, ItemBase repair_kit, ItemBase item, float specialty_weight, string damage_zone="")
 
- Private Member Functions inherited from 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)
 

Private Attributes

 m_LastValidType
 
string m_CurrentDamageZone = ""
 
int m_LastValidComponentIndex = -1
 

Detailed Description

Definition at line 19 of file ActionRepairTent.c.

Constructor & Destructor Documentation

◆ ActionRepairTent()

void ActionRepairTent::ActionRepairTent ( )
inlineprivate

Member Function Documentation

◆ ActionCondition()

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

Definition at line 52 of file ActionRepairTent.c.

53 {
54 Object targetObject = target.GetObject();
55 Object targetParent = target.GetParent();
56 if (!targetParent || !targetParent.IsInherited(TentBase))
57 return false;
58
60 {
64 targetObject.GetActionComponentNameList(target.GetComponentIndex(), selections, "view");
66
67 string damageZone = "";
68
69 for (int s = 0; s < selections.Count(); s++)
70 {
71 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
72 {
73 //Print("selections[s]: " + selections[s] + " | damageZone: " + damageZone);
74 break;
75 }
76 }
77
78 if (damageZone != "")
79 {
80 if (module_repairing.CanRepair(item, tent, damageZone))
81 {
83 return true;
84 }
85 }
86 }
87 return false;
88 }
PluginBase GetPlugin(typename plugin_type)
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.

References Class::CastTo(), GetPlugin(), and m_CurrentDamageZone.

◆ CreateActionData()

override ActionData ActionRepairTent::CreateActionData ( )
inlineprivate

Definition at line 110 of file ActionRepairTent.c.

◆ CreateConditionComponents()

override void ActionRepairTent::CreateConditionComponents ( )
inlineprivate

Definition at line 36 of file ActionRepairTent.c.

37 {
40 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
const float SMALL

References m_ConditionItem, m_ConditionTarget, and UAMaxDistances::SMALL.

◆ HandleReciveData()

override void ActionRepairTent::HandleReciveData ( ActionReciveData action_recive_data,
ActionData action_data )
inlineprivate

◆ HasTarget()

override bool ActionRepairTent::HasTarget ( )
inlineprivate

Definition at line 47 of file ActionRepairTent.c.

48 {
49 return true;
50 }

Referenced by ReadFromContext(), and WriteToContext().

◆ IsUsingProxies()

override bool ActionRepairTent::IsUsingProxies ( )
inlineprivate

Definition at line 42 of file ActionRepairTent.c.

43 {
44 return true;
45 }

◆ OnFinishProgressServer()

override void ActionRepairTent::OnFinishProgressServer ( ActionData action_data)
inlineprivate

Definition at line 90 of file ActionRepairTent.c.

91 {
92 Object targetObject = action_data.m_Target.GetObject();
93 Object targetParent = action_data.m_Target.GetParent();
94
95 string damageZone = RepairTentActionData.Cast(action_data).m_DamageZone;
96 if (!GetGame().IsMultiplayer())
98
99 if (targetParent && targetParent.IsInherited(TentBase) && damageZone != "")
100 {
104
107 }
108 }
void RepairDamageTransfer(PlayerBase player, ItemBase repair_kit, ItemBase item, float specialty_weight, string damage_zone="")
proto native CGame GetGame()

References Class::CastTo(), GetGame(), GetPlugin(), m_CurrentDamageZone, m_SpecialtyWeight, and RepairDamageTransfer().

◆ ReadFromContext()

override bool ActionRepairTent::ReadFromContext ( ParamsReadContext ctx,
out ActionReciveData action_recive_data )
inlineprivate

Definition at line 128 of file ActionRepairTent.c.

129 {
132 super.ReadFromContext(ctx, action_recive_data);
134
135 if (HasTarget())
136 {
137 string zone;
138 if (!ctx.Read(zone))
139 return false;
140
141 recive_data_repair.m_DamageZoneRecived = zone;
142 }
143 return true;
144 }
override bool HasTarget()

References HasTarget().

◆ RepairDamageTransfer()

void ActionRepairTent::RepairDamageTransfer ( PlayerBase player,
ItemBase repair_kit,
ItemBase item,
float specialty_weight,
string damage_zone = "" )
inlineprivate

Definition at line 154 of file ActionRepairTent.c.

155 {
156 float transfer_to_global_coef = 0;
158 string path = "" + CFG_VEHICLESPATH + " " + item.GetType() + " DamageSystem DamageZones " + damage_zone;
161
162 GetGame().ConfigGetTextArray("" + path + " transferToZonesNames", transfer_zones);
163
164 for (int i = 0; i < transfer_zones.Count(); i++)
165 {
166 transfer_to_global_coef += GetGame().ConfigGetFloat("" + path + " Health transferToGlobalCoef");
167 if (transfer_zones.Get(i) == damage_zone)
168 continue;
169
171 }
172
173 //finally, repairs global
176 }
const string CFG_VEHICLESPATH
Definition constants.c:209

References Class::CastTo(), CFG_VEHICLESPATH, GetGame(), GetPlugin(), and path.

Referenced by OnFinishProgressServer().

◆ WriteToContext()

override void ActionRepairTent::WriteToContext ( ParamsWriteContext ctx,
ActionData action_data )
inlineprivate

Definition at line 116 of file ActionRepairTent.c.

117 {
118 super.WriteToContext(ctx, action_data);
120
122 {
124 ctx.Write(repair_action_data.m_DamageZone);
125 }
126 }

References Class::CastTo(), HasTarget(), and m_CurrentDamageZone.

Member Data Documentation

◆ m_CurrentDamageZone

string ActionRepairTent::m_CurrentDamageZone = ""
private

Definition at line 22 of file ActionRepairTent.c.

Referenced by ActionCondition(), OnFinishProgressServer(), and WriteToContext().

◆ m_LastValidComponentIndex

int ActionRepairTent::m_LastValidComponentIndex = -1
private

Definition at line 23 of file ActionRepairTent.c.

◆ m_LastValidType

ActionRepairTent::m_LastValidType
private

Definition at line 21 of file ActionRepairTent.c.


The documentation for this class was generated from the following file: