internal MechDefMovementStatistics(MechDef mechDef) { this.mechDef = mechDef; Engine = mechDef.GetEngine(); movement = Engine?.CoreDef.GetMovement(mechDef.Chassis.Tonnage); if (movement == null) { return; } WalkMovementPoint = movement.WalkMovementPoint; MoveMultiplier = GetMoveMultiplier(); BaseWalkSpeed = GetWalkSpeed(); BaseRunSpeed = GetRunSpeed(); WalkSpeed = BaseWalkSpeed * MoveMultiplier; RunSpeed = BaseRunSpeed * MoveMultiplier; JumpCapacity = GetJumpCapacity(); BaseJumpDistance = EngineMovement.ConvertJJMPToGameDistance(JumpCapacity); JumpDistanceMultiplier = GetJumpDistanceMultiplier(); JumpDistance = BaseJumpDistance * JumpDistanceMultiplier; JumpJetCount = mechDef.Inventory.Count(x => x.ComponentDefType == ComponentType.JumpJet); JumpJetMaxCount = GetJumpJetMaxCount(); }
internal static int CalcJumpHeat(Mech mech, float jumpDistance) { var jumpCapacity = mech.StatCollection.JumpCapacity().Get(); var maxJumpDistance = EngineMovement.ConvertMPToGameDistance(jumpCapacity); var jumpRatio = jumpDistance / maxJumpDistance; return(GetJumpHeat(mech.StatCollection, jumpRatio)); }
internal static float CalcMaxJumpDistance(Mech mech) { if (!mech.IsOperational || mech.IsProne) { return(0f); } var jumpCapacity = mech.StatCollection.JumpCapacity().Get(); if (jumpCapacity < 0.1) { return(0f); } var jumpjetDistance = EngineMovement.ConvertMPToGameDistance(jumpCapacity); var mechJumpDistanceMultiplier = mech.StatCollection.JumpDistanceMultiplier().Get(); return(jumpjetDistance * mechJumpDistanceMultiplier); }