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

◆ CreateFrontLight()

override CarLightBase OnDebugSpawn::CreateFrontLight ( )
protected

См. определение в файле CivilianSedan.c строка 532

533{
537
538 void CivilianSedan()
539 {
540 //m_dmgContactCoef = 0.065;
541
542 m_EngineStartOK = "CivilianSedan_engine_start_SoundSet";
543 m_EngineStartBattery = "CivilianSedan_engine_failed_start_battery_SoundSet";
544 m_EngineStartPlug = "CivilianSedan_engine_failed_start_sparkplugs_SoundSet";
545 m_EngineStartFuel = "CivilianSedan_engine_failed_start_fuel_SoundSet";
546 m_EngineStop = "CivilianSedan_engine_stop_SoundSet";
547 m_EngineStopFuel = "CivilianSedan_engine_stop_fuel_SoundSet";
548
549 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
550 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
551
552 m_CarHornShortSoundName = "CivilianSedan_Horn_Short_SoundSet";
553 m_CarHornLongSoundName = "CivilianSedan_Horn_SoundSet";
554
555 SetEnginePos("0 0.7 1.6");
556 }
557
558 override void EEInit()
559 {
560 super.EEInit();
561
562 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
563 {
565 m_UTSSettings.m_ManualUpdate = true;
567 m_UTSSettings.m_TemperatureCap = 0;
568 m_UTSSettings.m_RangeFull = 0.5;
569 m_UTSSettings.m_RangeMax = 2;
570
573 }
574 }
575
576 override void OnEngineStart()
577 {
578 super.OnEngineStart();
579
580 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
581 {
582 m_UTSource.SetDefferedActive(true, 20.0);
583 }
584 }
585
586 override void OnEngineStop()
587 {
588 super.OnEngineStop();
589
590 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
591 {
592 m_UTSource.SetDefferedActive(false, 10.0);
593 }
594 }
595
596 override void EOnPostSimulate(IEntity other, float timeSlice)
597 {
598 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
599 {
600 if (m_UTSource.IsActive())
601 {
603 }
604 }
605 }
606
607 override int GetAnimInstance()
608 {
609 return VehicleAnimInstances.SEDAN;
610 }
611
612 override float GetTransportCameraDistance()
613 {
614 return 4.5;
615 }
616
617 override int GetSeatAnimationType(int posIdx)
618 {
619 switch (posIdx)
620 {
621 case 0:
622 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
623 case 1:
624 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
625 case 2:
626 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
627 case 3:
628 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
629 }
630
631 return 0;
632 }
633
634 // Override for car-specific light type
636 {
637 return CarLightBase.Cast( ScriptedLightBase.CreateLight(CivilianSedanFrontLight) );
638 }
639
640 // Override for car-specific light type
642 {
643 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(CivilianSedanRearLight) );
644 }
645
646 override bool CanReleaseAttachment( EntityAI attachment )
647 {
648 if( !super.CanReleaseAttachment( attachment ) )
649 return false;
650
651 string attType = attachment.GetType();
652
653 if ( EngineIsOn() || GetCarDoorsState("CivSedanHood") == CarDoorState.DOORS_CLOSED )
654 {
655 if ( attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
656 return false;
657 }
658
659 return true;
660 }
661
662 override protected bool CanManipulateSpareWheel(string slotSelectionName)
663 {
664 return GetCarDoorsState("CivSedanTrunk") != CarDoorState.DOORS_CLOSED;
665 }
666
667 override bool CanDisplayAttachmentCategory(string category_name)
668 {
669 //super
670 if (!super.CanDisplayAttachmentCategory(category_name))
671 return false;
672 //
673
674 category_name.ToLower();
675 if (category_name.Contains("engine"))
676 {
677 if (GetCarDoorsState("CivSedanHood") == CarDoorState.DOORS_CLOSED)
678 return false;
679 }
680
681 return true;
682 }
683
684 override bool CanDisplayCargo()
685 {
686 if ( !super.CanDisplayCargo() )
687 return false;
688
689 if ( GetCarDoorsState("CivSedanTrunk") == CarDoorState.DOORS_CLOSED )
690 return false;
691
692 return true;
693 }
694
695 override int GetCarDoorsState( string slotType )
696 {
697 CarDoor carDoor;
698
699 Class.CastTo( carDoor, FindAttachmentBySlotName( slotType ) );
700 if (!carDoor)
701 {
702 return CarDoorState.DOORS_MISSING;
703 }
704
705 switch (slotType)
706 {
707 case "CivSedanDriverDoors":
708 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
709 break;
710
711 case "CivSedanCoDriverDoors":
712 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
713 break;
714
715 case "CivSedanCargo1Doors":
716 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
717 break;
718
719 case "CivSedanCargo2Doors":
720 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
721 break;
722
723 case "CivSedanTrunk":
724 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
725 break;
726
727 case "CivSedanHood":
728 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
729 break;
730 }
731
732 return CarDoorState.DOORS_MISSING;
733 }
734
735
736 override bool CrewCanGetThrough( int posIdx )
737 {
738 switch( posIdx )
739 {
740 case 0:
741 if ( GetCarDoorsState("CivSedanDriverDoors") == CarDoorState.DOORS_CLOSED )
742 return false;
743
744 return true;
745 break;
746
747 case 1:
748 if ( GetCarDoorsState("CivSedanCoDriverDoors") == CarDoorState.DOORS_CLOSED )
749 return false;
750
751 return true;
752 break;
753
754 case 2:
755 if ( GetCarDoorsState("CivSedanCargo1Doors") == CarDoorState.DOORS_CLOSED )
756 return false;
757
758 return true;
759 break;
760
761 case 3:
762 if ( GetCarDoorsState("CivSedanCargo2Doors") == CarDoorState.DOORS_CLOSED )
763 return false;
764
765 return true;
766 break;
767 }
768
769 return false;
770 }
771
772 override string GetDoorSelectionNameFromSeatPos(int posIdx)
773 {
774 switch( posIdx )
775 {
776 case 0:
777 return "doors_driver";
778 break;
779 case 1:
780 return "doors_codriver";
781 break;
782 case 2:
783 return "doors_cargo1";
784 break;
785 case 3:
786 return "doors_cargo2";
787 break;
788 }
789
790 return super.GetDoorSelectionNameFromSeatPos(posIdx);
791 }
792
793 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
794 {
795 switch( posIdx )
796 {
797 case 0:
798 return "CivSedanDriverDoors";
799 break;
800 case 1:
801 return "CivSedanCoDriverDoors";
802 break;
803 case 2:
804 return "CivSedanCargo1Doors";
805 break;
806 case 3:
807 return "CivSedanCargo2Doors";
808 break;
809 }
810
811 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
812 }
813
814 // 0 full ambient and engine sound
815 // 1 zero ambient and engine sound
816 override float OnSound(CarSoundCtrl ctrl, float oldValue)
817 {
818 switch (ctrl)
819 {
820 case CarSoundCtrl.DOORS:
821 float newValue = 0;
822 if (GetCarDoorsState("CivSedanDriverDoors") == CarDoorState.DOORS_CLOSED)
823 {
824 newValue += 0.25;
825 }
826
827 if (GetCarDoorsState("CivSedanCoDriverDoors") == CarDoorState.DOORS_CLOSED)
828 {
829 newValue += 0.25;
830 }
831
832 if (GetCarDoorsState("CivSedanCargo1Doors") == CarDoorState.DOORS_CLOSED)
833 {
834 newValue += 0.25;
835 }
836
837 if (GetCarDoorsState("CivSedanCargo2Doors") == CarDoorState.DOORS_CLOSED)
838 {
839 newValue += 0.25;
840 }
841
842 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
843 {
844 newValue -= 0.6;
845 }
846
847 if (GetHealthLevel("WindowBack") == GameConstants.STATE_RUINED)
848 {
849 newValue -= 0.6;
850 }
851
852 return Math.Clamp(newValue, 0, 1);
853 break;
854 }
855
856 return super.OnSound(ctrl, oldValue);
857 }
858
859 override string GetAnimSourceFromSelection(string selection)
860 {
861 switch (selection)
862 {
863 case "doors_driver":
864 return "DoorsDriver";
865 case "doors_codriver":
866 return "DoorsCoDriver";
867 case "doors_cargo1":
868 return "DoorsCargo1";
869 case "doors_cargo2":
870 return "DoorsCargo2";
871 case "doors_hood":
872 return "DoorsHood";
873 case "doors_trunk":
874 return "DoorsTrunk";
875 }
876
877 return "";
878 }
879
880 override bool IsVitalTruckBattery()
881 {
882 return false;
883 }
884
885 override bool IsVitalGlowPlug()
886 {
887 return false;
888 }
889
890 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
891 {
892 switch (currentSeat)
893 {
894 case 0:
895 return nextSeat == 1;
896
897 case 1:
898 return nextSeat == 0;
899
900 case 2:
901 return nextSeat == 3;
902
903 case 3:
904 return nextSeat == 2;
905 }
906
907 return false;
908 }
909
910 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
911 {
912 switch (pCurrentSeat)
913 {
914 case 0:
915 return pDoorsSelection == "DoorsDriver";
916
917 case 1:
918 return pDoorsSelection == "DoorsCoDriver";
919
920 case 2:
921 return pDoorsSelection == "DoorsCargo1";
922
923 case 3:
924 return pDoorsSelection == "DoorsCargo2";
925 }
926
927 return false;
928 }
929
930 override void OnDebugSpawn()
931 {
932 SpawnUniversalParts();
933 SpawnAdditionalItems();
934 FillUpCarFluids();
935
936 GetInventory().CreateInInventory("CivSedanWheel");
937 GetInventory().CreateInInventory("CivSedanWheel");
938 GetInventory().CreateInInventory("CivSedanWheel");
939 GetInventory().CreateInInventory("CivSedanWheel");
940
941 GetInventory().CreateInInventory("CivSedanDoors_Driver");
942 GetInventory().CreateInInventory("CivSedanDoors_CoDriver");
943 GetInventory().CreateInInventory("CivSedanDoors_BackLeft");
944 GetInventory().CreateInInventory("CivSedanDoors_BackRight");
945 GetInventory().CreateInInventory("CivSedanHood");
946 GetInventory().CreateInInventory("CivSedanTrunk");
947
948 //-----IN CAR CARGO
949 GetInventory().CreateInInventory("CivSedanWheel");
950 GetInventory().CreateInInventory("CivSedanWheel");
951 }
952
953 override float GetPushForceCoefficientMultiplier()
954 {
955 return 1.5;
956 }
957}
958
959class CivilianSedan_Wine extends CivilianSedan
960{
961 override void OnDebugSpawn()
962 {
963 SpawnUniversalParts();
964 SpawnAdditionalItems();
965 FillUpCarFluids();
966
967 GetInventory().CreateInInventory("CivSedanWheel");
968 GetInventory().CreateInInventory("CivSedanWheel");
969 GetInventory().CreateInInventory("CivSedanWheel");
970 GetInventory().CreateInInventory("CivSedanWheel");
971
972 GetInventory().CreateInInventory("CivSedanDoors_Driver_Wine");
973 GetInventory().CreateInInventory("CivSedanDoors_CoDriver_Wine");
974 GetInventory().CreateInInventory("CivSedanDoors_BackLeft_Wine");
975 GetInventory().CreateInInventory("CivSedanDoors_BackRight_Wine");
976 GetInventory().CreateInInventory("CivSedanHood_Wine");
977 GetInventory().CreateInInventory("CivSedanTrunk_Wine");
978
979 //-----IN CAR CARGO
980 GetInventory().CreateInInventory("CivSedanWheel");
981 GetInventory().CreateInInventory("CivSedanWheel");
982 }
983}
984
985class CivilianSedan_Black extends CivilianSedan
986{
987 override void OnDebugSpawn()
988 {
989 SpawnUniversalParts();
990 SpawnAdditionalItems();
991 FillUpCarFluids();
992
993 GetInventory().CreateInInventory("CivSedanWheel");
994 GetInventory().CreateInInventory("CivSedanWheel");
995 GetInventory().CreateInInventory("CivSedanWheel");
996 GetInventory().CreateInInventory("CivSedanWheel");
997
998 GetInventory().CreateInInventory("CivSedanDoors_Driver_Black");
999 GetInventory().CreateInInventory("CivSedanDoors_CoDriver_Black");
1000 GetInventory().CreateInInventory("CivSedanDoors_BackLeft_Black");
1001 GetInventory().CreateInInventory("CivSedanDoors_BackRight_Black");
1002 GetInventory().CreateInInventory("CivSedanHood_Black");
1003 GetInventory().CreateInInventory("CivSedanTrunk_Black");
1004
1005 //-----IN CAR CARGO
1006 GetInventory().CreateInInventory("CivSedanWheel");
1007 GetInventory().CreateInInventory("CivSedanWheel");
1008 }
1009}
CarSoundCtrl
Car's sound controller list. (native, do not change or extend)
Определения Car.c:4
CarDoorState
Определения CarScript.c:2
override float GetPushForceCoefficientMultiplier()
Определения CivilianSedan.c:850
class CivilianSedan extends CarScript OnDebugSpawn()
Определения CivilianSedan.c:430
override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
Определения CivilianSedan.c:787
override string GetAnimSourceFromSelection(string selection)
Определения CivilianSedan.c:756
override int GetSeatAnimationType(int posIdx)
Определения CivilianSedan.c:514
override float OnSound(CarSoundCtrl ctrl, float oldValue)
Определения CivilianSedan.c:713
override string GetDoorInvSlotNameFromSeatPos(int posIdx)
Определения CivilianSedan.c:690
override void EOnPostSimulate(IEntity other, float timeSlice)
Определения CivilianSedan.c:493
override void OnEngineStop()
Определения CivilianSedan.c:483
void CivilianSedan()
Определения CivilianSedan.c:435
ref UniversalTemperatureSourceLambdaEngine m_UTSLEngine
Определения CivilianSedan.c:433
override float GetTransportCameraDistance()
Определения CivilianSedan.c:509
override void EEInit()
Определения CivilianSedan.c:455
override bool CanReleaseAttachment(EntityAI attachment)
Определения CivilianSedan.c:543
override bool CanDisplayCargo()
Определения CivilianSedan.c:581
override void OnEngineStart()
Определения CivilianSedan.c:473
override CarLightBase CreateFrontLight()
Определения CivilianSedan.c:532
override int GetAnimInstance()
Определения CivilianSedan.c:504
override bool CrewCanGetThrough(int posIdx)
Определения CivilianSedan.c:633
override bool CanReachDoorsFromSeat(string pDoorsSelection, int pCurrentSeat)
Определения CivilianSedan.c:807
bool CanManipulateSpareWheel(string slotSelectionName)
Определения CivilianSedan.c:559
override bool IsVitalGlowPlug()
Определения CivilianSedan.c:782
override CarRearLightBase CreateRearLight()
Определения CivilianSedan.c:538
override bool IsVitalTruckBattery()
Определения CivilianSedan.c:777
override string GetDoorSelectionNameFromSeatPos(int posIdx)
Определения CivilianSedan.c:669
override int GetCarDoorsState(string slotType)
Определения CivilianSedan.c:592
override bool CanDisplayAttachmentCategory(string category_name)
Определения CivilianSedan.c:564
ref UniversalTemperatureSourceSettings m_UTSSettings
Определения FireplaceBase.c:220
ref UniversalTemperatureSource m_UTSource
Определения FireplaceBase.c:219
UniversalTemperatureSourceLambdaBaseImpl UniversalTemperatureSourceLambdaBase UniversalTemperatureSourceLambdaEngine()
VehicleAnimInstances
Определения VehicleAnimInstances.c:2
Определения CarRearLightBase.c:2
override void OnDebugSpawn()
Определения CivilianSedan.c:456
Определения CivilianSedan.c:455
Super root of all classes in Enforce script.
Определения EnScript.c:11
Определения EnEntity.c:165
Определения EnMath.c:7
original Timer deletes m_params which is unwanted
Определения UniversalTemperatureSource.c:38
DayZPlayerConstants
defined in C++
Определения dayzplayer.c:602
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static const float ITEM_TEMPERATURE_NEUTRAL_ZONE_MIDDLE
Определения 3_Game/constants.c:808
const int STATE_RUINED
Определения 3_Game/constants.c:848
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'.
bool Contains(string sample)
Returns true if sample is substring of string.
Определения EnString.c:286
proto int ToLower()
Changes string to lowercase. Returns length.