public CalculatorResults(StatsResults stats, FeedResults feed) : this(stats) { Feed = feed; }
private FeedResults GetFeedResults(int targetArmorMaxLevel, int startLevel, int targetLevel, int baseFeedCost, bool isSameElement, int craftCost, int materialCount, int craftTime, int armorsmithCount, int armorsmithLevel) { FeedResults results = new FeedResults(); int feedCost = (isSameElement) ? (int)(baseFeedCost * 1.25) : baseFeedCost; int totalFeedCost = LevelTable.Instance.GetTotalFeedCost(targetArmorMaxLevel, startLevel, targetLevel); if (feedCost <= 0 || totalFeedCost <= 0) return results; int feedCount = (int)Math.Ceiling(totalFeedCost / (decimal)feedCost); results.FeedCount = feedCount; // special case: non-craftable rare/super rare int craftCount = feedCount; if (baseFeedCost == 40 && craftCost == 0) { craftCost = Armor.GetCraftCostFromFeedCost(5); craftTime = Armor.GetCraftTimeFromFeedCost(5); materialCount = Armor.GetMaterialCountFromFeedCost(5); craftCount = feedCount * 2; results.FusionCount = feedCount; results.FusionCost = feedCount * 25000; } results.CraftCost = craftCost * craftCount; results.MaterialCount = materialCount * craftCount; results.CraftTime = GetCraftTime(craftTime, craftCount, armorsmithCount, armorsmithLevel); int currentLevel = startLevel; int cumulativeJump = LevelTable.Instance.GetExperienceFromLevel(targetArmorMaxLevel, startLevel); while (feedCount > 0) { Level level = LevelTable.Instance.GetLevel(currentLevel); if (level == null) break; int count = (feedCount > 4) ? 4 : feedCount; results.FeedCost += level.Gold * count; cumulativeJump += feedCost * count; currentLevel = LevelTable.Instance.GetLevelFromExperience(targetArmorMaxLevel, cumulativeJump); feedCount -= count; } return results; }
public CalculatorResults(FeedResults feed) : this() { Feed = feed; }