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

◆ GetSeatAnimationType()

override int OnDebugSpawn::GetSeatAnimationType ( int posIdx)
protected

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

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