public void Calculate(ClassJobCategory classJobCategory) { mpRegen = (int)Math.Floor((attribute.pie - main) * 150.0d / div) + 200; var speedFactor = classJobCategory.IsHealer || classJobCategory.IsIntDps ? attribute.sps : attribute.sks; var rawGcd = (int)Math.Floor((2000 - (int)Math.Floor((speedFactor - sub) * 130.0d / div + 1000.0d)) * 2500.0d / 1000.0d); gcd = (int)Math.Floor(rawGcd / 10.0d) / 100.0d; var glRawGcd = (int)Math.Floor(rawGcd * (100 - 20) / 100.0d); glGcd = (int)Math.Floor(glRawGcd / 10.0d) / 100.0d; var hutonRawGcd = (int)Math.Floor(rawGcd * (100 - 15) / 100.0d); hutonGcd = (int)Math.Floor(hutonRawGcd / 10.0d) / 100.0d; var shifuRawGcd = (int)Math.Floor(rawGcd * (100 - 13) / 100.0d); shifuGcd = (int)Math.Floor(shifuRawGcd / 10.0d) / 100.0d; ch = (int)Math.Floor((attribute.ch - sub) * 200.0d / div + 50.0d) / 10.0d; dh = (int)Math.Floor((attribute.dh - sub) * 550.0d / div) / 10.0d; ten = (int)Math.Floor((attribute.ten - sub) * 100.0d / div) / 10.0d; }
public Table(string title, string description, ClassJobCategory classJobCategory, params GearSet[] gearSets) { this.title = title; this.description = description; this.gearSets = gearSets; columnDefinitions = GetColumnDefinitions(classJobCategory); statDefinitions = GetStatDefinitions(classJobCategory); var mainAttribute = GetMainAttribute(classJobCategory); for (var i = 0; i < gearSets.Length; i++) { var gearSet = gearSets[i]; if (gearSet.attribute == null) { gearSet.attribute = new Attribute(); gearSet.attribute.Add(mainAttribute); var totalAttribute = gearSet.GetTotalAttribute(); gearSet.attribute.Add(totalAttribute); gearSet.attribute.ApplyFood(gearSet.meal.mealAttribute); } if (gearSet.title.Contains("절 바하무트") || gearSet.title.Contains("절 알테마")) { gearSet.Calculate70(classJobCategory); } else { gearSet.Calculate(classJobCategory); } } }
public ItemViewModel(int key, ExcelSheet <Item> sheet, Lumina lumina) : base(key, sheet, lumina) { this.classJob = this.Value.ClassJobCategory.Value; LuminaExtensions.GetModel(this.Value.ModelMain, this.IsWeapon, out this.modelSet, out this.modelBase, out this.modelVariant); LuminaExtensions.GetModel(this.Value.ModelSub, this.IsWeapon, out this.subModelSet, out this.subModelBase, out this.subModelVariant); }
public static bool HasClass(this ClassJobCategory cjc, uint classJobRowId) { return(classJobRowId switch { 0 => cjc.ADV, 1 => cjc.GLA, 2 => cjc.PGL, 3 => cjc.MRD, 4 => cjc.LNC, 5 => cjc.ARC, 6 => cjc.CNJ, 7 => cjc.THM, 8 => cjc.CRP, 9 => cjc.BSM, 10 => cjc.ARM, 11 => cjc.GSM, 12 => cjc.LTW, 13 => cjc.WVR, 14 => cjc.ALC, 15 => cjc.CUL, 16 => cjc.MIN, 17 => cjc.BTN, 18 => cjc.FSH, 19 => cjc.PLD, 20 => cjc.MNK, 21 => cjc.WAR, 22 => cjc.DRG, 23 => cjc.BRD, 24 => cjc.WHM, 25 => cjc.BLM, 26 => cjc.ACN, 27 => cjc.SMN, 28 => cjc.SCH, 29 => cjc.ROG, 30 => cjc.NIN, 31 => cjc.MCH, 32 => cjc.DRK, 33 => cjc.AST, 34 => cjc.SAM, 35 => cjc.RDM, 36 => cjc.BLU, 37 => cjc.GNB, 38 => cjc.DNC, 39 => cjc.RPR, 40 => cjc.SGE, _ => false });
public static bool Contains(this ClassJobCategory self, Classes classJob) { string abr = classJob.GetAbbreviation(); FieldInfo?field = self.GetType().GetField(abr, BindingFlags.Public | BindingFlags.Instance); if (field == null) { throw new Exception($"Unable to find ClassJob: {abr}"); } object?val = field.GetValue(self); if (val == null) { throw new Exception($"Unable to find ClassJob Value: {abr}"); } return((bool)val); }
public static Classes ToFlags(this ClassJobCategory self) { Classes classes = Classes.None; foreach (Classes?job in Enum.GetValues(typeof(Classes))) { if (job == null || job == Classes.None || job == Classes.All) { continue; } if (self.Contains((Classes)job)) { classes |= (Classes)job; } } return(classes); }
public void CalculateFlatDps(long potency, long trait, long mainModifier, ClassJobCategory classJobCategory) { var mainAttribute = 0; if (classJobCategory.IsTank || classJobCategory.IsStrDps) { mainAttribute = attribute.str; } else if (classJobCategory.IsHealer) { mainAttribute = attribute.mnd; } else if (classJobCategory.IsDexDps) { mainAttribute = attribute.dex; } else if (classJobCategory.IsIntDps) { mainAttribute = attribute.@int; } var fDet = (int)Math.Floor((attribute.det - main) * 130.0d / div + 1000.0d); var fWd = (int)Math.Floor(main * mainModifier / 1000.0d + attribute.wd); var fCrit = (int)Math.Floor((attribute.ch - sub) * 200.0d / div + 1400.0d); var fAttack = (int)Math.Floor((mainAttribute - 340) * 165.0d / 340.0d) + 100; var d1 = (int)Math.Floor(Math.Floor(potency * fAttack * fDet / 100.0d) / 1000.0d); var d2 = (int)Math.Floor(Math.Floor(d1 * fWd / 100.0d) * (trait + 100) / 100.0d); var d3chdh = (int)Math.Floor(Math.Floor(d2 * fCrit / 1000.0d) * 125.0d / 100.0d); var d3ch = (int)Math.Floor(d2 * fCrit / 1000.0d); var d3dh = (int)Math.Floor(d2 * 125.0d / 100.0d); var chdhChance = ch / 100.0d * dh / 100.0d; var chChance = ch / 100.0d - chdhChance; var dhChance = dh / 100.0d - chdhChance; var noneChance = 1 - chdhChance - chChance - dhChance; var damage = d3chdh * chdhChance + d3ch * chChance + d3dh * dhChance + d2 * noneChance; dps = (int)Math.Floor(damage / gcd * 100.0d) / 100.0d; }
public ColumnDefinition[] GetColumnDefinitions(ClassJobCategory classJobCategory) { if (classJobCategory.IsTank) { return new[]