Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
fencekit.c
Go to the documentation of this file.
1 class FenceKit 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 
19  override void OnPlacementComplete( Man player, vector position = "0 0 0", vector orientation = "0 0 0" )
20  {
21  super.OnPlacementComplete( player, position, orientation );
22 
23  if ( GetGame().IsServer() )
24  {
25  //Create fence
26 
27  Fence fence = Fence.Cast( GetGame().CreateObjectEx( "Fence", GetPosition(), ECE_PLACE_ON_SURFACE ) );
28  fence.SetPosition( position );
29  fence.SetOrientation( orientation );
30 
31  //make the kit invisible, so it can be destroyed from deploy UA when action ends
32  HideAllSelections();
33 
34  SetIsDeploySound( true );
35  }
36  }
37 
38  override bool DoPlacingHeightCheck()
39  {
40  return true;
41  }
42 
43  override float HeightCheckOverride()
44  {
45  return 2.54;
46  }
47 
48  override void DisassembleKit(ItemBase item)
49  {
50  if (!IsHologram())
51  {
52  ItemBase stick = ItemBase.Cast(GetGame().CreateObjectEx("WoodenStick",GetPosition(),ECE_PLACE_ON_SURFACE));
53  MiscGameplayFunctions.TransferItemProperties(this, stick);
54  stick.SetQuantity(2);
55  Rope rope = Rope.Cast(item);
56  CreateRope(rope);
57  }
58  }
59 
60  //Debug menu Spawn Ground Special
61  override void OnDebugSpawn()
62  {
63  SpawnEntityOnGroundPos("Shovel", GetPosition());
64  SpawnEntityOnGroundPos("Hammer", GetPosition());
65  SpawnEntityOnGroundPos("Hammer", GetPosition());
66  SpawnEntityOnGroundPos("Pliers", GetPosition());
67 
68  SpawnEntityOnGroundPos("WoodenLog", GetPosition());
69  SpawnEntityOnGroundPos("WoodenLog", GetPosition());
70  SpawnEntityOnGroundPos("Nail", GetPosition());
71  SpawnEntityOnGroundPos("CamoNet", GetPosition());
72  SpawnEntityOnGroundPos("BarbedWire", GetPosition());
73  SpawnEntityOnGroundPos("BarbedWire", GetPosition());
74  SpawnEntityOnGroundPos("MetalWire", GetPosition());
75  SpawnEntityOnGroundPos("CombinationLock", GetPosition());
76  SpawnEntityOnGroundPos("WoodenPlank", GetPosition());
77  SpawnEntityOnGroundPos("WoodenPlank", GetPosition());
78  SpawnEntityOnGroundPos("WoodenPlank", GetPosition());
79  SpawnEntityOnGroundPos("WoodenPlank", GetPosition());
80  }
81 }
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
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
CanReceiveAttachment
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Definition: basebuildingbase.c:895
EntityAI
Definition: building.c:5