Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
shelterkit.c
Go to the documentation of this file.
1 class 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  SetIsDeploySound( true );
33  }
34  }
35 
36  override bool DoPlacingHeightCheck()
37  {
38  return true;
39  }
40 
41  override float HeightCheckOverride()
42  {
43  return 1.6;
44  }
45 
46  override string GetDeploySoundset()
47  {
48  return "Shelter_Site_Build_Start_SoundSet";
49  }
50 
51  override string GetLoopDeploySoundset()
52  {
53  return "Shelter_Site_Build_Loop_SoundSet";
54  }
55 
56  override string GetDeployFinishSoundset()
57  {
58  return "Shelter_Site_Build_Finish_SoundSet";
59  }
60 
61  override void DisassembleKit(ItemBase item)
62  {
63  if (!IsHologram())
64  {
65  ItemBase stick = ItemBase.Cast(GetGame().CreateObjectEx("WoodenStick",GetPosition(),ECE_PLACE_ON_SURFACE));
66  MiscGameplayFunctions.TransferItemProperties(this, stick);
67  stick.SetQuantity(4);
68  Rope rope = Rope.Cast(item);
69  CreateRope(rope);
70  }
71  }
72 
73  //Debug menu Spawn Ground Special
74  override void OnDebugSpawn()
75  {
76  SpawnEntityOnGroundPos("Shovel", GetPosition());
77  SpawnEntityOnGroundPos("Hammer", GetPosition());
78  SpawnEntityOnGroundPos("Pliers", GetPosition());
79 
80  for (int i0 = 0; i0 < 4; ++i0)
81  {
82  SpawnEntityOnGroundPos("LongWoodenStick", GetPosition());
83  }
84 
85  for (int i1 = 0; i1 < 8; ++i1)
86  {
87  SpawnEntityOnGroundPos("TannedLeather", GetPosition());
88  }
89 
90  for (int i2 = 0; i2 < 4; ++i2)
91  {
92  SpawnEntityOnGroundPos("Fabric", GetPosition());
93  }
94 
95  for (int i3 = 0; i3 < 50; ++i3)
96  {
97  SpawnEntityOnGroundPos("WoodenStick", GetPosition());
98  }
99  }
100 }
ItemBase
Definition: inventoryitem.c:730
GetGame
proto native CGame GetGame()
KitBase
Definition: fencekit.c:1
DoPlacingHeightCheck
override bool DoPlacingHeightCheck()
Definition: trap_smallfish.c:186
SetIsDeploySound
void SetIsDeploySound(bool is_deploy_sound)
Definition: itembase.c:4293
ECE_PLACE_ON_SURFACE
const int ECE_PLACE_ON_SURFACE
Definition: centraleconomy.c:37
OnPlacementComplete
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
Definition: explosivesbase.c:133
GetLoopDeploySoundset
override string GetLoopDeploySoundset()
Definition: largetent.c:151
OnDebugSpawn
class Hatchback_02_Blue extends Hatchback_02 OnDebugSpawn
Definition: hatchback_02.c:404
GetPosition
class JsonUndergroundAreaTriggerData GetPosition
Definition: undergroundarealoader.c:9
vector
Definition: enconvert.c:105
IsHologram
override bool IsHologram()
Definition: itembase.c:962
GetDeployFinishSoundset
string GetDeployFinishSoundset()
CanReceiveAttachment
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Definition: basebuildingbase.c:895
GetDeploySoundset
override string GetDeploySoundset()
Definition: largetent.c:146
EntityAI
Definition: building.c:5