Esempio n. 1
0
 private static float RoundWalkMovementPoints(float value)
 {
     if (EngineFeature.settings.CBTWalkAndRunMPRounding)
     {
         return(PrecisionUtils.RoundDownToInt(value));
     }
     return(value);
 }
Esempio n. 2
0
            static string DistanceToSummary(float meter)
            {
                var meters          = PrecisionUtils.RoundDownToInt(meter);
                var hexWidth        = MechStatisticsRules.Combat.MoveConstants.ExperimentalGridDistance;
                var hexes           = PrecisionUtils.RoundDownToInt(meters / hexWidth);
                var translatedValue = Strings.T("{0}m / {1} hex", meters, hexes);

                return(translatedValue);
            }
Esempio n. 3
0
        internal static void SetStatValues(float fraction, ref float currentValue, ref float maxValue)
        {
            var minValue = 1f;

            maxValue     = 10f;
            currentValue = fraction * (maxValue - minValue) + minValue;
            currentValue = PrecisionUtils.RoundDownToInt(currentValue);
            currentValue = Mathf.Max(currentValue, minValue);
            currentValue = Mathf.Min(currentValue, maxValue);
        }
        private int GetJumpJetMaxCount()
        {
            var raw        = movement.JumpJetCount;
            var multiplier = GetJumpJetMaxCountMultiplier();
            var mutiplied  = raw * multiplier;
            var rounded    = PrecisionUtils.RoundDownToInt(mutiplied);
            var cropped    = Mathf.Min(rounded, mechDef.Chassis.MaxJumpjets);

            //Control.mod.Logger.Log($"raw={raw} multiplier={multiplier} mutiplied={mutiplied} rounded={rounded} cropped={cropped}");
            return(cropped);
        }