1165 {
1166 PlayerBase player = gotActionData.m_Player;
1167
1168 array<ClothingBase> equippedClothes = new array<ClothingBase>;
1169 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"LEGS")));
1170 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"BACK")));
1171 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"VEST")));
1172 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"HeadGear")));
1173 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"Mask")));
1174 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"BODY")));
1175 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"FEET")));
1176 equippedClothes.Insert(
ClothingBase.Cast(player.GetItemOnSlot(
"GLOVES")));
1177
1178
1179 float shockTaken = (gotActionData.
m_Speed * gotActionData.
m_Speed) / ActionGetOutTransport.DMG_FACTOR;
1180
1181
1183 HelmetBase helmet;
1184 if (Class.CastTo(helmet, headGear))
1185 shockTaken *= 0.5;
1186
1187
1188
1189 int randNum;
1190 randNum = Math.RandomInt(0, 100);
1191 if (gotActionData.
m_Speed < ActionGetOutTransport.LOW_SPEED_VALUE)
1192 {
1193 if (randNum < 20)
1194 player.GiveShock(-shockTaken);
1195
1196 randNum = Math.RandomIntInclusive(0, PlayerBase.m_BleedingSourcesLow.Count() - 1);
1197
1198 if (player.m_BleedingManagerServer)
1199 player.m_BleedingManagerServer.AttemptAddBleedingSourceBySelection(PlayerBase.m_BleedingSourcesLow[randNum]);
1200 }
1201 else if (gotActionData.
m_Speed >= ActionGetOutTransport.LOW_SPEED_VALUE && gotActionData.
m_Speed < ActionGetOutTransport.HIGH_SPEED_VALUE)
1202 {
1203 if (randNum < 50)
1204 player.GiveShock(-shockTaken);
1205
1206 randNum = Math.RandomInt(0, PlayerBase.m_BleedingSourcesUp.Count() - 1);
1207
1208 if (player.m_BleedingManagerServer)
1209 player.m_BleedingManagerServer.AttemptAddBleedingSourceBySelection(PlayerBase.m_BleedingSourcesUp[randNum]);
1210 }
1211 else if (gotActionData.
m_Speed >= ActionGetOutTransport.HIGH_SPEED_VALUE)
1212 {
1213 if (!headGear && player.m_BleedingManagerServer)
1214 player.m_BleedingManagerServer.AttemptAddBleedingSourceBySelection("Head");
1215
1216 if (randNum < 75)
1217 player.GiveShock(-shockTaken);
1218 }
1219
1220 float dmgTaken = (gotActionData.
m_Speed * gotActionData.
m_Speed) / ActionGetOutTransport.SHOCK_FACTOR;
1221
1222
1224 {
1225
1226 if (cloth == null)
1227 continue;
1228
1229 cloth.DecreaseHealth(dmgTaken, false);
1230 }
1231
1232 vector posMS = gotActionData.m_Player.WorldToModel(gotActionData.m_Player.GetPosition());
1233 gotActionData.m_Player.DamageAllLegs(dmgTaken);
1234
1235 float healthCoef = Math.InverseLerp(ActionGetOutTransport.HEALTH_LOW_SPEED_VALUE, ActionGetOutTransport.HEALTH_HIGH_SPEED_VALUE, gotActionData.
m_Speed);
1236 healthCoef = Math.Clamp(healthCoef, 0.0, 1.0);
1237 gotActionData.m_Player.ProcessDirectDamage(
DamageType.CUSTOM, gotActionData.m_Player,
"",
"FallDamageHealth", posMS, healthCoef);
1238 }
DamageType
exposed from C++ (do not change)
class GP5GasMask extends MaskBase ItemBase