DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
ShelterKit.c
См. документацию.
1class ShelterKit extends KitBase
2{
3 override bool CanReceiveAttachment(EntityAI attachment, int slotId)
4 {
5 if ( !super.CanReceiveAttachment(attachment, slotId) )
6 return false;
7
8 ItemBase att = ItemBase.Cast(GetInventory().FindAttachment(slotId));
9 if (att)
10 return false;
11
12 return true;
13 }
14
15 //================================================================
16 // ADVANCED PLACEMENT
17 //================================================================
18 override void OnPlacementComplete( Man player, vector position = "0 0 0", vector orientation = "0 0 0" )
19 {
20 super.OnPlacementComplete( player, position, orientation );
21
22 if ( GetGame().IsServer() )
23 {
24 //Create shelter site
25 ShelterSite site = ShelterSite.Cast( GetGame().CreateObjectEx( "ShelterSite", GetPosition(), ECE_PLACE_ON_SURFACE ) );
26 site.SetPosition( position );
27 site.SetOrientation( orientation );
28
29 //make the kit invisible, so it can be destroyed from deploy UA when action ends
30 HideAllSelections();
31 }
32 }
33
34 override bool DoPlacingHeightCheck()
35 {
36 return true;
37 }
38
39 override float HeightCheckOverride()
40 {
41 return 1.6;
42 }
43
44 override string GetPlaceSoundset()
45 {
46 return "Shelter_Site_Build_Start_SoundSet";
47 }
48
49 override string GetDeploySoundset()
50 {
51 return "Shelter_Site_Build_Finish_SoundSet";
52 }
53
54 override void DisassembleKit(ItemBase item)
55 {
56 if (!IsHologram())
57 {
58 ItemBase stick = ItemBase.Cast(GetGame().CreateObjectEx("WoodenStick",GetPosition(),ECE_PLACE_ON_SURFACE));
59 MiscGameplayFunctions.TransferItemProperties(this, stick);
60 stick.SetQuantity(4);
61 Rope rope = Rope.Cast(item);
62 CreateRope(rope);
63 }
64 }
65
66 //Debug menu Spawn Ground Special
67 override void OnDebugSpawn()
68 {
69 SpawnEntityOnGroundPos("Shovel", GetPosition());
70 SpawnEntityOnGroundPos("Hammer", GetPosition());
71 SpawnEntityOnGroundPos("Pliers", GetPosition());
72
73 for (int i0 = 0; i0 < 4; ++i0)
74 {
75 SpawnEntityOnGroundPos("LongWoodenStick", GetPosition());
76 }
77
78 for (int i1 = 0; i1 < 8; ++i1)
79 {
80 SpawnEntityOnGroundPos("TannedLeather", GetPosition());
81 }
82
83 for (int i2 = 0; i2 < 4; ++i2)
84 {
85 SpawnEntityOnGroundPos("Fabric", GetPosition());
86 }
87
88 for (int i3 = 0; i3 < 50; ++i3)
89 {
90 SpawnEntityOnGroundPos("WoodenStick", GetPosition());
91 }
92 }
93}
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
override bool IsHologram()
Определения ItemBase.c:5753
Определения Building.c:6
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Определения PileOfWoodenPlanks.c:88
Определения InventoryItem.c:731
override string GetPlaceSoundset()
Определения ShelterKit.c:44
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Определения ShelterKit.c:3
override string GetDeploySoundset()
Определения ShelterKit.c:49
override float HeightCheckOverride()
Определения ShelterKit.c:39
override void DisassembleKit(ItemBase item)
Определения ShelterKit.c:54
override void OnDebugSpawn()
Определения ShelterKit.c:67
override bool DoPlacingHeightCheck()
Определения ShelterKit.c:34
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
Определения ShelterKit.c:18
Определения FenceKit.c:2
Определения EnConvert.c:106
proto native CGame GetGame()
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9