8 enum CarHeadlightBulbsState
24 enum CarEngineSoundState
44 enum EVehicleDebugOutputType
48 DAMAGE_CONSIDERED = 2,
57 static ref CrashDebugData m_CrashDataPoint;
73 Print(
"Vehicle; DamageType; Damage; Zone; Momentum; Momentum Prev; Momentum Delta; Speedometer; SpeedWorld; SpeedWorld Prev; SpeedWorld Delta; Velocity; Velocity Prev; Velocity Dot; TimeStamp (ms); CrewDamageBase; ShockTemp; DMGHealth; DMGShock");
74 foreach (CrashDebugData data:dataArray)
80 static void DumpData(CrashDebugData data)
82 string output = data.m_VehicleType+
";"+data.m_DamageType+
";"+data.m_Damage+
";"+data.m_Zone+
";"+data.m_MomentumCurr+
";"+data.m_MomentumPrev+
";"+data.m_MomentumDelta+
";"+data.m_Speedometer;
83 output +=
";"+data.m_SpeedWorld+
";"+data.m_SpeedWorldPrev+
";"+data.m_SpeedWorldDelta+
";"+data.m_VelocityCur;
84 output +=
";"+data.m_VelocityPrev+
";"+data.m_VelocityDot+
";"+data.m_Time+
";"+data.m_CrewDamageBase+
";"+data.m_ShockTemp+
";"+data.m_DMGHealth+
";"+data.m_DMGShock;
94 float m_MomentumDelta;
97 float m_SpeedWorldPrev;
98 float m_SpeedWorldDelta;
103 float m_CrewDamageBase;
116 void CarContactData(
vector _localPos,
IEntity _other,
float _impulse)
118 localPos = _localPos;
135 #ifdef DIAG_DEVELOPER
136 static EVehicleDebugOutputType DEBUG_OUTPUT_TYPE;
137 bool m_ContactCalled;
148 static float DROWN_ENGINE_THRESHOLD = 0.5;
149 static float DROWN_ENGINE_DAMAGE = 350.0;
151 static const string MEMORY_POINT_NAME_CAR_HORN =
"pos_carHorn";
166 static vector m_DrownEnginePos;
251 static string m_ReverseLightPoint =
"light_reverse";
252 static string m_LeftHeadlightPoint =
"light_left";
253 static string m_RightHeadlightPoint =
"light_right";
254 static string m_LeftHeadlightTargetPoint =
"light_left_dir";
255 static string m_RightHeadlightTargetPoint =
"light_right_dir";
256 static string m_DrownEnginePoint =
"drown_engine";
260 static const int SELECTION_ID_FRONT_LIGHT_L = 0;
261 static const int SELECTION_ID_FRONT_LIGHT_R = 1;
262 static const int SELECTION_ID_BRAKE_LIGHT_L = 2;
263 static const int SELECTION_ID_BRAKE_LIGHT_R = 3;
264 static const int SELECTION_ID_REVERSE_LIGHT_L = 4;
265 static const int SELECTION_ID_REVERSE_LIGHT_R = 5;
266 static const int SELECTION_ID_TAIL_LIGHT_L = 6;
267 static const int SELECTION_ID_TAIL_LIGHT_R = 7;
268 static const int SELECTION_ID_DASHBOARD_LIGHT = 8;
279 private const int DEBUG_MESSAGE_CLEAN_TIME_SECONDS = 10;
280 private float m_DebugMessageCleanTime;
281 private string m_DebugContactDamageMessage;
316 RegisterNetSyncVariableBool(
"m_HeadlightsOn");
317 RegisterNetSyncVariableBool(
"m_BrakesArePressed");
318 RegisterNetSyncVariableBool(
"m_ForceUpdateLights");
319 RegisterNetSyncVariableBool(
"m_EngineZoneReceivedHit");
320 RegisterNetSyncVariableBoolSignal(
"m_PlayCrashSoundLight");
321 RegisterNetSyncVariableBoolSignal(
"m_PlayCrashSoundHeavy");
322 RegisterNetSyncVariableInt(
"m_CarHornState", ECarHornState.OFF, ECarHornState.LONG);
324 if ( MemoryPointExists(
"ptcExhaust_end") )
327 if ( MemoryPointExists(
"ptcExhaust_start") )
329 vector exhaustStart = GetMemoryPointPos(
"ptcExhaust_start");
345 if ( MemoryPointExists(
"ptcEnginePos") )
350 if ( MemoryPointExists(
"ptcCoolantPos") )
355 if ( MemoryPointExists(
"refill") )
360 if ( MemoryPointExists(
"drown_engine") )
361 m_DrownEnginePos = GetMemoryPointPos(
"drown_engine");
363 m_DrownEnginePos =
"0 0 0";
365 if ( MemoryPointExists(
"dmgZone_engine") )
370 if ( MemoryPointExists(
"dmgZone_front") )
371 m_frontPos = GetMemoryPointPos(
"dmgZone_front");
375 if ( MemoryPointExists(
"dmgZone_back") )
376 m_backPos = GetMemoryPointPos(
"dmgZone_back");
380 if ( MemoryPointExists(
"dmgZone_fender_1_1") )
385 if ( MemoryPointExists(
"dmgZone_fender_1_2") )
390 if ( MemoryPointExists(
"dmgZone_fender_2_1") )
395 if ( MemoryPointExists(
"dmgZone_fender_2_2") )
401 override void EEInit()
416 #ifdef DIAG_DEVELOPER
418 override void FixEntity()
425 for (
int i = 5; i > 0; i--)
427 if (!
GetGame().IsMultiplayer())
444 return ModelToWorld( m_DrownEnginePos );
494 super.EEHitBy(damageResult, damageType, source,
component, dmgZone, ammo, modelPos, speedCoef);
559 super.GetDebugActions(outputList);
567 if (super.OnAction(action_id, player, ctx))
622 super.OnVariablesSynchronized();
650 super.EEItemAttached(item, slot_name);
654 case "Reflector_1_1":
657 SetHealth(
"Reflector_1_1",
"Health", item.GetHealth());
660 case "Reflector_2_1":
663 SetHealth(
"Reflector_2_1",
"Health", item.GetHealth());
702 EntityAI bulb_L = FindAttachmentBySlotName(
"Reflector_1_1");
703 EntityAI bulb_R = FindAttachmentBySlotName(
"Reflector_2_1");
705 if (bulb_L && !bulb_L.IsRuined() && bulb_R && !bulb_R.IsRuined())
709 else if (bulb_L && !bulb_L.IsRuined())
713 else if (bulb_R && !bulb_R.IsRuined())
717 else if ((!bulb_L || bulb_L.IsRuined()) && (!bulb_R || bulb_R.IsRuined()))
746 if (
GetGame().IsServer() && EngineIsOn())
757 if (m_DamageZoneMap.Contains(
"Radiator"))
759 SetHealth(
"Radiator",
"Health", 0);
776 super.OnAttachmentRuined(attachment);
784 if (!super.CanReceiveAttachment(attachment, slotId))
788 attachment.GetInventory().GetCurrentInventoryLocation(attachmentInventoryLocation);
789 if (attachmentInventoryLocation.GetParent() ==
null)
794 if (attachment && attachment.Type().IsInherited(
CarWheel))
796 string slotSelectionName;
799 switch (slotSelectionName)
801 case "wheel_spare_1":
802 case "wheel_spare_2":
803 return CanManipulateSpareWheel(slotSelectionName);
811 override bool CanReleaseAttachment(
EntityAI attachment)
813 if (!super.CanReleaseAttachment(attachment))
823 if (attachment && attachment.Type().IsInherited(
CarWheel))
826 attachment.GetInventory().GetCurrentInventoryLocation(attachmentInventoryLocation);
828 string slotSelectionName;
829 InventorySlots.GetSelectionForSlotId(attachmentInventoryLocation.GetSlot(), slotSelectionName);
831 switch (slotSelectionName)
833 case "wheel_spare_1":
834 case "wheel_spare_2":
835 return CanManipulateSpareWheel(slotSelectionName);
843 protected bool CanManipulateSpareWheel(
string slotSelectionName)
848 override void EOnPostSimulate(
IEntity other,
float timeSlice)
857 #ifdef DIAG_DEVELOPER
858 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.CONTACT)
863 Debug.Log(
"--------------------------------------------------------------------");
864 m_ContactCalled =
false;
874 m_DebugMessageCleanTime += timeSlice;
875 if (m_DebugMessageCleanTime >= DEBUG_MESSAGE_CLEAN_TIME_SECONDS)
877 m_DebugMessageCleanTime = 0;
878 m_DebugContactDamageMessage =
"";
890 if (
GetGame().IsServer() && EngineIsOn())
907 SetHealth(
"Engine",
"Health",
GameConstants.DAMAGE_RUINED_VALUE);
919 if ( EngineGetRPM() >= EngineGetRPMRedline() )
921 if (EngineGetRPM() > EngineGetRPMMax())
922 AddHealth(
"Engine",
"Health", -GetMaxHealth(
"Engine",
"") * 0.05 );
924 dmg = EngineGetRPM() * 0.001 *
Math.RandomFloat( 0.02, 1.0 );
925 ProcessDirectDamage(
DamageType.CUSTOM,
null,
"Engine",
"EnviroDmg",
vector.Zero, dmg);
934 if ( IsVitalRadiator() )
952 if ( IsVitalRadiator() )
954 if ( GetFluidFraction(
CarFluid.COOLANT ) < 0.5 && GetFluidFraction(
CarFluid.COOLANT ) >= 0 )
956 dmg = ( 1 - GetFluidFraction(
CarFluid.COOLANT) ) *
Math.RandomFloat( 0.02, 10.00 );
957 AddHealth(
"Engine",
"Health", -dmg );
964 if (!
GetGame().IsDedicatedServer())
973 if (IsVitalRadiator() && GetFluidFraction(
CarFluid.COOLANT) < 0.5)
983 if (GetFluidFraction(
CarFluid.COOLANT) > 0)
999 if ( !
GetGame().IsDedicatedServer() )
1051 if ( battery.GetCompEM().GetEnergy() <= 0 )
1065 AddHealth(
"Engine",
"Health", -DROWN_ENGINE_DAMAGE * dt);
1076 float brake_coef = GetBrake();
1077 if ( brake_coef > 0 )
1105 super.EEKilled(killer);
1114 #ifdef DIAG_DEVELOPER
1115 m_ContactCalled =
true;
1116 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.CONTACT)
1118 string output =
"Zone: " + zoneName +
" | Impulse:" + data.Impulse;
1133 ccd.Insert(
new CarContactData(localPos, other, momentumDelta));
1144 if (contactZonesCount == 0)
1148 for (
int i = 0; i < contactZonesCount; ++i)
1156 #ifdef DIAG_DEVELOPER
1157 CrashDebugData.m_CrashDataPoint =
new CrashDebugData();
1158 CrashDebugData.m_CrashDataPoint.m_VehicleType = GetDisplayName();
1159 CrashDebugData.m_CrashDataPoint.m_Damage = dmg;
1160 CrashDebugData.m_CrashDataPoint.m_Zone = zoneName;
1161 CrashDebugData.m_CrashDataPoint.m_MomentumCurr =
GetMomentum();
1163 CrashDebugData.m_CrashDataPoint.m_MomentumDelta = data[0].impulse;
1164 CrashDebugData.m_CrashDataPoint.m_SpeedWorld =
GetVelocity(
this).Length() * 3.6;
1165 CrashDebugData.m_CrashDataPoint.m_SpeedWorldPrev =
m_VelocityPrevTick.Length() * 3.6;
1167 CrashDebugData.m_CrashDataPoint.m_VelocityCur =
GetVelocity(
this);
1170 CrashDebugData.m_CrashDataPoint.m_Time =
GetGame().GetTime();
1174 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_CONSIDERED)
1176 Debug.Log(
"--------------------------------------------------");
1177 Debug.Log(
"Vehicle:" + GetDisplayName());
1178 Debug.Log(
"DMG: " + dmg);
1179 Debug.Log(
"zoneName : "+ zoneName);
1182 Debug.Log(
"momentumDelta : "+ data[0].impulse);
1190 Debug.Log(
"--------------------------------------------------");
1197 #ifdef DIAG_DEVELOPER
1198 CrashDebugData.m_CrashData.Insert(CrashDebugData.m_CrashDataPoint);
1199 CrashDebugData.m_CrashDataPoint.m_Speedometer = GetSpeedometer();
1204 #ifdef DIAG_DEVELOPER
1205 CrashDebugData.m_CrashDataPoint.m_DamageType =
"Small";
1206 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_APPLIED)
1207 Debug.Log(
string.Format(
"[Vehiles:Damage]:: DMG %1 to the %2 zone is SMALL (threshold: %3), SPEEDOMETER: %4, TIME: %5", dmg, zoneName,
GameConstants.CARS_CONTACT_DMG_MIN, GetSpeedometer(),
GetGame().
GetTime() ));
1214 #ifdef DIAG_DEVELOPER
1215 CrashDebugData.m_CrashDataPoint.m_DamageType =
"Big";
1216 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_APPLIED)
1217 Debug.Log(
string.Format(
"[Vehiles:Damage]:: DMG %1 to the %2 zone is BIG (threshold: %3), SPEED: %4, TIME: %5", dmg, zoneName,
GameConstants.CARS_CONTACT_DMG_THRESHOLD, GetSpeedometer(),
GetGame().
GetTime() ));
1225 m_DebugContactDamageMessage +=
string.Format(
"%1: %2\n", zoneName, dmg);
1228 ProcessDirectDamage(DT_CUSTOM,
null, zoneName,
"EnviroDmg",
"0 0 0", dmg, pddfFlags);
1241 for (
int c = 0; c < CrewSize(); ++c )
1243 Human crew = CrewMember( c );
1248 if (
Class.CastTo(player, crew ) )
1252 #ifdef DIAG_DEVELOPER
1253 CrashDebugData.m_CrashDataPoint.m_CrewDamageBase = dmg;
1254 CrashDebugData.m_CrashDataPoint.m_DMGHealth = -100;
1255 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_APPLIED)
1257 Debug.Log(
"--------------------------------------------------");
1258 Debug.Log(
"Killing the player");
1259 Debug.Log(
"Crew DMG Base: " + dmg);
1260 Debug.Log(
"--------------------------------------------------");
1264 player.SetHealth(0.0);
1269 shockTemp =
Math.Clamp(shockTemp,0,1);
1270 float shock =
Math.Lerp( 50, 150, shockTemp );
1271 float hp =
Math.Lerp( 2, 100, shockTemp );
1273 #ifdef DIAG_DEVELOPER
1274 CrashDebugData.m_CrashDataPoint.m_CrewDamageBase = dmg;
1275 CrashDebugData.m_CrashDataPoint.m_ShockTemp = shockTemp;
1276 CrashDebugData.m_CrashDataPoint.m_DMGHealth = hp;
1277 CrashDebugData.m_CrashDataPoint.m_DMGShock = shock;
1278 if (DEBUG_OUTPUT_TYPE & EVehicleDebugOutputType.DAMAGE_APPLIED)
1280 Debug.Log(
"--------------------------------------------------");
1281 Debug.Log(
"Crew DMG Base: " + dmg);
1282 Debug.Log(
"Crew shockTemp: " + shockTemp);
1283 Debug.Log(
"Crew DMG Health: " + hp);
1284 Debug.Log(
"Crew DMG Shock: " + shock);
1285 Debug.Log(
"--------------------------------------------------");
1289 player.AddHealth(
"",
"Shock", -shock );
1290 player.AddHealth(
"",
"Health", -hp );
1316 override void OnAnimationPhaseStarted(
string animSource,
float phase)
1329 case "doorscodriver":
1341 sound.SetAutodestroy(
true);
1352 case "seatcodriver":
1360 sound.SetAutodestroy(
true);
1371 case ECarHornState.SHORT:
1374 case ECarHornState.LONG:
1392 case CarEngineSoundState.STARTING:
1396 case CarEngineSoundState.START_OK:
1398 if (
Class.CastTo(player, CrewMember(0)))
1400 if (!player.IsCameraInsideVehicle())
1408 sound.SetSoundWaveKind(waveKind);
1410 sound.SetAutodestroy(
true);
1418 case CarEngineSoundState.START_NO_FUEL:
1419 sound =
SEffectManager.PlaySound(
"offroad_engine_failed_start_fuel_SoundSet", ModelToWorld(GetEnginePos()));
1420 sound.SetAutodestroy(
true);
1423 case CarEngineSoundState.START_NO_BATTERY:
1424 sound =
SEffectManager.PlaySound(
"offroad_engine_failed_start_battery_SoundSet", ModelToWorld(GetEnginePos()));
1425 sound.SetAutodestroy(
true);
1428 case CarEngineSoundState.START_NO_SPARKPLUG:
1429 sound =
SEffectManager.PlaySound(
"offroad_engine_failed_start_sparkplugs_SoundSet", ModelToWorld(GetEnginePos()));
1430 sound.SetAutodestroy(
true);
1433 case CarEngineSoundState.STOP_OK:
1434 case CarEngineSoundState.STOP_NO_FUEL:
1436 if (
Class.CastTo(player, CrewMember(0)))
1438 if (!player.IsCameraInsideVehicle())
1446 sound.SetSoundWaveKind(waveKind);
1448 sound.SetAutodestroy(
true);
1460 set<int> crewMemberIndicesCopy =
new set<int>();
1462 crewMemberIndicesCopy.Insert(crewMemberIndex);
1469 set<int> crewMemberIndicesCopy =
new set<int>();
1471 crewMemberIndicesCopy.Insert(crewMemberIndex);
1557 if (GetFluidFraction(
CarFluid.FUEL) <= 0)
1563 if (IsVitalCarBattery() || IsVitalTruckBattery())
1574 if (IsVitalSparkPlug())
1576 item = FindAttachmentBySlotName(
"SparkPlug");
1577 if (!item || (item && item.IsRuined()))
1585 if (IsVitalGlowPlug())
1587 item = FindAttachmentBySlotName(
"GlowPlug");
1588 if (!item || (item && item.IsRuined()))
1612 override void OnEngineStart()
1615 if (
GetGame().IsServer() && battery)
1628 override void OnEngineStop()
1692 case CarHeadlightBulbsState.LEFT:
1693 m_Headlight.AttachOnMemoryPoint(
this, m_LeftHeadlightPoint, m_LeftHeadlightTargetPoint);
1696 case CarHeadlightBulbsState.RIGHT:
1697 m_Headlight.AttachOnMemoryPoint(
this, m_RightHeadlightPoint, m_RightHeadlightTargetPoint);
1700 case CarHeadlightBulbsState.BOTH:
1701 vector local_pos_left = GetMemoryPointPos(m_LeftHeadlightPoint);
1702 vector local_pos_right = GetMemoryPointPos(m_RightHeadlightPoint);
1704 vector local_pos_middle = (local_pos_left + local_pos_right) * 0.5;
1705 m_Headlight.AttachOnObject(
this, local_pos_middle);
1726 case CarGear.REVERSE:
1747 vector localPos = GetMemoryPointPos(m_ReverseLightPoint);
1748 m_RearLight.AttachOnObject(
this, localPos,
"180 0 0");
1757 case CarRearLightType.BRAKES_ONLY:
1760 case CarRearLightType.REVERSE_ONLY:
1767 case CarRearLightType.BRAKES_AND_REVERSE:
1796 gear = GearboxGetMode();
1811 case CarHeadlightBulbsState.LEFT:
1815 case CarHeadlightBulbsState.RIGHT:
1819 case CarHeadlightBulbsState.BOTH:
1842 case CarGear.REVERSE:
1864 case CarRearLightType.BRAKES_ONLY:
1868 case CarRearLightType.REVERSE_ONLY:
1880 case CarRearLightType.BRAKES_AND_REVERSE:
1928 string material = ConfigGetString(
"frontReflectorMatOn");
1932 SetObjectMaterial(SELECTION_ID_FRONT_LIGHT_L, material);
1938 string material = ConfigGetString(
"frontReflectorMatOn");
1942 SetObjectMaterial(SELECTION_ID_FRONT_LIGHT_R, material);
1948 string material = ConfigGetString(
"frontReflectorMatOff");
1952 SetObjectMaterial(SELECTION_ID_FRONT_LIGHT_L, material);
1958 string material = ConfigGetString(
"frontReflectorMatOff");
1962 SetObjectMaterial(SELECTION_ID_FRONT_LIGHT_R, material);
1968 string material = ConfigGetString(
"ReverseReflectorMatOn");
1972 SetObjectMaterial(SELECTION_ID_REVERSE_LIGHT_L, material);
1973 SetObjectMaterial(SELECTION_ID_REVERSE_LIGHT_R, material);
1979 string material = ConfigGetString(
"ReverseReflectorMatOff");
1983 SetObjectMaterial(SELECTION_ID_REVERSE_LIGHT_L, material);
1984 SetObjectMaterial(SELECTION_ID_REVERSE_LIGHT_R, material);
1990 string material = ConfigGetString(
"brakeReflectorMatOn");
1994 SetObjectMaterial(SELECTION_ID_BRAKE_LIGHT_L, material);
1995 SetObjectMaterial(SELECTION_ID_BRAKE_LIGHT_R, material);
2001 string material = ConfigGetString(
"brakeReflectorMatOff");
2005 SetObjectMaterial(SELECTION_ID_BRAKE_LIGHT_L, material);
2006 SetObjectMaterial(SELECTION_ID_BRAKE_LIGHT_R, material);
2012 string material = ConfigGetString(
"TailReflectorMatOn");
2013 string materialOff = ConfigGetString(
"TailReflectorMatOff");
2015 if (material && materialOff)
2019 SetObjectMaterial(SELECTION_ID_TAIL_LIGHT_L, material);
2020 SetObjectMaterial(SELECTION_ID_TAIL_LIGHT_R, materialOff);
2024 SetObjectMaterial(SELECTION_ID_TAIL_LIGHT_L, materialOff);
2025 SetObjectMaterial(SELECTION_ID_TAIL_LIGHT_R, material);
2029 SetObjectMaterial(SELECTION_ID_TAIL_LIGHT_L, material);
2030 SetObjectMaterial(SELECTION_ID_TAIL_LIGHT_R, material);
2037 string material = ConfigGetString(
"TailReflectorMatOff");
2041 SetObjectMaterial(SELECTION_ID_TAIL_LIGHT_L, material);
2042 SetObjectMaterial(SELECTION_ID_TAIL_LIGHT_R, material);
2048 string material = ConfigGetString(
"dashboardMatOn");
2052 SetObjectMaterial(SELECTION_ID_DASHBOARD_LIGHT, material);
2058 string material = ConfigGetString(
"dashboardMatOff");
2062 SetObjectMaterial(SELECTION_ID_DASHBOARD_LIGHT, material);
2083 EntityAI item = FindAttachmentBySlotName(itemName);
2087 else if ( item.IsRuined() )
2099 Leak(fluid, ammount);
2104 Leak(fluid, ammount);
2109 Leak(fluid, ammount);
2178 sound.SetAutodestroy(
true);
2183 if (!sound.IsSoundPlaying())
2199 string GetAnimSourceFromSelection(
string selection )
2204 string GetDoorConditionPointFromSelection(
string selection )
2209 return "seat_con_1_1";
2211 case "seat_codriver":
2212 return "seat_con_2_1";
2215 return "seat_con_1_2";
2218 return "seat_con_2_2";
2225 string GetDoorSelectionNameFromSeatPos(
int posIdx)
2230 string GetDoorInvSlotNameFromSeatPos(
int posIdx)
2235 int GetCrewIndex(
string selection )
2242 string conPointName = GetDoorConditionPointFromSelection(pSeatSelection);
2243 if (conPointName.Length() > 0)
2245 if ( MemoryPointExists(conPointName) )
2247 vector conPointMS = GetMemoryPointPos(conPointName);
2248 vector conPointWS = ModelToWorld(conPointMS);
2254 if (
vector.Distance(pFromPos, conPointWS) <= pDistance)
2264 bool IsVitalCarBattery()
2269 bool IsVitalTruckBattery()
2274 bool IsVitalSparkPlug()
2279 bool IsVitalGlowPlug()
2284 bool IsVitalEngineBelt()
2289 bool IsVitalRadiator()
2311 return GetSpeedometerAbsolute() > 3.5;
2316 return GetHandbrake() > 0.0;
2331 int GetCarDoorsState(
string slotType)
2338 if (GetAnimationPhase(animation) > 0.5)
2370 return "carradiator";
2380 return "carradiator";
2391 if (!m_InputActionMap)
2428 Debug.LogError(
"Action " + actionName +
" dosn't exist!");
2432 typename ai = action.GetInputType();
2448 Debug.ActionLog(action.ToString() +
" -> " + ai,
this.ToString() ,
"n/a",
"Add action" );
2450 action_array.Insert(action);
2456 ActionBase action = player.GetActionManager().GetAction(actionName);
2457 typename ai = action.GetInputType();
2462 action_array.RemoveItem(action);
2473 super.EEHealthLevelChanged(oldLevel,newLevel,zone);
2475 if (newLevel ==
GameConstants.STATE_RUINED && oldLevel != newLevel)
2490 case "WindowFrontLeft":
2491 case "WindowFrontRight":
2510 float maxVolume = GetFluidCapacity(
CarFluid.FUEL );
2511 float amount =
Math.RandomFloat(0.0, maxVolume * 0.35 );
2552 if (IsVitalCarBattery())
2554 return ItemBase.Cast(FindAttachmentBySlotName(
"CarBattery"));
2556 else if (IsVitalTruckBattery())
2558 return ItemBase.Cast(FindAttachmentBySlotName(
"TruckBattery"));
2579 if (pState != ECarHornState.OFF)
2583 float noiseMultiplier = 1.0;
2584 if (pState == ECarHornState.LONG)
2585 noiseMultiplier = 2.0;
2613 float GetPushForceCoefficientMultiplier()
2621 string debug_output = super.GetDebugText();
2624 debug_output += m_DebugContactDamageMessage +
"\n";
2626 debug_output +=
"Entity momentum: " +
GetMomentum();
2628 return debug_output;
2634 GetInventory().CreateInInventory(
"HeadlightH7");
2635 GetInventory().CreateInInventory(
"HeadlightH7");
2636 GetInventory().CreateInInventory(
"HeadlightH7");
2637 GetInventory().CreateInInventory(
"HeadlightH7");
2639 if (IsVitalCarBattery())
2641 GetInventory().CreateInInventory(
"CarBattery");
2642 GetInventory().CreateInInventory(
"CarBattery");
2645 if (IsVitalTruckBattery())
2647 GetInventory().CreateInInventory(
"TruckBattery");
2648 GetInventory().CreateInInventory(
"TruckBattery");
2651 if (IsVitalRadiator())
2653 GetInventory().CreateInInventory(
"CarRadiator");
2654 GetInventory().CreateInInventory(
"CarRadiator");
2657 if (IsVitalSparkPlug())
2659 GetInventory().CreateInInventory(
"SparkPlug");
2660 GetInventory().CreateInInventory(
"SparkPlug");
2663 if (IsVitalGlowPlug())
2665 GetInventory().CreateInInventory(
"GlowPlug");
2666 GetInventory().CreateInInventory(
"GlowPlug");
2672 GetInventory().CreateInInventory(
"Wrench");
2673 GetInventory().CreateInInventory(
"LugWrench");
2674 GetInventory().CreateInInventory(
"Screwdriver");
2675 GetInventory().CreateInInventory(
"EpoxyPutty");
2677 GetInventory().CreateInInventory(
"CanisterGasoline");
2681 ent = GetInventory().CreateInInventory(
"CanisterGasoline");
2682 if (
Class.CastTo(container, ent))
2687 ent = GetInventory().CreateInInventory(
"Blowtorch");
2690 ent.GetInventory().CreateInInventory(
"LargeGasCanister");
2693 ent = GetInventory().CreateInInventory(
"Blowtorch");
2696 ent.GetInventory().CreateInInventory(
"LargeGasCanister");