DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ActionSplintTarget.c
Go to the documentation of this file.
2{
3 override void CreateActionComponent()
4 {
6 }
7};
8
10{
12 {
14 m_CommandUID = DayZPlayerConstants.CMD_ACTIONFB_BANDAGETARGET;
15 m_FullBody = true;
17 m_Text = "#fix_persons_fracture";
18 }
19
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
61 {
62 if ( player.GetItemOnSlot("Splint_Right") )
63 {
64 return true;
65 }
66 return false;
67 }
68};
protected float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
bool CanReceiveAction(ActionTarget target)
Definition ActionBase.c:637
protected string m_Text
Definition ActionBase.c:49
protected bool m_FullBody
Definition ActionBase.c:52
class ActionTargets ActionTarget
eBrokenLegs
Definition EBrokenLegs.c:2
protected ActionData m_ActionData
ItemBase m_MainItem
Definition ActionBase.c:28
PlayerBase m_Player
Definition ActionBase.c:33
ref CABase m_ActionComponent
Definition ActionBase.c:30
ref ActionTarget m_Target
Definition ActionBase.c:32
override void CreateActionComponent()
override void OnFinishProgressServer(ActionData action_data)
override void CreateConditionComponents()
bool IsWearingSplint(PlayerBase player)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Definition CCTMan.c:2
const float DEFAULT
const float APPLY_SPLINT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602