DayZ 1.27
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 m_CurrentlyUsedDelta = duration;
324 m_Timer.Run(duration, this, fnName);
325 }
326
327 // Set animation phases according to state
329 {
331
332 if ( GetGame().IsServer() && !IsActive() )
333 {
334 SetCatchSuccessful(false);
335 m_IsActive = true;
336 m_IsPastWaitingTime = false;
337 m_YieldItemIdx = -1;
338
342
343 SetSynchDirty();
344
346 {
347 SetAnimationPhase( m_AnimationPhaseSet, 1 );
348 SetAnimationPhase( m_AnimationPhaseTriggered, 0 );
349 SetAnimationPhase( m_AnimationPhaseUsed, 1 );
350 }
351
354 if (!m_IsStoreLoad) //presumably activated by the player, store load initializes component separately
355 {
358
361 }
362 else //presumed store load
363 {
365
366 RunTrappingTimer(m_UpdateWaitTime,"EvaluateCatch");
368 }
369 }
370 }
371
373 {
374 if ( GetGame().IsServer() )
375 {
376 // We stop timers as the trap is no longer active, then update visuals
377 m_IsActive = false;
378
380
381 if ( m_Timer )
382 {
383 m_Timer.Stop();
384 }
385
386 m_IsPastWaitingTime = false;
387
388 SetDeployed( false );
389
390 SetSynchDirty();
391 }
392 }
393
394 void SetUsed()
395 {
396 if ( GetGame().IsServer() )
397 {
398 // We updated state, visuals and stop timers
399 m_IsActive = false;
400 m_IsDeployed = false;
401
402 // Deal damage to trap
403 AddDefect();
406
408
409 if ( m_Timer )
410 {
411 m_Timer.Stop();
412 }
413
414 m_IsPastWaitingTime = false;
415
417 {
418 SetAnimationPhase( m_AnimationPhaseSet, 1 );
419 SetAnimationPhase( m_AnimationPhaseTriggered, 1 );
420 SetAnimationPhase( m_AnimationPhaseUsed, 0 );
421 }
422
423 m_CatchingContext = null;
424
425 SetSynchDirty();
426 }
427 }
428
430 {
432
433 #ifdef DEVELOPER
434 if (IsCLIParam("catchingLogs"))
435 {
436 Print("dbgTrapz | delta: " + m_CurrentlyUsedDelta);
437 Print("dbgTrapz | m_ElapsedTime: " + m_ElapsedTime);
438 Print("dbgTrapz | m_AdjustedMaxActiveTime: " + m_AdjustedMaxActiveTime);
439 }
440 #endif
441 }
442
444 {
446 {
447 float time = m_ElapsedTime - m_RollSuccessTime;
448 float timeLimit = m_AdjustedMaxActiveTime - m_RollSuccessTime;
449 time = Math.InverseLerp(0,timeLimit,time);
450 time = Easing.EaseInQuad(time);
453
454 #ifdef DEVELOPER
455 if (IsCLIParam("catchingLogs"))
456 {
457 Print("dbgTrapz | adjusted distance: " + m_CurrentMinimalDistance + "/" + m_MinimalDistanceFromPlayersToCatch + " | LERP progress: " + time);
458 }
459 #endif
460 }
461 }
462
464 {
465 #ifdef DEVELOPER
466 m_dbgAttemptCount++;
467 #endif
468
469 m_IsPastWaitingTime = true;
471
472 #ifdef DEVELOPER
473 if (IsCLIParam("catchingLogs"))
474 {
475 Print("dbgTrapz | m_dbgAttemptCount: " + m_dbgAttemptCount + "/" + (m_MaxActiveTime/m_UpdateWaitTime));
476 }
477 #endif
478
479 bool success = false;
481 if (m_CanCatch)
482 {
483 if (m_CatchingContext.RollCatch())
484 {
485 success = true;
486
487 #ifdef DEVELOPER
488 if (IsCLIParam("catchingLogs"))
489 {
490 Print("dbgTrapz | success!!!");
491 Print("---------------------");
492 }
493 #endif
494 }
495 }
496
497 m_Timer.Stop();
498
500 {
501 SetUsed();
502 return;
503 }
504
505 if (success)
506 {
510 }
511 else
512 {
513 RunTrappingTimer(m_UpdateWaitTime,"EvaluateCatch");
514 }
515 }
516
518 {
519 if (!GetCEApi())
520 {
521 Debug.Log("CE not enabled, player avoidance not available!");
522 return false;
523 }
524
525 return !GetCEApi().AvoidPlayer(GetPosition(), m_CurrentMinimalDistance);
526 }
527
529 {
532
534 {
535 SpawnCatch();
536 }
538 {
540 }
541 }
542
543 // Actually spawns the prey
545 {
546 // Only server side, let's make sure
547 if (GetGame().IsMultiplayer() && GetGame().IsClient())
548 return;
549
551
552 ItemBase catch;
553 if (m_CanCatch)
554 {
555 catch = ItemBase.Cast(m_CatchingContext.SpawnAndSetupCatch(m_YieldItemIdx,m_PreyPos));
556
558 SetCatchSuccessful(catch != null);
559 // We change the trap state and visuals
560 SetUsed();
561 }
562
563 SetSynchDirty();
564 }
565
566 void SetCatchSuccessful(bool successful)
567 {
568 m_IsCatchSuccessful = successful;
569 }
570
575
577 {
578 UpdatePreyPos(); //previously set on server only
579
581 }
582
583 protected void PlayCatchEffectsServer()
584 {
585 if (m_YieldItemIdx == -1)
586 return
587
589
590 PlayCatchNoise(yItem);
592 }
593
594 protected void PlayCatchEffectsClient()
595 {
596 if (m_YieldItemIdx == -1)
597 return
598
600 PlayCatchSound(yItem);
601 }
602
603 protected void PlayCatchSound(YieldItemBase yItem)
604 {
605 if (yItem.GetCatchDeathSoundset() != "")
607 }
608
609 protected void PlayCatchNoise(YieldItemBase yItem)
610 {
612 string noiseType = yItem.GetCatchAINoise();
613 if (noiseType == "")
614 return;
615
616 m_NoisePar.Load(noiseType);
617 float noiseMultiplier = yItem.GetCatchAINoiseBaseStrength();
618 noiseMultiplier *= NoiseAIEvaluate.GetNoiseReduction(GetGame().GetWeather());
619 GetGame().GetNoiseSystem().AddNoiseTarget(m_PreyPos, 5, m_NoisePar, noiseMultiplier);
620 }
621
623 {
624 int particleId = yItem.GetCatchParticleID();
625 if (particleId == ParticleList.INVALID)
626 return;
627
629 {
631 }
632 else
633 {
634 SEffectManager.ReinitParticleServer(m_CatchParticleEffecterId, new ParticleEffecterParameters("ParticleEffecter", 5, particleId)); //reinit here, since particleId might differ
636 }
637 }
638
639 //Pre-roll validation, bait compatibility handled between YieldItems and bait type
640 bool SetCanCatch( out EntityAI bait )
641 {
642 return m_CatchingContext.IsValid();
643 }
644
645 override void OnItemLocationChanged( EntityAI old_owner, EntityAI new_owner )
646 {
647 super.OnItemLocationChanged( old_owner, new_owner );
648
649 if ( GetGame().IsServer() )
650 {
651 // throw trap from vicinity if the trap does not need installation ( action required )
652 if ( new_owner == NULL && m_NeedInstalation == false )
653 {
654 SetActive();
655 }
656 else if ( old_owner == NULL && new_owner != NULL )
657 {
658 if ( m_IsFoldable )
659 {
660 Fold();
661 }
662 else
663 {
664 SetInactive();
665 }
666 }
667
668 if (m_YieldItemIdx != -1) //resets sound effect idx
669 {
670 m_YieldItemIdx = -1;
671 SetSynchDirty();
672 }
673 }
674 }
675
676 // Generic water check, no real distinction between pond or sea
677 bool IsSurfaceWater(vector position)
678 {
679 string surfaceType;
680 GetGame().SurfaceGetType3D(position[0], position[1], position[2], surfaceType);
681
682 return Surface.AllowedWaterSurface(position[1] + 0.1, surfaceType, m_PlaceableWaterSurfaceList);
683 }
684
685 // Can only receive attachment if deployed
686 override bool CanDisplayAttachmentSlot( int slot_id )
687 {
688 super.CanDisplayAttachmentSlot( slot_id );
689 return IsDeployed();
690 }
691
692 override bool CanReceiveAttachment( EntityAI attachment, int slotId )
693 {
694 super.CanReceiveAttachment( attachment, slotId );
695 return IsDeployed();
696 }
697
698 override void EEItemAttached( EntityAI item, string slot_name )
699 {
700 super.EEItemAttached( item, slot_name );
701
702 if (IsActive() && GetGame().IsServer())
703 {
705 m_CatchingContext.UpdateDataAndMasks();
706 m_CatchingContext.GenerateResult();
708 }
709 }
710
711 override void EEItemDetached(EntityAI item, string slot_name)
712 {
713 super.EEItemDetached( item, slot_name );
714
715 if (IsActive() && GetGame().IsServer())
716 {
718 m_CatchingContext.UpdateDataAndMasks();
719 m_CatchingContext.GenerateResult();
721 }
722 }
723
725
727 {
729 delete m_CatchingContext;
730 }
731
733 {
734 m_CatchEnviroMask = m_CatchingContext.UpdateTrapEnviroMask();
735 }
736
737 void SetTrapEnviroMask(int value)
738 {
739 m_CatchingContext.SetTrapEnviroMask(value);
740 }
741
743 {
745 {
747 m_CatchingContext.RemoveBait();
748 else
750 }
751 }
752
755 {
756 int count = GetInventory().AttachmentCount();
757 if (count > 0)
758 {
759 EntityAI att;
760 for (int i = 0; i < count; i++)
761 {
762 att = GetInventory().GetAttachmentFromIndex(i);
763 GetInventory().DropEntity(InventoryMode.SERVER,this,att);
764 }
765 }
766 }
767
768 //================================================================
769 // ADVANCED PLACEMENT
770 //================================================================
771
772 override void OnPlacementComplete(Man player, vector position = "0 0 0", vector orientation = "0 0 0")
773 {
774 super.OnPlacementComplete(player, position, orientation);
775
776 if (GetGame().IsServer())
777 {
778 vector rotation_matrix[3];
779 float direction[4];
780 Math3D.YawPitchRollMatrix(orientation, rotation_matrix);
781 Math3D.MatrixToQuat(rotation_matrix, direction);
783 InventoryLocation destination = new InventoryLocation;
784
785 if (GetInventory().GetCurrentInventoryLocation(source))
786 {
787 destination.SetGroundEx(this, position, direction);
788 if (GetGame().IsMultiplayer())
789 {
790 player.ServerTakeToDst(source, destination);
791 SetupTrapPlayer(PlayerBase.Cast(player), false);
792 }
793 else // singleplayer
794 {
795 PlayerBase.Cast(player).GetDayZPlayerInventory().RedirectToHandEvent(InventoryMode.LOCAL, source, destination);
797 }
798 }
799
802 SetActive();
803 }
804 }
805
806
808 {
809 if ( GetGame().IsServer() )
810 {
812 GetInventory().GetCurrentInventoryLocation(loc);
813 if (loc.GetType() == InventoryLocationType.HANDS)
814 {
815 PlayerBase player = PlayerBase.Cast(GetHierarchyRootPlayer());
816
817 vector player_pos = player.GetPosition();
818 vector aim_pos = player.GetAimPosition();
819
820 if ( vector.DistanceSq(player_pos, aim_pos) <= ( 1.5 * 1.5 ) )
821 {
822 return IsPlaceableAtPosition( aim_pos );
823 }
824 }
825 }
826
827 return false;
828 }
829
830 override bool CanBePlaced( Man player, vector position )
831 {
832 return IsPlaceableAtPosition(position);
833 }
834
835 // We add the action to deploy a trap laid on ground
836 override void SetActions()
837 {
838 super.SetActions();
839
842 }
843
844 // ===============================================================
845 // ===================== DEPRECATED ============================
846 // ===============================================================
847
848 const string m_PlaceableWaterType
849
856 protected bool m_IsInProgress;
857 protected ref EffectSound m_DeployLoopSound;
858 protected EntityAI m_Bait;
862
864 ref multiMap<string, float> m_CatchesPond;
865 ref multiMap<string, float> m_CatchesSea;
866 ref multiMap<string, float> m_CatchesGroundAnimal;
867
871 void AlignCatch(ItemBase obj, string catch_name);
876 // ===============================================================
877}
InventoryMode
NOTE: PREDICTIVE is not to be used at all in multiplayer.
Определения Inventory.c:22
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:4838
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.
Определения Game.c:1156
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.
Определения Debug.c:122
Определения 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
Определения Building.c:6
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:698
void AdjustDetectionRange()
Определения TrapSpawnBase.c:443
float m_NoBaitCatchProb
DEPRECATED.
Определения TrapSpawnBase.c:860
void SetTrapEnviroMask(int value)
Определения TrapSpawnBase.c:737
void UpdatePreyPos()
Определения TrapSpawnBase.c:240
void OnCatchSpawnServer()
Определения TrapSpawnBase.c:571
void ResetRunningTimerProgress()
Определения TrapSpawnBase.c:301
bool m_IsDeployed
Определения TrapSpawnBase.c:35
bool IsSurfaceWater(vector position)
Определения TrapSpawnBase.c:677
int m_RollSuccessTime
Определения TrapSpawnBase.c:22
string m_AnimationPhaseTriggered
Определения TrapSpawnBase.c:40
void PlayCatchParticleSynced(YieldItemBase yItem)
Определения TrapSpawnBase.c:622
bool SetCanCatch(out EntityAI bait)
Определения TrapSpawnBase.c:640
string m_InfoSetup
DEPRECATED.
Определения TrapSpawnBase.c:855
bool m_IsInProgress
DEPRECATED.
Определения TrapSpawnBase.c:856
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:854
void PlayCatchEffectsClient()
Определения TrapSpawnBase.c:594
bool CanPutInInventory(EntityAI player)
DEPRECATED.
void HandleBaitLoss()
Определения TrapSpawnBase.c:742
int m_YieldItemIdxLocal
Определения TrapSpawnBase.c:27
void PlayCatchNoise(YieldItemBase yItem)
Определения TrapSpawnBase.c:609
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:583
int m_ActivationTime
Определения TrapSpawnBase.c:21
float m_FinalCatchProb
DEPRECATED.
Определения TrapSpawnBase.c:861
void DetachAllAttachments()
detaches everything on catching end (some slots may not be accessible when folded)
Определения TrapSpawnBase.c:754
override void OnItemLocationChanged(EntityAI old_owner, EntityAI new_owner)
Определения TrapSpawnBase.c:645
bool m_BaitNeeded
DEPRECATED.
Определения TrapSpawnBase.c:851
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:852
void IncreaseElapsedTime()
Определения TrapSpawnBase.c:429
void PlayDeployLoopSound()
override void SetActions()
Определения TrapSpawnBase.c:836
int m_AdjustedMaxActiveTime
After this time after deployment, the trap is activated.
Определения TrapSpawnBase.c:19
void ResetActiveProgress()
Определения TrapSpawnBase.c:290
void OnCatchSpawnClient()
Определения TrapSpawnBase.c:576
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:566
void SpawnCatch()
Определения TrapSpawnBase.c:544
void SetInactive()
Определения TrapSpawnBase.c:372
void SetupTrapPlayer(PlayerBase player, bool set_position=true)
Определения TrapSpawnBase.c:225
void PlayCatchSound(YieldItemBase yItem)
Определения TrapSpawnBase.c:603
ref multiMap< string, float > m_CatchesGroundAnimal
DEPRECATED.
Определения TrapSpawnBase.c:866
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:732
float m_BaitLossFraction
Max time of trap activity (seconds)
Определения TrapSpawnBase.c:13
ref multiMap< string, float > m_CatchesSea
DEPRECATED.
Определения TrapSpawnBase.c:865
int m_CatchParticleEffecterId
Определения TrapSpawnBase.c:29
int m_InitWaitTime
duh
Определения TrapSpawnBase.c:18
void SetUsed()
Определения TrapSpawnBase.c:394
void AddDefect()
Определения TrapSpawnBase.c:256
int m_InitWaitTimeMin
Определения TrapSpawnBase.c:8
int m_InitWaitTimeMax
Определения TrapSpawnBase.c:9
void ClearCatchingComponent()
Определения TrapSpawnBase.c:726
bool IsPlayerInVicinity()
Определения TrapSpawnBase.c:517
void SetActive()
Определения TrapSpawnBase.c:328
int m_UpdateWaitTime
Определения TrapSpawnBase.c:10
override void EEItemDetached(EntityAI item, string slot_name)
Определения TrapSpawnBase.c:711
override void OnVariablesSynchronized()
this event is called all variables are synchronized on client
Определения TrapSpawnBase.c:152
bool IsPlaceable()
Определения TrapSpawnBase.c:807
vector m_PreyPos
Определения TrapSpawnBase.c:31
override bool CanDisplayAttachmentSlot(int slot_id)
Определения TrapSpawnBase.c:686
void SetDeployed(bool newState)
Определения TrapSpawnBase.c:174
float m_CurrentlyUsedDelta
Определения TrapSpawnBase.c:24
ItemBase m_Catch
DEPRECATED.
Определения TrapSpawnBase.c:853
EntityAI m_Bait
DEPRECATED.
Определения TrapSpawnBase.c:858
override bool CanReceiveAttachment(EntityAI attachment, int slotId)
Определения TrapSpawnBase.c:692
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:772
void StartActivate(PlayerBase player)
Определения TrapSpawnBase.c:264
void ~TrapSpawnBase()
Определения TrapSpawnBase.c:65
const string m_PlaceableWaterType ref Timer m_PrevTimer
DEPRECATED.
Определения TrapSpawnBase.c:850
override bool IsTakeable()
Определения TrapSpawnBase.c:200
bool m_IsActive
Определения TrapSpawnBase.c:33
ref Timer m_Timer
Определения Raycaster.c:5
void TrySpawnCatch()
Определения TrapSpawnBase.c:528
bool IsActive()
Определения TrapSpawnBase.c:164
float m_BaitCatchProb
Определения TrapSpawnBase.c:859
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:830
float m_DefectRate
Normalized bait qty reduction on unsuccessful catch.
Определения TrapSpawnBase.c:14
bool m_WaterSurfaceForSetup
DEPRECATED.
Определения TrapSpawnBase.c:863
bool CanBeTaken()
Определения TrapSpawnBase.c:268
void EvaluateCatch()
Определения TrapSpawnBase.c:463
bool m_IsFoldable
Определения TrapSpawnBase.c:3
ref multiMap< string, float > m_CatchesPond
DEPRECATED.
Определения TrapSpawnBase.c:864
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
Определения InventoryItem.c:731
Определения 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:37
Определения 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:438
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 bool IsCLIParam(string param)
Returns if command line argument is present.
const int CALL_CATEGORY_SYSTEM
Определения tools.c:8