public I9Slot() { this.Enh = -1; this.RelativeLevel = Enums.eEnhRelative.Even; this.Grade = Enums.eEnhGrade.None; this.IOLevel = 1; }
public static Origin.Grade ToGfxGrade(Enums.eType iType, Enums.eEnhGrade iGrade) { switch (iType) { case Enums.eType.None: return(Origin.Grade.None); case Enums.eType.Normal: switch (iGrade) { case Enums.eEnhGrade.None: return(Origin.Grade.None); case Enums.eEnhGrade.TrainingO: return(Origin.Grade.TrainingO); case Enums.eEnhGrade.DualO: return(Origin.Grade.DualO); case Enums.eEnhGrade.SingleO: return(Origin.Grade.SingleO); } break; case Enums.eType.InventO: return(Origin.Grade.IO); case Enums.eType.SpecialO: return(Origin.Grade.HO); case Enums.eType.SetO: return(Origin.Grade.SetO); } return(Origin.Grade.None); }
public I9Slot() { Enh = -1; RelativeLevel = Enums.eEnhRelative.Even; Grade = Enums.eEnhGrade.None; IOLevel = 1; }
float GetScheduleMult(Enums.eType iType, Enums.eSchedule iSched) { if (this.Grade < Enums.eEnhGrade.None) { this.Grade = Enums.eEnhGrade.None; } if (this.RelativeLevel < Enums.eEnhRelative.None) { this.RelativeLevel = Enums.eEnhRelative.None; } if (this.Grade > Enums.eEnhGrade.SingleO) { this.Grade = Enums.eEnhGrade.SingleO; } if (this.RelativeLevel > Enums.eEnhRelative.PlusFive) { this.RelativeLevel = Enums.eEnhRelative.PlusFive; } float num1 = 0.0f; if (this.IOLevel <= 0) { this.IOLevel = 0; } if (this.IOLevel > DatabaseAPI.Database.MultIO.Length - 1) { this.IOLevel = DatabaseAPI.Database.MultIO.Length - 1; } if (iSched == Enums.eSchedule.None || iSched == Enums.eSchedule.Multiple) { num1 = 0.0f; } else { switch (iType) { case Enums.eType.Normal: switch (this.Grade) { case Enums.eEnhGrade.None: num1 = 0.0f; break; case Enums.eEnhGrade.TrainingO: num1 = DatabaseAPI.Database.MultTO[0][(int)iSched]; break; case Enums.eEnhGrade.DualO: num1 = DatabaseAPI.Database.MultDO[0][(int)iSched]; break; case Enums.eEnhGrade.SingleO: num1 = DatabaseAPI.Database.MultSO[0][(int)iSched]; break; } break; case Enums.eType.InventO: num1 = DatabaseAPI.Database.MultIO[this.IOLevel][(int)iSched]; break; case Enums.eType.SpecialO: num1 = DatabaseAPI.Database.MultSO[0][(int)iSched]; break; case Enums.eType.SetO: num1 = DatabaseAPI.Database.MultIO[this.IOLevel][(int)iSched]; break; } } float num2 = num1 * this.GetRelativeLevelMultiplier(); if (this.Enh > -1 && DatabaseAPI.Database.Enhancements[this.Enh].Superior) { num2 *= 1.25f; } return(num2); }
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(); } } }
private float GetScheduleMult(Enums.eType iType, Enums.eSchedule iSched) { if (Grade < Enums.eEnhGrade.None) { Grade = Enums.eEnhGrade.None; } if (RelativeLevel < Enums.eEnhRelative.None) { RelativeLevel = Enums.eEnhRelative.None; } if (Grade > Enums.eEnhGrade.SingleO) { Grade = Enums.eEnhGrade.SingleO; } if (RelativeLevel > Enums.eEnhRelative.PlusFive) { RelativeLevel = Enums.eEnhRelative.PlusFive; } var num1 = 0.0f; if (IOLevel <= 0) { IOLevel = 0; } if (IOLevel > DatabaseAPI.Database.MultIO.Length - 1) { IOLevel = DatabaseAPI.Database.MultIO.Length - 1; } if (iSched == Enums.eSchedule.None || iSched == Enums.eSchedule.Multiple) { num1 = 0.0f; } else { switch (iType) { case Enums.eType.Normal: num1 = Grade switch { Enums.eEnhGrade.None => 0.0f, Enums.eEnhGrade.TrainingO => DatabaseAPI.Database.MultTO[0][(int)iSched], Enums.eEnhGrade.DualO => DatabaseAPI.Database.MultDO[0][(int)iSched], Enums.eEnhGrade.SingleO => DatabaseAPI.Database.MultSO[0][(int)iSched], _ => num1 }; break; case Enums.eType.InventO: num1 = DatabaseAPI.Database.MultIO[IOLevel][(int)iSched]; break; case Enums.eType.SpecialO: num1 = DatabaseAPI.Database.MultSO[0][(int)iSched]; break; case Enums.eType.SetO: num1 = DatabaseAPI.Database.MultIO[IOLevel][(int)iSched]; break; } } var num2 = num1 * GetRelativeLevelMultiplier(); if (Enh > -1 && DatabaseAPI.Database.Enhancements[Enh].Superior) { num2 *= 1.25f; } return(num2); }