Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionsplintself.c
Go to the documentation of this file.
2 {
3  override void CreateActionComponent()
4  {
5  m_ActionData.m_ActionComponent = new CAContinuousTime(UATimeSpent.APPLY_SPLINT);
6  }
7 };
8 
10 {
11  void ActionSplintSelf()
12  {
13  m_CallbackClass = ActionSplintSelfCB;
14  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_CRAFTING;
15  m_FullBody = true;
16  m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
18  m_Text = "#apply_splint";
19  }
20 
21  override void CreateConditionComponents()
22  {
25  }
26 
27  override bool HasTarget()
28  {
29  return false;
30  }
31 
32  override void OnFinishProgressServer( ActionData action_data )
33  {
34  action_data.m_MainItem.TransferModifiers(action_data.m_Player);
35  action_data.m_Player.ApplySplint();
36 
37  //Double check to not enter splinted state if legs are not broken
38  if (action_data.m_Player.GetBrokenLegs() == eBrokenLegs.BROKEN_LEGS)
39  {
40  action_data.m_Player.SetBrokenLegs(eBrokenLegs.BROKEN_LEGS_SPLINT);
41 
42  ItemBase new_item = ItemBase.Cast(action_data.m_Player.GetInventory().CreateInInventory("Splint_Applied"));
43  if ( new_item )
44  {
45  MiscGameplayFunctions.TransferItemProperties(action_data.m_MainItem,new_item,true,false,true);
46  action_data.m_MainItem.Delete();
47  action_data.m_Player.GetSoftSkillsManager().AddSpecialty( m_SpecialtyWeight );
48  }
49  }
50  }
51 
52  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
53  {
54  if (player.GetBrokenLegs() != eBrokenLegs.BROKEN_LEGS || IsWearingSplint(player))
55  {
56  return false;
57  }
58  return super.ActionCondition(player, target, item);
59 
60  }
61 
62  bool IsWearingSplint( PlayerBase player )
63  {
64  if ( player.GetItemOnSlot("Splint_Right") )
65  {
66  return true;
67  }
68  return false;
69  }
70 };
ItemBase
Definition: inventoryitem.c:730
ActionSplintSelf
Definition: actionsplintself.c:9
CAContinuousTime
Definition: cacontinuoustime.c:1
UASoftSkillsWeight
Definition: actionconstants.c:118
eBrokenLegs
eBrokenLegs
Definition: ebrokenlegs.c:1
m_FullBody
protected bool m_FullBody
Definition: actionbase.c:52
PlayerBase
Definition: playerbaseclient.c:1
ActionTarget
class ActionTargets ActionTarget
ActionData
Definition: actionbase.c:20
DayZPlayerConstants
DayZPlayerConstants
defined in C++
Definition: dayzplayer.c:601
CCTSelf
Definition: cctself.c:1
UATimeSpent
Definition: actionconstants.c:26
ActionContinuousBaseCB
Definition: actioncontinuousbase.c:1
m_Text
protected string m_Text
Definition: actionbase.c:49
m_ConditionItem
ref CCIBase m_ConditionItem
Definition: actionbase.c:55
ActionContinuousBase
Definition: actioncontinuousbase.c:132
CCINonRuined
Definition: ccinonruined.c:1
m_ConditionTarget
ref CCTBase m_ConditionTarget
Definition: actionbase.c:56
m_SpecialtyWeight
protected float m_SpecialtyWeight
Definition: actionbase.c:68
m_StanceMask
protected int m_StanceMask
Definition: actionbase.c:53
ActionSplintSelfCB
Definition: actionsplintself.c:1