DayZ 1.24
Loading...
Searching...
No Matches
TotemKit.c
Go to the documentation of this file.
1class 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
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
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 SpawnEntityOnGroundPos("Stone", GetPosition());
82
83 for (int i1 = 0; i1 < 10; i1++)
84 SpawnEntityOnGroundPos("WoodenLog", GetPosition());
85 }
86}
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)
Definition TotemKit.c:18
override float HeightCheckOverride()
Definition TotemKit.c:13
override void DisassembleKit(ItemBase item)
Definition TotemKit.c:52
override void OnDebugSpawn()
Definition TotemKit.c:68
override bool PlacementCanBeRotated()
Definition TotemKit.c:3
override bool DoPlacingHeightCheck()
Definition TotemKit.c:8
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
Definition TotemKit.c:34
proto native CGame GetGame()