Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
totemkit.c
Go to the documentation of this file.
1 class TerritoryFlagKit extends KitBase
2 {
3  override bool PlacementCanBeRotated()
4  {
5  return false;
6  }
7 
8  override bool DoPlacingHeightCheck()
9  {
10  return true;
11  }
12 
13  override float HeightCheckOverride()
14  {
15  return 11.3;
16  }
17 
18  override bool CanReceiveAttachment(EntityAI attachment, int slotId)
19  {
20  if ( !super.CanReceiveAttachment(attachment, slotId) )
21  return false;
22 
23  ItemBase att = ItemBase.Cast(GetInventory().FindAttachment(slotId));
24  if (att)
25  return false;
26 
27  return true;
28  }
29 
30  //================================================================
31  // ADVANCED PLACEMENT
32  //================================================================
33 
34  override void OnPlacementComplete( Man player, vector position = "0 0 0", vector orientation = "0 0 0" )
35  {
36  super.OnPlacementComplete( player, position, orientation );
37 
38  if ( GetGame().IsServer() )
39  {
40  //Create TerritoryFlag
41  TerritoryFlag totem = TerritoryFlag.Cast( GetGame().CreateObjectEx( "TerritoryFlag", GetPosition(), ECE_PLACE_ON_SURFACE ) );
42  totem.SetPosition( position );
43  totem.SetOrientation( orientation );
44 
45  //make the kit invisible, so it can be destroyed from deploy UA when action ends
46  HideAllSelections();
47 
48  SetIsDeploySound( true );
49  }
50  }
51 
52  override void DisassembleKit(ItemBase item)
53  {
54  if (!IsHologram())
55  {
56  ItemBase stick = ItemBase.Cast(GetGame().CreateObjectEx("WoodenStick",GetPosition(),ECE_PLACE_ON_SURFACE));
57  MiscGameplayFunctions.TransferItemProperties(this, stick);
58  stick.SetQuantity(3);
59  Rope rope = Rope.Cast(item);
60  CreateRope(rope);
61  }
62  }
63 
64  //================================================================
65  // DEBUG
66  //================================================================
67  //Debug menu Spawn Ground Special
68  override void OnDebugSpawn()
69  {
70  SpawnEntityOnGroundPos("SledgeHammer", GetPosition());
71  SpawnEntityOnGroundPos("Hammer", GetPosition());
72  SpawnEntityOnGroundPos("Shovel", GetPosition());
73 
74  Nail nails = Nail.Cast(SpawnEntityOnGroundPos("Nail", GetPosition()));
75  nails.SetQuantity(60);
76  SpawnEntityOnGroundPos("Rope", GetPosition());
77  SpawnEntityOnGroundPos("MetalWire", GetPosition());
78  SpawnEntityOnGroundPos("Flag_DayZ", GetPosition());
79 
80  for (int i0 = 0; i0 < 32; i0++)
81  {
82  SpawnEntityOnGroundPos("Stone", GetPosition());
83  }
84 
85  for (int i1 = 0; i1 < 10; i1++)
86  {
87  SpawnEntityOnGroundPos("WoodenLog", GetPosition());
88  }
89  }
90 }
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