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

Private Member Functions

void ActionUnrestrainTarget ()
 
override void CreateConditionComponents ()
 
override bool ActionCondition (PlayerBase player, ActionTarget target, ItemBase item)
 
override void OnFinishProgressServer (ActionData action_data)
 
- 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)
 

Detailed Description

Definition at line 51 of file ActionUnrestrainTarget.c.

Constructor & Destructor Documentation

◆ ActionUnrestrainTarget()

void ActionUnrestrainTarget::ActionUnrestrainTarget ( )
inlineprivate

Member Function Documentation

◆ ActionCondition()

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

Definition at line 69 of file ActionUnrestrainTarget.c.

70 {
71 PlayerBase other_player = PlayerBase.Cast(target.GetObject());
72 EntityAI item_in_hands_source = player.GetItemInHands();
73
74 if (other_player.IsRestrained())
75 {
76 //Print("is restrained");
78
80
82 {
83 item_in_hands_target.ConfigGetTextArray("CanBeUnrestrainedBy", CachedObjectsArrays.ARRAY_STRING);
84
86
87 for (int i = 0; i < CachedObjectsArrays.ARRAY_STRING.Count(); i++)
88 {
89 if ((i % 2) == 0)
90 {
92 if (GetGame().IsKindOf(item_in_hands_name, class_name))
93 return true;
94 }
95 }
96 }
97 }
98 return false;
99 }
class OptionSelectorMultistate extends OptionSelector class_name
static ref TStringArray ARRAY_STRING
proto native CGame GetGame()

References CachedObjectsArrays::ARRAY_STRING, class_name, and GetGame().

◆ CreateConditionComponents()

override void ActionUnrestrainTarget::CreateConditionComponents ( )
inlineprivate

Definition at line 63 of file ActionUnrestrainTarget.c.

64 {
67 }
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
Definition CCTMan.c:2
const float DEFAULT

References UAMaxDistances::DEFAULT, m_ConditionItem, and m_ConditionTarget.

◆ OnFinishProgressServer()

override void ActionUnrestrainTarget::OnFinishProgressServer ( ActionData action_data)
inlineprivate

Definition at line 101 of file ActionUnrestrainTarget.c.

102 {
103 PlayerBase player_target = PlayerBase.Cast(action_data.m_Target.GetObject());
105
106 if (CanReceiveAction(action_data.m_Target) && player_target.IsRestrained())
107 {
109 EntityAI restraining_item = player_target.GetItemInHands();
110
111 player_target.SetRestrained(false);
112
113
114 //Damage applied to tool
116
117 restraining_item.ConfigGetTextArray("CanBeUnrestrainedBy", CachedObjectsArrays.ARRAY_STRING);
118 restraining_item.ConfigGetFloatArray("CanBeUnrestrainedByDMG", CachedObjectsArrays.ARRAY_FLOAT);
119
120 string item_in_hands_name = unrestraining_tool.GetType();
121 float damageToTool = 0;
122
123 for (int i = 0; i < CachedObjectsArrays.ARRAY_STRING.Count(); i++)
124 {
126 if (GetGame().IsKindOf(item_in_hands_name, class_name))
127 {
129 break;
130 }
131 }
132
133 MiscGameplayFunctions.DealAbsoluteDmg(action_data.m_MainItem, damageToTool);
134 //---------------------------
135
137
138 action_data.m_Player.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
139 }
140 }
bool CanReceiveAction(ActionTarget target)
Definition ActionBase.c:594
static ref TFloatArray ARRAY_FLOAT

References CachedObjectsArrays::ARRAY_FLOAT, CachedObjectsArrays::ARRAY_STRING, CanReceiveAction(), class_name, GetGame(), and m_SpecialtyWeight.


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