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

◆ GetAnimInstance()

override int OnDebugSpawn::GetAnimInstance ( )
protected

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

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