DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
Fence.c
См. документацию.
2{
3 const int GATE_STATE_NONE = 0;
4 const int GATE_STATE_PARTIAL = 1;
5 const int GATE_STATE_FULL = 2;
6
7 const string ATTACHMENT_SLOT_COMBINATION_LOCK = "Att_CombinationLock";
8 const string SOUND_GATE_OPEN_START = "DoorWoodTowerOpen_SoundSet";
9 const string SOUND_GATE_CLOSE_START = "DoorWoodTowerClose_start_SoundSet";
10 const string SOUND_GATE_CLOSE_END = "DoorWoodTowerClose_end_SoundSet";
11
12 //gate openining
13 const float GATE_ROTATION_ANGLE_DEG = 100;
14 const float GATE_ROTATION_TIME_APPROX = 2000; //ms
15
16 const float MAX_ACTION_DETECTION_ANGLE_RAD = 1.3; //1.3 RAD = ~75 DEG
17 const float MAX_ACTION_DETECTION_DISTANCE = 2.0; //meters
18
19 typename ATTACHMENT_WOODEN_LOG = WoodenLog;
21
22 string ATTSLOT_CAMONET = "Wall_Camonet";
23 string ATTSLOT_BARBEDWIRE_DOWN = "Wall_Barbedwire_1";
24 string ATTSLOT_BARBEDWIRE_UP = "Wall_Barbedwire_2";
25
26 //protected bool m_HasHinges = false;
27 //protected bool m_GateFullyConstructed = false;
28 protected bool m_ToDiscard = false; //for legacy OnStoreLoad handling
29 protected bool m_IsOpened = false;
30 protected bool m_IsOpenedClient = false;
31 protected int m_GateState = 0;
32
35
36 void Fence()
37 {
38 //synchronized variables
39 //RegisterNetSyncVariableBool( "m_HasHinges" );
40 //RegisterNetSyncVariableBool( "m_GateFullyConstructed" );
41 RegisterNetSyncVariableBool( "m_IsOpened" );
42 RegisterNetSyncVariableInt( "m_GateState" );
43 }
44
45 override string GetConstructionKitType()
46 {
47 return "FenceKit";
48 }
49
50 override int GetMeleeTargetType()
51 {
52 return EMeleeTargetType.NONALIGNABLE;
53 }
54
55 //Gate
56 bool HasHinges()
57 {
59 }
60
62 {
64 }
65
66 void SetGateState( int state )
67 {
68 m_GateState = state;
69 SetSynchDirty();
70 }
71
73 {
74 return m_GateState;
75 }
76
78 {
79 ConstructionPart gate_part = GetConstruction().GetGateConstructionPart();
80 int state = GATE_STATE_NONE;
81 if( gate_part.IsBuilt() )
82 {
83 ConstructionPart req_part;
84 array<string> req_parts = gate_part.GetRequiredParts();
85 for (int i = 0; i < req_parts.Count(); i++)
86 {
87 req_part = GetConstruction().GetConstructionPart(req_parts.Get(i));
88 if(!req_part.IsBuilt())
89 break;
90 }
91
92 if( i != req_parts.Count() )
93 {
94 state = GATE_STATE_PARTIAL;
95 }
96 else
97 {
98 state = GATE_STATE_FULL;
99 }
100
101 }
102 return state;
103 }
104
105 void SetOpenedState( bool state )
106 {
107 m_IsOpened = state;
108 }
109
110 override bool IsOpened()
111 {
112 return m_IsOpened;
113 }
114
115 bool IsLocked()
116 {
117 CombinationLock combination_lock = GetCombinationLock();
118 if ( combination_lock && combination_lock.IsLocked() )
119 {
120 return true;
121 }
122
123 return false;
124 }
125
126 override bool NameOverride(out string output)
127 {
129 {
130 output = "#str_cfgvehicles_construction_part_gate"; //changes object displayed name if in 'gate' state
131 output.ToUpper();
132 return true;
133 }
134 return false;
135 }
136//
138 {
139 CombinationLock combination_lock = CombinationLock.Cast( FindAttachmentBySlotName( ATTACHMENT_SLOT_COMBINATION_LOCK ) );
140 return combination_lock;
141 }
142
143 CamoNet GetCamoNet()
144 {
145 CamoNet camonet = CamoNet.Cast( FindAttachmentBySlotName( "Wall_Camonet" ) );
146 return camonet;
147 }
148
149 BarbedWire GetBarbedWire1()
150 {
151 BarbedWire barbedwire = BarbedWire.Cast( FindAttachmentBySlotName( "Wall_Barbedwire_1" ) );
152 return barbedwire;
153 }
154
155 BarbedWire GetBarbedWire2()
156 {
157 BarbedWire barbedwire = BarbedWire.Cast( FindAttachmentBySlotName( "Wall_Barbedwire_2" ) );
158 return barbedwire;
159 }
160
161 //--- CONSTRUCTION KIT
163 {
164 if ( MemoryPointExists( "kit_spawn_position" ) )
165 {
166 vector position;
167 position = GetMemoryPointPos( "kit_spawn_position" );
168
169 return ModelToWorld( position );
170 }
171
172 return GetPosition();
173 }
174
175 // --- INVENTORY
176 override bool CanDisplayAttachmentSlot( int slot_id )
177 {
178 if (!super.CanDisplayAttachmentSlot(slot_id))
179 return false;
180
181 string slot_name = InventorySlots.GetSlotName(slot_id);
182
183 if ( slot_name == "Att_CombinationLock" )
184 {
186 {
187 return false;
188 }
189 }
190
192 return false;
193
194 return true;
195 }
196
197 override bool CanDisplayAttachmentCategory( string category_name )
198 {
199 if ( category_name == "Attachments" || category_name == "Material" )
200 {
201 if ( !HasBase() )
202 {
203 return false;
204 }
205 }
206
207 return true;
208 }
209 // ---
210
211 // --- EVENTS
212 override void OnStoreSave( ParamsWriteContext ctx )
213 {
214 super.OnStoreSave( ctx );
215
216 //write
217 ctx.Write( m_GateState );
218 ctx.Write( m_IsOpened );
219 if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] OnStoreSave - build=" + m_GateState + " opened=" + m_IsOpened);
220 }
221
222 override bool OnStoreLoad( ParamsReadContext ctx, int version )
223 {
224 if ( !super.OnStoreLoad( ctx, version ) )
225 return false;
226
227 //--- Fence data ---
228 //has gate
229 if (version < 110)
230 {
231 if ( !ctx.Read( m_ToDiscard ) )
232 {
233 m_ToDiscard = false;
234 return false;
235 }
237 }
238 else if ( !ctx.Read( m_GateState ) )
239 {
241 return false;
242 }
243
244 //is opened
245 if ( !ctx.Read( m_IsOpened ) )
246 {
247 m_IsOpened = false;
248 return false;
249 }
250
251 if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] OnStoreLoad - build=" + m_GateState + " opened=" + m_IsOpened);
252 //---
253
254 return true;
255 }
256
257 override void AfterStoreLoad()
258 {
259 super.AfterStoreLoad();
260
261 //set gate state
262 ConstructionPart gate_part = GetConstruction().GetGateConstructionPart();
264
265 //update gate state visual
266 if ( IsOpened() )
267 {
268 OpenFence();
269 }
270
272
273 if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] AfterStoreLoad - build=" + gate_part.IsBuilt() + " opened=" + IsOpened());
274 }
275
277 {
278 super.OnVariablesSynchronized();
279
281 {
283
284 if ( m_IsOpenedClient )
285 {
286 OpenFence();
287 }
288 else
289 {
290 CloseFence();
291 }
292 }
293 }
294
295 //--- BUILD EVENTS
296 //CONSTRUCTION EVENTS
297 override void OnPartBuiltServer( notnull Man player, string part_name, int action_id )
298 {
299 ConstructionPart constrution_part = GetConstruction().GetConstructionPart( part_name );
300
301 super.OnPartBuiltServer( player, part_name, action_id );
302
304
305 //update visuals (server)
307 }
308
309 override void OnPartDismantledServer( notnull Man player, string part_name, int action_id )
310 {
311 ConstructionPart constrution_part = GetConstruction().GetConstructionPart( part_name );
312
313 //check gate state
314 if ( constrution_part.IsGate() )
315 {
316 if ( IsLocked() )
317 {
318 CombinationLock combination_lock = CombinationLock.Cast( FindAttachmentBySlotName( ATTACHMENT_SLOT_COMBINATION_LOCK ) );
319 combination_lock.UnlockServer( player , this );
320 }
321 }
322
323 super.OnPartDismantledServer( player, part_name, action_id );
324
326
327 //update visuals (server)
329 }
330
331 override void OnPartDestroyedServer( Man player, string part_name, int action_id, bool destroyed_by_connected_part = false )
332 {
333 super.OnPartDestroyedServer( player, part_name, action_id );
334
335 //check gate state
336 ConstructionPart constrution_part = GetConstruction().GetConstructionPart( part_name );
337 if ( constrution_part.IsGate() && destroyed_by_connected_part ) //avoids attachment dropping on regular hinges destruction
338 {
339 //drop regular attachments
344
345 //rotate back to place
346 if ( IsOpened() )
347 CloseFence();
348 }
349 if ( part_name == "wall_base_down" )
350 {
353 }
354 if ( part_name == "wall_base_up" )
355 {
359 }
360
362 //update visuals (server)
364 }
365
366 //--- ATTACHMENT & CONDITIONS
367 override bool CanReceiveAttachment( EntityAI attachment, int slotId )
368 {
369 if ( !super.CanReceiveAttachment(attachment, slotId) )
370 return false;
371
372 //manage action initiator (AT_ATTACH_TO_CONSTRUCTION)
373 if ( !GetGame().IsDedicatedServer() )
374 {
375 PlayerBase player = PlayerBase.Cast( GetGame().GetPlayer() );
376 if ( player )
377 {
378 ConstructionActionData construction_action_data = player.GetConstructionActionData();
379
380 //reset action initiator
381 construction_action_data.SetActionInitiator( NULL );
382 }
383 }
384
385 //conditions
386 if ( attachment.Type() != ATTACHMENT_WOODEN_LOG )
387 {
388 if ( !HasBase() )
389 {
390 return false;
391 }
392 }
393
394 if ( attachment.IsInherited( ATTACHMENT_COMBINATION_LOCK ) )
395 {
396 return ( HasFullyConstructedGate() && !IsOpened() );
397 }
398
399 if ( !GateAttachmentConditions(slotId) )
400 return false;
401
402 return true;
403 }
404
405 //hands
406 override bool CanPutIntoHands( EntityAI parent )
407 {
408 if( !super.CanPutIntoHands( parent ) )
409 {
410 return false;
411 }
412
413 if ( HasBase() )
414 {
415 return false;
416 }
417
418 return true;
419 }
420
422 {
423 return true;
424 }
425
426 //--- OPEN/CLOSE ACTIONS
428 {
429 if ( HasHinges() && !IsOpened() && !IsLocked() )
430 {
431 return true;
432 }
433
434 return false;
435 }
436
438 {
439 if ( HasHinges() && IsOpened() )
440 {
441 return true;
442 }
443
444 return false;
445 }
446
448 {
449 //server or single player
450 if ( GetGame().IsServer() )
451 {
452 float value = GATE_ROTATION_ANGLE_DEG;
453 SetAnimationPhase( "Wall_Interact_Rotate", value );
454 SetAnimationPhase( "Wall_Barbedwire_1_Mounted_Rotate", value );
455 SetAnimationPhase( "Wall_Barbedwire_2_Mounted_Rotate", value );
456 SetAnimationPhase( "Wall_Camonet_Rotate", value );
457 SetAnimationPhase( "Wall_Gate_Rotate", value );
458 SetAnimationPhase( "Wall_Base_Down_Rotate", value );
459 SetAnimationPhase( "Wall_Base_Up_Rotate", value );
460 SetAnimationPhase( "Wall_Wood_Down_Rotate", value );
461 SetAnimationPhase( "Wall_Wood_Up_Rotate", value );
462 SetAnimationPhase( "Wall_Metal_Down_Rotate", value );
463 SetAnimationPhase( "Wall_Metal_Up_Rotate", value );
464
465 SetOpenedState( true );
466
467 //regenerate navmesh
469
470 //synchronize
472 }
473
474 //client or single player
475 if ( !GetGame().IsDedicatedServer() )
476 {
477 //play sound
479 }
480
481 //remove BarbedWire AreaDamageTrigger
483
484 //add check
487 }
488
490 {
491 //server or single player
492 if ( GetGame().IsServer() )
493 {
494 float value = 0;
495 SetAnimationPhase( "Wall_Interact_Rotate", value );
496 SetAnimationPhase( "Wall_Barbedwire_1_Mounted_Rotate", value );
497 SetAnimationPhase( "Wall_Barbedwire_2_Mounted_Rotate", value );
498 SetAnimationPhase( "Wall_Camonet_Rotate", value );
499 SetAnimationPhase( "Wall_Gate_Rotate", value );
500 SetAnimationPhase( "Wall_Base_Down_Rotate", value );
501 SetAnimationPhase( "Wall_Base_Up_Rotate", value );
502 SetAnimationPhase( "Wall_Wood_Down_Rotate", value );
503 SetAnimationPhase( "Wall_Wood_Up_Rotate", value );
504 SetAnimationPhase( "Wall_Metal_Down_Rotate", value );
505 SetAnimationPhase( "Wall_Metal_Up_Rotate", value );
506
507 SetOpenedState( false );
508
509 //regenerate navmesh
511
512 //synchronize
514 }
515
516 //client or single player
517 if ( !GetGame().IsDedicatedServer() )
518 {
519 //play sound
521 }
522
523 //remove BarbedWire AreaDamageTrigger
525
526 //add check
529 }
530
531 protected void CheckFenceOpened()
532 {
533 if ( GetAnimationPhase( "Wall_Gate_Rotate" ) == GATE_ROTATION_ANGLE_DEG ) //animation finished - open
534 {
535 UpdateBarbedWireAreaDamagePos(GetAnimationPhase( "Wall_Gate_Rotate" ));
536 //remove check
538 }
539 }
540
541 protected void CheckFenceClosed()
542 {
543 if ( GetAnimationPhase( "Wall_Gate_Rotate" ) == 0 ) //animation finished - closed
544 {
545 //client or single player
546 if ( !GetGame().IsDedicatedServer() )
547 {
548 //play sound
549 if ( this ) SoundGateCloseEnd();
550 }
551 UpdateBarbedWireAreaDamagePos(GetAnimationPhase( "Wall_Gate_Rotate" ));
552 //remove check
554 }
555 }
556
557 //Damage triggers
558 override void CreateAreaDamage( string slot_name, float rotation_angle = 0 )
559 {
560 if ( IsOpened() )
561 {
562 rotation_angle = 100;
563 }
564
565 super.CreateAreaDamage( slot_name, rotation_angle );
566 }
567
568 //BarbedWire update
569 void UpdateBarbedWireAreaDamagePos(float rotation_angle = 0, bool to_delete = false )
570 {
571 int slot_id;
572 string slot_name;
573 string slot_name_mounted;
574 if ( GetBarbedWire1() && GetBarbedWire1().IsMounted() )
575 {
576 GetBarbedWire1().GetInventory().GetCurrentAttachmentSlotInfo(slot_id,slot_name);
577 slot_name_mounted = slot_name + "_Mounted";
578 if (to_delete)
579 {
580 DestroyAreaDamage( slot_name_mounted );
581 }
582 else
583 {
584 super.CreateAreaDamage( slot_name_mounted, rotation_angle );
585 }
586 }
587 if ( GetBarbedWire2() && GetBarbedWire2().IsMounted() )
588 {
589 GetBarbedWire2().GetInventory().GetCurrentAttachmentSlotInfo(slot_id,slot_name);
590 slot_name_mounted = slot_name + "_Mounted";
591 if (to_delete)
592 {
593 DestroyAreaDamage( slot_name_mounted );
594 }
595 else
596 {
597 super.CreateAreaDamage( slot_name_mounted, rotation_angle );
598 }
599 }
600 }
601
602 //Here deal damage to BarbedWire when entity taking damage from it
603 override void PostAreaDamageActions()
604 {
605 /*if (GetBarbedWire1())
606 {
607 //DecreaseHealth("Wall_BarbedWire_1", "", 1000); //why no dmg to wire???
608 //BarbedWire wire = GetBarbedWire1();
609 //wire.PostAreaDamageActions();
610 //Print(GetHealth("BarbedWire1", ""));
611 }*/
612 }
613
614 //--- ACTION CONDITIONS
615 override bool IsPlayerInside( PlayerBase player, string selection )
616 {
617 vector player_pos = player.GetPosition();
618 vector fence_pos = GetPosition();
619 vector ref_dir = GetDirection();
620 ref_dir[1] = 0;
621 ref_dir.Normalize();
622
623 vector x[2];
624 vector b1,b2;
625 GetCollisionBox(x);
626 b1 = x[0];
627 b2 = x[1];
628
629 vector dir_to_fence = fence_pos - player_pos;
630 dir_to_fence[1] = 0;
631 float len = dir_to_fence.Length();
632
633 dir_to_fence.Normalize();
634
635 vector ref_dir_angle = ref_dir.VectorToAngles();
636 vector dir_to_fence_angle = dir_to_fence.VectorToAngles();
637 vector test_angles = dir_to_fence_angle - ref_dir_angle;
638
639 vector test_position = test_angles.AnglesToVector() * len;
640
641 if(test_position[0] < b1[0] || test_position[0] > b2[0] || test_position[2] < 0.2 || test_position[2] > 2.2 )
642 {
643 return false;
644 }
645 else
646 {
647 return true;
648 }
649 }
650
651 override bool IsFacingPlayer( PlayerBase player, string selection )
652 {
653 vector fence_pos = GetPosition();
654 vector player_pos = player.GetPosition();
655 vector ref_dir = GetDirection();
656
657 //vector fence_player_dir = player_pos - fence_pos;
658 vector fence_player_dir = player.GetDirection();
659 fence_player_dir.Normalize();
660 fence_player_dir[1] = 0; //ignore height
661
662 ref_dir.Normalize();
663 ref_dir[1] = 0; //ignore height
664
665 if ( ref_dir.Length() != 0 )
666 {
667 float angle = Math.Acos( fence_player_dir * ref_dir );
668
669 if ( angle >= MAX_ACTION_DETECTION_ANGLE_RAD )
670 {
671 return true;
672 }
673 }
674
675 return false;
676 }
677
678 override bool IsFacingCamera( string selection )
679 {
680 vector ref_dir = GetDirection();
682
683 //ref_dir = GetGame().GetCurrentCameraPosition() - GetPosition();
684 ref_dir.Normalize();
685 ref_dir[1] = 0; //ignore height
686
687 cam_dir.Normalize();
688 cam_dir[1] = 0; //ignore height
689
690 if ( ref_dir.Length() != 0 )
691 {
692 float angle = Math.Acos( cam_dir * ref_dir );
693
694 if ( angle >= MAX_ACTION_DETECTION_ANGLE_RAD )
695 {
696 return true;
697 }
698 }
699
700 return false;
701 }
702
703 override bool HasProperDistance( string selection, PlayerBase player )
704 {
705 if ( MemoryPointExists( selection ) )
706 {
707 vector selection_pos = ModelToWorld( GetMemoryPointPos( selection ) );
708 float distance = vector.Distance( selection_pos, player.GetPosition() );
709 if ( distance >= MAX_ACTION_DETECTION_DISTANCE )
710 {
711 return false;
712 }
713 }
714
715 return true;
716 }
717
719 {
720 return !IsOpened();
721 }
722
723 //================================================================
724 // SOUNDS
725 //================================================================
726 protected void SoundGateOpenStart()
727 {
728 //client or single player
729 if ( !GetGame().IsDedicatedServer() )
730 {
731 PlaySoundSet( m_SoundGate_Start, SOUND_GATE_OPEN_START, 0.1, 0.1 );
732 }
733 }
734
735 protected void SoundGateCloseStart()
736 {
737 //client or single player
738 if ( !GetGame().IsDedicatedServer() )
739 {
740 PlaySoundSet( m_SoundGate_Start, SOUND_GATE_CLOSE_START, 0.1, 0.1 );
741 }
742 }
743
744 protected void SoundGateCloseEnd()
745 {
746 //client or single player
747 if ( !GetGame().IsDedicatedServer() )
748 {
749 PlaySoundSet( m_SoundGate_End, SOUND_GATE_CLOSE_END, 0.1, 0.1 );
750 }
751 }
752
754 {
755 ConstructionPart wall_base_down = GetConstruction().GetConstructionPart("wall_base_down");
756 ConstructionPart wall_base_up = GetConstruction().GetConstructionPart("wall_base_up");
757 if(GetBarbedWire1() && !wall_base_down.IsBuilt())
758 {
761 }
762 if( ( GetCamoNet() || GetBarbedWire2() ) && !wall_base_up.IsBuilt() )
763 {
767 }
768 }
769
771 {
772 BarbedWire wire;
773 CombinationLock lock;
774 if (Class.CastTo(wire,item)) //special barbed wire beh.
775 {
776 wire.SetMountedState( false );
777 GetInventory().DropEntity(InventoryMode.SERVER, this, wire);
778 }
779 else if (Class.CastTo(lock,item))
780 {
781 lock.UnlockServer(null,this);
782 }
783 else if (item)//generic behaviour
784 {
785 GetInventory().DropEntity(InventoryMode.SERVER, this, item);
786 }
787 }
788
790 {
792 {
793 ConstructionPart wall_base_down = GetConstruction().GetConstructionPart("wall_base_down");
794 ConstructionPart wall_base_up = GetConstruction().GetConstructionPart("wall_base_up");
795 string slot_name = InventorySlots.GetSlotName(slotId);
796 if ( !wall_base_up.IsBuilt() )
797 {
798 if ( slot_name == ATTSLOT_CAMONET || slot_name == ATTSLOT_BARBEDWIRE_UP )
799 {
800 return false;
801 }
802 }
803 if ( !wall_base_down.IsBuilt() )
804 {
805 if ( slot_name == ATTSLOT_BARBEDWIRE_DOWN )
806 {
807 return false;
808 }
809 }
810 }
811 return true;
812 }
813
814 //specific selection for camonet attaching (other ones might be animated via rotation!)
815 override bool TranslateSlotFromSelection(string selection_name, out int slot_id)
816 {
817 if ( selection_name == "wall_camonet_attach" )
818 {
819 slot_id = InventorySlots.GetSlotIdFromString("Wall_Camonet");
820 return true;
821 }
822 return false;
823 }
824
825 override void SetActions()
826 {
827 super.SetActions();
828
832 //AddAction(ActionDialCombinationLockOnTarget);
833 //AddAction(ActionNextCombinationLockDialOnTarget);
836 }
837
838 //================================================================
839 // DEBUG
840 //================================================================
841 /*
842 override void DebugCustomState()
843 {
844 //debug
845 m_SyncParts01 = 881; //full fence with gate
846 m_HasHinges = true;
847 m_HasBase = true;
848
849 OnVariablesSynchronized();
850 }
851 */
852
855 {
856 array<string> excludes = {};
857
858 #ifdef DIAG_DEVELOPER
859 bool bWood = DiagMenu.GetBool(DiagMenuIDs.BASEBUILDING_WOOD);
860 #else
861 bool bWood = false;
862 #endif
863
864 if (bWood)
865 {
866 excludes.Insert("_metal_");
867 }
868 else
869 {
870 excludes.Insert("_wood_");
871 }
872
873 #ifdef DIAG_DEVELOPER
874 bool bGate = DiagMenu.GetBool(DiagMenuIDs.BASEBUILDING_GATE);
875 #else
876 bool bGate = false;
877 #endif
878
879 if (bGate)
880 {
881 excludes.Insert("platform");
882 }
883 else
884 {
885 excludes.Insert("gate");
886 }
887
888 return excludes;
889 }
890
891 //Debug menu Spawn Ground Special
892 override void OnDebugSpawn()
893 {
894 super.OnDebugSpawn();
895
896 GetInventory().CreateInInventory("CamoNet");
897
898 for (int i = 0; i < 2; ++i)
899 {
900 BarbedWire wire = BarbedWire.Cast(GetInventory().CreateInInventory("BarbedWire"));
901 wire.SetMountedState(true);
902 }
903 }
904}
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Определения Inventory.c:22
ActionFoldBaseBuildingObjectCB ActionContinuousBaseCB ActionFoldBaseBuildingObject()
Определения ActionFoldBaseBuildingObject.c:11
ActionPlaceObjectCB ActiondeployObjectCB ActionPlaceObject()
Определения ActionPlaceObject.c:11
void AddAction(typename actionName)
Определения AdvancedCommunication.c:220
void UpdateNavmesh()
Определения BaseBuildingBase.c:2174
Construction GetConstruction()
Определения BaseBuildingBase.c:2244
class BaseBuildingBase extends ItemBase bsbDebugPrint(string s)
Определения BaseBuildingBase.c:1292
bool HasBase()
Определения BaseBuildingBase.c:1620
void SynchronizeBaseState()
Определения BaseBuildingBase.c:1384
DiagMenuIDs
Определения EDiagMenuIDs.c:2
EMeleeTargetType
Определения EMeleeTargetType.c:2
void DestroyAreaDamage()
Определения FireplaceBase.c:2338
Icon x
PlayerBase GetPlayer()
Определения ModifierBase.c:51
Определения ActionOpenFence.c:2
override bool CanDisplayAttachmentCategory(string category_name)
Определения Fence.c:197
bool HasHinges()
Определения Fence.c:56
override void PostAreaDamageActions()
Определения Fence.c:603
override void OnDebugSpawn()
Определения Fence.c:892
override bool IsPlayerInside(PlayerBase player, string selection)
Определения Fence.c:615
override void OnVariablesSynchronized()
Определения Fence.c:276
override bool TranslateSlotFromSelection(string selection_name, out int slot_id)
Определения Fence.c:815
void SetOpenedState(bool state)
Определения Fence.c:105
void Fence()
Определения Fence.c:36
override bool CanDisplayAttachmentSlot(int slot_id)
Определения Fence.c:176
EffectSound m_SoundGate_Start
Определения Fence.c:33
override string GetConstructionKitType()
Определения Fence.c:45
const string SOUND_GATE_CLOSE_END
Определения Fence.c:10
ATTACHMENT_COMBINATION_LOCK
Определения Fence.c:20
void CloseFence()
Определения Fence.c:489
void SetGateState(int state)
Определения Fence.c:66
bool m_IsOpenedClient
Определения Fence.c:30
override bool IsOpened()
Определения Fence.c:110
override bool NameOverride(out string output)
Определения Fence.c:126
bool IsLocked()
Определения Fence.c:115
const int GATE_STATE_NONE
Определения Fence.c:3
string ATTSLOT_BARBEDWIRE_DOWN
Определения Fence.c:23
override bool CanPutIntoHands(EntityAI parent)
Определения Fence.c:406
override array< string > OnDebugSpawnBuildExcludes()
Excludes certain parts from being built by OnDebugSpawn, uses Contains to compare.
Определения Fence.c:854
override void UpdateVisuals()
Определения Watchtower.c:44
void GateAttachmentsSanityCheck()
Определения Fence.c:753
const float GATE_ROTATION_ANGLE_DEG
Определения Fence.c:13
string ATTSLOT_BARBEDWIRE_UP
Определения Fence.c:24
void SoundGateOpenStart()
Определения Fence.c:726
const string SOUND_GATE_CLOSE_START
Определения Fence.c:9
override void OnPartBuiltServer(notnull Man player, string part_name, int action_id)
Определения Fence.c:297
bool HasFullyConstructedGate()
Определения Fence.c:61
bool GateAttachmentConditions(int slotId)
Определения Fence.c:789
EffectSound m_SoundGate_End
Определения Fence.c:34
override void SetActions()
Определения Fence.c:825
const float GATE_ROTATION_TIME_APPROX
Определения Fence.c:14
const int GATE_STATE_FULL
Определения Fence.c:5
ATTACHMENT_WOODEN_LOG
Определения Fence.c:19
void HandleDropAttachment(ItemBase item)
Определения Fence.c:770
bool m_IsOpened
Определения Fence.c:29
bool m_ToDiscard
Определения Fence.c:28
void CheckFenceClosed()
Определения Fence.c:541
void SoundGateCloseStart()
Определения Fence.c:735
const float MAX_ACTION_DETECTION_ANGLE_RAD
Определения Fence.c:16
CamoNet GetCamoNet()
Определения Fence.c:143
override bool IsFacingCamera(string selection)
Определения Fence.c:678
override bool IsFacingPlayer(PlayerBase player, string selection)
Определения Fence.c:651
const float MAX_ACTION_DETECTION_DISTANCE
Определения Fence.c:17
override void AfterStoreLoad()
Определения Fence.c:257
override bool CanUseConstructionBuild()
Определения Fence.c:718
override bool OnStoreLoad(ParamsReadContext ctx, int version)
Определения Fence.c:222
void CheckFenceOpened()
Определения Fence.c:531
override int GetMeleeTargetType()
Определения Fence.c:50
bool CanCloseFence()
Определения Fence.c:437
override bool HasProperDistance(string selection, PlayerBase player)
Определения Fence.c:703
BarbedWire GetBarbedWire1()
Определения Fence.c:149
int GetGateState()
Определения Fence.c:72
bool CanOpenFence()
Определения Fence.c:427
void OpenFence()
Определения Fence.c:447
const string ATTACHMENT_SLOT_COMBINATION_LOCK
Определения Fence.c:7
CombinationLock GetCombinationLock()
Определения Fence.c:137
override void OnPartDestroyedServer(Man player, string part_name, int action_id, bool destroyed_by_connected_part=false)
Определения Fence.c:331
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Определения Fence.c:367
override void OnStoreSave(ParamsWriteContext ctx)
Определения Fence.c:212
void UpdateBarbedWireAreaDamagePos(float rotation_angle=0, bool to_delete=false)
Определения Fence.c:569
const string SOUND_GATE_OPEN_START
Определения Fence.c:8
override vector GetKitSpawnPosition()
Определения Fence.c:162
void SoundGateCloseEnd()
Определения Fence.c:744
override bool CanBeRepairedToPristine()
Определения Fence.c:421
const int GATE_STATE_PARTIAL
Определения Fence.c:4
int m_GateState
Определения Fence.c:31
int CheckGateState()
Определения Fence.c:77
override void CreateAreaDamage(string slot_name, float rotation_angle=0)
Определения Fence.c:558
override void OnPartDismantledServer(notnull Man player, string part_name, int action_id)
Определения Fence.c:309
BarbedWire GetBarbedWire2()
Определения Fence.c:155
string ATTSLOT_CAMONET
Определения Fence.c:22
Определения Fence.c:2
override ScriptCallQueue GetCallQueue(int call_category)
Определения DayZGame.c:1187
proto native vector GetCurrentCameraDirection()
Super root of all classes in Enforce script.
Определения EnScript.c:11
void SetActionInitiator(PlayerBase action_initiator)
Определения ConstructionActionData.c:108
bool IsGate()
Определения ConstructionPart.c:70
bool IsBuilt()
Определения ConstructionPart.c:45
array< string > GetRequiredParts()
Определения ConstructionPart.c:75
Определения EnDebug.c:233
Wrapper class for managing sound through SEffectManager.
Определения EffectSound.c:5
Определения Building.c:6
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id
static proto native owned string GetSlotName(int id)
converts slot_id to string
provides access to slot configuration
Определения InventorySlots.c:6
Определения InventoryItem.c:731
static bool IsBaseBuildingLogEnable()
Определения Debug.c:698
Определения Debug.c:594
Определения EnMath.c:7
Определения PlayerBaseClient.c:2
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native float Length()
Returns length of vector (magnitude)
proto float Normalize()
Normalizes vector. Returns length.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
proto vector VectorToAngles()
Converts vector to spherical coordinates with radius = 1.
proto vector AnglesToVector()
Converts spherical coordinates (yaw, pitch, roll in degrees) to unit length vector.
Определения EnConvert.c:106
Serializer ParamsReadContext
Определения gameplay.c:15
proto native CGame GetGame()
Serializer ParamsWriteContext
Определения gameplay.c:16
static proto bool GetBool(int id, bool reverse=false)
Get value as bool from the given script id.
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static proto float Acos(float c)
Returns angle in radians from cosinus.
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9
const int CALL_CATEGORY_GAMEPLAY
Определения tools.c:10