DayZ 1.27
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено
BoatScript.c
См. документацию.
8
9enum EBoatEngineSoundState
10{
15 STOP_NO_FUEL
16}
17
18class BoatScriptOwnerState : BoatOwnerState
19{
20};
21
23{
24};
25
26#ifdef DIAG_DEVELOPER
27BoatScript _boat;
28#endif
29
30class BoatScript : Boat
31{
32 protected const int DECAY_PLAYER_RANGE = 300; // when a player is found within this range, decay is deactivated
33 protected const int DECAY_FLAG_RANGE = 100; // when a boat is parked around a territoryflag, decay is deactivated
34 protected const float DECAY_TICK_FREQUENCY = 10; // seconds
35 protected const float DECAY_DAMAGE = 0.017;
36 protected const float DECAY_FLIPPED_MULT = 4;
37
38 protected const float SOUND_ENGINE_FADE = 0.2;
39 protected const float SPLASH_THRESHOLD_CONDITION = 0.08; // diff between sea surface and propeller pos which determines if the splash should happen
40 protected const float SPLASH_THRESHOLD = 0.18; // diff between sea surface and propeller pos which determines when the splash happens
41
44 private bool m_ActionsInitialized;
45
47 protected float m_MomentumPrevTick;
49 protected ref Timer m_DecayTimer;
50
51 // particles
52 protected bool m_UpdateParticles;
54
55 // sounds
56 protected bool m_SplashIncoming; // boat is high enough for the splash to trigger when it falls back down to sea level
58 protected bool m_PlaySoundImpactLight;
59 protected bool m_PlaySoundImpactHeavy;
60 protected bool m_PlaySoundPushBoat;
61 protected bool m_IsEngineSoundFading;
62 protected bool m_EngineFadeDirection; // true>in | false>out
63 protected float m_EngineFadeTime;
64 protected string m_SoundImpactLight;
65 protected string m_SoundImpactHeavy;
66 protected string m_SoundPushBoat;
67 protected string m_SoundWaterSplash;
68 protected string m_SoundEngineStart;
69 protected string m_SoundEngineStop;
70 protected string m_SoundEngineStartNoFuel;
71 protected string m_SoundEngineStopNoFuel;
72
73 // caches to avoid multiple triggers
77 protected ref EffectSound m_SoundEngineEffectDeletion; // hold engine sound which is being stopped & deleted while another is starting
78
80 {
81#ifdef DIAG_DEVELOPER
82 _boat = this;
83#endif
84
85 SetEventMask(EntityEvent.POSTSIMULATE);
86 SetEventMask(EntityEvent.FRAME);
87
90
91 RegisterNetSyncVariableBool("m_PlaySoundEngineStopNoFuel");
92 RegisterNetSyncVariableBool("m_PlaySoundPushBoat");
93 RegisterNetSyncVariableBoolSignal("m_PlaySoundImpactLight");
94 RegisterNetSyncVariableBoolSignal("m_PlaySoundImpactHeavy");
95
96 m_SoundImpactHeavy = "boat_01_hit_light_SoundSet";
97 m_SoundImpactLight = "boat_01_hit_heavy_SoundSet";
98 m_SoundPushBoat = "boat_01_push_SoundSet";
99 m_SoundWaterSplash = "boat_01_splash_SoundSet";
100 m_SoundEngineStart = "boat_01_engine_start_SoundSet";
101 m_SoundEngineStop = "boat_01_engine_stop_SoundSet";
102 m_SoundEngineStartNoFuel = "boat_01_engine_start_no_fuel_SoundSet";
103 m_SoundEngineStopNoFuel = "boat_01_engine_stop_no_fuel_SoundSet";
104
105 if (GetGame().IsServer())
106 {
108 m_DecayTimer.Run(DECAY_TICK_FREQUENCY, this, "DecayHealthTick", NULL, true);
109 }
110
111 if (GetGame().IsDedicatedServer())
112 return;
113
118
119 if (MemoryPointExists("ptcFxFront"))
120 m_WaterEffects[EBoatEffects.PTC_FRONT].AttachTo(this, GetMemoryPointPos("ptcFxFront"));
121
122 if (MemoryPointExists("ptcFxBack"))
123 m_WaterEffects[EBoatEffects.PTC_BACK].AttachTo(this, GetMemoryPointPos("ptcFxBack"));
124
125 if (MemoryPointExists("ptcFxSide1"))
126 m_WaterEffects[EBoatEffects.PTC_SIDE_L].AttachTo(this, GetMemoryPointPos("ptcFxSide1"));
127
128 if (MemoryPointExists("ptcFxSide2"))
129 m_WaterEffects[EBoatEffects.PTC_SIDE_R].AttachTo(this, GetMemoryPointPos("ptcFxSide2"));
130 }
131
133 {
134 if (m_DecayTimer)
135 m_DecayTimer.Stop();
136
137 #ifndef SERVER
139 #endif
140 }
141
142 override void EEDelete(EntityAI parent)
143 {
144 if (!GetGame().IsDedicatedServer())
146 }
147
149 {
151 if (!m_InputActionMap)
152 {
154 m_InputActionMap = iam;
155 SetActions();
156 m_BoatTypeActionsMap.Insert(this.Type(), m_InputActionMap);
157 }
158 }
159
160 override void GetActions(typename action_input_type, out array<ActionBase_Basic> actions)
161 {
163 {
166 }
167
168 actions = m_InputActionMap.Get(action_input_type);
169 }
170
171 override bool DisableVicinityIcon()
172 {
173 return true;
174 }
175
176 override string GetVehicleType()
177 {
178 return "VehicleTypeBoat";
179 }
180
181 override bool IsInventoryVisible()
182 {
183 return (GetGame().GetPlayer() && (!GetGame().GetPlayer().GetCommand_Vehicle() || GetGame().GetPlayer().GetCommand_Vehicle().GetTransport() == this));
184 }
185
187 {
188 return 4.5;
189 }
190
192 {
193 return "0 1.4 0";
194 }
195
196 override int GetAnimInstance()
197 {
198 return VehicleAnimInstances.ZODIAC;
199 }
200
205
206 override bool CrewCanGetThrough(int posIdx)
207 {
208 return true;
209 }
210
211 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
212 {
213 return true;
214 }
215
216 override bool CanReachSeatFromDoors(string pSeatSelection, vector pFromPos, float pDistance = 1.0)
217 {
218 return true;
219 }
220
221 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
222 {
223 return true;
224 }
225
226 override bool IsAreaAtDoorFree(int currentSeat, float maxAllowedObjHeight, inout vector extents, out vector transform[4])
227 {
228 return super.IsAreaAtDoorFree(currentSeat, maxAllowedObjHeight, extents, transform);
229 }
230
231 override bool OnBeforeEngineStart()
232 {
233 if (IsVitalSparkPlug())
234 {
235 EntityAI item = FindAttachmentBySlotName("SparkPlug");
236 if (!item || (item && item.IsRuined()))
237 {
238 HandleEngineSound(EBoatEngineSoundState.START_NO_FUEL);
239 return false;
240 }
241 }
242
243 if (GetFluidFraction(BoatFluid.FUEL) <= 0)
244 {
245 HandleEngineSound(EBoatEngineSoundState.START_NO_FUEL);
246 return false;
247 }
248
249 return true;
250 }
251
252 override void OnEngineStart()
253 {
254 super.OnEngineStart();
255
256 if (GetGame().IsDedicatedServer())
257 return;
258
259 FadeEngineSound(true);
260 HandleEngineSound(EBoatEngineSoundState.START_OK);
261 ClearWaterEffects(); // in case they are still active
262 }
263
264 override void OnEngineStop()
265 {
266 super.OnEngineStop();
267
268 if (GetGame().IsDedicatedServer())
269 return;
270
271 FadeEngineSound(false);
272 HandleEngineSound(EBoatEngineSoundState.STOP_OK);
273
274 vector mat[4];
275 dBodyGetWorldTransform(this, mat);
276 vector pos = mat[3] + VectorToParent(PropellerGetPosition());
277
278 if (GetGame().GetWaterDepth(pos) < 0) // stop instantly
280 else
282 }
283
284 override void EEOnCECreate()
285 {
286 float maxVolume = GetFluidCapacity(BoatFluid.FUEL);
287 float amount = Math.RandomFloat(0.0, maxVolume * 0.35);
288
289 Fill(BoatFluid.FUEL, amount);
290 }
291
292 override void EOnPostSimulate(IEntity other, float timeSlice)
293 {
294 if (!IsProxy())
295 {
298
299 if (EngineIsOn())
300 {
301 if (GetFluidFraction(BoatFluid.FUEL) <= 0)
302 {
303 if (GetGame().IsServer())
304 {
306 SetSynchDirty();
308 }
309
310 EngineStop();
311 }
312 }
313 }
314
315 if (GetGame().IsServer())
316 {
319 m_MomentumPrevTick = GetMomentum();
320 }
321
322 if (!GetGame().IsDedicatedServer())
323 {
324 if (EngineIsOn())
325 m_UpdateParticles = true;
326
329
330 }
331 }
332
333 override void EOnSimulate(IEntity other, float dt)
334 {
335 if (!IsProxy())
336 {
337 if (EngineIsOn())
338 {
339 vector mat[4];
340 dBodyGetWorldTransform(this, mat);
341 vector pos = mat[3] + VectorToParent(PropellerGetPosition());
342
343 if (GetGame().GetWaterDepth(pos) < -0.2)
344 EngineStop();
345 }
346 }
347 }
348
349 override void EOnFrame(IEntity other, float timeSlice)
350 {
351 if (!GetGame().IsDedicatedServer())
352 {
354 UpdateParticles(timeSlice);
355
357 {
358 m_EngineFadeTime -= timeSlice;
359 if (m_EngineFadeTime < 0)
360 m_IsEngineSoundFading = false;
361 }
362 }
363 }
364
365 override void EOnContact(IEntity other, Contact extra)
366 {
367 if (GetGame().IsServer())
368 {
369 if (m_ContactData)
370 return;
371
372 float momentumDelta = GetMomentum() - m_MomentumPrevTick;
373 float dot = vector.Dot(m_VelocityPrevTick.Normalized(), GetVelocity(this).Normalized());
374 if (dot < 0)
375 momentumDelta = m_MomentumPrevTick;
376
378 m_ContactData.SetData(extra.Position, other, momentumDelta); // change to local pos
379 }
380
381 if (!IsProxy())
382 {
383 if (EngineIsOn() && !CheckOperationalState())
384 EngineStop();
385 }
386
387 }
388
389 override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
390 {
391 super.EEHitBy(damageResult, damageType, source, component, dmgZone, ammo, modelPos, speedCoef);
392
393 if (!IsProxy())
394 {
395 if (EngineIsOn() && !CheckOperationalState())
396 EngineStop();
397 }
398 }
399
401 {
402 super.OnVariablesSynchronized();
403
405 {
406 EffectSound impactHeavy;
409 }
410
412 {
413 EffectSound impactLight;
416 }
417
420 else if (m_SoundPushBoatEffect && m_SoundPushBoatEffect.IsPlaying())
422
424 {
425 HandleEngineSound(EBoatEngineSoundState.STOP_NO_FUEL);
427 }
428 }
429
430 protected override bool DetectFlipped(VehicleFlippedContext ctx)
431 {
432 if (!DetectFlippedUsingSurface(ctx, GameConstants.VEHICLE_FLIP_ANGLE_TOLERANCE))
433 return false;
434 return true;
435 }
436
437 override float OnSound(BoatSoundCtrl ctrl, float oldValue)
438 {
440 {
443 else
445
446 return oldValue;
447 }
448
449 return super.OnSound(ctrl, oldValue);
450 }
451
453 {
454 switch (state)
455 {
456 case ECrewMemberState.UNCONSCIOUS:
457 foreach (int unconsciousCrewMemberIndex : m_UnconsciousCrewMemberIndices)
458 {
459 if (unconsciousCrewMemberIndex == DayZPlayerConstants.VEHICLESEAT_DRIVER)
460 EngineStop();
461
462 m_UnconsciousCrewMemberIndices.RemoveItem(unconsciousCrewMemberIndex);
463 }
464
465 break;
466
467 case ECrewMemberState.DEAD:
468 foreach (int deadCrewMemberIndex : m_DeadCrewMemberIndices)
469 {
470 if (deadCrewMemberIndex == DayZPlayerConstants.VEHICLESEAT_DRIVER)
471 EngineStop();
472
473 m_DeadCrewMemberIndices.RemoveItem(deadCrewMemberIndex);
474 }
475
476 break;
477 }
478 }
479
480 protected void DecayHealthTick()
481 {
483 return;
484
486
487 if (IsFlipped())
488 damage *= DECAY_FLIPPED_MULT;
489
490 if (IsInFlagRange())
491 damage *= 0.3;
492
493 AddHealth("Engine","Health", -damage);
494 }
495
496 protected bool IsInFlagRange()
497 {
499 if (!locations)
500 return false;
501
502 int count = locations.Count();
503 if (count > 0)
504 {
505 vector pos = GetWorldPosition();
506 for (int i = 0; i < count; i++)
507 {
508 if (vector.Distance(pos, locations.Get(i)) < DECAY_FLAG_RANGE)
509 return true;
510 }
511
512 return false;
513 }
514 else
515 return false;
516 }
517
519 {
520 if (GetHealthLevel("") >= GameConstants.STATE_RUINED || GetHealthLevel("Engine") >= GameConstants.STATE_RUINED)
521 return false;
522
523 if (IsVitalSparkPlug())
524 {
525 EntityAI item = FindAttachmentBySlotName("SparkPlug");
526 if (!item || (item && item.IsRuined()))
527 return false;
528 }
529
530 return true;
531 }
532
533 // Server side event for jump out processing
535 {
536 vector posMS = data.m_Player.WorldToModel(data.m_Player.GetPosition());
538 healthCoef = Math.Clamp(healthCoef, 0.0, 1.0);
539 data.m_Player.ProcessDirectDamage(DamageType.CUSTOM, data.m_Player, "", "FallDamageHealth", posMS, healthCoef);
540 }
541
542 protected void HandleEngineSound(EBoatEngineSoundState state)
543 {
544 if (GetGame().IsDedicatedServer())
545 return;
546
547 string soundset;
548
549 switch (state)
550 {
551 case EBoatEngineSoundState.START_OK:
552 soundset = m_SoundEngineStart;
553 break;
554 case EBoatEngineSoundState.STOP_OK:
555 soundset = m_SoundEngineStop;
556 break;
557 case EBoatEngineSoundState.START_NO_FUEL:
558 soundset = m_SoundEngineStartNoFuel;
559 break;
560 case EBoatEngineSoundState.STOP_NO_FUEL:
561 soundset = m_SoundEngineStopNoFuel;
562 break;
563 }
564
565 // already playing same type of sound
567 {
568 if (m_SoundEngineEffect.GetSoundSet() == soundset) // already playing same type of sound
569 return;
570 else
571 {
573 m_SoundEngineEffectDeletion.SoundStop(); // stop the existing sound
574
575 m_SoundEngineEffect = null;
576 }
577
578 }
579
580 PlaySound(soundset, m_SoundEngineEffect, ModelToWorld(PropellerGetPosition()));
581 }
582
583 protected void PlaySound(string soundset, inout EffectSound sound, vector position = vector.Zero)
584 {
585 #ifndef SERVER
586 if (position == vector.Zero)
587 position = GetPosition();
588
589 if (!sound)
590 {
591 sound = SEffectManager.PlaySoundCachedParams(soundset, position);
592 sound.SetAttachmentParent(this);
593 sound.SetAutodestroy(true); // SoundWaveObjects tend to null themselves for unknown reasons, breaking the effect in the process
594 }
595 else
596 {
597 if (!sound.IsSoundPlaying())
598 {
599 sound.SetCurrentPosition(position);
600 sound.SoundPlay();
601 }
602 }
603 #endif
604 }
605
606 protected void HandleBoatSplashSound()
607 {
608 float propPosRelative = GetGame().SurfaceGetSeaLevel() - CoordToParent(PropellerGetPosition())[1];
609 if (propPosRelative < SPLASH_THRESHOLD_CONDITION)
610 m_SplashIncoming = true;
611
612 if (m_SplashIncoming && propPosRelative > SPLASH_THRESHOLD)
613 {
615 m_SoundWaterSplashEffect.SetAttachmentParent(this);
616 m_SoundWaterSplashEffect.SetLocalPosition(PropellerGetPosition());
617 m_SoundWaterSplashEffect.SetAutodestroy(true);
618
619 vector velocity = dBodyGetVelocityAt(this, CoordToParent(PropellerGetPosition()));
620 float speed = velocity.Normalize() * 3.6; // to km/h
621 float lerp = Math.InverseLerp(0, 30, speed);
622 m_SoundWaterSplashEffect.SetSoundVolume(lerp);
623
625
626 m_SplashIncoming = false;
627 }
628 }
629
630 protected void SyncSoundImpactLight()
631 {
633 {
635 SetSynchDirty();
636 }
637 }
638
639 protected void SyncSoundImpactHeavy()
640 {
642 {
644 SetSynchDirty();
645 }
646 }
647
648 void SyncSoundPushBoat(bool play)
649 {
650 if (m_PlaySoundPushBoat != play)
651 {
652 m_PlaySoundPushBoat = play;
653 SetSynchDirty();
654 }
655 }
656
657 // Set engine sound to fade on start/stop
658 protected void FadeEngineSound(bool fadeIn)
659 {
661 m_EngineFadeDirection = fadeIn;
663 }
664
665 protected void FlipVehicle()
666 {
667 vector orient = GetOrientation();
668 orient[2] = orient[2] + 180;
669 SetOrientation(orient);
670
671 vector pos = GetPosition();
672 pos[1] = pos[1] + 0.5;
673 SetPosition(pos);
674 }
675
676 protected void CheckContactCache()
677 {
678 if (!m_ContactData)
679 return;
680
681 float impulse = Math.AbsInt(m_ContactData.m_Impulse);
682 m_ContactData = null;
683
685 return;
686 else if (impulse < GameConstants.CARS_CONTACT_DMG_THRESHOLD)
688 else
690 }
691
692 protected void SetActions()
693 {
696 }
697
698 void AddAction(typename actionName)
699 {
700 ActionBase action = ActionManagerBase.GetAction(actionName);
701
702 if (!action)
703 {
704 Debug.LogError("Action " + actionName + " dosn't exist!");
705 return;
706 }
707
708 typename ai = action.GetInputType();
709 if (!ai)
710 {
711 m_ActionsInitialized = false;
712 return;
713 }
714
715 array<ActionBase_Basic> actionArray = m_InputActionMap.Get(ai);
716
717 if (!actionArray)
718 {
719 actionArray = new array<ActionBase_Basic>;
720 m_InputActionMap.Insert(ai, actionArray);
721 }
722
724 {
725 Debug.ActionLog(action.ToString() + " -> " + ai, this.ToString() , "n/a", "Add action" );
726 }
727
728 actionArray.Insert(action);
729 }
730
731 void RemoveAction(typename actionName)
732 {
733 PlayerBase player = PlayerBase.Cast(GetGame().GetPlayer());
734 ActionBase action = player.GetActionManager().GetAction(actionName);
735 typename ai = action.GetInputType();
736 array<ActionBase_Basic> actionArray = m_InputActionMap.Get(ai);
737
738 if (actionArray)
739 {
740 actionArray.RemoveItem(action);
741 }
742 }
743
744 protected void UpdateParticles(float timeSlice = 0)
745 {
746 for (int i; i < 4; i++)
747 {
748 m_WaterEffects[i].Update(timeSlice);
749 }
750 }
751
752 protected void StopParticleUpdate()
753 {
754 m_UpdateParticles = false;
756 }
757
758 protected void ClearWaterEffects()
759 {
761
762 for (int i; i < 4; i++)
763 {
764 if (m_WaterEffects[i].IsPlaying())
765 {
767 {
768 m_WaterEffects[i].GetParticle().SetParticleParam(EmitorParam.BIRTH_RATE, 0);
769 m_WaterEffects[i].GetParticle().SetParticleParam(EmitorParam.BIRTH_RATE_RND, 0);
770 }
771 m_WaterEffects[i].Stop();
772 }
773 }
774 }
775
776 // Called on destroy/stream out
777 protected void CleanupEffects()
778 {
779 for (int i; i < 4; i++)
780 {
782 {
783 m_WaterEffects[i].Stop();
785 }
786 }
787
790 }
791
792 override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
793 {
794 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.FLIP_ENTITY, "Flip vehicle", FadeColors.LIGHT_GREY));
795
796 super.GetDebugActions(outputList);
797
798 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.SEPARATOR, "___________________________", FadeColors.RED));
799 outputList.Insert(new TSelectableActionInfoWithColor(SAT_DEBUG_ACTION, EActions.DELETE, "Delete", FadeColors.RED));
800 }
801
802 override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
803 {
804 if (super.OnAction(action_id, player, ctx))
805 return true;
806
807 if (!GetGame().IsServer())
808 {
809 return false;
810 }
811
812 switch (action_id)
813 {
814 case EActions.DELETE:
815 Delete();
816 return true;
817
818 case EActions.FLIP_ENTITY:
819 FlipVehicle();
820 return true;
821 }
822
823 return false;
824 }
825
826 protected override event typename GetOwnerStateType()
827 {
828 return BoatScriptOwnerState;
829 }
830
831 protected override event typename GetMoveType()
832 {
833 return BoatScriptMove;
834 }
835
836 #ifdef DIAG_DEVELOPER
837 override void FixEntity()
838 {
839 super.FixEntity();
840
841 if (GetGame().IsServer())
842 Fill(BoatFluid.FUEL, GetFluidCapacity(BoatFluid.FUEL));
843
844
845 }
846 #endif
847}
Param4< int, int, string, int > TSelectableActionInfoWithColor
Определения EntityAI.c:97
void ActionManagerBase(PlayerBase player)
Определения ActionManagerBase.c:63
map< typename, ref array< ActionBase_Basic > > TInputActionMap
Определения ActionManagerClient.c:1
vector GetOrientation()
Определения AreaDamageManager.c:306
BoatSoundCtrl
Boat's sound controller list. (native, do not change or extend)
Определения Boat.c:3
BoatFluid
Type of vehicle's fluid. (native, do not change or extend)
Определения Boat.c:14
enum EBoatEffects STOP_OK
enum EBoatEffects START_NO_FUEL
enum EBoatEffects START_OK
EBoatEffects
Определения BoatScript.c:2
@ PTC_SIDE_L
Определения BoatScript.c:5
@ PTC_BACK
Определения BoatScript.c:4
@ PTC_FRONT
Определения BoatScript.c:3
@ PTC_SIDE_R
Определения BoatScript.c:6
void EffectBoatWaterFront()
Определения BoatWaterEffects.c:14
void EffectBoatWaterSide()
Определения BoatWaterEffects.c:203
proto native bool AvoidPlayer(vector vPos, float fDistance)
Check if there is a player within a radius.
proto native CEApi GetCEApi()
Get the CE API.
map
Определения ControlsXboxNew.c:4
DamageType
exposed from C++ (do not change)
Определения DamageSystem.c:11
EActions
Определения EActions.c:2
ECrewMemberState
Определения ECrewMemberState.c:2
bool IsRegistered()
Get whether this Effect is registered in SEffectManager.
Определения Effect.c:545
bool IsPlaying()
Returns true when the Effect is playing, false otherwise.
Определения Effect.c:195
bool IsProxy()
Определения Hand_Events.c:65
void PlaySound()
Определения HungerSoundHandler.c:38
class BoxCollidingParams component
ComponentInfo for BoxCollidingResult.
string Type
Определения JsonDataContaminatedArea.c:11
PlayerBase GetPlayer()
Определения ModifierBase.c:51
proto native ParticleSource GetParticle(int index)
Manually get the particle at index.
VehicleAnimInstances
Определения VehicleAnimInstances.c:2
GetInputType()
Определения ActionBase.c:215
Определения ActionBase.c:53
const int HEALTH_HIGH_SPEED_VALUE
Определения ActionGetOutTransport.c:37
const int HEALTH_LOW_SPEED_VALUE
Определения ActionGetOutTransport.c:36
Определения ActionPushBoat.c:18
Определения Boat.c:24
Определения Boat.c:19
void HandleBoatSplashSound()
Определения BoatScript.c:606
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
Определения BoatScript.c:792
ref EffectBoatWaterBase m_WaterEffects[4]
Определения BoatScript.c:53
void AddAction(typename actionName)
Определения BoatScript.c:698
bool m_PlaySoundPushBoat
Определения BoatScript.c:60
void PlaySound(string soundset, inout EffectSound sound, vector position=vector.Zero)
Определения BoatScript.c:583
bool m_UpdateParticles
Определения BoatScript.c:52
const int DECAY_PLAYER_RANGE
Определения BoatScript.c:32
override void OnEngineStop()
Определения BoatScript.c:264
string m_SoundEngineStopNoFuel
Определения BoatScript.c:71
override void EEDelete(EntityAI parent)
Определения BoatScript.c:142
void HandleEngineSound(EBoatEngineSoundState state)
Определения BoatScript.c:542
void DecayHealthTick()
Определения BoatScript.c:480
bool m_PlaySoundEngineStopNoFuel
Определения BoatScript.c:57
override void EOnFrame(IEntity other, float timeSlice)
Определения BoatScript.c:349
void FadeEngineSound(bool fadeIn)
Определения BoatScript.c:658
ref EffectSound m_SoundPushBoatEffect
Определения BoatScript.c:74
override void EOnPostSimulate(IEntity other, float timeSlice)
Определения BoatScript.c:292
override bool IsInventoryVisible()
Определения BoatScript.c:181
override void GetActions(typename action_input_type, out array< ActionBase_Basic > actions)
Определения BoatScript.c:160
string m_SoundPushBoat
Определения BoatScript.c:66
ref Timer m_DecayTimer
Определения BoatScript.c:49
void FlipVehicle()
Определения BoatScript.c:665
override event GetOwnerStateType()
Определения BoatScript.c:826
bool IsInFlagRange()
Определения BoatScript.c:496
string m_SoundImpactHeavy
Определения BoatScript.c:65
void ~BoatScript()
Определения BoatScript.c:132
string m_SoundWaterSplash
Определения BoatScript.c:67
override bool DetectFlipped(VehicleFlippedContext ctx)
Определения BoatScript.c:430
string m_SoundImpactLight
Определения BoatScript.c:64
override event GetMoveType()
Определения BoatScript.c:831
override int Get3rdPersonCameraType()
Определения BoatScript.c:201
void CheckContactCache()
Определения BoatScript.c:676
override int GetAnimInstance()
Определения BoatScript.c:196
void SyncSoundImpactHeavy()
Определения BoatScript.c:639
void SyncSoundPushBoat(bool play)
Определения BoatScript.c:648
override void EOnSimulate(IEntity other, float dt)
Определения BoatScript.c:333
const float DECAY_FLIPPED_MULT
Определения BoatScript.c:36
float m_MomentumPrevTick
Определения BoatScript.c:47
override void EEHitBy(TotalDamageResult damageResult, int damageType, EntityAI source, int component, string dmgZone, string ammo, vector modelPos, float speedCoef)
Определения BoatScript.c:389
bool m_EngineFadeDirection
Определения BoatScript.c:62
ref EffectSound m_SoundEngineEffect
Определения BoatScript.c:76
string m_SoundEngineStart
Определения BoatScript.c:68
void CleanupEffects()
Определения BoatScript.c:777
TInputActionMap m_InputActionMap
Определения BoatScript.c:43
bool m_IsEngineSoundFading
Определения BoatScript.c:61
override bool CrewCanGetThrough(int posIdx)
Определения BoatScript.c:206
bool m_PlaySoundImpactLight
Определения BoatScript.c:58
void ClearWaterEffects()
Определения BoatScript.c:758
vector m_VelocityPrevTick
Определения BoatScript.c:46
override bool DisableVicinityIcon()
Определения BoatScript.c:171
const float DECAY_TICK_FREQUENCY
Определения BoatScript.c:34
void OnVehicleJumpOutServer(GetOutTransportActionData data)
Определения BoatScript.c:534
float m_EngineFadeTime
Определения BoatScript.c:63
void SetActions()
Определения BoatScript.c:692
void SyncSoundImpactLight()
Определения BoatScript.c:630
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
Определения BoatScript.c:802
ref VehicleContactData m_ContactData
Определения BoatScript.c:48
ref EffectSound m_SoundWaterSplashEffect
Определения BoatScript.c:75
override float GetTransportCameraDistance()
Определения BoatScript.c:186
override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
Определения BoatScript.c:221
bool m_PlaySoundImpactHeavy
Определения BoatScript.c:59
override bool CanReachSeatFromDoors(string pSeatSelection, vector pFromPos, float pDistance=1.0)
Определения BoatScript.c:216
const int DECAY_FLAG_RANGE
Определения BoatScript.c:33
bool m_SplashIncoming
Определения BoatScript.c:56
override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
Определения BoatScript.c:211
void BoatScript()
Определения BoatScript.c:79
override void EOnContact(IEntity other, Contact extra)
Определения BoatScript.c:365
void StopParticleUpdate()
Определения BoatScript.c:752
override bool IsAreaAtDoorFree(int currentSeat, float maxAllowedObjHeight, inout vector extents, out vector transform[4])
Определения BoatScript.c:226
override string GetVehicleType()
Определения BoatScript.c:176
const float SPLASH_THRESHOLD_CONDITION
Определения BoatScript.c:39
void RemoveAction(typename actionName)
Определения BoatScript.c:731
const float SOUND_ENGINE_FADE
Определения BoatScript.c:38
string m_SoundEngineStop
Определения BoatScript.c:69
override bool OnBeforeEngineStart()
Определения BoatScript.c:231
override void OnVariablesSynchronized()
Определения BoatScript.c:400
bool m_ActionsInitialized
Определения BoatScript.c:44
void UpdateParticles(float timeSlice=0)
Определения BoatScript.c:744
ref EffectSound m_SoundEngineEffectDeletion
Определения BoatScript.c:77
override vector GetTransportCameraOffset()
Определения BoatScript.c:191
static ref map< typename, ref TInputActionMap > m_BoatTypeActionsMap
Определения BoatScript.c:42
void InitializeActions()
Определения BoatScript.c:148
const float DECAY_DAMAGE
Определения BoatScript.c:35
override void OnEngineStart()
Определения BoatScript.c:252
string m_SoundEngineStartNoFuel
Определения BoatScript.c:70
const float SPLASH_THRESHOLD
Определения BoatScript.c:40
override void EEOnCECreate()
Определения BoatScript.c:284
bool CheckOperationalState()
Определения BoatScript.c:518
override void HandleByCrewMemberState(ECrewMemberState state)
Определения BoatScript.c:452
override float OnSound(BoatSoundCtrl ctrl, float oldValue)
Определения BoatScript.c:437
Определения BoatScript.c:31
Определения BoatScript.c:23
proto native float SurfaceGetSeaLevel()
override ScriptCallQueue GetCallQueue(int call_category)
Определения DayZGame.c:1187
proto native Mission GetMission()
static float GetBoatDecayMultiplier()
Определения CfgGameplayHandler.c:453
Определения EnPhysics.c:305
static const int DAYZCAMERA_3RD_VEHICLE
generic vehicle 3rd person
Определения DayZPlayerCameras.c:19
static void LogError(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Prints debug message as error message.
Определения Debug.c:245
static void ActionLog(string message=LOG_DEFAULT, string plugin=LOG_DEFAULT, string author=LOG_DEFAULT, string label=LOG_DEFAULT, string entity=LOG_DEFAULT)
Определения Debug.c:127
Определения Debug.c:2
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Определения EffectSound.c:603
Wrapper class for managing sound through SEffectManager.
Определения EffectSound.c:5
Определения Building.c:6
Определения constants.c:659
Определения EnEntity.c:165
static bool IsActionLogEnable()
Определения Debug.c:638
Определения Debug.c:594
Определения EnMath.c:7
array< vector > GetActiveRefresherLocations()
Определения PlayerBaseClient.c:2
static EffectSound PlaySoundCachedParams(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound, using or creating cached SoundParams.
Определения EffectManager.c:207
static void EffectUnregisterEx(Effect effect)
Unregisters Effect in SEffectManager.
Определения EffectManager.c:391
static EffectSound CreateSound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false, bool enviroment=false)
Create an EffectSound.
Определения EffectManager.c:144
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Определения EffectManager.c:271
Manager class for managing Effect (EffectParticle, EffectSound)
Определения EffectManager.c:6
proto void Remove(func fn)
remove specific call from queue
proto void CallLater(func fn, int delay=0, bool repeat=false, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
Определения DayZPlayerImplement.c:63
Определения DamageSystem.c:2
Определения Transport.c:559
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static float Dot(vector v1, vector v2)
Returns Dot product of vector v1 and vector v2.
Определения EnConvert.c:271
static const vector Zero
Определения EnConvert.c:110
proto float Normalize()
Normalizes vector. Returns length.
static proto native float Distance(vector v1, vector v2)
Returns the distance between tips of two 3D vectors.
Определения EnConvert.c:106
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
Serializer ParamsReadContext
Определения gameplay.c:15
proto native CGame GetGame()
const float CARS_CONTACT_DMG_THRESHOLD
Определения constants.c:836
const float CARS_CONTACT_DMG_MIN
Определения constants.c:837
vector Position
Определения EnPhysics.c:323
proto native void SetPosition(vector position)
Set the world position of the Effect.
Определения Effect.c:438
EntityEvent
Entity events for event-mask, or throwing event from code.
Определения EnEntity.c:45
const int STATE_RUINED
Определения constants.c:846
static proto int AbsInt(int i)
Returns absolute value.
static proto float RandomFloat(float min, float max)
Returns a random float number between and min[inclusive] and max[exclusive].
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,...
EmitorParam
Определения EnVisual.c:114
@ NONE
No flags.
Определения EnProfiler.c:11
proto native vector dBodyGetVelocityAt(notnull IEntity body, vector globalpos)
proto native vector GetVelocity(notnull IEntity ent)
Returns linear velocity.
proto native void dBodyGetWorldTransform(notnull IEntity body, out vector matrix[4])
const int SAT_DEBUG_ACTION
Определения constants.c:452
class JsonUndergroundAreaTriggerData GetPosition
Определения UndergroundAreaLoader.c:9
const int CALL_CATEGORY_SYSTEM
Определения tools.c:8
const float VEHICLE_FLIP_ANGLE_TOLERANCE
Определения constants.c:816