Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
actionsplinttarget.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 ActionSplintTarget()
12  {
13  m_CallbackClass = ActionSplintTargetCB;
14  m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_BANDAGETARGET;
15  m_FullBody = true;
17  m_Text = "#fix_persons_fracture";
18  }
19 
20  override void CreateConditionComponents()
21  {
24  }
25 
26  override void OnFinishProgressServer( ActionData action_data )
27  {
28  PlayerBase ntarget = PlayerBase.Cast( action_data.m_Target.GetObject() );
29  if (CanReceiveAction(action_data.m_Target))
30  {
31  action_data.m_MainItem.TransferModifiers(ntarget);
32  ntarget.ApplySplint();
33 
34  ItemBase new_item = ItemBase.Cast(ntarget.GetInventory().CreateInInventory("Splint_Applied"));
35  if ( new_item )
36  {
37  MiscGameplayFunctions.TransferItemProperties(action_data.m_MainItem,new_item,true,false,true);
38  action_data.m_MainItem.Delete();
39  action_data.m_Player.GetSoftSkillsManager().AddSpecialty( m_SpecialtyWeight );
40  }
41 
42  ntarget.SetBrokenLegs(eBrokenLegs.BROKEN_LEGS_SPLINT);
43  //action_data.m_MainItem.Delete();
44 
45  action_data.m_Player.GetSoftSkillsManager().AddSpecialty( m_SpecialtyWeight );
46  }
47  }
48 
49  override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
50  {
51  PlayerBase ntarget = PlayerBase.Cast( target.GetObject() );
52  if (ntarget.GetBrokenLegs() != eBrokenLegs.BROKEN_LEGS || IsWearingSplint(ntarget))
53  {
54  return false;
55  }
56  return super.ActionCondition(player, target, item);
57 
58  }
59 
60  bool IsWearingSplint( PlayerBase player )
61  {
62  if ( player.GetItemOnSlot("Splint_Right") )
63  {
64  return true;
65  }
66  return false;
67  }
68 };
ItemBase
Definition: inventoryitem.c:730
CAContinuousTime
Definition: cacontinuoustime.c:1
ActionSplintTarget
Definition: actionsplinttarget.c:9
CCTMan
Definition: cctman.c:1
UASoftSkillsWeight
Definition: actionconstants.c:118
ActionSplintTargetCB
Definition: actionsplinttarget.c:1
UAMaxDistances
Definition: actionconstants.c:104
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
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
CanReceiveAction
bool CanReceiveAction(ActionTarget target)
Definition: actionbase.c:638