DayZ 1.29
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 (g_Game.IsDedicatedServer() && newLoc.GetType() == InventoryLocationType.GROUND)
18 {
19 EntityAI newItem = EntityAI.Cast(g_Game.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 if (slot_id == InventorySlots.HEADGEAR)
30 g_Game.GetCallQueue(CALL_CATEGORY_SYSTEM).CallLater(HandleAttachedToHead, 0);
31 }
32
33 override bool CanPutInCargo(EntityAI parent)
34 {
35 if (!super.CanPutInCargo(parent))
36 return false;
37
38 if (parent && parent != this)
39 return true;
40
41 return false;
42 }
43
44 override bool CanDetachAttachment(EntityAI parent)
45 {
46 return false;
47 }
48
49 protected void OnRemovedFromHead(PlayerBase player)
50 {
51 if ((!g_Game.IsServer() || !g_Game.IsMultiplayer()) && PlayerBase.Cast(g_Game.GetPlayer()) == player) // Client side
52 {
53 PPERequesterBank.GetRequester(PPERequester_BurlapSackEffects).Stop();
54 player.SetInventorySoftLock(false);
55 player.SetMasterAttenuation("");
56 }
57
58 if (g_Game.IsServer() || g_Game.IsMultiplayer()) // Server side or single player
59 SetInvisibleRecursive(false, player, {InventorySlots.MASK, InventorySlots.EYEWEAR});
60 }
61
62 override protected set<int> GetAttachmentExclusionInitSlotValue(int slotId)
63 {
64 set<int> ret = super.GetAttachmentExclusionInitSlotValue(slotId);
65 if (slotId == InventorySlots.HEADGEAR)
66 {
67 ret.Insert(EAttExclusions.SHAVING_HEADGEAR_ATT_0);
68 }
69 return ret;
70 }
71
72 protected void HandleAttachedToHead()
73 {
74 Class.CastTo(m_Player, GetHierarchyRootPlayer());
75 if (!m_Player)
76 return;
77
78 if (!g_Game.IsServer() || !g_Game.IsMultiplayer()) // Client side
79 {
80 if (m_Player && PlayerBase.Cast(g_Game.GetPlayer()) == m_Player)
81 {
82 PPERequesterBase ppeRB = PPERequesterBank.GetRequester(PPERequester_BurlapSackEffects);
83 if (ppeRB)
84 ppeRB.Start();
85
86 m_Player.SetInventorySoftLock(true);
87 m_Player.SetMasterAttenuation("BurlapSackAttenuation");
88
89 if (g_Game.GetUIManager().IsMenuOpen(MENU_INVENTORY))
90 g_Game.GetMission().HideInventory();
91 }
92 }
93
94 if (g_Game.IsServer() || g_Game.IsMultiplayer()) // Server side or single player
95 SetInvisibleRecursive(true, m_Player, {InventorySlots.MASK, InventorySlots.EYEWEAR});
96 }
97}
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
const int RF_DEFAULT
Определения CentralEconomy.c:65
DayZGame g_Game
Определения DayZGame.c:3942
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
Super root of all classes in Enforce script.
Определения EnScript.c:11
void OnRemovedFromHead(PlayerBase player)
Определения BurlapSackCover.c:49
void HandleAttachedToHead()
Определения BurlapSackCover.c:72
override void OnWasAttached(EntityAI parent, int slot_id)
Определения BurlapSackCover.c:25
set< int > GetAttachmentExclusionInitSlotValue(int slotId)
Определения BurlapSackCover.c:62
override bool CanDetachAttachment(EntityAI parent)
Определения BurlapSackCover.c:44
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
Определения BurlapSackCover.c:13
override bool CanPutInCargo(EntityAI parent)
Определения BurlapSackCover.c:33
void ~BurlapSackCover()
Определения BurlapSackCover.c:5
PlayerBase m_Player
Определения BurlapSackCover.c:3
hard helmet base
Определения BaseballCap_ColorBase.c:2
InventoryLocation.
Определения InventoryLocation.c:30
provides access to slot configuration
Определения InventorySlots.c:6
void Start(Param par=null)
Определения PPERequestPlatformsBase.c:38
Определения PlayerBaseClient.c:2
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
const int MENU_INVENTORY
Определения 3_Game/DayZ/constants.c:180
const int CALL_CATEGORY_SYSTEM
Определения 3_Game/DayZ/tools/tools.c:8