DayZ 1.24
Loading...
Searching...
No Matches
ActionUncoverHeadSelf.c
Go to the documentation of this file.
2{
7};
8
9
11{
13 {
15 if (Class.CastTo(attachment, target.GetInventory().FindAttachment(InventorySlots.HEADGEAR)) && attachment.GetType() == "BurlapSackCover")
16 {
18 if (!source.GetHumanInventory().GetEntityInHands())
19 new_item = ItemBase.Cast(HumanInventory.Cast(source.GetInventory()).CreateInHands("BurlapSack"));
20 else
21 {
22 if (!Class.CastTo(new_item, source.GetInventory().CreateInInventory("BurlapSack"))) //full inventory
23 {
24 vector m4[4];
25 source.GetTransformWS(m4);
27 target_gnd.SetGround(null, m4);
29 }
30 }
31
32 if (new_item)
33 {
34 MiscGameplayFunctions.TransferItemProperties(attachment, new_item, true, false, true);
35 attachment.Delete();
36
37 source.GetSoftSkillsManager().AddSpecialty(m_SpecialtyWeight);
38 }
39 }
40 }
41
42}
43
45{
47 {
48 m_CallbackClass = ActionUncoverHeadSelfCB;
49 m_CommandUID = DayZPlayerConstants.CMD_ACTIONMOD_COVERHEAD_SELF;
50 m_StanceMask = DayZPlayerConstants.STANCEMASK_ERECT | DayZPlayerConstants.STANCEMASK_CROUCH | DayZPlayerConstants.STANCEMASK_PRONE;
51
52 m_Text = "#uncover_head";
53 }
54
56 {
59 }
60
61 override bool HasTarget()
62 {
63 return false;
64 }
65
66 override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
67 {
69 return true;
70
71 return false;
72 }
73
75 {
76 UncoverHead(action_data.m_Player, action_data.m_Player);
77 }
78
79
81 {
83 Class.CastTo(attachment, player.GetInventory().FindAttachment(InventorySlots.HEADGEAR));
84 if (attachment && attachment.IsInherited(BurlapSackCover))
85 return true;
86 return false;
87 }
88};
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
int m_StanceMask
Definition ActionBase.c:53
bool IsWearingBurlap(PlayerBase player)
ActionUncoverHeadBase ActionContinuousBase ActionUncoverHeadSelf()
override void CreateConditionComponents()
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
override bool HasTarget()
const int ECE_IN_INVENTORY
const int RF_DEFAULT
ActionData m_ActionData
void OnFinishProgressServer(ActionData action_data)
ref CABase m_ActionComponent
Definition ActionBase.c:30
void UncoverHead(PlayerBase target, PlayerBase source)
override void CreateActionComponent()
Super root of all classes in Enforce script.
Definition EnScript.c:11
script counterpart to engine's class Inventory
Definition Inventory.c:79
static proto native EntityAI LocationCreateEntity(notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation)
creates new item directly at location
inventory for plain man/human
proto native EntityAI CreateInHands(string typeName)
creates new entity in hands
InventoryLocation.
provides access to slot configuration
const float COVER_HEAD
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.