DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
BurlapSackCover.c
См. документацию.
1class BurlapSackCover extends HeadGear_Base
2{
4
6 {
7 if (m_Player)
8 {
10 }
11 }
12
13 override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
14 {
15 super.EEItemLocationChanged(oldLoc,newLoc);
16
17 if (GetGame().IsDedicatedServer() && newLoc.GetType() == InventoryLocationType.GROUND)
18 {
19 EntityAI newItem = EntityAI.Cast(GetGame().CreateObjectEx("BurlapSack",newLoc.GetPos(),ECE_PLACE_ON_SURFACE,RF_DEFAULT));
20 MiscGameplayFunctions.TransferItemProperties(this,newItem);
21 DeleteSafe();
22 }
23 }
24
25 override void OnWasAttached(EntityAI parent, int slot_id)
26 {
27 super.OnWasAttached(parent, slot_id);
28
29 Class.CastTo(m_Player, parent.GetHierarchyRootPlayer());
30
31 if ((!GetGame().IsDedicatedServer()) && m_Player && m_Player.IsControlledPlayer() && slot_id == InventorySlots.HEADGEAR)
32 {
33 PPERequesterBank.GetRequester(PPERequester_BurlapSackEffects).Start();
34 m_Player.SetInventorySoftLock(true);
35 m_Player.SetMasterAttenuation("BurlapSackAttenuation");
36
37 if (GetGame().GetUIManager().IsMenuOpen(MENU_INVENTORY))
38 {
40 }
41 }
42 SetInvisibleRecursive(true,m_Player,{InventorySlots.MASK,InventorySlots.EYEWEAR});
43 }
44
45 override bool CanPutInCargo( EntityAI parent )
46 {
47 if (!super.CanPutInCargo(parent))
48 return false;
49
50 if (parent && parent != this)
51 return true;
52
53 return false;
54 }
55
56 override bool CanDetachAttachment( EntityAI parent )
57 {
58 return false;
59 }
60
62 {
63 if (player.IsControlledPlayer())
64 {
65 PPERequesterBank.GetRequester(PPERequester_BurlapSackEffects).Stop();
66 player.SetInventorySoftLock(false);
67 player.SetMasterAttenuation("");
68 }
69 SetInvisibleRecursive(false,player,{InventorySlots.MASK,InventorySlots.EYEWEAR});
70 }
71
72 override protected set<int> GetAttachmentExclusionInitSlotValue(int slotId)
73 {
74 set<int> ret = super.GetAttachmentExclusionInitSlotValue(slotId);
75 if (slotId == InventorySlots.HEADGEAR)
76 {
77 ret.Insert(EAttExclusions.SHAVING_HEADGEAR_ATT_0);
78 }
79 return ret;
80 }
81}
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
const int RF_DEFAULT
Определения CentralEconomy.c:65
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
proto native Mission GetMission()
Super root of all classes in Enforce script.
Определения EnScript.c:11
Определения Building.c:6
void OnRemovedFromHead(PlayerBase player)
Определения BurlapSackCover.c:61
override void OnWasAttached(EntityAI parent, int slot_id)
Определения BurlapSackCover.c:25
set< int > GetAttachmentExclusionInitSlotValue(int slotId)
Определения BurlapSackCover.c:72
override bool CanDetachAttachment(EntityAI parent)
Определения BurlapSackCover.c:56
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
Определения BurlapSackCover.c:13
override bool CanPutInCargo(EntityAI parent)
Определения BurlapSackCover.c:45
void ~BurlapSackCover()
Определения BurlapSackCover.c:5
PlayerBase m_Player
Определения BurlapSackCover.c:3
hard helmet base
Определения BaseballCap_ColorBase.c:2
InventoryLocation.
Определения InventoryLocation.c:29
provides access to slot configuration
Определения InventorySlots.c:6
void HideInventory()
Определения gameplay.c:809
Определения PlayerBaseClient.c:2
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const int MENU_INVENTORY
Определения constants.c:180