DayZ 1.24
Loading...
Searching...
No Matches
ActionSplintTarget.c
Go to the documentation of this file.
8
10{
12 {
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_BANDAGETARGET;
15 m_FullBody = true;
17 m_Text = "#fix_persons_fracture";
18 }
19
25
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 return false;
54 return super.ActionCondition(player, target, item);
55
56 }
57
59 {
60 if (player.GetItemOnSlot("Splint_Right"))
61 return true;
62 return false;
63 }
64};
bool m_FullBody
Definition ActionBase.c:52
string m_Text
Definition ActionBase.c:49
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
bool CanReceiveAction(ActionTarget target)
Definition ActionBase.c:594
eBrokenLegs
Definition EBrokenLegs.c:2
ActionData m_ActionData
ref CABase m_ActionComponent
Definition ActionBase.c:30
override void CreateActionComponent()
override void OnFinishProgressServer(ActionData action_data)
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
bool IsWearingSplint(PlayerBase player)
Definition CCTMan.c:2
const float DEFAULT
const float APPLY_SPLINT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597