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

◆ OnEngineStop()

override void OnDebugSpawn::OnEngineStop ( )
protected

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

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