DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
WatchtowerKit.c
См. документацию.
1class WatchtowerKit extends KitBase
2{
3 override bool CanReceiveAttachment(EntityAI attachment, int slotId)
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 }
31
32 override bool DoPlacingHeightCheck()
33 {
34 return true;
35 }
36
37 override float HeightCheckOverride()
38 {
39 return 2.83;//9.56;
40 }
41
42 override void DisassembleKit(ItemBase item)
43 {
44 if (!IsHologram())
45 {
46 ItemBase stick = ItemBase.Cast(GetGame().CreateObjectEx("WoodenStick",GetPosition(),ECE_PLACE_ON_SURFACE));
47 MiscGameplayFunctions.TransferItemProperties(this, stick);
48 stick.SetQuantity(4);
49 Rope rope = Rope.Cast(item);
50 CreateRope(rope);
51 }
52 }
53
54 //Debug menu Spawn Ground Special
55 override void OnDebugSpawn()
56 {
57 SpawnEntityOnGroundPos("Shovel", GetPosition());
58 SpawnEntityOnGroundPos("Hammer", GetPosition());
59 SpawnEntityOnGroundPos("Hammer", GetPosition());
60 SpawnEntityOnGroundPos("Hammer", GetPosition());
61 SpawnEntityOnGroundPos("Hammer", GetPosition());
62 SpawnEntityOnGroundPos("Pliers", GetPosition());
63
64 for (int i0 = 0; i0 < 30; i0++)
65 {
66 SpawnEntityOnGroundPos("WoodenPlank", GetPosition());
67 }
68
69 for (int i1 = 0; i1 < 10; i1++)
70 {
71 SpawnEntityOnGroundPos("WoodenLog", GetPosition());
72 }
73
74 for (int i2 = 0; i2 < 15; i2++)
75 {
76 SpawnEntityOnGroundPos("Nail", GetPosition());
77 }
78
79 for (int i3 = 0; i3 < 9; i3++)
80 {
81 SpawnEntityOnGroundPos("CamoNet", GetPosition());
82 }
83
84 for (int i4 = 0; i4 < 6; i4++)
85 {
86 SpawnEntityOnGroundPos("BarbedWire", GetPosition());
87 }
88 }
89}
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
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Определения BaseBuildingBase.c:962
Определения InventoryItem.c:731
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Определения WatchtowerKit.c:3
override float HeightCheckOverride()
Определения WatchtowerKit.c:37
override void DisassembleKit(ItemBase item)
Определения WatchtowerKit.c:42
override void OnDebugSpawn()
Определения WatchtowerKit.c:55
override bool DoPlacingHeightCheck()
Определения WatchtowerKit.c:32
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
Определения WatchtowerKit.c:16
Определения FenceKit.c:2
Определения EnConvert.c:106
proto native CGame GetGame()
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9