public static SchemaConstants.Rarity Evolve( SchemaConstants.Rarity rarity, int num_times) { Debug.Assert(num_times <= 2); return(rarity + (byte)num_times); }
public static SchemaConstants.Rarity EvolveAsMuchAsPossible(SchemaConstants.Rarity base_rarity, SchemaConstants.Rarity cur_rarity, int max_times) { int times_already_upgraded = (int)cur_rarity - (int)base_rarity; int new_total_upgrades = Math.Min(times_already_upgraded + max_times, 2); return(Evolve(base_rarity, new_total_upgrades)); }
public static SchemaConstants.Rarity Evolve(SchemaConstants.Rarity rarity, int num_times) { System.Diagnostics.Debug.Assert(num_times <= 2); int new_rarity = (int)rarity + num_times; return((SchemaConstants.Rarity)new_rarity); }
public static byte MaxLevel(SchemaConstants.Rarity rarity) { if (rarity == SchemaConstants.Rarity.One) { return(3); } return((byte)(5 * ((int)rarity - 1))); }
public static short ComputeStatForLevel( SchemaConstants.Rarity base_rarity, short?base_stat, short?max_stat, byte target_level) { return(StatCalculator.ComputeStatForLevel2(base_stat.GetValueOrDefault((short)0), (byte)1, max_stat.GetValueOrDefault((short)0), StatCalculator.MaxLevel(StatCalculator.Evolve(base_rarity, SchemaConstants.EvolutionLevel.PlusPlus)), target_level)); }
public static short ComputeStatForLevel(SchemaConstants.Rarity base_rarity, short?base_stat, short?max_stat, byte target_level) { short bv = base_stat.GetValueOrDefault(0); short mv = max_stat.GetValueOrDefault(0); byte fully_upgraded_max_level = MaxLevel(Evolve(base_rarity, SchemaConstants.EvolutionLevel.PlusPlus)); return(ComputeStatForLevel2(bv, 1, mv, fully_upgraded_max_level, target_level)); }
public static SchemaConstants.Rarity EvolveAsMuchAsPossible( SchemaConstants.Rarity base_rarity, SchemaConstants.Rarity cur_rarity, int max_times) { int num_times = Math.Min((int)(cur_rarity - base_rarity) + max_times, 2); return(StatCalculator.Evolve(base_rarity, num_times)); }
public static EquipStats ComputeStatsForLevel(SchemaConstants.Rarity base_rarity, EquipStats base_stats, EquipStats max_stats, byte target_level) { return(new EquipStats { Acc = ComputeStatForLevel(base_rarity, base_stats.Acc, max_stats.Acc, target_level), Atk = ComputeStatForLevel(base_rarity, base_stats.Atk, max_stats.Atk, target_level), Def = ComputeStatForLevel(base_rarity, base_stats.Def, max_stats.Def, target_level), Res = ComputeStatForLevel(base_rarity, base_stats.Res, max_stats.Res, target_level), Eva = ComputeStatForLevel(base_rarity, base_stats.Eva, max_stats.Eva, target_level), Mag = ComputeStatForLevel(base_rarity, base_stats.Mag, max_stats.Mag, target_level), Mnd = ComputeStatForLevel(base_rarity, base_stats.Mnd, max_stats.Mnd, target_level) }); }
public static EquipStats ComputeStatsForLevel( SchemaConstants.Rarity base_rarity, EquipStats base_stats, EquipStats max_stats, byte target_level) { return(new EquipStats() { Acc = new short?(StatCalculator.ComputeStatForLevel(base_rarity, base_stats.Acc, max_stats.Acc, target_level)), Atk = new short?(StatCalculator.ComputeStatForLevel(base_rarity, base_stats.Atk, max_stats.Atk, target_level)), Def = new short?(StatCalculator.ComputeStatForLevel(base_rarity, base_stats.Def, max_stats.Def, target_level)), Res = new short?(StatCalculator.ComputeStatForLevel(base_rarity, base_stats.Res, max_stats.Res, target_level)), Eva = new short?(StatCalculator.ComputeStatForLevel(base_rarity, base_stats.Eva, max_stats.Eva, target_level)), Mag = new short?(StatCalculator.ComputeStatForLevel(base_rarity, base_stats.Mag, max_stats.Mag, target_level)), Mnd = new short?(StatCalculator.ComputeStatForLevel(base_rarity, base_stats.Mnd, max_stats.Mnd, target_level)) }); }
public static SchemaConstants.Rarity Evolve(SchemaConstants.Rarity rarity, SchemaConstants.EvolutionLevel evo) { return(Evolve(rarity, (int)evo)); }
public static byte MaxLevel(SchemaConstants.Rarity rarity) => rarity == SchemaConstants.Rarity.One ? (byte)3 : (byte)(5U * (uint)(rarity - (byte)1));