6 bool m_WasJumpingOut =
false;
7 float m_DmgTaken = 0.0;
8 float m_ShockTaken = 0.0;
58 Transport trans = vehCommand.GetTransport();
61 int crewIndex = trans.CrewMemberIndex(player);
62 return crewIndex >= 0 && trans.CrewCanGetThrough(crewIndex) && trans.IsAreaAtDoorFree(crewIndex);
71 got_action_data.m_StartLocation = got_action_data.m_Player.GetPosition();
72 got_action_data.m_Car = car;
73 float carSpeed = car.GetSpeedometerAbsolute();
74 got_action_data.m_CarSpeed = carSpeed;
75 got_action_data.m_DmgTaken = (carSpeed * carSpeed) /
m_DmgFactor;
76 got_action_data.m_ShockTaken = (carSpeed * carSpeed) /
m_ShockFactor;
77 got_action_data.m_WasJumpingOut = carSpeed > 8.0;
82 super.OnStart(action_data);
87 Transport trans = vehCommand.GetTransport();
93 if (
Class.CastTo(car, trans))
96 if (!gotActionData.m_WasJumpingOut)
97 vehCommand.GetOutVehicle();
99 vehCommand.JumpOutVehicle();
104 if (action_data.m_Player.GetInventory())
105 action_data.m_Player.GetInventory().LockInventory(LOCK_FROM_SCRIPT);
115 Transport trans = vehCommand.GetTransport();
119 if (
Class.CastTo(car, trans))
120 car.ForceUpdateLightsStart();
129 if (action_data.m_State ==
UA_START)
131 if (!action_data.m_Player.GetCommand_Vehicle())
153 if (action_data.m_Player.GetInventory())
154 action_data.m_Player.GetInventory().UnlockInventory(LOCK_FROM_SCRIPT);
161 if (gotActionData.m_WasJumpingOut)
163 float carSpeed = gotActionData.m_CarSpeed;
164 gotActionData.m_Player.OnJumpOutVehicleFinish(carSpeed);
168 vector posMS = gotActionData.m_Player.WorldToModel(gotActionData.m_Player.GetPosition());
169 gotActionData.m_Player.DamageAllLegs(gotActionData.m_DmgTaken);
172 healthCoef =
Math.Clamp(healthCoef, 0.0, 1.0);
173 gotActionData.m_Player.ProcessDirectDamage(
DamageType.CUSTOM, gotActionData.m_Player,
"",
"FallDamageHealth", posMS, healthCoef);
176 if (gotActionData.m_Car)
179 if (
Class.CastTo(car, gotActionData.m_Car))
180 car.ForceUpdateLightsEnd();
191 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"LEGS")));
192 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"BACK")));
193 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"VEST")));
194 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"HeadGear")));
195 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"Mask")));
196 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"BODY")));
197 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"FEET")));
198 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"GLOVES")));
205 if (
Class.CastTo(helmet, headGear))
206 gotActionData.m_ShockTaken *= 0.5;
211 randNum =
Math.RandomInt(0, 100);
215 player.GiveShock(-gotActionData.m_ShockTaken);
217 randNum =
Math.RandomIntInclusive(0,
PlayerBase.m_BleedingSourcesLow.Count() - 1);
219 player.m_BleedingManagerServer.AttemptAddBleedingSourceBySelection(
PlayerBase.m_BleedingSourcesLow[randNum]);
224 player.GiveShock(-gotActionData.m_ShockTaken);
226 randNum =
Math.RandomInt(0,
PlayerBase.m_BleedingSourcesUp.Count() - 1);
228 player.m_BleedingManagerServer.AttemptAddBleedingSourceBySelection(
PlayerBase.m_BleedingSourcesUp[randNum]);
233 player.m_BleedingManagerServer.AttemptAddBleedingSourceBySelection(
"Head");
236 player.GiveShock(-gotActionData.m_ShockTaken);
246 cloth.DecreaseHealth(gotActionData.m_DmgTaken,
false);