DayZ 1.28
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
TrapSpawnBase.c
См. документацию.
1class TrapSpawnBase extends ItemBase
2{
4 bool m_CanCatch = false;
5
6 //configurable stuff
16
17 //derived stuff
18 private int m_InitWaitTime;
20 private int m_ElapsedTime;
21 private int m_ActivationTime;
22 private int m_RollSuccessTime;
24 private float m_CurrentlyUsedDelta;
25 private bool m_IsCatchSuccessful;
26 private int m_CatchEnviroMask = 0;
27 private int m_YieldItemIdxLocal = -1;
28 private int m_YieldItemIdx = -1;
29 private int m_CatchParticleEffecterId = -1;
30
31 vector m_PreyPos; // The position where prey will be spawned -> Will be overriden later
32
33 protected bool m_IsActive;
34 protected bool m_IsPastWaitingTime;
35 protected bool m_IsDeployed;
36
37 ref Timer m_Timer;
38
42
44
46
47 #ifdef DEVELOPER
48 int m_dbgAttemptCount = 0;
49 #endif
50
52 {
54
55 RegisterNetSyncVariableBool("m_IsActive");
56 RegisterNetSyncVariableBool("m_IsDeployed");
57 RegisterNetSyncVariableInt("m_YieldItemIdx");
58
59 //DEPRECATED stuff below, legacy reasons only
60 m_CatchesPond = new multiMap<string, float>; //yields now in WorldData.InitYieldBank
61 m_CatchesSea = new multiMap<string, float>; //yields now in WorldData.InitYieldBank
62 m_CatchesGroundAnimal = new multiMap<string, float>; //yields now in WorldData.InitYieldBank
63 }
64
66 {
67 if (m_Timer)
68 {
69 m_Timer.Stop();
70 delete m_Timer;
71 }
72
74 }
75
98
99 override void OnStoreSave( ParamsWriteContext ctx )
100 {
101 super.OnStoreSave( ctx );
102
103 ctx.Write( m_IsActive );
104
105 ctx.Write( m_IsDeployed );
106
108 }
109
110 override bool OnStoreLoad( ParamsReadContext ctx, int version )
111 {
112 if ( !super.OnStoreLoad(ctx, version) )
113 return false;
114
115 m_IsStoreLoad = true;
116
117 bool b_is_active = false;
118 if ( !ctx.Read( b_is_active ) )
119 b_is_active = false;
120
121 bool b_is_in_progress = false;
122 if (version < 139)
123 {
124 if ( !ctx.Read( b_is_in_progress ) )
125 b_is_in_progress = false;
126 }
127
128 bool b_is_deployed = false;
129 if ( !ctx.Read( b_is_deployed ) )
130 b_is_deployed = false;
131
132 if (version >= 139)
133 {
134 int enviroMask;
135 if (ctx.Read(enviroMask))
136 m_CatchEnviroMask = enviroMask;
137 }
138
139 if (b_is_active)
140 {
142 SetActive();
143 }
144
145 SetDeployed( b_is_deployed );
146
147 m_IsStoreLoad = false;
148 return true;
149 }
150
153 {
154 super.OnVariablesSynchronized();
155
157 {
159 if (m_YieldItemIdxLocal != -1)
161 }
162 }
163
164 bool IsActive()
165 {
166 return m_IsActive;
167 }
168
170 {
171 return m_IsDeployed;
172 }
173
174 void SetDeployed( bool newState )
175 {
176 m_IsDeployed = newState;
177
178 if ( newState == true )
179 {
181 {
182 SetAnimationPhase( m_AnimationPhaseSet, 1 );
183 SetAnimationPhase( m_AnimationPhaseTriggered, 0 );
184 SetAnimationPhase( m_AnimationPhaseUsed, 1 );
185 }
186 }
187 else
188 {
190 {
191 SetAnimationPhase( m_AnimationPhaseSet, 0 );
192 SetAnimationPhase( m_AnimationPhaseTriggered, 1 );
193 SetAnimationPhase( m_AnimationPhaseUsed, 1 );
194 }
195 }
196
197 SetSynchDirty();
198 }
199
200 override bool IsTakeable()
201 {
202 return true;
203 }
204
206 {
207 string surface_type;
208 GetGame().SurfaceGetType3D( position[0], position[1], position[2], surface_type);
209
210 // check surface
211 return GetGame().IsSurfaceDigable(surface_type);
212 }
213
215 {
216 if ( GetGame().IsServer() )
217 {
218 if ( GetHierarchyRootPlayer() && GetHierarchyRootPlayer().CanDropEntity( this ) )
219 {
220 SetupTrapPlayer( PlayerBase.Cast( GetHierarchyRootPlayer() ) );
221 }
222 }
223 }
224
225 void SetupTrapPlayer( PlayerBase player, bool set_position = true )
226 {
227 if ( GetGame().IsServer() )
228 {
229 if ( set_position )
230 {
231 vector trapPos = player.GetPosition() + ( player.GetDirection() * 0.5 );
232 trapPos[1] = GetGame().SurfaceRoadY( trapPos[0], trapPos[2] );
233 SetPosition( trapPos );
234 }
235
236 SetDeployed( true );
237 }
238 }
239
241 {
243 if (MemoryPointExists("Prey_Position"))
244 m_PreyPos = ModelToWorld(GetMemoryPointPos("Prey_Position"));
245 }
246
247 void Fold()
248 {
249 if ( GetGame().IsServer() && m_IsFoldable == true )
250 {
251 SetInactive();
252 }
253 }
254
255 // Deal damage to trap on specific events
257 {
258 if ( GetGame().IsServer() )
259 {
260 DecreaseHealth( "", "", m_DefectRate );
261 }
262 }
263
264 void StartActivate( PlayerBase player ) { }
265
266 // IsTakeable is used to hide tooltips as well, so we use a custom method instead
267 // Used to prevent players from taking traps which should be set for catching
269 {
270 if ( !IsDeployed() || ( GetInventory().AttachmentCount() == 0 && IsDeployed() ) )
271 {
272 return true;
273 }
274
275 return false;
276 }
277
278 override bool CanPutInCargo( EntityAI parent )
279 {
280 super.CanPutInCargo( parent );
281 return CanBeTaken();
282 }
283
284 override bool CanPutIntoHands( EntityAI parent )
285 {
286 super.CanPutIntoHands( parent );
287 return CanBeTaken();
288 }
289
291 {
293 m_ElapsedTime = 0;
295
296 #ifdef DEVELOPER
297 m_dbgAttemptCount = 0;
298 #endif
299 }
300
314
316 void RunTrappingTimer(float duration, string fnName)
317 {
318 if (!m_Timer)
320 else
321 m_Timer.Stop();
322
323 #ifdef DEVELOPER
324 if (IsCLIParam("trapsQuick"))
325 {
327 m_Timer.Run(1, this, fnName);
328 }
329 else
330 #endif
331 {
332 m_CurrentlyUsedDelta = duration;
333 m_Timer.Run(duration, this, fnName);
334 }
335 }
336
337 // Set animation phases according to state
339 {
341
342 if ( GetGame().IsServer() && !IsActive() )
343 {
344 SetCatchSuccessful(false);
345 m_IsActive = true;
346 m_IsPastWaitingTime = false;
347 m_YieldItemIdx = -1;
348
352
353 SetSynchDirty();
354
356 {
357 SetAnimationPhase( m_AnimationPhaseSet, 1 );
358 SetAnimationPhase( m_AnimationPhaseTriggered, 0 );
359 SetAnimationPhase( m_AnimationPhaseUsed, 1 );
360 }
361
364 if (!m_IsStoreLoad) //presumably activated by the player, store load initializes component separately
365 {
368
371 }
372 else //presumed store load
373 {
375
376 RunTrappingTimer(m_UpdateWaitTime,"EvaluateCatch");
378 }
379 }
380 }
381
383 {
384 if ( GetGame().IsServer() )
385 {
386 // We stop timers as the trap is no longer active, then update visuals
387 m_IsActive = false;
388
390
391 if ( m_Timer )
392 {
393 m_Timer.Stop();
394 }
395
396 m_IsPastWaitingTime = false;
397
398 SetDeployed( false );
399
400 SetSynchDirty();
401 }
402 }
403
404 void SetUsed()
405 {
406 if ( GetGame().IsServer() )
407 {
408 // We updated state, visuals and stop timers
409 m_IsActive = false;
410 m_IsDeployed = false;
411
412 // Deal damage to trap
413 AddDefect();
416
418
419 if ( m_Timer )
420 {
421 m_Timer.Stop();
422 }
423
424 m_IsPastWaitingTime = false;
425
427 {
428 SetAnimationPhase( m_AnimationPhaseSet, 1 );
429 SetAnimationPhase( m_AnimationPhaseTriggered, 1 );
430 SetAnimationPhase( m_AnimationPhaseUsed, 0 );
431 }
432
433 m_CatchingContext = null;
434
435 SetSynchDirty();
436 }
437 }
438
440 {
442
443 #ifdef DEVELOPER
444 if (IsCLIParam("catchingLogs"))
445 {
446 Print("dbgTrapz | delta: " + m_CurrentlyUsedDelta);
447 Print("dbgTrapz | m_ElapsedTime: " + m_ElapsedTime);
448 Print("dbgTrapz | m_AdjustedMaxActiveTime: " + m_AdjustedMaxActiveTime);
449 }
450 #endif
451 }
452
454 {
456 {
457 float time = m_ElapsedTime - m_RollSuccessTime;
458 float timeLimit = m_AdjustedMaxActiveTime - m_RollSuccessTime;
459 time = Math.InverseLerp(0,timeLimit,time);
460 time = Easing.EaseInQuad(time);
463
464 #ifdef DEVELOPER
465 if (IsCLIParam("catchingLogs"))
466 {
467 Print("dbgTrapz | adjusted distance: " + m_CurrentMinimalDistance + "/" + m_MinimalDistanceFromPlayersToCatch + " | LERP progress: " + time);
468 }
469 #endif
470 }
471 }
472
474 {
475 #ifdef DEVELOPER
476 m_dbgAttemptCount++;
477 #endif
478
479 m_IsPastWaitingTime = true;
481
482 #ifdef DEVELOPER
483 if (IsCLIParam("catchingLogs"))
484 {
485 Print("dbgTrapz | m_dbgAttemptCount: " + m_dbgAttemptCount + "/" + (m_MaxActiveTime/m_UpdateWaitTime));
486 }
487 #endif
488
489 bool success = false;
491
492 if (m_CanCatch)
493 {
494 if (m_CatchingContext.RollCatch())
495 {
496 success = true;
497
498 #ifdef DEVELOPER
499 if (IsCLIParam("catchingLogs"))
500 {
501 Print("dbgTrapz | success!!!");
502 Print("---------------------");
503 }
504 #endif
505 }
506 }
507
508 #ifdef DEVELOPER
509 string dbgSuccessOverride;
510 if (GetCLIParam("trapsSuccessOverride",dbgSuccessOverride))
511 {
512 if (dbgSuccessOverride == "true" || dbgSuccessOverride.ToInt() == 1)
513 success = true;
514 else if (dbgSuccessOverride == "false" || dbgSuccessOverride.ToInt() == 0)
515 success = false;
516 }
517 #endif
518
519 m_Timer.Stop();
520
521 #ifdef DEVELOPER
522 if (m_ElapsedTime >= m_AdjustedMaxActiveTime || (IsCLIParam("trapsQuick") && !success))
523 #else
525 #endif
526 {
527 SetUsed();
528 return;
529 }
530
531 if (success)
532 {
536 }
537 else
538 {
539 RunTrappingTimer(m_UpdateWaitTime,"EvaluateCatch");
540 }
541 }
542
544 {
545 if (!GetCEApi())
546 {
547 Debug.Log("CE not enabled, player avoidance not available!");
548 return false;
549 }
550
551 return !GetCEApi().AvoidPlayer(GetPosition(), m_CurrentMinimalDistance);
552 }
553
555 {
558
559 #ifdef DEVELOPER
560 if (IsCLIParam("trapsQuick") || m_CurrentMinimalDistance <= 0 || !IsPlayerInVicinity())
561 #else
563 #endif
564 {
565 SpawnCatch();
566 }
568 {
570 }
571 }
572
573 // Actually spawns the prey
575 {
576 // Only server side, let's make sure
577 if (GetGame().IsMultiplayer() && GetGame().IsClient())
578 return;
579
581
582 ItemBase catch;
583 if (m_CanCatch)
584 {
585 catch = ItemBase.Cast(m_CatchingContext.SpawnAndSetupCatch(m_YieldItemIdx,m_PreyPos));
586
588 SetCatchSuccessful(catch != null);
589 // We change the trap state and visuals
590 SetUsed();
591 }
592
593 SetSynchDirty();
594 }
595
596 void SetCatchSuccessful(bool successful)
597 {
598 m_IsCatchSuccessful = successful;
599 }
600
605
607 {
608 UpdatePreyPos(); //previously set on server only
609
611 }
612
613 protected void PlayCatchEffectsServer()
614 {
615 if (m_YieldItemIdx == -1)
616 return;
617
619
620 PlayCatchNoise(yItem);
622 }
623
624 protected void PlayCatchEffectsClient()
625 {
626 if (m_YieldItemIdx == -1)
627 return;
628
630 PlayCatchSound(yItem);
631 }
632
633 protected void PlayCatchSound(YieldItemBase yItem)
634 {
635 if (yItem.GetCatchDeathSoundset() != "")
637 }
638
639 protected void PlayCatchNoise(YieldItemBase yItem)
640 {
641 string noiseType = yItem.GetCatchAINoise();
642 if (noiseType == "")
643 return;
644
646 m_NoisePar.Load(noiseType);
647 float noiseMultiplier = yItem.GetCatchAINoiseBaseStrength();
648 noiseMultiplier *= NoiseAIEvaluate.GetNoiseReduction(GetGame().GetWeather());
649 GetGame().GetNoiseSystem().AddNoiseTarget(m_PreyPos, 5, m_NoisePar, noiseMultiplier);
650 }
651
653 {
654 int particleId = yItem.GetCatchParticleID();
655 if (particleId == ParticleList.INVALID)
656 return;
657
659 {
661 }
662 else
663 {
664 SEffectManager.ReinitParticleServer(m_CatchParticleEffecterId, new ParticleEffecterParameters("ParticleEffecter", 5, particleId)); //reinit here, since particleId might differ
666 }
667 }
668
669 //Pre-roll validation, bait compatibility handled between YieldItems and bait type
670 bool SetCanCatch( out EntityAI bait )
671 {
672 return m_CatchingContext.IsValid();
673 }
674
675 override void OnItemLocationChanged( EntityAI old_owner, EntityAI new_owner )
676 {
677 super.OnItemLocationChanged( old_owner, new_owner );
678
679 if ( GetGame().IsServer() )
680 {
681 // throw trap from vicinity if the trap does not need installation ( action required )
682 if ( new_owner == NULL && m_NeedInstalation == false )
683 {
684 SetActive();
685 }
686 else if ( old_owner == NULL && new_owner != NULL )
687 {
688 if ( m_IsFoldable )
689 {
690 Fold();
691 }
692 else
693 {
694 SetInactive();
695 }
696 }
697
698 if (m_YieldItemIdx != -1) //resets sound effect idx
699 {
700 m_YieldItemIdx = -1;
701 SetSynchDirty();
702 }
703 }
704 }
705
706 // Generic water check, no real distinction between pond or sea
707 bool IsSurfaceWater(vector position)
708 {
709 string surfaceType;
710 GetGame().SurfaceGetType3D(position[0], position[1], position[2], surfaceType);
711
712 return Surface.AllowedWaterSurface(position[1] + 0.1, surfaceType, m_PlaceableWaterSurfaceList);
713 }
714
715 // Can only receive attachment if deployed
716 override bool CanDisplayAttachmentSlot( int slot_id )
717 {
718 super.CanDisplayAttachmentSlot( slot_id );
719 return IsDeployed();
720 }
721
722 override bool CanReceiveAttachment( EntityAI attachment, int slotId )
723 {
724 super.CanReceiveAttachment( attachment, slotId );
725 return IsDeployed();
726 }
727
728 override void EEItemAttached( EntityAI item, string slot_name )
729 {
730 super.EEItemAttached( item, slot_name );
731
732 if (IsActive() && GetGame().IsServer())
733 {
735 m_CatchingContext.UpdateDataAndMasks();
736 m_CatchingContext.GenerateResult();
738 }
739 }
740
741 override void EEItemDetached(EntityAI item, string slot_name)
742 {
743 super.EEItemDetached( item, slot_name );
744
745 if (IsActive() && GetGame().IsServer())
746 {
748 m_CatchingContext.UpdateDataAndMasks();
749 m_CatchingContext.GenerateResult();
751 }
752 }
753
755
757 {
759 delete m_CatchingContext;
760 }
761
763 {
764 m_CatchEnviroMask = m_CatchingContext.UpdateTrapEnviroMask();
765 }
766
767 void SetTrapEnviroMask(int value)
768 {
769 m_CatchingContext.SetTrapEnviroMask(value);
770 }
771
773 {
775 {
777 m_CatchingContext.RemoveBait();
778 else
780 }
781 }
782
785 {
786 int count = GetInventory().AttachmentCount();
787 if (count > 0)
788 {
789 EntityAI att;
790 for (int i = 0; i < count; i++)
791 {
792 att = GetInventory().GetAttachmentFromIndex(i);
793 GetInventory().DropEntity(InventoryMode.SERVER,this,att);
794 }
795 }
796 }
797
798 //================================================================
799 // ADVANCED PLACEMENT
800 //================================================================
801
802 override void OnPlacementComplete(Man player, vector position = "0 0 0", vector orientation = "0 0 0")
803 {
804 super.OnPlacementComplete(player, position, orientation);
805
806 if (GetGame().IsServer())
807 {
808 vector rotation_matrix[3];
809 float direction[4];
810 Math3D.YawPitchRollMatrix(orientation, rotation_matrix);
811 Math3D.MatrixToQuat(rotation_matrix, direction);
813 InventoryLocation destination = new InventoryLocation;
814
815 if (GetInventory().GetCurrentInventoryLocation(source))
816 {
817 destination.SetGroundEx(this, position, direction);
818 if (GetGame().IsMultiplayer())
819 {
820 player.ServerTakeToDst(source, destination);
821 SetupTrapPlayer(PlayerBase.Cast(player), false);
822 }
823 else // singleplayer
824 {
825 PlayerBase.Cast(player).GetDayZPlayerInventory().RedirectToHandEvent(InventoryMode.LOCAL, source, destination);
827 }
828 }
829
832 SetActive();
833 }
834 }
835
836
838 {
839 if ( GetGame().IsServer() )
840 {
842 GetInventory().GetCurrentInventoryLocation(loc);
843 if (loc.GetType() == InventoryLocationType.HANDS)
844 {
845 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
846
847 vector player_pos = player.GetPosition();
848 vector aim_pos = player.GetAimPosition();
849
850 if ( vector.DistanceSq(player_pos, aim_pos) <= ( 1.5 * 1.5 ) )
851 {
852 return IsPlaceableAtPosition( aim_pos );
853 }
854 }
855 }
856
857 return false;
858 }
859
860 override bool CanBePlaced( Man player, vector position )
861 {
862 return IsPlaceableAtPosition(position);
863 }
864
865 // We add the action to deploy a trap laid on ground
866 override void SetActions()
867 {
868 super.SetActions();
869
872 }
873
874 // ===============================================================
875 // ===================== DEPRECATED ============================
876 // ===============================================================
877
878 const string m_PlaceableWaterType
879
886 protected bool m_IsInProgress;
887 protected ref EffectSound m_DeployLoopSound;
888 protected EntityAI m_Bait;
892
894 ref multiMap<string, float> m_CatchesPond;
895 ref multiMap<string, float> m_CatchesSea;
896 ref multiMap<string, float> m_CatchesGroundAnimal;
897
901 void AlignCatch(ItemBase obj, string catch_name);
906 // ===============================================================
907}
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
ActionActivateTrapCB ActionContinuousBaseCB ActionActivateTrap()
Определения ActionActivateTrap.c:18
ref NoiseParams m_NoisePar
Определения ActionOpenDoors.c:94
void AddAction(typename actionName)
Определения AdvancedCommunication.c:220
void SetTrapEnviroMask(int value)
Определения CatchingContextTraps.c:394
int UpdateTrapEnviroMask()
Определения CatchingContextTraps.c:388
proto native CEApi GetCEApi()
Get the CE API.
InventoryLocationType
types of Inventory Location
Определения InventoryLocation.c:4
bool m_IsStoreLoad
Определения ItemBase.c:4910
bool IsActive()
Определения ModifierBase.c:130
class NoiseSystem NoiseParams()
Определения Noise.c:15
void AddDefect()
Определения TrapBase.c:406
void SetActive()
Определения TrapBase.c:414
void SetInactive(bool stop_timer=true)
Определения TrapBase.c:459
void SetupTrapPlayer(PlayerBase player, bool set_position=true)
Определения TrapBase.c:388
proto native NoiseSystem GetNoiseSystem()
proto native float GetTickTime()
Returns current time from start of the game.
override ScriptCallQueue GetCallQueue(int call_category)
Определения DayZGame.c:1187
proto native float SurfaceRoadY(float x, float z, RoadSurfaceDetection rsd=RoadSurfaceDetection.LEGACY)
proto float SurfaceGetType3D(float x, float y, float z, out string type)
Y input: Maximum Y to trace down from; Returns: Y position the surface was found.
bool IsSurfaceDigable(string surface)
Checks if the surface is digable.
Определения Global/game.c:1211
proto native Mission GetMission()
YieldItemBase GetYieldItemByIdx(int idx)
Определения CatchYieldBank.c:43
static void Log(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message with normal prio.
Определения 3_Game/tools/Debug.c:122
Определения 3_Game/tools/Debug.c:2
static float EaseInQuad(float t)
Определения Easing.c:19
Input value between 0 and 1, returns value adjusted by easing, no automatic clamping of input(do your...
Определения Easing.c:3
Wrapper class for managing sound through SEffectManager.
Определения EffectSound.c:5
proto native int GetType()
returns type of InventoryLocation
proto native void SetGroundEx(EntityAI e, vector pos, float dir[4])
sets current inventory location type to Ground with transformation mat
InventoryLocation.
Определения InventoryLocation.c:29
ref CatchingContextTrapsBase m_CatchingContext
Определения TrapSpawnBase.c:45
void InitCatchingComponent()
override void EEItemAttached(EntityAI item, string slot_name)
Определения TrapSpawnBase.c:728
void AdjustDetectionRange()
Определения TrapSpawnBase.c:453
float m_NoBaitCatchProb
DEPRECATED.
Определения TrapSpawnBase.c:890
void SetTrapEnviroMask(int value)
Определения TrapSpawnBase.c:767
void UpdatePreyPos()
Определения TrapSpawnBase.c:240
void OnCatchSpawnServer()
Определения TrapSpawnBase.c:601
void ResetRunningTimerProgress()
Определения TrapSpawnBase.c:301
bool m_IsDeployed
Определения TrapSpawnBase.c:35
bool IsSurfaceWater(vector position)
Определения TrapSpawnBase.c:707
int m_RollSuccessTime
Определения TrapSpawnBase.c:22
string m_AnimationPhaseTriggered
Определения TrapSpawnBase.c:40
void PlayCatchParticleSynced(YieldItemBase yItem)
Определения TrapSpawnBase.c:652
bool SetCanCatch(out EntityAI bait)
Определения TrapSpawnBase.c:670
string m_InfoSetup
DEPRECATED.
Определения TrapSpawnBase.c:885
bool m_IsInProgress
DEPRECATED.
Определения TrapSpawnBase.c:886
override bool OnStoreLoad(ParamsReadContext ctx, int version)
Определения TrapSpawnBase.c:110
ref Timer m_AlignCatchTimer
DEPRECATED, no reason to keep the information as member.
Определения TrapSpawnBase.c:884
void PlayCatchEffectsClient()
Определения TrapSpawnBase.c:624
bool CanPutInInventory(EntityAI player)
DEPRECATED.
void HandleBaitLoss()
Определения TrapSpawnBase.c:772
int m_YieldItemIdxLocal
Определения TrapSpawnBase.c:27
void PlayCatchNoise(YieldItemBase yItem)
Определения TrapSpawnBase.c:639
void AlignCatch(ItemBase obj, string catch_name)
DEPRECATED.
float m_MinimalDistanceFromPlayersToCatch
Absolute damage dealt to trap when used.
Определения TrapSpawnBase.c:15
bool IsDeployed()
Определения TrapSpawnBase.c:169
void PlayCatchEffectsServer()
Определения TrapSpawnBase.c:613
int m_ActivationTime
Определения TrapSpawnBase.c:21
float m_FinalCatchProb
DEPRECATED.
Определения TrapSpawnBase.c:891
void DetachAllAttachments()
detaches everything on catching end (some slots may not be accessible when folded)
Определения TrapSpawnBase.c:784
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
Определения TrapSpawnBase.c:675
bool m_BaitNeeded
DEPRECATED.
Определения TrapSpawnBase.c:881
int m_ElapsedTime
Adjusted by init wait time, when appropriate.
Определения TrapSpawnBase.c:20
override bool CanPutIntoHands(EntityAI parent)
Определения TrapSpawnBase.c:284
bool m_IsUsable
DEPRECATED.
Определения TrapSpawnBase.c:882
void IncreaseElapsedTime()
Определения TrapSpawnBase.c:439
void PlayDeployLoopSound()
override void SetActions()
Определения TrapSpawnBase.c:866
int m_AdjustedMaxActiveTime
After this time after deployment, the trap is activated.
Определения TrapSpawnBase.c:19
void ResetActiveProgress()
Определения TrapSpawnBase.c:290
void OnCatchSpawnClient()
Определения TrapSpawnBase.c:606
float m_CurrentMinimalDistance
Определения TrapSpawnBase.c:23
void RunTrappingTimer(float duration, string fnName)
generic trapping launcher for traps, use this to store delta info
Определения TrapSpawnBase.c:316
int m_YieldItemIdx
Определения TrapSpawnBase.c:28
int m_SpawnUpdateWaitTime
Catch evaluation interval.
Определения TrapSpawnBase.c:11
bool m_IsCatchSuccessful
Определения TrapSpawnBase.c:25
void SetCatchSuccessful(bool successful)
Определения TrapSpawnBase.c:596
void SpawnCatch()
Определения TrapSpawnBase.c:574
void SetInactive()
Определения TrapSpawnBase.c:382
void SetupTrapPlayer(PlayerBase player, bool set_position=true)
Определения TrapSpawnBase.c:225
void PlayCatchSound(YieldItemBase yItem)
Определения TrapSpawnBase.c:633
ref multiMap< string, float > m_CatchesGroundAnimal
DEPRECATED.
Определения TrapSpawnBase.c:896
ref EffectSound m_DeployLoopSound
DEPRECATED.
Определения BarbedWire.c:413
void TrapSpawnBase()
Определения TrapSpawnBase.c:51
int m_MaxActiveTime
Catch spawn and player check interval (expensive-ish)
Определения TrapSpawnBase.c:12
void InitTrapValues()
Определения TrapSpawnBase.c:76
void Fold()
Определения TrapSpawnBase.c:247
override void OnStoreSave(ParamsWriteContext ctx)
Определения TrapSpawnBase.c:99
void UpdateTrapEnviroMask()
Определения TrapSpawnBase.c:762
float m_BaitLossFraction
Max time of trap activity (seconds)
Определения TrapSpawnBase.c:13
ref multiMap< string, float > m_CatchesSea
DEPRECATED.
Определения TrapSpawnBase.c:895
int m_CatchParticleEffecterId
Определения TrapSpawnBase.c:29
int m_InitWaitTime
duh
Определения TrapSpawnBase.c:18
void SetUsed()
Определения TrapSpawnBase.c:404
void AddDefect()
Определения TrapSpawnBase.c:256
int m_InitWaitTimeMin
Определения TrapSpawnBase.c:8
int m_InitWaitTimeMax
Определения TrapSpawnBase.c:9
void ClearCatchingComponent()
Определения TrapSpawnBase.c:756
bool IsPlayerInVicinity()
Определения TrapSpawnBase.c:543
void SetActive()
Определения TrapSpawnBase.c:338
int m_UpdateWaitTime
Определения TrapSpawnBase.c:10
override void EEItemDetached(EntityAI item, string slot_name)
Определения TrapSpawnBase.c:741
override void OnVariablesSynchronized()
this event is called all variables are synchronized on client
Определения TrapSpawnBase.c:152
bool IsPlaceable()
Определения TrapSpawnBase.c:837
vector m_PreyPos
Определения TrapSpawnBase.c:31
override bool CanDisplayAttachmentSlot(int slot_id)
Определения TrapSpawnBase.c:716
void SetDeployed(bool newState)
Определения TrapSpawnBase.c:174
float m_CurrentlyUsedDelta
Определения TrapSpawnBase.c:24
ItemBase m_Catch
DEPRECATED.
Определения TrapSpawnBase.c:883
EntityAI m_Bait
DEPRECATED.
Определения TrapSpawnBase.c:888
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Определения TrapSpawnBase.c:722
override bool CanPutInCargo(EntityAI parent)
Определения TrapSpawnBase.c:278
override void OnPlacementComplete(Man player, vector position="0 0 0", vector orientation="0 0 0")
Определения TrapSpawnBase.c:802
void StartActivate(PlayerBase player)
Определения TrapSpawnBase.c:264
void ~TrapSpawnBase()
Определения TrapSpawnBase.c:65
const string m_PlaceableWaterType ref Timer m_PrevTimer
DEPRECATED.
Определения TrapSpawnBase.c:880
override bool IsTakeable()
Определения TrapSpawnBase.c:200
bool m_IsActive
Определения TrapSpawnBase.c:33
ref Timer m_Timer
Определения Raycaster.c:5
void TrySpawnCatch()
Определения TrapSpawnBase.c:554
bool IsActive()
Определения TrapSpawnBase.c:164
float m_BaitCatchProb
Определения TrapSpawnBase.c:889
bool m_CanCatch
Определения TrapSpawnBase.c:4
bool IsPlaceableAtPosition(vector position)
Определения TrapSpawnBase.c:205
void Fold(bool keep_connected=false)
Определения Spotlight.c:238
void SetupTrap()
Определения TrapSpawnBase.c:214
string m_AnimationPhaseSet
Определения TrapSpawnBase.c:39
bool m_NeedInstalation
Определения TrapSpawnBase.c:7
void StopDeployLoopSound()
DEPRECATED.
bool m_IsPastWaitingTime
Определения TrapSpawnBase.c:34
override bool CanBePlaced(Man player, vector position)
Определения TrapSpawnBase.c:860
float m_DefectRate
Normalized bait qty reduction on unsuccessful catch.
Определения TrapSpawnBase.c:14
bool m_WaterSurfaceForSetup
DEPRECATED.
Определения TrapSpawnBase.c:893
bool CanBeTaken()
Определения TrapSpawnBase.c:268
void EvaluateCatch()
Определения TrapSpawnBase.c:473
bool m_IsFoldable
Определения TrapSpawnBase.c:3
ref multiMap< string, float > m_CatchesPond
DEPRECATED.
Определения TrapSpawnBase.c:894
void CatchSetQuant(ItemBase catch)
!DEPRECATED
string m_AnimationPhaseUsed
Определения TrapSpawnBase.c:41
ref array< string > m_PlaceableWaterSurfaceList
Определения TrapSpawnBase.c:43
int m_CatchEnviroMask
Определения TrapSpawnBase.c:26
Определения EnMath3D.c:28
Определения EnMath.c:7
WorldData GetWorldData()
Определения gameplay.c:743
static float GetNoiseReduction(Weather weather)
Определения SensesAIEvaluate.c:18
proto void AddNoiseTarget(vector pos, float lifetime, NoiseParams noise_params, float external_strength_multiplier=1.0)
Will make a noise at that position which the AI will "see" for the duration of 'lifetime'.
static const int INVALID
Определения ParticleList.c:20
Определения ParticleList.c:12
Определения PlayerBaseClient.c:2
static EffectSound PlaySoundEnviroment(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound, updating environment variables.
Определения EffectManager.c:228
static void DestroyEffecterParticleServer(int effecterID)
Определения EffectManager.c:630
static int CreateParticleServer(vector pos, EffecterParameters parameters)
returns unique effecter ID
Определения EffectManager.c:577
static void ReinitParticleServer(int effecterID, EffecterParameters parameters)
allows re-initializing existing effecter with new parameters (extept m_EffecterType,...
Определения EffectManager.c:593
static void ReactivateParticleServer(int effecterID)
Определения EffectManager.c:602
Manager class for managing Effect (EffectParticle, EffectSound)
Определения EffectManager.c:6
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Write(void value_out)
proto bool Read(void value_in)
static bool AllowedWaterSurface(float pHeight, string pSurface, array< string > pAllowedSurfaceList)
Определения Surface.c:31
Определения Surface.c:2
Определения DayZPlayerImplement.c:63
override void InitTrapValues()
Определения Trap_FishNet.c:3
override void InitCatchingComponent()
Определения Trap_FishNet.c:23
override bool IsPlaceableAtPosition(vector position)
Определения Trap_FishNet.c:39
Определения Trap_FishNet.c:2
const string FRESH
fake
Определения ActionConstants.c:163
const string SEA
Определения ActionConstants.c:162
Определения ActionConstants.c:161
CatchYieldBank GetCatchYieldBank()
Определения WorldData.c:387
string GetCatchAINoise()
Определения CatchYieldItemBase.c:86
float GetCatchAINoiseBaseStrength()
Определения CatchYieldItemBase.c:91
string GetCatchDeathSoundset()
Определения CatchYieldItemBase.c:81
int GetCatchParticleID()
Определения CatchYieldItemBase.c:96
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static proto native float DistanceSq(vector v1, vector v2)
Returns the square distance between tips of two 3D vectors.
Определения EnConvert.c:106
Serializer ParamsReadContext
Определения gameplay.c:15
proto native CGame GetGame()
Serializer ParamsWriteContext
Определения gameplay.c:16
proto void Print(void var)
Prints content of variable to console/log.
proto native void SetPosition(vector position)
Set the world position of the Effect.
Определения Effect.c:463
static proto void MatrixToQuat(vector mat[3], out float d[4])
Converts rotation matrix to quaternion.
static proto void YawPitchRollMatrix(vector ang, out vector mat[3])
Creates rotation matrix from angles.
static proto float Lerp(float a, float b, float time)
Linearly interpolates between 'a' and 'b' given 'time'.
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Определения EnMath.c:106
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'.
static proto float InverseLerp(float a, float b, float value)
Calculates the linear value that produces the interpolant value within the range [a,...
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9
proto native int ToInt()
Converts string to integer.
proto native bool IsCLIParam(string param)
Returns if command line argument is present.
proto bool GetCLIParam(string param, out string val)
Returns command line argument.
const int CALL_CATEGORY_SYSTEM
Определения 3_Game/tools/tools.c:8