DayZ 1.28
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ActionUncoverHeadSelf.c
См. документацию.
2{
3 override void CreateActionComponent()
4 {
6 }
7};
8
9
11{
12 void UncoverHead(PlayerBase target, PlayerBase source)
13 {
14 EntityAI attachment;
15 if (Class.CastTo(attachment, target.GetInventory().FindAttachment(InventorySlots.HEADGEAR)) && attachment.GetType() == "BurlapSackCover")
16 {
17 ItemBase new_item = null;
18 if (!source.GetHumanInventory().GetEntityInHands())
19 {
20 new_item = ItemBase.Cast(HumanInventory.Cast(source.GetInventory()).CreateInHands("BurlapSack"));
21 }
22 else
23 {
24 if (!Class.CastTo(new_item,source.GetInventory().CreateInInventory("BurlapSack")))//full inventory
25 {
26 vector m4[4];
27 source.GetTransformWS(m4);
28 InventoryLocation target_gnd = new InventoryLocation;
29 target_gnd.SetGround(null, m4);
30 new_item = ItemBase.Cast(GameInventory.LocationCreateEntity(target_gnd, "BurlapSack",ECE_IN_INVENTORY,RF_DEFAULT));
31 }
32 }
33
34 if (new_item)
35 {
36 MiscGameplayFunctions.TransferItemProperties(attachment,new_item,true,false,true);
37 attachment.Delete();
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 {
57 m_ConditionItem = new CCINone;
58 m_ConditionTarget = new CCTNone;
59 }
60
61 override bool HasTarget()
62 {
63 return false;
64 }
65
66 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
67 {
68 if ( IsWearingBurlap(player) )
69 return true;
70
71 return false;
72 }
73
74 override void OnFinishProgressServer( ActionData action_data )
75 {
76 UncoverHead(action_data.m_Player, action_data.m_Player);
77 }
78
79
81 {
82 EntityAI attachment;
83 Class.CastTo(attachment, player.GetInventory().FindAttachment(InventorySlots.HEADGEAR));
84 if ( attachment && attachment.IsInherited(BurlapSackCover) )
85 {
86 return true;
87 }
88 return false;
89 }
90};
int m_CommandUID
Определения ActionBase.c:31
int m_StanceMask
Определения ActionBase.c:33
ActionBase ActionData
Определения ActionBase.c:30
void ActionTarget(Object object, Object parent, int componentIndex, vector cursorHitPos, float utility, string surfaceName="")
Определения ActionTargets.c:121
bool IsWearingBurlap(PlayerBase player)
Определения ActionUncoverHeadSelf.c:80
ActionUncoverHeadBase ActionContinuousBase ActionUncoverHeadSelf()
Определения ActionUncoverHeadSelf.c:46
override void CreateConditionComponents()
Определения ActionUncoverHeadSelf.c:55
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
Определения ActionUncoverHeadSelf.c:66
override bool HasTarget()
Определения ActionUncoverHeadSelf.c:61
const int ECE_IN_INVENTORY
Определения CentralEconomy.c:36
const int RF_DEFAULT
Определения CentralEconomy.c:65
ActionData m_ActionData
Определения AnimatedActionBase.c:3
void ActionContinuousBase()
Определения ActionContinuousBase.c:124
void OnFinishProgressServer(ActionData action_data)
Определения ActionContinuousBase.c:283
void UncoverHead(PlayerBase target, PlayerBase source)
Определения ActionUncoverHeadSelf.c:12
override void CreateActionComponent()
Определения ActionUncoverHeadSelf.c:3
Определения CCINone.c:2
Определения CCTNone.c:2
Super root of all classes in Enforce script.
Определения EnScript.c:11
static proto native EntityAI LocationCreateEntity(notnull InventoryLocation inv_loc, string type, int iSetupFlags, int iRotation)
creates new item directly at location
script counterpart to engine's class Inventory
proto native EntityAI CreateInHands(string typeName)
creates new entity in hands
inventory for plain man/human
Определения HumanInventory.c:10
proto native void SetGround(EntityAI e, vector mat[4])
sets current inventory location type to Ground with transformation mat
InventoryLocation.
Определения InventoryLocation.c:29
provides access to slot configuration
Определения InventorySlots.c:6
Определения PlayerBaseClient.c:2
const float COVER_HEAD
Определения ActionConstants.c:55
Определения ActionConstants.c:28
Определения EnConvert.c:106
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.