Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
basebuildingbase.c
Go to the documentation of this file.
1 //BASE BUILDING BASE
3 {
4  const string ANIMATION_DEPLOYED = "Deployed";
5 
6  float m_ConstructionKitHealth; //stored health value for used construction kit
7 
9 
10  bool m_HasBase;
11  //variables for synchronization of base building parts (2x31 is the current limit)
12  int m_SyncParts01; //synchronization for already built parts (31 parts)
13  int m_SyncParts02; //synchronization for already built parts (+31 parts)
14  int m_SyncParts03; //synchronization for already built parts (+31 parts)
15  int m_InteractedPartId; //construction part id that an action was performed on
16  int m_PerformedActionId; //action id that was performed on a construction part
17 
18  //Sounds
19  //build
20  const string SOUND_BUILD_WOOD_LOG = "putDown_WoodLog_SoundSet";
21  const string SOUND_BUILD_WOOD_PLANK = "putDown_WoodPlank_SoundSet";
22  const string SOUND_BUILD_WOOD_STAIRS = "putDown_WoodStairs_SoundSet";
23  const string SOUND_BUILD_METAL = "putDown_MetalPlank_SoundSet";
24  const string SOUND_BUILD_WIRE = "putDown_BarbedWire_SoundSet";
25  //dismantle
26  const string SOUND_DISMANTLE_WOOD_LOG = "Crash_WoodPlank_SoundSet";
27  const string SOUND_DISMANTLE_WOOD_PLANK = "Crash_WoodPlank_SoundSet";
28  const string SOUND_DISMANTLE_WOOD_STAIRS = "Crash_WoodPlank_SoundSet";
29  const string SOUND_DISMANTLE_METAL = "Crash_MetalPlank_SoundSet";
30  const string SOUND_DISMANTLE_WIRE = "putDown_BarbedWire_SoundSet";
31 
32  protected EffectSound m_Sound;
33 
37 
38  // Constructor
39  void BaseBuildingBase()
40  {
42 
43  //synchronized variables
44  RegisterNetSyncVariableInt( "m_SyncParts01" );
45  RegisterNetSyncVariableInt( "m_SyncParts02" );
46  RegisterNetSyncVariableInt( "m_SyncParts03" );
47  RegisterNetSyncVariableInt( "m_InteractedPartId" );
48  RegisterNetSyncVariableInt( "m_PerformedActionId" );
49  RegisterNetSyncVariableBool( "m_HasBase" );
50 
51  //Construction init
53 
54  if (ConfigIsExisting("hybridAttachments"))
55  {
57  ConfigGetTextArray("hybridAttachments", m_HybridAttachments);
58  }
59  if (ConfigIsExisting("mountables"))
60  {
62  ConfigGetTextArray("mountables", m_Mountables);
63  }
64 
65  ProcessInvulnerabilityCheck(GetInvulnerabilityTypeString());
66  }
67 
68  override void EEDelete(EntityAI parent)
69  {
70  super.EEDelete(parent);
71 
72  foreach (AreaDamageManager areaDamage : m_DamageTriggers)
73  {
74  areaDamage.Destroy();
75  }
76 
77  }
78 
79  override string GetInvulnerabilityTypeString()
80  {
81  return "disableBaseDamage";
82  }
83 
84  override bool CanObstruct()
85  {
86  return true;
87  }
88 
89  override int GetHideIconMask()
90  {
91  return EInventoryIconVisibility.HIDE_VICINITY;
92  }
93 
94  // --- SYNCHRONIZATION
96  {
97  if ( GetGame().IsServer() )
98  {
99  SetSynchDirty();
100  }
101  }
102 
103  override void OnVariablesSynchronized()
104  {
105  if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] " + GetDebugName(this) + " OnVariablesSynchronized");
106  super.OnVariablesSynchronized();
107 
108  GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).CallLater( OnSynchronizedClient, 100, false );
109  }
110 
111  protected void OnSynchronizedClient()
112  {
113  //update parts
115 
116  //update action on part
118 
119  //update visuals (client)
120  UpdateVisuals();
121  }
122 
123  //parts synchronization
124  void RegisterPartForSync( int part_id )
125  {
126  //part_id must starts from index = 1
127  int offset;
128  int mask;
129 
130  if ( part_id >= 1 && part_id <= 31 ) //<1,31> (31 parts)
131  {
132  offset = part_id - 1;
133  mask = 1 << offset;
134 
135  m_SyncParts01 = m_SyncParts01 | mask;
136  }
137  else if ( part_id >= 32 && part_id <= 62 ) //<32,62> (31 parts)
138  {
139  offset = ( part_id % 32 );
140  mask = 1 << offset;
141 
142  m_SyncParts02 = m_SyncParts02 | mask;
143  }
144  else if ( part_id >= 63 && part_id <= 93 ) //<63,93> (31 parts)
145  {
146  offset = ( part_id % 63 );
147  mask = 1 << offset;
148 
149  m_SyncParts03 = m_SyncParts03 | mask;
150  }
151  }
152 
153  void UnregisterPartForSync( int part_id )
154  {
155  //part_id must starts from index = 1
156  int offset;
157  int mask;
158 
159  if ( part_id >= 1 && part_id <= 31 ) //<1,31> (31 parts)
160  {
161  offset = part_id - 1;
162  mask = 1 << offset;
163 
164  m_SyncParts01 = m_SyncParts01 & ~mask;
165  }
166  else if ( part_id >= 32 && part_id <= 62 ) //<32,62> (31 parts)
167  {
168  offset = ( part_id % 32 );
169  mask = 1 << offset;
170 
171  m_SyncParts02 = m_SyncParts02 & ~mask;
172  }
173  else if ( part_id >= 63 && part_id <= 93 ) //<63,93> (31 parts)
174  {
175  offset = ( part_id % 63 );
176  mask = 1 << offset;
177 
178  m_SyncParts03 = m_SyncParts03 & ~mask;
179  }
180  }
181 
182  bool IsPartBuildInSyncData( int part_id )
183  {
184  //part_id must starts from index = 1
185  int offset;
186  int mask;
187 
188  if ( part_id >= 1 && part_id <= 31 ) //<1,31> (31 parts)
189  {
190  offset = part_id - 1;
191  mask = 1 << offset;
192 
193  if ( ( m_SyncParts01 & mask ) > 0 )
194  {
195  return true;
196  }
197  }
198  else if ( part_id >= 32 && part_id <= 62 ) //<32,62> (31 parts)
199  {
200  offset = ( part_id % 32 );
201  mask = 1 << offset;
202 
203  if ( ( m_SyncParts02 & mask ) > 0 )
204  {
205  return true;
206  }
207  }
208  else if ( part_id >= 63 && part_id <= 93 ) //<63,93> (31 parts)
209  {
210  offset = ( part_id % 63 );
211  mask = 1 << offset;
212 
213  if ( ( m_SyncParts03 & mask ) > 0 )
214  {
215  return true;
216  }
217  }
218 
219  return false;
220  }
221 
222  protected void RegisterActionForSync( int part_id, int action_id )
223  {
224  m_InteractedPartId = part_id;
225  m_PerformedActionId = action_id;
226  }
227 
228  protected void ResetActionSyncData()
229  {
230  //reset data
231  m_InteractedPartId = -1;
232  m_PerformedActionId = -1;
233  }
234 
235  protected void SetActionFromSyncData()
236  {
237  if ( m_InteractedPartId > -1 && m_PerformedActionId > -1 )
238  {
240  int build_action_id = m_PerformedActionId;
241 
242  switch( build_action_id )
243  {
244  case AT_BUILD_PART : OnPartBuiltClient( constrution_part.GetPartName(), build_action_id ); break;
245  case AT_DISMANTLE_PART : OnPartDismantledClient( constrution_part.GetPartName(), build_action_id ); break;
246  case AT_DESTROY_PART : OnPartDestroyedClient( constrution_part.GetPartName(), build_action_id ); break;
247  }
248  }
249  }
250  //------
251 
253  {
254  string key = part.m_PartName;
255  bool is_base = part.IsBase();
256  bool is_part_built_sync = IsPartBuildInSyncData( part.GetId() );
257  bsbDebugSpam("[bsb] " + GetDebugName(this) + " SetPartFromSyncData try to sync: built=" + is_part_built_sync + " key=" + key + " part=" + part.GetPartName() + " part_built=" + part.IsBuilt());
258  if ( is_part_built_sync )
259  {
260  if ( !part.IsBuilt() )
261  {
262  if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] " + GetDebugName(this) + " SetPartsFromSyncData +++ " + key);
263  GetConstruction().AddToConstructedParts( key );
264  GetConstruction().ShowConstructionPartPhysics(part.GetPartName());
265 
266  if (is_base)
267  {
268  if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] " + GetDebugName(this) + ANIMATION_DEPLOYED + " RM");
269  RemoveProxyPhysics( ANIMATION_DEPLOYED );
270  }
271  }
272  }
273  else
274  {
275  if ( part.IsBuilt() )
276  {
277  if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] " + GetDebugName(this) + " SetPartsFromSyncData --- " + key);
278  GetConstruction().RemoveFromConstructedParts( key );
279  GetConstruction().HideConstructionPartPhysics(part.GetPartName());
280 
281  if (is_base)
282  {
283  if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] " + GetDebugName(this) + ANIMATION_DEPLOYED + " ADD");
284  AddProxyPhysics( ANIMATION_DEPLOYED );
285  }
286  }
287  }
288 
289  //check slot lock for material attachments
290  GetConstruction().SetLockOnAttachedMaterials( part.GetPartName(), part.IsBuilt() ); //failsafe for corrupted sync/storage data
291  }
292 
293  //set construction parts based on synchronized data
294  void SetPartsFromSyncData()
295  {
296  Construction construction = GetConstruction();
297  map<string, ref ConstructionPart> construction_parts = construction.GetConstructionParts();
298 
299  for ( int i = 0; i < construction_parts.Count(); ++i )
300  {
301  string key = construction_parts.GetKey( i );
302  ConstructionPart value = construction_parts.Get( key );
303  SetPartFromSyncData(value);
304  }
305 
306  //regenerate navmesh
307  UpdateNavmesh();
308  }
309 
310  protected ConstructionPart GetConstructionPartById( int id )
311  {
312  Construction construction = GetConstruction();
313  map<string, ref ConstructionPart> construction_parts = construction.GetConstructionParts();
314 
315  for ( int i = 0; i < construction_parts.Count(); ++i )
316  {
317  string key = construction_parts.GetKey( i );
318  ConstructionPart value = construction_parts.Get( key );
319 
320  if ( value.GetId() == id )
321  {
322  return value;
323  }
324  }
325 
326  return NULL;
327  }
328  //
329 
330  //Base
331  bool HasBase()
332  {
333  return m_HasBase;
334  }
335 
336  void SetBaseState( bool has_base )
337  {
338  m_HasBase = has_base;
339  }
340 
341  override bool IsDeployable()
342  {
343  return true;
344  }
345 
346  bool IsOpened()
347  {
348  return false;
349  }
350 
351  //--- CONSTRUCTION KIT
353  {
354  ItemBase construction_kit = ItemBase.Cast( GetGame().CreateObjectEx( GetConstructionKitType(), GetKitSpawnPosition(), ECE_PLACE_ON_SURFACE ) );
355  if ( m_ConstructionKitHealth > 0 )
356  {
357  construction_kit.SetHealth( m_ConstructionKitHealth );
358  }
359 
360  return construction_kit;
361  }
362 
363  void CreateConstructionKitInHands(notnull PlayerBase player)
364  {
365  ItemBase construction_kit = ItemBase.Cast(player.GetHumanInventory().CreateInHands(GetConstructionKitType()));
366  if ( m_ConstructionKitHealth > 0 )
367  {
368  construction_kit.SetHealth( m_ConstructionKitHealth );
369  }
370  }
371 
372  protected vector GetKitSpawnPosition()
373  {
374  return GetPosition();
375  }
376 
377  protected string GetConstructionKitType()
378  {
379  return "";
380  }
381 
382  void DestroyConstructionKit( ItemBase construction_kit )
383  {
384  m_ConstructionKitHealth = construction_kit.GetHealth();
385  GetGame().ObjectDelete( construction_kit );
386  }
387 
388  //--- CONSTRUCTION
389  void DestroyConstruction()
390  {
391  if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] " + GetDebugName(this) + " DestroyConstruction");
392  GetGame().ObjectDelete( this );
393  }
394 
395  // --- EVENTS
396  override void OnStoreSave( ParamsWriteContext ctx )
397  {
398  super.OnStoreSave( ctx );
399 
400  //sync parts 01
401  ctx.Write( m_SyncParts01 );
402  ctx.Write( m_SyncParts02 );
403  ctx.Write( m_SyncParts03 );
404 
405  ctx.Write( m_HasBase );
406  }
407 
408  override bool OnStoreLoad( ParamsReadContext ctx, int version )
409  {
410  if ( !super.OnStoreLoad( ctx, version ) )
411  return false;
412 
413  //--- Base building data ---
414  //Restore synced parts data
415  if ( !ctx.Read( m_SyncParts01 ) )
416  {
417  m_SyncParts01 = 0; //set default
418  return false;
419  }
420  if ( !ctx.Read( m_SyncParts02 ) )
421  {
422  m_SyncParts02 = 0; //set default
423  return false;
424  }
425  if ( !ctx.Read( m_SyncParts03 ) )
426  {
427  m_SyncParts03 = 0; //set default
428  return false;
429  }
430 
431  //has base
432  if ( !ctx.Read( m_HasBase ) )
433  {
434  m_HasBase = false;
435  return false;
436  }
437  //---
438 
439  return true;
440  }
441 
442  override void AfterStoreLoad()
443  {
444  super.AfterStoreLoad();
445 
447  {
449  }
450  }
451 
453  {
454  //update server data
456 
457  //set base state
458  ConstructionPart construction_part = GetConstruction().GetBaseConstructionPart();
459  SetBaseState( construction_part.IsBuilt() ) ;
460 
461  //synchronize after load
463  }
464 
465  override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
466  {
468  return;
469 
470  super.EEHealthLevelChanged(oldLevel,newLevel,zone);
471 
472  if (GetGame().IsMultiplayer() && !GetGame().IsServer())
473  return;
474 
475  Construction construction = GetConstruction();
476  string part_name = zone;
477  part_name.ToLower();
478 
479  if ( newLevel == GameConstants.STATE_RUINED )
480  {
481  ConstructionPart construction_part = construction.GetConstructionPart( part_name );
482 
483  if ( construction_part && construction.IsPartConstructed( part_name ) )
484  {
485  construction.DestroyPartServer( null, part_name, AT_DESTROY_PART );
486  construction.DestroyConnectedParts(part_name);
487  }
488 
489  //barbed wire handling (hack-ish)
490  if ( part_name.Contains("barbed") )
491  {
492  BarbedWire barbed_wire = BarbedWire.Cast( FindAttachmentBySlotName( zone ) );
493  if (barbed_wire)
494  barbed_wire.SetMountedState( false );
495  }
496  }
497  }
498 
499  override void EEOnAfterLoad()
500  {
502  {
503  GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).CallLater( SetPartsAfterStoreLoad, 500, false, this );
504  }
505 
506  super.EEOnAfterLoad();
507  }
508 
509  override void EEInit()
510  {
511  super.EEInit();
512 
513  // init visuals and physics
514  InitBaseState();
515 
516  //debug
517  #ifdef DEVELOPER
519  #endif
520  }
521 
522  override void EEItemAttached( EntityAI item, string slot_name )
523  {
524  super.EEItemAttached( item, slot_name );
525 
526  CheckForHybridAttachments( item, slot_name );
527  UpdateVisuals();
528  UpdateAttachmentPhysics( slot_name, false );
529  }
530 
531  override void EEItemDetached( EntityAI item, string slot_name )
532  {
533  super.EEItemDetached( item, slot_name );
534 
535  UpdateVisuals();
536  UpdateAttachmentPhysics( slot_name, false );
537  }
538 
539  protected void OnSetSlotLock( int slotId, bool locked, bool was_locked )
540  {
541  string slot_name = InventorySlots.GetSlotName( slotId );
542  if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint( "inv: OnSetSlotLock " + GetDebugName( this ) + " slot=" + slot_name + " locked=" + locked + " was_locked=" + was_locked );
543 
544  UpdateAttachmentVisuals( slot_name, locked );
545  UpdateAttachmentPhysics( slot_name, locked );
546  }
547 
548  //ignore out of reach condition
549  override bool IgnoreOutOfReachCondition()
550  {
551  return true;
552  }
553 
554  //CONSTRUCTION EVENTS
555  //Build
556  void OnPartBuiltServer(notnull Man player, string part_name, int action_id)
557  {
558  ConstructionPart construtionPart = GetConstruction().GetConstructionPart(part_name);
559 
560  //check base state
561  if (construtionPart.IsBase())
562  {
563  SetBaseState(true);
564 
565  //spawn kit
567  }
568 
569  //register constructed parts for synchronization
570  RegisterPartForSync(construtionPart.GetId());
571 
572  //register action that was performed on part
573  RegisterActionForSync(construtionPart.GetId(), action_id);
574 
575  //synchronize
577 
578  SetPartFromSyncData(construtionPart); // server part of sync, client will be synced from SetPartsFromSyncData
579 
580  UpdateNavmesh();
581 
582  //update visuals
583  UpdateVisuals();
584 
585  //reset action sync data
586  GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(ResetActionSyncData, 100, false, this);
587  }
588 
589  void OnPartBuiltClient(string part_name, int action_id)
590  {
591  //play sound
592  SoundBuildStart( part_name );
593  }
594 
595  //Dismantle
596  void OnPartDismantledServer(notnull Man player, string part_name, int action_id)
597  {
598  if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] " + GetDebugName(this) + " OnPartDismantledServer " + part_name);
599  ConstructionPart construtionPart = GetConstruction().GetConstructionPart(part_name);
600 
601  //register constructed parts for synchronization
602  UnregisterPartForSync(construtionPart.GetId());
603 
604  //register action that was performed on part
605  RegisterActionForSync(construtionPart.GetId(), action_id);
606 
607  //synchronize
609 
610  // server part of sync, client will be synced from SetPartsFromSyncData
611  SetPartFromSyncData(construtionPart);
612 
613  UpdateNavmesh();
614 
615  //update visuals
616  UpdateVisuals();
617 
618  //reset action sync data
619  GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(ResetActionSyncData, 100, false, this);
620 
621  //check base state
622  if (construtionPart.IsBase())
623  {
624  //Destroy construction
625  GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(DestroyConstruction, 200, false, this);
626  }
627  }
628 
629  void OnPartDismantledClient( string part_name, int action_id )
630  {
631  //play sound
632  SoundDismantleStart( part_name );
633  }
634 
635  //Destroy
636  void OnPartDestroyedServer(Man player, string part_name, int action_id, bool destroyed_by_connected_part = false)
637  {
638  if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] " + GetDebugName(this) + " OnPartDestroyedServer " + part_name);
639  ConstructionPart construtionPart = GetConstruction().GetConstructionPart(part_name);
640 
641  //register constructed parts for synchronization
642  UnregisterPartForSync(construtionPart.GetId());
643 
644  //register action that was performed on part
645  RegisterActionForSync(construtionPart.GetId(), action_id);
646 
647  //synchronize
649 
650  // server part of sync, client will be synced from SetPartsFromSyncData
651  SetPartFromSyncData(construtionPart);
652 
653  UpdateNavmesh();
654 
655  //update visuals
656  UpdateVisuals();
657 
658  //reset action sync data
659  GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(ResetActionSyncData, 100, false, this);
660 
661  //check base state
662  if (construtionPart.IsBase())
663  {
664  //Destroy construction
665  GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).CallLater(DestroyConstruction, 200, false, this);
666  }
667  }
668 
669  void OnPartDestroyedClient( string part_name, int action_id )
670  {
671  //play sound
672  SoundDestroyStart( part_name );
673  }
674 
675  // --- UPDATE
676  void InitBaseState()
677  {
678  if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] " + GetDebugName(this) + " BaseBuildingBase::InitBaseState ");
679 
680  InitVisuals();
681  UpdateNavmesh(); //regenerate navmesh
682  GetConstruction().InitBaseState();
683  }
684 
685  void InitVisuals()
686  {
687  if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] " + GetDebugName(this) + " InitVisuals");
688  //check base
689  if ( !HasBase() )
690  {
691  SetAnimationPhase( ANIMATION_DEPLOYED, 0 );
692  }
693  else
694  {
695  SetAnimationPhase( ANIMATION_DEPLOYED, 1 );
696  }
697 
698  GetConstruction().UpdateVisuals();
699  }
700 
701  void UpdateVisuals()
702  {
703  array<string> attachmentSlots = new array<string>;
704 
705  GetAttachmentSlots(this, attachmentSlots);
706  foreach (string slotName : attachmentSlots)
707  {
709  }
710 
711  //check base
712  if (!HasBase())
713  SetAnimationPhase(ANIMATION_DEPLOYED, 0);
714  else
715  SetAnimationPhase(ANIMATION_DEPLOYED, 1);
716 
717  GetConstruction().UpdateVisuals();
718  }
719 
720  void UpdateAttachmentVisuals(string slot_name, bool is_locked)
721  {
722  string slotNameMounted = slot_name + "_Mounted";
723  EntityAI attachment = FindAttachmentBySlotName(slot_name);
724 
725  if (attachment)
726  {
727  BarbedWire barbedWire = BarbedWire.Cast(attachment);
728  if (barbedWire && barbedWire.IsMounted())
729  CreateAreaDamage(slotNameMounted);
730  else
731  DestroyAreaDamage(slotNameMounted);
732 
733  if (is_locked)
734  {
735  SetAnimationPhase(slotNameMounted, 0);
736  SetAnimationPhase(slot_name, 1);
737  }
738  else
739  {
740  SetAnimationPhase(slotNameMounted, 1);
741  SetAnimationPhase(slot_name, 0);
742  }
743  }
744  else
745  {
746  SetAnimationPhase(slotNameMounted, 1);
747  SetAnimationPhase(slot_name, 1);
748 
749  DestroyAreaDamage(slotNameMounted);
750  }
751  }
752 
753  // avoid calling this function on frequent occasions, it's a massive performance hit
754  void UpdatePhysics()
755  {
756  if (LogManager.IsBaseBuildingLogEnable())
757  bsbDebugPrint("[bsb] " + GetDebugName(this) + " BaseBuildingBase::UpdatePhysics");
758 
759  array<string> attachmentSlots = new array<string>;
760  GetAttachmentSlots(this, attachmentSlots);
761 
762  if (LogManager.IsBaseBuildingLogEnable())
763  bsbDebugPrint("[bsb] " + GetDebugName(this) + " att_cnt=" + attachmentSlots.Count());
764 
765  foreach (string slotName : attachmentSlots)
766  {
768  }
769 
770  //check base
771  if (!HasBase())
772  {
773  if (LogManager.IsBaseBuildingLogEnable())
774  bsbDebugPrint("[bsb] " + GetDebugName(this) + ANIMATION_DEPLOYED + " ADD");
775 
776  AddProxyPhysics(ANIMATION_DEPLOYED);
777  }
778  else
779  {
780  if (LogManager.IsBaseBuildingLogEnable())
781  bsbDebugPrint("[bsb] " + GetDebugName(this) + ANIMATION_DEPLOYED + " RM");
782 
783  RemoveProxyPhysics(ANIMATION_DEPLOYED);
784  }
785 
786  GetConstruction().UpdatePhysics();
787  UpdateNavmesh();
788  }
789 
790  void UpdateAttachmentPhysics( string slot_name, bool is_locked )
791  {
792  //checks for invalid appends; hotfix
793  if ( !m_Mountables || m_Mountables.Find(slot_name) == -1 )
794  return;
795  //----------------------------------
796  string slot_name_mounted = slot_name + "_Mounted";
797  EntityAI attachment = FindAttachmentBySlotName( slot_name );
798 
799  //remove proxy physics
800  if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] " + GetDebugName(this) + " Removing ATT SLOT=" + slot_name + " RM / RM");
801  RemoveProxyPhysics( slot_name_mounted );
802  RemoveProxyPhysics( slot_name );
803 
804  if ( attachment )
805  {
806  if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] " + GetDebugName(this) + " Adding ATT=" + Object.GetDebugName(attachment));
807  if ( is_locked )
808  {
809  if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] " + GetDebugName(this) + " RM / RM");
810  AddProxyPhysics( slot_name_mounted );
811  }
812  else
813  {
814  if (LogManager.IsBaseBuildingLogEnable()) bsbDebugPrint("[bsb] " + GetDebugName(this) + " ADD");
815  AddProxyPhysics( slot_name );
816  }
817  }
818  }
819 
820  protected void UpdateNavmesh()
821  {
822  SetAffectPathgraph( true, false );
823  GetGame().GetCallQueue( CALL_CATEGORY_SYSTEM ).CallLater( GetGame().UpdatePathgraphRegionByObject, 100, false, this );
824  }
825 
826  override bool CanUseConstruction()
827  {
828  return true;
829  }
830 
831  override bool CanUseConstructionBuild()
832  {
833  return true;
834  }
835 
836  protected bool IsAttachmentSlotLocked( EntityAI attachment )
837  {
838  if ( attachment )
839  {
840  InventoryLocation inventory_location = new InventoryLocation;
841  attachment.GetInventory().GetCurrentInventoryLocation( inventory_location );
842 
843  return GetInventory().GetSlotLock( inventory_location.GetSlot() );
844  }
845 
846  return false;
847  }
848 
849  protected bool IsAttachmentSlotLocked( string slot_name )
850  {
851  return GetInventory().GetSlotLock( InventorySlots.GetSlotIdFromString( slot_name ) );
852  }
853 
854  //--- ATTACHMENT SLOTS
855  void GetAttachmentSlots( EntityAI entity, out array<string> attachment_slots )
856  {
857  string config_path = "CfgVehicles" + " " + entity.GetType() + " " + "attachments";
858  if ( GetGame().ConfigIsExisting( config_path ) )
859  {
860  GetGame().ConfigGetTextArray( config_path, attachment_slots );
861  }
862  }
863 
864  bool CheckSlotVerticalDistance( int slot_id, PlayerBase player )
865  {
866  return true;
867  }
868 
869  protected bool CheckMemoryPointVerticalDistance( float max_dist, string selection, PlayerBase player )
870  {
871  return true;
872  }
873 
874  protected bool CheckLevelVerticalDistance( float max_dist, string selection, PlayerBase player )
875  {
876  return true;
877  }
878 
879  // --- INIT
880  void ConstructionInit()
881  {
882  if ( !m_Construction )
883  {
884  m_Construction = new Construction( this );
885  }
886 
887  GetConstruction().Init();
888  }
889 
891  {
892  return m_Construction;
893  }
894 
895  //--- INVENTORY/ATTACHMENTS CONDITIONS
896  //attachments
897  override bool CanReceiveAttachment( EntityAI attachment, int slotId )
898  {
899  return super.CanReceiveAttachment(attachment, slotId);
900  }
901 
903  {
904  int attachment_count = GetInventory().AttachmentCount();
905  if ( attachment_count > 0 )
906  {
907  if ( HasBase() && attachment_count == 1 )
908  {
909  return false;
910  }
911 
912  return true;
913  }
914 
915  return false;
916  }
917 
918  override bool ShowZonesHealth()
919  {
920  return true;
921  }
922 
923  //this into/outo parent.Cargo
924  override bool CanPutInCargo( EntityAI parent )
925  {
926  return false;
927  }
928 
929  override bool CanRemoveFromCargo( EntityAI parent )
930  {
931  return false;
932  }
933 
934  //hands
935  override bool CanPutIntoHands( EntityAI parent )
936  {
937  return false;
938  }
939 
940  //--- ACTION CONDITIONS
941  //direction
942  override bool IsFacingPlayer( PlayerBase player, string selection )
943  {
944  return true;
945  }
946 
947  override bool IsPlayerInside( PlayerBase player, string selection )
948  {
949  return true;
950  }
951 
953  bool MustBeBuiltFromOutside()
954  {
955  return false;
956  }
957 
958  //camera direction check
959  bool IsFacingCamera( string selection )
960  {
961  return true;
962  }
963 
964  //roof check
965  bool PerformRoofCheckForBase( string partName, PlayerBase player, out bool result )
966  {
967  return false;
968  }
969 
970  //selection->player distance check
971  bool HasProperDistance( string selection, PlayerBase player )
972  {
973  return true;
974  }
975 
976  //folding
978  {
979  if ( HasBase() || GetInventory().AttachmentCount() > 0 )
980  {
981  return false;
982  }
983 
984  return true;
985  }
986 
988  {
991 
992  return item;
993  }
994 
995  //Damage triggers (barbed wire)
996  void CreateAreaDamage( string slot_name, float rotation_angle = 0 )
997  {
998  if ( GetGame() && GetGame().IsServer() )
999  {
1000  //destroy area damage if some already exists
1001  DestroyAreaDamage( slot_name );
1002 
1003  //create new area damage
1005  areaDamage.SetDamageComponentType(AreaDamageComponentTypes.HITZONE);
1006 
1007  vector min_max[2];
1008  if ( MemoryPointExists( slot_name + "_min" ) )
1009  {
1010  min_max[0] = GetMemoryPointPos( slot_name + "_min" );
1011  }
1012  if ( MemoryPointExists( slot_name + "_max" ) )
1013  {
1014  min_max[1] = GetMemoryPointPos( slot_name + "_max" );
1015  }
1016 
1017  //get proper trigger extents (min<max)
1018  vector extents[2];
1019  GetConstruction().GetTriggerExtents( min_max, extents );
1020 
1021  //get box center
1022  vector center;
1023  center = GetConstruction().GetBoxCenter( min_max );
1024  center = ModelToWorld( center );
1025 
1026  //rotate center if needed
1027  vector orientation = GetOrientation();;
1028  CalcDamageAreaRotation( rotation_angle, center, orientation );
1029 
1030  areaDamage.SetExtents( extents[0], extents[1] );
1031  areaDamage.SetAreaPosition( center );
1032  areaDamage.SetAreaOrientation( orientation );
1033  areaDamage.SetLoopInterval( 1.0 );
1034  areaDamage.SetDeferDuration( 0.2 );
1035  areaDamage.SetHitZones( { "Torso","LeftHand","LeftLeg","LeftFoot","RightHand","RightLeg","RightFoot" } );
1036  areaDamage.SetAmmoName( "BarbedWireHit" );
1037  areaDamage.Spawn();
1038 
1039  m_DamageTriggers.Insert( slot_name, areaDamage );
1040  }
1041  }
1042 
1043  void CalcDamageAreaRotation( float angle_deg, out vector center, out vector orientation )
1044  {
1045  if ( angle_deg != 0 )
1046  {
1047  //orientation
1048  orientation[0] = orientation[0] - angle_deg;
1049 
1050  //center
1051  vector rotate_axis;
1052  if ( MemoryPointExists( "rotate_axis" ) )
1053  {
1054  rotate_axis = ModelToWorld( GetMemoryPointPos( "rotate_axis" ) );
1055  }
1056  float r_center_x = ( Math.Cos( angle_deg * Math.DEG2RAD ) * ( center[0] - rotate_axis[0] ) ) - ( Math.Sin( angle_deg * Math.DEG2RAD ) * ( center[2] - rotate_axis[2] ) ) + rotate_axis[0];
1057  float r_center_z = ( Math.Sin( angle_deg * Math.DEG2RAD ) * ( center[0] - rotate_axis[0] ) ) + ( Math.Cos( angle_deg * Math.DEG2RAD ) * ( center[2] - rotate_axis[2] ) ) + rotate_axis[2];
1058  center[0] = r_center_x;
1059  center[2] = r_center_z;
1060  }
1061  }
1062 
1063  void DestroyAreaDamage( string slot_name )
1064  {
1065  if (GetGame() && GetGame().IsServer())
1066  {
1068  if (m_DamageTriggers.Find(slot_name, areaDamage))
1069  {
1070  if (areaDamage)
1071  {
1072  areaDamage.Destroy();
1073  }
1074 
1075  m_DamageTriggers.Remove( slot_name );
1076  }
1077  }
1078  }
1079 
1080  override bool IsIgnoredByConstruction()
1081  {
1082  return true;
1083  }
1084 
1085  //================================================================
1086  // SOUNDS
1087  //================================================================
1088  protected void SoundBuildStart( string part_name )
1089  {
1090  PlaySoundSet( m_Sound, GetBuildSoundByMaterial( part_name ), 0.1, 0.1 );
1091  }
1092 
1093  protected void SoundDismantleStart( string part_name )
1094  {
1095  PlaySoundSet( m_Sound, GetDismantleSoundByMaterial( part_name ), 0.1, 0.1 );
1096  }
1097 
1098  protected void SoundDestroyStart( string part_name )
1099  {
1100  PlaySoundSet( m_Sound, GetDismantleSoundByMaterial( part_name ), 0.1, 0.1 );
1101  }
1102 
1103  protected string GetBuildSoundByMaterial( string part_name )
1104  {
1105  ConstructionMaterialType material_type = GetConstruction().GetMaterialType( part_name );
1106 
1107  switch ( material_type )
1108  {
1109  case ConstructionMaterialType.MATERIAL_LOG: return SOUND_BUILD_WOOD_LOG;
1110  case ConstructionMaterialType.MATERIAL_WOOD: return SOUND_BUILD_WOOD_PLANK;
1111  case ConstructionMaterialType.MATERIAL_STAIRS: return SOUND_BUILD_WOOD_STAIRS;
1112  case ConstructionMaterialType.MATERIAL_METAL: return SOUND_BUILD_METAL;
1113  case ConstructionMaterialType.MATERIAL_WIRE: return SOUND_BUILD_WIRE;
1114  }
1115 
1116  return "";
1117  }
1118 
1119  protected string GetDismantleSoundByMaterial( string part_name )
1120  {
1121  ConstructionMaterialType material_type = GetConstruction().GetMaterialType( part_name );
1122 
1123  switch ( material_type )
1124  {
1125  case ConstructionMaterialType.MATERIAL_LOG: return SOUND_DISMANTLE_WOOD_LOG;
1126  case ConstructionMaterialType.MATERIAL_WOOD: return SOUND_DISMANTLE_WOOD_PLANK;
1127  case ConstructionMaterialType.MATERIAL_STAIRS: return SOUND_DISMANTLE_WOOD_STAIRS;
1128  case ConstructionMaterialType.MATERIAL_METAL: return SOUND_DISMANTLE_METAL;
1129  case ConstructionMaterialType.MATERIAL_WIRE: return SOUND_DISMANTLE_WIRE;
1130  }
1131 
1132  return "";
1133  }
1135  //misc
1136  void CheckForHybridAttachments( EntityAI item, string slot_name )
1137  {
1138  if (!GetGame().IsMultiplayer() || GetGame().IsServer())
1139  {
1140  //if this is a hybrid attachment, set damage of appropriate damage zone. Zone name must match slot name...WIP
1141  if (m_HybridAttachments && m_HybridAttachments.Find(slot_name) != -1)
1142  {
1143  SetHealth(slot_name,"Health",item.GetHealth());
1144  }
1145  }
1146  }
1147 
1148  override int GetDamageSystemVersionChange()
1149  {
1150  return 111;
1151  }
1152 
1153  override void SetActions()
1154  {
1155  super.SetActions();
1156 
1158  //AddAction(ActionTakeHybridAttachment);
1159  //AddAction(ActionTakeHybridAttachmentToHands);
1162  }
1163 
1164  //================================================================
1165  // DEBUG
1166  //================================================================
1167  protected void DebugCustomState()
1168  {
1169  }
1172  array<string> OnDebugSpawnBuildExcludes()
1173  {
1174  return null;
1175  }
1176 
1177  override void OnDebugSpawn()
1178  {
1179  FullyBuild();
1180  }
1181 
1182  void FullyBuild()
1183  {
1184  array<string> excludes = OnDebugSpawnBuildExcludes();
1185  array<ConstructionPart> parts = GetConstruction().GetConstructionParts().GetValueArray();
1186 
1187  Man p;
1188 
1189  #ifdef SERVER
1190  array<Man> players = new array<Man>;
1191  GetGame().GetWorld().GetPlayerList(players);
1192  if (players.Count())
1193  p = players[0];
1194  #else
1195  p = GetGame().GetPlayer();
1196  #endif
1197 
1198  foreach (ConstructionPart part : parts)
1199  {
1200  bool excluded = false;
1201  string partName = part.GetPartName();
1202  if (excludes)
1203  {
1204  foreach (string exclude : excludes)
1205  {
1206  if (partName.Contains(exclude))
1207  {
1208  excluded = true;
1209  break;
1210  }
1211  }
1212  }
1213 
1214  if (!excluded)
1215  {
1216  OnPartBuiltServer(p, partName, AT_BUILD_PART);
1217  }
1218  }
1219 
1220  GetConstruction().UpdateVisuals();
1221  }
1222 }
1223 
1224 void bsbDebugPrint (string s)
1225 {
1226 #ifdef BSB_DEBUG
1227  PrintToRPT("" + s); // comment/uncomment to hide/see debug logs
1228 #else
1229  //Print("" + s); // comment/uncomment to hide/see debug logs
1230 #endif
1231 }
1232 void bsbDebugSpam (string s)
1233 {
1234 #ifdef BSB_DEBUG_SPAM
1235  PrintToRPT("" + s); // comment/uncomment to hide/see debug logs
1236 #else
1237  //Print("" + s); // comment/uncomment to hide/see debug logs
1238 #endif
1239 }
ItemBase
Definition: inventoryitem.c:730
GetGame
proto native CGame GetGame()
GetBuildSoundByMaterial
protected string GetBuildSoundByMaterial(string part_name)
Definition: basebuildingbase.c:1101
CALL_CATEGORY_SYSTEM
const int CALL_CATEGORY_SYSTEM
Definition: tools.c:8
m_Sound
protected EffectSound m_Sound
Definition: basebuildingbase.c:30
CreateConstructionKit
ItemBase CreateConstructionKit()
Definition: basebuildingbase.c:350
GetHideIconMask
override int GetHideIconMask()
Definition: basebuildingbase.c:87
ActionTakeItemToHands
Definition: actiontakeitemtohands.c:1
ANIMATION_DEPLOYED
const string ANIMATION_DEPLOYED
Definition: basebuildingbase.c:2
FullyBuild
void FullyBuild()
Definition: basebuildingbase.c:1180
ConstructionMaterialType
ConstructionMaterialType
Definition: construction.c:1
CALL_CATEGORY_GAMEPLAY
const int CALL_CATEGORY_GAMEPLAY
Definition: tools.c:10
RegisterActionForSync
protected void RegisterActionForSync(int part_id, int action_id)
Definition: basebuildingbase.c:220
SOUND_DISMANTLE_METAL
const string SOUND_DISMANTLE_METAL
Definition: basebuildingbase.c:27
LogManager
Definition: debug.c:734
UpdateNavmesh
protected void UpdateNavmesh()
Definition: basebuildingbase.c:818
InventorySlots
provides access to slot configuration
Definition: inventoryslots.c:5
SOUND_BUILD_WIRE
const string SOUND_BUILD_WIRE
Definition: basebuildingbase.c:22
EEInit
override void EEInit()
Definition: basebuildingbase.c:507
m_SyncParts03
int m_SyncParts03
Definition: basebuildingbase.c:12
IsPartBuildInSyncData
bool IsPartBuildInSyncData(int part_id)
Definition: basebuildingbase.c:180
IsIgnoredByConstruction
override bool IsIgnoredByConstruction()
Definition: basebuildingbase.c:1078
m_SyncParts01
int m_SyncParts01
Definition: basebuildingbase.c:10
m_HasBase
bool m_HasBase
Definition: basebuildingbase.c:8
ActionTakeItem
Definition: actiontakeitem.c:6
m_InteractedPartId
int m_InteractedPartId
Definition: basebuildingbase.c:13
SOUND_DISMANTLE_WOOD_STAIRS
const string SOUND_DISMANTLE_WOOD_STAIRS
Definition: basebuildingbase.c:26
Construction
void Construction(BaseBuildingBase parent)
Definition: construction.c:26
OnPartDismantledClient
void OnPartDismantledClient(string part_name, int action_id)
Definition: basebuildingbase.c:627
SoundBuildStart
protected void SoundBuildStart(string part_name)
Definition: basebuildingbase.c:1086
SOUND_DISMANTLE_WOOD_LOG
const string SOUND_DISMANTLE_WOOD_LOG
Definition: basebuildingbase.c:24
EEDelete
override void EEDelete(EntityAI parent)
Definition: basebuildingbase.c:66
CalcDamageAreaRotation
void CalcDamageAreaRotation(float angle_deg, out vector center, out vector orientation)
Definition: basebuildingbase.c:1041
InventoryLocation
InventoryLocation.
Definition: inventorylocation.c:27
RemoveAction
void RemoveAction(typename actionName)
Definition: advancedcommunication.c:118
ECE_PLACE_ON_SURFACE
const int ECE_PLACE_ON_SURFACE
Definition: centraleconomy.c:37
ShowZonesHealth
override bool ShowZonesHealth()
Definition: basebuildingbase.c:916
SetBaseState
void SetBaseState(bool has_base)
Definition: basebuildingbase.c:334
AT_DISMANTLE_PART
const int AT_DISMANTLE_PART
Definition: _constants.c:7
UpdatePhysics
void UpdatePhysics()
Definition: basebuildingbase.c:752
m_HybridAttachments
ref array< string > m_HybridAttachments
Definition: basebuildingbase.c:33
ActionDetachFromTarget
Definition: actiondetachfromtarget.c:1
InitVisuals
void InitVisuals()
Definition: basebuildingbase.c:683
m_Construction
ref Construction m_Construction
Definition: basebuildingbase.c:6
CanFoldBaseBuildingObject
bool CanFoldBaseBuildingObject()
Definition: basebuildingbase.c:975
CreateConstructionKitInHands
void CreateConstructionKitInHands(notnull PlayerBase player)
Definition: basebuildingbase.c:361
Serializer
Serialization general interface. Serializer API works with:
Definition: serializer.c:55
SetPartFromSyncData
void SetPartFromSyncData(ConstructionPart part)
Definition: basebuildingbase.c:250
GetPosition
class JsonUndergroundAreaTriggerData GetPosition
Definition: undergroundarealoader.c:9
EffectSound
Wrapper class for managing sound through SEffectManager.
Definition: effectsound.c:4
SOUND_DISMANTLE_WOOD_PLANK
const string SOUND_DISMANTLE_WOOD_PLANK
Definition: basebuildingbase.c:25
UnregisterPartForSync
void UnregisterPartForSync(int part_id)
Definition: basebuildingbase.c:151
bsbDebugPrint
class BaseBuildingBase extends ItemBase bsbDebugPrint(string s)
Definition: basebuildingbase.c:1224
PlayerBase
Definition: playerbaseclient.c:1
m_Mountables
ref array< string > m_Mountables
Definition: basebuildingbase.c:34
map
map
Definition: controlsxboxnew.c:3
SoundDismantleStart
protected void SoundDismantleStart(string part_name)
Definition: basebuildingbase.c:1091
vector
Definition: enconvert.c:105
GetDamageSystemVersionChange
override int GetDamageSystemVersionChange()
Definition: basebuildingbase.c:1146
SetActionFromSyncData
protected void SetActionFromSyncData()
Definition: basebuildingbase.c:233
m_DamageTriggers
ref map< string, ref AreaDamageManager > m_DamageTriggers
Definition: basebuildingbase.c:32
SOUND_BUILD_WOOD_LOG
const string SOUND_BUILD_WOOD_LOG
Definition: basebuildingbase.c:18
BaseBuildingBase
Definition: fence.c:1
IsAttachmentSlotLocked
protected bool IsAttachmentSlotLocked(EntityAI attachment)
Definition: basebuildingbase.c:834
OnPartDestroyedClient
void OnPartDestroyedClient(string part_name, int action_id)
Definition: basebuildingbase.c:667
AddAction
void AddAction(typename actionName)
Definition: advancedcommunication.c:86
SetPartsFromSyncData
void SetPartsFromSyncData()
Definition: basebuildingbase.c:292
Object
Definition: objecttyped.c:1
PrintToRPT
proto void PrintToRPT(void var)
Prints content of variable to RPT file (performance warning - each write means fflush!...
slotName
PlayerSpawnPreset slotName
EEOnAfterLoad
override void EEOnAfterLoad()
Definition: basebuildingbase.c:497
AreaDamageLoopedDeferred_NoVehicle
A particular version of the deferred loop used to not damage players inside vehicles.
Definition: areadamageloopeddeferred_novehicle.c:2
CanRemoveFromCargo
override bool CanRemoveFromCargo(EntityAI parent)
Definition: basebuildingbase.c:927
OnPartBuiltClient
void OnPartBuiltClient(string part_name, int action_id)
Definition: basebuildingbase.c:587
m_PerformedActionId
int m_PerformedActionId
Definition: basebuildingbase.c:14
GetConstruction
Construction GetConstruction()
Definition: basebuildingbase.c:888
CanPutInCargo
override bool CanPutInCargo(EntityAI parent)
Definition: basebuildingbase.c:922
AT_BUILD_PART
const int AT_BUILD_PART
Definition: _constants.c:6
array< string >
CanObstruct
override bool CanObstruct()
Definition: basebuildingbase.c:82
DestroyAreaDamage
void DestroyAreaDamage(string slot_name)
Definition: basebuildingbase.c:1061
DestroyConstructionKit
void DestroyConstructionKit(ItemBase construction_kit)
Definition: basebuildingbase.c:380
UpdateAttachmentVisuals
void UpdateAttachmentVisuals(string slot_name, bool is_locked)
Definition: basebuildingbase.c:718
AT_DESTROY_PART
const int AT_DESTROY_PART
Definition: _constants.c:8
IsDeployable
override bool IsDeployable()
Definition: basebuildingbase.c:339
bsbDebugSpam
void bsbDebugSpam(string s)
Definition: basebuildingbase.c:1232
m_FixDamageSystemInit
bool m_FixDamageSystemInit
Definition: itembase.c:61
HasAttachmentsBesidesBase
bool HasAttachmentsBesidesBase()
Definition: basebuildingbase.c:900
BaseBuildingBase
void BaseBuildingBase()
Definition: basebuildingbase.c:37
GetDebugName
override string GetDebugName()
Definition: dayzplayer.c:1126
m_ConstructionKitHealth
float m_ConstructionKitHealth
Definition: basebuildingbase.c:4
GetInvulnerabilityTypeString
override string GetInvulnerabilityTypeString()
Definition: basebuildingbase.c:77
EEHealthLevelChanged
override void EEHealthLevelChanged(int oldLevel, int newLevel, string zone)
Definition: basebuildingbase.c:463
GameConstants
Definition: constants.c:612
GetConstructionPartById
protected ConstructionPart GetConstructionPartById(int id)
Definition: basebuildingbase.c:308
ConstructionPart
Definition: constructionpart.c:1
SOUND_BUILD_WOOD_PLANK
const string SOUND_BUILD_WOOD_PLANK
Definition: basebuildingbase.c:19
AreaDamageComponentTypes
Definition: areadamagemanager.c:1
SetPartsAfterStoreLoad
void SetPartsAfterStoreLoad()
Definition: basebuildingbase.c:450
CheckForHybridAttachments
void CheckForHybridAttachments(EntityAI item, string slot_name)
Definition: basebuildingbase.c:1134
IgnoreOutOfReachCondition
override bool IgnoreOutOfReachCondition()
Definition: basebuildingbase.c:547
AreaDamageManager
void AreaDamageManager(EntityAI parent)
Definition: areadamagemanager.c:22
SOUND_BUILD_WOOD_STAIRS
const string SOUND_BUILD_WOOD_STAIRS
Definition: basebuildingbase.c:20
SOUND_DISMANTLE_WIRE
const string SOUND_DISMANTLE_WIRE
Definition: basebuildingbase.c:28
ConstructionInit
void ConstructionInit()
Definition: basebuildingbase.c:878
SoundDestroyStart
protected void SoundDestroyStart(string part_name)
Definition: basebuildingbase.c:1096
InitBaseState
void InitBaseState()
Definition: basebuildingbase.c:674
CanUseConstruction
override bool CanUseConstruction()
Definition: basebuildingbase.c:824
OnSynchronizedClient
protected void OnSynchronizedClient()
Definition: basebuildingbase.c:109
GetAttachmentSlots
void GetAttachmentSlots(EntityAI entity, out array< string > attachment_slots)
Definition: basebuildingbase.c:853
HasBase
bool HasBase()
Definition: basebuildingbase.c:329
SynchronizeBaseState
void SynchronizeBaseState()
Definition: basebuildingbase.c:93
Math
Definition: enmath.c:6
DebugCustomState
protected void DebugCustomState()
Definition: basebuildingbase.c:1165
m_SyncParts02
int m_SyncParts02
Definition: basebuildingbase.c:11
EEItemAttached
override void EEItemAttached(EntityAI item, string slot_name)
Definition: basebuildingbase.c:520
GetDismantleSoundByMaterial
protected string GetDismantleSoundByMaterial(string part_name)
Definition: basebuildingbase.c:1117
FoldBaseBuildingObject
ItemBase FoldBaseBuildingObject()
Definition: basebuildingbase.c:985
EEItemDetached
override void EEItemDetached(EntityAI item, string slot_name)
Definition: basebuildingbase.c:529
ResetActionSyncData
protected void ResetActionSyncData()
Definition: basebuildingbase.c:226
EntityAI
Definition: building.c:5
SOUND_BUILD_METAL
const string SOUND_BUILD_METAL
Definition: basebuildingbase.c:21
DestroyConstruction
void DestroyConstruction()
Definition: basebuildingbase.c:387
RegisterPartForSync
void RegisterPartForSync(int part_id)
Definition: basebuildingbase.c:122
GetOrientation
vector GetOrientation()
Definition: areadamagemanager.c:306
OnSetSlotLock
protected void OnSetSlotLock(int slotId, bool locked, bool was_locked)
Definition: basebuildingbase.c:537
UpdateAttachmentPhysics
void UpdateAttachmentPhysics(string slot_name, bool is_locked)
Definition: basebuildingbase.c:788