Dayz Explorer 1.28.160049
Loading...
Searching...
No Matches
shelterkit.c
Go to the documentation of this file.
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
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
Definition barbedwire.c:372
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
proto native CGame GetGame()
class JsonUndergroundAreaTriggerData GetPosition
class Hatchback_02_Blue extends Hatchback_02 OnDebugSpawn
string GetPlaceSoundset()
string GetDeploySoundset()
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Definition itembase.c:8990
override bool DoPlacingHeightCheck()