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

◆ GetPushForceCoefficientMultiplier()

override float OnDebugSpawn::GetPushForceCoefficientMultiplier ( )
protected

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

851{
855
856 void CivilianSedan()
857 {
858 //m_dmgContactCoef = 0.065;
859
860 m_EngineStartOK = "CivilianSedan_engine_start_SoundSet";
861 m_EngineStartBattery = "CivilianSedan_engine_failed_start_battery_SoundSet";
862 m_EngineStartPlug = "CivilianSedan_engine_failed_start_sparkplugs_SoundSet";
863 m_EngineStartFuel = "CivilianSedan_engine_failed_start_fuel_SoundSet";
864 m_EngineStop = "CivilianSedan_engine_stop_SoundSet";
865 m_EngineStopFuel = "CivilianSedan_engine_stop_fuel_SoundSet";
866
867 m_CarDoorOpenSound = "offroad_door_open_SoundSet";
868 m_CarDoorCloseSound = "offroad_door_close_SoundSet";
869
870 m_CarHornShortSoundName = "CivilianSedan_Horn_Short_SoundSet";
871 m_CarHornLongSoundName = "CivilianSedan_Horn_SoundSet";
872
873 SetEnginePos("0 0.7 1.6");
874 }
875
876 override void EEInit()
877 {
878 super.EEInit();
879
880 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
881 {
883 m_UTSSettings.m_ManualUpdate = true;
885 m_UTSSettings.m_TemperatureCap = 0;
886 m_UTSSettings.m_RangeFull = 0.5;
887 m_UTSSettings.m_RangeMax = 2;
888
891 }
892 }
893
894 override void OnEngineStart()
895 {
896 super.OnEngineStart();
897
898 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
899 {
900 m_UTSource.SetDefferedActive(true, 20.0);
901 }
902 }
903
904 override void OnEngineStop()
905 {
906 super.OnEngineStop();
907
908 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
909 {
910 m_UTSource.SetDefferedActive(false, 10.0);
911 }
912 }
913
914 override void EOnPostSimulate(IEntity other, float timeSlice)
915 {
916 if (GetGame().IsServer() || !GetGame().IsMultiplayer())
917 {
918 if (m_UTSource.IsActive())
919 {
921 }
922 }
923 }
924
925 override int GetAnimInstance()
926 {
927 return VehicleAnimInstances.SEDAN;
928 }
929
930 override float GetTransportCameraDistance()
931 {
932 return 4.5;
933 }
934
935 override int GetSeatAnimationType(int posIdx)
936 {
937 switch (posIdx)
938 {
939 case 0:
940 return DayZPlayerConstants.VEHICLESEAT_DRIVER;
941 case 1:
942 return DayZPlayerConstants.VEHICLESEAT_CODRIVER;
943 case 2:
944 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_L;
945 case 3:
946 return DayZPlayerConstants.VEHICLESEAT_PASSENGER_R;
947 }
948
949 return 0;
950 }
951
952 // Override for car-specific light type
954 {
955 return CarLightBase.Cast( ScriptedLightBase.CreateLight(CivilianSedanFrontLight) );
956 }
957
958 // Override for car-specific light type
960 {
961 return CarRearLightBase.Cast( ScriptedLightBase.CreateLight(CivilianSedanRearLight) );
962 }
963
964 override bool CanReleaseAttachment( EntityAI attachment )
965 {
966 if( !super.CanReleaseAttachment( attachment ) )
967 return false;
968
969 string attType = attachment.GetType();
970
971 if ( EngineIsOn() || GetCarDoorsState("CivSedanHood") == CarDoorState.DOORS_CLOSED )
972 {
973 if ( attType == "CarRadiator" || attType == "CarBattery" || attType == "SparkPlug")
974 return false;
975 }
976
977 return true;
978 }
979
980 override protected bool CanManipulateSpareWheel(string slotSelectionName)
981 {
982 return GetCarDoorsState("CivSedanTrunk") != CarDoorState.DOORS_CLOSED;
983 }
984
985 override bool CanDisplayAttachmentCategory(string category_name)
986 {
987 //super
988 if (!super.CanDisplayAttachmentCategory(category_name))
989 return false;
990 //
991
992 category_name.ToLower();
993 if (category_name.Contains("engine"))
994 {
995 if (GetCarDoorsState("CivSedanHood") == CarDoorState.DOORS_CLOSED)
996 return false;
997 }
998
999 return true;
1000 }
1001
1002 override bool CanDisplayCargo()
1003 {
1004 if ( !super.CanDisplayCargo() )
1005 return false;
1006
1007 if ( GetCarDoorsState("CivSedanTrunk") == CarDoorState.DOORS_CLOSED )
1008 return false;
1009
1010 return true;
1011 }
1012
1013 override int GetCarDoorsState( string slotType )
1014 {
1015 CarDoor carDoor;
1016
1017 Class.CastTo( carDoor, FindAttachmentBySlotName( slotType ) );
1018 if (!carDoor)
1019 {
1020 return CarDoorState.DOORS_MISSING;
1021 }
1022
1023 switch (slotType)
1024 {
1025 case "CivSedanDriverDoors":
1026 return TranslateAnimationPhaseToCarDoorState("DoorsDriver");
1027 break;
1028
1029 case "CivSedanCoDriverDoors":
1030 return TranslateAnimationPhaseToCarDoorState("DoorsCoDriver");
1031 break;
1032
1033 case "CivSedanCargo1Doors":
1034 return TranslateAnimationPhaseToCarDoorState("DoorsCargo1");
1035 break;
1036
1037 case "CivSedanCargo2Doors":
1038 return TranslateAnimationPhaseToCarDoorState("DoorsCargo2");
1039 break;
1040
1041 case "CivSedanTrunk":
1042 return TranslateAnimationPhaseToCarDoorState("DoorsTrunk");
1043 break;
1044
1045 case "CivSedanHood":
1046 return TranslateAnimationPhaseToCarDoorState("DoorsHood");
1047 break;
1048 }
1049
1050 return CarDoorState.DOORS_MISSING;
1051 }
1052
1053
1054 override bool CrewCanGetThrough( int posIdx )
1055 {
1056 switch( posIdx )
1057 {
1058 case 0:
1059 if ( GetCarDoorsState("CivSedanDriverDoors") == CarDoorState.DOORS_CLOSED )
1060 return false;
1061
1062 return true;
1063 break;
1064
1065 case 1:
1066 if ( GetCarDoorsState("CivSedanCoDriverDoors") == CarDoorState.DOORS_CLOSED )
1067 return false;
1068
1069 return true;
1070 break;
1071
1072 case 2:
1073 if ( GetCarDoorsState("CivSedanCargo1Doors") == CarDoorState.DOORS_CLOSED )
1074 return false;
1075
1076 return true;
1077 break;
1078
1079 case 3:
1080 if ( GetCarDoorsState("CivSedanCargo2Doors") == CarDoorState.DOORS_CLOSED )
1081 return false;
1082
1083 return true;
1084 break;
1085 }
1086
1087 return false;
1088 }
1089
1090 override string GetDoorSelectionNameFromSeatPos(int posIdx)
1091 {
1092 switch( posIdx )
1093 {
1094 case 0:
1095 return "doors_driver";
1096 break;
1097 case 1:
1098 return "doors_codriver";
1099 break;
1100 case 2:
1101 return "doors_cargo1";
1102 break;
1103 case 3:
1104 return "doors_cargo2";
1105 break;
1106 }
1107
1108 return super.GetDoorSelectionNameFromSeatPos(posIdx);
1109 }
1110
1111 override string GetDoorInvSlotNameFromSeatPos(int posIdx)
1112 {
1113 switch( posIdx )
1114 {
1115 case 0:
1116 return "CivSedanDriverDoors";
1117 break;
1118 case 1:
1119 return "CivSedanCoDriverDoors";
1120 break;
1121 case 2:
1122 return "CivSedanCargo1Doors";
1123 break;
1124 case 3:
1125 return "CivSedanCargo2Doors";
1126 break;
1127 }
1128
1129 return super.GetDoorInvSlotNameFromSeatPos(posIdx);
1130 }
1131
1132 // 0 full ambient and engine sound
1133 // 1 zero ambient and engine sound
1134 override float OnSound(CarSoundCtrl ctrl, float oldValue)
1135 {
1136 switch (ctrl)
1137 {
1138 case CarSoundCtrl.DOORS:
1139 float newValue = 0;
1140 if (GetCarDoorsState("CivSedanDriverDoors") == CarDoorState.DOORS_CLOSED)
1141 {
1142 newValue += 0.25;
1143 }
1144
1145 if (GetCarDoorsState("CivSedanCoDriverDoors") == CarDoorState.DOORS_CLOSED)
1146 {
1147 newValue += 0.25;
1148 }
1149
1150 if (GetCarDoorsState("CivSedanCargo1Doors") == CarDoorState.DOORS_CLOSED)
1151 {
1152 newValue += 0.25;
1153 }
1154
1155 if (GetCarDoorsState("CivSedanCargo2Doors") == CarDoorState.DOORS_CLOSED)
1156 {
1157 newValue += 0.25;
1158 }
1159
1160 if (GetHealthLevel("WindowFront") == GameConstants.STATE_RUINED)
1161 {
1162 newValue -= 0.6;
1163 }
1164
1165 if (GetHealthLevel("WindowBack") == GameConstants.STATE_RUINED)
1166 {
1167 newValue -= 0.6;
1168 }
1169
1170 return Math.Clamp(newValue, 0, 1);
1171 break;
1172 }
1173
1174 return super.OnSound(ctrl, oldValue);
1175 }
1176
1177 override string GetAnimSourceFromSelection(string selection)
1178 {
1179 switch (selection)
1180 {
1181 case "doors_driver":
1182 return "DoorsDriver";
1183 case "doors_codriver":
1184 return "DoorsCoDriver";
1185 case "doors_cargo1":
1186 return "DoorsCargo1";
1187 case "doors_cargo2":
1188 return "DoorsCargo2";
1189 case "doors_hood":
1190 return "DoorsHood";
1191 case "doors_trunk":
1192 return "DoorsTrunk";
1193 }
1194
1195 return "";
1196 }
1197
1198 override bool IsVitalTruckBattery()
1199 {
1200 return false;
1201 }
1202
1203 override bool IsVitalGlowPlug()
1204 {
1205 return false;
1206 }
1207
1208 override bool CanReachSeatFromSeat(int currentSeat, int nextSeat)
1209 {
1210 switch (currentSeat)
1211 {
1212 case 0:
1213 return nextSeat == 1;
1214
1215 case 1:
1216 return nextSeat == 0;
1217
1218 case 2:
1219 return nextSeat == 3;
1220
1221 case 3:
1222 return nextSeat == 2;
1223 }
1224
1225 return false;
1226 }
1227
1228 override bool CanReachDoorsFromSeat( string pDoorsSelection, int pCurrentSeat )
1229 {
1230 switch (pCurrentSeat)
1231 {
1232 case 0:
1233 return pDoorsSelection == "DoorsDriver";
1234
1235 case 1:
1236 return pDoorsSelection == "DoorsCoDriver";
1237
1238 case 2:
1239 return pDoorsSelection == "DoorsCargo1";
1240
1241 case 3:
1242 return pDoorsSelection == "DoorsCargo2";
1243 }
1244
1245 return false;
1246 }
1247
1248 override void OnDebugSpawn()
1249 {
1250 SpawnUniversalParts();
1251 SpawnAdditionalItems();
1252 FillUpCarFluids();
1253
1254 GetInventory().CreateInInventory("CivSedanWheel");
1255 GetInventory().CreateInInventory("CivSedanWheel");
1256 GetInventory().CreateInInventory("CivSedanWheel");
1257 GetInventory().CreateInInventory("CivSedanWheel");
1258
1259 GetInventory().CreateInInventory("CivSedanDoors_Driver");
1260 GetInventory().CreateInInventory("CivSedanDoors_CoDriver");
1261 GetInventory().CreateInInventory("CivSedanDoors_BackLeft");
1262 GetInventory().CreateInInventory("CivSedanDoors_BackRight");
1263 GetInventory().CreateInInventory("CivSedanHood");
1264 GetInventory().CreateInInventory("CivSedanTrunk");
1265
1266 //-----IN CAR CARGO
1267 GetInventory().CreateInInventory("CivSedanWheel");
1268 GetInventory().CreateInInventory("CivSedanWheel");
1269 }
1270
1271 override float GetPushForceCoefficientMultiplier()
1272 {
1273 return 1.5;
1274 }
1275}
1276
1277class CivilianSedan_Wine extends CivilianSedan
1278{
1279 override void OnDebugSpawn()
1280 {
1281 SpawnUniversalParts();
1282 SpawnAdditionalItems();
1283 FillUpCarFluids();
1284
1285 GetInventory().CreateInInventory("CivSedanWheel");
1286 GetInventory().CreateInInventory("CivSedanWheel");
1287 GetInventory().CreateInInventory("CivSedanWheel");
1288 GetInventory().CreateInInventory("CivSedanWheel");
1289
1290 GetInventory().CreateInInventory("CivSedanDoors_Driver_Wine");
1291 GetInventory().CreateInInventory("CivSedanDoors_CoDriver_Wine");
1292 GetInventory().CreateInInventory("CivSedanDoors_BackLeft_Wine");
1293 GetInventory().CreateInInventory("CivSedanDoors_BackRight_Wine");
1294 GetInventory().CreateInInventory("CivSedanHood_Wine");
1295 GetInventory().CreateInInventory("CivSedanTrunk_Wine");
1296
1297 //-----IN CAR CARGO
1298 GetInventory().CreateInInventory("CivSedanWheel");
1299 GetInventory().CreateInInventory("CivSedanWheel");
1300 }
1301}
1302
1303class CivilianSedan_Black extends CivilianSedan
1304{
1305 override void OnDebugSpawn()
1306 {
1307 SpawnUniversalParts();
1308 SpawnAdditionalItems();
1309 FillUpCarFluids();
1310
1311 GetInventory().CreateInInventory("CivSedanWheel");
1312 GetInventory().CreateInInventory("CivSedanWheel");
1313 GetInventory().CreateInInventory("CivSedanWheel");
1314 GetInventory().CreateInInventory("CivSedanWheel");
1315
1316 GetInventory().CreateInInventory("CivSedanDoors_Driver_Black");
1317 GetInventory().CreateInInventory("CivSedanDoors_CoDriver_Black");
1318 GetInventory().CreateInInventory("CivSedanDoors_BackLeft_Black");
1319 GetInventory().CreateInInventory("CivSedanDoors_BackRight_Black");
1320 GetInventory().CreateInInventory("CivSedanHood_Black");
1321 GetInventory().CreateInInventory("CivSedanTrunk_Black");
1322
1323 //-----IN CAR CARGO
1324 GetInventory().CreateInInventory("CivSedanWheel");
1325 GetInventory().CreateInInventory("CivSedanWheel");
1326 }
1327}
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.