public float Speed(float iSpeed, Enums.eSpeedMeasure unit)
    {
        float num;

        switch (unit)
        {
        case Enums.eSpeedMeasure.FeetPerSecond:
            num = iSpeed;
            break;

        case Enums.eSpeedMeasure.MetersPerSecond:
            num = iSpeed * 0.3048f;
            break;

        case Enums.eSpeedMeasure.MilesPerHour:
            num = iSpeed * 0.6818182f;
            break;

        case Enums.eSpeedMeasure.KilometersPerHour:
            num = iSpeed * 1.09728f;
            break;

        default:
            num = iSpeed;
            break;
        }
        return(num);
    }
    public float Distance(float iDist, Enums.eSpeedMeasure unit)
    {
        float num;

        switch (unit)
        {
        case Enums.eSpeedMeasure.FeetPerSecond:
            num = iDist;
            break;

        case Enums.eSpeedMeasure.MetersPerSecond:
            num = iDist * 0.3048f;
            break;

        case Enums.eSpeedMeasure.MilesPerHour:
            num = iDist;
            break;

        case Enums.eSpeedMeasure.KilometersPerHour:
            num = iDist * 0.3048f;
            break;

        default:
            num = iDist;
            break;
        }
        return(num);
    }
    public float MovementJumpSpeed(Enums.eSpeedMeasure sType, bool uncapped)
    {
        float iSpeed = this._character.Totals.JumpSpd;

        if (!uncapped && (double)this._character.Totals.JumpSpd > (double)this._character.Totals.MaxJumpSpd)
        {
            iSpeed = this._character.Totals.MaxJumpSpd;
        }
        return(this.Speed(iSpeed, sType));
    }
Beispiel #4
0
 public static string FormatSpeedUnit(Enums.eSpeedMeasure speedUnit)
 {
     return(speedUnit switch
     {
         Enums.eSpeedMeasure.FeetPerSecond => "ft/s",
         Enums.eSpeedMeasure.MetersPerSecond => "m/s",
         Enums.eSpeedMeasure.MilesPerHour => "mph",
         Enums.eSpeedMeasure.KilometersPerHour => "km/h",
         _ => "ft/s"
     });
    public float MovementFlySpeed(Enums.eSpeedMeasure sType, bool uncapped)
    {
        float iSpeed = this._character.Totals.FlySpd;

        if (!uncapped && this._character.Totals.FlySpd > this._character.Totals.MaxFlySpd)
        {
            iSpeed = this._character.Totals.MaxFlySpd;
        }
        return(this.Speed(iSpeed, sType));
    }
Beispiel #6
0
        public float MovementJumpSpeed(Enums.eSpeedMeasure sType, bool uncapped)
        {
            var iSpeed = _character.Totals.JumpSpd;

            if (!uncapped && _character.Totals.JumpSpd > (double)_character.Totals.MaxJumpSpd)
            {
                iSpeed = _character.Totals.MaxJumpSpd;
            }
            return(Speed(iSpeed, sType));
        }
Beispiel #7
0
        public float Distance(float iDist, Enums.eSpeedMeasure unit)
        {
            var num = unit switch
            {
                Enums.eSpeedMeasure.FeetPerSecond => iDist,
                Enums.eSpeedMeasure.MetersPerSecond => iDist * 0.3048f,
                Enums.eSpeedMeasure.MilesPerHour => iDist,
                Enums.eSpeedMeasure.KilometersPerHour => iDist * 0.3048f,
                _ => iDist
            };

            return(num);
        }
Beispiel #8
0
        public float Speed(float iSpeed, Enums.eSpeedMeasure unit)
        {
            var num = unit switch
            {
                Enums.eSpeedMeasure.FeetPerSecond => iSpeed,
                Enums.eSpeedMeasure.MetersPerSecond => iSpeed * 0.3048f,
                Enums.eSpeedMeasure.MilesPerHour => iSpeed * 0.6818182f,
                Enums.eSpeedMeasure.KilometersPerHour => iSpeed * 1.09728f,
                _ => iSpeed
            };

            return(num);
        }
    public float MovementJumpHeight(Enums.eSpeedMeasure sType)
    {
        float result;

        if (!(sType == Enums.eSpeedMeasure.KilometersPerHour | sType == Enums.eSpeedMeasure.MetersPerSecond))
        {
            result = this._character.TotalsCapped.JumpHeight;
        }
        else
        {
            result = this._character.TotalsCapped.JumpHeight * 0.3048f;
        }
        return(result);
    }
 public float MovementJumpHeight(Enums.eSpeedMeasure sType)
 {
     return(sType == Enums.eSpeedMeasure.KilometersPerHour | sType == Enums.eSpeedMeasure.MetersPerSecond ? this._character.TotalsCapped.JumpHeight * 0.3048f : this._character.TotalsCapped.JumpHeight);
 }
    void Load(string iFilename)
    {
        if (iFilename.EndsWith("json"))
        {
        }
        //using (FileStream fileStream = new FileStream(iFilename, FileMode.Open, FileAccess.Read))
        {
            using (BinaryReader reader = new BinaryReader(File.Open(iFilename, FileMode.Open, FileAccess.Read)))
            {
                float num1;
                switch (reader.ReadString())
                {
                // legacy string, refers to something specific in files, do not change
                case "Mids' Hero Designer Config":
                    num1 = 0.9f;
                    break;

                // legacy string, refers to something specific in files, do not change
                // here's something F# doesn't do easily(fallthrough where one branch has a when variable declared)
                case "Mids' Hero Designer Config V2":
                case string x when x == header:
                    num1 = reader.ReadSingle();
                    break;

                default:
                    MessageBox.Show("Config file was missing a header! Using defaults.");
                    reader.Close();
                    //fileStream.Close();
                    return;
                }

                /* Commenting out for now - will remove later
                 * this.DNickName = reader.ReadString();
                 * this.DSelServer = reader.ReadString();
                 * this.DChannel = reader.ReadString();*/
                this.NoToolTips = reader.ReadBoolean();
                this.BaseAcc    = reader.ReadSingle();
                double num3 = (double)reader.ReadSingle();
                double num4 = (double)reader.ReadSingle();
                double num5 = (double)reader.ReadSingle();
                double num6 = (double)reader.ReadSingle();
                double num7 = (double)reader.ReadSingle();
                this.CalcEnhLevel  = (Enums.eEnhRelative)reader.ReadInt32();
                this.CalcEnhOrigin = (Enums.eEnhGrade)reader.ReadInt32();
                this.ExempHigh     = reader.ReadInt32();
                this.ExempLow      = reader.ReadInt32();
                this.Inc.PvE       = reader.ReadBoolean();
                reader.ReadBoolean();
                this.DamageMath.Calculate = (ConfigData.EDamageMath)reader.ReadInt32();
                reader.ReadSingle();
                if ((double)num1 < 1.24000000953674)
                {
                    reader.ReadBoolean();
                }
                else
                {
                    reader.ReadInt32();
                }
                this.DamageMath.ReturnValue        = (ConfigData.EDamageReturn)reader.ReadInt32();
                this.DataDamageGraph               = reader.ReadBoolean();
                this.DataDamageGraphPercentageOnly = reader.ReadBoolean();
                this.DataGraphType = (Enums.eDDGraph)reader.ReadInt32();
                this.ExportScheme  = reader.ReadInt32();
                this.ExportTarget  = reader.ReadInt32();
                if ((double)num1 >= 1.24000000953674)
                {
                    this.ExportBonusTotals = reader.ReadBoolean();
                    this.ExportBonusList   = reader.ReadBoolean();
                }
                this._hideOriginEnhancements = reader.ReadBoolean();
                this.ShowVillainColours      = reader.ReadBoolean();
                this.CheckForUpdates         = reader.ReadBoolean();
                this.Columns         = reader.ReadInt32();
                this.LastSize.Width  = reader.ReadInt32();
                this.LastSize.Height = reader.ReadInt32();
                this.DvState         = (Enums.eVisibleSize)reader.ReadInt32();
                this.StatGraphStyle  = (Enums.GraphStyle)reader.ReadInt32();
                if ((double)num1 >= 1.0)
                {
                    this.FreshInstall = reader.ReadBoolean();
                }
                if ((double)num1 >= 1.10000002384186)
                {
                    this.ForceLevel = reader.ReadInt32();
                }
                if ((double)num1 >= 1.20000004768372)
                {
                    this.I9.DefaultIOLevel = reader.ReadInt32();
                    if (this.I9.DefaultIOLevel > 49)
                    {
                        this.I9.DefaultIOLevel = 49;
                    }
                    this.I9.DisplayIOLevels        = reader.ReadBoolean();
                    this.I9.CalculateEnahncementFX = reader.ReadBoolean();
                    this.I9.CalculateSetBonusFX    = reader.ReadBoolean();
                    this.I9.ExportIOLevels         = reader.ReadBoolean();
                    this.I9.PrintIOLevels          = reader.ReadBoolean();
                    this.I9.ExportCompress         = reader.ReadBoolean();
                    this.I9.ExportDataChunk        = reader.ReadBoolean();
                    this.I9.ExportStripEnh         = reader.ReadBoolean();
                    this.I9.ExportStripSetNames    = reader.ReadBoolean();
                    this.I9.ExportExtraSep         = reader.ReadBoolean();
                    this.PrintInColour             = reader.ReadBoolean();
                    this._printScheme = reader.ReadInt32();
                }
                if ((double)num1 >= 1.21000003814697)
                {
                    this.RtFont.PairedBase             = reader.ReadSingle();
                    this.RtFont.PairedBold             = reader.ReadBoolean();
                    this.RtFont.RTFBase                = reader.ReadInt32();
                    this.RtFont.RTFBold                = reader.ReadBoolean();
                    this.RtFont.ColorBackgroundHero    = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorBackgroundVillain = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorEnhancement       = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorFaded             = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorInvention         = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorInventionInv      = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorText              = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorWarning           = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorPlName            = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorPlSpecial         = ConfigData.ReadRGB(reader);
                }
                if ((double)num1 >= 1.22000002861023)
                {
                    this.ShowSlotLevels             = reader.ReadBoolean();
                    this.LoadLastFileOnStart        = reader.ReadBoolean();
                    this.LastFileName               = reader.ReadString();
                    this.RtFont.ColorPowerAvailable = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorPowerTaken     = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorPowerTakenDark = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorPowerDisabled  = ConfigData.ReadRGB(reader);
                    this.RtFont.ColorPowerHighlight = ConfigData.ReadRGB(reader);
                }
                if ((double)num1 >= 1.23000001907349)
                {
                    this.Tips = new Tips(reader);
                    this.DefaultSaveFolderOverride = reader.ReadString();
                }
                if ((double)num1 >= 1.24000000953674)
                {
                    this.EnhanceVisibility = reader.ReadBoolean();
                    reader.ReadBoolean();
                    this.BuildMode   = (Enums.dmModes)reader.ReadInt32();
                    this.BuildOption = (Enums.dmItem)reader.ReadInt32();
                    this.UpdatePath  = reader.ReadString();
                    if (string.IsNullOrEmpty(this.UpdatePath))
                    {
                        this.UpdatePath = "";
                    }
                }
                if ((double)num1 >= 1.25)
                {
                    this.ShowEnhRel     = reader.ReadBoolean();
                    this.ShowRelSymbols = reader.ReadBoolean();
                    this.ShowPopup      = reader.ReadBoolean();
                    if ((double)num1 >= 1.32000005245209)
                    {
                        this.ShowAlphaPopup = reader.ReadBoolean();
                    }
                    this.PopupRecipes = reader.ReadBoolean();
                    this.ShoppingListIncludesRecipes = reader.ReadBoolean();
                    this.PrintProfile         = (ConfigData.PrintOptionProfile)reader.ReadInt32();
                    this.PrintHistory         = reader.ReadBoolean();
                    this.LastPrinter          = reader.ReadString();
                    this.PrintProfileEnh      = reader.ReadBoolean();
                    this.DesaturateInherent   = reader.ReadBoolean();
                    this.ReapeatOnMiddleClick = reader.ReadBoolean();
                }
                if ((double)num1 >= 1.25999999046326)
                {
                    this.ExportHex = reader.ReadBoolean();
                }
                if ((double)num1 >= 1.26999998092651)
                {
                    this.SpeedFormat = (Enums.eSpeedMeasure)reader.ReadInt32();
                }
                if ((double)num1 >= 1.27999997138977)
                {
                    this.SaveFolderChecked = reader.ReadBoolean();
                }
                if ((double)num1 >= 1.28999996185303)
                {
                    this.UseArcanaTime = reader.ReadBoolean(); //this is correct
                }

                /*Commented out to expidite release.... Will not load forum Export settings  or supression settings
                 * if ((double)num1 >= 1.29999995231628)
                 * {  // numbers seem really off which is screwing up the rest of the read
                 *  tempNum = reader.ReadInt16();
                 *  this.Suppression = (Enums.eSuppress)tempNum;
                 * }
                 * if ((double)num1 >= 1.30999994277954)
                 * {
                 *  for (int index = 0; index < 19; ++index) {
                 *      this.DragDropScenarioAction[index] = reader.ReadInt16();
                 * }
                 * }//589825 or 2305
                 * tempNum = reader.ReadInt16();
                 * this.Export.ColorSchemes = new ExportConfig.ColorScheme[(int)tempNum];
                 * for (int index = 0; index < this.Export.ColorSchemes.Length; ++index)
                 * { //crashes at index 14
                 *  this.Export.ColorSchemes[index].SchemeName = reader.ReadString();
                 *  this.Export.ColorSchemes[index].Heading = ConfigData.ReadRGB(reader);
                 *  this.Export.ColorSchemes[index].Level = ConfigData.ReadRGB(reader);
                 *  this.Export.ColorSchemes[index].Slots = ConfigData.ReadRGB(reader);
                 *  this.Export.ColorSchemes[index].Title = ConfigData.ReadRGB(reader);
                 *  if ((double)num1 >= 1.20000004768372)
                 *  {
                 *      this.Export.ColorSchemes[index].IOColor = ConfigData.ReadRGB(reader);
                 *      this.Export.ColorSchemes[index].SetColor = ConfigData.ReadRGB(reader);
                 *      this.Export.ColorSchemes[index].HOColor = ConfigData.ReadRGB(reader);
                 *      this.Export.ColorSchemes[index].Power = ConfigData.ReadRGB(reader);
                 *  }
                 * }
                 * this.Export.FormatCode = new ExportConfig.FormatCodes[reader.ReadInt32() + 1];
                 * for (int index = 0; index < this.Export.FormatCode.Length; ++index)
                 * {
                 *  this.Export.FormatCode[index].Name = reader.ReadString();
                 *  this.Export.FormatCode[index].Notes = reader.ReadString();
                 *  this.Export.FormatCode[index].BoldOff = reader.ReadString();
                 *  this.Export.FormatCode[index].BoldOn = reader.ReadString();
                 *  this.Export.FormatCode[index].ColourOff = reader.ReadString();
                 *  this.Export.FormatCode[index].ColourOn = reader.ReadString();
                 *  this.Export.FormatCode[index].ItalicOff = reader.ReadString();
                 *  this.Export.FormatCode[index].ItalicOn = reader.ReadString();
                 *  this.Export.FormatCode[index].SizeOff = reader.ReadString();
                 *  this.Export.FormatCode[index].SizeOn = reader.ReadString();
                 *  this.Export.FormatCode[index].UnderlineOff = reader.ReadString();
                 *  this.Export.FormatCode[index].UnderlineOn = reader.ReadString();
                 *  this.Export.FormatCode[index].Space = (ExportConfig.WhiteSpace)reader.ReadInt32();
                 * } */
                this.CreateDefaultSaveFolder();
            }
        }
    }