DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
TotemKit.c
См. документацию.
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
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 }
49
50 override void DisassembleKit(ItemBase item)
51 {
52 if (!IsHologram())
53 {
54 ItemBase stick = ItemBase.Cast(GetGame().CreateObjectEx("WoodenStick",GetPosition(),ECE_PLACE_ON_SURFACE));
55 MiscGameplayFunctions.TransferItemProperties(this, stick);
56 stick.SetQuantity(3);
57 Rope rope = Rope.Cast(item);
58 CreateRope(rope);
59 }
60 }
61
62 //================================================================
63 // DEBUG
64 //================================================================
65 //Debug menu Spawn Ground Special
66 override void OnDebugSpawn()
67 {
68 SpawnEntityOnGroundPos("SledgeHammer", GetPosition());
69 SpawnEntityOnGroundPos("Hammer", GetPosition());
70 SpawnEntityOnGroundPos("Shovel", GetPosition());
71
72 Nail nails = Nail.Cast(SpawnEntityOnGroundPos("Nail", GetPosition()));
73 nails.SetQuantity(60);
74 SpawnEntityOnGroundPos("Rope", GetPosition());
75 SpawnEntityOnGroundPos("MetalWire", GetPosition());
76 SpawnEntityOnGroundPos("Flag_DayZ", GetPosition());
77
78 for (int i0 = 0; i0 < 32; i0++)
79 {
80 SpawnEntityOnGroundPos("Stone", GetPosition());
81 }
82
83 for (int i1 = 0; i1 < 10; i1++)
84 {
85 SpawnEntityOnGroundPos("WoodenLog", GetPosition());
86 }
87 }
88}
const int ECE_PLACE_ON_SURFACE
Определения CentralEconomy.c:37
override bool IsHologram()
Определения ItemBase.c:5753
Определения Building.c:6
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Определения PileOfWoodenPlanks.c:88
Определения InventoryItem.c:731
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Определения TotemKit.c:18
override float HeightCheckOverride()
Определения TotemKit.c:13
override void DisassembleKit(ItemBase item)
Определения TotemKit.c:50
override void OnDebugSpawn()
Определения TotemKit.c:66
override bool PlacementCanBeRotated()
Определения TotemKit.c:3
override bool DoPlacingHeightCheck()
Определения TotemKit.c:8
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
Определения TotemKit.c:34
Определения FenceKit.c:2
Определения StaticFlagPole.c:28
Определения EnConvert.c:106
proto native CGame GetGame()
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9