DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ActionRepairShelter.c
Go to the documentation of this file.
1//used for shelters (non-proxy tent objects)
3{
5 {
8
9 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_INTERACT;
10 m_FullBody = true;
11 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH;
12 }
13
15 {
18 }
19
20 override bool IsUsingProxies()
21 {
22 return false;
23 }
24
25 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
26 {
27 ShelterBase shelter = ShelterBase.Cast( target.GetObject() );
28 if ( !shelter )
29 return false;
30
31 if ( player && shelter )
32 {
33 PluginRepairing module_repairing;
34 Class.CastTo(module_repairing, GetPlugin(PluginRepairing));
35 if (module_repairing.CanRepair(item,shelter))
36 {
37 return true;
38 }
39 }
40
41 return false;
42 }
43
44 override void OnFinishProgressServer( ActionData action_data )
45 {
46 ShelterBase shelter = ShelterBase.Cast( action_data.m_Target.GetObject() );
47
48 if ( shelter )
49 {
50 PluginRepairing module_repairing;
51 Class.CastTo(module_repairing, GetPlugin(PluginRepairing));
52 module_repairing.Repair(action_data.m_Player,action_data.m_MainItem,shelter,m_SpecialtyWeight);
53 }
54 }
55};
protected float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
protected bool m_FullBody
Definition ActionBase.c:52
protected int m_StanceMask
Definition ActionBase.c:53
class ActionTargets ActionTarget
PluginBase GetPlugin(typename plugin_type)
ItemBase m_MainItem
Definition ActionBase.c:28
PlayerBase m_Player
Definition ActionBase.c:33
ref ActionTarget m_Target
Definition ActionBase.c:32
override void OnFinishProgressServer(ActionData action_data)
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override bool IsUsingProxies()
Super root of all classes in Enforce script.
Definition EnScript.c:11
const float SMALL
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.