DayZ 1.24
Loading...
Searching...
No Matches
WatchtowerKit.c
Go to the documentation of this file.
1class WatchtowerKit extends KitBase
2{
4 {
5 ItemBase att = ItemBase.Cast(GetInventory().FindAttachment(slotId));
6 if (att)
7 return false;
8
9 return super.CanReceiveAttachment(attachment, slotId);
10 }
11
12 //================================================================
13 // ADVANCED PLACEMENT
14 //================================================================
15
16 override void OnPlacementComplete(Man player, vector position = "0 0 0", vector orientation = "0 0 0")
17 {
18 super.OnPlacementComplete(player, position, orientation);
19
20 if (GetGame().IsServer())
21 {
22 //Create watchtower
23 Watchtower watchtower = Watchtower.Cast(GetGame().CreateObjectEx("Watchtower", GetPosition(), ECE_PLACE_ON_SURFACE));
24 watchtower.SetPosition(position);
25 watchtower.SetOrientation(orientation);
26
27 //make the kit invisible, so it can be destroyed from deploy UA when action ends
28 HideAllSelections();
29
30 SetIsDeploySound(true);
31 }
32 }
33
34 override bool DoPlacingHeightCheck()
35 {
36 return true;
37 }
38
39 override float HeightCheckOverride()
40 {
41 return 2.83;//9.56;
42 }
43
45 {
46 if (!IsHologram())
47 {
48 ItemBase stick = ItemBase.Cast(GetGame().CreateObjectEx("WoodenStick", GetPosition(), ECE_PLACE_ON_SURFACE));
49 MiscGameplayFunctions.TransferItemProperties(this, stick);
50 stick.SetQuantity(4);
51 Rope rope = Rope.Cast(item);
52 CreateRope(rope);
53 }
54 }
55
56 //Debug menu Spawn Ground Special
57 override void OnDebugSpawn()
58 {
59 SpawnEntityOnGroundPos("Shovel", GetPosition());
60 SpawnEntityOnGroundPos("Hammer", GetPosition());
61 SpawnEntityOnGroundPos("Hammer", GetPosition());
62 SpawnEntityOnGroundPos("Hammer", GetPosition());
63 SpawnEntityOnGroundPos("Hammer", GetPosition());
64 SpawnEntityOnGroundPos("Pliers", GetPosition());
65
66 for (int i0 = 0; i0 < 30; i0++)
67 SpawnEntityOnGroundPos("WoodenPlank", GetPosition());
68
69 for (int i1 = 0; i1 < 10; i1++)
70 SpawnEntityOnGroundPos("WoodenLog", GetPosition());
71
72 for (int i2 = 0; i2 < 15; i2++)
73 SpawnEntityOnGroundPos("Nail", GetPosition());
74
75 for (int i3 = 0; i3 < 9; i3++)
76 SpawnEntityOnGroundPos("CamoNet", GetPosition());
77
78 for (int i4 = 0; i4 < 6; i4++)
79 SpawnEntityOnGroundPos("BarbedWire", GetPosition());
80 }
81}
const int ECE_PLACE_ON_SURFACE
void SetIsDeploySound(bool is_deploy_sound)
Definition ItemBase.c:8972
override bool IsHologram()
Definition ItemBase.c:5641
class JsonUndergroundAreaTriggerData GetPosition
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
override float HeightCheckOverride()
override void DisassembleKit(ItemBase item)
override void OnDebugSpawn()
override bool DoPlacingHeightCheck()
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
proto native CGame GetGame()