DayZ 1.24
Loading...
Searching...
No Matches
Sedan_02.c File Reference

Go to the source code of this file.

Classes

class  CarScript
 
class  Sedan_02
 

Functions

class Sedan_02 extends CarScript OnDebugSpawn ()
 
void Sedan_02 ()
 
override void EEInit ()
 
override void OnEngineStart ()
 
override void OnEngineStop ()
 
override void EOnPostSimulate (IEntity other, float timeSlice)
 
override int GetAnimInstance ()
 
override int GetSeatAnimationType (int posIdx)
 
override CarLightBase CreateFrontLight ()
 
override CarRearLightBase CreateRearLight ()
 
override bool CanReleaseAttachment (EntityAI attachment)
 
bool CanManipulateSpareWheel (string slotSelectionName)
 
override bool CanDisplayAttachmentCategory (string category_name)
 
override bool CanDisplayCargo ()
 
override int GetCarDoorsState (string slotType)
 
override bool CrewCanGetThrough (int posIdx)
 
override string GetDoorSelectionNameFromSeatPos (int posIdx)
 
override string GetDoorInvSlotNameFromSeatPos (int posIdx)
 
override float OnSound (CarSoundCtrl ctrl, float oldValue)
 
override string GetAnimSourceFromSelection (string selection)
 
override bool IsVitalTruckBattery ()
 
override bool IsVitalGlowPlug ()
 
override bool CanReachSeatFromSeat (int currentSeat, int nextSeat)
 
override bool CanReachDoorsFromSeat (string pDoorsSelection, int pCurrentSeat)
 

Variables

ref UniversalTemperatureSource m_UTSource
 
ref UniversalTemperatureSourceSettings m_UTSSettings
 
ref UniversalTemperatureSourceLambdaEngine m_UTSLEngine
 

Function Documentation

◆ CanDisplayAttachmentCategory()

override bool OnDebugSpawn::CanDisplayAttachmentCategory ( string category_name)
protected

Definition at line 537 of file Sedan_02.c.

◆ CanDisplayCargo()

override bool OnDebugSpawn::CanDisplayCargo ( )
protected

Definition at line 558 of file Sedan_02.c.

559{
563
564 void Sedan_02()
565 {
566 m_dmgContactCoef = 0.0790;
567
568 m_EngineStartOK = "Sedan_02_engine_start_SoundSet";
569 m_EngineStartBattery = "Sedan_02_engine_failed_start_battery_SoundSet";
570 m_EngineStartPlug = "Sedan_02_engine_failed_start_sparkplugs_SoundSet";
571 m_EngineStartFuel = "Sedan_02_engine_failed_start_fuel_SoundSet";
572 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
573
574 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
575 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
576
577 m_CarHornShortSoundName = "Sedan_02_Horn_Short_SoundSet";
578 m_CarHornLongSoundName = "Sedan_02_Horn_SoundSet";
579
580 SetEnginePos("0 0.7 -1.7");
581 }
582
583 override void EEInit()
584 {
585 super.EEInit();
586
587 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
588 {
590 m_UTSSettings.m_ManualUpdate = true;
591 m_UTSSettings.m_TemperatureMin = 0;
592 m_UTSSettings.m_TemperatureMax = 30;
593 m_UTSSettings.m_RangeFull = 0.5;
594 m_UTSSettings.m_RangeMax = 2;
595 m_UTSSettings.m_TemperatureCap = 25;
596
599 }
600 }
601
602 override void OnEngineStart()
603 {
604 super.OnEngineStart();
605
606 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
607 m_UTSource.SetDefferedActive(true, 20.0);
608 }
609
610 override void OnEngineStop()
611 {
612 super.OnEngineStop();
613
614 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
615 m_UTSource.SetDefferedActive(false, 10.0);
616 }
617
618 override void EOnPostSimulate(IEntity other, float timeSlice)
619 {
620 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
621 {
622 if (m_UTSource.IsActive())
624 }
625 }
626
627 override int GetAnimInstance()
628 {
629 return VehicleAnimInstances.S120;
630 }
631
632 override int GetSeatAnimationType(int posIdx)
633 {
634 switch (posIdx)
635 {
636 case 0:
637 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
638 case 1:
639 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
640 case 2:
641 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
642 case 3:
643 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
644 }
645
646 return 0;
647 }
648
649 // Override for car-specific light type
651 {
652 return CarLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02FrontLight));
653 }
654
655 // Override for car-specific light type
657 {
658 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02RearLight));
659 }
660
662 {
663 if (!super.CanReleaseAttachment(attachment))
664 return false;
665
666 string attType = attachment.GetType();
667 switch (attType)
668 {
669 case "CarBattery":
670 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
671 return false;
672 break;
673
674 case "SparkPlug":
675 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
676 return false;
677 break;
678
679 case "CarRadiator":
680 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED || EngineIsOn())
681 return false;
682 break;
683 }
684
685 return true;
686 }
687
688 override protected bool CanManipulateSpareWheel(string slotSelectionName)
689 {
690 return GetCarDoorsState("Sedan_02_Hood") != CarDoorState.DOORS_CLOSED;
691 }
692
693 override bool CanDisplayAttachmentCategory(string category_name)
694 {
695 if (!super.CanDisplayAttachmentCategory(category_name))
696 return false;
697
698 category_name.ToLower();
699 if (category_name.Contains("engine"))
700 {
701 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED)
702 return false;
703 }
704
705 if (category_name.Contains("trunk"))
706 {
707 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
708 return false;
709 }
710
711 return true;
712 }
713
714 override bool CanDisplayCargo()
715 {
716 if (!super.CanDisplayCargo())
717 return false;
718
719 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
720 return false;
721
722 return true;
723 }
724
725 override int GetCarDoorsState(string slotType)
726 {
728
729 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
730 if (!carDoor)
731 return CarDoorState.DOORS_MISSING;
732
733 switch (slotType)
734 {
735 case "Sedan_02_Door_1_1":
736 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
737
738 case "Sedan_02_Door_2_1":
739 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
740
741 case "Sedan_02_Door_1_2":
742 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
743
744 case "Sedan_02_Door_2_2":
745 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
746
747 case "Sedan_02_Hood":
748 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
749
750 case "Sedan_02_Trunk":
751 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
752 }
753
754 return CarDoorState.DOORS_MISSING;
755 }
756
757
758 override bool CrewCanGetThrough(int posIdx)
759 {
760 switch (posIdx)
761 {
762 case 0:
763 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
764 return false;
765
766 return true;
767 break;
768
769 case 1:
770 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
771 return false;
772
773 return true;
774 break;
775
776 case 2:
777 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
778 return false;
779
780 return true;
781 break;
782
783 case 3:
784 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
785 return false;
786
787 return true;
788 break;
789 }
790
791 return false;
792 }
793
794 override string GetDoorSelectionNameFromSeatPos(int posIdx)
795 {
796 switch (posIdx)
797 {
798 case 0:
799 return "doors_driver";
800 break;
801 case 1:
802 return "doors_codriver";
803 break;
804 case 2:
805 return "doors_cargo1";
806 break;
807 case 3:
808 return "doors_cargo2";
809 break;
810 }
811
812 return super.GetDoorSelectionNameFromSeatPos(posIdx);
813 }
814
815 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
816 {
817 switch (posIdx)
818 {
819 case 0:
820 return "Sedan_02_Door_1_1";
821 break;
822 case 1:
823 return "Sedan_02_Door_2_1";
824 break;
825 case 2:
826 return "Sedan_02_Door_1_2";
827 break;
828 case 3:
829 return "Sedan_02_Door_2_2";
830 break;
831 }
832
833 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
834 }
835
836 override float OnSound(CarSoundCtrl ctrl, float oldValue)
837 {
838 switch (ctrl)
839 {
840 case CarSoundCtrl.DOORS:
841 float newValue = 0;
842 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
843 newValue += 0.25;
844
845 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
846 newValue += 0.25;
847
848 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
849 newValue += 0.25;
850
851 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
852 newValue += 0.25;
853
854 return Math.Clamp(newValue, 0, 1);
855 break;
856 }
857
858 return super.OnSound(ctrl, oldValue);
859 }
860
861 override string GetAnimSourceFromSelection(string selection)
862 {
863 switch (selection)
864 {
865 case "doors_driver":
866 return "DoorsDriver";
867 case "doors_codriver":
868 return "DoorsCoDriver";
869 case "doors_cargo1":
870 return "DoorsCargo1";
871 case "doors_cargo2":
872 return "DoorsCargo2";
873 case "doors_hood":
874 return "DoorsHood";
875 case "doors_trunk":
876 return "DoorsTrunk";
877 }
878
879 return "";
880 }
881
882
883 override bool IsVitalTruckBattery()
884 {
885 return false;
886 }
887
888 override bool IsVitalGlowPlug()
889 {
890 return false;
891 }
892
893 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
894 {
895 switch (currentSeat)
896 {
897 case 0:
898 return nextSeat == 1;
899
900 case 1:
901 return nextSeat == 0;
902
903 case 2:
904 return nextSeat == 3;
905
906 case 3:
907 return nextSeat == 2;
908 }
909
910 return false;
911 }
912
913 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
914 {
915 switch (pCurrentSeat)
916 {
917 case 0:
918 return pDoorsSelection == "DoorsDriver";
919
920 case 1:
921 return pDoorsSelection == "DoorsCoDriver";
922
923 case 2:
924 return pDoorsSelection == "DoorsCargo1";
925
926 case 3:
927 return pDoorsSelection == "DoorsCargo2";
928 }
929
930 return false;
931 }
932
933 override void OnDebugSpawn()
934 {
938
939 GetInventory().CreateInInventory("Sedan_02_Wheel");
940 GetInventory().CreateInInventory("Sedan_02_Wheel");
941 GetInventory().CreateInInventory("Sedan_02_Wheel");
942 GetInventory().CreateInInventory("Sedan_02_Wheel");
943 GetInventory().CreateInInventory("Sedan_02_Wheel");
944
945 GetInventory().CreateInInventory("Sedan_02_Door_1_1");
946 GetInventory().CreateInInventory("Sedan_02_Door_1_2");
947 GetInventory().CreateInInventory("Sedan_02_Door_2_1");
948 GetInventory().CreateInInventory("Sedan_02_Door_2_2");
949 GetInventory().CreateInInventory("Sedan_02_Hood");
950 GetInventory().CreateInInventory("Sedan_02_Trunk");
951
952 //-----IN CAR CARGO
953 GetInventory().CreateInInventory("Sedan_02_Wheel");
954 GetInventory().CreateInInventory("Sedan_02_Wheel");
955 }
956}
957
958class Sedan_02_Red extends Sedan_02
959{
960 override void OnDebugSpawn()
961 {
965
966 GetInventory().CreateInInventory("Sedan_02_Wheel");
967 GetInventory().CreateInInventory("Sedan_02_Wheel");
968 GetInventory().CreateInInventory("Sedan_02_Wheel");
969 GetInventory().CreateInInventory("Sedan_02_Wheel");
970
971 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
972 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
973 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
974 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
975 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
976 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
977
978 //-----IN CAR CARGO
979 GetInventory().CreateInInventory("Sedan_02_Wheel");
980 GetInventory().CreateInInventory("Sedan_02_Wheel");
981 }
982}
983
984class Sedan_02_Grey extends Sedan_02
985{
986 override void OnDebugSpawn()
987 {
991
992 GetInventory().CreateInInventory("Sedan_02_Wheel");
993 GetInventory().CreateInInventory("Sedan_02_Wheel");
994 GetInventory().CreateInInventory("Sedan_02_Wheel");
995 GetInventory().CreateInInventory("Sedan_02_Wheel");
996
997 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
998 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
999 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
1000 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
1001 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");
1002 GetInventory().CreateInInventory("Sedan_02_Trunk_Grey");
1003
1004 //-----IN CAR CARGO
1005 GetInventory().CreateInInventory("Sedan_02_Wheel");
1006 GetInventory().CreateInInventory("Sedan_02_Wheel");
1007 }
1008}
CarSoundCtrl
Car's sound controller list. (native, do not change or extend)
Definition Car.c:4
void SpawnUniversalParts()
Definition CarScript.c:2516
CarDoorState TranslateAnimationPhaseToCarDoorState(string animation)
Definition CarScript.c:2241
CarDoorState
Definition CarScript.c:2
void SpawnAdditionalItems()
Definition CarScript.c:2554
string m_EngineStartOK
Sounds.
Definition CarScript.c:207
string m_CarDoorCloseSound
Definition CarScript.c:214
string m_EngineStartBattery
Definition CarScript.c:208
string m_EngineStartPlug
Definition CarScript.c:209
string m_EngineStartFuel
Definition CarScript.c:210
string m_CarHornShortSoundName
Definition CarScript.c:218
void FillUpCarFluids()
Definition CarScript.c:2578
string m_CarHornLongSoundName
Definition CarScript.c:219
string m_EngineStopFuel
Definition CarScript.c:211
float m_dmgContactCoef
Definition CarScript.c:159
string m_CarDoorOpenSound
Definition CarScript.c:213
class Hatchback_02_Blue extends Hatchback_02 OnDebugSpawn
ref UniversalTemperatureSourceSettings m_UTSSettings
Definition Sedan_02.c:405
override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
Definition Sedan_02.c:737
class Sedan_02 extends CarScript OnDebugSpawn()
Definition Sedan_02.c:403
override string GetAnimSourceFromSelection(string selection)
Definition Sedan_02.c:705
override int GetSeatAnimationType(int posIdx)
Definition Sedan_02.c:476
override float OnSound(CarSoundCtrl ctrl, float oldValue)
Definition Sedan_02.c:680
override string GetDoorInvSlotNameFromSeatPos(int posIdx)
Definition Sedan_02.c:659
override void EOnPostSimulate(IEntity other, float timeSlice)
Definition Sedan_02.c:462
override void OnEngineStop()
Definition Sedan_02.c:454
ref UniversalTemperatureSourceLambdaEngine m_UTSLEngine
Definition Sedan_02.c:406
override void EEInit()
Definition Sedan_02.c:427
override bool CanReleaseAttachment(EntityAI attachment)
Definition Sedan_02.c:505
override bool CanDisplayCargo()
Definition Sedan_02.c:558
override void OnEngineStart()
Definition Sedan_02.c:446
override CarLightBase CreateFrontLight()
Definition Sedan_02.c:494
override int GetAnimInstance()
Definition Sedan_02.c:471
override bool CrewCanGetThrough(int posIdx)
Definition Sedan_02.c:602
override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
Definition Sedan_02.c:757
bool CanManipulateSpareWheel(string slotSelectionName)
Definition Sedan_02.c:532
override bool IsVitalGlowPlug()
Definition Sedan_02.c:732
void Sedan_02()
Definition Sedan_02.c:408
ref UniversalTemperatureSource m_UTSource
Definition Sedan_02.c:404
override CarRearLightBase CreateRearLight()
Definition Sedan_02.c:500
override bool IsVitalTruckBattery()
Definition Sedan_02.c:727
override string GetDoorSelectionNameFromSeatPos(int posIdx)
Definition Sedan_02.c:638
override int GetCarDoorsState(string slotType)
Definition Sedan_02.c:569
override bool CanDisplayAttachmentCategory(string category_name)
Definition Sedan_02.c:537
VehicleAnimInstances
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition EnMath.c:7
original Timer deletes m_params which is unwanted
DayZPlayerConstants
defined in C++
Definition dayzplayer.c:597
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
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'.

◆ CanManipulateSpareWheel()

bool OnDebugSpawn::CanManipulateSpareWheel ( string slotSelectionName)
protected

Definition at line 532 of file Sedan_02.c.

533{
537
538 void Sedan_02()
539 {
540 m_dmgContactCoef = 0.0790;
541
542 m_EngineStartOK = "Sedan_02_engine_start_SoundSet";
543 m_EngineStartBattery = "Sedan_02_engine_failed_start_battery_SoundSet";
544 m_EngineStartPlug = "Sedan_02_engine_failed_start_sparkplugs_SoundSet";
545 m_EngineStartFuel = "Sedan_02_engine_failed_start_fuel_SoundSet";
546 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
547
548 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
549 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
550
551 m_CarHornShortSoundName = "Sedan_02_Horn_Short_SoundSet";
552 m_CarHornLongSoundName = "Sedan_02_Horn_SoundSet";
553
554 SetEnginePos("0 0.7 -1.7");
555 }
556
557 override void EEInit()
558 {
559 super.EEInit();
560
561 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
562 {
564 m_UTSSettings.m_ManualUpdate = true;
565 m_UTSSettings.m_TemperatureMin = 0;
566 m_UTSSettings.m_TemperatureMax = 30;
567 m_UTSSettings.m_RangeFull = 0.5;
568 m_UTSSettings.m_RangeMax = 2;
569 m_UTSSettings.m_TemperatureCap = 25;
570
573 }
574 }
575
576 override void OnEngineStart()
577 {
578 super.OnEngineStart();
579
580 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
581 m_UTSource.SetDefferedActive(true, 20.0);
582 }
583
584 override void OnEngineStop()
585 {
586 super.OnEngineStop();
587
588 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
589 m_UTSource.SetDefferedActive(false, 10.0);
590 }
591
592 override void EOnPostSimulate(IEntity other, float timeSlice)
593 {
594 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
595 {
596 if (m_UTSource.IsActive())
598 }
599 }
600
601 override int GetAnimInstance()
602 {
603 return VehicleAnimInstances.S120;
604 }
605
606 override int GetSeatAnimationType(int posIdx)
607 {
608 switch (posIdx)
609 {
610 case 0:
611 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
612 case 1:
613 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
614 case 2:
615 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
616 case 3:
617 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
618 }
619
620 return 0;
621 }
622
623 // Override for car-specific light type
625 {
626 return CarLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02FrontLight));
627 }
628
629 // Override for car-specific light type
631 {
632 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02RearLight));
633 }
634
636 {
637 if (!super.CanReleaseAttachment(attachment))
638 return false;
639
640 string attType = attachment.GetType();
641 switch (attType)
642 {
643 case "CarBattery":
644 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
645 return false;
646 break;
647
648 case "SparkPlug":
649 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
650 return false;
651 break;
652
653 case "CarRadiator":
654 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED || EngineIsOn())
655 return false;
656 break;
657 }
658
659 return true;
660 }
661
662 override protected bool CanManipulateSpareWheel(string slotSelectionName)
663 {
664 return GetCarDoorsState("Sedan_02_Hood") != CarDoorState.DOORS_CLOSED;
665 }
666
667 override bool CanDisplayAttachmentCategory(string category_name)
668 {
669 if (!super.CanDisplayAttachmentCategory(category_name))
670 return false;
671
672 category_name.ToLower();
673 if (category_name.Contains("engine"))
674 {
675 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED)
676 return false;
677 }
678
679 if (category_name.Contains("trunk"))
680 {
681 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
682 return false;
683 }
684
685 return true;
686 }
687
688 override bool CanDisplayCargo()
689 {
690 if (!super.CanDisplayCargo())
691 return false;
692
693 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
694 return false;
695
696 return true;
697 }
698
699 override int GetCarDoorsState(string slotType)
700 {
702
703 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
704 if (!carDoor)
705 return CarDoorState.DOORS_MISSING;
706
707 switch (slotType)
708 {
709 case "Sedan_02_Door_1_1":
710 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
711
712 case "Sedan_02_Door_2_1":
713 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
714
715 case "Sedan_02_Door_1_2":
716 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
717
718 case "Sedan_02_Door_2_2":
719 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
720
721 case "Sedan_02_Hood":
722 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
723
724 case "Sedan_02_Trunk":
725 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
726 }
727
728 return CarDoorState.DOORS_MISSING;
729 }
730
731
732 override bool CrewCanGetThrough(int posIdx)
733 {
734 switch (posIdx)
735 {
736 case 0:
737 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
738 return false;
739
740 return true;
741 break;
742
743 case 1:
744 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
745 return false;
746
747 return true;
748 break;
749
750 case 2:
751 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
752 return false;
753
754 return true;
755 break;
756
757 case 3:
758 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
759 return false;
760
761 return true;
762 break;
763 }
764
765 return false;
766 }
767
768 override string GetDoorSelectionNameFromSeatPos(int posIdx)
769 {
770 switch (posIdx)
771 {
772 case 0:
773 return "doors_driver";
774 break;
775 case 1:
776 return "doors_codriver";
777 break;
778 case 2:
779 return "doors_cargo1";
780 break;
781 case 3:
782 return "doors_cargo2";
783 break;
784 }
785
786 return super.GetDoorSelectionNameFromSeatPos(posIdx);
787 }
788
789 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
790 {
791 switch (posIdx)
792 {
793 case 0:
794 return "Sedan_02_Door_1_1";
795 break;
796 case 1:
797 return "Sedan_02_Door_2_1";
798 break;
799 case 2:
800 return "Sedan_02_Door_1_2";
801 break;
802 case 3:
803 return "Sedan_02_Door_2_2";
804 break;
805 }
806
807 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
808 }
809
810 override float OnSound(CarSoundCtrl ctrl, float oldValue)
811 {
812 switch (ctrl)
813 {
814 case CarSoundCtrl.DOORS:
815 float newValue = 0;
816 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
817 newValue += 0.25;
818
819 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
820 newValue += 0.25;
821
822 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
823 newValue += 0.25;
824
825 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
826 newValue += 0.25;
827
828 return Math.Clamp(newValue, 0, 1);
829 break;
830 }
831
832 return super.OnSound(ctrl, oldValue);
833 }
834
835 override string GetAnimSourceFromSelection(string selection)
836 {
837 switch (selection)
838 {
839 case "doors_driver":
840 return "DoorsDriver";
841 case "doors_codriver":
842 return "DoorsCoDriver";
843 case "doors_cargo1":
844 return "DoorsCargo1";
845 case "doors_cargo2":
846 return "DoorsCargo2";
847 case "doors_hood":
848 return "DoorsHood";
849 case "doors_trunk":
850 return "DoorsTrunk";
851 }
852
853 return "";
854 }
855
856
857 override bool IsVitalTruckBattery()
858 {
859 return false;
860 }
861
862 override bool IsVitalGlowPlug()
863 {
864 return false;
865 }
866
867 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
868 {
869 switch (currentSeat)
870 {
871 case 0:
872 return nextSeat == 1;
873
874 case 1:
875 return nextSeat == 0;
876
877 case 2:
878 return nextSeat == 3;
879
880 case 3:
881 return nextSeat == 2;
882 }
883
884 return false;
885 }
886
887 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
888 {
889 switch (pCurrentSeat)
890 {
891 case 0:
892 return pDoorsSelection == "DoorsDriver";
893
894 case 1:
895 return pDoorsSelection == "DoorsCoDriver";
896
897 case 2:
898 return pDoorsSelection == "DoorsCargo1";
899
900 case 3:
901 return pDoorsSelection == "DoorsCargo2";
902 }
903
904 return false;
905 }
906
907 override void OnDebugSpawn()
908 {
912
913 GetInventory().CreateInInventory("Sedan_02_Wheel");
914 GetInventory().CreateInInventory("Sedan_02_Wheel");
915 GetInventory().CreateInInventory("Sedan_02_Wheel");
916 GetInventory().CreateInInventory("Sedan_02_Wheel");
917 GetInventory().CreateInInventory("Sedan_02_Wheel");
918
919 GetInventory().CreateInInventory("Sedan_02_Door_1_1");
920 GetInventory().CreateInInventory("Sedan_02_Door_1_2");
921 GetInventory().CreateInInventory("Sedan_02_Door_2_1");
922 GetInventory().CreateInInventory("Sedan_02_Door_2_2");
923 GetInventory().CreateInInventory("Sedan_02_Hood");
924 GetInventory().CreateInInventory("Sedan_02_Trunk");
925
926 //-----IN CAR CARGO
927 GetInventory().CreateInInventory("Sedan_02_Wheel");
928 GetInventory().CreateInInventory("Sedan_02_Wheel");
929 }
930}
931
932class Sedan_02_Red extends Sedan_02
933{
934 override void OnDebugSpawn()
935 {
939
940 GetInventory().CreateInInventory("Sedan_02_Wheel");
941 GetInventory().CreateInInventory("Sedan_02_Wheel");
942 GetInventory().CreateInInventory("Sedan_02_Wheel");
943 GetInventory().CreateInInventory("Sedan_02_Wheel");
944
945 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
946 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
947 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
948 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
949 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
950 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
951
952 //-----IN CAR CARGO
953 GetInventory().CreateInInventory("Sedan_02_Wheel");
954 GetInventory().CreateInInventory("Sedan_02_Wheel");
955 }
956}
957
958class Sedan_02_Grey extends Sedan_02
959{
960 override void OnDebugSpawn()
961 {
965
966 GetInventory().CreateInInventory("Sedan_02_Wheel");
967 GetInventory().CreateInInventory("Sedan_02_Wheel");
968 GetInventory().CreateInInventory("Sedan_02_Wheel");
969 GetInventory().CreateInInventory("Sedan_02_Wheel");
970
971 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
972 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
973 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
974 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
975 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");
976 GetInventory().CreateInInventory("Sedan_02_Trunk_Grey");
977
978 //-----IN CAR CARGO
979 GetInventory().CreateInInventory("Sedan_02_Wheel");
980 GetInventory().CreateInInventory("Sedan_02_Wheel");
981 }
982}

◆ CanReachDoorsFromSeat()

override bool OnDebugSpawn::CanReachDoorsFromSeat ( string pDoorsSelection,
int pCurrentSeat )
protected

Definition at line 757 of file Sedan_02.c.

758{
762
763 void Sedan_02()
764 {
765 m_dmgContactCoef = 0.0790;
766
767 m_EngineStartOK = "Sedan_02_engine_start_SoundSet";
768 m_EngineStartBattery = "Sedan_02_engine_failed_start_battery_SoundSet";
769 m_EngineStartPlug = "Sedan_02_engine_failed_start_sparkplugs_SoundSet";
770 m_EngineStartFuel = "Sedan_02_engine_failed_start_fuel_SoundSet";
771 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
772
773 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
774 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
775
776 m_CarHornShortSoundName = "Sedan_02_Horn_Short_SoundSet";
777 m_CarHornLongSoundName = "Sedan_02_Horn_SoundSet";
778
779 SetEnginePos("0 0.7 -1.7");
780 }
781
782 override void EEInit()
783 {
784 super.EEInit();
785
786 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
787 {
789 m_UTSSettings.m_ManualUpdate = true;
790 m_UTSSettings.m_TemperatureMin = 0;
791 m_UTSSettings.m_TemperatureMax = 30;
792 m_UTSSettings.m_RangeFull = 0.5;
793 m_UTSSettings.m_RangeMax = 2;
794 m_UTSSettings.m_TemperatureCap = 25;
795
798 }
799 }
800
801 override void OnEngineStart()
802 {
803 super.OnEngineStart();
804
805 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
806 m_UTSource.SetDefferedActive(true, 20.0);
807 }
808
809 override void OnEngineStop()
810 {
811 super.OnEngineStop();
812
813 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
814 m_UTSource.SetDefferedActive(false, 10.0);
815 }
816
817 override void EOnPostSimulate(IEntity other, float timeSlice)
818 {
819 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
820 {
821 if (m_UTSource.IsActive())
823 }
824 }
825
826 override int GetAnimInstance()
827 {
828 return VehicleAnimInstances.S120;
829 }
830
831 override int GetSeatAnimationType(int posIdx)
832 {
833 switch (posIdx)
834 {
835 case 0:
836 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
837 case 1:
838 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
839 case 2:
840 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
841 case 3:
842 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
843 }
844
845 return 0;
846 }
847
848 // Override for car-specific light type
850 {
851 return CarLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02FrontLight));
852 }
853
854 // Override for car-specific light type
856 {
857 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02RearLight));
858 }
859
861 {
862 if (!super.CanReleaseAttachment(attachment))
863 return false;
864
865 string attType = attachment.GetType();
866 switch (attType)
867 {
868 case "CarBattery":
869 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
870 return false;
871 break;
872
873 case "SparkPlug":
874 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
875 return false;
876 break;
877
878 case "CarRadiator":
879 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED || EngineIsOn())
880 return false;
881 break;
882 }
883
884 return true;
885 }
886
887 override protected bool CanManipulateSpareWheel(string slotSelectionName)
888 {
889 return GetCarDoorsState("Sedan_02_Hood") != CarDoorState.DOORS_CLOSED;
890 }
891
892 override bool CanDisplayAttachmentCategory(string category_name)
893 {
894 if (!super.CanDisplayAttachmentCategory(category_name))
895 return false;
896
897 category_name.ToLower();
898 if (category_name.Contains("engine"))
899 {
900 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED)
901 return false;
902 }
903
904 if (category_name.Contains("trunk"))
905 {
906 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
907 return false;
908 }
909
910 return true;
911 }
912
913 override bool CanDisplayCargo()
914 {
915 if (!super.CanDisplayCargo())
916 return false;
917
918 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
919 return false;
920
921 return true;
922 }
923
924 override int GetCarDoorsState(string slotType)
925 {
927
928 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
929 if (!carDoor)
930 return CarDoorState.DOORS_MISSING;
931
932 switch (slotType)
933 {
934 case "Sedan_02_Door_1_1":
935 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
936
937 case "Sedan_02_Door_2_1":
938 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
939
940 case "Sedan_02_Door_1_2":
941 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
942
943 case "Sedan_02_Door_2_2":
944 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
945
946 case "Sedan_02_Hood":
947 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
948
949 case "Sedan_02_Trunk":
950 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
951 }
952
953 return CarDoorState.DOORS_MISSING;
954 }
955
956
957 override bool CrewCanGetThrough(int posIdx)
958 {
959 switch (posIdx)
960 {
961 case 0:
962 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
963 return false;
964
965 return true;
966 break;
967
968 case 1:
969 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
970 return false;
971
972 return true;
973 break;
974
975 case 2:
976 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
977 return false;
978
979 return true;
980 break;
981
982 case 3:
983 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
984 return false;
985
986 return true;
987 break;
988 }
989
990 return false;
991 }
992
993 override string GetDoorSelectionNameFromSeatPos(int posIdx)
994 {
995 switch (posIdx)
996 {
997 case 0:
998 return "doors_driver";
999 break;
1000 case 1:
1001 return "doors_codriver";
1002 break;
1003 case 2:
1004 return "doors_cargo1";
1005 break;
1006 case 3:
1007 return "doors_cargo2";
1008 break;
1009 }
1010
1011 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1012 }
1013
1014 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
1015 {
1016 switch (posIdx)
1017 {
1018 case 0:
1019 return "Sedan_02_Door_1_1";
1020 break;
1021 case 1:
1022 return "Sedan_02_Door_2_1";
1023 break;
1024 case 2:
1025 return "Sedan_02_Door_1_2";
1026 break;
1027 case 3:
1028 return "Sedan_02_Door_2_2";
1029 break;
1030 }
1031
1032 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1033 }
1034
1035 override float OnSound(CarSoundCtrl ctrl, float oldValue)
1036 {
1037 switch (ctrl)
1038 {
1039 case CarSoundCtrl.DOORS:
1040 float newValue = 0;
1041 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
1042 newValue += 0.25;
1043
1044 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
1045 newValue += 0.25;
1046
1047 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
1048 newValue += 0.25;
1049
1050 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
1051 newValue += 0.25;
1052
1053 return Math.Clamp(newValue, 0, 1);
1054 break;
1055 }
1056
1057 return super.OnSound(ctrl, oldValue);
1058 }
1059
1060 override string GetAnimSourceFromSelection(string selection)
1061 {
1062 switch (selection)
1063 {
1064 case "doors_driver":
1065 return "DoorsDriver";
1066 case "doors_codriver":
1067 return "DoorsCoDriver";
1068 case "doors_cargo1":
1069 return "DoorsCargo1";
1070 case "doors_cargo2":
1071 return "DoorsCargo2";
1072 case "doors_hood":
1073 return "DoorsHood";
1074 case "doors_trunk":
1075 return "DoorsTrunk";
1076 }
1077
1078 return "";
1079 }
1080
1081
1082 override bool IsVitalTruckBattery()
1083 {
1084 return false;
1085 }
1086
1087 override bool IsVitalGlowPlug()
1088 {
1089 return false;
1090 }
1091
1092 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1093 {
1094 switch (currentSeat)
1095 {
1096 case 0:
1097 return nextSeat == 1;
1098
1099 case 1:
1100 return nextSeat == 0;
1101
1102 case 2:
1103 return nextSeat == 3;
1104
1105 case 3:
1106 return nextSeat == 2;
1107 }
1108
1109 return false;
1110 }
1111
1112 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
1113 {
1114 switch (pCurrentSeat)
1115 {
1116 case 0:
1117 return pDoorsSelection == "DoorsDriver";
1118
1119 case 1:
1120 return pDoorsSelection == "DoorsCoDriver";
1121
1122 case 2:
1123 return pDoorsSelection == "DoorsCargo1";
1124
1125 case 3:
1126 return pDoorsSelection == "DoorsCargo2";
1127 }
1128
1129 return false;
1130 }
1131
1132 override void OnDebugSpawn()
1133 {
1137
1138 GetInventory().CreateInInventory("Sedan_02_Wheel");
1139 GetInventory().CreateInInventory("Sedan_02_Wheel");
1140 GetInventory().CreateInInventory("Sedan_02_Wheel");
1141 GetInventory().CreateInInventory("Sedan_02_Wheel");
1142 GetInventory().CreateInInventory("Sedan_02_Wheel");
1143
1144 GetInventory().CreateInInventory("Sedan_02_Door_1_1");
1145 GetInventory().CreateInInventory("Sedan_02_Door_1_2");
1146 GetInventory().CreateInInventory("Sedan_02_Door_2_1");
1147 GetInventory().CreateInInventory("Sedan_02_Door_2_2");
1148 GetInventory().CreateInInventory("Sedan_02_Hood");
1149 GetInventory().CreateInInventory("Sedan_02_Trunk");
1150
1151 //-----IN CAR CARGO
1152 GetInventory().CreateInInventory("Sedan_02_Wheel");
1153 GetInventory().CreateInInventory("Sedan_02_Wheel");
1154 }
1155}
1156
1157class Sedan_02_Red extends Sedan_02
1158{
1159 override void OnDebugSpawn()
1160 {
1164
1165 GetInventory().CreateInInventory("Sedan_02_Wheel");
1166 GetInventory().CreateInInventory("Sedan_02_Wheel");
1167 GetInventory().CreateInInventory("Sedan_02_Wheel");
1168 GetInventory().CreateInInventory("Sedan_02_Wheel");
1169
1170 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
1171 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
1172 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
1173 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
1174 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
1175 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
1176
1177 //-----IN CAR CARGO
1178 GetInventory().CreateInInventory("Sedan_02_Wheel");
1179 GetInventory().CreateInInventory("Sedan_02_Wheel");
1180 }
1181}
1182
1183class Sedan_02_Grey extends Sedan_02
1184{
1185 override void OnDebugSpawn()
1186 {
1190
1191 GetInventory().CreateInInventory("Sedan_02_Wheel");
1192 GetInventory().CreateInInventory("Sedan_02_Wheel");
1193 GetInventory().CreateInInventory("Sedan_02_Wheel");
1194 GetInventory().CreateInInventory("Sedan_02_Wheel");
1195
1196 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
1197 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
1198 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
1199 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
1200 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");
1201 GetInventory().CreateInInventory("Sedan_02_Trunk_Grey");
1202
1203 //-----IN CAR CARGO
1204 GetInventory().CreateInInventory("Sedan_02_Wheel");
1205 GetInventory().CreateInInventory("Sedan_02_Wheel");
1206 }
1207}

◆ CanReachSeatFromSeat()

override bool OnDebugSpawn::CanReachSeatFromSeat ( int currentSeat,
int nextSeat )
protected

Definition at line 737 of file Sedan_02.c.

738{
742
743 void Sedan_02()
744 {
745 m_dmgContactCoef = 0.0790;
746
747 m_EngineStartOK = "Sedan_02_engine_start_SoundSet";
748 m_EngineStartBattery = "Sedan_02_engine_failed_start_battery_SoundSet";
749 m_EngineStartPlug = "Sedan_02_engine_failed_start_sparkplugs_SoundSet";
750 m_EngineStartFuel = "Sedan_02_engine_failed_start_fuel_SoundSet";
751 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
752
753 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
754 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
755
756 m_CarHornShortSoundName = "Sedan_02_Horn_Short_SoundSet";
757 m_CarHornLongSoundName = "Sedan_02_Horn_SoundSet";
758
759 SetEnginePos("0 0.7 -1.7");
760 }
761
762 override void EEInit()
763 {
764 super.EEInit();
765
766 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
767 {
769 m_UTSSettings.m_ManualUpdate = true;
770 m_UTSSettings.m_TemperatureMin = 0;
771 m_UTSSettings.m_TemperatureMax = 30;
772 m_UTSSettings.m_RangeFull = 0.5;
773 m_UTSSettings.m_RangeMax = 2;
774 m_UTSSettings.m_TemperatureCap = 25;
775
778 }
779 }
780
781 override void OnEngineStart()
782 {
783 super.OnEngineStart();
784
785 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
786 m_UTSource.SetDefferedActive(true, 20.0);
787 }
788
789 override void OnEngineStop()
790 {
791 super.OnEngineStop();
792
793 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
794 m_UTSource.SetDefferedActive(false, 10.0);
795 }
796
797 override void EOnPostSimulate(IEntity other, float timeSlice)
798 {
799 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
800 {
801 if (m_UTSource.IsActive())
803 }
804 }
805
806 override int GetAnimInstance()
807 {
808 return VehicleAnimInstances.S120;
809 }
810
811 override int GetSeatAnimationType(int posIdx)
812 {
813 switch (posIdx)
814 {
815 case 0:
816 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
817 case 1:
818 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
819 case 2:
820 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
821 case 3:
822 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
823 }
824
825 return 0;
826 }
827
828 // Override for car-specific light type
830 {
831 return CarLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02FrontLight));
832 }
833
834 // Override for car-specific light type
836 {
837 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02RearLight));
838 }
839
841 {
842 if (!super.CanReleaseAttachment(attachment))
843 return false;
844
845 string attType = attachment.GetType();
846 switch (attType)
847 {
848 case "CarBattery":
849 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
850 return false;
851 break;
852
853 case "SparkPlug":
854 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
855 return false;
856 break;
857
858 case "CarRadiator":
859 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED || EngineIsOn())
860 return false;
861 break;
862 }
863
864 return true;
865 }
866
867 override protected bool CanManipulateSpareWheel(string slotSelectionName)
868 {
869 return GetCarDoorsState("Sedan_02_Hood") != CarDoorState.DOORS_CLOSED;
870 }
871
872 override bool CanDisplayAttachmentCategory(string category_name)
873 {
874 if (!super.CanDisplayAttachmentCategory(category_name))
875 return false;
876
877 category_name.ToLower();
878 if (category_name.Contains("engine"))
879 {
880 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED)
881 return false;
882 }
883
884 if (category_name.Contains("trunk"))
885 {
886 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
887 return false;
888 }
889
890 return true;
891 }
892
893 override bool CanDisplayCargo()
894 {
895 if (!super.CanDisplayCargo())
896 return false;
897
898 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
899 return false;
900
901 return true;
902 }
903
904 override int GetCarDoorsState(string slotType)
905 {
907
908 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
909 if (!carDoor)
910 return CarDoorState.DOORS_MISSING;
911
912 switch (slotType)
913 {
914 case "Sedan_02_Door_1_1":
915 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
916
917 case "Sedan_02_Door_2_1":
918 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
919
920 case "Sedan_02_Door_1_2":
921 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
922
923 case "Sedan_02_Door_2_2":
924 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
925
926 case "Sedan_02_Hood":
927 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
928
929 case "Sedan_02_Trunk":
930 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
931 }
932
933 return CarDoorState.DOORS_MISSING;
934 }
935
936
937 override bool CrewCanGetThrough(int posIdx)
938 {
939 switch (posIdx)
940 {
941 case 0:
942 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
943 return false;
944
945 return true;
946 break;
947
948 case 1:
949 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
950 return false;
951
952 return true;
953 break;
954
955 case 2:
956 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
957 return false;
958
959 return true;
960 break;
961
962 case 3:
963 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
964 return false;
965
966 return true;
967 break;
968 }
969
970 return false;
971 }
972
973 override string GetDoorSelectionNameFromSeatPos(int posIdx)
974 {
975 switch (posIdx)
976 {
977 case 0:
978 return "doors_driver";
979 break;
980 case 1:
981 return "doors_codriver";
982 break;
983 case 2:
984 return "doors_cargo1";
985 break;
986 case 3:
987 return "doors_cargo2";
988 break;
989 }
990
991 return super.GetDoorSelectionNameFromSeatPos(posIdx);
992 }
993
994 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
995 {
996 switch (posIdx)
997 {
998 case 0:
999 return "Sedan_02_Door_1_1";
1000 break;
1001 case 1:
1002 return "Sedan_02_Door_2_1";
1003 break;
1004 case 2:
1005 return "Sedan_02_Door_1_2";
1006 break;
1007 case 3:
1008 return "Sedan_02_Door_2_2";
1009 break;
1010 }
1011
1012 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1013 }
1014
1015 override float OnSound(CarSoundCtrl ctrl, float oldValue)
1016 {
1017 switch (ctrl)
1018 {
1019 case CarSoundCtrl.DOORS:
1020 float newValue = 0;
1021 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
1022 newValue += 0.25;
1023
1024 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
1025 newValue += 0.25;
1026
1027 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
1028 newValue += 0.25;
1029
1030 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
1031 newValue += 0.25;
1032
1033 return Math.Clamp(newValue, 0, 1);
1034 break;
1035 }
1036
1037 return super.OnSound(ctrl, oldValue);
1038 }
1039
1040 override string GetAnimSourceFromSelection(string selection)
1041 {
1042 switch (selection)
1043 {
1044 case "doors_driver":
1045 return "DoorsDriver";
1046 case "doors_codriver":
1047 return "DoorsCoDriver";
1048 case "doors_cargo1":
1049 return "DoorsCargo1";
1050 case "doors_cargo2":
1051 return "DoorsCargo2";
1052 case "doors_hood":
1053 return "DoorsHood";
1054 case "doors_trunk":
1055 return "DoorsTrunk";
1056 }
1057
1058 return "";
1059 }
1060
1061
1062 override bool IsVitalTruckBattery()
1063 {
1064 return false;
1065 }
1066
1067 override bool IsVitalGlowPlug()
1068 {
1069 return false;
1070 }
1071
1072 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1073 {
1074 switch (currentSeat)
1075 {
1076 case 0:
1077 return nextSeat == 1;
1078
1079 case 1:
1080 return nextSeat == 0;
1081
1082 case 2:
1083 return nextSeat == 3;
1084
1085 case 3:
1086 return nextSeat == 2;
1087 }
1088
1089 return false;
1090 }
1091
1092 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
1093 {
1094 switch (pCurrentSeat)
1095 {
1096 case 0:
1097 return pDoorsSelection == "DoorsDriver";
1098
1099 case 1:
1100 return pDoorsSelection == "DoorsCoDriver";
1101
1102 case 2:
1103 return pDoorsSelection == "DoorsCargo1";
1104
1105 case 3:
1106 return pDoorsSelection == "DoorsCargo2";
1107 }
1108
1109 return false;
1110 }
1111
1112 override void OnDebugSpawn()
1113 {
1117
1118 GetInventory().CreateInInventory("Sedan_02_Wheel");
1119 GetInventory().CreateInInventory("Sedan_02_Wheel");
1120 GetInventory().CreateInInventory("Sedan_02_Wheel");
1121 GetInventory().CreateInInventory("Sedan_02_Wheel");
1122 GetInventory().CreateInInventory("Sedan_02_Wheel");
1123
1124 GetInventory().CreateInInventory("Sedan_02_Door_1_1");
1125 GetInventory().CreateInInventory("Sedan_02_Door_1_2");
1126 GetInventory().CreateInInventory("Sedan_02_Door_2_1");
1127 GetInventory().CreateInInventory("Sedan_02_Door_2_2");
1128 GetInventory().CreateInInventory("Sedan_02_Hood");
1129 GetInventory().CreateInInventory("Sedan_02_Trunk");
1130
1131 //-----IN CAR CARGO
1132 GetInventory().CreateInInventory("Sedan_02_Wheel");
1133 GetInventory().CreateInInventory("Sedan_02_Wheel");
1134 }
1135}
1136
1137class Sedan_02_Red extends Sedan_02
1138{
1139 override void OnDebugSpawn()
1140 {
1144
1145 GetInventory().CreateInInventory("Sedan_02_Wheel");
1146 GetInventory().CreateInInventory("Sedan_02_Wheel");
1147 GetInventory().CreateInInventory("Sedan_02_Wheel");
1148 GetInventory().CreateInInventory("Sedan_02_Wheel");
1149
1150 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
1151 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
1152 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
1153 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
1154 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
1155 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
1156
1157 //-----IN CAR CARGO
1158 GetInventory().CreateInInventory("Sedan_02_Wheel");
1159 GetInventory().CreateInInventory("Sedan_02_Wheel");
1160 }
1161}
1162
1163class Sedan_02_Grey extends Sedan_02
1164{
1165 override void OnDebugSpawn()
1166 {
1170
1171 GetInventory().CreateInInventory("Sedan_02_Wheel");
1172 GetInventory().CreateInInventory("Sedan_02_Wheel");
1173 GetInventory().CreateInInventory("Sedan_02_Wheel");
1174 GetInventory().CreateInInventory("Sedan_02_Wheel");
1175
1176 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
1177 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
1178 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
1179 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
1180 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");
1181 GetInventory().CreateInInventory("Sedan_02_Trunk_Grey");
1182
1183 //-----IN CAR CARGO
1184 GetInventory().CreateInInventory("Sedan_02_Wheel");
1185 GetInventory().CreateInInventory("Sedan_02_Wheel");
1186 }
1187}

◆ CanReleaseAttachment()

override bool OnDebugSpawn::CanReleaseAttachment ( EntityAI attachment)
protected

Definition at line 505 of file Sedan_02.c.

506{
510
511 void Sedan_02()
512 {
513 m_dmgContactCoef = 0.0790;
514
515 m_EngineStartOK = "Sedan_02_engine_start_SoundSet";
516 m_EngineStartBattery = "Sedan_02_engine_failed_start_battery_SoundSet";
517 m_EngineStartPlug = "Sedan_02_engine_failed_start_sparkplugs_SoundSet";
518 m_EngineStartFuel = "Sedan_02_engine_failed_start_fuel_SoundSet";
519 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
520
521 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
522 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
523
524 m_CarHornShortSoundName = "Sedan_02_Horn_Short_SoundSet";
525 m_CarHornLongSoundName = "Sedan_02_Horn_SoundSet";
526
527 SetEnginePos("0 0.7 -1.7");
528 }
529
530 override void EEInit()
531 {
532 super.EEInit();
533
534 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
535 {
537 m_UTSSettings.m_ManualUpdate = true;
538 m_UTSSettings.m_TemperatureMin = 0;
539 m_UTSSettings.m_TemperatureMax = 30;
540 m_UTSSettings.m_RangeFull = 0.5;
541 m_UTSSettings.m_RangeMax = 2;
542 m_UTSSettings.m_TemperatureCap = 25;
543
546 }
547 }
548
549 override void OnEngineStart()
550 {
551 super.OnEngineStart();
552
553 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
554 m_UTSource.SetDefferedActive(true, 20.0);
555 }
556
557 override void OnEngineStop()
558 {
559 super.OnEngineStop();
560
561 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
562 m_UTSource.SetDefferedActive(false, 10.0);
563 }
564
565 override void EOnPostSimulate(IEntity other, float timeSlice)
566 {
567 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
568 {
569 if (m_UTSource.IsActive())
571 }
572 }
573
574 override int GetAnimInstance()
575 {
576 return VehicleAnimInstances.S120;
577 }
578
579 override int GetSeatAnimationType(int posIdx)
580 {
581 switch (posIdx)
582 {
583 case 0:
584 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
585 case 1:
586 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
587 case 2:
588 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
589 case 3:
590 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
591 }
592
593 return 0;
594 }
595
596 // Override for car-specific light type
598 {
599 return CarLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02FrontLight));
600 }
601
602 // Override for car-specific light type
604 {
605 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02RearLight));
606 }
607
609 {
610 if (!super.CanReleaseAttachment(attachment))
611 return false;
612
613 string attType = attachment.GetType();
614 switch (attType)
615 {
616 case "CarBattery":
617 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
618 return false;
619 break;
620
621 case "SparkPlug":
622 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
623 return false;
624 break;
625
626 case "CarRadiator":
627 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED || EngineIsOn())
628 return false;
629 break;
630 }
631
632 return true;
633 }
634
635 override protected bool CanManipulateSpareWheel(string slotSelectionName)
636 {
637 return GetCarDoorsState("Sedan_02_Hood") != CarDoorState.DOORS_CLOSED;
638 }
639
640 override bool CanDisplayAttachmentCategory(string category_name)
641 {
642 if (!super.CanDisplayAttachmentCategory(category_name))
643 return false;
644
645 category_name.ToLower();
646 if (category_name.Contains("engine"))
647 {
648 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED)
649 return false;
650 }
651
652 if (category_name.Contains("trunk"))
653 {
654 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
655 return false;
656 }
657
658 return true;
659 }
660
661 override bool CanDisplayCargo()
662 {
663 if (!super.CanDisplayCargo())
664 return false;
665
666 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
667 return false;
668
669 return true;
670 }
671
672 override int GetCarDoorsState(string slotType)
673 {
675
676 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
677 if (!carDoor)
678 return CarDoorState.DOORS_MISSING;
679
680 switch (slotType)
681 {
682 case "Sedan_02_Door_1_1":
683 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
684
685 case "Sedan_02_Door_2_1":
686 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
687
688 case "Sedan_02_Door_1_2":
689 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
690
691 case "Sedan_02_Door_2_2":
692 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
693
694 case "Sedan_02_Hood":
695 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
696
697 case "Sedan_02_Trunk":
698 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
699 }
700
701 return CarDoorState.DOORS_MISSING;
702 }
703
704
705 override bool CrewCanGetThrough(int posIdx)
706 {
707 switch (posIdx)
708 {
709 case 0:
710 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
711 return false;
712
713 return true;
714 break;
715
716 case 1:
717 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
718 return false;
719
720 return true;
721 break;
722
723 case 2:
724 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
725 return false;
726
727 return true;
728 break;
729
730 case 3:
731 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
732 return false;
733
734 return true;
735 break;
736 }
737
738 return false;
739 }
740
741 override string GetDoorSelectionNameFromSeatPos(int posIdx)
742 {
743 switch (posIdx)
744 {
745 case 0:
746 return "doors_driver";
747 break;
748 case 1:
749 return "doors_codriver";
750 break;
751 case 2:
752 return "doors_cargo1";
753 break;
754 case 3:
755 return "doors_cargo2";
756 break;
757 }
758
759 return super.GetDoorSelectionNameFromSeatPos(posIdx);
760 }
761
762 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
763 {
764 switch (posIdx)
765 {
766 case 0:
767 return "Sedan_02_Door_1_1";
768 break;
769 case 1:
770 return "Sedan_02_Door_2_1";
771 break;
772 case 2:
773 return "Sedan_02_Door_1_2";
774 break;
775 case 3:
776 return "Sedan_02_Door_2_2";
777 break;
778 }
779
780 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
781 }
782
783 override float OnSound(CarSoundCtrl ctrl, float oldValue)
784 {
785 switch (ctrl)
786 {
787 case CarSoundCtrl.DOORS:
788 float newValue = 0;
789 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
790 newValue += 0.25;
791
792 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
793 newValue += 0.25;
794
795 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
796 newValue += 0.25;
797
798 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
799 newValue += 0.25;
800
801 return Math.Clamp(newValue, 0, 1);
802 break;
803 }
804
805 return super.OnSound(ctrl, oldValue);
806 }
807
808 override string GetAnimSourceFromSelection(string selection)
809 {
810 switch (selection)
811 {
812 case "doors_driver":
813 return "DoorsDriver";
814 case "doors_codriver":
815 return "DoorsCoDriver";
816 case "doors_cargo1":
817 return "DoorsCargo1";
818 case "doors_cargo2":
819 return "DoorsCargo2";
820 case "doors_hood":
821 return "DoorsHood";
822 case "doors_trunk":
823 return "DoorsTrunk";
824 }
825
826 return "";
827 }
828
829
830 override bool IsVitalTruckBattery()
831 {
832 return false;
833 }
834
835 override bool IsVitalGlowPlug()
836 {
837 return false;
838 }
839
840 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
841 {
842 switch (currentSeat)
843 {
844 case 0:
845 return nextSeat == 1;
846
847 case 1:
848 return nextSeat == 0;
849
850 case 2:
851 return nextSeat == 3;
852
853 case 3:
854 return nextSeat == 2;
855 }
856
857 return false;
858 }
859
860 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
861 {
862 switch (pCurrentSeat)
863 {
864 case 0:
865 return pDoorsSelection == "DoorsDriver";
866
867 case 1:
868 return pDoorsSelection == "DoorsCoDriver";
869
870 case 2:
871 return pDoorsSelection == "DoorsCargo1";
872
873 case 3:
874 return pDoorsSelection == "DoorsCargo2";
875 }
876
877 return false;
878 }
879
880 override void OnDebugSpawn()
881 {
885
886 GetInventory().CreateInInventory("Sedan_02_Wheel");
887 GetInventory().CreateInInventory("Sedan_02_Wheel");
888 GetInventory().CreateInInventory("Sedan_02_Wheel");
889 GetInventory().CreateInInventory("Sedan_02_Wheel");
890 GetInventory().CreateInInventory("Sedan_02_Wheel");
891
892 GetInventory().CreateInInventory("Sedan_02_Door_1_1");
893 GetInventory().CreateInInventory("Sedan_02_Door_1_2");
894 GetInventory().CreateInInventory("Sedan_02_Door_2_1");
895 GetInventory().CreateInInventory("Sedan_02_Door_2_2");
896 GetInventory().CreateInInventory("Sedan_02_Hood");
897 GetInventory().CreateInInventory("Sedan_02_Trunk");
898
899 //-----IN CAR CARGO
900 GetInventory().CreateInInventory("Sedan_02_Wheel");
901 GetInventory().CreateInInventory("Sedan_02_Wheel");
902 }
903}
904
905class Sedan_02_Red extends Sedan_02
906{
907 override void OnDebugSpawn()
908 {
912
913 GetInventory().CreateInInventory("Sedan_02_Wheel");
914 GetInventory().CreateInInventory("Sedan_02_Wheel");
915 GetInventory().CreateInInventory("Sedan_02_Wheel");
916 GetInventory().CreateInInventory("Sedan_02_Wheel");
917
918 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
919 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
920 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
921 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
922 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
923 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
924
925 //-----IN CAR CARGO
926 GetInventory().CreateInInventory("Sedan_02_Wheel");
927 GetInventory().CreateInInventory("Sedan_02_Wheel");
928 }
929}
930
931class Sedan_02_Grey extends Sedan_02
932{
933 override void OnDebugSpawn()
934 {
938
939 GetInventory().CreateInInventory("Sedan_02_Wheel");
940 GetInventory().CreateInInventory("Sedan_02_Wheel");
941 GetInventory().CreateInInventory("Sedan_02_Wheel");
942 GetInventory().CreateInInventory("Sedan_02_Wheel");
943
944 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
945 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
946 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
947 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
948 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");
949 GetInventory().CreateInInventory("Sedan_02_Trunk_Grey");
950
951 //-----IN CAR CARGO
952 GetInventory().CreateInInventory("Sedan_02_Wheel");
953 GetInventory().CreateInInventory("Sedan_02_Wheel");
954 }
955}

◆ CreateFrontLight()

override CarLightBase OnDebugSpawn::CreateFrontLight ( )
protected

Definition at line 494 of file Sedan_02.c.

495{
499
500 void Sedan_02()
501 {
502 m_dmgContactCoef = 0.0790;
503
504 m_EngineStartOK = "Sedan_02_engine_start_SoundSet";
505 m_EngineStartBattery = "Sedan_02_engine_failed_start_battery_SoundSet";
506 m_EngineStartPlug = "Sedan_02_engine_failed_start_sparkplugs_SoundSet";
507 m_EngineStartFuel = "Sedan_02_engine_failed_start_fuel_SoundSet";
508 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
509
510 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
511 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
512
513 m_CarHornShortSoundName = "Sedan_02_Horn_Short_SoundSet";
514 m_CarHornLongSoundName = "Sedan_02_Horn_SoundSet";
515
516 SetEnginePos("0 0.7 -1.7");
517 }
518
519 override void EEInit()
520 {
521 super.EEInit();
522
523 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
524 {
526 m_UTSSettings.m_ManualUpdate = true;
527 m_UTSSettings.m_TemperatureMin = 0;
528 m_UTSSettings.m_TemperatureMax = 30;
529 m_UTSSettings.m_RangeFull = 0.5;
530 m_UTSSettings.m_RangeMax = 2;
531 m_UTSSettings.m_TemperatureCap = 25;
532
535 }
536 }
537
538 override void OnEngineStart()
539 {
540 super.OnEngineStart();
541
542 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
543 m_UTSource.SetDefferedActive(true, 20.0);
544 }
545
546 override void OnEngineStop()
547 {
548 super.OnEngineStop();
549
550 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
551 m_UTSource.SetDefferedActive(false, 10.0);
552 }
553
554 override void EOnPostSimulate(IEntity other, float timeSlice)
555 {
556 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
557 {
558 if (m_UTSource.IsActive())
560 }
561 }
562
563 override int GetAnimInstance()
564 {
565 return VehicleAnimInstances.S120;
566 }
567
568 override int GetSeatAnimationType(int posIdx)
569 {
570 switch (posIdx)
571 {
572 case 0:
573 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
574 case 1:
575 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
576 case 2:
577 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
578 case 3:
579 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
580 }
581
582 return 0;
583 }
584
585 // Override for car-specific light type
587 {
588 return CarLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02FrontLight));
589 }
590
591 // Override for car-specific light type
593 {
594 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02RearLight));
595 }
596
598 {
599 if (!super.CanReleaseAttachment(attachment))
600 return false;
601
602 string attType = attachment.GetType();
603 switch (attType)
604 {
605 case "CarBattery":
606 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
607 return false;
608 break;
609
610 case "SparkPlug":
611 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
612 return false;
613 break;
614
615 case "CarRadiator":
616 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED || EngineIsOn())
617 return false;
618 break;
619 }
620
621 return true;
622 }
623
624 override protected bool CanManipulateSpareWheel(string slotSelectionName)
625 {
626 return GetCarDoorsState("Sedan_02_Hood") != CarDoorState.DOORS_CLOSED;
627 }
628
629 override bool CanDisplayAttachmentCategory(string category_name)
630 {
631 if (!super.CanDisplayAttachmentCategory(category_name))
632 return false;
633
634 category_name.ToLower();
635 if (category_name.Contains("engine"))
636 {
637 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED)
638 return false;
639 }
640
641 if (category_name.Contains("trunk"))
642 {
643 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
644 return false;
645 }
646
647 return true;
648 }
649
650 override bool CanDisplayCargo()
651 {
652 if (!super.CanDisplayCargo())
653 return false;
654
655 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
656 return false;
657
658 return true;
659 }
660
661 override int GetCarDoorsState(string slotType)
662 {
664
665 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
666 if (!carDoor)
667 return CarDoorState.DOORS_MISSING;
668
669 switch (slotType)
670 {
671 case "Sedan_02_Door_1_1":
672 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
673
674 case "Sedan_02_Door_2_1":
675 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
676
677 case "Sedan_02_Door_1_2":
678 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
679
680 case "Sedan_02_Door_2_2":
681 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
682
683 case "Sedan_02_Hood":
684 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
685
686 case "Sedan_02_Trunk":
687 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
688 }
689
690 return CarDoorState.DOORS_MISSING;
691 }
692
693
694 override bool CrewCanGetThrough(int posIdx)
695 {
696 switch (posIdx)
697 {
698 case 0:
699 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
700 return false;
701
702 return true;
703 break;
704
705 case 1:
706 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
707 return false;
708
709 return true;
710 break;
711
712 case 2:
713 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
714 return false;
715
716 return true;
717 break;
718
719 case 3:
720 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
721 return false;
722
723 return true;
724 break;
725 }
726
727 return false;
728 }
729
730 override string GetDoorSelectionNameFromSeatPos(int posIdx)
731 {
732 switch (posIdx)
733 {
734 case 0:
735 return "doors_driver";
736 break;
737 case 1:
738 return "doors_codriver";
739 break;
740 case 2:
741 return "doors_cargo1";
742 break;
743 case 3:
744 return "doors_cargo2";
745 break;
746 }
747
748 return super.GetDoorSelectionNameFromSeatPos(posIdx);
749 }
750
751 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
752 {
753 switch (posIdx)
754 {
755 case 0:
756 return "Sedan_02_Door_1_1";
757 break;
758 case 1:
759 return "Sedan_02_Door_2_1";
760 break;
761 case 2:
762 return "Sedan_02_Door_1_2";
763 break;
764 case 3:
765 return "Sedan_02_Door_2_2";
766 break;
767 }
768
769 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
770 }
771
772 override float OnSound(CarSoundCtrl ctrl, float oldValue)
773 {
774 switch (ctrl)
775 {
776 case CarSoundCtrl.DOORS:
777 float newValue = 0;
778 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
779 newValue += 0.25;
780
781 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
782 newValue += 0.25;
783
784 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
785 newValue += 0.25;
786
787 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
788 newValue += 0.25;
789
790 return Math.Clamp(newValue, 0, 1);
791 break;
792 }
793
794 return super.OnSound(ctrl, oldValue);
795 }
796
797 override string GetAnimSourceFromSelection(string selection)
798 {
799 switch (selection)
800 {
801 case "doors_driver":
802 return "DoorsDriver";
803 case "doors_codriver":
804 return "DoorsCoDriver";
805 case "doors_cargo1":
806 return "DoorsCargo1";
807 case "doors_cargo2":
808 return "DoorsCargo2";
809 case "doors_hood":
810 return "DoorsHood";
811 case "doors_trunk":
812 return "DoorsTrunk";
813 }
814
815 return "";
816 }
817
818
819 override bool IsVitalTruckBattery()
820 {
821 return false;
822 }
823
824 override bool IsVitalGlowPlug()
825 {
826 return false;
827 }
828
829 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
830 {
831 switch (currentSeat)
832 {
833 case 0:
834 return nextSeat == 1;
835
836 case 1:
837 return nextSeat == 0;
838
839 case 2:
840 return nextSeat == 3;
841
842 case 3:
843 return nextSeat == 2;
844 }
845
846 return false;
847 }
848
849 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
850 {
851 switch (pCurrentSeat)
852 {
853 case 0:
854 return pDoorsSelection == "DoorsDriver";
855
856 case 1:
857 return pDoorsSelection == "DoorsCoDriver";
858
859 case 2:
860 return pDoorsSelection == "DoorsCargo1";
861
862 case 3:
863 return pDoorsSelection == "DoorsCargo2";
864 }
865
866 return false;
867 }
868
869 override void OnDebugSpawn()
870 {
874
875 GetInventory().CreateInInventory("Sedan_02_Wheel");
876 GetInventory().CreateInInventory("Sedan_02_Wheel");
877 GetInventory().CreateInInventory("Sedan_02_Wheel");
878 GetInventory().CreateInInventory("Sedan_02_Wheel");
879 GetInventory().CreateInInventory("Sedan_02_Wheel");
880
881 GetInventory().CreateInInventory("Sedan_02_Door_1_1");
882 GetInventory().CreateInInventory("Sedan_02_Door_1_2");
883 GetInventory().CreateInInventory("Sedan_02_Door_2_1");
884 GetInventory().CreateInInventory("Sedan_02_Door_2_2");
885 GetInventory().CreateInInventory("Sedan_02_Hood");
886 GetInventory().CreateInInventory("Sedan_02_Trunk");
887
888 //-----IN CAR CARGO
889 GetInventory().CreateInInventory("Sedan_02_Wheel");
890 GetInventory().CreateInInventory("Sedan_02_Wheel");
891 }
892}
893
894class Sedan_02_Red extends Sedan_02
895{
896 override void OnDebugSpawn()
897 {
901
902 GetInventory().CreateInInventory("Sedan_02_Wheel");
903 GetInventory().CreateInInventory("Sedan_02_Wheel");
904 GetInventory().CreateInInventory("Sedan_02_Wheel");
905 GetInventory().CreateInInventory("Sedan_02_Wheel");
906
907 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
908 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
909 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
910 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
911 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
912 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
913
914 //-----IN CAR CARGO
915 GetInventory().CreateInInventory("Sedan_02_Wheel");
916 GetInventory().CreateInInventory("Sedan_02_Wheel");
917 }
918}
919
920class Sedan_02_Grey extends Sedan_02
921{
922 override void OnDebugSpawn()
923 {
927
928 GetInventory().CreateInInventory("Sedan_02_Wheel");
929 GetInventory().CreateInInventory("Sedan_02_Wheel");
930 GetInventory().CreateInInventory("Sedan_02_Wheel");
931 GetInventory().CreateInInventory("Sedan_02_Wheel");
932
933 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
934 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
935 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
936 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
937 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");
938 GetInventory().CreateInInventory("Sedan_02_Trunk_Grey");
939
940 //-----IN CAR CARGO
941 GetInventory().CreateInInventory("Sedan_02_Wheel");
942 GetInventory().CreateInInventory("Sedan_02_Wheel");
943 }
944}

◆ CreateRearLight()

override CarRearLightBase OnDebugSpawn::CreateRearLight ( )
protected

Definition at line 500 of file Sedan_02.c.

501{
505
506 void Sedan_02()
507 {
508 m_dmgContactCoef = 0.0790;
509
510 m_EngineStartOK = "Sedan_02_engine_start_SoundSet";
511 m_EngineStartBattery = "Sedan_02_engine_failed_start_battery_SoundSet";
512 m_EngineStartPlug = "Sedan_02_engine_failed_start_sparkplugs_SoundSet";
513 m_EngineStartFuel = "Sedan_02_engine_failed_start_fuel_SoundSet";
514 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
515
516 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
517 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
518
519 m_CarHornShortSoundName = "Sedan_02_Horn_Short_SoundSet";
520 m_CarHornLongSoundName = "Sedan_02_Horn_SoundSet";
521
522 SetEnginePos("0 0.7 -1.7");
523 }
524
525 override void EEInit()
526 {
527 super.EEInit();
528
529 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
530 {
532 m_UTSSettings.m_ManualUpdate = true;
533 m_UTSSettings.m_TemperatureMin = 0;
534 m_UTSSettings.m_TemperatureMax = 30;
535 m_UTSSettings.m_RangeFull = 0.5;
536 m_UTSSettings.m_RangeMax = 2;
537 m_UTSSettings.m_TemperatureCap = 25;
538
541 }
542 }
543
544 override void OnEngineStart()
545 {
546 super.OnEngineStart();
547
548 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
549 m_UTSource.SetDefferedActive(true, 20.0);
550 }
551
552 override void OnEngineStop()
553 {
554 super.OnEngineStop();
555
556 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
557 m_UTSource.SetDefferedActive(false, 10.0);
558 }
559
560 override void EOnPostSimulate(IEntity other, float timeSlice)
561 {
562 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
563 {
564 if (m_UTSource.IsActive())
566 }
567 }
568
569 override int GetAnimInstance()
570 {
571 return VehicleAnimInstances.S120;
572 }
573
574 override int GetSeatAnimationType(int posIdx)
575 {
576 switch (posIdx)
577 {
578 case 0:
579 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
580 case 1:
581 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
582 case 2:
583 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
584 case 3:
585 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
586 }
587
588 return 0;
589 }
590
591 // Override for car-specific light type
593 {
594 return CarLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02FrontLight));
595 }
596
597 // Override for car-specific light type
599 {
600 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02RearLight));
601 }
602
604 {
605 if (!super.CanReleaseAttachment(attachment))
606 return false;
607
608 string attType = attachment.GetType();
609 switch (attType)
610 {
611 case "CarBattery":
612 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
613 return false;
614 break;
615
616 case "SparkPlug":
617 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
618 return false;
619 break;
620
621 case "CarRadiator":
622 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED || EngineIsOn())
623 return false;
624 break;
625 }
626
627 return true;
628 }
629
630 override protected bool CanManipulateSpareWheel(string slotSelectionName)
631 {
632 return GetCarDoorsState("Sedan_02_Hood") != CarDoorState.DOORS_CLOSED;
633 }
634
635 override bool CanDisplayAttachmentCategory(string category_name)
636 {
637 if (!super.CanDisplayAttachmentCategory(category_name))
638 return false;
639
640 category_name.ToLower();
641 if (category_name.Contains("engine"))
642 {
643 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED)
644 return false;
645 }
646
647 if (category_name.Contains("trunk"))
648 {
649 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
650 return false;
651 }
652
653 return true;
654 }
655
656 override bool CanDisplayCargo()
657 {
658 if (!super.CanDisplayCargo())
659 return false;
660
661 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
662 return false;
663
664 return true;
665 }
666
667 override int GetCarDoorsState(string slotType)
668 {
670
671 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
672 if (!carDoor)
673 return CarDoorState.DOORS_MISSING;
674
675 switch (slotType)
676 {
677 case "Sedan_02_Door_1_1":
678 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
679
680 case "Sedan_02_Door_2_1":
681 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
682
683 case "Sedan_02_Door_1_2":
684 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
685
686 case "Sedan_02_Door_2_2":
687 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
688
689 case "Sedan_02_Hood":
690 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
691
692 case "Sedan_02_Trunk":
693 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
694 }
695
696 return CarDoorState.DOORS_MISSING;
697 }
698
699
700 override bool CrewCanGetThrough(int posIdx)
701 {
702 switch (posIdx)
703 {
704 case 0:
705 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
706 return false;
707
708 return true;
709 break;
710
711 case 1:
712 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
713 return false;
714
715 return true;
716 break;
717
718 case 2:
719 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
720 return false;
721
722 return true;
723 break;
724
725 case 3:
726 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
727 return false;
728
729 return true;
730 break;
731 }
732
733 return false;
734 }
735
736 override string GetDoorSelectionNameFromSeatPos(int posIdx)
737 {
738 switch (posIdx)
739 {
740 case 0:
741 return "doors_driver";
742 break;
743 case 1:
744 return "doors_codriver";
745 break;
746 case 2:
747 return "doors_cargo1";
748 break;
749 case 3:
750 return "doors_cargo2";
751 break;
752 }
753
754 return super.GetDoorSelectionNameFromSeatPos(posIdx);
755 }
756
757 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
758 {
759 switch (posIdx)
760 {
761 case 0:
762 return "Sedan_02_Door_1_1";
763 break;
764 case 1:
765 return "Sedan_02_Door_2_1";
766 break;
767 case 2:
768 return "Sedan_02_Door_1_2";
769 break;
770 case 3:
771 return "Sedan_02_Door_2_2";
772 break;
773 }
774
775 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
776 }
777
778 override float OnSound(CarSoundCtrl ctrl, float oldValue)
779 {
780 switch (ctrl)
781 {
782 case CarSoundCtrl.DOORS:
783 float newValue = 0;
784 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
785 newValue += 0.25;
786
787 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
788 newValue += 0.25;
789
790 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
791 newValue += 0.25;
792
793 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
794 newValue += 0.25;
795
796 return Math.Clamp(newValue, 0, 1);
797 break;
798 }
799
800 return super.OnSound(ctrl, oldValue);
801 }
802
803 override string GetAnimSourceFromSelection(string selection)
804 {
805 switch (selection)
806 {
807 case "doors_driver":
808 return "DoorsDriver";
809 case "doors_codriver":
810 return "DoorsCoDriver";
811 case "doors_cargo1":
812 return "DoorsCargo1";
813 case "doors_cargo2":
814 return "DoorsCargo2";
815 case "doors_hood":
816 return "DoorsHood";
817 case "doors_trunk":
818 return "DoorsTrunk";
819 }
820
821 return "";
822 }
823
824
825 override bool IsVitalTruckBattery()
826 {
827 return false;
828 }
829
830 override bool IsVitalGlowPlug()
831 {
832 return false;
833 }
834
835 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
836 {
837 switch (currentSeat)
838 {
839 case 0:
840 return nextSeat == 1;
841
842 case 1:
843 return nextSeat == 0;
844
845 case 2:
846 return nextSeat == 3;
847
848 case 3:
849 return nextSeat == 2;
850 }
851
852 return false;
853 }
854
855 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
856 {
857 switch (pCurrentSeat)
858 {
859 case 0:
860 return pDoorsSelection == "DoorsDriver";
861
862 case 1:
863 return pDoorsSelection == "DoorsCoDriver";
864
865 case 2:
866 return pDoorsSelection == "DoorsCargo1";
867
868 case 3:
869 return pDoorsSelection == "DoorsCargo2";
870 }
871
872 return false;
873 }
874
875 override void OnDebugSpawn()
876 {
880
881 GetInventory().CreateInInventory("Sedan_02_Wheel");
882 GetInventory().CreateInInventory("Sedan_02_Wheel");
883 GetInventory().CreateInInventory("Sedan_02_Wheel");
884 GetInventory().CreateInInventory("Sedan_02_Wheel");
885 GetInventory().CreateInInventory("Sedan_02_Wheel");
886
887 GetInventory().CreateInInventory("Sedan_02_Door_1_1");
888 GetInventory().CreateInInventory("Sedan_02_Door_1_2");
889 GetInventory().CreateInInventory("Sedan_02_Door_2_1");
890 GetInventory().CreateInInventory("Sedan_02_Door_2_2");
891 GetInventory().CreateInInventory("Sedan_02_Hood");
892 GetInventory().CreateInInventory("Sedan_02_Trunk");
893
894 //-----IN CAR CARGO
895 GetInventory().CreateInInventory("Sedan_02_Wheel");
896 GetInventory().CreateInInventory("Sedan_02_Wheel");
897 }
898}
899
900class Sedan_02_Red extends Sedan_02
901{
902 override void OnDebugSpawn()
903 {
907
908 GetInventory().CreateInInventory("Sedan_02_Wheel");
909 GetInventory().CreateInInventory("Sedan_02_Wheel");
910 GetInventory().CreateInInventory("Sedan_02_Wheel");
911 GetInventory().CreateInInventory("Sedan_02_Wheel");
912
913 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
914 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
915 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
916 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
917 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
918 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
919
920 //-----IN CAR CARGO
921 GetInventory().CreateInInventory("Sedan_02_Wheel");
922 GetInventory().CreateInInventory("Sedan_02_Wheel");
923 }
924}
925
926class Sedan_02_Grey extends Sedan_02
927{
928 override void OnDebugSpawn()
929 {
933
934 GetInventory().CreateInInventory("Sedan_02_Wheel");
935 GetInventory().CreateInInventory("Sedan_02_Wheel");
936 GetInventory().CreateInInventory("Sedan_02_Wheel");
937 GetInventory().CreateInInventory("Sedan_02_Wheel");
938
939 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
940 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
941 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
942 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
943 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");
944 GetInventory().CreateInInventory("Sedan_02_Trunk_Grey");
945
946 //-----IN CAR CARGO
947 GetInventory().CreateInInventory("Sedan_02_Wheel");
948 GetInventory().CreateInInventory("Sedan_02_Wheel");
949 }
950}

◆ CrewCanGetThrough()

override bool OnDebugSpawn::CrewCanGetThrough ( int posIdx)
protected

Definition at line 602 of file Sedan_02.c.

603{
607
608 void Sedan_02()
609 {
610 m_dmgContactCoef = 0.0790;
611
612 m_EngineStartOK = "Sedan_02_engine_start_SoundSet";
613 m_EngineStartBattery = "Sedan_02_engine_failed_start_battery_SoundSet";
614 m_EngineStartPlug = "Sedan_02_engine_failed_start_sparkplugs_SoundSet";
615 m_EngineStartFuel = "Sedan_02_engine_failed_start_fuel_SoundSet";
616 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
617
618 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
619 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
620
621 m_CarHornShortSoundName = "Sedan_02_Horn_Short_SoundSet";
622 m_CarHornLongSoundName = "Sedan_02_Horn_SoundSet";
623
624 SetEnginePos("0 0.7 -1.7");
625 }
626
627 override void EEInit()
628 {
629 super.EEInit();
630
631 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
632 {
634 m_UTSSettings.m_ManualUpdate = true;
635 m_UTSSettings.m_TemperatureMin = 0;
636 m_UTSSettings.m_TemperatureMax = 30;
637 m_UTSSettings.m_RangeFull = 0.5;
638 m_UTSSettings.m_RangeMax = 2;
639 m_UTSSettings.m_TemperatureCap = 25;
640
643 }
644 }
645
646 override void OnEngineStart()
647 {
648 super.OnEngineStart();
649
650 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
651 m_UTSource.SetDefferedActive(true, 20.0);
652 }
653
654 override void OnEngineStop()
655 {
656 super.OnEngineStop();
657
658 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
659 m_UTSource.SetDefferedActive(false, 10.0);
660 }
661
662 override void EOnPostSimulate(IEntity other, float timeSlice)
663 {
664 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
665 {
666 if (m_UTSource.IsActive())
668 }
669 }
670
671 override int GetAnimInstance()
672 {
673 return VehicleAnimInstances.S120;
674 }
675
676 override int GetSeatAnimationType(int posIdx)
677 {
678 switch (posIdx)
679 {
680 case 0:
681 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
682 case 1:
683 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
684 case 2:
685 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
686 case 3:
687 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
688 }
689
690 return 0;
691 }
692
693 // Override for car-specific light type
695 {
696 return CarLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02FrontLight));
697 }
698
699 // Override for car-specific light type
701 {
702 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02RearLight));
703 }
704
706 {
707 if (!super.CanReleaseAttachment(attachment))
708 return false;
709
710 string attType = attachment.GetType();
711 switch (attType)
712 {
713 case "CarBattery":
714 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
715 return false;
716 break;
717
718 case "SparkPlug":
719 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
720 return false;
721 break;
722
723 case "CarRadiator":
724 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED || EngineIsOn())
725 return false;
726 break;
727 }
728
729 return true;
730 }
731
732 override protected bool CanManipulateSpareWheel(string slotSelectionName)
733 {
734 return GetCarDoorsState("Sedan_02_Hood") != CarDoorState.DOORS_CLOSED;
735 }
736
737 override bool CanDisplayAttachmentCategory(string category_name)
738 {
739 if (!super.CanDisplayAttachmentCategory(category_name))
740 return false;
741
742 category_name.ToLower();
743 if (category_name.Contains("engine"))
744 {
745 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED)
746 return false;
747 }
748
749 if (category_name.Contains("trunk"))
750 {
751 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
752 return false;
753 }
754
755 return true;
756 }
757
758 override bool CanDisplayCargo()
759 {
760 if (!super.CanDisplayCargo())
761 return false;
762
763 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
764 return false;
765
766 return true;
767 }
768
769 override int GetCarDoorsState(string slotType)
770 {
772
773 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
774 if (!carDoor)
775 return CarDoorState.DOORS_MISSING;
776
777 switch (slotType)
778 {
779 case "Sedan_02_Door_1_1":
780 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
781
782 case "Sedan_02_Door_2_1":
783 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
784
785 case "Sedan_02_Door_1_2":
786 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
787
788 case "Sedan_02_Door_2_2":
789 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
790
791 case "Sedan_02_Hood":
792 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
793
794 case "Sedan_02_Trunk":
795 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
796 }
797
798 return CarDoorState.DOORS_MISSING;
799 }
800
801
802 override bool CrewCanGetThrough(int posIdx)
803 {
804 switch (posIdx)
805 {
806 case 0:
807 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
808 return false;
809
810 return true;
811 break;
812
813 case 1:
814 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
815 return false;
816
817 return true;
818 break;
819
820 case 2:
821 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
822 return false;
823
824 return true;
825 break;
826
827 case 3:
828 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
829 return false;
830
831 return true;
832 break;
833 }
834
835 return false;
836 }
837
838 override string GetDoorSelectionNameFromSeatPos(int posIdx)
839 {
840 switch (posIdx)
841 {
842 case 0:
843 return "doors_driver";
844 break;
845 case 1:
846 return "doors_codriver";
847 break;
848 case 2:
849 return "doors_cargo1";
850 break;
851 case 3:
852 return "doors_cargo2";
853 break;
854 }
855
856 return super.GetDoorSelectionNameFromSeatPos(posIdx);
857 }
858
859 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
860 {
861 switch (posIdx)
862 {
863 case 0:
864 return "Sedan_02_Door_1_1";
865 break;
866 case 1:
867 return "Sedan_02_Door_2_1";
868 break;
869 case 2:
870 return "Sedan_02_Door_1_2";
871 break;
872 case 3:
873 return "Sedan_02_Door_2_2";
874 break;
875 }
876
877 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
878 }
879
880 override float OnSound(CarSoundCtrl ctrl, float oldValue)
881 {
882 switch (ctrl)
883 {
884 case CarSoundCtrl.DOORS:
885 float newValue = 0;
886 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
887 newValue += 0.25;
888
889 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
890 newValue += 0.25;
891
892 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
893 newValue += 0.25;
894
895 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
896 newValue += 0.25;
897
898 return Math.Clamp(newValue, 0, 1);
899 break;
900 }
901
902 return super.OnSound(ctrl, oldValue);
903 }
904
905 override string GetAnimSourceFromSelection(string selection)
906 {
907 switch (selection)
908 {
909 case "doors_driver":
910 return "DoorsDriver";
911 case "doors_codriver":
912 return "DoorsCoDriver";
913 case "doors_cargo1":
914 return "DoorsCargo1";
915 case "doors_cargo2":
916 return "DoorsCargo2";
917 case "doors_hood":
918 return "DoorsHood";
919 case "doors_trunk":
920 return "DoorsTrunk";
921 }
922
923 return "";
924 }
925
926
927 override bool IsVitalTruckBattery()
928 {
929 return false;
930 }
931
932 override bool IsVitalGlowPlug()
933 {
934 return false;
935 }
936
937 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
938 {
939 switch (currentSeat)
940 {
941 case 0:
942 return nextSeat == 1;
943
944 case 1:
945 return nextSeat == 0;
946
947 case 2:
948 return nextSeat == 3;
949
950 case 3:
951 return nextSeat == 2;
952 }
953
954 return false;
955 }
956
957 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
958 {
959 switch (pCurrentSeat)
960 {
961 case 0:
962 return pDoorsSelection == "DoorsDriver";
963
964 case 1:
965 return pDoorsSelection == "DoorsCoDriver";
966
967 case 2:
968 return pDoorsSelection == "DoorsCargo1";
969
970 case 3:
971 return pDoorsSelection == "DoorsCargo2";
972 }
973
974 return false;
975 }
976
977 override void OnDebugSpawn()
978 {
982
983 GetInventory().CreateInInventory("Sedan_02_Wheel");
984 GetInventory().CreateInInventory("Sedan_02_Wheel");
985 GetInventory().CreateInInventory("Sedan_02_Wheel");
986 GetInventory().CreateInInventory("Sedan_02_Wheel");
987 GetInventory().CreateInInventory("Sedan_02_Wheel");
988
989 GetInventory().CreateInInventory("Sedan_02_Door_1_1");
990 GetInventory().CreateInInventory("Sedan_02_Door_1_2");
991 GetInventory().CreateInInventory("Sedan_02_Door_2_1");
992 GetInventory().CreateInInventory("Sedan_02_Door_2_2");
993 GetInventory().CreateInInventory("Sedan_02_Hood");
994 GetInventory().CreateInInventory("Sedan_02_Trunk");
995
996 //-----IN CAR CARGO
997 GetInventory().CreateInInventory("Sedan_02_Wheel");
998 GetInventory().CreateInInventory("Sedan_02_Wheel");
999 }
1000}
1001
1002class Sedan_02_Red extends Sedan_02
1003{
1004 override void OnDebugSpawn()
1005 {
1009
1010 GetInventory().CreateInInventory("Sedan_02_Wheel");
1011 GetInventory().CreateInInventory("Sedan_02_Wheel");
1012 GetInventory().CreateInInventory("Sedan_02_Wheel");
1013 GetInventory().CreateInInventory("Sedan_02_Wheel");
1014
1015 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
1016 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
1017 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
1018 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
1019 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
1020 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
1021
1022 //-----IN CAR CARGO
1023 GetInventory().CreateInInventory("Sedan_02_Wheel");
1024 GetInventory().CreateInInventory("Sedan_02_Wheel");
1025 }
1026}
1027
1028class Sedan_02_Grey extends Sedan_02
1029{
1030 override void OnDebugSpawn()
1031 {
1035
1036 GetInventory().CreateInInventory("Sedan_02_Wheel");
1037 GetInventory().CreateInInventory("Sedan_02_Wheel");
1038 GetInventory().CreateInInventory("Sedan_02_Wheel");
1039 GetInventory().CreateInInventory("Sedan_02_Wheel");
1040
1041 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
1042 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
1043 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
1044 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
1045 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");
1046 GetInventory().CreateInInventory("Sedan_02_Trunk_Grey");
1047
1048 //-----IN CAR CARGO
1049 GetInventory().CreateInInventory("Sedan_02_Wheel");
1050 GetInventory().CreateInInventory("Sedan_02_Wheel");
1051 }
1052}

◆ EEInit()

override void OnDebugSpawn::EEInit ( )
protected

Definition at line 427 of file Sedan_02.c.

428{
429 override void OnDebugSpawn()
430 {
434
435 GetInventory().CreateInInventory("Sedan_02_Wheel");
436 GetInventory().CreateInInventory("Sedan_02_Wheel");
437 GetInventory().CreateInInventory("Sedan_02_Wheel");
438 GetInventory().CreateInInventory("Sedan_02_Wheel");
439
440 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
441 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
442 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
443 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
444 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");

◆ EOnPostSimulate()

override void OnDebugSpawn::EOnPostSimulate ( IEntity other,
float timeSlice )
protected

Definition at line 462 of file Sedan_02.c.

463{
467
468 void Sedan_02()
469 {
470 m_dmgContactCoef = 0.0790;
471
472 m_EngineStartOK = "Sedan_02_engine_start_SoundSet";
473 m_EngineStartBattery = "Sedan_02_engine_failed_start_battery_SoundSet";
474 m_EngineStartPlug = "Sedan_02_engine_failed_start_sparkplugs_SoundSet";
475 m_EngineStartFuel = "Sedan_02_engine_failed_start_fuel_SoundSet";
476 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
477
478 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
479 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
480
481 m_CarHornShortSoundName = "Sedan_02_Horn_Short_SoundSet";
482 m_CarHornLongSoundName = "Sedan_02_Horn_SoundSet";
483
484 SetEnginePos("0 0.7 -1.7");
485 }
486
487 override void EEInit()
488 {
489 super.EEInit();
490
491 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
492 {
494 m_UTSSettings.m_ManualUpdate = true;
495 m_UTSSettings.m_TemperatureMin = 0;
496 m_UTSSettings.m_TemperatureMax = 30;
497 m_UTSSettings.m_RangeFull = 0.5;
498 m_UTSSettings.m_RangeMax = 2;
499 m_UTSSettings.m_TemperatureCap = 25;
500
503 }
504 }
505
506 override void OnEngineStart()
507 {
508 super.OnEngineStart();
509
510 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
511 m_UTSource.SetDefferedActive(true, 20.0);
512 }
513
514 override void OnEngineStop()
515 {
516 super.OnEngineStop();
517
518 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
519 m_UTSource.SetDefferedActive(false, 10.0);
520 }
521
522 override void EOnPostSimulate(IEntity other, float timeSlice)
523 {
524 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
525 {
526 if (m_UTSource.IsActive())
528 }
529 }
530
531 override int GetAnimInstance()
532 {
533 return VehicleAnimInstances.S120;
534 }
535
536 override int GetSeatAnimationType(int posIdx)
537 {
538 switch (posIdx)
539 {
540 case 0:
541 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
542 case 1:
543 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
544 case 2:
545 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
546 case 3:
547 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
548 }
549
550 return 0;
551 }
552
553 // Override for car-specific light type
555 {
556 return CarLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02FrontLight));
557 }
558
559 // Override for car-specific light type
561 {
562 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02RearLight));
563 }
564
566 {
567 if (!super.CanReleaseAttachment(attachment))
568 return false;
569
570 string attType = attachment.GetType();
571 switch (attType)
572 {
573 case "CarBattery":
574 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
575 return false;
576 break;
577
578 case "SparkPlug":
579 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
580 return false;
581 break;
582
583 case "CarRadiator":
584 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED || EngineIsOn())
585 return false;
586 break;
587 }
588
589 return true;
590 }
591
592 override protected bool CanManipulateSpareWheel(string slotSelectionName)
593 {
594 return GetCarDoorsState("Sedan_02_Hood") != CarDoorState.DOORS_CLOSED;
595 }
596
597 override bool CanDisplayAttachmentCategory(string category_name)
598 {
599 if (!super.CanDisplayAttachmentCategory(category_name))
600 return false;
601
602 category_name.ToLower();
603 if (category_name.Contains("engine"))
604 {
605 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED)
606 return false;
607 }
608
609 if (category_name.Contains("trunk"))
610 {
611 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
612 return false;
613 }
614
615 return true;
616 }
617
618 override bool CanDisplayCargo()
619 {
620 if (!super.CanDisplayCargo())
621 return false;
622
623 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
624 return false;
625
626 return true;
627 }
628
629 override int GetCarDoorsState(string slotType)
630 {
632
633 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
634 if (!carDoor)
635 return CarDoorState.DOORS_MISSING;
636
637 switch (slotType)
638 {
639 case "Sedan_02_Door_1_1":
640 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
641
642 case "Sedan_02_Door_2_1":
643 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
644
645 case "Sedan_02_Door_1_2":
646 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
647
648 case "Sedan_02_Door_2_2":
649 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
650
651 case "Sedan_02_Hood":
652 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
653
654 case "Sedan_02_Trunk":
655 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
656 }
657
658 return CarDoorState.DOORS_MISSING;
659 }
660
661
662 override bool CrewCanGetThrough(int posIdx)
663 {
664 switch (posIdx)
665 {
666 case 0:
667 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
668 return false;
669
670 return true;
671 break;
672
673 case 1:
674 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
675 return false;
676
677 return true;
678 break;
679
680 case 2:
681 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
682 return false;
683
684 return true;
685 break;
686
687 case 3:
688 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
689 return false;
690
691 return true;
692 break;
693 }
694
695 return false;
696 }
697
698 override string GetDoorSelectionNameFromSeatPos(int posIdx)
699 {
700 switch (posIdx)
701 {
702 case 0:
703 return "doors_driver";
704 break;
705 case 1:
706 return "doors_codriver";
707 break;
708 case 2:
709 return "doors_cargo1";
710 break;
711 case 3:
712 return "doors_cargo2";
713 break;
714 }
715
716 return super.GetDoorSelectionNameFromSeatPos(posIdx);
717 }
718
719 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
720 {
721 switch (posIdx)
722 {
723 case 0:
724 return "Sedan_02_Door_1_1";
725 break;
726 case 1:
727 return "Sedan_02_Door_2_1";
728 break;
729 case 2:
730 return "Sedan_02_Door_1_2";
731 break;
732 case 3:
733 return "Sedan_02_Door_2_2";
734 break;
735 }
736
737 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
738 }
739
740 override float OnSound(CarSoundCtrl ctrl, float oldValue)
741 {
742 switch (ctrl)
743 {
744 case CarSoundCtrl.DOORS:
745 float newValue = 0;
746 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
747 newValue += 0.25;
748
749 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
750 newValue += 0.25;
751
752 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
753 newValue += 0.25;
754
755 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
756 newValue += 0.25;
757
758 return Math.Clamp(newValue, 0, 1);
759 break;
760 }
761
762 return super.OnSound(ctrl, oldValue);
763 }
764
765 override string GetAnimSourceFromSelection(string selection)
766 {
767 switch (selection)
768 {
769 case "doors_driver":
770 return "DoorsDriver";
771 case "doors_codriver":
772 return "DoorsCoDriver";
773 case "doors_cargo1":
774 return "DoorsCargo1";
775 case "doors_cargo2":
776 return "DoorsCargo2";
777 case "doors_hood":
778 return "DoorsHood";
779 case "doors_trunk":
780 return "DoorsTrunk";
781 }
782
783 return "";
784 }
785
786
787 override bool IsVitalTruckBattery()
788 {
789 return false;
790 }
791
792 override bool IsVitalGlowPlug()
793 {
794 return false;
795 }
796
797 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
798 {
799 switch (currentSeat)
800 {
801 case 0:
802 return nextSeat == 1;
803
804 case 1:
805 return nextSeat == 0;
806
807 case 2:
808 return nextSeat == 3;
809
810 case 3:
811 return nextSeat == 2;
812 }
813
814 return false;
815 }
816
817 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
818 {
819 switch (pCurrentSeat)
820 {
821 case 0:
822 return pDoorsSelection == "DoorsDriver";
823
824 case 1:
825 return pDoorsSelection == "DoorsCoDriver";
826
827 case 2:
828 return pDoorsSelection == "DoorsCargo1";
829
830 case 3:
831 return pDoorsSelection == "DoorsCargo2";
832 }
833
834 return false;
835 }
836
837 override void OnDebugSpawn()
838 {
842
843 GetInventory().CreateInInventory("Sedan_02_Wheel");
844 GetInventory().CreateInInventory("Sedan_02_Wheel");
845 GetInventory().CreateInInventory("Sedan_02_Wheel");
846 GetInventory().CreateInInventory("Sedan_02_Wheel");
847 GetInventory().CreateInInventory("Sedan_02_Wheel");
848
849 GetInventory().CreateInInventory("Sedan_02_Door_1_1");
850 GetInventory().CreateInInventory("Sedan_02_Door_1_2");
851 GetInventory().CreateInInventory("Sedan_02_Door_2_1");
852 GetInventory().CreateInInventory("Sedan_02_Door_2_2");
853 GetInventory().CreateInInventory("Sedan_02_Hood");
854 GetInventory().CreateInInventory("Sedan_02_Trunk");
855
856 //-----IN CAR CARGO
857 GetInventory().CreateInInventory("Sedan_02_Wheel");
858 GetInventory().CreateInInventory("Sedan_02_Wheel");
859 }
860}
861
862class Sedan_02_Red extends Sedan_02
863{
864 override void OnDebugSpawn()
865 {
869
870 GetInventory().CreateInInventory("Sedan_02_Wheel");
871 GetInventory().CreateInInventory("Sedan_02_Wheel");
872 GetInventory().CreateInInventory("Sedan_02_Wheel");
873 GetInventory().CreateInInventory("Sedan_02_Wheel");
874
875 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
876 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
877 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
878 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
879 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
880 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
881
882 //-----IN CAR CARGO
883 GetInventory().CreateInInventory("Sedan_02_Wheel");
884 GetInventory().CreateInInventory("Sedan_02_Wheel");
885 }
886}
887
888class Sedan_02_Grey extends Sedan_02
889{
890 override void OnDebugSpawn()
891 {
895
896 GetInventory().CreateInInventory("Sedan_02_Wheel");
897 GetInventory().CreateInInventory("Sedan_02_Wheel");
898 GetInventory().CreateInInventory("Sedan_02_Wheel");
899 GetInventory().CreateInInventory("Sedan_02_Wheel");
900
901 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
902 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
903 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
904 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
905 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");
906 GetInventory().CreateInInventory("Sedan_02_Trunk_Grey");
907
908 //-----IN CAR CARGO
909 GetInventory().CreateInInventory("Sedan_02_Wheel");
910 GetInventory().CreateInInventory("Sedan_02_Wheel");
911 }
912}

◆ GetAnimInstance()

override int OnDebugSpawn::GetAnimInstance ( )
protected

Definition at line 471 of file Sedan_02.c.

472{
476
477 void Sedan_02()
478 {
479 m_dmgContactCoef = 0.0790;
480
481 m_EngineStartOK = "Sedan_02_engine_start_SoundSet";
482 m_EngineStartBattery = "Sedan_02_engine_failed_start_battery_SoundSet";
483 m_EngineStartPlug = "Sedan_02_engine_failed_start_sparkplugs_SoundSet";
484 m_EngineStartFuel = "Sedan_02_engine_failed_start_fuel_SoundSet";
485 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
486
487 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
488 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
489
490 m_CarHornShortSoundName = "Sedan_02_Horn_Short_SoundSet";
491 m_CarHornLongSoundName = "Sedan_02_Horn_SoundSet";
492
493 SetEnginePos("0 0.7 -1.7");
494 }
495
496 override void EEInit()
497 {
498 super.EEInit();
499
500 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
501 {
503 m_UTSSettings.m_ManualUpdate = true;
504 m_UTSSettings.m_TemperatureMin = 0;
505 m_UTSSettings.m_TemperatureMax = 30;
506 m_UTSSettings.m_RangeFull = 0.5;
507 m_UTSSettings.m_RangeMax = 2;
508 m_UTSSettings.m_TemperatureCap = 25;
509
512 }
513 }
514
515 override void OnEngineStart()
516 {
517 super.OnEngineStart();
518
519 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
520 m_UTSource.SetDefferedActive(true, 20.0);
521 }
522
523 override void OnEngineStop()
524 {
525 super.OnEngineStop();
526
527 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
528 m_UTSource.SetDefferedActive(false, 10.0);
529 }
530
531 override void EOnPostSimulate(IEntity other, float timeSlice)
532 {
533 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
534 {
535 if (m_UTSource.IsActive())
537 }
538 }
539
540 override int GetAnimInstance()
541 {
542 return VehicleAnimInstances.S120;
543 }
544
545 override int GetSeatAnimationType(int posIdx)
546 {
547 switch (posIdx)
548 {
549 case 0:
550 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
551 case 1:
552 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
553 case 2:
554 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
555 case 3:
556 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
557 }
558
559 return 0;
560 }
561
562 // Override for car-specific light type
564 {
565 return CarLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02FrontLight));
566 }
567
568 // Override for car-specific light type
570 {
571 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02RearLight));
572 }
573
575 {
576 if (!super.CanReleaseAttachment(attachment))
577 return false;
578
579 string attType = attachment.GetType();
580 switch (attType)
581 {
582 case "CarBattery":
583 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
584 return false;
585 break;
586
587 case "SparkPlug":
588 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
589 return false;
590 break;
591
592 case "CarRadiator":
593 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED || EngineIsOn())
594 return false;
595 break;
596 }
597
598 return true;
599 }
600
601 override protected bool CanManipulateSpareWheel(string slotSelectionName)
602 {
603 return GetCarDoorsState("Sedan_02_Hood") != CarDoorState.DOORS_CLOSED;
604 }
605
606 override bool CanDisplayAttachmentCategory(string category_name)
607 {
608 if (!super.CanDisplayAttachmentCategory(category_name))
609 return false;
610
611 category_name.ToLower();
612 if (category_name.Contains("engine"))
613 {
614 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED)
615 return false;
616 }
617
618 if (category_name.Contains("trunk"))
619 {
620 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
621 return false;
622 }
623
624 return true;
625 }
626
627 override bool CanDisplayCargo()
628 {
629 if (!super.CanDisplayCargo())
630 return false;
631
632 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
633 return false;
634
635 return true;
636 }
637
638 override int GetCarDoorsState(string slotType)
639 {
641
642 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
643 if (!carDoor)
644 return CarDoorState.DOORS_MISSING;
645
646 switch (slotType)
647 {
648 case "Sedan_02_Door_1_1":
649 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
650
651 case "Sedan_02_Door_2_1":
652 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
653
654 case "Sedan_02_Door_1_2":
655 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
656
657 case "Sedan_02_Door_2_2":
658 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
659
660 case "Sedan_02_Hood":
661 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
662
663 case "Sedan_02_Trunk":
664 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
665 }
666
667 return CarDoorState.DOORS_MISSING;
668 }
669
670
671 override bool CrewCanGetThrough(int posIdx)
672 {
673 switch (posIdx)
674 {
675 case 0:
676 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
677 return false;
678
679 return true;
680 break;
681
682 case 1:
683 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
684 return false;
685
686 return true;
687 break;
688
689 case 2:
690 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
691 return false;
692
693 return true;
694 break;
695
696 case 3:
697 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
698 return false;
699
700 return true;
701 break;
702 }
703
704 return false;
705 }
706
707 override string GetDoorSelectionNameFromSeatPos(int posIdx)
708 {
709 switch (posIdx)
710 {
711 case 0:
712 return "doors_driver";
713 break;
714 case 1:
715 return "doors_codriver";
716 break;
717 case 2:
718 return "doors_cargo1";
719 break;
720 case 3:
721 return "doors_cargo2";
722 break;
723 }
724
725 return super.GetDoorSelectionNameFromSeatPos(posIdx);
726 }
727
728 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
729 {
730 switch (posIdx)
731 {
732 case 0:
733 return "Sedan_02_Door_1_1";
734 break;
735 case 1:
736 return "Sedan_02_Door_2_1";
737 break;
738 case 2:
739 return "Sedan_02_Door_1_2";
740 break;
741 case 3:
742 return "Sedan_02_Door_2_2";
743 break;
744 }
745
746 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
747 }
748
749 override float OnSound(CarSoundCtrl ctrl, float oldValue)
750 {
751 switch (ctrl)
752 {
753 case CarSoundCtrl.DOORS:
754 float newValue = 0;
755 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
756 newValue += 0.25;
757
758 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
759 newValue += 0.25;
760
761 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
762 newValue += 0.25;
763
764 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
765 newValue += 0.25;
766
767 return Math.Clamp(newValue, 0, 1);
768 break;
769 }
770
771 return super.OnSound(ctrl, oldValue);
772 }
773
774 override string GetAnimSourceFromSelection(string selection)
775 {
776 switch (selection)
777 {
778 case "doors_driver":
779 return "DoorsDriver";
780 case "doors_codriver":
781 return "DoorsCoDriver";
782 case "doors_cargo1":
783 return "DoorsCargo1";
784 case "doors_cargo2":
785 return "DoorsCargo2";
786 case "doors_hood":
787 return "DoorsHood";
788 case "doors_trunk":
789 return "DoorsTrunk";
790 }
791
792 return "";
793 }
794
795
796 override bool IsVitalTruckBattery()
797 {
798 return false;
799 }
800
801 override bool IsVitalGlowPlug()
802 {
803 return false;
804 }
805
806 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
807 {
808 switch (currentSeat)
809 {
810 case 0:
811 return nextSeat == 1;
812
813 case 1:
814 return nextSeat == 0;
815
816 case 2:
817 return nextSeat == 3;
818
819 case 3:
820 return nextSeat == 2;
821 }
822
823 return false;
824 }
825
826 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
827 {
828 switch (pCurrentSeat)
829 {
830 case 0:
831 return pDoorsSelection == "DoorsDriver";
832
833 case 1:
834 return pDoorsSelection == "DoorsCoDriver";
835
836 case 2:
837 return pDoorsSelection == "DoorsCargo1";
838
839 case 3:
840 return pDoorsSelection == "DoorsCargo2";
841 }
842
843 return false;
844 }
845
846 override void OnDebugSpawn()
847 {
851
852 GetInventory().CreateInInventory("Sedan_02_Wheel");
853 GetInventory().CreateInInventory("Sedan_02_Wheel");
854 GetInventory().CreateInInventory("Sedan_02_Wheel");
855 GetInventory().CreateInInventory("Sedan_02_Wheel");
856 GetInventory().CreateInInventory("Sedan_02_Wheel");
857
858 GetInventory().CreateInInventory("Sedan_02_Door_1_1");
859 GetInventory().CreateInInventory("Sedan_02_Door_1_2");
860 GetInventory().CreateInInventory("Sedan_02_Door_2_1");
861 GetInventory().CreateInInventory("Sedan_02_Door_2_2");
862 GetInventory().CreateInInventory("Sedan_02_Hood");
863 GetInventory().CreateInInventory("Sedan_02_Trunk");
864
865 //-----IN CAR CARGO
866 GetInventory().CreateInInventory("Sedan_02_Wheel");
867 GetInventory().CreateInInventory("Sedan_02_Wheel");
868 }
869}
870
871class Sedan_02_Red extends Sedan_02
872{
873 override void OnDebugSpawn()
874 {
878
879 GetInventory().CreateInInventory("Sedan_02_Wheel");
880 GetInventory().CreateInInventory("Sedan_02_Wheel");
881 GetInventory().CreateInInventory("Sedan_02_Wheel");
882 GetInventory().CreateInInventory("Sedan_02_Wheel");
883
884 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
885 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
886 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
887 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
888 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
889 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
890
891 //-----IN CAR CARGO
892 GetInventory().CreateInInventory("Sedan_02_Wheel");
893 GetInventory().CreateInInventory("Sedan_02_Wheel");
894 }
895}
896
897class Sedan_02_Grey extends Sedan_02
898{
899 override void OnDebugSpawn()
900 {
904
905 GetInventory().CreateInInventory("Sedan_02_Wheel");
906 GetInventory().CreateInInventory("Sedan_02_Wheel");
907 GetInventory().CreateInInventory("Sedan_02_Wheel");
908 GetInventory().CreateInInventory("Sedan_02_Wheel");
909
910 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
911 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
912 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
913 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
914 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");
915 GetInventory().CreateInInventory("Sedan_02_Trunk_Grey");
916
917 //-----IN CAR CARGO
918 GetInventory().CreateInInventory("Sedan_02_Wheel");
919 GetInventory().CreateInInventory("Sedan_02_Wheel");
920 }
921}

◆ GetAnimSourceFromSelection()

override string OnDebugSpawn::GetAnimSourceFromSelection ( string selection)
protected

Definition at line 705 of file Sedan_02.c.

706{
710
711 void Sedan_02()
712 {
713 m_dmgContactCoef = 0.0790;
714
715 m_EngineStartOK = "Sedan_02_engine_start_SoundSet";
716 m_EngineStartBattery = "Sedan_02_engine_failed_start_battery_SoundSet";
717 m_EngineStartPlug = "Sedan_02_engine_failed_start_sparkplugs_SoundSet";
718 m_EngineStartFuel = "Sedan_02_engine_failed_start_fuel_SoundSet";
719 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
720
721 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
722 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
723
724 m_CarHornShortSoundName = "Sedan_02_Horn_Short_SoundSet";
725 m_CarHornLongSoundName = "Sedan_02_Horn_SoundSet";
726
727 SetEnginePos("0 0.7 -1.7");
728 }
729
730 override void EEInit()
731 {
732 super.EEInit();
733
734 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
735 {
737 m_UTSSettings.m_ManualUpdate = true;
738 m_UTSSettings.m_TemperatureMin = 0;
739 m_UTSSettings.m_TemperatureMax = 30;
740 m_UTSSettings.m_RangeFull = 0.5;
741 m_UTSSettings.m_RangeMax = 2;
742 m_UTSSettings.m_TemperatureCap = 25;
743
746 }
747 }
748
749 override void OnEngineStart()
750 {
751 super.OnEngineStart();
752
753 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
754 m_UTSource.SetDefferedActive(true, 20.0);
755 }
756
757 override void OnEngineStop()
758 {
759 super.OnEngineStop();
760
761 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
762 m_UTSource.SetDefferedActive(false, 10.0);
763 }
764
765 override void EOnPostSimulate(IEntity other, float timeSlice)
766 {
767 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
768 {
769 if (m_UTSource.IsActive())
771 }
772 }
773
774 override int GetAnimInstance()
775 {
776 return VehicleAnimInstances.S120;
777 }
778
779 override int GetSeatAnimationType(int posIdx)
780 {
781 switch (posIdx)
782 {
783 case 0:
784 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
785 case 1:
786 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
787 case 2:
788 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
789 case 3:
790 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
791 }
792
793 return 0;
794 }
795
796 // Override for car-specific light type
798 {
799 return CarLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02FrontLight));
800 }
801
802 // Override for car-specific light type
804 {
805 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02RearLight));
806 }
807
809 {
810 if (!super.CanReleaseAttachment(attachment))
811 return false;
812
813 string attType = attachment.GetType();
814 switch (attType)
815 {
816 case "CarBattery":
817 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
818 return false;
819 break;
820
821 case "SparkPlug":
822 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
823 return false;
824 break;
825
826 case "CarRadiator":
827 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED || EngineIsOn())
828 return false;
829 break;
830 }
831
832 return true;
833 }
834
835 override protected bool CanManipulateSpareWheel(string slotSelectionName)
836 {
837 return GetCarDoorsState("Sedan_02_Hood") != CarDoorState.DOORS_CLOSED;
838 }
839
840 override bool CanDisplayAttachmentCategory(string category_name)
841 {
842 if (!super.CanDisplayAttachmentCategory(category_name))
843 return false;
844
845 category_name.ToLower();
846 if (category_name.Contains("engine"))
847 {
848 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED)
849 return false;
850 }
851
852 if (category_name.Contains("trunk"))
853 {
854 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
855 return false;
856 }
857
858 return true;
859 }
860
861 override bool CanDisplayCargo()
862 {
863 if (!super.CanDisplayCargo())
864 return false;
865
866 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
867 return false;
868
869 return true;
870 }
871
872 override int GetCarDoorsState(string slotType)
873 {
875
876 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
877 if (!carDoor)
878 return CarDoorState.DOORS_MISSING;
879
880 switch (slotType)
881 {
882 case "Sedan_02_Door_1_1":
883 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
884
885 case "Sedan_02_Door_2_1":
886 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
887
888 case "Sedan_02_Door_1_2":
889 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
890
891 case "Sedan_02_Door_2_2":
892 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
893
894 case "Sedan_02_Hood":
895 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
896
897 case "Sedan_02_Trunk":
898 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
899 }
900
901 return CarDoorState.DOORS_MISSING;
902 }
903
904
905 override bool CrewCanGetThrough(int posIdx)
906 {
907 switch (posIdx)
908 {
909 case 0:
910 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
911 return false;
912
913 return true;
914 break;
915
916 case 1:
917 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
918 return false;
919
920 return true;
921 break;
922
923 case 2:
924 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
925 return false;
926
927 return true;
928 break;
929
930 case 3:
931 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
932 return false;
933
934 return true;
935 break;
936 }
937
938 return false;
939 }
940
941 override string GetDoorSelectionNameFromSeatPos(int posIdx)
942 {
943 switch (posIdx)
944 {
945 case 0:
946 return "doors_driver";
947 break;
948 case 1:
949 return "doors_codriver";
950 break;
951 case 2:
952 return "doors_cargo1";
953 break;
954 case 3:
955 return "doors_cargo2";
956 break;
957 }
958
959 return super.GetDoorSelectionNameFromSeatPos(posIdx);
960 }
961
962 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
963 {
964 switch (posIdx)
965 {
966 case 0:
967 return "Sedan_02_Door_1_1";
968 break;
969 case 1:
970 return "Sedan_02_Door_2_1";
971 break;
972 case 2:
973 return "Sedan_02_Door_1_2";
974 break;
975 case 3:
976 return "Sedan_02_Door_2_2";
977 break;
978 }
979
980 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
981 }
982
983 override float OnSound(CarSoundCtrl ctrl, float oldValue)
984 {
985 switch (ctrl)
986 {
987 case CarSoundCtrl.DOORS:
988 float newValue = 0;
989 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
990 newValue += 0.25;
991
992 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
993 newValue += 0.25;
994
995 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
996 newValue += 0.25;
997
998 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
999 newValue += 0.25;
1000
1001 return Math.Clamp(newValue, 0, 1);
1002 break;
1003 }
1004
1005 return super.OnSound(ctrl, oldValue);
1006 }
1007
1008 override string GetAnimSourceFromSelection(string selection)
1009 {
1010 switch (selection)
1011 {
1012 case "doors_driver":
1013 return "DoorsDriver";
1014 case "doors_codriver":
1015 return "DoorsCoDriver";
1016 case "doors_cargo1":
1017 return "DoorsCargo1";
1018 case "doors_cargo2":
1019 return "DoorsCargo2";
1020 case "doors_hood":
1021 return "DoorsHood";
1022 case "doors_trunk":
1023 return "DoorsTrunk";
1024 }
1025
1026 return "";
1027 }
1028
1029
1030 override bool IsVitalTruckBattery()
1031 {
1032 return false;
1033 }
1034
1035 override bool IsVitalGlowPlug()
1036 {
1037 return false;
1038 }
1039
1040 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1041 {
1042 switch (currentSeat)
1043 {
1044 case 0:
1045 return nextSeat == 1;
1046
1047 case 1:
1048 return nextSeat == 0;
1049
1050 case 2:
1051 return nextSeat == 3;
1052
1053 case 3:
1054 return nextSeat == 2;
1055 }
1056
1057 return false;
1058 }
1059
1060 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
1061 {
1062 switch (pCurrentSeat)
1063 {
1064 case 0:
1065 return pDoorsSelection == "DoorsDriver";
1066
1067 case 1:
1068 return pDoorsSelection == "DoorsCoDriver";
1069
1070 case 2:
1071 return pDoorsSelection == "DoorsCargo1";
1072
1073 case 3:
1074 return pDoorsSelection == "DoorsCargo2";
1075 }
1076
1077 return false;
1078 }
1079
1080 override void OnDebugSpawn()
1081 {
1085
1086 GetInventory().CreateInInventory("Sedan_02_Wheel");
1087 GetInventory().CreateInInventory("Sedan_02_Wheel");
1088 GetInventory().CreateInInventory("Sedan_02_Wheel");
1089 GetInventory().CreateInInventory("Sedan_02_Wheel");
1090 GetInventory().CreateInInventory("Sedan_02_Wheel");
1091
1092 GetInventory().CreateInInventory("Sedan_02_Door_1_1");
1093 GetInventory().CreateInInventory("Sedan_02_Door_1_2");
1094 GetInventory().CreateInInventory("Sedan_02_Door_2_1");
1095 GetInventory().CreateInInventory("Sedan_02_Door_2_2");
1096 GetInventory().CreateInInventory("Sedan_02_Hood");
1097 GetInventory().CreateInInventory("Sedan_02_Trunk");
1098
1099 //-----IN CAR CARGO
1100 GetInventory().CreateInInventory("Sedan_02_Wheel");
1101 GetInventory().CreateInInventory("Sedan_02_Wheel");
1102 }
1103}
1104
1105class Sedan_02_Red extends Sedan_02
1106{
1107 override void OnDebugSpawn()
1108 {
1112
1113 GetInventory().CreateInInventory("Sedan_02_Wheel");
1114 GetInventory().CreateInInventory("Sedan_02_Wheel");
1115 GetInventory().CreateInInventory("Sedan_02_Wheel");
1116 GetInventory().CreateInInventory("Sedan_02_Wheel");
1117
1118 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
1119 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
1120 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
1121 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
1122 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
1123 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
1124
1125 //-----IN CAR CARGO
1126 GetInventory().CreateInInventory("Sedan_02_Wheel");
1127 GetInventory().CreateInInventory("Sedan_02_Wheel");
1128 }
1129}
1130
1131class Sedan_02_Grey extends Sedan_02
1132{
1133 override void OnDebugSpawn()
1134 {
1138
1139 GetInventory().CreateInInventory("Sedan_02_Wheel");
1140 GetInventory().CreateInInventory("Sedan_02_Wheel");
1141 GetInventory().CreateInInventory("Sedan_02_Wheel");
1142 GetInventory().CreateInInventory("Sedan_02_Wheel");
1143
1144 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
1145 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
1146 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
1147 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
1148 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");
1149 GetInventory().CreateInInventory("Sedan_02_Trunk_Grey");
1150
1151 //-----IN CAR CARGO
1152 GetInventory().CreateInInventory("Sedan_02_Wheel");
1153 GetInventory().CreateInInventory("Sedan_02_Wheel");
1154 }
1155}

◆ GetCarDoorsState()

override int OnDebugSpawn::GetCarDoorsState ( string slotType)
protected

Definition at line 569 of file Sedan_02.c.

570{
574
575 void Sedan_02()
576 {
577 m_dmgContactCoef = 0.0790;
578
579 m_EngineStartOK = "Sedan_02_engine_start_SoundSet";
580 m_EngineStartBattery = "Sedan_02_engine_failed_start_battery_SoundSet";
581 m_EngineStartPlug = "Sedan_02_engine_failed_start_sparkplugs_SoundSet";
582 m_EngineStartFuel = "Sedan_02_engine_failed_start_fuel_SoundSet";
583 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
584
585 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
586 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
587
588 m_CarHornShortSoundName = "Sedan_02_Horn_Short_SoundSet";
589 m_CarHornLongSoundName = "Sedan_02_Horn_SoundSet";
590
591 SetEnginePos("0 0.7 -1.7");
592 }
593
594 override void EEInit()
595 {
596 super.EEInit();
597
598 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
599 {
601 m_UTSSettings.m_ManualUpdate = true;
602 m_UTSSettings.m_TemperatureMin = 0;
603 m_UTSSettings.m_TemperatureMax = 30;
604 m_UTSSettings.m_RangeFull = 0.5;
605 m_UTSSettings.m_RangeMax = 2;
606 m_UTSSettings.m_TemperatureCap = 25;
607
610 }
611 }
612
613 override void OnEngineStart()
614 {
615 super.OnEngineStart();
616
617 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
618 m_UTSource.SetDefferedActive(true, 20.0);
619 }
620
621 override void OnEngineStop()
622 {
623 super.OnEngineStop();
624
625 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
626 m_UTSource.SetDefferedActive(false, 10.0);
627 }
628
629 override void EOnPostSimulate(IEntity other, float timeSlice)
630 {
631 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
632 {
633 if (m_UTSource.IsActive())
635 }
636 }
637
638 override int GetAnimInstance()
639 {
640 return VehicleAnimInstances.S120;
641 }
642
643 override int GetSeatAnimationType(int posIdx)
644 {
645 switch (posIdx)
646 {
647 case 0:
648 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
649 case 1:
650 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
651 case 2:
652 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
653 case 3:
654 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
655 }
656
657 return 0;
658 }
659
660 // Override for car-specific light type
662 {
663 return CarLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02FrontLight));
664 }
665
666 // Override for car-specific light type
668 {
669 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02RearLight));
670 }
671
673 {
674 if (!super.CanReleaseAttachment(attachment))
675 return false;
676
677 string attType = attachment.GetType();
678 switch (attType)
679 {
680 case "CarBattery":
681 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
682 return false;
683 break;
684
685 case "SparkPlug":
686 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
687 return false;
688 break;
689
690 case "CarRadiator":
691 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED || EngineIsOn())
692 return false;
693 break;
694 }
695
696 return true;
697 }
698
699 override protected bool CanManipulateSpareWheel(string slotSelectionName)
700 {
701 return GetCarDoorsState("Sedan_02_Hood") != CarDoorState.DOORS_CLOSED;
702 }
703
704 override bool CanDisplayAttachmentCategory(string category_name)
705 {
706 if (!super.CanDisplayAttachmentCategory(category_name))
707 return false;
708
709 category_name.ToLower();
710 if (category_name.Contains("engine"))
711 {
712 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED)
713 return false;
714 }
715
716 if (category_name.Contains("trunk"))
717 {
718 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
719 return false;
720 }
721
722 return true;
723 }
724
725 override bool CanDisplayCargo()
726 {
727 if (!super.CanDisplayCargo())
728 return false;
729
730 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
731 return false;
732
733 return true;
734 }
735
736 override int GetCarDoorsState(string slotType)
737 {
739
740 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
741 if (!carDoor)
742 return CarDoorState.DOORS_MISSING;
743
744 switch (slotType)
745 {
746 case "Sedan_02_Door_1_1":
747 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
748
749 case "Sedan_02_Door_2_1":
750 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
751
752 case "Sedan_02_Door_1_2":
753 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
754
755 case "Sedan_02_Door_2_2":
756 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
757
758 case "Sedan_02_Hood":
759 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
760
761 case "Sedan_02_Trunk":
762 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
763 }
764
765 return CarDoorState.DOORS_MISSING;
766 }
767
768
769 override bool CrewCanGetThrough(int posIdx)
770 {
771 switch (posIdx)
772 {
773 case 0:
774 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
775 return false;
776
777 return true;
778 break;
779
780 case 1:
781 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
782 return false;
783
784 return true;
785 break;
786
787 case 2:
788 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
789 return false;
790
791 return true;
792 break;
793
794 case 3:
795 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
796 return false;
797
798 return true;
799 break;
800 }
801
802 return false;
803 }
804
805 override string GetDoorSelectionNameFromSeatPos(int posIdx)
806 {
807 switch (posIdx)
808 {
809 case 0:
810 return "doors_driver";
811 break;
812 case 1:
813 return "doors_codriver";
814 break;
815 case 2:
816 return "doors_cargo1";
817 break;
818 case 3:
819 return "doors_cargo2";
820 break;
821 }
822
823 return super.GetDoorSelectionNameFromSeatPos(posIdx);
824 }
825
826 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
827 {
828 switch (posIdx)
829 {
830 case 0:
831 return "Sedan_02_Door_1_1";
832 break;
833 case 1:
834 return "Sedan_02_Door_2_1";
835 break;
836 case 2:
837 return "Sedan_02_Door_1_2";
838 break;
839 case 3:
840 return "Sedan_02_Door_2_2";
841 break;
842 }
843
844 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
845 }
846
847 override float OnSound(CarSoundCtrl ctrl, float oldValue)
848 {
849 switch (ctrl)
850 {
851 case CarSoundCtrl.DOORS:
852 float newValue = 0;
853 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
854 newValue += 0.25;
855
856 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
857 newValue += 0.25;
858
859 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
860 newValue += 0.25;
861
862 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
863 newValue += 0.25;
864
865 return Math.Clamp(newValue, 0, 1);
866 break;
867 }
868
869 return super.OnSound(ctrl, oldValue);
870 }
871
872 override string GetAnimSourceFromSelection(string selection)
873 {
874 switch (selection)
875 {
876 case "doors_driver":
877 return "DoorsDriver";
878 case "doors_codriver":
879 return "DoorsCoDriver";
880 case "doors_cargo1":
881 return "DoorsCargo1";
882 case "doors_cargo2":
883 return "DoorsCargo2";
884 case "doors_hood":
885 return "DoorsHood";
886 case "doors_trunk":
887 return "DoorsTrunk";
888 }
889
890 return "";
891 }
892
893
894 override bool IsVitalTruckBattery()
895 {
896 return false;
897 }
898
899 override bool IsVitalGlowPlug()
900 {
901 return false;
902 }
903
904 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
905 {
906 switch (currentSeat)
907 {
908 case 0:
909 return nextSeat == 1;
910
911 case 1:
912 return nextSeat == 0;
913
914 case 2:
915 return nextSeat == 3;
916
917 case 3:
918 return nextSeat == 2;
919 }
920
921 return false;
922 }
923
924 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
925 {
926 switch (pCurrentSeat)
927 {
928 case 0:
929 return pDoorsSelection == "DoorsDriver";
930
931 case 1:
932 return pDoorsSelection == "DoorsCoDriver";
933
934 case 2:
935 return pDoorsSelection == "DoorsCargo1";
936
937 case 3:
938 return pDoorsSelection == "DoorsCargo2";
939 }
940
941 return false;
942 }
943
944 override void OnDebugSpawn()
945 {
949
950 GetInventory().CreateInInventory("Sedan_02_Wheel");
951 GetInventory().CreateInInventory("Sedan_02_Wheel");
952 GetInventory().CreateInInventory("Sedan_02_Wheel");
953 GetInventory().CreateInInventory("Sedan_02_Wheel");
954 GetInventory().CreateInInventory("Sedan_02_Wheel");
955
956 GetInventory().CreateInInventory("Sedan_02_Door_1_1");
957 GetInventory().CreateInInventory("Sedan_02_Door_1_2");
958 GetInventory().CreateInInventory("Sedan_02_Door_2_1");
959 GetInventory().CreateInInventory("Sedan_02_Door_2_2");
960 GetInventory().CreateInInventory("Sedan_02_Hood");
961 GetInventory().CreateInInventory("Sedan_02_Trunk");
962
963 //-----IN CAR CARGO
964 GetInventory().CreateInInventory("Sedan_02_Wheel");
965 GetInventory().CreateInInventory("Sedan_02_Wheel");
966 }
967}
968
969class Sedan_02_Red extends Sedan_02
970{
971 override void OnDebugSpawn()
972 {
976
977 GetInventory().CreateInInventory("Sedan_02_Wheel");
978 GetInventory().CreateInInventory("Sedan_02_Wheel");
979 GetInventory().CreateInInventory("Sedan_02_Wheel");
980 GetInventory().CreateInInventory("Sedan_02_Wheel");
981
982 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
983 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
984 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
985 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
986 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
987 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
988
989 //-----IN CAR CARGO
990 GetInventory().CreateInInventory("Sedan_02_Wheel");
991 GetInventory().CreateInInventory("Sedan_02_Wheel");
992 }
993}
994
995class Sedan_02_Grey extends Sedan_02
996{
997 override void OnDebugSpawn()
998 {
1002
1003 GetInventory().CreateInInventory("Sedan_02_Wheel");
1004 GetInventory().CreateInInventory("Sedan_02_Wheel");
1005 GetInventory().CreateInInventory("Sedan_02_Wheel");
1006 GetInventory().CreateInInventory("Sedan_02_Wheel");
1007
1008 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
1009 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
1010 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
1011 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
1012 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");
1013 GetInventory().CreateInInventory("Sedan_02_Trunk_Grey");
1014
1015 //-----IN CAR CARGO
1016 GetInventory().CreateInInventory("Sedan_02_Wheel");
1017 GetInventory().CreateInInventory("Sedan_02_Wheel");
1018 }
1019}

Referenced by CarScript::CanDisplayAttachmentCategory(), CarScript::CanDisplayCargo(), CarScript::CanManipulateSpareWheel(), CarScript::CanReleaseAttachment(), CarScript::CrewCanGetThrough(), and CarScript::OnSound().

◆ GetDoorInvSlotNameFromSeatPos()

override string OnDebugSpawn::GetDoorInvSlotNameFromSeatPos ( int posIdx)
protected

Definition at line 659 of file Sedan_02.c.

660{
664
665 void Sedan_02()
666 {
667 m_dmgContactCoef = 0.0790;
668
669 m_EngineStartOK = "Sedan_02_engine_start_SoundSet";
670 m_EngineStartBattery = "Sedan_02_engine_failed_start_battery_SoundSet";
671 m_EngineStartPlug = "Sedan_02_engine_failed_start_sparkplugs_SoundSet";
672 m_EngineStartFuel = "Sedan_02_engine_failed_start_fuel_SoundSet";
673 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
674
675 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
676 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
677
678 m_CarHornShortSoundName = "Sedan_02_Horn_Short_SoundSet";
679 m_CarHornLongSoundName = "Sedan_02_Horn_SoundSet";
680
681 SetEnginePos("0 0.7 -1.7");
682 }
683
684 override void EEInit()
685 {
686 super.EEInit();
687
688 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
689 {
691 m_UTSSettings.m_ManualUpdate = true;
692 m_UTSSettings.m_TemperatureMin = 0;
693 m_UTSSettings.m_TemperatureMax = 30;
694 m_UTSSettings.m_RangeFull = 0.5;
695 m_UTSSettings.m_RangeMax = 2;
696 m_UTSSettings.m_TemperatureCap = 25;
697
700 }
701 }
702
703 override void OnEngineStart()
704 {
705 super.OnEngineStart();
706
707 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
708 m_UTSource.SetDefferedActive(true, 20.0);
709 }
710
711 override void OnEngineStop()
712 {
713 super.OnEngineStop();
714
715 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
716 m_UTSource.SetDefferedActive(false, 10.0);
717 }
718
719 override void EOnPostSimulate(IEntity other, float timeSlice)
720 {
721 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
722 {
723 if (m_UTSource.IsActive())
725 }
726 }
727
728 override int GetAnimInstance()
729 {
730 return VehicleAnimInstances.S120;
731 }
732
733 override int GetSeatAnimationType(int posIdx)
734 {
735 switch (posIdx)
736 {
737 case 0:
738 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
739 case 1:
740 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
741 case 2:
742 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
743 case 3:
744 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
745 }
746
747 return 0;
748 }
749
750 // Override for car-specific light type
752 {
753 return CarLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02FrontLight));
754 }
755
756 // Override for car-specific light type
758 {
759 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02RearLight));
760 }
761
763 {
764 if (!super.CanReleaseAttachment(attachment))
765 return false;
766
767 string attType = attachment.GetType();
768 switch (attType)
769 {
770 case "CarBattery":
771 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
772 return false;
773 break;
774
775 case "SparkPlug":
776 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
777 return false;
778 break;
779
780 case "CarRadiator":
781 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED || EngineIsOn())
782 return false;
783 break;
784 }
785
786 return true;
787 }
788
789 override protected bool CanManipulateSpareWheel(string slotSelectionName)
790 {
791 return GetCarDoorsState("Sedan_02_Hood") != CarDoorState.DOORS_CLOSED;
792 }
793
794 override bool CanDisplayAttachmentCategory(string category_name)
795 {
796 if (!super.CanDisplayAttachmentCategory(category_name))
797 return false;
798
799 category_name.ToLower();
800 if (category_name.Contains("engine"))
801 {
802 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED)
803 return false;
804 }
805
806 if (category_name.Contains("trunk"))
807 {
808 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
809 return false;
810 }
811
812 return true;
813 }
814
815 override bool CanDisplayCargo()
816 {
817 if (!super.CanDisplayCargo())
818 return false;
819
820 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
821 return false;
822
823 return true;
824 }
825
826 override int GetCarDoorsState(string slotType)
827 {
829
830 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
831 if (!carDoor)
832 return CarDoorState.DOORS_MISSING;
833
834 switch (slotType)
835 {
836 case "Sedan_02_Door_1_1":
837 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
838
839 case "Sedan_02_Door_2_1":
840 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
841
842 case "Sedan_02_Door_1_2":
843 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
844
845 case "Sedan_02_Door_2_2":
846 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
847
848 case "Sedan_02_Hood":
849 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
850
851 case "Sedan_02_Trunk":
852 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
853 }
854
855 return CarDoorState.DOORS_MISSING;
856 }
857
858
859 override bool CrewCanGetThrough(int posIdx)
860 {
861 switch (posIdx)
862 {
863 case 0:
864 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
865 return false;
866
867 return true;
868 break;
869
870 case 1:
871 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
872 return false;
873
874 return true;
875 break;
876
877 case 2:
878 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
879 return false;
880
881 return true;
882 break;
883
884 case 3:
885 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
886 return false;
887
888 return true;
889 break;
890 }
891
892 return false;
893 }
894
895 override string GetDoorSelectionNameFromSeatPos(int posIdx)
896 {
897 switch (posIdx)
898 {
899 case 0:
900 return "doors_driver";
901 break;
902 case 1:
903 return "doors_codriver";
904 break;
905 case 2:
906 return "doors_cargo1";
907 break;
908 case 3:
909 return "doors_cargo2";
910 break;
911 }
912
913 return super.GetDoorSelectionNameFromSeatPos(posIdx);
914 }
915
916 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
917 {
918 switch (posIdx)
919 {
920 case 0:
921 return "Sedan_02_Door_1_1";
922 break;
923 case 1:
924 return "Sedan_02_Door_2_1";
925 break;
926 case 2:
927 return "Sedan_02_Door_1_2";
928 break;
929 case 3:
930 return "Sedan_02_Door_2_2";
931 break;
932 }
933
934 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
935 }
936
937 override float OnSound(CarSoundCtrl ctrl, float oldValue)
938 {
939 switch (ctrl)
940 {
941 case CarSoundCtrl.DOORS:
942 float newValue = 0;
943 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
944 newValue += 0.25;
945
946 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
947 newValue += 0.25;
948
949 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
950 newValue += 0.25;
951
952 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
953 newValue += 0.25;
954
955 return Math.Clamp(newValue, 0, 1);
956 break;
957 }
958
959 return super.OnSound(ctrl, oldValue);
960 }
961
962 override string GetAnimSourceFromSelection(string selection)
963 {
964 switch (selection)
965 {
966 case "doors_driver":
967 return "DoorsDriver";
968 case "doors_codriver":
969 return "DoorsCoDriver";
970 case "doors_cargo1":
971 return "DoorsCargo1";
972 case "doors_cargo2":
973 return "DoorsCargo2";
974 case "doors_hood":
975 return "DoorsHood";
976 case "doors_trunk":
977 return "DoorsTrunk";
978 }
979
980 return "";
981 }
982
983
984 override bool IsVitalTruckBattery()
985 {
986 return false;
987 }
988
989 override bool IsVitalGlowPlug()
990 {
991 return false;
992 }
993
994 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
995 {
996 switch (currentSeat)
997 {
998 case 0:
999 return nextSeat == 1;
1000
1001 case 1:
1002 return nextSeat == 0;
1003
1004 case 2:
1005 return nextSeat == 3;
1006
1007 case 3:
1008 return nextSeat == 2;
1009 }
1010
1011 return false;
1012 }
1013
1014 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
1015 {
1016 switch (pCurrentSeat)
1017 {
1018 case 0:
1019 return pDoorsSelection == "DoorsDriver";
1020
1021 case 1:
1022 return pDoorsSelection == "DoorsCoDriver";
1023
1024 case 2:
1025 return pDoorsSelection == "DoorsCargo1";
1026
1027 case 3:
1028 return pDoorsSelection == "DoorsCargo2";
1029 }
1030
1031 return false;
1032 }
1033
1034 override void OnDebugSpawn()
1035 {
1039
1040 GetInventory().CreateInInventory("Sedan_02_Wheel");
1041 GetInventory().CreateInInventory("Sedan_02_Wheel");
1042 GetInventory().CreateInInventory("Sedan_02_Wheel");
1043 GetInventory().CreateInInventory("Sedan_02_Wheel");
1044 GetInventory().CreateInInventory("Sedan_02_Wheel");
1045
1046 GetInventory().CreateInInventory("Sedan_02_Door_1_1");
1047 GetInventory().CreateInInventory("Sedan_02_Door_1_2");
1048 GetInventory().CreateInInventory("Sedan_02_Door_2_1");
1049 GetInventory().CreateInInventory("Sedan_02_Door_2_2");
1050 GetInventory().CreateInInventory("Sedan_02_Hood");
1051 GetInventory().CreateInInventory("Sedan_02_Trunk");
1052
1053 //-----IN CAR CARGO
1054 GetInventory().CreateInInventory("Sedan_02_Wheel");
1055 GetInventory().CreateInInventory("Sedan_02_Wheel");
1056 }
1057}
1058
1059class Sedan_02_Red extends Sedan_02
1060{
1061 override void OnDebugSpawn()
1062 {
1066
1067 GetInventory().CreateInInventory("Sedan_02_Wheel");
1068 GetInventory().CreateInInventory("Sedan_02_Wheel");
1069 GetInventory().CreateInInventory("Sedan_02_Wheel");
1070 GetInventory().CreateInInventory("Sedan_02_Wheel");
1071
1072 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
1073 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
1074 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
1075 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
1076 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
1077 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
1078
1079 //-----IN CAR CARGO
1080 GetInventory().CreateInInventory("Sedan_02_Wheel");
1081 GetInventory().CreateInInventory("Sedan_02_Wheel");
1082 }
1083}
1084
1085class Sedan_02_Grey extends Sedan_02
1086{
1087 override void OnDebugSpawn()
1088 {
1092
1093 GetInventory().CreateInInventory("Sedan_02_Wheel");
1094 GetInventory().CreateInInventory("Sedan_02_Wheel");
1095 GetInventory().CreateInInventory("Sedan_02_Wheel");
1096 GetInventory().CreateInInventory("Sedan_02_Wheel");
1097
1098 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
1099 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
1100 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
1101 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
1102 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");
1103 GetInventory().CreateInInventory("Sedan_02_Trunk_Grey");
1104
1105 //-----IN CAR CARGO
1106 GetInventory().CreateInInventory("Sedan_02_Wheel");
1107 GetInventory().CreateInInventory("Sedan_02_Wheel");
1108 }
1109}

◆ GetDoorSelectionNameFromSeatPos()

override string OnDebugSpawn::GetDoorSelectionNameFromSeatPos ( int posIdx)
protected

Definition at line 638 of file Sedan_02.c.

639{
643
644 void Sedan_02()
645 {
646 m_dmgContactCoef = 0.0790;
647
648 m_EngineStartOK = "Sedan_02_engine_start_SoundSet";
649 m_EngineStartBattery = "Sedan_02_engine_failed_start_battery_SoundSet";
650 m_EngineStartPlug = "Sedan_02_engine_failed_start_sparkplugs_SoundSet";
651 m_EngineStartFuel = "Sedan_02_engine_failed_start_fuel_SoundSet";
652 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
653
654 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
655 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
656
657 m_CarHornShortSoundName = "Sedan_02_Horn_Short_SoundSet";
658 m_CarHornLongSoundName = "Sedan_02_Horn_SoundSet";
659
660 SetEnginePos("0 0.7 -1.7");
661 }
662
663 override void EEInit()
664 {
665 super.EEInit();
666
667 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
668 {
670 m_UTSSettings.m_ManualUpdate = true;
671 m_UTSSettings.m_TemperatureMin = 0;
672 m_UTSSettings.m_TemperatureMax = 30;
673 m_UTSSettings.m_RangeFull = 0.5;
674 m_UTSSettings.m_RangeMax = 2;
675 m_UTSSettings.m_TemperatureCap = 25;
676
679 }
680 }
681
682 override void OnEngineStart()
683 {
684 super.OnEngineStart();
685
686 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
687 m_UTSource.SetDefferedActive(true, 20.0);
688 }
689
690 override void OnEngineStop()
691 {
692 super.OnEngineStop();
693
694 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
695 m_UTSource.SetDefferedActive(false, 10.0);
696 }
697
698 override void EOnPostSimulate(IEntity other, float timeSlice)
699 {
700 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
701 {
702 if (m_UTSource.IsActive())
704 }
705 }
706
707 override int GetAnimInstance()
708 {
709 return VehicleAnimInstances.S120;
710 }
711
712 override int GetSeatAnimationType(int posIdx)
713 {
714 switch (posIdx)
715 {
716 case 0:
717 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
718 case 1:
719 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
720 case 2:
721 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
722 case 3:
723 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
724 }
725
726 return 0;
727 }
728
729 // Override for car-specific light type
731 {
732 return CarLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02FrontLight));
733 }
734
735 // Override for car-specific light type
737 {
738 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02RearLight));
739 }
740
742 {
743 if (!super.CanReleaseAttachment(attachment))
744 return false;
745
746 string attType = attachment.GetType();
747 switch (attType)
748 {
749 case "CarBattery":
750 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
751 return false;
752 break;
753
754 case "SparkPlug":
755 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
756 return false;
757 break;
758
759 case "CarRadiator":
760 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED || EngineIsOn())
761 return false;
762 break;
763 }
764
765 return true;
766 }
767
768 override protected bool CanManipulateSpareWheel(string slotSelectionName)
769 {
770 return GetCarDoorsState("Sedan_02_Hood") != CarDoorState.DOORS_CLOSED;
771 }
772
773 override bool CanDisplayAttachmentCategory(string category_name)
774 {
775 if (!super.CanDisplayAttachmentCategory(category_name))
776 return false;
777
778 category_name.ToLower();
779 if (category_name.Contains("engine"))
780 {
781 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED)
782 return false;
783 }
784
785 if (category_name.Contains("trunk"))
786 {
787 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
788 return false;
789 }
790
791 return true;
792 }
793
794 override bool CanDisplayCargo()
795 {
796 if (!super.CanDisplayCargo())
797 return false;
798
799 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
800 return false;
801
802 return true;
803 }
804
805 override int GetCarDoorsState(string slotType)
806 {
808
809 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
810 if (!carDoor)
811 return CarDoorState.DOORS_MISSING;
812
813 switch (slotType)
814 {
815 case "Sedan_02_Door_1_1":
816 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
817
818 case "Sedan_02_Door_2_1":
819 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
820
821 case "Sedan_02_Door_1_2":
822 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
823
824 case "Sedan_02_Door_2_2":
825 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
826
827 case "Sedan_02_Hood":
828 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
829
830 case "Sedan_02_Trunk":
831 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
832 }
833
834 return CarDoorState.DOORS_MISSING;
835 }
836
837
838 override bool CrewCanGetThrough(int posIdx)
839 {
840 switch (posIdx)
841 {
842 case 0:
843 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
844 return false;
845
846 return true;
847 break;
848
849 case 1:
850 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
851 return false;
852
853 return true;
854 break;
855
856 case 2:
857 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
858 return false;
859
860 return true;
861 break;
862
863 case 3:
864 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
865 return false;
866
867 return true;
868 break;
869 }
870
871 return false;
872 }
873
874 override string GetDoorSelectionNameFromSeatPos(int posIdx)
875 {
876 switch (posIdx)
877 {
878 case 0:
879 return "doors_driver";
880 break;
881 case 1:
882 return "doors_codriver";
883 break;
884 case 2:
885 return "doors_cargo1";
886 break;
887 case 3:
888 return "doors_cargo2";
889 break;
890 }
891
892 return super.GetDoorSelectionNameFromSeatPos(posIdx);
893 }
894
895 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
896 {
897 switch (posIdx)
898 {
899 case 0:
900 return "Sedan_02_Door_1_1";
901 break;
902 case 1:
903 return "Sedan_02_Door_2_1";
904 break;
905 case 2:
906 return "Sedan_02_Door_1_2";
907 break;
908 case 3:
909 return "Sedan_02_Door_2_2";
910 break;
911 }
912
913 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
914 }
915
916 override float OnSound(CarSoundCtrl ctrl, float oldValue)
917 {
918 switch (ctrl)
919 {
920 case CarSoundCtrl.DOORS:
921 float newValue = 0;
922 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
923 newValue += 0.25;
924
925 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
926 newValue += 0.25;
927
928 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
929 newValue += 0.25;
930
931 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
932 newValue += 0.25;
933
934 return Math.Clamp(newValue, 0, 1);
935 break;
936 }
937
938 return super.OnSound(ctrl, oldValue);
939 }
940
941 override string GetAnimSourceFromSelection(string selection)
942 {
943 switch (selection)
944 {
945 case "doors_driver":
946 return "DoorsDriver";
947 case "doors_codriver":
948 return "DoorsCoDriver";
949 case "doors_cargo1":
950 return "DoorsCargo1";
951 case "doors_cargo2":
952 return "DoorsCargo2";
953 case "doors_hood":
954 return "DoorsHood";
955 case "doors_trunk":
956 return "DoorsTrunk";
957 }
958
959 return "";
960 }
961
962
963 override bool IsVitalTruckBattery()
964 {
965 return false;
966 }
967
968 override bool IsVitalGlowPlug()
969 {
970 return false;
971 }
972
973 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
974 {
975 switch (currentSeat)
976 {
977 case 0:
978 return nextSeat == 1;
979
980 case 1:
981 return nextSeat == 0;
982
983 case 2:
984 return nextSeat == 3;
985
986 case 3:
987 return nextSeat == 2;
988 }
989
990 return false;
991 }
992
993 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
994 {
995 switch (pCurrentSeat)
996 {
997 case 0:
998 return pDoorsSelection == "DoorsDriver";
999
1000 case 1:
1001 return pDoorsSelection == "DoorsCoDriver";
1002
1003 case 2:
1004 return pDoorsSelection == "DoorsCargo1";
1005
1006 case 3:
1007 return pDoorsSelection == "DoorsCargo2";
1008 }
1009
1010 return false;
1011 }
1012
1013 override void OnDebugSpawn()
1014 {
1018
1019 GetInventory().CreateInInventory("Sedan_02_Wheel");
1020 GetInventory().CreateInInventory("Sedan_02_Wheel");
1021 GetInventory().CreateInInventory("Sedan_02_Wheel");
1022 GetInventory().CreateInInventory("Sedan_02_Wheel");
1023 GetInventory().CreateInInventory("Sedan_02_Wheel");
1024
1025 GetInventory().CreateInInventory("Sedan_02_Door_1_1");
1026 GetInventory().CreateInInventory("Sedan_02_Door_1_2");
1027 GetInventory().CreateInInventory("Sedan_02_Door_2_1");
1028 GetInventory().CreateInInventory("Sedan_02_Door_2_2");
1029 GetInventory().CreateInInventory("Sedan_02_Hood");
1030 GetInventory().CreateInInventory("Sedan_02_Trunk");
1031
1032 //-----IN CAR CARGO
1033 GetInventory().CreateInInventory("Sedan_02_Wheel");
1034 GetInventory().CreateInInventory("Sedan_02_Wheel");
1035 }
1036}
1037
1038class Sedan_02_Red extends Sedan_02
1039{
1040 override void OnDebugSpawn()
1041 {
1045
1046 GetInventory().CreateInInventory("Sedan_02_Wheel");
1047 GetInventory().CreateInInventory("Sedan_02_Wheel");
1048 GetInventory().CreateInInventory("Sedan_02_Wheel");
1049 GetInventory().CreateInInventory("Sedan_02_Wheel");
1050
1051 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
1052 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
1053 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
1054 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
1055 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
1056 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
1057
1058 //-----IN CAR CARGO
1059 GetInventory().CreateInInventory("Sedan_02_Wheel");
1060 GetInventory().CreateInInventory("Sedan_02_Wheel");
1061 }
1062}
1063
1064class Sedan_02_Grey extends Sedan_02
1065{
1066 override void OnDebugSpawn()
1067 {
1071
1072 GetInventory().CreateInInventory("Sedan_02_Wheel");
1073 GetInventory().CreateInInventory("Sedan_02_Wheel");
1074 GetInventory().CreateInInventory("Sedan_02_Wheel");
1075 GetInventory().CreateInInventory("Sedan_02_Wheel");
1076
1077 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
1078 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
1079 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
1080 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
1081 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");
1082 GetInventory().CreateInInventory("Sedan_02_Trunk_Grey");
1083
1084 //-----IN CAR CARGO
1085 GetInventory().CreateInInventory("Sedan_02_Wheel");
1086 GetInventory().CreateInInventory("Sedan_02_Wheel");
1087 }
1088}

◆ GetSeatAnimationType()

override int OnDebugSpawn::GetSeatAnimationType ( int posIdx)
protected

Definition at line 476 of file Sedan_02.c.

477{
481
482 void Sedan_02()
483 {
484 m_dmgContactCoef = 0.0790;
485
486 m_EngineStartOK = "Sedan_02_engine_start_SoundSet";
487 m_EngineStartBattery = "Sedan_02_engine_failed_start_battery_SoundSet";
488 m_EngineStartPlug = "Sedan_02_engine_failed_start_sparkplugs_SoundSet";
489 m_EngineStartFuel = "Sedan_02_engine_failed_start_fuel_SoundSet";
490 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
491
492 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
493 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
494
495 m_CarHornShortSoundName = "Sedan_02_Horn_Short_SoundSet";
496 m_CarHornLongSoundName = "Sedan_02_Horn_SoundSet";
497
498 SetEnginePos("0 0.7 -1.7");
499 }
500
501 override void EEInit()
502 {
503 super.EEInit();
504
505 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
506 {
508 m_UTSSettings.m_ManualUpdate = true;
509 m_UTSSettings.m_TemperatureMin = 0;
510 m_UTSSettings.m_TemperatureMax = 30;
511 m_UTSSettings.m_RangeFull = 0.5;
512 m_UTSSettings.m_RangeMax = 2;
513 m_UTSSettings.m_TemperatureCap = 25;
514
517 }
518 }
519
520 override void OnEngineStart()
521 {
522 super.OnEngineStart();
523
524 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
525 m_UTSource.SetDefferedActive(true, 20.0);
526 }
527
528 override void OnEngineStop()
529 {
530 super.OnEngineStop();
531
532 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
533 m_UTSource.SetDefferedActive(false, 10.0);
534 }
535
536 override void EOnPostSimulate(IEntity other, float timeSlice)
537 {
538 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
539 {
540 if (m_UTSource.IsActive())
542 }
543 }
544
545 override int GetAnimInstance()
546 {
547 return VehicleAnimInstances.S120;
548 }
549
550 override int GetSeatAnimationType(int posIdx)
551 {
552 switch (posIdx)
553 {
554 case 0:
555 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
556 case 1:
557 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
558 case 2:
559 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
560 case 3:
561 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
562 }
563
564 return 0;
565 }
566
567 // Override for car-specific light type
569 {
570 return CarLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02FrontLight));
571 }
572
573 // Override for car-specific light type
575 {
576 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02RearLight));
577 }
578
580 {
581 if (!super.CanReleaseAttachment(attachment))
582 return false;
583
584 string attType = attachment.GetType();
585 switch (attType)
586 {
587 case "CarBattery":
588 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
589 return false;
590 break;
591
592 case "SparkPlug":
593 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
594 return false;
595 break;
596
597 case "CarRadiator":
598 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED || EngineIsOn())
599 return false;
600 break;
601 }
602
603 return true;
604 }
605
606 override protected bool CanManipulateSpareWheel(string slotSelectionName)
607 {
608 return GetCarDoorsState("Sedan_02_Hood") != CarDoorState.DOORS_CLOSED;
609 }
610
611 override bool CanDisplayAttachmentCategory(string category_name)
612 {
613 if (!super.CanDisplayAttachmentCategory(category_name))
614 return false;
615
616 category_name.ToLower();
617 if (category_name.Contains("engine"))
618 {
619 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED)
620 return false;
621 }
622
623 if (category_name.Contains("trunk"))
624 {
625 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
626 return false;
627 }
628
629 return true;
630 }
631
632 override bool CanDisplayCargo()
633 {
634 if (!super.CanDisplayCargo())
635 return false;
636
637 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
638 return false;
639
640 return true;
641 }
642
643 override int GetCarDoorsState(string slotType)
644 {
646
647 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
648 if (!carDoor)
649 return CarDoorState.DOORS_MISSING;
650
651 switch (slotType)
652 {
653 case "Sedan_02_Door_1_1":
654 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
655
656 case "Sedan_02_Door_2_1":
657 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
658
659 case "Sedan_02_Door_1_2":
660 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
661
662 case "Sedan_02_Door_2_2":
663 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
664
665 case "Sedan_02_Hood":
666 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
667
668 case "Sedan_02_Trunk":
669 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
670 }
671
672 return CarDoorState.DOORS_MISSING;
673 }
674
675
676 override bool CrewCanGetThrough(int posIdx)
677 {
678 switch (posIdx)
679 {
680 case 0:
681 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
682 return false;
683
684 return true;
685 break;
686
687 case 1:
688 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
689 return false;
690
691 return true;
692 break;
693
694 case 2:
695 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
696 return false;
697
698 return true;
699 break;
700
701 case 3:
702 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
703 return false;
704
705 return true;
706 break;
707 }
708
709 return false;
710 }
711
712 override string GetDoorSelectionNameFromSeatPos(int posIdx)
713 {
714 switch (posIdx)
715 {
716 case 0:
717 return "doors_driver";
718 break;
719 case 1:
720 return "doors_codriver";
721 break;
722 case 2:
723 return "doors_cargo1";
724 break;
725 case 3:
726 return "doors_cargo2";
727 break;
728 }
729
730 return super.GetDoorSelectionNameFromSeatPos(posIdx);
731 }
732
733 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
734 {
735 switch (posIdx)
736 {
737 case 0:
738 return "Sedan_02_Door_1_1";
739 break;
740 case 1:
741 return "Sedan_02_Door_2_1";
742 break;
743 case 2:
744 return "Sedan_02_Door_1_2";
745 break;
746 case 3:
747 return "Sedan_02_Door_2_2";
748 break;
749 }
750
751 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
752 }
753
754 override float OnSound(CarSoundCtrl ctrl, float oldValue)
755 {
756 switch (ctrl)
757 {
758 case CarSoundCtrl.DOORS:
759 float newValue = 0;
760 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
761 newValue += 0.25;
762
763 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
764 newValue += 0.25;
765
766 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
767 newValue += 0.25;
768
769 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
770 newValue += 0.25;
771
772 return Math.Clamp(newValue, 0, 1);
773 break;
774 }
775
776 return super.OnSound(ctrl, oldValue);
777 }
778
779 override string GetAnimSourceFromSelection(string selection)
780 {
781 switch (selection)
782 {
783 case "doors_driver":
784 return "DoorsDriver";
785 case "doors_codriver":
786 return "DoorsCoDriver";
787 case "doors_cargo1":
788 return "DoorsCargo1";
789 case "doors_cargo2":
790 return "DoorsCargo2";
791 case "doors_hood":
792 return "DoorsHood";
793 case "doors_trunk":
794 return "DoorsTrunk";
795 }
796
797 return "";
798 }
799
800
801 override bool IsVitalTruckBattery()
802 {
803 return false;
804 }
805
806 override bool IsVitalGlowPlug()
807 {
808 return false;
809 }
810
811 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
812 {
813 switch (currentSeat)
814 {
815 case 0:
816 return nextSeat == 1;
817
818 case 1:
819 return nextSeat == 0;
820
821 case 2:
822 return nextSeat == 3;
823
824 case 3:
825 return nextSeat == 2;
826 }
827
828 return false;
829 }
830
831 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
832 {
833 switch (pCurrentSeat)
834 {
835 case 0:
836 return pDoorsSelection == "DoorsDriver";
837
838 case 1:
839 return pDoorsSelection == "DoorsCoDriver";
840
841 case 2:
842 return pDoorsSelection == "DoorsCargo1";
843
844 case 3:
845 return pDoorsSelection == "DoorsCargo2";
846 }
847
848 return false;
849 }
850
851 override void OnDebugSpawn()
852 {
856
857 GetInventory().CreateInInventory("Sedan_02_Wheel");
858 GetInventory().CreateInInventory("Sedan_02_Wheel");
859 GetInventory().CreateInInventory("Sedan_02_Wheel");
860 GetInventory().CreateInInventory("Sedan_02_Wheel");
861 GetInventory().CreateInInventory("Sedan_02_Wheel");
862
863 GetInventory().CreateInInventory("Sedan_02_Door_1_1");
864 GetInventory().CreateInInventory("Sedan_02_Door_1_2");
865 GetInventory().CreateInInventory("Sedan_02_Door_2_1");
866 GetInventory().CreateInInventory("Sedan_02_Door_2_2");
867 GetInventory().CreateInInventory("Sedan_02_Hood");
868 GetInventory().CreateInInventory("Sedan_02_Trunk");
869
870 //-----IN CAR CARGO
871 GetInventory().CreateInInventory("Sedan_02_Wheel");
872 GetInventory().CreateInInventory("Sedan_02_Wheel");
873 }
874}
875
876class Sedan_02_Red extends Sedan_02
877{
878 override void OnDebugSpawn()
879 {
883
884 GetInventory().CreateInInventory("Sedan_02_Wheel");
885 GetInventory().CreateInInventory("Sedan_02_Wheel");
886 GetInventory().CreateInInventory("Sedan_02_Wheel");
887 GetInventory().CreateInInventory("Sedan_02_Wheel");
888
889 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
890 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
891 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
892 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
893 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
894 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
895
896 //-----IN CAR CARGO
897 GetInventory().CreateInInventory("Sedan_02_Wheel");
898 GetInventory().CreateInInventory("Sedan_02_Wheel");
899 }
900}
901
902class Sedan_02_Grey extends Sedan_02
903{
904 override void OnDebugSpawn()
905 {
909
910 GetInventory().CreateInInventory("Sedan_02_Wheel");
911 GetInventory().CreateInInventory("Sedan_02_Wheel");
912 GetInventory().CreateInInventory("Sedan_02_Wheel");
913 GetInventory().CreateInInventory("Sedan_02_Wheel");
914
915 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
916 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
917 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
918 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
919 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");
920 GetInventory().CreateInInventory("Sedan_02_Trunk_Grey");
921
922 //-----IN CAR CARGO
923 GetInventory().CreateInInventory("Sedan_02_Wheel");
924 GetInventory().CreateInInventory("Sedan_02_Wheel");
925 }
926}

◆ IsVitalGlowPlug()

override bool OnDebugSpawn::IsVitalGlowPlug ( )
protected

Definition at line 732 of file Sedan_02.c.

733{
737
738 void Sedan_02()
739 {
740 m_dmgContactCoef = 0.0790;
741
742 m_EngineStartOK = "Sedan_02_engine_start_SoundSet";
743 m_EngineStartBattery = "Sedan_02_engine_failed_start_battery_SoundSet";
744 m_EngineStartPlug = "Sedan_02_engine_failed_start_sparkplugs_SoundSet";
745 m_EngineStartFuel = "Sedan_02_engine_failed_start_fuel_SoundSet";
746 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
747
748 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
749 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
750
751 m_CarHornShortSoundName = "Sedan_02_Horn_Short_SoundSet";
752 m_CarHornLongSoundName = "Sedan_02_Horn_SoundSet";
753
754 SetEnginePos("0 0.7 -1.7");
755 }
756
757 override void EEInit()
758 {
759 super.EEInit();
760
761 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
762 {
764 m_UTSSettings.m_ManualUpdate = true;
765 m_UTSSettings.m_TemperatureMin = 0;
766 m_UTSSettings.m_TemperatureMax = 30;
767 m_UTSSettings.m_RangeFull = 0.5;
768 m_UTSSettings.m_RangeMax = 2;
769 m_UTSSettings.m_TemperatureCap = 25;
770
773 }
774 }
775
776 override void OnEngineStart()
777 {
778 super.OnEngineStart();
779
780 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
781 m_UTSource.SetDefferedActive(true, 20.0);
782 }
783
784 override void OnEngineStop()
785 {
786 super.OnEngineStop();
787
788 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
789 m_UTSource.SetDefferedActive(false, 10.0);
790 }
791
792 override void EOnPostSimulate(IEntity other, float timeSlice)
793 {
794 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
795 {
796 if (m_UTSource.IsActive())
798 }
799 }
800
801 override int GetAnimInstance()
802 {
803 return VehicleAnimInstances.S120;
804 }
805
806 override int GetSeatAnimationType(int posIdx)
807 {
808 switch (posIdx)
809 {
810 case 0:
811 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
812 case 1:
813 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
814 case 2:
815 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
816 case 3:
817 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
818 }
819
820 return 0;
821 }
822
823 // Override for car-specific light type
825 {
826 return CarLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02FrontLight));
827 }
828
829 // Override for car-specific light type
831 {
832 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02RearLight));
833 }
834
836 {
837 if (!super.CanReleaseAttachment(attachment))
838 return false;
839
840 string attType = attachment.GetType();
841 switch (attType)
842 {
843 case "CarBattery":
844 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
845 return false;
846 break;
847
848 case "SparkPlug":
849 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
850 return false;
851 break;
852
853 case "CarRadiator":
854 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED || EngineIsOn())
855 return false;
856 break;
857 }
858
859 return true;
860 }
861
862 override protected bool CanManipulateSpareWheel(string slotSelectionName)
863 {
864 return GetCarDoorsState("Sedan_02_Hood") != CarDoorState.DOORS_CLOSED;
865 }
866
867 override bool CanDisplayAttachmentCategory(string category_name)
868 {
869 if (!super.CanDisplayAttachmentCategory(category_name))
870 return false;
871
872 category_name.ToLower();
873 if (category_name.Contains("engine"))
874 {
875 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED)
876 return false;
877 }
878
879 if (category_name.Contains("trunk"))
880 {
881 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
882 return false;
883 }
884
885 return true;
886 }
887
888 override bool CanDisplayCargo()
889 {
890 if (!super.CanDisplayCargo())
891 return false;
892
893 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
894 return false;
895
896 return true;
897 }
898
899 override int GetCarDoorsState(string slotType)
900 {
902
903 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
904 if (!carDoor)
905 return CarDoorState.DOORS_MISSING;
906
907 switch (slotType)
908 {
909 case "Sedan_02_Door_1_1":
910 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
911
912 case "Sedan_02_Door_2_1":
913 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
914
915 case "Sedan_02_Door_1_2":
916 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
917
918 case "Sedan_02_Door_2_2":
919 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
920
921 case "Sedan_02_Hood":
922 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
923
924 case "Sedan_02_Trunk":
925 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
926 }
927
928 return CarDoorState.DOORS_MISSING;
929 }
930
931
932 override bool CrewCanGetThrough(int posIdx)
933 {
934 switch (posIdx)
935 {
936 case 0:
937 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
938 return false;
939
940 return true;
941 break;
942
943 case 1:
944 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
945 return false;
946
947 return true;
948 break;
949
950 case 2:
951 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
952 return false;
953
954 return true;
955 break;
956
957 case 3:
958 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
959 return false;
960
961 return true;
962 break;
963 }
964
965 return false;
966 }
967
968 override string GetDoorSelectionNameFromSeatPos(int posIdx)
969 {
970 switch (posIdx)
971 {
972 case 0:
973 return "doors_driver";
974 break;
975 case 1:
976 return "doors_codriver";
977 break;
978 case 2:
979 return "doors_cargo1";
980 break;
981 case 3:
982 return "doors_cargo2";
983 break;
984 }
985
986 return super.GetDoorSelectionNameFromSeatPos(posIdx);
987 }
988
989 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
990 {
991 switch (posIdx)
992 {
993 case 0:
994 return "Sedan_02_Door_1_1";
995 break;
996 case 1:
997 return "Sedan_02_Door_2_1";
998 break;
999 case 2:
1000 return "Sedan_02_Door_1_2";
1001 break;
1002 case 3:
1003 return "Sedan_02_Door_2_2";
1004 break;
1005 }
1006
1007 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1008 }
1009
1010 override float OnSound(CarSoundCtrl ctrl, float oldValue)
1011 {
1012 switch (ctrl)
1013 {
1014 case CarSoundCtrl.DOORS:
1015 float newValue = 0;
1016 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
1017 newValue += 0.25;
1018
1019 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
1020 newValue += 0.25;
1021
1022 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
1023 newValue += 0.25;
1024
1025 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
1026 newValue += 0.25;
1027
1028 return Math.Clamp(newValue, 0, 1);
1029 break;
1030 }
1031
1032 return super.OnSound(ctrl, oldValue);
1033 }
1034
1035 override string GetAnimSourceFromSelection(string selection)
1036 {
1037 switch (selection)
1038 {
1039 case "doors_driver":
1040 return "DoorsDriver";
1041 case "doors_codriver":
1042 return "DoorsCoDriver";
1043 case "doors_cargo1":
1044 return "DoorsCargo1";
1045 case "doors_cargo2":
1046 return "DoorsCargo2";
1047 case "doors_hood":
1048 return "DoorsHood";
1049 case "doors_trunk":
1050 return "DoorsTrunk";
1051 }
1052
1053 return "";
1054 }
1055
1056
1057 override bool IsVitalTruckBattery()
1058 {
1059 return false;
1060 }
1061
1062 override bool IsVitalGlowPlug()
1063 {
1064 return false;
1065 }
1066
1067 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1068 {
1069 switch (currentSeat)
1070 {
1071 case 0:
1072 return nextSeat == 1;
1073
1074 case 1:
1075 return nextSeat == 0;
1076
1077 case 2:
1078 return nextSeat == 3;
1079
1080 case 3:
1081 return nextSeat == 2;
1082 }
1083
1084 return false;
1085 }
1086
1087 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
1088 {
1089 switch (pCurrentSeat)
1090 {
1091 case 0:
1092 return pDoorsSelection == "DoorsDriver";
1093
1094 case 1:
1095 return pDoorsSelection == "DoorsCoDriver";
1096
1097 case 2:
1098 return pDoorsSelection == "DoorsCargo1";
1099
1100 case 3:
1101 return pDoorsSelection == "DoorsCargo2";
1102 }
1103
1104 return false;
1105 }
1106
1107 override void OnDebugSpawn()
1108 {
1112
1113 GetInventory().CreateInInventory("Sedan_02_Wheel");
1114 GetInventory().CreateInInventory("Sedan_02_Wheel");
1115 GetInventory().CreateInInventory("Sedan_02_Wheel");
1116 GetInventory().CreateInInventory("Sedan_02_Wheel");
1117 GetInventory().CreateInInventory("Sedan_02_Wheel");
1118
1119 GetInventory().CreateInInventory("Sedan_02_Door_1_1");
1120 GetInventory().CreateInInventory("Sedan_02_Door_1_2");
1121 GetInventory().CreateInInventory("Sedan_02_Door_2_1");
1122 GetInventory().CreateInInventory("Sedan_02_Door_2_2");
1123 GetInventory().CreateInInventory("Sedan_02_Hood");
1124 GetInventory().CreateInInventory("Sedan_02_Trunk");
1125
1126 //-----IN CAR CARGO
1127 GetInventory().CreateInInventory("Sedan_02_Wheel");
1128 GetInventory().CreateInInventory("Sedan_02_Wheel");
1129 }
1130}
1131
1132class Sedan_02_Red extends Sedan_02
1133{
1134 override void OnDebugSpawn()
1135 {
1139
1140 GetInventory().CreateInInventory("Sedan_02_Wheel");
1141 GetInventory().CreateInInventory("Sedan_02_Wheel");
1142 GetInventory().CreateInInventory("Sedan_02_Wheel");
1143 GetInventory().CreateInInventory("Sedan_02_Wheel");
1144
1145 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
1146 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
1147 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
1148 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
1149 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
1150 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
1151
1152 //-----IN CAR CARGO
1153 GetInventory().CreateInInventory("Sedan_02_Wheel");
1154 GetInventory().CreateInInventory("Sedan_02_Wheel");
1155 }
1156}
1157
1158class Sedan_02_Grey extends Sedan_02
1159{
1160 override void OnDebugSpawn()
1161 {
1165
1166 GetInventory().CreateInInventory("Sedan_02_Wheel");
1167 GetInventory().CreateInInventory("Sedan_02_Wheel");
1168 GetInventory().CreateInInventory("Sedan_02_Wheel");
1169 GetInventory().CreateInInventory("Sedan_02_Wheel");
1170
1171 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
1172 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
1173 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
1174 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
1175 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");
1176 GetInventory().CreateInInventory("Sedan_02_Trunk_Grey");
1177
1178 //-----IN CAR CARGO
1179 GetInventory().CreateInInventory("Sedan_02_Wheel");
1180 GetInventory().CreateInInventory("Sedan_02_Wheel");
1181 }
1182}

◆ IsVitalTruckBattery()

override bool OnDebugSpawn::IsVitalTruckBattery ( )
protected

Definition at line 727 of file Sedan_02.c.

728{
732
733 void Sedan_02()
734 {
735 m_dmgContactCoef = 0.0790;
736
737 m_EngineStartOK = "Sedan_02_engine_start_SoundSet";
738 m_EngineStartBattery = "Sedan_02_engine_failed_start_battery_SoundSet";
739 m_EngineStartPlug = "Sedan_02_engine_failed_start_sparkplugs_SoundSet";
740 m_EngineStartFuel = "Sedan_02_engine_failed_start_fuel_SoundSet";
741 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
742
743 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
744 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
745
746 m_CarHornShortSoundName = "Sedan_02_Horn_Short_SoundSet";
747 m_CarHornLongSoundName = "Sedan_02_Horn_SoundSet";
748
749 SetEnginePos("0 0.7 -1.7");
750 }
751
752 override void EEInit()
753 {
754 super.EEInit();
755
756 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
757 {
759 m_UTSSettings.m_ManualUpdate = true;
760 m_UTSSettings.m_TemperatureMin = 0;
761 m_UTSSettings.m_TemperatureMax = 30;
762 m_UTSSettings.m_RangeFull = 0.5;
763 m_UTSSettings.m_RangeMax = 2;
764 m_UTSSettings.m_TemperatureCap = 25;
765
768 }
769 }
770
771 override void OnEngineStart()
772 {
773 super.OnEngineStart();
774
775 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
776 m_UTSource.SetDefferedActive(true, 20.0);
777 }
778
779 override void OnEngineStop()
780 {
781 super.OnEngineStop();
782
783 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
784 m_UTSource.SetDefferedActive(false, 10.0);
785 }
786
787 override void EOnPostSimulate(IEntity other, float timeSlice)
788 {
789 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
790 {
791 if (m_UTSource.IsActive())
793 }
794 }
795
796 override int GetAnimInstance()
797 {
798 return VehicleAnimInstances.S120;
799 }
800
801 override int GetSeatAnimationType(int posIdx)
802 {
803 switch (posIdx)
804 {
805 case 0:
806 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
807 case 1:
808 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
809 case 2:
810 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
811 case 3:
812 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
813 }
814
815 return 0;
816 }
817
818 // Override for car-specific light type
820 {
821 return CarLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02FrontLight));
822 }
823
824 // Override for car-specific light type
826 {
827 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02RearLight));
828 }
829
831 {
832 if (!super.CanReleaseAttachment(attachment))
833 return false;
834
835 string attType = attachment.GetType();
836 switch (attType)
837 {
838 case "CarBattery":
839 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
840 return false;
841 break;
842
843 case "SparkPlug":
844 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
845 return false;
846 break;
847
848 case "CarRadiator":
849 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED || EngineIsOn())
850 return false;
851 break;
852 }
853
854 return true;
855 }
856
857 override protected bool CanManipulateSpareWheel(string slotSelectionName)
858 {
859 return GetCarDoorsState("Sedan_02_Hood") != CarDoorState.DOORS_CLOSED;
860 }
861
862 override bool CanDisplayAttachmentCategory(string category_name)
863 {
864 if (!super.CanDisplayAttachmentCategory(category_name))
865 return false;
866
867 category_name.ToLower();
868 if (category_name.Contains("engine"))
869 {
870 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED)
871 return false;
872 }
873
874 if (category_name.Contains("trunk"))
875 {
876 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
877 return false;
878 }
879
880 return true;
881 }
882
883 override bool CanDisplayCargo()
884 {
885 if (!super.CanDisplayCargo())
886 return false;
887
888 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
889 return false;
890
891 return true;
892 }
893
894 override int GetCarDoorsState(string slotType)
895 {
897
898 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
899 if (!carDoor)
900 return CarDoorState.DOORS_MISSING;
901
902 switch (slotType)
903 {
904 case "Sedan_02_Door_1_1":
905 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
906
907 case "Sedan_02_Door_2_1":
908 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
909
910 case "Sedan_02_Door_1_2":
911 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
912
913 case "Sedan_02_Door_2_2":
914 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
915
916 case "Sedan_02_Hood":
917 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
918
919 case "Sedan_02_Trunk":
920 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
921 }
922
923 return CarDoorState.DOORS_MISSING;
924 }
925
926
927 override bool CrewCanGetThrough(int posIdx)
928 {
929 switch (posIdx)
930 {
931 case 0:
932 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
933 return false;
934
935 return true;
936 break;
937
938 case 1:
939 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
940 return false;
941
942 return true;
943 break;
944
945 case 2:
946 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
947 return false;
948
949 return true;
950 break;
951
952 case 3:
953 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
954 return false;
955
956 return true;
957 break;
958 }
959
960 return false;
961 }
962
963 override string GetDoorSelectionNameFromSeatPos(int posIdx)
964 {
965 switch (posIdx)
966 {
967 case 0:
968 return "doors_driver";
969 break;
970 case 1:
971 return "doors_codriver";
972 break;
973 case 2:
974 return "doors_cargo1";
975 break;
976 case 3:
977 return "doors_cargo2";
978 break;
979 }
980
981 return super.GetDoorSelectionNameFromSeatPos(posIdx);
982 }
983
984 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
985 {
986 switch (posIdx)
987 {
988 case 0:
989 return "Sedan_02_Door_1_1";
990 break;
991 case 1:
992 return "Sedan_02_Door_2_1";
993 break;
994 case 2:
995 return "Sedan_02_Door_1_2";
996 break;
997 case 3:
998 return "Sedan_02_Door_2_2";
999 break;
1000 }
1001
1002 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1003 }
1004
1005 override float OnSound(CarSoundCtrl ctrl, float oldValue)
1006 {
1007 switch (ctrl)
1008 {
1009 case CarSoundCtrl.DOORS:
1010 float newValue = 0;
1011 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
1012 newValue += 0.25;
1013
1014 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
1015 newValue += 0.25;
1016
1017 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
1018 newValue += 0.25;
1019
1020 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
1021 newValue += 0.25;
1022
1023 return Math.Clamp(newValue, 0, 1);
1024 break;
1025 }
1026
1027 return super.OnSound(ctrl, oldValue);
1028 }
1029
1030 override string GetAnimSourceFromSelection(string selection)
1031 {
1032 switch (selection)
1033 {
1034 case "doors_driver":
1035 return "DoorsDriver";
1036 case "doors_codriver":
1037 return "DoorsCoDriver";
1038 case "doors_cargo1":
1039 return "DoorsCargo1";
1040 case "doors_cargo2":
1041 return "DoorsCargo2";
1042 case "doors_hood":
1043 return "DoorsHood";
1044 case "doors_trunk":
1045 return "DoorsTrunk";
1046 }
1047
1048 return "";
1049 }
1050
1051
1052 override bool IsVitalTruckBattery()
1053 {
1054 return false;
1055 }
1056
1057 override bool IsVitalGlowPlug()
1058 {
1059 return false;
1060 }
1061
1062 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1063 {
1064 switch (currentSeat)
1065 {
1066 case 0:
1067 return nextSeat == 1;
1068
1069 case 1:
1070 return nextSeat == 0;
1071
1072 case 2:
1073 return nextSeat == 3;
1074
1075 case 3:
1076 return nextSeat == 2;
1077 }
1078
1079 return false;
1080 }
1081
1082 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
1083 {
1084 switch (pCurrentSeat)
1085 {
1086 case 0:
1087 return pDoorsSelection == "DoorsDriver";
1088
1089 case 1:
1090 return pDoorsSelection == "DoorsCoDriver";
1091
1092 case 2:
1093 return pDoorsSelection == "DoorsCargo1";
1094
1095 case 3:
1096 return pDoorsSelection == "DoorsCargo2";
1097 }
1098
1099 return false;
1100 }
1101
1102 override void OnDebugSpawn()
1103 {
1107
1108 GetInventory().CreateInInventory("Sedan_02_Wheel");
1109 GetInventory().CreateInInventory("Sedan_02_Wheel");
1110 GetInventory().CreateInInventory("Sedan_02_Wheel");
1111 GetInventory().CreateInInventory("Sedan_02_Wheel");
1112 GetInventory().CreateInInventory("Sedan_02_Wheel");
1113
1114 GetInventory().CreateInInventory("Sedan_02_Door_1_1");
1115 GetInventory().CreateInInventory("Sedan_02_Door_1_2");
1116 GetInventory().CreateInInventory("Sedan_02_Door_2_1");
1117 GetInventory().CreateInInventory("Sedan_02_Door_2_2");
1118 GetInventory().CreateInInventory("Sedan_02_Hood");
1119 GetInventory().CreateInInventory("Sedan_02_Trunk");
1120
1121 //-----IN CAR CARGO
1122 GetInventory().CreateInInventory("Sedan_02_Wheel");
1123 GetInventory().CreateInInventory("Sedan_02_Wheel");
1124 }
1125}
1126
1127class Sedan_02_Red extends Sedan_02
1128{
1129 override void OnDebugSpawn()
1130 {
1134
1135 GetInventory().CreateInInventory("Sedan_02_Wheel");
1136 GetInventory().CreateInInventory("Sedan_02_Wheel");
1137 GetInventory().CreateInInventory("Sedan_02_Wheel");
1138 GetInventory().CreateInInventory("Sedan_02_Wheel");
1139
1140 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
1141 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
1142 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
1143 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
1144 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
1145 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
1146
1147 //-----IN CAR CARGO
1148 GetInventory().CreateInInventory("Sedan_02_Wheel");
1149 GetInventory().CreateInInventory("Sedan_02_Wheel");
1150 }
1151}
1152
1153class Sedan_02_Grey extends Sedan_02
1154{
1155 override void OnDebugSpawn()
1156 {
1160
1161 GetInventory().CreateInInventory("Sedan_02_Wheel");
1162 GetInventory().CreateInInventory("Sedan_02_Wheel");
1163 GetInventory().CreateInInventory("Sedan_02_Wheel");
1164 GetInventory().CreateInInventory("Sedan_02_Wheel");
1165
1166 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
1167 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
1168 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
1169 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
1170 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");
1171 GetInventory().CreateInInventory("Sedan_02_Trunk_Grey");
1172
1173 //-----IN CAR CARGO
1174 GetInventory().CreateInInventory("Sedan_02_Wheel");
1175 GetInventory().CreateInInventory("Sedan_02_Wheel");
1176 }
1177}

◆ OnDebugSpawn()

class Sedan_02 extends CarScript OnDebugSpawn ( )

Definition at line 1 of file Sedan_02.c.

404 {
408
409 GetInventory().CreateInInventory("Sedan_02_Wheel");
410 GetInventory().CreateInInventory("Sedan_02_Wheel");
411 GetInventory().CreateInInventory("Sedan_02_Wheel");
412 GetInventory().CreateInInventory("Sedan_02_Wheel");
413
414 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
415 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
416 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
417 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
418 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
419 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
420
421 //-----IN CAR CARGO
422 GetInventory().CreateInInventory("Sedan_02_Wheel");
423 GetInventory().CreateInInventory("Sedan_02_Wheel");
424 }

References m_UTSLEngine, m_UTSource, and m_UTSSettings.

◆ OnEngineStart()

override void OnDebugSpawn::OnEngineStart ( )
protected

Definition at line 446 of file Sedan_02.c.

◆ OnEngineStop()

override void OnDebugSpawn::OnEngineStop ( )
protected

Definition at line 454 of file Sedan_02.c.

455{
459
460 void Sedan_02()
461 {
462 m_dmgContactCoef = 0.0790;
463
464 m_EngineStartOK = "Sedan_02_engine_start_SoundSet";
465 m_EngineStartBattery = "Sedan_02_engine_failed_start_battery_SoundSet";
466 m_EngineStartPlug = "Sedan_02_engine_failed_start_sparkplugs_SoundSet";
467 m_EngineStartFuel = "Sedan_02_engine_failed_start_fuel_SoundSet";
468 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
469
470 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
471 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
472
473 m_CarHornShortSoundName = "Sedan_02_Horn_Short_SoundSet";
474 m_CarHornLongSoundName = "Sedan_02_Horn_SoundSet";
475
476 SetEnginePos("0 0.7 -1.7");
477 }
478
479 override void EEInit()
480 {
481 super.EEInit();
482
483 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
484 {
486 m_UTSSettings.m_ManualUpdate = true;
487 m_UTSSettings.m_TemperatureMin = 0;
488 m_UTSSettings.m_TemperatureMax = 30;
489 m_UTSSettings.m_RangeFull = 0.5;
490 m_UTSSettings.m_RangeMax = 2;
491 m_UTSSettings.m_TemperatureCap = 25;
492
495 }
496 }
497
498 override void OnEngineStart()
499 {
500 super.OnEngineStart();
501
502 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
503 m_UTSource.SetDefferedActive(true, 20.0);
504 }
505
506 override void OnEngineStop()
507 {
508 super.OnEngineStop();
509
510 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
511 m_UTSource.SetDefferedActive(false, 10.0);
512 }
513
514 override void EOnPostSimulate(IEntity other, float timeSlice)
515 {
516 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
517 {
518 if (m_UTSource.IsActive())
520 }
521 }
522
523 override int GetAnimInstance()
524 {
525 return VehicleAnimInstances.S120;
526 }
527
528 override int GetSeatAnimationType(int posIdx)
529 {
530 switch (posIdx)
531 {
532 case 0:
533 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
534 case 1:
535 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
536 case 2:
537 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
538 case 3:
539 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
540 }
541
542 return 0;
543 }
544
545 // Override for car-specific light type
547 {
548 return CarLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02FrontLight));
549 }
550
551 // Override for car-specific light type
553 {
554 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02RearLight));
555 }
556
558 {
559 if (!super.CanReleaseAttachment(attachment))
560 return false;
561
562 string attType = attachment.GetType();
563 switch (attType)
564 {
565 case "CarBattery":
566 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
567 return false;
568 break;
569
570 case "SparkPlug":
571 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
572 return false;
573 break;
574
575 case "CarRadiator":
576 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED || EngineIsOn())
577 return false;
578 break;
579 }
580
581 return true;
582 }
583
584 override protected bool CanManipulateSpareWheel(string slotSelectionName)
585 {
586 return GetCarDoorsState("Sedan_02_Hood") != CarDoorState.DOORS_CLOSED;
587 }
588
589 override bool CanDisplayAttachmentCategory(string category_name)
590 {
591 if (!super.CanDisplayAttachmentCategory(category_name))
592 return false;
593
594 category_name.ToLower();
595 if (category_name.Contains("engine"))
596 {
597 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED)
598 return false;
599 }
600
601 if (category_name.Contains("trunk"))
602 {
603 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
604 return false;
605 }
606
607 return true;
608 }
609
610 override bool CanDisplayCargo()
611 {
612 if (!super.CanDisplayCargo())
613 return false;
614
615 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
616 return false;
617
618 return true;
619 }
620
621 override int GetCarDoorsState(string slotType)
622 {
624
625 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
626 if (!carDoor)
627 return CarDoorState.DOORS_MISSING;
628
629 switch (slotType)
630 {
631 case "Sedan_02_Door_1_1":
632 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
633
634 case "Sedan_02_Door_2_1":
635 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
636
637 case "Sedan_02_Door_1_2":
638 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
639
640 case "Sedan_02_Door_2_2":
641 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
642
643 case "Sedan_02_Hood":
644 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
645
646 case "Sedan_02_Trunk":
647 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
648 }
649
650 return CarDoorState.DOORS_MISSING;
651 }
652
653
654 override bool CrewCanGetThrough(int posIdx)
655 {
656 switch (posIdx)
657 {
658 case 0:
659 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
660 return false;
661
662 return true;
663 break;
664
665 case 1:
666 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
667 return false;
668
669 return true;
670 break;
671
672 case 2:
673 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
674 return false;
675
676 return true;
677 break;
678
679 case 3:
680 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
681 return false;
682
683 return true;
684 break;
685 }
686
687 return false;
688 }
689
690 override string GetDoorSelectionNameFromSeatPos(int posIdx)
691 {
692 switch (posIdx)
693 {
694 case 0:
695 return "doors_driver";
696 break;
697 case 1:
698 return "doors_codriver";
699 break;
700 case 2:
701 return "doors_cargo1";
702 break;
703 case 3:
704 return "doors_cargo2";
705 break;
706 }
707
708 return super.GetDoorSelectionNameFromSeatPos(posIdx);
709 }
710
711 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
712 {
713 switch (posIdx)
714 {
715 case 0:
716 return "Sedan_02_Door_1_1";
717 break;
718 case 1:
719 return "Sedan_02_Door_2_1";
720 break;
721 case 2:
722 return "Sedan_02_Door_1_2";
723 break;
724 case 3:
725 return "Sedan_02_Door_2_2";
726 break;
727 }
728
729 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
730 }
731
732 override float OnSound(CarSoundCtrl ctrl, float oldValue)
733 {
734 switch (ctrl)
735 {
736 case CarSoundCtrl.DOORS:
737 float newValue = 0;
738 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
739 newValue += 0.25;
740
741 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
742 newValue += 0.25;
743
744 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
745 newValue += 0.25;
746
747 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
748 newValue += 0.25;
749
750 return Math.Clamp(newValue, 0, 1);
751 break;
752 }
753
754 return super.OnSound(ctrl, oldValue);
755 }
756
757 override string GetAnimSourceFromSelection(string selection)
758 {
759 switch (selection)
760 {
761 case "doors_driver":
762 return "DoorsDriver";
763 case "doors_codriver":
764 return "DoorsCoDriver";
765 case "doors_cargo1":
766 return "DoorsCargo1";
767 case "doors_cargo2":
768 return "DoorsCargo2";
769 case "doors_hood":
770 return "DoorsHood";
771 case "doors_trunk":
772 return "DoorsTrunk";
773 }
774
775 return "";
776 }
777
778
779 override bool IsVitalTruckBattery()
780 {
781 return false;
782 }
783
784 override bool IsVitalGlowPlug()
785 {
786 return false;
787 }
788
789 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
790 {
791 switch (currentSeat)
792 {
793 case 0:
794 return nextSeat == 1;
795
796 case 1:
797 return nextSeat == 0;
798
799 case 2:
800 return nextSeat == 3;
801
802 case 3:
803 return nextSeat == 2;
804 }
805
806 return false;
807 }
808
809 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
810 {
811 switch (pCurrentSeat)
812 {
813 case 0:
814 return pDoorsSelection == "DoorsDriver";
815
816 case 1:
817 return pDoorsSelection == "DoorsCoDriver";
818
819 case 2:
820 return pDoorsSelection == "DoorsCargo1";
821
822 case 3:
823 return pDoorsSelection == "DoorsCargo2";
824 }
825
826 return false;
827 }
828
829 override void OnDebugSpawn()
830 {
834
835 GetInventory().CreateInInventory("Sedan_02_Wheel");
836 GetInventory().CreateInInventory("Sedan_02_Wheel");
837 GetInventory().CreateInInventory("Sedan_02_Wheel");
838 GetInventory().CreateInInventory("Sedan_02_Wheel");
839 GetInventory().CreateInInventory("Sedan_02_Wheel");
840
841 GetInventory().CreateInInventory("Sedan_02_Door_1_1");
842 GetInventory().CreateInInventory("Sedan_02_Door_1_2");
843 GetInventory().CreateInInventory("Sedan_02_Door_2_1");
844 GetInventory().CreateInInventory("Sedan_02_Door_2_2");
845 GetInventory().CreateInInventory("Sedan_02_Hood");
846 GetInventory().CreateInInventory("Sedan_02_Trunk");
847
848 //-----IN CAR CARGO
849 GetInventory().CreateInInventory("Sedan_02_Wheel");
850 GetInventory().CreateInInventory("Sedan_02_Wheel");
851 }
852}
853
854class Sedan_02_Red extends Sedan_02
855{
856 override void OnDebugSpawn()
857 {
861
862 GetInventory().CreateInInventory("Sedan_02_Wheel");
863 GetInventory().CreateInInventory("Sedan_02_Wheel");
864 GetInventory().CreateInInventory("Sedan_02_Wheel");
865 GetInventory().CreateInInventory("Sedan_02_Wheel");
866
867 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
868 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
869 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
870 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
871 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
872 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
873
874 //-----IN CAR CARGO
875 GetInventory().CreateInInventory("Sedan_02_Wheel");
876 GetInventory().CreateInInventory("Sedan_02_Wheel");
877 }
878}
879
880class Sedan_02_Grey extends Sedan_02
881{
882 override void OnDebugSpawn()
883 {
887
888 GetInventory().CreateInInventory("Sedan_02_Wheel");
889 GetInventory().CreateInInventory("Sedan_02_Wheel");
890 GetInventory().CreateInInventory("Sedan_02_Wheel");
891 GetInventory().CreateInInventory("Sedan_02_Wheel");
892
893 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
894 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
895 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
896 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
897 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");
898 GetInventory().CreateInInventory("Sedan_02_Trunk_Grey");
899
900 //-----IN CAR CARGO
901 GetInventory().CreateInInventory("Sedan_02_Wheel");
902 GetInventory().CreateInInventory("Sedan_02_Wheel");
903 }
904}

◆ OnSound()

override float OnDebugSpawn::OnSound ( CarSoundCtrl ctrl,
float oldValue )
protected

Definition at line 680 of file Sedan_02.c.

681{
685
686 void Sedan_02()
687 {
688 m_dmgContactCoef = 0.0790;
689
690 m_EngineStartOK = "Sedan_02_engine_start_SoundSet";
691 m_EngineStartBattery = "Sedan_02_engine_failed_start_battery_SoundSet";
692 m_EngineStartPlug = "Sedan_02_engine_failed_start_sparkplugs_SoundSet";
693 m_EngineStartFuel = "Sedan_02_engine_failed_start_fuel_SoundSet";
694 m_EngineStopFuel = "offroad_engine_stop_fuel_SoundSet";
695
696 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
697 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
698
699 m_CarHornShortSoundName = "Sedan_02_Horn_Short_SoundSet";
700 m_CarHornLongSoundName = "Sedan_02_Horn_SoundSet";
701
702 SetEnginePos("0 0.7 -1.7");
703 }
704
705 override void EEInit()
706 {
707 super.EEInit();
708
709 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
710 {
712 m_UTSSettings.m_ManualUpdate = true;
713 m_UTSSettings.m_TemperatureMin = 0;
714 m_UTSSettings.m_TemperatureMax = 30;
715 m_UTSSettings.m_RangeFull = 0.5;
716 m_UTSSettings.m_RangeMax = 2;
717 m_UTSSettings.m_TemperatureCap = 25;
718
721 }
722 }
723
724 override void OnEngineStart()
725 {
726 super.OnEngineStart();
727
728 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
729 m_UTSource.SetDefferedActive(true, 20.0);
730 }
731
732 override void OnEngineStop()
733 {
734 super.OnEngineStop();
735
736 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
737 m_UTSource.SetDefferedActive(false, 10.0);
738 }
739
740 override void EOnPostSimulate(IEntity other, float timeSlice)
741 {
742 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
743 {
744 if (m_UTSource.IsActive())
746 }
747 }
748
749 override int GetAnimInstance()
750 {
751 return VehicleAnimInstances.S120;
752 }
753
754 override int GetSeatAnimationType(int posIdx)
755 {
756 switch (posIdx)
757 {
758 case 0:
759 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
760 case 1:
761 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
762 case 2:
763 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
764 case 3:
765 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
766 }
767
768 return 0;
769 }
770
771 // Override for car-specific light type
773 {
774 return CarLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02FrontLight));
775 }
776
777 // Override for car-specific light type
779 {
780 return CarRearLightBase.Cast(ScriptedLightBase.CreateLight(Sedan_02RearLight));
781 }
782
784 {
785 if (!super.CanReleaseAttachment(attachment))
786 return false;
787
788 string attType = attachment.GetType();
789 switch (attType)
790 {
791 case "CarBattery":
792 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
793 return false;
794 break;
795
796 case "SparkPlug":
797 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED || EngineIsOn())
798 return false;
799 break;
800
801 case "CarRadiator":
802 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED || EngineIsOn())
803 return false;
804 break;
805 }
806
807 return true;
808 }
809
810 override protected bool CanManipulateSpareWheel(string slotSelectionName)
811 {
812 return GetCarDoorsState("Sedan_02_Hood") != CarDoorState.DOORS_CLOSED;
813 }
814
815 override bool CanDisplayAttachmentCategory(string category_name)
816 {
817 if (!super.CanDisplayAttachmentCategory(category_name))
818 return false;
819
820 category_name.ToLower();
821 if (category_name.Contains("engine"))
822 {
823 if (GetCarDoorsState("Sedan_02_Trunk") == CarDoorState.DOORS_CLOSED)
824 return false;
825 }
826
827 if (category_name.Contains("trunk"))
828 {
829 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
830 return false;
831 }
832
833 return true;
834 }
835
836 override bool CanDisplayCargo()
837 {
838 if (!super.CanDisplayCargo())
839 return false;
840
841 if (GetCarDoorsState("Sedan_02_Hood") == CarDoorState.DOORS_CLOSED)
842 return false;
843
844 return true;
845 }
846
847 override int GetCarDoorsState(string slotType)
848 {
850
851 Class.CastTo(carDoor, FindAttachmentBySlotName(slotType));
852 if (!carDoor)
853 return CarDoorState.DOORS_MISSING;
854
855 switch (slotType)
856 {
857 case "Sedan_02_Door_1_1":
858 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
859
860 case "Sedan_02_Door_2_1":
861 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
862
863 case "Sedan_02_Door_1_2":
864 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
865
866 case "Sedan_02_Door_2_2":
867 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
868
869 case "Sedan_02_Hood":
870 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
871
872 case "Sedan_02_Trunk":
873 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
874 }
875
876 return CarDoorState.DOORS_MISSING;
877 }
878
879
880 override bool CrewCanGetThrough(int posIdx)
881 {
882 switch (posIdx)
883 {
884 case 0:
885 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
886 return false;
887
888 return true;
889 break;
890
891 case 1:
892 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
893 return false;
894
895 return true;
896 break;
897
898 case 2:
899 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
900 return false;
901
902 return true;
903 break;
904
905 case 3:
906 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
907 return false;
908
909 return true;
910 break;
911 }
912
913 return false;
914 }
915
916 override string GetDoorSelectionNameFromSeatPos(int posIdx)
917 {
918 switch (posIdx)
919 {
920 case 0:
921 return "doors_driver";
922 break;
923 case 1:
924 return "doors_codriver";
925 break;
926 case 2:
927 return "doors_cargo1";
928 break;
929 case 3:
930 return "doors_cargo2";
931 break;
932 }
933
934 return super.GetDoorSelectionNameFromSeatPos(posIdx);
935 }
936
937 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
938 {
939 switch (posIdx)
940 {
941 case 0:
942 return "Sedan_02_Door_1_1";
943 break;
944 case 1:
945 return "Sedan_02_Door_2_1";
946 break;
947 case 2:
948 return "Sedan_02_Door_1_2";
949 break;
950 case 3:
951 return "Sedan_02_Door_2_2";
952 break;
953 }
954
955 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
956 }
957
958 override float OnSound(CarSoundCtrl ctrl, float oldValue)
959 {
960 switch (ctrl)
961 {
962 case CarSoundCtrl.DOORS:
963 float newValue = 0;
964 if (GetCarDoorsState("Sedan_02_Door_1_1") == CarDoorState.DOORS_CLOSED)
965 newValue += 0.25;
966
967 if (GetCarDoorsState("Sedan_02_Door_2_1") == CarDoorState.DOORS_CLOSED)
968 newValue += 0.25;
969
970 if (GetCarDoorsState("Sedan_02_Door_1_2") == CarDoorState.DOORS_CLOSED)
971 newValue += 0.25;
972
973 if (GetCarDoorsState("Sedan_02_Door_2_2") == CarDoorState.DOORS_CLOSED)
974 newValue += 0.25;
975
976 return Math.Clamp(newValue, 0, 1);
977 break;
978 }
979
980 return super.OnSound(ctrl, oldValue);
981 }
982
983 override string GetAnimSourceFromSelection(string selection)
984 {
985 switch (selection)
986 {
987 case "doors_driver":
988 return "DoorsDriver";
989 case "doors_codriver":
990 return "DoorsCoDriver";
991 case "doors_cargo1":
992 return "DoorsCargo1";
993 case "doors_cargo2":
994 return "DoorsCargo2";
995 case "doors_hood":
996 return "DoorsHood";
997 case "doors_trunk":
998 return "DoorsTrunk";
999 }
1000
1001 return "";
1002 }
1003
1004
1005 override bool IsVitalTruckBattery()
1006 {
1007 return false;
1008 }
1009
1010 override bool IsVitalGlowPlug()
1011 {
1012 return false;
1013 }
1014
1015 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1016 {
1017 switch (currentSeat)
1018 {
1019 case 0:
1020 return nextSeat == 1;
1021
1022 case 1:
1023 return nextSeat == 0;
1024
1025 case 2:
1026 return nextSeat == 3;
1027
1028 case 3:
1029 return nextSeat == 2;
1030 }
1031
1032 return false;
1033 }
1034
1035 override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
1036 {
1037 switch (pCurrentSeat)
1038 {
1039 case 0:
1040 return pDoorsSelection == "DoorsDriver";
1041
1042 case 1:
1043 return pDoorsSelection == "DoorsCoDriver";
1044
1045 case 2:
1046 return pDoorsSelection == "DoorsCargo1";
1047
1048 case 3:
1049 return pDoorsSelection == "DoorsCargo2";
1050 }
1051
1052 return false;
1053 }
1054
1055 override void OnDebugSpawn()
1056 {
1060
1061 GetInventory().CreateInInventory("Sedan_02_Wheel");
1062 GetInventory().CreateInInventory("Sedan_02_Wheel");
1063 GetInventory().CreateInInventory("Sedan_02_Wheel");
1064 GetInventory().CreateInInventory("Sedan_02_Wheel");
1065 GetInventory().CreateInInventory("Sedan_02_Wheel");
1066
1067 GetInventory().CreateInInventory("Sedan_02_Door_1_1");
1068 GetInventory().CreateInInventory("Sedan_02_Door_1_2");
1069 GetInventory().CreateInInventory("Sedan_02_Door_2_1");
1070 GetInventory().CreateInInventory("Sedan_02_Door_2_2");
1071 GetInventory().CreateInInventory("Sedan_02_Hood");
1072 GetInventory().CreateInInventory("Sedan_02_Trunk");
1073
1074 //-----IN CAR CARGO
1075 GetInventory().CreateInInventory("Sedan_02_Wheel");
1076 GetInventory().CreateInInventory("Sedan_02_Wheel");
1077 }
1078}
1079
1080class Sedan_02_Red extends Sedan_02
1081{
1082 override void OnDebugSpawn()
1083 {
1087
1088 GetInventory().CreateInInventory("Sedan_02_Wheel");
1089 GetInventory().CreateInInventory("Sedan_02_Wheel");
1090 GetInventory().CreateInInventory("Sedan_02_Wheel");
1091 GetInventory().CreateInInventory("Sedan_02_Wheel");
1092
1093 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Red");
1094 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Red");
1095 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Red");
1096 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Red");
1097 GetInventory().CreateInInventory("Sedan_02_Hood_Red");
1098 GetInventory().CreateInInventory("Sedan_02_Trunk_Red");
1099
1100 //-----IN CAR CARGO
1101 GetInventory().CreateInInventory("Sedan_02_Wheel");
1102 GetInventory().CreateInInventory("Sedan_02_Wheel");
1103 }
1104}
1105
1106class Sedan_02_Grey extends Sedan_02
1107{
1108 override void OnDebugSpawn()
1109 {
1113
1114 GetInventory().CreateInInventory("Sedan_02_Wheel");
1115 GetInventory().CreateInInventory("Sedan_02_Wheel");
1116 GetInventory().CreateInInventory("Sedan_02_Wheel");
1117 GetInventory().CreateInInventory("Sedan_02_Wheel");
1118
1119 GetInventory().CreateInInventory("Sedan_02_Door_1_1_Grey");
1120 GetInventory().CreateInInventory("Sedan_02_Door_1_2_Grey");
1121 GetInventory().CreateInInventory("Sedan_02_Door_2_1_Grey");
1122 GetInventory().CreateInInventory("Sedan_02_Door_2_2_Grey");
1123 GetInventory().CreateInInventory("Sedan_02_Hood_Grey");
1124 GetInventory().CreateInInventory("Sedan_02_Trunk_Grey");
1125
1126 //-----IN CAR CARGO
1127 GetInventory().CreateInInventory("Sedan_02_Wheel");
1128 GetInventory().CreateInInventory("Sedan_02_Wheel");
1129 }
1130}

◆ Sedan_02()

void OnDebugSpawn::Sedan_02 ( )
protected

Definition at line 408 of file Sedan_02.c.

Variable Documentation

◆ m_UTSLEngine

Definition at line 406 of file Sedan_02.c.

Referenced by CarScript::EEInit(), CarScript::EOnPostSimulate(), and OnDebugSpawn().

◆ m_UTSource

◆ m_UTSSettings

ref UniversalTemperatureSourceSettings m_UTSSettings
protected

Definition at line 405 of file Sedan_02.c.

Referenced by CarScript::EEInit(), CarScript::EOnPostSimulate(), and OnDebugSpawn().