DayZ 1.26
DayZ Explorer by KGB
Загрузка...
Поиск...
Не найдено
Класс BaseBuildingBase

Защищенные члены

void Fence ()
 
override string GetConstructionKitType ()
 
override int GetMeleeTargetType ()
 
bool HasHinges ()
 
bool HasFullyConstructedGate ()
 
void SetGateState (int state)
 
int GetGateState ()
 
int CheckGateState ()
 
void SetOpenedState (bool state)
 
override bool IsOpened ()
 
bool IsLocked ()
 
override bool NameOverride (out string output)
 
CombinationLock GetCombinationLock ()
 
CamoNet GetCamoNet ()
 
BarbedWire GetBarbedWire1 ()
 
BarbedWire GetBarbedWire2 ()
 
override vector GetKitSpawnPosition ()
 
override bool CanDisplayAttachmentSlot (int slot_id)
 
override bool CanDisplayAttachmentCategory (string category_name)
 
override void OnStoreSave (ParamsWriteContext ctx)
 
override bool OnStoreLoad (ParamsReadContext ctx, int version)
 
override void AfterStoreLoad ()
 
override void OnVariablesSynchronized ()
 
override void OnPartBuiltServer (notnull Man player, string part_name, int action_id)
 
override void OnPartDismantledServer (notnull Man player, string part_name, int action_id)
 
override void OnPartDestroyedServer (Man player, string part_name, int action_id, bool destroyed_by_connected_part=false)
 
override bool CanReceiveAttachment (EntityAI attachment, int slotId)
 
override bool CanPutIntoHands (EntityAI parent)
 
override bool CanBeRepairedToPristine ()
 
bool CanOpenFence ()
 
bool CanCloseFence ()
 
void OpenFence ()
 
void CloseFence ()
 
void CheckFenceOpened ()
 
void CheckFenceClosed ()
 
override void CreateAreaDamage (string slot_name, float rotation_angle=0)
 
void UpdateBarbedWireAreaDamagePos (float rotation_angle=0, bool to_delete=false)
 
override void PostAreaDamageActions ()
 
override bool IsPlayerInside (PlayerBase player, string selection)
 
override bool IsFacingPlayer (PlayerBase player, string selection)
 
override bool IsFacingCamera (string selection)
 
override bool HasProperDistance (string selection, PlayerBase player)
 
override bool CanUseConstructionBuild ()
 
void SoundGateOpenStart ()
 
void SoundGateCloseStart ()
 
void SoundGateCloseEnd ()
 
void GateAttachmentsSanityCheck ()
 
void HandleDropAttachment (ItemBase item)
 
bool GateAttachmentConditions (int slotId)
 
override bool TranslateSlotFromSelection (string selection_name, out int slot_id)
 
override void SetActions ()
 
override array< stringOnDebugSpawnBuildExcludes ()
 Excludes certain parts from being built by OnDebugSpawn, uses Contains to compare.
 
override void OnDebugSpawn ()
 
void TerritoryFlag ()
 
void ~TerritoryFlag ()
 
void InitRefresherData ()
 
override string GetConstructionKitType ()
 
override int GetMeleeTargetType ()
 
override vector GetKitSpawnPosition ()
 
override bool CanDisplayAttachmentCategory (string category_name)
 
override void OnStoreSave (ParamsWriteContext ctx)
 
override bool OnStoreLoad (ParamsReadContext ctx, int version)
 
override void AfterStoreLoad ()
 
override void OnCEUpdate ()
 
void HandleRefreshers ()
 Client-side, saves positions of active lifetime refreshers to MissionGameplay.
 
void SetRefresherActive (bool state)
 
void InsertRefresherPosition ()
 
void RemoveRefresherPosition (int idx=-2)
 
override void OnVariablesSynchronized ()
 
override void OnPartBuiltServer (notnull Man player, string part_name, int action_id)
 
override void OnPartDismantledServer (notnull Man player, string part_name, int action_id)
 
override void OnPartDestroyedServer (Man player, string part_name, int action_id, bool destroyed_by_connected_part=false)
 
override void EEItemDetached (EntityAI item, string slot_name)
 
override bool CanReceiveAttachment (EntityAI attachment, int slotId)
 
override bool CanPutIntoHands (EntityAI parent)
 
override bool CanBeRepairedToPristine ()
 
override bool IsPlayerInside (PlayerBase player, string selection)
 
override bool IsFacingPlayer (PlayerBase player, string selection)
 
override bool IsFacingCamera (string selection)
 
override bool HasProperDistance (string selection, PlayerBase player)
 
override void SetActions ()
 
void AnimateFlagEx (float delta, PlayerBase player=null)
 
void AnimateFlag (float delta)
 
void LogAnimateFlag (float newPhase, notnull PlayerBase player)
 
void SetRefreshTimer01 (float fraction)
 
void AddRefresherTime01 (float fraction)
 
float GetRefresherTime01 ()
 
void CheckLoadedVariables (int max_duration)
 
override void OnDebugSpawn ()
 

Защищенные данные

bool m_ToDiscard = false
 
bool m_IsOpened = false
 
bool m_IsOpenedClient = false
 
int m_GateState = 0
 
EffectSound m_SoundGate_Start
 
EffectSound m_SoundGate_End
 
int m_FlagRefresherFrequency = GameConstants.REFRESHER_FREQUENCY_DEFAULT
 
int m_FlagRefresherMaxDuration = GameConstants.REFRESHER_MAX_DURATION_DEFAULT
 

Закрытые члены

void ShelterSite ()
 
override string GetConstructionKitType ()
 
override int GetMeleeTargetType ()
 
override vector GetKitSpawnPosition ()
 
override void OnPartBuiltServer (notnull Man player, string part_name, int action_id)
 
override bool CanPutIntoHands (EntityAI parent)
 
override bool CanBeRepairedToPristine ()
 
override bool CanUseHandConstruction ()
 
override bool MustBeBuiltFromOutside ()
 
override bool IsFacingCamera (string selection)
 
override bool IsPlayerInside (PlayerBase player, string selection)
 
override bool HasProperDistance (string selection, PlayerBase player)
 
override void SetActions ()
 
void Watchtower ()
 
override string GetConstructionKitType ()
 
override int GetMeleeTargetType ()
 
override void UpdateVisuals ()
 
override bool CanReceiveAttachment (EntityAI attachment, int slotId)
 
override bool CanPutIntoHands (EntityAI parent)
 
override bool CanBeRepairedToPristine ()
 
override bool PerformRoofCheckForBase (string partName, PlayerBase player, out bool result)
 
override bool CanDisplayAttachmentSlot (int slot_id)
 
override bool CanDisplayAttachmentCategory (string category_name)
 
override bool CheckSlotVerticalDistance (int slot_id, PlayerBase player)
 
override bool CheckMemoryPointVerticalDistance (float max_dist, string selection, PlayerBase player)
 
override bool CheckLevelVerticalDistance (float max_dist, string selection, PlayerBase player)
 
override void AfterStoreLoad ()
 
override void OnPartBuiltServer (notnull Man player, string part_name, int action_id)
 
override void OnPartDismantledServer (notnull Man player, string part_name, int action_id)
 
override void OnPartDestroyedServer (Man player, string part_name, int action_id, bool destroyed_by_connected_part=false)
 
override bool IsFacingPlayer (PlayerBase player, string selection)
 
override bool IsFacingCamera (string selection)
 
override bool IsPlayerInside (PlayerBase player, string selection)
 
override bool HasProperDistance (string selection, PlayerBase player)
 
override void SetActions ()
 
override array< stringOnDebugSpawnBuildExcludes ()
 Excludes certain parts from being built by OnDebugSpawn, uses Contains to compare.
 
override void OnDebugSpawn ()
 

Закрытые данные

const int GATE_STATE_NONE = 0
 
const int GATE_STATE_PARTIAL = 1
 
const int GATE_STATE_FULL = 2
 
const string ATTACHMENT_SLOT_COMBINATION_LOCK = "Att_CombinationLock"
 
const string SOUND_GATE_OPEN_START = "DoorWoodTowerOpen_SoundSet"
 
const string SOUND_GATE_CLOSE_START = "DoorWoodTowerClose_start_SoundSet"
 
const string SOUND_GATE_CLOSE_END = "DoorWoodTowerClose_end_SoundSet"
 
const float GATE_ROTATION_ANGLE_DEG = 100
 
const float GATE_ROTATION_TIME_APPROX = 2000
 
const float MAX_ACTION_DETECTION_ANGLE_RAD = 1.3
 
const float MAX_ACTION_DETECTION_DISTANCE = 2.0
 
 ATTACHMENT_WOODEN_LOG = WoodenLog
 
 ATTACHMENT_COMBINATION_LOCK = CombinationLock
 
string ATTSLOT_CAMONET = "Wall_Camonet"
 
string ATTSLOT_BARBEDWIRE_DOWN = "Wall_Barbedwire_1"
 
string ATTSLOT_BARBEDWIRE_UP = "Wall_Barbedwire_2"
 
bool m_RefresherActive
 
bool m_RefresherActiveLocal
 
bool m_RefresherInitialized
 
int m_RefresherTimeRemaining
 
int m_RefreshTimeCounter
 
 ATTACHMENT_BARBED_WIRE = BarbedWire
 
 ATTACHMENT_CAMONET = CamoNet
 
const float MAX_FLOOR_VERTICAL_DISTANCE = 0.5
 
const float MIN_ACTION_DETECTION_ANGLE_RAD = 0.35
 

Закрытые статические данные

static const string BASE_VIEW_NAME = "level_"
 
static const string BASE_WALL_NAME = "_wall_"
 
static const string BASE_ROOF_NAME = "_roof"
 
static const int MAX_WATCHTOWER_FLOORS = 3
 
static const int MAX_WATCHTOWER_WALLS = 3
 

Подробное описание

Конструктор(ы)

◆ ~TerritoryFlag()

void ~TerritoryFlag ( )
inlineprotected
30 {
32 }
void RemoveRefresherPosition(int idx=-2)
Definition Totem.c:215

Перекрестные ссылки RemoveRefresherPosition().

Методы

◆ AddRefresherTime01()

void AddRefresherTime01 ( float fraction)
inlineprotected
559 {
563 //Print(m_RefresherTimeRemaining);
564 }
void SetRefresherActive(bool state)
Definition Totem.c:196
int m_FlagRefresherMaxDuration
Definition Totem.c:13
int m_RefresherTimeRemaining
Definition Totem.c:9
Definition EnMath.c:7
Definition EntityAI.c:95
static proto float Round(float f)
Returns mathematical round of value.
static proto float Clamp(float value, float min, float max)
Clamps 'value' to 'min' if it is lower than 'min', or to 'max' if it is higher than 'max'.

Перекрестные ссылки Math::Clamp(), Math::Round() и SetRefresherActive().

Используется в OnDebugSpawn().

◆ AfterStoreLoad() [1/3]

override void AfterStoreLoad ( )
inlineprotected
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 }
Construction GetConstruction()
Definition BaseBuildingBase.c:2128
class BaseBuildingBase extends ItemBase bsbDebugPrint(string s)
Definition BaseBuildingBase.c:1234
override void UpdateVisuals()
Definition Watchtower.c:44
void OpenFence()
Definition Fence.c:447
override bool IsOpened()
Definition Fence.c:110
void SetGateState(int state)
Definition Fence.c:66
int CheckGateState()
Definition Fence.c:77
Definition ConstructionPart.c:2
Definition Debug.c:600
static bool IsBaseBuildingLogEnable()
Definition Debug.c:704

Перекрестные ссылки bsbDebugPrint(), CheckGateState(), GetConstruction(), LogManager::IsBaseBuildingLogEnable(), IsOpened(), IsOpened(), OpenFence(), SetGateState() и UpdateVisuals().

◆ AfterStoreLoad() [2/3]

override void AfterStoreLoad ( )
inlineprotected
146 {
147 super.AfterStoreLoad();
148
150 {
152 }
153 SetSynchDirty();
155 }
proto native CEApi GetCEApi()
Get the CE API.
bool m_RefresherInitialized
Definition Totem.c:8
void InitRefresherData()
Definition Totem.c:34

Перекрестные ссылки GetCEApi(), InitRefresherData() и UpdateVisuals().

◆ AfterStoreLoad() [3/3]

override void AfterStoreLoad ( )
inlineprivate
400 {
401 super.AfterStoreLoad();
402
404 }

Перекрестные ссылки UpdateVisuals().

◆ AnimateFlag()

void AnimateFlag ( float delta)
inlineprotected
525 {
527 }
void AnimateFlagEx(float delta, PlayerBase player=null)
Definition Totem.c:504

Перекрестные ссылки AnimateFlagEx().

Используется в EEItemDetached(), OnCEUpdate(), OnDebugSpawn() и OnStoreLoad().

◆ AnimateFlagEx()

void AnimateFlagEx ( float delta,
PlayerBase player = null )
inlineprotected
505 {
506 float temp = Math.Clamp( delta,0,1 );
507 float phase_new;
508 if (temp < 0.01 || temp > 0.99)
509 {
511 }
512 else
513 phase_new = temp;
514
515 SetAnimationPhase("flag_mast",phase_new);
516
517 if (player)
519
520 GetInventory().SetSlotLock(InventorySlots.GetSlotIdFromString("Material_FPole_Flag"),phase_new != 1);
521
522 }
void LogAnimateFlag(float newPhase, notnull PlayerBase player)
Definition Totem.c:529
provides access to slot configuration
Definition InventorySlots.c:6
static proto native int GetSlotIdFromString(string slot_name)
converts string to slot_id

Перекрестные ссылки Math::Clamp(), InventorySlots::GetSlotIdFromString(), LogAnimateFlag() и Math::Round().

Используется в AnimateFlag().

◆ CanBeRepairedToPristine() [1/4]

override bool CanBeRepairedToPristine ( )
inlineprotected
422 {
423 return true;
424 }

◆ CanBeRepairedToPristine() [2/4]

override bool CanBeRepairedToPristine ( )
inlineprivate
79 {
80 return true;
81 }

◆ CanBeRepairedToPristine() [3/4]

override bool CanBeRepairedToPristine ( )
inlineprotected
367 {
368 return true;
369 }

◆ CanBeRepairedToPristine() [4/4]

override bool CanBeRepairedToPristine ( )
inlineprivate
129 {
130 return true;
131 }

◆ CanCloseFence()

bool CanCloseFence ( )
inlineprotected
438 {
439 if ( HasHinges() && IsOpened() )
440 {
441 return true;
442 }
443
444 return false;
445 }
bool HasHinges()
Definition Fence.c:56

Перекрестные ссылки HasHinges() и IsOpened().

◆ CanDisplayAttachmentCategory() [1/3]

override bool CanDisplayAttachmentCategory ( string category_name)
inlineprotected
198 {
199 if ( category_name == "Attachments" || category_name == "Material" )
200 {
201 if ( !HasBase() )
202 {
203 return false;
204 }
205 }
206
207 return true;
208 }
bool HasBase()
Definition BaseBuildingBase.c:1562

Перекрестные ссылки HasBase().

◆ CanDisplayAttachmentCategory() [2/3]

override bool CanDisplayAttachmentCategory ( string category_name)
inlineprotected
86 {
87 if ( category_name == "Base" && !HasBase() )
88 return true;
89 else if ( category_name == "Support" && HasBase() && !GetConstruction().IsPartConstructed("support") )
90 return true;
91 else if ( category_name == "Pole" && GetConstruction().IsPartConstructed("support") && !GetConstruction().IsPartConstructed("pole") )
92 return true;
93 else if ( category_name == "Flag" && GetConstruction().IsPartConstructed("pole") )
94 return true;
95 else
96 return false;
97 }
bool IsPartConstructed(string part_name)
Definition Construction.c:603

Перекрестные ссылки GetConstruction(), HasBase() и IsPartConstructed().

◆ CanDisplayAttachmentCategory() [3/3]

override bool CanDisplayAttachmentCategory ( string category_name)
inlineprivate
246 {
247 //super
248 if ( !super.CanDisplayAttachmentCategory( category_name ) )
249 return false;
250 //
251
252 category_name.ToLower();
254 //level 1
255 if ( category_name.Contains( "level_1" ) )
256 {
257 if ( category_name.Contains( "level_1_" ) )
258 {
259 return GetConstruction().IsPartConstructed( "level_1_base" ) && CheckMemoryPointVerticalDistance( MAX_FLOOR_VERTICAL_DISTANCE, "level_1", player );
260 }
261 else
262 {
264 }
265 }
266 //level 2
267 if ( category_name.Contains( "level_2" ) )
268 {
269 if ( category_name.Contains( "level_2_" ) )
270 {
271 return GetConstruction().IsPartConstructed( "level_2_base" ) && CheckMemoryPointVerticalDistance( MAX_FLOOR_VERTICAL_DISTANCE, "level_2", player );
272 }
273 else
274 {
275 return GetConstruction().IsPartConstructed( "level_1_roof" ) && CheckMemoryPointVerticalDistance( MAX_FLOOR_VERTICAL_DISTANCE, "level_2", player );
276 }
277 }
278 //level 3
279 if ( category_name.Contains( "level_3" ) )
280 {
281 if ( category_name.Contains( "level_3_" ) )
282 {
283 return GetConstruction().IsPartConstructed( "level_3_base" ) && CheckMemoryPointVerticalDistance( MAX_FLOOR_VERTICAL_DISTANCE, "level_3", player );
284 }
285 else
286 {
287 return GetConstruction().IsPartConstructed( "level_2_roof" ) && CheckMemoryPointVerticalDistance( MAX_FLOOR_VERTICAL_DISTANCE, "level_3", player );
288 }
289 }
290
291 return true;
292 }
PlayerBase GetPlayer()
Definition ModifierBase.c:51
override bool CheckMemoryPointVerticalDistance(float max_dist, string selection, PlayerBase player)
Definition Watchtower.c:357
const float MAX_FLOOR_VERTICAL_DISTANCE
Definition Watchtower.c:6
Definition PlayerBaseClient.c:2
proto native CGame GetGame()

Перекрестные ссылки CheckMemoryPointVerticalDistance(), GetConstruction(), GetGame() и GetPlayer().

◆ CanDisplayAttachmentSlot() [1/2]

override bool CanDisplayAttachmentSlot ( int slot_id)
inlineprotected
177 {
178 if (!super.CanDisplayAttachmentSlot(slot_id))
179 return false;
180
182
183 if ( slot_name == "Att_CombinationLock" )
184 {
186 {
187 return false;
188 }
189 }
190
192 return false;
193
194 return true;
195 }
bool HasFullyConstructedGate()
Definition Fence.c:61
bool GateAttachmentConditions(int slotId)
Definition Fence.c:789
static proto native owned string GetSlotName(int id)
converts slot_id to string

Перекрестные ссылки GateAttachmentConditions(), InventorySlots::GetSlotIdFromString(), InventorySlots::GetSlotName() и HasFullyConstructedGate().

◆ CanDisplayAttachmentSlot() [2/2]

override bool CanDisplayAttachmentSlot ( int slot_id)
inlineprivate
199 {
200 //super
201 if ( !super.CanDisplayAttachmentSlot( slot_id ) )
202 return false;
203
205 slot_name.ToLower();
207 //base attachments
208 if ( slot_name.Contains( "material_l1" ) || slot_name.Contains( "level_1_" ) )
209 {
210 if ( slot_name.Contains( "woodenlogs" ) )
211 {
213 }
214 else
215 {
216 return GetConstruction().IsPartConstructed( "level_1_base" ) && CheckMemoryPointVerticalDistance( MAX_FLOOR_VERTICAL_DISTANCE, "level_1", player );
217 }
218 }
219 else if ( slot_name.Contains( "material_l2" ) || slot_name.Contains( "level_2_" ) )
220 {
221 if ( slot_name.Contains( "woodenlogs" ) )
222 {
224 }
225 else
226 {
227 return GetConstruction().IsPartConstructed( "level_2_base" ) && CheckMemoryPointVerticalDistance( MAX_FLOOR_VERTICAL_DISTANCE, "level_2", player );
228 }
229 }
230 else if ( slot_name.Contains( "material_l3" ) || slot_name.Contains( "level_3_" ) )
231 {
232 if ( slot_name.Contains( "woodenlogs" ) )
233 {
235 }
236 else
237 {
238 return GetConstruction().IsPartConstructed( "level_3_base" ) && CheckMemoryPointVerticalDistance( MAX_FLOOR_VERTICAL_DISTANCE, "level_3", player );
239 }
240 }
241
242 return true;
243 }

Перекрестные ссылки CheckMemoryPointVerticalDistance(), GetConstruction(), GetGame(), GetPlayer() и InventorySlots::GetSlotName().

◆ CanOpenFence()

bool CanOpenFence ( )
inlineprotected
428 {
429 if ( HasHinges() && !IsOpened() && !IsLocked() )
430 {
431 return true;
432 }
433
434 return false;
435 }
bool IsLocked()
Definition Fence.c:115

Перекрестные ссылки HasHinges(), IsLocked() и IsOpened().

◆ CanPutIntoHands() [1/4]

override bool CanPutIntoHands ( EntityAI parent)
inlineprotected
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 }

Перекрестные ссылки HasBase().

◆ CanPutIntoHands() [2/4]

override bool CanPutIntoHands ( EntityAI parent)
inlineprivate
74 {
75 return false;
76 }

◆ CanPutIntoHands() [3/4]

override bool CanPutIntoHands ( EntityAI parent)
inlineprotected
362 {
363 return false;
364 }

◆ CanPutIntoHands() [4/4]

override bool CanPutIntoHands ( EntityAI parent)
inlineprivate
124 {
125 return false;
126 }

◆ CanReceiveAttachment() [1/3]

override bool CanReceiveAttachment ( EntityAI attachment,
int slotId )
inlineprotected
368 {
369 if ( !super.CanReceiveAttachment(attachment, slotId) )
370 return false;
371
372 //manage action initiator (AT_ATTACH_TO_CONSTRUCTION)
373 if ( !GetGame().IsDedicatedServer() )
374 {
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
400 return false;
401
402 return true;
403 }
ATTACHMENT_COMBINATION_LOCK
Definition Fence.c:20
ATTACHMENT_WOODEN_LOG
Definition Fence.c:19
Definition ConstructionActionData.c:2

Перекрестные ссылки GateAttachmentConditions(), GetGame(), GetPlayer(), HasBase(), HasFullyConstructedGate() и IsOpened().

◆ CanReceiveAttachment() [2/3]

override bool CanReceiveAttachment ( EntityAI attachment,
int slotId )
inlineprotected
293 {
294 if ( !super.CanReceiveAttachment(attachment, slotId) )
295 return false;
296
297 //manage action initiator (AT_ATTACH_TO_CONSTRUCTION)
298 if ( !GetGame().IsDedicatedServer() )
299 {
301 if ( player )
302 {
303 ConstructionActionData construction_action_data = player.GetConstructionActionData();
304
305 //reset action initiator
306 construction_action_data.SetActionInitiator( NULL );
307 }
308 }
309
310 //conditions
312 //flag item attachment
313 if ( slot_name == "Material_FPole_Flag" )
314 {
315 if ( GetConstruction().IsPartConstructed("pole") )
316 return true;
317 else
318 return false;
319 }
320 //materials
323 int part_id = -1;
324 for (int i = 0; i < GetConstruction().GetConstructionParts().Count(); i++)
325 {
326 part = GetConstruction().GetConstructionParts().GetElement(i);
327 if (!part.IsBuilt())
328 {
329 if (part_id == -1 || part_id > part.GetId())
330 {
332 part_id = part.GetId();
333 }
334 }
335 }
336
337 if (part_lowest /*&& !part_lowest.IsBuilt()*/)
338 {
339 string cfg_path = "cfgVehicles " + GetType() + " Construction " + part_lowest.GetMainPartName() + " " + part_lowest.GetPartName() + " Materials";
340 string material_path;
341 if ( GetGame().ConfigIsExisting(cfg_path) )
342 {
343 string child_name;
344 string child_slot_name;
345 for ( i = 0; i < GetGame().ConfigGetChildrenCount( cfg_path ); i++ )
346 {
347 GetGame().ConfigGetChildName( cfg_path, i, child_name );
348 material_path = "" + cfg_path + " " + child_name + " slot_name";
350 {
351 return true;
352 }
353 }
354 }
355 }
356
357 return false;
358 }
eBleedingSourceType GetType()
Definition BleedingSource.c:63

Перекрестные ссылки GetConstruction(), GetGame(), GetPlayer(), InventorySlots::GetSlotName(), GetType() и IsPartConstructed().

◆ CanReceiveAttachment() [3/3]

override bool CanReceiveAttachment ( EntityAI attachment,
int slotId )
inlineprivate
91 {
92 if ( !super.CanReceiveAttachment( attachment, slotId ) )
93 return false;
94
95 //because CanReceiveAttachment() method can be called on all clients in the vicinity, vertical distance check needs to be skipped on clients that don't
96 //interact with the object through attach action (AT_ATTACH_TO_CONSTRUCTION)
98 if ( !GetGame().IsDedicatedServer() )
99 {
100 //check action initiator (AT_ATTACH_TO_CONSTRUCTION)
101 player = PlayerBase.Cast( GetGame().GetPlayer() );
102 if ( player )
103 {
104 ConstructionActionData construction_action_data = player.GetConstructionActionData();
106
107 if ( action_initiator == player )
108 {
109 construction_action_data.SetActionInitiator( NULL ); //reset action initiator
110 }
111 else
112 {
113 player = null; //do not do vertical check (next)
114 }
115 }
116 }
117 //
118
120 }
override bool CheckSlotVerticalDistance(int slot_id, PlayerBase player)
Definition Watchtower.c:295

Перекрестные ссылки CheckSlotVerticalDistance(), GetGame() и GetPlayer().

◆ CanUseConstructionBuild()

override bool CanUseConstructionBuild ( )
inlineprotected
719 {
720 return !IsOpened();
721 }

Перекрестные ссылки IsOpened().

◆ CanUseHandConstruction()

override bool CanUseHandConstruction ( )
inlineprivate
84 {
85 return true;
86 }

◆ CheckFenceClosed()

void CheckFenceClosed ( )
inlineprotected
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
553 GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).Remove( CheckFenceClosed );
554 }
555 }
void SoundGateCloseEnd()
Definition Fence.c:744
void CheckFenceClosed()
Definition Fence.c:541
void UpdateBarbedWireAreaDamagePos(float rotation_angle=0, bool to_delete=false)
Definition Fence.c:569
const int CALL_CATEGORY_GAMEPLAY
Definition tools.c:10

Перекрестные ссылки CALL_CATEGORY_GAMEPLAY, GetGame(), SoundGateCloseEnd() и UpdateBarbedWireAreaDamagePos().

◆ CheckFenceOpened()

void CheckFenceOpened ( )
inlineprotected
532 {
533 if ( GetAnimationPhase( "Wall_Gate_Rotate" ) == GATE_ROTATION_ANGLE_DEG ) //animation finished - open
534 {
535 UpdateBarbedWireAreaDamagePos(GetAnimationPhase( "Wall_Gate_Rotate" ));
536 //remove check
537 GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).Remove( CheckFenceOpened );
538 }
539 }
const float GATE_ROTATION_ANGLE_DEG
Definition Fence.c:13
void CheckFenceOpened()
Definition Fence.c:531

Перекрестные ссылки CALL_CATEGORY_GAMEPLAY, GetGame() и UpdateBarbedWireAreaDamagePos().

◆ CheckGateState()

int CheckGateState ( )
inlineprotected
78 {
79 ConstructionPart gate_part = GetConstruction().GetGateConstructionPart();
81 if( gate_part.IsBuilt() )
82 {
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 {
95 }
96 else
97 {
99 }
100
101 }
102 return state;
103 }
const int GATE_STATE_NONE
Definition Fence.c:3
const int GATE_STATE_FULL
Definition Fence.c:5
const int GATE_STATE_PARTIAL
Definition Fence.c:4

Перекрестные ссылки GATE_STATE_FULL, GATE_STATE_NONE, GATE_STATE_PARTIAL и GetConstruction().

Используется в AfterStoreLoad(), OnPartBuiltServer(), OnPartDestroyedServer() и OnPartDismantledServer().

◆ CheckLevelVerticalDistance()

override bool CheckLevelVerticalDistance ( float max_dist,
string selection,
PlayerBase player )
inlineprivate
384 {
385 if ( player )
386 {
387 if ( selection.Contains( "level_1_" ) )
389
390 if ( selection.Contains( "level_2_" ) )
392
393 if ( selection.Contains( "level_3_" ) )
395 }
396 return false;
397 }
bool Contains(string sample)
Returns true if sample is substring of string.
Definition EnString.c:286

Перекрестные ссылки CheckMemoryPointVerticalDistance() и string::Contains().

Используется в IsPlayerInside().

◆ CheckLoadedVariables()

void CheckLoadedVariables ( int max_duration)
inlineprotected

◆ CheckMemoryPointVerticalDistance()

override bool CheckMemoryPointVerticalDistance ( float max_dist,
string selection,
PlayerBase player )
inlineprivate
358 {
359 if ( player )
360 {
361 //check vertical distance
362 vector player_pos = player.GetPosition();
363 vector pos;
364
365 if ( MemoryPointExists( selection ) )
366 {
367 pos = ModelToWorld( GetMemoryPointPos( selection ) );
368 }
369
370 if ( Math.AbsFloat( player_pos[1] - pos[1] ) <= max_dist )
371 {
372 return true;
373 }
374 else
375 {
376 return false;
377 }
378 }
379
380 return true;
381 }
Definition EnConvert.c:106
static proto float AbsFloat(float f)
Returns absolute value.

Перекрестные ссылки Math::AbsFloat().

Используется в CanDisplayAttachmentCategory(), CanDisplayAttachmentSlot(), CheckLevelVerticalDistance() и CheckSlotVerticalDistance().

◆ CheckSlotVerticalDistance()

override bool CheckSlotVerticalDistance ( int slot_id,
PlayerBase player )
inlineprivate
296 {
297 string slot_name;
299 slot_name.ToLower();
300
301 //wall attachments
302 //level 1
303 if ( slot_name.Contains( "material_l1" ) || slot_name.Contains( "level_1_" ) )
304 {
305 if ( slot_name.Contains( "woodenlogs" ) )
306 {
308 }
309 else
310 {
311 return GetConstruction().IsPartConstructed( "level_1_base" ) && CheckMemoryPointVerticalDistance( MAX_FLOOR_VERTICAL_DISTANCE, "level_1", player );
312 }
313 }
314 //level 2
315 if ( slot_name.Contains( "material_l2" ) || slot_name.Contains( "level_2_" ) )
316 {
317 if ( slot_name.Contains( "material_l2w" ) || slot_name.Contains( "level_2_wall" ) )
318 {
319 return GetConstruction().IsPartConstructed( "level_2_base" ) && CheckMemoryPointVerticalDistance( MAX_FLOOR_VERTICAL_DISTANCE, "level_2", player );
320 }
321 else
322 {
323 if ( slot_name.Contains( "woodenlogs" ) )
324 {
326 }
327 else
328 {
329 return GetConstruction().IsPartConstructed( "level_1_roof" ) && CheckMemoryPointVerticalDistance( MAX_FLOOR_VERTICAL_DISTANCE, "level_2", player );
330 }
331 }
332 }
333 //level 3
334 if ( slot_name.Contains( "material_l3" ) || slot_name.Contains( "level_3_" ) )
335 {
336 if ( slot_name.Contains( "material_l3w" ) || slot_name.Contains( "level_3_wall" ) )
337 {
338 return GetConstruction().IsPartConstructed( "level_3_base" ) && CheckMemoryPointVerticalDistance( MAX_FLOOR_VERTICAL_DISTANCE, "level_3", player );
339 }
340 else
341 {
342 if ( slot_name.Contains( "woodenlogs" ) )
343 {
345 }
346 else
347 {
348 return GetConstruction().IsPartConstructed( "level_2_roof" ) && CheckMemoryPointVerticalDistance( MAX_FLOOR_VERTICAL_DISTANCE, "level_3", player );
349 }
350 }
351 }
352
353 return true;
354 }
static proto bool GetSelectionForSlotId(int slot_Id, out string selection)

Перекрестные ссылки CheckMemoryPointVerticalDistance(), GetConstruction() и InventorySlots::GetSelectionForSlotId().

Используется в CanReceiveAttachment().

◆ CloseFence()

void CloseFence ( )
inlineprotected
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
510 GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).CallLater( UpdateNavmesh, GATE_ROTATION_TIME_APPROX, false );
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
527 GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).Remove(CheckFenceOpened);
528 GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).CallLater( CheckFenceClosed, 0, true );
529 }
void UpdateNavmesh()
Definition BaseBuildingBase.c:2058
void SynchronizeBaseState()
Definition BaseBuildingBase.c:1326
const float GATE_ROTATION_TIME_APPROX
Definition Fence.c:14
void SoundGateCloseStart()
Definition Fence.c:735
void SetOpenedState(bool state)
Definition Fence.c:105

Перекрестные ссылки CALL_CATEGORY_GAMEPLAY, GetGame(), SetOpenedState(), SoundGateCloseStart(), SynchronizeBaseState(), UpdateBarbedWireAreaDamagePos() и UpdateNavmesh().

Используется в OnPartDestroyedServer() и OnVariablesSynchronized().

◆ CreateAreaDamage()

override void CreateAreaDamage ( string slot_name,
float rotation_angle = 0 )
inlineprotected
559 {
560 if ( IsOpened() )
561 {
562 rotation_angle = 100;
563 }
564
565 super.CreateAreaDamage( slot_name, rotation_angle );
566 }

Перекрестные ссылки IsOpened().

◆ EEItemDetached()

override void EEItemDetached ( EntityAI item,
string slot_name )
inlineprotected
278 {
279 super.EEItemDetached( item, slot_name );
280
281 if (GetGame().IsServer()) // reset totem state is flag is decrafted while raised
282 {
283 float state = GetAnimationPhase("flag_mast");
284 if (state < 1)
285 {
286 AnimateFlag(1);
288 }
289 }
290 }
void AnimateFlag(float delta)
Definition Totem.c:524
void SetRefreshTimer01(float fraction)
Definition Totem.c:545

Перекрестные ссылки AnimateFlag(), GetGame() и SetRefreshTimer01().

◆ Fence()

void Fence ( )
inlineprotected
37 {
38 //synchronized variables
39 //RegisterNetSyncVariableBool( "m_HasHinges" );
40 //RegisterNetSyncVariableBool( "m_GateFullyConstructed" );
41 RegisterNetSyncVariableBool( "m_IsOpened" );
42 RegisterNetSyncVariableInt( "m_GateState" );
43 }

◆ GateAttachmentConditions()

bool GateAttachmentConditions ( int slotId)
inlineprotected
790 {
792 {
793 ConstructionPart wall_base_down = GetConstruction().GetConstructionPart("wall_base_down");
794 ConstructionPart wall_base_up = GetConstruction().GetConstructionPart("wall_base_up");
796 if ( !wall_base_up.IsBuilt() )
797 {
799 {
800 return false;
801 }
802 }
803 if ( !wall_base_down.IsBuilt() )
804 {
806 {
807 return false;
808 }
809 }
810 }
811 return true;
812 }
string ATTSLOT_BARBEDWIRE_UP
Definition Fence.c:24
string ATTSLOT_BARBEDWIRE_DOWN
Definition Fence.c:23
string ATTSLOT_CAMONET
Definition Fence.c:22
int GetGateState()
Definition Fence.c:72

Перекрестные ссылки GetConstruction(), GetGateState() и InventorySlots::GetSlotName().

Используется в CanDisplayAttachmentSlot() и CanReceiveAttachment().

◆ GateAttachmentsSanityCheck()

void GateAttachmentsSanityCheck ( )
inlineprotected
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 }
CombinationLock GetCombinationLock()
Definition Fence.c:137
BarbedWire GetBarbedWire2()
Definition Fence.c:155
void HandleDropAttachment(ItemBase item)
Definition Fence.c:770
BarbedWire GetBarbedWire1()
Definition Fence.c:149
CamoNet GetCamoNet()
Definition Fence.c:143

Перекрестные ссылки GetBarbedWire1(), GetBarbedWire2(), GetCamoNet(), GetCombinationLock(), GetConstruction() и HandleDropAttachment().

◆ GetBarbedWire1()

BarbedWire GetBarbedWire1 ( )
inlineprotected
150 {
151 BarbedWire barbedwire = BarbedWire.Cast( FindAttachmentBySlotName( "Wall_Barbedwire_1" ) );
152 return barbedwire;
153 }

Используется в GateAttachmentsSanityCheck(), OnPartDestroyedServer() и UpdateBarbedWireAreaDamagePos().

◆ GetBarbedWire2()

BarbedWire GetBarbedWire2 ( )
inlineprotected
156 {
157 BarbedWire barbedwire = BarbedWire.Cast( FindAttachmentBySlotName( "Wall_Barbedwire_2" ) );
158 return barbedwire;
159 }

Используется в GateAttachmentsSanityCheck(), OnPartDestroyedServer() и UpdateBarbedWireAreaDamagePos().

◆ GetCamoNet()

CamoNet GetCamoNet ( )
inlineprotected
144 {
145 CamoNet camonet = CamoNet.Cast( FindAttachmentBySlotName( "Wall_Camonet" ) );
146 return camonet;
147 }

Используется в GateAttachmentsSanityCheck() и OnPartDestroyedServer().

◆ GetCombinationLock()

CombinationLock GetCombinationLock ( )
inlineprotected
138 {
140 return combination_lock;
141 }
const string ATTACHMENT_SLOT_COMBINATION_LOCK
Definition Fence.c:7
Definition CombinationLock4.c:2

Используется в GateAttachmentsSanityCheck(), IsLocked() и OnPartDestroyedServer().

◆ GetConstructionKitType() [1/4]

override string GetConstructionKitType ( )
inlineprotected
46 {
47 return "FenceKit";
48 }

Используется в ItemBase::CreateConstructionKit() и ItemBase::CreateConstructionKitInHands().

◆ GetConstructionKitType() [2/4]

override string GetConstructionKitType ( )
inlineprivate
11 {
12 return "ShelterKit";
13 }

◆ GetConstructionKitType() [3/4]

override string GetConstructionKitType ( )
inlineprotected
51 {
52 return "TerritoryFlagKit";
53 }

◆ GetConstructionKitType() [4/4]

override string GetConstructionKitType ( )
inlineprivate
22 {
23 return "WatchtowerKit";
24 }

◆ GetGateState()

int GetGateState ( )
inlineprotected
73 {
74 return m_GateState;
75 }
int m_GateState
Definition Fence.c:31

Перекрестные ссылки m_GateState.

Используется в GateAttachmentConditions().

◆ GetKitSpawnPosition() [1/3]

override vector GetKitSpawnPosition ( )
inlineprotected
163 {
164 if ( MemoryPointExists( "kit_spawn_position" ) )
165 {
167 position = GetMemoryPointPos( "kit_spawn_position" );
168
169 return ModelToWorld( position );
170 }
171
172 return GetPosition();
173 }
class JsonUndergroundAreaTriggerData GetPosition
Definition UndergroundAreaLoader.c:9

Перекрестные ссылки GetPosition.

Используется в ItemBase::CreateConstructionKit().

◆ GetKitSpawnPosition() [2/3]

override vector GetKitSpawnPosition ( )
inlineprivate
22 {
23 if ( MemoryPointExists( "kit_spawn_position" ) )
24 {
26 position = GetMemoryPointPos( "kit_spawn_position" );
27
28 return ModelToWorld( position );
29 }
30
31 return GetPosition();
32 }

Перекрестные ссылки GetPosition.

◆ GetKitSpawnPosition() [3/3]

override vector GetKitSpawnPosition ( )
inlineprotected
73 {
74 if ( MemoryPointExists( "kit_spawn_position" ) )
75 {
77 position = GetMemoryPointPos( "kit_spawn_position" );
78
79 return ModelToWorld( position );
80 }
81
82 return GetPosition();
83 }

Перекрестные ссылки GetPosition.

◆ GetMeleeTargetType() [1/4]

override int GetMeleeTargetType ( )
inlineprotected
51 {
52 return EMeleeTargetType.NONALIGNABLE;
53 }
EMeleeTargetType
Definition EMeleeTargetType.c:2

◆ GetMeleeTargetType() [2/4]

override int GetMeleeTargetType ( )
inlineprivate
16 {
17 return EMeleeTargetType.NONALIGNABLE;
18 }

◆ GetMeleeTargetType() [3/4]

override int GetMeleeTargetType ( )
inlineprotected
56 {
57 return EMeleeTargetType.NONALIGNABLE;
58 }

◆ GetMeleeTargetType() [4/4]

override int GetMeleeTargetType ( )
inlineprivate
27 {
28 return EMeleeTargetType.NONALIGNABLE;
29 }

◆ GetRefresherTime01()

float GetRefresherTime01 ( )
inlineprotected

Перекрестные ссылки m_FlagRefresherMaxDuration.

Используется в OnCEUpdate() и OnStoreLoad().

◆ HandleDropAttachment()

void HandleDropAttachment ( ItemBase item)
inlineprotected
771 {
772 BarbedWire wire;
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 }
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Definition Inventory.c:22
Super root of all classes in Enforce script.
Definition EnScript.c:11
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.

Перекрестные ссылки Class::CastTo().

Используется в GateAttachmentsSanityCheck() и OnPartDestroyedServer().

◆ HandleRefreshers()

void HandleRefreshers ( )
inlineprotected

Client-side, saves positions of active lifetime refreshers to MissionGameplay.

180 {
181 Mission mission = GetGame().GetMission();
183 return;
184
186 if ( m_RefresherActive && idx == -1 )
187 {
189 }
190 else if ( !m_RefresherActive && idx > -1 )
191 {
193 }
194 }
Mission mission
Definition DisplayStatus.c:28
void InsertRefresherPosition()
Definition Totem.c:209
bool m_RefresherActive
Definition Totem.c:6
Mission class.
Definition gameplay.c:681
ref array< vector > m_ActiveRefresherLocations
Definition gameplay.c:684

Перекрестные ссылки GetGame(), GetPosition, InsertRefresherPosition(), Mission::m_ActiveRefresherLocations, mission и RemoveRefresherPosition().

Используется в OnVariablesSynchronized().

◆ HasFullyConstructedGate()

bool HasFullyConstructedGate ( )
inlineprotected
62 {
64 }

Перекрестные ссылки GATE_STATE_FULL.

Используется в CanDisplayAttachmentSlot() и CanReceiveAttachment().

◆ HasHinges()

bool HasHinges ( )
inlineprotected
57 {
59 }

Перекрестные ссылки GATE_STATE_NONE.

Используется в CanCloseFence() и CanOpenFence().

◆ HasProperDistance() [1/4]

override bool HasProperDistance ( string selection,
PlayerBase player )
inlineprotected
704 {
705 if ( MemoryPointExists( selection ) )
706 {
707 vector selection_pos = ModelToWorld( GetMemoryPointPos( selection ) );
708 float distance = vector.Distance( selection_pos, player.GetPosition() );
710 {
711 return false;
712 }
713 }
714
715 return true;
716 }
const float MAX_ACTION_DETECTION_DISTANCE
Definition Fence.c:17
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.

Перекрестные ссылки vector::Distance().

◆ HasProperDistance() [2/4]

override bool HasProperDistance ( string selection,
PlayerBase player )
inlineprivate
151 {
152 if ( MemoryPointExists( selection ) )
153 {
154 vector selection_pos = ModelToWorld( GetMemoryPointPos( selection ) );
155 float distance = vector.Distance( selection_pos, player.GetPosition() );
157 {
158 return false;
159 }
160 }
161
162 return true;
163 }

Перекрестные ссылки vector::Distance().

◆ HasProperDistance() [3/4]

override bool HasProperDistance ( string selection,
PlayerBase player )
inlineprotected
467 {
468 //TODO
469 if ( MemoryPointExists( selection ) )
470 {
471 vector selection_pos = ModelToWorld( GetMemoryPointPos( selection ) );
472 float distance = vector.Distance( selection_pos, player.GetPosition() );
474 {
475 return false;
476 }
477 }
478
479 return true;
480 }

Перекрестные ссылки vector::Distance().

◆ HasProperDistance() [4/4]

override bool HasProperDistance ( string selection,
PlayerBase player )
inlineprivate
547 {
548 if ( MemoryPointExists( selection ) )
549 {
550 vector selection_pos = ModelToWorld( GetMemoryPointPos( selection ) );
551 float distance = vector.Distance( selection_pos, player.GetPosition() );
553 {
554 return false;
555 }
556 }
557
558 return true;
559 }

Перекрестные ссылки vector::Distance().

◆ InitRefresherData()

void InitRefresherData ( )
inlineprotected
35 {
36 int frequency = GetCEApi().GetCEGlobalInt("FlagRefreshFrequency");
37 int max_duration = GetCEApi().GetCEGlobalInt("FlagRefreshMaxDuration");
38
39 if ( frequency > 0)
40 {
42 }
43 if ( max_duration > 0 )
44 {
46 }
48 }
int m_FlagRefresherFrequency
Definition Totem.c:12

Перекрестные ссылки GetCEApi().

Используется в AfterStoreLoad() и TerritoryFlag().

◆ InsertRefresherPosition()

void InsertRefresherPosition ( )
inlineprotected
210 {
211 Mission mission = GetGame().GetMission();
213 }

Перекрестные ссылки GetGame(), GetPosition, Mission::m_ActiveRefresherLocations и mission.

Используется в HandleRefreshers().

◆ IsFacingCamera() [1/4]

override bool IsFacingCamera ( string selection)
inlineprotected
679 {
680 vector ref_dir = GetDirection();
681 vector cam_dir = GetGame().GetCurrentCameraDirection();
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
695 {
696 return true;
697 }
698 }
699
700 return false;
701 }
const float MAX_ACTION_DETECTION_ANGLE_RAD
Definition Fence.c:16
static proto float Acos(float c)
Returns angle in radians from cosinus.

Перекрестные ссылки Math::Acos() и GetGame().

◆ IsFacingCamera() [2/4]

override bool IsFacingCamera ( string selection)
inlineprivate
94 {
95 vector ref_dir = GetDirection();
96 vector cam_dir = GetGame().GetCurrentCameraDirection();
97
98 //ref_dir = GetGame().GetCurrentCameraPosition() - GetPosition();
99 ref_dir.Normalize();
100 ref_dir[1] = 0; //ignore height
101
102 cam_dir.Normalize();
103 cam_dir[1] = 0; //ignore height
104
105 if ( ref_dir.Length() != 0 )
106 {
107 float angle = Math.Acos( cam_dir * ref_dir );
108
110 {
111 return true;
112 }
113 }
114
115 return false;
116 }

Перекрестные ссылки Math::Acos() и GetGame().

◆ IsFacingCamera() [3/4]

override bool IsFacingCamera ( string selection)
inlineprotected
440 {
441 return false; //TODO
442
443 vector ref_dir = GetDirection();
444 vector cam_dir = GetGame().GetCurrentCameraDirection();
445
446 //ref_dir = GetGame().GetCurrentCameraPosition() - GetPosition();
447 ref_dir.Normalize();
448 ref_dir[1] = 0; //ignore height
449
450 cam_dir.Normalize();
451 cam_dir[1] = 0; //ignore height
452
453 if ( ref_dir.Length() != 0 )
454 {
455 float angle = Math.Acos( cam_dir * ref_dir );
456
458 {
459 return true;
460 }
461 }
462
463 return false;
464 }

Перекрестные ссылки Math::Acos() и GetGame().

◆ IsFacingCamera() [4/4]

override bool IsFacingCamera ( string selection)
inlineprivate
479 {
482 vector cam_dir = GetGame().GetCurrentCameraDirection();
483
484 if ( MemoryPointExists( selection ) )
485 {
486 ref_pos = ModelToWorld( GetMemoryPointPos( selection ) );
488
489 ref_dir.Normalize();
490 ref_dir[1] = 0; //ignore height
491
492 cam_dir[1] = 0; //ignore height
493
494 if ( ref_dir.Length() > 0.5 ) //if the distance (m) is too low, ignore this check
495 {
496 float dot = vector.Dot( cam_dir, ref_dir );
497
498 if ( dot < 0 )
499 {
500 return true;
501 }
502 }
503 }
504
505 return false;
506 }
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Definition EnConvert.c:271

Перекрестные ссылки vector::Dot(), GetGame() и GetPosition.

◆ IsFacingPlayer() [1/3]

override bool IsFacingPlayer ( PlayerBase player,
string selection )
inlineprotected
652 {
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 {
668
670 {
671 return true;
672 }
673 }
674
675 return false;
676 }

Перекрестные ссылки Math::Acos() и GetPosition.

◆ IsFacingPlayer() [2/3]

override bool IsFacingPlayer ( PlayerBase player,
string selection )
inlineprotected
411 {
412 return true; //TODO
413
415 vector player_pos = player.GetPosition();
416 vector ref_dir = GetDirection();
417
418 //vector fence_player_dir = player_pos - fence_pos;
419 vector fence_player_dir = player.GetDirection();
420 fence_player_dir.Normalize();
421 fence_player_dir[1] = 0; //ignore height
422
423 ref_dir.Normalize();
424 ref_dir[1] = 0; //ignore height
425
426 if ( ref_dir.Length() != 0 )
427 {
429
431 {
432 return true;
433 }
434 }
435
436 return false;
437 }

Перекрестные ссылки Math::Acos() и GetPosition.

◆ IsFacingPlayer() [3/3]

override bool IsFacingPlayer ( PlayerBase player,
string selection )
inlineprivate
430 {
434 float dot;
435 bool has_memory_point = MemoryPointExists( selection );
436
437 if ( has_memory_point )
438 {
439 ref_pos = ModelToWorld( GetMemoryPointPos( selection ) );
441 }
442 else
443 {
445 ref_dir = ref_pos - player.GetPosition();
446 }
447
448 ref_dir.Normalize();
449 ref_dir[1] = 0; //ignore height
450
451 player_dir = player.GetDirection();
452 player_dir.Normalize();
453 player_dir[1] = 0; //ignore height
454
455 if ( ref_dir.Length() != 0 )
456 {
458 }
459
460 if ( has_memory_point )
461 {
463 {
464 return true;
465 }
466 }
467 else
468 {
470 {
471 return true;
472 }
473 }
474
475 return false;
476 }
const float MIN_ACTION_DETECTION_ANGLE_RAD
Definition Watchtower.c:8

Перекрестные ссылки Math::AbsFloat(), vector::Dot() и GetPosition.

◆ IsLocked()

bool IsLocked ( )
inlineprotected
116 {
118 if ( combination_lock && combination_lock.IsLocked() )
119 {
120 return true;
121 }
122
123 return false;
124 }

Перекрестные ссылки GetCombinationLock().

Используется в CanOpenFence() и OnPartDismantledServer().

◆ IsOpened()

override bool IsOpened ( )
inlineprotected
111 {
112 return m_IsOpened;
113 }
bool m_IsOpened
Definition Fence.c:29

Перекрестные ссылки m_IsOpened.

Используется в AfterStoreLoad(), CanCloseFence(), CanOpenFence(), CanReceiveAttachment(), CanUseConstructionBuild(), CreateAreaDamage() и OnPartDestroyedServer().

◆ IsPlayerInside() [1/4]

override bool IsPlayerInside ( PlayerBase player,
string selection )
inlineprotected
616 {
617 vector player_pos = player.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
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();
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 }
Icon x

Перекрестные ссылки GetPosition и x.

Используется в VicinityContainer::UpdateInterval().

◆ IsPlayerInside() [2/4]

override bool IsPlayerInside ( PlayerBase player,
string selection )
inlineprivate
119 {
120 vector player_pos = player.GetPosition();
122 vector ref_dir = GetDirection();
123 ref_dir[1] = 0;
124 ref_dir.Normalize();
125
126 vector min,max;
127 min = -GetMemoryPointPos( "BoundingBox_min" );
128 max = -GetMemoryPointPos( "BoundingBox_max" );
129
131 dir_to_object[1] = 0;
132 float len = dir_to_object.Length();
133
134 dir_to_object.Normalize();
135
136 vector ref_dir_angle = ref_dir.VectorToAngles();
137 vector dir_to_object_angle = dir_to_object.VectorToAngles();
139
140 vector test_position = test_angles.AnglesToVector() * len;
141
142 if(test_position[0] > max[0] || test_position[0] < min[0] || test_position[2] > max[2] || test_position[2] < min[2] )
143 {
144 return false;
145 }
146
147 return true;
148 }

Перекрестные ссылки GetPosition.

◆ IsPlayerInside() [3/4]

override bool IsPlayerInside ( PlayerBase player,
string selection )
inlineprotected
373 {
374 return true; //TODO
375
376 vector player_pos = player.GetPosition();
378 vector ref_dir = GetDirection();
379 ref_dir[1] = 0;
380 ref_dir.Normalize();
381
382 vector x[2];
383 vector b1,b2;
384 GetCollisionBox(x);
385 b1 = x[0];
386 b2 = x[1];
387
389 dir_to_fence[1] = 0;
390 float len = dir_to_fence.Length();
391
392 dir_to_fence.Normalize();
393
394 vector ref_dir_angle = ref_dir.VectorToAngles();
395 vector dir_to_fence_angle = dir_to_fence.VectorToAngles();
397
398 vector test_position = test_angles.AnglesToVector() * len;
399
400 if(test_position[0] < b1[0] || test_position[0] > b2[0] || test_position[2] < 0.2 || test_position[2] > 2.2 )
401 {
402 return false;
403 }
404 else
405 {
406 return true;
407 }
408 }

Перекрестные ссылки GetPosition и x.

◆ IsPlayerInside() [4/4]

override bool IsPlayerInside ( PlayerBase player,
string selection )
inlineprivate
509 {
510 if ( selection != "")
511 {
513 }
514 vector player_pos = player.GetPosition();
516 vector ref_dir = GetDirection();
517 ref_dir[1] = 0;
518 ref_dir.Normalize();
519
520 vector min,max;
521
522 min = -GetMemoryPointPos( "interact_min" );
523 max = -GetMemoryPointPos( "interact_max" );
524
526 dir_to_tower[1] = 0;
527 float len = dir_to_tower.Length();
528
529
530 dir_to_tower.Normalize();
531
532 vector ref_dir_angle = ref_dir.VectorToAngles();
533 vector dir_to_tower_angle = dir_to_tower.VectorToAngles();
535
536 vector test_position = test_angles.AnglesToVector() * len;
537
538 if (test_position[0] > max[0] || test_position[0] < min[0] || test_position[2] > max[2] || test_position[2] < min[2] )
539 {
540 return false;
541 }
542
543 return true;
544 }
override bool CheckLevelVerticalDistance(float max_dist, string selection, PlayerBase player)
Definition Watchtower.c:383

Перекрестные ссылки CheckLevelVerticalDistance() и GetPosition.

◆ LogAnimateFlag()

void LogAnimateFlag ( float newPhase,
notnull PlayerBase player )
inlineprotected
530 {
531 PluginAdminLog logs = PluginAdminLog.Cast(GetPlugin(PluginAdminLog));
532 if (newPhase == 0)
533 {
534 // at the top(it's inverted)
535 logs.TotemFlagChange(true, player, this);
536 }
537 else if (newPhase == 1)
538 {
539 // at the bottom(it's inverted)
540 logs.TotemFlagChange(false, player, this);
541 }
542
543 }
PluginBase GetPlugin(typename plugin_type)
Definition PluginManager.c:316

Перекрестные ссылки GetPlugin().

Используется в AnimateFlagEx().

◆ MustBeBuiltFromOutside()

override bool MustBeBuiltFromOutside ( )
inlineprivate
89 {
90 return true;
91 }

◆ NameOverride()

override bool NameOverride ( out string output)
inlineprotected
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 }

◆ OnCEUpdate()

override void OnCEUpdate ( )
inlineprotected
158 {
159 super.OnCEUpdate();
160
161 int time_elapsed_rounded = Math.Round(m_ElapsedSinceLastUpdate);
162
163 if ( m_RefresherTimeRemaining > 0 )
164 {
167 {
168 GetCEApi().RadiusLifetimeReset(GetPosition(),GameConstants.REFRESHER_RADIUS);
170 m_RefreshTimeCounter = 0; //possibly carry over the rest?
172 }
173 }
174
176 }
float GetRefresherTime01()
Definition Totem.c:566
int m_RefreshTimeCounter
Definition Totem.c:10
Definition constants.c:638
const float REFRESHER_RADIUS
Definition constants.c:979

Перекрестные ссылки AnimateFlag(), Math::Clamp(), GetCEApi(), GetPosition, GetRefresherTime01(), GameConstants::REFRESHER_RADIUS, Math::Round() и SetRefresherActive().

◆ OnDebugSpawn() [1/3]

override void OnDebugSpawn ( )
inlineprotected
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 }

◆ OnDebugSpawn() [2/3]

override void OnDebugSpawn ( )
inlineprotected
596 {
597 super.OnDebugSpawn();
598
599 GetInventory().CreateInInventory("Flag_DayZ");
600 AnimateFlag(0);
602 }
void AddRefresherTime01(float fraction)
Definition Totem.c:558

Перекрестные ссылки AddRefresherTime01() и AnimateFlag().

◆ OnDebugSpawn() [3/3]

override void OnDebugSpawn ( )
inlineprivate
600 {
601 super.OnDebugSpawn();
602
603 int i;
604
606 {
607 GetInventory().CreateInInventory("CamoNet");
608 }
609
610 for (i = 0; i < 2 * MAX_WATCHTOWER_WALLS; ++i)
611 {
612 BarbedWire wire = BarbedWire.Cast(GetInventory().CreateInInventory("BarbedWire"));
613 wire.SetMountedState(true);
614 }
615 }
static const int MAX_WATCHTOWER_WALLS
Definition Watchtower.c:15
static const int MAX_WATCHTOWER_FLOORS
Definition Watchtower.c:14

Перекрестные ссылки MAX_WATCHTOWER_WALLS.

◆ OnDebugSpawnBuildExcludes() [1/2]

override array< string > OnDebugSpawnBuildExcludes ( )
inlineprotected

Excludes certain parts from being built by OnDebugSpawn, uses Contains to compare.

855 {
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 }
DiagMenuIDs
Definition EDiagMenuIDs.c:2
Definition EnDebug.c:233
static proto bool GetBool(int id, bool reverse=false)
Get value as bool from the given script id.

Перекрестные ссылки DiagMenu::GetBool().

Используется в ItemBase::FullyBuild().

◆ OnDebugSpawnBuildExcludes() [2/2]

override array< string > OnDebugSpawnBuildExcludes ( )
inlineprivate

Excludes certain parts from being built by OnDebugSpawn, uses Contains to compare.

577 {
579
580 #ifdef DIAG_DEVELOPER
581 bool bWood = DiagMenu.GetBool(DiagMenuIDs.BASEBUILDING_WOOD);
582 #else
583 bool bWood = false;
584 #endif
585
586 if (bWood)
587 {
588 excludes = {"_metal_"};
589 }
590 else
591 {
592 excludes = {"_wood_"};
593 }
594
595 return excludes;
596 }

Перекрестные ссылки DiagMenu::GetBool().

◆ OnPartBuiltServer() [1/4]

override void OnPartBuiltServer ( notnull Man player,
string part_name,
int action_id )
inlineprotected
298 {
300
301 super.OnPartBuiltServer( player, part_name, action_id );
302
304
305 //update visuals (server)
307 }

Перекрестные ссылки CheckGateState(), GetConstruction(), SetGateState() и UpdateVisuals().

Используется в ItemBase::FullyBuild().

◆ OnPartBuiltServer() [2/4]

override void OnPartBuiltServer ( notnull Man player,
string part_name,
int action_id )
inlineprivate
37 {
39
40 string shelter_type = "";
41 switch (part_name)
42 {
43 case "leather":
44 shelter_type = "ShelterLeather";
45 break;
46
47 case "fabric":
48 shelter_type = "ShelterFabric";
49 break;
50
51 case "stick":
52 shelter_type = "ShelterStick";
53 break;
54
55 default: {};
56 }
57
58 if (shelter_type != "")
59 {
60 GetConstruction().DropNonUsableMaterialsServer( player, part_name );
61 MiscGameplayFunctions.TurnItemIntoItem(this, shelter_type, PlayerBase.Cast(player));
62
63 PluginAdminLog admin_log = PluginAdminLog.Cast( GetPlugin(PluginAdminLog) );
64 if (admin_log)
65 {
66 string playerPrefix = admin_log.GetPlayerPrefix(PlayerBase.Cast(player), player.GetIdentity());
67 admin_log.DirectAdminLogPrint(playerPrefix +" built " + shelter_type + " with Hands ");
68 }
69 }
70 //super.OnPartBuiltServer( part_name, action_id );
71 }

Перекрестные ссылки GetConstruction() и GetPlugin().

◆ OnPartBuiltServer() [3/4]

override void OnPartBuiltServer ( notnull Man player,
string part_name,
int action_id )
inlineprotected
249 {
250 //ConstructionPart constrution_part = GetConstruction().GetConstructionPart( part_name );
251
252 super.OnPartBuiltServer( player, part_name, action_id );
253
254 //update visuals (server)
256 }

Перекрестные ссылки UpdateVisuals().

◆ OnPartBuiltServer() [4/4]

override void OnPartBuiltServer ( notnull Man player,
string part_name,
int action_id )
inlineprivate
407 {
408 super.OnPartBuiltServer( player, part_name, action_id );
409 //update visuals (server)
411 }

Перекрестные ссылки UpdateVisuals().

◆ OnPartDestroyedServer() [1/3]

override void OnPartDestroyedServer ( Man player,
string part_name,
int action_id,
bool destroyed_by_connected_part = false )
inlineprotected
332 {
333 super.OnPartDestroyedServer( player, part_name, action_id );
334
335 //check gate state
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 }
void CloseFence()
Definition Fence.c:489

Перекрестные ссылки CheckGateState(), CloseFence(), GetBarbedWire1(), GetBarbedWire2(), GetCamoNet(), GetCombinationLock(), GetConstruction(), HandleDropAttachment(), IsOpened(), SetGateState() и UpdateVisuals().

◆ OnPartDestroyedServer() [2/3]

override void OnPartDestroyedServer ( Man player,
string part_name,
int action_id,
bool destroyed_by_connected_part = false )
inlineprotected
269 {
270 super.OnPartDestroyedServer( player, part_name, action_id );
271
272 //update visuals (server)
274 }

Перекрестные ссылки UpdateVisuals().

◆ OnPartDestroyedServer() [3/3]

override void OnPartDestroyedServer ( Man player,
string part_name,
int action_id,
bool destroyed_by_connected_part = false )
inlineprivate
421 {
422 super.OnPartDestroyedServer( player, part_name, action_id );
423 //update visuals (server)
425 }

Перекрестные ссылки UpdateVisuals().

◆ OnPartDismantledServer() [1/3]

override void OnPartDismantledServer ( notnull Man player,
string part_name,
int action_id )
inlineprotected
310 {
312
313 //check gate state
314 if ( constrution_part.IsGate() )
315 {
316 if ( IsLocked() )
317 {
319 combination_lock.UnlockServer( player , this );
320 }
321 }
322
323 super.OnPartDismantledServer( player, part_name, action_id );
324
326
327 //update visuals (server)
329 }

Перекрестные ссылки CheckGateState(), GetConstruction(), IsLocked(), SetGateState() и UpdateVisuals().

◆ OnPartDismantledServer() [2/3]

override void OnPartDismantledServer ( notnull Man player,
string part_name,
int action_id )
inlineprotected
259 {
261
262 super.OnPartDismantledServer( player, part_name, action_id );
263
264 //update visuals (server)
266 }

Перекрестные ссылки GetConstruction() и UpdateVisuals().

◆ OnPartDismantledServer() [3/3]

override void OnPartDismantledServer ( notnull Man player,
string part_name,
int action_id )
inlineprivate
414 {
415 super.OnPartDismantledServer( player, part_name, action_id );
416 //update visuals (server)
418 }

Перекрестные ссылки UpdateVisuals().

◆ OnStoreLoad() [1/2]

override bool OnStoreLoad ( ParamsReadContext ctx,
int version )
inlineprotected
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 }
bool m_ToDiscard
Definition Fence.c:28

Перекрестные ссылки bsbDebugPrint(), GATE_STATE_NONE, LogManager::IsBaseBuildingLogEnable() и m_IsOpened.

◆ OnStoreLoad() [2/2]

override bool OnStoreLoad ( ParamsReadContext ctx,
int version )
inlineprotected
112 {
113 if ( !super.OnStoreLoad( ctx, version ) )
114 return false;
115
116 //int loaded_frequency;
118
119 if ( !ctx.Read( m_RefresherTimeRemaining ) )
120 {
121 return false;
122 }
123
124 if ( !ctx.Read( m_RefreshTimeCounter ) )
125 {
126 return false;
127 }
128
129 if ( !ctx.Read( loaded_max_duration ) )
130 {
131 return false;
132 }
133
134 if ( version >= 118 && !ctx.Read( m_RefresherActive ) )
135 {
136 return false;
137 }
138
141
142 return true;
143 }
void CheckLoadedVariables(int max_duration)
Definition Totem.c:571

Перекрестные ссылки AnimateFlag(), CheckLoadedVariables() и GetRefresherTime01().

◆ OnStoreSave() [1/2]

override void OnStoreSave ( ParamsWriteContext ctx)
inlineprotected
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 }

Перекрестные ссылки bsbDebugPrint(), LogManager::IsBaseBuildingLogEnable() и m_IsOpened.

◆ OnStoreSave() [2/2]

override void OnStoreSave ( ParamsWriteContext ctx)
inlineprotected
102 {
103 super.OnStoreSave( ctx );
104
106 ctx.Write( m_RefreshTimeCounter );
108 ctx.Write( m_RefresherActive );
109 }

◆ OnVariablesSynchronized() [1/2]

override void OnVariablesSynchronized ( )
inlineprotected
277 {
278 super.OnVariablesSynchronized();
279
281 {
283
284 if ( m_IsOpenedClient )
285 {
286 OpenFence();
287 }
288 else
289 {
290 CloseFence();
291 }
292 }
293 }
bool m_IsOpenedClient
Definition Fence.c:30

Перекрестные ссылки CloseFence(), m_IsOpened, m_IsOpened и OpenFence().

◆ OnVariablesSynchronized() [2/2]

override void OnVariablesSynchronized ( )
inlineprotected
236 {
237 super.OnVariablesSynchronized();
238
240 {
243 }
244 }
void HandleRefreshers()
Client-side, saves positions of active lifetime refreshers to MissionGameplay.
Definition Totem.c:179
bool m_RefresherActiveLocal
Definition Totem.c:7

Перекрестные ссылки HandleRefreshers() и m_RefresherActive.

◆ OpenFence()

void OpenFence ( )
inlineprotected
448 {
449 //server or single player
450 if ( GetGame().IsServer() )
451 {
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
468 GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).CallLater( UpdateNavmesh, GATE_ROTATION_TIME_APPROX, false );
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
485 GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).Remove(CheckFenceClosed);
486 GetGame().GetCallQueue( CALL_CATEGORY_GAMEPLAY ).CallLater( CheckFenceOpened, 0, true );
487 }
void SoundGateOpenStart()
Definition Fence.c:726

Перекрестные ссылки CALL_CATEGORY_GAMEPLAY, GATE_ROTATION_ANGLE_DEG, GetGame(), SetOpenedState(), SoundGateOpenStart(), SynchronizeBaseState(), UpdateBarbedWireAreaDamagePos() и UpdateNavmesh().

Используется в AfterStoreLoad() и OnVariablesSynchronized().

◆ PerformRoofCheckForBase()

override bool PerformRoofCheckForBase ( string partName,
PlayerBase player,
out bool result )
inlineprivate
134 {
136 return false;
137
138 if (partName != "level_1_base" && partName != "level_2_base" && partName != "level_3_base" && partName != "level_3_roof")
139 {
140 return false;
141 }
142
146 vector min_max[2];
149
150 excluded_objects.Insert( this );
151 excluded_objects.Insert( player );
152
153 if ( partName == "level_2_base" )
154 {
155 min_max[0] = GetMemoryPointPos( "level_2_wall_1_down_min" );
156 min_max[1] = GetMemoryPointPos( "level_2_roof_max" );
157 }
158 else if ( partName == "level_3_base" )
159 {
160 min_max[0] = GetMemoryPointPos( "level_3_wall_1_down_min" );
161 min_max[1] = GetMemoryPointPos( "level_3_wall_2_up_max" );
162 }
163 else if ( partName == "level_3_roof" )
164 {
165 min_max[0] = GetMemoryPointPos( "level_3_roof_min" );
166 min_max[1] = GetMemoryPointPos( "level_3_roof_max" );
167 }
168 else
169 {
170 //min_max[0] = GetMemoryPointPos( "level_1_wall_1_up_min" );
171 //min_max[0] = GetMemoryPointPos( "level_1_wall_1_down_min" );
172 min_max[0] = GetMemoryPointPos( "level_1_collisioncheck_min" );
173 min_max[1] = GetMemoryPointPos( "level_1_roof_max" );
174 }
176 center[1] = center[1] + ( min_max[1][1] + min_max[0][1] ) / 2;
177
178 edge_length[0] = min_max[1][0] - min_max[0][0];
179 edge_length[2] = min_max[1][2] - min_max[0][2];
180 edge_length[1] = min_max[1][1] - min_max[0][1];
181
182 result = false;
184 if ( collided_objects.Count() > 0 )
185 {
186 foreach ( Object o : collided_objects )
187 {
188 if (Building.Cast(o))
189 {
190 result = true;
191 }
192 }
193 }
194 return true;
195 }
vector GetOrientation()
Definition AreaDamageManager.c:306
Definition CfgGameplayHandler.c:2
static bool GetDisablePerformRoofCheck()
Definition CfgGameplayHandler.c:322
Definition ObjectTyped.c:2

Перекрестные ссылки CfgGameplayHandler::GetDisablePerformRoofCheck(), GetGame(), GetOrientation() и GetPosition.

◆ PostAreaDamageActions()

override void PostAreaDamageActions ( )
inlineprotected
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 }

◆ RemoveRefresherPosition()

void RemoveRefresherPosition ( int idx = -2)
inlineprotected
216 {
217 if (!GetGame() || (GetGame().IsMultiplayer() && GetGame().IsServer()) )
218 return;
219
220 Mission mission = GetGame().GetMission();
222 return;
223
224 if (idx == -2)
225 {
227 }
228
229 if (idx > -1)
230 {
232 }
233 }

Перекрестные ссылки GetGame(), GetPosition, Mission::m_ActiveRefresherLocations и mission.

Используется в HandleRefreshers() и ~TerritoryFlag().

◆ SetActions() [1/4]

override void SetActions ( )
inlineprotected
826 {
827 super.SetActions();
828
832 //AddAction(ActionDialCombinationLockOnTarget);
833 //AddAction(ActionNextCombinationLockDialOnTarget);
836 }
ActionFoldBaseBuildingObjectCB ActionContinuousBaseCB ActionFoldBaseBuildingObject()
Definition ActionFoldBaseBuildingObject.c:11
ActionPlaceObjectCB ActiondeployObjectCB ActionPlaceObject()
Definition ActionPlaceObject.c:11
void AddAction(typename actionName)
Definition AdvancedCommunication.c:220
Definition ActionCloseFence.c:2
Definition ActionOpenFence.c:2
Definition ActionTogglePlaceObject.c:2

Перекрестные ссылки ActionFoldBaseBuildingObject(), ActionPlaceObject() и AddAction().

◆ SetActions() [2/4]

override void SetActions ( )
inlineprivate
166 {
167 super.SetActions();
168
173 }
Definition ActionBuildShelter.c:2

Перекрестные ссылки ActionFoldBaseBuildingObject(), ActionPlaceObject() и AddAction().

◆ SetActions() [3/4]

override void SetActions ( )
inlineprotected
488 {
489 super.SetActions();
490
494 }
Definition ActionLowerFlag.c:3
Definition ActionRaiseFlag.c:10

Перекрестные ссылки ActionFoldBaseBuildingObject() и AddAction().

◆ SetActions() [4/4]

override void SetActions ( )
inlineprivate

◆ SetGateState()

void SetGateState ( int state)
inlineprotected
67 {
69 SetSynchDirty();
70 }

Используется в AfterStoreLoad(), OnPartBuiltServer(), OnPartDestroyedServer() и OnPartDismantledServer().

◆ SetOpenedState()

void SetOpenedState ( bool state)
inlineprotected
106 {
108 }

Перекрестные ссылки m_IsOpened.

Используется в CloseFence() и OpenFence().

◆ SetRefresherActive()

void SetRefresherActive ( bool state)
inlineprotected
197 {
198 if ( m_RefresherActive != state )
199 {
201 SetSynchDirty();
202
203 //update on refresher activation / last update on refresher deactivation
204 if (GetCEApi())
205 GetCEApi().RadiusLifetimeReset(GetPosition(),GameConstants.REFRESHER_RADIUS);
206 }
207 }

Перекрестные ссылки GetCEApi(), GetPosition и GameConstants::REFRESHER_RADIUS.

Используется в AddRefresherTime01() и OnCEUpdate().

◆ SetRefreshTimer01()

void SetRefreshTimer01 ( float fraction)
inlineprotected

Перекрестные ссылки Math::Clamp() и Math::Round().

Используется в EEItemDetached().

◆ ShelterSite()

void ShelterSite ( )
inlineprivate
7 {
8 }

◆ SoundGateCloseEnd()

void SoundGateCloseEnd ( )
inlineprotected
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 }
const string SOUND_GATE_CLOSE_END
Definition Fence.c:10
EffectSound m_SoundGate_End
Definition Fence.c:34

Перекрестные ссылки GetGame().

Используется в CheckFenceClosed().

◆ SoundGateCloseStart()

void SoundGateCloseStart ( )
inlineprotected
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 }
const string SOUND_GATE_CLOSE_START
Definition Fence.c:9
EffectSound m_SoundGate_Start
Definition Fence.c:33

Перекрестные ссылки GetGame().

Используется в CloseFence().

◆ SoundGateOpenStart()

void SoundGateOpenStart ( )
inlineprotected
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 }
const string SOUND_GATE_OPEN_START
Definition Fence.c:8

Перекрестные ссылки GetGame().

Используется в OpenFence().

◆ TerritoryFlag()

void TerritoryFlag ( )
inlineprotected
16 {
17 m_RefresherActive = false;
21
22 if ( GetCEApi() )
23 {
25 }
26 RegisterNetSyncVariableBool("m_RefresherActive");
27 }

Перекрестные ссылки GetCEApi() и InitRefresherData().

◆ TranslateSlotFromSelection()

override bool TranslateSlotFromSelection ( string selection_name,
out int slot_id )
inlineprotected
816 {
817 if ( selection_name == "wall_camonet_attach" )
818 {
820 return true;
821 }
822 return false;
823 }

Перекрестные ссылки InventorySlots::GetSlotIdFromString().

◆ UpdateBarbedWireAreaDamagePos()

void UpdateBarbedWireAreaDamagePos ( float rotation_angle = 0,
bool to_delete = false )
inlineprotected
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 {
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 {
594 }
595 else
596 {
597 super.CreateAreaDamage( slot_name_mounted, rotation_angle );
598 }
599 }
600 }
void DestroyAreaDamage()
Definition FireplaceBase.c:2306

Перекрестные ссылки DestroyAreaDamage(), GetBarbedWire1() и GetBarbedWire2().

Используется в CheckFenceClosed(), CheckFenceOpened(), CloseFence() и OpenFence().

◆ UpdateVisuals()

override void UpdateVisuals ( )
inlineprivate
45 {
46 super.UpdateVisuals();
47
48 SetAnimationPhase( "level_1", 0); //always visible
49 SetAnimationPhase( "level_1_wall_1", 0); //always visible
50 SetAnimationPhase( "level_1_wall_2", 0); //always visible
51 SetAnimationPhase( "level_1_wall_3", 0); //always visible
52
53 string part_name = "";
54 bool built = false;
55
56 for ( int i = 1; i < MAX_WATCHTOWER_FLOORS; ++i )
57 {
58 //roof checks
60 built = GetConstruction().IsPartConstructed(part_name);
61 //Print(part_name);
62 //Print(built);
63
64 //string tmp = "";
65
66 if ( built )
67 {
68 SetAnimationPhase( BASE_VIEW_NAME + (i + 1), 0); //show
69 for ( int j = 1; j < MAX_WATCHTOWER_WALLS + 1; ++j )
70 {
71 //tmp = BASE_VIEW_NAME + (i + 1) + BASE_WALL_NAME + j;
72 //Print(tmp);
73 SetAnimationPhase( BASE_VIEW_NAME + (i + 1) + BASE_WALL_NAME + j, 0); //show
74 }
75 }
76 else
77 {
78 SetAnimationPhase( BASE_VIEW_NAME + (i + 1), 1 ); //hide
79 for ( j = 1; j < MAX_WATCHTOWER_WALLS + 1; ++j )
80 {
81 //tmp = BASE_VIEW_NAME + (i + 1) + BASE_WALL_NAME + j;
82 //Print(tmp);
83 SetAnimationPhase( BASE_VIEW_NAME + (i + 1) + BASE_WALL_NAME + j, 1); //hide
84 }
85 }
86 }
87 }
static const string BASE_WALL_NAME
Definition Watchtower.c:12
static const string BASE_VIEW_NAME
Definition Watchtower.c:11
static const string BASE_ROOF_NAME
Definition Watchtower.c:13

Перекрестные ссылки BASE_ROOF_NAME, GetConstruction() и MAX_WATCHTOWER_FLOORS.

Используется в AfterStoreLoad(), ItemBase::EEItemAttached(), ItemBase::EEItemDetached(), ItemBase::OnPartBuiltServer(), OnPartBuiltServer(), ItemBase::OnPartDestroyedServer(), OnPartDestroyedServer(), ItemBase::OnPartDismantledServer(), OnPartDismantledServer() и ItemBase::OnSynchronizedClient().

◆ Watchtower()

void Watchtower ( )
inlineprivate
18 {
19 }

Поля

◆ ATTACHMENT_BARBED_WIRE

ATTACHMENT_BARBED_WIRE = BarbedWire
private

◆ ATTACHMENT_CAMONET

ATTACHMENT_CAMONET = CamoNet
private

◆ ATTACHMENT_COMBINATION_LOCK

ATTACHMENT_COMBINATION_LOCK = CombinationLock
private

◆ ATTACHMENT_SLOT_COMBINATION_LOCK

const string ATTACHMENT_SLOT_COMBINATION_LOCK = "Att_CombinationLock"
private

◆ ATTACHMENT_WOODEN_LOG

ATTACHMENT_WOODEN_LOG = WoodenLog
private

◆ ATTSLOT_BARBEDWIRE_DOWN

string ATTSLOT_BARBEDWIRE_DOWN = "Wall_Barbedwire_1"
private

◆ ATTSLOT_BARBEDWIRE_UP

string ATTSLOT_BARBEDWIRE_UP = "Wall_Barbedwire_2"
private

◆ ATTSLOT_CAMONET

string ATTSLOT_CAMONET = "Wall_Camonet"
private

◆ BASE_ROOF_NAME

const string BASE_ROOF_NAME = "_roof"
staticprivate

Используется в UpdateVisuals().

◆ BASE_VIEW_NAME

const string BASE_VIEW_NAME = "level_"
staticprivate

◆ BASE_WALL_NAME

const string BASE_WALL_NAME = "_wall_"
staticprivate

◆ GATE_ROTATION_ANGLE_DEG

const float GATE_ROTATION_ANGLE_DEG = 100
private

Используется в OpenFence().

◆ GATE_ROTATION_TIME_APPROX

const float GATE_ROTATION_TIME_APPROX = 2000
private

◆ GATE_STATE_FULL

const int GATE_STATE_FULL = 2
private

Используется в CheckGateState() и HasFullyConstructedGate().

◆ GATE_STATE_NONE

const int GATE_STATE_NONE = 0
private

Используется в CheckGateState(), HasHinges() и OnStoreLoad().

◆ GATE_STATE_PARTIAL

const int GATE_STATE_PARTIAL = 1
private

Используется в CheckGateState().

◆ m_FlagRefresherFrequency

int m_FlagRefresherFrequency = GameConstants.REFRESHER_FREQUENCY_DEFAULT
protected

◆ m_FlagRefresherMaxDuration

int m_FlagRefresherMaxDuration = GameConstants.REFRESHER_MAX_DURATION_DEFAULT
protected

Используется в GetRefresherTime01().

◆ m_GateState

int m_GateState = 0
protected

Используется в GetGateState().

◆ m_IsOpened

bool m_IsOpened = false
protected

Используется в IsOpened() и OnVariablesSynchronized().

◆ m_IsOpenedClient

bool m_IsOpenedClient = false
protected

◆ m_RefresherActive

bool m_RefresherActive
private

Используется в OnVariablesSynchronized().

◆ m_RefresherActiveLocal

bool m_RefresherActiveLocal
private

◆ m_RefresherInitialized

bool m_RefresherInitialized
private

◆ m_RefresherTimeRemaining

int m_RefresherTimeRemaining
private

◆ m_RefreshTimeCounter

int m_RefreshTimeCounter
private

◆ m_SoundGate_End

EffectSound m_SoundGate_End
protected

◆ m_SoundGate_Start

EffectSound m_SoundGate_Start
protected

◆ m_ToDiscard

bool m_ToDiscard = false
protected

◆ MAX_ACTION_DETECTION_ANGLE_RAD

const float MAX_ACTION_DETECTION_ANGLE_RAD = 1.3
private

◆ MAX_ACTION_DETECTION_DISTANCE

const float MAX_ACTION_DETECTION_DISTANCE = 2.0
private

◆ MAX_FLOOR_VERTICAL_DISTANCE

const float MAX_FLOOR_VERTICAL_DISTANCE = 0.5
private

◆ MAX_WATCHTOWER_FLOORS

const int MAX_WATCHTOWER_FLOORS = 3
staticprivate

Используется в UpdateVisuals().

◆ MAX_WATCHTOWER_WALLS

const int MAX_WATCHTOWER_WALLS = 3
staticprivate

Используется в OnDebugSpawn().

◆ MIN_ACTION_DETECTION_ANGLE_RAD

const float MIN_ACTION_DETECTION_ANGLE_RAD = 0.35
private

◆ SOUND_GATE_CLOSE_END

const string SOUND_GATE_CLOSE_END = "DoorWoodTowerClose_end_SoundSet"
private

◆ SOUND_GATE_CLOSE_START

const string SOUND_GATE_CLOSE_START = "DoorWoodTowerClose_start_SoundSet"
private

◆ SOUND_GATE_OPEN_START

const string SOUND_GATE_OPEN_START = "DoorWoodTowerOpen_SoundSet"
private

Объявления и описания членов классов находятся в файлах: