DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ActionSplintSelf.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_CRAFTING;
15 m_FullBody = true;
16 m_StanceMask = DayZPlayerConstants.STANCEMASK_CROUCH;
18 m_Text = "#apply_splint";
19 }
20
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
63 {
64 if ( player.GetItemOnSlot("Splint_Right") )
65 {
66 return true;
67 }
68 return false;
69 }
70};
protected float m_SpecialtyWeight
Definition ActionBase.c:68
ref CCIBase m_ConditionItem
Definition ActionBase.c:55
ref CCTBase m_ConditionTarget
Definition ActionBase.c:56
protected string m_Text
Definition ActionBase.c:49
protected bool m_FullBody
Definition ActionBase.c:52
protected int m_StanceMask
Definition ActionBase.c:53
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
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)
override bool HasTarget()
const float APPLY_SPLINT
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:602