168 if (playerStats !=
null) {
171 playerStats.DistanceTravelled += x;
174 playerStats.DistanceRidden += x;
178 playerStats.DistanceWalked += x;
182 playerStats.DistanceFallen += x;
186 playerStats.DistanceClimbed += x;
194 playerStats.DistanceSwam += x;
198 playerStats.DistanceFlown += x;
203 playerStats.LowestAltitude = Math.Min(playerStats.
LowestAltitude, position.
Y);
204 playerStats.HighestAltitude = Math.Max(playerStats.
HighestAltitude, position.
Y);
224 float num2 = MathF.Atan2(
225 2f * rotation.
Y * rotation.
W - 2f * rotation.
X * rotation.
Z,
226 1f - 2f * rotation.
Y * rotation.
Y - 2f * rotation.
Z * rotation.
Z
264 "OnLocomotionStopped",
266 loader.OnLocomotionStopped(
this, ref fallsOnDeathOrStun);
270 if (fallsOnDeathOrStun) {
271 m_componentCreature.ComponentBody.IsGravityEnabled =
true;
272 m_componentCreature.ComponentBody.IsGroundDragEnabled =
true;
273 m_componentCreature.ComponentBody.IsWaterDragEnabled =
true;
305 WalkSpeed = valuesDictionary.GetValue<
float>(
"WalkSpeed");
306 LadderSpeed = valuesDictionary.GetValue<
float>(
"LadderSpeed");
307 JumpSpeed = valuesDictionary.GetValue<
float>(
"JumpSpeed");
309 FlySpeed = valuesDictionary.GetValue<
float>(
"FlySpeed");
310 SwimSpeed = valuesDictionary.GetValue<
float>(
"SwimSpeed");
311 TurnSpeed = valuesDictionary.GetValue<
float>(
"TurnSpeed");
312 LookSpeed = valuesDictionary.GetValue<
float>(
"LookSpeed");
318 float mobWalkSpeedFactor =
m_random.Float(0.85f, 1f);
319 float mobFlySpeedFactor =
m_random.Float(0.85f, 1f);
320 float mobSwimSpeedFactor =
m_random.Float(0.85f, 1f);
321 bool disableCreativeFlyInSurvivalMode =
true;
323 "OnComponentLocomotionLoaded",
325 loader.OnComponentLocomotionLoaded(
327 ref mobWalkSpeedFactor,
328 ref mobFlySpeedFactor,
329 ref mobSwimSpeedFactor,
330 ref disableCreativeFlyInSurvivalMode
350 m_componentCreature.ComponentBody.IsGravityEnabled =
true;
351 m_componentCreature.ComponentBody.IsGroundDragEnabled =
true;
352 m_componentCreature.ComponentBody.IsWaterDragEnabled =
true;
365 || m_componentPlayer.ComponentInput.IsControlledByTouch
369 float num = v == Vector3.Zero ? 5f : 3f;
371 m_componentCreature.ComponentBody.IsGravityEnabled =
false;
372 m_componentCreature.ComponentBody.IsGroundDragEnabled =
false;
395 if (componentClothing !=
null) {
424 velocity.X += num4 * (vector2.X - velocity.
X);
425 velocity.Z += num4 * (vector2.Z - velocity.
Z);
426 Vector3 vector3 = value.X * right + value.Y * vector;
430 velocity.Y += 10f *
AccelerationFactor * vector3.Y * m_componentCreature.ComponentBody.ImmersionFactor * dt;
431 m_componentCreature.ComponentBody.IsGroundDragEnabled =
false;
441 if (clothingData !=
null) {
442 flag = clothingData.MovementSpeedFactor > 1f;
446 &&
WalkOrder.Value.LengthSquared() > 0.99f) {
458 m_componentCreature.ComponentBody.IsGravityEnabled =
false;
473 m_componentCreature.ComponentBody.IsGravityEnabled = MathF.Abs(value4.
Y) <= 0.07f;
474 m_componentCreature.ComponentBody.IsWaterDragEnabled =
false;
475 m_componentCreature.ComponentBody.IsGroundDragEnabled =
false;
480 m_componentCreature.ComponentBody.TargetCrouchFactor = 0f;
483 num6 *= 0.25f * (m_componentFactors.SpeedFactor - 1f) + 1f;
494 m_componentCreature.ComponentBody.Velocity = velocity;
498 m_componentCreature.ComponentBody.IsGravityEnabled =
false;
507 velocity.X = 5f * (MathF.Floor(position.
X) + 0.5f - position.
X);
508 velocity.Z = 5f * (MathF.Floor(position.
Z) + 0.5f - position.
Z);
536 m_componentCreature.ComponentBody.Velocity = velocity;